AT32F415 Firmwary Library: Introduction

AT32F415 Firmwary Library 2.0.2
AT32F415 Peripherals Driver Library
Introduction

The AT32F415 Firmware Library is a firmware package which contains the device drivers for all of the peripherals for AT32F415.

This library provides a set of examples for each peripheral and some application such as the IAP and sLib utilities.

The mamual is structured as follows:

  • AT32F415_periph_driver : device drivers
  • AT32F415_periph_examples : examples for AT32F415
  • AT32F415_periph_template : AT32F415 project template for Keil and IAR IDE tools
  • AT32F415_board : AT-START-F415 board setting functions
  • AT32F415_middlewares_i2c_application_library : middlewares for I2C application
  • AT32F415_middlewares_usbd_class : middlewares for different USB device class
  • AT32F415_middlewares_usbh_class : middlewares for different USB host class
  • AT32F415_middlewares_usbd_drivers : middlewares for USB device core driver
  • UTILITIES_examples : some applications such as FreeRTOS, sLib and IAP.
Generated by doxygen 1.9.2


AT32F415 Firmwary Library: Modules

Modules
Here is a list of all modules:
[detail level 123]
► CMSIS |
► AT32F415 |
Library_configuration_section |
Configuration_section_for_CMSIS |
Exported_types |
Exported_macro |
Peripheral_memory_map |
► AT32F415_system |
AT32F415_system_clock_stable_definition |
AT32F415_system_exported_variables |
AT32F415_system_exported_functions |
AT32F415_system_private_defines |
AT32F415_system_private_variables |
AT32F415_system_private_functions |
► AT32F415_periph_driver |
► ADC | ADC driver modules
ADC_interrupts_definition | Adc interrupt
ADC_flags_definition | Adc flag
ADC_exported_types |
ADC_exported_functions |
ADC_private_functions |
► CAN | CAN driver modules
CAN_timeout_count |
CAN_flags_definition | Can flag
CAN_interrupts_definition | Can interrupt
CAN_exported_types |
CAN_exported_functions |
CAN_private_functions |
► CMP | CMP driver modules
CMP_exported_types |
CMP_exported_functions |
CMP_private_functions |
► CRC | CRC driver modules
CRC_exported_types |
CRC_exported_functions |
CRC_private_functions |
► CRM | CRM driver modules
CRM_flags_definition | Crm flag
CRM_interrupts_definition | Crm interrupt
CRM_exported_types |
CRM_exported_functions |
CRM_private_functions |
► DEBUG | DEBUG driver modules
DEBUG_mode_definition |
DEBUG_exported_types |
DEBUG_exported_functions |
DEBUG_private_functions |
► DMA | DMA driver modules
DMA_interrupts_definition | Dma interrupt
DMA_flexible_channel |
DMA_flags_definition | Dma flag
DMA_exported_types |
DMA_exported_functions |
DMA_private_functions |
► ERTC | ERTC driver modules
ERTC_interrupts_definition | Ertc interrupt
ERTC_flags_definition | Ertc flag
ERTC_exported_types |
ERTC_exported_functions |
ERTC_private_functions |
► EXINT | EXINT driver modules
EXINT_lines |
EXINT_exported_types |
EXINT_exported_functions |
EXINT_private_functions |
► FLASH | FLASH driver modules
FLASH_keys | Flash keys
FLASH_flags | Flash flag
FLASH_interrupts | Flash interrupts
FLASH_slib_mask | Flash slib mask
FLASH_user_system_data | Flash user system data
FLASH_timeout_definition | Flash timeout definition
FLASH_exported_types |
FLASH_exported_functions |
FLASH_private_functions |
► GPIO | GPIO driver modules
GPIO_pins_number_definition |
IOMUX_map_definition | Iomux map definitions
IOMUX_map2_definition | Iomux map2 definitions
IOMUX_map3_definition | Iomux map3 definitions
IOMUX_map4_definition | Iomux map4 definitions
IOMUX_map5_definition | Iomux map5 definitions
IOMUX_map6_definition | Iomux map6 definitions
IOMUX_map7_definition | Iomux map7 definitions
IOMUX_map8_definition | Iomux map8 definitions
GPIO_exported_types |
GPIO_exported_functions |
GPIO_private_functions |
► I2C | I2C driver modules
I2C_sts1_flags_definition | I2c sts1 flag
I2C_sts2_flags_definition | I2c sts2 flag
I2C_interrupts_definition | I2c interrupt
I2C_exported_types |
I2C_exported_functions |
I2C_private_functions |
► MISC | MISC driver modules
MISC_vector_table_base_address |
MISC_exported_types |
MISC_exported_functions |
MISC_private_functions |
► PWC | PWC driver modules
PWC_flags_definition | Pwc flag
PWC_exported_types |
PWC_exported_functions |
PWC_private_functions |
► SDIO | SDIO driver modules
SDIO_interrupts_definition | Sdio interrupt
SDIO_flags_definition | Sdio flag
SDIO_exported_types |
SDIO_exported_functions |
SDIO_private_functions |
► SPI | SPI driver modules
SPI_I2S_flags_definition | Spi i2s flag
SPI_I2S_interrupts_definition | Spi i2s interrupt
SPI_exported_types |
SPI_exported_functions |
SPI_private_functions |
► TMR | TMR driver modules
TMR_flags_definition | Tmr flag
TMR_interrupt_select_type_definition | Tmr interrupt select type
TMR_exported_types |
TMR_exported_functions |
TMR_private_functions |
► USART | USART driver modules
USART_flags_definition | Usart flag
USART_interrupts_definition | Usart interrupt
USART_exported_types |
USART_exported_functions |
USART_private_functions |
► USB | USB driver modules
USB_global_interrupts_definition | Usb global interrupt mask
USB_global_interrupt_flags_definition | Usb global interrupt flag
USB_global_setting_definition | Usb global setting
USB_host_config_definition |
USB_device_config_definition |
USB_exported_enum_types |
USB_exported_types |
USB_exported_functions |
USB_private_functions |
► WDT | WDT driver modules
WDT_flags_definition | Wdt flag
WDT_exported_types |
WDT_exported_functions |
WDT_private_functions |
► WWDT | WWDT driver modules
WWDT_enable_bit_definition | Wwdt enable bit
WWDT_exported_types |
WWDT_exported_functions |
WWDT_private_functions |
► AT32F415_middlewares_i2c_application_library |
I2C_library_event_check_flag |
I2C_library_transmission_mode |
I2C_library_status_code |
I2C_library_handler |
I2C_library_exported_functions |
► AT32F415_middlewares_usb_drivers |
► USB_drivers_core | Usb global drivers core
USB_core_exported_types |
USB_core_private_functions |
► USB_standard |
USB_standard_define |
► AT32F415_middlewares_usbd_drivers |
► USBD_drivers_core | Usb device drivers core
USBD_core_exported_types |
USBD_core_private_functions |
► USBD_drivers_interrupt | Usb device interrupt
USBD_int_private_functions |
► USBD_drivers_standard_request | Usb device standard_request
USBD_sdr_exported_functions |
USBD_sdr_private_functions |
► USBD_drivers_int |
USBD_interrupt_exported_types |
► AT32F415_middlewares_usbh_drivers |
► USBH_drivers_core | Usb host drivers core
USBH_core_exported_types |
USBH_core_private_functions |
► USBH_drivers_control | Usb host drivers control
USBH_ctrl_exported_types |
USBH_ctrl_private_functions |
► USBH_drivers_interrupt | Usb host interrupt
USBH_int_private_functions |
► USBH_drivers_int |
USBH_interrupt_exported_types |
► AT32F415_middlewares_usbd_class |
► USB_audio_class | Usb device class audio demo
USB_audio_class_private_functions |
USB_audio_class_definition |
USB_device_audio_config_definition |
► USB_audio_desc | Usb device audio descriptor
USB_audio_desc_private_functions |
USB_audio_desc_definition |
► USB_audio_hid_class | Usb device class audio hid demo
USB_device_audio_hid_config_definition |
USB_audio_hid_class_private_functions |
USB_audio_hid_class_definition |
► USB_audio_hid_desc | Usb device audio hid descriptor
USB_audio_hid_desc_private_functions |
USB_audio_hid_desc_definition |
► USB_cdc_class | Usb device class cdc demo
USB_cdc_class_private_functions |
USB_cdc_class_definition |
USB_cdc_class_exported_types |
USB_cdc_class_exported_functions |
► USB_cdc_desc | Usb device cdc descriptor
USB_cdc_desc_private_functions |
USB_cdc_desc_definition |
► USB_cdc_keyboard_class | Usb device class composite cdc and keyboard
USB_cdc_keyboard_class_private_functions |
USB_cdc_keyboard_class_definition |
USB_cdc_class_exported_types |
USB_cdc_keyboar_class_exported_functions |
► USB_cdc_keyboard_desc | Usb device cdc keyboard descriptor
USB_cdc_keyboard_desc_private_functions |
USB_cdc_keyboard_desc_definition |
► USB_custom_hid_class | Usb device custom hid demo
USB_custom_hid_class_private_functions |
USB_custom_hid_class_endpoint_definition |
USB_custom_hid_class_request_code_definition |
USB_custom_hid_class_exported_functions |
► USB_custom_hid_desc | Usb device custom_hid descriptor
USB_custom_hid_desc_private_functions |
USB_custom_hid_desc_definition |
► USB_hid_iap_class | Usb device class hid iap demo
USB_hid_iap_class_private_functions |
USB_hid_iap_class_definition |
► USB_hid_iap_desc | Usb device hid_iap descriptor
USB_hid_iap_desc_private_functions |
USB_hid_iap_desc_definition |
► USB_keyboard_class | Usb device keyboard demo
USB_keyboard_class_private_functions |
USB_keyboard_class_endpoint_definition |
USB_hid_class_request_code_definition |
USB_hid_class_exported_functions |
► USB_keyboard_desc | Usb device keyboard descriptor
USB_keyboard_desc_private_functions |
USB_keyboard_desc_definition |
► USB_mouse_class | Usb device mouse demo
USB_mouse_class_private_functions |
USB_mouse_class_endpoint_definition |
USB_mouse_class_request_code_definition |
USB_hid_class_exported_functions |
► USB_mouse_desc | Usb device mouse descriptor
USB_mouse_desc_private_functions |
USB_mouse_desc_definition |
► USB_msc_bot_scsi | Usb device class mass storage demo
USB_msc_bot_functions |
USB_msc_bot_scsi_definition |
► USB_msc_class | Usb device class msc demo
USB_msc_class_private_functions |
USB_msc_class_definition |
► USB_msc_desc | Usb device msc descriptor
USB_msc_desc_private_functions |
USB_msc_desc_definition |
► USB_printer_class | Usb device class printer demo
USB_printer_class_private_functions |
USB_printer_class_definition |
► USB_printer_desc | Usb device printer descriptor
USB_printer_desc_private_functions |
USB_printer_desc_definition |
► AT32F415_middlewares_usbh_class |
► USBH_hid_class | Usb host class hid demo
USBH_hid_class_private_functions |
USBH_hid_class_definition |
► USBH_hid_class_keyboard | Usb host class hid keyboard
USBH_hid_class_keyboard_private_functions |
USBH_hid_class_keyboard_definition |
► USBH_hid_class_mouse | Usb host class hid mouse
USBH_hid_class_mouse_private_functions |
USBH_hid_class_mouse_definition |
► USBH_msc_bot_scsi_class | Usb host class msc bot scsi
USBH_msc_bot_scsi_class_private_functions |
USBH_msc_bot_scsi_class_definition |
► USBH_msc_class | Usb host class msc demo
USBH_msc_class_private_functions |
USBH_msc_class_definition |
► AT32F415_board |
► BOARD | Onboard periph driver
BOARD_pins_definition |
BOARD_exported_functions |
► AT32F415_periph_examples |
ADC_current_vref_value_check |
ADC_exint_trigger_partitioned |
ADC_internal_temperature_sensor |
ADC_software_trigger_repeat |
ADC_tmr_trigger_automatic_preempted |
ADC_voltage_monitoring |
CAN_communication_mode |
CAN_filter |
CAN_loopback_mode |
CMP_deep_sleep_mode |
CMP_output |
CORTEX_m4_bit_band |
CORTEX_m4_systick_interrupt |
CRC_calculation |
CRM_clock_failure_detection |
CRM_sysclk_switch |
DEBUG_tmr |
DMA_data_to_gpio_flexible |
DMA_flash_to_sram |
ERTC_bpr_domain |
ERTC_calendar |
ERTC_lick_calibration |
ERTC_tamper |
ERTC_time_stamp |
ERTC_wakeup_timer |
EXINT_config |
EXINT_software_trigger |
► FLASH_write_read |
FLASH_write_read_functions |
GPIO_led_toggle |
GPIO_swjtag_remap |
I2C_communication_dma |
I2C_communication_int |
I2C_communication_poll |
I2C_eeprom |
I2S_halfduplex_dma |
I2S_halfduplex_interrupt |
I2S_spii2s_switch_halfduplex_polling |
PWC_deepsleep_ertc_alarm |
PWC_deepsleep_ertc_tamper |
PWC_power_voltage_monitor |
PWC_sleep_tmr2 |
PWC_sleep_usart1 |
PWC_standby_ertc_alarm |
PWC_standby_wakeup_pin |
► SDIO_sd_mmc_card |
SDIO_sd_mmc_card_instance_definition |
SDIO_sd_mmc_card_exported_types |
SDIO_sd_mmc_card_command_index_definition |
SDIO_sd_mmc_card_paremeters_definition |
SDIO_sd_mmc_card_response_definition |
SDIO_sd_mmc_card_command_class_definition |
SDIO_sd_mmc_card_cmd8_definition |
SDIO_sd_mmc_card_mmc_extend_definition |
SDIO_sd_mmc_card_interrupt_flags_definition |
SDIO_sd_mmc_card_exported_functions |
► SDIO_sdio_fatfs |
SDIO_sdio_fatfs_instance_definition |
SDIO_sdio_fatfs_exported_types |
SDIO_sdio_fatfs_command_index_definition |
SDIO_sdio_fatfs_paremeters_definition |
SDIO_sdio_fatfs_response_definition |
SDIO_sdio_fatfs_command_class_definition |
SDIO_sdio_fatfs_cmd8_definition |
SDIO_sdio_fatfs_mmc_extend_definition |
SDIO_sdio_fatfs_interrupt_flags_definition |
SDIO_sdio_fatfs_exported_functions |
SPI_crc_transfer_polling |
SPI_fullduplex_polling |
SPI_halfduplex_interrupt |
SPI_halfduplex_transceiver_switch |
SPI_only_receive_mode_polling |
SPI_use_jtagpin_hardwarecs_dma |
► SPI_w25q_flash |
SPI_flash_cs_pin_definition |
SPI_flash_id_definition |
SPI_flash_operation_definition |
SPI_flash_exported_functions |
TMR_6_steps |
TMR_7_pwm_output |
TMR_cascade_synchro |
TMR_complementary_signals |
TMR_dma |
TMR_dma_burst |
TMR_encoder_tmr2 |
TMR_external_clock |
TMR_hall_xor_tmr2 |
TMR_hang_mode |
TMR_input_capture |
TMR_oc_high |
TMR_oc_low |
TMR_oc_toggle_tmr3 |
TMR_oc_toggle_tmr9 |
TMR_one_cycle |
TMR_parallel_synchro |
TMR_pwm_input |
TMR_pwm_input_dma |
TMR_pwm_output_simulate |
TMR_pwm_output_tmr10 |
TMR_pwm_output_tmr3 |
TMR_timer_base |
TMR_tmr1_synchro |
TMR_tmr2_32bit |
USART_half_duplex |
USART_hw_flow_control |
USART_idle_detection |
USART_interrupt |
USART_irda |
USART_polling |
USART_printf |
USART_receiver_mute |
USART_smartcard |
USART_synchronous |
USART_transfer_by_dma_interrupt |
USART_transfer_by_dma_polling |
► USB_device_audio |
USB_device_audio_codec_reg_definition |
USB_device_audio_codec_pin_definition |
USB_device_audio_codec_exported_functions |
► USB_device_audio_hid |
USB_device_audio_hid_codec_reg_definition |
USB_device_audio_hid_codec_pin_definition |
USB_device_audio_hid_codec_exported_functions |
USB_device_composite_vcp_keyboard |
USB_device_custom_hid |
USB_device_keyboard |
USB_device_mouse |
USB_device_msc |
USB_device_printer |
USB_device_vcp_loopback |
► USB_device_virtual_msc_iap |
USB_device_virtual_msc_iap_definition |
USB_host_hid |
USB_host_msc |
WDT_reset |
WWDT_reset |
_USB_device_hid_app_led3 |
_USB_device_hid_app_led4 |
_USB_device_hid_iap |
► AT32F415_periph_template |
Library_configuration |
System_clock_configuration |
LED_toggle |
► UTILITIES_examples |
AP_read_write_boot_memory |
► AP_run_in_boot_memory |
RUN_in_boot_memory_demo_exported_functions |
FreeRTOS_demo |
► GEN_random_number_demo |
ERTC_asseed_definition |
GEN_random_number_demo_exported_functions |
SLIB_project_l0 |
SLIB_project_l1 |
► USART_IAP_app_led3_toggle |
App_led3_definition |
App_led3_exported_functions |
► USART_IAP_app_led4_toggle |
App_led4_definition |
App_led4_exported_functions |
► USART_IAP_bootloader |
Bootloader_definition |
Bootloader_exported_functions |
Bootloader_exported_types |
► USB_IAP_app_led3_toggle |
App_led3_toggle_definition |
App_led3_toggle_exported_functions |
► USB_IAP_app_led4_toggle |
App_led4_toggle_definition |
App_led4_toggle_exported_functions |
► USB_IAP_bootloader |
Bootloader_definition |
Bootloader_exported_functions |


AT32F415 Firmwary Library: CMSIS

Modules
CMSIS

Modules

AT32F415
AT32F415_system

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: AT32F415

Modules
AT32F415
CMSIS

Modules

Library_configuration_section
Configuration_section_for_CMSIS
Exported_types
Exported_macro
Peripheral_memory_map

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: Library_configuration_section

Macros
Library_configuration_section
CMSIS » AT32F415

Macros

#define | __AT32F415_LIBRARY_VERSION_MAJOR (0x02)
at32f415 standard peripheral library version number More...
#define | __AT32F415_LIBRARY_VERSION_MIDDLE (0x00)
#define | __AT32F415_LIBRARY_VERSION_MINOR (0x02)
#define | __AT32F415_LIBRARY_VERSION_RC (0x00)
#define | __AT32F415_LIBRARY_VERSION

Detailed Description

Macro Definition Documentation

◆ __AT32F415_LIBRARY_VERSION

#define __AT32F415_LIBRARY_VERSION
Value:
((__AT32F415_LIBRARY_VERSION_MAJOR << 24) | \
(__AT32F415_LIBRARY_VERSION_MIDDLE << 16) | \
(__AT32F415_LIBRARY_VERSION_MINOR << 8) | \
(__AT32F415_LIBRARY_VERSION_RC))
__AT32F415_LIBRARY_VERSION_MAJOR
#define __AT32F415_LIBRARY_VERSION_MAJOR
at32f415 standard peripheral library version number
Definition: at32f415.h:90
__AT32F415_LIBRARY_VERSION_RC
#define __AT32F415_LIBRARY_VERSION_RC
Definition: at32f415.h:93
__AT32F415_LIBRARY_VERSION_MIDDLE
#define __AT32F415_LIBRARY_VERSION_MIDDLE
Definition: at32f415.h:91
__AT32F415_LIBRARY_VERSION_MINOR
#define __AT32F415_LIBRARY_VERSION_MINOR
Definition: at32f415.h:92

Definition at line 94 of file at32f415.h.

◆ __AT32F415_LIBRARY_VERSION_MAJOR

#define __AT32F415_LIBRARY_VERSION_MAJOR (0x02)

at32f415 standard peripheral library version number

tip: to avoid modifying this file each time you need to switch between these devices, you can define the device in your toolchain compiler preprocessor. [31:24] major version

Definition at line 90 of file at32f415.h.

◆ __AT32F415_LIBRARY_VERSION_MIDDLE

#define __AT32F415_LIBRARY_VERSION_MIDDLE (0x00)

[23:16] middle version

Definition at line 91 of file at32f415.h.

◆ __AT32F415_LIBRARY_VERSION_MINOR

#define __AT32F415_LIBRARY_VERSION_MINOR (0x02)

[15:8] minor version

Definition at line 92 of file at32f415.h.

◆ __AT32F415_LIBRARY_VERSION_RC

#define __AT32F415_LIBRARY_VERSION_RC (0x00)

[7:0] release candidate

Definition at line 93 of file at32f415.h.


AT32F415 Firmwary Library: Configuration_section_for_CMSIS

Macros | Typedefs | Enumerations
Configuration_section_for_CMSIS
CMSIS » AT32F415

Macros

#define | __CM4_REV 0x0001U
configuration of the cortex-m4 processor and core peripherals More...
#define | __MPU_PRESENT 1
#define | __NVIC_PRIO_BITS 4
#define | __Vendor_SysTickConfig 0
#define | __FPU_PRESENT 0U

Typedefs

typedef enum IRQn IRQn_Type
at32f415 interrupt number definition, according to the selected device in Library_configuration_section More...

Enumerations

enum IRQn {
Reset_IRQn = -15 , NonMaskableInt_IRQn = -14 , HardFault_IRQn = -13 , MemoryManagement_IRQn = -12 ,
BusFault_IRQn = -11 , UsageFault_IRQn = -10 , SVCall_IRQn = -5 , DebugMonitor_IRQn = -4 ,
PendSV_IRQn = -2 , SysTick_IRQn = -1 , WWDT_IRQn = 0 , PVM_IRQn = 1 ,
TAMP_STAMP_IRQn = 2 , ERTC_WKUP_IRQn = 3 , FLASH_IRQn = 4 , CRM_IRQn = 5 ,
EXINT0_IRQn = 6 , EXINT1_IRQn = 7 , EXINT2_IRQn = 8 , EXINT3_IRQn = 9 ,
EXINT4_IRQn = 10 , DMA1_Channel1_IRQn = 11 , DMA1_Channel2_IRQn = 12 , DMA1_Channel3_IRQn = 13 ,
DMA1_Channel4_IRQn = 14 , DMA1_Channel5_IRQn = 15 , DMA1_Channel6_IRQn = 16 , DMA1_Channel7_IRQn = 17 ,
ADC1_IRQn = 18 , CAN1_TX_IRQn = 19 , CAN1_RX0_IRQn = 20 , CAN1_RX1_IRQn = 21 ,
CAN1_SE_IRQn = 22 , EXINT9_5_IRQn = 23 , TMR1_BRK_TMR9_IRQn = 24 , TMR1_OVF_TMR10_IRQn = 25 ,
TMR1_TRG_HALL_TMR11_IRQn = 26 , TMR1_CH_IRQn = 27 , TMR2_GLOBAL_IRQn = 28 , TMR3_GLOBAL_IRQn = 29 ,
TMR4_GLOBAL_IRQn = 30 , I2C1_EVT_IRQn = 31 , I2C1_ERR_IRQn = 32 , I2C2_EVT_IRQn = 33 ,
I2C2_ERR_IRQn = 34 , SPI1_IRQn = 35 , SPI2_IRQn = 36 , USART1_IRQn = 37 ,
USART2_IRQn = 38 , USART3_IRQn = 39 , EXINT15_10_IRQn = 40 , ERTCAlarm_IRQn = 41 ,
OTGFS1_WKUP_IRQn = 42 , SDIO1_IRQn = 49 , TMR5_GLOBAL_IRQn = 50 , UART4_IRQn = 52 ,
UART5_IRQn = 53 , DMA2_Channel1_IRQn = 56 , DMA2_Channel2_IRQn = 57 , DMA2_Channel3_IRQn = 58 ,
DMA2_Channel4_5_IRQn = 59 , OTGFS1_IRQn = 67 , CMP1_IRQn = 70 , CMP2_IRQn = 71 ,
DMA2_Channel6_7_IRQn = 75
}
at32f415 interrupt number definition, according to the selected device in Library_configuration_section More...

Detailed Description

Macro Definition Documentation

◆ __CM4_REV

#define __CM4_REV 0x0001U

configuration of the cortex-m4 processor and core peripherals

core revision r0p1

Definition at line 110 of file at32f415.h.

◆ __FPU_PRESENT

#define __FPU_PRESENT 0U

fpu present

Definition at line 114 of file at32f415.h.

◆ __MPU_PRESENT

#define __MPU_PRESENT 1

mpu present

Definition at line 111 of file at32f415.h.

◆ __NVIC_PRIO_BITS

#define __NVIC_PRIO_BITS 4

at32 uses 4 bits for the priority levels

Definition at line 112 of file at32f415.h.

◆ __Vendor_SysTickConfig

#define __Vendor_SysTickConfig 0

set to 1 if different systick config is used

Definition at line 113 of file at32f415.h.

Typedef Documentation

◆ IRQn_Type

typedef enum IRQn IRQn_Type

at32f415 interrupt number definition, according to the selected device in Library_configuration_section

Enumeration Type Documentation

◆ IRQn

enum IRQn

at32f415 interrupt number definition, according to the selected device in Library_configuration_section

Enumerator
Reset_IRQn | 1 reset vector, invoked on power up and warm reset
NonMaskableInt_IRQn | 2 non maskable interrupt
HardFault_IRQn | 3 hard fault, all classes of fault
MemoryManagement_IRQn | 4 cortex-m4 memory management interrupt
BusFault_IRQn | 5 cortex-m4 bus fault interrupt
UsageFault_IRQn | 6 cortex-m4 usage fault interrupt
SVCall_IRQn | 11 cortex-m4 sv call interrupt
DebugMonitor_IRQn | 12 cortex-m4 debug monitor interrupt
PendSV_IRQn | 14 cortex-m4 pend sv interrupt
SysTick_IRQn | 15 cortex-m4 system tick interrupt
WWDT_IRQn | window watchdog timer interrupt
PVM_IRQn | pvm through exint line detection interrupt
TAMP_STAMP_IRQn | tamper and timestamp interrupts through the exint line
ERTC_WKUP_IRQn | ertc wakeup through the exint line
FLASH_IRQn | flash global interrupt
CRM_IRQn | crm global interrupt
EXINT0_IRQn | external line0 interrupt
EXINT1_IRQn | external line1 interrupt
EXINT2_IRQn | external line2 interrupt
EXINT3_IRQn | external line3 interrupt
EXINT4_IRQn | external line4 interrupt
DMA1_Channel1_IRQn | dma1 channel 1 global interrupt
DMA1_Channel2_IRQn | dma1 channel 2 global interrupt
DMA1_Channel3_IRQn | dma1 channel 3 global interrupt
DMA1_Channel4_IRQn | dma1 channel 4 global interrupt
DMA1_Channel5_IRQn | dma1 channel 5 global interrupt
DMA1_Channel6_IRQn | dma1 channel 6 global interrupt
DMA1_Channel7_IRQn | dma1 channel 7 global interrupt
ADC1_IRQn | adc1 global interrupt
CAN1_TX_IRQn | can1 tx interrupts
CAN1_RX0_IRQn | can1 rx0 interrupts
CAN1_RX1_IRQn | can1 rx1 interrupt
CAN1_SE_IRQn | can1 se interrupt
EXINT9_5_IRQn | external line[9:5] interrupts
TMR1_BRK_TMR9_IRQn | tmr1 brake interrupt
TMR1_OVF_TMR10_IRQn | tmr1 overflow interrupt
TMR1_TRG_HALL_TMR11_IRQn | tmr1 trigger and hall interrupt
TMR1_CH_IRQn | tmr1 channel interrupt
TMR2_GLOBAL_IRQn | tmr2 global interrupt
TMR3_GLOBAL_IRQn | tmr3 global interrupt
TMR4_GLOBAL_IRQn | tmr4 global interrupt
I2C1_EVT_IRQn | i2c1 event interrupt
I2C1_ERR_IRQn | i2c1 error interrupt
I2C2_EVT_IRQn | i2c2 event interrupt
I2C2_ERR_IRQn | i2c2 error interrupt
SPI1_IRQn | spi1 global interrupt
SPI2_IRQn | spi2 global interrupt
USART1_IRQn | usart1 global interrupt
USART2_IRQn | usart2 global interrupt
USART3_IRQn | usart3 global interrupt
EXINT15_10_IRQn | external line[15:10] interrupts
ERTCAlarm_IRQn | ertc alarm through exint line interrupt
OTGFS1_WKUP_IRQn | otgfs1 wakeup from suspend through exint line interrupt
SDIO1_IRQn | sdio1 global interrupt
TMR5_GLOBAL_IRQn | tmr5 global interrupt
UART4_IRQn | uart4 global interrupt
UART5_IRQn | uart5 global interrupt
DMA2_Channel1_IRQn | dma2 channel 1 global interrupt
DMA2_Channel2_IRQn | dma2 channel 2 global interrupt
DMA2_Channel3_IRQn | dma2 channel 3 global interrupt
DMA2_Channel4_5_IRQn | dma2 channel 4 and channel 5 global interrupt
OTGFS1_IRQn | otgfs1 global interrupt
CMP1_IRQn | comparator1 global interrupt
CMP2_IRQn | comparator2 global interrupt
DMA2_Channel6_7_IRQn | dma2 channel 6 and channel 7 global interrupt

Definition at line 120 of file at32f415.h.


AT32F415 Firmwary Library: Exported_types

Typedefs | Enumerations
Exported_types
CMSIS » AT32F415

Typedefs

typedef int32_t | INT32
typedef int16_t | INT16
typedef int8_t | INT8
typedef uint32_t | UINT32
typedef uint16_t | UINT16
typedef uint8_t | UINT8
typedef int32_t | s32
typedef int16_t | s16
typedef int8_t | s8
typedef const int32_t | sc32
typedef const int16_t | sc16
typedef const int8_t | sc8
typedef __IO int32_t | vs32
typedef __IO int16_t | vs16
typedef __IO int8_t | vs8
typedef __I int32_t | vsc32
typedef __I int16_t | vsc16
typedef __I int8_t | vsc8
typedef uint32_t | u32
typedef uint16_t | u16
typedef uint8_t | u8
typedef const uint32_t | uc32
typedef const uint16_t | uc16
typedef const uint8_t | uc8
typedef __IO uint32_t | vu32
typedef __IO uint16_t | vu16
typedef __IO uint8_t | vu8
typedef __I uint32_t | vuc32
typedef __I uint16_t | vuc16
typedef __I uint8_t | vuc8

Enumerations

enum | flag_status { RESET = 0 , SET = !RESET }
flag status More...
enum | confirm_state { FALSE = 0 , TRUE = !FALSE }
confirm state More...
enum | error_status { ERROR = 0 , SUCCESS = !ERROR }
error status More...

Detailed Description

Typedef Documentation

◆ INT16

typedef int16_t INT16

Definition at line 207 of file at32f415.h.

◆ INT32

typedef int32_t INT32

Definition at line 206 of file at32f415.h.

◆ INT8

typedef int8_t INT8

Definition at line 208 of file at32f415.h.

◆ s16

typedef int16_t s16

Definition at line 214 of file at32f415.h.

◆ s32

typedef int32_t s32

Definition at line 213 of file at32f415.h.

◆ s8

typedef int8_t s8

Definition at line 215 of file at32f415.h.

◆ sc16

typedef const int16_t sc16

read only

Definition at line 218 of file at32f415.h.

◆ sc32

typedef const int32_t sc32

read only

Definition at line 217 of file at32f415.h.

◆ sc8

typedef const int8_t sc8

read only

Definition at line 219 of file at32f415.h.

◆ u16

typedef uint16_t u16

Definition at line 230 of file at32f415.h.

◆ u32

typedef uint32_t u32

Definition at line 229 of file at32f415.h.

◆ u8

typedef uint8_t u8

Definition at line 231 of file at32f415.h.

◆ uc16

typedef const uint16_t uc16

read only

Definition at line 234 of file at32f415.h.

◆ uc32

typedef const uint32_t uc32

read only

Definition at line 233 of file at32f415.h.

◆ uc8

typedef const uint8_t uc8

read only

Definition at line 235 of file at32f415.h.

◆ UINT16

typedef uint16_t UINT16

Definition at line 210 of file at32f415.h.

◆ UINT32

typedef uint32_t UINT32

Definition at line 209 of file at32f415.h.

◆ UINT8

typedef uint8_t UINT8

Definition at line 211 of file at32f415.h.

◆ vs16

typedef __IO int16_t vs16

Definition at line 222 of file at32f415.h.

◆ vs32

typedef __IO int32_t vs32

Definition at line 221 of file at32f415.h.

◆ vs8

typedef __IO int8_t vs8

Definition at line 223 of file at32f415.h.

◆ vsc16

typedef __I int16_t vsc16

read only

Definition at line 226 of file at32f415.h.

◆ vsc32

typedef __I int32_t vsc32

read only

Definition at line 225 of file at32f415.h.

◆ vsc8

typedef __I int8_t vsc8

read only

Definition at line 227 of file at32f415.h.

◆ vu16

typedef __IO uint16_t vu16

Definition at line 238 of file at32f415.h.

◆ vu32

typedef __IO uint32_t vu32

Definition at line 237 of file at32f415.h.

◆ vu8

typedef __IO uint8_t vu8

Definition at line 239 of file at32f415.h.

◆ vuc16

typedef __I uint16_t vuc16

read only

Definition at line 242 of file at32f415.h.

◆ vuc32

typedef __I uint32_t vuc32

read only

Definition at line 241 of file at32f415.h.

◆ vuc8

typedef __I uint8_t vuc8

read only

Definition at line 243 of file at32f415.h.

Enumeration Type Documentation

◆ confirm_state

enum confirm_state

confirm state

Enumerator
FALSE
TRUE

Definition at line 253 of file at32f415.h.

◆ error_status

enum error_status

error status

Enumerator
ERROR
SUCCESS

Definition at line 258 of file at32f415.h.

◆ flag_status

enum flag_status

flag status

Enumerator
RESET
SET

Definition at line 248 of file at32f415.h.


AT32F415 Firmwary Library: Exported_macro

Macros
Exported_macro
CMSIS » AT32F415

Macros

#define | REG8(addr) *(volatile uint8_t *)(addr)
#define | REG16(addr) *(volatile uint16_t *)(addr)
#define | REG32(addr) *(volatile uint32_t *)(addr)
#define | MAKE_VALUE(reg_offset, bit_num) (uint32_t)(((reg_offset) << 16) | (bit_num & 0x1F))
#define | PERIPH_REG(periph_base, value) REG32((periph_base + (value >> 16)))
#define | PERIPH_REG_BIT(value) (0x1U << (value & 0x1F))

Detailed Description

Macro Definition Documentation

◆ MAKE_VALUE

#define MAKE_VALUE | ( | reg_offset,
 |  | bit_num
 | ) | (uint32_t)(((reg_offset) << 16) | (bit_num & 0x1F))

Definition at line 272 of file at32f415.h.

◆ PERIPH_REG

#define PERIPH_REG | ( | periph_base,
 |  | value
 | ) | REG32((periph_base + (value >> 16)))

Definition at line 274 of file at32f415.h.

◆ PERIPH_REG_BIT

#define PERIPH_REG_BIT ( value ) (0x1U << (value & 0x1F))

Definition at line 275 of file at32f415.h.

◆ REG16

#define REG16 ( addr ) *(volatile uint16_t *)(addr)

Definition at line 269 of file at32f415.h.

◆ REG32

#define REG32 ( addr ) *(volatile uint32_t *)(addr)

Definition at line 270 of file at32f415.h.

◆ REG8

#define REG8 ( addr ) *(volatile uint8_t *)(addr)

Definition at line 268 of file at32f415.h.


AT32F415 Firmwary Library: Peripheral_memory_map

Macros
Peripheral_memory_map
CMSIS » AT32F415

Macros

#define | FLASH_BASE ((uint32_t)0x08000000)
#define | SPIM_FLASH_BASE ((uint32_t)0x08400000)
#define | USD_BASE ((uint32_t)0x1FFFF800)
#define | SRAM_BASE ((uint32_t)0x20000000)
#define | PERIPH_BASE ((uint32_t)0x40000000)
#define | DEBUG_BASE ((uint32_t)0xE0042000)
#define | APB1PERIPH_BASE (PERIPH_BASE + 0x00000)
#define | APB2PERIPH_BASE (PERIPH_BASE + 0x10000)
#define | AHBPERIPH_BASE (PERIPH_BASE + 0x20000)
#define | TMR2_BASE (APB1PERIPH_BASE + 0x0000)
#define | TMR3_BASE (APB1PERIPH_BASE + 0x0400)
#define | TMR4_BASE (APB1PERIPH_BASE + 0x0800)
#define | TMR5_BASE (APB1PERIPH_BASE + 0x0C00)
#define | CMP_BASE (APB1PERIPH_BASE + 0x2400)
#define | ERTC_BASE (APB1PERIPH_BASE + 0x2800)
#define | WWDT_BASE (APB1PERIPH_BASE + 0x2C00)
#define | WDT_BASE (APB1PERIPH_BASE + 0x3000)
#define | SPI2_BASE (APB1PERIPH_BASE + 0x3800)
#define | USART2_BASE (APB1PERIPH_BASE + 0x4400)
#define | USART3_BASE (APB1PERIPH_BASE + 0x4800)
#define | UART4_BASE (APB1PERIPH_BASE + 0x4C00)
#define | UART5_BASE (APB1PERIPH_BASE + 0x5000)
#define | I2C1_BASE (APB1PERIPH_BASE + 0x5400)
#define | I2C2_BASE (APB1PERIPH_BASE + 0x5800)
#define | CAN1_BASE (APB1PERIPH_BASE + 0x6400)
#define | PWC_BASE (APB1PERIPH_BASE + 0x7000)
#define | IOMUX_BASE (APB2PERIPH_BASE + 0x0000)
#define | EXINT_BASE (APB2PERIPH_BASE + 0x0400)
#define | GPIOA_BASE (APB2PERIPH_BASE + 0x0800)
#define | GPIOB_BASE (APB2PERIPH_BASE + 0x0C00)
#define | GPIOC_BASE (APB2PERIPH_BASE + 0x1000)
#define | GPIOD_BASE (APB2PERIPH_BASE + 0x1400)
#define | GPIOF_BASE (APB2PERIPH_BASE + 0x1C00)
#define | ADC1_BASE (APB2PERIPH_BASE + 0x2400)
#define | TMR1_BASE (APB2PERIPH_BASE + 0x2C00)
#define | SPI1_BASE (APB2PERIPH_BASE + 0x3000)
#define | USART1_BASE (APB2PERIPH_BASE + 0x3800)
#define | TMR9_BASE (APB2PERIPH_BASE + 0x4C00)
#define | TMR10_BASE (APB2PERIPH_BASE + 0x5000)
#define | TMR11_BASE (APB2PERIPH_BASE + 0x5400)
#define | SDIO1_BASE (APB2PERIPH_BASE + 0x8000)
#define | DMA1_BASE (AHBPERIPH_BASE + 0x0000)
#define | DMA1_CHANNEL1_BASE (AHBPERIPH_BASE + 0x0008)
#define | DMA1_CHANNEL2_BASE (AHBPERIPH_BASE + 0x001C)
#define | DMA1_CHANNEL3_BASE (AHBPERIPH_BASE + 0x0030)
#define | DMA1_CHANNEL4_BASE (AHBPERIPH_BASE + 0x0044)
#define | DMA1_CHANNEL5_BASE (AHBPERIPH_BASE + 0x0058)
#define | DMA1_CHANNEL6_BASE (AHBPERIPH_BASE + 0x006C)
#define | DMA1_CHANNEL7_BASE (AHBPERIPH_BASE + 0x0080)
#define | DMA2_BASE (AHBPERIPH_BASE + 0x0400)
#define | DMA2_CHANNEL1_BASE (AHBPERIPH_BASE + 0x0408)
#define | DMA2_CHANNEL2_BASE (AHBPERIPH_BASE + 0x041C)
#define | DMA2_CHANNEL3_BASE (AHBPERIPH_BASE + 0x0430)
#define | DMA2_CHANNEL4_BASE (AHBPERIPH_BASE + 0x0444)
#define | DMA2_CHANNEL5_BASE (AHBPERIPH_BASE + 0x0458)
#define | DMA2_CHANNEL6_BASE (AHBPERIPH_BASE + 0x046C)
#define | DMA2_CHANNEL7_BASE (AHBPERIPH_BASE + 0x0480)
#define | CRM_BASE (AHBPERIPH_BASE + 0x1000)
#define | FLASH_REG_BASE (AHBPERIPH_BASE + 0x2000)
#define | CRC_BASE (AHBPERIPH_BASE + 0x3000)
#define | OTGFS1_BASE (PERIPH_BASE + 0x10000000)

Detailed Description

Macro Definition Documentation

◆ ADC1_BASE

#define ADC1_BASE (APB2PERIPH_BASE + 0x2400)

Definition at line 322 of file at32f415.h.

◆ AHBPERIPH_BASE

#define AHBPERIPH_BASE (PERIPH_BASE + 0x20000)

Definition at line 294 of file at32f415.h.

◆ APB1PERIPH_BASE

#define APB1PERIPH_BASE (PERIPH_BASE + 0x00000)

Definition at line 292 of file at32f415.h.

◆ APB2PERIPH_BASE

#define APB2PERIPH_BASE (PERIPH_BASE + 0x10000)

Definition at line 293 of file at32f415.h.

◆ CAN1_BASE

#define CAN1_BASE (APB1PERIPH_BASE + 0x6400)

Definition at line 312 of file at32f415.h.

◆ CMP_BASE

#define CMP_BASE (APB1PERIPH_BASE + 0x2400)

Definition at line 301 of file at32f415.h.

◆ CRC_BASE

#define CRC_BASE (AHBPERIPH_BASE + 0x3000)

Definition at line 349 of file at32f415.h.

◆ CRM_BASE

#define CRM_BASE (AHBPERIPH_BASE + 0x1000)

Definition at line 347 of file at32f415.h.

◆ DEBUG_BASE

#define DEBUG_BASE ((uint32_t)0xE0042000)

Definition at line 290 of file at32f415.h.

◆ DMA1_BASE

#define DMA1_BASE (AHBPERIPH_BASE + 0x0000)

Definition at line 331 of file at32f415.h.

◆ DMA1_CHANNEL1_BASE

#define DMA1_CHANNEL1_BASE (AHBPERIPH_BASE + 0x0008)

Definition at line 332 of file at32f415.h.

◆ DMA1_CHANNEL2_BASE

#define DMA1_CHANNEL2_BASE (AHBPERIPH_BASE + 0x001C)

Definition at line 333 of file at32f415.h.

◆ DMA1_CHANNEL3_BASE

#define DMA1_CHANNEL3_BASE (AHBPERIPH_BASE + 0x0030)

Definition at line 334 of file at32f415.h.

◆ DMA1_CHANNEL4_BASE

#define DMA1_CHANNEL4_BASE (AHBPERIPH_BASE + 0x0044)

Definition at line 335 of file at32f415.h.

◆ DMA1_CHANNEL5_BASE

#define DMA1_CHANNEL5_BASE (AHBPERIPH_BASE + 0x0058)

Definition at line 336 of file at32f415.h.

◆ DMA1_CHANNEL6_BASE

#define DMA1_CHANNEL6_BASE (AHBPERIPH_BASE + 0x006C)

Definition at line 337 of file at32f415.h.

◆ DMA1_CHANNEL7_BASE

#define DMA1_CHANNEL7_BASE (AHBPERIPH_BASE + 0x0080)

Definition at line 338 of file at32f415.h.

◆ DMA2_BASE

#define DMA2_BASE (AHBPERIPH_BASE + 0x0400)

Definition at line 339 of file at32f415.h.

◆ DMA2_CHANNEL1_BASE

#define DMA2_CHANNEL1_BASE (AHBPERIPH_BASE + 0x0408)

Definition at line 340 of file at32f415.h.

◆ DMA2_CHANNEL2_BASE

#define DMA2_CHANNEL2_BASE (AHBPERIPH_BASE + 0x041C)

Definition at line 341 of file at32f415.h.

◆ DMA2_CHANNEL3_BASE

#define DMA2_CHANNEL3_BASE (AHBPERIPH_BASE + 0x0430)

Definition at line 342 of file at32f415.h.

◆ DMA2_CHANNEL4_BASE

#define DMA2_CHANNEL4_BASE (AHBPERIPH_BASE + 0x0444)

Definition at line 343 of file at32f415.h.

◆ DMA2_CHANNEL5_BASE

#define DMA2_CHANNEL5_BASE (AHBPERIPH_BASE + 0x0458)

Definition at line 344 of file at32f415.h.

◆ DMA2_CHANNEL6_BASE

#define DMA2_CHANNEL6_BASE (AHBPERIPH_BASE + 0x046C)

Definition at line 345 of file at32f415.h.

◆ DMA2_CHANNEL7_BASE

#define DMA2_CHANNEL7_BASE (AHBPERIPH_BASE + 0x0480)

Definition at line 346 of file at32f415.h.

◆ ERTC_BASE

#define ERTC_BASE (APB1PERIPH_BASE + 0x2800)

Definition at line 302 of file at32f415.h.

◆ EXINT_BASE

#define EXINT_BASE (APB2PERIPH_BASE + 0x0400)

Definition at line 316 of file at32f415.h.

◆ FLASH_BASE

#define FLASH_BASE ((uint32_t)0x08000000)

Definition at line 285 of file at32f415.h.

◆ FLASH_REG_BASE

#define FLASH_REG_BASE (AHBPERIPH_BASE + 0x2000)

Definition at line 348 of file at32f415.h.

◆ GPIOA_BASE

#define GPIOA_BASE (APB2PERIPH_BASE + 0x0800)

Definition at line 317 of file at32f415.h.

◆ GPIOB_BASE

#define GPIOB_BASE (APB2PERIPH_BASE + 0x0C00)

Definition at line 318 of file at32f415.h.

◆ GPIOC_BASE

#define GPIOC_BASE (APB2PERIPH_BASE + 0x1000)

Definition at line 319 of file at32f415.h.

◆ GPIOD_BASE

#define GPIOD_BASE (APB2PERIPH_BASE + 0x1400)

Definition at line 320 of file at32f415.h.

◆ GPIOF_BASE

#define GPIOF_BASE (APB2PERIPH_BASE + 0x1C00)

Definition at line 321 of file at32f415.h.

◆ I2C1_BASE

#define I2C1_BASE (APB1PERIPH_BASE + 0x5400)

Definition at line 310 of file at32f415.h.

◆ I2C2_BASE

#define I2C2_BASE (APB1PERIPH_BASE + 0x5800)

Definition at line 311 of file at32f415.h.

◆ IOMUX_BASE

#define IOMUX_BASE (APB2PERIPH_BASE + 0x0000)

Definition at line 315 of file at32f415.h.

◆ OTGFS1_BASE

#define OTGFS1_BASE (PERIPH_BASE + 0x10000000)

Definition at line 350 of file at32f415.h.

◆ PERIPH_BASE

#define PERIPH_BASE ((uint32_t)0x40000000)

Definition at line 289 of file at32f415.h.

◆ PWC_BASE

#define PWC_BASE (APB1PERIPH_BASE + 0x7000)

Definition at line 313 of file at32f415.h.

◆ SDIO1_BASE

#define SDIO1_BASE (APB2PERIPH_BASE + 0x8000)

Definition at line 329 of file at32f415.h.

◆ SPI1_BASE

#define SPI1_BASE (APB2PERIPH_BASE + 0x3000)

Definition at line 324 of file at32f415.h.

◆ SPI2_BASE

#define SPI2_BASE (APB1PERIPH_BASE + 0x3800)

Definition at line 305 of file at32f415.h.

◆ SPIM_FLASH_BASE

#define SPIM_FLASH_BASE ((uint32_t)0x08400000)

Definition at line 286 of file at32f415.h.

◆ SRAM_BASE

#define SRAM_BASE ((uint32_t)0x20000000)

Definition at line 288 of file at32f415.h.

◆ TMR10_BASE

#define TMR10_BASE (APB2PERIPH_BASE + 0x5000)

Definition at line 327 of file at32f415.h.

◆ TMR11_BASE

#define TMR11_BASE (APB2PERIPH_BASE + 0x5400)

Definition at line 328 of file at32f415.h.

◆ TMR1_BASE

#define TMR1_BASE (APB2PERIPH_BASE + 0x2C00)

Definition at line 323 of file at32f415.h.

◆ TMR2_BASE

#define TMR2_BASE (APB1PERIPH_BASE + 0x0000)

Definition at line 297 of file at32f415.h.

◆ TMR3_BASE

#define TMR3_BASE (APB1PERIPH_BASE + 0x0400)

Definition at line 298 of file at32f415.h.

◆ TMR4_BASE

#define TMR4_BASE (APB1PERIPH_BASE + 0x0800)

Definition at line 299 of file at32f415.h.

◆ TMR5_BASE

#define TMR5_BASE (APB1PERIPH_BASE + 0x0C00)

Definition at line 300 of file at32f415.h.

◆ TMR9_BASE

#define TMR9_BASE (APB2PERIPH_BASE + 0x4C00)

Definition at line 326 of file at32f415.h.

◆ UART4_BASE

#define UART4_BASE (APB1PERIPH_BASE + 0x4C00)

Definition at line 308 of file at32f415.h.

◆ UART5_BASE

#define UART5_BASE (APB1PERIPH_BASE + 0x5000)

Definition at line 309 of file at32f415.h.

◆ USART1_BASE

#define USART1_BASE (APB2PERIPH_BASE + 0x3800)

Definition at line 325 of file at32f415.h.

◆ USART2_BASE

#define USART2_BASE (APB1PERIPH_BASE + 0x4400)

Definition at line 306 of file at32f415.h.

◆ USART3_BASE

#define USART3_BASE (APB1PERIPH_BASE + 0x4800)

Definition at line 307 of file at32f415.h.

◆ USD_BASE

#define USD_BASE ((uint32_t)0x1FFFF800)

Definition at line 287 of file at32f415.h.

◆ WDT_BASE

#define WDT_BASE (APB1PERIPH_BASE + 0x3000)

Definition at line 304 of file at32f415.h.

◆ WWDT_BASE

#define WWDT_BASE (APB1PERIPH_BASE + 0x2C00)

Definition at line 303 of file at32f415.h.


AT32F415 Firmwary Library: AT32F415_system

Modules
AT32F415_system
CMSIS

Modules

AT32F415_system_clock_stable_definition
AT32F415_system_exported_variables
AT32F415_system_exported_functions
AT32F415_system_private_defines
AT32F415_system_private_variables
AT32F415_system_private_functions

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: AT32F415_system_clock_stable_definition

Macros
AT32F415_system_clock_stable_definition
CMSIS » AT32F415_system

Macros

#define | HEXT_STABLE_DELAY (5000u)
#define | PLL_STABLE_DELAY (500u)

Detailed Description

Macro Definition Documentation

◆ HEXT_STABLE_DELAY

#define HEXT_STABLE_DELAY (5000u)

Definition at line 46 of file system_at32f415.h.

◆ PLL_STABLE_DELAY

#define PLL_STABLE_DELAY (500u)

Definition at line 47 of file system_at32f415.h.


AT32F415 Firmwary Library: AT32F415_system_exported_variables

Variables
AT32F415_system_exported_variables
CMSIS » AT32F415_system

Variables

unsigned int system_core_clock

Detailed Description

Variable Documentation

◆ system_core_clock

unsigned int system_core_clock
extern

system clock frequency (core clock)

value of the high speed internal clock in hz system clock frequency (core clock)

Definition at line 48 of file system_at32f415.c.

Referenced by delay_init(), DMA1_Channel2_IRQHandler(), main(), mclk_tmr1_init(), sd_init(), sd_power_on(), system_core_clock_update(), TMR3_GLOBAL_IRQHandler(), and usb_clock48m_select().


AT32F415 Firmwary Library: AT32F415_system_exported_functions

Functions
AT32F415_system_exported_functions
CMSIS » AT32F415_system

Functions

void | SystemInit (void)
setup the microcontroller system initialize the flash interface. More...
void | system_core_clock_update (void)
update system_core_clock variable according to clock register values. the system_core_clock variable contains the core clock (hclk), it can be used by the user application to setup the systick timer or configure other parameters. More...

Detailed Description

Function Documentation

◆ system_core_clock_update()

void system_core_clock_update ( void )

update system_core_clock variable according to clock register values. the system_core_clock variable contains the core clock (hclk), it can be used by the user application to setup the systick timer or configure other parameters.

Parameters
none
Return values
none

< value of the high speed internal clock in hz

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed exernal crystal in hz

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed exernal crystal in hz

< value of the high speed internal clock in hz

Definition at line 110 of file system_at32f415.c.

Referenced by sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), and system_clock_config().

◆ SystemInit()

void SystemInit ( void )

setup the microcontroller system initialize the flash interface.

Note
this function should be used only after reset.
Parameters
none
Return values
none

< vector table base offset field. this value must be a multiple of 0x200.

Definition at line 64 of file system_at32f415.c.


AT32F415 Firmwary Library: AT32F415_system_private_defines

Macros
AT32F415_system_private_defines
CMSIS » AT32F415_system

Macros

#define VECT_TAB_OFFSET 0x0

Detailed Description

Macro Definition Documentation

◆ VECT_TAB_OFFSET

#define VECT_TAB_OFFSET 0x0

vector table base offset field. this value must be a multiple of 0x200.

Definition at line 40 of file system_at32f415.c.


AT32F415 Firmwary Library: AT32F415_system_private_variables

Variables
AT32F415_system_private_variables
CMSIS » AT32F415_system

Variables

unsigned int system_core_clock = ((uint32_t)8000000)

Detailed Description

Variable Documentation

◆ system_core_clock

unsigned int system_core_clock = ((uint32_t)8000000)

value of the high speed internal clock in hz system clock frequency (core clock)

Definition at line 48 of file system_at32f415.c.

Referenced by delay_init(), DMA1_Channel2_IRQHandler(), main(), mclk_tmr1_init(), sd_init(), sd_power_on(), system_core_clock_update(), TMR3_GLOBAL_IRQHandler(), and usb_clock48m_select().


AT32F415 Firmwary Library: AT32F415_system_private_functions

Functions
AT32F415_system_private_functions
CMSIS » AT32F415_system

Functions

void | SystemInit (void)
setup the microcontroller system initialize the flash interface. More...
void | system_core_clock_update (void)
update system_core_clock variable according to clock register values. the system_core_clock variable contains the core clock (hclk), it can be used by the user application to setup the systick timer or configure other parameters. More...

Detailed Description

Function Documentation

◆ system_core_clock_update()

void system_core_clock_update ( void )

update system_core_clock variable according to clock register values. the system_core_clock variable contains the core clock (hclk), it can be used by the user application to setup the systick timer or configure other parameters.

Parameters
none
Return values
none

< value of the high speed internal clock in hz

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed exernal crystal in hz

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed exernal crystal in hz

< value of the high speed internal clock in hz

Definition at line 110 of file system_at32f415.c.

Referenced by sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), and system_clock_config().

◆ SystemInit()

void SystemInit ( void )

setup the microcontroller system initialize the flash interface.

Note
this function should be used only after reset.
Parameters
none
Return values
none

< vector table base offset field. this value must be a multiple of 0x200.

Definition at line 64 of file system_at32f415.c.


AT32F415 Firmwary Library: AT32F415_periph_driver

Modules
AT32F415_periph_driver

Modules

ADC
ADC driver modules.
CAN
CAN driver modules.
CMP
CMP driver modules.
CRC
CRC driver modules.
CRM
CRM driver modules.
DEBUG
DEBUG driver modules.
DMA
DMA driver modules.
ERTC
ERTC driver modules.
EXINT
EXINT driver modules.
FLASH
FLASH driver modules.
GPIO
GPIO driver modules.
I2C
I2C driver modules.
MISC
MISC driver modules.
PWC
PWC driver modules.
SDIO
SDIO driver modules.
SPI
SPI driver modules.
TMR
TMR driver modules.
USART
USART driver modules.
USB
USB driver modules.
WDT
WDT driver modules.
WWDT
WWDT driver modules.

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: ADC

Modules | Macros
ADC
AT32F415_periph_driver

ADC driver modules. More...

Modules

ADC_interrupts_definition
adc interrupt

ADC_flags_definition
adc flag

ADC_exported_types
ADC_exported_functions
ADC_private_functions

Macros

#define ADC1 ((adc_type *) ADC1_BASE)

Detailed Description

ADC driver modules.

Macro Definition Documentation

◆ ADC1

#define ADC1 ((adc_type *) ADC1_BASE)

Definition at line 555 of file at32f415_adc.h.


AT32F415 Firmwary Library: ADC_interrupts_definition

Macros
ADC_interrupts_definition
AT32F415_periph_driver » ADC

adc interrupt
More...

Macros

#define | ADC_CCE_INT ((uint32_t)0x00000020)
#define | ADC_VMOR_INT ((uint32_t)0x00000040)
#define | ADC_PCCE_INT ((uint32_t)0x00000080)

Detailed Description

adc interrupt

Macro Definition Documentation

◆ ADC_CCE_INT

#define ADC_CCE_INT ((uint32_t)0x00000020)

channels conversion end interrupt

Definition at line 52 of file at32f415_adc.h.

◆ ADC_PCCE_INT

#define ADC_PCCE_INT ((uint32_t)0x00000080)

preempt channels conversion end interrupt

Definition at line 54 of file at32f415_adc.h.

◆ ADC_VMOR_INT

#define ADC_VMOR_INT ((uint32_t)0x00000040)

voltage monitoring out of range interrupt

Definition at line 53 of file at32f415_adc.h.


AT32F415 Firmwary Library: ADC_flags_definition

Macros
ADC_flags_definition
AT32F415_periph_driver » ADC

adc flag
More...

Macros

#define | ADC_VMOR_FLAG ((uint8_t)0x01)
#define | ADC_CCE_FLAG ((uint8_t)0x02)
#define | ADC_PCCE_FLAG ((uint8_t)0x04)
#define | ADC_PCCS_FLAG ((uint8_t)0x08)
#define | ADC_OCCS_FLAG ((uint8_t)0x10)

Detailed Description

adc flag

Macro Definition Documentation

◆ ADC_CCE_FLAG

#define ADC_CCE_FLAG ((uint8_t)0x02)

channels conversion end flag

Definition at line 66 of file at32f415_adc.h.

◆ ADC_OCCS_FLAG

#define ADC_OCCS_FLAG ((uint8_t)0x10)

ordinary channel conversion start flag

Definition at line 69 of file at32f415_adc.h.

◆ ADC_PCCE_FLAG

#define ADC_PCCE_FLAG ((uint8_t)0x04)

preempt channels conversion end flag

Definition at line 67 of file at32f415_adc.h.

◆ ADC_PCCS_FLAG

#define ADC_PCCS_FLAG ((uint8_t)0x08)

preempt channel conversion start flag

Definition at line 68 of file at32f415_adc.h.

◆ ADC_VMOR_FLAG

#define ADC_VMOR_FLAG ((uint8_t)0x01)

voltage monitoring out of range flag

Definition at line 65 of file at32f415_adc.h.


AT32F415 Firmwary Library: ADC_exported_types

Data Structures | Enumerations
ADC_exported_types
AT32F415_periph_driver » ADC

Data Structures

struct | adc_base_config_type
adc base config type More...
struct | adc_type
type define adc register all More...

Enumerations

enum adc_combine_mode_type {
ADC_INDEPENDENT_MODE = 0x00 , ADC_ORDINARY_SMLT_PREEMPT_SMLT_MODE = 0x01 , ADC_ORDINARY_SMLT_PREEMPT_INTERLTRIG_MODE = 0x02 , ADC_ORDINARY_SHORTSHIFT_PREEMPT_SMLT_MODE = 0x03 ,
ADC_ORDINARY_LONGSHIFT_PREEMPT_SMLT_MODE = 0x04 , ADC_PREEMPT_SMLT_ONLY_MODE = 0x05 , ADC_ORDINARY_SMLT_ONLY_MODE = 0x06 , ADC_ORDINARY_SHORTSHIFT_ONLY_MODE = 0x07 ,
ADC_ORDINARY_LONGSHIFT_ONLY_MODE = 0x08 , ADC_PREEMPT_INTERLTRIG_ONLY_MODE = 0x09
}
adc combine mode type More...
enum | adc_data_align_type { ADC_RIGHT_ALIGNMENT = 0x00 , ADC_LEFT_ALIGNMENT = 0x01 }
adc data align type More...
enum adc_channel_select_type {
ADC_CHANNEL_0 = 0x00 , ADC_CHANNEL_1 = 0x01 , ADC_CHANNEL_2 = 0x02 , ADC_CHANNEL_3 = 0x03 ,
ADC_CHANNEL_4 = 0x04 , ADC_CHANNEL_5 = 0x05 , ADC_CHANNEL_6 = 0x06 , ADC_CHANNEL_7 = 0x07 ,
ADC_CHANNEL_8 = 0x08 , ADC_CHANNEL_9 = 0x09 , ADC_CHANNEL_10 = 0x0A , ADC_CHANNEL_11 = 0x0B ,
ADC_CHANNEL_12 = 0x0C , ADC_CHANNEL_13 = 0x0D , ADC_CHANNEL_14 = 0x0E , ADC_CHANNEL_15 = 0x0F ,
ADC_CHANNEL_16 = 0x10 , ADC_CHANNEL_17 = 0x11
}
adc channel select type More...
enum adc_sampletime_select_type {
ADC_SAMPLETIME_1_5 = 0x00 , ADC_SAMPLETIME_7_5 = 0x01 , ADC_SAMPLETIME_13_5 = 0x02 , ADC_SAMPLETIME_28_5 = 0x03 ,
ADC_SAMPLETIME_41_5 = 0x04 , ADC_SAMPLETIME_55_5 = 0x05 , ADC_SAMPLETIME_71_5 = 0x06 , ADC_SAMPLETIME_239_5 = 0x07
}
adc sampletime select type More...
enum adc_ordinary_trig_select_type {
ADC12_ORDINARY_TRIG_TMR1CH1 = 0x00 , ADC12_ORDINARY_TRIG_TMR1CH2 = 0x01 , ADC12_ORDINARY_TRIG_TMR1CH3 = 0x02 , ADC12_ORDINARY_TRIG_TMR2CH2 = 0x03 ,
ADC12_ORDINARY_TRIG_TMR3TRGOUT = 0x04 , ADC12_ORDINARY_TRIG_TMR4CH4 = 0x05 , ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT = 0x06 , ADC12_ORDINARY_TRIG_SOFTWARE = 0x07 ,
ADC12_ORDINARY_TRIG_TMR1TRGOUT = 0x0D
}
adc ordinary group trigger event select type More...
enum adc_preempt_trig_select_type {
ADC12_PREEMPT_TRIG_TMR1TRGOUT = 0x00 , ADC12_PREEMPT_TRIG_TMR1CH4 = 0x01 , ADC12_PREEMPT_TRIG_TMR2TRGOUT = 0x02 , ADC12_PREEMPT_TRIG_TMR2CH1 = 0x03 ,
ADC12_PREEMPT_TRIG_TMR3CH4 = 0x04 , ADC12_PREEMPT_TRIG_TMR4TRGOUT = 0x05 , ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4 = 0x06 , ADC12_PREEMPT_TRIG_SOFTWARE = 0x07 ,
ADC12_PREEMPT_TRIG_TMR1CH1 = 0x0D
}
adc preempt group trigger event select type More...
enum | adc_preempt_channel_type { ADC_PREEMPT_CHANNEL_1 = 0x00 , ADC_PREEMPT_CHANNEL_2 = 0x01 , ADC_PREEMPT_CHANNEL_3 = 0x02 , ADC_PREEMPT_CHANNEL_4 = 0x03 }
adc preempt channel type More...
enum adc_voltage_monitoring_type {
ADC_VMONITOR_SINGLE_ORDINARY = 0x00800200 , ADC_VMONITOR_SINGLE_PREEMPT = 0x00400200 , ADC_VMONITOR_SINGLE_ORDINARY_PREEMPT = 0x00C00200 , ADC_VMONITOR_ALL_ORDINARY = 0x00800000 ,
ADC_VMONITOR_ALL_PREEMPT = 0x00400000 , ADC_VMONITOR_ALL_ORDINARY_PREEMPT = 0x00C00000 , ADC_VMONITOR_NONE = 0x00000000
}
adc voltage_monitoring type More...

Detailed Description

Enumeration Type Documentation

◆ adc_channel_select_type

enum adc_channel_select_type

adc channel select type

Enumerator
ADC_CHANNEL_0 | adc channel 0
ADC_CHANNEL_1 | adc channel 1
ADC_CHANNEL_2 | adc channel 2
ADC_CHANNEL_3 | adc channel 3
ADC_CHANNEL_4 | adc channel 4
ADC_CHANNEL_5 | adc channel 5
ADC_CHANNEL_6 | adc channel 6
ADC_CHANNEL_7 | adc channel 7
ADC_CHANNEL_8 | adc channel 8
ADC_CHANNEL_9 | adc channel 9
ADC_CHANNEL_10 | adc channel 10
ADC_CHANNEL_11 | adc channel 11
ADC_CHANNEL_12 | adc channel 12
ADC_CHANNEL_13 | adc channel 13
ADC_CHANNEL_14 | adc channel 14
ADC_CHANNEL_15 | adc channel 15
ADC_CHANNEL_16 | adc channel 16
ADC_CHANNEL_17 | adc channel 17

Definition at line 108 of file at32f415_adc.h.

◆ adc_combine_mode_type

enum adc_combine_mode_type

adc combine mode type

Enumerator
ADC_INDEPENDENT_MODE | independent mode
ADC_ORDINARY_SMLT_PREEMPT_SMLT_MODE | combined ordinary simultaneous + preempt simultaneous mode
ADC_ORDINARY_SMLT_PREEMPT_INTERLTRIG_MODE | combined ordinary simultaneous + preempt interleaved trigger mode
ADC_ORDINARY_SHORTSHIFT_PREEMPT_SMLT_MODE | combined ordinary short shifting + preempt simultaneous mode
ADC_ORDINARY_LONGSHIFT_PREEMPT_SMLT_MODE | combined ordinary long shifting + preempt simultaneous mode
ADC_PREEMPT_SMLT_ONLY_MODE | preempt simultaneous mode only
ADC_ORDINARY_SMLT_ONLY_MODE | ordinary simultaneous mode only
ADC_ORDINARY_SHORTSHIFT_ONLY_MODE | ordinary short shifting mode only
ADC_ORDINARY_LONGSHIFT_ONLY_MODE | slow interleaved mode only
ADC_PREEMPT_INTERLTRIG_ONLY_MODE | alternate trigger mode only

Definition at line 82 of file at32f415_adc.h.

◆ adc_data_align_type

enum adc_data_align_type

adc data align type

Enumerator
ADC_RIGHT_ALIGNMENT | data right alignment
ADC_LEFT_ALIGNMENT | data left alignment

Definition at line 99 of file at32f415_adc.h.

◆ adc_ordinary_trig_select_type

enum adc_ordinary_trig_select_type

adc ordinary group trigger event select type

Enumerator
ADC12_ORDINARY_TRIG_TMR1CH1 | timer1 ch1 event as trigger source of adc1 ordinary sequence
ADC12_ORDINARY_TRIG_TMR1CH2 | timer1 ch2 event as trigger source of adc1 ordinary sequence
ADC12_ORDINARY_TRIG_TMR1CH3 | timer1 ch3 event as trigger source of adc1 ordinary sequence
ADC12_ORDINARY_TRIG_TMR2CH2 | timer2 ch2 event as trigger source of adc1 ordinary sequence
ADC12_ORDINARY_TRIG_TMR3TRGOUT | timer3 trgout event as trigger source of adc1 ordinary sequence
ADC12_ORDINARY_TRIG_TMR4CH4 | timer4 ch4 event as trigger source of adc1 ordinary sequence
ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT | exint line11/timer1 trgout event as trigger source of adc1 ordinary sequence
ADC12_ORDINARY_TRIG_SOFTWARE | software(OCSWTRG) control bit as trigger source of adc1 ordinary sequence
ADC12_ORDINARY_TRIG_TMR1TRGOUT | timer1 trgout event as trigger source of adc1 ordinary sequence

Definition at line 148 of file at32f415_adc.h.

◆ adc_preempt_channel_type

enum adc_preempt_channel_type

adc preempt channel type

Enumerator
ADC_PREEMPT_CHANNEL_1 | adc preempt channel 1
ADC_PREEMPT_CHANNEL_2 | adc preempt channel 2
ADC_PREEMPT_CHANNEL_3 | adc preempt channel 3
ADC_PREEMPT_CHANNEL_4 | adc preempt channel 4

Definition at line 182 of file at32f415_adc.h.

◆ adc_preempt_trig_select_type

enum adc_preempt_trig_select_type

adc preempt group trigger event select type

Enumerator
ADC12_PREEMPT_TRIG_TMR1TRGOUT | timer1 trgout event as trigger source of adc1 preempt sequence
ADC12_PREEMPT_TRIG_TMR1CH4 | timer1 ch4 event as trigger source of adc1 preempt sequence
ADC12_PREEMPT_TRIG_TMR2TRGOUT | timer2 trgout event as trigger source of adc1 preempt sequence
ADC12_PREEMPT_TRIG_TMR2CH1 | timer2 ch1 event as trigger source of adc1 preempt sequence
ADC12_PREEMPT_TRIG_TMR3CH4 | timer3 ch4 event as trigger source of adc1 preempt sequence
ADC12_PREEMPT_TRIG_TMR4TRGOUT | timer4 trgout event as trigger source of adc1 preempt sequence
ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4 | exint line15/timer1 ch4 event as trigger source of adc1 preempt sequence
ADC12_PREEMPT_TRIG_SOFTWARE | software(PCSWTRG) control bit as trigger source of adc1 preempt sequence
ADC12_PREEMPT_TRIG_TMR1CH1 | timer1 ch1 event as trigger source of adc1 preempt sequence

Definition at line 165 of file at32f415_adc.h.

◆ adc_sampletime_select_type

enum adc_sampletime_select_type

adc sampletime select type

Enumerator
ADC_SAMPLETIME_1_5 | adc sample time 1.5 cycle
ADC_SAMPLETIME_7_5 | adc sample time 7.5 cycle
ADC_SAMPLETIME_13_5 | adc sample time 13.5 cycle
ADC_SAMPLETIME_28_5 | adc sample time 28.5 cycle
ADC_SAMPLETIME_41_5 | adc sample time 41.5 cycle
ADC_SAMPLETIME_55_5 | adc sample time 55.5 cycle
ADC_SAMPLETIME_71_5 | adc sample time 71.5 cycle
ADC_SAMPLETIME_239_5 | adc sample time 239.5 cycle

Definition at line 133 of file at32f415_adc.h.

◆ adc_voltage_monitoring_type

enum adc_voltage_monitoring_type

adc voltage_monitoring type

Enumerator
ADC_VMONITOR_SINGLE_ORDINARY | voltage_monitoring on a single ordinary channel
ADC_VMONITOR_SINGLE_PREEMPT | voltage_monitoring on a single preempt channel
ADC_VMONITOR_SINGLE_ORDINARY_PREEMPT | voltage_monitoring on a single ordinary or preempt channel
ADC_VMONITOR_ALL_ORDINARY | voltage_monitoring on all ordinary channel
ADC_VMONITOR_ALL_PREEMPT | voltage_monitoring on all preempt channel
ADC_VMONITOR_ALL_ORDINARY_PREEMPT | voltage_monitoring on all ordinary and preempt channel
ADC_VMONITOR_NONE | no channel guarded by the voltage_monitoring

Definition at line 193 of file at32f415_adc.h.


AT32F415 Firmwary Library: adc_base_config_type Struct Reference

Data Fields
adc_base_config_type Struct Reference
AT32F415_periph_driver » ADC » ADC_exported_types

adc base config type More...

#include <at32f415_adc.h>

Data Fields

confirm_state sequence_mode
confirm_state repeat_mode
adc_data_align_type data_align
uint8_t ordinary_channel_length

Detailed Description

adc base config type

Definition at line 207 of file at32f415_adc.h.

Field Documentation

◆ data_align

adc_data_align_type adc_base_config_type::data_align

adc data alignment

Definition at line 211 of file at32f415_adc.h.

Referenced by adc_base_config(), adc_base_default_para_init(), and adc_config().

◆ ordinary_channel_length

uint8_t adc_base_config_type::ordinary_channel_length

adc ordinary channel sequence length

Definition at line 212 of file at32f415_adc.h.

Referenced by adc_base_config(), adc_base_default_para_init(), and adc_config().

◆ repeat_mode

confirm_state adc_base_config_type::repeat_mode

adc repeat mode

Definition at line 210 of file at32f415_adc.h.

Referenced by adc_base_config(), adc_base_default_para_init(), and adc_config().

◆ sequence_mode

confirm_state adc_base_config_type::sequence_mode

adc sequence mode

Definition at line 209 of file at32f415_adc.h.

Referenced by adc_base_config(), adc_base_default_para_init(), and adc_config().

The documentation for this struct was generated from the following file:
  • at32f415_adc.h


AT32F415 Firmwary Library: adc_type Struct Reference

Data Fields
adc_type Struct Reference
AT32F415_periph_driver » ADC » ADC_exported_types

type define adc register all More...

#include <at32f415_adc.h>

Data Fields

union {
__IO uint32_t sts
struct {
__IO uint32_t vmor: 1
__IO uint32_t cce: 1
__IO uint32_t pcce: 1
__IO uint32_t pccs: 1
__IO uint32_t occs: 1
__IO uint32_t reserved1: 27
} sts_bit
};
adc sts register, offset:0x00 More...
union {
__IO uint32_t ctrl1
struct {
__IO uint32_t vmcsel: 5
__IO uint32_t cceien: 1
__IO uint32_t vmorien: 1
__IO uint32_t pcceien: 1
__IO uint32_t sqen: 1
__IO uint32_t vmsgen: 1
__IO uint32_t pcautoen: 1
__IO uint32_t ocpen: 1
__IO uint32_t pcpen: 1
__IO uint32_t ocpcnt: 3
__IO uint32_t mssel: 4
__IO uint32_t reserved1: 2
__IO uint32_t pcvmen: 1
__IO uint32_t ocvmen: 1
__IO uint32_t reserved2: 8
} ctrl1_bit
};
adc ctrl1 register, offset:0x04 More...
union {
__IO uint32_t ctrl2
struct {
__IO uint32_t adcen: 1
__IO uint32_t rpen: 1
__IO uint32_t adcal: 1
__IO uint32_t adcalinit: 1
__IO uint32_t reserved1: 4
__IO uint32_t ocdmaen: 1
__IO uint32_t reserved2: 2
__IO uint32_t dtalign: 1
__IO uint32_t pctesel_l: 3
__IO uint32_t pcten: 1
__IO uint32_t reserved3: 1
__IO uint32_t octesel_l: 3
__IO uint32_t octen: 1
__IO uint32_t pcswtrg: 1
__IO uint32_t ocswtrg: 1
__IO uint32_t itsrven: 1
__IO uint32_t pctesel_h: 1
__IO uint32_t octesel_h: 1
__IO uint32_t reserved4: 6
} ctrl2_bit
};
adc ctrl2 register, offset:0x08 More...
union {
__IO uint32_t spt1
struct {
__IO uint32_t cspt10: 3
__IO uint32_t cspt11: 3
__IO uint32_t cspt12: 3
__IO uint32_t cspt13: 3
__IO uint32_t cspt14: 3
__IO uint32_t cspt15: 3
__IO uint32_t cspt16: 3
__IO uint32_t cspt17: 3
__IO uint32_t reserved1: 8
} spt1_bit
};
adc spt1 register, offset:0x0C More...
union {
__IO uint32_t spt2
struct {
__IO uint32_t cspt0: 3
__IO uint32_t cspt1: 3
__IO uint32_t cspt2: 3
__IO uint32_t cspt3: 3
__IO uint32_t cspt4: 3
__IO uint32_t cspt5: 3
__IO uint32_t cspt6: 3
__IO uint32_t cspt7: 3
__IO uint32_t cspt8: 3
__IO uint32_t cspt9: 3
__IO uint32_t reserved1: 2
} spt2_bit
};
adc spt2 register, offset:0x10 More...
union {
__IO uint32_t pcdto1
struct {
__IO uint32_t pcdto1: 12
__IO uint32_t reserved1: 20
} pcdto1_bit
};
adc pcdto1 register, offset:0x14 More...
union {
__IO uint32_t pcdto2
struct {
__IO uint32_t pcdto2: 12
__IO uint32_t reserved1: 20
} pcdto2_bit
};
adc pcdto2 register, offset:0x18 More...
union {
__IO uint32_t pcdto3
struct {
__IO uint32_t pcdto3: 12
__IO uint32_t reserved1: 20
} pcdto3_bit
};
adc pcdto3 register, offset:0x1C More...
union {
__IO uint32_t pcdto4
struct {
__IO uint32_t pcdto4: 12
__IO uint32_t reserved1: 20
} pcdto4_bit
};
adc pcdto4 register, offset:0x20 More...
union {
__IO uint32_t vmhb
struct {
__IO uint32_t vmhb: 12
__IO uint32_t reserved1: 20
} vmhb_bit
};
adc vmhb register, offset:0x24 More...
union {
__IO uint32_t vmlb
struct {
__IO uint32_t vmlb: 12
__IO uint32_t reserved1: 20
} vmlb_bit
};
adc vmlb register, offset:0x28 More...
union {
__IO uint32_t osq1
struct {
__IO uint32_t osn13: 5
__IO uint32_t osn14: 5
__IO uint32_t osn15: 5
__IO uint32_t osn16: 5
__IO uint32_t oclen: 4
__IO uint32_t reserved1: 8
} osq1_bit
};
adc osq1 register, offset:0x2C More...
union {
__IO uint32_t osq2
struct {
__IO uint32_t osn7: 5
__IO uint32_t osn8: 5
__IO uint32_t osn9: 5
__IO uint32_t osn10: 5
__IO uint32_t osn11: 5
__IO uint32_t osn12: 5
__IO uint32_t reserved1: 2
} osq2_bit
};
adc osq2 register, offset:0x30 More...
union {
__IO uint32_t osq3
struct {
__IO uint32_t osn1: 5
__IO uint32_t osn2: 5
__IO uint32_t osn3: 5
__IO uint32_t osn4: 5
__IO uint32_t osn5: 5
__IO uint32_t osn6: 5
__IO uint32_t reserved1: 2
} osq3_bit
};
adc osq3 register, offset:0x34 More...
union {
__IO uint32_t psq
struct {
__IO uint32_t psn1: 5
__IO uint32_t psn2: 5
__IO uint32_t psn3: 5
__IO uint32_t psn4: 5
__IO uint32_t pclen: 2
__IO uint32_t reserved1: 10
} psq_bit
};
adc psq register, offset:0x38 More...
union {
__IO uint32_t pdt1
struct {
__IO uint32_t pdt1: 16
__IO uint32_t reserved1: 16
} pdt1_bit
};
adc pdt1 register, offset:0x3C More...
union {
__IO uint32_t pdt2
struct {
__IO uint32_t pdt2: 16
__IO uint32_t reserved1: 16
} pdt2_bit
};
adc pdt2 register, offset:0x40 More...
union {
__IO uint32_t pdt3
struct {
__IO uint32_t pdt3: 16
__IO uint32_t reserved1: 16
} pdt3_bit
};
adc pdt3 register, offset:0x44 More...
union {
__IO uint32_t pdt4
struct {
__IO uint32_t pdt4: 16
__IO uint32_t reserved1: 16
} pdt4_bit
};
adc pdt4 register, offset:0x48 More...
union {
__IO uint32_t odt
struct {
__IO uint32_t odt: 16
__IO uint32_t reserved1: 16
} odt_bit
};
adc odt register, offset:0x4C More...

Detailed Description

type define adc register all

Definition at line 218 of file at32f415_adc.h.

Field Documentation

◆

union { ... } adc_type::@1

adc sts register, offset:0x00

◆

union { ... } adc_type::@11

adc pcdto1 register, offset:0x14

◆

union { ... } adc_type::@13

adc pcdto2 register, offset:0x18

◆

union { ... } adc_type::@15

adc pcdto3 register, offset:0x1C

◆

union { ... } adc_type::@17

adc pcdto4 register, offset:0x20

◆

union { ... } adc_type::@19

adc vmhb register, offset:0x24

◆

union { ... } adc_type::@21

adc vmlb register, offset:0x28

◆

union { ... } adc_type::@23

adc osq1 register, offset:0x2C

◆

union { ... } adc_type::@25

adc osq2 register, offset:0x30

◆

union { ... } adc_type::@27

adc osq3 register, offset:0x34

◆

union { ... } adc_type::@29

adc psq register, offset:0x38

◆

union { ... } adc_type::@3

adc ctrl1 register, offset:0x04

◆

union { ... } adc_type::@31

adc pdt1 register, offset:0x3C

◆

union { ... } adc_type::@33

adc pdt2 register, offset:0x40

◆

union { ... } adc_type::@35

adc pdt3 register, offset:0x44

◆

union { ... } adc_type::@37

adc pdt4 register, offset:0x48

◆

union { ... } adc_type::@39

adc odt register, offset:0x4C

◆

union { ... } adc_type::@5

adc ctrl2 register, offset:0x08

◆

union { ... } adc_type::@7

adc spt1 register, offset:0x0C

◆

union { ... } adc_type::@9

adc spt2 register, offset:0x10

◆ adcal

__IO uint32_t adc_type::adcal

Definition at line 274 of file at32f415_adc.h.

Referenced by adc_calibration_start(), and adc_calibration_status_get().

◆ adcalinit

__IO uint32_t adc_type::adcalinit

Definition at line 275 of file at32f415_adc.h.

Referenced by adc_calibration_init(), and adc_calibration_init_status_get().

◆ adcen

__IO uint32_t adc_type::adcen

Definition at line 272 of file at32f415_adc.h.

Referenced by adc_enable().

◆ cce

__IO uint32_t adc_type::cce

Definition at line 230 of file at32f415_adc.h.

◆ cceien

__IO uint32_t adc_type::cceien

Definition at line 247 of file at32f415_adc.h.

◆ cspt0

__IO uint32_t adc_type::cspt0

Definition at line 322 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt1

__IO uint32_t adc_type::cspt1

Definition at line 323 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt10

__IO uint32_t adc_type::cspt10

Definition at line 302 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt11

__IO uint32_t adc_type::cspt11

Definition at line 303 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt12

__IO uint32_t adc_type::cspt12

Definition at line 304 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt13

__IO uint32_t adc_type::cspt13

Definition at line 305 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt14

__IO uint32_t adc_type::cspt14

Definition at line 306 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt15

__IO uint32_t adc_type::cspt15

Definition at line 307 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt16

__IO uint32_t adc_type::cspt16

Definition at line 308 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt17

__IO uint32_t adc_type::cspt17

Definition at line 309 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt2

__IO uint32_t adc_type::cspt2

Definition at line 324 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt3

__IO uint32_t adc_type::cspt3

Definition at line 325 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt4

__IO uint32_t adc_type::cspt4

Definition at line 326 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt5

__IO uint32_t adc_type::cspt5

Definition at line 327 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt6

__IO uint32_t adc_type::cspt6

Definition at line 328 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt7

__IO uint32_t adc_type::cspt7

Definition at line 329 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt8

__IO uint32_t adc_type::cspt8

Definition at line 330 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ cspt9

__IO uint32_t adc_type::cspt9

Definition at line 331 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ ctrl1

__IO uint32_t adc_type::ctrl1

Definition at line 243 of file at32f415_adc.h.

Referenced by adc_interrupt_enable(), and adc_voltage_monitor_enable().

◆

struct { ... } adc_type::ctrl1_bit

Referenced by adc_base_config(), adc_ordinary_part_count_set(), adc_ordinary_part_mode_enable(), adc_preempt_auto_mode_enable(), adc_preempt_part_mode_enable(), adc_voltage_monitor_enable(), and adc_voltage_monitor_single_channel_select().

◆ ctrl2

__IO uint32_t adc_type::ctrl2

Definition at line 269 of file at32f415_adc.h.

◆

struct { ... } adc_type::ctrl2_bit

Referenced by adc_base_config(), adc_calibration_init(), adc_calibration_init_status_get(), adc_calibration_start(), adc_calibration_status_get(), adc_dma_mode_enable(), adc_enable(), adc_ordinary_conversion_trigger_set(), adc_ordinary_software_trigger_enable(), adc_ordinary_software_trigger_status_get(), adc_preempt_conversion_trigger_set(), adc_preempt_software_trigger_enable(), and adc_preempt_software_trigger_status_get().

◆ dtalign

__IO uint32_t adc_type::dtalign

Definition at line 279 of file at32f415_adc.h.

Referenced by adc_base_config().

◆ itsrven

__IO uint32_t adc_type::itsrven

Definition at line 287 of file at32f415_adc.h.

◆ mssel

__IO uint32_t adc_type::mssel

Definition at line 256 of file at32f415_adc.h.

◆ occs

__IO uint32_t adc_type::occs

Definition at line 233 of file at32f415_adc.h.

◆ ocdmaen

__IO uint32_t adc_type::ocdmaen

Definition at line 277 of file at32f415_adc.h.

Referenced by adc_dma_mode_enable().

◆ oclen

__IO uint32_t adc_type::oclen

Definition at line 426 of file at32f415_adc.h.

Referenced by adc_base_config().

◆ ocpcnt

__IO uint32_t adc_type::ocpcnt

Definition at line 255 of file at32f415_adc.h.

Referenced by adc_ordinary_part_count_set().

◆ ocpen

__IO uint32_t adc_type::ocpen

Definition at line 253 of file at32f415_adc.h.

Referenced by adc_ordinary_part_mode_enable().

◆ ocswtrg

__IO uint32_t adc_type::ocswtrg

Definition at line 286 of file at32f415_adc.h.

Referenced by adc_ordinary_software_trigger_enable(), and adc_ordinary_software_trigger_status_get().

◆ octen

__IO uint32_t adc_type::octen

Definition at line 284 of file at32f415_adc.h.

Referenced by adc_ordinary_conversion_trigger_set().

◆ octesel_h

__IO uint32_t adc_type::octesel_h

Definition at line 289 of file at32f415_adc.h.

Referenced by adc_ordinary_conversion_trigger_set().

◆ octesel_l

__IO uint32_t adc_type::octesel_l

Definition at line 283 of file at32f415_adc.h.

Referenced by adc_ordinary_conversion_trigger_set().

◆ ocvmen

__IO uint32_t adc_type::ocvmen

Definition at line 259 of file at32f415_adc.h.

Referenced by adc_voltage_monitor_enable().

◆ odt

__IO uint32_t adc_type::odt

Definition at line 541 of file at32f415_adc.h.

Referenced by adc_ordinary_conversion_data_get().

◆

struct { ... } adc_type::odt_bit

Referenced by adc_ordinary_conversion_data_get().

◆ osn1

__IO uint32_t adc_type::osn1

Definition at line 457 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn10

__IO uint32_t adc_type::osn10

Definition at line 442 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn11

__IO uint32_t adc_type::osn11

Definition at line 443 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn12

__IO uint32_t adc_type::osn12

Definition at line 444 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn13

__IO uint32_t adc_type::osn13

Definition at line 422 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn14

__IO uint32_t adc_type::osn14

Definition at line 423 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn15

__IO uint32_t adc_type::osn15

Definition at line 424 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn16

__IO uint32_t adc_type::osn16

Definition at line 425 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn2

__IO uint32_t adc_type::osn2

Definition at line 458 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn3

__IO uint32_t adc_type::osn3

Definition at line 459 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn4

__IO uint32_t adc_type::osn4

Definition at line 460 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn5

__IO uint32_t adc_type::osn5

Definition at line 461 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn6

__IO uint32_t adc_type::osn6

Definition at line 462 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn7

__IO uint32_t adc_type::osn7

Definition at line 439 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn8

__IO uint32_t adc_type::osn8

Definition at line 440 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osn9

__IO uint32_t adc_type::osn9

Definition at line 441 of file at32f415_adc.h.

Referenced by adc_ordinary_channel_set().

◆ osq1

__IO uint32_t adc_type::osq1

Definition at line 419 of file at32f415_adc.h.

◆

struct { ... } adc_type::osq1_bit

Referenced by adc_base_config(), and adc_ordinary_channel_set().

◆ osq2

__IO uint32_t adc_type::osq2

Definition at line 436 of file at32f415_adc.h.

◆

struct { ... } adc_type::osq2_bit

Referenced by adc_ordinary_channel_set().

◆ osq3

__IO uint32_t adc_type::osq3

Definition at line 454 of file at32f415_adc.h.

◆

struct { ... } adc_type::osq3_bit

Referenced by adc_ordinary_channel_set().

◆ pcautoen

__IO uint32_t adc_type::pcautoen

Definition at line 252 of file at32f415_adc.h.

Referenced by adc_preempt_auto_mode_enable().

◆ pcce

__IO uint32_t adc_type::pcce

Definition at line 231 of file at32f415_adc.h.

◆ pcceien

__IO uint32_t adc_type::pcceien

Definition at line 249 of file at32f415_adc.h.

◆ pccs

__IO uint32_t adc_type::pccs

Definition at line 232 of file at32f415_adc.h.

◆ pcdto1

__IO uint32_t adc_type::pcdto1

Definition at line 341 of file at32f415_adc.h.

Referenced by adc_preempt_offset_value_set().

◆

struct { ... } adc_type::pcdto1_bit

Referenced by adc_preempt_offset_value_set().

◆ pcdto2

__IO uint32_t adc_type::pcdto2

Definition at line 354 of file at32f415_adc.h.

Referenced by adc_preempt_offset_value_set().

◆

struct { ... } adc_type::pcdto2_bit

Referenced by adc_preempt_offset_value_set().

◆ pcdto3

__IO uint32_t adc_type::pcdto3

Definition at line 367 of file at32f415_adc.h.

Referenced by adc_preempt_offset_value_set().

◆

struct { ... } adc_type::pcdto3_bit

Referenced by adc_preempt_offset_value_set().

◆ pcdto4

__IO uint32_t adc_type::pcdto4

Definition at line 380 of file at32f415_adc.h.

Referenced by adc_preempt_offset_value_set().

◆

struct { ... } adc_type::pcdto4_bit

Referenced by adc_preempt_offset_value_set().

◆ pclen

__IO uint32_t adc_type::pclen

Definition at line 479 of file at32f415_adc.h.

Referenced by adc_preempt_channel_length_set(), and adc_preempt_channel_set().

◆ pcpen

__IO uint32_t adc_type::pcpen

Definition at line 254 of file at32f415_adc.h.

Referenced by adc_preempt_part_mode_enable().

◆ pcswtrg

__IO uint32_t adc_type::pcswtrg

Definition at line 285 of file at32f415_adc.h.

Referenced by adc_preempt_software_trigger_enable(), and adc_preempt_software_trigger_status_get().

◆ pcten

__IO uint32_t adc_type::pcten

Definition at line 281 of file at32f415_adc.h.

Referenced by adc_preempt_conversion_trigger_set().

◆ pctesel_h

__IO uint32_t adc_type::pctesel_h

Definition at line 288 of file at32f415_adc.h.

Referenced by adc_preempt_conversion_trigger_set().

◆ pctesel_l

__IO uint32_t adc_type::pctesel_l

Definition at line 280 of file at32f415_adc.h.

Referenced by adc_preempt_conversion_trigger_set().

◆ pcvmen

__IO uint32_t adc_type::pcvmen

Definition at line 258 of file at32f415_adc.h.

Referenced by adc_voltage_monitor_enable().

◆ pdt1

__IO uint32_t adc_type::pdt1

Definition at line 489 of file at32f415_adc.h.

Referenced by adc_preempt_conversion_data_get().

◆

struct { ... } adc_type::pdt1_bit

Referenced by adc_preempt_conversion_data_get().

◆ pdt2

__IO uint32_t adc_type::pdt2

Definition at line 502 of file at32f415_adc.h.

Referenced by adc_preempt_conversion_data_get().

◆

struct { ... } adc_type::pdt2_bit

Referenced by adc_preempt_conversion_data_get().

◆ pdt3

__IO uint32_t adc_type::pdt3

Definition at line 515 of file at32f415_adc.h.

Referenced by adc_preempt_conversion_data_get().

◆

struct { ... } adc_type::pdt3_bit

Referenced by adc_preempt_conversion_data_get().

◆ pdt4

__IO uint32_t adc_type::pdt4

Definition at line 528 of file at32f415_adc.h.

Referenced by adc_preempt_conversion_data_get().

◆

struct { ... } adc_type::pdt4_bit

Referenced by adc_preempt_conversion_data_get().

◆ psn1

__IO uint32_t adc_type::psn1

Definition at line 475 of file at32f415_adc.h.

Referenced by adc_preempt_channel_set().

◆ psn2

__IO uint32_t adc_type::psn2

Definition at line 476 of file at32f415_adc.h.

Referenced by adc_preempt_channel_set().

◆ psn3

__IO uint32_t adc_type::psn3

Definition at line 477 of file at32f415_adc.h.

Referenced by adc_preempt_channel_set().

◆ psn4

__IO uint32_t adc_type::psn4

Definition at line 478 of file at32f415_adc.h.

Referenced by adc_preempt_channel_set().

◆ psq

__IO uint32_t adc_type::psq

Definition at line 472 of file at32f415_adc.h.

◆

struct { ... } adc_type::psq_bit

Referenced by adc_preempt_channel_length_set(), and adc_preempt_channel_set().

◆ reserved1

__IO uint32_t adc_type::reserved1

Definition at line 234 of file at32f415_adc.h.

◆ reserved2

__IO uint32_t adc_type::reserved2

Definition at line 260 of file at32f415_adc.h.

◆ reserved3

__IO uint32_t adc_type::reserved3

Definition at line 282 of file at32f415_adc.h.

◆ reserved4

__IO uint32_t adc_type::reserved4

Definition at line 290 of file at32f415_adc.h.

◆ rpen

__IO uint32_t adc_type::rpen

Definition at line 273 of file at32f415_adc.h.

Referenced by adc_base_config().

◆ spt1

__IO uint32_t adc_type::spt1

Definition at line 299 of file at32f415_adc.h.

◆

struct { ... } adc_type::spt1_bit

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ spt2

__IO uint32_t adc_type::spt2

Definition at line 319 of file at32f415_adc.h.

◆

struct { ... } adc_type::spt2_bit

Referenced by adc_ordinary_channel_set(), and adc_preempt_channel_set().

◆ sqen

__IO uint32_t adc_type::sqen

Definition at line 250 of file at32f415_adc.h.

Referenced by adc_base_config().

◆ sts

__IO uint32_t adc_type::sts

Definition at line 226 of file at32f415_adc.h.

Referenced by adc_flag_clear(), and adc_flag_get().

◆

struct { ... } adc_type::sts_bit

◆ vmcsel

__IO uint32_t adc_type::vmcsel

Definition at line 246 of file at32f415_adc.h.

Referenced by adc_voltage_monitor_single_channel_select().

◆ vmhb

__IO uint32_t adc_type::vmhb

Definition at line 393 of file at32f415_adc.h.

Referenced by adc_voltage_monitor_threshold_value_set().

◆

struct { ... } adc_type::vmhb_bit

Referenced by adc_voltage_monitor_threshold_value_set().

◆ vmlb

__IO uint32_t adc_type::vmlb

Definition at line 406 of file at32f415_adc.h.

Referenced by adc_voltage_monitor_threshold_value_set().

◆

struct { ... } adc_type::vmlb_bit

Referenced by adc_voltage_monitor_threshold_value_set().

◆ vmor

__IO uint32_t adc_type::vmor

Definition at line 229 of file at32f415_adc.h.

◆ vmorien

__IO uint32_t adc_type::vmorien

Definition at line 248 of file at32f415_adc.h.

◆ vmsgen

__IO uint32_t adc_type::vmsgen

Definition at line 251 of file at32f415_adc.h.

Referenced by adc_voltage_monitor_enable().

The documentation for this struct was generated from the following file:
  • at32f415_adc.h


AT32F415 Firmwary Library: ADC_exported_functions

Functions
ADC_exported_functions
AT32F415_periph_driver » ADC

Functions

void | adc_reset (adc_type *adc_x)
deinitialize the adc peripheral registers to their default reset values. More...
void | adc_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the specified adc peripheral. More...
void | adc_combine_mode_select (adc_combine_mode_type combine_mode)
select combine mode of the specified adc peripheral. More...
void | adc_base_default_para_init (adc_base_config_type *adc_base_struct)
adc base default para init. More...
void | adc_base_config (adc_type *adc_x, adc_base_config_type *adc_base_struct)
initialize the adc peripheral according to the specified parameters. More...
void | adc_dma_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the adc dma transfer. More...
void | adc_interrupt_enable (adc_type *adc_x, uint32_t adc_int, confirm_state new_state)
enable or disable the specified adc interrupts. More...
void | adc_calibration_init (adc_type *adc_x)
initialize calibration register of the specified adc peripheral. More...
flag_status | adc_calibration_init_status_get (adc_type *adc_x)
get calibration register's initialize status of the specified adc peripheral. More...
void | adc_calibration_start (adc_type *adc_x)
start calibration process of the specified adc peripheral. More...
flag_status | adc_calibration_status_get (adc_type *adc_x)
get calibration status of the specified adc peripheral. More...
void | adc_voltage_monitor_enable (adc_type *adc_x, adc_voltage_monitoring_type adc_voltage_monitoring)
enable or disable the voltage monitoring on single/all ordinary or preempt channels of the specified adc peripheral. More...
void | adc_voltage_monitor_threshold_value_set (adc_type *adc_x, uint16_t adc_high_threshold, uint16_t adc_low_threshold)
set voltage monitoring's high and low thresholds value of the specified adc peripheral. More...
void | adc_voltage_monitor_single_channel_select (adc_type *adc_x, adc_channel_select_type adc_channel)
select the voltage monitoring's channel of the specified adc peripheral. More...
void | adc_ordinary_channel_set (adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc peripheral. More...
void | adc_preempt_channel_length_set (adc_type *adc_x, uint8_t adc_channel_lenght)
set preempt channel lenghth of the specified adc peripheral. More...
void | adc_preempt_channel_set (adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
configure preempt channel's corresponding rank in the sequencer and sample time of the specified adc peripheral. More...
void | adc_ordinary_conversion_trigger_set (adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state)
enable or disable the ordinary channel's external trigger and set external trigger event of the specified adc peripheral. More...
void | adc_preempt_conversion_trigger_set (adc_type *adc_x, adc_preempt_trig_select_type adc_preempt_trig, confirm_state new_state)
enable or disable the preempt channel's external trigger and set external trigger event of the specified adc peripheral. More...
void | adc_preempt_offset_value_set (adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel, uint16_t adc_offset_value)
set preempt channel's conversion value offset of the specified adc peripheral. More...
void | adc_ordinary_part_count_set (adc_type *adc_x, uint8_t adc_channel_count)
set partitioned mode channel count of the specified adc peripheral. More...
void | adc_ordinary_part_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the partitioned mode on ordinary channel of the specified adc peripheral. More...
void | adc_preempt_part_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the partitioned mode on preempt channel of the specified adc peripheral. More...
void | adc_preempt_auto_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable automatic preempt group conversion of the specified adc peripheral. More...
void | adc_tempersensor_vintrv_enable (confirm_state new_state)
enable or disable the temperature sensor and vintrv channel. More...
void | adc_ordinary_software_trigger_enable (adc_type *adc_x, confirm_state new_state)
enable or disable ordinary software start conversion of the specified adc peripheral. More...
flag_status | adc_ordinary_software_trigger_status_get (adc_type *adc_x)
get ordinary software start conversion status of the specified adc peripheral. More...
void | adc_preempt_software_trigger_enable (adc_type *adc_x, confirm_state new_state)
enable or disable preempt software start conversion of the specified adc peripheral. More...
flag_status | adc_preempt_software_trigger_status_get (adc_type *adc_x)
get preempt software start conversion status of the specified adc peripheral. More...
uint16_t | adc_ordinary_conversion_data_get (adc_type *adc_x)
return the last conversion data for ordinary channel of the specified adc peripheral. More...
uint32_t | adc_combine_ordinary_conversion_data_get (void)
return the last conversion data for ordinary channel of combine adc. More...
uint16_t | adc_preempt_conversion_data_get (adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel)
return the conversion data for selection preempt channel of the specified adc peripheral. More...
flag_status | adc_flag_get (adc_type *adc_x, uint8_t adc_flag)
get flag of the specified adc peripheral. More...
void | adc_flag_clear (adc_type *adc_x, uint32_t adc_flag)
clear flag of the specified adc peripheral. More...

Detailed Description

Function Documentation

◆ adc_base_config()

void adc_base_config | ( | adc_type * | adc_x,
 |  | adc_base_config_type * | adc_base_struct
 | ) |  |

initialize the adc peripheral according to the specified parameters.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
sequence_mode | set the state of adc sequence mode. this parameter can be:TRUE or FALSE
repeat_mode | set the state of adc repeat conversion mode. this parameter can be:TRUE or FALSE
data_align set the state of adc data alignment. this parameter can be one of the following values:
  • ADC_RIGHT_ALIGNMENT
  • ADC_LEFT_ALIGNMENT
ordinary_channel_length configure the adc ordinary channel sequence length. this parameter can be:
  • (0x1~0xf)
Return values
none

Definition at line 137 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_base_default_para_init()

void adc_base_default_para_init ( adc_base_config_type * adc_base_struct )

adc base default para init.

Parameters
sequence_mode | set the state of adc sequence mode. this parameter can be:TRUE or FALSE
repeat_mode | set the state of adc repeat conversion mode. this parameter can be:TRUE or FALSE
data_align set the state of adc data alignment. this parameter can be one of the following values:
  • ADC_RIGHT_ALIGNMENT
  • ADC_LEFT_ALIGNMENT
ordinary_channel_length configure the adc ordinary channel sequence length. this parameter can be:
  • (0x1~0xf)
Return values
none

Definition at line 111 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_calibration_init()

void adc_calibration_init ( adc_type * adc_x )

initialize calibration register of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
none

Definition at line 192 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_calibration_init_status_get()

flag_status adc_calibration_init_status_get ( adc_type * adc_x )

get calibration register's initialize status of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
the new state of reset calibration register status(SET or RESET).

Definition at line 204 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_calibration_start()

void adc_calibration_start ( adc_type * adc_x )

start calibration process of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
none

Definition at line 223 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_calibration_status_get()

flag_status adc_calibration_status_get ( adc_type * adc_x )

get calibration status of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
the new state of calibration status(SET or RESET).

Definition at line 235 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_combine_mode_select()

void adc_combine_mode_select ( adc_combine_mode_type combine_mode )

select combine mode of the specified adc peripheral.

Parameters
combine_mode select the adc combine mode. this parameter can be one of the following values:
  • ADC_INDEPENDENT_MODE
  • ADC_ORDINARY_SMLT_PREEMPT_SMLT_MODE
  • ADC_ORDINARY_SMLT_PREEMPT_INTERLTRIG_MODE
  • ADC_ORDINARY_SHORTSHIFT_PREEMPT_SMLT_MODE
  • ADC_ORDINARY_LONGSHIFT_PREEMPT_SMLT_MODE
  • ADC_PREEMPT_SMLT_ONLY_MODE
  • ADC_ORDINARY_SMLT_ONLY_MODE
  • ADC_ORDINARY_SHORTSHIFT_ONLY_MODE
  • ADC_ORDINARY_LONGSHIFT_ONLY_MODE
  • ADC_PREEMPT_INTERLTRIG_ONLY_MODE
Return values
none

Definition at line 91 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_combine_ordinary_conversion_data_get()

uint32_t adc_combine_ordinary_conversion_data_get ( void )

return the last conversion data for ordinary channel of combine adc.

Return values
the last conversion data for ordinary channel.

Definition at line 828 of file at32f415_adc.c.

◆ adc_dma_mode_enable()

void adc_dma_mode_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the adc dma transfer.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of the adc dma transfer. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 154 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_enable()

void adc_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of a/d converter. this parameter can be: TRUE or FALSE. note:after adc ready,user set adcen bit will cause ordinary conversion
Return values
none

Definition at line 70 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_flag_clear()

void adc_flag_clear | ( | adc_type * | adc_x,
 |  | uint32_t | adc_flag
 | ) |  |

clear flag of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_flag select the adc flag. this parameter can be any combination of the following values:
  • ADC_VMOR_FLAG
  • ADC_CCE_FLAG(also can clear by reading the adc_x->odt)
  • ADC_PCCE_FLAG
  • ADC_PCCS_FLAG
  • ADC_OCCS_FLAG
Return values
none

Definition at line 912 of file at32f415_adc.c.

Referenced by ADC1_IRQHandler().

◆ adc_flag_get()

flag_status adc_flag_get | ( | adc_type * | adc_x,
 |  | uint8_t | adc_flag
 | ) |  |

get flag of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_flag select the adc flag. this parameter can be one of the following values:
  • ADC_VMOR_FLAG
  • ADC_CCE_FLAG
  • ADC_PCCE_FLAG
  • ADC_PCCS_FLAG(no interrupt associated)
  • ADC_OCCS_FLAG(no interrupt associated)
Return values
the new state of adc flag status(SET or RESET).

Definition at line 883 of file at32f415_adc.c.

Referenced by ADC1_IRQHandler().

◆ adc_interrupt_enable()

void adc_interrupt_enable | ( | adc_type * | adc_x,
 |  | uint32_t | adc_int,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the specified adc interrupts.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_int specifies the adc interrupt sources to be enabled or disabled. this parameter can be one of the following values:
  • ADC_VMOR_INT
  • ADC_CCE_INT
  • ADC_PCCE_INT
new_state | new state of the specified adc interrupts. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 173 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_ordinary_channel_set()

void adc_ordinary_channel_set | ( | adc_type * | adc_x,
 |  | adc_channel_select_type | adc_channel,
 |  | uint8_t | adc_sequence,
 |  | adc_sampletime_select_type | adc_sampletime
 | ) |  |

set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_channel select the channel. this parameter can be one of the following values:
  • ADC_CHANNEL_0 - ADC_CHANNEL_1 - ADC_CHANNEL_2 - ADC_CHANNEL_3
  • ADC_CHANNEL_4 - ADC_CHANNEL_5 - ADC_CHANNEL_6 - ADC_CHANNEL_7
  • ADC_CHANNEL_8 - ADC_CHANNEL_9 - ADC_CHANNEL_10 - ADC_CHANNEL_11
  • ADC_CHANNEL_12 - ADC_CHANNEL_13 - ADC_CHANNEL_14 - ADC_CHANNEL_15
  • ADC_CHANNEL_16 - ADC_CHANNEL_17
adc_sequence set rank in the ordinary group sequencer. this parameter must be:
  • between 1 to 16
adc_sampletime set the sampletime of adc channel. this parameter can be one of the following values:
  • ADC_SAMPLETIME_1_5
  • ADC_SAMPLETIME_7_5
  • ADC_SAMPLETIME_13_5
  • ADC_SAMPLETIME_28_5
  • ADC_SAMPLETIME_41_5
  • ADC_SAMPLETIME_55_5
  • ADC_SAMPLETIME_71_5
  • ADC_SAMPLETIME_239_5
Return values
none

Definition at line 336 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_ordinary_conversion_data_get()

uint16_t adc_ordinary_conversion_data_get ( adc_type * adc_x )

return the last conversion data for ordinary channel of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
the last conversion data for ordinary channel.

Definition at line 819 of file at32f415_adc.c.

◆ adc_ordinary_conversion_trigger_set()

void adc_ordinary_conversion_trigger_set | ( | adc_type * | adc_x,
 |  | adc_ordinary_trig_select_type | adc_ordinary_trig,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the ordinary channel's external trigger and set external trigger event of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_ordinary_trig select the external trigger event. this parameter can be one of the following values: adc1
  • ADC12_ORDINARY_TRIG_TMR1CH1 - ADC12_ORDINARY_TRIG_TMR1CH2 - ADC12_ORDINARY_TRIG_TMR1CH3 - ADC12_ORDINARY_TRIG_TMR2CH2
  • ADC12_ORDINARY_TRIG_TMR3TRGOUT - ADC12_ORDINARY_TRIG_TMR4CH4 - ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT - ADC12_ORDINARY_TRIG_SOFTWARE
  • ADC12_ORDINARY_TRIG_TMR1TRGOUT
new_state | new state of ordinary channel's external trigger. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 592 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_ordinary_part_count_set()

void adc_ordinary_part_count_set | ( | adc_type * | adc_x,
 |  | uint8_t | adc_channel_count
 | ) |  |

set partitioned mode channel count of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_channel_count configure the adc partitioned mode channel count. this parameter can be:
  • (0x1~0x8)
Return values
none

Definition at line 686 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_ordinary_part_mode_enable()

void adc_ordinary_part_mode_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the partitioned mode on ordinary channel of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of ordinary channel's partitioned mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 701 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_ordinary_software_trigger_enable()

void adc_ordinary_software_trigger_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable ordinary software start conversion of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of ordinary software start conversion. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 755 of file at32f415_adc.c.

Referenced by main().

◆ adc_ordinary_software_trigger_status_get()

flag_status adc_ordinary_software_trigger_status_get ( adc_type * adc_x )

get ordinary software start conversion status of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
the new state of ordinary software start conversion status(SET or RESET).

Definition at line 767 of file at32f415_adc.c.

◆ adc_preempt_auto_mode_enable()

void adc_preempt_auto_mode_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable automatic preempt group conversion of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of automatic preempt group conversion. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 729 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_preempt_channel_length_set()

void adc_preempt_channel_length_set | ( | adc_type * | adc_x,
 |  | uint8_t | adc_channel_lenght
 | ) |  |

set preempt channel lenghth of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_channel_lenght set the adc preempt channel lenghth. this parameter can be:
  • (0x1~0x4)
Return values
none

Definition at line 462 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_preempt_channel_set()

void adc_preempt_channel_set | ( | adc_type * | adc_x,
 |  | adc_channel_select_type | adc_channel,
 |  | uint8_t | adc_sequence,
 |  | adc_sampletime_select_type | adc_sampletime
 | ) |  |

configure preempt channel's corresponding rank in the sequencer and sample time of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_channel select the channel. this parameter can be one of the following values:
  • ADC_CHANNEL_0 - ADC_CHANNEL_1 - ADC_CHANNEL_2 - ADC_CHANNEL_3
  • ADC_CHANNEL_4 - ADC_CHANNEL_5 - ADC_CHANNEL_6 - ADC_CHANNEL_7
  • ADC_CHANNEL_8 - ADC_CHANNEL_9 - ADC_CHANNEL_10 - ADC_CHANNEL_11
  • ADC_CHANNEL_12 - ADC_CHANNEL_13 - ADC_CHANNEL_14 - ADC_CHANNEL_15
  • ADC_CHANNEL_16 - ADC_CHANNEL_17
adc_sequence set rank in the preempt group sequencer. this parameter must be:
  • between 1 to 4
adc_sampletime config the sampletime of adc channel. this parameter can be one of the following values:
  • ADC_SAMPLETIME_1_5
  • ADC_SAMPLETIME_7_5
  • ADC_SAMPLETIME_13_5
  • ADC_SAMPLETIME_28_5
  • ADC_SAMPLETIME_41_5
  • ADC_SAMPLETIME_55_5
  • ADC_SAMPLETIME_71_5
  • ADC_SAMPLETIME_239_5
Return values
none

Definition at line 494 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_preempt_conversion_data_get()

uint16_t adc_preempt_conversion_data_get | ( | adc_type * | adc_x,
 |  | adc_preempt_channel_type | adc_preempt_channel
 | ) |  |

return the conversion data for selection preempt channel of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_preempt_channel select the preempt channel. this parameter can be one of the following values:
  • ADC_PREEMPTED_CHANNEL_1
  • ADC_PREEMPTED_CHANNEL_2
  • ADC_PREEMPTED_CHANNEL_3
  • ADC_PREEMPTED_CHANNEL_4
Return values
the conversion data for selection preempt channel.

Definition at line 846 of file at32f415_adc.c.

Referenced by ADC1_IRQHandler().

◆ adc_preempt_conversion_trigger_set()

void adc_preempt_conversion_trigger_set | ( | adc_type * | adc_x,
 |  | adc_preempt_trig_select_type | adc_preempt_trig,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the preempt channel's external trigger and set external trigger event of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_preempt_trig select the external trigger event. this parameter can be one of the following values: adc1
  • ADC12_PREEMPT_TRIG_TMR1TRGOUT - ADC12_PREEMPT_TRIG_TMR1CH4 - ADC12_PREEMPT_TRIG_TMR2TRGOUT - ADC12_PREEMPT_TRIG_TMR2CH1
  • ADC12_PREEMPT_TRIG_TMR3CH4 - ADC12_PREEMPT_TRIG_TMR4TRGOUT - ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4 - ADC12_PREEMPT_TRIG_SOFTWARE
  • ADC12_PREEMPT_TRIG_TMR1CH1
new_state | new state of preempt channel's external trigger. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 623 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_preempt_offset_value_set()

void adc_preempt_offset_value_set | ( | adc_type * | adc_x,
 |  | adc_preempt_channel_type | adc_preempt_channel,
 |  | uint16_t | adc_offset_value
 | ) |  |

set preempt channel's conversion value offset of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_preempt_channel select the preempt channel. this parameter can be one of the following values:
  • ADC_PREEMPT_CHANNEL_1
  • ADC_PREEMPT_CHANNEL_2
  • ADC_PREEMPT_CHANNEL_3
  • ADC_PREEMPT_CHANNEL_4
adc_offset_value set the adc preempt channel's conversion value offset. this parameter can be:
  • (0x000~0xFFF)
Return values
none

Definition at line 655 of file at32f415_adc.c.

◆ adc_preempt_part_mode_enable()

void adc_preempt_part_mode_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the partitioned mode on preempt channel of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of preempt channel's partitioned mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 715 of file at32f415_adc.c.

◆ adc_preempt_software_trigger_enable()

void adc_preempt_software_trigger_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable preempt software start conversion of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of preempt software start conversion. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 788 of file at32f415_adc.c.

◆ adc_preempt_software_trigger_status_get()

flag_status adc_preempt_software_trigger_status_get ( adc_type * adc_x )

get preempt software start conversion status of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
the new state of preempt software start conversion status(SET or RESET).

Definition at line 800 of file at32f415_adc.c.

◆ adc_reset()

void adc_reset ( adc_type * adc_x )

deinitialize the adc peripheral registers to their default reset values.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
none

Definition at line 51 of file at32f415_adc.c.

◆ adc_tempersensor_vintrv_enable()

void adc_tempersensor_vintrv_enable ( confirm_state new_state )

enable or disable the temperature sensor and vintrv channel.

Parameters
new_state new state of Internal temperature sensor and vintrv. this parameter can be: TRUE or FALSE. note:this bit is present only in adc1
Return values
none

Definition at line 741 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_voltage_monitor_enable()

void adc_voltage_monitor_enable | ( | adc_type * | adc_x,
 |  | adc_voltage_monitoring_type | adc_voltage_monitoring
 | ) |  |

enable or disable the voltage monitoring on single/all ordinary or preempt channels of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_voltage_monitoring choose the adc_voltage_monitoring config. this parameter can be one of the following values:
  • ADC_VMONITOR_SINGLE_ORDINARY
  • ADC_VMONITOR_SINGLE_PREEMPT
  • ADC_VMONITOR_SINGLE_ORDINARY_PREEMPT
  • ADC_VMONITOR_ALL_ORDINARY
  • ADC_VMONITOR_ALL_PREEMPT
  • ADC_VMONITOR_ALL_ORDINARY_PREEMPT
  • ADC_VMONITOR_NONE
Return values
none

Definition at line 263 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_voltage_monitor_single_channel_select()

void adc_voltage_monitor_single_channel_select | ( | adc_type * | adc_x,
 |  | adc_channel_select_type | adc_channel
 | ) |  |

select the voltage monitoring's channel of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_channel select the channel. this parameter can be one of the following values:
  • ADC_CHANNEL_0 - ADC_CHANNEL_1 - ADC_CHANNEL_2 - ADC_CHANNEL_3
  • ADC_CHANNEL_4 - ADC_CHANNEL_5 - ADC_CHANNEL_6 - ADC_CHANNEL_7
  • ADC_CHANNEL_8 - ADC_CHANNEL_9 - ADC_CHANNEL_10 - ADC_CHANNEL_11
  • ADC_CHANNEL_12 - ADC_CHANNEL_13 - ADC_CHANNEL_14 - ADC_CHANNEL_15
  • ADC_CHANNEL_16 - ADC_CHANNEL_17
Return values
none

Definition at line 304 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_voltage_monitor_threshold_value_set()

void adc_voltage_monitor_threshold_value_set | ( | adc_type * | adc_x,
 |  | uint16_t | adc_high_threshold,
 |  | uint16_t | adc_low_threshold
 | ) |  |

set voltage monitoring's high and low thresholds value of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_high_threshold voltage monitoring's high thresholds value. this parameter can be:
  • (0x000~0xFFF)
adc_low_threshold voltage monitoring's low thresholds value. this parameter can be:
  • (0x000~0xFFF)
Return values
none

Definition at line 284 of file at32f415_adc.c.

Referenced by adc_config().


AT32F415 Firmwary Library: ADC_private_functions

Functions
ADC_private_functions
AT32F415_periph_driver » ADC

Functions

void | adc_reset (adc_type *adc_x)
deinitialize the adc peripheral registers to their default reset values. More...
void | adc_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the specified adc peripheral. More...
void | adc_combine_mode_select (adc_combine_mode_type combine_mode)
select combine mode of the specified adc peripheral. More...
void | adc_base_default_para_init (adc_base_config_type *adc_base_struct)
adc base default para init. More...
void | adc_base_config (adc_type *adc_x, adc_base_config_type *adc_base_struct)
initialize the adc peripheral according to the specified parameters. More...
void | adc_dma_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the adc dma transfer. More...
void | adc_interrupt_enable (adc_type *adc_x, uint32_t adc_int, confirm_state new_state)
enable or disable the specified adc interrupts. More...
void | adc_calibration_init (adc_type *adc_x)
initialize calibration register of the specified adc peripheral. More...
flag_status | adc_calibration_init_status_get (adc_type *adc_x)
get calibration register's initialize status of the specified adc peripheral. More...
void | adc_calibration_start (adc_type *adc_x)
start calibration process of the specified adc peripheral. More...
flag_status | adc_calibration_status_get (adc_type *adc_x)
get calibration status of the specified adc peripheral. More...
void | adc_voltage_monitor_enable (adc_type *adc_x, adc_voltage_monitoring_type adc_voltage_monitoring)
enable or disable the voltage monitoring on single/all ordinary or preempt channels of the specified adc peripheral. More...
void | adc_voltage_monitor_threshold_value_set (adc_type *adc_x, uint16_t adc_high_threshold, uint16_t adc_low_threshold)
set voltage monitoring's high and low thresholds value of the specified adc peripheral. More...
void | adc_voltage_monitor_single_channel_select (adc_type *adc_x, adc_channel_select_type adc_channel)
select the voltage monitoring's channel of the specified adc peripheral. More...
void | adc_ordinary_channel_set (adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc peripheral. More...
void | adc_preempt_channel_length_set (adc_type *adc_x, uint8_t adc_channel_lenght)
set preempt channel lenghth of the specified adc peripheral. More...
void | adc_preempt_channel_set (adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
configure preempt channel's corresponding rank in the sequencer and sample time of the specified adc peripheral. More...
void | adc_ordinary_conversion_trigger_set (adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state)
enable or disable the ordinary channel's external trigger and set external trigger event of the specified adc peripheral. More...
void | adc_preempt_conversion_trigger_set (adc_type *adc_x, adc_preempt_trig_select_type adc_preempt_trig, confirm_state new_state)
enable or disable the preempt channel's external trigger and set external trigger event of the specified adc peripheral. More...
void | adc_preempt_offset_value_set (adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel, uint16_t adc_offset_value)
set preempt channel's conversion value offset of the specified adc peripheral. More...
void | adc_ordinary_part_count_set (adc_type *adc_x, uint8_t adc_channel_count)
set partitioned mode channel count of the specified adc peripheral. More...
void | adc_ordinary_part_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the partitioned mode on ordinary channel of the specified adc peripheral. More...
void | adc_preempt_part_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the partitioned mode on preempt channel of the specified adc peripheral. More...
void | adc_preempt_auto_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable automatic preempt group conversion of the specified adc peripheral. More...
void | adc_tempersensor_vintrv_enable (confirm_state new_state)
enable or disable the temperature sensor and vintrv channel. More...
void | adc_ordinary_software_trigger_enable (adc_type *adc_x, confirm_state new_state)
enable or disable ordinary software start conversion of the specified adc peripheral. More...
flag_status | adc_ordinary_software_trigger_status_get (adc_type *adc_x)
get ordinary software start conversion status of the specified adc peripheral. More...
void | adc_preempt_software_trigger_enable (adc_type *adc_x, confirm_state new_state)
enable or disable preempt software start conversion of the specified adc peripheral. More...
flag_status | adc_preempt_software_trigger_status_get (adc_type *adc_x)
get preempt software start conversion status of the specified adc peripheral. More...
uint16_t | adc_ordinary_conversion_data_get (adc_type *adc_x)
return the last conversion data for ordinary channel of the specified adc peripheral. More...
uint32_t | adc_combine_ordinary_conversion_data_get (void)
return the last conversion data for ordinary channel of combine adc. More...
uint16_t | adc_preempt_conversion_data_get (adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel)
return the conversion data for selection preempt channel of the specified adc peripheral. More...
flag_status | adc_flag_get (adc_type *adc_x, uint8_t adc_flag)
get flag of the specified adc peripheral. More...
void | adc_flag_clear (adc_type *adc_x, uint32_t adc_flag)
clear flag of the specified adc peripheral. More...

Detailed Description

Function Documentation

◆ adc_base_config()

void adc_base_config | ( | adc_type * | adc_x,
 |  | adc_base_config_type * | adc_base_struct
 | ) |  |

initialize the adc peripheral according to the specified parameters.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
sequence_mode | set the state of adc sequence mode. this parameter can be:TRUE or FALSE
repeat_mode | set the state of adc repeat conversion mode. this parameter can be:TRUE or FALSE
data_align set the state of adc data alignment. this parameter can be one of the following values:
  • ADC_RIGHT_ALIGNMENT
  • ADC_LEFT_ALIGNMENT
ordinary_channel_length configure the adc ordinary channel sequence length. this parameter can be:
  • (0x1~0xf)
Return values
none

Definition at line 137 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_base_default_para_init()

void adc_base_default_para_init ( adc_base_config_type * adc_base_struct )

adc base default para init.

Parameters
sequence_mode | set the state of adc sequence mode. this parameter can be:TRUE or FALSE
repeat_mode | set the state of adc repeat conversion mode. this parameter can be:TRUE or FALSE
data_align set the state of adc data alignment. this parameter can be one of the following values:
  • ADC_RIGHT_ALIGNMENT
  • ADC_LEFT_ALIGNMENT
ordinary_channel_length configure the adc ordinary channel sequence length. this parameter can be:
  • (0x1~0xf)
Return values
none

Definition at line 111 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_calibration_init()

void adc_calibration_init ( adc_type * adc_x )

initialize calibration register of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
none

Definition at line 192 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_calibration_init_status_get()

flag_status adc_calibration_init_status_get ( adc_type * adc_x )

get calibration register's initialize status of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
the new state of reset calibration register status(SET or RESET).

Definition at line 204 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_calibration_start()

void adc_calibration_start ( adc_type * adc_x )

start calibration process of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
none

Definition at line 223 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_calibration_status_get()

flag_status adc_calibration_status_get ( adc_type * adc_x )

get calibration status of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
the new state of calibration status(SET or RESET).

Definition at line 235 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_combine_mode_select()

void adc_combine_mode_select ( adc_combine_mode_type combine_mode )

select combine mode of the specified adc peripheral.

Parameters
combine_mode select the adc combine mode. this parameter can be one of the following values:
  • ADC_INDEPENDENT_MODE
  • ADC_ORDINARY_SMLT_PREEMPT_SMLT_MODE
  • ADC_ORDINARY_SMLT_PREEMPT_INTERLTRIG_MODE
  • ADC_ORDINARY_SHORTSHIFT_PREEMPT_SMLT_MODE
  • ADC_ORDINARY_LONGSHIFT_PREEMPT_SMLT_MODE
  • ADC_PREEMPT_SMLT_ONLY_MODE
  • ADC_ORDINARY_SMLT_ONLY_MODE
  • ADC_ORDINARY_SHORTSHIFT_ONLY_MODE
  • ADC_ORDINARY_LONGSHIFT_ONLY_MODE
  • ADC_PREEMPT_INTERLTRIG_ONLY_MODE
Return values
none

Definition at line 91 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_combine_ordinary_conversion_data_get()

uint32_t adc_combine_ordinary_conversion_data_get ( void )

return the last conversion data for ordinary channel of combine adc.

Return values
the last conversion data for ordinary channel.

Definition at line 828 of file at32f415_adc.c.

◆ adc_dma_mode_enable()

void adc_dma_mode_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the adc dma transfer.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of the adc dma transfer. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 154 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_enable()

void adc_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of a/d converter. this parameter can be: TRUE or FALSE. note:after adc ready,user set adcen bit will cause ordinary conversion
Return values
none

Definition at line 70 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_flag_clear()

void adc_flag_clear | ( | adc_type * | adc_x,
 |  | uint32_t | adc_flag
 | ) |  |

clear flag of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_flag select the adc flag. this parameter can be any combination of the following values:
  • ADC_VMOR_FLAG
  • ADC_CCE_FLAG(also can clear by reading the adc_x->odt)
  • ADC_PCCE_FLAG
  • ADC_PCCS_FLAG
  • ADC_OCCS_FLAG
Return values
none

Definition at line 912 of file at32f415_adc.c.

Referenced by ADC1_IRQHandler().

◆ adc_flag_get()

flag_status adc_flag_get | ( | adc_type * | adc_x,
 |  | uint8_t | adc_flag
 | ) |  |

get flag of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_flag select the adc flag. this parameter can be one of the following values:
  • ADC_VMOR_FLAG
  • ADC_CCE_FLAG
  • ADC_PCCE_FLAG
  • ADC_PCCS_FLAG(no interrupt associated)
  • ADC_OCCS_FLAG(no interrupt associated)
Return values
the new state of adc flag status(SET or RESET).

Definition at line 883 of file at32f415_adc.c.

Referenced by ADC1_IRQHandler().

◆ adc_interrupt_enable()

void adc_interrupt_enable | ( | adc_type * | adc_x,
 |  | uint32_t | adc_int,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the specified adc interrupts.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_int specifies the adc interrupt sources to be enabled or disabled. this parameter can be one of the following values:
  • ADC_VMOR_INT
  • ADC_CCE_INT
  • ADC_PCCE_INT
new_state | new state of the specified adc interrupts. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 173 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_ordinary_channel_set()

void adc_ordinary_channel_set | ( | adc_type * | adc_x,
 |  | adc_channel_select_type | adc_channel,
 |  | uint8_t | adc_sequence,
 |  | adc_sampletime_select_type | adc_sampletime
 | ) |  |

set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_channel select the channel. this parameter can be one of the following values:
  • ADC_CHANNEL_0 - ADC_CHANNEL_1 - ADC_CHANNEL_2 - ADC_CHANNEL_3
  • ADC_CHANNEL_4 - ADC_CHANNEL_5 - ADC_CHANNEL_6 - ADC_CHANNEL_7
  • ADC_CHANNEL_8 - ADC_CHANNEL_9 - ADC_CHANNEL_10 - ADC_CHANNEL_11
  • ADC_CHANNEL_12 - ADC_CHANNEL_13 - ADC_CHANNEL_14 - ADC_CHANNEL_15
  • ADC_CHANNEL_16 - ADC_CHANNEL_17
adc_sequence set rank in the ordinary group sequencer. this parameter must be:
  • between 1 to 16
adc_sampletime set the sampletime of adc channel. this parameter can be one of the following values:
  • ADC_SAMPLETIME_1_5
  • ADC_SAMPLETIME_7_5
  • ADC_SAMPLETIME_13_5
  • ADC_SAMPLETIME_28_5
  • ADC_SAMPLETIME_41_5
  • ADC_SAMPLETIME_55_5
  • ADC_SAMPLETIME_71_5
  • ADC_SAMPLETIME_239_5
Return values
none

Definition at line 336 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_ordinary_conversion_data_get()

uint16_t adc_ordinary_conversion_data_get ( adc_type * adc_x )

return the last conversion data for ordinary channel of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
the last conversion data for ordinary channel.

Definition at line 819 of file at32f415_adc.c.

◆ adc_ordinary_conversion_trigger_set()

void adc_ordinary_conversion_trigger_set | ( | adc_type * | adc_x,
 |  | adc_ordinary_trig_select_type | adc_ordinary_trig,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the ordinary channel's external trigger and set external trigger event of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_ordinary_trig select the external trigger event. this parameter can be one of the following values: adc1
  • ADC12_ORDINARY_TRIG_TMR1CH1 - ADC12_ORDINARY_TRIG_TMR1CH2 - ADC12_ORDINARY_TRIG_TMR1CH3 - ADC12_ORDINARY_TRIG_TMR2CH2
  • ADC12_ORDINARY_TRIG_TMR3TRGOUT - ADC12_ORDINARY_TRIG_TMR4CH4 - ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT - ADC12_ORDINARY_TRIG_SOFTWARE
  • ADC12_ORDINARY_TRIG_TMR1TRGOUT
new_state | new state of ordinary channel's external trigger. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 592 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_ordinary_part_count_set()

void adc_ordinary_part_count_set | ( | adc_type * | adc_x,
 |  | uint8_t | adc_channel_count
 | ) |  |

set partitioned mode channel count of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_channel_count configure the adc partitioned mode channel count. this parameter can be:
  • (0x1~0x8)
Return values
none

Definition at line 686 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_ordinary_part_mode_enable()

void adc_ordinary_part_mode_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the partitioned mode on ordinary channel of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of ordinary channel's partitioned mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 701 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_ordinary_software_trigger_enable()

void adc_ordinary_software_trigger_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable ordinary software start conversion of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of ordinary software start conversion. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 755 of file at32f415_adc.c.

Referenced by main().

◆ adc_ordinary_software_trigger_status_get()

flag_status adc_ordinary_software_trigger_status_get ( adc_type * adc_x )

get ordinary software start conversion status of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
the new state of ordinary software start conversion status(SET or RESET).

Definition at line 767 of file at32f415_adc.c.

◆ adc_preempt_auto_mode_enable()

void adc_preempt_auto_mode_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable automatic preempt group conversion of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of automatic preempt group conversion. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 729 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_preempt_channel_length_set()

void adc_preempt_channel_length_set | ( | adc_type * | adc_x,
 |  | uint8_t | adc_channel_lenght
 | ) |  |

set preempt channel lenghth of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_channel_lenght set the adc preempt channel lenghth. this parameter can be:
  • (0x1~0x4)
Return values
none

Definition at line 462 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_preempt_channel_set()

void adc_preempt_channel_set | ( | adc_type * | adc_x,
 |  | adc_channel_select_type | adc_channel,
 |  | uint8_t | adc_sequence,
 |  | adc_sampletime_select_type | adc_sampletime
 | ) |  |

configure preempt channel's corresponding rank in the sequencer and sample time of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_channel select the channel. this parameter can be one of the following values:
  • ADC_CHANNEL_0 - ADC_CHANNEL_1 - ADC_CHANNEL_2 - ADC_CHANNEL_3
  • ADC_CHANNEL_4 - ADC_CHANNEL_5 - ADC_CHANNEL_6 - ADC_CHANNEL_7
  • ADC_CHANNEL_8 - ADC_CHANNEL_9 - ADC_CHANNEL_10 - ADC_CHANNEL_11
  • ADC_CHANNEL_12 - ADC_CHANNEL_13 - ADC_CHANNEL_14 - ADC_CHANNEL_15
  • ADC_CHANNEL_16 - ADC_CHANNEL_17
adc_sequence set rank in the preempt group sequencer. this parameter must be:
  • between 1 to 4
adc_sampletime config the sampletime of adc channel. this parameter can be one of the following values:
  • ADC_SAMPLETIME_1_5
  • ADC_SAMPLETIME_7_5
  • ADC_SAMPLETIME_13_5
  • ADC_SAMPLETIME_28_5
  • ADC_SAMPLETIME_41_5
  • ADC_SAMPLETIME_55_5
  • ADC_SAMPLETIME_71_5
  • ADC_SAMPLETIME_239_5
Return values
none

Definition at line 494 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_preempt_conversion_data_get()

uint16_t adc_preempt_conversion_data_get | ( | adc_type * | adc_x,
 |  | adc_preempt_channel_type | adc_preempt_channel
 | ) |  |

return the conversion data for selection preempt channel of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_preempt_channel select the preempt channel. this parameter can be one of the following values:
  • ADC_PREEMPTED_CHANNEL_1
  • ADC_PREEMPTED_CHANNEL_2
  • ADC_PREEMPTED_CHANNEL_3
  • ADC_PREEMPTED_CHANNEL_4
Return values
the conversion data for selection preempt channel.

Definition at line 846 of file at32f415_adc.c.

Referenced by ADC1_IRQHandler().

◆ adc_preempt_conversion_trigger_set()

void adc_preempt_conversion_trigger_set | ( | adc_type * | adc_x,
 |  | adc_preempt_trig_select_type | adc_preempt_trig,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the preempt channel's external trigger and set external trigger event of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_preempt_trig select the external trigger event. this parameter can be one of the following values: adc1
  • ADC12_PREEMPT_TRIG_TMR1TRGOUT - ADC12_PREEMPT_TRIG_TMR1CH4 - ADC12_PREEMPT_TRIG_TMR2TRGOUT - ADC12_PREEMPT_TRIG_TMR2CH1
  • ADC12_PREEMPT_TRIG_TMR3CH4 - ADC12_PREEMPT_TRIG_TMR4TRGOUT - ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4 - ADC12_PREEMPT_TRIG_SOFTWARE
  • ADC12_PREEMPT_TRIG_TMR1CH1
new_state | new state of preempt channel's external trigger. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 623 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_preempt_offset_value_set()

void adc_preempt_offset_value_set | ( | adc_type * | adc_x,
 |  | adc_preempt_channel_type | adc_preempt_channel,
 |  | uint16_t | adc_offset_value
 | ) |  |

set preempt channel's conversion value offset of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_preempt_channel select the preempt channel. this parameter can be one of the following values:
  • ADC_PREEMPT_CHANNEL_1
  • ADC_PREEMPT_CHANNEL_2
  • ADC_PREEMPT_CHANNEL_3
  • ADC_PREEMPT_CHANNEL_4
adc_offset_value set the adc preempt channel's conversion value offset. this parameter can be:
  • (0x000~0xFFF)
Return values
none

Definition at line 655 of file at32f415_adc.c.

◆ adc_preempt_part_mode_enable()

void adc_preempt_part_mode_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the partitioned mode on preempt channel of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of preempt channel's partitioned mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 715 of file at32f415_adc.c.

◆ adc_preempt_software_trigger_enable()

void adc_preempt_software_trigger_enable | ( | adc_type * | adc_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable preempt software start conversion of the specified adc peripheral.

Parameters
adc_x | select the adc peripheral. this parameter can be one of the following values: ADC1.
new_state | new state of preempt software start conversion. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 788 of file at32f415_adc.c.

◆ adc_preempt_software_trigger_status_get()

flag_status adc_preempt_software_trigger_status_get ( adc_type * adc_x )

get preempt software start conversion status of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
the new state of preempt software start conversion status(SET or RESET).

Definition at line 800 of file at32f415_adc.c.

◆ adc_reset()

void adc_reset ( adc_type * adc_x )

deinitialize the adc peripheral registers to their default reset values.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
Return values
none

Definition at line 51 of file at32f415_adc.c.

◆ adc_tempersensor_vintrv_enable()

void adc_tempersensor_vintrv_enable ( confirm_state new_state )

enable or disable the temperature sensor and vintrv channel.

Parameters
new_state new state of Internal temperature sensor and vintrv. this parameter can be: TRUE or FALSE. note:this bit is present only in adc1
Return values
none

Definition at line 741 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_voltage_monitor_enable()

void adc_voltage_monitor_enable | ( | adc_type * | adc_x,
 |  | adc_voltage_monitoring_type | adc_voltage_monitoring
 | ) |  |

enable or disable the voltage monitoring on single/all ordinary or preempt channels of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_voltage_monitoring choose the adc_voltage_monitoring config. this parameter can be one of the following values:
  • ADC_VMONITOR_SINGLE_ORDINARY
  • ADC_VMONITOR_SINGLE_PREEMPT
  • ADC_VMONITOR_SINGLE_ORDINARY_PREEMPT
  • ADC_VMONITOR_ALL_ORDINARY
  • ADC_VMONITOR_ALL_PREEMPT
  • ADC_VMONITOR_ALL_ORDINARY_PREEMPT
  • ADC_VMONITOR_NONE
Return values
none

Definition at line 263 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_voltage_monitor_single_channel_select()

void adc_voltage_monitor_single_channel_select | ( | adc_type * | adc_x,
 |  | adc_channel_select_type | adc_channel
 | ) |  |

select the voltage monitoring's channel of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_channel select the channel. this parameter can be one of the following values:
  • ADC_CHANNEL_0 - ADC_CHANNEL_1 - ADC_CHANNEL_2 - ADC_CHANNEL_3
  • ADC_CHANNEL_4 - ADC_CHANNEL_5 - ADC_CHANNEL_6 - ADC_CHANNEL_7
  • ADC_CHANNEL_8 - ADC_CHANNEL_9 - ADC_CHANNEL_10 - ADC_CHANNEL_11
  • ADC_CHANNEL_12 - ADC_CHANNEL_13 - ADC_CHANNEL_14 - ADC_CHANNEL_15
  • ADC_CHANNEL_16 - ADC_CHANNEL_17
Return values
none

Definition at line 304 of file at32f415_adc.c.

Referenced by adc_config().

◆ adc_voltage_monitor_threshold_value_set()

void adc_voltage_monitor_threshold_value_set | ( | adc_type * | adc_x,
 |  | uint16_t | adc_high_threshold,
 |  | uint16_t | adc_low_threshold
 | ) |  |

set voltage monitoring's high and low thresholds value of the specified adc peripheral.

Parameters
adc_x select the adc peripheral. this parameter can be one of the following values: ADC1.
adc_high_threshold voltage monitoring's high thresholds value. this parameter can be:
  • (0x000~0xFFF)
adc_low_threshold voltage monitoring's low thresholds value. this parameter can be:
  • (0x000~0xFFF)
Return values
none

Definition at line 284 of file at32f415_adc.c.

Referenced by adc_config().


AT32F415 Firmwary Library: CAN

Modules | Macros
CAN
AT32F415_periph_driver

CAN driver modules. More...

Modules

CAN_timeout_count
CAN_flags_definition
can flag

CAN_interrupts_definition
can interrupt

CAN_exported_types
CAN_exported_functions
CAN_private_functions

Macros

#define | CAN_MSTS_EOIF_VAL ((uint32_t)0x00000004)
can flag clear operation macro definition val More...
#define | CAN_MSTS_QDZIF_VAL ((uint32_t)0x00000008)
#define | CAN_MSTS_EDZIF_VAL ((uint32_t)0x00000010)
#define | CAN_TSTS_TM0TCF_VAL ((uint32_t)0x00000001)
#define | CAN_TSTS_TM1TCF_VAL ((uint32_t)0x00000100)
#define | CAN_TSTS_TM2TCF_VAL ((uint32_t)0x00010000)
#define | CAN_TSTS_TM0CT_VAL ((uint32_t)0x00000080)
#define | CAN_TSTS_TM1CT_VAL ((uint32_t)0x00008000)
#define | CAN_TSTS_TM2CT_VAL ((uint32_t)0x00800000)
#define | CAN_RF0_RF0FF_VAL ((uint32_t)0x00000008)
#define | CAN_RF0_RF0OF_VAL ((uint32_t)0x00000010)
#define | CAN_RF0_RF0R_VAL ((uint32_t)0x00000020)
#define | CAN_RF1_RF1FF_VAL ((uint32_t)0x00000008)
#define | CAN_RF1_RF1OF_VAL ((uint32_t)0x00000010)
#define | CAN_RF1_RF1R_VAL ((uint32_t)0x00000020)
#define | CAN1 ((can_type *) CAN1_BASE)

Detailed Description

CAN driver modules.

Macro Definition Documentation

◆ CAN1

#define CAN1 ((can_type *) CAN1_BASE)

Definition at line 938 of file at32f415_can.h.

◆ CAN_MSTS_EDZIF_VAL

#define CAN_MSTS_EDZIF_VAL ((uint32_t)0x00000010)

edzif bit value, it clear by writing 1

Definition at line 115 of file at32f415_can.h.

◆ CAN_MSTS_EOIF_VAL

#define CAN_MSTS_EOIF_VAL ((uint32_t)0x00000004)

can flag clear operation macro definition val

eoif bit value, it clear by writing 1

Definition at line 113 of file at32f415_can.h.

◆ CAN_MSTS_QDZIF_VAL

#define CAN_MSTS_QDZIF_VAL ((uint32_t)0x00000008)

qdzif bit value, it clear by writing 1

Definition at line 114 of file at32f415_can.h.

◆ CAN_RF0_RF0FF_VAL

#define CAN_RF0_RF0FF_VAL ((uint32_t)0x00000008)

rf0ff bit value, it clear by writing 1

Definition at line 122 of file at32f415_can.h.

◆ CAN_RF0_RF0OF_VAL

#define CAN_RF0_RF0OF_VAL ((uint32_t)0x00000010)

rf0of bit value, it clear by writing 1

Definition at line 123 of file at32f415_can.h.

◆ CAN_RF0_RF0R_VAL

#define CAN_RF0_RF0R_VAL ((uint32_t)0x00000020)

rf0r bit value, it clear by writing 1

Definition at line 124 of file at32f415_can.h.

◆ CAN_RF1_RF1FF_VAL

#define CAN_RF1_RF1FF_VAL ((uint32_t)0x00000008)

rf1ff bit value, it clear by writing 1

Definition at line 125 of file at32f415_can.h.

◆ CAN_RF1_RF1OF_VAL

#define CAN_RF1_RF1OF_VAL ((uint32_t)0x00000010)

rf1of bit value, it clear by writing 1

Definition at line 126 of file at32f415_can.h.

◆ CAN_RF1_RF1R_VAL

#define CAN_RF1_RF1R_VAL ((uint32_t)0x00000020)

rf1r bit value, it clear by writing 1

Definition at line 127 of file at32f415_can.h.

◆ CAN_TSTS_TM0CT_VAL

#define CAN_TSTS_TM0CT_VAL ((uint32_t)0x00000080)

tm0ct bit value, it clear by writing 1

Definition at line 119 of file at32f415_can.h.

◆ CAN_TSTS_TM0TCF_VAL

#define CAN_TSTS_TM0TCF_VAL ((uint32_t)0x00000001)

tm0tcf bit value, it clear by writing 1

Definition at line 116 of file at32f415_can.h.

◆ CAN_TSTS_TM1CT_VAL

#define CAN_TSTS_TM1CT_VAL ((uint32_t)0x00008000)

tm1ct bit value, it clear by writing 1

Definition at line 120 of file at32f415_can.h.

◆ CAN_TSTS_TM1TCF_VAL

#define CAN_TSTS_TM1TCF_VAL ((uint32_t)0x00000100)

tm1tcf bit value, it clear by writing 1

Definition at line 117 of file at32f415_can.h.

◆ CAN_TSTS_TM2CT_VAL

#define CAN_TSTS_TM2CT_VAL ((uint32_t)0x00800000)

tm2ct bit value, it clear by writing 1

Definition at line 121 of file at32f415_can.h.

◆ CAN_TSTS_TM2TCF_VAL

#define CAN_TSTS_TM2TCF_VAL ((uint32_t)0x00010000)

tm2tcf bit value, it clear by writing 1

Definition at line 118 of file at32f415_can.h.


AT32F415 Firmwary Library: CAN_timeout_count

Macros
CAN_timeout_count
AT32F415_periph_driver » CAN

Macros

#define | FZC_TIMEOUT ((uint32_t)0x0000FFFF)
#define | DZC_TIMEOUT ((uint32_t)0x0000FFFF)

Detailed Description

Macro Definition Documentation

◆ DZC_TIMEOUT

#define DZC_TIMEOUT ((uint32_t)0x0000FFFF)

time out for dzc bit

Definition at line 53 of file at32f415_can.h.

◆ FZC_TIMEOUT

#define FZC_TIMEOUT ((uint32_t)0x0000FFFF)

time out for fzc bit

Definition at line 52 of file at32f415_can.h.


AT32F415 Firmwary Library: CAN_flags_definition

Macros
CAN_flags_definition
AT32F415_periph_driver » CAN

can flag
More...

Macros

#define | CAN_EAF_FLAG ((uint32_t)0x01)
#define | CAN_EPF_FLAG ((uint32_t)0x02)
#define | CAN_BOF_FLAG ((uint32_t)0x03)
#define | CAN_ETR_FLAG ((uint32_t)0x04)
#define | CAN_EOIF_FLAG ((uint32_t)0x05)
#define | CAN_TM0TCF_FLAG ((uint32_t)0x06)
#define | CAN_TM1TCF_FLAG ((uint32_t)0x07)
#define | CAN_TM2TCF_FLAG ((uint32_t)0x08)
#define | CAN_RF0MN_FLAG ((uint32_t)0x09)
#define | CAN_RF0FF_FLAG ((uint32_t)0x0A)
#define | CAN_RF0OF_FLAG ((uint32_t)0x0B)
#define | CAN_RF1MN_FLAG ((uint32_t)0x0C)
#define | CAN_RF1FF_FLAG ((uint32_t)0x0D)
#define | CAN_RF1OF_FLAG ((uint32_t)0x0E)
#define | CAN_QDZIF_FLAG ((uint32_t)0x0F)
#define | CAN_EDZC_FLAG ((uint32_t)0x10)
#define | CAN_TMEF_FLAG ((uint32_t)0x11)

Detailed Description

can flag

Macro Definition Documentation

◆ CAN_BOF_FLAG

#define CAN_BOF_FLAG ((uint32_t)0x03)

bus-off flag

Definition at line 66 of file at32f415_can.h.

◆ CAN_EAF_FLAG

#define CAN_EAF_FLAG ((uint32_t)0x01)

error active flag

Definition at line 64 of file at32f415_can.h.

◆ CAN_EDZC_FLAG

#define CAN_EDZC_FLAG ((uint32_t)0x10)

enter doze mode confirm flag

Definition at line 79 of file at32f415_can.h.

◆ CAN_EOIF_FLAG

#define CAN_EOIF_FLAG ((uint32_t)0x05)

error occur interrupt flag

Definition at line 68 of file at32f415_can.h.

◆ CAN_EPF_FLAG

#define CAN_EPF_FLAG ((uint32_t)0x02)

error passive flag

Definition at line 65 of file at32f415_can.h.

◆ CAN_ETR_FLAG

#define CAN_ETR_FLAG ((uint32_t)0x04)

error type record flag

Definition at line 67 of file at32f415_can.h.

◆ CAN_QDZIF_FLAG

#define CAN_QDZIF_FLAG ((uint32_t)0x0F)

quit doze mode interrupt flag

Definition at line 78 of file at32f415_can.h.

◆ CAN_RF0FF_FLAG

#define CAN_RF0FF_FLAG ((uint32_t)0x0A)

receive fifo 0 full flag

Definition at line 73 of file at32f415_can.h.

◆ CAN_RF0MN_FLAG

#define CAN_RF0MN_FLAG ((uint32_t)0x09)

receive fifo 0 message num flag

Definition at line 72 of file at32f415_can.h.

◆ CAN_RF0OF_FLAG

#define CAN_RF0OF_FLAG ((uint32_t)0x0B)

receive fifo 0 overflow flag

Definition at line 74 of file at32f415_can.h.

◆ CAN_RF1FF_FLAG

#define CAN_RF1FF_FLAG ((uint32_t)0x0D)

receive fifo 1 full flag

Definition at line 76 of file at32f415_can.h.

◆ CAN_RF1MN_FLAG

#define CAN_RF1MN_FLAG ((uint32_t)0x0C)

receive fifo 1 message num flag

Definition at line 75 of file at32f415_can.h.

◆ CAN_RF1OF_FLAG

#define CAN_RF1OF_FLAG ((uint32_t)0x0E)

receive fifo 1 overflow flag

Definition at line 77 of file at32f415_can.h.

◆ CAN_TM0TCF_FLAG

#define CAN_TM0TCF_FLAG ((uint32_t)0x06)

transmit mailbox 0 transmission completed flag

Definition at line 69 of file at32f415_can.h.

◆ CAN_TM1TCF_FLAG

#define CAN_TM1TCF_FLAG ((uint32_t)0x07)

transmit mailbox 1 transmission completed flag

Definition at line 70 of file at32f415_can.h.

◆ CAN_TM2TCF_FLAG

#define CAN_TM2TCF_FLAG ((uint32_t)0x08)

transmit mailbox 2 transmission completed flag

Definition at line 71 of file at32f415_can.h.

◆ CAN_TMEF_FLAG

#define CAN_TMEF_FLAG ((uint32_t)0x11)

transmit mailbox empty flag

Definition at line 80 of file at32f415_can.h.


AT32F415 Firmwary Library: CAN_interrupts_definition

Macros
CAN_interrupts_definition
AT32F415_periph_driver » CAN

can interrupt
More...

Macros

#define | CAN_TCIEN_INT ((uint32_t)0x00000001)
#define | CAN_RF0MIEN_INT ((uint32_t)0x00000002)
#define | CAN_RF0FIEN_INT ((uint32_t)0x00000004)
#define | CAN_RF0OIEN_INT ((uint32_t)0x00000008)
#define | CAN_RF1MIEN_INT ((uint32_t)0x00000010)
#define | CAN_RF1FIEN_INT ((uint32_t)0x00000020)
#define | CAN_RF1OIEN_INT ((uint32_t)0x00000040)
#define | CAN_EAIEN_INT ((uint32_t)0x00000100)
#define | CAN_EPIEN_INT ((uint32_t)0x00000200)
#define | CAN_BOIEN_INT ((uint32_t)0x00000400)
#define | CAN_ETRIEN_INT ((uint32_t)0x00000800)
#define | CAN_EOIEN_INT ((uint32_t)0x00008000)
#define | CAN_QDZIEN_INT ((uint32_t)0x00010000)
#define | CAN_EDZIEN_INT ((uint32_t)0x00020000)

Detailed Description

can interrupt

Macro Definition Documentation

◆ CAN_BOIEN_INT

#define CAN_BOIEN_INT ((uint32_t)0x00000400)

bus-off interrupt

Definition at line 100 of file at32f415_can.h.

◆ CAN_EAIEN_INT

#define CAN_EAIEN_INT ((uint32_t)0x00000100)

error active interrupt

Definition at line 98 of file at32f415_can.h.

◆ CAN_EDZIEN_INT

#define CAN_EDZIEN_INT ((uint32_t)0x00020000)

enter doze mode confirm interrupt

Definition at line 104 of file at32f415_can.h.

◆ CAN_EOIEN_INT

#define CAN_EOIEN_INT ((uint32_t)0x00008000)

error occur interrupt

Definition at line 102 of file at32f415_can.h.

◆ CAN_EPIEN_INT

#define CAN_EPIEN_INT ((uint32_t)0x00000200)

error passive interrupt

Definition at line 99 of file at32f415_can.h.

◆ CAN_ETRIEN_INT

#define CAN_ETRIEN_INT ((uint32_t)0x00000800)

error type record interrupt

Definition at line 101 of file at32f415_can.h.

◆ CAN_QDZIEN_INT

#define CAN_QDZIEN_INT ((uint32_t)0x00010000)

quit doze mode interrupt

Definition at line 103 of file at32f415_can.h.

◆ CAN_RF0FIEN_INT

#define CAN_RF0FIEN_INT ((uint32_t)0x00000004)

receive fifo 0 full interrupt

Definition at line 93 of file at32f415_can.h.

◆ CAN_RF0MIEN_INT

#define CAN_RF0MIEN_INT ((uint32_t)0x00000002)

receive fifo 0 message interrupt

Definition at line 92 of file at32f415_can.h.

◆ CAN_RF0OIEN_INT

#define CAN_RF0OIEN_INT ((uint32_t)0x00000008)

receive fifo 0 overflow interrupt

Definition at line 94 of file at32f415_can.h.

◆ CAN_RF1FIEN_INT

#define CAN_RF1FIEN_INT ((uint32_t)0x00000020)

receive fifo 1 full interrupt

Definition at line 96 of file at32f415_can.h.

◆ CAN_RF1MIEN_INT

#define CAN_RF1MIEN_INT ((uint32_t)0x00000010)

receive fifo 1 message interrupt

Definition at line 95 of file at32f415_can.h.

◆ CAN_RF1OIEN_INT

#define CAN_RF1OIEN_INT ((uint32_t)0x00000040)

receive fifo 1 overflow interrupt

Definition at line 97 of file at32f415_can.h.

◆ CAN_TCIEN_INT

#define CAN_TCIEN_INT ((uint32_t)0x00000001)

transmission complete interrupt

Definition at line 91 of file at32f415_can.h.


AT32F415 Firmwary Library: CAN_exported_types

Data Structures | Enumerations
CAN_exported_types
AT32F415_periph_driver » CAN

Data Structures

struct | can_base_type
can init structure definition More...
struct | can_baudrate_type
can baudrate structure definition More...
struct | can_filter_init_type
can filter init structure definition More...
struct | can_tx_message_type
can tx message structure definition More...
struct | can_rx_message_type
can rx message structure definition More...
struct | can_tx_mailbox_type
can controller area network tx mailbox More...
struct | can_fifo_mailbox_type
can controller area network fifo mailbox More...
struct | can_filter_register_type
can controller area network filter bit register More...
struct | can_type
type define can register all More...

Enumerations

enum | can_filter_fifo_type { CAN_FILTER_FIFO0 = 0x00 , CAN_FILTER_FIFO1 = 0x01 }
can filter fifo More...
enum | can_filter_mode_type { CAN_FILTER_MODE_ID_MASK = 0x00 , CAN_FILTER_MODE_ID_LIST = 0x01 }
can filter mode More...
enum | can_filter_bit_width_type { CAN_FILTER_16BIT = 0x00 , CAN_FILTER_32BIT = 0x01 }
can filter bit width select More...
enum | can_mode_type { CAN_MODE_COMMUNICATE = 0x00 , CAN_MODE_LOOPBACK = 0x01 , CAN_MODE_LISTENONLY = 0x02 , CAN_MODE_LISTENONLY_LOOPBACK = 0x03 }
can mode More...
enum | can_operating_mode_type { CAN_OPERATINGMODE_FREEZE = 0x00 , CAN_OPERATINGMODE_DOZE = 0x01 , CAN_OPERATINGMODE_COMMUNICATE = 0x02 }
can operating mode More...
enum | can_rsaw_type { CAN_RSAW_1TQ = 0x00 , CAN_RSAW_2TQ = 0x01 , CAN_RSAW_3TQ = 0x02 , CAN_RSAW_4TQ = 0x03 }
can resynchronization adjust width More...
enum can_bts1_type {
CAN_BTS1_1TQ = 0x00 , CAN_BTS1_2TQ = 0x01 , CAN_BTS1_3TQ = 0x02 , CAN_BTS1_4TQ = 0x03 ,
CAN_BTS1_5TQ = 0x04 , CAN_BTS1_6TQ = 0x05 , CAN_BTS1_7TQ = 0x06 , CAN_BTS1_8TQ = 0x07 ,
CAN_BTS1_9TQ = 0x08 , CAN_BTS1_10TQ = 0x09 , CAN_BTS1_11TQ = 0x0A , CAN_BTS1_12TQ = 0x0B ,
CAN_BTS1_13TQ = 0x0C , CAN_BTS1_14TQ = 0x0D , CAN_BTS1_15TQ = 0x0E , CAN_BTS1_16TQ = 0x0F
}
can bit time segment 1 More...
enum can_bts2_type {
CAN_BTS2_1TQ = 0x00 , CAN_BTS2_2TQ = 0x01 , CAN_BTS2_3TQ = 0x02 , CAN_BTS2_4TQ = 0x03 ,
CAN_BTS2_5TQ = 0x04 , CAN_BTS2_6TQ = 0x05 , CAN_BTS2_7TQ = 0x06 , CAN_BTS2_8TQ = 0x07
}
can bit time segment 2 More...
enum | can_identifier_type { CAN_ID_STANDARD = 0x00 , CAN_ID_EXTENDED = 0x01 }
can identifier type More...
enum | can_trans_frame_type { CAN_TFT_DATA = 0x00 , CAN_TFT_REMOTE = 0x01 }
can transmission frame type More...
enum | can_tx_mailbox_num_type { CAN_TX_MAILBOX0 = 0x00 , CAN_TX_MAILBOX1 = 0x01 , CAN_TX_MAILBOX2 = 0x02 }
can tx mailboxes More...
enum | can_rx_fifo_num_type { CAN_RX_FIFO0 = 0x00 , CAN_RX_FIFO1 = 0x01 }
can receive fifo More...
enum | can_transmit_status_type { CAN_TX_STATUS_FAILED = 0x00 , CAN_TX_STATUS_SUCCESSFUL = 0x01 , CAN_TX_STATUS_PENDING = 0x02 , CAN_TX_STATUS_NO_EMPTY = 0x04 }
can transmit status More...
enum | can_enter_doze_status_type { CAN_ENTER_DOZE_FAILED = 0x00 , CAN_ENTER_DOZE_SUCCESSFUL = 0x01 }
can enter doze mode status More...
enum | can_quit_doze_status_type { CAN_QUIT_DOZE_FAILED = 0x00 , CAN_QUIT_DOZE_SUCCESSFUL = 0x01 }
can quit doze mode status More...
enum | can_msg_discarding_rule_type { CAN_DISCARDING_FIRST_RECEIVED = 0x00 , CAN_DISCARDING_LAST_RECEIVED = 0x01 }
can message discarding rule select when overflow More...
enum | can_msg_sending_rule_type { CAN_SENDING_BY_ID = 0x00 , CAN_SENDING_BY_REQUEST = 0x01 }
can multiple message sending sequence rule More...
enum can_error_record_type {
CAN_ERRORRECORD_NOERR = 0x00 , CAN_ERRORRECORD_STUFFERR = 0x01 , CAN_ERRORRECORD_FORMERR = 0x02 , CAN_ERRORRECORD_ACKERR = 0x03 ,
CAN_ERRORRECORD_BITRECESSIVEERR = 0x04 , CAN_ERRORRECORD_BITDOMINANTERR = 0x05 , CAN_ERRORRECORD_CRCERR = 0x06 , CAN_ERRORRECORD_SOFTWARESETERR = 0x07
}
can error type record More...

Detailed Description

Enumeration Type Documentation

◆ can_bts1_type

enum can_bts1_type

can bit time segment 1

Enumerator
CAN_BTS1_1TQ | 1 time quantum
CAN_BTS1_2TQ | 2 time quantum
CAN_BTS1_3TQ | 3 time quantum
CAN_BTS1_4TQ | 4 time quantum
CAN_BTS1_5TQ | 5 time quantum
CAN_BTS1_6TQ | 6 time quantum
CAN_BTS1_7TQ | 7 time quantum
CAN_BTS1_8TQ | 8 time quantum
CAN_BTS1_9TQ | 9 time quantum
CAN_BTS1_10TQ | 10 time quantum
CAN_BTS1_11TQ | 11 time quantum
CAN_BTS1_12TQ | 12 time quantum
CAN_BTS1_13TQ | 13 time quantum
CAN_BTS1_14TQ | 14 time quantum
CAN_BTS1_15TQ | 15 time quantum
CAN_BTS1_16TQ | 16 time quantum

Definition at line 195 of file at32f415_can.h.

◆ can_bts2_type

enum can_bts2_type

can bit time segment 2

Enumerator
CAN_BTS2_1TQ | 1 time quantum
CAN_BTS2_2TQ | 2 time quantum
CAN_BTS2_3TQ | 3 time quantum
CAN_BTS2_4TQ | 4 time quantum
CAN_BTS2_5TQ | 5 time quantum
CAN_BTS2_6TQ | 6 time quantum
CAN_BTS2_7TQ | 7 time quantum
CAN_BTS2_8TQ | 8 time quantum

Definition at line 218 of file at32f415_can.h.

◆ can_enter_doze_status_type

enum can_enter_doze_status_type

can enter doze mode status

Enumerator
CAN_ENTER_DOZE_FAILED | can enter the doze mode failed
CAN_ENTER_DOZE_SUCCESSFUL | can enter the doze mode successful

Definition at line 281 of file at32f415_can.h.

◆ can_error_record_type

enum can_error_record_type

can error type record

Enumerator
CAN_ERRORRECORD_NOERR | no error
CAN_ERRORRECORD_STUFFERR | stuff error
CAN_ERRORRECORD_FORMERR | form error
CAN_ERRORRECORD_ACKERR | acknowledgment error
CAN_ERRORRECORD_BITRECESSIVEERR | bit recessive error
CAN_ERRORRECORD_BITDOMINANTERR | bit dominant error
CAN_ERRORRECORD_CRCERR | crc error
CAN_ERRORRECORD_SOFTWARESETERR | software set error

Definition at line 317 of file at32f415_can.h.

◆ can_filter_bit_width_type

enum can_filter_bit_width_type

can filter bit width select

Enumerator
CAN_FILTER_16BIT | two 16-bit filters
CAN_FILTER_32BIT | one 32-bit filter

Definition at line 154 of file at32f415_can.h.

◆ can_filter_fifo_type

enum can_filter_fifo_type

can filter fifo

Enumerator
CAN_FILTER_FIFO0 | filter fifo 0 assignment for filter x
CAN_FILTER_FIFO1 | filter fifo 1 assignment for filter x

Definition at line 136 of file at32f415_can.h.

◆ can_filter_mode_type

enum can_filter_mode_type

can filter mode

Enumerator
CAN_FILTER_MODE_ID_MASK | identifier mask mode
CAN_FILTER_MODE_ID_LIST | identifier list mode

Definition at line 145 of file at32f415_can.h.

◆ can_identifier_type

enum can_identifier_type

can identifier type

Enumerator
CAN_ID_STANDARD | standard Id
CAN_ID_EXTENDED | extended Id

Definition at line 233 of file at32f415_can.h.

◆ can_mode_type

enum can_mode_type

can mode

Enumerator
CAN_MODE_COMMUNICATE | communication mode
CAN_MODE_LOOPBACK | loopback mode
CAN_MODE_LISTENONLY | listen-only mode
CAN_MODE_LISTENONLY_LOOPBACK | loopback combined with listen-only mode

Definition at line 163 of file at32f415_can.h.

◆ can_msg_discarding_rule_type

enum can_msg_discarding_rule_type

can message discarding rule select when overflow

Enumerator
CAN_DISCARDING_FIRST_RECEIVED | can discarding the first received message
CAN_DISCARDING_LAST_RECEIVED | can discarding the last received message

Definition at line 299 of file at32f415_can.h.

◆ can_msg_sending_rule_type

enum can_msg_sending_rule_type

can multiple message sending sequence rule

Enumerator
CAN_SENDING_BY_ID | can sending the minimum id message first
CAN_SENDING_BY_REQUEST | can sending the first request message first

Definition at line 308 of file at32f415_can.h.

◆ can_operating_mode_type

enum can_operating_mode_type

can operating mode

Enumerator
CAN_OPERATINGMODE_FREEZE | freeze mode
CAN_OPERATINGMODE_DOZE | doze mode
CAN_OPERATINGMODE_COMMUNICATE | communication mode

Definition at line 174 of file at32f415_can.h.

◆ can_quit_doze_status_type

enum can_quit_doze_status_type

can quit doze mode status

Enumerator
CAN_QUIT_DOZE_FAILED | can quit doze mode failed
CAN_QUIT_DOZE_SUCCESSFUL | can quit doze mode successful

Definition at line 290 of file at32f415_can.h.

◆ can_rsaw_type

enum can_rsaw_type

can resynchronization adjust width

Enumerator
CAN_RSAW_1TQ | 1 time quantum
CAN_RSAW_2TQ | 2 time quantum
CAN_RSAW_3TQ | 3 time quantum
CAN_RSAW_4TQ | 4 time quantum

Definition at line 184 of file at32f415_can.h.

◆ can_rx_fifo_num_type

enum can_rx_fifo_num_type

can receive fifo

Enumerator
CAN_RX_FIFO0 | can fifo 0 used to receive
CAN_RX_FIFO1 | can fifo 1 used to receive

Definition at line 261 of file at32f415_can.h.

◆ can_trans_frame_type

enum can_trans_frame_type

can transmission frame type

Enumerator
CAN_TFT_DATA | data frame
CAN_TFT_REMOTE | remote frame

Definition at line 242 of file at32f415_can.h.

◆ can_transmit_status_type

enum can_transmit_status_type

can transmit status

Enumerator
CAN_TX_STATUS_FAILED | can transmission failed
CAN_TX_STATUS_SUCCESSFUL | can transmission successful
CAN_TX_STATUS_PENDING | can transmission pending
CAN_TX_STATUS_NO_EMPTY | can transmission no empty mailbox

Definition at line 270 of file at32f415_can.h.

◆ can_tx_mailbox_num_type

enum can_tx_mailbox_num_type

can tx mailboxes

Enumerator
CAN_TX_MAILBOX0 | can tx mailbox 0
CAN_TX_MAILBOX1 | can tx mailbox 1
CAN_TX_MAILBOX2 | can tx mailbox 2

Definition at line 251 of file at32f415_can.h.


AT32F415 Firmwary Library: can_base_type Struct Reference

Data Fields
can_base_type Struct Reference
AT32F415_periph_driver » CAN » CAN_exported_types

can init structure definition More...

#include <at32f415_can.h>

Data Fields

can_mode_type mode_selection
confirm_state ttc_enable
confirm_state aebo_enable
confirm_state aed_enable
confirm_state prsf_enable
can_msg_discarding_rule_type mdrsel_selection
can_msg_sending_rule_type mmssr_selection

Detailed Description

can init structure definition

Definition at line 332 of file at32f415_can.h.

Field Documentation

◆ aebo_enable

confirm_state can_base_type::aebo_enable

automatic exit bus-off enable

Definition at line 338 of file at32f415_can.h.

Referenced by can_base_init(), can_configuration(), and can_default_para_init().

◆ aed_enable

confirm_state can_base_type::aed_enable

automatic exit doze mode enable

Definition at line 340 of file at32f415_can.h.

Referenced by can_base_init(), can_configuration(), and can_default_para_init().

◆ mdrsel_selection

can_msg_discarding_rule_type can_base_type::mdrsel_selection

message discarding rule select when overflow

Definition at line 344 of file at32f415_can.h.

Referenced by can_base_init(), can_configuration(), and can_default_para_init().

◆ mmssr_selection

can_msg_sending_rule_type can_base_type::mmssr_selection

multiple message sending sequence rule

Definition at line 346 of file at32f415_can.h.

Referenced by can_base_init(), can_configuration(), and can_default_para_init().

◆ mode_selection

can_mode_type can_base_type::mode_selection

specifies the can mode.

Definition at line 334 of file at32f415_can.h.

Referenced by can_base_init(), can_configuration(), and can_default_para_init().

◆ prsf_enable

confirm_state can_base_type::prsf_enable

prohibit retransmission when sending fails enable

Definition at line 342 of file at32f415_can.h.

Referenced by can_base_init(), can_configuration(), and can_default_para_init().

◆ ttc_enable

confirm_state can_base_type::ttc_enable

time triggered communication mode enable

Definition at line 336 of file at32f415_can.h.

Referenced by can_base_init(), can_configuration(), and can_default_para_init().

The documentation for this struct was generated from the following file:
  • at32f415_can.h


AT32F415 Firmwary Library: can_baudrate_type Struct Reference

Data Fields
can_baudrate_type Struct Reference
AT32F415_periph_driver » CAN » CAN_exported_types

can baudrate structure definition More...

#include <at32f415_can.h>

Data Fields

uint16_t baudrate_div
can_rsaw_type rsaw_size
can_bts1_type bts1_size
can_bts2_type bts2_size

Detailed Description

can baudrate structure definition

Definition at line 353 of file at32f415_can.h.

Field Documentation

◆ baudrate_div

uint16_t can_baudrate_type::baudrate_div

baudrate division,this parameter can be 0x001~0x400.

Definition at line 355 of file at32f415_can.h.

Referenced by can_baudrate_default_para_init(), can_baudrate_set(), and can_configuration().

◆ bts1_size

can_bts1_type can_baudrate_type::bts1_size

bit time segment 1

Definition at line 359 of file at32f415_can.h.

Referenced by can_baudrate_default_para_init(), can_baudrate_set(), and can_configuration().

◆ bts2_size

can_bts2_type can_baudrate_type::bts2_size

bit time segment 2

Definition at line 361 of file at32f415_can.h.

Referenced by can_baudrate_default_para_init(), can_baudrate_set(), and can_configuration().

◆ rsaw_size

can_rsaw_type can_baudrate_type::rsaw_size

resynchronization adjust width

Definition at line 357 of file at32f415_can.h.

Referenced by can_baudrate_default_para_init(), can_baudrate_set(), and can_configuration().

The documentation for this struct was generated from the following file:
  • at32f415_can.h


AT32F415 Firmwary Library: can_filter_init_type Struct Reference

Data Fields
can_filter_init_type Struct Reference
AT32F415_periph_driver » CAN » CAN_exported_types

can filter init structure definition More...

#include <at32f415_can.h>

Data Fields

confirm_state filter_activate_enable
can_filter_mode_type filter_mode
can_filter_fifo_type filter_fifo
uint8_t | filter_number
can_filter_bit_width_type filter_bit
uint16_t | filter_id_high
uint16_t | filter_id_low
uint16_t | filter_mask_high
uint16_t | filter_mask_low

Detailed Description

can filter init structure definition

Definition at line 368 of file at32f415_can.h.

Field Documentation

◆ filter_activate_enable

confirm_state can_filter_init_type::filter_activate_enable

enable or disable the filter activate.

Definition at line 370 of file at32f415_can.h.

Referenced by can_configuration(), can_filter_default_para_init(), and can_filter_init().

◆ filter_bit

can_filter_bit_width_type can_filter_init_type::filter_bit

config the filter bit width 16bit or 32bit.

Definition at line 378 of file at32f415_can.h.

Referenced by can_configuration(), can_filter_default_para_init(), and can_filter_init().

◆ filter_fifo

can_filter_fifo_type can_filter_init_type::filter_fifo

config the fifo which will be assigned to the filter.

Definition at line 374 of file at32f415_can.h.

Referenced by can_configuration(), can_filter_default_para_init(), and can_filter_init().

◆ filter_id_high

uint16_t can_filter_init_type::filter_id_high

config the filter identification, for 32-bit configuration it's high 16 bits, for 16-bit configuration it's first.

Definition at line 380 of file at32f415_can.h.

Referenced by can_configuration(), can_filter_default_para_init(), and can_filter_init().

◆ filter_id_low

uint16_t can_filter_init_type::filter_id_low

config the filter identification, for 32-bit configuration it's low 16 bits, for 16-bit configuration it's second.

Definition at line 383 of file at32f415_can.h.

Referenced by can_configuration(), can_filter_default_para_init(), and can_filter_init().

◆ filter_mask_high

uint16_t can_filter_init_type::filter_mask_high

config the filter mask or identification, according to the filtering mode, for 32-bit configuration it's high 16 bits, for 16-bit configuration it's first.

Definition at line 386 of file at32f415_can.h.

Referenced by can_configuration(), can_filter_default_para_init(), and can_filter_init().

◆ filter_mask_low

uint16_t can_filter_init_type::filter_mask_low

config the filter mask or identification, according to the filtering mode, for 32-bit configuration it's low 16 bits, for 16-bit configuration it's second.

Definition at line 389 of file at32f415_can.h.

Referenced by can_configuration(), can_filter_default_para_init(), and can_filter_init().

◆ filter_mode

can_filter_mode_type can_filter_init_type::filter_mode

config the filter mode mask or list.

Definition at line 372 of file at32f415_can.h.

Referenced by can_configuration(), can_filter_default_para_init(), and can_filter_init().

◆ filter_number

uint8_t can_filter_init_type::filter_number

config the filter number, parameter ranges from 0 to 13.

Definition at line 376 of file at32f415_can.h.

Referenced by can_configuration(), can_filter_default_para_init(), and can_filter_init().

The documentation for this struct was generated from the following file:
  • at32f415_can.h


AT32F415 Firmwary Library: can_tx_message_type Struct Reference

Data Fields
can_tx_message_type Struct Reference
AT32F415_periph_driver » CAN » CAN_exported_types

can tx message structure definition More...

#include <at32f415_can.h>

Data Fields

uint32_t | standard_id
uint32_t | extended_id
can_identifier_type id_type
can_trans_frame_type frame_type
uint8_t | dlc
uint8_t | data [8]

Detailed Description

can tx message structure definition

Definition at line 396 of file at32f415_can.h.

Field Documentation

◆ data

uint8_t can_tx_message_type::data[8]

contains the transmit data. it ranges from 0 to 0xFF.

Definition at line 411 of file at32f415_can.h.

Referenced by can_message_transmit(), and can_transmit_data().

◆ dlc

uint8_t can_tx_message_type::dlc

specifies frame data length that will be transmitted. this parameter can be a value between 0 to 8

Definition at line 408 of file at32f415_can.h.

Referenced by can_message_transmit(), and can_transmit_data().

◆ extended_id

uint32_t can_tx_message_type::extended_id

specifies the 29 bits extended identifier. this parameter can be a value between 0 to 0x1FFFFFFF.

Definition at line 401 of file at32f415_can.h.

Referenced by can_message_transmit(), and can_transmit_data().

◆ frame_type

can_trans_frame_type can_tx_message_type::frame_type

specifies frame type for the transmit message.

Definition at line 406 of file at32f415_can.h.

Referenced by can_message_transmit(), and can_transmit_data().

◆ id_type

can_identifier_type can_tx_message_type::id_type

specifies identifier type for the transmit message.

Definition at line 404 of file at32f415_can.h.

Referenced by can_message_transmit(), and can_transmit_data().

◆ standard_id

uint32_t can_tx_message_type::standard_id

specifies the 11 bits standard identifier. this parameter can be a value between 0 to 0x7FF.

Definition at line 398 of file at32f415_can.h.

Referenced by can_message_transmit(), and can_transmit_data().

The documentation for this struct was generated from the following file:
  • at32f415_can.h


AT32F415 Firmwary Library: can_rx_message_type Struct Reference

Data Fields
can_rx_message_type Struct Reference
AT32F415_periph_driver » CAN » CAN_exported_types

can rx message structure definition More...

#include <at32f415_can.h>

Data Fields

uint32_t | standard_id
uint32_t | extended_id
can_identifier_type id_type
can_trans_frame_type frame_type
uint8_t | dlc
uint8_t | data [8]
uint8_t | filter_index

Detailed Description

can rx message structure definition

Definition at line 418 of file at32f415_can.h.

Field Documentation

◆ data

uint8_t can_rx_message_type::data[8]

contains the receive data. it ranges from 0 to 0xFF.

Definition at line 433 of file at32f415_can.h.

Referenced by can_message_receive().

◆ dlc

uint8_t can_rx_message_type::dlc

specifies the frame data length that will be received. this parameter can be a value between 0 to 8

Definition at line 430 of file at32f415_can.h.

Referenced by can_message_receive().

◆ extended_id

uint32_t can_rx_message_type::extended_id

specifies the 29 bits extended identifier. this parameter can be a value between 0 to 0x1FFFFFFF.

Definition at line 423 of file at32f415_can.h.

Referenced by CAN1_RX0_IRQHandler(), and can_message_receive().

◆ filter_index

uint8_t can_rx_message_type::filter_index

specifies the message stored in which filter this parameter can be a value between 0 to 0xFF

Definition at line 435 of file at32f415_can.h.

Referenced by can_message_receive().

◆ frame_type

can_trans_frame_type can_rx_message_type::frame_type

specifies frame type for the receive message.

Definition at line 428 of file at32f415_can.h.

Referenced by can_message_receive().

◆ id_type

can_identifier_type can_rx_message_type::id_type

specifies identifier type for the receive message.

Definition at line 426 of file at32f415_can.h.

Referenced by CAN1_RX0_IRQHandler(), and can_message_receive().

◆ standard_id

uint32_t can_rx_message_type::standard_id

specifies the 11 bits standard identifier this parameter can be a value between 0 to 0x7FF.

Definition at line 420 of file at32f415_can.h.

Referenced by CAN1_RX0_IRQHandler(), and can_message_receive().

The documentation for this struct was generated from the following file:
  • at32f415_can.h


AT32F415 Firmwary Library: can_tx_mailbox_type Struct Reference

Data Fields
can_tx_mailbox_type Struct Reference
AT32F415_periph_driver » CAN » CAN_exported_types

can controller area network tx mailbox More...

#include <at32f415_can.h>

Data Fields

union {
__IO uint32_t tmi
struct {
__IO uint32_t tmsr: 1
__IO uint32_t tmfrsel: 1
__IO uint32_t tmidsel: 1
__IO uint32_t tmeid: 18
__IO uint32_t tmsid: 11
} tmi_bit
};
can tmi register More...
union {
__IO uint32_t tmc
struct {
__IO uint32_t tmdtbl: 4
__IO uint32_t reserved1: 4
__IO uint32_t tmtsten: 1
__IO uint32_t reserved2: 7
__IO uint32_t tmts: 16
} tmc_bit
};
can tmc register More...
union {
__IO uint32_t tmdtl
struct {
__IO uint32_t tmdt0: 8
__IO uint32_t tmdt1: 8
__IO uint32_t tmdt2: 8
__IO uint32_t tmdt3: 8
} tmdtl_bit
};
can tmdtl register More...
union {
__IO uint32_t tmdth
struct {
__IO uint32_t tmdt4: 8
__IO uint32_t tmdt5: 8
__IO uint32_t tmdt6: 8
__IO uint32_t tmdt7: 8
} tmdth_bit
};
can tmdth register More...

Detailed Description

can controller area network tx mailbox

Definition at line 442 of file at32f415_can.h.

Field Documentation

◆

union { ... } can_tx_mailbox_type::@61

can tmi register

◆

union { ... } can_tx_mailbox_type::@63

can tmc register

◆

union { ... } can_tx_mailbox_type::@65

can tmdtl register

◆

union { ... } can_tx_mailbox_type::@67

can tmdth register

◆ reserved1

__IO uint32_t can_tx_mailbox_type::reserved1

Definition at line 469 of file at32f415_can.h.

◆ reserved2

__IO uint32_t can_tx_mailbox_type::reserved2

Definition at line 471 of file at32f415_can.h.

◆ tmc

__IO uint32_t can_tx_mailbox_type::tmc

Definition at line 465 of file at32f415_can.h.

◆

struct { ... } can_tx_mailbox_type::tmc_bit

Referenced by can_message_transmit(), and can_ttc_mode_enable().

◆ tmdt0

__IO uint32_t can_tx_mailbox_type::tmdt0

Definition at line 484 of file at32f415_can.h.

◆ tmdt1

__IO uint32_t can_tx_mailbox_type::tmdt1

Definition at line 485 of file at32f415_can.h.

◆ tmdt2

__IO uint32_t can_tx_mailbox_type::tmdt2

Definition at line 486 of file at32f415_can.h.

◆ tmdt3

__IO uint32_t can_tx_mailbox_type::tmdt3

Definition at line 487 of file at32f415_can.h.

◆ tmdt4

__IO uint32_t can_tx_mailbox_type::tmdt4

Definition at line 499 of file at32f415_can.h.

◆ tmdt5

__IO uint32_t can_tx_mailbox_type::tmdt5

Definition at line 500 of file at32f415_can.h.

◆ tmdt6

__IO uint32_t can_tx_mailbox_type::tmdt6

Definition at line 501 of file at32f415_can.h.

◆ tmdt7

__IO uint32_t can_tx_mailbox_type::tmdt7

Definition at line 502 of file at32f415_can.h.

◆ tmdtbl

__IO uint32_t can_tx_mailbox_type::tmdtbl

Definition at line 468 of file at32f415_can.h.

Referenced by can_message_transmit().

◆ tmdth

__IO uint32_t can_tx_mailbox_type::tmdth

Definition at line 496 of file at32f415_can.h.

Referenced by can_message_transmit().

◆

struct { ... } can_tx_mailbox_type::tmdth_bit

◆ tmdtl

__IO uint32_t can_tx_mailbox_type::tmdtl

Definition at line 481 of file at32f415_can.h.

Referenced by can_message_transmit().

◆

struct { ... } can_tx_mailbox_type::tmdtl_bit

◆ tmeid

__IO uint32_t can_tx_mailbox_type::tmeid

Definition at line 455 of file at32f415_can.h.

◆ tmfrsel

__IO uint32_t can_tx_mailbox_type::tmfrsel

Definition at line 453 of file at32f415_can.h.

Referenced by can_message_transmit().

◆ tmi

__IO uint32_t can_tx_mailbox_type::tmi

Definition at line 449 of file at32f415_can.h.

Referenced by can_message_transmit().

◆

struct { ... } can_tx_mailbox_type::tmi_bit

Referenced by can_message_transmit().

◆ tmidsel

__IO uint32_t can_tx_mailbox_type::tmidsel

Definition at line 454 of file at32f415_can.h.

Referenced by can_message_transmit().

◆ tmsid

__IO uint32_t can_tx_mailbox_type::tmsid

Definition at line 456 of file at32f415_can.h.

Referenced by can_message_transmit().

◆ tmsr

__IO uint32_t can_tx_mailbox_type::tmsr

Definition at line 452 of file at32f415_can.h.

Referenced by can_message_transmit().

◆ tmts

__IO uint32_t can_tx_mailbox_type::tmts

Definition at line 472 of file at32f415_can.h.

◆ tmtsten

__IO uint32_t can_tx_mailbox_type::tmtsten

Definition at line 470 of file at32f415_can.h.

Referenced by can_ttc_mode_enable().

The documentation for this struct was generated from the following file:
  • at32f415_can.h


AT32F415 Firmwary Library: can_fifo_mailbox_type Struct Reference

Data Fields
can_fifo_mailbox_type Struct Reference
AT32F415_periph_driver » CAN » CAN_exported_types

can controller area network fifo mailbox More...

#include <at32f415_can.h>

Data Fields

union {
__IO uint32_t rfi
struct {
__IO uint32_t reserved1: 1
__IO uint32_t rffri: 1
__IO uint32_t rfidi: 1
__IO uint32_t rfeid: 18
__IO uint32_t rfsid: 11
} rfi_bit
};
can rfi register More...
union {
__IO uint32_t rfc
struct {
__IO uint32_t rfdtl: 4
__IO uint32_t reserved1: 4
__IO uint32_t rffmn: 8
__IO uint32_t rfts: 16
} rfc_bit
};
can rfc register More...
union {
__IO uint32_t rfdtl
struct {
__IO uint32_t rfdt0: 8
__IO uint32_t rfdt1: 8
__IO uint32_t rfdt2: 8
__IO uint32_t rfdt3: 8
} rfdtl_bit
};
can rfdtl register More...
union {
__IO uint32_t rfdth
struct {
__IO uint32_t rfdt4: 8
__IO uint32_t rfdt5: 8
__IO uint32_t rfdt6: 8
__IO uint32_t rfdt7: 8
} rfdth_bit
};
can rfdth register More...

Detailed Description

can controller area network fifo mailbox

Definition at line 510 of file at32f415_can.h.

Field Documentation

◆

union { ... } can_fifo_mailbox_type::@73

can rfi register

◆

union { ... } can_fifo_mailbox_type::@75

can rfc register

◆

union { ... } can_fifo_mailbox_type::@77

can rfdtl register

◆

union { ... } can_fifo_mailbox_type::@79

can rfdth register

◆ reserved1

__IO uint32_t can_fifo_mailbox_type::reserved1

Definition at line 520 of file at32f415_can.h.

◆ rfc

__IO uint32_t can_fifo_mailbox_type::rfc

Definition at line 533 of file at32f415_can.h.

◆

struct { ... } can_fifo_mailbox_type::rfc_bit

Referenced by can_message_receive().

◆ rfdt0

__IO uint32_t can_fifo_mailbox_type::rfdt0

Definition at line 551 of file at32f415_can.h.

Referenced by can_message_receive().

◆ rfdt1

__IO uint32_t can_fifo_mailbox_type::rfdt1

Definition at line 552 of file at32f415_can.h.

Referenced by can_message_receive().

◆ rfdt2

__IO uint32_t can_fifo_mailbox_type::rfdt2

Definition at line 553 of file at32f415_can.h.

Referenced by can_message_receive().

◆ rfdt3

__IO uint32_t can_fifo_mailbox_type::rfdt3

Definition at line 554 of file at32f415_can.h.

Referenced by can_message_receive().

◆ rfdt4

__IO uint32_t can_fifo_mailbox_type::rfdt4

Definition at line 566 of file at32f415_can.h.

Referenced by can_message_receive().

◆ rfdt5

__IO uint32_t can_fifo_mailbox_type::rfdt5

Definition at line 567 of file at32f415_can.h.

Referenced by can_message_receive().

◆ rfdt6

__IO uint32_t can_fifo_mailbox_type::rfdt6

Definition at line 568 of file at32f415_can.h.

Referenced by can_message_receive().

◆ rfdt7

__IO uint32_t can_fifo_mailbox_type::rfdt7

Definition at line 569 of file at32f415_can.h.

Referenced by can_message_receive().

◆ rfdth

__IO uint32_t can_fifo_mailbox_type::rfdth

Definition at line 563 of file at32f415_can.h.

◆

struct { ... } can_fifo_mailbox_type::rfdth_bit

Referenced by can_message_receive().

◆ rfdtl

__IO uint32_t can_fifo_mailbox_type::rfdtl

Definition at line 536 of file at32f415_can.h.

Referenced by can_message_receive().

◆

struct { ... } can_fifo_mailbox_type::rfdtl_bit

Referenced by can_message_receive().

◆ rfeid

__IO uint32_t can_fifo_mailbox_type::rfeid

Definition at line 523 of file at32f415_can.h.

◆ rffmn

__IO uint32_t can_fifo_mailbox_type::rffmn

Definition at line 538 of file at32f415_can.h.

Referenced by can_message_receive().

◆ rffri

__IO uint32_t can_fifo_mailbox_type::rffri

Definition at line 521 of file at32f415_can.h.

Referenced by can_message_receive().

◆ rfi

__IO uint32_t can_fifo_mailbox_type::rfi

Definition at line 517 of file at32f415_can.h.

Referenced by can_message_receive().

◆

struct { ... } can_fifo_mailbox_type::rfi_bit

Referenced by can_message_receive().

◆ rfidi

__IO uint32_t can_fifo_mailbox_type::rfidi

Definition at line 522 of file at32f415_can.h.

Referenced by can_message_receive().

◆ rfsid

__IO uint32_t can_fifo_mailbox_type::rfsid

Definition at line 524 of file at32f415_can.h.

Referenced by can_message_receive().

◆ rfts

__IO uint32_t can_fifo_mailbox_type::rfts

Definition at line 539 of file at32f415_can.h.

The documentation for this struct was generated from the following file:
  • at32f415_can.h


AT32F415 Firmwary Library: can_filter_register_type Struct Reference

Data Fields
can_filter_register_type Struct Reference
AT32F415_periph_driver » CAN » CAN_exported_types

can controller area network filter bit register More...

#include <at32f415_can.h>

Data Fields

__IO uint32_t | ffdb1
__IO uint32_t | ffdb2

Detailed Description

can controller area network filter bit register

Definition at line 577 of file at32f415_can.h.

Field Documentation

◆ ffdb1

__IO uint32_t can_filter_register_type::ffdb1

Definition at line 579 of file at32f415_can.h.

Referenced by can_filter_init().

◆ ffdb2

__IO uint32_t can_filter_register_type::ffdb2

Definition at line 580 of file at32f415_can.h.

Referenced by can_filter_init().

The documentation for this struct was generated from the following file:
  • at32f415_can.h


AT32F415 Firmwary Library: can_type Struct Reference

Data Fields
can_type Struct Reference
AT32F415_periph_driver » CAN » CAN_exported_types

type define can register all More...

#include <at32f415_can.h>

Data Fields

union {
__IO uint32_t mctrl
struct {
__IO uint32_t fzen: 1
__IO uint32_t dzen: 1
__IO uint32_t mmssr: 1
__IO uint32_t mdrsel: 1
__IO uint32_t prsfen: 1
__IO uint32_t aeden: 1
__IO uint32_t aeboen: 1
__IO uint32_t ttcen: 1
__IO uint32_t reserved1: 7
__IO uint32_t sprst: 1
__IO uint32_t ptd: 1
__IO uint32_t reserved2: 15
} mctrl_bit
};
can mctrl register, offset:0x00 More...
union {
__IO uint32_t msts
struct {
__IO uint32_t fzc: 1
__IO uint32_t dzc: 1
__IO uint32_t eoif: 1
__IO uint32_t qdzif: 1
__IO uint32_t edzif: 1
__IO uint32_t reserved1: 3
__IO uint32_t cuss: 1
__IO uint32_t curs: 1
__IO uint32_t lsamprx: 1
__IO uint32_t realrx: 1
__IO uint32_t reserved2: 20
} msts_bit
};
can msts register, offset:0x04 More...
union {
__IO uint32_t tsts
struct {
__IO uint32_t tm0tcf: 1
__IO uint32_t tm0tsf: 1
__IO uint32_t tm0alf: 1
__IO uint32_t tm0tef: 1
__IO uint32_t reserved1: 3
__IO uint32_t tm0ct: 1
__IO uint32_t tm1tcf: 1
__IO uint32_t tm1tsf: 1
__IO uint32_t tm1alf: 1
__IO uint32_t tm1tef: 1
__IO uint32_t reserved2: 3
__IO uint32_t tm1ct: 1
__IO uint32_t tm2tcf: 1
__IO uint32_t tm2tsf: 1
__IO uint32_t tm2alf: 1
__IO uint32_t tm2tef: 1
__IO uint32_t reserved3: 3
__IO uint32_t tm2ct: 1
__IO uint32_t tmnr: 2
__IO uint32_t tm0ef: 1
__IO uint32_t tm1ef: 1
__IO uint32_t tm2ef: 1
__IO uint32_t tm0lpf: 1
__IO uint32_t tm1lpf: 1
__IO uint32_t tm2lpf: 1
} tsts_bit
};
can tsts register, offset:0x08 More...
union {
__IO uint32_t rf0
struct {
__IO uint32_t rf0mn: 2
__IO uint32_t reserved1: 1
__IO uint32_t rf0ff: 1
__IO uint32_t rf0of: 1
__IO uint32_t rf0r: 1
__IO uint32_t reserved2: 26
} rf0_bit
};
can rf0 register, offset:0x0C More...
union {
__IO uint32_t rf1
struct {
__IO uint32_t rf1mn: 2
__IO uint32_t reserved1: 1
__IO uint32_t rf1ff: 1
__IO uint32_t rf1of: 1
__IO uint32_t rf1r: 1
__IO uint32_t reserved2: 26
} rf1_bit
};
can rf1 register, offset:0x10 More...
union {
__IO uint32_t inten
struct {
__IO uint32_t tcien: 1
__IO uint32_t rf0mien: 1
__IO uint32_t rf0fien: 1
__IO uint32_t rf0oien: 1
__IO uint32_t rf1mien: 1
__IO uint32_t rf1fien: 1
__IO uint32_t rf1oien: 1
__IO uint32_t reserved1: 1
__IO uint32_t eaien: 1
__IO uint32_t epien: 1
__IO uint32_t boien: 1
__IO uint32_t etrien: 1
__IO uint32_t reserved2: 3
__IO uint32_t eoien: 1
__IO uint32_t qdzien: 1
__IO uint32_t edzien: 1
__IO uint32_t reserved3: 14
} inten_bit
};
can inten register, offset:0x14 More...
union {
__IO uint32_t ests
struct {
__IO uint32_t eaf: 1
__IO uint32_t epf: 1
__IO uint32_t bof: 1
__IO uint32_t reserved1: 1
__IO uint32_t etr: 3
__IO uint32_t reserved2: 9
__IO uint32_t tec: 8
__IO uint32_t rec: 8
} ests_bit
};
can ests register, offset:0x18 More...
union {
__IO uint32_t btmg
struct {
__IO uint32_t brdiv: 12
__IO uint32_t reserved1: 4
__IO uint32_t bts1: 4
__IO uint32_t bts2: 3
__IO uint32_t reserved2: 1
__IO uint32_t rsaw: 2
__IO uint32_t reserved3: 4
__IO uint32_t lben: 1
__IO uint32_t loen: 1
} btmg_bit
};
can btmg register, offset:0x1C More...
can_tx_mailbox_type | tx_mailbox [3]
can controller area network tx mailbox register, offset:0x180~0x1AC More...
can_fifo_mailbox_type | fifo_mailbox [2]
can controller area network fifo mailbox register, offset:0x1B0~0x1CC More...
union {
__IO uint32_t fctrl
struct {
__IO uint32_t fcs: 1
__IO uint32_t reserved1: 31
} fctrl_bit
};
can fctrl register, offset:0x200 More...
union {
__IO uint32_t fmcfg
struct {
__IO uint32_t fmsel0: 1
__IO uint32_t fmsel1: 1
__IO uint32_t fmsel2: 1
__IO uint32_t fmsel3: 1
__IO uint32_t fmsel4: 1
__IO uint32_t fmsel5: 1
__IO uint32_t fmsel6: 1
__IO uint32_t fmsel7: 1
__IO uint32_t fmsel8: 1
__IO uint32_t fmsel9: 1
__IO uint32_t fmsel10: 1
__IO uint32_t fmsel11: 1
__IO uint32_t fmsel12: 1
__IO uint32_t fmsel13: 1
__IO uint32_t reserved1: 18
} fmcfg_bit
};
can fmcfg register, offset:0x204 More...
union {
__IO uint32_t fbwcfg
struct {
__IO uint32_t fbwsel0: 1
__IO uint32_t fbwsel1: 1
__IO uint32_t fbwsel2: 1
__IO uint32_t fbwsel3: 1
__IO uint32_t fbwsel4: 1
__IO uint32_t fbwsel5: 1
__IO uint32_t fbwsel6: 1
__IO uint32_t fbwsel7: 1
__IO uint32_t fbwsel8: 1
__IO uint32_t fbwsel9: 1
__IO uint32_t fbwsel10: 1
__IO uint32_t fbwsel11: 1
__IO uint32_t fbwsel12: 1
__IO uint32_t fbwsel13: 1
__IO uint32_t reserved1: 18
} fbwcfg_bit
};
can fbwcfg register, offset:0x20C More...
__IO uint32_t | reserved4
can reserved register, offset:0x210 More...
union {
__IO uint32_t frf
struct {
__IO uint32_t frfsel0: 1
__IO uint32_t frfsel1: 1
__IO uint32_t frfsel2: 1
__IO uint32_t frfsel3: 1
__IO uint32_t frfsel4: 1
__IO uint32_t frfsel5: 1
__IO uint32_t frfsel6: 1
__IO uint32_t frfsel7: 1
__IO uint32_t frfsel8: 1
__IO uint32_t frfsel9: 1
__IO uint32_t frfsel10: 1
__IO uint32_t frfsel11: 1
__IO uint32_t frfsel12: 1
__IO uint32_t frfsel13: 1
__IO uint32_t reserved1: 18
} frf_bit
};
can frf register, offset:0x214 More...
__IO uint32_t | reserved5
can reserved register, offset:0x218 More...
union {
__IO uint32_t facfg
struct {
__IO uint32_t faen0: 1
__IO uint32_t faen1: 1
__IO uint32_t faen2: 1
__IO uint32_t faen3: 1
__IO uint32_t faen4: 1
__IO uint32_t faen5: 1
__IO uint32_t faen6: 1
__IO uint32_t faen7: 1
__IO uint32_t faen8: 1
__IO uint32_t faen9: 1
__IO uint32_t faen10: 1
__IO uint32_t faen11: 1
__IO uint32_t faen12: 1
__IO uint32_t faen13: 1
__IO uint32_t reserved1: 18
} facfg_bit
};
can facfg register, offset:0x21C More...
__IO uint32_t | reserved6 [8]
can reserved register, offset:0x220~0x23C More...
can_filter_register_type | ffb [14]
can ffb register, offset:0x240~0x2AC More...

Detailed Description

type define can register all

Definition at line 586 of file at32f415_can.h.

Field Documentation

◆

union { ... } can_type::@101

can fctrl register, offset:0x200

◆

union { ... } can_type::@103

can fmcfg register, offset:0x204

◆

union { ... } can_type::@105

can fbwcfg register, offset:0x20C

◆

union { ... } can_type::@107

can frf register, offset:0x214

◆

union { ... } can_type::@109

can facfg register, offset:0x21C

◆

union { ... } can_type::@85

can mctrl register, offset:0x00

◆

union { ... } can_type::@87

can msts register, offset:0x04

◆

union { ... } can_type::@89

can tsts register, offset:0x08

◆

union { ... } can_type::@91

can rf0 register, offset:0x0C

◆

union { ... } can_type::@93

can rf1 register, offset:0x10

◆

union { ... } can_type::@95

can inten register, offset:0x14

◆

union { ... } can_type::@97

can ests register, offset:0x18

◆

union { ... } can_type::@99

can btmg register, offset:0x1C

◆ aeboen

__IO uint32_t can_type::aeboen

Definition at line 603 of file at32f415_can.h.

Referenced by can_base_init().

◆ aeden

__IO uint32_t can_type::aeden

Definition at line 602 of file at32f415_can.h.

Referenced by can_base_init().

◆ bof

__IO uint32_t can_type::bof

Definition at line 742 of file at32f415_can.h.

Referenced by can_flag_get().

◆ boien

__IO uint32_t can_type::boien

Definition at line 722 of file at32f415_can.h.

◆ brdiv

__IO uint32_t can_type::brdiv

Definition at line 759 of file at32f415_can.h.

Referenced by can_baudrate_set().

◆ btmg

__IO uint32_t can_type::btmg

Definition at line 756 of file at32f415_can.h.

◆

struct { ... } can_type::btmg_bit

Referenced by can_base_init(), and can_baudrate_set().

◆ bts1

__IO uint32_t can_type::bts1

Definition at line 761 of file at32f415_can.h.

Referenced by can_baudrate_set().

◆ bts2

__IO uint32_t can_type::bts2

Definition at line 762 of file at32f415_can.h.

Referenced by can_baudrate_set().

◆ curs

__IO uint32_t can_type::curs

Definition at line 627 of file at32f415_can.h.

◆ cuss

__IO uint32_t can_type::cuss

Definition at line 626 of file at32f415_can.h.

◆ dzc

__IO uint32_t can_type::dzc

Definition at line 621 of file at32f415_can.h.

Referenced by can_doze_mode_enter(), can_doze_mode_exit(), can_flag_get(), and can_operating_mode_set().

◆ dzen

__IO uint32_t can_type::dzen

Definition at line 598 of file at32f415_can.h.

Referenced by can_base_init(), can_baudrate_set(), can_doze_mode_enter(), can_doze_mode_exit(), and can_operating_mode_set().

◆ eaf

__IO uint32_t can_type::eaf

Definition at line 740 of file at32f415_can.h.

Referenced by can_flag_get().

◆ eaien

__IO uint32_t can_type::eaien

Definition at line 720 of file at32f415_can.h.

◆ edzien

__IO uint32_t can_type::edzien

Definition at line 727 of file at32f415_can.h.

◆ edzif

__IO uint32_t can_type::edzif

Definition at line 624 of file at32f415_can.h.

Referenced by can_flag_get().

◆ eoien

__IO uint32_t can_type::eoien

Definition at line 725 of file at32f415_can.h.

◆ eoif

__IO uint32_t can_type::eoif

Definition at line 622 of file at32f415_can.h.

Referenced by can_flag_get().

◆ epf

__IO uint32_t can_type::epf

Definition at line 741 of file at32f415_can.h.

Referenced by can_flag_get().

◆ epien

__IO uint32_t can_type::epien

Definition at line 721 of file at32f415_can.h.

◆ ests

__IO uint32_t can_type::ests

Definition at line 737 of file at32f415_can.h.

Referenced by can_flag_clear().

◆

struct { ... } can_type::ests_bit

Referenced by can_error_type_record_get(), can_flag_get(), can_receive_error_counter_get(), and can_transmit_error_counter_get().

◆ etr

__IO uint32_t can_type::etr

Definition at line 744 of file at32f415_can.h.

Referenced by can_error_type_record_get(), and can_flag_get().

◆ etrien

__IO uint32_t can_type::etrien

Definition at line 723 of file at32f415_can.h.

◆ facfg

__IO uint32_t can_type::facfg

Definition at line 902 of file at32f415_can.h.

Referenced by can_filter_init().

◆

struct { ... } can_type::facfg_bit

◆ faen0

__IO uint32_t can_type::faen0

Definition at line 905 of file at32f415_can.h.

◆ faen1

__IO uint32_t can_type::faen1

Definition at line 906 of file at32f415_can.h.

◆ faen10

__IO uint32_t can_type::faen10

Definition at line 915 of file at32f415_can.h.

◆ faen11

__IO uint32_t can_type::faen11

Definition at line 916 of file at32f415_can.h.

◆ faen12

__IO uint32_t can_type::faen12

Definition at line 917 of file at32f415_can.h.

◆ faen13

__IO uint32_t can_type::faen13

Definition at line 918 of file at32f415_can.h.

◆ faen2

__IO uint32_t can_type::faen2

Definition at line 907 of file at32f415_can.h.

◆ faen3

__IO uint32_t can_type::faen3

Definition at line 908 of file at32f415_can.h.

◆ faen4

__IO uint32_t can_type::faen4

Definition at line 909 of file at32f415_can.h.

◆ faen5

__IO uint32_t can_type::faen5

Definition at line 910 of file at32f415_can.h.

◆ faen6

__IO uint32_t can_type::faen6

Definition at line 911 of file at32f415_can.h.

◆ faen7

__IO uint32_t can_type::faen7

Definition at line 912 of file at32f415_can.h.

◆ faen8

__IO uint32_t can_type::faen8

Definition at line 913 of file at32f415_can.h.

◆ faen9

__IO uint32_t can_type::faen9

Definition at line 914 of file at32f415_can.h.

◆ fbwcfg

__IO uint32_t can_type::fbwcfg

Definition at line 840 of file at32f415_can.h.

Referenced by can_filter_init().

◆

struct { ... } can_type::fbwcfg_bit

◆ fbwsel0

__IO uint32_t can_type::fbwsel0

Definition at line 843 of file at32f415_can.h.

◆ fbwsel1

__IO uint32_t can_type::fbwsel1

Definition at line 844 of file at32f415_can.h.

◆ fbwsel10

__IO uint32_t can_type::fbwsel10

Definition at line 853 of file at32f415_can.h.

◆ fbwsel11

__IO uint32_t can_type::fbwsel11

Definition at line 854 of file at32f415_can.h.

◆ fbwsel12

__IO uint32_t can_type::fbwsel12

Definition at line 855 of file at32f415_can.h.

◆ fbwsel13

__IO uint32_t can_type::fbwsel13

Definition at line 856 of file at32f415_can.h.

◆ fbwsel2

__IO uint32_t can_type::fbwsel2

Definition at line 845 of file at32f415_can.h.

◆ fbwsel3

__IO uint32_t can_type::fbwsel3

Definition at line 846 of file at32f415_can.h.

◆ fbwsel4

__IO uint32_t can_type::fbwsel4

Definition at line 847 of file at32f415_can.h.

◆ fbwsel5

__IO uint32_t can_type::fbwsel5

Definition at line 848 of file at32f415_can.h.

◆ fbwsel6

__IO uint32_t can_type::fbwsel6

Definition at line 849 of file at32f415_can.h.

◆ fbwsel7

__IO uint32_t can_type::fbwsel7

Definition at line 850 of file at32f415_can.h.

◆ fbwsel8

__IO uint32_t can_type::fbwsel8

Definition at line 851 of file at32f415_can.h.

◆ fbwsel9

__IO uint32_t can_type::fbwsel9

Definition at line 852 of file at32f415_can.h.

◆ fcs

__IO uint32_t can_type::fcs

Definition at line 799 of file at32f415_can.h.

Referenced by can_filter_init().

◆ fctrl

__IO uint32_t can_type::fctrl

Definition at line 796 of file at32f415_can.h.

◆

struct { ... } can_type::fctrl_bit

Referenced by can_filter_init().

◆ ffb

can_filter_register_type can_type::ffb[14]

can ffb register, offset:0x240~0x2AC

Definition at line 931 of file at32f415_can.h.

Referenced by can_filter_init().

◆ fifo_mailbox

can_fifo_mailbox_type can_type::fifo_mailbox[2]

can controller area network fifo mailbox register, offset:0x1B0~0x1CC

Definition at line 784 of file at32f415_can.h.

Referenced by can_message_receive().

◆ fmcfg

__IO uint32_t can_type::fmcfg

Definition at line 809 of file at32f415_can.h.

Referenced by can_filter_init().

◆

struct { ... } can_type::fmcfg_bit

◆ fmsel0

__IO uint32_t can_type::fmsel0

Definition at line 812 of file at32f415_can.h.

◆ fmsel1

__IO uint32_t can_type::fmsel1

Definition at line 813 of file at32f415_can.h.

◆ fmsel10

__IO uint32_t can_type::fmsel10

Definition at line 822 of file at32f415_can.h.

◆ fmsel11

__IO uint32_t can_type::fmsel11

Definition at line 823 of file at32f415_can.h.

◆ fmsel12

__IO uint32_t can_type::fmsel12

Definition at line 824 of file at32f415_can.h.

◆ fmsel13

__IO uint32_t can_type::fmsel13

Definition at line 825 of file at32f415_can.h.

◆ fmsel2

__IO uint32_t can_type::fmsel2

Definition at line 814 of file at32f415_can.h.

◆ fmsel3

__IO uint32_t can_type::fmsel3

Definition at line 815 of file at32f415_can.h.

◆ fmsel4

__IO uint32_t can_type::fmsel4

Definition at line 816 of file at32f415_can.h.

◆ fmsel5

__IO uint32_t can_type::fmsel5

Definition at line 817 of file at32f415_can.h.

◆ fmsel6

__IO uint32_t can_type::fmsel6

Definition at line 818 of file at32f415_can.h.

◆ fmsel7

__IO uint32_t can_type::fmsel7

Definition at line 819 of file at32f415_can.h.

◆ fmsel8

__IO uint32_t can_type::fmsel8

Definition at line 820 of file at32f415_can.h.

◆ fmsel9

__IO uint32_t can_type::fmsel9

Definition at line 821 of file at32f415_can.h.

◆ frf

__IO uint32_t can_type::frf

Definition at line 871 of file at32f415_can.h.

Referenced by can_filter_init().

◆

struct { ... } can_type::frf_bit

◆ frfsel0

__IO uint32_t can_type::frfsel0

Definition at line 874 of file at32f415_can.h.

◆ frfsel1

__IO uint32_t can_type::frfsel1

Definition at line 875 of file at32f415_can.h.

◆ frfsel10

__IO uint32_t can_type::frfsel10

Definition at line 884 of file at32f415_can.h.

◆ frfsel11

__IO uint32_t can_type::frfsel11

Definition at line 885 of file at32f415_can.h.

◆ frfsel12

__IO uint32_t can_type::frfsel12

Definition at line 886 of file at32f415_can.h.

◆ frfsel13

__IO uint32_t can_type::frfsel13

Definition at line 887 of file at32f415_can.h.

◆ frfsel2

__IO uint32_t can_type::frfsel2

Definition at line 876 of file at32f415_can.h.

◆ frfsel3

__IO uint32_t can_type::frfsel3

Definition at line 877 of file at32f415_can.h.

◆ frfsel4

__IO uint32_t can_type::frfsel4

Definition at line 878 of file at32f415_can.h.

◆ frfsel5

__IO uint32_t can_type::frfsel5

Definition at line 879 of file at32f415_can.h.

◆ frfsel6

__IO uint32_t can_type::frfsel6

Definition at line 880 of file at32f415_can.h.

◆ frfsel7

__IO uint32_t can_type::frfsel7

Definition at line 881 of file at32f415_can.h.

◆ frfsel8

__IO uint32_t can_type::frfsel8

Definition at line 882 of file at32f415_can.h.

◆ frfsel9

__IO uint32_t can_type::frfsel9

Definition at line 883 of file at32f415_can.h.

◆ fzc

__IO uint32_t can_type::fzc

Definition at line 620 of file at32f415_can.h.

Referenced by can_base_init(), can_baudrate_set(), can_doze_mode_enter(), and can_operating_mode_set().

◆ fzen

__IO uint32_t can_type::fzen

Definition at line 597 of file at32f415_can.h.

Referenced by can_base_init(), can_baudrate_set(), can_doze_mode_enter(), and can_operating_mode_set().

◆ inten

__IO uint32_t can_type::inten

Definition at line 709 of file at32f415_can.h.

Referenced by can_interrupt_enable().

◆

struct { ... } can_type::inten_bit

◆ lben

__IO uint32_t can_type::lben

Definition at line 766 of file at32f415_can.h.

Referenced by can_base_init().

◆ loen

__IO uint32_t can_type::loen

Definition at line 767 of file at32f415_can.h.

Referenced by can_base_init().

◆ lsamprx

__IO uint32_t can_type::lsamprx

Definition at line 628 of file at32f415_can.h.

◆ mctrl

__IO uint32_t can_type::mctrl

Definition at line 594 of file at32f415_can.h.

◆

struct { ... } can_type::mctrl_bit

Referenced by can_base_init(), can_baudrate_set(), can_debug_transmission_prohibit(), can_doze_mode_enter(), can_doze_mode_exit(), can_operating_mode_set(), and can_ttc_mode_enable().

◆ mdrsel

__IO uint32_t can_type::mdrsel

Definition at line 600 of file at32f415_can.h.

Referenced by can_base_init().

◆ mmssr

__IO uint32_t can_type::mmssr

Definition at line 599 of file at32f415_can.h.

Referenced by can_base_init().

◆ msts

__IO uint32_t can_type::msts

Definition at line 617 of file at32f415_can.h.

Referenced by can_flag_clear().

◆

struct { ... } can_type::msts_bit

Referenced by can_base_init(), can_baudrate_set(), can_doze_mode_enter(), can_doze_mode_exit(), can_flag_get(), and can_operating_mode_set().

◆ prsfen

__IO uint32_t can_type::prsfen

Definition at line 601 of file at32f415_can.h.

Referenced by can_base_init().

◆ ptd

__IO uint32_t can_type::ptd

Definition at line 607 of file at32f415_can.h.

Referenced by can_debug_transmission_prohibit().

◆ qdzien

__IO uint32_t can_type::qdzien

Definition at line 726 of file at32f415_can.h.

◆ qdzif

__IO uint32_t can_type::qdzif

Definition at line 623 of file at32f415_can.h.

Referenced by can_flag_get().

◆ realrx

__IO uint32_t can_type::realrx

Definition at line 629 of file at32f415_can.h.

◆ rec

__IO uint32_t can_type::rec

Definition at line 747 of file at32f415_can.h.

Referenced by can_receive_error_counter_get().

◆ reserved1

__IO uint32_t can_type::reserved1

can reserved register, offset:0x20~0x17C

Definition at line 605 of file at32f415_can.h.

◆ reserved2

__IO uint32_t can_type::reserved2

can reserved register, offset:0x1D0~0x1FC

Definition at line 608 of file at32f415_can.h.

◆ reserved3

__IO uint32_t can_type::reserved3

can reserved register, offset:0x208

Definition at line 658 of file at32f415_can.h.

◆ reserved4

__IO uint32_t can_type::reserved4

can reserved register, offset:0x210

Definition at line 864 of file at32f415_can.h.

◆ reserved5

__IO uint32_t can_type::reserved5

can reserved register, offset:0x218

Definition at line 895 of file at32f415_can.h.

◆ reserved6

__IO uint32_t can_type::reserved6[8]

can reserved register, offset:0x220~0x23C

Definition at line 926 of file at32f415_can.h.

◆ rf0

__IO uint32_t can_type::rf0

Definition at line 675 of file at32f415_can.h.

Referenced by can_flag_clear(), and can_receive_fifo_release().

◆

struct { ... } can_type::rf0_bit

Referenced by can_flag_get(), and can_receive_message_pending_get().

◆ rf0ff

__IO uint32_t can_type::rf0ff

Definition at line 680 of file at32f415_can.h.

Referenced by can_flag_get().

◆ rf0fien

__IO uint32_t can_type::rf0fien

Definition at line 714 of file at32f415_can.h.

◆ rf0mien

__IO uint32_t can_type::rf0mien

Definition at line 713 of file at32f415_can.h.

◆ rf0mn

__IO uint32_t can_type::rf0mn

Definition at line 678 of file at32f415_can.h.

Referenced by can_flag_get(), and can_receive_message_pending_get().

◆ rf0of

__IO uint32_t can_type::rf0of

Definition at line 681 of file at32f415_can.h.

Referenced by can_flag_get().

◆ rf0oien

__IO uint32_t can_type::rf0oien

Definition at line 715 of file at32f415_can.h.

◆ rf0r

__IO uint32_t can_type::rf0r

Definition at line 682 of file at32f415_can.h.

◆ rf1

__IO uint32_t can_type::rf1

Definition at line 692 of file at32f415_can.h.

Referenced by can_flag_clear(), and can_receive_fifo_release().

◆

struct { ... } can_type::rf1_bit

Referenced by can_flag_get(), and can_receive_message_pending_get().

◆ rf1ff

__IO uint32_t can_type::rf1ff

Definition at line 697 of file at32f415_can.h.

Referenced by can_flag_get().

◆ rf1fien

__IO uint32_t can_type::rf1fien

Definition at line 717 of file at32f415_can.h.

◆ rf1mien

__IO uint32_t can_type::rf1mien

Definition at line 716 of file at32f415_can.h.

◆ rf1mn

__IO uint32_t can_type::rf1mn

Definition at line 695 of file at32f415_can.h.

Referenced by can_flag_get(), and can_receive_message_pending_get().

◆ rf1of

__IO uint32_t can_type::rf1of

Definition at line 698 of file at32f415_can.h.

Referenced by can_flag_get().

◆ rf1oien

__IO uint32_t can_type::rf1oien

Definition at line 718 of file at32f415_can.h.

◆ rf1r

__IO uint32_t can_type::rf1r

Definition at line 699 of file at32f415_can.h.

◆ rsaw

__IO uint32_t can_type::rsaw

Definition at line 764 of file at32f415_can.h.

Referenced by can_baudrate_set().

◆ sprst

__IO uint32_t can_type::sprst

Definition at line 606 of file at32f415_can.h.

◆ tcien

__IO uint32_t can_type::tcien

Definition at line 712 of file at32f415_can.h.

◆ tec

__IO uint32_t can_type::tec

Definition at line 746 of file at32f415_can.h.

Referenced by can_transmit_error_counter_get().

◆ tm0alf

__IO uint32_t can_type::tm0alf

Definition at line 644 of file at32f415_can.h.

◆ tm0ct

__IO uint32_t can_type::tm0ct

Definition at line 647 of file at32f415_can.h.

◆ tm0ef

__IO uint32_t can_type::tm0ef

Definition at line 661 of file at32f415_can.h.

Referenced by can_flag_get(), and can_message_transmit().

◆ tm0lpf

__IO uint32_t can_type::tm0lpf

Definition at line 664 of file at32f415_can.h.

◆ tm0tcf

__IO uint32_t can_type::tm0tcf

Definition at line 642 of file at32f415_can.h.

Referenced by can_flag_get(), and can_transmit_status_get().

◆ tm0tef

__IO uint32_t can_type::tm0tef

Definition at line 645 of file at32f415_can.h.

◆ tm0tsf

__IO uint32_t can_type::tm0tsf

Definition at line 643 of file at32f415_can.h.

Referenced by can_transmit_status_get().

◆ tm1alf

__IO uint32_t can_type::tm1alf

Definition at line 650 of file at32f415_can.h.

◆ tm1ct

__IO uint32_t can_type::tm1ct

Definition at line 653 of file at32f415_can.h.

◆ tm1ef

__IO uint32_t can_type::tm1ef

Definition at line 662 of file at32f415_can.h.

Referenced by can_flag_get(), and can_message_transmit().

◆ tm1lpf

__IO uint32_t can_type::tm1lpf

Definition at line 665 of file at32f415_can.h.

◆ tm1tcf

__IO uint32_t can_type::tm1tcf

Definition at line 648 of file at32f415_can.h.

Referenced by can_flag_get(), and can_transmit_status_get().

◆ tm1tef

__IO uint32_t can_type::tm1tef

Definition at line 651 of file at32f415_can.h.

◆ tm1tsf

__IO uint32_t can_type::tm1tsf

Definition at line 649 of file at32f415_can.h.

Referenced by can_transmit_status_get().

◆ tm2alf

__IO uint32_t can_type::tm2alf

Definition at line 656 of file at32f415_can.h.

◆ tm2ct

__IO uint32_t can_type::tm2ct

Definition at line 659 of file at32f415_can.h.

◆ tm2ef

__IO uint32_t can_type::tm2ef

Definition at line 663 of file at32f415_can.h.

Referenced by can_flag_get(), and can_message_transmit().

◆ tm2lpf

__IO uint32_t can_type::tm2lpf

Definition at line 666 of file at32f415_can.h.

◆ tm2tcf

__IO uint32_t can_type::tm2tcf

Definition at line 654 of file at32f415_can.h.

Referenced by can_flag_get(), and can_transmit_status_get().

◆ tm2tef

__IO uint32_t can_type::tm2tef

Definition at line 657 of file at32f415_can.h.

◆ tm2tsf

__IO uint32_t can_type::tm2tsf

Definition at line 655 of file at32f415_can.h.

Referenced by can_transmit_status_get().

◆ tmnr

__IO uint32_t can_type::tmnr

Definition at line 660 of file at32f415_can.h.

◆ tsts

__IO uint32_t can_type::tsts

Definition at line 639 of file at32f415_can.h.

Referenced by can_flag_clear(), and can_transmit_cancel().

◆

struct { ... } can_type::tsts_bit

Referenced by can_flag_get(), can_message_transmit(), and can_transmit_status_get().

◆ ttcen

__IO uint32_t can_type::ttcen

Definition at line 604 of file at32f415_can.h.

Referenced by can_base_init(), and can_ttc_mode_enable().

◆ tx_mailbox

can_tx_mailbox_type can_type::tx_mailbox[3]

can controller area network tx mailbox register, offset:0x180~0x1AC

Definition at line 779 of file at32f415_can.h.

Referenced by can_message_transmit(), and can_ttc_mode_enable().

The documentation for this struct was generated from the following file:
  • at32f415_can.h


AT32F415 Firmwary Library: CAN_exported_functions

Functions
CAN_exported_functions
AT32F415_periph_driver » CAN

Functions

void | can_reset (can_type *can_x)
deinitialize the can peripheral registers to their default reset values. More...
void | can_baudrate_default_para_init (can_baudrate_type *can_baudrate_struct)
fill each can_baudrate_struct member with its default value. More...
error_status | can_baudrate_set (can_type *can_x, can_baudrate_type *can_baudrate_struct)
set the baudrate of the can peripheral More...
void | can_default_para_init (can_base_type *can_base_struct)
fill each can_init_struct member with its default value. More...
error_status | can_base_init (can_type *can_x, can_base_type *can_base_struct)
initialize the can peripheral according to the specified parameters in the can_init_struct. More...
void | can_filter_default_para_init (can_filter_init_type *can_filter_init_struct)
fill each can_filter_init_struct member with its default value. More...
void | can_filter_init (can_type *can_x, can_filter_init_type *can_filter_init_struct)
initialize the can peripheral according to the specified parameters in the can_filter_init_struct. More...
void | can_debug_transmission_prohibit (can_type *can_x, confirm_state new_state)
enable or disable the debug transmission prohibit of the specified can peripheral. More...
void | can_ttc_mode_enable (can_type *can_x, confirm_state new_state)
enable or disable time trigger operation communication mode of the specified can peripheral. More...
uint8_t | can_message_transmit (can_type *can_x, can_tx_message_type *tx_message_struct)
fill the transmission message and transmit of the specified can peripheral. More...
can_transmit_status_type | can_transmit_status_get (can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
check the transmission state of the specified can peripheral. More...
void | can_transmit_cancel (can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
cancel a transmit request of the specified can peripheral. More...
void | can_message_receive (can_type *can_x, can_rx_fifo_num_type fifo_number, can_rx_message_type *rx_message_struct)
receive message of the specified can peripheral. More...
void | can_receive_fifo_release (can_type *can_x, can_rx_fifo_num_type fifo_number)
release the specified fifo of the specified can peripheral. More...
uint8_t | can_receive_message_pending_get (can_type *can_x, can_rx_fifo_num_type fifo_number)
return the number of pending messages of the specified can peripheral. More...
error_status | can_operating_mode_set (can_type *can_x, can_operating_mode_type can_operating_mode)
set the operation mode of the specified can peripheral. More...
can_enter_doze_status_type | can_doze_mode_enter (can_type *can_x)
enter the low power mode of the specified can peripheral. More...
can_quit_doze_status_type | can_doze_mode_exit (can_type *can_x)
exit the doze mode of the specified can peripheral. More...
can_error_record_type | can_error_type_record_get (can_type *can_x)
return the error type record (etr) of the specified can peripheral. More...
uint8_t | can_receive_error_counter_get (can_type *can_x)
return the receive error counter (rec) of the specified can peripheral. More...
uint8_t | can_transmit_error_counter_get (can_type *can_x)
return the transmit error counter of the specified can peripheral. More...
void | can_interrupt_enable (can_type *can_x, uint32_t can_int, confirm_state new_state)
enable or disable the interrupt of the specified can peripheral. More...
flag_status | can_flag_get (can_type *can_x, uint32_t can_flag)
get flag of the specified can peripheral. More...
void | can_flag_clear (can_type *can_x, uint32_t can_flag)
clear flag of the specified can peripheral. More...

Detailed Description

Function Documentation

◆ can_base_init()

error_status can_base_init | ( | can_type * | can_x,
 |  | can_base_type * | can_base_struct
 | ) |  |

initialize the can peripheral according to the specified parameters in the can_init_struct.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
can_base_struct | pointer to a can_base_struct structure that contains the configuration information for the can peripheral.
Return values
the status of initialization this parameter can be one of the following values: SUCCESS or ERROR

< time out for fzc bit

< time out for fzc bit

Definition at line 186 of file at32f415_can.c.

Referenced by can_configuration().

◆ can_baudrate_default_para_init()

void can_baudrate_default_para_init ( can_baudrate_type * can_baudrate_struct )

fill each can_baudrate_struct member with its default value.

Parameters
can_baudrate_struct pointer to a can_baudrate_type structure which will be initialized.
Return values
none.

Definition at line 62 of file at32f415_can.c.

◆ can_baudrate_set()

error_status can_baudrate_set | ( | can_type * | can_x,
 |  | can_baudrate_type * | can_baudrate_struct
 | ) |  |

set the baudrate of the can peripheral

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
can_baudrate_struct | pointer to a can_baudrate_type structure which will be set.
Note
baudrate calculate method is: baudrate = fpclk/(baudrate_div *(3 + bts1_size + bts2_size))
Return values
the result of baudrate set this parameter can be one of the following values: SUCCESS or ERROR

< time out for fzc bit

< time out for fzc bit

Definition at line 91 of file at32f415_can.c.

Referenced by can_configuration().

◆ can_debug_transmission_prohibit()

void can_debug_transmission_prohibit | ( | can_type * | can_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the debug transmission prohibit of the specified can peripheral.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
new_state | new state of debug transmission prohibit. this parameter can be: TRUE or FALSE.
Return values
none.

Definition at line 387 of file at32f415_can.c.

◆ can_default_para_init()

void can_default_para_init ( can_base_type * can_base_struct )

fill each can_init_struct member with its default value.

Parameters
can_base_struct pointer to a can_base_type structure which will be initialized.
Return values
none.

Definition at line 149 of file at32f415_can.c.

Referenced by can_configuration().

◆ can_doze_mode_enter()

can_enter_doze_status_type can_doze_mode_enter ( can_type * can_x )

enter the low power mode of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
Return values
status of doze mode enter, the returned value can be:
  • CAN_ENTER_DOZE_SUCCESSFUL <it meaning enter the doze mode succeed>
  • CAN_ENTER_DOZE_FAILED <it meaning enter the doze mode failed>

< time out for fzc bit

Definition at line 793 of file at32f415_can.c.

◆ can_doze_mode_exit()

can_quit_doze_status_type can_doze_mode_exit ( can_type * can_x )

exit the doze mode of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
Return values
status of doze mode enter, the returned value can be:
  • CAN_QUIT_DOZE_SUCCESSFUL <it meaning exit the doze mode succeed>
  • CAN_QUIT_DOZE_FAILED <it meaning exit the doze mode failed>

< time out for dzc bit

Definition at line 823 of file at32f415_can.c.

◆ can_error_type_record_get()

can_error_record_type can_error_type_record_get ( can_type * can_x )

return the error type record (etr) of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
Return values
the value of the error code the return can be one of the follow values:
  • CAN_ERRORRECORD_NOERR
  • CAN_ERRORRECORD_STUFFERR,
  • CAN_ERRORRECORD_FORMERR,
  • CAN_ERRORRECORD_ACKERR,
  • CAN_ERRORRECORD_BITRECESSIVEERR,
  • CAN_ERRORRECORD_BITDOMINANTERR,
  • CAN_ERRORRECORD_CRCERR,
  • CAN_ERRORRECORD_SOFTWARESETERR

Definition at line 855 of file at32f415_can.c.

◆ can_filter_default_para_init()

void can_filter_default_para_init ( can_filter_init_type * can_filter_init_struct )

fill each can_filter_init_struct member with its default value.

Parameters
can_filter_init_struct pointer to a can_filter_init_type structure which will be initialized.
Return values
none.

Definition at line 261 of file at32f415_can.c.

◆ can_filter_init()

void can_filter_init | ( | can_type * | can_x,
 |  | can_filter_init_type * | can_filter_init_struct
 | ) |  |

initialize the can peripheral according to the specified parameters in the can_filter_init_struct.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
can_filter_init_struct | pointer to a can_filter_init_type structure that contains the configuration information.
Return values
none.

Definition at line 296 of file at32f415_can.c.

Referenced by can_configuration().

◆ can_flag_clear()

void can_flag_clear | ( | can_type * | can_x,
 |  | uint32_t | can_flag
 | ) |  |

clear flag of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
can_flag select the flag. this parameter can be one of the following flags:
  • CAN_EAF_FLAG
  • CAN_EPF_FLAG
  • CAN_BOF_FLAG
  • CAN_ETR_FLAG
  • CAN_EOIF_FLAG
  • CAN_TM0TCF_FLAG
  • CAN_TM1TCF_FLAG
  • CAN_TM2TCF_FLAG
  • CAN_RF0FF_FLAG
  • CAN_RF0OF_FLAG
  • CAN_RF1FF_FLAG
  • CAN_RF1OF_FLAG
  • CAN_QDZIF_FLAG
  • CAN_EDZC_FLAG
  • CAN_TMEF_FLAG note:CAN_RF0MN_FLAG and CAN_RF1MN_FLAG can not clear by this function
Return values
none.

< error active flag

< error passive flag

< bus-off flag

< error occur interrupt flag

< eoif bit value, it clear by writing 1

< error type record flag

< eoif bit value, it clear by writing 1

< transmit mailbox 0 transmission completed flag

< tm0tcf bit value, it clear by writing 1

< transmit mailbox 1 transmission completed flag

< tm1tcf bit value, it clear by writing 1

< transmit mailbox 2 transmission completed flag

< tm2tcf bit value, it clear by writing 1

< receive fifo 0 full flag

< rf0ff bit value, it clear by writing 1

< receive fifo 0 overflow flag

< rf0of bit value, it clear by writing 1

< receive fifo 1 full flag

< rf1ff bit value, it clear by writing 1

< receive fifo 1 overflow flag

< rf1of bit value, it clear by writing 1

< quit doze mode interrupt flag

< qdzif bit value, it clear by writing 1

< enter doze mode confirm flag

< edzif bit value, it clear by writing 1

< transmit mailbox empty flag

< tm0tcf bit value, it clear by writing 1

< tm1tcf bit value, it clear by writing 1

< tm2tcf bit value, it clear by writing 1

Definition at line 1079 of file at32f415_can.c.

Referenced by CAN1_SE_IRQHandler().

◆ can_flag_get()

flag_status can_flag_get | ( | can_type * | can_x,
 |  | uint32_t | can_flag
 | ) |  |

get flag of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
can_flag select the flag. this parameter can be one of the following flags:
  • CAN_EAF_FLAG
  • CAN_EPF_FLAG
  • CAN_BOF_FLAG
  • CAN_ETR_FLAG
  • CAN_EOIF_FLAG
  • CAN_TM0TCF_FLAG
  • CAN_TM1TCF_FLAG
  • CAN_TM2TCF_FLAG
  • CAN_RF0MN_FLAG
  • CAN_RF0FF_FLAG
  • CAN_RF0OF_FLAG
  • CAN_RF1MN_FLAG
  • CAN_RF1FF_FLAG
  • CAN_RF1OF_FLAG
  • CAN_QDZIF_FLAG
  • CAN_EDZC_FLAG
  • CAN_TMEF_FLAG note:the state of CAN_EDZC_FLAG need to check dzc and edzif bit note:the state of CAN_TMEF_FLAG need to check rqc0,rqc1 and rqc2 bit
Return values
status of can_flag, the returned value can be:SET or RESET.

< error active flag

< error passive flag

< bus-off flag

< error type record flag

< error occur interrupt flag

< transmit mailbox 0 transmission completed flag

< transmit mailbox 1 transmission completed flag

< transmit mailbox 2 transmission completed flag

< receive fifo 0 message num flag

< receive fifo 0 full flag

< receive fifo 0 overflow flag

< receive fifo 1 message num flag

< receive fifo 1 full flag

< receive fifo 1 overflow flag

< quit doze mode interrupt flag

< enter doze mode confirm flag

< transmit mailbox empty flag

Definition at line 956 of file at32f415_can.c.

Referenced by CAN1_RX0_IRQHandler(), and CAN1_SE_IRQHandler().

◆ can_interrupt_enable()

void can_interrupt_enable | ( | can_type * | can_x,
 |  | uint32_t | can_int,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the interrupt of the specified can peripheral.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
can_int specifies the can interrupt sources to be enabled or disabled. this parameter can be one of the following values:
  • CAN_TCIEN_INT
  • CAN_RF0MIEN_INT
  • CAN_RF0FIEN_INT
  • CAN_RF0OIEN_INT
  • CAN_RF1MIEN_INT
  • CAN_RF1FIEN_INT
  • CAN_RF1OIEN_INT
  • CAN_EAIEN_INT
  • CAN_EPIEN_INT
  • CAN_BOIEN_INT
  • CAN_ETRIEN_INT
  • CAN_EOIEN_INT
  • CAN_QDZIEN_INT
  • CAN_EDZIEN_INT
new_state | new state of the can interrupts. this parameter can be: TRUE or FALSE.
Return values
none.

Definition at line 916 of file at32f415_can.c.

Referenced by can_configuration().

◆ can_message_receive()

void can_message_receive | ( | can_type * | can_x,
 |  | can_rx_fifo_num_type | fifo_number,
 |  | can_rx_message_type * | rx_message_struct
 | ) |  |

receive message of the specified can peripheral.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
fifo_number receive fifo number. this parameter can be one of the following values:
  • CAN_RX_FIFO0
  • CAN_RX_FIFO1
rx_message_struct | pointer to a structure which store the receive message.
Return values
none.

Definition at line 611 of file at32f415_can.c.

Referenced by CAN1_RX0_IRQHandler().

◆ can_message_transmit()

uint8_t can_message_transmit | ( | can_type * | can_x,
 |  | can_tx_message_type * | tx_message_struct
 | ) |  |

fill the transmission message and transmit of the specified can peripheral.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
tx_message_struct | pointer to a structure which contains the message to be trans.
Return values
the number of the mailbox that is used for transmission: this parameter can be one of the following values:
  • CAN_TX_MAILBOX0
  • CAN_TX_MAILBOX1
  • CAN_TX_MAILBOX2
  • CAN_TX_STATUS_NO_EMPTY <meanings there is no empty mailbox, message cannot be filled>

Definition at line 432 of file at32f415_can.c.

Referenced by can_transmit_data().

◆ can_operating_mode_set()

error_status can_operating_mode_set | ( | can_type * | can_x,
 |  | can_operating_mode_type | can_operating_mode
 | ) |  |

set the operation mode of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
can_operating_mode can operating mode. this parameter can be one of the following values:
  • CAN_OPERATINGMODE_FREEZE
  • CAN_OPERATINGMODE_DOZE
  • CAN_OPERATINGMODE_COMMUNICATE
Return values
status of operation mode set this parameter can be one of the following values: SUCCESS or ERROR

< time out for fzc bit

Definition at line 715 of file at32f415_can.c.

◆ can_receive_error_counter_get()

uint8_t can_receive_error_counter_get ( can_type * can_x )

return the receive error counter (rec) of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
Return values
the value of receive error counter.

Definition at line 870 of file at32f415_can.c.

◆ can_receive_fifo_release()

void can_receive_fifo_release | ( | can_type * | can_x,
 |  | can_rx_fifo_num_type | fifo_number
 | ) |  |

release the specified fifo of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
fifo_number fifo to be release. this parameter can be one of the following values:
  • CAN_RX_FIFO0
  • CAN_RX_FIFO1
Return values
none.

< rf0r bit value, it clear by writing 1

< rf1r bit value, it clear by writing 1

Definition at line 658 of file at32f415_can.c.

Referenced by can_message_receive().

◆ can_receive_message_pending_get()

uint8_t can_receive_message_pending_get | ( | can_type * | can_x,
 |  | can_rx_fifo_num_type | fifo_number
 | ) |  |

return the number of pending messages of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
fifo_number receive fifo number. this parameter can be one of the following values:
  • CAN_RX_FIFO0
  • CAN_RX_FIFO1
Return values
the number of message pending in the receive fifo.

Definition at line 684 of file at32f415_can.c.

◆ can_reset()

void can_reset ( can_type * can_x )

deinitialize the can peripheral registers to their default reset values.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
Return values
none.

Definition at line 51 of file at32f415_can.c.

Referenced by CAN1_SE_IRQHandler().

◆ can_transmit_cancel()

void can_transmit_cancel | ( | can_type * | can_x,
 |  | can_tx_mailbox_num_type | transmit_mailbox
 | ) |  |

cancel a transmit request of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
mailbox mailbox number. this parameter can be one of the following values:
  • CAN_TX_MAILBOX0
  • CAN_TX_MAILBOX1
  • CAN_TX_MAILBOX2
Return values
none.

< tm0ct bit value, it clear by writing 1

< tm1ct bit value, it clear by writing 1

< tm2ct bit value, it clear by writing 1

Definition at line 581 of file at32f415_can.c.

◆ can_transmit_error_counter_get()

uint8_t can_transmit_error_counter_get ( can_type * can_x )

return the transmit error counter of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
Return values
the value of transmit error counter.

Definition at line 884 of file at32f415_can.c.

◆ can_transmit_status_get()

can_transmit_status_type can_transmit_status_get | ( | can_type * | can_x,
 |  | can_tx_mailbox_num_type | transmit_mailbox
 | ) |  |

check the transmission state of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
transmit_mailbox the number of the mailbox that is used for transmission. this parameter can be one of the following values:
  • CAN_TX_MAILBOX0
  • CAN_TX_MAILBOX1
  • CAN_TX_MAILBOX2
Return values
can transmit status this parameter can be one of the following values:
  • CAN_TX_STATUS_SUCCESSFUL
  • CAN_TX_STATUS_FAILED
  • CAN_TX_STATUS_PENDING

Definition at line 506 of file at32f415_can.c.

Referenced by can_transmit_data().

◆ can_ttc_mode_enable()

void can_ttc_mode_enable | ( | can_type * | can_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable time trigger operation communication mode of the specified can peripheral.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
new_state | : new state of time trigger operation communication mode. this parameter can be: TRUE or FALSE.
Note

note1: when enabled, transmit mailbox time stamp(tmts[15:0]) value is sent in the last two data bytes of the 8-byte message: tmts[7:0] in data byte 6 and tmts[15:8] in data byte 7
note2: tmdtbl must be programmed as 8 in order time stamp (2 bytes) to be sent over the can bus.
Return values
none

Definition at line 408 of file at32f415_can.c.


AT32F415 Firmwary Library: CAN_private_functions

Functions
CAN_private_functions
AT32F415_periph_driver » CAN

Functions

void | can_reset (can_type *can_x)
deinitialize the can peripheral registers to their default reset values. More...
void | can_baudrate_default_para_init (can_baudrate_type *can_baudrate_struct)
fill each can_baudrate_struct member with its default value. More...
error_status | can_baudrate_set (can_type *can_x, can_baudrate_type *can_baudrate_struct)
set the baudrate of the can peripheral More...
void | can_default_para_init (can_base_type *can_base_struct)
fill each can_init_struct member with its default value. More...
error_status | can_base_init (can_type *can_x, can_base_type *can_base_struct)
initialize the can peripheral according to the specified parameters in the can_init_struct. More...
void | can_filter_default_para_init (can_filter_init_type *can_filter_init_struct)
fill each can_filter_init_struct member with its default value. More...
void | can_filter_init (can_type *can_x, can_filter_init_type *can_filter_init_struct)
initialize the can peripheral according to the specified parameters in the can_filter_init_struct. More...
void | can_debug_transmission_prohibit (can_type *can_x, confirm_state new_state)
enable or disable the debug transmission prohibit of the specified can peripheral. More...
void | can_ttc_mode_enable (can_type *can_x, confirm_state new_state)
enable or disable time trigger operation communication mode of the specified can peripheral. More...
uint8_t | can_message_transmit (can_type *can_x, can_tx_message_type *tx_message_struct)
fill the transmission message and transmit of the specified can peripheral. More...
can_transmit_status_type | can_transmit_status_get (can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
check the transmission state of the specified can peripheral. More...
void | can_transmit_cancel (can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
cancel a transmit request of the specified can peripheral. More...
void | can_message_receive (can_type *can_x, can_rx_fifo_num_type fifo_number, can_rx_message_type *rx_message_struct)
receive message of the specified can peripheral. More...
void | can_receive_fifo_release (can_type *can_x, can_rx_fifo_num_type fifo_number)
release the specified fifo of the specified can peripheral. More...
uint8_t | can_receive_message_pending_get (can_type *can_x, can_rx_fifo_num_type fifo_number)
return the number of pending messages of the specified can peripheral. More...
error_status | can_operating_mode_set (can_type *can_x, can_operating_mode_type can_operating_mode)
set the operation mode of the specified can peripheral. More...
can_enter_doze_status_type | can_doze_mode_enter (can_type *can_x)
enter the low power mode of the specified can peripheral. More...
can_quit_doze_status_type | can_doze_mode_exit (can_type *can_x)
exit the doze mode of the specified can peripheral. More...
can_error_record_type | can_error_type_record_get (can_type *can_x)
return the error type record (etr) of the specified can peripheral. More...
uint8_t | can_receive_error_counter_get (can_type *can_x)
return the receive error counter (rec) of the specified can peripheral. More...
uint8_t | can_transmit_error_counter_get (can_type *can_x)
return the transmit error counter of the specified can peripheral. More...
void | can_interrupt_enable (can_type *can_x, uint32_t can_int, confirm_state new_state)
enable or disable the interrupt of the specified can peripheral. More...
flag_status | can_flag_get (can_type *can_x, uint32_t can_flag)
get flag of the specified can peripheral. More...
void | can_flag_clear (can_type *can_x, uint32_t can_flag)
clear flag of the specified can peripheral. More...

Detailed Description

Function Documentation

◆ can_base_init()

error_status can_base_init | ( | can_type * | can_x,
 |  | can_base_type * | can_base_struct
 | ) |  |

initialize the can peripheral according to the specified parameters in the can_init_struct.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
can_base_struct | pointer to a can_base_struct structure that contains the configuration information for the can peripheral.
Return values
the status of initialization this parameter can be one of the following values: SUCCESS or ERROR

< time out for fzc bit

< time out for fzc bit

Definition at line 186 of file at32f415_can.c.

Referenced by can_configuration().

◆ can_baudrate_default_para_init()

void can_baudrate_default_para_init ( can_baudrate_type * can_baudrate_struct )

fill each can_baudrate_struct member with its default value.

Parameters
can_baudrate_struct pointer to a can_baudrate_type structure which will be initialized.
Return values
none.

Definition at line 62 of file at32f415_can.c.

◆ can_baudrate_set()

error_status can_baudrate_set | ( | can_type * | can_x,
 |  | can_baudrate_type * | can_baudrate_struct
 | ) |  |

set the baudrate of the can peripheral

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
can_baudrate_struct | pointer to a can_baudrate_type structure which will be set.
Note
baudrate calculate method is: baudrate = fpclk/(baudrate_div *(3 + bts1_size + bts2_size))
Return values
the result of baudrate set this parameter can be one of the following values: SUCCESS or ERROR

< time out for fzc bit

< time out for fzc bit

Definition at line 91 of file at32f415_can.c.

Referenced by can_configuration().

◆ can_debug_transmission_prohibit()

void can_debug_transmission_prohibit | ( | can_type * | can_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the debug transmission prohibit of the specified can peripheral.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
new_state | new state of debug transmission prohibit. this parameter can be: TRUE or FALSE.
Return values
none.

Definition at line 387 of file at32f415_can.c.

◆ can_default_para_init()

void can_default_para_init ( can_base_type * can_base_struct )

fill each can_init_struct member with its default value.

Parameters
can_base_struct pointer to a can_base_type structure which will be initialized.
Return values
none.

Definition at line 149 of file at32f415_can.c.

Referenced by can_configuration().

◆ can_doze_mode_enter()

can_enter_doze_status_type can_doze_mode_enter ( can_type * can_x )

enter the low power mode of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
Return values
status of doze mode enter, the returned value can be:
  • CAN_ENTER_DOZE_SUCCESSFUL <it meaning enter the doze mode succeed>
  • CAN_ENTER_DOZE_FAILED <it meaning enter the doze mode failed>

< time out for fzc bit

Definition at line 793 of file at32f415_can.c.

◆ can_doze_mode_exit()

can_quit_doze_status_type can_doze_mode_exit ( can_type * can_x )

exit the doze mode of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
Return values
status of doze mode enter, the returned value can be:
  • CAN_QUIT_DOZE_SUCCESSFUL <it meaning exit the doze mode succeed>
  • CAN_QUIT_DOZE_FAILED <it meaning exit the doze mode failed>

< time out for dzc bit

Definition at line 823 of file at32f415_can.c.

◆ can_error_type_record_get()

can_error_record_type can_error_type_record_get ( can_type * can_x )

return the error type record (etr) of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
Return values
the value of the error code the return can be one of the follow values:
  • CAN_ERRORRECORD_NOERR
  • CAN_ERRORRECORD_STUFFERR,
  • CAN_ERRORRECORD_FORMERR,
  • CAN_ERRORRECORD_ACKERR,
  • CAN_ERRORRECORD_BITRECESSIVEERR,
  • CAN_ERRORRECORD_BITDOMINANTERR,
  • CAN_ERRORRECORD_CRCERR,
  • CAN_ERRORRECORD_SOFTWARESETERR

Definition at line 855 of file at32f415_can.c.

◆ can_filter_default_para_init()

void can_filter_default_para_init ( can_filter_init_type * can_filter_init_struct )

fill each can_filter_init_struct member with its default value.

Parameters
can_filter_init_struct pointer to a can_filter_init_type structure which will be initialized.
Return values
none.

Definition at line 261 of file at32f415_can.c.

◆ can_filter_init()

void can_filter_init | ( | can_type * | can_x,
 |  | can_filter_init_type * | can_filter_init_struct
 | ) |  |

initialize the can peripheral according to the specified parameters in the can_filter_init_struct.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
can_filter_init_struct | pointer to a can_filter_init_type structure that contains the configuration information.
Return values
none.

Definition at line 296 of file at32f415_can.c.

Referenced by can_configuration().

◆ can_flag_clear()

void can_flag_clear | ( | can_type * | can_x,
 |  | uint32_t | can_flag
 | ) |  |

clear flag of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
can_flag select the flag. this parameter can be one of the following flags:
  • CAN_EAF_FLAG
  • CAN_EPF_FLAG
  • CAN_BOF_FLAG
  • CAN_ETR_FLAG
  • CAN_EOIF_FLAG
  • CAN_TM0TCF_FLAG
  • CAN_TM1TCF_FLAG
  • CAN_TM2TCF_FLAG
  • CAN_RF0FF_FLAG
  • CAN_RF0OF_FLAG
  • CAN_RF1FF_FLAG
  • CAN_RF1OF_FLAG
  • CAN_QDZIF_FLAG
  • CAN_EDZC_FLAG
  • CAN_TMEF_FLAG note:CAN_RF0MN_FLAG and CAN_RF1MN_FLAG can not clear by this function
Return values
none.

< error active flag

< error passive flag

< bus-off flag

< error occur interrupt flag

< eoif bit value, it clear by writing 1

< error type record flag

< eoif bit value, it clear by writing 1

< transmit mailbox 0 transmission completed flag

< tm0tcf bit value, it clear by writing 1

< transmit mailbox 1 transmission completed flag

< tm1tcf bit value, it clear by writing 1

< transmit mailbox 2 transmission completed flag

< tm2tcf bit value, it clear by writing 1

< receive fifo 0 full flag

< rf0ff bit value, it clear by writing 1

< receive fifo 0 overflow flag

< rf0of bit value, it clear by writing 1

< receive fifo 1 full flag

< rf1ff bit value, it clear by writing 1

< receive fifo 1 overflow flag

< rf1of bit value, it clear by writing 1

< quit doze mode interrupt flag

< qdzif bit value, it clear by writing 1

< enter doze mode confirm flag

< edzif bit value, it clear by writing 1

< transmit mailbox empty flag

< tm0tcf bit value, it clear by writing 1

< tm1tcf bit value, it clear by writing 1

< tm2tcf bit value, it clear by writing 1

Definition at line 1079 of file at32f415_can.c.

Referenced by CAN1_SE_IRQHandler().

◆ can_flag_get()

flag_status can_flag_get | ( | can_type * | can_x,
 |  | uint32_t | can_flag
 | ) |  |

get flag of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
can_flag select the flag. this parameter can be one of the following flags:
  • CAN_EAF_FLAG
  • CAN_EPF_FLAG
  • CAN_BOF_FLAG
  • CAN_ETR_FLAG
  • CAN_EOIF_FLAG
  • CAN_TM0TCF_FLAG
  • CAN_TM1TCF_FLAG
  • CAN_TM2TCF_FLAG
  • CAN_RF0MN_FLAG
  • CAN_RF0FF_FLAG
  • CAN_RF0OF_FLAG
  • CAN_RF1MN_FLAG
  • CAN_RF1FF_FLAG
  • CAN_RF1OF_FLAG
  • CAN_QDZIF_FLAG
  • CAN_EDZC_FLAG
  • CAN_TMEF_FLAG note:the state of CAN_EDZC_FLAG need to check dzc and edzif bit note:the state of CAN_TMEF_FLAG need to check rqc0,rqc1 and rqc2 bit
Return values
status of can_flag, the returned value can be:SET or RESET.

< error active flag

< error passive flag

< bus-off flag

< error type record flag

< error occur interrupt flag

< transmit mailbox 0 transmission completed flag

< transmit mailbox 1 transmission completed flag

< transmit mailbox 2 transmission completed flag

< receive fifo 0 message num flag

< receive fifo 0 full flag

< receive fifo 0 overflow flag

< receive fifo 1 message num flag

< receive fifo 1 full flag

< receive fifo 1 overflow flag

< quit doze mode interrupt flag

< enter doze mode confirm flag

< transmit mailbox empty flag

Definition at line 956 of file at32f415_can.c.

Referenced by CAN1_RX0_IRQHandler(), and CAN1_SE_IRQHandler().

◆ can_interrupt_enable()

void can_interrupt_enable | ( | can_type * | can_x,
 |  | uint32_t | can_int,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the interrupt of the specified can peripheral.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
can_int specifies the can interrupt sources to be enabled or disabled. this parameter can be one of the following values:
  • CAN_TCIEN_INT
  • CAN_RF0MIEN_INT
  • CAN_RF0FIEN_INT
  • CAN_RF0OIEN_INT
  • CAN_RF1MIEN_INT
  • CAN_RF1FIEN_INT
  • CAN_RF1OIEN_INT
  • CAN_EAIEN_INT
  • CAN_EPIEN_INT
  • CAN_BOIEN_INT
  • CAN_ETRIEN_INT
  • CAN_EOIEN_INT
  • CAN_QDZIEN_INT
  • CAN_EDZIEN_INT
new_state | new state of the can interrupts. this parameter can be: TRUE or FALSE.
Return values
none.

Definition at line 916 of file at32f415_can.c.

Referenced by can_configuration().

◆ can_message_receive()

void can_message_receive | ( | can_type * | can_x,
 |  | can_rx_fifo_num_type | fifo_number,
 |  | can_rx_message_type * | rx_message_struct
 | ) |  |

receive message of the specified can peripheral.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
fifo_number receive fifo number. this parameter can be one of the following values:
  • CAN_RX_FIFO0
  • CAN_RX_FIFO1
rx_message_struct | pointer to a structure which store the receive message.
Return values
none.

Definition at line 611 of file at32f415_can.c.

Referenced by CAN1_RX0_IRQHandler().

◆ can_message_transmit()

uint8_t can_message_transmit | ( | can_type * | can_x,
 |  | can_tx_message_type * | tx_message_struct
 | ) |  |

fill the transmission message and transmit of the specified can peripheral.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
tx_message_struct | pointer to a structure which contains the message to be trans.
Return values
the number of the mailbox that is used for transmission: this parameter can be one of the following values:
  • CAN_TX_MAILBOX0
  • CAN_TX_MAILBOX1
  • CAN_TX_MAILBOX2
  • CAN_TX_STATUS_NO_EMPTY <meanings there is no empty mailbox, message cannot be filled>

Definition at line 432 of file at32f415_can.c.

Referenced by can_transmit_data().

◆ can_operating_mode_set()

error_status can_operating_mode_set | ( | can_type * | can_x,
 |  | can_operating_mode_type | can_operating_mode
 | ) |  |

set the operation mode of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
can_operating_mode can operating mode. this parameter can be one of the following values:
  • CAN_OPERATINGMODE_FREEZE
  • CAN_OPERATINGMODE_DOZE
  • CAN_OPERATINGMODE_COMMUNICATE
Return values
status of operation mode set this parameter can be one of the following values: SUCCESS or ERROR

< time out for fzc bit

Definition at line 715 of file at32f415_can.c.

◆ can_receive_error_counter_get()

uint8_t can_receive_error_counter_get ( can_type * can_x )

return the receive error counter (rec) of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
Return values
the value of receive error counter.

Definition at line 870 of file at32f415_can.c.

◆ can_receive_fifo_release()

void can_receive_fifo_release | ( | can_type * | can_x,
 |  | can_rx_fifo_num_type | fifo_number
 | ) |  |

release the specified fifo of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
fifo_number fifo to be release. this parameter can be one of the following values:
  • CAN_RX_FIFO0
  • CAN_RX_FIFO1
Return values
none.

< rf0r bit value, it clear by writing 1

< rf1r bit value, it clear by writing 1

Definition at line 658 of file at32f415_can.c.

Referenced by can_message_receive().

◆ can_receive_message_pending_get()

uint8_t can_receive_message_pending_get | ( | can_type * | can_x,
 |  | can_rx_fifo_num_type | fifo_number
 | ) |  |

return the number of pending messages of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
fifo_number receive fifo number. this parameter can be one of the following values:
  • CAN_RX_FIFO0
  • CAN_RX_FIFO1
Return values
the number of message pending in the receive fifo.

Definition at line 684 of file at32f415_can.c.

◆ can_reset()

void can_reset ( can_type * can_x )

deinitialize the can peripheral registers to their default reset values.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
Return values
none.

Definition at line 51 of file at32f415_can.c.

Referenced by CAN1_SE_IRQHandler().

◆ can_transmit_cancel()

void can_transmit_cancel | ( | can_type * | can_x,
 |  | can_tx_mailbox_num_type | transmit_mailbox
 | ) |  |

cancel a transmit request of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
mailbox mailbox number. this parameter can be one of the following values:
  • CAN_TX_MAILBOX0
  • CAN_TX_MAILBOX1
  • CAN_TX_MAILBOX2
Return values
none.

< tm0ct bit value, it clear by writing 1

< tm1ct bit value, it clear by writing 1

< tm2ct bit value, it clear by writing 1

Definition at line 581 of file at32f415_can.c.

◆ can_transmit_error_counter_get()

uint8_t can_transmit_error_counter_get ( can_type * can_x )

return the transmit error counter of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
Return values
the value of transmit error counter.

Definition at line 884 of file at32f415_can.c.

◆ can_transmit_status_get()

can_transmit_status_type can_transmit_status_get | ( | can_type * | can_x,
 |  | can_tx_mailbox_num_type | transmit_mailbox
 | ) |  |

check the transmission state of the specified can peripheral.

Parameters
can_x select the can peripheral. this parameter can be one of the following values: CAN1.
transmit_mailbox the number of the mailbox that is used for transmission. this parameter can be one of the following values:
  • CAN_TX_MAILBOX0
  • CAN_TX_MAILBOX1
  • CAN_TX_MAILBOX2
Return values
can transmit status this parameter can be one of the following values:
  • CAN_TX_STATUS_SUCCESSFUL
  • CAN_TX_STATUS_FAILED
  • CAN_TX_STATUS_PENDING

Definition at line 506 of file at32f415_can.c.

Referenced by can_transmit_data().

◆ can_ttc_mode_enable()

void can_ttc_mode_enable | ( | can_type * | can_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable time trigger operation communication mode of the specified can peripheral.

Parameters
can_x | select the can peripheral. this parameter can be one of the following values: CAN1.
new_state | : new state of time trigger operation communication mode. this parameter can be: TRUE or FALSE.
Note

note1: when enabled, transmit mailbox time stamp(tmts[15:0]) value is sent in the last two data bytes of the 8-byte message: tmts[7:0] in data byte 6 and tmts[15:8] in data byte 7
note2: tmdtbl must be programmed as 8 in order time stamp (2 bytes) to be sent over the can bus.
Return values
none

Definition at line 408 of file at32f415_can.c.


AT32F415 Firmwary Library: CMP

Modules | Macros
CMP
AT32F415_periph_driver

CMP driver modules. More...

Modules

CMP_exported_types
CMP_exported_functions
CMP_private_functions

Macros

#define CMP ((cmp_type *) (CMP_BASE))

Detailed Description

CMP driver modules.

Macro Definition Documentation

◆ CMP

#define CMP ((cmp_type *) (CMP_BASE))

Definition at line 203 of file at32f415_cmp.h.


AT32F415 Firmwary Library: CMP_exported_types

Data Structures | Enumerations
CMP_exported_types
AT32F415_periph_driver » CMP

Data Structures

struct | cmp_init_type
cmp init type More...
struct | cmp_type
type define cmp register all More...

Enumerations

enum | cmp_non_inverting_type { CMP_NON_INVERTING_PA5 = 0x00 , CMP_NON_INVERTING_PA1 = 0x01 , CMP_NON_INVERTING_PA0 = 0x02 , CMP_NON_INVERTING_VSSA = 0x03 }
cmp non-inverting type More...
enum cmp_inverting_type {
CMP_INVERTING_1_4VREFINT = 0x00 , CMP_INVERTING_1_2VREFINT = 0x01 , CMP_INVERTING_3_4VREFINT = 0x02 , CMP_INVERTING_VREFINT = 0x03 ,
CMP_INVERTING_PA4 = 0x04 , CMP_INVERTING_PA5 = 0x05 , CMP_INVERTING_PA0 = 0x06 , CMP_INVERTING_PA2 = 0x07
}
cmp inverting type More...
enum | cmp_speed_type { CMP_SPEED_FAST = 0x00 , CMP_SPEED_MEDIUM = 0x01 , CMP_SPEED_SLOW = 0x02 , CMP_SPEED_ULTRALOW = 0x03 }
cmp speed type More...
enum cmp_output_type {
CMP_OUTPUT_NONE = 0x00 , CMP_OUTPUT_TMR1BRK = 0x01 , CMP_OUTPUT_TMR1CH1 = 0x02 , CMP_OUTPUT_TMR1CHCLR = 0x03 ,
CMP_OUTPUT_TMR2CH4 = 0x04 , CMP_OUTPUT_TMR2CHCLR = 0x05 , CMP_OUTPUT_TMR3CH1 = 0x06 , CMP_OUTPUT_TMR3CHCLR = 0x07
}
cmp output type More...
enum | cmp_polarity_type { CMP_POL_NON_INVERTING = 0x00 , CMP_POL_INVERTING = 0x01 }
cmp polarity type More...
enum | cmp_hysteresis_type { CMP_HYSTERESIS_NONE = 0x00 , CMP_HYSTERESIS_LOW = 0x01 , CMP_HYSTERESIS_MEDIUM = 0x02 , CMP_HYSTERESIS_HIGH = 0x03 }
cmp hysteresis type More...
enum | cmp_sel_type { CMP1_SELECTION = 0x00 , CMP2_SELECTION = 0x01 }
cmp selection type More...

Detailed Description

Enumeration Type Documentation

◆ cmp_hysteresis_type

enum cmp_hysteresis_type

cmp hysteresis type

Enumerator
CMP_HYSTERESIS_NONE | comparator selected no hysteresis
CMP_HYSTERESIS_LOW | comparator selected low hysteresis
CMP_HYSTERESIS_MEDIUM | comparator selected medium hysteresis
CMP_HYSTERESIS_HIGH | comparator selected high hysteresis

Definition at line 114 of file at32f415_cmp.h.

◆ cmp_inverting_type

enum cmp_inverting_type

cmp inverting type

Enumerator
CMP_INVERTING_1_4VREFINT | comparator inverting connect to 1_4vrefint
CMP_INVERTING_1_2VREFINT | comparator inverting connect to 1_2vrefint
CMP_INVERTING_3_4VREFINT | comparator inverting connect to 3_4vrefint
CMP_INVERTING_VREFINT | comparator inverting connect to vrefint
CMP_INVERTING_PA4 | comparator inverting connect to pa4
CMP_INVERTING_PA5 | comparator inverting connect to pa5
CMP_INVERTING_PA0 | comparator inverting connect to pa0
CMP_INVERTING_PA2 | comparator inverting connect to pa2

Definition at line 64 of file at32f415_cmp.h.

◆ cmp_non_inverting_type

enum cmp_non_inverting_type

cmp non-inverting type

Enumerator
CMP_NON_INVERTING_PA5 | comparator non-inverting connect to pa5
CMP_NON_INVERTING_PA1 | comparator non-inverting connect to pa1
CMP_NON_INVERTING_PA0 | comparator non-inverting connect to pa0
CMP_NON_INVERTING_VSSA | comparator non-inverting connect to vssa

Definition at line 53 of file at32f415_cmp.h.

◆ cmp_output_type

enum cmp_output_type

cmp output type

Enumerator
CMP_OUTPUT_NONE | comparator has no output
CMP_OUTPUT_TMR1BRK | comparator output connect to tmr1brk
CMP_OUTPUT_TMR1CH1 | comparator output connect to tmr1ch1
CMP_OUTPUT_TMR1CHCLR | comparator output connect to tmr1chclr
CMP_OUTPUT_TMR2CH4 | comparator output connect to tmr1chclr
CMP_OUTPUT_TMR2CHCLR | comparator output connect to tmr1chclr
CMP_OUTPUT_TMR3CH1 | comparator output connect to tmr3ch1
CMP_OUTPUT_TMR3CHCLR | comparator output connect to tmr3chclr

Definition at line 90 of file at32f415_cmp.h.

◆ cmp_polarity_type

enum cmp_polarity_type

cmp polarity type

Enumerator
CMP_POL_NON_INVERTING | comparator polarity non-inverting
CMP_POL_INVERTING | comparator polarity inverting

Definition at line 105 of file at32f415_cmp.h.

◆ cmp_sel_type

enum cmp_sel_type

cmp selection type

Enumerator
CMP1_SELECTION | select comparator 1
CMP2_SELECTION | select comparator 2

Definition at line 125 of file at32f415_cmp.h.

◆ cmp_speed_type

enum cmp_speed_type

cmp speed type

Enumerator
CMP_SPEED_FAST | comparator selected fast speed
CMP_SPEED_MEDIUM | comparator selected medium speed
CMP_SPEED_SLOW | comparator selected slow speed
CMP_SPEED_ULTRALOW | comparator selected ultralow speed

Definition at line 79 of file at32f415_cmp.h.


AT32F415 Firmwary Library: cmp_init_type Struct Reference

Data Fields
cmp_init_type Struct Reference
AT32F415_periph_driver » CMP » CMP_exported_types

cmp init type More...

#include <at32f415_cmp.h>

Data Fields

cmp_non_inverting_type cmp_non_inverting
cmp_inverting_type cmp_inverting
cmp_speed_type cmp_speed
cmp_output_type cmp_output
cmp_polarity_type cmp_polarity
cmp_hysteresis_type cmp_hysteresis

Detailed Description

cmp init type

Definition at line 134 of file at32f415_cmp.h.

Field Documentation

◆ cmp_hysteresis

cmp_hysteresis_type cmp_init_type::cmp_hysteresis

comparator hysteresis selection

Definition at line 141 of file at32f415_cmp.h.

Referenced by cmp_config(), cmp_default_para_init(), and cmp_init().

◆ cmp_inverting

cmp_inverting_type cmp_init_type::cmp_inverting

comparator inverting selection

Definition at line 137 of file at32f415_cmp.h.

Referenced by cmp_config(), cmp_default_para_init(), and cmp_init().

◆ cmp_non_inverting

cmp_non_inverting_type cmp_init_type::cmp_non_inverting

comparator non-inverting input selection

Definition at line 136 of file at32f415_cmp.h.

Referenced by cmp_default_para_init(), and cmp_init().

◆ cmp_output

cmp_output_type cmp_init_type::cmp_output

comparator output target selection

Definition at line 139 of file at32f415_cmp.h.

Referenced by cmp_config(), cmp_default_para_init(), and cmp_init().

◆ cmp_polarity

cmp_polarity_type cmp_init_type::cmp_polarity

comparator polarity selection

Definition at line 140 of file at32f415_cmp.h.

Referenced by cmp_config(), cmp_default_para_init(), and cmp_init().

◆ cmp_speed

cmp_speed_type cmp_init_type::cmp_speed

comparator speed selection

Definition at line 138 of file at32f415_cmp.h.

Referenced by cmp_config(), cmp_default_para_init(), and cmp_init().

The documentation for this struct was generated from the following file:
  • at32f415_cmp.h


AT32F415 Firmwary Library: cmp_type Struct Reference

Data Fields
cmp_type Struct Reference
AT32F415_periph_driver » CMP » CMP_exported_types

type define cmp register all More...

#include <at32f415_cmp.h>

Data Fields

union {
__IO uint32_t ctrlsts1
struct {
__IO uint32_t cmp1en: 1
__IO uint32_t cmp1is: 1
__IO uint32_t cmp1ssel: 1
__IO uint32_t reserved1: 1
__IO uint32_t cmp1invsel: 3
__IO uint32_t reserved2: 1
__IO uint32_t cmp1tag: 3
__IO uint32_t cmp1p: 1
__IO uint32_t cmp1hyst: 2
__IO uint32_t cmp1value: 1
__IO uint32_t cmp1wp: 1
__IO uint32_t cmp2en: 1
__IO uint32_t reserved3: 1
__IO uint32_t cmp2ssel: 1
__IO uint32_t reserved4: 1
__IO uint32_t cmp2invsel: 3
__IO uint32_t dcmpen: 1
__IO uint32_t cmp2tag: 3
__IO uint32_t cmp2p: 1
__IO uint32_t cmp2hyst: 2
__IO uint32_t cmp2value: 1
__IO uint32_t cmp2wp: 1
} ctrlsts1_bit
};
cmp control and status register1, offset:0x00 More...
union {
__IO uint32_t ctrlsts2
struct {
__IO uint32_t cmp1ninvsel: 2
__IO uint32_t reserved1: 14
__IO uint32_t cmp2ninvsel: 2
__IO uint32_t reserved2: 14
} ctrlsts2_bit
};
cmp control and status register2, offset:0x04 More...

Detailed Description

type define cmp register all

Definition at line 147 of file at32f415_cmp.h.

Field Documentation

◆

union { ... } cmp_type::@124

cmp control and status register1, offset:0x00

◆

union { ... } cmp_type::@126

cmp control and status register2, offset:0x04

◆ cmp1en

__IO uint32_t cmp_type::cmp1en

Definition at line 157 of file at32f415_cmp.h.

◆ cmp1hyst

__IO uint32_t cmp_type::cmp1hyst

Definition at line 165 of file at32f415_cmp.h.

◆ cmp1invsel

__IO uint32_t cmp_type::cmp1invsel

Definition at line 161 of file at32f415_cmp.h.

◆ cmp1is

__IO uint32_t cmp_type::cmp1is

Definition at line 158 of file at32f415_cmp.h.

◆ cmp1ninvsel

__IO uint32_t cmp_type::cmp1ninvsel

Definition at line 190 of file at32f415_cmp.h.

◆ cmp1p

__IO uint32_t cmp_type::cmp1p

Definition at line 164 of file at32f415_cmp.h.

◆ cmp1ssel

__IO uint32_t cmp_type::cmp1ssel

Definition at line 159 of file at32f415_cmp.h.

◆ cmp1tag

__IO uint32_t cmp_type::cmp1tag

Definition at line 163 of file at32f415_cmp.h.

◆ cmp1value

__IO uint32_t cmp_type::cmp1value

Definition at line 166 of file at32f415_cmp.h.

◆ cmp1wp

__IO uint32_t cmp_type::cmp1wp

Definition at line 167 of file at32f415_cmp.h.

◆ cmp2en

__IO uint32_t cmp_type::cmp2en

Definition at line 168 of file at32f415_cmp.h.

◆ cmp2hyst

__IO uint32_t cmp_type::cmp2hyst

Definition at line 176 of file at32f415_cmp.h.

◆ cmp2invsel

__IO uint32_t cmp_type::cmp2invsel

Definition at line 172 of file at32f415_cmp.h.

◆ cmp2ninvsel

__IO uint32_t cmp_type::cmp2ninvsel

Definition at line 192 of file at32f415_cmp.h.

◆ cmp2p

__IO uint32_t cmp_type::cmp2p

Definition at line 175 of file at32f415_cmp.h.

◆ cmp2ssel

__IO uint32_t cmp_type::cmp2ssel

Definition at line 170 of file at32f415_cmp.h.

◆ cmp2tag

__IO uint32_t cmp_type::cmp2tag

Definition at line 174 of file at32f415_cmp.h.

◆ cmp2value

__IO uint32_t cmp_type::cmp2value

Definition at line 177 of file at32f415_cmp.h.

◆ cmp2wp

__IO uint32_t cmp_type::cmp2wp

Definition at line 178 of file at32f415_cmp.h.

◆ ctrlsts1

__IO uint32_t cmp_type::ctrlsts1

Definition at line 154 of file at32f415_cmp.h.

◆

struct { ... } cmp_type::ctrlsts1_bit

◆ ctrlsts2

__IO uint32_t cmp_type::ctrlsts2

Definition at line 187 of file at32f415_cmp.h.

◆

struct { ... } cmp_type::ctrlsts2_bit

◆ dcmpen

__IO uint32_t cmp_type::dcmpen

Definition at line 173 of file at32f415_cmp.h.

◆ reserved1

__IO uint32_t cmp_type::reserved1

Definition at line 160 of file at32f415_cmp.h.

◆ reserved2

__IO uint32_t cmp_type::reserved2

Definition at line 162 of file at32f415_cmp.h.

◆ reserved3

__IO uint32_t cmp_type::reserved3

Definition at line 169 of file at32f415_cmp.h.

◆ reserved4

__IO uint32_t cmp_type::reserved4

Definition at line 171 of file at32f415_cmp.h.

The documentation for this struct was generated from the following file:
  • at32f415_cmp.h


AT32F415 Firmwary Library: CMP_exported_functions

Functions
CMP_exported_functions
AT32F415_periph_driver » CMP

Functions

void | cmp_reset (void)
reset the cmp register More...
void | cmp_init (cmp_sel_type cmp_sel, cmp_init_type *cmp_init_struct)
initialize the cmp peripheral More...
void | cmp_default_para_init (cmp_init_type *cmp_init_struct)
fill each cmp_init_type member with its default value. More...
void | cmp_enable (cmp_sel_type cmp_sel, confirm_state new_state)
enable or disable cmp More...
void | cmp_input_shift_enable (confirm_state new_state)
enable or disable cmp input shift More...
uint32_t | cmp_output_value_get (cmp_sel_type cmp_sel)
get cmp output value More...
void | cmp_write_protect_enable (cmp_sel_type cmp_sel)
enable cmp write protect More...

Detailed Description

Function Documentation

◆ cmp_default_para_init()

void cmp_default_para_init ( cmp_init_type * cmp_init_struct )

fill each cmp_init_type member with its default value.

Parameters
cmp_init_type : pointer to a cmp_init_type structure which will be initialized.
Return values
none

Definition at line 95 of file at32f415_cmp.c.

Referenced by cmp_config().

◆ cmp_enable()

void cmp_enable | ( | cmp_sel_type | cmp_sel,
 |  | confirm_state | new_state
 | ) |  |

enable or disable cmp

Parameters
cmp_sel | to select the cmp peripheral this parameter only can be CMP1_SELECTION.
new_state | (TRUE or FALSE)
Return values
none

Definition at line 113 of file at32f415_cmp.c.

Referenced by cmp_config().

◆ cmp_init()

void cmp_init | ( | cmp_sel_type | cmp_sel,
 |  | cmp_init_type * | cmp_init_struct
 | ) |  |

initialize the cmp peripheral

Parameters
cmp_sel | to select the cmp peripheral this parameter only can be CMP1_SELECTION
cmp_init_struct | pointer to cmp init structure
Return values
none

Definition at line 67 of file at32f415_cmp.c.

Referenced by cmp_config().

◆ cmp_input_shift_enable()

void cmp_input_shift_enable ( confirm_state new_state )

enable or disable cmp input shift

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 131 of file at32f415_cmp.c.

◆ cmp_output_value_get()

uint32_t cmp_output_value_get ( cmp_sel_type cmp_sel )

get cmp output value

Parameters
cmp_sel to select the cmp peripheral this parameter only can be CMP1_SELECTION.
Return values
cmp output value

Definition at line 142 of file at32f415_cmp.c.

◆ cmp_reset()

void cmp_reset ( void )

reset the cmp register

Parameters
none
Return values
none

Definition at line 54 of file at32f415_cmp.c.

◆ cmp_write_protect_enable()

void cmp_write_protect_enable ( cmp_sel_type cmp_sel )

enable cmp write protect

Parameters
cmp_sel to select the cmp peripheral this parameter only can be CMP1_SELECTION.
Return values
none

Definition at line 164 of file at32f415_cmp.c.


AT32F415 Firmwary Library: CMP_private_functions

Macros | Functions
CMP_private_functions
AT32F415_periph_driver » CMP

Macros

#define | CMP_CTRLSTS1_CLEAR_MASK ((uint32_t)0x00039C7C)
#define | CMP_INPINPUT_CLEAR_MASK ((uint32_t)0x00000180)
#define | CMP_HIGH_PULSE_CLEAR_MASK ((uint16_t)0x003F)
#define | CMP_LOW_PULSE_CLEAR_MASK ((uint16_t)0x003F)

Functions

void | cmp_reset (void)
reset the cmp register More...
void | cmp_init (cmp_sel_type cmp_sel, cmp_init_type *cmp_init_struct)
initialize the cmp peripheral More...
void | cmp_default_para_init (cmp_init_type *cmp_init_struct)
fill each cmp_init_type member with its default value. More...
void | cmp_enable (cmp_sel_type cmp_sel, confirm_state new_state)
enable or disable cmp More...
void | cmp_input_shift_enable (confirm_state new_state)
enable or disable cmp input shift More...
uint32_t | cmp_output_value_get (cmp_sel_type cmp_sel)
get cmp output value More...
void | cmp_write_protect_enable (cmp_sel_type cmp_sel)
enable cmp write protect More...

Detailed Description

Macro Definition Documentation

◆ CMP_CTRLSTS1_CLEAR_MASK

#define CMP_CTRLSTS1_CLEAR_MASK ((uint32_t)0x00039C7C)

Definition at line 44 of file at32f415_cmp.c.

◆ CMP_HIGH_PULSE_CLEAR_MASK

#define CMP_HIGH_PULSE_CLEAR_MASK ((uint16_t)0x003F)

Definition at line 46 of file at32f415_cmp.c.

◆ CMP_INPINPUT_CLEAR_MASK

#define CMP_INPINPUT_CLEAR_MASK ((uint32_t)0x00000180)

Definition at line 45 of file at32f415_cmp.c.

◆ CMP_LOW_PULSE_CLEAR_MASK

#define CMP_LOW_PULSE_CLEAR_MASK ((uint16_t)0x003F)

Definition at line 47 of file at32f415_cmp.c.

Function Documentation

◆ cmp_default_para_init()

void cmp_default_para_init ( cmp_init_type * cmp_init_struct )

fill each cmp_init_type member with its default value.

Parameters
cmp_init_type : pointer to a cmp_init_type structure which will be initialized.
Return values
none

Definition at line 95 of file at32f415_cmp.c.

Referenced by cmp_config().

◆ cmp_enable()

void cmp_enable | ( | cmp_sel_type | cmp_sel,
 |  | confirm_state | new_state
 | ) |  |

enable or disable cmp

Parameters
cmp_sel | to select the cmp peripheral this parameter only can be CMP1_SELECTION.
new_state | (TRUE or FALSE)
Return values
none

Definition at line 113 of file at32f415_cmp.c.

Referenced by cmp_config().

◆ cmp_init()

void cmp_init | ( | cmp_sel_type | cmp_sel,
 |  | cmp_init_type * | cmp_init_struct
 | ) |  |

initialize the cmp peripheral

Parameters
cmp_sel | to select the cmp peripheral this parameter only can be CMP1_SELECTION
cmp_init_struct | pointer to cmp init structure
Return values
none

Definition at line 67 of file at32f415_cmp.c.

Referenced by cmp_config().

◆ cmp_input_shift_enable()

void cmp_input_shift_enable ( confirm_state new_state )

enable or disable cmp input shift

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 131 of file at32f415_cmp.c.

◆ cmp_output_value_get()

uint32_t cmp_output_value_get ( cmp_sel_type cmp_sel )

get cmp output value

Parameters
cmp_sel to select the cmp peripheral this parameter only can be CMP1_SELECTION.
Return values
cmp output value

Definition at line 142 of file at32f415_cmp.c.

◆ cmp_reset()

void cmp_reset ( void )

reset the cmp register

Parameters
none
Return values
none

Definition at line 54 of file at32f415_cmp.c.

◆ cmp_write_protect_enable()

void cmp_write_protect_enable ( cmp_sel_type cmp_sel )

enable cmp write protect

Parameters
cmp_sel to select the cmp peripheral this parameter only can be CMP1_SELECTION.
Return values
none

Definition at line 164 of file at32f415_cmp.c.


AT32F415 Firmwary Library: CRC

Modules | Macros
CRC
AT32F415_periph_driver

CRC driver modules. More...

Modules

CRC_exported_types
CRC_exported_functions
CRC_private_functions

Macros

#define CRC ((crc_type *) CRC_BASE)

Detailed Description

CRC driver modules.

Macro Definition Documentation

◆ CRC

#define CRC ((crc_type *) CRC_BASE)

Definition at line 140 of file at32f415_crc.h.


AT32F415 Firmwary Library: CRC_exported_types

Data Structures | Enumerations
CRC_exported_types
AT32F415_periph_driver » CRC

Data Structures

struct crc_type
type define crc register all More...

Enumerations

enum | crc_reverse_input_type { CRC_REVERSE_INPUT_NO_AFFECTE = 0x00 , CRC_REVERSE_INPUT_BY_BYTE = 0x01 , CRC_REVERSE_INPUT_BY_HALFWORD = 0x02 , CRC_REVERSE_INPUT_BY_WORD = 0x03 }
crc reverse input data More...
enum | crc_reverse_output_type { CRC_REVERSE_OUTPUT_NO_AFFECTE = 0x00 , CRC_REVERSE_OUTPUT_DATA = 0x01 }
crc reverse output data More...

Detailed Description

Enumeration Type Documentation

◆ crc_reverse_input_type

enum crc_reverse_input_type

crc reverse input data

Enumerator
CRC_REVERSE_INPUT_NO_AFFECTE | input data no reverse
CRC_REVERSE_INPUT_BY_BYTE | input data reverse by byte
CRC_REVERSE_INPUT_BY_HALFWORD | input data reverse by half word
CRC_REVERSE_INPUT_BY_WORD | input data reverse by word

Definition at line 54 of file at32f415_crc.h.

◆ crc_reverse_output_type

enum crc_reverse_output_type

crc reverse output data

Enumerator
CRC_REVERSE_OUTPUT_NO_AFFECTE | output data no reverse
CRC_REVERSE_OUTPUT_DATA | output data reverse by word

Definition at line 65 of file at32f415_crc.h.


AT32F415 Firmwary Library: crc_type Struct Reference

Data Fields
crc_type Struct Reference
AT32F415_periph_driver » CRC » CRC_exported_types

type define crc register all More...

#include <at32f415_crc.h>

Data Fields

union {
__IO uint32_t dt
struct {
__IO uint32_t dt: 32
} dt_bit
};
crc dt register, offset:0x00 More...
union {
__IO uint32_t cdt
struct {
__IO uint32_t cdt: 8
__IO uint32_t reserved1: 24
} cdt_bit
};
crc cdt register, offset:0x04 More...
union {
__IO uint32_t ctrl
struct {
__IO uint32_t rst: 1
__IO uint32_t reserved1: 4
__IO uint32_t revid: 2
__IO uint32_t revod: 1
__IO uint32_t reserved2: 24
} ctrl_bit
};
crc ctrl register, offset:0x08 More...
union {
__IO uint32_t idt
struct {
__IO uint32_t idt: 32
} idt_bit
};
crc idt register, offset:0x10 More...

Detailed Description

type define crc register all

Definition at line 74 of file at32f415_crc.h.

Field Documentation

◆

union { ... } crc_type::@130

crc dt register, offset:0x00

◆

union { ... } crc_type::@132

crc cdt register, offset:0x04

◆

union { ... } crc_type::@134

crc ctrl register, offset:0x08

◆

union { ... } crc_type::@136

crc idt register, offset:0x10

◆ cdt

__IO uint32_t crc_type::cdt

Definition at line 93 of file at32f415_crc.h.

◆

struct { ... } crc_type::cdt_bit

◆ ctrl

__IO uint32_t crc_type::ctrl

Definition at line 106 of file at32f415_crc.h.

◆

struct { ... } crc_type::ctrl_bit

◆ dt

__IO uint32_t crc_type::dt

Definition at line 81 of file at32f415_crc.h.

◆

struct { ... } crc_type::dt_bit

◆ idt

__IO uint32_t crc_type::idt

Definition at line 127 of file at32f415_crc.h.

◆

struct { ... } crc_type::idt_bit

◆ reserved1

__IO uint32_t crc_type::reserved1

crm reserved1 register, offset:0x0C

Definition at line 97 of file at32f415_crc.h.

◆ reserved2

__IO uint32_t crc_type::reserved2

Definition at line 113 of file at32f415_crc.h.

◆ revid

__IO uint32_t crc_type::revid

Definition at line 111 of file at32f415_crc.h.

◆ revod

__IO uint32_t crc_type::revod

Definition at line 112 of file at32f415_crc.h.

◆ rst

__IO uint32_t crc_type::rst

Definition at line 109 of file at32f415_crc.h.

The documentation for this struct was generated from the following file:
  • at32f415_crc.h


AT32F415 Firmwary Library: CRC_exported_functions

Functions
CRC_exported_functions
AT32F415_periph_driver » CRC

Functions

void | crc_data_reset (void)
reset the crc data register. More...
uint32_t | crc_one_word_calculate (uint32_t data)
compute the 32-bit crc of a given data word(32-bit). More...
uint32_t | crc_block_calculate (uint32_t *pbuffer, uint32_t length)
compute the 32-bit crc of a given buffer of data word(32-bit). More...
uint32_t | crc_data_get (void)
return the current crc value. More...
void | crc_common_data_set (uint8_t cdt_value)
store a 8-bit data in the common data register. More...
uint8_t | crc_common_date_get (void)
return the 8-bit data stored in the common data register More...
void | crc_init_data_set (uint32_t value)
set the 32-bit initial data of crc More...
void | crc_reverse_input_data_set (crc_reverse_input_type value)
control the reversal of the bit order in the input data More...
void | crc_reverse_output_data_set (crc_reverse_output_type value)
control the reversal of the bit order in the output data More...

Detailed Description

Function Documentation

◆ crc_block_calculate()

uint32_t crc_block_calculate | ( | uint32_t * | pbuffer,
 |  | uint32_t | length
 | ) |  |

compute the 32-bit crc of a given buffer of data word(32-bit).

Parameters
pbuffer | pointer to the buffer containing the data to be computed
length | length of the buffer to be computed
Return values
32-bit crc

Definition at line 72 of file at32f415_crc.c.

Referenced by main().

◆ crc_common_data_set()

void crc_common_data_set ( uint8_t cdt_value )

store a 8-bit data in the common data register.

Parameters
cdt_value 8-bit value to be stored in the common data register
Return values
none

Definition at line 99 of file at32f415_crc.c.

◆ crc_common_date_get()

uint8_t crc_common_date_get ( void )

return the 8-bit data stored in the common data register

Parameters
none
Return values
8-bit value of the common data register

Definition at line 109 of file at32f415_crc.c.

◆ crc_data_get()

uint32_t crc_data_get ( void )

return the current crc value.

Parameters
none
Return values
32-bit crc

Definition at line 89 of file at32f415_crc.c.

Referenced by crc_cal().

◆ crc_data_reset()

void crc_data_reset ( void )

reset the crc data register.

Parameters
none
Return values
none

Definition at line 49 of file at32f415_crc.c.

Referenced by crc_cal(), flash_crc_check(), and main().

◆ crc_init_data_set()

void crc_init_data_set ( uint32_t value )

set the 32-bit initial data of crc

Parameters
value initial data
Return values
none

Definition at line 119 of file at32f415_crc.c.

◆ crc_one_word_calculate()

uint32_t crc_one_word_calculate ( uint32_t data )

compute the 32-bit crc of a given data word(32-bit).

Parameters
data data word(32-bit) to compute its crc
Return values
32-bit crc

Definition at line 60 of file at32f415_crc.c.

Referenced by crc_cal(), and flash_crc_check().

◆ crc_reverse_input_data_set()

void crc_reverse_input_data_set ( crc_reverse_input_type value )

control the reversal of the bit order in the input data

Parameters
value this parameter can be one of the following values:
  • CRC_REVERSE_INPUT_NO_AFFECTE
  • CRC_REVERSE_INPUT_BY_BYTE
  • CRC_REVERSE_INPUT_BY_HALFWORD
  • CRC_REVERSE_INPUT_BY_WORD
Return values
none.

Definition at line 134 of file at32f415_crc.c.

◆ crc_reverse_output_data_set()

void crc_reverse_output_data_set ( crc_reverse_output_type value )

control the reversal of the bit order in the output data

Parameters
value this parameter can be one of the following values:
  • CRC_REVERSE_OUTPUT_NO_AFFECTE
  • CRC_REVERSE_OUTPUT_DATA
Return values
none.

Definition at line 147 of file at32f415_crc.c.


AT32F415 Firmwary Library: CRC_private_functions

Functions
CRC_private_functions
AT32F415_periph_driver » CRC

Functions

void | crc_data_reset (void)
reset the crc data register. More...
uint32_t | crc_one_word_calculate (uint32_t data)
compute the 32-bit crc of a given data word(32-bit). More...
uint32_t | crc_block_calculate (uint32_t *pbuffer, uint32_t length)
compute the 32-bit crc of a given buffer of data word(32-bit). More...
uint32_t | crc_data_get (void)
return the current crc value. More...
void | crc_common_data_set (uint8_t cdt_value)
store a 8-bit data in the common data register. More...
uint8_t | crc_common_date_get (void)
return the 8-bit data stored in the common data register More...
void | crc_init_data_set (uint32_t value)
set the 32-bit initial data of crc More...
void | crc_reverse_input_data_set (crc_reverse_input_type value)
control the reversal of the bit order in the input data More...
void | crc_reverse_output_data_set (crc_reverse_output_type value)
control the reversal of the bit order in the output data More...

Detailed Description

Function Documentation

◆ crc_block_calculate()

uint32_t crc_block_calculate | ( | uint32_t * | pbuffer,
 |  | uint32_t | length
 | ) |  |

compute the 32-bit crc of a given buffer of data word(32-bit).

Parameters
pbuffer | pointer to the buffer containing the data to be computed
length | length of the buffer to be computed
Return values
32-bit crc

Definition at line 72 of file at32f415_crc.c.

Referenced by main().

◆ crc_common_data_set()

void crc_common_data_set ( uint8_t cdt_value )

store a 8-bit data in the common data register.

Parameters
cdt_value 8-bit value to be stored in the common data register
Return values
none

Definition at line 99 of file at32f415_crc.c.

◆ crc_common_date_get()

uint8_t crc_common_date_get ( void )

return the 8-bit data stored in the common data register

Parameters
none
Return values
8-bit value of the common data register

Definition at line 109 of file at32f415_crc.c.

◆ crc_data_get()

uint32_t crc_data_get ( void )

return the current crc value.

Parameters
none
Return values
32-bit crc

Definition at line 89 of file at32f415_crc.c.

Referenced by crc_cal().

◆ crc_data_reset()

void crc_data_reset ( void )

reset the crc data register.

Parameters
none
Return values
none

Definition at line 49 of file at32f415_crc.c.

Referenced by crc_cal(), flash_crc_check(), and main().

◆ crc_init_data_set()

void crc_init_data_set ( uint32_t value )

set the 32-bit initial data of crc

Parameters
value initial data
Return values
none

Definition at line 119 of file at32f415_crc.c.

◆ crc_one_word_calculate()

uint32_t crc_one_word_calculate ( uint32_t data )

compute the 32-bit crc of a given data word(32-bit).

Parameters
data data word(32-bit) to compute its crc
Return values
32-bit crc

Definition at line 60 of file at32f415_crc.c.

Referenced by crc_cal(), and flash_crc_check().

◆ crc_reverse_input_data_set()

void crc_reverse_input_data_set ( crc_reverse_input_type value )

control the reversal of the bit order in the input data

Parameters
value this parameter can be one of the following values:
  • CRC_REVERSE_INPUT_NO_AFFECTE
  • CRC_REVERSE_INPUT_BY_BYTE
  • CRC_REVERSE_INPUT_BY_HALFWORD
  • CRC_REVERSE_INPUT_BY_WORD
Return values
none.

Definition at line 134 of file at32f415_crc.c.

◆ crc_reverse_output_data_set()

void crc_reverse_output_data_set ( crc_reverse_output_type value )

control the reversal of the bit order in the output data

Parameters
value this parameter can be one of the following values:
  • CRC_REVERSE_OUTPUT_NO_AFFECTE
  • CRC_REVERSE_OUTPUT_DATA
Return values
none.

Definition at line 147 of file at32f415_crc.c.


AT32F415 Firmwary Library: CRM

Modules | Macros
CRM
AT32F415_periph_driver

CRM driver modules. More...

Modules

CRM_flags_definition
crm flag

CRM_interrupts_definition
crm interrupt

CRM_exported_types
CRM_exported_functions
CRM_private_functions

Macros

#define | CRM_REG(value) PERIPH_REG(CRM_BASE, value)
#define | CRM_REG_BIT(value) PERIPH_REG_BIT(value)
#define | CRM ((crm_type *) CRM_BASE)

Detailed Description

CRM driver modules.

Macro Definition Documentation

◆ CRM

#define CRM ((crm_type *) CRM_BASE)

Definition at line 858 of file at32f415_crm.h.

◆ CRM_REG

#define CRM_REG ( value ) PERIPH_REG(CRM_BASE, value)

Definition at line 47 of file at32f415_crm.h.

◆ CRM_REG_BIT

#define CRM_REG_BIT ( value ) PERIPH_REG_BIT(value)

Definition at line 48 of file at32f415_crm.h.


AT32F415 Firmwary Library: CRM_flags_definition

Macros
CRM_flags_definition
AT32F415_periph_driver » CRM

crm flag
More...

Macros

#define | CRM_HICK_STABLE_FLAG MAKE_VALUE(0x00, 1)
#define | CRM_HEXT_STABLE_FLAG MAKE_VALUE(0x00, 17)
#define | CRM_PLL_STABLE_FLAG MAKE_VALUE(0x00, 25)
#define | CRM_LEXT_STABLE_FLAG MAKE_VALUE(0x20, 1)
#define | CRM_LICK_STABLE_FLAG MAKE_VALUE(0x24, 1)
#define | CRM_NRST_RESET_FLAG MAKE_VALUE(0x24, 26)
#define | CRM_POR_RESET_FLAG MAKE_VALUE(0x24, 27)
#define | CRM_SW_RESET_FLAG MAKE_VALUE(0x24, 28)
#define | CRM_WDT_RESET_FLAG MAKE_VALUE(0x24, 29)
#define | CRM_WWDT_RESET_FLAG MAKE_VALUE(0x24, 30)
#define | CRM_LOWPOWER_RESET_FLAG MAKE_VALUE(0x24, 31)
#define | CRM_LICK_READY_INT_FLAG MAKE_VALUE(0x08, 0)
#define | CRM_LEXT_READY_INT_FLAG MAKE_VALUE(0x08, 1)
#define | CRM_HICK_READY_INT_FLAG MAKE_VALUE(0x08, 2)
#define | CRM_HEXT_READY_INT_FLAG MAKE_VALUE(0x08, 3)
#define | CRM_PLL_READY_INT_FLAG MAKE_VALUE(0x08, 4)
#define | CRM_CLOCK_FAILURE_INT_FLAG MAKE_VALUE(0x08, 7)

Detailed Description

crm flag

Macro Definition Documentation

◆ CRM_CLOCK_FAILURE_INT_FLAG

#define CRM_CLOCK_FAILURE_INT_FLAG MAKE_VALUE(0x08, 7)

clock failure interrupt ready flag

Definition at line 71 of file at32f415_crm.h.

◆ CRM_HEXT_READY_INT_FLAG

#define CRM_HEXT_READY_INT_FLAG MAKE_VALUE(0x08, 3)

high speed external crystal stable interrupt ready flag

Definition at line 69 of file at32f415_crm.h.

◆ CRM_HEXT_STABLE_FLAG

#define CRM_HEXT_STABLE_FLAG MAKE_VALUE(0x00, 17)

high speed external crystal stable flag

Definition at line 56 of file at32f415_crm.h.

◆ CRM_HICK_READY_INT_FLAG

#define CRM_HICK_READY_INT_FLAG MAKE_VALUE(0x08, 2)

high speed internal clock stable interrupt ready flag

Definition at line 68 of file at32f415_crm.h.

◆ CRM_HICK_STABLE_FLAG

#define CRM_HICK_STABLE_FLAG MAKE_VALUE(0x00, 1)

high speed internal clock stable flag

Definition at line 55 of file at32f415_crm.h.

◆ CRM_LEXT_READY_INT_FLAG

#define CRM_LEXT_READY_INT_FLAG MAKE_VALUE(0x08, 1)

low speed external crystal stable interrupt ready flag

Definition at line 67 of file at32f415_crm.h.

◆ CRM_LEXT_STABLE_FLAG

#define CRM_LEXT_STABLE_FLAG MAKE_VALUE(0x20, 1)

low speed external crystal stable flag

Definition at line 58 of file at32f415_crm.h.

◆ CRM_LICK_READY_INT_FLAG

#define CRM_LICK_READY_INT_FLAG MAKE_VALUE(0x08, 0)

low speed internal clock stable interrupt ready flag

Definition at line 66 of file at32f415_crm.h.

◆ CRM_LICK_STABLE_FLAG

#define CRM_LICK_STABLE_FLAG MAKE_VALUE(0x24, 1)

low speed internal clock stable flag

Definition at line 59 of file at32f415_crm.h.

◆ CRM_LOWPOWER_RESET_FLAG

#define CRM_LOWPOWER_RESET_FLAG MAKE_VALUE(0x24, 31)

low-power reset flag

Definition at line 65 of file at32f415_crm.h.

◆ CRM_NRST_RESET_FLAG

#define CRM_NRST_RESET_FLAG MAKE_VALUE(0x24, 26)

nrst pin reset flag

Definition at line 60 of file at32f415_crm.h.

◆ CRM_PLL_READY_INT_FLAG

#define CRM_PLL_READY_INT_FLAG MAKE_VALUE(0x08, 4)

phase locking loop stable interrupt ready flag

Definition at line 70 of file at32f415_crm.h.

◆ CRM_PLL_STABLE_FLAG

#define CRM_PLL_STABLE_FLAG MAKE_VALUE(0x00, 25)

phase locking loop stable flag

Definition at line 57 of file at32f415_crm.h.

◆ CRM_POR_RESET_FLAG

#define CRM_POR_RESET_FLAG MAKE_VALUE(0x24, 27)

power on reset flag

Definition at line 61 of file at32f415_crm.h.

◆ CRM_SW_RESET_FLAG

#define CRM_SW_RESET_FLAG MAKE_VALUE(0x24, 28)

software reset flag

Definition at line 62 of file at32f415_crm.h.

◆ CRM_WDT_RESET_FLAG

#define CRM_WDT_RESET_FLAG MAKE_VALUE(0x24, 29)

watchdog timer reset flag

Definition at line 63 of file at32f415_crm.h.

◆ CRM_WWDT_RESET_FLAG

#define CRM_WWDT_RESET_FLAG MAKE_VALUE(0x24, 30)

window watchdog timer reset flag

Definition at line 64 of file at32f415_crm.h.


AT32F415 Firmwary Library: CRM_interrupts_definition

Macros
CRM_interrupts_definition
AT32F415_periph_driver » CRM

crm interrupt
More...

Macros

#define | CRM_LICK_STABLE_INT ((uint32_t)0x00000100)
#define | CRM_LEXT_STABLE_INT ((uint32_t)0x00000200)
#define | CRM_HICK_STABLE_INT ((uint32_t)0x00000400)
#define | CRM_HEXT_STABLE_INT ((uint32_t)0x00000800)
#define | CRM_PLL_STABLE_INT ((uint32_t)0x00001000)
#define | CRM_CLOCK_FAILURE_INT ((uint32_t)0x00800000)

Detailed Description

crm interrupt

Macro Definition Documentation

◆ CRM_CLOCK_FAILURE_INT

#define CRM_CLOCK_FAILURE_INT ((uint32_t)0x00800000)

clock failure interrupt

Definition at line 87 of file at32f415_crm.h.

◆ CRM_HEXT_STABLE_INT

#define CRM_HEXT_STABLE_INT ((uint32_t)0x00000800)

high speed external crystal stable interrupt

Definition at line 85 of file at32f415_crm.h.

◆ CRM_HICK_STABLE_INT

#define CRM_HICK_STABLE_INT ((uint32_t)0x00000400)

high speed internal clock stable interrupt

Definition at line 84 of file at32f415_crm.h.

◆ CRM_LEXT_STABLE_INT

#define CRM_LEXT_STABLE_INT ((uint32_t)0x00000200)

low speed external crystal stable interrupt

Definition at line 83 of file at32f415_crm.h.

◆ CRM_LICK_STABLE_INT

#define CRM_LICK_STABLE_INT ((uint32_t)0x00000100)

low speed internal clock stable interrupt

Definition at line 82 of file at32f415_crm.h.

◆ CRM_PLL_STABLE_INT

#define CRM_PLL_STABLE_INT ((uint32_t)0x00001000)

phase locking loop stable interrupt

Definition at line 86 of file at32f415_crm.h.


AT32F415 Firmwary Library: CRM_exported_types

Data Structures | Enumerations
CRM_exported_types
AT32F415_periph_driver » CRM

Data Structures

struct | crm_clocks_freq_type
crm clocks freqency structure More...
struct | crm_type
type define crm register all More...

Enumerations

enum crm_periph_clock_type {
CRM_DMA1_PERIPH_CLOCK = (uint32_t)((( 0x14 ) << 16) | ( 0 & 0x1F)) , CRM_DMA2_PERIPH_CLOCK = (uint32_t)((( 0x14 ) << 16) | ( 1 & 0x1F)) , CRM_CRC_PERIPH_CLOCK = (uint32_t)((( 0x14 ) << 16) | ( 6 & 0x1F)) , CRM_SDIO1_PERIPH_CLOCK = (uint32_t)((( 0x14 ) << 16) | ( 10 & 0x1F)) ,
CRM_OTGFS1_PERIPH_CLOCK = (uint32_t)((( 0x14 ) << 16) | ( 12 & 0x1F)) , CRM_IOMUX_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 0 & 0x1F)) , CRM_GPIOA_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 2 & 0x1F)) , CRM_GPIOB_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 3 & 0x1F)) ,
CRM_GPIOC_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 4 & 0x1F)) , CRM_GPIOD_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 5 & 0x1F)) , CRM_GPIOF_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 7 & 0x1F)) , CRM_ADC1_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 9 & 0x1F)) ,
CRM_TMR1_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 11 & 0x1F)) , CRM_SPI1_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 12 & 0x1F)) , CRM_USART1_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 14 & 0x1F)) , CRM_TMR9_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 19 & 0x1F)) ,
CRM_TMR10_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 20 & 0x1F)) , CRM_TMR11_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 21 & 0x1F)) , CRM_TMR2_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 0 & 0x1F)) , CRM_TMR3_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 1 & 0x1F)) ,
CRM_TMR4_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 2 & 0x1F)) , CRM_TMR5_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 3 & 0x1F)) , CRM_CMP_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 9 & 0x1F)) , CRM_WWDT_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 11 & 0x1F)) ,
CRM_SPI2_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 14 & 0x1F)) , CRM_USART2_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 17 & 0x1F)) , CRM_USART3_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 18 & 0x1F)) , CRM_UART4_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 19 & 0x1F)) ,
CRM_UART5_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 20 & 0x1F)) , CRM_I2C1_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 21 & 0x1F)) , CRM_I2C2_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 22 & 0x1F)) , CRM_CAN1_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 25 & 0x1F)) ,
CRM_PWC_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 28 & 0x1F))
}
crm periph clock More...
enum crm_periph_reset_type {
CRM_OTGFS1_PERIPH_RESET = (uint32_t)((( 0x28 ) << 16) | ( 12 & 0x1F)) , CRM_IOMUX_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 0 & 0x1F)) , CRM_EXINT_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 1 & 0x1F)) , CRM_GPIOA_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 2 & 0x1F)) ,
CRM_GPIOB_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 3 & 0x1F)) , CRM_GPIOC_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 4 & 0x1F)) , CRM_GPIOD_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 5 & 0x1F)) , CRM_GPIOF_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 7 & 0x1F)) ,
CRM_ADC1_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 9 & 0x1F)) , CRM_TMR1_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 11 & 0x1F)) , CRM_SPI1_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 12 & 0x1F)) , CRM_USART1_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 14 & 0x1F)) ,
CRM_TMR9_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 19 & 0x1F)) , CRM_TMR10_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 20 & 0x1F)) , CRM_TMR11_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 21 & 0x1F)) , CRM_TMR2_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 0 & 0x1F)) ,
CRM_TMR3_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 1 & 0x1F)) , CRM_TMR4_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 2 & 0x1F)) , CRM_TMR5_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 3 & 0x1F)) , CRM_CMP_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 9 & 0x1F)) ,
CRM_WWDT_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 11 & 0x1F)) , CRM_SPI2_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 14 & 0x1F)) , CRM_USART2_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 17 & 0x1F)) , CRM_USART3_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 18 & 0x1F)) ,
CRM_UART4_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 19 & 0x1F)) , CRM_UART5_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 20 & 0x1F)) , CRM_I2C1_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 21 & 0x1F)) , CRM_I2C2_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 22 & 0x1F)) ,
CRM_CAN1_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 25 & 0x1F)) , CRM_PWC_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 28 & 0x1F))
}
crm periph reset More...
enum | crm_periph_clock_sleepmd_type { CRM_SRAM_PERIPH_CLOCK_SLEEP_MODE = (uint32_t)((( 0x14 ) << 16) | ( 2 & 0x1F)) , CRM_FLASH_PERIPH_CLOCK_SLEEP_MODE = (uint32_t)((( 0x14 ) << 16) | ( 4 & 0x1F)) }
crm periph clock in sleep mode More...
enum crm_pll_mult_type {
CRM_PLL_MULT_2 = 0 , CRM_PLL_MULT_3 = 1 , CRM_PLL_MULT_4 = 2 , CRM_PLL_MULT_5 = 3 ,
CRM_PLL_MULT_6 = 4 , CRM_PLL_MULT_7 = 5 , CRM_PLL_MULT_8 = 6 , CRM_PLL_MULT_9 = 7 ,
CRM_PLL_MULT_10 = 8 , CRM_PLL_MULT_11 = 9 , CRM_PLL_MULT_12 = 10 , CRM_PLL_MULT_13 = 11 ,
CRM_PLL_MULT_14 = 12 , CRM_PLL_MULT_15 = 13 , CRM_PLL_MULT_16 = 15 , CRM_PLL_MULT_17 = 16 ,
CRM_PLL_MULT_18 = 17 , CRM_PLL_MULT_19 = 18 , CRM_PLL_MULT_20 = 19 , CRM_PLL_MULT_21 = 20 ,
CRM_PLL_MULT_22 = 21 , CRM_PLL_MULT_23 = 22 , CRM_PLL_MULT_24 = 23 , CRM_PLL_MULT_25 = 24 ,
CRM_PLL_MULT_26 = 25 , CRM_PLL_MULT_27 = 26 , CRM_PLL_MULT_28 = 27 , CRM_PLL_MULT_29 = 28 ,
CRM_PLL_MULT_30 = 29 , CRM_PLL_MULT_31 = 30 , CRM_PLL_MULT_32 = 31 , CRM_PLL_MULT_33 = 32 ,
CRM_PLL_MULT_34 = 33 , CRM_PLL_MULT_35 = 34 , CRM_PLL_MULT_36 = 35 , CRM_PLL_MULT_37 = 36 ,
CRM_PLL_MULT_38 = 37 , CRM_PLL_MULT_39 = 38 , CRM_PLL_MULT_40 = 39 , CRM_PLL_MULT_41 = 40 ,
CRM_PLL_MULT_42 = 41 , CRM_PLL_MULT_43 = 42 , CRM_PLL_MULT_44 = 43 , CRM_PLL_MULT_45 = 44 ,
CRM_PLL_MULT_46 = 45 , CRM_PLL_MULT_47 = 46 , CRM_PLL_MULT_48 = 47 , CRM_PLL_MULT_49 = 48 ,
CRM_PLL_MULT_50 = 49 , CRM_PLL_MULT_51 = 50 , CRM_PLL_MULT_52 = 51 , CRM_PLL_MULT_53 = 52 ,
CRM_PLL_MULT_54 = 53 , CRM_PLL_MULT_55 = 54 , CRM_PLL_MULT_56 = 55 , CRM_PLL_MULT_57 = 56 ,
CRM_PLL_MULT_58 = 57 , CRM_PLL_MULT_59 = 58 , CRM_PLL_MULT_60 = 59 , CRM_PLL_MULT_61 = 60 ,
CRM_PLL_MULT_62 = 61 , CRM_PLL_MULT_63 = 62 , CRM_PLL_MULT_64 = 63
}
crm pll mult_x More...
enum crm_pll_fref_type {
CRM_PLL_FREF_4M = 0 , CRM_PLL_FREF_6M = 1 , CRM_PLL_FREF_8M = 2 , CRM_PLL_FREF_12M = 3 ,
CRM_PLL_FREF_16M = 4 , CRM_PLL_FREF_25M = 5
}
crm pll fref_x More...
enum | crm_pll_clock_source_type { CRM_PLL_SOURCE_HICK = 0x00 , CRM_PLL_SOURCE_HEXT = 0x01 , CRM_PLL_SOURCE_HEXT_DIV = 0x02 }
crm pll clock source More...
enum crm_pll_fr_type {
CRM_PLL_FR_1 = 0x00 , CRM_PLL_FR_2 = 0x01 , CRM_PLL_FR_4 = 0x02 , CRM_PLL_FR_8 = 0x03 ,
CRM_PLL_FR_16 = 0x04 , CRM_PLL_FR_32 = 0x05
}
crm pll fr More...
enum crm_clock_source_type {
CRM_CLOCK_SOURCE_HICK = 0x00 , CRM_CLOCK_SOURCE_HEXT = 0x01 , CRM_CLOCK_SOURCE_PLL = 0x02 , CRM_CLOCK_SOURCE_LEXT = 0x03 ,
CRM_CLOCK_SOURCE_LICK = 0x04
}
crm clock source More...
enum crm_ahb_div_type {
CRM_AHB_DIV_1 = 0x00 , CRM_AHB_DIV_2 = 0x08 , CRM_AHB_DIV_4 = 0x09 , CRM_AHB_DIV_8 = 0x0A ,
CRM_AHB_DIV_16 = 0x0B , CRM_AHB_DIV_64 = 0x0C , CRM_AHB_DIV_128 = 0x0D , CRM_AHB_DIV_256 = 0x0E ,
CRM_AHB_DIV_512 = 0x0F
}
crm ahb division More...
enum crm_apb1_div_type {
CRM_APB1_DIV_1 = 0x00 , CRM_APB1_DIV_2 = 0x04 , CRM_APB1_DIV_4 = 0x05 , CRM_APB1_DIV_8 = 0x06 ,
CRM_APB1_DIV_16 = 0x07
}
crm apb1 division More...
enum crm_apb2_div_type {
CRM_APB2_DIV_1 = 0x00 , CRM_APB2_DIV_2 = 0x04 , CRM_APB2_DIV_4 = 0x05 , CRM_APB2_DIV_8 = 0x06 ,
CRM_APB2_DIV_16 = 0x07
}
crm apb2 division More...
enum crm_adc_div_type {
CRM_ADC_DIV_2 = 0x00 , CRM_ADC_DIV_4 = 0x01 , CRM_ADC_DIV_6 = 0x02 , CRM_ADC_DIV_8 = 0x03 ,
CRM_ADC_DIV_12 = 0x05 , CRM_ADC_DIV_16 = 0x07
}
crm adc division More...
enum crm_usb_div_type {
CRM_USB_DIV_1_5 = 0x00 , CRM_USB_DIV_1 = 0x01 , CRM_USB_DIV_2_5 = 0x02 , CRM_USB_DIV_2 = 0x03 ,
CRM_USB_DIV_3_5 = 0x04 , CRM_USB_DIV_3 = 0x05 , CRM_USB_DIV_4 = 0x06
}
crm usb division More...
enum | crm_ertc_clock_type { CRM_ERTC_CLOCK_NOCLK = 0x00 , CRM_ERTC_CLOCK_LEXT = 0x01 , CRM_ERTC_CLOCK_LICK = 0x02 , CRM_ERTC_CLOCK_HEXT_DIV = 0x03 }
crm ertc clock More...
enum | crm_hick_div_6_type { CRM_HICK48_DIV6 = 0x00 , CRM_HICK48_NODIV = 0x01 }
crm hick 48mhz division More...
enum | crm_sclk_type { CRM_SCLK_HICK = 0x00 , CRM_SCLK_HEXT = 0x01 , CRM_SCLK_PLL = 0x02 }
crm sclk select More...
enum crm_clkout_select_type {
CRM_CLKOUT_NOCLK = 0x00 , CRM_CLKOUT_LICK = 0x02 , CRM_CLKOUT_LEXT = 0x03 , CRM_CLKOUT_SCLK = 0x04 ,
CRM_CLKOUT_HICK = 0x05 , CRM_CLKOUT_HEXT = 0x06 , CRM_CLKOUT_PLL_DIV_2 = 0x07 , CRM_CLKOUT_PLL_DIV_4 = 0x0C ,
CRM_CLKOUT_USB = 0x0D , CRM_CLKOUT_ADC = 0x0E
}
crm clkout select More...
enum crm_clkout_div_type {
CRM_CLKOUT_DIV_1 = 0x00 , CRM_CLKOUT_DIV_2 = 0x08 , CRM_CLKOUT_DIV_4 = 0x09 , CRM_CLKOUT_DIV_8 = 0x0A ,
CRM_CLKOUT_DIV_16 = 0x0B , CRM_CLKOUT_DIV_64 = 0x0C , CRM_CLKOUT_DIV_128 = 0x0D , CRM_CLKOUT_DIV_256 = 0x0E ,
CRM_CLKOUT_DIV_512 = 0x0F
}
crm clkout division More...
enum | crm_auto_step_mode_type { CRM_AUTO_STEP_MODE_DISABLE = 0x00 , CRM_AUTO_STEP_MODE_ENABLE = 0x03 }
crm auto step mode More...
enum | crm_usb_clock_source_type { CRM_USB_CLOCK_SOURCE_PLL = 0x00 , CRM_USB_CLOCK_SOURCE_HICK = 0x01 }
crm usb 48 mhz clock source select More...
enum | crm_hick_sclk_frequency_type { CRM_HICK_SCLK_8MHZ = 0x00 , CRM_HICK_SCLK_48MHZ = 0x01 }
crm hick as system clock frequency select More...

Detailed Description

Enumeration Type Documentation

◆ crm_adc_div_type

enum crm_adc_div_type

crm adc division

Enumerator
CRM_ADC_DIV_2 | apb2clk div2 to adcclk
CRM_ADC_DIV_4 | apb2clk div4 to adcclk
CRM_ADC_DIV_6 | apb2clk div6 to adcclk
CRM_ADC_DIV_8 | apb2clk div8 to adcclk
CRM_ADC_DIV_12 | apb2clk div12 to adcclk
CRM_ADC_DIV_16 | apb2clk div16 to adcclk

Definition at line 353 of file at32f415_crm.h.

◆ crm_ahb_div_type

enum crm_ahb_div_type

crm ahb division

Enumerator
CRM_AHB_DIV_1 | sclk div1 to ahbclk
CRM_AHB_DIV_2 | sclk div2 to ahbclk
CRM_AHB_DIV_4 | sclk div4 to ahbclk
CRM_AHB_DIV_8 | sclk div8 to ahbclk
CRM_AHB_DIV_16 | sclk div16 to ahbclk
CRM_AHB_DIV_64 | sclk div64 to ahbclk
CRM_AHB_DIV_128 | sclk div128 to ahbclk
CRM_AHB_DIV_256 | sclk div256 to ahbclk
CRM_AHB_DIV_512 | sclk div512 to ahbclk

Definition at line 313 of file at32f415_crm.h.

◆ crm_apb1_div_type

enum crm_apb1_div_type

crm apb1 division

Enumerator
CRM_APB1_DIV_1 | ahbclk div1 to apb1clk
CRM_APB1_DIV_2 | ahbclk div2 to apb1clk
CRM_APB1_DIV_4 | ahbclk div4 to apb1clk
CRM_APB1_DIV_8 | ahbclk div8 to apb1clk
CRM_APB1_DIV_16 | ahbclk div16 to apb1clk

Definition at line 329 of file at32f415_crm.h.

◆ crm_apb2_div_type

enum crm_apb2_div_type

crm apb2 division

Enumerator
CRM_APB2_DIV_1 | ahbclk div1 to apb2clk
CRM_APB2_DIV_2 | ahbclk div2 to apb2clk
CRM_APB2_DIV_4 | ahbclk div4 to apb2clk
CRM_APB2_DIV_8 | ahbclk div8 to apb2clk
CRM_APB2_DIV_16 | ahbclk div16 to apb2clk

Definition at line 341 of file at32f415_crm.h.

◆ crm_auto_step_mode_type

enum crm_auto_step_mode_type

crm auto step mode

Enumerator
CRM_AUTO_STEP_MODE_DISABLE | disable auto step mode
CRM_AUTO_STEP_MODE_ENABLE | enable auto step mode

Definition at line 443 of file at32f415_crm.h.

◆ crm_clkout_div_type

enum crm_clkout_div_type

crm clkout division

Enumerator
CRM_CLKOUT_DIV_1 | clkout div1
CRM_CLKOUT_DIV_2 | clkout div2
CRM_CLKOUT_DIV_4 | clkout div4
CRM_CLKOUT_DIV_8 | clkout div8
CRM_CLKOUT_DIV_16 | clkout div16
CRM_CLKOUT_DIV_64 | clkout div64
CRM_CLKOUT_DIV_128 | clkout div128
CRM_CLKOUT_DIV_256 | clkout div256
CRM_CLKOUT_DIV_512 | clkout div512

Definition at line 427 of file at32f415_crm.h.

◆ crm_clkout_select_type

enum crm_clkout_select_type

crm clkout select

Enumerator
CRM_CLKOUT_NOCLK | output no clock to clkout pin
CRM_CLKOUT_LICK | output low speed internal clock to clkout pin
CRM_CLKOUT_LEXT | output low speed external crystal to clkout pin
CRM_CLKOUT_SCLK | output system clock to clkout pin
CRM_CLKOUT_HICK | output high speed internal clock to clkout pin
CRM_CLKOUT_HEXT | output high speed external crystal to clkout pin
CRM_CLKOUT_PLL_DIV_2 | output phase locking loop clock div2 to clkout pin
CRM_CLKOUT_PLL_DIV_4 | output phase locking loop clock div4 to clkout pin
CRM_CLKOUT_USB | output usbclk to clkout pin
CRM_CLKOUT_ADC | output adcclk to clkout pin

Definition at line 410 of file at32f415_crm.h.

◆ crm_clock_source_type

enum crm_clock_source_type

crm clock source

Enumerator
CRM_CLOCK_SOURCE_HICK | high speed internal clock
CRM_CLOCK_SOURCE_HEXT | high speed external crystal
CRM_CLOCK_SOURCE_PLL | phase locking loop
CRM_CLOCK_SOURCE_LEXT | low speed external crystal
CRM_CLOCK_SOURCE_LICK | low speed internal clock

Definition at line 301 of file at32f415_crm.h.

◆ crm_ertc_clock_type

enum crm_ertc_clock_type

crm ertc clock

Enumerator
CRM_ERTC_CLOCK_NOCLK | no clock as ertc clock source
CRM_ERTC_CLOCK_LEXT | low speed external crystal as ertc clock source
CRM_ERTC_CLOCK_LICK | low speed internal clock as ertc clock source
CRM_ERTC_CLOCK_HEXT_DIV | high speed external crystal div as ertc clock source

Definition at line 380 of file at32f415_crm.h.

◆ crm_hick_div_6_type

enum crm_hick_div_6_type

crm hick 48mhz division

Enumerator
CRM_HICK48_DIV6 | high speed internal clock (48 mhz) div6
CRM_HICK48_NODIV | high speed internal clock (48 mhz) no div

Definition at line 391 of file at32f415_crm.h.

◆ crm_hick_sclk_frequency_type

enum crm_hick_sclk_frequency_type

crm hick as system clock frequency select

Enumerator
CRM_HICK_SCLK_8MHZ | fixed 8 mhz when hick is selected as sclk
CRM_HICK_SCLK_48MHZ | 8 mhz or 48 mhz depend on hickdiv when hick is selected as sclk

Definition at line 461 of file at32f415_crm.h.

◆ crm_periph_clock_sleepmd_type

enum crm_periph_clock_sleepmd_type

crm periph clock in sleep mode

Enumerator
CRM_SRAM_PERIPH_CLOCK_SLEEP_MODE | sram sleep mode periph clock
CRM_FLASH_PERIPH_CLOCK_SLEEP_MODE | flash sleep mode periph clock

Definition at line 185 of file at32f415_crm.h.

◆ crm_periph_clock_type

enum crm_periph_clock_type

crm periph clock

Enumerator
CRM_DMA1_PERIPH_CLOCK | dma1 periph clock
CRM_DMA2_PERIPH_CLOCK | dma2 periph clock
CRM_CRC_PERIPH_CLOCK | crc periph clock
CRM_SDIO1_PERIPH_CLOCK | sdio1 periph clock
CRM_OTGFS1_PERIPH_CLOCK | otgfs1 periph clock
CRM_IOMUX_PERIPH_CLOCK | iomux periph clock
CRM_GPIOA_PERIPH_CLOCK | gpioa periph clock
CRM_GPIOB_PERIPH_CLOCK | gpiob periph clock
CRM_GPIOC_PERIPH_CLOCK | gpioc periph clock
CRM_GPIOD_PERIPH_CLOCK | gpiod periph clock
CRM_GPIOF_PERIPH_CLOCK | gpiof periph clock
CRM_ADC1_PERIPH_CLOCK | adc1 periph clock
CRM_TMR1_PERIPH_CLOCK | tmr1 periph clock
CRM_SPI1_PERIPH_CLOCK | spi1 periph clock
CRM_USART1_PERIPH_CLOCK | usart1 periph clock
CRM_TMR9_PERIPH_CLOCK | tmr9 periph clock
CRM_TMR10_PERIPH_CLOCK | tmr10 periph clock
CRM_TMR11_PERIPH_CLOCK | tmr11 periph clock
CRM_TMR2_PERIPH_CLOCK | tmr2 periph clock
CRM_TMR3_PERIPH_CLOCK | tmr3 periph clock
CRM_TMR4_PERIPH_CLOCK | tmr4 periph clock
CRM_TMR5_PERIPH_CLOCK | tmr5 periph clock
CRM_CMP_PERIPH_CLOCK | cmparator periph clock
CRM_WWDT_PERIPH_CLOCK | wwdt periph clock
CRM_SPI2_PERIPH_CLOCK | spi2 periph clock
CRM_USART2_PERIPH_CLOCK | usart2 periph clock
CRM_USART3_PERIPH_CLOCK | usart3 periph clock
CRM_UART4_PERIPH_CLOCK | uart4 periph clock
CRM_UART5_PERIPH_CLOCK | uart5 periph clock
CRM_I2C1_PERIPH_CLOCK | i2c1 periph clock
CRM_I2C2_PERIPH_CLOCK | i2c2 periph clock
CRM_CAN1_PERIPH_CLOCK | can1 periph clock
CRM_PWC_PERIPH_CLOCK | pwc periph clock

Definition at line 100 of file at32f415_crm.h.

◆ crm_periph_reset_type

enum crm_periph_reset_type

crm periph reset

Enumerator
CRM_OTGFS1_PERIPH_RESET | otgfs1 periph reset
CRM_IOMUX_PERIPH_RESET | iomux periph reset
CRM_EXINT_PERIPH_RESET | exint periph reset
CRM_GPIOA_PERIPH_RESET | gpioa periph reset
CRM_GPIOB_PERIPH_RESET | gpiob periph reset
CRM_GPIOC_PERIPH_RESET | gpioc periph reset
CRM_GPIOD_PERIPH_RESET | gpiod periph reset
CRM_GPIOF_PERIPH_RESET | gpiof periph reset
CRM_ADC1_PERIPH_RESET | adc1 periph reset
CRM_TMR1_PERIPH_RESET | tmr1 periph reset
CRM_SPI1_PERIPH_RESET | spi2 periph reset
CRM_USART1_PERIPH_RESET | usart1 periph reset
CRM_TMR9_PERIPH_RESET | tmr9 periph reset
CRM_TMR10_PERIPH_RESET | tmr10 periph reset
CRM_TMR11_PERIPH_RESET | tmr11 periph reset
CRM_TMR2_PERIPH_RESET | tmr2 periph reset
CRM_TMR3_PERIPH_RESET | tmr3 periph reset
CRM_TMR4_PERIPH_RESET | tmr4 periph reset
CRM_TMR5_PERIPH_RESET | tmr5 periph reset
CRM_CMP_PERIPH_RESET | comparator periph reset
CRM_WWDT_PERIPH_RESET | wwdt periph reset
CRM_SPI2_PERIPH_RESET | spi2 periph reset
CRM_USART2_PERIPH_RESET | usart2 periph reset
CRM_USART3_PERIPH_RESET | usart3 periph reset
CRM_UART4_PERIPH_RESET | uart4 periph reset
CRM_UART5_PERIPH_RESET | uart5 periph reset
CRM_I2C1_PERIPH_RESET | i2c1 periph reset
CRM_I2C2_PERIPH_RESET | i2c2 periph reset
CRM_CAN1_PERIPH_RESET | can1 periph reset
CRM_PWC_PERIPH_RESET | pwc periph reset

Definition at line 144 of file at32f415_crm.h.

◆ crm_pll_clock_source_type

enum crm_pll_clock_source_type

crm pll clock source

Enumerator
CRM_PLL_SOURCE_HICK | high speed internal clock as pll reference clock source
CRM_PLL_SOURCE_HEXT | high speed external crystal as pll reference clock source
CRM_PLL_SOURCE_HEXT_DIV | high speed external crystal div as pll reference clock source

Definition at line 278 of file at32f415_crm.h.

◆ crm_pll_fr_type

enum crm_pll_fr_type

crm pll fr

Enumerator
CRM_PLL_FR_1 | pll post-division div1
CRM_PLL_FR_2 | pll post-division div2
CRM_PLL_FR_4 | pll post-division div4
CRM_PLL_FR_8 | pll post-division div8
CRM_PLL_FR_16 | pll post-division div16
CRM_PLL_FR_32 | pll post-division div32

Definition at line 288 of file at32f415_crm.h.

◆ crm_pll_fref_type

enum crm_pll_fref_type

crm pll fref_x

Enumerator
CRM_PLL_FREF_4M | pll refrence clock between 3.9 mhz and 5 mhz
CRM_PLL_FREF_6M | pll refrence clock between 5.2 mhz and 6.25 mhz
CRM_PLL_FREF_8M | pll refrence clock between 7.8125 mhz and 8.33 mhz
CRM_PLL_FREF_12M | pll refrence clock between 8.33 mhz and 12.5 mhz
CRM_PLL_FREF_16M | pll refrence clock between 15.625 mhz and 20.83 mhz
CRM_PLL_FREF_25M | pll refrence clock between 20.83 mhz and 31.255 mhz

Definition at line 265 of file at32f415_crm.h.

◆ crm_pll_mult_type

enum crm_pll_mult_type

crm pll mult_x

Enumerator
CRM_PLL_MULT_2 | pll multiplication factor 2
CRM_PLL_MULT_3 | pll multiplication factor 3
CRM_PLL_MULT_4 | pll multiplication factor 4
CRM_PLL_MULT_5 | pll multiplication factor 5
CRM_PLL_MULT_6 | pll multiplication factor 6
CRM_PLL_MULT_7 | pll multiplication factor 7
CRM_PLL_MULT_8 | pll multiplication factor 8
CRM_PLL_MULT_9 | pll multiplication factor 9
CRM_PLL_MULT_10 | pll multiplication factor 10
CRM_PLL_MULT_11 | pll multiplication factor 11
CRM_PLL_MULT_12 | pll multiplication factor 12
CRM_PLL_MULT_13 | pll multiplication factor 13
CRM_PLL_MULT_14 | pll multiplication factor 14
CRM_PLL_MULT_15 | pll multiplication factor 15
CRM_PLL_MULT_16 | pll multiplication factor 16
CRM_PLL_MULT_17 | pll multiplication factor 17
CRM_PLL_MULT_18 | pll multiplication factor 18
CRM_PLL_MULT_19 | pll multiplication factor 19
CRM_PLL_MULT_20 | pll multiplication factor 20
CRM_PLL_MULT_21 | pll multiplication factor 21
CRM_PLL_MULT_22 | pll multiplication factor 22
CRM_PLL_MULT_23 | pll multiplication factor 23
CRM_PLL_MULT_24 | pll multiplication factor 24
CRM_PLL_MULT_25 | pll multiplication factor 25
CRM_PLL_MULT_26 | pll multiplication factor 26
CRM_PLL_MULT_27 | pll multiplication factor 27
CRM_PLL_MULT_28 | pll multiplication factor 28
CRM_PLL_MULT_29 | pll multiplication factor 29
CRM_PLL_MULT_30 | pll multiplication factor 30
CRM_PLL_MULT_31 | pll multiplication factor 31
CRM_PLL_MULT_32 | pll multiplication factor 32
CRM_PLL_MULT_33 | pll multiplication factor 33
CRM_PLL_MULT_34 | pll multiplication factor 34
CRM_PLL_MULT_35 | pll multiplication factor 35
CRM_PLL_MULT_36 | pll multiplication factor 36
CRM_PLL_MULT_37 | pll multiplication factor 37
CRM_PLL_MULT_38 | pll multiplication factor 38
CRM_PLL_MULT_39 | pll multiplication factor 39
CRM_PLL_MULT_40 | pll multiplication factor 40
CRM_PLL_MULT_41 | pll multiplication factor 41
CRM_PLL_MULT_42 | pll multiplication factor 42
CRM_PLL_MULT_43 | pll multiplication factor 43
CRM_PLL_MULT_44 | pll multiplication factor 44
CRM_PLL_MULT_45 | pll multiplication factor 45
CRM_PLL_MULT_46 | pll multiplication factor 46
CRM_PLL_MULT_47 | pll multiplication factor 47
CRM_PLL_MULT_48 | pll multiplication factor 48
CRM_PLL_MULT_49 | pll multiplication factor 49
CRM_PLL_MULT_50 | pll multiplication factor 50
CRM_PLL_MULT_51 | pll multiplication factor 51
CRM_PLL_MULT_52 | pll multiplication factor 52
CRM_PLL_MULT_53 | pll multiplication factor 53
CRM_PLL_MULT_54 | pll multiplication factor 54
CRM_PLL_MULT_55 | pll multiplication factor 55
CRM_PLL_MULT_56 | pll multiplication factor 56
CRM_PLL_MULT_57 | pll multiplication factor 57
CRM_PLL_MULT_58 | pll multiplication factor 58
CRM_PLL_MULT_59 | pll multiplication factor 59
CRM_PLL_MULT_60 | pll multiplication factor 60
CRM_PLL_MULT_61 | pll multiplication factor 61
CRM_PLL_MULT_62 | pll multiplication factor 62
CRM_PLL_MULT_63 | pll multiplication factor 63
CRM_PLL_MULT_64 | pll multiplication factor 64

Definition at line 195 of file at32f415_crm.h.

◆ crm_sclk_type

enum crm_sclk_type

crm sclk select

Enumerator
CRM_SCLK_HICK | select high speed internal clock as sclk
CRM_SCLK_HEXT | select high speed external crystal as sclk
CRM_SCLK_PLL | select phase locking loop clock as sclk

Definition at line 400 of file at32f415_crm.h.

◆ crm_usb_clock_source_type

enum crm_usb_clock_source_type

crm usb 48 mhz clock source select

Enumerator
CRM_USB_CLOCK_SOURCE_PLL | select phase locking loop clock as usb clock source
CRM_USB_CLOCK_SOURCE_HICK | select high speed internal clock as usb clock source

Definition at line 452 of file at32f415_crm.h.

◆ crm_usb_div_type

enum crm_usb_div_type

crm usb division

Enumerator
CRM_USB_DIV_1_5 | pllclk div1.5 to usbclk
CRM_USB_DIV_1 | pllclk div1 to usbclk
CRM_USB_DIV_2_5 | pllclk div2.5 to usbclk
CRM_USB_DIV_2 | pllclk div2 to usbclk
CRM_USB_DIV_3_5 | pllclk div3.5 to usbclk
CRM_USB_DIV_3 | pllclk div3 to usbclk
CRM_USB_DIV_4 | pllclk div4 to usbclk

Definition at line 366 of file at32f415_crm.h.


AT32F415 Firmwary Library: crm_clocks_freq_type Struct Reference

Data Fields
crm_clocks_freq_type Struct Reference
AT32F415_periph_driver » CRM » CRM_exported_types

crm clocks freqency structure More...

#include <at32f415_crm.h>

Data Fields

uint32_t | sclk_freq
uint32_t | ahb_freq
uint32_t | apb2_freq
uint32_t | apb1_freq
uint32_t | adc_freq

Detailed Description

crm clocks freqency structure

Definition at line 470 of file at32f415_crm.h.

Field Documentation

◆ adc_freq

uint32_t crm_clocks_freq_type::adc_freq

adc clock frequency

Definition at line 476 of file at32f415_crm.h.

Referenced by crm_clocks_freq_get().

◆ ahb_freq

uint32_t crm_clocks_freq_type::ahb_freq

ahb bus clock frequency

Definition at line 473 of file at32f415_crm.h.

Referenced by crm_clocks_freq_get(), main(), and tmr_init().

◆ apb1_freq

uint32_t crm_clocks_freq_type::apb1_freq

apb1 bus clock frequency

Definition at line 475 of file at32f415_crm.h.

Referenced by crm_clocks_freq_get(), i2c_init(), lick_frequency_get(), and usart_init().

◆ apb2_freq

uint32_t crm_clocks_freq_type::apb2_freq

apb2 bus clock frequency

Definition at line 474 of file at32f415_crm.h.

Referenced by crm_clocks_freq_get(), and usart_init().

◆ sclk_freq

uint32_t crm_clocks_freq_type::sclk_freq

system clock frequency

Definition at line 472 of file at32f415_crm.h.

Referenced by crm_clocks_freq_get(), i2s_init(), main(), systick_configuration(), tmr1_config(), and TMR3_GLOBAL_IRQHandler().

The documentation for this struct was generated from the following file:
  • at32f415_crm.h


AT32F415 Firmwary Library: crm_type Struct Reference

Data Fields
crm_type Struct Reference
AT32F415_periph_driver » CRM » CRM_exported_types

type define crm register all More...

#include <at32f415_crm.h>

Data Fields

union {
__IO uint32_t ctrl
struct {
__IO uint32_t hicken: 1
__IO uint32_t hickstbl: 1
__IO uint32_t hicktrim: 6
__IO uint32_t hickcal: 8
__IO uint32_t hexten: 1
__IO uint32_t hextstbl: 1
__IO uint32_t hextbyps: 1
__IO uint32_t cfden: 1
__IO uint32_t reserved1: 4
__IO uint32_t pllen: 1
__IO uint32_t pllstbl: 1
__IO uint32_t reserved2: 6
} ctrl_bit
};
crm ctrl register, offset:0x00 More...
union {
__IO uint32_t cfg
struct {
__IO uint32_t sclksel: 2
__IO uint32_t sclksts: 2
__IO uint32_t ahbdiv: 4
__IO uint32_t apb1div: 3
__IO uint32_t apb2div: 3
__IO uint32_t adcdiv_l: 2
__IO uint32_t pllrcs: 1
__IO uint32_t pllhextdiv: 1
__IO uint32_t pllmult_l: 4
__IO uint32_t usbdiv_l: 2
__IO uint32_t clkout_sel: 3
__IO uint32_t usbdiv_h: 1
__IO uint32_t adcdiv_h: 1
__IO uint32_t pllmult_h: 2
__IO uint32_t reserved1: 1
} cfg_bit
};
crm cfg register, offset:0x04 More...
union {
__IO uint32_t clkint
struct {
__IO uint32_t lickstblf: 1
__IO uint32_t lextstblf: 1
__IO uint32_t hickstblf: 1
__IO uint32_t hextstblf: 1
__IO uint32_t pllstblf: 1
__IO uint32_t reserved1: 2
__IO uint32_t cfdf: 1
__IO uint32_t lickstblien: 1
__IO uint32_t lextstblien: 1
__IO uint32_t hickstblien: 1
__IO uint32_t hextstblien: 1
__IO uint32_t pllstblien: 1
__IO uint32_t reserved2: 3
__IO uint32_t lickstblfc: 1
__IO uint32_t lextstblfc: 1
__IO uint32_t hickstblfc: 1
__IO uint32_t hextstblfc: 1
__IO uint32_t pllstblfc: 1
__IO uint32_t reserved3: 2
__IO uint32_t cfdfc: 1
__IO uint32_t reserved4: 8
} clkint_bit
};
crm clkint register, offset:0x08 More...
union {
__IO uint32_t apb2rst
struct {
__IO uint32_t iomuxrst: 1
__IO uint32_t exintrst: 1
__IO uint32_t gpioarst: 1
__IO uint32_t gpiobrst: 1
__IO uint32_t gpiocrst: 1
__IO uint32_t gpiodrst: 1
__IO uint32_t reserved1: 1
__IO uint32_t gpiofrst: 1
__IO uint32_t reserved2: 1
__IO uint32_t adc1rst: 1
__IO uint32_t reserved3: 1
__IO uint32_t tmr1rst: 1
__IO uint32_t spi1rst: 1
__IO uint32_t reserved4: 1
__IO uint32_t usart1rst: 1
__IO uint32_t reserved5: 4
__IO uint32_t tmr9rst: 1
__IO uint32_t tmr10rst: 1
__IO uint32_t tmr11rst: 1
__IO uint32_t reserved6: 10
} apb2rst_bit
};
crm apb2rst register, offset:0x0C More...
union {
__IO uint32_t apb1rst
struct {
__IO uint32_t tmr2rst: 1
__IO uint32_t tmr3rst: 1
__IO uint32_t tmr4rst: 1
__IO uint32_t tmr5rst: 1
__IO uint32_t reserved1: 5
__IO uint32_t cmprst: 1
__IO uint32_t reserved2: 1
__IO uint32_t wwdtrst: 1
__IO uint32_t reserved3: 2
__IO uint32_t spi2rst: 1
__IO uint32_t reserved4: 2
__IO uint32_t usart2rst: 1
__IO uint32_t usart3rst: 1
__IO uint32_t uart4rst: 1
__IO uint32_t uart5rst: 1
__IO uint32_t i2c1rst: 1
__IO uint32_t i2c2rst: 1
__IO uint32_t reserved5: 2
__IO uint32_t can1rst: 1
__IO uint32_t reserved6: 2
__IO uint32_t pwcrst: 1
__IO uint32_t reserved7: 3
} apb1rst_bit
};
crm apb1rst register, offset:0x10 More...
union {
__IO uint32_t ahben
struct {
__IO uint32_t dma1en: 1
__IO uint32_t dma2en: 1
__IO uint32_t sramen: 1
__IO uint32_t reserved1: 1
__IO uint32_t flashen: 1
__IO uint32_t reserved2: 1
__IO uint32_t crcen: 1
__IO uint32_t reserved3: 3
__IO uint32_t sdio1en: 1
__IO uint32_t reserved4: 1
__IO uint32_t usben: 1
__IO uint32_t reserved5: 19
} ahben_bit
};
crm ahben register, offset:0x14 More...
union {
__IO uint32_t apb2en
struct {
__IO uint32_t iomuxen: 1
__IO uint32_t reserved1: 1
__IO uint32_t gpioaen: 1
__IO uint32_t gpioben: 1
__IO uint32_t gpiocen: 1
__IO uint32_t gpioden: 1
__IO uint32_t reserved2: 1
__IO uint32_t gpiofen: 1
__IO uint32_t reserved3: 1
__IO uint32_t adc1en: 1
__IO uint32_t reserved4: 1
__IO uint32_t tmr1en: 1
__IO uint32_t spi1en: 1
__IO uint32_t reserved5: 1
__IO uint32_t usart1en: 1
__IO uint32_t reserved6: 4
__IO uint32_t tmr9en: 1
__IO uint32_t tmr10en: 1
__IO uint32_t tmr11en: 1
__IO uint32_t reserved7: 10
} apb2en_bit
};
crm apb2en register, offset:0x18 More...
union {
__IO uint32_t apb1en
struct {
__IO uint32_t tmr2en: 1
__IO uint32_t tmr3en: 1
__IO uint32_t tmr4en: 1
__IO uint32_t tmr5en: 1
__IO uint32_t reserved1: 5
__IO uint32_t cmpen: 1
__IO uint32_t reserved2: 1
__IO uint32_t wwdten: 1
__IO uint32_t reserved3: 2
__IO uint32_t spi2en: 1
__IO uint32_t reserved4: 2
__IO uint32_t usart2en: 1
__IO uint32_t usart3en: 1
__IO uint32_t uart4en: 1
__IO uint32_t uart5en: 1
__IO uint32_t i2c1en: 1
__IO uint32_t i2c2en: 1
__IO uint32_t reserved5: 2
__IO uint32_t can1en: 1
__IO uint32_t reserved6: 1
__IO uint32_t bpren: 1
__IO uint32_t pwcen: 1
__IO uint32_t reserved7: 2
} apb1en_bit
};
crm apb1en register, offset:0x1C More...
union {
__IO uint32_t bpdc
struct {
__IO uint32_t lexten: 1
__IO uint32_t lextstbl: 1
__IO uint32_t lextbyps: 1
__IO uint32_t reserved1: 5
__IO uint32_t ertcsel: 2
__IO uint32_t reserved2: 5
__IO uint32_t ertcen: 1
__IO uint32_t bpdrst: 1
__IO uint32_t reserved3: 15
} bpdc_bit
};
crm bpdc register, offset:0x20 More...
union {
__IO uint32_t ctrlsts
struct {
__IO uint32_t licken: 1
__IO uint32_t lickstbl: 1
__IO uint32_t reserved1: 22
__IO uint32_t rstfc: 1
__IO uint32_t reserved2: 1
__IO uint32_t nrstf: 1
__IO uint32_t porrstf: 1
__IO uint32_t swrstf: 1
__IO uint32_t wdtrstf: 1
__IO uint32_t wwdtrstf: 1
__IO uint32_t lprstf: 1
} ctrlsts_bit
};
crm ctrlsts register, offset:0x24 More...
union {
__IO uint32_t ahbrst
struct {
__IO uint32_t reserved1: 12
__IO uint32_t usbrst: 1
__IO uint32_t reserved2: 19
} ahbrst_bit
};
crm ahbrst register, offset:0x28 More...
union {
__IO uint32_t pll
struct {
__IO uint32_t pllfr: 3
__IO uint32_t reserved1: 1
__IO uint32_t pllms: 4
__IO uint32_t pllns: 9
__IO uint32_t reserved2: 7
__IO uint32_t pllfref: 3
__IO uint32_t reserved3: 4
__IO uint32_t pllcfgen: 1
} pll_bit
};
crm pll register, offset:0x2C More...
union {
__IO uint32_t misc1
struct {
__IO uint32_t hickcal_key: 8
__IO uint32_t reserved1: 8
__IO uint32_t clkout_sel: 1
__IO uint32_t reserved2: 7
__IO uint32_t usbbufs: 1
__IO uint32_t hickdiv: 1
__IO uint32_t reserved3: 2
__IO uint32_t clkoutdiv: 4
} misc1_bit
};
crm misc1 register, offset:0x30 More...
union {
__IO uint32_t otg_extctrl
struct {
__IO uint32_t reserved1: 30
__IO uint32_t usbdivrst: 1
__IO uint32_t ep3_rmpen: 1
} otg_extctrl_bit
};
crm otg_extctrl register, offset:0x44 More...
union {
__IO uint32_t misc2
struct {
__IO uint32_t reserved1: 4
__IO uint32_t auto_step_en: 2
__IO uint32_t reserved2: 2
__IO uint32_t hick_to_usb: 1
__IO uint32_t hick_to_sclk: 1
__IO uint32_t reserved3: 22
} misc2_bit
};
crm misc2 register, offset:0x54 More...

Detailed Description

type define crm register all

Definition at line 482 of file at32f415_crm.h.

Field Documentation

◆

union { ... } crm_type::@142

crm ctrl register, offset:0x00

◆

union { ... } crm_type::@144

crm cfg register, offset:0x04

◆

union { ... } crm_type::@146

crm clkint register, offset:0x08

◆

union { ... } crm_type::@148

crm apb2rst register, offset:0x0C

◆

union { ... } crm_type::@150

crm apb1rst register, offset:0x10

◆

union { ... } crm_type::@152

crm ahben register, offset:0x14

◆

union { ... } crm_type::@154

crm apb2en register, offset:0x18

◆

union { ... } crm_type::@156

crm apb1en register, offset:0x1C

◆

union { ... } crm_type::@158

crm bpdc register, offset:0x20

◆

union { ... } crm_type::@160

crm ctrlsts register, offset:0x24

◆

union { ... } crm_type::@162

crm ahbrst register, offset:0x28

◆

union { ... } crm_type::@164

crm pll register, offset:0x2C

◆

union { ... } crm_type::@166

crm misc1 register, offset:0x30

◆

union { ... } crm_type::@168

crm otg_extctrl register, offset:0x44

◆

union { ... } crm_type::@170

crm misc2 register, offset:0x54

◆ adc1en

__IO uint32_t crm_type::adc1en

Definition at line 669 of file at32f415_crm.h.

◆ adc1rst

__IO uint32_t crm_type::adc1rst

Definition at line 582 of file at32f415_crm.h.

◆ adcdiv_h

__IO uint32_t crm_type::adcdiv_h

Definition at line 527 of file at32f415_crm.h.

◆ adcdiv_l

__IO uint32_t crm_type::adcdiv_l

Definition at line 520 of file at32f415_crm.h.

◆ ahbdiv

__IO uint32_t crm_type::ahbdiv

Definition at line 517 of file at32f415_crm.h.

◆ ahben

__IO uint32_t crm_type::ahben

Definition at line 634 of file at32f415_crm.h.

◆

struct { ... } crm_type::ahben_bit

◆ ahbrst

__IO uint32_t crm_type::ahbrst

Definition at line 764 of file at32f415_crm.h.

◆

struct { ... } crm_type::ahbrst_bit

◆ apb1div

__IO uint32_t crm_type::apb1div

Definition at line 518 of file at32f415_crm.h.

◆ apb1en

__IO uint32_t crm_type::apb1en

Definition at line 688 of file at32f415_crm.h.

◆

struct { ... } crm_type::apb1en_bit

◆ apb1rst

__IO uint32_t crm_type::apb1rst

Definition at line 601 of file at32f415_crm.h.

◆

struct { ... } crm_type::apb1rst_bit

◆ apb2div

__IO uint32_t crm_type::apb2div

Definition at line 519 of file at32f415_crm.h.

◆ apb2en

__IO uint32_t crm_type::apb2en

Definition at line 657 of file at32f415_crm.h.

◆

struct { ... } crm_type::apb2en_bit

◆ apb2rst

__IO uint32_t crm_type::apb2rst

Definition at line 570 of file at32f415_crm.h.

◆

struct { ... } crm_type::apb2rst_bit

◆ auto_step_en

__IO uint32_t crm_type::auto_step_en

Definition at line 844 of file at32f415_crm.h.

◆ bpdc

__IO uint32_t crm_type::bpdc

Definition at line 722 of file at32f415_crm.h.

◆

struct { ... } crm_type::bpdc_bit

◆ bpdrst

__IO uint32_t crm_type::bpdrst

Definition at line 732 of file at32f415_crm.h.

◆ bpren

__IO uint32_t crm_type::bpren

Definition at line 711 of file at32f415_crm.h.

◆ can1en

__IO uint32_t crm_type::can1en

Definition at line 709 of file at32f415_crm.h.

◆ can1rst

__IO uint32_t crm_type::can1rst

Definition at line 622 of file at32f415_crm.h.

◆ cfden

__IO uint32_t crm_type::cfden

Definition at line 499 of file at32f415_crm.h.

◆ cfdf

__IO uint32_t crm_type::cfdf

Definition at line 547 of file at32f415_crm.h.

◆ cfdfc

__IO uint32_t crm_type::cfdfc

Definition at line 560 of file at32f415_crm.h.

◆ cfg

__IO uint32_t crm_type::cfg

Definition at line 512 of file at32f415_crm.h.

◆

struct { ... } crm_type::cfg_bit

◆ clkint

__IO uint32_t crm_type::clkint

Definition at line 538 of file at32f415_crm.h.

◆

struct { ... } crm_type::clkint_bit

◆ clkout_sel

__IO uint32_t crm_type::clkout_sel

Definition at line 525 of file at32f415_crm.h.

◆ clkoutdiv

__IO uint32_t crm_type::clkoutdiv

Definition at line 807 of file at32f415_crm.h.

◆ cmpen

__IO uint32_t crm_type::cmpen

Definition at line 696 of file at32f415_crm.h.

◆ cmprst

__IO uint32_t crm_type::cmprst

Definition at line 609 of file at32f415_crm.h.

◆ crcen

__IO uint32_t crm_type::crcen

Definition at line 643 of file at32f415_crm.h.

◆ ctrl

__IO uint32_t crm_type::ctrl

Definition at line 489 of file at32f415_crm.h.

◆

struct { ... } crm_type::ctrl_bit

◆ ctrlsts

__IO uint32_t crm_type::ctrlsts

Definition at line 742 of file at32f415_crm.h.

◆

struct { ... } crm_type::ctrlsts_bit

◆ dma1en

__IO uint32_t crm_type::dma1en

Definition at line 637 of file at32f415_crm.h.

◆ dma2en

__IO uint32_t crm_type::dma2en

Definition at line 638 of file at32f415_crm.h.

◆ ep3_rmpen

__IO uint32_t crm_type::ep3_rmpen

Definition at line 826 of file at32f415_crm.h.

◆ ertcen

__IO uint32_t crm_type::ertcen

Definition at line 731 of file at32f415_crm.h.

◆ ertcsel

__IO uint32_t crm_type::ertcsel

Definition at line 729 of file at32f415_crm.h.

◆ exintrst

__IO uint32_t crm_type::exintrst

Definition at line 574 of file at32f415_crm.h.

◆ flashen

__IO uint32_t crm_type::flashen

Definition at line 641 of file at32f415_crm.h.

◆ gpioaen

__IO uint32_t crm_type::gpioaen

Definition at line 662 of file at32f415_crm.h.

◆ gpioarst

__IO uint32_t crm_type::gpioarst

Definition at line 575 of file at32f415_crm.h.

◆ gpioben

__IO uint32_t crm_type::gpioben

Definition at line 663 of file at32f415_crm.h.

◆ gpiobrst

__IO uint32_t crm_type::gpiobrst

Definition at line 576 of file at32f415_crm.h.

◆ gpiocen

__IO uint32_t crm_type::gpiocen

Definition at line 664 of file at32f415_crm.h.

◆ gpiocrst

__IO uint32_t crm_type::gpiocrst

Definition at line 577 of file at32f415_crm.h.

◆ gpioden

__IO uint32_t crm_type::gpioden

Definition at line 665 of file at32f415_crm.h.

◆ gpiodrst

__IO uint32_t crm_type::gpiodrst

Definition at line 578 of file at32f415_crm.h.

◆ gpiofen

__IO uint32_t crm_type::gpiofen

Definition at line 667 of file at32f415_crm.h.

◆ gpiofrst

__IO uint32_t crm_type::gpiofrst

Definition at line 580 of file at32f415_crm.h.

◆ hextbyps

__IO uint32_t crm_type::hextbyps

Definition at line 498 of file at32f415_crm.h.

◆ hexten

__IO uint32_t crm_type::hexten

Definition at line 496 of file at32f415_crm.h.

◆ hextstbl

__IO uint32_t crm_type::hextstbl

Definition at line 497 of file at32f415_crm.h.

◆ hextstblf

__IO uint32_t crm_type::hextstblf

Definition at line 544 of file at32f415_crm.h.

◆ hextstblfc

__IO uint32_t crm_type::hextstblfc

Definition at line 557 of file at32f415_crm.h.

◆ hextstblien

__IO uint32_t crm_type::hextstblien

Definition at line 551 of file at32f415_crm.h.

◆ hick_to_sclk

__IO uint32_t crm_type::hick_to_sclk

Definition at line 847 of file at32f415_crm.h.

◆ hick_to_usb

__IO uint32_t crm_type::hick_to_usb

Definition at line 846 of file at32f415_crm.h.

◆ hickcal

__IO uint32_t crm_type::hickcal

Definition at line 495 of file at32f415_crm.h.

◆ hickcal_key

__IO uint32_t crm_type::hickcal_key

Definition at line 800 of file at32f415_crm.h.

◆ hickdiv

__IO uint32_t crm_type::hickdiv

Definition at line 805 of file at32f415_crm.h.

◆ hicken

__IO uint32_t crm_type::hicken

Definition at line 492 of file at32f415_crm.h.

◆ hickstbl

__IO uint32_t crm_type::hickstbl

Definition at line 493 of file at32f415_crm.h.

◆ hickstblf

__IO uint32_t crm_type::hickstblf

Definition at line 543 of file at32f415_crm.h.

◆ hickstblfc

__IO uint32_t crm_type::hickstblfc

Definition at line 556 of file at32f415_crm.h.

◆ hickstblien

__IO uint32_t crm_type::hickstblien

Definition at line 550 of file at32f415_crm.h.

◆ hicktrim

__IO uint32_t crm_type::hicktrim

Definition at line 494 of file at32f415_crm.h.

◆ i2c1en

__IO uint32_t crm_type::i2c1en

Definition at line 706 of file at32f415_crm.h.

◆ i2c1rst

__IO uint32_t crm_type::i2c1rst

Definition at line 619 of file at32f415_crm.h.

◆ i2c2en

__IO uint32_t crm_type::i2c2en

Definition at line 707 of file at32f415_crm.h.

◆ i2c2rst

__IO uint32_t crm_type::i2c2rst

Definition at line 620 of file at32f415_crm.h.

◆ iomuxen

__IO uint32_t crm_type::iomuxen

Definition at line 660 of file at32f415_crm.h.

◆ iomuxrst

__IO uint32_t crm_type::iomuxrst

Definition at line 573 of file at32f415_crm.h.

◆ lextbyps

__IO uint32_t crm_type::lextbyps

Definition at line 727 of file at32f415_crm.h.

◆ lexten

__IO uint32_t crm_type::lexten

Definition at line 725 of file at32f415_crm.h.

◆ lextstbl

__IO uint32_t crm_type::lextstbl

Definition at line 726 of file at32f415_crm.h.

◆ lextstblf

__IO uint32_t crm_type::lextstblf

Definition at line 542 of file at32f415_crm.h.

◆ lextstblfc

__IO uint32_t crm_type::lextstblfc

Definition at line 555 of file at32f415_crm.h.

◆ lextstblien

__IO uint32_t crm_type::lextstblien

Definition at line 549 of file at32f415_crm.h.

◆ licken

__IO uint32_t crm_type::licken

Definition at line 745 of file at32f415_crm.h.

◆ lickstbl

__IO uint32_t crm_type::lickstbl

Definition at line 746 of file at32f415_crm.h.

◆ lickstblf

__IO uint32_t crm_type::lickstblf

Definition at line 541 of file at32f415_crm.h.

◆ lickstblfc

__IO uint32_t crm_type::lickstblfc

Definition at line 554 of file at32f415_crm.h.

◆ lickstblien

__IO uint32_t crm_type::lickstblien

Definition at line 548 of file at32f415_crm.h.

◆ lprstf

__IO uint32_t crm_type::lprstf

Definition at line 755 of file at32f415_crm.h.

◆ misc1

__IO uint32_t crm_type::misc1

Definition at line 797 of file at32f415_crm.h.

◆

struct { ... } crm_type::misc1_bit

◆ misc2

__IO uint32_t crm_type::misc2

Definition at line 840 of file at32f415_crm.h.

◆

struct { ... } crm_type::misc2_bit

◆ nrstf

__IO uint32_t crm_type::nrstf

Definition at line 750 of file at32f415_crm.h.

◆ otg_extctrl

__IO uint32_t crm_type::otg_extctrl

Definition at line 821 of file at32f415_crm.h.

◆

struct { ... } crm_type::otg_extctrl_bit

◆ pll

__IO uint32_t crm_type::pll

Definition at line 778 of file at32f415_crm.h.

◆

struct { ... } crm_type::pll_bit

◆ pllcfgen

__IO uint32_t crm_type::pllcfgen

Definition at line 788 of file at32f415_crm.h.

◆ pllen

__IO uint32_t crm_type::pllen

Definition at line 501 of file at32f415_crm.h.

◆ pllfr

__IO uint32_t crm_type::pllfr

Definition at line 781 of file at32f415_crm.h.

◆ pllfref

__IO uint32_t crm_type::pllfref

Definition at line 786 of file at32f415_crm.h.

◆ pllhextdiv

__IO uint32_t crm_type::pllhextdiv

Definition at line 522 of file at32f415_crm.h.

◆ pllms

__IO uint32_t crm_type::pllms

Definition at line 783 of file at32f415_crm.h.

◆ pllmult_h

__IO uint32_t crm_type::pllmult_h

Definition at line 528 of file at32f415_crm.h.

◆ pllmult_l

__IO uint32_t crm_type::pllmult_l

Definition at line 523 of file at32f415_crm.h.

◆ pllns

__IO uint32_t crm_type::pllns

Definition at line 784 of file at32f415_crm.h.

◆ pllrcs

__IO uint32_t crm_type::pllrcs

Definition at line 521 of file at32f415_crm.h.

◆ pllstbl

__IO uint32_t crm_type::pllstbl

Definition at line 502 of file at32f415_crm.h.

◆ pllstblf

__IO uint32_t crm_type::pllstblf

Definition at line 545 of file at32f415_crm.h.

◆ pllstblfc

__IO uint32_t crm_type::pllstblfc

Definition at line 558 of file at32f415_crm.h.

◆ pllstblien

__IO uint32_t crm_type::pllstblien

Definition at line 552 of file at32f415_crm.h.

◆ porrstf

__IO uint32_t crm_type::porrstf

Definition at line 751 of file at32f415_crm.h.

◆ pwcen

__IO uint32_t crm_type::pwcen

Definition at line 712 of file at32f415_crm.h.

◆ pwcrst

__IO uint32_t crm_type::pwcrst

Definition at line 624 of file at32f415_crm.h.

◆ reserved1

__IO uint32_t crm_type::reserved1

Definition at line 500 of file at32f415_crm.h.

◆ reserved2

__IO uint32_t crm_type::reserved2

crm reserved2 register, offset:0x40~0x34

Definition at line 503 of file at32f415_crm.h.

◆ reserved3

__IO uint32_t crm_type::reserved3

crm reserved3 register, offset:0x50~0x48

Definition at line 559 of file at32f415_crm.h.

◆ reserved4

__IO uint32_t crm_type::reserved4

Definition at line 561 of file at32f415_crm.h.

◆ reserved5

__IO uint32_t crm_type::reserved5

Definition at line 588 of file at32f415_crm.h.

◆ reserved6

__IO uint32_t crm_type::reserved6

Definition at line 592 of file at32f415_crm.h.

◆ reserved7

__IO uint32_t crm_type::reserved7

Definition at line 625 of file at32f415_crm.h.

◆ rstfc

__IO uint32_t crm_type::rstfc

Definition at line 748 of file at32f415_crm.h.

◆ sclksel

__IO uint32_t crm_type::sclksel

Definition at line 515 of file at32f415_crm.h.

◆ sclksts

__IO uint32_t crm_type::sclksts

Definition at line 516 of file at32f415_crm.h.

◆ sdio1en

__IO uint32_t crm_type::sdio1en

Definition at line 645 of file at32f415_crm.h.

◆ spi1en

__IO uint32_t crm_type::spi1en

Definition at line 672 of file at32f415_crm.h.

◆ spi1rst

__IO uint32_t crm_type::spi1rst

Definition at line 585 of file at32f415_crm.h.

◆ spi2en

__IO uint32_t crm_type::spi2en

Definition at line 700 of file at32f415_crm.h.

◆ spi2rst

__IO uint32_t crm_type::spi2rst

Definition at line 613 of file at32f415_crm.h.

◆ sramen

__IO uint32_t crm_type::sramen

Definition at line 639 of file at32f415_crm.h.

◆ swrstf

__IO uint32_t crm_type::swrstf

Definition at line 752 of file at32f415_crm.h.

◆ tmr10en

__IO uint32_t crm_type::tmr10en

Definition at line 677 of file at32f415_crm.h.

◆ tmr10rst

__IO uint32_t crm_type::tmr10rst

Definition at line 590 of file at32f415_crm.h.

◆ tmr11en

__IO uint32_t crm_type::tmr11en

Definition at line 678 of file at32f415_crm.h.

◆ tmr11rst

__IO uint32_t crm_type::tmr11rst

Definition at line 591 of file at32f415_crm.h.

◆ tmr1en

__IO uint32_t crm_type::tmr1en

Definition at line 671 of file at32f415_crm.h.

◆ tmr1rst

__IO uint32_t crm_type::tmr1rst

Definition at line 584 of file at32f415_crm.h.

◆ tmr2en

__IO uint32_t crm_type::tmr2en

Definition at line 691 of file at32f415_crm.h.

◆ tmr2rst

__IO uint32_t crm_type::tmr2rst

Definition at line 604 of file at32f415_crm.h.

◆ tmr3en

__IO uint32_t crm_type::tmr3en

Definition at line 692 of file at32f415_crm.h.

◆ tmr3rst

__IO uint32_t crm_type::tmr3rst

Definition at line 605 of file at32f415_crm.h.

◆ tmr4en

__IO uint32_t crm_type::tmr4en

Definition at line 693 of file at32f415_crm.h.

◆ tmr4rst

__IO uint32_t crm_type::tmr4rst

Definition at line 606 of file at32f415_crm.h.

◆ tmr5en

__IO uint32_t crm_type::tmr5en

Definition at line 694 of file at32f415_crm.h.

◆ tmr5rst

__IO uint32_t crm_type::tmr5rst

Definition at line 607 of file at32f415_crm.h.

◆ tmr9en

__IO uint32_t crm_type::tmr9en

Definition at line 676 of file at32f415_crm.h.

◆ tmr9rst

__IO uint32_t crm_type::tmr9rst

Definition at line 589 of file at32f415_crm.h.

◆ uart4en

__IO uint32_t crm_type::uart4en

Definition at line 704 of file at32f415_crm.h.

◆ uart4rst

__IO uint32_t crm_type::uart4rst

Definition at line 617 of file at32f415_crm.h.

◆ uart5en

__IO uint32_t crm_type::uart5en

Definition at line 705 of file at32f415_crm.h.

◆ uart5rst

__IO uint32_t crm_type::uart5rst

Definition at line 618 of file at32f415_crm.h.

◆ usart1en

__IO uint32_t crm_type::usart1en

Definition at line 674 of file at32f415_crm.h.

◆ usart1rst

__IO uint32_t crm_type::usart1rst

Definition at line 587 of file at32f415_crm.h.

◆ usart2en

__IO uint32_t crm_type::usart2en

Definition at line 702 of file at32f415_crm.h.

◆ usart2rst

__IO uint32_t crm_type::usart2rst

Definition at line 615 of file at32f415_crm.h.

◆ usart3en

__IO uint32_t crm_type::usart3en

Definition at line 703 of file at32f415_crm.h.

◆ usart3rst

__IO uint32_t crm_type::usart3rst

Definition at line 616 of file at32f415_crm.h.

◆ usbbufs

__IO uint32_t crm_type::usbbufs

Definition at line 804 of file at32f415_crm.h.

◆ usbdiv_h

__IO uint32_t crm_type::usbdiv_h

Definition at line 526 of file at32f415_crm.h.

◆ usbdiv_l

__IO uint32_t crm_type::usbdiv_l

Definition at line 524 of file at32f415_crm.h.

◆ usbdivrst

__IO uint32_t crm_type::usbdivrst

Definition at line 825 of file at32f415_crm.h.

◆ usben

__IO uint32_t crm_type::usben

Definition at line 647 of file at32f415_crm.h.

◆ usbrst

__IO uint32_t crm_type::usbrst

Definition at line 768 of file at32f415_crm.h.

◆ wdtrstf

__IO uint32_t crm_type::wdtrstf

Definition at line 753 of file at32f415_crm.h.

◆ wwdten

__IO uint32_t crm_type::wwdten

Definition at line 698 of file at32f415_crm.h.

◆ wwdtrst

__IO uint32_t crm_type::wwdtrst

Definition at line 611 of file at32f415_crm.h.

◆ wwdtrstf

__IO uint32_t crm_type::wwdtrstf

Definition at line 754 of file at32f415_crm.h.

The documentation for this struct was generated from the following file:
  • at32f415_crm.h


AT32F415 Firmwary Library: CRM_exported_functions

Functions
CRM_exported_functions
AT32F415_periph_driver » CRM

Functions

void | crm_reset (void)
reset the crm register More...
void | crm_lext_bypass (confirm_state new_state)
enable or disable crm low speed external crystal bypass More...
void | crm_hext_bypass (confirm_state new_state)
enable or disable crm high speed external crystal bypass More...
flag_status | crm_flag_get (uint32_t flag)
get crm flag status More...
error_status | crm_hext_stable_wait (void)
wait for hext stable More...
void | crm_hick_clock_trimming_set (uint8_t trim_value)
set the hick trimming value More...
void | crm_hick_clock_calibration_set (uint8_t cali_value)
set the crm calibration value More...
void | crm_periph_clock_enable (crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock More...
void | crm_periph_reset (crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset More...
void | crm_periph_sleep_mode_clock_enable (crm_periph_clock_sleepmd_type value, confirm_state new_state)
enable or disable the peripheral clock in sleep mode More...
void | crm_clock_source_enable (crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source More...
void | crm_flag_clear (uint32_t flag)
clear the crm reset flags More...
void | crm_ertc_clock_select (crm_ertc_clock_type value)
select ertc clock More...
void | crm_ertc_clock_enable (confirm_state new_state)
enable or disable ertc More...
void | crm_ahb_div_set (crm_ahb_div_type value)
set crm ahb division More...
void | crm_apb1_div_set (crm_apb1_div_type value)
set crm apb1 division More...
void | crm_apb2_div_set (crm_apb2_div_type value)
set crm apb2 division More...
void | crm_adc_clock_div_set (crm_adc_div_type div_value)
set crm adc division More...
void | crm_usb_clock_div_set (crm_usb_div_type div_value)
set crm usb division More...
void | crm_clock_failure_detection_enable (confirm_state new_state)
enable or disable clock failure detection More...
void | crm_battery_powered_domain_reset (confirm_state new_state)
battery powered domain software reset More...
void | crm_pll_config (crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll More...
void | crm_pll_config2 (crm_pll_clock_source_type clock_source, uint16_t pll_ns, uint16_t pll_ms, crm_pll_fr_type pll_fr)
config crm pll function2, another method. pll_rcs_freq * pll_ns pll clock = -----------------------------— pll_ms * pll_fr_n attemtion: 31 <= pll_ns <= 500 1 <= pll_ms <= 15 More...
void | crm_sysclk_switch (crm_sclk_type value)
select system clock source More...
crm_sclk_type | crm_sysclk_switch_status_get (void)
indicate which clock source is used as system clock More...
void | crm_clocks_freq_get (crm_clocks_freq_type *clocks_struct)
get crm clocks freqency More...
void | crm_clock_out_set (crm_clkout_select_type clkout)
set crm clkout More...
void | crm_interrupt_enable (uint32_t crm_int, confirm_state new_state)
config crm interrupt More...
void | crm_auto_step_mode_enable (confirm_state new_state)
auto step clock switch enable More...
void | crm_hick_divider_select (crm_hick_div_6_type value)
config hick divider select More...
void | crm_hick_sclk_frequency_select (crm_hick_sclk_frequency_type value)
hick as system clock frequency select More...
void | crm_usb_clock_source_select (crm_usb_clock_source_type value)
usb 48 mhz clock source select More...
void | crm_clkout_div_set (crm_clkout_div_type clkout_div)
set crm clkout division More...
void | crm_otgfs_ep3_remap_enable (confirm_state new_state)
enable or disable otgfs end-point3 remap, only available in at32f415xx revision C. at32f415xx revision B: (not support) do not support configuration ep3 remap. More...
void | crm_usbdiv_reset (confirm_state new_state)
usb divider reset, only available in at32f415xx revision C. at32f415xx revision B: (not support) usb divider(CRM_CFG[usbdiv]) do not support to be reset. More...

Detailed Description

Function Documentation

◆ crm_adc_clock_div_set()

void crm_adc_clock_div_set ( crm_adc_div_type div_value )

set crm adc division

Parameters
value this parameter can be one of the following values:
  • CRM_ADC_DIV_2
  • CRM_ADC_DIV_4
  • CRM_ADC_DIV_6
  • CRM_ADC_DIV_8
  • CRM_ADC_DIV_12
  • CRM_ADC_DIV_16
Return values
none

Definition at line 456 of file at32f415_crm.c.

Referenced by adc_config().

◆ crm_ahb_div_set()

void crm_ahb_div_set ( crm_ahb_div_type value )

set crm ahb division

Parameters
value this parameter can be one of the following values:
  • CRM_AHB_DIV_1
  • CRM_AHB_DIV_2
  • CRM_AHB_DIV_4
  • CRM_AHB_DIV_8
  • CRM_AHB_DIV_16
  • CRM_AHB_DIV_64
  • CRM_AHB_DIV_128
  • CRM_AHB_DIV_256
  • CRM_AHB_DIV_512
Return values
none

Definition at line 407 of file at32f415_crm.c.

Referenced by sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), and system_clock_config().

◆ crm_apb1_div_set()

void crm_apb1_div_set ( crm_apb1_div_type value )

set crm apb1 division

Parameters
value this parameter can be one of the following values:
  • CRM_APB1_DIV_1
  • CRM_APB1_DIV_2
  • CRM_APB1_DIV_4
  • CRM_APB1_DIV_8
  • CRM_APB1_DIV_16
Return values
none

Definition at line 423 of file at32f415_crm.c.

Referenced by main(), sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), and system_clock_config().

◆ crm_apb2_div_set()

void crm_apb2_div_set ( crm_apb2_div_type value )

set crm apb2 division

Parameters
value this parameter can be one of the following values:
  • CRM_APB2_DIV_1
  • CRM_APB2_DIV_2
  • CRM_APB2_DIV_4
  • CRM_APB2_DIV_8
  • CRM_APB2_DIV_16
Return values
none

Definition at line 439 of file at32f415_crm.c.

Referenced by sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), and system_clock_config().

◆ crm_auto_step_mode_enable()

void crm_auto_step_mode_enable ( confirm_state new_state )

auto step clock switch enable

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 834 of file at32f415_crm.c.

Referenced by sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), sysclk_config_deep_sleep(), system_clock_config(), and system_clock_recover().

◆ crm_battery_powered_domain_reset()

void crm_battery_powered_domain_reset ( confirm_state new_state )

battery powered domain software reset

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 496 of file at32f415_crm.c.

Referenced by ertc_config().

◆ crm_clkout_div_set()

void crm_clkout_div_set ( crm_clkout_div_type clkout_div )

set crm clkout division

Parameters
clkout_div this parameter can be one of the following values:
  • CRM_CLKOUT_DIV_1
  • CRM_CLKOUT_DIV_2
  • CRM_CLKOUT_DIV_4
  • CRM_CLKOUT_DIV_8
  • CRM_CLKOUT_DIV_16
  • CRM_CLKOUT_DIV_64
  • CRM_CLKOUT_DIV_128
  • CRM_CLKOUT_DIV_256
  • CRM_CLKOUT_DIV_512
Return values
none

Definition at line 901 of file at32f415_crm.c.

Referenced by clkout_config().

◆ crm_clock_failure_detection_enable()

void crm_clock_failure_detection_enable ( confirm_state new_state )

enable or disable clock failure detection

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 486 of file at32f415_crm.c.

Referenced by clock_failure_detection_handler(), and main().

◆ crm_clock_out_set()

void crm_clock_out_set ( crm_clkout_select_type clkout )

set crm clkout

Parameters
clkout this parameter can be one of the following values:
  • CRM_CLKOUT_NOCLK
  • CRM_CLKOUT_LICK
  • CRM_CLKOUT_LEXT
  • CRM_CLKOUT_SCLK
  • CRM_CLKOUT_HICK
  • CRM_CLKOUT_HEXT
  • CRM_CLKOUT_PLL_DIV_2
  • CRM_CLKOUT_PLL_DIV_4
  • CRM_CLKOUT_USB
  • CRM_CLKOUT_ADC
Return values
none

Definition at line 803 of file at32f415_crm.c.

Referenced by clkout_config().

◆ crm_clock_source_enable()

void crm_clock_source_enable | ( | crm_clock_source_type | source,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the crm clock source

Parameters
source this parameter can be one of the following values:
  • CRM_CLOCK_SOURCE_HICK
  • CRM_CLOCK_SOURCE_HEXT
  • CRM_CLOCK_SOURCE_PLL
  • CRM_CLOCK_SOURCE_LEXT
  • CRM_CLOCK_SOURCE_LICK
new_state (TRUE or FALSE)
Return values
none

Definition at line 289 of file at32f415_crm.c.

Referenced by ertc_config(), sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), sysclk_config_deep_sleep(), system_clock_config(), and system_clock_recover().

◆ crm_clocks_freq_get()

void crm_clocks_freq_get ( crm_clocks_freq_type * clocks_struct )

get crm clocks freqency

Parameters
clocks
  • pointer to the crm_clocks_freq structure
Return values
none

< value of the high speed internal clock in hz

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed exernal crystal in hz

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed exernal crystal in hz

< value of the high speed internal clock in hz

Definition at line 666 of file at32f415_crm.c.

Referenced by i2c_init(), i2s_init(), lick_frequency_get(), main(), tmr1_config(), tmr_init(), and usart_init().

◆ crm_ertc_clock_enable()

void crm_ertc_clock_enable ( confirm_state new_state )

enable or disable ertc

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 387 of file at32f415_crm.c.

Referenced by ertc_config().

◆ crm_ertc_clock_select()

void crm_ertc_clock_select ( crm_ertc_clock_type value )

select ertc clock

Parameters
value this parameter can be one of the following values:
  • CRM_ERTC_CLOCK_LEXT
  • CRM_ERTC_CLOCK_LICK
  • CRM_ERTC_CLOCK_HEXT_DIV
Return values
none

Definition at line 377 of file at32f415_crm.c.

Referenced by ertc_config().

◆ crm_flag_clear()

void crm_flag_clear ( uint32_t flag )

clear the crm reset flags

Parameters
flag this parameter can be one of the following values: reset flag:
  • CRM_NRST_RESET_FLAG
  • CRM_POR_RESET_FLAG
  • CRM_SW_RESET_FLAG
  • CRM_WDT_RESET_FLAG
  • CRM_WWDT_RESET_FLAG
  • CRM_LOWPOWER_RESET_FLAG interrupt flag:
  • CRM_LICK_READY_INT_FLAG
  • CRM_LEXT_READY_INT_FLAG
  • CRM_HICK_READY_INT_FLAG
  • CRM_HEXT_READY_INT_FLAG
  • CRM_PLL_READY_INT_FLAG
  • CRM_CLOCK_FAILURE_INT_FLAG
Return values
none

< nrst pin reset flag

< power on reset flag

< software reset flag

< watchdog timer reset flag

< window watchdog timer reset flag

< low-power reset flag

< low speed internal clock stable interrupt ready flag

< low speed external crystal stable interrupt ready flag

< high speed internal clock stable interrupt ready flag

< high speed external crystal stable interrupt ready flag

< phase locking loop stable interrupt ready flag

< clock failure interrupt ready flag

Definition at line 333 of file at32f415_crm.c.

Referenced by clock_failure_detection_handler(), and main().

◆ crm_flag_get()

flag_status crm_flag_get ( uint32_t flag )

get crm flag status

Parameters
flag this parameter can be one of the following values:
  • CRM_HICK_STABLE_FLAG
  • CRM_HEXT_STABLE_FLAG
  • CRM_PLL_STABLE_FLAG
  • CRM_LEXT_STABLE_FLAG
  • CRM_LICK_STABLE_FLAG
  • CRM_NRST_RESET_FLAG
  • CRM_POR_RESET_FLAG
  • CRM_SW_RESET_FLAG
  • CRM_WDT_RESET_FLAG
  • CRM_WWDT_RESET_FLAG
  • CRM_LOWPOWER_RESET_FLAG interrupt flag:
  • CRM_LICK_READY_INT_FLAG
  • CRM_LEXT_READY_INT_FLAG
  • CRM_HICK_READY_INT_FLAG
  • CRM_HEXT_READY_INT_FLAG
  • CRM_PLL_READY_INT_FLAG
  • CRM_CLOCK_FAILURE_INT_FLAG
Return values
flag_status (SET or RESET)

Definition at line 125 of file at32f415_crm.c.

Referenced by clock_failure_detection_handler(), crm_hext_stable_wait(), ertc_config(), main(), sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), sysclk_config_deep_sleep(), system_clock_config(), and system_clock_recover().

◆ crm_hext_bypass()

void crm_hext_bypass ( confirm_state new_state )

enable or disable crm high speed external crystal bypass

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 96 of file at32f415_crm.c.

◆ crm_hext_stable_wait()

error_status crm_hext_stable_wait ( void )

wait for hext stable

Parameters
none
Return values
error_status (ERROR or SUCCESS)

< high speed external crystal stable flag

< time out for hext start up

< high speed external crystal stable flag

Definition at line 144 of file at32f415_crm.c.

Referenced by sclk_96m_hext_config(), sysclk_config_deep_sleep(), system_clock_config(), and system_clock_recover().

◆ crm_hick_clock_calibration_set()

void crm_hick_clock_calibration_set ( uint8_t cali_value )

set the crm calibration value

Parameters
cali_value (0x00~0xFF)
Return values
none

Definition at line 181 of file at32f415_crm.c.

◆ crm_hick_clock_trimming_set()

void crm_hick_clock_trimming_set ( uint8_t trim_value )

set the hick trimming value

Parameters
trim_value (0x00~0x3F)
Return values
none

Definition at line 171 of file at32f415_crm.c.

◆ crm_hick_divider_select()

void crm_hick_divider_select ( crm_hick_div_6_type value )

config hick divider select

Parameters
value this parameter can be one of the following values:
  • CRM_HICK48_DIV6
  • CRM_HICK48_NODIV
Return values
none

Definition at line 850 of file at32f415_crm.c.

Referenced by crm_hick_sclk_frequency_select().

◆ crm_hick_sclk_frequency_select()

void crm_hick_sclk_frequency_select ( crm_hick_sclk_frequency_type value )

hick as system clock frequency select

Parameters
value this parameter can be one of the following values:
  • CRM_HICK_SCLK_8MHZ
  • CRM_HICK_SCLK_48MHZ
Return values
none

Definition at line 863 of file at32f415_crm.c.

Referenced by crm_usb_clock_source_select().

◆ crm_interrupt_enable()

void crm_interrupt_enable | ( | uint32_t | crm_int,
 |  | confirm_state | new_state
 | ) |  |

config crm interrupt

Parameters
int this parameter can be any combination of the following values:
  • CRM_LICK_STABLE_INT
  • CRM_LEXT_STABLE_INT
  • CRM_HICK_STABLE_INT
  • CRM_HEXT_STABLE_INT
  • CRM_PLL_STABLE_INT
new_state (TRUE or FALSE)
Return values
none

Definition at line 821 of file at32f415_crm.c.

◆ crm_lext_bypass()

void crm_lext_bypass ( confirm_state new_state )

enable or disable crm low speed external crystal bypass

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 86 of file at32f415_crm.c.

◆ crm_otgfs_ep3_remap_enable()

void crm_otgfs_ep3_remap_enable ( confirm_state new_state )

enable or disable otgfs end-point3 remap, only available in at32f415xx revision C. at32f415xx revision B: (not support) do not support configuration ep3 remap.

at32f415xx revision C: (support) support configuration ep3 remap.

Return values
none

Definition at line 915 of file at32f415_crm.c.

◆ crm_periph_clock_enable()

void crm_periph_clock_enable | ( | crm_periph_clock_type | value,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the peripheral clock

Parameters
value this parameter can be one of the following values:
  • CRM_DMA1_PERIPH_CLOCK - CRM_DMA2_PERIPH_CLOCK - CRM_CRC_PERIPH_CLOCK - CRM_SDIO1_PERIPH_CLOCK
  • CRM_OTGFS1_PERIPH_CLOCK - CRM_IOMUX_PERIPH_CLOCK - CRM_GPIOA_PERIPH_CLOCK - CRM_GPIOB_PERIPH_CLOCK
  • CRM_GPIOC_PERIPH_CLOCK - CRM_GPIOD_PERIPH_CLOCK - CRM_GPIOF_PERIPH_CLOCK - CRM_ADC1_PERIPH_CLOCK
  • CRM_TMR1_PERIPH_CLOCK - CRM_SPI1_PERIPH_CLOCK - CRM_USART1_PERIPH_CLOCK - CRM_TMR9_PERIPH_CLOCK
  • CRM_TMR10_PERIPH_CLOCK - CRM_TMR11_PERIPH_CLOCK - CRM_TMR2_PERIPH_CLOCK - CRM_TMR3_PERIPH_CLOCK
  • CRM_TMR4_PERIPH_CLOCK - CRM_TMR5_PERIPH_CLOCK - CRM_TMR9_PERIPH_CLOCK
  • CRM_TMR10_PERIPH_CLOCK - CRM_TMR11_PERIPH_CLOCK - CRM_CMP_PERIPH_CLOCK - CRM_WWDT_PERIPH_CLOCK
  • CRM_SPI2_PERIPH_CLOCK - CRM_USART2_PERIPH_CLOCK - CRM_USART3_PERIPH_CLOCK - CRM_UART4_PERIPH_CLOCK
  • CRM_UART5_PERIPH_CLOCK - CRM_I2C1_PERIPH_CLOCK - CRM_I2C2_PERIPH_CLOCK - CRM_CAN1_PERIPH_CLOCK
  • CRM_PWC_PERIPH_CLOCK
new_state (TRUE or FALSE)
Return values
none

Definition at line 210 of file at32f415_crm.c.

Referenced by adc_config(), app_load(), at32_button_init(), at32_led_init(), button_exint_init(), can_configuration(), can_gpio_config(), clkout_config(), cmp_config(), codec_i2s_init(), crc_cal(), crm_configuration(), dma_config(), dma_configuration(), ertc_config(), exint_config(), exint_line0_config(), exint_line4_config(), flash_crc_check(), gpio_config(), i2c_lowlevel_init(), i2s_config(), jump_to_app(), lick_frequency_get(), main(), mclk_tmr1_init(), sd_dma_config(), sd_init(), spi_config(), spiflash_init(), tmr1_config(), tmr1_init(), tmr2_config(), TMR3_GLOBAL_IRQHandler(), tmr_init(), uart_init(), uart_print_init(), usart1_config(), usart_configuration(), usart_spi_configuration(), and usb_gpio_config().

◆ crm_periph_reset()

void crm_periph_reset | ( | crm_periph_reset_type | value,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the peripheral reset

Parameters
value this parameter can be one of the following values:
  • CRM_IOMUX_PERIPH_RESET - CRM_EXINT_PERIPH_RESET - CRM_GPIOA_PERIPH_RESET - CRM_GPIOB_PERIPH_RESET
  • CRM_GPIOC_PERIPH_RESET - CRM_GPIOD_PERIPH_RESET - CRM_GPIOF_PERIPH_RESET - CRM_ADC1_PERIPH_RESET
  • CRM_TMR1_PERIPH_RESET - CRM_SPI1_PERIPH_RESET - CRM_USART1_PERIPH_RESET - CRM_TMR9_PERIPH_RESET
  • CRM_TMR10_PERIPH_RESET - CRM_TMR11_PERIPH_RESET - CRM_TMR2_PERIPH_RESET - CRM_TMR3_PERIPH_RESET
  • CRM_TMR4_PERIPH_RESET - CRM_TMR5_PERIPH_RESET - CRM_CMP_PERIPH_RESET - CRM_WWDT_PERIPH_RESET
  • CRM_SPI2_PERIPH_RESET - CRM_USART2_PERIPH_RESET - CRM_USART3_PERIPH_RESET - CRM_UART4_PERIPH_RESET
  • CRM_UART5_PERIPH_RESET - CRM_I2C1_PERIPH_RESET - CRM_I2C2_PERIPH_RESET - CRM_CAN1_PERIPH_RESET
  • CRM_PWC_PERIPH_RESET - CRM_OTGFS1_PERIPH_RESET
new_state (TRUE or FALSE)
Return values
none

Definition at line 239 of file at32f415_crm.c.

Referenced by adc_reset(), can_reset(), cmp_reset(), gpio_iomux_reset(), gpio_reset(), i2c_reset(), jump_to_app(), pwc_reset(), spi_i2s_reset(), tmr_reset(), usart_reset(), and wwdt_reset().

◆ crm_periph_sleep_mode_clock_enable()

void crm_periph_sleep_mode_clock_enable | ( | crm_periph_clock_sleepmd_type | value,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the peripheral clock in sleep mode

Parameters
value this parameter can be one of the following values:
  • CRM_SRAM_PERIPH_CLOCK_SLEEP_MODE
  • CRM_FLASH_PERIPH_CLOCK_SLEEP_MODE
new_state (TRUE or FALSE)
Return values
none

Definition at line 262 of file at32f415_crm.c.

◆ crm_pll_config()

void crm_pll_config | ( | crm_pll_clock_source_type | clock_source,
 |  | crm_pll_mult_type | mult_value
 | ) |  |

config crm pll

Parameters
clock_source this parameter can be one of the following values:
  • CRM_PLL_SOURCE_HICK
  • CRM_PLL_SOURCE_HEXT
  • CRM_PLL_SOURCE_HEXT_DIV
mult_value (CRM_PLL_MULT_2~64)
Return values
none

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed exernal crystal in hz

Definition at line 511 of file at32f415_crm.c.

Referenced by sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), and system_clock_config().

◆ crm_pll_config2()

void crm_pll_config2 | ( | crm_pll_clock_source_type | clock_source,
 |  | uint16_t | pll_ns,
 |  | uint16_t | pll_ms,
 |  | crm_pll_fr_type | pll_fr
 | ) |  |

config crm pll function2, another method. pll_rcs_freq * pll_ns pll clock = -----------------------------— pll_ms * pll_fr_n attemtion: 31 <= pll_ns <= 500 1 <= pll_ms <= 15

 pll_rcs_freq

2mhz <= -------------------— <= 16mhz pll_ms

pll_rcs_freq * pll_ns 500mhz <= -----------------------------— <= 1000mhz pll_ms

Parameters
clock_source this parameter can be one of the following values:
  • CRM_PLL_SOURCE_HICK
  • CRM_PLL_SOURCE_HEXT
  • CRM_PLL_SOURCE_HEXT_DIV
pll_ns | (31~500)
pll_ms | (1~15)
pll_fr this parameter can be one of the following values:
  • CRM_PLL_FR_1
  • CRM_PLL_FR_2
  • CRM_PLL_FR_4
  • CRM_PLL_FR_8
  • CRM_PLL_FR_16
  • CRM_PLL_FR_32
Return values
none

Definition at line 603 of file at32f415_crm.c.

Referenced by system_clock_config().

◆ crm_reset()

void crm_reset ( void )

reset the crm register

Parameters
none
Return values
none

Definition at line 49 of file at32f415_crm.c.

Referenced by app_update_handle(), sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), and system_clock_config().

◆ crm_sysclk_switch()

void crm_sysclk_switch ( crm_sclk_type value )

select system clock source

Parameters
value this parameter can be one of the following values:
  • CRM_SCLK_HICK
  • CRM_SCLK_HEXT
  • CRM_SCLK_PLL
Return values
none

Definition at line 641 of file at32f415_crm.c.

Referenced by sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), sysclk_config_deep_sleep(), system_clock_config(), and system_clock_recover().

◆ crm_sysclk_switch_status_get()

crm_sclk_type crm_sysclk_switch_status_get ( void )

indicate which clock source is used as system clock

Parameters
none
Return values
crm_sclk this return can be one of the following values:
  • CRM_SCLK_HICK
  • CRM_SCLK_HEXT
  • CRM_SCLK_PLL

Definition at line 655 of file at32f415_crm.c.

Referenced by crm_clocks_freq_get(), sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), sysclk_config_deep_sleep(), system_clock_config(), system_clock_recover(), and system_core_clock_update().

◆ crm_usb_clock_div_set()

void crm_usb_clock_div_set ( crm_usb_div_type div_value )

set crm usb division

Parameters
value this parameter can be one of the following values:
  • CRM_USB_DIV_1_5
  • CRM_USB_DIV_1
  • CRM_USB_DIV_2_5
  • CRM_USB_DIV_2
  • CRM_USB_DIV_3_5
  • CRM_USB_DIV_3
  • CRM_USB_DIV_4
Return values
none

Definition at line 475 of file at32f415_crm.c.

Referenced by usb_clock48m_select().

◆ crm_usb_clock_source_select()

void crm_usb_clock_source_select ( crm_usb_clock_source_type value )

usb 48 mhz clock source select

Parameters
value this parameter can be one of the following values:
  • CRM_USB_CLOCK_SOURCE_PLL
  • CRM_USB_CLOCK_SOURCE_HICK
Return values
none

Definition at line 877 of file at32f415_crm.c.

◆ crm_usbdiv_reset()

void crm_usbdiv_reset ( confirm_state new_state )

usb divider reset, only available in at32f415xx revision C. at32f415xx revision B: (not support) usb divider(CRM_CFG[usbdiv]) do not support to be reset.

at32f415xx revision C: (support) usb divider(CRM_CFG[usbdiv]) support to be reset.

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 930 of file at32f415_crm.c.


AT32F415 Firmwary Library: CRM_private_functions

Functions
CRM_private_functions
AT32F415_periph_driver » CRM

Functions

void | crm_reset (void)
reset the crm register More...
void | crm_lext_bypass (confirm_state new_state)
enable or disable crm low speed external crystal bypass More...
void | crm_hext_bypass (confirm_state new_state)
enable or disable crm high speed external crystal bypass More...
flag_status | crm_flag_get (uint32_t flag)
get crm flag status More...
error_status | crm_hext_stable_wait (void)
wait for hext stable More...
void | crm_hick_clock_trimming_set (uint8_t trim_value)
set the hick trimming value More...
void | crm_hick_clock_calibration_set (uint8_t cali_value)
set the crm calibration value More...
void | crm_periph_clock_enable (crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock More...
void | crm_periph_reset (crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset More...
void | crm_periph_sleep_mode_clock_enable (crm_periph_clock_sleepmd_type value, confirm_state new_state)
enable or disable the peripheral clock in sleep mode More...
void | crm_clock_source_enable (crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source More...
void | crm_flag_clear (uint32_t flag)
clear the crm reset flags More...
void | crm_ertc_clock_select (crm_ertc_clock_type value)
select ertc clock More...
void | crm_ertc_clock_enable (confirm_state new_state)
enable or disable ertc More...
void | crm_ahb_div_set (crm_ahb_div_type value)
set crm ahb division More...
void | crm_apb1_div_set (crm_apb1_div_type value)
set crm apb1 division More...
void | crm_apb2_div_set (crm_apb2_div_type value)
set crm apb2 division More...
void | crm_adc_clock_div_set (crm_adc_div_type div_value)
set crm adc division More...
void | crm_usb_clock_div_set (crm_usb_div_type div_value)
set crm usb division More...
void | crm_clock_failure_detection_enable (confirm_state new_state)
enable or disable clock failure detection More...
void | crm_battery_powered_domain_reset (confirm_state new_state)
battery powered domain software reset More...
void | crm_pll_config (crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll More...
void | crm_pll_config2 (crm_pll_clock_source_type clock_source, uint16_t pll_ns, uint16_t pll_ms, crm_pll_fr_type pll_fr)
config crm pll function2, another method. pll_rcs_freq * pll_ns pll clock = -----------------------------— pll_ms * pll_fr_n attemtion: 31 <= pll_ns <= 500 1 <= pll_ms <= 15 More...
void | crm_sysclk_switch (crm_sclk_type value)
select system clock source More...
crm_sclk_type | crm_sysclk_switch_status_get (void)
indicate which clock source is used as system clock More...
void | crm_clocks_freq_get (crm_clocks_freq_type *clocks_struct)
get crm clocks freqency More...
void | crm_clock_out_set (crm_clkout_select_type clkout)
set crm clkout More...
void | crm_interrupt_enable (uint32_t crm_int, confirm_state new_state)
config crm interrupt More...
void | crm_auto_step_mode_enable (confirm_state new_state)
auto step clock switch enable More...
void | crm_hick_divider_select (crm_hick_div_6_type value)
config hick divider select More...
void | crm_hick_sclk_frequency_select (crm_hick_sclk_frequency_type value)
hick as system clock frequency select More...
void | crm_usb_clock_source_select (crm_usb_clock_source_type value)
usb 48 mhz clock source select More...
void | crm_clkout_div_set (crm_clkout_div_type clkout_div)
set crm clkout division More...
void | crm_otgfs_ep3_remap_enable (confirm_state new_state)
enable or disable otgfs end-point3 remap, only available in at32f415xx revision C. at32f415xx revision B: (not support) do not support configuration ep3 remap. More...
void | crm_usbdiv_reset (confirm_state new_state)
usb divider reset, only available in at32f415xx revision C. at32f415xx revision B: (not support) usb divider(CRM_CFG[usbdiv]) do not support to be reset. More...

Detailed Description

Function Documentation

◆ crm_adc_clock_div_set()

void crm_adc_clock_div_set ( crm_adc_div_type div_value )

set crm adc division

Parameters
value this parameter can be one of the following values:
  • CRM_ADC_DIV_2
  • CRM_ADC_DIV_4
  • CRM_ADC_DIV_6
  • CRM_ADC_DIV_8
  • CRM_ADC_DIV_12
  • CRM_ADC_DIV_16
Return values
none

Definition at line 456 of file at32f415_crm.c.

Referenced by adc_config().

◆ crm_ahb_div_set()

void crm_ahb_div_set ( crm_ahb_div_type value )

set crm ahb division

Parameters
value this parameter can be one of the following values:
  • CRM_AHB_DIV_1
  • CRM_AHB_DIV_2
  • CRM_AHB_DIV_4
  • CRM_AHB_DIV_8
  • CRM_AHB_DIV_16
  • CRM_AHB_DIV_64
  • CRM_AHB_DIV_128
  • CRM_AHB_DIV_256
  • CRM_AHB_DIV_512
Return values
none

Definition at line 407 of file at32f415_crm.c.

Referenced by sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), and system_clock_config().

◆ crm_apb1_div_set()

void crm_apb1_div_set ( crm_apb1_div_type value )

set crm apb1 division

Parameters
value this parameter can be one of the following values:
  • CRM_APB1_DIV_1
  • CRM_APB1_DIV_2
  • CRM_APB1_DIV_4
  • CRM_APB1_DIV_8
  • CRM_APB1_DIV_16
Return values
none

Definition at line 423 of file at32f415_crm.c.

Referenced by main(), sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), and system_clock_config().

◆ crm_apb2_div_set()

void crm_apb2_div_set ( crm_apb2_div_type value )

set crm apb2 division

Parameters
value this parameter can be one of the following values:
  • CRM_APB2_DIV_1
  • CRM_APB2_DIV_2
  • CRM_APB2_DIV_4
  • CRM_APB2_DIV_8
  • CRM_APB2_DIV_16
Return values
none

Definition at line 439 of file at32f415_crm.c.

Referenced by sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), and system_clock_config().

◆ crm_auto_step_mode_enable()

void crm_auto_step_mode_enable ( confirm_state new_state )

auto step clock switch enable

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 834 of file at32f415_crm.c.

Referenced by sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), sysclk_config_deep_sleep(), system_clock_config(), and system_clock_recover().

◆ crm_battery_powered_domain_reset()

void crm_battery_powered_domain_reset ( confirm_state new_state )

battery powered domain software reset

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 496 of file at32f415_crm.c.

Referenced by ertc_config().

◆ crm_clkout_div_set()

void crm_clkout_div_set ( crm_clkout_div_type clkout_div )

set crm clkout division

Parameters
clkout_div this parameter can be one of the following values:
  • CRM_CLKOUT_DIV_1
  • CRM_CLKOUT_DIV_2
  • CRM_CLKOUT_DIV_4
  • CRM_CLKOUT_DIV_8
  • CRM_CLKOUT_DIV_16
  • CRM_CLKOUT_DIV_64
  • CRM_CLKOUT_DIV_128
  • CRM_CLKOUT_DIV_256
  • CRM_CLKOUT_DIV_512
Return values
none

Definition at line 901 of file at32f415_crm.c.

Referenced by clkout_config().

◆ crm_clock_failure_detection_enable()

void crm_clock_failure_detection_enable ( confirm_state new_state )

enable or disable clock failure detection

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 486 of file at32f415_crm.c.

Referenced by clock_failure_detection_handler(), and main().

◆ crm_clock_out_set()

void crm_clock_out_set ( crm_clkout_select_type clkout )

set crm clkout

Parameters
clkout this parameter can be one of the following values:
  • CRM_CLKOUT_NOCLK
  • CRM_CLKOUT_LICK
  • CRM_CLKOUT_LEXT
  • CRM_CLKOUT_SCLK
  • CRM_CLKOUT_HICK
  • CRM_CLKOUT_HEXT
  • CRM_CLKOUT_PLL_DIV_2
  • CRM_CLKOUT_PLL_DIV_4
  • CRM_CLKOUT_USB
  • CRM_CLKOUT_ADC
Return values
none

Definition at line 803 of file at32f415_crm.c.

Referenced by clkout_config().

◆ crm_clock_source_enable()

void crm_clock_source_enable | ( | crm_clock_source_type | source,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the crm clock source

Parameters
source this parameter can be one of the following values:
  • CRM_CLOCK_SOURCE_HICK
  • CRM_CLOCK_SOURCE_HEXT
  • CRM_CLOCK_SOURCE_PLL
  • CRM_CLOCK_SOURCE_LEXT
  • CRM_CLOCK_SOURCE_LICK
new_state (TRUE or FALSE)
Return values
none

Definition at line 289 of file at32f415_crm.c.

Referenced by ertc_config(), sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), sysclk_config_deep_sleep(), system_clock_config(), and system_clock_recover().

◆ crm_clocks_freq_get()

void crm_clocks_freq_get ( crm_clocks_freq_type * clocks_struct )

get crm clocks freqency

Parameters
clocks
  • pointer to the crm_clocks_freq structure
Return values
none

< value of the high speed internal clock in hz

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed exernal crystal in hz

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed exernal crystal in hz

< value of the high speed internal clock in hz

Definition at line 666 of file at32f415_crm.c.

Referenced by i2c_init(), i2s_init(), lick_frequency_get(), main(), tmr1_config(), tmr_init(), and usart_init().

◆ crm_ertc_clock_enable()

void crm_ertc_clock_enable ( confirm_state new_state )

enable or disable ertc

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 387 of file at32f415_crm.c.

Referenced by ertc_config().

◆ crm_ertc_clock_select()

void crm_ertc_clock_select ( crm_ertc_clock_type value )

select ertc clock

Parameters
value this parameter can be one of the following values:
  • CRM_ERTC_CLOCK_LEXT
  • CRM_ERTC_CLOCK_LICK
  • CRM_ERTC_CLOCK_HEXT_DIV
Return values
none

Definition at line 377 of file at32f415_crm.c.

Referenced by ertc_config().

◆ crm_flag_clear()

void crm_flag_clear ( uint32_t flag )

clear the crm reset flags

Parameters
flag this parameter can be one of the following values: reset flag:
  • CRM_NRST_RESET_FLAG
  • CRM_POR_RESET_FLAG
  • CRM_SW_RESET_FLAG
  • CRM_WDT_RESET_FLAG
  • CRM_WWDT_RESET_FLAG
  • CRM_LOWPOWER_RESET_FLAG interrupt flag:
  • CRM_LICK_READY_INT_FLAG
  • CRM_LEXT_READY_INT_FLAG
  • CRM_HICK_READY_INT_FLAG
  • CRM_HEXT_READY_INT_FLAG
  • CRM_PLL_READY_INT_FLAG
  • CRM_CLOCK_FAILURE_INT_FLAG
Return values
none

< nrst pin reset flag

< power on reset flag

< software reset flag

< watchdog timer reset flag

< window watchdog timer reset flag

< low-power reset flag

< low speed internal clock stable interrupt ready flag

< low speed external crystal stable interrupt ready flag

< high speed internal clock stable interrupt ready flag

< high speed external crystal stable interrupt ready flag

< phase locking loop stable interrupt ready flag

< clock failure interrupt ready flag

Definition at line 333 of file at32f415_crm.c.

Referenced by clock_failure_detection_handler(), and main().

◆ crm_flag_get()

flag_status crm_flag_get ( uint32_t flag )

get crm flag status

Parameters
flag this parameter can be one of the following values:
  • CRM_HICK_STABLE_FLAG
  • CRM_HEXT_STABLE_FLAG
  • CRM_PLL_STABLE_FLAG
  • CRM_LEXT_STABLE_FLAG
  • CRM_LICK_STABLE_FLAG
  • CRM_NRST_RESET_FLAG
  • CRM_POR_RESET_FLAG
  • CRM_SW_RESET_FLAG
  • CRM_WDT_RESET_FLAG
  • CRM_WWDT_RESET_FLAG
  • CRM_LOWPOWER_RESET_FLAG interrupt flag:
  • CRM_LICK_READY_INT_FLAG
  • CRM_LEXT_READY_INT_FLAG
  • CRM_HICK_READY_INT_FLAG
  • CRM_HEXT_READY_INT_FLAG
  • CRM_PLL_READY_INT_FLAG
  • CRM_CLOCK_FAILURE_INT_FLAG
Return values
flag_status (SET or RESET)

Definition at line 125 of file at32f415_crm.c.

Referenced by clock_failure_detection_handler(), crm_hext_stable_wait(), ertc_config(), main(), sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), sysclk_config_deep_sleep(), system_clock_config(), and system_clock_recover().

◆ crm_hext_bypass()

void crm_hext_bypass ( confirm_state new_state )

enable or disable crm high speed external crystal bypass

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 96 of file at32f415_crm.c.

◆ crm_hext_stable_wait()

error_status crm_hext_stable_wait ( void )

wait for hext stable

Parameters
none
Return values
error_status (ERROR or SUCCESS)

< high speed external crystal stable flag

< time out for hext start up

< high speed external crystal stable flag

Definition at line 144 of file at32f415_crm.c.

Referenced by sclk_96m_hext_config(), sysclk_config_deep_sleep(), system_clock_config(), and system_clock_recover().

◆ crm_hick_clock_calibration_set()

void crm_hick_clock_calibration_set ( uint8_t cali_value )

set the crm calibration value

Parameters
cali_value (0x00~0xFF)
Return values
none

Definition at line 181 of file at32f415_crm.c.

◆ crm_hick_clock_trimming_set()

void crm_hick_clock_trimming_set ( uint8_t trim_value )

set the hick trimming value

Parameters
trim_value (0x00~0x3F)
Return values
none

Definition at line 171 of file at32f415_crm.c.

◆ crm_hick_divider_select()

void crm_hick_divider_select ( crm_hick_div_6_type value )

config hick divider select

Parameters
value this parameter can be one of the following values:
  • CRM_HICK48_DIV6
  • CRM_HICK48_NODIV
Return values
none

Definition at line 850 of file at32f415_crm.c.

Referenced by crm_hick_sclk_frequency_select().

◆ crm_hick_sclk_frequency_select()

void crm_hick_sclk_frequency_select ( crm_hick_sclk_frequency_type value )

hick as system clock frequency select

Parameters
value this parameter can be one of the following values:
  • CRM_HICK_SCLK_8MHZ
  • CRM_HICK_SCLK_48MHZ
Return values
none

Definition at line 863 of file at32f415_crm.c.

Referenced by crm_usb_clock_source_select().

◆ crm_interrupt_enable()

void crm_interrupt_enable | ( | uint32_t | crm_int,
 |  | confirm_state | new_state
 | ) |  |

config crm interrupt

Parameters
int this parameter can be any combination of the following values:
  • CRM_LICK_STABLE_INT
  • CRM_LEXT_STABLE_INT
  • CRM_HICK_STABLE_INT
  • CRM_HEXT_STABLE_INT
  • CRM_PLL_STABLE_INT
new_state (TRUE or FALSE)
Return values
none

Definition at line 821 of file at32f415_crm.c.

◆ crm_lext_bypass()

void crm_lext_bypass ( confirm_state new_state )

enable or disable crm low speed external crystal bypass

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 86 of file at32f415_crm.c.

◆ crm_otgfs_ep3_remap_enable()

void crm_otgfs_ep3_remap_enable ( confirm_state new_state )

enable or disable otgfs end-point3 remap, only available in at32f415xx revision C. at32f415xx revision B: (not support) do not support configuration ep3 remap.

at32f415xx revision C: (support) support configuration ep3 remap.

Return values
none

Definition at line 915 of file at32f415_crm.c.

◆ crm_periph_clock_enable()

void crm_periph_clock_enable | ( | crm_periph_clock_type | value,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the peripheral clock

Parameters
value this parameter can be one of the following values:
  • CRM_DMA1_PERIPH_CLOCK - CRM_DMA2_PERIPH_CLOCK - CRM_CRC_PERIPH_CLOCK - CRM_SDIO1_PERIPH_CLOCK
  • CRM_OTGFS1_PERIPH_CLOCK - CRM_IOMUX_PERIPH_CLOCK - CRM_GPIOA_PERIPH_CLOCK - CRM_GPIOB_PERIPH_CLOCK
  • CRM_GPIOC_PERIPH_CLOCK - CRM_GPIOD_PERIPH_CLOCK - CRM_GPIOF_PERIPH_CLOCK - CRM_ADC1_PERIPH_CLOCK
  • CRM_TMR1_PERIPH_CLOCK - CRM_SPI1_PERIPH_CLOCK - CRM_USART1_PERIPH_CLOCK - CRM_TMR9_PERIPH_CLOCK
  • CRM_TMR10_PERIPH_CLOCK - CRM_TMR11_PERIPH_CLOCK - CRM_TMR2_PERIPH_CLOCK - CRM_TMR3_PERIPH_CLOCK
  • CRM_TMR4_PERIPH_CLOCK - CRM_TMR5_PERIPH_CLOCK - CRM_TMR9_PERIPH_CLOCK
  • CRM_TMR10_PERIPH_CLOCK - CRM_TMR11_PERIPH_CLOCK - CRM_CMP_PERIPH_CLOCK - CRM_WWDT_PERIPH_CLOCK
  • CRM_SPI2_PERIPH_CLOCK - CRM_USART2_PERIPH_CLOCK - CRM_USART3_PERIPH_CLOCK - CRM_UART4_PERIPH_CLOCK
  • CRM_UART5_PERIPH_CLOCK - CRM_I2C1_PERIPH_CLOCK - CRM_I2C2_PERIPH_CLOCK - CRM_CAN1_PERIPH_CLOCK
  • CRM_PWC_PERIPH_CLOCK
new_state (TRUE or FALSE)
Return values
none

Definition at line 210 of file at32f415_crm.c.

Referenced by adc_config(), app_load(), at32_button_init(), at32_led_init(), button_exint_init(), can_configuration(), can_gpio_config(), clkout_config(), cmp_config(), codec_i2s_init(), crc_cal(), crm_configuration(), dma_config(), dma_configuration(), ertc_config(), exint_config(), exint_line0_config(), exint_line4_config(), flash_crc_check(), gpio_config(), i2c_lowlevel_init(), i2s_config(), jump_to_app(), lick_frequency_get(), main(), mclk_tmr1_init(), sd_dma_config(), sd_init(), spi_config(), spiflash_init(), tmr1_config(), tmr1_init(), tmr2_config(), TMR3_GLOBAL_IRQHandler(), tmr_init(), uart_init(), uart_print_init(), usart1_config(), usart_configuration(), usart_spi_configuration(), and usb_gpio_config().

◆ crm_periph_reset()

void crm_periph_reset | ( | crm_periph_reset_type | value,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the peripheral reset

Parameters
value this parameter can be one of the following values:
  • CRM_IOMUX_PERIPH_RESET - CRM_EXINT_PERIPH_RESET - CRM_GPIOA_PERIPH_RESET - CRM_GPIOB_PERIPH_RESET
  • CRM_GPIOC_PERIPH_RESET - CRM_GPIOD_PERIPH_RESET - CRM_GPIOF_PERIPH_RESET - CRM_ADC1_PERIPH_RESET
  • CRM_TMR1_PERIPH_RESET - CRM_SPI1_PERIPH_RESET - CRM_USART1_PERIPH_RESET - CRM_TMR9_PERIPH_RESET
  • CRM_TMR10_PERIPH_RESET - CRM_TMR11_PERIPH_RESET - CRM_TMR2_PERIPH_RESET - CRM_TMR3_PERIPH_RESET
  • CRM_TMR4_PERIPH_RESET - CRM_TMR5_PERIPH_RESET - CRM_CMP_PERIPH_RESET - CRM_WWDT_PERIPH_RESET
  • CRM_SPI2_PERIPH_RESET - CRM_USART2_PERIPH_RESET - CRM_USART3_PERIPH_RESET - CRM_UART4_PERIPH_RESET
  • CRM_UART5_PERIPH_RESET - CRM_I2C1_PERIPH_RESET - CRM_I2C2_PERIPH_RESET - CRM_CAN1_PERIPH_RESET
  • CRM_PWC_PERIPH_RESET - CRM_OTGFS1_PERIPH_RESET
new_state (TRUE or FALSE)
Return values
none

Definition at line 239 of file at32f415_crm.c.

Referenced by adc_reset(), can_reset(), cmp_reset(), gpio_iomux_reset(), gpio_reset(), i2c_reset(), jump_to_app(), pwc_reset(), spi_i2s_reset(), tmr_reset(), usart_reset(), and wwdt_reset().

◆ crm_periph_sleep_mode_clock_enable()

void crm_periph_sleep_mode_clock_enable | ( | crm_periph_clock_sleepmd_type | value,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the peripheral clock in sleep mode

Parameters
value this parameter can be one of the following values:
  • CRM_SRAM_PERIPH_CLOCK_SLEEP_MODE
  • CRM_FLASH_PERIPH_CLOCK_SLEEP_MODE
new_state (TRUE or FALSE)
Return values
none

Definition at line 262 of file at32f415_crm.c.

◆ crm_pll_config()

void crm_pll_config | ( | crm_pll_clock_source_type | clock_source,
 |  | crm_pll_mult_type | mult_value
 | ) |  |

config crm pll

Parameters
clock_source this parameter can be one of the following values:
  • CRM_PLL_SOURCE_HICK
  • CRM_PLL_SOURCE_HEXT
  • CRM_PLL_SOURCE_HEXT_DIV
mult_value (CRM_PLL_MULT_2~64)
Return values
none

< value of the high speed internal clock in hz

< value of the high speed exernal crystal in hz

< value of the high speed exernal crystal in hz

Definition at line 511 of file at32f415_crm.c.

Referenced by sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), and system_clock_config().

◆ crm_pll_config2()

void crm_pll_config2 | ( | crm_pll_clock_source_type | clock_source,
 |  | uint16_t | pll_ns,
 |  | uint16_t | pll_ms,
 |  | crm_pll_fr_type | pll_fr
 | ) |  |

config crm pll function2, another method. pll_rcs_freq * pll_ns pll clock = -----------------------------— pll_ms * pll_fr_n attemtion: 31 <= pll_ns <= 500 1 <= pll_ms <= 15

 pll_rcs_freq

2mhz <= -------------------— <= 16mhz pll_ms

pll_rcs_freq * pll_ns 500mhz <= -----------------------------— <= 1000mhz pll_ms

Parameters
clock_source this parameter can be one of the following values:
  • CRM_PLL_SOURCE_HICK
  • CRM_PLL_SOURCE_HEXT
  • CRM_PLL_SOURCE_HEXT_DIV
pll_ns | (31~500)
pll_ms | (1~15)
pll_fr this parameter can be one of the following values:
  • CRM_PLL_FR_1
  • CRM_PLL_FR_2
  • CRM_PLL_FR_4
  • CRM_PLL_FR_8
  • CRM_PLL_FR_16
  • CRM_PLL_FR_32
Return values
none

Definition at line 603 of file at32f415_crm.c.

Referenced by system_clock_config().

◆ crm_reset()

void crm_reset ( void )

reset the crm register

Parameters
none
Return values
none

Definition at line 49 of file at32f415_crm.c.

Referenced by app_update_handle(), sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), and system_clock_config().

◆ crm_sysclk_switch()

void crm_sysclk_switch ( crm_sclk_type value )

select system clock source

Parameters
value this parameter can be one of the following values:
  • CRM_SCLK_HICK
  • CRM_SCLK_HEXT
  • CRM_SCLK_PLL
Return values
none

Definition at line 641 of file at32f415_crm.c.

Referenced by sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), sysclk_config_deep_sleep(), system_clock_config(), and system_clock_recover().

◆ crm_sysclk_switch_status_get()

crm_sclk_type crm_sysclk_switch_status_get ( void )

indicate which clock source is used as system clock

Parameters
none
Return values
crm_sclk this return can be one of the following values:
  • CRM_SCLK_HICK
  • CRM_SCLK_HEXT
  • CRM_SCLK_PLL

Definition at line 655 of file at32f415_crm.c.

Referenced by crm_clocks_freq_get(), sclk_144m_hick_config(), sclk_64m_hick_config(), sclk_96m_hext_config(), sysclk_config_deep_sleep(), system_clock_config(), system_clock_recover(), and system_core_clock_update().

◆ crm_usb_clock_div_set()

void crm_usb_clock_div_set ( crm_usb_div_type div_value )

set crm usb division

Parameters
value this parameter can be one of the following values:
  • CRM_USB_DIV_1_5
  • CRM_USB_DIV_1
  • CRM_USB_DIV_2_5
  • CRM_USB_DIV_2
  • CRM_USB_DIV_3_5
  • CRM_USB_DIV_3
  • CRM_USB_DIV_4
Return values
none

Definition at line 475 of file at32f415_crm.c.

Referenced by usb_clock48m_select().

◆ crm_usb_clock_source_select()

void crm_usb_clock_source_select ( crm_usb_clock_source_type value )

usb 48 mhz clock source select

Parameters
value this parameter can be one of the following values:
  • CRM_USB_CLOCK_SOURCE_PLL
  • CRM_USB_CLOCK_SOURCE_HICK
Return values
none

Definition at line 877 of file at32f415_crm.c.

◆ crm_usbdiv_reset()

void crm_usbdiv_reset ( confirm_state new_state )

usb divider reset, only available in at32f415xx revision C. at32f415xx revision B: (not support) usb divider(CRM_CFG[usbdiv]) do not support to be reset.

at32f415xx revision C: (support) usb divider(CRM_CFG[usbdiv]) support to be reset.

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 930 of file at32f415_crm.c.


AT32F415 Firmwary Library: DEBUG

Modules | Macros
DEBUG
AT32F415_periph_driver

DEBUG driver modules. More...

Modules

DEBUG_mode_definition
DEBUG_exported_types
DEBUG_exported_functions
DEBUG_private_functions

Macros

#define DEBUGMCU ((debug_type *) DEBUG_BASE)

Detailed Description

DEBUG driver modules.

Macro Definition Documentation

◆ DEBUGMCU

#define DEBUGMCU ((debug_type *) DEBUG_BASE)

Definition at line 136 of file at32f415_debug.h.


AT32F415 Firmwary Library: DEBUG_mode_definition

Macros
DEBUG_mode_definition
AT32F415_periph_driver » DEBUG

Macros

#define | DEBUG_SLEEP ((uint32_t)0x00000001)
#define | DEBUG_STOP ((uint32_t)0x00000002)
#define | DEBUG_STANDBY ((uint32_t)0x00000004)
#define | DEBUG_WDT_PAUSE ((uint32_t)0x00000100)
#define | DEBUG_WWDT_PAUSE ((uint32_t)0x00000200)
#define | DEBUG_TMR1_PAUSE ((uint32_t)0x00000400)
#define | DEBUG_TMR3_PAUSE ((uint32_t)0x00001000)
#define | DEBUG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00008000)
#define | DEBUG_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00010000)
#define | DEBUG_TMR2_PAUSE ((uint32_t)0x00000800)
#define | DEBUG_TMR4_PAUSE ((uint32_t)0x00002000)
#define | DEBUG_CAN1_PAUSE ((uint32_t)0x00004000)
#define | DEBUG_TMR5_PAUSE ((uint32_t)0x00040000)
#define | DEBUG_TMR9_PAUSE ((uint32_t)0x10000000)
#define | DEBUG_TMR10_PAUSE ((uint32_t)0x20000000)
#define | DEBUG_TMR11_PAUSE ((uint32_t)0x40000000)

Detailed Description

Macro Definition Documentation

◆ DEBUG_CAN1_PAUSE

#define DEBUG_CAN1_PAUSE ((uint32_t)0x00004000)

debug can1 pause

Definition at line 61 of file at32f415_debug.h.

◆ DEBUG_I2C1_SMBUS_TIMEOUT

#define DEBUG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00008000)

debug i2c1 smbus timeout

Definition at line 57 of file at32f415_debug.h.

◆ DEBUG_I2C2_SMBUS_TIMEOUT

#define DEBUG_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00010000)

debug i2c2 smbus timeout

Definition at line 58 of file at32f415_debug.h.

◆ DEBUG_SLEEP

#define DEBUG_SLEEP ((uint32_t)0x00000001)

debug sleep mode

Definition at line 50 of file at32f415_debug.h.

◆ DEBUG_STANDBY

#define DEBUG_STANDBY ((uint32_t)0x00000004)

debug standby mode

Definition at line 52 of file at32f415_debug.h.

◆ DEBUG_STOP

#define DEBUG_STOP ((uint32_t)0x00000002)

debug deepsleep mode

Definition at line 51 of file at32f415_debug.h.

◆ DEBUG_TMR10_PAUSE

#define DEBUG_TMR10_PAUSE ((uint32_t)0x20000000)

debug timer10 pause

Definition at line 64 of file at32f415_debug.h.

◆ DEBUG_TMR11_PAUSE

#define DEBUG_TMR11_PAUSE ((uint32_t)0x40000000)

debug timer11 pause

Definition at line 65 of file at32f415_debug.h.

◆ DEBUG_TMR1_PAUSE

#define DEBUG_TMR1_PAUSE ((uint32_t)0x00000400)

debug timer1 pause

Definition at line 55 of file at32f415_debug.h.

◆ DEBUG_TMR2_PAUSE

#define DEBUG_TMR2_PAUSE ((uint32_t)0x00000800)

debug timer2 pause

Definition at line 59 of file at32f415_debug.h.

◆ DEBUG_TMR3_PAUSE

#define DEBUG_TMR3_PAUSE ((uint32_t)0x00001000)

debug timer3 pause

Definition at line 56 of file at32f415_debug.h.

◆ DEBUG_TMR4_PAUSE

#define DEBUG_TMR4_PAUSE ((uint32_t)0x00002000)

debug timer4 pause

Definition at line 60 of file at32f415_debug.h.

◆ DEBUG_TMR5_PAUSE

#define DEBUG_TMR5_PAUSE ((uint32_t)0x00040000)

debug timer5 pause

Definition at line 62 of file at32f415_debug.h.

◆ DEBUG_TMR9_PAUSE

#define DEBUG_TMR9_PAUSE ((uint32_t)0x10000000)

debug timer9 pause

Definition at line 63 of file at32f415_debug.h.

◆ DEBUG_WDT_PAUSE

#define DEBUG_WDT_PAUSE ((uint32_t)0x00000100)

debug watchdog timer pause

Definition at line 53 of file at32f415_debug.h.

◆ DEBUG_WWDT_PAUSE

#define DEBUG_WWDT_PAUSE ((uint32_t)0x00000200)

debug window watchdog timer pause

Definition at line 54 of file at32f415_debug.h.


AT32F415 Firmwary Library: DEBUG_exported_types

Data Structures
DEBUG_exported_types
AT32F415_periph_driver » DEBUG

Data Structures

struct debug_type
type define debug register all More...

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: debug_type Struct Reference

Data Fields
debug_type Struct Reference
AT32F415_periph_driver » DEBUG » DEBUG_exported_types

type define debug register all More...

#include <at32f415_debug.h>

Data Fields

union {
__IO uint32_t pid
struct {
__IO uint32_t pid: 32
} idcode_bit
};
debug idcode register, offset:0x00 More...
union {
__IO uint32_t ctrl
struct {
__IO uint32_t sleep_debug: 1
__IO uint32_t deepsleep_debug: 1
__IO uint32_t standby_debug: 1
__IO uint32_t reserved1: 2
__IO uint32_t trace_ioen: 1
__IO uint32_t trace_mode: 2
__IO uint32_t wdt_pause: 1
__IO uint32_t wwdt_pause: 1
__IO uint32_t tmr1_pause: 1
__IO uint32_t tmr2_pause: 1
__IO uint32_t tmr3_pause: 1
__IO uint32_t tmr4_pause: 1
__IO uint32_t can1_pause: 1
__IO uint32_t i2c1_smbus_timeout: 1
__IO uint32_t i2c2_smbus_timeout: 1
__IO uint32_t tim8_pause: 1
__IO uint32_t tim5_pause: 1
__IO uint32_t tim6_pause: 1
__IO uint32_t tim7_pause: 1
__IO uint32_t can2_pause: 1
__IO uint32_t reserved2: 3
__IO uint32_t tim12_pause: 1
__IO uint32_t tim13_pause: 1
__IO uint32_t tim14_pause: 1
__IO uint32_t tim9_pause: 1
__IO uint32_t tim10_pause: 1
__IO uint32_t tim11_pause: 1
__IO uint32_t i2c3_smbus_timeout: 1
} ctrl_bit
};
debug ctrl register, offset:0x04 More...

Detailed Description

type define debug register all

Definition at line 77 of file at32f415_debug.h.

Field Documentation

◆

union { ... } debug_type::@187

debug idcode register, offset:0x00

◆

union { ... } debug_type::@189

debug ctrl register, offset:0x04

◆ can1_pause

__IO uint32_t debug_type::can1_pause

Definition at line 111 of file at32f415_debug.h.

◆ can2_pause

__IO uint32_t debug_type::can2_pause

Definition at line 118 of file at32f415_debug.h.

◆ ctrl

__IO uint32_t debug_type::ctrl

Definition at line 96 of file at32f415_debug.h.

◆

struct { ... } debug_type::ctrl_bit

◆ deepsleep_debug

__IO uint32_t debug_type::deepsleep_debug

Definition at line 100 of file at32f415_debug.h.

◆ i2c1_smbus_timeout

__IO uint32_t debug_type::i2c1_smbus_timeout

Definition at line 112 of file at32f415_debug.h.

◆ i2c2_smbus_timeout

__IO uint32_t debug_type::i2c2_smbus_timeout

Definition at line 113 of file at32f415_debug.h.

◆ i2c3_smbus_timeout

__IO uint32_t debug_type::i2c3_smbus_timeout

Definition at line 126 of file at32f415_debug.h.

◆

struct { ... } debug_type::idcode_bit

◆ pid

__IO uint32_t debug_type::pid

Definition at line 84 of file at32f415_debug.h.

◆ reserved1

__IO uint32_t debug_type::reserved1

Definition at line 102 of file at32f415_debug.h.

◆ reserved2

__IO uint32_t debug_type::reserved2

Definition at line 119 of file at32f415_debug.h.

◆ sleep_debug

__IO uint32_t debug_type::sleep_debug

Definition at line 99 of file at32f415_debug.h.

◆ standby_debug

__IO uint32_t debug_type::standby_debug

Definition at line 101 of file at32f415_debug.h.

◆ tim10_pause

__IO uint32_t debug_type::tim10_pause

Definition at line 124 of file at32f415_debug.h.

◆ tim11_pause

__IO uint32_t debug_type::tim11_pause

Definition at line 125 of file at32f415_debug.h.

◆ tim12_pause

__IO uint32_t debug_type::tim12_pause

Definition at line 120 of file at32f415_debug.h.

◆ tim13_pause

__IO uint32_t debug_type::tim13_pause

Definition at line 121 of file at32f415_debug.h.

◆ tim14_pause

__IO uint32_t debug_type::tim14_pause

Definition at line 122 of file at32f415_debug.h.

◆ tim5_pause

__IO uint32_t debug_type::tim5_pause

Definition at line 115 of file at32f415_debug.h.

◆ tim6_pause

__IO uint32_t debug_type::tim6_pause

Definition at line 116 of file at32f415_debug.h.

◆ tim7_pause

__IO uint32_t debug_type::tim7_pause

Definition at line 117 of file at32f415_debug.h.

◆ tim8_pause

__IO uint32_t debug_type::tim8_pause

Definition at line 114 of file at32f415_debug.h.

◆ tim9_pause

__IO uint32_t debug_type::tim9_pause

Definition at line 123 of file at32f415_debug.h.

◆ tmr1_pause

__IO uint32_t debug_type::tmr1_pause

Definition at line 107 of file at32f415_debug.h.

◆ tmr2_pause

__IO uint32_t debug_type::tmr2_pause

Definition at line 108 of file at32f415_debug.h.

◆ tmr3_pause

__IO uint32_t debug_type::tmr3_pause

Definition at line 109 of file at32f415_debug.h.

◆ tmr4_pause

__IO uint32_t debug_type::tmr4_pause

Definition at line 110 of file at32f415_debug.h.

◆ trace_ioen

__IO uint32_t debug_type::trace_ioen

Definition at line 103 of file at32f415_debug.h.

◆ trace_mode

__IO uint32_t debug_type::trace_mode

Definition at line 104 of file at32f415_debug.h.

◆ wdt_pause

__IO uint32_t debug_type::wdt_pause

Definition at line 105 of file at32f415_debug.h.

◆ wwdt_pause

__IO uint32_t debug_type::wwdt_pause

Definition at line 106 of file at32f415_debug.h.

The documentation for this struct was generated from the following file:
  • at32f415_debug.h


AT32F415 Firmwary Library: DEBUG_exported_functions

Functions
DEBUG_exported_functions
AT32F415_periph_driver » DEBUG

Functions

uint32_t | debug_device_id_get (void)
get debug device id More...
void | debug_periph_mode_set (uint32_t periph_debug_mode, confirm_state new_state)
set periph debug mode
More...

Detailed Description

Function Documentation

◆ debug_device_id_get()

uint32_t debug_device_id_get ( void )

get debug device id

Parameters
none
Return values
the debug device id

Definition at line 49 of file at32f415_debug.c.

◆ debug_periph_mode_set()

void debug_periph_mode_set | ( | uint32_t | periph_debug_mode,
 |  | confirm_state | new_state
 | ) |  |

set periph debug mode

Parameters
periph_debug_mode this parameter can be any combination of the following values:
  • DEBUG_SLEEP
  • DEBUG_STOP
  • DEBUG_STANDBY
  • DEBUG_WDT_PAUSE
  • DEBUG_WWDT_PAUSE
  • DEBUG_TMR1_PAUSE
  • DEBUG_TMR3_PAUSE
  • DEBUG_I2C1_SMBUS_TIMEOUT
  • DEBUG_I2C2_SMBUS_TIMEOUT
  • DEBUG_TMR2_PAUSE
  • DEBUG_TMR4_PAUSE
  • DEBUG_CAN1_PAUSE
  • DEBUG_TMR5_PAUSE
  • DEBUG_TMR9_PAUSE
  • DEBUG_TMR10_PAUSE
  • DEBUG_TMR11_PAUSE
new_state (TRUE or FALSE)
Return values
none

Definition at line 76 of file at32f415_debug.c.

Referenced by main().


AT32F415 Firmwary Library: DEBUG_private_functions

Functions
DEBUG_private_functions
AT32F415_periph_driver » DEBUG

Functions

uint32_t | debug_device_id_get (void)
get debug device id More...
void | debug_periph_mode_set (uint32_t periph_debug_mode, confirm_state new_state)
set periph debug mode
More...

Detailed Description

Function Documentation

◆ debug_device_id_get()

uint32_t debug_device_id_get ( void )

get debug device id

Parameters
none
Return values
the debug device id

Definition at line 49 of file at32f415_debug.c.

◆ debug_periph_mode_set()

void debug_periph_mode_set | ( | uint32_t | periph_debug_mode,
 |  | confirm_state | new_state
 | ) |  |

set periph debug mode

Parameters
periph_debug_mode this parameter can be any combination of the following values:
  • DEBUG_SLEEP
  • DEBUG_STOP
  • DEBUG_STANDBY
  • DEBUG_WDT_PAUSE
  • DEBUG_WWDT_PAUSE
  • DEBUG_TMR1_PAUSE
  • DEBUG_TMR3_PAUSE
  • DEBUG_I2C1_SMBUS_TIMEOUT
  • DEBUG_I2C2_SMBUS_TIMEOUT
  • DEBUG_TMR2_PAUSE
  • DEBUG_TMR4_PAUSE
  • DEBUG_CAN1_PAUSE
  • DEBUG_TMR5_PAUSE
  • DEBUG_TMR9_PAUSE
  • DEBUG_TMR10_PAUSE
  • DEBUG_TMR11_PAUSE
new_state (TRUE or FALSE)
Return values
none

Definition at line 76 of file at32f415_debug.c.

Referenced by main().


AT32F415 Firmwary Library: DMA

Modules | Macros
DMA
AT32F415_periph_driver

DMA driver modules. More...

Modules

DMA_interrupts_definition
dma interrupt
DMA_flexible_channel
DMA_flags_definition
dma flag
DMA_exported_types
DMA_exported_functions
DMA_private_functions

Macros

#define | DMA1 ((dma_type *) DMA1_BASE)
#define | DMA1_CHANNEL1 ((dma_channel_type *) DMA1_CHANNEL1_BASE)
#define | DMA1_CHANNEL2 ((dma_channel_type *) DMA1_CHANNEL2_BASE)
#define | DMA1_CHANNEL3 ((dma_channel_type *) DMA1_CHANNEL3_BASE)
#define | DMA1_CHANNEL4 ((dma_channel_type *) DMA1_CHANNEL4_BASE)
#define | DMA1_CHANNEL5 ((dma_channel_type *) DMA1_CHANNEL5_BASE)
#define | DMA1_CHANNEL6 ((dma_channel_type *) DMA1_CHANNEL6_BASE)
#define | DMA1_CHANNEL7 ((dma_channel_type *) DMA1_CHANNEL7_BASE)
#define | DMA2 ((dma_type *) DMA2_BASE)
#define | DMA2_CHANNEL1 ((dma_channel_type *) DMA2_CHANNEL1_BASE)
#define | DMA2_CHANNEL2 ((dma_channel_type *) DMA2_CHANNEL2_BASE)
#define | DMA2_CHANNEL3 ((dma_channel_type *) DMA2_CHANNEL3_BASE)
#define | DMA2_CHANNEL4 ((dma_channel_type *) DMA2_CHANNEL4_BASE)
#define | DMA2_CHANNEL5 ((dma_channel_type *) DMA2_CHANNEL5_BASE)
#define | DMA2_CHANNEL6 ((dma_channel_type *) DMA2_CHANNEL6_BASE)
#define | DMA2_CHANNEL7 ((dma_channel_type *) DMA2_CHANNEL7_BASE)

Detailed Description

DMA driver modules.

Macro Definition Documentation

◆ DMA1

#define DMA1 ((dma_type *) DMA1_BASE)

Definition at line 472 of file at32f415_dma.h.

◆ DMA1_CHANNEL1

#define DMA1_CHANNEL1 ((dma_channel_type *) DMA1_CHANNEL1_BASE)

Definition at line 473 of file at32f415_dma.h.

◆ DMA1_CHANNEL2

#define DMA1_CHANNEL2 ((dma_channel_type *) DMA1_CHANNEL2_BASE)

Definition at line 474 of file at32f415_dma.h.

◆ DMA1_CHANNEL3

#define DMA1_CHANNEL3 ((dma_channel_type *) DMA1_CHANNEL3_BASE)

Definition at line 475 of file at32f415_dma.h.

◆ DMA1_CHANNEL4

#define DMA1_CHANNEL4 ((dma_channel_type *) DMA1_CHANNEL4_BASE)

Definition at line 476 of file at32f415_dma.h.

◆ DMA1_CHANNEL5

#define DMA1_CHANNEL5 ((dma_channel_type *) DMA1_CHANNEL5_BASE)

Definition at line 477 of file at32f415_dma.h.

◆ DMA1_CHANNEL6

#define DMA1_CHANNEL6 ((dma_channel_type *) DMA1_CHANNEL6_BASE)

Definition at line 478 of file at32f415_dma.h.

◆ DMA1_CHANNEL7

#define DMA1_CHANNEL7 ((dma_channel_type *) DMA1_CHANNEL7_BASE)

Definition at line 479 of file at32f415_dma.h.

◆ DMA2

#define DMA2 ((dma_type *) DMA2_BASE)

Definition at line 481 of file at32f415_dma.h.

◆ DMA2_CHANNEL1

#define DMA2_CHANNEL1 ((dma_channel_type *) DMA2_CHANNEL1_BASE)

Definition at line 482 of file at32f415_dma.h.

◆ DMA2_CHANNEL2

#define DMA2_CHANNEL2 ((dma_channel_type *) DMA2_CHANNEL2_BASE)

Definition at line 483 of file at32f415_dma.h.

◆ DMA2_CHANNEL3

#define DMA2_CHANNEL3 ((dma_channel_type *) DMA2_CHANNEL3_BASE)

Definition at line 484 of file at32f415_dma.h.

◆ DMA2_CHANNEL4

#define DMA2_CHANNEL4 ((dma_channel_type *) DMA2_CHANNEL4_BASE)

Definition at line 485 of file at32f415_dma.h.

◆ DMA2_CHANNEL5

#define DMA2_CHANNEL5 ((dma_channel_type *) DMA2_CHANNEL5_BASE)

Definition at line 486 of file at32f415_dma.h.

◆ DMA2_CHANNEL6

#define DMA2_CHANNEL6 ((dma_channel_type *) DMA2_CHANNEL6_BASE)

Definition at line 487 of file at32f415_dma.h.

◆ DMA2_CHANNEL7

#define DMA2_CHANNEL7 ((dma_channel_type *) DMA2_CHANNEL7_BASE)

Definition at line 488 of file at32f415_dma.h.


AT32F415 Firmwary Library: DMA_interrupts_definition

Macros
DMA_interrupts_definition
AT32F415_periph_driver » DMA

dma interrupt More...

Macros

#define | DMA_FDT_INT ((uint32_t)0x00000002)
#define | DMA_HDT_INT ((uint32_t)0x00000004)
#define | DMA_DTERR_INT ((uint32_t)0x00000008)

Detailed Description

dma interrupt

Macro Definition Documentation

◆ DMA_DTERR_INT

#define DMA_DTERR_INT ((uint32_t)0x00000008)

dma errorr interrupt

Definition at line 54 of file at32f415_dma.h.

◆ DMA_FDT_INT

#define DMA_FDT_INT ((uint32_t)0x00000002)

dma full data transfer interrupt

Definition at line 52 of file at32f415_dma.h.

◆ DMA_HDT_INT

#define DMA_HDT_INT ((uint32_t)0x00000004)

dma half data transfer interrupt

Definition at line 53 of file at32f415_dma.h.


AT32F415 Firmwary Library: DMA_flexible_channel

Macros
DMA_flexible_channel
AT32F415_periph_driver » DMA

Macros

#define | FLEX_CHANNEL1 ((uint8_t)0x01)
#define | FLEX_CHANNEL2 ((uint8_t)0x02)
#define | FLEX_CHANNEL3 ((uint8_t)0x03)
#define | FLEX_CHANNEL4 ((uint8_t)0x04)
#define | FLEX_CHANNEL5 ((uint8_t)0x05)
#define | FLEX_CHANNEL6 ((uint8_t)0x06)
#define | FLEX_CHANNEL7 ((uint8_t)0x07)

Detailed Description

Macro Definition Documentation

◆ FLEX_CHANNEL1

#define FLEX_CHANNEL1 ((uint8_t)0x01)

dma flexible channel1

Definition at line 64 of file at32f415_dma.h.

◆ FLEX_CHANNEL2

#define FLEX_CHANNEL2 ((uint8_t)0x02)

dma flexible channel2

Definition at line 65 of file at32f415_dma.h.

◆ FLEX_CHANNEL3

#define FLEX_CHANNEL3 ((uint8_t)0x03)

dma flexible channel3

Definition at line 66 of file at32f415_dma.h.

◆ FLEX_CHANNEL4

#define FLEX_CHANNEL4 ((uint8_t)0x04)

dma flexible channel4

Definition at line 67 of file at32f415_dma.h.

◆ FLEX_CHANNEL5

#define FLEX_CHANNEL5 ((uint8_t)0x05)

dma flexible channel5

Definition at line 68 of file at32f415_dma.h.

◆ FLEX_CHANNEL6

#define FLEX_CHANNEL6 ((uint8_t)0x06)

dma flexible channel6

Definition at line 69 of file at32f415_dma.h.

◆ FLEX_CHANNEL7

#define FLEX_CHANNEL7 ((uint8_t)0x07)

dma flexible channel7

Definition at line 70 of file at32f415_dma.h.


AT32F415 Firmwary Library: DMA_flags_definition

Macros
DMA_flags_definition
AT32F415_periph_driver » DMA

dma flag More...

Macros

#define | DMA1_GL1_FLAG ((uint32_t)0x00000001)
#define | DMA1_FDT1_FLAG ((uint32_t)0x00000002)
#define | DMA1_HDT1_FLAG ((uint32_t)0x00000004)
#define | DMA1_DTERR1_FLAG ((uint32_t)0x00000008)
#define | DMA1_GL2_FLAG ((uint32_t)0x00000010)
#define | DMA1_FDT2_FLAG ((uint32_t)0x00000020)
#define | DMA1_HDT2_FLAG ((uint32_t)0x00000040)
#define | DMA1_DTERR2_FLAG ((uint32_t)0x00000080)
#define | DMA1_GL3_FLAG ((uint32_t)0x00000100)
#define | DMA1_FDT3_FLAG ((uint32_t)0x00000200)
#define | DMA1_HDT3_FLAG ((uint32_t)0x00000400)
#define | DMA1_DTERR3_FLAG ((uint32_t)0x00000800)
#define | DMA1_GL4_FLAG ((uint32_t)0x00001000)
#define | DMA1_FDT4_FLAG ((uint32_t)0x00002000)
#define | DMA1_HDT4_FLAG ((uint32_t)0x00004000)
#define | DMA1_DTERR4_FLAG ((uint32_t)0x00008000)
#define | DMA1_GL5_FLAG ((uint32_t)0x00010000)
#define | DMA1_FDT5_FLAG ((uint32_t)0x00020000)
#define | DMA1_HDT5_FLAG ((uint32_t)0x00040000)
#define | DMA1_DTERR5_FLAG ((uint32_t)0x00080000)
#define | DMA1_GL6_FLAG ((uint32_t)0x00100000)
#define | DMA1_FDT6_FLAG ((uint32_t)0x00200000)
#define | DMA1_HDT6_FLAG ((uint32_t)0x00400000)
#define | DMA1_DTERR6_FLAG ((uint32_t)0x00800000)
#define | DMA1_GL7_FLAG ((uint32_t)0x01000000)
#define | DMA1_FDT7_FLAG ((uint32_t)0x02000000)
#define | DMA1_HDT7_FLAG ((uint32_t)0x04000000)
#define | DMA1_DTERR7_FLAG ((uint32_t)0x08000000)
#define | DMA2_GL1_FLAG ((uint32_t)0x10000001)
#define | DMA2_FDT1_FLAG ((uint32_t)0x10000002)
#define | DMA2_HDT1_FLAG ((uint32_t)0x10000004)
#define | DMA2_DTERR1_FLAG ((uint32_t)0x10000008)
#define | DMA2_GL2_FLAG ((uint32_t)0x10000010)
#define | DMA2_FDT2_FLAG ((uint32_t)0x10000020)
#define | DMA2_HDT2_FLAG ((uint32_t)0x10000040)
#define | DMA2_DTERR2_FLAG ((uint32_t)0x10000080)
#define | DMA2_GL3_FLAG ((uint32_t)0x10000100)
#define | DMA2_FDT3_FLAG ((uint32_t)0x10000200)
#define | DMA2_HDT3_FLAG ((uint32_t)0x10000400)
#define | DMA2_DTERR3_FLAG ((uint32_t)0x10000800)
#define | DMA2_GL4_FLAG ((uint32_t)0x10001000)
#define | DMA2_FDT4_FLAG ((uint32_t)0x10002000)
#define | DMA2_HDT4_FLAG ((uint32_t)0x10004000)
#define | DMA2_DTERR4_FLAG ((uint32_t)0x10008000)
#define | DMA2_GL5_FLAG ((uint32_t)0x10010000)
#define | DMA2_FDT5_FLAG ((uint32_t)0x10020000)
#define | DMA2_HDT5_FLAG ((uint32_t)0x10040000)
#define | DMA2_DTERR5_FLAG ((uint32_t)0x10080000)
#define | DMA2_GL6_FLAG ((uint32_t)0x10100000)
#define | DMA2_FDT6_FLAG ((uint32_t)0x10200000)
#define | DMA2_HDT6_FLAG ((uint32_t)0x10400000)
#define | DMA2_DTERR6_FLAG ((uint32_t)0x10800000)
#define | DMA2_GL7_FLAG ((uint32_t)0x11000000)
#define | DMA2_FDT7_FLAG ((uint32_t)0x12000000)
#define | DMA2_HDT7_FLAG ((uint32_t)0x14000000)
#define | DMA2_DTERR7_FLAG ((uint32_t)0x18000000)

Detailed Description

dma flag

Macro Definition Documentation

◆ DMA1_DTERR1_FLAG

#define DMA1_DTERR1_FLAG ((uint32_t)0x00000008)

dma1 channel1 error flag

Definition at line 84 of file at32f415_dma.h.

◆ DMA1_DTERR2_FLAG

#define DMA1_DTERR2_FLAG ((uint32_t)0x00000080)

dma1 channel2 error flag

Definition at line 88 of file at32f415_dma.h.

◆ DMA1_DTERR3_FLAG

#define DMA1_DTERR3_FLAG ((uint32_t)0x00000800)

dma1 channel3 error flag

Definition at line 92 of file at32f415_dma.h.

◆ DMA1_DTERR4_FLAG

#define DMA1_DTERR4_FLAG ((uint32_t)0x00008000)

dma1 channel4 error flag

Definition at line 96 of file at32f415_dma.h.

◆ DMA1_DTERR5_FLAG

#define DMA1_DTERR5_FLAG ((uint32_t)0x00080000)

dma1 channel5 error flag

Definition at line 100 of file at32f415_dma.h.

◆ DMA1_DTERR6_FLAG

#define DMA1_DTERR6_FLAG ((uint32_t)0x00800000)

dma1 channel6 error flag

Definition at line 104 of file at32f415_dma.h.

◆ DMA1_DTERR7_FLAG

#define DMA1_DTERR7_FLAG ((uint32_t)0x08000000)

dma1 channel7 error flag

Definition at line 108 of file at32f415_dma.h.

◆ DMA1_FDT1_FLAG

#define DMA1_FDT1_FLAG ((uint32_t)0x00000002)

dma1 channel1 full data transfer flag

Definition at line 82 of file at32f415_dma.h.

◆ DMA1_FDT2_FLAG

#define DMA1_FDT2_FLAG ((uint32_t)0x00000020)

dma1 channel2 full data transfer flag

Definition at line 86 of file at32f415_dma.h.

◆ DMA1_FDT3_FLAG

#define DMA1_FDT3_FLAG ((uint32_t)0x00000200)

dma1 channel3 full data transfer flag

Definition at line 90 of file at32f415_dma.h.

◆ DMA1_FDT4_FLAG

#define DMA1_FDT4_FLAG ((uint32_t)0x00002000)

dma1 channel4 full data transfer flag

Definition at line 94 of file at32f415_dma.h.

◆ DMA1_FDT5_FLAG

#define DMA1_FDT5_FLAG ((uint32_t)0x00020000)

dma1 channel5 full data transfer flag

Definition at line 98 of file at32f415_dma.h.

◆ DMA1_FDT6_FLAG

#define DMA1_FDT6_FLAG ((uint32_t)0x00200000)

dma1 channel6 full data transfer flag

Definition at line 102 of file at32f415_dma.h.

◆ DMA1_FDT7_FLAG

#define DMA1_FDT7_FLAG ((uint32_t)0x02000000)

dma1 channel7 full data transfer flag

Definition at line 106 of file at32f415_dma.h.

◆ DMA1_GL1_FLAG

#define DMA1_GL1_FLAG ((uint32_t)0x00000001)

dma1 channel1 global flag

Definition at line 81 of file at32f415_dma.h.

◆ DMA1_GL2_FLAG

#define DMA1_GL2_FLAG ((uint32_t)0x00000010)

dma1 channel2 global flag

Definition at line 85 of file at32f415_dma.h.

◆ DMA1_GL3_FLAG

#define DMA1_GL3_FLAG ((uint32_t)0x00000100)

dma1 channel3 global flag

Definition at line 89 of file at32f415_dma.h.

◆ DMA1_GL4_FLAG

#define DMA1_GL4_FLAG ((uint32_t)0x00001000)

dma1 channel4 global flag

Definition at line 93 of file at32f415_dma.h.

◆ DMA1_GL5_FLAG

#define DMA1_GL5_FLAG ((uint32_t)0x00010000)

dma1 channel5 global flag

Definition at line 97 of file at32f415_dma.h.

◆ DMA1_GL6_FLAG

#define DMA1_GL6_FLAG ((uint32_t)0x00100000)

dma1 channel6 global flag

Definition at line 101 of file at32f415_dma.h.

◆ DMA1_GL7_FLAG

#define DMA1_GL7_FLAG ((uint32_t)0x01000000)

dma1 channel7 global flag

Definition at line 105 of file at32f415_dma.h.

◆ DMA1_HDT1_FLAG

#define DMA1_HDT1_FLAG ((uint32_t)0x00000004)

dma1 channel1 half data transfer flag

Definition at line 83 of file at32f415_dma.h.

◆ DMA1_HDT2_FLAG

#define DMA1_HDT2_FLAG ((uint32_t)0x00000040)

dma1 channel2 half data transfer flag

Definition at line 87 of file at32f415_dma.h.

◆ DMA1_HDT3_FLAG

#define DMA1_HDT3_FLAG ((uint32_t)0x00000400)

dma1 channel3 half data transfer flag

Definition at line 91 of file at32f415_dma.h.

◆ DMA1_HDT4_FLAG

#define DMA1_HDT4_FLAG ((uint32_t)0x00004000)

dma1 channel4 half data transfer flag

Definition at line 95 of file at32f415_dma.h.

◆ DMA1_HDT5_FLAG

#define DMA1_HDT5_FLAG ((uint32_t)0x00040000)

dma1 channel5 half data transfer flag

Definition at line 99 of file at32f415_dma.h.

◆ DMA1_HDT6_FLAG

#define DMA1_HDT6_FLAG ((uint32_t)0x00400000)

dma1 channel6 half data transfer flag

Definition at line 103 of file at32f415_dma.h.

◆ DMA1_HDT7_FLAG

#define DMA1_HDT7_FLAG ((uint32_t)0x04000000)

dma1 channel7 half data transfer flag

Definition at line 107 of file at32f415_dma.h.

◆ DMA2_DTERR1_FLAG

#define DMA2_DTERR1_FLAG ((uint32_t)0x10000008)

dma2 channel1 error flag

Definition at line 113 of file at32f415_dma.h.

◆ DMA2_DTERR2_FLAG

#define DMA2_DTERR2_FLAG ((uint32_t)0x10000080)

dma2 channel2 error flag

Definition at line 117 of file at32f415_dma.h.

◆ DMA2_DTERR3_FLAG

#define DMA2_DTERR3_FLAG ((uint32_t)0x10000800)

dma2 channel3 error flag

Definition at line 121 of file at32f415_dma.h.

◆ DMA2_DTERR4_FLAG

#define DMA2_DTERR4_FLAG ((uint32_t)0x10008000)

dma2 channel4 error flag

Definition at line 125 of file at32f415_dma.h.

◆ DMA2_DTERR5_FLAG

#define DMA2_DTERR5_FLAG ((uint32_t)0x10080000)

dma2 channel5 error flag

Definition at line 129 of file at32f415_dma.h.

◆ DMA2_DTERR6_FLAG

#define DMA2_DTERR6_FLAG ((uint32_t)0x10800000)

dma2 channel6 error flag

Definition at line 133 of file at32f415_dma.h.

◆ DMA2_DTERR7_FLAG

#define DMA2_DTERR7_FLAG ((uint32_t)0x18000000)

dma2 channel7 error flag

Definition at line 137 of file at32f415_dma.h.

◆ DMA2_FDT1_FLAG

#define DMA2_FDT1_FLAG ((uint32_t)0x10000002)

dma2 channel1 full data transfer flag

Definition at line 111 of file at32f415_dma.h.

◆ DMA2_FDT2_FLAG

#define DMA2_FDT2_FLAG ((uint32_t)0x10000020)

dma2 channel2 full data transfer flag

Definition at line 115 of file at32f415_dma.h.

◆ DMA2_FDT3_FLAG

#define DMA2_FDT3_FLAG ((uint32_t)0x10000200)

dma2 channel3 full data transfer flag

Definition at line 119 of file at32f415_dma.h.

◆ DMA2_FDT4_FLAG

#define DMA2_FDT4_FLAG ((uint32_t)0x10002000)

dma2 channel4 full data transfer flag

Definition at line 123 of file at32f415_dma.h.

◆ DMA2_FDT5_FLAG

#define DMA2_FDT5_FLAG ((uint32_t)0x10020000)

dma2 channel5 full data transfer flag

Definition at line 127 of file at32f415_dma.h.

◆ DMA2_FDT6_FLAG

#define DMA2_FDT6_FLAG ((uint32_t)0x10200000)

dma2 channel6 full data transfer flag

Definition at line 131 of file at32f415_dma.h.

◆ DMA2_FDT7_FLAG

#define DMA2_FDT7_FLAG ((uint32_t)0x12000000)

dma2 channel7 full data transfer flag

Definition at line 135 of file at32f415_dma.h.

◆ DMA2_GL1_FLAG

#define DMA2_GL1_FLAG ((uint32_t)0x10000001)

dma2 channel1 global flag

Definition at line 110 of file at32f415_dma.h.

◆ DMA2_GL2_FLAG

#define DMA2_GL2_FLAG ((uint32_t)0x10000010)

dma2 channel2 global flag

Definition at line 114 of file at32f415_dma.h.

◆ DMA2_GL3_FLAG

#define DMA2_GL3_FLAG ((uint32_t)0x10000100)

dma2 channel3 global flag

Definition at line 118 of file at32f415_dma.h.

◆ DMA2_GL4_FLAG

#define DMA2_GL4_FLAG ((uint32_t)0x10001000)

dma2 channel4 global flag

Definition at line 122 of file at32f415_dma.h.

◆ DMA2_GL5_FLAG

#define DMA2_GL5_FLAG ((uint32_t)0x10010000)

dma2 channel5 global flag

Definition at line 126 of file at32f415_dma.h.

◆ DMA2_GL6_FLAG

#define DMA2_GL6_FLAG ((uint32_t)0x10100000)

dma2 channel6 global flag

Definition at line 130 of file at32f415_dma.h.

◆ DMA2_GL7_FLAG

#define DMA2_GL7_FLAG ((uint32_t)0x11000000)

dma2 channel7 global flag

Definition at line 134 of file at32f415_dma.h.

◆ DMA2_HDT1_FLAG

#define DMA2_HDT1_FLAG ((uint32_t)0x10000004)

dma2 channel1 half data transfer flag

Definition at line 112 of file at32f415_dma.h.

◆ DMA2_HDT2_FLAG

#define DMA2_HDT2_FLAG ((uint32_t)0x10000040)

dma2 channel2 half data transfer flag

Definition at line 116 of file at32f415_dma.h.

◆ DMA2_HDT3_FLAG

#define DMA2_HDT3_FLAG ((uint32_t)0x10000400)

dma2 channel3 half data transfer flag

Definition at line 120 of file at32f415_dma.h.

◆ DMA2_HDT4_FLAG

#define DMA2_HDT4_FLAG ((uint32_t)0x10004000)

dma2 channel4 half data transfer flag

Definition at line 124 of file at32f415_dma.h.

◆ DMA2_HDT5_FLAG

#define DMA2_HDT5_FLAG ((uint32_t)0x10040000)

dma2 channel5 half data transfer flag

Definition at line 128 of file at32f415_dma.h.

◆ DMA2_HDT6_FLAG

#define DMA2_HDT6_FLAG ((uint32_t)0x10400000)

dma2 channel6 half data transfer flag

Definition at line 132 of file at32f415_dma.h.

◆ DMA2_HDT7_FLAG

#define DMA2_HDT7_FLAG ((uint32_t)0x14000000)

dma2 channel7 half data transfer flag

Definition at line 136 of file at32f415_dma.h.


AT32F415 Firmwary Library: DMA_exported_types

Data Structures | Enumerations
DMA_exported_types
AT32F415_periph_driver » DMA

Data Structures

struct | dma_init_type
dma init type More...
struct | dma_type
type define dma register More...
struct | dma_channel_type
type define dma channel register all More...

Enumerations

enum dma_flexible_request_type {
DMA_FLEXIBLE_ADC1 = 0x01 , DMA_FLEXIBLE_SPI1_RX = 0x09 , DMA_FLEXIBLE_SPI1_TX = 0x0A , DMA_FLEXIBLE_SPI2_RX = 0x0B ,
DMA_FLEXIBLE_SPI2_TX = 0x0C , DMA_FLEXIBLE_UART1_RX = 0x19 , DMA_FLEXIBLE_UART1_TX = 0x1A , DMA_FLEXIBLE_UART2_RX = 0x1B ,
DMA_FLEXIBLE_UART2_TX = 0x1C , DMA_FLEXIBLE_UART3_RX = 0x1D , DMA_FLEXIBLE_UART3_TX = 0x1E , DMA_FLEXIBLE_UART4_RX = 0x1F ,
DMA_FLEXIBLE_UART4_TX = 0x20 , DMA_FLEXIBLE_UART5_RX = 0x21 , DMA_FLEXIBLE_UART5_TX = 0x22 , DMA_FLEXIBLE_I2C1_RX = 0x29 ,
DMA_FLEXIBLE_I2C1_TX = 0x2A , DMA_FLEXIBLE_I2C2_RX = 0x2B , DMA_FLEXIBLE_I2C2_TX = 0x2C , DMA_FLEXIBLE_SDIO1 = 0x31 ,
DMA_FLEXIBLE_TMR1_TRIG = 0x35 , DMA_FLEXIBLE_TMR1_HALL = 0x36 , DMA_FLEXIBLE_TMR1_OVERFLOW = 0x37 , DMA_FLEXIBLE_TMR1_CH1 = 0x38 ,
DMA_FLEXIBLE_TMR1_CH2 = 0x39 , DMA_FLEXIBLE_TMR1_CH3 = 0x3A , DMA_FLEXIBLE_TMR1_CH4 = 0x3B , DMA_FLEXIBLE_TMR2_TRIG = 0x3D ,
DMA_FLEXIBLE_TMR2_OVERFLOW = 0x3F , DMA_FLEXIBLE_TMR2_CH1 = 0x40 , DMA_FLEXIBLE_TMR2_CH2 = 0x41 , DMA_FLEXIBLE_TMR2_CH3 = 0x42 ,
DMA_FLEXIBLE_TMR2_CH4 = 0x43 , DMA_FLEXIBLE_TMR3_TRIG = 0x45 , DMA_FLEXIBLE_TMR3_OVERFLOW = 0x47 , DMA_FLEXIBLE_TMR3_CH1 = 0x48 ,
DMA_FLEXIBLE_TMR3_CH2 = 0x49 , DMA_FLEXIBLE_TMR3_CH3 = 0x4A , DMA_FLEXIBLE_TMR3_CH4 = 0x4B , DMA_FLEXIBLE_TMR4_TRIG = 0x4D ,
DMA_FLEXIBLE_TMR4_OVERFLOW = 0x4F , DMA_FLEXIBLE_TMR4_CH1 = 0x50 , DMA_FLEXIBLE_TMR4_CH2 = 0x51 , DMA_FLEXIBLE_TMR4_CH3 = 0x52 ,
DMA_FLEXIBLE_TMR4_CH4 = 0x53 , DMA_FLEXIBLE_TMR5_TRIG = 0x55 , DMA_FLEXIBLE_TMR5_OVERFLOW = 0x57 , DMA_FLEXIBLE_TMR5_CH1 = 0x58 ,
DMA_FLEXIBLE_TMR5_CH2 = 0x59 , DMA_FLEXIBLE_TMR5_CH3 = 0x5A , DMA_FLEXIBLE_TMR5_CH4 = 0x5B
}
dma flexible request type More...
enum | dma_dir_type { DMA_DIR_PERIPHERAL_TO_MEMORY = 0x0000 , DMA_DIR_MEMORY_TO_PERIPHERAL = 0x0010 , DMA_DIR_MEMORY_TO_MEMORY = 0x4000 }
dma direction type More...
enum | dma_peripheral_inc_type { DMA_PERIPHERAL_INC_DISABLE = 0x00 , DMA_PERIPHERAL_INC_ENABLE = 0x01 }
dma peripheral incremented type More...
enum | dma_memory_inc_type { DMA_MEMORY_INC_DISABLE = 0x00 , DMA_MEMORY_INC_ENABLE = 0x01 }
dma memory incremented type More...
enum | dma_peripheral_data_size_type { DMA_PERIPHERAL_DATA_WIDTH_BYTE = 0x00 , DMA_PERIPHERAL_DATA_WIDTH_HALFWORD = 0x01 , DMA_PERIPHERAL_DATA_WIDTH_WORD = 0x02 }
dma peripheral data size type More...
enum | dma_memory_data_size_type { DMA_MEMORY_DATA_WIDTH_BYTE = 0x00 , DMA_MEMORY_DATA_WIDTH_HALFWORD = 0x01 , DMA_MEMORY_DATA_WIDTH_WORD = 0x02 }
dma memory data size type More...
enum | dma_priority_level_type { DMA_PRIORITY_LOW = 0x00 , DMA_PRIORITY_MEDIUM = 0x01 , DMA_PRIORITY_HIGH = 0x02 , DMA_PRIORITY_VERY_HIGH = 0x03 }
dma priority level type More...

Detailed Description

Enumeration Type Documentation

◆ dma_dir_type

enum dma_dir_type

dma direction type

Enumerator
DMA_DIR_PERIPHERAL_TO_MEMORY | dma data transfer direction:peripheral to memory
DMA_DIR_MEMORY_TO_PERIPHERAL | dma data transfer direction:memory to peripheral
DMA_DIR_MEMORY_TO_MEMORY | dma data transfer direction:memory to memory

Definition at line 208 of file at32f415_dma.h.

◆ dma_flexible_request_type

enum dma_flexible_request_type

dma flexible request type

Enumerator
DMA_FLEXIBLE_ADC1 | adc1 flexible request id
DMA_FLEXIBLE_SPI1_RX | spi1_rx flexible request id
DMA_FLEXIBLE_SPI1_TX | spi1_tx flexible request id
DMA_FLEXIBLE_SPI2_RX | spi2_rx flexible request id
DMA_FLEXIBLE_SPI2_TX | spi2_tx flexible request id
DMA_FLEXIBLE_UART1_RX | uart1_rx flexible request id
DMA_FLEXIBLE_UART1_TX | uart1_tx flexible request id
DMA_FLEXIBLE_UART2_RX | uart2_rx flexible request id
DMA_FLEXIBLE_UART2_TX | uart2_tx flexible request id
DMA_FLEXIBLE_UART3_RX | uart3_rx flexible request id
DMA_FLEXIBLE_UART3_TX | uart3_tx flexible request id
DMA_FLEXIBLE_UART4_RX | uart4_rx flexible request id
DMA_FLEXIBLE_UART4_TX | uart4_tx flexible request id
DMA_FLEXIBLE_UART5_RX | uart5_rx flexible request id
DMA_FLEXIBLE_UART5_TX | uart5_tx flexible request id
DMA_FLEXIBLE_I2C1_RX | i2c1_rx flexible request id
DMA_FLEXIBLE_I2C1_TX | i2c1_tx flexible request id
DMA_FLEXIBLE_I2C2_RX | i2c2_rx flexible request id
DMA_FLEXIBLE_I2C2_TX | i2c2_tx flexible request id
DMA_FLEXIBLE_SDIO1 | sdio1 flexible request id
DMA_FLEXIBLE_TMR1_TRIG | tmr1_trig flexible request id
DMA_FLEXIBLE_TMR1_HALL | tmr1_hall flexible request id
DMA_FLEXIBLE_TMR1_OVERFLOW | tmr1_overflow flexible request id
DMA_FLEXIBLE_TMR1_CH1 | tmr1_ch1 flexible request id
DMA_FLEXIBLE_TMR1_CH2 | tmr1_ch2 flexible request id
DMA_FLEXIBLE_TMR1_CH3 | tmr1_ch3 flexible request id
DMA_FLEXIBLE_TMR1_CH4 | tmr1_ch4 flexible request id
DMA_FLEXIBLE_TMR2_TRIG | tmr2_trig flexible request id
DMA_FLEXIBLE_TMR2_OVERFLOW | tmr2_overflow flexible request id
DMA_FLEXIBLE_TMR2_CH1 | tmr2_ch1 flexible request id
DMA_FLEXIBLE_TMR2_CH2 | tmr2_ch2 flexible request id
DMA_FLEXIBLE_TMR2_CH3 | tmr2_ch3 flexible request id
DMA_FLEXIBLE_TMR2_CH4 | tmr2_ch4 flexible request id
DMA_FLEXIBLE_TMR3_TRIG | tmr3_trig flexible request id
DMA_FLEXIBLE_TMR3_OVERFLOW | tmr3_overflow flexible request id
DMA_FLEXIBLE_TMR3_CH1 | tmr3_ch1 flexible request id
DMA_FLEXIBLE_TMR3_CH2 | tmr3_ch2 flexible request id
DMA_FLEXIBLE_TMR3_CH3 | tmr3_ch3 flexible request id
DMA_FLEXIBLE_TMR3_CH4 | tmr3_ch4 flexible request id
DMA_FLEXIBLE_TMR4_TRIG | tmr4_trig flexible request id
DMA_FLEXIBLE_TMR4_OVERFLOW | tmr4_overflow flexible request id
DMA_FLEXIBLE_TMR4_CH1 | tmr4_ch1 flexible request id
DMA_FLEXIBLE_TMR4_CH2 | tmr4_ch2 flexible request id
DMA_FLEXIBLE_TMR4_CH3 | tmr4_ch3 flexible request id
DMA_FLEXIBLE_TMR4_CH4 | tmr4_ch4 flexible request id
DMA_FLEXIBLE_TMR5_TRIG | tmr5_trig flexible request id
DMA_FLEXIBLE_TMR5_OVERFLOW | tmr5_overflow flexible request id
DMA_FLEXIBLE_TMR5_CH1 | tmr5_ch1 flexible request id
DMA_FLEXIBLE_TMR5_CH2 | tmr5_ch2 flexible request id
DMA_FLEXIBLE_TMR5_CH3 | tmr5_ch3 flexible request id
DMA_FLEXIBLE_TMR5_CH4 | tmr5_ch4 flexible request id

Definition at line 150 of file at32f415_dma.h.

◆ dma_memory_data_size_type

enum dma_memory_data_size_type

dma memory data size type

Enumerator
DMA_MEMORY_DATA_WIDTH_BYTE | dma memory databus width 8bit
DMA_MEMORY_DATA_WIDTH_HALFWORD | dma memory databus width 16bit
DMA_MEMORY_DATA_WIDTH_WORD | dma memory databus width 32bit

Definition at line 246 of file at32f415_dma.h.

◆ dma_memory_inc_type

enum dma_memory_inc_type

dma memory incremented type

Enumerator
DMA_MEMORY_INC_DISABLE | dma memory increment mode disable
DMA_MEMORY_INC_ENABLE | dma memory increment mode enable

Definition at line 227 of file at32f415_dma.h.

◆ dma_peripheral_data_size_type

enum dma_peripheral_data_size_type

dma peripheral data size type

Enumerator
DMA_PERIPHERAL_DATA_WIDTH_BYTE | dma peripheral databus width 8bit
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD | dma peripheral databus width 16bit
DMA_PERIPHERAL_DATA_WIDTH_WORD | dma peripheral databus width 32bit

Definition at line 236 of file at32f415_dma.h.

◆ dma_peripheral_inc_type

enum dma_peripheral_inc_type

dma peripheral incremented type

Enumerator
DMA_PERIPHERAL_INC_DISABLE | dma peripheral increment mode disable
DMA_PERIPHERAL_INC_ENABLE | dma peripheral increment mode enable

Definition at line 218 of file at32f415_dma.h.

◆ dma_priority_level_type

enum dma_priority_level_type

dma priority level type

Enumerator
DMA_PRIORITY_LOW | dma channel priority: low
DMA_PRIORITY_MEDIUM | dma channel priority: mediue
DMA_PRIORITY_HIGH | dma channel priority: high
DMA_PRIORITY_VERY_HIGH | dma channel priority: very high

Definition at line 256 of file at32f415_dma.h.


AT32F415 Firmwary Library: dma_init_type Struct Reference

Data Fields
dma_init_type Struct Reference
AT32F415_periph_driver » DMA » DMA_exported_types

dma init type More...

#include <at32f415_dma.h>

Data Fields

uint32_t | peripheral_base_addr
uint32_t | memory_base_addr
dma_dir_type direction
uint16_t | buffer_size
confirm_state peripheral_inc_enable
confirm_state memory_inc_enable
dma_peripheral_data_size_type peripheral_data_width
dma_memory_data_size_type memory_data_width
confirm_state loop_mode_enable
dma_priority_level_type priority

Detailed Description

dma init type

Definition at line 267 of file at32f415_dma.h.

Field Documentation

◆ buffer_size

uint16_t dma_init_type::buffer_size

counter to transfer

Definition at line 272 of file at32f415_dma.h.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), dma_default_para_init(), dma_init(), i2c_dma_config(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ direction

dma_dir_type dma_init_type::direction

dma transmit direction, peripheral as source or as destnation

Definition at line 271 of file at32f415_dma.h.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), dma_default_para_init(), dma_init(), i2c_dma_config(), i2c_lowlevel_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ loop_mode_enable

confirm_state dma_init_type::loop_mode_enable

when circular mode enable, buffer size will reload if count to 0

Definition at line 277 of file at32f415_dma.h.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), dma_default_para_init(), dma_init(), i2c_lowlevel_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ memory_base_addr

uint32_t dma_init_type::memory_base_addr

base addrress for memory

Definition at line 270 of file at32f415_dma.h.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), dma_default_para_init(), dma_init(), i2c_dma_config(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ memory_data_width

dma_memory_data_size_type dma_init_type::memory_data_width

memory data width for transmit

Definition at line 276 of file at32f415_dma.h.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), dma_default_para_init(), dma_init(), i2c_lowlevel_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ memory_inc_enable

confirm_state dma_init_type::memory_inc_enable

memory address increment after one transmit

Definition at line 274 of file at32f415_dma.h.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), dma_default_para_init(), dma_init(), i2c_lowlevel_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ peripheral_base_addr

uint32_t dma_init_type::peripheral_base_addr

base addrress for peripheral

Definition at line 269 of file at32f415_dma.h.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), dma_default_para_init(), dma_init(), i2c_dma_config(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ peripheral_data_width

dma_peripheral_data_size_type dma_init_type::peripheral_data_width

peripheral data width for transmit

Definition at line 275 of file at32f415_dma.h.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), dma_default_para_init(), dma_init(), i2c_lowlevel_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ peripheral_inc_enable

confirm_state dma_init_type::peripheral_inc_enable

periphera address increment after one transmit

Definition at line 273 of file at32f415_dma.h.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), dma_default_para_init(), dma_init(), i2c_lowlevel_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ priority

dma_priority_level_type dma_init_type::priority

dma priority can choose from very high, high, dedium or low

Definition at line 278 of file at32f415_dma.h.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), dma_default_para_init(), dma_init(), i2c_lowlevel_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

The documentation for this struct was generated from the following file:
  • at32f415_dma.h


AT32F415 Firmwary Library: dma_type Struct Reference

Data Fields
dma_type Struct Reference
AT32F415_periph_driver » DMA » DMA_exported_types

type define dma register More...

#include <at32f415_dma.h>

Data Fields

union {
__IO uint32_t sts
struct {
__IO uint32_t gf1: 1
__IO uint32_t fdtf1: 1
__IO uint32_t hdtf1: 1
__IO uint32_t dterrf1: 1
__IO uint32_t gf2: 1
__IO uint32_t fdtf2: 1
__IO uint32_t hdtf2: 1
__IO uint32_t dterrf2: 1
__IO uint32_t gf3: 1
__IO uint32_t fdtf3: 1
__IO uint32_t hdtf3: 1
__IO uint32_t dterrf3: 1
__IO uint32_t gf4: 1
__IO uint32_t fdtf4: 1
__IO uint32_t hdtf4: 1
__IO uint32_t dterrf4: 1
__IO uint32_t gf5: 1
__IO uint32_t fdtf5: 1
__IO uint32_t hdtf5: 1
__IO uint32_t dterrf5: 1
__IO uint32_t gf6: 1
__IO uint32_t fdtf6: 1
__IO uint32_t hdtf6: 1
__IO uint32_t dterrf6: 1
__IO uint32_t gf7: 1
__IO uint32_t fdtf7: 1
__IO uint32_t hdtf7: 1
__IO uint32_t dterrf7: 1
__IO uint32_t reserved1: 4
} sts_bit
};
dma sts register, offset:0x00 More...
union {
__IO uint32_t clr
struct {
__IO uint32_t gfc1: 1
__IO uint32_t fdtfc1: 1
__IO uint32_t hdtfc1: 1
__IO uint32_t dterrfc1: 1
__IO uint32_t gfc2: 1
__IO uint32_t fdtfc2: 1
__IO uint32_t hdtfc2: 1
__IO uint32_t dterrfc2: 1
__IO uint32_t gfc3: 1
__IO uint32_t fdtfc3: 1
__IO uint32_t hdtfc3: 1
__IO uint32_t dterrfc3: 1
__IO uint32_t gfc4: 1
__IO uint32_t fdtfc4: 1
__IO uint32_t hdtfc4: 1
__IO uint32_t dterrfc4: 1
__IO uint32_t gfc5: 1
__IO uint32_t fdtfc5: 1
__IO uint32_t hdtfc5: 1
__IO uint32_t dterrfc5: 1
__IO uint32_t gfc6: 1
__IO uint32_t fdtfc6: 1
__IO uint32_t hdtfc6: 1
__IO uint32_t dterrfc6: 1
__IO uint32_t gfc7: 1
__IO uint32_t fdtfc7: 1
__IO uint32_t hdtfc7: 1
__IO uint32_t dterrfc7: 1
__IO uint32_t reserved1: 4
} clr_bit
};
dma clr register, offset:0x04 More...
union {
__IO uint32_t src_sel0
struct {
__IO uint32_t ch1_src: 8
__IO uint32_t ch2_src: 8
__IO uint32_t ch3_src: 8
__IO uint32_t ch4_src: 8
} src_sel0_bit
};
dma src_sel0 register, offset:0xA0 More...
union {
__IO uint32_t src_sel1
struct {
__IO uint32_t ch5_src: 8
__IO uint32_t ch6_src: 8
__IO uint32_t ch7_src: 8
__IO uint32_t dma_flex_en: 1
__IO uint32_t reserved1: 7
} src_sel1_bit
};
dma src_sel1 register, offset:0xA4 More...

Detailed Description

type define dma register

Definition at line 284 of file at32f415_dma.h.

Field Documentation

◆

union { ... } dma_type::@193

dma sts register, offset:0x00

◆

union { ... } dma_type::@195

dma clr register, offset:0x04

◆

union { ... } dma_type::@197

dma src_sel0 register, offset:0xA0

◆

union { ... } dma_type::@199

dma src_sel1 register, offset:0xA4

◆ ch1_src

__IO uint32_t dma_type::ch1_src

Definition at line 377 of file at32f415_dma.h.

Referenced by dma_flexible_config().

◆ ch2_src

__IO uint32_t dma_type::ch2_src

Definition at line 378 of file at32f415_dma.h.

Referenced by dma_flexible_config().

◆ ch3_src

__IO uint32_t dma_type::ch3_src

Definition at line 379 of file at32f415_dma.h.

Referenced by dma_flexible_config().

◆ ch4_src

__IO uint32_t dma_type::ch4_src

Definition at line 380 of file at32f415_dma.h.

Referenced by dma_flexible_config().

◆ ch5_src

__IO uint32_t dma_type::ch5_src

Definition at line 392 of file at32f415_dma.h.

Referenced by dma_flexible_config().

◆ ch6_src

__IO uint32_t dma_type::ch6_src

Definition at line 393 of file at32f415_dma.h.

Referenced by dma_flexible_config().

◆ ch7_src

__IO uint32_t dma_type::ch7_src

Definition at line 394 of file at32f415_dma.h.

Referenced by dma_flexible_config().

◆ clr

__IO uint32_t dma_type::clr

Definition at line 331 of file at32f415_dma.h.

◆

struct { ... } dma_type::clr_bit

◆ dma_flex_en

__IO uint32_t dma_type::dma_flex_en

Definition at line 395 of file at32f415_dma.h.

Referenced by dma_flexible_config().

◆ dterrf1

__IO uint32_t dma_type::dterrf1

Definition at line 297 of file at32f415_dma.h.

◆ dterrf2

__IO uint32_t dma_type::dterrf2

Definition at line 301 of file at32f415_dma.h.

◆ dterrf3

__IO uint32_t dma_type::dterrf3

Definition at line 305 of file at32f415_dma.h.

◆ dterrf4

__IO uint32_t dma_type::dterrf4

Definition at line 309 of file at32f415_dma.h.

◆ dterrf5

__IO uint32_t dma_type::dterrf5

Definition at line 313 of file at32f415_dma.h.

◆ dterrf6

__IO uint32_t dma_type::dterrf6

Definition at line 317 of file at32f415_dma.h.

◆ dterrf7

__IO uint32_t dma_type::dterrf7

Definition at line 321 of file at32f415_dma.h.

◆ dterrfc1

__IO uint32_t dma_type::dterrfc1

Definition at line 337 of file at32f415_dma.h.

◆ dterrfc2

__IO uint32_t dma_type::dterrfc2

Definition at line 341 of file at32f415_dma.h.

◆ dterrfc3

__IO uint32_t dma_type::dterrfc3

Definition at line 345 of file at32f415_dma.h.

◆ dterrfc4

__IO uint32_t dma_type::dterrfc4

Definition at line 349 of file at32f415_dma.h.

◆ dterrfc5

__IO uint32_t dma_type::dterrfc5

Definition at line 353 of file at32f415_dma.h.

◆ dterrfc6

__IO uint32_t dma_type::dterrfc6

Definition at line 357 of file at32f415_dma.h.

◆ dterrfc7

__IO uint32_t dma_type::dterrfc7

Definition at line 361 of file at32f415_dma.h.

◆ fdtf1

__IO uint32_t dma_type::fdtf1

Definition at line 295 of file at32f415_dma.h.

◆ fdtf2

__IO uint32_t dma_type::fdtf2

Definition at line 299 of file at32f415_dma.h.

◆ fdtf3

__IO uint32_t dma_type::fdtf3

Definition at line 303 of file at32f415_dma.h.

◆ fdtf4

__IO uint32_t dma_type::fdtf4

Definition at line 307 of file at32f415_dma.h.

◆ fdtf5

__IO uint32_t dma_type::fdtf5

Definition at line 311 of file at32f415_dma.h.

◆ fdtf6

__IO uint32_t dma_type::fdtf6

Definition at line 315 of file at32f415_dma.h.

◆ fdtf7

__IO uint32_t dma_type::fdtf7

Definition at line 319 of file at32f415_dma.h.

◆ fdtfc1

__IO uint32_t dma_type::fdtfc1

Definition at line 335 of file at32f415_dma.h.

◆ fdtfc2

__IO uint32_t dma_type::fdtfc2

Definition at line 339 of file at32f415_dma.h.

◆ fdtfc3

__IO uint32_t dma_type::fdtfc3

Definition at line 343 of file at32f415_dma.h.

◆ fdtfc4

__IO uint32_t dma_type::fdtfc4

Definition at line 347 of file at32f415_dma.h.

◆ fdtfc5

__IO uint32_t dma_type::fdtfc5

Definition at line 351 of file at32f415_dma.h.

◆ fdtfc6

__IO uint32_t dma_type::fdtfc6

Definition at line 355 of file at32f415_dma.h.

◆ fdtfc7

__IO uint32_t dma_type::fdtfc7

Definition at line 359 of file at32f415_dma.h.

◆ gf1

__IO uint32_t dma_type::gf1

Definition at line 294 of file at32f415_dma.h.

◆ gf2

__IO uint32_t dma_type::gf2

Definition at line 298 of file at32f415_dma.h.

◆ gf3

__IO uint32_t dma_type::gf3

Definition at line 302 of file at32f415_dma.h.

◆ gf4

__IO uint32_t dma_type::gf4

Definition at line 306 of file at32f415_dma.h.

◆ gf5

__IO uint32_t dma_type::gf5

Definition at line 310 of file at32f415_dma.h.

◆ gf6

__IO uint32_t dma_type::gf6

Definition at line 314 of file at32f415_dma.h.

◆ gf7

__IO uint32_t dma_type::gf7

Definition at line 318 of file at32f415_dma.h.

◆ gfc1

__IO uint32_t dma_type::gfc1

Definition at line 334 of file at32f415_dma.h.

◆ gfc2

__IO uint32_t dma_type::gfc2

Definition at line 338 of file at32f415_dma.h.

◆ gfc3

__IO uint32_t dma_type::gfc3

Definition at line 342 of file at32f415_dma.h.

◆ gfc4

__IO uint32_t dma_type::gfc4

Definition at line 346 of file at32f415_dma.h.

◆ gfc5

__IO uint32_t dma_type::gfc5

Definition at line 350 of file at32f415_dma.h.

◆ gfc6

__IO uint32_t dma_type::gfc6

Definition at line 354 of file at32f415_dma.h.

◆ gfc7

__IO uint32_t dma_type::gfc7

Definition at line 358 of file at32f415_dma.h.

◆ hdtf1

__IO uint32_t dma_type::hdtf1

Definition at line 296 of file at32f415_dma.h.

◆ hdtf2

__IO uint32_t dma_type::hdtf2

Definition at line 300 of file at32f415_dma.h.

◆ hdtf3

__IO uint32_t dma_type::hdtf3

Definition at line 304 of file at32f415_dma.h.

◆ hdtf4

__IO uint32_t dma_type::hdtf4

Definition at line 308 of file at32f415_dma.h.

◆ hdtf5

__IO uint32_t dma_type::hdtf5

Definition at line 312 of file at32f415_dma.h.

◆ hdtf6

__IO uint32_t dma_type::hdtf6

Definition at line 316 of file at32f415_dma.h.

◆ hdtf7

__IO uint32_t dma_type::hdtf7

Definition at line 320 of file at32f415_dma.h.

◆ hdtfc1

__IO uint32_t dma_type::hdtfc1

Definition at line 336 of file at32f415_dma.h.

◆ hdtfc2

__IO uint32_t dma_type::hdtfc2

Definition at line 340 of file at32f415_dma.h.

◆ hdtfc3

__IO uint32_t dma_type::hdtfc3

Definition at line 344 of file at32f415_dma.h.

◆ hdtfc4

__IO uint32_t dma_type::hdtfc4

Definition at line 348 of file at32f415_dma.h.

◆ hdtfc5

__IO uint32_t dma_type::hdtfc5

Definition at line 352 of file at32f415_dma.h.

◆ hdtfc6

__IO uint32_t dma_type::hdtfc6

Definition at line 356 of file at32f415_dma.h.

◆ hdtfc7

__IO uint32_t dma_type::hdtfc7

Definition at line 360 of file at32f415_dma.h.

◆ reserved1

__IO uint32_t dma_type::reserved1

reserved, offset:0x08~0x9C

Definition at line 322 of file at32f415_dma.h.

◆ src_sel0

__IO uint32_t dma_type::src_sel0

Definition at line 374 of file at32f415_dma.h.

◆

struct { ... } dma_type::src_sel0_bit

Referenced by dma_flexible_config().

◆ src_sel1

__IO uint32_t dma_type::src_sel1

Definition at line 389 of file at32f415_dma.h.

◆

struct { ... } dma_type::src_sel1_bit

Referenced by dma_flexible_config().

◆ sts

__IO uint32_t dma_type::sts

Definition at line 291 of file at32f415_dma.h.

◆

struct { ... } dma_type::sts_bit
The documentation for this struct was generated from the following file:
  • at32f415_dma.h


AT32F415 Firmwary Library: dma_channel_type Struct Reference

Data Fields
dma_channel_type Struct Reference
AT32F415_periph_driver » DMA » DMA_exported_types

type define dma channel register all More...

#include <at32f415_dma.h>

Data Fields

union {
__IO uint32_t ctrl
struct {
__IO uint32_t chen: 1
__IO uint32_t fdtien: 1
__IO uint32_t hdtien: 1
__IO uint32_t dterrien: 1
__IO uint32_t dtd: 1
__IO uint32_t lm: 1
__IO uint32_t pincm: 1
__IO uint32_t mincm: 1
__IO uint32_t pwidth: 2
__IO uint32_t mwidth: 2
__IO uint32_t chpl: 2
__IO uint32_t m2m: 1
__IO uint32_t reserved1: 17
} ctrl_bit
};
dma ctrl register, offset:0x08+20*(x-1) x=1...7 More...
union {
__IO uint32_t dtcnt
struct {
__IO uint32_t cnt: 16
__IO uint32_t reserved1: 16
} dtcnt_bit
};
dma dtcnt register, offset:0x0C+20*(x-1) x=1...7 More...
union {
__IO uint32_t paddr
struct {
__IO uint32_t paddr: 32
} paddr_bit
};
dma cpba register, offset:0x10+20*(x-1) x=1...7 More...
union {
__IO uint32_t maddr
struct {
__IO uint32_t maddr: 32
} maddr_bit
};
dma cmba register, offset:0x14+20*(x-1) x=1...7 More...

Detailed Description

type define dma channel register all

Definition at line 404 of file at32f415_dma.h.

Field Documentation

◆

union { ... } dma_channel_type::@205

dma ctrl register, offset:0x08+20*(x-1) x=1...7

◆

union { ... } dma_channel_type::@207

dma dtcnt register, offset:0x0C+20*(x-1) x=1...7

◆

union { ... } dma_channel_type::@209

dma cpba register, offset:0x10+20*(x-1) x=1...7

◆

union { ... } dma_channel_type::@211

dma cmba register, offset:0x14+20*(x-1) x=1...7

◆ chen

__IO uint32_t dma_channel_type::chen

Definition at line 414 of file at32f415_dma.h.

Referenced by dma_channel_enable(), and dma_reset().

◆ chpl

__IO uint32_t dma_channel_type::chpl

Definition at line 424 of file at32f415_dma.h.

Referenced by dma_init().

◆ cnt

__IO uint32_t dma_channel_type::cnt

Definition at line 438 of file at32f415_dma.h.

◆ ctrl

__IO uint32_t dma_channel_type::ctrl

Definition at line 411 of file at32f415_dma.h.

Referenced by dma_init(), dma_interrupt_enable(), and dma_reset().

◆

struct { ... } dma_channel_type::ctrl_bit

Referenced by dma_channel_enable(), dma_init(), and dma_reset().

◆ dtcnt

__IO uint32_t dma_channel_type::dtcnt

Definition at line 435 of file at32f415_dma.h.

Referenced by dma_data_number_get(), dma_data_number_set(), dma_init(), and dma_reset().

◆

struct { ... } dma_channel_type::dtcnt_bit

◆ dtd

__IO uint32_t dma_channel_type::dtd

Definition at line 418 of file at32f415_dma.h.

◆ dterrien

__IO uint32_t dma_channel_type::dterrien

Definition at line 417 of file at32f415_dma.h.

◆ fdtien

__IO uint32_t dma_channel_type::fdtien

Definition at line 415 of file at32f415_dma.h.

◆ hdtien

__IO uint32_t dma_channel_type::hdtien

Definition at line 416 of file at32f415_dma.h.

◆ lm

__IO uint32_t dma_channel_type::lm

Definition at line 419 of file at32f415_dma.h.

Referenced by dma_init().

◆ m2m

__IO uint32_t dma_channel_type::m2m

Definition at line 425 of file at32f415_dma.h.

◆ maddr

__IO uint32_t dma_channel_type::maddr

Definition at line 460 of file at32f415_dma.h.

Referenced by dma_init(), and dma_reset().

◆

struct { ... } dma_channel_type::maddr_bit

◆ mincm

__IO uint32_t dma_channel_type::mincm

Definition at line 421 of file at32f415_dma.h.

Referenced by dma_init().

◆ mwidth

__IO uint32_t dma_channel_type::mwidth

Definition at line 423 of file at32f415_dma.h.

Referenced by dma_init().

◆ paddr

__IO uint32_t dma_channel_type::paddr

Definition at line 448 of file at32f415_dma.h.

Referenced by dma_init(), and dma_reset().

◆

struct { ... } dma_channel_type::paddr_bit

◆ pincm

__IO uint32_t dma_channel_type::pincm

Definition at line 420 of file at32f415_dma.h.

Referenced by dma_init().

◆ pwidth

__IO uint32_t dma_channel_type::pwidth

Definition at line 422 of file at32f415_dma.h.

Referenced by dma_init().

◆ reserved1

__IO uint32_t dma_channel_type::reserved1

Definition at line 426 of file at32f415_dma.h.

The documentation for this struct was generated from the following file:
  • at32f415_dma.h


AT32F415 Firmwary Library: DMA_exported_functions

Functions
DMA_exported_functions
AT32F415_periph_driver » DMA

Functions

void | dma_reset (dma_channel_type *dmax_channely)
reset the dmax channely registers. More...
void | dma_default_para_init (dma_init_type *dma_init_struct)
dma init config with its default value. More...
void | dma_init (dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init More...
void | dma_channel_enable (dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely More...
void | dma_flexible_config (dma_type *dma_x, uint8_t flex_channelx, dma_flexible_request_type flexible_request)
initialize the dma_x flexible function according to the specified parameters. More...
void | dma_data_number_set (dma_channel_type *dmax_channely, uint16_t data_number)
set the number of data to be transferred More...
uint16_t | dma_data_number_get (dma_channel_type *dmax_channely)
get number of data from dtcnt register More...
void | dma_interrupt_enable (dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt More...
flag_status | dma_flag_get (uint32_t dmax_flag)
get dma flag More...
void | dma_flag_clear (uint32_t dmax_flag)
clear dma flag
More...

Detailed Description

Function Documentation

◆ dma_channel_enable()

void dma_channel_enable | ( | dma_channel_type * | dmax_channely,
 |  | confirm_state | new_state
 | ) |  |

enable or disable dma channely

Parameters
dmax_channely this parameter can be one of the following values:
  • DMA1_CHANNEL1
  • DMA1_CHANNEL2
  • DMA1_CHANNEL3
  • DMA1_CHANNEL4
  • DMA1_CHANNEL5
  • DMA1_CHANNEL6
  • DMA1_CHANNEL7
  • DMA2_CHANNEL1
  • DMA2_CHANNEL2
  • DMA2_CHANNEL3
  • DMA2_CHANNEL4
  • DMA2_CHANNEL5
  • DMA2_CHANNEL6
  • DMA2_CHANNEL7
new_state (TRUE or FALSE)
Return values
None

Definition at line 198 of file at32f415_dma.c.

Referenced by codec_i2s_init(), codec_i2s_reset(), DMA1_Channel1_IRQHandler(), DMA1_Channel2_IRQHandler(), DMA1_Channel3_IRQHandler(), DMA1_Channel4_IRQHandler(), dma_config(), dma_configuration(), i2c_dma_config(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), and spi_bytes_write().

◆ dma_data_number_get()

uint16_t dma_data_number_get ( dma_channel_type * dmax_channely )

get number of data from dtcnt register

Parameters
dmax_channely this parameter can be one of the following values:
  • DMA1_CHANNEL1
  • DMA1_CHANNEL2
  • DMA1_CHANNEL3
  • DMA1_CHANNEL4
  • DMA1_CHANNEL5
  • DMA1_CHANNEL6
  • DMA1_CHANNEL7
  • DMA2_CHANNEL1
  • DMA2_CHANNEL2
  • DMA2_CHANNEL3
  • DMA2_CHANNEL4
  • DMA2_CHANNEL5
  • DMA2_CHANNEL6
  • DMA2_CHANNEL7
Return values
the number of data.

Definition at line 134 of file at32f415_dma.c.

◆ dma_data_number_set()

void dma_data_number_set | ( | dma_channel_type * | dmax_channely,
 |  | uint16_t | data_number
 | ) |  |

set the number of data to be transferred

Parameters
dmax_channely this parameter can be one of the following values:
  • DMA1_CHANNEL1
  • DMA1_CHANNEL2
  • DMA1_CHANNEL3
  • DMA1_CHANNEL4
  • DMA1_CHANNEL5
  • DMA1_CHANNEL6
  • DMA1_CHANNEL7
  • DMA2_CHANNEL1
  • DMA2_CHANNEL2
  • DMA2_CHANNEL3
  • DMA2_CHANNEL4
  • DMA2_CHANNEL5
  • DMA2_CHANNEL6
  • DMA2_CHANNEL7
data_number the number of data to be transferred(0x0000~0xFFFF) transfer.
Return values
none.

Definition at line 109 of file at32f415_dma.c.

◆ dma_default_para_init()

void dma_default_para_init ( dma_init_type * dma_init_struct )

dma init config with its default value.

Parameters
dma_init_struct : pointer to a dma_init_type structure which will be initialized.
Return values
none

Definition at line 360 of file at32f415_dma.c.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), i2c_lowlevel_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ dma_flag_clear()

void dma_flag_clear ( uint32_t dmax_flag )

clear dma flag

Parameters
dmax_flag this parameter can be one of the following values:
  • DMA1_GL1_FLAG - DMA1_FDT1_FLAG - DMA1_HDT1_FLAG - DMA1_DTERR1_FLAG
  • DMA1_GL2_FLAG - DMA1_FDT2_FLAG - DMA1_HDT2_FLAG - DMA1_DTERR2_FLAG
  • DMA1_GL3_FLAG - DMA1_FDT3_FLAG - DMA1_HDT3_FLAG - DMA1_DTERR3_FLAG
  • DMA1_GL4_FLAG - DMA1_FDT4_FLAG - DMA1_HDT4_FLAG - DMA1_DTERR4_FLAG
  • DMA1_GL5_FLAG - DMA1_FDT5_FLAG - DMA1_HDT5_FLAG - DMA1_DTERR5_FLAG
  • DMA1_GL6_FLAG - DMA1_FDT6_FLAG - DMA1_HDT6_FLAG - DMA1_DTERR6_FLAG
  • DMA1_GL7_FLAG - DMA1_FDT7_FLAG - DMA1_HDT7_FLAG - DMA1_DTERR7_FLAG
  • DMA2_GL1_FLAG - DMA2_FDT1_FLAG - DMA2_HDT1_FLAG - DMA2_DTERR1_FLAG
  • DMA2_GL2_FLAG - DMA2_FDT2_FLAG - DMA2_HDT2_FLAG - DMA2_DTERR2_FLAG
  • DMA2_GL3_FLAG - DMA2_FDT3_FLAG - DMA2_HDT3_FLAG - DMA2_DTERR3_FLAG
  • DMA2_GL4_FLAG - DMA2_FDT4_FLAG - DMA2_HDT4_FLAG - DMA2_DTERR4_FLAG
  • DMA2_GL5_FLAG - DMA2_FDT5_FLAG - DMA2_HDT5_FLAG - DMA2_DTERR5_FLAG
  • DMA2_GL6_FLAG - DMA2_FDT6_FLAG - DMA2_HDT6_FLAG - DMA2_DTERR6_FLAG
  • DMA2_GL7_FLAG - DMA2_FDT7_FLAG - DMA2_HDT7_FLAG - DMA2_DTERR7_FLAG
Return values
none

Definition at line 342 of file at32f415_dma.c.

Referenced by DMA1_Channel1_IRQHandler(), DMA1_Channel2_IRQHandler(), DMA1_Channel3_IRQHandler(), DMA1_Channel4_IRQHandler(), DMA2_Channel1_IRQHandler(), i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), main(), spi_bytes_read(), and spi_bytes_write().

◆ dma_flag_get()

flag_status dma_flag_get ( uint32_t dmax_flag )

get dma flag

Parameters
dmax_flag this parameter can be one of the following values:
  • DMA1_GL1_FLAG - DMA1_FDT1_FLAG - DMA1_HDT1_FLAG - DMA1_DTERR1_FLAG
  • DMA1_GL2_FLAG - DMA1_FDT2_FLAG - DMA1_HDT2_FLAG - DMA1_DTERR2_FLAG
  • DMA1_GL3_FLAG - DMA1_FDT3_FLAG - DMA1_HDT3_FLAG - DMA1_DTERR3_FLAG
  • DMA1_GL4_FLAG - DMA1_FDT4_FLAG - DMA1_HDT4_FLAG - DMA1_DTERR4_FLAG
  • DMA1_GL5_FLAG - DMA1_FDT5_FLAG - DMA1_HDT5_FLAG - DMA1_DTERR5_FLAG
  • DMA1_GL6_FLAG - DMA1_FDT6_FLAG - DMA1_HDT6_FLAG - DMA1_DTERR6_FLAG
  • DMA1_GL7_FLAG - DMA1_FDT7_FLAG - DMA1_HDT7_FLAG - DMA1_DTERR7_FLAG
  • DMA2_GL1_FLAG - DMA2_FDT1_FLAG - DMA2_HDT1_FLAG - DMA2_DTERR1_FLAG
  • DMA2_GL2_FLAG - DMA2_FDT2_FLAG - DMA2_HDT2_FLAG - DMA2_DTERR2_FLAG
  • DMA2_GL3_FLAG - DMA2_FDT3_FLAG - DMA2_HDT3_FLAG - DMA2_DTERR3_FLAG
  • DMA2_GL4_FLAG - DMA2_FDT4_FLAG - DMA2_HDT4_FLAG - DMA2_DTERR4_FLAG
  • DMA2_GL5_FLAG - DMA2_FDT5_FLAG - DMA2_HDT5_FLAG - DMA2_DTERR5_FLAG
  • DMA2_GL6_FLAG - DMA2_FDT6_FLAG - DMA2_HDT6_FLAG - DMA2_DTERR6_FLAG
  • DMA2_GL7_FLAG - DMA2_FDT7_FLAG - DMA2_HDT7_FLAG - DMA2_DTERR7_FLAG
Return values
state of dma flag

Definition at line 296 of file at32f415_dma.c.

Referenced by DMA1_Channel1_IRQHandler(), DMA1_Channel2_IRQHandler(), DMA1_Channel3_IRQHandler(), DMA1_Channel4_IRQHandler(), DMA2_Channel1_IRQHandler(), i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), main(), spi_bytes_read(), and spi_bytes_write().

◆ dma_flexible_config()

void dma_flexible_config | ( | dma_type * | dma_x,
 |  | uint8_t | flex_channelx,
 |  | dma_flexible_request_type | flexible_request
 | ) |  |

initialize the dma_x flexible function according to the specified parameters.

Parameters
dma_x this parameter can be one of the following values:
  • DMA1
  • DMA2
flex_channelx this parameter can be one of the following values:
  • FLEX_CHANNEL1
  • FLEX_CHANNEL2
  • FLEX_CHANNEL3
  • FLEX_CHANNEL4
  • FLEX_CHANNEL5
  • FLEX_CHANNEL6
  • FLEX_CHANNEL7
flexible_request every peripheral have specified hardware_id. this parameter can be one of the following values:
  • DMA_FLEXIBLE_ADC1 - DMA_FLEXIBLE_SPI1_RX - DMA_FLEXIBLE_SPI1_TX - DMA_FLEXIBLE_SPI2_RX
  • DMA_FLEXIBLE_SPI2_TX - DMA_FLEXIBLE_UART1_RX - DMA_FLEXIBLE_UART1_TX - DMA_FLEXIBLE_UART2_RX
  • DMA_FLEXIBLE_UART2_TX - DMA_FLEXIBLE_UART3_RX - DMA_FLEXIBLE_UART3_TX - DMA_FLEXIBLE_UART4_RX
  • DMA_FLEXIBLE_UART4_TX - DMA_FLEXIBLE_UART5_RX - DMA_FLEXIBLE_UART5_TX - DMA_FLEXIBLE_I2C1_RX
  • DMA_FLEXIBLE_I2C1_TX - DMA_FLEXIBLE_I2C2_RX - DMA_FLEXIBLE_I2C2_TX - DMA_FLEXIBLE_SDIO1
  • DMA_FLEXIBLE_TMR1_TRIG - DMA_FLEXIBLE_TMR1_HALL - DMA_FLEXIBLE_TMR1_OVERFLOW- DMA_FLEXIBLE_TMR1_CH1
  • DMA_FLEXIBLE_TMR1_CH2 - DMA_FLEXIBLE_TMR1_CH3 - DMA_FLEXIBLE_TMR1_CH4 - DMA_FLEXIBLE_TMR2_TRIG
  • DMA_FLEXIBLE_TMR2_OVERFLOW- DMA_FLEXIBLE_TMR2_CH1 - DMA_FLEXIBLE_TMR2_CH2 - DMA_FLEXIBLE_TMR2_CH3
  • DMA_FLEXIBLE_TMR2_CH4 - DMA_FLEXIBLE_TMR3_TRIG - DMA_FLEXIBLE_TMR3_OVERFLOW- DMA_FLEXIBLE_TMR3_CH1
  • DMA_FLEXIBLE_TMR3_CH2 - DMA_FLEXIBLE_TMR3_CH3 - DMA_FLEXIBLE_TMR3_CH4 - DMA_FLEXIBLE_TMR4_TRIG
  • DMA_FLEXIBLE_TMR4_OVERFLOW- DMA_FLEXIBLE_TMR4_CH1 - DMA_FLEXIBLE_TMR4_CH2 - DMA_FLEXIBLE_TMR4_CH3
  • DMA_FLEXIBLE_TMR4_CH4 - DMA_FLEXIBLE_TMR5_TRIG - DMA_FLEXIBLE_TMR5_OVERFLOW- DMA_FLEXIBLE_TMR5_CH1
  • DMA_FLEXIBLE_TMR5_CH2 - DMA_FLEXIBLE_TMR5_CH3 - DMA_FLEXIBLE_TMR5_CH4
Return values
none

< dma flexible channel1

< dma flexible channel2

< dma flexible channel3

< dma flexible channel4

< dma flexible channel5

< dma flexible channel6

< dma flexible channel7

Definition at line 236 of file at32f415_dma.c.

Referenced by dma_configuration(), and main().

◆ dma_init()

void dma_init | ( | dma_channel_type * | dmax_channely,
 |  | dma_init_type * | dma_init_struct
 | ) |  |

dma init

Parameters
dmax_channely this parameter can be one of the following values:
  • DMA1_CHANNEL1
  • DMA1_CHANNEL2
  • DMA1_CHANNEL3
  • DMA1_CHANNEL4
  • DMA1_CHANNEL5
  • DMA1_CHANNEL6
  • DMA1_CHANNEL7
  • DMA2_CHANNEL1
  • DMA2_CHANNEL2
  • DMA2_CHANNEL3
  • DMA2_CHANNEL4
  • DMA2_CHANNEL5
  • DMA2_CHANNEL6
  • DMA2_CHANNEL7
dma_initstruct : pointer to a dma_init_type structure.
Return values
none

Definition at line 395 of file at32f415_dma.c.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), i2c_dma_config(), i2c_lowlevel_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ dma_interrupt_enable()

void dma_interrupt_enable | ( | dma_channel_type * | dmax_channely,
 |  | uint32_t | dma_int,
 |  | confirm_state | new_state
 | ) |  |

enable or disable dma interrupt

Parameters
dmax_channely this parameter can be one of the following values:
  • DMA1_CHANNEL1
  • DMA1_CHANNEL2
  • DMA1_CHANNEL3
  • DMA1_CHANNEL4
  • DMA1_CHANNEL5
  • DMA1_CHANNEL6
  • DMA1_CHANNEL7
  • DMA2_CHANNEL1
  • DMA2_CHANNEL2
  • DMA2_CHANNEL3
  • DMA2_CHANNEL4
  • DMA2_CHANNEL5
  • DMA2_CHANNEL6
  • DMA2_CHANNEL7
dma_int this parameter can be any combination of the following values:
  • DMA_FDT_INT
  • DMA_HDT_INT
  • DMA_DTERR_INT
new_state (TRUE or FALSE)
Return values
none

Definition at line 165 of file at32f415_dma.c.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), i2c_dma_config(), i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), and main().

◆ dma_reset()

void dma_reset ( dma_channel_type * dmax_channely )

reset the dmax channely registers.

Parameters
dmax_channely this parameter can be one of the following values:
  • DMA1_CHANNEL1
  • DMA1_CHANNEL2
  • DMA1_CHANNEL3
  • DMA1_CHANNEL4
  • DMA1_CHANNEL5
  • DMA1_CHANNEL6
  • DMA1_CHANNEL7
  • DMA2_CHANNEL1
  • DMA2_CHANNEL2
  • DMA2_CHANNEL3
  • DMA2_CHANNEL4
  • DMA2_CHANNEL5
  • DMA2_CHANNEL6
  • DMA2_CHANNEL7
Return values
none

Definition at line 64 of file at32f415_dma.c.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), i2c_lowlevel_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().


AT32F415 Firmwary Library: DMA_private_functions

Functions
DMA_private_functions
AT32F415_periph_driver » DMA

Functions

void | dma_reset (dma_channel_type *dmax_channely)
reset the dmax channely registers. More...
void | dma_data_number_set (dma_channel_type *dmax_channely, uint16_t data_number)
set the number of data to be transferred More...
uint16_t | dma_data_number_get (dma_channel_type *dmax_channely)
get number of data from dtcnt register More...
void | dma_interrupt_enable (dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt More...
void | dma_channel_enable (dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely More...
void | dma_flexible_config (dma_type *dma_x, uint8_t flex_channelx, dma_flexible_request_type flexible_request)
initialize the dma_x flexible function according to the specified parameters. More...
flag_status | dma_flag_get (uint32_t dmax_flag)
get dma flag More...
void | dma_flag_clear (uint32_t dmax_flag)
clear dma flag
More...
void | dma_default_para_init (dma_init_type *dma_init_struct)
dma init config with its default value. More...
void | dma_init (dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init More...

Detailed Description

Function Documentation

◆ dma_channel_enable()

void dma_channel_enable | ( | dma_channel_type * | dmax_channely,
 |  | confirm_state | new_state
 | ) |  |

enable or disable dma channely

Parameters
dmax_channely this parameter can be one of the following values:
  • DMA1_CHANNEL1
  • DMA1_CHANNEL2
  • DMA1_CHANNEL3
  • DMA1_CHANNEL4
  • DMA1_CHANNEL5
  • DMA1_CHANNEL6
  • DMA1_CHANNEL7
  • DMA2_CHANNEL1
  • DMA2_CHANNEL2
  • DMA2_CHANNEL3
  • DMA2_CHANNEL4
  • DMA2_CHANNEL5
  • DMA2_CHANNEL6
  • DMA2_CHANNEL7
new_state (TRUE or FALSE)
Return values
None

Definition at line 198 of file at32f415_dma.c.

Referenced by codec_i2s_init(), codec_i2s_reset(), DMA1_Channel1_IRQHandler(), DMA1_Channel2_IRQHandler(), DMA1_Channel3_IRQHandler(), DMA1_Channel4_IRQHandler(), dma_config(), dma_configuration(), i2c_dma_config(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), and spi_bytes_write().

◆ dma_data_number_get()

uint16_t dma_data_number_get ( dma_channel_type * dmax_channely )

get number of data from dtcnt register

Parameters
dmax_channely this parameter can be one of the following values:
  • DMA1_CHANNEL1
  • DMA1_CHANNEL2
  • DMA1_CHANNEL3
  • DMA1_CHANNEL4
  • DMA1_CHANNEL5
  • DMA1_CHANNEL6
  • DMA1_CHANNEL7
  • DMA2_CHANNEL1
  • DMA2_CHANNEL2
  • DMA2_CHANNEL3
  • DMA2_CHANNEL4
  • DMA2_CHANNEL5
  • DMA2_CHANNEL6
  • DMA2_CHANNEL7
Return values
the number of data.

Definition at line 134 of file at32f415_dma.c.

◆ dma_data_number_set()

void dma_data_number_set | ( | dma_channel_type * | dmax_channely,
 |  | uint16_t | data_number
 | ) |  |

set the number of data to be transferred

Parameters
dmax_channely this parameter can be one of the following values:
  • DMA1_CHANNEL1
  • DMA1_CHANNEL2
  • DMA1_CHANNEL3
  • DMA1_CHANNEL4
  • DMA1_CHANNEL5
  • DMA1_CHANNEL6
  • DMA1_CHANNEL7
  • DMA2_CHANNEL1
  • DMA2_CHANNEL2
  • DMA2_CHANNEL3
  • DMA2_CHANNEL4
  • DMA2_CHANNEL5
  • DMA2_CHANNEL6
  • DMA2_CHANNEL7
data_number the number of data to be transferred(0x0000~0xFFFF) transfer.
Return values
none.

Definition at line 109 of file at32f415_dma.c.

◆ dma_default_para_init()

void dma_default_para_init ( dma_init_type * dma_init_struct )

dma init config with its default value.

Parameters
dma_init_struct : pointer to a dma_init_type structure which will be initialized.
Return values
none

Definition at line 360 of file at32f415_dma.c.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), i2c_lowlevel_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ dma_flag_clear()

void dma_flag_clear ( uint32_t dmax_flag )

clear dma flag

Parameters
dmax_flag this parameter can be one of the following values:
  • DMA1_GL1_FLAG - DMA1_FDT1_FLAG - DMA1_HDT1_FLAG - DMA1_DTERR1_FLAG
  • DMA1_GL2_FLAG - DMA1_FDT2_FLAG - DMA1_HDT2_FLAG - DMA1_DTERR2_FLAG
  • DMA1_GL3_FLAG - DMA1_FDT3_FLAG - DMA1_HDT3_FLAG - DMA1_DTERR3_FLAG
  • DMA1_GL4_FLAG - DMA1_FDT4_FLAG - DMA1_HDT4_FLAG - DMA1_DTERR4_FLAG
  • DMA1_GL5_FLAG - DMA1_FDT5_FLAG - DMA1_HDT5_FLAG - DMA1_DTERR5_FLAG
  • DMA1_GL6_FLAG - DMA1_FDT6_FLAG - DMA1_HDT6_FLAG - DMA1_DTERR6_FLAG
  • DMA1_GL7_FLAG - DMA1_FDT7_FLAG - DMA1_HDT7_FLAG - DMA1_DTERR7_FLAG
  • DMA2_GL1_FLAG - DMA2_FDT1_FLAG - DMA2_HDT1_FLAG - DMA2_DTERR1_FLAG
  • DMA2_GL2_FLAG - DMA2_FDT2_FLAG - DMA2_HDT2_FLAG - DMA2_DTERR2_FLAG
  • DMA2_GL3_FLAG - DMA2_FDT3_FLAG - DMA2_HDT3_FLAG - DMA2_DTERR3_FLAG
  • DMA2_GL4_FLAG - DMA2_FDT4_FLAG - DMA2_HDT4_FLAG - DMA2_DTERR4_FLAG
  • DMA2_GL5_FLAG - DMA2_FDT5_FLAG - DMA2_HDT5_FLAG - DMA2_DTERR5_FLAG
  • DMA2_GL6_FLAG - DMA2_FDT6_FLAG - DMA2_HDT6_FLAG - DMA2_DTERR6_FLAG
  • DMA2_GL7_FLAG - DMA2_FDT7_FLAG - DMA2_HDT7_FLAG - DMA2_DTERR7_FLAG
Return values
none

Definition at line 342 of file at32f415_dma.c.

Referenced by DMA1_Channel1_IRQHandler(), DMA1_Channel2_IRQHandler(), DMA1_Channel3_IRQHandler(), DMA1_Channel4_IRQHandler(), DMA2_Channel1_IRQHandler(), i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), main(), spi_bytes_read(), and spi_bytes_write().

◆ dma_flag_get()

flag_status dma_flag_get ( uint32_t dmax_flag )

get dma flag

Parameters
dmax_flag this parameter can be one of the following values:
  • DMA1_GL1_FLAG - DMA1_FDT1_FLAG - DMA1_HDT1_FLAG - DMA1_DTERR1_FLAG
  • DMA1_GL2_FLAG - DMA1_FDT2_FLAG - DMA1_HDT2_FLAG - DMA1_DTERR2_FLAG
  • DMA1_GL3_FLAG - DMA1_FDT3_FLAG - DMA1_HDT3_FLAG - DMA1_DTERR3_FLAG
  • DMA1_GL4_FLAG - DMA1_FDT4_FLAG - DMA1_HDT4_FLAG - DMA1_DTERR4_FLAG
  • DMA1_GL5_FLAG - DMA1_FDT5_FLAG - DMA1_HDT5_FLAG - DMA1_DTERR5_FLAG
  • DMA1_GL6_FLAG - DMA1_FDT6_FLAG - DMA1_HDT6_FLAG - DMA1_DTERR6_FLAG
  • DMA1_GL7_FLAG - DMA1_FDT7_FLAG - DMA1_HDT7_FLAG - DMA1_DTERR7_FLAG
  • DMA2_GL1_FLAG - DMA2_FDT1_FLAG - DMA2_HDT1_FLAG - DMA2_DTERR1_FLAG
  • DMA2_GL2_FLAG - DMA2_FDT2_FLAG - DMA2_HDT2_FLAG - DMA2_DTERR2_FLAG
  • DMA2_GL3_FLAG - DMA2_FDT3_FLAG - DMA2_HDT3_FLAG - DMA2_DTERR3_FLAG
  • DMA2_GL4_FLAG - DMA2_FDT4_FLAG - DMA2_HDT4_FLAG - DMA2_DTERR4_FLAG
  • DMA2_GL5_FLAG - DMA2_FDT5_FLAG - DMA2_HDT5_FLAG - DMA2_DTERR5_FLAG
  • DMA2_GL6_FLAG - DMA2_FDT6_FLAG - DMA2_HDT6_FLAG - DMA2_DTERR6_FLAG
  • DMA2_GL7_FLAG - DMA2_FDT7_FLAG - DMA2_HDT7_FLAG - DMA2_DTERR7_FLAG
Return values
state of dma flag

Definition at line 296 of file at32f415_dma.c.

Referenced by DMA1_Channel1_IRQHandler(), DMA1_Channel2_IRQHandler(), DMA1_Channel3_IRQHandler(), DMA1_Channel4_IRQHandler(), DMA2_Channel1_IRQHandler(), i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), main(), spi_bytes_read(), and spi_bytes_write().

◆ dma_flexible_config()

void dma_flexible_config | ( | dma_type * | dma_x,
 |  | uint8_t | flex_channelx,
 |  | dma_flexible_request_type | flexible_request
 | ) |  |

initialize the dma_x flexible function according to the specified parameters.

Parameters
dma_x this parameter can be one of the following values:
  • DMA1
  • DMA2
flex_channelx this parameter can be one of the following values:
  • FLEX_CHANNEL1
  • FLEX_CHANNEL2
  • FLEX_CHANNEL3
  • FLEX_CHANNEL4
  • FLEX_CHANNEL5
  • FLEX_CHANNEL6
  • FLEX_CHANNEL7
flexible_request every peripheral have specified hardware_id. this parameter can be one of the following values:
  • DMA_FLEXIBLE_ADC1 - DMA_FLEXIBLE_SPI1_RX - DMA_FLEXIBLE_SPI1_TX - DMA_FLEXIBLE_SPI2_RX
  • DMA_FLEXIBLE_SPI2_TX - DMA_FLEXIBLE_UART1_RX - DMA_FLEXIBLE_UART1_TX - DMA_FLEXIBLE_UART2_RX
  • DMA_FLEXIBLE_UART2_TX - DMA_FLEXIBLE_UART3_RX - DMA_FLEXIBLE_UART3_TX - DMA_FLEXIBLE_UART4_RX
  • DMA_FLEXIBLE_UART4_TX - DMA_FLEXIBLE_UART5_RX - DMA_FLEXIBLE_UART5_TX - DMA_FLEXIBLE_I2C1_RX
  • DMA_FLEXIBLE_I2C1_TX - DMA_FLEXIBLE_I2C2_RX - DMA_FLEXIBLE_I2C2_TX - DMA_FLEXIBLE_SDIO1
  • DMA_FLEXIBLE_TMR1_TRIG - DMA_FLEXIBLE_TMR1_HALL - DMA_FLEXIBLE_TMR1_OVERFLOW- DMA_FLEXIBLE_TMR1_CH1
  • DMA_FLEXIBLE_TMR1_CH2 - DMA_FLEXIBLE_TMR1_CH3 - DMA_FLEXIBLE_TMR1_CH4 - DMA_FLEXIBLE_TMR2_TRIG
  • DMA_FLEXIBLE_TMR2_OVERFLOW- DMA_FLEXIBLE_TMR2_CH1 - DMA_FLEXIBLE_TMR2_CH2 - DMA_FLEXIBLE_TMR2_CH3
  • DMA_FLEXIBLE_TMR2_CH4 - DMA_FLEXIBLE_TMR3_TRIG - DMA_FLEXIBLE_TMR3_OVERFLOW- DMA_FLEXIBLE_TMR3_CH1
  • DMA_FLEXIBLE_TMR3_CH2 - DMA_FLEXIBLE_TMR3_CH3 - DMA_FLEXIBLE_TMR3_CH4 - DMA_FLEXIBLE_TMR4_TRIG
  • DMA_FLEXIBLE_TMR4_OVERFLOW- DMA_FLEXIBLE_TMR4_CH1 - DMA_FLEXIBLE_TMR4_CH2 - DMA_FLEXIBLE_TMR4_CH3
  • DMA_FLEXIBLE_TMR4_CH4 - DMA_FLEXIBLE_TMR5_TRIG - DMA_FLEXIBLE_TMR5_OVERFLOW- DMA_FLEXIBLE_TMR5_CH1
  • DMA_FLEXIBLE_TMR5_CH2 - DMA_FLEXIBLE_TMR5_CH3 - DMA_FLEXIBLE_TMR5_CH4
Return values
none

< dma flexible channel1

< dma flexible channel2

< dma flexible channel3

< dma flexible channel4

< dma flexible channel5

< dma flexible channel6

< dma flexible channel7

Definition at line 236 of file at32f415_dma.c.

Referenced by dma_configuration(), and main().

◆ dma_init()

void dma_init | ( | dma_channel_type * | dmax_channely,
 |  | dma_init_type * | dma_init_struct
 | ) |  |

dma init

Parameters
dmax_channely this parameter can be one of the following values:
  • DMA1_CHANNEL1
  • DMA1_CHANNEL2
  • DMA1_CHANNEL3
  • DMA1_CHANNEL4
  • DMA1_CHANNEL5
  • DMA1_CHANNEL6
  • DMA1_CHANNEL7
  • DMA2_CHANNEL1
  • DMA2_CHANNEL2
  • DMA2_CHANNEL3
  • DMA2_CHANNEL4
  • DMA2_CHANNEL5
  • DMA2_CHANNEL6
  • DMA2_CHANNEL7
dma_initstruct : pointer to a dma_init_type structure.
Return values
none

Definition at line 395 of file at32f415_dma.c.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), i2c_dma_config(), i2c_lowlevel_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ dma_interrupt_enable()

void dma_interrupt_enable | ( | dma_channel_type * | dmax_channely,
 |  | uint32_t | dma_int,
 |  | confirm_state | new_state
 | ) |  |

enable or disable dma interrupt

Parameters
dmax_channely this parameter can be one of the following values:
  • DMA1_CHANNEL1
  • DMA1_CHANNEL2
  • DMA1_CHANNEL3
  • DMA1_CHANNEL4
  • DMA1_CHANNEL5
  • DMA1_CHANNEL6
  • DMA1_CHANNEL7
  • DMA2_CHANNEL1
  • DMA2_CHANNEL2
  • DMA2_CHANNEL3
  • DMA2_CHANNEL4
  • DMA2_CHANNEL5
  • DMA2_CHANNEL6
  • DMA2_CHANNEL7
dma_int this parameter can be any combination of the following values:
  • DMA_FDT_INT
  • DMA_HDT_INT
  • DMA_DTERR_INT
new_state (TRUE or FALSE)
Return values
none

Definition at line 165 of file at32f415_dma.c.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), i2c_dma_config(), i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), and main().

◆ dma_reset()

void dma_reset ( dma_channel_type * dmax_channely )

reset the dmax channely registers.

Parameters
dmax_channely this parameter can be one of the following values:
  • DMA1_CHANNEL1
  • DMA1_CHANNEL2
  • DMA1_CHANNEL3
  • DMA1_CHANNEL4
  • DMA1_CHANNEL5
  • DMA1_CHANNEL6
  • DMA1_CHANNEL7
  • DMA2_CHANNEL1
  • DMA2_CHANNEL2
  • DMA2_CHANNEL3
  • DMA2_CHANNEL4
  • DMA2_CHANNEL5
  • DMA2_CHANNEL6
  • DMA2_CHANNEL7
Return values
none

Definition at line 64 of file at32f415_dma.c.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), i2c_lowlevel_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().


AT32F415 Firmwary Library: ERTC

Modules | Macros
ERTC
AT32F415_periph_driver

ERTC driver modules. More...

Modules

ERTC_interrupts_definition
ertc interrupt

ERTC_flags_definition
ertc flag

ERTC_exported_types
ERTC_exported_functions
ERTC_private_functions

Macros

#define ERTC ((ertc_type *) ERTC_BASE)

Detailed Description

ERTC driver modules.

Macro Definition Documentation

◆ ERTC

#define ERTC ((ertc_type *) ERTC_BASE)

Definition at line 1118 of file at32f415_ertc.h.


AT32F415 Firmwary Library: ERTC_interrupts_definition

Macros
ERTC_interrupts_definition
AT32F415_periph_driver » ERTC

ertc interrupt
More...

Macros

#define | ERTC_TP_INT ((uint32_t)0x00000004)
#define | ERTC_ALA_INT ((uint32_t)0x00001000)
#define | ERTC_ALB_INT ((uint32_t)0x00002000)
#define | ERTC_WAT_INT ((uint32_t)0x00004000)
#define | ERTC_TS_INT ((uint32_t)0x00008000)

Detailed Description

ertc interrupt

Macro Definition Documentation

◆ ERTC_ALA_INT

#define ERTC_ALA_INT ((uint32_t)0x00001000)

ertc alarm a interrupt

Definition at line 53 of file at32f415_ertc.h.

◆ ERTC_ALB_INT

#define ERTC_ALB_INT ((uint32_t)0x00002000)

ertc alarm b interrupt

Definition at line 54 of file at32f415_ertc.h.

◆ ERTC_TP_INT

#define ERTC_TP_INT ((uint32_t)0x00000004)

ertc tamper interrupt

Definition at line 52 of file at32f415_ertc.h.

◆ ERTC_TS_INT

#define ERTC_TS_INT ((uint32_t)0x00008000)

ertc timestamp interrupt

Definition at line 56 of file at32f415_ertc.h.

◆ ERTC_WAT_INT

#define ERTC_WAT_INT ((uint32_t)0x00004000)

ertc wakeup timer interrupt

Definition at line 55 of file at32f415_ertc.h.


AT32F415 Firmwary Library: ERTC_flags_definition

Macros
ERTC_flags_definition
AT32F415_periph_driver » ERTC

ertc flag
More...

Macros

#define | ERTC_ALAWF_FLAG ((uint32_t)0x00000001)
#define | ERTC_ALBWF_FLAG ((uint32_t)0x00000002)
#define | ERTC_WATWF_FLAG ((uint32_t)0x00000004)
#define | ERTC_TADJF_FLAG ((uint32_t)0x00000008)
#define | ERTC_INITF_FLAG ((uint32_t)0x00000010)
#define | ERTC_UPDF_FLAG ((uint32_t)0x00000020)
#define | ERTC_IMF_FLAG ((uint32_t)0x00000040)
#define | ERTC_ALAF_FLAG ((uint32_t)0x00000100)
#define | ERTC_ALBF_FLAG ((uint32_t)0x00000200)
#define | ERTC_WATF_FLAG ((uint32_t)0x00000400)
#define | ERTC_TSF_FLAG ((uint32_t)0x00000800)
#define | ERTC_TSOF_FLAG ((uint32_t)0x00001000)
#define | ERTC_TP1F_FLAG ((uint32_t)0x00002000)
#define | ERTC_CALUPDF_FLAG ((uint32_t)0x00010000)
#define | ERTC_ALARM_MASK_NONE ((uint32_t)0x00000000)
ertc alarm mask More...
#define | ERTC_ALARM_MASK_SEC ((uint32_t)0x00000080)
#define | ERTC_ALARM_MASK_MIN ((uint32_t)0x00008000)
#define | ERTC_ALARM_MASK_HOUR ((uint32_t)0x00800000)
#define | ERTC_ALARM_MASK_DATE_WEEK ((uint32_t)0x80000000)
#define | ERTC_ALARM_MASK_ALL ((uint32_t)0x80808080)

Detailed Description

ertc flag

Macro Definition Documentation

◆ ERTC_ALAF_FLAG

#define ERTC_ALAF_FLAG ((uint32_t)0x00000100)

ertc alarm clock a flag

Definition at line 74 of file at32f415_ertc.h.

◆ ERTC_ALARM_MASK_ALL

#define ERTC_ALARM_MASK_ALL ((uint32_t)0x80808080)

ertc alarm don't match all

Definition at line 90 of file at32f415_ertc.h.

◆ ERTC_ALARM_MASK_DATE_WEEK

#define ERTC_ALARM_MASK_DATE_WEEK ((uint32_t)0x80000000)

ertc alarm don't match date or week

Definition at line 89 of file at32f415_ertc.h.

◆ ERTC_ALARM_MASK_HOUR

#define ERTC_ALARM_MASK_HOUR ((uint32_t)0x00800000)

ertc alarm don't match hour

Definition at line 88 of file at32f415_ertc.h.

◆ ERTC_ALARM_MASK_MIN

#define ERTC_ALARM_MASK_MIN ((uint32_t)0x00008000)

ertc alarm don't match minute

Definition at line 87 of file at32f415_ertc.h.

◆ ERTC_ALARM_MASK_NONE

#define ERTC_ALARM_MASK_NONE ((uint32_t)0x00000000)

ertc alarm mask

ertc alarm match all

Definition at line 85 of file at32f415_ertc.h.

◆ ERTC_ALARM_MASK_SEC

#define ERTC_ALARM_MASK_SEC ((uint32_t)0x00000080)

ertc alarm don't match seconds

Definition at line 86 of file at32f415_ertc.h.

◆ ERTC_ALAWF_FLAG

#define ERTC_ALAWF_FLAG ((uint32_t)0x00000001)

ertc alarm a register allows write flag

Definition at line 67 of file at32f415_ertc.h.

◆ ERTC_ALBF_FLAG

#define ERTC_ALBF_FLAG ((uint32_t)0x00000200)

ertc alarm clock b flag

Definition at line 75 of file at32f415_ertc.h.

◆ ERTC_ALBWF_FLAG

#define ERTC_ALBWF_FLAG ((uint32_t)0x00000002)

ertc alarm b register allows write flag

Definition at line 68 of file at32f415_ertc.h.

◆ ERTC_CALUPDF_FLAG

#define ERTC_CALUPDF_FLAG ((uint32_t)0x00010000)

ertc calibration value update completed flag

Definition at line 80 of file at32f415_ertc.h.

◆ ERTC_IMF_FLAG

#define ERTC_IMF_FLAG ((uint32_t)0x00000040)

ertc enter initialization mode flag

Definition at line 73 of file at32f415_ertc.h.

◆ ERTC_INITF_FLAG

#define ERTC_INITF_FLAG ((uint32_t)0x00000010)

ertc calendar initialization flag

Definition at line 71 of file at32f415_ertc.h.

◆ ERTC_TADJF_FLAG

#define ERTC_TADJF_FLAG ((uint32_t)0x00000008)

ertc time adjustment flag

Definition at line 70 of file at32f415_ertc.h.

◆ ERTC_TP1F_FLAG

#define ERTC_TP1F_FLAG ((uint32_t)0x00002000)

ertc tamper detection 1 flag

Definition at line 79 of file at32f415_ertc.h.

◆ ERTC_TSF_FLAG

#define ERTC_TSF_FLAG ((uint32_t)0x00000800)

ertc timestamp flag

Definition at line 77 of file at32f415_ertc.h.

◆ ERTC_TSOF_FLAG

#define ERTC_TSOF_FLAG ((uint32_t)0x00001000)

ertc timestamp overflow flag

Definition at line 78 of file at32f415_ertc.h.

◆ ERTC_UPDF_FLAG

#define ERTC_UPDF_FLAG ((uint32_t)0x00000020)

ertc calendar update flag

Definition at line 72 of file at32f415_ertc.h.

◆ ERTC_WATF_FLAG

#define ERTC_WATF_FLAG ((uint32_t)0x00000400)

ertc wakeup timer flag

Definition at line 76 of file at32f415_ertc.h.

◆ ERTC_WATWF_FLAG

#define ERTC_WATWF_FLAG ((uint32_t)0x00000004)

ertc wakeup timer register allows write flag

Definition at line 69 of file at32f415_ertc.h.


AT32F415 Firmwary Library: ERTC_exported_types

Data Structures | Enumerations
ERTC_exported_types
AT32F415_periph_driver » ERTC

Data Structures

struct | ertc_time_type
ertc time More...
struct | ertc_alarm_value_type
ertc alarm More...
union | ertc_reg_time_type
ertc time reg union More...
union | ertc_reg_date_type
ertc date reg union More...
union | ertc_reg_alarm_type
ertc alarm reg union More...
union | ertc_reg_scal_type
ertc scal reg union More...
union | ertc_reg_tadj_type
ertc tadj reg union More...
union | ertc_reg_tstm_type
ertc tstm reg union More...
union | ertc_reg_tsdt_type
ertc tsdt register, offset:0x34 More...
struct | ertc_type
type define ertc register all More...

Enumerations

enum | ertc_hour_mode_set_type { ERTC_HOUR_MODE_24 = 0x00 , ERTC_HOUR_MODE_12 = 0x01 }
ertc hour mode More...
enum | ertc_am_pm_type { ERTC_24H = 0x00 , ERTC_AM = 0x00 , ERTC_PM = 0x01 }
ertc 12-hour format am/pm More...
enum | ertc_week_date_select_type { ERTC_SLECT_DATE = 0x00 , ERTC_SLECT_WEEK = 0x01 }
ertc week or date select More...
enum | ertc_alarm_type { ERTC_ALA = 0x00 , ERTC_ALB = 0x01 }
ertc alarm x select More...
enum ertc_alarm_sbs_mask_type {
ERTC_ALARM_SBS_MASK_ALL = 0x00 , ERTC_ALARM_SBS_MASK_14_1 = 0x01 , ERTC_ALARM_SBS_MASK_14_2 = 0x02 , ERTC_ALARM_SBS_MASK_14_3 = 0x03 ,
ERTC_ALARM_SBS_MASK_14_4 = 0x04 , ERTC_ALARM_SBS_MASK_14_5 = 0x05 , ERTC_ALARM_SBS_MASK_14_6 = 0x06 , ERTC_ALARM_SBS_MASK_14_7 = 0x07 ,
ERTC_ALARM_SBS_MASK_14_8 = 0x08 , ERTC_ALARM_SBS_MASK_14_9 = 0x09 , ERTC_ALARM_SBS_MASK_14_10 = 0x0A , ERTC_ALARM_SBS_MASK_14_11 = 0x0B ,
ERTC_ALARM_SBS_MASK_14_12 = 0x0C , ERTC_ALARM_SBS_MASK_14_13 = 0x0D , ERTC_ALARM_SBS_MASK_14 = 0x0E , ERTC_ALARM_SBS_MASK_NONE = 0x0F
}
ertc alarm sub second mask More...
enum ertc_wakeup_clock_type {
ERTC_WAT_CLK_ERTCCLK_DIV16 = 0x00 , ERTC_WAT_CLK_ERTCCLK_DIV8 = 0x01 , ERTC_WAT_CLK_ERTCCLK_DIV4 = 0x02 , ERTC_WAT_CLK_ERTCCLK_DIV2 = 0x03 ,
ERTC_WAT_CLK_CK_A_16BITS = 0x04 , ERTC_WAT_CLK_CK_A_17BITS = 0x06
}
ertc wakeup timer clock select More...
enum | ertc_smooth_cal_period_type { ERTC_SMOOTH_CAL_PERIOD_32 = 0x00 , ERTC_SMOOTH_CAL_PERIOD_16 = 0x01 , ERTC_SMOOTH_CAL_PERIOD_8 = 0x02 }
ertc smooth calibration period More...
enum | ertc_smooth_cal_clk_add_type { ERTC_SMOOTH_CAL_CLK_ADD_0 = 0x00 , ERTC_SMOOTH_CAL_CLK_ADD_512 = 0x01 }
ertc smooth calibration clock add mode More...
enum | ertc_cal_direction_type { ERTC_CAL_DIR_POSITIVE = 0x00 , ERTC_CAL_DIR_NEGATIVE = 0x01 }
ertc calibration direction mode More...
enum | ertc_cal_output_select_type { ERTC_CAL_OUTPUT_512HZ = 0x00 , ERTC_CAL_OUTPUT_1HZ = 0x01 }
ertc calibration output mode More...
enum | ertc_time_adjust_type { ERTC_TIME_ADD_NONE = 0x00 , ERTC_TIME_ADD_1S = 0x01 }
time adjust add mode More...
enum | ertc_dst_operation_type { ERTC_DST_ADD_1H = 0x00 , ERTC_DST_DEC_1H = 0x01 }
ertc daylight saving time hour adjustment mode More...
enum | ertc_dst_save_type { ERTC_DST_SAVE_0 = 0x00 , ERTC_DST_SAVE_1 = 0x01 }
ertc daylight saving time store operation mode More...
enum | ertc_output_source_type { ERTC_OUTPUT_DISABLE = 0x00 , ERTC_OUTPUT_ALARM_A = 0x01 , ERTC_OUTPUT_ALARM_B = 0x02 , ERTC_OUTPUT_WAKEUP = 0x03 }
output source More...
enum | ertc_output_polarity_type { ERTC_OUTPUT_POLARITY_HIGH = 0x00 , ERTC_OUTPUT_POLARITY_LOW = 0x01 }
output polarity More...
enum | ertc_output_type { ERTC_OUTPUT_TYPE_OPEN_DRAIN = 0x00 , ERTC_OUTPUT_TYPE_PUSH_PULL = 0x01 }
output type More...
enum | ertc_pin_select_type { ERTC_PIN_PC13 = 0x00 , ERTC_PIN_PA0 = 0x01 }
timestamp/ tamper detection pin selection More...
enum | ertc_timestamp_valid_edge_type { ERTC_TIMESTAMP_EDGE_RISING = 0x00 , ERTC_TIMESTAMP_EDGE_FALLING = 0x01 }
ertc timestamp valid edge More...
enum | ertc_tamper_select_type { ERTC_TAMPER_1 = 0x00 }
ertc tamper x select More...
enum | ertc_tamper_precharge_type { ERTC_TAMPER_PR_1_ERTCCLK = 0x00 , ERTC_TAMPER_PR_2_ERTCCLK = 0x01 , ERTC_TAMPER_PR_4_ERTCCLK = 0x02 , ERTC_TAMPER_PR_8_ERTCCLK = 0x03 }
tamper detection pre-charge time More...
enum | ertc_tamper_filter_type { ERTC_TAMPER_FILTER_DISABLE = 0x00 , ERTC_TAMPER_FILTER_2 = 0x01 , ERTC_TAMPER_FILTER_4 = 0x02 , ERTC_TAMPER_FILTER_8 = 0x03 }
ertc tamper filter More...
enum ertc_tamper_detect_freq_type {
ERTC_TAMPER_FREQ_DIV_32768 = 0x00 , ERTC_TAMPER_FREQ_DIV_16384 = 0x01 , ERTC_TAMPER_FREQ_DIV_8192 = 0x02 , ERTC_TAMPER_FREQ_DIV_4096 = 0x03 ,
ERTC_TAMPER_FREQ_DIV_2048 = 0x04 , ERTC_TAMPER_FREQ_DIV_1024 = 0x05 , ERTC_TAMPER_FREQ_DIV_512 = 0x06 , ERTC_TAMPER_FREQ_DIV_256 = 0x07
}
ertc tamper detection frequency More...
enum | ertc_tamper_valid_edge_type { ERTC_TAMPER_EDGE_RISING = 0x00 , ERTC_TAMPER_EDGE_FALLING = 0x01 , ERTC_TAMPER_EDGE_LOW = 0x00 , ERTC_TAMPER_EDGE_HIGH = 0x01 }
ertc tamper valid edge More...
enum ertc_dt_type {
ERTC_DT1 = 0 , ERTC_DT2 = 1 , ERTC_DT3 = 2 , ERTC_DT4 = 3 ,
ERTC_DT5 = 4 , ERTC_DT6 = 5 , ERTC_DT7 = 6 , ERTC_DT8 = 7 ,
ERTC_DT9 = 8 , ERTC_DT10 = 9 , ERTC_DT11 = 10 , ERTC_DT12 = 11 ,
ERTC_DT13 = 12 , ERTC_DT14 = 13 , ERTC_DT15 = 14 , ERTC_DT16 = 15 ,
ERTC_DT17 = 16 , ERTC_DT18 = 17 , ERTC_DT19 = 18 , ERTC_DT20 = 19
}
ertc bpr register More...

Detailed Description

Enumeration Type Documentation

◆ ertc_alarm_sbs_mask_type

enum ertc_alarm_sbs_mask_type

ertc alarm sub second mask

Enumerator
ERTC_ALARM_SBS_MASK_ALL | do not match the sub-second
ERTC_ALARM_SBS_MASK_14_1 | only compare bit [0]
ERTC_ALARM_SBS_MASK_14_2 | only compare bit [1:0]
ERTC_ALARM_SBS_MASK_14_3 | only compare bit [2:0]
ERTC_ALARM_SBS_MASK_14_4 | only compare bit [3:0]
ERTC_ALARM_SBS_MASK_14_5 | only compare bit [4:0]
ERTC_ALARM_SBS_MASK_14_6 | only compare bit [5:0]
ERTC_ALARM_SBS_MASK_14_7 | only compare bit [6:0]
ERTC_ALARM_SBS_MASK_14_8 | only compare bit [7:0]
ERTC_ALARM_SBS_MASK_14_9 | only compare bit [8:0]
ERTC_ALARM_SBS_MASK_14_10 | only compare bit [9:0]
ERTC_ALARM_SBS_MASK_14_11 | only compare bit [10:0]
ERTC_ALARM_SBS_MASK_14_12 | only compare bit [11:0]
ERTC_ALARM_SBS_MASK_14_13 | only compare bit [12:0]
ERTC_ALARM_SBS_MASK_14 | only compare bit [13:0]
ERTC_ALARM_SBS_MASK_NONE | compare bit [14:0]

Definition at line 140 of file at32f415_ertc.h.

◆ ertc_alarm_type

enum ertc_alarm_type

ertc alarm x select

Enumerator
ERTC_ALA | select alarm a
ERTC_ALB | select alarm b

Definition at line 131 of file at32f415_ertc.h.

◆ ertc_am_pm_type

enum ertc_am_pm_type

ertc 12-hour format am/pm

Enumerator
ERTC_24H | 24-hour format
ERTC_AM | 12-hour format, ante meridiem
ERTC_PM | 12-hour format, meridiem

Definition at line 112 of file at32f415_ertc.h.

◆ ertc_cal_direction_type

enum ertc_cal_direction_type

ertc calibration direction mode

Enumerator
ERTC_CAL_DIR_POSITIVE | positive calibration
ERTC_CAL_DIR_NEGATIVE | negative calibration

Definition at line 195 of file at32f415_ertc.h.

◆ ertc_cal_output_select_type

enum ertc_cal_output_select_type

ertc calibration output mode

Enumerator
ERTC_CAL_OUTPUT_512HZ | output 512 hz
ERTC_CAL_OUTPUT_1HZ | output 1 hz

Definition at line 204 of file at32f415_ertc.h.

◆ ertc_dst_operation_type

enum ertc_dst_operation_type

ertc daylight saving time hour adjustment mode

Enumerator
ERTC_DST_ADD_1H | add 1 hour
ERTC_DST_DEC_1H | dec 1 hour

Definition at line 222 of file at32f415_ertc.h.

◆ ertc_dst_save_type

enum ertc_dst_save_type

ertc daylight saving time store operation mode

Enumerator
ERTC_DST_SAVE_0 | set the bpr register value to 0
ERTC_DST_SAVE_1 | set the bpr register value to 1

Definition at line 231 of file at32f415_ertc.h.

◆ ertc_dt_type

enum ertc_dt_type

ertc bpr register

Enumerator
ERTC_DT1 | bpr data register 0
ERTC_DT2 | bpr data register 1
ERTC_DT3 | bpr data register 2
ERTC_DT4 | bpr data register 3
ERTC_DT5 | bpr data register 4
ERTC_DT6 | bpr data register 5
ERTC_DT7 | bpr data register 6
ERTC_DT8 | bpr data register 7
ERTC_DT9 | bpr data register 8
ERTC_DT10 | bpr data register 9
ERTC_DT11 | bpr data register 10
ERTC_DT12 | bpr data register 11
ERTC_DT13 | bpr data register 12
ERTC_DT14 | bpr data register 13
ERTC_DT15 | bpr data register 14
ERTC_DT16 | bpr data register 15
ERTC_DT17 | bpr data register 16
ERTC_DT18 | bpr data register 17
ERTC_DT19 | bpr data register 18
ERTC_DT20 | bpr data register 19

Definition at line 343 of file at32f415_ertc.h.

◆ ertc_hour_mode_set_type

enum ertc_hour_mode_set_type

ertc hour mode

Enumerator
ERTC_HOUR_MODE_24 | 24-hour format
ERTC_HOUR_MODE_12 | 12-hour format

Definition at line 103 of file at32f415_ertc.h.

◆ ertc_output_polarity_type

enum ertc_output_polarity_type

output polarity

Enumerator
ERTC_OUTPUT_POLARITY_HIGH | when the event occurs, the output is high
ERTC_OUTPUT_POLARITY_LOW | when the event occurs, the output is low

Definition at line 251 of file at32f415_ertc.h.

◆ ertc_output_source_type

enum ertc_output_source_type

output source

Enumerator
ERTC_OUTPUT_DISABLE | diable output
ERTC_OUTPUT_ALARM_A | output alarm a event
ERTC_OUTPUT_ALARM_B | output alarm b event
ERTC_OUTPUT_WAKEUP | output wakeup event

Definition at line 240 of file at32f415_ertc.h.

◆ ertc_output_type

enum ertc_output_type

output type

Enumerator
ERTC_OUTPUT_TYPE_OPEN_DRAIN | open drain output
ERTC_OUTPUT_TYPE_PUSH_PULL | push pull output

Definition at line 260 of file at32f415_ertc.h.

◆ ertc_pin_select_type

enum ertc_pin_select_type

timestamp/ tamper detection pin selection

Enumerator
ERTC_PIN_PC13 | pc13 is used as timestamp detection pin
ERTC_PIN_PA0 | pa0 is used as timestamp detection pin

Definition at line 269 of file at32f415_ertc.h.

◆ ertc_smooth_cal_clk_add_type

enum ertc_smooth_cal_clk_add_type

ertc smooth calibration clock add mode

Enumerator
ERTC_SMOOTH_CAL_CLK_ADD_0 | do not increase clock
ERTC_SMOOTH_CAL_CLK_ADD_512 | add 512 clocks

Definition at line 186 of file at32f415_ertc.h.

◆ ertc_smooth_cal_period_type

enum ertc_smooth_cal_period_type

ertc smooth calibration period

Enumerator
ERTC_SMOOTH_CAL_PERIOD_32 | 32 second calibration period
ERTC_SMOOTH_CAL_PERIOD_16 | 16 second calibration period
ERTC_SMOOTH_CAL_PERIOD_8 | 8 second calibration period

Definition at line 176 of file at32f415_ertc.h.

◆ ertc_tamper_detect_freq_type

enum ertc_tamper_detect_freq_type

ertc tamper detection frequency

Enumerator
ERTC_TAMPER_FREQ_DIV_32768 | ERTC_CLK / 32768
ERTC_TAMPER_FREQ_DIV_16384 | ERTC_CLK / 16384
ERTC_TAMPER_FREQ_DIV_8192 | ERTC_CLK / 8192
ERTC_TAMPER_FREQ_DIV_4096 | ERTC_CLK / 4096
ERTC_TAMPER_FREQ_DIV_2048 | ERTC_CLK / 2048
ERTC_TAMPER_FREQ_DIV_1024 | ERTC_CLK / 1024
ERTC_TAMPER_FREQ_DIV_512 | ERTC_CLK / 512
ERTC_TAMPER_FREQ_DIV_256 | ERTC_CLK / 256

Definition at line 317 of file at32f415_ertc.h.

◆ ertc_tamper_filter_type

enum ertc_tamper_filter_type

ertc tamper filter

Enumerator
ERTC_TAMPER_FILTER_DISABLE | disable filter function
ERTC_TAMPER_FILTER_2 | 2 consecutive samples arw valid, effective tamper event
ERTC_TAMPER_FILTER_4 | 4 consecutive samples arw valid, effective tamper event
ERTC_TAMPER_FILTER_8 | 8 consecutive samples arw valid, effective tamper event

Definition at line 306 of file at32f415_ertc.h.

◆ ertc_tamper_precharge_type

enum ertc_tamper_precharge_type

tamper detection pre-charge time

Enumerator
ERTC_TAMPER_PR_1_ERTCCLK | pre-charge time is 1 ERTC_CLK
ERTC_TAMPER_PR_2_ERTCCLK | pre-charge time is 2 ERTC_CLK
ERTC_TAMPER_PR_4_ERTCCLK | pre-charge time is 4 ERTC_CLK
ERTC_TAMPER_PR_8_ERTCCLK | pre-charge time is 8 ERTC_CLK

Definition at line 295 of file at32f415_ertc.h.

◆ ertc_tamper_select_type

enum ertc_tamper_select_type

ertc tamper x select

Enumerator
ERTC_TAMPER_1

tamper 1

Definition at line 287 of file at32f415_ertc.h.

◆ ertc_tamper_valid_edge_type

enum ertc_tamper_valid_edge_type

ertc tamper valid edge

Enumerator
ERTC_TAMPER_EDGE_RISING | rising gedge
ERTC_TAMPER_EDGE_FALLING | falling gedge
ERTC_TAMPER_EDGE_LOW | low level
ERTC_TAMPER_EDGE_HIGH | high level

Definition at line 332 of file at32f415_ertc.h.

◆ ertc_time_adjust_type

enum ertc_time_adjust_type

time adjust add mode

Enumerator
ERTC_TIME_ADD_NONE | none operation
ERTC_TIME_ADD_1S | add 1 second

Definition at line 213 of file at32f415_ertc.h.

◆ ertc_timestamp_valid_edge_type

enum ertc_timestamp_valid_edge_type

ertc timestamp valid edge

Enumerator
ERTC_TIMESTAMP_EDGE_RISING | rising edge trigger
ERTC_TIMESTAMP_EDGE_FALLING | falling edge trigger

Definition at line 278 of file at32f415_ertc.h.

◆ ertc_wakeup_clock_type

enum ertc_wakeup_clock_type

ertc wakeup timer clock select

Enumerator
ERTC_WAT_CLK_ERTCCLK_DIV16 | the wake up timer clock is ERTC_CLK / 16
ERTC_WAT_CLK_ERTCCLK_DIV8 | the wake up timer clock is ERTC_CLK / 8
ERTC_WAT_CLK_ERTCCLK_DIV4 | the wake up timer clock is ERTC_CLK / 4
ERTC_WAT_CLK_ERTCCLK_DIV2 | the wake up timer clock is ERTC_CLK / 2
ERTC_WAT_CLK_CK_A_16BITS | the wake up timer clock is CK_A, wakeup counter = ERTC_WAT
ERTC_WAT_CLK_CK_A_17BITS | the wake up timer clock is CK_A, wakeup counter = ERTC_WAT + 65535

Definition at line 163 of file at32f415_ertc.h.

◆ ertc_week_date_select_type

enum ertc_week_date_select_type

ertc week or date select

Enumerator
ERTC_SLECT_DATE | slect date mode
ERTC_SLECT_WEEK | slect week mode

Definition at line 122 of file at32f415_ertc.h.


AT32F415 Firmwary Library: ertc_time_type Struct Reference

Data Fields
ertc_time_type Struct Reference
AT32F415_periph_driver » ERTC » ERTC_exported_types

ertc time More...

#include <at32f415_ertc.h>

Data Fields

uint8_t | year
uint8_t | month
uint8_t | day
uint8_t | hour
uint8_t | min
uint8_t | sec
uint8_t | week
ertc_am_pm_type ampm

Detailed Description

ertc time

Definition at line 370 of file at32f415_ertc.h.

Field Documentation

◆ ampm

ertc_am_pm_type ertc_time_type::ampm

ante meridiem / post meridiem

Definition at line 379 of file at32f415_ertc.h.

Referenced by ertc_alarm_value_set(), ertc_calendar_get(), and ertc_timestamp_get().

◆ day

uint8_t ertc_time_type::day

date

Definition at line 374 of file at32f415_ertc.h.

Referenced by ertc_alarm_value_set(), ertc_calendar_get(), ertc_time_show(), ertc_timestamp_get(), ertc_timestamp_show(), and main().

◆ hour

uint8_t ertc_time_type::hour

hour

Definition at line 375 of file at32f415_ertc.h.

Referenced by ertc_alarm_value_set(), ertc_calendar_get(), ertc_time_show(), ertc_timestamp_get(), ertc_timestamp_show(), and main().

◆ min

uint8_t ertc_time_type::min

minute

Definition at line 376 of file at32f415_ertc.h.

Referenced by ertc_alarm_value_set(), ertc_calendar_get(), ertc_time_show(), ertc_timestamp_get(), ertc_timestamp_show(), and main().

◆ month

uint8_t ertc_time_type::month

month

Definition at line 373 of file at32f415_ertc.h.

Referenced by ertc_calendar_get(), ertc_time_show(), ertc_timestamp_get(), ertc_timestamp_show(), and main().

◆ sec

uint8_t ertc_time_type::sec

second

Definition at line 377 of file at32f415_ertc.h.

Referenced by ertc_alarm_value_set(), ertc_calendar_get(), ertc_time_show(), ertc_timestamp_get(), ertc_timestamp_show(), and main().

◆ week

uint8_t ertc_time_type::week

week

Definition at line 378 of file at32f415_ertc.h.

Referenced by ertc_calendar_get(), and ertc_timestamp_get().

◆ year

uint8_t ertc_time_type::year

year

Definition at line 372 of file at32f415_ertc.h.

Referenced by ertc_calendar_get(), ertc_time_show(), ertc_timestamp_get(), and main().

The documentation for this struct was generated from the following file:
  • at32f415_ertc.h


AT32F415 Firmwary Library: ertc_alarm_value_type Struct Reference

Data Fields
ertc_alarm_value_type Struct Reference
AT32F415_periph_driver » ERTC » ERTC_exported_types

ertc alarm More...

#include <at32f415_ertc.h>

Data Fields

uint8_t | day
uint8_t | hour
uint8_t | min
uint8_t | sec
ertc_am_pm_type ampm
uint32_t | mask
uint8_t | week_date_sel
uint8_t | week

Detailed Description

ertc alarm

Definition at line 385 of file at32f415_ertc.h.

Field Documentation

◆ ampm

ertc_am_pm_type ertc_alarm_value_type::ampm

ante meridiem / post meridiem

Definition at line 391 of file at32f415_ertc.h.

Referenced by ertc_alarm_get().

◆ day

uint8_t ertc_alarm_value_type::day

date

Definition at line 387 of file at32f415_ertc.h.

Referenced by ertc_alarm_get().

◆ hour

uint8_t ertc_alarm_value_type::hour

hour

Definition at line 388 of file at32f415_ertc.h.

Referenced by ertc_alarm_get(), and ertc_alarm_show().

◆ mask

uint32_t ertc_alarm_value_type::mask

alarm mask

Definition at line 392 of file at32f415_ertc.h.

Referenced by ertc_alarm_get().

◆ min

uint8_t ertc_alarm_value_type::min

minute

Definition at line 389 of file at32f415_ertc.h.

Referenced by ertc_alarm_get(), and ertc_alarm_show().

◆ sec

uint8_t ertc_alarm_value_type::sec

second

Definition at line 390 of file at32f415_ertc.h.

Referenced by ertc_alarm_get(), and ertc_alarm_show().

◆ week

uint8_t ertc_alarm_value_type::week

week

Definition at line 394 of file at32f415_ertc.h.

Referenced by ertc_alarm_get().

◆ week_date_sel

uint8_t ertc_alarm_value_type::week_date_sel

week or date mode

Definition at line 393 of file at32f415_ertc.h.

Referenced by ertc_alarm_get().

The documentation for this struct was generated from the following file:
  • at32f415_ertc.h


AT32F415 Firmwary Library: ertc_reg_time_type Union Reference

Data Fields
ertc_reg_time_type Union Reference
AT32F415_periph_driver » ERTC » ERTC_exported_types

ertc time reg union More...

#include <at32f415_ertc.h>

Data Fields

__IO uint32_t time
struct {
__IO uint32_t s: 7
__IO uint32_t reserved1: 1
__IO uint32_t m: 7
__IO uint32_t reserved2: 1
__IO uint32_t h: 6
__IO uint32_t ampm: 1
__IO uint32_t reserved3: 9
} time_bit

Detailed Description

ertc time reg union

Definition at line 400 of file at32f415_ertc.h.

Field Documentation

◆ ampm

__IO uint32_t ertc_reg_time_type::ampm

Definition at line 410 of file at32f415_ertc.h.

Referenced by ertc_calendar_get(), and ertc_time_set().

◆ h

__IO uint32_t ertc_reg_time_type::h

Definition at line 409 of file at32f415_ertc.h.

Referenced by ertc_calendar_get(), and ertc_time_set().

◆ m

__IO uint32_t ertc_reg_time_type::m

Definition at line 407 of file at32f415_ertc.h.

Referenced by ertc_calendar_get(), and ertc_time_set().

◆ reserved1

__IO uint32_t ertc_reg_time_type::reserved1

Definition at line 406 of file at32f415_ertc.h.

◆ reserved2

__IO uint32_t ertc_reg_time_type::reserved2

Definition at line 408 of file at32f415_ertc.h.

◆ reserved3

__IO uint32_t ertc_reg_time_type::reserved3

Definition at line 411 of file at32f415_ertc.h.

◆ s

__IO uint32_t ertc_reg_time_type::s

Definition at line 405 of file at32f415_ertc.h.

Referenced by ertc_calendar_get(), and ertc_time_set().

◆ time

__IO uint32_t ertc_reg_time_type::time

Definition at line 402 of file at32f415_ertc.h.

Referenced by ertc_calendar_get(), and ertc_time_set().

◆

struct { ... } ertc_reg_time_type::time_bit

Referenced by ertc_calendar_get(), and ertc_time_set().

The documentation for this union was generated from the following file:
  • at32f415_ertc.h


AT32F415 Firmwary Library: ertc_reg_date_type Union Reference

Data Fields
ertc_reg_date_type Union Reference
AT32F415_periph_driver » ERTC » ERTC_exported_types

ertc date reg union More...

#include <at32f415_ertc.h>

Data Fields

__IO uint32_t date
struct {
__IO uint32_t d:6
__IO uint32_t reserved1:2
__IO uint32_t m:5
__IO uint32_t wk:3
__IO uint32_t y:8
__IO uint32_t reserved2:8
} date_bit

Detailed Description

ertc date reg union

Definition at line 418 of file at32f415_ertc.h.

Field Documentation

◆ d

__IO uint32_t ertc_reg_date_type::d

Definition at line 423 of file at32f415_ertc.h.

Referenced by ertc_calendar_get(), and ertc_date_set().

◆ date

__IO uint32_t ertc_reg_date_type::date

Definition at line 420 of file at32f415_ertc.h.

Referenced by ertc_calendar_get(), and ertc_date_set().

◆

struct { ... } ertc_reg_date_type::date_bit

Referenced by ertc_calendar_get(), and ertc_date_set().

◆ m

__IO uint32_t ertc_reg_date_type::m

Definition at line 425 of file at32f415_ertc.h.

Referenced by ertc_calendar_get(), and ertc_date_set().

◆ reserved1

__IO uint32_t ertc_reg_date_type::reserved1

Definition at line 424 of file at32f415_ertc.h.

◆ reserved2

__IO uint32_t ertc_reg_date_type::reserved2

Definition at line 428 of file at32f415_ertc.h.

◆ wk

__IO uint32_t ertc_reg_date_type::wk

Definition at line 426 of file at32f415_ertc.h.

Referenced by ertc_calendar_get(), and ertc_date_set().

◆ y

__IO uint32_t ertc_reg_date_type::y

Definition at line 427 of file at32f415_ertc.h.

Referenced by ertc_calendar_get(), and ertc_date_set().

The documentation for this union was generated from the following file:
  • at32f415_ertc.h


AT32F415 Firmwary Library: ertc_reg_alarm_type Union Reference

Data Fields
ertc_reg_alarm_type Union Reference
AT32F415_periph_driver » ERTC » ERTC_exported_types

ertc alarm reg union More...

#include <at32f415_ertc.h>

Data Fields

__IO uint32_t ala
struct {
__IO uint32_t s:7
__IO uint32_t mask1:1
__IO uint32_t m:7
__IO uint32_t mask2:1
__IO uint32_t h:6
__IO uint32_t ampm:1
__IO uint32_t mask3:1
__IO uint32_t d:6
__IO uint32_t wksel:1
__IO uint32_t mask4:1
} ala_bit

Detailed Description

ertc alarm reg union

Definition at line 435 of file at32f415_ertc.h.

Field Documentation

◆ ala

__IO uint32_t ertc_reg_alarm_type::ala

Definition at line 437 of file at32f415_ertc.h.

Referenced by ertc_alarm_get(), and ertc_alarm_set().

◆

struct { ... } ertc_reg_alarm_type::ala_bit

Referenced by ertc_alarm_get(), and ertc_alarm_set().

◆ ampm

__IO uint32_t ertc_reg_alarm_type::ampm

Definition at line 445 of file at32f415_ertc.h.

Referenced by ertc_alarm_get(), and ertc_alarm_set().

◆ d

__IO uint32_t ertc_reg_alarm_type::d

Definition at line 447 of file at32f415_ertc.h.

Referenced by ertc_alarm_get(), and ertc_alarm_set().

◆ h

__IO uint32_t ertc_reg_alarm_type::h

Definition at line 444 of file at32f415_ertc.h.

Referenced by ertc_alarm_get(), and ertc_alarm_set().

◆ m

__IO uint32_t ertc_reg_alarm_type::m

Definition at line 442 of file at32f415_ertc.h.

Referenced by ertc_alarm_get(), and ertc_alarm_set().

◆ mask1

__IO uint32_t ertc_reg_alarm_type::mask1

Definition at line 441 of file at32f415_ertc.h.

◆ mask2

__IO uint32_t ertc_reg_alarm_type::mask2

Definition at line 443 of file at32f415_ertc.h.

◆ mask3

__IO uint32_t ertc_reg_alarm_type::mask3

Definition at line 446 of file at32f415_ertc.h.

◆ mask4

__IO uint32_t ertc_reg_alarm_type::mask4

Definition at line 449 of file at32f415_ertc.h.

◆ s

__IO uint32_t ertc_reg_alarm_type::s

Definition at line 440 of file at32f415_ertc.h.

Referenced by ertc_alarm_get(), and ertc_alarm_set().

◆ wksel

__IO uint32_t ertc_reg_alarm_type::wksel

Definition at line 448 of file at32f415_ertc.h.

Referenced by ertc_alarm_get().

The documentation for this union was generated from the following file:
  • at32f415_ertc.h


AT32F415 Firmwary Library: ertc_reg_scal_type Union Reference

Data Fields
ertc_reg_scal_type Union Reference
AT32F415_periph_driver » ERTC » ERTC_exported_types

ertc scal reg union More...

#include <at32f415_ertc.h>

Data Fields

__IO uint32_t scal
struct {
__IO uint32_t dec:9
__IO uint32_t reserved1:4
__IO uint32_t cal16:1
__IO uint32_t cal8:1
__IO uint32_t add:1
__IO uint32_t reserved2:16
} scal_bit

Detailed Description

ertc scal reg union

Definition at line 456 of file at32f415_ertc.h.

Field Documentation

◆ add

__IO uint32_t ertc_reg_scal_type::add

Definition at line 465 of file at32f415_ertc.h.

Referenced by ertc_smooth_calibration_config().

◆ cal16

__IO uint32_t ertc_reg_scal_type::cal16

Definition at line 463 of file at32f415_ertc.h.

Referenced by ertc_smooth_calibration_config().

◆ cal8

__IO uint32_t ertc_reg_scal_type::cal8

Definition at line 464 of file at32f415_ertc.h.

Referenced by ertc_smooth_calibration_config().

◆ dec

__IO uint32_t ertc_reg_scal_type::dec

Definition at line 461 of file at32f415_ertc.h.

Referenced by ertc_smooth_calibration_config().

◆ reserved1

__IO uint32_t ertc_reg_scal_type::reserved1

Definition at line 462 of file at32f415_ertc.h.

◆ reserved2

__IO uint32_t ertc_reg_scal_type::reserved2

Definition at line 466 of file at32f415_ertc.h.

◆ scal

__IO uint32_t ertc_reg_scal_type::scal

Definition at line 458 of file at32f415_ertc.h.

Referenced by ertc_smooth_calibration_config().

◆

struct { ... } ertc_reg_scal_type::scal_bit

Referenced by ertc_smooth_calibration_config().

The documentation for this union was generated from the following file:
  • at32f415_ertc.h


AT32F415 Firmwary Library: ertc_reg_tadj_type Union Reference

Data Fields
ertc_reg_tadj_type Union Reference
AT32F415_periph_driver » ERTC » ERTC_exported_types

ertc tadj reg union More...

#include <at32f415_ertc.h>

Data Fields

__IO uint32_t tadj
struct {
__IO uint32_t decsbs:15
__IO uint32_t reserved1:16
__IO uint32_t add1s:1
} tadj_bit

Detailed Description

ertc tadj reg union

Definition at line 473 of file at32f415_ertc.h.

Field Documentation

◆ add1s

__IO uint32_t ertc_reg_tadj_type::add1s

Definition at line 480 of file at32f415_ertc.h.

Referenced by ertc_time_adjust().

◆ decsbs

__IO uint32_t ertc_reg_tadj_type::decsbs

Definition at line 478 of file at32f415_ertc.h.

Referenced by ertc_time_adjust().

◆ reserved1

__IO uint32_t ertc_reg_tadj_type::reserved1

Definition at line 479 of file at32f415_ertc.h.

◆ tadj

__IO uint32_t ertc_reg_tadj_type::tadj

Definition at line 475 of file at32f415_ertc.h.

Referenced by ertc_time_adjust().

◆

struct { ... } ertc_reg_tadj_type::tadj_bit

Referenced by ertc_time_adjust().

The documentation for this union was generated from the following file:
  • at32f415_ertc.h


AT32F415 Firmwary Library: ertc_reg_tstm_type Union Reference

Data Fields
ertc_reg_tstm_type Union Reference
AT32F415_periph_driver » ERTC » ERTC_exported_types

ertc tstm reg union More...

#include <at32f415_ertc.h>

Data Fields

__IO uint32_t tstm
struct {
__IO uint32_t s:7
__IO uint32_t reserved1:1
__IO uint32_t m:7
__IO uint32_t reserved2:1
__IO uint32_t h:6
__IO uint32_t ampm:1
__IO uint32_t reserved3:9
} tstm_bit

Detailed Description

ertc tstm reg union

Definition at line 487 of file at32f415_ertc.h.

Field Documentation

◆ ampm

__IO uint32_t ertc_reg_tstm_type::ampm

Definition at line 497 of file at32f415_ertc.h.

Referenced by ertc_timestamp_get().

◆ h

__IO uint32_t ertc_reg_tstm_type::h

Definition at line 496 of file at32f415_ertc.h.

Referenced by ertc_timestamp_get().

◆ m

__IO uint32_t ertc_reg_tstm_type::m

Definition at line 494 of file at32f415_ertc.h.

Referenced by ertc_timestamp_get().

◆ reserved1

__IO uint32_t ertc_reg_tstm_type::reserved1

Definition at line 493 of file at32f415_ertc.h.

◆ reserved2

__IO uint32_t ertc_reg_tstm_type::reserved2

Definition at line 495 of file at32f415_ertc.h.

◆ reserved3

__IO uint32_t ertc_reg_tstm_type::reserved3

Definition at line 498 of file at32f415_ertc.h.

◆ s

__IO uint32_t ertc_reg_tstm_type::s

Definition at line 492 of file at32f415_ertc.h.

Referenced by ertc_timestamp_get().

◆ tstm

__IO uint32_t ertc_reg_tstm_type::tstm

Definition at line 489 of file at32f415_ertc.h.

Referenced by ertc_timestamp_get().

◆

struct { ... } ertc_reg_tstm_type::tstm_bit

Referenced by ertc_timestamp_get().

The documentation for this union was generated from the following file:
  • at32f415_ertc.h


AT32F415 Firmwary Library: ertc_reg_tsdt_type Union Reference

Data Fields
ertc_reg_tsdt_type Union Reference
AT32F415_periph_driver » ERTC » ERTC_exported_types

ertc tsdt register, offset:0x34 More...

#include <at32f415_ertc.h>

Data Fields

__IO uint32_t tsdt
struct {
__IO uint32_t d:6
__IO uint32_t reserved1:2
__IO uint32_t m:5
__IO uint32_t wk:3
__IO uint32_t reserved2:16
} tsdt_bit

Detailed Description

ertc tsdt register, offset:0x34

Definition at line 505 of file at32f415_ertc.h.

Field Documentation

◆ d

__IO uint32_t ertc_reg_tsdt_type::d

Definition at line 510 of file at32f415_ertc.h.

Referenced by ertc_timestamp_get().

◆ m

__IO uint32_t ertc_reg_tsdt_type::m

Definition at line 512 of file at32f415_ertc.h.

Referenced by ertc_timestamp_get().

◆ reserved1

__IO uint32_t ertc_reg_tsdt_type::reserved1

Definition at line 511 of file at32f415_ertc.h.

◆ reserved2

__IO uint32_t ertc_reg_tsdt_type::reserved2

Definition at line 514 of file at32f415_ertc.h.

◆ tsdt

__IO uint32_t ertc_reg_tsdt_type::tsdt

Definition at line 507 of file at32f415_ertc.h.

Referenced by ertc_timestamp_get().

◆

struct { ... } ertc_reg_tsdt_type::tsdt_bit

Referenced by ertc_timestamp_get().

◆ wk

__IO uint32_t ertc_reg_tsdt_type::wk

Definition at line 513 of file at32f415_ertc.h.

Referenced by ertc_timestamp_get().

The documentation for this union was generated from the following file:
  • at32f415_ertc.h


AT32F415 Firmwary Library: ertc_type Struct Reference

Data Fields
ertc_type Struct Reference
AT32F415_periph_driver » ERTC » ERTC_exported_types

type define ertc register all More...

#include <at32f415_ertc.h>

Data Fields

union {
__IO uint32_t time
struct {
__IO uint32_t s: 7
__IO uint32_t reserved1: 1
__IO uint32_t m: 7
__IO uint32_t reserved2: 1
__IO uint32_t h: 6
__IO uint32_t ampm: 1
__IO uint32_t reserved3: 9
} time_bit
};
ertc time register, offset:0x00 More...
union {
__IO uint32_t date
struct {
__IO uint32_t d:6
__IO uint32_t reserved1:2
__IO uint32_t m:5
__IO uint32_t wk:3
__IO uint32_t y:8
__IO uint32_t reserved2:8
} date_bit
};
ertc date register, offset:0x04 More...
union {
__IO uint32_t ctrl
struct {
__IO uint32_t watclk:3
__IO uint32_t tsedg:1
__IO uint32_t rcden:1
__IO uint32_t dren:1
__IO uint32_t hm:1
__IO uint32_t ccalen:1
__IO uint32_t alaen:1
__IO uint32_t alben:1
__IO uint32_t waten:1
__IO uint32_t tsen:1
__IO uint32_t alaien:1
__IO uint32_t albien:1
__IO uint32_t watien:1
__IO uint32_t tsien:1
__IO uint32_t add1h:1
__IO uint32_t dec1h:1
__IO uint32_t bpr:1
__IO uint32_t calosel:1
__IO uint32_t outp:1
__IO uint32_t outsel:2
__IO uint32_t caloen:1
__IO uint32_t reserved1:8
} ctrl_bit
};
ertc ctrl register, offset:0x08 More...
union {
__IO uint32_t sts
struct {
__IO uint32_t alawf:1
__IO uint32_t albwf:1
__IO uint32_t watwf:1
__IO uint32_t tadjf:1
__IO uint32_t initf:1
__IO uint32_t updf:1
__IO uint32_t imf:1
__IO uint32_t imen:1
__IO uint32_t alaf:1
__IO uint32_t albf:1
__IO uint32_t watf:1
__IO uint32_t tsf:1
__IO uint32_t tsof:1
__IO uint32_t tp1f:1
__IO uint32_t reserved1:1
__IO uint32_t reserved2:1
__IO uint32_t calupdf:1
__IO uint32_t reserved3:15
} sts_bit
};
ertc sts register, offset:0x0C More...
union {
__IO uint32_t div
struct {
__IO uint32_t divb:15
__IO uint32_t reserved1:1
__IO uint32_t diva:7
__IO uint32_t reserved2:9
} div_bit
};
ertc div register, offset:0x10 More...
union {
__IO uint32_t wat
struct {
__IO uint32_t val:16
__IO uint32_t reserved1:16
} wat_bit
};
ertc wat register, offset:0x14 More...
union {
__IO uint32_t ccal
struct {
__IO uint32_t calval:5
__IO uint32_t reserved1:2
__IO uint32_t caldir:1
__IO uint32_t reserved2:24
} ccal_bit
};
ertc ccal register, offset:0x18 More...
union {
__IO uint32_t ala
struct {
__IO uint32_t s:7
__IO uint32_t mask1:1
__IO uint32_t m:7
__IO uint32_t mask2:1
__IO uint32_t h:6
__IO uint32_t ampm:1
__IO uint32_t mask3:1
__IO uint32_t d:6
__IO uint32_t wksel:1
__IO uint32_t mask4:1
} ala_bit
};
ertc ala register, offset:0x1C More...
union {
__IO uint32_t alb
struct {
__IO uint32_t s:7
__IO uint32_t mask1:1
__IO uint32_t m:7
__IO uint32_t mask2:1
__IO uint32_t h:6
__IO uint32_t ampm:1
__IO uint32_t mask3:1
__IO uint32_t d:6
__IO uint32_t wksel:1
__IO uint32_t mask4:1
} alb_bit
};
ertc alb register, offset:0x20 More...
union {
__IO uint32_t wp
struct {
__IO uint32_t cmd:8
__IO uint32_t reserved1:24
} wp_bit
};
ertc wp register, offset:0x24 More...
union {
__IO uint32_t sbs
struct {
__IO uint32_t sbs:16
__IO uint32_t reserved1:16
} sbs_bit
};
ertc sbs register, offset:0x28 More...
union {
__IO uint32_t tadj
struct {
__IO uint32_t decsbs:15
__IO uint32_t reserved1:16
__IO uint32_t add1s:1
} tadj_bit
};
ertc tadj register, offset:0x2C More...
union {
__IO uint32_t tstm
struct {
__IO uint32_t s:7
__IO uint32_t reserved1:1
__IO uint32_t m:7
__IO uint32_t reserved2:1
__IO uint32_t h:6
__IO uint32_t ampm:1
__IO uint32_t reserved3:9
} tstm_bit
};
ertc tstm register, offset:0x30 More...
union {
__IO uint32_t tsdt
struct {
__IO uint32_t d:6
__IO uint32_t reserved1:2
__IO uint32_t m:5
__IO uint32_t wk:3
__IO uint32_t reserved2:16
} tsdt_bit
};
ertc tsdt register, offset:0x34 More...
union {
__IO uint32_t tssbs
struct {
__IO uint32_t sbs:16
__IO uint32_t reserved1:16
} tssbs_bit
};
ertc tssbs register, offset:0x38 More...
union {
__IO uint32_t scal
struct {
__IO uint32_t dec:9
__IO uint32_t reserved1:4
__IO uint32_t cal16:1
__IO uint32_t cal8:1
__IO uint32_t add:1
__IO uint32_t reserved2:16
} scal_bit
};
ertc scal register, offset:0x3C More...
union {
__IO uint32_t tamp
struct {
__IO uint32_t tp1en:1
__IO uint32_t tp1edg:1
__IO uint32_t tpien:1
__IO uint32_t reserved1:1
__IO uint32_t reserved2:1
__IO uint32_t reserved3:2
__IO uint32_t tptsen:1
__IO uint32_t tpfreq:3
__IO uint32_t tpflt:2
__IO uint32_t tppr:2
__IO uint32_t tppu:1
__IO uint32_t reserved4:1
__IO uint32_t reserved5:1
__IO uint32_t outtype:1
__IO uint32_t reserved6:13
} tamp_bit
};
ertc tamp register, offset:0x40 More...
union {
__IO uint32_t alasbs
struct {
__IO uint32_t sbs:15
__IO uint32_t reserved1:9
__IO uint32_t sbsmsk:4
__IO uint32_t reserved2:4
} alasbs_bit
};
ertc alasbs register, offset:0x44 More...
union {
__IO uint32_t albsbs
struct {
__IO uint32_t sbs:15
__IO uint32_t reserved1:9
__IO uint32_t sbsmsk:4
__IO uint32_t reserved2:4
} albsbs_bit
};
ertc albsbs register, offset:0x48 More...
union {
__IO uint32_t dt1
struct {
__IO uint32_t dt:32
} dt1_bit
};
ertc dt1 register, offset:0x50 More...
union {
__IO uint32_t dt2
struct {
__IO uint32_t dt:32
} dt2_bit
};
ertc dt2 register, offset:0x54 More...
union {
__IO uint32_t dt3
struct {
__IO uint32_t dt:32
} dt3_bit
};
ertc dt3 register, offset:0x58 More...
union {
__IO uint32_t dt4
struct {
__IO uint32_t dt:32
} dt4_bit
};
ertc dt4 register, offset:0x5C More...
union {
__IO uint32_t dt5
struct {
__IO uint32_t dt:32
} dt5_bit
};
ertc dt5 register, offset:0x60 More...
union {
__IO uint32_t dt6
struct {
__IO uint32_t dt:32
} dt6_bit
};
ertc dt6 register, offset:0x64 More...
union {
__IO uint32_t dt7
struct {
__IO uint32_t dt:32
} dt7_bit
};
ertc dt7 register, offset:0x68 More...
union {
__IO uint32_t dt8
struct {
__IO uint32_t dt:32
} dt8_bit
};
ertc dt8 register, offset:0x6C More...
union {
__IO uint32_t dt9
struct {
__IO uint32_t dt:32
} dt9_bit
};
ertc dt9 register, offset:0x70 More...
union {
__IO uint32_t dt10
struct {
__IO uint32_t dt:32
} dt10_bit
};
ertc dt10 register, offset:0x74 More...
union {
__IO uint32_t dt11
struct {
__IO uint32_t dt:32
} dt11_bit
};
ertc dt11 register, offset:0x78 More...
union {
__IO uint32_t dt12
struct {
__IO uint32_t dt:32
} dt12_bit
};
ertc dt12 register, offset:0x7C More...
union {
__IO uint32_t dt13
struct {
__IO uint32_t dt:32
} dt13_bit
};
ertc dt13 register, offset:0x80 More...
union {
__IO uint32_t dt14
struct {
__IO uint32_t dt:32
} dt14_bit
};
ertc dt14 register, offset:0x84 More...
union {
__IO uint32_t dt15
struct {
__IO uint32_t dt:32
} dt15_bit
};
ertc dt15 register, offset:0x88 More...
union {
__IO uint32_t dt16
struct {
__IO uint32_t dt:32
} dt16_bit
};
ertc dt16 register, offset:0x8C More...
union {
__IO uint32_t dt17
struct {
__IO uint32_t dt:32
} dt17_bit
};
ertc dt17 register, offset:0x90 More...
union {
__IO uint32_t dt18
struct {
__IO uint32_t dt:32
} dt18_bit
};
ertc dt18 register, offset:0x94 More...
union {
__IO uint32_t dt19
struct {
__IO uint32_t dt:32
} dt19_bit
};
ertc dt19 register, offset:0x98 More...
union {
__IO uint32_t dt20
struct {
__IO uint32_t dt:32
} dt20_bit
};
ertc dt20 register, offset:0x9C More...

Detailed Description

type define ertc register all

Definition at line 521 of file at32f415_ertc.h.

Field Documentation

◆

union { ... } ertc_type::@224

ertc time register, offset:0x00

◆

union { ... } ertc_type::@226

ertc date register, offset:0x04

◆

union { ... } ertc_type::@228

ertc ctrl register, offset:0x08

◆

union { ... } ertc_type::@230

ertc sts register, offset:0x0C

◆

union { ... } ertc_type::@232

ertc div register, offset:0x10

◆

union { ... } ertc_type::@234

ertc wat register, offset:0x14

◆

union { ... } ertc_type::@236

ertc ccal register, offset:0x18

◆

union { ... } ertc_type::@238

ertc ala register, offset:0x1C

◆

union { ... } ertc_type::@240

ertc alb register, offset:0x20

◆

union { ... } ertc_type::@242

ertc wp register, offset:0x24

◆

union { ... } ertc_type::@244

ertc sbs register, offset:0x28

◆

union { ... } ertc_type::@246

ertc tadj register, offset:0x2C

◆

union { ... } ertc_type::@248

ertc tstm register, offset:0x30

◆

union { ... } ertc_type::@250

ertc tsdt register, offset:0x34

◆

union { ... } ertc_type::@252

ertc tssbs register, offset:0x38

◆

union { ... } ertc_type::@254

ertc scal register, offset:0x3C

◆

union { ... } ertc_type::@256

ertc tamp register, offset:0x40

◆

union { ... } ertc_type::@258

ertc alasbs register, offset:0x44

◆

union { ... } ertc_type::@260

ertc albsbs register, offset:0x48

◆

union { ... } ertc_type::@262

ertc dt1 register, offset:0x50

◆

union { ... } ertc_type::@264

ertc dt2 register, offset:0x54

◆

union { ... } ertc_type::@266

ertc dt3 register, offset:0x58

◆

union { ... } ertc_type::@268

ertc dt4 register, offset:0x5C

◆

union { ... } ertc_type::@270

ertc dt5 register, offset:0x60

◆

union { ... } ertc_type::@272

ertc dt6 register, offset:0x64

◆

union { ... } ertc_type::@274

ertc dt7 register, offset:0x68

◆

union { ... } ertc_type::@276

ertc dt8 register, offset:0x6C

◆

union { ... } ertc_type::@278

ertc dt9 register, offset:0x70

◆

union { ... } ertc_type::@280

ertc dt10 register, offset:0x74

◆

union { ... } ertc_type::@282

ertc dt11 register, offset:0x78

◆

union { ... } ertc_type::@284

ertc dt12 register, offset:0x7C

◆

union { ... } ertc_type::@286

ertc dt13 register, offset:0x80

◆

union { ... } ertc_type::@288

ertc dt14 register, offset:0x84

◆

union { ... } ertc_type::@290

ertc dt15 register, offset:0x88

◆

union { ... } ertc_type::@292

ertc dt16 register, offset:0x8C

◆

union { ... } ertc_type::@294

ertc dt17 register, offset:0x90

◆

union { ... } ertc_type::@296

ertc dt18 register, offset:0x94

◆

union { ... } ertc_type::@298

ertc dt19 register, offset:0x98

◆

union { ... } ertc_type::@300

ertc dt20 register, offset:0x9C

◆ add

__IO uint32_t ertc_type::add

Definition at line 805 of file at32f415_ertc.h.

◆ add1h

__IO uint32_t ertc_type::add1h

Definition at line 581 of file at32f415_ertc.h.

◆ add1s

__IO uint32_t ertc_type::add1s

Definition at line 742 of file at32f415_ertc.h.

◆ ala

__IO uint32_t ertc_type::ala

Definition at line 669 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::ala_bit

◆ alaen

__IO uint32_t ertc_type::alaen

Definition at line 573 of file at32f415_ertc.h.

◆ alaf

__IO uint32_t ertc_type::alaf

Definition at line 608 of file at32f415_ertc.h.

◆ alaien

__IO uint32_t ertc_type::alaien

Definition at line 577 of file at32f415_ertc.h.

◆ alasbs

__IO uint32_t ertc_type::alasbs

Definition at line 841 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::alasbs_bit

◆ alawf

__IO uint32_t ertc_type::alawf

Definition at line 600 of file at32f415_ertc.h.

◆ alb

__IO uint32_t ertc_type::alb

Definition at line 690 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::alb_bit

◆ alben

__IO uint32_t ertc_type::alben

Definition at line 574 of file at32f415_ertc.h.

◆ albf

__IO uint32_t ertc_type::albf

Definition at line 609 of file at32f415_ertc.h.

◆ albien

__IO uint32_t ertc_type::albien

Definition at line 578 of file at32f415_ertc.h.

◆ albsbs

__IO uint32_t ertc_type::albsbs

Definition at line 856 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::albsbs_bit

◆ albwf

__IO uint32_t ertc_type::albwf

Definition at line 601 of file at32f415_ertc.h.

◆ ampm

__IO uint32_t ertc_type::ampm

Definition at line 537 of file at32f415_ertc.h.

◆ bpr

__IO uint32_t ertc_type::bpr

Definition at line 583 of file at32f415_ertc.h.

◆ cal16

__IO uint32_t ertc_type::cal16

Definition at line 803 of file at32f415_ertc.h.

◆ cal8

__IO uint32_t ertc_type::cal8

Definition at line 804 of file at32f415_ertc.h.

◆ caldir

__IO uint32_t ertc_type::caldir

Definition at line 659 of file at32f415_ertc.h.

◆ caloen

__IO uint32_t ertc_type::caloen

Definition at line 587 of file at32f415_ertc.h.

◆ calosel

__IO uint32_t ertc_type::calosel

Definition at line 584 of file at32f415_ertc.h.

◆ calupdf

__IO uint32_t ertc_type::calupdf

Definition at line 616 of file at32f415_ertc.h.

◆ calval

__IO uint32_t ertc_type::calval

Definition at line 657 of file at32f415_ertc.h.

◆ ccal

__IO uint32_t ertc_type::ccal

Definition at line 654 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::ccal_bit

◆ ccalen

__IO uint32_t ertc_type::ccalen

Definition at line 572 of file at32f415_ertc.h.

◆ cmd

__IO uint32_t ertc_type::cmd

Definition at line 714 of file at32f415_ertc.h.

◆ ctrl

__IO uint32_t ertc_type::ctrl

Definition at line 564 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::ctrl_bit

◆ d

__IO uint32_t ertc_type::d

Definition at line 550 of file at32f415_ertc.h.

◆ date

__IO uint32_t ertc_type::date

Definition at line 547 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::date_bit

◆ dec

__IO uint32_t ertc_type::dec

Definition at line 801 of file at32f415_ertc.h.

◆ dec1h

__IO uint32_t ertc_type::dec1h

Definition at line 582 of file at32f415_ertc.h.

◆ decsbs

__IO uint32_t ertc_type::decsbs

Definition at line 740 of file at32f415_ertc.h.

◆ div

__IO uint32_t ertc_type::div

Definition at line 626 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::div_bit

◆ diva

__IO uint32_t ertc_type::diva

Definition at line 631 of file at32f415_ertc.h.

◆ divb

__IO uint32_t ertc_type::divb

Definition at line 629 of file at32f415_ertc.h.

◆ dren

__IO uint32_t ertc_type::dren

Definition at line 570 of file at32f415_ertc.h.

◆ dt

__IO uint32_t ertc_type::dt

Definition at line 879 of file at32f415_ertc.h.

◆ dt1

__IO uint32_t ertc_type::dt1

Definition at line 876 of file at32f415_ertc.h.

◆ dt10

__IO uint32_t ertc_type::dt10

Definition at line 984 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt10_bit

◆ dt11

__IO uint32_t ertc_type::dt11

Definition at line 996 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt11_bit

◆ dt12

__IO uint32_t ertc_type::dt12

Definition at line 1008 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt12_bit

◆ dt13

__IO uint32_t ertc_type::dt13

Definition at line 1020 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt13_bit

◆ dt14

__IO uint32_t ertc_type::dt14

Definition at line 1032 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt14_bit

◆ dt15

__IO uint32_t ertc_type::dt15

Definition at line 1044 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt15_bit

◆ dt16

__IO uint32_t ertc_type::dt16

Definition at line 1056 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt16_bit

◆ dt17

__IO uint32_t ertc_type::dt17

Definition at line 1068 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt17_bit

◆ dt18

__IO uint32_t ertc_type::dt18

Definition at line 1080 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt18_bit

◆ dt19

__IO uint32_t ertc_type::dt19

Definition at line 1092 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt19_bit

◆

struct { ... } ertc_type::dt1_bit

◆ dt2

__IO uint32_t ertc_type::dt2

Definition at line 888 of file at32f415_ertc.h.

◆ dt20

__IO uint32_t ertc_type::dt20

Definition at line 1104 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt20_bit

◆

struct { ... } ertc_type::dt2_bit

◆ dt3

__IO uint32_t ertc_type::dt3

Definition at line 900 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt3_bit

◆ dt4

__IO uint32_t ertc_type::dt4

Definition at line 912 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt4_bit

◆ dt5

__IO uint32_t ertc_type::dt5

Definition at line 924 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt5_bit

◆ dt6

__IO uint32_t ertc_type::dt6

Definition at line 936 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt6_bit

◆ dt7

__IO uint32_t ertc_type::dt7

Definition at line 948 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt7_bit

◆ dt8

__IO uint32_t ertc_type::dt8

Definition at line 960 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt8_bit

◆ dt9

__IO uint32_t ertc_type::dt9

Definition at line 972 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::dt9_bit

◆ h

__IO uint32_t ertc_type::h

Definition at line 536 of file at32f415_ertc.h.

◆ hm

__IO uint32_t ertc_type::hm

Definition at line 571 of file at32f415_ertc.h.

◆ imen

__IO uint32_t ertc_type::imen

Definition at line 607 of file at32f415_ertc.h.

◆ imf

__IO uint32_t ertc_type::imf

Definition at line 606 of file at32f415_ertc.h.

◆ initf

__IO uint32_t ertc_type::initf

Definition at line 604 of file at32f415_ertc.h.

◆ m

__IO uint32_t ertc_type::m

Definition at line 534 of file at32f415_ertc.h.

◆ mask1

__IO uint32_t ertc_type::mask1

Definition at line 673 of file at32f415_ertc.h.

◆ mask2

__IO uint32_t ertc_type::mask2

Definition at line 675 of file at32f415_ertc.h.

◆ mask3

__IO uint32_t ertc_type::mask3

Definition at line 678 of file at32f415_ertc.h.

◆ mask4

__IO uint32_t ertc_type::mask4

Definition at line 681 of file at32f415_ertc.h.

◆ outp

__IO uint32_t ertc_type::outp

Definition at line 585 of file at32f415_ertc.h.

◆ outsel

__IO uint32_t ertc_type::outsel

Definition at line 586 of file at32f415_ertc.h.

◆ outtype

__IO uint32_t ertc_type::outtype

Definition at line 831 of file at32f415_ertc.h.

◆ rcden

__IO uint32_t ertc_type::rcden

Definition at line 569 of file at32f415_ertc.h.

◆ reserved1

__IO uint32_t ertc_type::reserved1

reserved register, offset:0x4c

Definition at line 533 of file at32f415_ertc.h.

◆ reserved2

__IO uint32_t ertc_type::reserved2

Definition at line 535 of file at32f415_ertc.h.

◆ reserved3

__IO uint32_t ertc_type::reserved3

Definition at line 538 of file at32f415_ertc.h.

◆ reserved4

__IO uint32_t ertc_type::reserved4

Definition at line 829 of file at32f415_ertc.h.

◆ reserved5

__IO uint32_t ertc_type::reserved5

Definition at line 830 of file at32f415_ertc.h.

◆ reserved6

__IO uint32_t ertc_type::reserved6

Definition at line 832 of file at32f415_ertc.h.

◆ s

__IO uint32_t ertc_type::s

Definition at line 532 of file at32f415_ertc.h.

◆ sbs

__IO uint32_t ertc_type::sbs

Definition at line 724 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::sbs_bit

◆ sbsmsk

__IO uint32_t ertc_type::sbsmsk

Definition at line 846 of file at32f415_ertc.h.

◆ scal

__IO uint32_t ertc_type::scal

Definition at line 798 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::scal_bit

◆ sts

__IO uint32_t ertc_type::sts

Definition at line 597 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::sts_bit

◆ tadj

__IO uint32_t ertc_type::tadj

Definition at line 737 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::tadj_bit

◆ tadjf

__IO uint32_t ertc_type::tadjf

Definition at line 603 of file at32f415_ertc.h.

◆ tamp

__IO uint32_t ertc_type::tamp

Definition at line 815 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::tamp_bit

◆ time

__IO uint32_t ertc_type::time

Definition at line 529 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::time_bit

◆ tp1edg

__IO uint32_t ertc_type::tp1edg

Definition at line 819 of file at32f415_ertc.h.

◆ tp1en

__IO uint32_t ertc_type::tp1en

Definition at line 818 of file at32f415_ertc.h.

◆ tp1f

__IO uint32_t ertc_type::tp1f

Definition at line 613 of file at32f415_ertc.h.

◆ tpflt

__IO uint32_t ertc_type::tpflt

Definition at line 826 of file at32f415_ertc.h.

◆ tpfreq

__IO uint32_t ertc_type::tpfreq

Definition at line 825 of file at32f415_ertc.h.

◆ tpien

__IO uint32_t ertc_type::tpien

Definition at line 820 of file at32f415_ertc.h.

◆ tppr

__IO uint32_t ertc_type::tppr

Definition at line 827 of file at32f415_ertc.h.

◆ tppu

__IO uint32_t ertc_type::tppu

Definition at line 828 of file at32f415_ertc.h.

◆ tptsen

__IO uint32_t ertc_type::tptsen

Definition at line 824 of file at32f415_ertc.h.

◆ tsdt

__IO uint32_t ertc_type::tsdt

Definition at line 769 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::tsdt_bit

◆ tsedg

__IO uint32_t ertc_type::tsedg

Definition at line 568 of file at32f415_ertc.h.

◆ tsen

__IO uint32_t ertc_type::tsen

Definition at line 576 of file at32f415_ertc.h.

◆ tsf

__IO uint32_t ertc_type::tsf

Definition at line 611 of file at32f415_ertc.h.

◆ tsien

__IO uint32_t ertc_type::tsien

Definition at line 580 of file at32f415_ertc.h.

◆ tsof

__IO uint32_t ertc_type::tsof

Definition at line 612 of file at32f415_ertc.h.

◆ tssbs

__IO uint32_t ertc_type::tssbs

Definition at line 785 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::tssbs_bit

◆ tstm

__IO uint32_t ertc_type::tstm

Definition at line 751 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::tstm_bit

◆ updf

__IO uint32_t ertc_type::updf

Definition at line 605 of file at32f415_ertc.h.

◆ val

__IO uint32_t ertc_type::val

Definition at line 644 of file at32f415_ertc.h.

◆ wat

__IO uint32_t ertc_type::wat

Definition at line 641 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::wat_bit

◆ watclk

__IO uint32_t ertc_type::watclk

Definition at line 567 of file at32f415_ertc.h.

◆ waten

__IO uint32_t ertc_type::waten

Definition at line 575 of file at32f415_ertc.h.

◆ watf

__IO uint32_t ertc_type::watf

Definition at line 610 of file at32f415_ertc.h.

◆ watien

__IO uint32_t ertc_type::watien

Definition at line 579 of file at32f415_ertc.h.

◆ watwf

__IO uint32_t ertc_type::watwf

Definition at line 602 of file at32f415_ertc.h.

◆ wk

__IO uint32_t ertc_type::wk

Definition at line 553 of file at32f415_ertc.h.

◆ wksel

__IO uint32_t ertc_type::wksel

Definition at line 680 of file at32f415_ertc.h.

◆ wp

__IO uint32_t ertc_type::wp

Definition at line 711 of file at32f415_ertc.h.

◆

struct { ... } ertc_type::wp_bit

◆ y

__IO uint32_t ertc_type::y

Definition at line 554 of file at32f415_ertc.h.

The documentation for this struct was generated from the following file:
  • at32f415_ertc.h


AT32F415 Firmwary Library: ERTC_exported_functions

Functions
ERTC_exported_functions
AT32F415_periph_driver » ERTC

Functions

uint8_t | ertc_num_to_bcd (uint8_t num)
number conversion to bcd code. More...
uint8_t | ertc_bcd_to_num (uint8_t bcd)
bcd code conversion to number. More...
void | ertc_write_protect_enable (void)
enable write protection. More...
void | ertc_write_protect_disable (void)
disable write protection. More...
error_status | ertc_wait_update (void)
ertc wait register update finish. More...
error_status | ertc_wait_flag (uint32_t flag, flag_status status)
ertc wait flag status. More...
error_status | ertc_init_mode_enter (void)
ertc enter init mode. More...
void | ertc_init_mode_exit (void)
ertc exit init mode. More...
error_status | ertc_reset (void)
ertc reset all register. More...
error_status | ertc_divider_set (uint16_t div_a, uint16_t div_b)
ertc division set. More...
error_status | ertc_hour_mode_set (ertc_hour_mode_set_type mode)
ertc hour mode set. More...
error_status | ertc_date_set (uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date. More...
error_status | ertc_time_set (uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time. More...
void | ertc_calendar_get (ertc_time_type *time)
get calendar More...
uint32_t | ertc_sub_second_get (void)
get current sub second. More...
void | ertc_alarm_mask_set (ertc_alarm_type alarm_x, uint32_t mask)
set which bits are irrelevant to the alarm match. More...
void | ertc_alarm_week_date_select (ertc_alarm_type alarm_x, ertc_week_date_select_type wk)
alarm week or date mode select. More...
void | ertc_alarm_set (ertc_alarm_type alarm_x, uint8_t week_date, uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set alarm. More...
void | ertc_alarm_sub_second_set (ertc_alarm_type alarm_x, uint32_t value, ertc_alarm_sbs_mask_type mask)
set alarm sub second. More...
error_status | ertc_alarm_enable (ertc_alarm_type alarm_x, confirm_state new_state)
enable or disable alarm clock. More...
void | ertc_alarm_get (ertc_alarm_type alarm_x, ertc_alarm_value_type *alarm)
get alarm value. More...
uint32_t | ertc_alarm_sub_second_get (ertc_alarm_type alarm_x)
get alarm sub second. More...
void | ertc_wakeup_clock_set (ertc_wakeup_clock_type clock)
set wakeup timer clock. More...
void | ertc_wakeup_counter_set (uint32_t counter)
set wakeup counter. More...
uint16_t | ertc_wakeup_counter_get (void)
get wakeup counter. More...
error_status | ertc_wakeup_enable (confirm_state new_state)
enable or disable wakeup timer. More...
error_status | ertc_smooth_calibration_config (ertc_smooth_cal_period_type period, ertc_smooth_cal_clk_add_type clk_add, uint32_t clk_dec)
config the smooth calibration. More...
error_status | ertc_coarse_calibration_set (ertc_cal_direction_type dir, uint32_t value)
set the coarse digital calibration. More...
error_status | ertc_coarse_calibration_enable (confirm_state new_state)
enable or disable coarse calibration. More...
void | ertc_cal_output_select (ertc_cal_output_select_type output)
calibration output source select. More...
void | ertc_cal_output_enable (confirm_state new_state)
enable or disable calibration output. More...
error_status | ertc_time_adjust (ertc_time_adjust_type add1s, uint32_t decsbs)
adjust the time. More...
void | ertc_daylight_set (ertc_dst_operation_type operation, ertc_dst_save_type save)
config the daylight saving time. More...
uint8_t | ertc_daylight_bpr_get (void)
get the bpr value. More...
error_status | ertc_refer_clock_detect_enable (confirm_state new_state)
enable or disable refer clock detect. More...
void | ertc_direct_read_enable (confirm_state new_state)
enable or disable direct read mode. More...
void | ertc_output_set (ertc_output_source_type source, ertc_output_polarity_type polarity, ertc_output_type type)
set the output mode. More...
void | ertc_timestamp_valid_edge_set (ertc_timestamp_valid_edge_type edge)
set the timestamp valid edge. More...
void | ertc_timestamp_enable (confirm_state new_state)
enable or disable timestamp. More...
void | ertc_timestamp_get (ertc_time_type *time)
get the timestamp. More...
uint32_t | ertc_timestamp_sub_second_get (void)
get the timestamp sub second. More...
void | ertc_tamper_pull_up_enable (confirm_state new_state)
enable or disable tamper pin pull up. More...
void | ertc_tamper_precharge_set (ertc_tamper_precharge_type precharge)
set the tamper pin pre-charge time. More...
void | ertc_tamper_filter_set (ertc_tamper_filter_type filter)
set the tamper filter time. More...
void | ertc_tamper_detect_freq_set (ertc_tamper_detect_freq_type freq)
set the tamper detection frequency. More...
void | ertc_tamper_valid_edge_set (ertc_tamper_select_type tamper_x, ertc_tamper_valid_edge_type trigger)
set the tamper trigger. More...
void | ertc_tamper_timestamp_enable (confirm_state new_state)
enable or disable trigger timestamp when tamper event occurs. More...
void | ertc_tamper_enable (ertc_tamper_select_type tamper_x, confirm_state new_state)
enable or disable tamper. More...
void | ertc_interrupt_enable (uint32_t source, confirm_state new_state)
enable or disable interrupt. More...
flag_status | ertc_interrupt_get (uint32_t source)
get interrupt status More...
flag_status | ertc_flag_get (uint32_t flag)
get flag status. More...
void | ertc_flag_clear (uint32_t flag)
clear flag status More...
void | ertc_bpr_data_write (ertc_dt_type dt, uint32_t data)
write data to the bpr register. More...
uint32_t | ertc_bpr_data_read (ertc_dt_type dt)
read data from bpr register. More...

Detailed Description

Function Documentation

◆ ertc_alarm_enable()

error_status ertc_alarm_enable | ( | ertc_alarm_type | alarm_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable alarm clock.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
new_state (TRUE or FALSE).
Return values
error_status (ERROR or SUCCESS).

< ertc alarm a register allows write flag

< ertc alarm b register allows write flag

Definition at line 629 of file at32f415_ertc.c.

Referenced by ertc_alarm_config(), ertc_alarm_value_set(), and ertc_config().

◆ ertc_alarm_get()

void ertc_alarm_get | ( | ertc_alarm_type | alarm_x,
 |  | ertc_alarm_value_type * | alarm
 | ) |  |

get alarm value.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
alarm alarm para.
Return values
none.

< ertc alarm don't match all

Definition at line 674 of file at32f415_ertc.c.

Referenced by ertc_alarm_show().

◆ ertc_alarm_mask_set()

void ertc_alarm_mask_set | ( | ertc_alarm_type | alarm_x,
 |  | uint32_t | mask
 | ) |  |

set which bits are irrelevant to the alarm match.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
mask select which bits are irrelevant to the alarm match. this parameter can be one of the following values:
  • ERTC_ALARM_MASK_NONE: match all.
  • ERTC_ALARM_MASK_SEC: don't match seconds.
  • ERTC_ALARM_MASK_MIN: don't match minute.
  • ERTC_ALARM_MASK_HOUR: don't match hour.
  • ERTC_ALARM_MASK_DATE_WEEK: don't match date or week.
  • ERTC_ALARM_MASK_ALL: don't match all.
alarm alarm para.
Return values
none.

< ertc alarm don't match all

< ertc alarm don't match all

Definition at line 458 of file at32f415_ertc.c.

Referenced by ertc_alarm_config(), and ertc_config().

◆ ertc_alarm_set()

void ertc_alarm_set | ( | ertc_alarm_type | alarm_x,
 |  | uint8_t | week_date,
 |  | uint8_t | hour,
 |  | uint8_t | min,
 |  | uint8_t | sec,
 |  | ertc_am_pm_type | ampm
 | ) |  |

set alarm.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
week_day week or date.
  • week: 1~7.
  • date: 1~31.
hour | hour (0~23).
min | minute (0~59).
sec | second (0~59).
ampm hour mode. this parameter can be one of the following values:
  • ERTC_24H: 24-hour format.
  • ERTC_AM: 12-hour format, ante meridiem.
  • ERTC_PM: 12-hour format, post meridiem.
alarm | alarm para.
Return values
none.

Definition at line 538 of file at32f415_ertc.c.

Referenced by ertc_alarm_config(), ertc_alarm_value_set(), and ertc_config().

◆ ertc_alarm_sub_second_get()

uint32_t ertc_alarm_sub_second_get ( ertc_alarm_type alarm_x )

get alarm sub second.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
Return values
sub second.

Definition at line 707 of file at32f415_ertc.c.

◆ ertc_alarm_sub_second_set()

void ertc_alarm_sub_second_set | ( | ertc_alarm_type | alarm_x,
 |  | uint32_t | value,
 |  | ertc_alarm_sbs_mask_type | mask
 | ) |  |

set alarm sub second.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
value sub second value.
mask sub second mask. this parameter can be one of the following values:
  • ERTC_ALARM_SBS_MASK_ALL: do not match the sub-second.
  • ERTC_ALARM_SBS_MASK_14_1: only compare bit [0].
  • ERTC_ALARM_SBS_MASK_14_2: only compare bit [1:0].
  • ERTC_ALARM_SBS_MASK_14_3: only compare bit [2:0].
  • ERTC_ALARM_SBS_MASK_14_4: only compare bit [3:0].
  • ERTC_ALARM_SBS_MASK_14_5: only compare bit [4:0].
  • ERTC_ALARM_SBS_MASK_14_6: only compare bit [5:0].
  • ERTC_ALARM_SBS_MASK_14_7: only compare bit [6:0].
  • ERTC_ALARM_SBS_MASK_14_8: only compare bit [7:0].
  • ERTC_ALARM_SBS_MASK_14_9: only compare bit [8:0].
  • ERTC_ALARM_SBS_MASK_14_10: only compare bit [9:0].
  • ERTC_ALARM_SBS_MASK_14_11: only compare bit [10:0].
  • ERTC_ALARM_SBS_MASK_14_12: only compare bit [11:0].
  • ERTC_ALARM_SBS_MASK_14_13: only compare bit [12:0].
  • ERTC_ALARM_SBS_MASK_14: only compare bit [13:0].
  • ERTC_ALARM_SBS_MASK_NONE: compare bit [14:0].
Return values
none.

Definition at line 600 of file at32f415_ertc.c.

◆ ertc_alarm_week_date_select()

void ertc_alarm_week_date_select | ( | ertc_alarm_type | alarm_x,
 |  | ertc_week_date_select_type | wk
 | ) |  |

alarm week or date mode select.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
wk week or date mode select. this parameter can be one of the following values:
  • ERTC_SLECT_DATE: slect date mode.
  • ERTC_SLECT_WEEK: slect week mode.
Return values
none.

Definition at line 500 of file at32f415_ertc.c.

Referenced by ertc_alarm_config(), and ertc_config().

◆ ertc_bcd_to_num()

uint8_t ertc_bcd_to_num ( uint8_t bcd )

bcd code conversion to number.

Parameters
bcd bcd code(0~99).
Return values
number.

Definition at line 66 of file at32f415_ertc.c.

Referenced by ertc_alarm_get(), ertc_calendar_get(), and ertc_timestamp_get().

◆ ertc_bpr_data_read()

uint32_t ertc_bpr_data_read ( ertc_dt_type dt )

read data from bpr register.

Parameters
dt data register this parameter can be one of the following values:
  • ERTC_DT1
  • ERTC_DT2
  • ...
  • ERTC_DT19
  • ERTC_DT20
Return values
data value.

Definition at line 1510 of file at32f415_ertc.c.

Referenced by bpr_reg_check(), is_bpr_reg_reset(), main(), and randnum_test().

◆ ertc_bpr_data_write()

void ertc_bpr_data_write | ( | ertc_dt_type | dt,
 |  | uint32_t | data
 | ) |  |

write data to the bpr register.

Parameters
dt data register this parameter can be one of the following values:
  • ERTC_DT1
  • ERTC_DT2
  • ...
  • ERTC_DT19
  • ERTC_DT20
data data to be write.
Return values
none.

Definition at line 1484 of file at32f415_ertc.c.

Referenced by bpr_reg_write(), and ertc_config().

◆ ertc_cal_output_enable()

void ertc_cal_output_enable ( confirm_state new_state )

enable or disable calibration output.

Parameters
new_state (TRUE or FALSE).
Return values
none.

Definition at line 931 of file at32f415_ertc.c.

◆ ertc_cal_output_select()

void ertc_cal_output_select ( ertc_cal_output_select_type output )

calibration output source select.

Parameters
output output source. this parameter can be one of the following values:
  • ERTC_CAL_OUTPUT_512HZ: output 512 hz.
  • ERTC_CAL_OUTPUT_1HZ: output 1 hz.
Return values
none.

Definition at line 915 of file at32f415_ertc.c.

◆ ertc_calendar_get()

void ertc_calendar_get ( ertc_time_type * time )

get calendar

Parameters
time ertc time.
Return values
none.

Definition at line 404 of file at32f415_ertc.c.

Referenced by ertc_alarm_value_set(), ertc_time_show(), main(), and randnum_test().

◆ ertc_coarse_calibration_enable()

error_status ertc_coarse_calibration_enable ( confirm_state new_state )

enable or disable coarse calibration.

Parameters
new_state (TRUE or FALSE).
Return values
error_status (ERROR or SUCCESS).

Definition at line 885 of file at32f415_ertc.c.

◆ ertc_coarse_calibration_set()

error_status ertc_coarse_calibration_set | ( | ertc_cal_direction_type | dir,
 |  | uint32_t | value
 | ) |  |

set the coarse digital calibration.

Parameters
dir calibration direction. this parameter can be one of the following values:
  • ERTC_CAL_DIR_POSITIVE: positive calibration.
  • ERTC_CAL_DIR_NEGATIVE: negative calibration.
value calibration value(0~31).
Return values
error_status (ERROR or SUCCESS).

Definition at line 856 of file at32f415_ertc.c.

◆ ertc_date_set()

error_status ertc_date_set | ( | uint8_t | year,
 |  | uint8_t | month,
 |  | uint8_t | date,
 |  | uint8_t | week
 | ) |  |

set date.

Parameters
year | year (0~99).
month | month (1~12).
date | date (1~31).
week | week (1~7).
Return values
error_status (ERROR or SUCCESS).

Definition at line 314 of file at32f415_ertc.c.

Referenced by ertc_config().

◆ ertc_daylight_bpr_get()

uint8_t ertc_daylight_bpr_get ( void )

get the bpr value.

Parameters
none.
Return values
bpr value.

Definition at line 1026 of file at32f415_ertc.c.

◆ ertc_daylight_set()

void ertc_daylight_set | ( | ertc_dst_operation_type | operation,
 |  | ertc_dst_save_type | save
 | ) |  |

config the daylight saving time.

Parameters
operation time adjust. this parameter can be one of the following values:
  • ERTC_DST_ADD_1H: add 1 hour.
  • ERTC_DST_DEC_1H: dec 1 hour.
save operation save. this parameter can be one of the following values:
  • ERTC_DST_SAVE_0: set the bpr register value to 0.
  • ERTC_DST_SAVE_1: set the bpr register value to 1.
Return values
none.

Definition at line 1001 of file at32f415_ertc.c.

◆ ertc_direct_read_enable()

void ertc_direct_read_enable ( confirm_state new_state )

enable or disable direct read mode.

Parameters
new_state (TRUE or FALSE).
Return values
none.

Definition at line 1064 of file at32f415_ertc.c.

◆ ertc_divider_set()

error_status ertc_divider_set | ( | uint16_t | div_a,
 |  | uint16_t | div_b
 | ) |  |

ertc division set.

Parameters
div_a | division a (0~0x7F).
div_b | division b (0~0x7FFF).
Return values
error_status (ERROR or SUCCESS).

Definition at line 251 of file at32f415_ertc.c.

Referenced by ertc_config(), and main().

◆ ertc_flag_clear()

void ertc_flag_clear ( uint32_t flag )

clear flag status

Parameters
flag specifies the flag to clear. this parameter can be any combination of the following values:
  • ERTC_ALAWF_FLAG: alarm a register allows write flag.
  • ERTC_ALBWF_FLAG: alarm b register allows write flag.
  • ERTC_WATWF_FLAG: wakeup timer register allows write flag.
  • ERTC_TADJF_FLAG: time adjustment flag.
  • ERTC_INITF_FLAG: calendar initialization flag.
  • ERTC_UPDF_FLAG: calendar update flag.
  • ERTC_IMF_FLAG: enter initialization mode flag.
  • ERTC_ALAF_FLAG: alarm clock a flag.
  • ERTC_ALBF_FLAG: alarm clock b flag.
  • ERTC_WATF_FLAG: wakeup timer flag.
  • ERTC_TSF_FLAG: timestamp flag.
  • ERTC_TSOF_FLAG: timestamp overflow flag.
  • ERTC_TP1F_FLAG: tamper detection 1 flag.
  • ERTC_TP2F_FLAG: tamper detection 2 flag.
  • ERTC_CALUPDF_FLAG: calibration value update completed flag.
Return values
none

Definition at line 1461 of file at32f415_ertc.c.

Referenced by ertc_config(), ertc_tamper_config(), ERTC_WKUP_IRQHandler(), ERTCAlarm_IRQHandler(), main(), and TAMP_STAMP_IRQHandler().

◆ ertc_flag_get()

flag_status ertc_flag_get ( uint32_t flag )

get flag status.

Parameters
flag specifies the flag to check. this parameter can be one of the following values:
  • ERTC_ALAWF_FLAG: alarm a register allows write flag.
  • ERTC_ALBWF_FLAG: alarm b register allows write flag.
  • ERTC_WATWF_FLAG: wakeup timer register allows write flag.
  • ERTC_TADJF_FLAG: time adjustment flag.
  • ERTC_INITF_FLAG: calendar initialization flag.
  • ERTC_UPDF_FLAG: calendar update flag.
  • ERTC_IMF_FLAG: enter initialization mode flag.
  • ERTC_ALAF_FLAG: alarm clock a flag.
  • ERTC_ALBF_FLAG: alarm clock b flag.
  • ERTC_WATF_FLAG: wakeup timer flag.
  • ERTC_TSF_FLAG: timestamp flag.
  • ERTC_TSOF_FLAG: timestamp overflow flag.
  • ERTC_TP1F_FLAG: tamper detection 1 flag.
  • ERTC_TP2F_FLAG: tamper detection 2 flag.
  • ERTC_CALUPDF_FLAG: calibration value update completed flag.
Return values
the new state of flag (SET or RESET).

Definition at line 1428 of file at32f415_ertc.c.

Referenced by ertc_wait_flag(), ERTC_WKUP_IRQHandler(), ERTCAlarm_IRQHandler(), and TAMP_STAMP_IRQHandler().

◆ ertc_hour_mode_set()

error_status ertc_hour_mode_set ( ertc_hour_mode_set_type mode )

ertc hour mode set.

Parameters
mode hour mode. this parameter can be one of the following values:
  • ERTC_HOUR_MODE_24: 24-hour format.
  • ERTC_HOUR_MODE_12: 12-hour format.
Return values
error_status (ERROR or SUCCESS).

Definition at line 283 of file at32f415_ertc.c.

Referenced by ertc_config().

◆ ertc_init_mode_enter()

error_status ertc_init_mode_enter ( void )

ertc enter init mode.

Parameters
none.
Return values
error_status (ERROR or SUCCESS).

Definition at line 163 of file at32f415_ertc.c.

Referenced by ertc_coarse_calibration_enable(), ertc_coarse_calibration_set(), ertc_date_set(), ertc_divider_set(), ertc_hour_mode_set(), ertc_refer_clock_detect_enable(), ertc_reset(), and ertc_time_set().

◆ ertc_init_mode_exit()

void ertc_init_mode_exit ( void )

ertc exit init mode.

Parameters
none.
Return values
none.

Definition at line 197 of file at32f415_ertc.c.

Referenced by ertc_coarse_calibration_enable(), ertc_coarse_calibration_set(), ertc_date_set(), ertc_divider_set(), ertc_hour_mode_set(), ertc_refer_clock_detect_enable(), and ertc_time_set().

◆ ertc_interrupt_enable()

void ertc_interrupt_enable | ( | uint32_t | source,
 |  | confirm_state | new_state
 | ) |  |

enable or disable interrupt.

Parameters
source interrupts sources this parameter can be any combination of the following values:
  • ERTC_TP_INT: tamper interrupt.
  • ERTC_ALA_INT: alarm a interrupt.
  • ERTC_ALB_INT: alarm b interrupt.
  • ERTC_WAT_INT: wakeup timer interrupt.
  • ERTC_TS_INT: timestamp interrupt.
new_state (TRUE or FALSE).
Return values
none.

< ertc tamper interrupt

< ertc tamper interrupt

< ertc tamper interrupt

< ertc tamper interrupt

Definition at line 1340 of file at32f415_ertc.c.

Referenced by ertc_alarm_config(), ertc_config(), ertc_tamper_config(), ertc_timestamp_config(), and wakeup_timer_config().

◆ ertc_interrupt_get()

flag_status ertc_interrupt_get ( uint32_t source )

get interrupt status

Parameters
source this parameter can be one of the following values:
  • ERTC_TP_INT: tamper interrupt.
  • ERTC_ALA_INT: alarm a interrupt.
  • ERTC_ALB_INT: alarm b interrupt.
  • ERTC_WAT_INT: wakeup timer interrupt.
  • ERTC_TS_INT: timestamp interrupt.
Return values
flag_status (SET or RESET)

< ertc tamper interrupt

< ertc tamper interrupt

Definition at line 1383 of file at32f415_ertc.c.

◆ ertc_num_to_bcd()

uint8_t ertc_num_to_bcd ( uint8_t num )

number conversion to bcd code.

Parameters
num number(0~99)
Return values
bcd code.

Definition at line 51 of file at32f415_ertc.c.

Referenced by ertc_alarm_set(), ertc_date_set(), and ertc_time_set().

◆ ertc_output_set()

void ertc_output_set | ( | ertc_output_source_type | source,
 |  | ertc_output_polarity_type | polarity,
 |  | ertc_output_type | type
 | ) |  |

set the output mode.

Parameters
source output source. this parameter can be one of the following values:
  • ERTC_OUTPUT_DISABLE: diable output.
  • ERTC_OUTPUT_ALARM_A: output alarm a event.
  • ERTC_OUTPUT_ALARM_B: output alarm b event.
  • ERTC_OUTPUT_WAKEUP: output wakeup event.
polarity output polarity. this parameter can be one of the following values:
  • ERTC_OUTPUT_POLARITY_HIGH: when the event occurs, the output is high.
  • ERTC_OUTPUT_POLARITY_LOW: when the event occurs, the output is low.
type output type. this parameter can be one of the following values:
  • ERTC_OUTPUT_TYPE_OPEN_DRAIN: open drain output.
  • ERTC_OUTPUT_TYPE_PUSH_PULL: push pull output.
Return values
none.

Definition at line 1093 of file at32f415_ertc.c.

◆ ertc_refer_clock_detect_enable()

error_status ertc_refer_clock_detect_enable ( confirm_state new_state )

enable or disable refer clock detect.

Parameters
new_state (TRUE or FALSE).
Return values
error_status (ERROR or SUCCESS).

Definition at line 1036 of file at32f415_ertc.c.

◆ ertc_reset()

error_status ertc_reset ( void )

ertc reset all register.

Parameters
none.
Return values
error_status (ERROR or SUCCESS).

Definition at line 207 of file at32f415_ertc.c.

Referenced by ertc_config().

◆ ertc_smooth_calibration_config()

error_status ertc_smooth_calibration_config | ( | ertc_smooth_cal_period_type | period,
 |  | ertc_smooth_cal_clk_add_type | clk_add,
 |  | uint32_t | clk_dec
 | ) |  |

config the smooth calibration.

Parameters
period calibration period. this parameter can be one of the following values:
  • ERTC_SMOOTH_CAL_PERIOD_32: 32 second calibration period.
  • ERTC_SMOOTH_CAL_PERIOD_16: 16 second calibration period.
  • ERTC_SMOOTH_CAL_PERIOD_8: 8 second calibration period.
clk_add add clock. this parameter can be one of the following values:
  • ERTC_SMOOTH_CAL_CLK_ADD_0: do not increase clock.
  • ERTC_SMOOTH_CAL_CLK_ADD_512: add 512 clocks.
clk_dec decrease clock(0~511).
Return values
error_status (ERROR or SUCCESS).

< ertc calibration value update completed flag

Definition at line 808 of file at32f415_ertc.c.

◆ ertc_sub_second_get()

uint32_t ertc_sub_second_get ( void )

get current sub second.

Parameters
none.
Return values
sub second.

Definition at line 430 of file at32f415_ertc.c.

◆ ertc_tamper_detect_freq_set()

void ertc_tamper_detect_freq_set ( ertc_tamper_detect_freq_type freq )

set the tamper detection frequency.

Parameters
freq tamper detection frequency. this parameter can be one of the following values:
  • ERTC_TAMPER_FREQ_DIV_32768: ERTC_CLK / 32768.
  • ERTC_TAMPER_FREQ_DIV_16384: ERTC_CLK / 16384.
  • ERTC_TAMPER_FREQ_DIV_8192: ERTC_CLK / 8192.
  • ERTC_TAMPER_FREQ_DIV_4096: ERTC_CLK / 4096.
  • ERTC_TAMPER_FREQ_DIV_2048: ERTC_CLK / 2048.
  • ERTC_TAMPER_FREQ_DIV_1024: ERTC_CLK / 1024.
  • ERTC_TAMPER_FREQ_DIV_512: ERTC_CLK / 512.
  • ERTC_TAMPER_FREQ_DIV_256: ERTC_CLK / 256.
Return values
none.

Definition at line 1249 of file at32f415_ertc.c.

◆ ertc_tamper_enable()

void ertc_tamper_enable | ( | ertc_tamper_select_type | tamper_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tamper.

Parameters
tamper_x select the tamper. this parameter can be one of the following values:
  • ERTC_TAMPER_1: tamper 1.
  • ERTC_TAMPER_2: tamper 2.
new_state (TRUE or FALSE).
Return values
none.

Definition at line 1314 of file at32f415_ertc.c.

Referenced by ertc_tamper_config().

◆ ertc_tamper_filter_set()

void ertc_tamper_filter_set ( ertc_tamper_filter_type filter )

set the tamper filter time.

Parameters
filter tamper filter. this parameter can be one of the following values:
  • ERTC_TAMPER_FILTER_DISABLE: disable filter function.
  • ERTC_TAMPER_FILTER_2: 2 consecutive samples arw valid, effective tamper event.
  • ERTC_TAMPER_FILTER_4: 4 consecutive samples arw valid, effective tamper event.
  • ERTC_TAMPER_FILTER_8: 8 consecutive samples arw valid, effective tamper event.
Return values
none.

Definition at line 1224 of file at32f415_ertc.c.

◆ ertc_tamper_precharge_set()

void ertc_tamper_precharge_set ( ertc_tamper_precharge_type precharge )

set the tamper pin pre-charge time.

Parameters
precharge tamper detection pre-charge time this parameter can be one of the following values:
  • ERTC_TAMPER_PR_1_ERTCCLK: pre-charge time is 1 ERTC_CLK.
  • ERTC_TAMPER_PR_2_ERTCCLK: pre-charge time is 2 ERTC_CLK.
  • ERTC_TAMPER_PR_4_ERTCCLK: pre-charge time is 4 ERTC_CLK.
  • ERTC_TAMPER_PR_8_ERTCCLK: pre-charge time is 8 ERTC_CLK.
Return values
none.

Definition at line 1203 of file at32f415_ertc.c.

◆ ertc_tamper_pull_up_enable()

void ertc_tamper_pull_up_enable ( confirm_state new_state )

enable or disable tamper pin pull up.

Parameters
new_state (TRUE or FALSE).
Return values
none.

Definition at line 1182 of file at32f415_ertc.c.

◆ ertc_tamper_timestamp_enable()

void ertc_tamper_timestamp_enable ( confirm_state new_state )

enable or disable trigger timestamp when tamper event occurs.

Parameters
new_state (TRUE or FALSE).
Return values
none.

Definition at line 1294 of file at32f415_ertc.c.

◆ ertc_tamper_valid_edge_set()

void ertc_tamper_valid_edge_set | ( | ertc_tamper_select_type | tamper_x,
 |  | ertc_tamper_valid_edge_type | trigger
 | ) |  |

set the tamper trigger.

Parameters
tamper_x select the tamper. this parameter can be one of the following values:
  • ERTC_TAMPER_1: tamper 1.
  • ERTC_TAMPER_2: tamper 2.
trigger tamper valid edge. this parameter can be one of the following values:
  • ERTC_TAMPER_EDGE_RISING: rising gedge.
  • ERTC_TAMPER_EDGE_FALLING: falling gedge.
  • ERTC_TAMPER_EDGE_LOW: low level.
  • ERTC_TAMPER_EDGE_HIGH: high level.
alarm alarm para.
Return values
none.

Definition at line 1275 of file at32f415_ertc.c.

Referenced by ertc_tamper_config().

◆ ertc_time_adjust()

error_status ertc_time_adjust | ( | ertc_time_adjust_type | add1s,
 |  | uint32_t | decsbs
 | ) |  |

adjust the time.

Parameters
add1s second operation. this parameter can be one of the following values:
  • ERTC_TIME_ADD_NONE: none operation.
  • ERTC_TIME_ADD_1S: add 1 second.
decsbs decrease sub second(0~0x7FFF).
Return values
error_status (ERROR or SUCCESS).

< ertc time adjustment flag

Definition at line 951 of file at32f415_ertc.c.

◆ ertc_time_set()

error_status ertc_time_set | ( | uint8_t | hour,
 |  | uint8_t | min,
 |  | uint8_t | sec,
 |  | ertc_am_pm_type | ampm
 | ) |  |

set time.

Parameters
hour | hour (0~23).
min | minute (0~59).
sec | second (0~59).
ampm hour mode. this parameter can be one of the following values:
  • ERTC_24H: 24-hour format.
  • ERTC_AM: 12-hour format, ante meridiem.
  • ERTC_PM: 12-hour format, post meridiem.
Return values
error_status (ERROR or SUCCESS).

Definition at line 363 of file at32f415_ertc.c.

Referenced by ertc_config().

◆ ertc_timestamp_enable()

void ertc_timestamp_enable ( confirm_state new_state )

enable or disable timestamp.

Parameters
new_state (TRUE or FALSE).
Return values
none.

Definition at line 1132 of file at32f415_ertc.c.

Referenced by ertc_timestamp_config().

◆ ertc_timestamp_get()

void ertc_timestamp_get ( ertc_time_type * time )

get the timestamp.

Parameters
time | time.
date | date.
Return values
none.

Definition at line 1149 of file at32f415_ertc.c.

Referenced by ertc_timestamp_show().

◆ ertc_timestamp_sub_second_get()

uint32_t ertc_timestamp_sub_second_get ( void )

get the timestamp sub second.

Parameters
none.
Return values
timestamp sub second.

Definition at line 1172 of file at32f415_ertc.c.

◆ ertc_timestamp_valid_edge_set()

void ertc_timestamp_valid_edge_set ( ertc_timestamp_valid_edge_type edge )

set the timestamp valid edge.

Parameters
edge calibration period. this parameter can be one of the following values:
  • ERTC_TIMESTAMP_EDGE_RISING : rising edge trigger.
  • ERTC_TIMESTAMP_EDGE_FALLING: falling edge trigger.
Return values
none.

Definition at line 1116 of file at32f415_ertc.c.

Referenced by ertc_timestamp_config().

◆ ertc_wait_flag()

error_status ertc_wait_flag | ( | uint32_t | flag,
 |  | flag_status | status
 | ) |  |

ertc wait flag status.

Parameters
flag flag to wait. this parameter can be one of the following values:
  • ERTC_ALAWF_FLAG: alarm a register allows write flag.
  • ERTC_ALBWF_FLAG: alarm b register allows write flag.
  • ERTC_WATWF_FLAG: wakeup timer register allows write flag.
  • ERTC_TADJF_FLAG: time adjustment flag.
  • ERTC_CALUPDF_FLAG: calibration value update completed flag.
status status to wait. this parameter can be one of the following values:
  • SET.
  • RESET.
Return values
error_status (ERROR or SUCCESS).

Definition at line 138 of file at32f415_ertc.c.

Referenced by ertc_alarm_enable(), ertc_smooth_calibration_config(), ertc_time_adjust(), and ertc_wakeup_enable().

◆ ertc_wait_update()

error_status ertc_wait_update ( void )

ertc wait register update finish.

Parameters
none.
Return values
error_status (ERROR or SUCCESS).

< ertc calendar update flag

Definition at line 97 of file at32f415_ertc.c.

Referenced by ertc_config(), ertc_date_set(), ertc_reset(), ertc_time_adjust(), ertc_time_set(), and main().

◆ ertc_wakeup_clock_set()

void ertc_wakeup_clock_set ( ertc_wakeup_clock_type clock )

set wakeup timer clock.

Parameters
clock wakeup timer clock source. this parameter can be one of the following values:
  • ERTC_WAT_CLK_ERTCCLK_DIV16: ERTC_CLK / 16.
  • ERTC_WAT_CLK_ERTCCLK_DIV8: ERTC_CLK / 8.
  • ERTC_WAT_CLK_ERTCCLK_DIV4: ERTC_CLK / 4.
  • ERTC_WAT_CLK_ERTCCLK_DIV2: ERTC_CLK / 2.
  • ERTC_WAT_CLK_CK_A_16BITS: CK_A, wakeup counter = ERTC_WAT
  • ERTC_WAT_CLK_CK_A_17BITS: CK_A, wakeup counter = ERTC_WAT + 65535.
Return values
none.

Definition at line 731 of file at32f415_ertc.c.

Referenced by wakeup_timer_config().

◆ ertc_wakeup_counter_get()

uint16_t ertc_wakeup_counter_get ( void )

get wakeup counter.

Parameters
none.
Return values
wakeup counter.

Definition at line 763 of file at32f415_ertc.c.

◆ ertc_wakeup_counter_set()

void ertc_wakeup_counter_set ( uint32_t counter )

set wakeup counter.

Parameters
counter wakeup counter(0~65535).
Return values
none.

Definition at line 747 of file at32f415_ertc.c.

Referenced by wakeup_timer_config().

◆ ertc_wakeup_enable()

error_status ertc_wakeup_enable ( confirm_state new_state )

enable or disable wakeup timer.

Parameters
new_state (TRUE or FALSE).
Return values
error_status (ERROR or SUCCESS).

< ertc alarm a register allows write flag

Definition at line 773 of file at32f415_ertc.c.

Referenced by wakeup_timer_config().

◆ ertc_write_protect_disable()

void ertc_write_protect_disable ( void )

disable write protection.

Parameters
none.
Return values
none

Definition at line 86 of file at32f415_ertc.c.

Referenced by ertc_alarm_enable(), ertc_alarm_mask_set(), ertc_alarm_set(), ertc_alarm_sub_second_set(), ertc_alarm_week_date_select(), ertc_bpr_data_write(), ertc_cal_output_enable(), ertc_cal_output_select(), ertc_coarse_calibration_enable(), ertc_coarse_calibration_set(), ertc_date_set(), ertc_daylight_set(), ertc_direct_read_enable(), ertc_divider_set(), ertc_flag_clear(), ertc_hour_mode_set(), ertc_init_mode_enter(), ertc_interrupt_enable(), ertc_output_set(), ertc_refer_clock_detect_enable(), ertc_reset(), ertc_smooth_calibration_config(), ertc_tamper_detect_freq_set(), ertc_tamper_enable(), ertc_tamper_filter_set(), ertc_tamper_precharge_set(), ertc_tamper_pull_up_enable(), ertc_tamper_timestamp_enable(), ertc_tamper_valid_edge_set(), ertc_time_adjust(), ertc_time_set(), ertc_timestamp_enable(), ertc_timestamp_valid_edge_set(), ertc_wait_update(), ertc_wakeup_clock_set(), ertc_wakeup_counter_set(), and ertc_wakeup_enable().

◆ ertc_write_protect_enable()

void ertc_write_protect_enable ( void )

enable write protection.

Parameters
none.
Return values
none

Definition at line 76 of file at32f415_ertc.c.

Referenced by ertc_alarm_enable(), ertc_alarm_mask_set(), ertc_alarm_set(), ertc_alarm_sub_second_set(), ertc_alarm_week_date_select(), ertc_bpr_data_write(), ertc_cal_output_enable(), ertc_cal_output_select(), ertc_coarse_calibration_enable(), ertc_coarse_calibration_set(), ertc_date_set(), ertc_daylight_set(), ertc_direct_read_enable(), ertc_divider_set(), ertc_flag_clear(), ertc_hour_mode_set(), ertc_init_mode_enter(), ertc_interrupt_enable(), ertc_output_set(), ertc_refer_clock_detect_enable(), ertc_reset(), ertc_smooth_calibration_config(), ertc_tamper_detect_freq_set(), ertc_tamper_enable(), ertc_tamper_filter_set(), ertc_tamper_precharge_set(), ertc_tamper_pull_up_enable(), ertc_tamper_timestamp_enable(), ertc_tamper_valid_edge_set(), ertc_time_adjust(), ertc_time_set(), ertc_timestamp_enable(), ertc_timestamp_valid_edge_set(), ertc_wait_flag(), ertc_wait_update(), ertc_wakeup_clock_set(), ertc_wakeup_counter_set(), and ertc_wakeup_enable().


AT32F415 Firmwary Library: ERTC_private_functions

Macros | Functions
ERTC_private_functions
AT32F415_periph_driver » ERTC

Macros

#define ERTC_TIMEOUT ((uint32_t) 0x00360000)

Functions

uint8_t | ertc_num_to_bcd (uint8_t num)
number conversion to bcd code. More...
uint8_t | ertc_bcd_to_num (uint8_t bcd)
bcd code conversion to number. More...
void | ertc_write_protect_enable (void)
enable write protection. More...
void | ertc_write_protect_disable (void)
disable write protection. More...
error_status | ertc_wait_update (void)
ertc wait register update finish. More...
error_status | ertc_wait_flag (uint32_t flag, flag_status status)
ertc wait flag status. More...
error_status | ertc_init_mode_enter (void)
ertc enter init mode. More...
void | ertc_init_mode_exit (void)
ertc exit init mode. More...
error_status | ertc_reset (void)
ertc reset all register. More...
error_status | ertc_divider_set (uint16_t div_a, uint16_t div_b)
ertc division set. More...
error_status | ertc_hour_mode_set (ertc_hour_mode_set_type mode)
ertc hour mode set. More...
error_status | ertc_date_set (uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date. More...
error_status | ertc_time_set (uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time. More...
void | ertc_calendar_get (ertc_time_type *time)
get calendar More...
uint32_t | ertc_sub_second_get (void)
get current sub second. More...
void | ertc_alarm_mask_set (ertc_alarm_type alarm_x, uint32_t mask)
set which bits are irrelevant to the alarm match. More...
void | ertc_alarm_week_date_select (ertc_alarm_type alarm_x, ertc_week_date_select_type wk)
alarm week or date mode select. More...
void | ertc_alarm_set (ertc_alarm_type alarm_x, uint8_t week_date, uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set alarm. More...
void | ertc_alarm_sub_second_set (ertc_alarm_type alarm_x, uint32_t value, ertc_alarm_sbs_mask_type mask)
set alarm sub second. More...
error_status | ertc_alarm_enable (ertc_alarm_type alarm_x, confirm_state new_state)
enable or disable alarm clock. More...
void | ertc_alarm_get (ertc_alarm_type alarm_x, ertc_alarm_value_type *alarm)
get alarm value. More...
uint32_t | ertc_alarm_sub_second_get (ertc_alarm_type alarm_x)
get alarm sub second. More...
void | ertc_wakeup_clock_set (ertc_wakeup_clock_type clock)
set wakeup timer clock. More...
void | ertc_wakeup_counter_set (uint32_t counter)
set wakeup counter. More...
uint16_t | ertc_wakeup_counter_get (void)
get wakeup counter. More...
error_status | ertc_wakeup_enable (confirm_state new_state)
enable or disable wakeup timer. More...
error_status | ertc_smooth_calibration_config (ertc_smooth_cal_period_type period, ertc_smooth_cal_clk_add_type clk_add, uint32_t clk_dec)
config the smooth calibration. More...
error_status | ertc_coarse_calibration_set (ertc_cal_direction_type dir, uint32_t value)
set the coarse digital calibration. More...
error_status | ertc_coarse_calibration_enable (confirm_state new_state)
enable or disable coarse calibration. More...
void | ertc_cal_output_select (ertc_cal_output_select_type output)
calibration output source select. More...
void | ertc_cal_output_enable (confirm_state new_state)
enable or disable calibration output. More...
error_status | ertc_time_adjust (ertc_time_adjust_type add1s, uint32_t decsbs)
adjust the time. More...
void | ertc_daylight_set (ertc_dst_operation_type operation, ertc_dst_save_type save)
config the daylight saving time. More...
uint8_t | ertc_daylight_bpr_get (void)
get the bpr value. More...
error_status | ertc_refer_clock_detect_enable (confirm_state new_state)
enable or disable refer clock detect. More...
void | ertc_direct_read_enable (confirm_state new_state)
enable or disable direct read mode. More...
void | ertc_output_set (ertc_output_source_type source, ertc_output_polarity_type polarity, ertc_output_type type)
set the output mode. More...
void | ertc_timestamp_valid_edge_set (ertc_timestamp_valid_edge_type edge)
set the timestamp valid edge. More...
void | ertc_timestamp_enable (confirm_state new_state)
enable or disable timestamp. More...
void | ertc_timestamp_get (ertc_time_type *time)
get the timestamp. More...
uint32_t | ertc_timestamp_sub_second_get (void)
get the timestamp sub second. More...
void | ertc_tamper_pull_up_enable (confirm_state new_state)
enable or disable tamper pin pull up. More...
void | ertc_tamper_precharge_set (ertc_tamper_precharge_type precharge)
set the tamper pin pre-charge time. More...
void | ertc_tamper_filter_set (ertc_tamper_filter_type filter)
set the tamper filter time. More...
void | ertc_tamper_detect_freq_set (ertc_tamper_detect_freq_type freq)
set the tamper detection frequency. More...
void | ertc_tamper_valid_edge_set (ertc_tamper_select_type tamper_x, ertc_tamper_valid_edge_type trigger)
set the tamper trigger. More...
void | ertc_tamper_timestamp_enable (confirm_state new_state)
enable or disable trigger timestamp when tamper event occurs. More...
void | ertc_tamper_enable (ertc_tamper_select_type tamper_x, confirm_state new_state)
enable or disable tamper. More...
void | ertc_interrupt_enable (uint32_t source, confirm_state new_state)
enable or disable interrupt. More...
flag_status | ertc_interrupt_get (uint32_t source)
get interrupt status More...
flag_status | ertc_flag_get (uint32_t flag)
get flag status. More...
void | ertc_flag_clear (uint32_t flag)
clear flag status More...
void | ertc_bpr_data_write (ertc_dt_type dt, uint32_t data)
write data to the bpr register. More...
uint32_t | ertc_bpr_data_read (ertc_dt_type dt)
read data from bpr register. More...

Detailed Description

Macro Definition Documentation

◆ ERTC_TIMEOUT

#define ERTC_TIMEOUT ((uint32_t) 0x00360000)

Definition at line 44 of file at32f415_ertc.c.

Function Documentation

◆ ertc_alarm_enable()

error_status ertc_alarm_enable | ( | ertc_alarm_type | alarm_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable alarm clock.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
new_state (TRUE or FALSE).
Return values
error_status (ERROR or SUCCESS).

< ertc alarm a register allows write flag

< ertc alarm b register allows write flag

Definition at line 629 of file at32f415_ertc.c.

Referenced by ertc_alarm_config(), ertc_alarm_value_set(), and ertc_config().

◆ ertc_alarm_get()

void ertc_alarm_get | ( | ertc_alarm_type | alarm_x,
 |  | ertc_alarm_value_type * | alarm
 | ) |  |

get alarm value.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
alarm alarm para.
Return values
none.

< ertc alarm don't match all

Definition at line 674 of file at32f415_ertc.c.

Referenced by ertc_alarm_show().

◆ ertc_alarm_mask_set()

void ertc_alarm_mask_set | ( | ertc_alarm_type | alarm_x,
 |  | uint32_t | mask
 | ) |  |

set which bits are irrelevant to the alarm match.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
mask select which bits are irrelevant to the alarm match. this parameter can be one of the following values:
  • ERTC_ALARM_MASK_NONE: match all.
  • ERTC_ALARM_MASK_SEC: don't match seconds.
  • ERTC_ALARM_MASK_MIN: don't match minute.
  • ERTC_ALARM_MASK_HOUR: don't match hour.
  • ERTC_ALARM_MASK_DATE_WEEK: don't match date or week.
  • ERTC_ALARM_MASK_ALL: don't match all.
alarm alarm para.
Return values
none.

< ertc alarm don't match all

< ertc alarm don't match all

Definition at line 458 of file at32f415_ertc.c.

Referenced by ertc_alarm_config(), and ertc_config().

◆ ertc_alarm_set()

void ertc_alarm_set | ( | ertc_alarm_type | alarm_x,
 |  | uint8_t | week_date,
 |  | uint8_t | hour,
 |  | uint8_t | min,
 |  | uint8_t | sec,
 |  | ertc_am_pm_type | ampm
 | ) |  |

set alarm.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
week_day week or date.
  • week: 1~7.
  • date: 1~31.
hour | hour (0~23).
min | minute (0~59).
sec | second (0~59).
ampm hour mode. this parameter can be one of the following values:
  • ERTC_24H: 24-hour format.
  • ERTC_AM: 12-hour format, ante meridiem.
  • ERTC_PM: 12-hour format, post meridiem.
alarm | alarm para.
Return values
none.

Definition at line 538 of file at32f415_ertc.c.

Referenced by ertc_alarm_config(), ertc_alarm_value_set(), and ertc_config().

◆ ertc_alarm_sub_second_get()

uint32_t ertc_alarm_sub_second_get ( ertc_alarm_type alarm_x )

get alarm sub second.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
Return values
sub second.

Definition at line 707 of file at32f415_ertc.c.

◆ ertc_alarm_sub_second_set()

void ertc_alarm_sub_second_set | ( | ertc_alarm_type | alarm_x,
 |  | uint32_t | value,
 |  | ertc_alarm_sbs_mask_type | mask
 | ) |  |

set alarm sub second.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
value sub second value.
mask sub second mask. this parameter can be one of the following values:
  • ERTC_ALARM_SBS_MASK_ALL: do not match the sub-second.
  • ERTC_ALARM_SBS_MASK_14_1: only compare bit [0].
  • ERTC_ALARM_SBS_MASK_14_2: only compare bit [1:0].
  • ERTC_ALARM_SBS_MASK_14_3: only compare bit [2:0].
  • ERTC_ALARM_SBS_MASK_14_4: only compare bit [3:0].
  • ERTC_ALARM_SBS_MASK_14_5: only compare bit [4:0].
  • ERTC_ALARM_SBS_MASK_14_6: only compare bit [5:0].
  • ERTC_ALARM_SBS_MASK_14_7: only compare bit [6:0].
  • ERTC_ALARM_SBS_MASK_14_8: only compare bit [7:0].
  • ERTC_ALARM_SBS_MASK_14_9: only compare bit [8:0].
  • ERTC_ALARM_SBS_MASK_14_10: only compare bit [9:0].
  • ERTC_ALARM_SBS_MASK_14_11: only compare bit [10:0].
  • ERTC_ALARM_SBS_MASK_14_12: only compare bit [11:0].
  • ERTC_ALARM_SBS_MASK_14_13: only compare bit [12:0].
  • ERTC_ALARM_SBS_MASK_14: only compare bit [13:0].
  • ERTC_ALARM_SBS_MASK_NONE: compare bit [14:0].
Return values
none.

Definition at line 600 of file at32f415_ertc.c.

◆ ertc_alarm_week_date_select()

void ertc_alarm_week_date_select | ( | ertc_alarm_type | alarm_x,
 |  | ertc_week_date_select_type | wk
 | ) |  |

alarm week or date mode select.

Parameters
alarm_x select the alarm. this parameter can be one of the following values:
  • ERTC_ALA: alarm a.
  • ERTC_ALB: alarm b.
wk week or date mode select. this parameter can be one of the following values:
  • ERTC_SLECT_DATE: slect date mode.
  • ERTC_SLECT_WEEK: slect week mode.
Return values
none.

Definition at line 500 of file at32f415_ertc.c.

Referenced by ertc_alarm_config(), and ertc_config().

◆ ertc_bcd_to_num()

uint8_t ertc_bcd_to_num ( uint8_t bcd )

bcd code conversion to number.

Parameters
bcd bcd code(0~99).
Return values
number.

Definition at line 66 of file at32f415_ertc.c.

Referenced by ertc_alarm_get(), ertc_calendar_get(), and ertc_timestamp_get().

◆ ertc_bpr_data_read()

uint32_t ertc_bpr_data_read ( ertc_dt_type dt )

read data from bpr register.

Parameters
dt data register this parameter can be one of the following values:
  • ERTC_DT1
  • ERTC_DT2
  • ...
  • ERTC_DT19
  • ERTC_DT20
Return values
data value.

Definition at line 1510 of file at32f415_ertc.c.

Referenced by bpr_reg_check(), is_bpr_reg_reset(), main(), and randnum_test().

◆ ertc_bpr_data_write()

void ertc_bpr_data_write | ( | ertc_dt_type | dt,
 |  | uint32_t | data
 | ) |  |

write data to the bpr register.

Parameters
dt data register this parameter can be one of the following values:
  • ERTC_DT1
  • ERTC_DT2
  • ...
  • ERTC_DT19
  • ERTC_DT20
data data to be write.
Return values
none.

Definition at line 1484 of file at32f415_ertc.c.

Referenced by bpr_reg_write(), and ertc_config().

◆ ertc_cal_output_enable()

void ertc_cal_output_enable ( confirm_state new_state )

enable or disable calibration output.

Parameters
new_state (TRUE or FALSE).
Return values
none.

Definition at line 931 of file at32f415_ertc.c.

◆ ertc_cal_output_select()

void ertc_cal_output_select ( ertc_cal_output_select_type output )

calibration output source select.

Parameters
output output source. this parameter can be one of the following values:
  • ERTC_CAL_OUTPUT_512HZ: output 512 hz.
  • ERTC_CAL_OUTPUT_1HZ: output 1 hz.
Return values
none.

Definition at line 915 of file at32f415_ertc.c.

◆ ertc_calendar_get()

void ertc_calendar_get ( ertc_time_type * time )

get calendar

Parameters
time ertc time.
Return values
none.

Definition at line 404 of file at32f415_ertc.c.

Referenced by ertc_alarm_value_set(), ertc_time_show(), main(), and randnum_test().

◆ ertc_coarse_calibration_enable()

error_status ertc_coarse_calibration_enable ( confirm_state new_state )

enable or disable coarse calibration.

Parameters
new_state (TRUE or FALSE).
Return values
error_status (ERROR or SUCCESS).

Definition at line 885 of file at32f415_ertc.c.

◆ ertc_coarse_calibration_set()

error_status ertc_coarse_calibration_set | ( | ertc_cal_direction_type | dir,
 |  | uint32_t | value
 | ) |  |

set the coarse digital calibration.

Parameters
dir calibration direction. this parameter can be one of the following values:
  • ERTC_CAL_DIR_POSITIVE: positive calibration.
  • ERTC_CAL_DIR_NEGATIVE: negative calibration.
value calibration value(0~31).
Return values
error_status (ERROR or SUCCESS).

Definition at line 856 of file at32f415_ertc.c.

◆ ertc_date_set()

error_status ertc_date_set | ( | uint8_t | year,
 |  | uint8_t | month,
 |  | uint8_t | date,
 |  | uint8_t | week
 | ) |  |

set date.

Parameters
year | year (0~99).
month | month (1~12).
date | date (1~31).
week | week (1~7).
Return values
error_status (ERROR or SUCCESS).

Definition at line 314 of file at32f415_ertc.c.

Referenced by ertc_config().

◆ ertc_daylight_bpr_get()

uint8_t ertc_daylight_bpr_get ( void )

get the bpr value.

Parameters
none.
Return values
bpr value.

Definition at line 1026 of file at32f415_ertc.c.

◆ ertc_daylight_set()

void ertc_daylight_set | ( | ertc_dst_operation_type | operation,
 |  | ertc_dst_save_type | save
 | ) |  |

config the daylight saving time.

Parameters
operation time adjust. this parameter can be one of the following values:
  • ERTC_DST_ADD_1H: add 1 hour.
  • ERTC_DST_DEC_1H: dec 1 hour.
save operation save. this parameter can be one of the following values:
  • ERTC_DST_SAVE_0: set the bpr register value to 0.
  • ERTC_DST_SAVE_1: set the bpr register value to 1.
Return values
none.

Definition at line 1001 of file at32f415_ertc.c.

◆ ertc_direct_read_enable()

void ertc_direct_read_enable ( confirm_state new_state )

enable or disable direct read mode.

Parameters
new_state (TRUE or FALSE).
Return values
none.

Definition at line 1064 of file at32f415_ertc.c.

◆ ertc_divider_set()

error_status ertc_divider_set | ( | uint16_t | div_a,
 |  | uint16_t | div_b
 | ) |  |

ertc division set.

Parameters
div_a | division a (0~0x7F).
div_b | division b (0~0x7FFF).
Return values
error_status (ERROR or SUCCESS).

Definition at line 251 of file at32f415_ertc.c.

Referenced by ertc_config(), and main().

◆ ertc_flag_clear()

void ertc_flag_clear ( uint32_t flag )

clear flag status

Parameters
flag specifies the flag to clear. this parameter can be any combination of the following values:
  • ERTC_ALAWF_FLAG: alarm a register allows write flag.
  • ERTC_ALBWF_FLAG: alarm b register allows write flag.
  • ERTC_WATWF_FLAG: wakeup timer register allows write flag.
  • ERTC_TADJF_FLAG: time adjustment flag.
  • ERTC_INITF_FLAG: calendar initialization flag.
  • ERTC_UPDF_FLAG: calendar update flag.
  • ERTC_IMF_FLAG: enter initialization mode flag.
  • ERTC_ALAF_FLAG: alarm clock a flag.
  • ERTC_ALBF_FLAG: alarm clock b flag.
  • ERTC_WATF_FLAG: wakeup timer flag.
  • ERTC_TSF_FLAG: timestamp flag.
  • ERTC_TSOF_FLAG: timestamp overflow flag.
  • ERTC_TP1F_FLAG: tamper detection 1 flag.
  • ERTC_TP2F_FLAG: tamper detection 2 flag.
  • ERTC_CALUPDF_FLAG: calibration value update completed flag.
Return values
none

Definition at line 1461 of file at32f415_ertc.c.

Referenced by ertc_config(), ertc_tamper_config(), ERTC_WKUP_IRQHandler(), ERTCAlarm_IRQHandler(), main(), and TAMP_STAMP_IRQHandler().

◆ ertc_flag_get()

flag_status ertc_flag_get ( uint32_t flag )

get flag status.

Parameters
flag specifies the flag to check. this parameter can be one of the following values:
  • ERTC_ALAWF_FLAG: alarm a register allows write flag.
  • ERTC_ALBWF_FLAG: alarm b register allows write flag.
  • ERTC_WATWF_FLAG: wakeup timer register allows write flag.
  • ERTC_TADJF_FLAG: time adjustment flag.
  • ERTC_INITF_FLAG: calendar initialization flag.
  • ERTC_UPDF_FLAG: calendar update flag.
  • ERTC_IMF_FLAG: enter initialization mode flag.
  • ERTC_ALAF_FLAG: alarm clock a flag.
  • ERTC_ALBF_FLAG: alarm clock b flag.
  • ERTC_WATF_FLAG: wakeup timer flag.
  • ERTC_TSF_FLAG: timestamp flag.
  • ERTC_TSOF_FLAG: timestamp overflow flag.
  • ERTC_TP1F_FLAG: tamper detection 1 flag.
  • ERTC_TP2F_FLAG: tamper detection 2 flag.
  • ERTC_CALUPDF_FLAG: calibration value update completed flag.
Return values
the new state of flag (SET or RESET).

Definition at line 1428 of file at32f415_ertc.c.

Referenced by ertc_wait_flag(), ERTC_WKUP_IRQHandler(), ERTCAlarm_IRQHandler(), and TAMP_STAMP_IRQHandler().

◆ ertc_hour_mode_set()

error_status ertc_hour_mode_set ( ertc_hour_mode_set_type mode )

ertc hour mode set.

Parameters
mode hour mode. this parameter can be one of the following values:
  • ERTC_HOUR_MODE_24: 24-hour format.
  • ERTC_HOUR_MODE_12: 12-hour format.
Return values
error_status (ERROR or SUCCESS).

Definition at line 283 of file at32f415_ertc.c.

Referenced by ertc_config().

◆ ertc_init_mode_enter()

error_status ertc_init_mode_enter ( void )

ertc enter init mode.

Parameters
none.
Return values
error_status (ERROR or SUCCESS).

Definition at line 163 of file at32f415_ertc.c.

Referenced by ertc_coarse_calibration_enable(), ertc_coarse_calibration_set(), ertc_date_set(), ertc_divider_set(), ertc_hour_mode_set(), ertc_refer_clock_detect_enable(), ertc_reset(), and ertc_time_set().

◆ ertc_init_mode_exit()

void ertc_init_mode_exit ( void )

ertc exit init mode.

Parameters
none.
Return values
none.

Definition at line 197 of file at32f415_ertc.c.

Referenced by ertc_coarse_calibration_enable(), ertc_coarse_calibration_set(), ertc_date_set(), ertc_divider_set(), ertc_hour_mode_set(), ertc_refer_clock_detect_enable(), and ertc_time_set().

◆ ertc_interrupt_enable()

void ertc_interrupt_enable | ( | uint32_t | source,
 |  | confirm_state | new_state
 | ) |  |

enable or disable interrupt.

Parameters
source interrupts sources this parameter can be any combination of the following values:
  • ERTC_TP_INT: tamper interrupt.
  • ERTC_ALA_INT: alarm a interrupt.
  • ERTC_ALB_INT: alarm b interrupt.
  • ERTC_WAT_INT: wakeup timer interrupt.
  • ERTC_TS_INT: timestamp interrupt.
new_state (TRUE or FALSE).
Return values
none.

< ertc tamper interrupt

< ertc tamper interrupt

< ertc tamper interrupt

< ertc tamper interrupt

Definition at line 1340 of file at32f415_ertc.c.

Referenced by ertc_alarm_config(), ertc_config(), ertc_tamper_config(), ertc_timestamp_config(), and wakeup_timer_config().

◆ ertc_interrupt_get()

flag_status ertc_interrupt_get ( uint32_t source )

get interrupt status

Parameters
source this parameter can be one of the following values:
  • ERTC_TP_INT: tamper interrupt.
  • ERTC_ALA_INT: alarm a interrupt.
  • ERTC_ALB_INT: alarm b interrupt.
  • ERTC_WAT_INT: wakeup timer interrupt.
  • ERTC_TS_INT: timestamp interrupt.
Return values
flag_status (SET or RESET)

< ertc tamper interrupt

< ertc tamper interrupt

Definition at line 1383 of file at32f415_ertc.c.

◆ ertc_num_to_bcd()

uint8_t ertc_num_to_bcd ( uint8_t num )

number conversion to bcd code.

Parameters
num number(0~99)
Return values
bcd code.

Definition at line 51 of file at32f415_ertc.c.

Referenced by ertc_alarm_set(), ertc_date_set(), and ertc_time_set().

◆ ertc_output_set()

void ertc_output_set | ( | ertc_output_source_type | source,
 |  | ertc_output_polarity_type | polarity,
 |  | ertc_output_type | type
 | ) |  |

set the output mode.

Parameters
source output source. this parameter can be one of the following values:
  • ERTC_OUTPUT_DISABLE: diable output.
  • ERTC_OUTPUT_ALARM_A: output alarm a event.
  • ERTC_OUTPUT_ALARM_B: output alarm b event.
  • ERTC_OUTPUT_WAKEUP: output wakeup event.
polarity output polarity. this parameter can be one of the following values:
  • ERTC_OUTPUT_POLARITY_HIGH: when the event occurs, the output is high.
  • ERTC_OUTPUT_POLARITY_LOW: when the event occurs, the output is low.
type output type. this parameter can be one of the following values:
  • ERTC_OUTPUT_TYPE_OPEN_DRAIN: open drain output.
  • ERTC_OUTPUT_TYPE_PUSH_PULL: push pull output.
Return values
none.

Definition at line 1093 of file at32f415_ertc.c.

◆ ertc_refer_clock_detect_enable()

error_status ertc_refer_clock_detect_enable ( confirm_state new_state )

enable or disable refer clock detect.

Parameters
new_state (TRUE or FALSE).
Return values
error_status (ERROR or SUCCESS).

Definition at line 1036 of file at32f415_ertc.c.

◆ ertc_reset()

error_status ertc_reset ( void )

ertc reset all register.

Parameters
none.
Return values
error_status (ERROR or SUCCESS).

Definition at line 207 of file at32f415_ertc.c.

Referenced by ertc_config().

◆ ertc_smooth_calibration_config()

error_status ertc_smooth_calibration_config | ( | ertc_smooth_cal_period_type | period,
 |  | ertc_smooth_cal_clk_add_type | clk_add,
 |  | uint32_t | clk_dec
 | ) |  |

config the smooth calibration.

Parameters
period calibration period. this parameter can be one of the following values:
  • ERTC_SMOOTH_CAL_PERIOD_32: 32 second calibration period.
  • ERTC_SMOOTH_CAL_PERIOD_16: 16 second calibration period.
  • ERTC_SMOOTH_CAL_PERIOD_8: 8 second calibration period.
clk_add add clock. this parameter can be one of the following values:
  • ERTC_SMOOTH_CAL_CLK_ADD_0: do not increase clock.
  • ERTC_SMOOTH_CAL_CLK_ADD_512: add 512 clocks.
clk_dec decrease clock(0~511).
Return values
error_status (ERROR or SUCCESS).

< ertc calibration value update completed flag

Definition at line 808 of file at32f415_ertc.c.

◆ ertc_sub_second_get()

uint32_t ertc_sub_second_get ( void )

get current sub second.

Parameters
none.
Return values
sub second.

Definition at line 430 of file at32f415_ertc.c.

◆ ertc_tamper_detect_freq_set()

void ertc_tamper_detect_freq_set ( ertc_tamper_detect_freq_type freq )

set the tamper detection frequency.

Parameters
freq tamper detection frequency. this parameter can be one of the following values:
  • ERTC_TAMPER_FREQ_DIV_32768: ERTC_CLK / 32768.
  • ERTC_TAMPER_FREQ_DIV_16384: ERTC_CLK / 16384.
  • ERTC_TAMPER_FREQ_DIV_8192: ERTC_CLK / 8192.
  • ERTC_TAMPER_FREQ_DIV_4096: ERTC_CLK / 4096.
  • ERTC_TAMPER_FREQ_DIV_2048: ERTC_CLK / 2048.
  • ERTC_TAMPER_FREQ_DIV_1024: ERTC_CLK / 1024.
  • ERTC_TAMPER_FREQ_DIV_512: ERTC_CLK / 512.
  • ERTC_TAMPER_FREQ_DIV_256: ERTC_CLK / 256.
Return values
none.

Definition at line 1249 of file at32f415_ertc.c.

◆ ertc_tamper_enable()

void ertc_tamper_enable | ( | ertc_tamper_select_type | tamper_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tamper.

Parameters
tamper_x select the tamper. this parameter can be one of the following values:
  • ERTC_TAMPER_1: tamper 1.
  • ERTC_TAMPER_2: tamper 2.
new_state (TRUE or FALSE).
Return values
none.

Definition at line 1314 of file at32f415_ertc.c.

Referenced by ertc_tamper_config().

◆ ertc_tamper_filter_set()

void ertc_tamper_filter_set ( ertc_tamper_filter_type filter )

set the tamper filter time.

Parameters
filter tamper filter. this parameter can be one of the following values:
  • ERTC_TAMPER_FILTER_DISABLE: disable filter function.
  • ERTC_TAMPER_FILTER_2: 2 consecutive samples arw valid, effective tamper event.
  • ERTC_TAMPER_FILTER_4: 4 consecutive samples arw valid, effective tamper event.
  • ERTC_TAMPER_FILTER_8: 8 consecutive samples arw valid, effective tamper event.
Return values
none.

Definition at line 1224 of file at32f415_ertc.c.

◆ ertc_tamper_precharge_set()

void ertc_tamper_precharge_set ( ertc_tamper_precharge_type precharge )

set the tamper pin pre-charge time.

Parameters
precharge tamper detection pre-charge time this parameter can be one of the following values:
  • ERTC_TAMPER_PR_1_ERTCCLK: pre-charge time is 1 ERTC_CLK.
  • ERTC_TAMPER_PR_2_ERTCCLK: pre-charge time is 2 ERTC_CLK.
  • ERTC_TAMPER_PR_4_ERTCCLK: pre-charge time is 4 ERTC_CLK.
  • ERTC_TAMPER_PR_8_ERTCCLK: pre-charge time is 8 ERTC_CLK.
Return values
none.

Definition at line 1203 of file at32f415_ertc.c.

◆ ertc_tamper_pull_up_enable()

void ertc_tamper_pull_up_enable ( confirm_state new_state )

enable or disable tamper pin pull up.

Parameters
new_state (TRUE or FALSE).
Return values
none.

Definition at line 1182 of file at32f415_ertc.c.

◆ ertc_tamper_timestamp_enable()

void ertc_tamper_timestamp_enable ( confirm_state new_state )

enable or disable trigger timestamp when tamper event occurs.

Parameters
new_state (TRUE or FALSE).
Return values
none.

Definition at line 1294 of file at32f415_ertc.c.

◆ ertc_tamper_valid_edge_set()

void ertc_tamper_valid_edge_set | ( | ertc_tamper_select_type | tamper_x,
 |  | ertc_tamper_valid_edge_type | trigger
 | ) |  |

set the tamper trigger.

Parameters
tamper_x select the tamper. this parameter can be one of the following values:
  • ERTC_TAMPER_1: tamper 1.
  • ERTC_TAMPER_2: tamper 2.
trigger tamper valid edge. this parameter can be one of the following values:
  • ERTC_TAMPER_EDGE_RISING: rising gedge.
  • ERTC_TAMPER_EDGE_FALLING: falling gedge.
  • ERTC_TAMPER_EDGE_LOW: low level.
  • ERTC_TAMPER_EDGE_HIGH: high level.
alarm alarm para.
Return values
none.

Definition at line 1275 of file at32f415_ertc.c.

Referenced by ertc_tamper_config().

◆ ertc_time_adjust()

error_status ertc_time_adjust | ( | ertc_time_adjust_type | add1s,
 |  | uint32_t | decsbs
 | ) |  |

adjust the time.

Parameters
add1s second operation. this parameter can be one of the following values:
  • ERTC_TIME_ADD_NONE: none operation.
  • ERTC_TIME_ADD_1S: add 1 second.
decsbs decrease sub second(0~0x7FFF).
Return values
error_status (ERROR or SUCCESS).

< ertc time adjustment flag

Definition at line 951 of file at32f415_ertc.c.

◆ ertc_time_set()

error_status ertc_time_set | ( | uint8_t | hour,
 |  | uint8_t | min,
 |  | uint8_t | sec,
 |  | ertc_am_pm_type | ampm
 | ) |  |

set time.

Parameters
hour | hour (0~23).
min | minute (0~59).
sec | second (0~59).
ampm hour mode. this parameter can be one of the following values:
  • ERTC_24H: 24-hour format.
  • ERTC_AM: 12-hour format, ante meridiem.
  • ERTC_PM: 12-hour format, post meridiem.
Return values
error_status (ERROR or SUCCESS).

Definition at line 363 of file at32f415_ertc.c.

Referenced by ertc_config().

◆ ertc_timestamp_enable()

void ertc_timestamp_enable ( confirm_state new_state )

enable or disable timestamp.

Parameters
new_state (TRUE or FALSE).
Return values
none.

Definition at line 1132 of file at32f415_ertc.c.

Referenced by ertc_timestamp_config().

◆ ertc_timestamp_get()

void ertc_timestamp_get ( ertc_time_type * time )

get the timestamp.

Parameters
time | time.
date | date.
Return values
none.

Definition at line 1149 of file at32f415_ertc.c.

Referenced by ertc_timestamp_show().

◆ ertc_timestamp_sub_second_get()

uint32_t ertc_timestamp_sub_second_get ( void )

get the timestamp sub second.

Parameters
none.
Return values
timestamp sub second.

Definition at line 1172 of file at32f415_ertc.c.

◆ ertc_timestamp_valid_edge_set()

void ertc_timestamp_valid_edge_set ( ertc_timestamp_valid_edge_type edge )

set the timestamp valid edge.

Parameters
edge calibration period. this parameter can be one of the following values:
  • ERTC_TIMESTAMP_EDGE_RISING : rising edge trigger.
  • ERTC_TIMESTAMP_EDGE_FALLING: falling edge trigger.
Return values
none.

Definition at line 1116 of file at32f415_ertc.c.

Referenced by ertc_timestamp_config().

◆ ertc_wait_flag()

error_status ertc_wait_flag | ( | uint32_t | flag,
 |  | flag_status | status
 | ) |  |

ertc wait flag status.

Parameters
flag flag to wait. this parameter can be one of the following values:
  • ERTC_ALAWF_FLAG: alarm a register allows write flag.
  • ERTC_ALBWF_FLAG: alarm b register allows write flag.
  • ERTC_WATWF_FLAG: wakeup timer register allows write flag.
  • ERTC_TADJF_FLAG: time adjustment flag.
  • ERTC_CALUPDF_FLAG: calibration value update completed flag.
status status to wait. this parameter can be one of the following values:
  • SET.
  • RESET.
Return values
error_status (ERROR or SUCCESS).

Definition at line 138 of file at32f415_ertc.c.

Referenced by ertc_alarm_enable(), ertc_smooth_calibration_config(), ertc_time_adjust(), and ertc_wakeup_enable().

◆ ertc_wait_update()

error_status ertc_wait_update ( void )

ertc wait register update finish.

Parameters
none.
Return values
error_status (ERROR or SUCCESS).

< ertc calendar update flag

Definition at line 97 of file at32f415_ertc.c.

Referenced by ertc_config(), ertc_date_set(), ertc_reset(), ertc_time_adjust(), ertc_time_set(), and main().

◆ ertc_wakeup_clock_set()

void ertc_wakeup_clock_set ( ertc_wakeup_clock_type clock )

set wakeup timer clock.

Parameters
clock wakeup timer clock source. this parameter can be one of the following values:
  • ERTC_WAT_CLK_ERTCCLK_DIV16: ERTC_CLK / 16.
  • ERTC_WAT_CLK_ERTCCLK_DIV8: ERTC_CLK / 8.
  • ERTC_WAT_CLK_ERTCCLK_DIV4: ERTC_CLK / 4.
  • ERTC_WAT_CLK_ERTCCLK_DIV2: ERTC_CLK / 2.
  • ERTC_WAT_CLK_CK_A_16BITS: CK_A, wakeup counter = ERTC_WAT
  • ERTC_WAT_CLK_CK_A_17BITS: CK_A, wakeup counter = ERTC_WAT + 65535.
Return values
none.

Definition at line 731 of file at32f415_ertc.c.

Referenced by wakeup_timer_config().

◆ ertc_wakeup_counter_get()

uint16_t ertc_wakeup_counter_get ( void )

get wakeup counter.

Parameters
none.
Return values
wakeup counter.

Definition at line 763 of file at32f415_ertc.c.

◆ ertc_wakeup_counter_set()

void ertc_wakeup_counter_set ( uint32_t counter )

set wakeup counter.

Parameters
counter wakeup counter(0~65535).
Return values
none.

Definition at line 747 of file at32f415_ertc.c.

Referenced by wakeup_timer_config().

◆ ertc_wakeup_enable()

error_status ertc_wakeup_enable ( confirm_state new_state )

enable or disable wakeup timer.

Parameters
new_state (TRUE or FALSE).
Return values
error_status (ERROR or SUCCESS).

< ertc alarm a register allows write flag

Definition at line 773 of file at32f415_ertc.c.

Referenced by wakeup_timer_config().

◆ ertc_write_protect_disable()

void ertc_write_protect_disable ( void )

disable write protection.

Parameters
none.
Return values
none

Definition at line 86 of file at32f415_ertc.c.

Referenced by ertc_alarm_enable(), ertc_alarm_mask_set(), ertc_alarm_set(), ertc_alarm_sub_second_set(), ertc_alarm_week_date_select(), ertc_bpr_data_write(), ertc_cal_output_enable(), ertc_cal_output_select(), ertc_coarse_calibration_enable(), ertc_coarse_calibration_set(), ertc_date_set(), ertc_daylight_set(), ertc_direct_read_enable(), ertc_divider_set(), ertc_flag_clear(), ertc_hour_mode_set(), ertc_init_mode_enter(), ertc_interrupt_enable(), ertc_output_set(), ertc_refer_clock_detect_enable(), ertc_reset(), ertc_smooth_calibration_config(), ertc_tamper_detect_freq_set(), ertc_tamper_enable(), ertc_tamper_filter_set(), ertc_tamper_precharge_set(), ertc_tamper_pull_up_enable(), ertc_tamper_timestamp_enable(), ertc_tamper_valid_edge_set(), ertc_time_adjust(), ertc_time_set(), ertc_timestamp_enable(), ertc_timestamp_valid_edge_set(), ertc_wait_update(), ertc_wakeup_clock_set(), ertc_wakeup_counter_set(), and ertc_wakeup_enable().

◆ ertc_write_protect_enable()

void ertc_write_protect_enable ( void )

enable write protection.

Parameters
none.
Return values
none

Definition at line 76 of file at32f415_ertc.c.

Referenced by ertc_alarm_enable(), ertc_alarm_mask_set(), ertc_alarm_set(), ertc_alarm_sub_second_set(), ertc_alarm_week_date_select(), ertc_bpr_data_write(), ertc_cal_output_enable(), ertc_cal_output_select(), ertc_coarse_calibration_enable(), ertc_coarse_calibration_set(), ertc_date_set(), ertc_daylight_set(), ertc_direct_read_enable(), ertc_divider_set(), ertc_flag_clear(), ertc_hour_mode_set(), ertc_init_mode_enter(), ertc_interrupt_enable(), ertc_output_set(), ertc_refer_clock_detect_enable(), ertc_reset(), ertc_smooth_calibration_config(), ertc_tamper_detect_freq_set(), ertc_tamper_enable(), ertc_tamper_filter_set(), ertc_tamper_precharge_set(), ertc_tamper_pull_up_enable(), ertc_tamper_timestamp_enable(), ertc_tamper_valid_edge_set(), ertc_time_adjust(), ertc_time_set(), ertc_timestamp_enable(), ertc_timestamp_valid_edge_set(), ertc_wait_flag(), ertc_wait_update(), ertc_wakeup_clock_set(), ertc_wakeup_counter_set(), and ertc_wakeup_enable().


AT32F415 Firmwary Library: EXINT

Modules | Macros
EXINT
AT32F415_periph_driver

EXINT driver modules. More...

Modules

EXINT_lines
EXINT_exported_types
EXINT_exported_functions
EXINT_private_functions

Macros

#define EXINT ((exint_type *) EXINT_BASE)

Detailed Description

EXINT driver modules.

Macro Definition Documentation

◆ EXINT

#define EXINT ((exint_type *) EXINT_BASE)

Definition at line 203 of file at32f415_exint.h.


AT32F415 Firmwary Library: EXINT_lines

Macros
EXINT_lines
AT32F415_periph_driver » EXINT

Macros

#define | EXINT_LINE_NONE ((uint32_t)0x000000)
#define | EXINT_LINE_0 ((uint32_t)0x000001)
#define | EXINT_LINE_1 ((uint32_t)0x000002)
#define | EXINT_LINE_2 ((uint32_t)0x000004)
#define | EXINT_LINE_3 ((uint32_t)0x000008)
#define | EXINT_LINE_4 ((uint32_t)0x000010)
#define | EXINT_LINE_5 ((uint32_t)0x000020)
#define | EXINT_LINE_6 ((uint32_t)0x000040)
#define | EXINT_LINE_7 ((uint32_t)0x000080)
#define | EXINT_LINE_8 ((uint32_t)0x000100)
#define | EXINT_LINE_9 ((uint32_t)0x000200)
#define | EXINT_LINE_10 ((uint32_t)0x000400)
#define | EXINT_LINE_11 ((uint32_t)0x000800)
#define | EXINT_LINE_12 ((uint32_t)0x001000)
#define | EXINT_LINE_13 ((uint32_t)0x002000)
#define | EXINT_LINE_14 ((uint32_t)0x004000)
#define | EXINT_LINE_15 ((uint32_t)0x008000)
#define | EXINT_LINE_16 ((uint32_t)0x010000)
#define | EXINT_LINE_17 ((uint32_t)0x020000)
#define | EXINT_LINE_18 ((uint32_t)0x040000)
#define | EXINT_LINE_19 ((uint32_t)0x080000)
#define | EXINT_LINE_20 ((uint32_t)0x100000)
#define | EXINT_LINE_21 ((uint32_t)0x200000)
#define | EXINT_LINE_22 ((uint32_t)0x400000)

Detailed Description

Macro Definition Documentation

◆ EXINT_LINE_0

#define EXINT_LINE_0 ((uint32_t)0x000001)

external interrupt line 0

Definition at line 52 of file at32f415_exint.h.

◆ EXINT_LINE_1

#define EXINT_LINE_1 ((uint32_t)0x000002)

external interrupt line 1

Definition at line 53 of file at32f415_exint.h.

◆ EXINT_LINE_10

#define EXINT_LINE_10 ((uint32_t)0x000400)

external interrupt line 10

Definition at line 62 of file at32f415_exint.h.

◆ EXINT_LINE_11

#define EXINT_LINE_11 ((uint32_t)0x000800)

external interrupt line 11

Definition at line 63 of file at32f415_exint.h.

◆ EXINT_LINE_12

#define EXINT_LINE_12 ((uint32_t)0x001000)

external interrupt line 12

Definition at line 64 of file at32f415_exint.h.

◆ EXINT_LINE_13

#define EXINT_LINE_13 ((uint32_t)0x002000)

external interrupt line 13

Definition at line 65 of file at32f415_exint.h.

◆ EXINT_LINE_14

#define EXINT_LINE_14 ((uint32_t)0x004000)

external interrupt line 14

Definition at line 66 of file at32f415_exint.h.

◆ EXINT_LINE_15

#define EXINT_LINE_15 ((uint32_t)0x008000)

external interrupt line 15

Definition at line 67 of file at32f415_exint.h.

◆ EXINT_LINE_16

#define EXINT_LINE_16 ((uint32_t)0x010000)

external interrupt line 16 connected to the pvm output

Definition at line 68 of file at32f415_exint.h.

◆ EXINT_LINE_17

#define EXINT_LINE_17 ((uint32_t)0x020000)

external interrupt line 17 connected to the rtc alarm event

Definition at line 69 of file at32f415_exint.h.

◆ EXINT_LINE_18

#define EXINT_LINE_18 ((uint32_t)0x040000)

external interrupt line 18 connected to the otg fs wakeup from suspend event

Definition at line 70 of file at32f415_exint.h.

◆ EXINT_LINE_19

#define EXINT_LINE_19 ((uint32_t)0x080000)

external interrupt line 19 connected to the comp1

Definition at line 71 of file at32f415_exint.h.

◆ EXINT_LINE_2

#define EXINT_LINE_2 ((uint32_t)0x000004)

external interrupt line 2

Definition at line 54 of file at32f415_exint.h.

◆ EXINT_LINE_20

#define EXINT_LINE_20 ((uint32_t)0x100000)

external interrupt line 20 connected to the comp1

Definition at line 72 of file at32f415_exint.h.

◆ EXINT_LINE_21

#define EXINT_LINE_21 ((uint32_t)0x200000)

external interrupt line 21 connected to the rtc temper and timestamp event

Definition at line 73 of file at32f415_exint.h.

◆ EXINT_LINE_22

#define EXINT_LINE_22 ((uint32_t)0x400000)

external interrupt line 22 connected to the rtc wakeup event

Definition at line 74 of file at32f415_exint.h.

◆ EXINT_LINE_3

#define EXINT_LINE_3 ((uint32_t)0x000008)

external interrupt line 3

Definition at line 55 of file at32f415_exint.h.

◆ EXINT_LINE_4

#define EXINT_LINE_4 ((uint32_t)0x000010)

external interrupt line 4

Definition at line 56 of file at32f415_exint.h.

◆ EXINT_LINE_5

#define EXINT_LINE_5 ((uint32_t)0x000020)

external interrupt line 5

Definition at line 57 of file at32f415_exint.h.

◆ EXINT_LINE_6

#define EXINT_LINE_6 ((uint32_t)0x000040)

external interrupt line 6

Definition at line 58 of file at32f415_exint.h.

◆ EXINT_LINE_7

#define EXINT_LINE_7 ((uint32_t)0x000080)

external interrupt line 7

Definition at line 59 of file at32f415_exint.h.

◆ EXINT_LINE_8

#define EXINT_LINE_8 ((uint32_t)0x000100)

external interrupt line 8

Definition at line 60 of file at32f415_exint.h.

◆ EXINT_LINE_9

#define EXINT_LINE_9 ((uint32_t)0x000200)

external interrupt line 9

Definition at line 61 of file at32f415_exint.h.

◆ EXINT_LINE_NONE

#define EXINT_LINE_NONE ((uint32_t)0x000000)

Definition at line 51 of file at32f415_exint.h.


AT32F415 Firmwary Library: EXINT_exported_types

Data Structures | Enumerations
EXINT_exported_types
AT32F415_periph_driver » EXINT

Data Structures

struct | exint_init_type
exint init type More...
struct | exint_type
type define exint register all More...

Enumerations

enum | exint_line_mode_type { EXINT_LINE_INTERRUPUT = 0x00 , EXINT_LINE_EVENT = 0x01 }
exint line mode type More...
enum | exint_polarity_config_type { EXINT_TRIGGER_RISING_EDGE = 0x00 , EXINT_TRIGGER_FALLING_EDGE = 0x01 , EXINT_TRIGGER_BOTH_EDGE = 0x02 }
exint polarity configuration type More...

Detailed Description

Enumeration Type Documentation

◆ exint_line_mode_type

enum exint_line_mode_type

exint line mode type

Enumerator
EXINT_LINE_INTERRUPUT | external interrupt line interrupt mode
EXINT_LINE_EVENT | external interrupt line event mode

Definition at line 87 of file at32f415_exint.h.

◆ exint_polarity_config_type

enum exint_polarity_config_type

exint polarity configuration type

Enumerator
EXINT_TRIGGER_RISING_EDGE | external interrupt line rising trigger mode
EXINT_TRIGGER_FALLING_EDGE | external interrupt line falling trigger mode
EXINT_TRIGGER_BOTH_EDGE | external interrupt line both rising and falling trigger mode

Definition at line 96 of file at32f415_exint.h.


AT32F415 Firmwary Library: exint_init_type Struct Reference

Data Fields
exint_init_type Struct Reference
AT32F415_periph_driver » EXINT » EXINT_exported_types

exint init type More...

#include <at32f415_exint.h>

Data Fields

exint_line_mode_type line_mode
uint32_t line_select
exint_polarity_config_type line_polarity
confirm_state line_enable

Detailed Description

exint init type

Definition at line 106 of file at32f415_exint.h.

Field Documentation

◆ line_enable

confirm_state exint_init_type::line_enable

enable or disable exint

Definition at line 111 of file at32f415_exint.h.

Referenced by button_exint_init(), cmp_exint_init(), ertc_alarm_config(), ertc_tamper_config(), ertc_timestamp_config(), exint_config(), exint_default_para_init(), exint_init(), exint_line0_config(), exint_line4_config(), main(), pvm_exint_config(), usart_configuration(), and wakeup_timer_config().

◆ line_mode

exint_line_mode_type exint_init_type::line_mode

choose mode event or interrupt mode

Definition at line 108 of file at32f415_exint.h.

Referenced by button_exint_init(), cmp_exint_init(), ertc_alarm_config(), ertc_tamper_config(), ertc_timestamp_config(), exint_config(), exint_default_para_init(), exint_init(), exint_line0_config(), exint_line4_config(), main(), pvm_exint_config(), usart_configuration(), and wakeup_timer_config().

◆ line_polarity

exint_polarity_config_type exint_init_type::line_polarity

select the tregger polarity, with rising edge, falling edge or both edge

Definition at line 110 of file at32f415_exint.h.

Referenced by button_exint_init(), cmp_exint_init(), ertc_alarm_config(), ertc_tamper_config(), ertc_timestamp_config(), exint_config(), exint_default_para_init(), exint_init(), exint_line0_config(), exint_line4_config(), main(), pvm_exint_config(), usart_configuration(), and wakeup_timer_config().

◆ line_select

uint32_t exint_init_type::line_select

select the exint line, availiable for single line or multiple lines

Definition at line 109 of file at32f415_exint.h.

Referenced by button_exint_init(), cmp_exint_init(), ertc_alarm_config(), ertc_tamper_config(), ertc_timestamp_config(), exint_config(), exint_default_para_init(), exint_init(), exint_line0_config(), exint_line4_config(), main(), pvm_exint_config(), usart_configuration(), and wakeup_timer_config().

The documentation for this struct was generated from the following file:
  • at32f415_exint.h


AT32F415 Firmwary Library: exint_type Struct Reference

Data Fields
exint_type Struct Reference
AT32F415_periph_driver » EXINT » EXINT_exported_types

type define exint register all More...

#include <at32f415_exint.h>

Data Fields

union {
__IO uint32_t inten
struct {
__IO uint32_t intenx: 23
__IO uint32_t reserved1: 9
} inten_bit
};
exint inten register, offset:0x00 More...
union {
__IO uint32_t evten
struct {
__IO uint32_t evtenx: 23
__IO uint32_t reserved1: 9
} evten_bit
};
exint evten register, offset:0x04 More...
union {
__IO uint32_t polcfg1
struct {
__IO uint32_t rpx: 23
__IO uint32_t reserved1: 9
} polcfg1_bit
};
exint polcfg1 register, offset:0x08 More...
union {
__IO uint32_t polcfg2
struct {
__IO uint32_t fpx: 23
__IO uint32_t reserved1: 9
} polcfg2_bit
};
exint polcfg2 register, offset:0x0C More...
union {
__IO uint32_t swtrg
struct {
__IO uint32_t swtx: 23
__IO uint32_t reserved1: 9
} swtrg_bit
};
exint swtrg register, offset:0x10 More...
union {
__IO uint32_t intsts
struct {
__IO uint32_t linex: 23
__IO uint32_t reserved1: 9
} intsts_bit
};
exint intsts register, offset:0x14 More...

Detailed Description

type define exint register all

Definition at line 117 of file at32f415_exint.h.

Field Documentation

◆

union { ... } exint_type::@341

exint inten register, offset:0x00

◆

union { ... } exint_type::@343

exint evten register, offset:0x04

◆

union { ... } exint_type::@345

exint polcfg1 register, offset:0x08

◆

union { ... } exint_type::@347

exint polcfg2 register, offset:0x0C

◆

union { ... } exint_type::@349

exint swtrg register, offset:0x10

◆

union { ... } exint_type::@351

exint intsts register, offset:0x14

◆ evten

__IO uint32_t exint_type::evten

Definition at line 138 of file at32f415_exint.h.

◆

struct { ... } exint_type::evten_bit

◆ evtenx

__IO uint32_t exint_type::evtenx

Definition at line 141 of file at32f415_exint.h.

◆ fpx

__IO uint32_t exint_type::fpx

Definition at line 167 of file at32f415_exint.h.

◆ inten

__IO uint32_t exint_type::inten

Definition at line 125 of file at32f415_exint.h.

◆

struct { ... } exint_type::inten_bit

◆ intenx

__IO uint32_t exint_type::intenx

Definition at line 128 of file at32f415_exint.h.

◆ intsts

__IO uint32_t exint_type::intsts

Definition at line 190 of file at32f415_exint.h.

◆

struct { ... } exint_type::intsts_bit

◆ linex

__IO uint32_t exint_type::linex

Definition at line 193 of file at32f415_exint.h.

◆ polcfg1

__IO uint32_t exint_type::polcfg1

Definition at line 151 of file at32f415_exint.h.

◆

struct { ... } exint_type::polcfg1_bit

◆ polcfg2

__IO uint32_t exint_type::polcfg2

Definition at line 164 of file at32f415_exint.h.

◆

struct { ... } exint_type::polcfg2_bit

◆ reserved1

__IO uint32_t exint_type::reserved1

Definition at line 129 of file at32f415_exint.h.

◆ rpx

__IO uint32_t exint_type::rpx

Definition at line 154 of file at32f415_exint.h.

◆ swtrg

__IO uint32_t exint_type::swtrg

Definition at line 177 of file at32f415_exint.h.

◆

struct { ... } exint_type::swtrg_bit

◆ swtx

__IO uint32_t exint_type::swtx

Definition at line 180 of file at32f415_exint.h.

The documentation for this struct was generated from the following file:
  • at32f415_exint.h


AT32F415 Firmwary Library: EXINT_exported_functions

Functions
EXINT_exported_functions
AT32F415_periph_driver » EXINT

Functions

void | exint_reset (void)
exint reset More...
void | exint_default_para_init (exint_init_type *exint_struct)
exint default para init More...
void | exint_init (exint_init_type *exint_struct)
exint init More...
void | exint_flag_clear (uint32_t exint_line)
clear exint flag More...
flag_status | exint_flag_get (uint32_t exint_line)
get exint flag More...
void | exint_software_interrupt_event_generate (uint32_t exint_line)
generate exint software interrupt event More...
void | exint_interrupt_enable (uint32_t exint_line, confirm_state new_state)
enable or disable exint interrupt More...
void | exint_event_enable (uint32_t exint_line, confirm_state new_state)
enable or disable exint event More...

Detailed Description

Function Documentation

◆ exint_default_para_init()

void exint_default_para_init ( exint_init_type * exint_struct )

exint default para init

Parameters
exint_struct
  • to the structure of exint_init_type
Return values
none

Definition at line 64 of file at32f415_exint.c.

Referenced by button_exint_init(), cmp_exint_init(), ertc_tamper_config(), ertc_timestamp_config(), exint_config(), exint_line0_config(), exint_line4_config(), main(), usart_configuration(), and wakeup_timer_config().

◆ exint_event_enable()

void exint_event_enable | ( | uint32_t | exint_line,
 |  | confirm_state | new_state
 | ) |  |

enable or disable exint event

Parameters
exint_line this parameter can be any combination of the following values:
  • EXINT_LINE_0
  • EXINT_LINE_1 ...
  • EXINT_LINE_21
  • EXINT_LINE_22
new_state new state of exint event. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 212 of file at32f415_exint.c.

◆ exint_flag_clear()

void exint_flag_clear ( uint32_t exint_line )

clear exint flag

Parameters
exint_line this parameter can be any combination of the following values:
  • EXINT_LINE_0
  • EXINT_LINE_1 ...
  • EXINT_LINE_21
  • EXINT_LINE_22
Return values
none

Definition at line 126 of file at32f415_exint.c.

Referenced by button_isr(), CMP1_IRQHandler(), ERTC_WKUP_IRQHandler(), ERTCAlarm_IRQHandler(), EXINT0_IRQHandler(), EXINT4_IRQHandler(), EXINT9_5_IRQHandler(), main(), PVM_IRQHandler(), TAMP_STAMP_IRQHandler(), and usart_configuration().

◆ exint_flag_get()

flag_status exint_flag_get ( uint32_t exint_line )

get exint flag

Parameters
exint_line this parameter can be one of the following values:
  • EXINT_LINE_0
  • EXINT_LINE_1 ...
  • EXINT_LINE_21
  • EXINT_LINE_22
Return values
the new state of exint flag(SET or RESET).

Definition at line 142 of file at32f415_exint.c.

Referenced by CMP1_IRQHandler(), EXINT0_IRQHandler(), EXINT4_IRQHandler(), main(), and PVM_IRQHandler().

◆ exint_init()

void exint_init ( exint_init_type * exint_struct )

exint init

Parameters
exint_struct
  • to the structure of exint_init_type
Return values
none

Definition at line 78 of file at32f415_exint.c.

Referenced by button_exint_init(), cmp_exint_init(), ertc_alarm_config(), ertc_tamper_config(), ertc_timestamp_config(), exint_config(), exint_line0_config(), exint_line4_config(), main(), pvm_exint_config(), usart_configuration(), and wakeup_timer_config().

◆ exint_interrupt_enable()

void exint_interrupt_enable | ( | uint32_t | exint_line,
 |  | confirm_state | new_state
 | ) |  |

enable or disable exint interrupt

Parameters
exint_line this parameter can be any combination of the following values:
  • EXINT_LINE_0
  • EXINT_LINE_1 ...
  • EXINT_LINE_21
  • EXINT_LINE_22
new_state new state of exint interrupt. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 187 of file at32f415_exint.c.

◆ exint_reset()

void exint_reset ( void )

exint reset

Parameters
none
Return values
none

Definition at line 49 of file at32f415_exint.c.

◆ exint_software_interrupt_event_generate()

void exint_software_interrupt_event_generate ( uint32_t exint_line )

generate exint software interrupt event

Parameters
exint_line this parameter can be one of the following values:
  • EXINT_LINE_0
  • EXINT_LINE_1 ...
  • EXINT_LINE_21
  • EXINT_LINE_22
Return values
none

Definition at line 169 of file at32f415_exint.c.

Referenced by TMR1_OVF_TMR10_IRQHandler().


AT32F415 Firmwary Library: EXINT_private_functions

Functions
EXINT_private_functions
AT32F415_periph_driver » EXINT

Functions

void | exint_reset (void)
exint reset More...
void | exint_default_para_init (exint_init_type *exint_struct)
exint default para init More...
void | exint_init (exint_init_type *exint_struct)
exint init More...
void | exint_flag_clear (uint32_t exint_line)
clear exint flag More...
flag_status | exint_flag_get (uint32_t exint_line)
get exint flag More...
void | exint_software_interrupt_event_generate (uint32_t exint_line)
generate exint software interrupt event More...
void | exint_interrupt_enable (uint32_t exint_line, confirm_state new_state)
enable or disable exint interrupt More...
void | exint_event_enable (uint32_t exint_line, confirm_state new_state)
enable or disable exint event More...

Detailed Description

Function Documentation

◆ exint_default_para_init()

void exint_default_para_init ( exint_init_type * exint_struct )

exint default para init

Parameters
exint_struct
  • to the structure of exint_init_type
Return values
none

Definition at line 64 of file at32f415_exint.c.

Referenced by button_exint_init(), cmp_exint_init(), ertc_tamper_config(), ertc_timestamp_config(), exint_config(), exint_line0_config(), exint_line4_config(), main(), usart_configuration(), and wakeup_timer_config().

◆ exint_event_enable()

void exint_event_enable | ( | uint32_t | exint_line,
 |  | confirm_state | new_state
 | ) |  |

enable or disable exint event

Parameters
exint_line this parameter can be any combination of the following values:
  • EXINT_LINE_0
  • EXINT_LINE_1 ...
  • EXINT_LINE_21
  • EXINT_LINE_22
new_state new state of exint event. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 212 of file at32f415_exint.c.

◆ exint_flag_clear()

void exint_flag_clear ( uint32_t exint_line )

clear exint flag

Parameters
exint_line this parameter can be any combination of the following values:
  • EXINT_LINE_0
  • EXINT_LINE_1 ...
  • EXINT_LINE_21
  • EXINT_LINE_22
Return values
none

Definition at line 126 of file at32f415_exint.c.

Referenced by button_isr(), CMP1_IRQHandler(), ERTC_WKUP_IRQHandler(), ERTCAlarm_IRQHandler(), EXINT0_IRQHandler(), EXINT4_IRQHandler(), EXINT9_5_IRQHandler(), main(), PVM_IRQHandler(), TAMP_STAMP_IRQHandler(), and usart_configuration().

◆ exint_flag_get()

flag_status exint_flag_get ( uint32_t exint_line )

get exint flag

Parameters
exint_line this parameter can be one of the following values:
  • EXINT_LINE_0
  • EXINT_LINE_1 ...
  • EXINT_LINE_21
  • EXINT_LINE_22
Return values
the new state of exint flag(SET or RESET).

Definition at line 142 of file at32f415_exint.c.

Referenced by CMP1_IRQHandler(), EXINT0_IRQHandler(), EXINT4_IRQHandler(), main(), and PVM_IRQHandler().

◆ exint_init()

void exint_init ( exint_init_type * exint_struct )

exint init

Parameters
exint_struct
  • to the structure of exint_init_type
Return values
none

Definition at line 78 of file at32f415_exint.c.

Referenced by button_exint_init(), cmp_exint_init(), ertc_alarm_config(), ertc_tamper_config(), ertc_timestamp_config(), exint_config(), exint_line0_config(), exint_line4_config(), main(), pvm_exint_config(), usart_configuration(), and wakeup_timer_config().

◆ exint_interrupt_enable()

void exint_interrupt_enable | ( | uint32_t | exint_line,
 |  | confirm_state | new_state
 | ) |  |

enable or disable exint interrupt

Parameters
exint_line this parameter can be any combination of the following values:
  • EXINT_LINE_0
  • EXINT_LINE_1 ...
  • EXINT_LINE_21
  • EXINT_LINE_22
new_state new state of exint interrupt. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 187 of file at32f415_exint.c.

◆ exint_reset()

void exint_reset ( void )

exint reset

Parameters
none
Return values
none

Definition at line 49 of file at32f415_exint.c.

◆ exint_software_interrupt_event_generate()

void exint_software_interrupt_event_generate ( uint32_t exint_line )

generate exint software interrupt event

Parameters
exint_line this parameter can be one of the following values:
  • EXINT_LINE_0
  • EXINT_LINE_1 ...
  • EXINT_LINE_21
  • EXINT_LINE_22
Return values
none

Definition at line 169 of file at32f415_exint.c.

Referenced by TMR1_OVF_TMR10_IRQHandler().


AT32F415 Firmwary Library: FLASH

Modules | Macros
FLASH
AT32F415_periph_driver

FLASH driver modules. More...

Modules

FLASH_keys
flash keys
FLASH_flags
flash flag
FLASH_interrupts
flash interrupts
FLASH_slib_mask
flash slib mask
FLASH_user_system_data
flash user system data
FLASH_timeout_definition
flash timeout definition
FLASH_exported_types
FLASH_exported_functions
FLASH_private_functions

Macros

#define | flash_psr_set(wtcyc) (FLASH->psr |= (uint32_t)(0x150 | wtcyc))
set the flash psr register More...
#define | FLASH ((flash_type *) FLASH_REG_BASE)
#define | USD ((usd_type *) USD_BASE)

Detailed Description

FLASH driver modules.

Macro Definition Documentation

◆ FLASH

#define FLASH ((flash_type *) FLASH_REG_BASE)

Definition at line 507 of file at32f415_flash.h.

◆ flash_psr_set

#define flash_psr_set ( wtcyc ) (FLASH->psr |= (uint32_t)(0x150 | wtcyc))

set the flash psr register

Parameters
wtcyc the flash wait cycle. this parameter can be one of the following values:
  • FLASH_WAIT_CYCLE_0
  • FLASH_WAIT_CYCLE_1
  • FLASH_WAIT_CYCLE_2
  • FLASH_WAIT_CYCLE_3
  • FLASH_WAIT_CYCLE_4

Definition at line 144 of file at32f415_flash.h.

◆ USD

#define USD ((usd_type *) USD_BASE)

Definition at line 508 of file at32f415_flash.h.


AT32F415 Firmwary Library: FLASH_keys

Macros
FLASH_keys
AT32F415_periph_driver » FLASH

flash keys More...

Macros

#define | FLASH_UNLOCK_KEY1 ((uint32_t)0x45670123)
#define | FLASH_UNLOCK_KEY2 ((uint32_t)0xCDEF89AB)
#define | FAP_RELIEVE_KEY ((uint16_t)0x00A5)
#define | FAP_HIGH_LEVEL_KEY ((uint16_t)0x00CC)
#define | SLIB_UNLOCK_KEY ((uint32_t)0xA35F6D24)

Detailed Description

flash keys

Macro Definition Documentation

◆ FAP_HIGH_LEVEL_KEY

#define FAP_HIGH_LEVEL_KEY ((uint16_t)0x00CC)

flash fap high level enable key val

Definition at line 56 of file at32f415_flash.h.

◆ FAP_RELIEVE_KEY

#define FAP_RELIEVE_KEY ((uint16_t)0x00A5)

flash fap relieve key val

Definition at line 55 of file at32f415_flash.h.

◆ FLASH_UNLOCK_KEY1

#define FLASH_UNLOCK_KEY1 ((uint32_t)0x45670123)

flash operation unlock order key1

Definition at line 53 of file at32f415_flash.h.

◆ FLASH_UNLOCK_KEY2

#define FLASH_UNLOCK_KEY2 ((uint32_t)0xCDEF89AB)

flash operation unlock order key2

Definition at line 54 of file at32f415_flash.h.

◆ SLIB_UNLOCK_KEY

#define SLIB_UNLOCK_KEY ((uint32_t)0xA35F6D24)

flash slib operation unlock order key

Definition at line 57 of file at32f415_flash.h.


AT32F415 Firmwary Library: FLASH_flags

Macros
FLASH_flags
AT32F415_periph_driver » FLASH

flash flag More...

Macros

#define | FLASH_OBF_FLAG ((uint32_t)0x00000001)
#define | FLASH_ODF_FLAG ((uint32_t)0x00000020)
#define | FLASH_PRGMERR_FLAG ((uint32_t)0x00000004)
#define | FLASH_EPPERR_FLAG ((uint32_t)0x00000010)
#define | FLASH_USDERR_FLAG ((uint32_t)0x40000001)

Detailed Description

flash flag

Macro Definition Documentation

◆ FLASH_EPPERR_FLAG

#define FLASH_EPPERR_FLAG ((uint32_t)0x00000010)

flash erase/program protection error flag

Definition at line 71 of file at32f415_flash.h.

◆ FLASH_OBF_FLAG

#define FLASH_OBF_FLAG ((uint32_t)0x00000001)

flash operate busy flag

Definition at line 68 of file at32f415_flash.h.

◆ FLASH_ODF_FLAG

#define FLASH_ODF_FLAG ((uint32_t)0x00000020)

flash operate done flag

Definition at line 69 of file at32f415_flash.h.

◆ FLASH_PRGMERR_FLAG

#define FLASH_PRGMERR_FLAG ((uint32_t)0x00000004)

flash program error flag

Definition at line 70 of file at32f415_flash.h.

◆ FLASH_USDERR_FLAG

#define FLASH_USDERR_FLAG ((uint32_t)0x40000001)

flash user system data error flag

Definition at line 72 of file at32f415_flash.h.


AT32F415 Firmwary Library: FLASH_interrupts

Macros
FLASH_interrupts
AT32F415_periph_driver » FLASH

flash interrupts More...

Macros

#define | FLASH_ERR_INT ((uint32_t)0x00000001)
#define | FLASH_ODF_INT ((uint32_t)0x00000002)

Detailed Description

flash interrupts

Macro Definition Documentation

◆ FLASH_ERR_INT

#define FLASH_ERR_INT ((uint32_t)0x00000001)

flash error interrupt

Definition at line 83 of file at32f415_flash.h.

◆ FLASH_ODF_INT

#define FLASH_ODF_INT ((uint32_t)0x00000002)

flash operate done interrupt

Definition at line 84 of file at32f415_flash.h.


AT32F415 Firmwary Library: FLASH_slib_mask

Macros
FLASH_slib_mask
AT32F415_periph_driver » FLASH

flash slib mask More...

Macros

#define | FLASH_SLIB_START_SECTOR ((uint32_t)0x000007FF)
#define | FLASH_SLIB_DATA_START_SECTOR ((uint32_t)0x003FF800)
#define | FLASH_SLIB_END_SECTOR ((uint32_t)0xFFC00000)

Detailed Description

flash slib mask

Macro Definition Documentation

◆ FLASH_SLIB_DATA_START_SECTOR

#define FLASH_SLIB_DATA_START_SECTOR ((uint32_t)0x003FF800)

flash slib d-bus area start sector

Definition at line 96 of file at32f415_flash.h.

◆ FLASH_SLIB_END_SECTOR

#define FLASH_SLIB_END_SECTOR ((uint32_t)0xFFC00000)

flash slib end sector

Definition at line 97 of file at32f415_flash.h.

◆ FLASH_SLIB_START_SECTOR

#define FLASH_SLIB_START_SECTOR ((uint32_t)0x000007FF)

flash slib start sector

Definition at line 95 of file at32f415_flash.h.


AT32F415 Firmwary Library: FLASH_user_system_data

Macros
FLASH_user_system_data
AT32F415_periph_driver » FLASH

flash user system data More...

Macros

#define | USD_WDT_ATO_DISABLE ((uint16_t)0x0001)
#define | USD_WDT_ATO_ENABLE ((uint16_t)0x0000)
#define | USD_DEPSLP_NO_RST ((uint16_t)0x0002)
#define | USD_DEPSLP_RST ((uint16_t)0x0000)
#define | USD_STDBY_NO_RST ((uint16_t)0x0004)
#define | USD_STDBY_RST ((uint16_t)0x0000)

Detailed Description

flash user system data

Macro Definition Documentation

◆ USD_DEPSLP_NO_RST

#define USD_DEPSLP_NO_RST ((uint16_t)0x0002)

no reset generated when entering in deepsleep

Definition at line 111 of file at32f415_flash.h.

◆ USD_DEPSLP_RST

#define USD_DEPSLP_RST ((uint16_t)0x0000)

reset generated when entering in deepsleep

Definition at line 112 of file at32f415_flash.h.

◆ USD_STDBY_NO_RST

#define USD_STDBY_NO_RST ((uint16_t)0x0004)

no reset generated when entering in standby

Definition at line 114 of file at32f415_flash.h.

◆ USD_STDBY_RST

#define USD_STDBY_RST ((uint16_t)0x0000)

reset generated when entering in standby

Definition at line 115 of file at32f415_flash.h.

◆ USD_WDT_ATO_DISABLE

#define USD_WDT_ATO_DISABLE ((uint16_t)0x0001)

wdt auto start disabled

Definition at line 108 of file at32f415_flash.h.

◆ USD_WDT_ATO_ENABLE

#define USD_WDT_ATO_ENABLE ((uint16_t)0x0000)

wdt auto start enabled

Definition at line 109 of file at32f415_flash.h.


AT32F415 Firmwary Library: FLASH_timeout_definition

Macros
FLASH_timeout_definition
AT32F415_periph_driver » FLASH

flash timeout definition More...

Macros

#define | ERASE_TIMEOUT ((uint32_t)0x40000000)
#define | PROGRAMMING_TIMEOUT ((uint32_t)0x00100000)
#define | OPERATION_TIMEOUT ((uint32_t)0x10000000)

Detailed Description

flash timeout definition

Macro Definition Documentation

◆ ERASE_TIMEOUT

#define ERASE_TIMEOUT ((uint32_t)0x40000000)

internal flash erase operation timeout

Definition at line 126 of file at32f415_flash.h.

◆ OPERATION_TIMEOUT

#define OPERATION_TIMEOUT ((uint32_t)0x10000000)

flash common operation timeout

Definition at line 128 of file at32f415_flash.h.

◆ PROGRAMMING_TIMEOUT

#define PROGRAMMING_TIMEOUT ((uint32_t)0x00100000)

internal flash program operation timeout

Definition at line 127 of file at32f415_flash.h.


AT32F415 Firmwary Library: FLASH_exported_types

Data Structures | Enumerations
FLASH_exported_types
AT32F415_periph_driver » FLASH

Data Structures

struct | flash_type
type define flash register all More...
struct | usd_type
user system data More...

Enumerations

enum flash_status_type {
FLASH_OPERATE_BUSY = 0x00 , FLASH_PROGRAM_ERROR = 0x01 , FLASH_EPP_ERROR = 0x02 , FLASH_OPERATE_DONE = 0x03 ,
FLASH_OPERATE_TIMEOUT = 0x04
}
flash status type More...
enum flash_wait_cycle_type {
FLASH_WAIT_CYCLE_0 = 0x00 , FLASH_WAIT_CYCLE_1 = 0x01 , FLASH_WAIT_CYCLE_2 = 0x02 , FLASH_WAIT_CYCLE_3 = 0x03 ,
FLASH_WAIT_CYCLE_4 = 0x04
}
flash wait cycle type More...

Detailed Description

Enumeration Type Documentation

◆ flash_status_type

enum flash_status_type

flash status type

Enumerator
FLASH_OPERATE_BUSY | flash status is operate busy
FLASH_PROGRAM_ERROR | flash status is program error
FLASH_EPP_ERROR | flash status is epp error
FLASH_OPERATE_DONE | flash status is operate done
FLASH_OPERATE_TIMEOUT | flash status is operate timeout

Definition at line 153 of file at32f415_flash.h.

◆ flash_wait_cycle_type

enum flash_wait_cycle_type

flash wait cycle type

Enumerator
FLASH_WAIT_CYCLE_0 | sysclk 1~32mhz
FLASH_WAIT_CYCLE_1 | sysclk 33~64mhz
FLASH_WAIT_CYCLE_2 | sysclk 65~96mhz
FLASH_WAIT_CYCLE_3 | sysclk 97~120mhz
FLASH_WAIT_CYCLE_4 | sysclk 121~150mhz

Definition at line 165 of file at32f415_flash.h.


AT32F415 Firmwary Library: flash_type Struct Reference

Data Fields
flash_type Struct Reference
AT32F415_periph_driver » FLASH » FLASH_exported_types

type define flash register all More...

#include <at32f415_flash.h>

Data Fields

union {
__IO uint32_t psr
struct {
__IO uint32_t wtcyc: 3
__IO uint32_t hfcyc_en: 1
__IO uint32_t pft_en: 1
__IO uint32_t pft_enf: 1
__IO uint32_t reserved1: 26
} psr_bit
};
flash psr register, offset:0x00 More...
union {
__IO uint32_t unlock
struct {
__IO uint32_t ukval: 32
} unlock_bit
};
flash unlock register, offset:0x04 More...
union {
__IO uint32_t usd_unlock
struct {
__IO uint32_t usd_ukval: 32
} usd_unlock_bit
};
flash usd unlock register, offset:0x08 More...
union {
__IO uint32_t sts
struct {
__IO uint32_t obf: 1
__IO uint32_t reserved1: 1
__IO uint32_t prgmerr: 1
__IO uint32_t reserved2: 1
__IO uint32_t epperr: 1
__IO uint32_t odf: 1
__IO uint32_t reserved3: 26
} sts_bit
};
flash sts register, offset:0x0C More...
union {
__IO uint32_t ctrl
struct {
__IO uint32_t fprgm: 1
__IO uint32_t secers: 1
__IO uint32_t bankers: 1
__IO uint32_t reserved1: 1
__IO uint32_t usdprgm: 1
__IO uint32_t usders: 1
__IO uint32_t erstr: 1
__IO uint32_t oplk: 1
__IO uint32_t reserved2: 1
__IO uint32_t usdulks: 1
__IO uint32_t errie: 1
__IO uint32_t reserved3: 1
__IO uint32_t odfie: 1
__IO uint32_t reserved4: 3
__IO uint32_t fap_hl_dis: 1
__IO uint32_t reserved5: 15
} ctrl_bit
};
flash ctrl register, offset:0x10 More...
union {
__IO uint32_t addr
struct {
__IO uint32_t fa: 32
} addr_bit
};
flash addr register, offset:0x14 More...
union {
__IO uint32_t usd
struct {
__IO uint32_t usderr: 1
__IO uint32_t fap: 1
__IO uint32_t wdt_ato_en: 1
__IO uint32_t depslp_rst: 1
__IO uint32_t stdby_rst: 1
__IO uint32_t reserved1: 5
__IO uint32_t user_d0: 8
__IO uint32_t user_d1: 8
__IO uint32_t fap_hl: 1
__IO uint32_t reserved2: 5
} usd_bit
};
flash usd register, offset:0x1C More...
union {
__IO uint32_t epps
struct {
__IO uint32_t epps: 32
} epps_bit
};
flash epps register, offset:0x20 More...
union {
__IO uint32_t slib_sts0
struct {
__IO uint32_t btm_ap_enf: 1
__IO uint32_t reserved1: 1
__IO uint32_t em_slib_enf: 1
__IO uint32_t slib_enf: 1
__IO uint32_t reserved2: 12
__IO uint32_t em_slib_dat_ss: 8
__IO uint32_t reserved3: 8
} slib_sts0_bit
};
flash slib_sts0 register, offset:0x74 More...
union {
__IO uint32_t slib_sts1
struct {
__IO uint32_t slib_ss: 11
__IO uint32_t slib_dat_ss: 11
__IO uint32_t slib_es: 10
} slib_sts1_bit
};
flash slib_sts1 register, offset:0x78 More...
union {
__IO uint32_t slib_pwd_clr
struct {
__IO uint32_t slib_pclr_val: 32
} slib_pwd_clr_bit
};
flash slib_pwd_clr register, offset:0x7C More...
union {
__IO uint32_t slib_misc_sts
struct {
__IO uint32_t slib_pwd_err: 1
__IO uint32_t slib_pwd_ok: 1
__IO uint32_t slib_ulkf: 1
__IO uint32_t reserved1: 29
} slib_misc_sts_bit
};
flash slib_misc_sts register, offset:0x80 More...
union {
__IO uint32_t crc_addr
struct {
__IO uint32_t crc_addr: 32
} crc_addr_bit
};
flash crc_addr register, offset:0x84 More...
union {
__IO uint32_t crc_ctrl
struct {
__IO uint32_t crc_sn: 16
__IO uint32_t crc_strt: 1
__IO uint32_t reserved1: 15
} crc_ctrl_bit
};
flash crc_ctrl register, offset:0x88 More...
union {
__IO uint32_t crc_chkr
struct {
__IO uint32_t crc_chkr: 32
} crc_chkr_bit
};
flash crc_chkr register, offset:0x8C More...
union {
__IO uint32_t slib_set_pwd
struct {
__IO uint32_t slib_pset_val: 32
} slib_set_pwd_bit
};
flash slib_set_pwd register, offset:0x160 More...
union {
__IO uint32_t slib_set_range
struct {
__IO uint32_t slib_ss_set: 11
__IO uint32_t slib_dss_set: 11
__IO uint32_t slib_es_set: 10
} slib_set_range_bit
};
flash slib_set_range register, offset:0x164 More...
union {
__IO uint32_t em_slib_set
struct {
__IO uint32_t em_slib_set: 16
__IO uint32_t em_slib_iss_set: 8
__IO uint32_t reserved1: 8
} em_slib_set_bit
};
flash em_slib_set register, offset:0x168 More...
union {
__IO uint32_t btm_mode_set
struct {
__IO uint32_t btm_mode_set: 8
__IO uint32_t reserved1: 24
} btm_mode_set_bit
};
flash btm_mode_set register, offset:0x16C More...
union {
__IO uint32_t slib_unlock
struct {
__IO uint32_t slib_ukval: 32
} slib_unlock_bit
};
flash slib_unlock register, offset:0x170 More...

Detailed Description

type define flash register all

Definition at line 177 of file at32f415_flash.h.

Field Documentation

◆

union { ... } flash_type::@359

flash psr register, offset:0x00

◆

union { ... } flash_type::@361

flash unlock register, offset:0x04

◆

union { ... } flash_type::@363

flash usd unlock register, offset:0x08

◆

union { ... } flash_type::@365

flash sts register, offset:0x0C

◆

union { ... } flash_type::@367

flash ctrl register, offset:0x10

◆

union { ... } flash_type::@369

flash addr register, offset:0x14

◆

union { ... } flash_type::@371

flash usd register, offset:0x1C

◆

union { ... } flash_type::@373

flash epps register, offset:0x20

◆

union { ... } flash_type::@375

flash slib_sts0 register, offset:0x74

◆

union { ... } flash_type::@377

flash slib_sts1 register, offset:0x78

◆

union { ... } flash_type::@379

flash slib_pwd_clr register, offset:0x7C

◆

union { ... } flash_type::@381

flash slib_misc_sts register, offset:0x80

◆

union { ... } flash_type::@383

flash crc_addr register, offset:0x84

◆

union { ... } flash_type::@385

flash crc_ctrl register, offset:0x88

◆

union { ... } flash_type::@387

flash crc_chkr register, offset:0x8C

◆

union { ... } flash_type::@389

flash slib_set_pwd register, offset:0x160

◆

union { ... } flash_type::@391

flash slib_set_range register, offset:0x164

◆

union { ... } flash_type::@393

flash em_slib_set register, offset:0x168

◆

union { ... } flash_type::@395

flash btm_mode_set register, offset:0x16C

◆

union { ... } flash_type::@397

flash slib_unlock register, offset:0x170

◆ addr

__IO uint32_t flash_type::addr

Definition at line 269 of file at32f415_flash.h.

◆

struct { ... } flash_type::addr_bit

◆ bankers

__IO uint32_t flash_type::bankers

Definition at line 247 of file at32f415_flash.h.

◆ btm_ap_enf

__IO uint32_t flash_type::btm_ap_enf

Definition at line 327 of file at32f415_flash.h.

◆ btm_mode_set

__IO uint32_t flash_type::btm_mode_set

Definition at line 466 of file at32f415_flash.h.

◆

struct { ... } flash_type::btm_mode_set_bit

◆ crc_addr

__IO uint32_t flash_type::crc_addr

Definition at line 383 of file at32f415_flash.h.

◆

struct { ... } flash_type::crc_addr_bit

◆ crc_chkr

__IO uint32_t flash_type::crc_chkr

Definition at line 409 of file at32f415_flash.h.

◆

struct { ... } flash_type::crc_chkr_bit

◆ crc_ctrl

__IO uint32_t flash_type::crc_ctrl

Definition at line 395 of file at32f415_flash.h.

◆

struct { ... } flash_type::crc_ctrl_bit

◆ crc_sn

__IO uint32_t flash_type::crc_sn

Definition at line 398 of file at32f415_flash.h.

◆ crc_strt

__IO uint32_t flash_type::crc_strt

Definition at line 399 of file at32f415_flash.h.

◆ ctrl

__IO uint32_t flash_type::ctrl

Definition at line 242 of file at32f415_flash.h.

◆

struct { ... } flash_type::ctrl_bit

◆ depslp_rst

__IO uint32_t flash_type::depslp_rst

Definition at line 292 of file at32f415_flash.h.

◆ em_slib_dat_ss

__IO uint32_t flash_type::em_slib_dat_ss

Definition at line 332 of file at32f415_flash.h.

◆ em_slib_enf

__IO uint32_t flash_type::em_slib_enf

Definition at line 329 of file at32f415_flash.h.

◆ em_slib_iss_set

__IO uint32_t flash_type::em_slib_iss_set

Definition at line 456 of file at32f415_flash.h.

◆ em_slib_set

__IO uint32_t flash_type::em_slib_set

Definition at line 452 of file at32f415_flash.h.

◆

struct { ... } flash_type::em_slib_set_bit

◆ epperr

__IO uint32_t flash_type::epperr

Definition at line 231 of file at32f415_flash.h.

◆ epps

__IO uint32_t flash_type::epps

Definition at line 307 of file at32f415_flash.h.

◆

struct { ... } flash_type::epps_bit

◆ errie

__IO uint32_t flash_type::errie

Definition at line 255 of file at32f415_flash.h.

◆ erstr

__IO uint32_t flash_type::erstr

Definition at line 251 of file at32f415_flash.h.

◆ fa

__IO uint32_t flash_type::fa

Definition at line 272 of file at32f415_flash.h.

◆ fap

__IO uint32_t flash_type::fap

Definition at line 290 of file at32f415_flash.h.

◆ fap_hl

__IO uint32_t flash_type::fap_hl

Definition at line 297 of file at32f415_flash.h.

◆ fap_hl_dis

__IO uint32_t flash_type::fap_hl_dis

Definition at line 259 of file at32f415_flash.h.

◆ fprgm

__IO uint32_t flash_type::fprgm

Definition at line 245 of file at32f415_flash.h.

◆ hfcyc_en

__IO uint32_t flash_type::hfcyc_en

Definition at line 188 of file at32f415_flash.h.

◆ obf

__IO uint32_t flash_type::obf

Definition at line 227 of file at32f415_flash.h.

◆ odf

__IO uint32_t flash_type::odf

Definition at line 232 of file at32f415_flash.h.

◆ odfie

__IO uint32_t flash_type::odfie

Definition at line 257 of file at32f415_flash.h.

◆ oplk

__IO uint32_t flash_type::oplk

Definition at line 252 of file at32f415_flash.h.

◆ pft_en

__IO uint32_t flash_type::pft_en

Definition at line 189 of file at32f415_flash.h.

◆ pft_enf

__IO uint32_t flash_type::pft_enf

Definition at line 190 of file at32f415_flash.h.

◆ prgmerr

__IO uint32_t flash_type::prgmerr

Definition at line 229 of file at32f415_flash.h.

◆ psr

__IO uint32_t flash_type::psr

Definition at line 184 of file at32f415_flash.h.

◆

struct { ... } flash_type::psr_bit

◆ reserved1

__IO uint32_t flash_type::reserved1

flash reserved1 register, offset:0x18

Definition at line 191 of file at32f415_flash.h.

◆ reserved2

__IO uint32_t flash_type::reserved2

flash reserved2 register, offset:0x70~0x24

Definition at line 230 of file at32f415_flash.h.

◆ reserved3

__IO uint32_t flash_type::reserved3

flash reserved3 register, offset:0x15C~0x90

Definition at line 233 of file at32f415_flash.h.

◆ reserved4

__IO uint32_t flash_type::reserved4

Definition at line 258 of file at32f415_flash.h.

◆ reserved5

__IO uint32_t flash_type::reserved5

Definition at line 260 of file at32f415_flash.h.

◆ secers

__IO uint32_t flash_type::secers

Definition at line 246 of file at32f415_flash.h.

◆ slib_dat_ss

__IO uint32_t flash_type::slib_dat_ss

Definition at line 346 of file at32f415_flash.h.

◆ slib_dss_set

__IO uint32_t flash_type::slib_dss_set

Definition at line 442 of file at32f415_flash.h.

◆ slib_enf

__IO uint32_t flash_type::slib_enf

Definition at line 330 of file at32f415_flash.h.

◆ slib_es

__IO uint32_t flash_type::slib_es

Definition at line 347 of file at32f415_flash.h.

◆ slib_es_set

__IO uint32_t flash_type::slib_es_set

Definition at line 443 of file at32f415_flash.h.

◆ slib_misc_sts

__IO uint32_t flash_type::slib_misc_sts

Definition at line 368 of file at32f415_flash.h.

◆

struct { ... } flash_type::slib_misc_sts_bit

◆ slib_pclr_val

__IO uint32_t flash_type::slib_pclr_val

Definition at line 359 of file at32f415_flash.h.

◆ slib_pset_val

__IO uint32_t flash_type::slib_pset_val

Definition at line 429 of file at32f415_flash.h.

◆ slib_pwd_clr

__IO uint32_t flash_type::slib_pwd_clr

Definition at line 356 of file at32f415_flash.h.

◆

struct { ... } flash_type::slib_pwd_clr_bit

◆ slib_pwd_err

__IO uint32_t flash_type::slib_pwd_err

Definition at line 371 of file at32f415_flash.h.

◆ slib_pwd_ok

__IO uint32_t flash_type::slib_pwd_ok

Definition at line 372 of file at32f415_flash.h.

◆ slib_set_pwd

__IO uint32_t flash_type::slib_set_pwd

Definition at line 426 of file at32f415_flash.h.

◆

struct { ... } flash_type::slib_set_pwd_bit

◆ slib_set_range

__IO uint32_t flash_type::slib_set_range

Definition at line 438 of file at32f415_flash.h.

◆

struct { ... } flash_type::slib_set_range_bit

◆ slib_ss

__IO uint32_t flash_type::slib_ss

Definition at line 345 of file at32f415_flash.h.

◆ slib_ss_set

__IO uint32_t flash_type::slib_ss_set

Definition at line 441 of file at32f415_flash.h.

◆ slib_sts0

__IO uint32_t flash_type::slib_sts0

Definition at line 324 of file at32f415_flash.h.

◆

struct { ... } flash_type::slib_sts0_bit

◆ slib_sts1

__IO uint32_t flash_type::slib_sts1

Definition at line 342 of file at32f415_flash.h.

◆

struct { ... } flash_type::slib_sts1_bit

◆ slib_ukval

__IO uint32_t flash_type::slib_ukval

Definition at line 482 of file at32f415_flash.h.

◆ slib_ulkf

__IO uint32_t flash_type::slib_ulkf

Definition at line 373 of file at32f415_flash.h.

◆ slib_unlock

__IO uint32_t flash_type::slib_unlock

Definition at line 479 of file at32f415_flash.h.

◆

struct { ... } flash_type::slib_unlock_bit

◆ stdby_rst

__IO uint32_t flash_type::stdby_rst

Definition at line 293 of file at32f415_flash.h.

◆ sts

__IO uint32_t flash_type::sts

Definition at line 224 of file at32f415_flash.h.

◆

struct { ... } flash_type::sts_bit

◆ ukval

__IO uint32_t flash_type::ukval

Definition at line 203 of file at32f415_flash.h.

◆ unlock

__IO uint32_t flash_type::unlock

Definition at line 200 of file at32f415_flash.h.

◆

struct { ... } flash_type::unlock_bit

◆ usd

__IO uint32_t flash_type::usd

Definition at line 286 of file at32f415_flash.h.

◆

struct { ... } flash_type::usd_bit

◆ usd_ukval

__IO uint32_t flash_type::usd_ukval

Definition at line 215 of file at32f415_flash.h.

◆ usd_unlock

__IO uint32_t flash_type::usd_unlock

Definition at line 212 of file at32f415_flash.h.

◆

struct { ... } flash_type::usd_unlock_bit

◆ usderr

__IO uint32_t flash_type::usderr

Definition at line 289 of file at32f415_flash.h.

◆ usders

__IO uint32_t flash_type::usders

Definition at line 250 of file at32f415_flash.h.

◆ usdprgm

__IO uint32_t flash_type::usdprgm

Definition at line 249 of file at32f415_flash.h.

◆ usdulks

__IO uint32_t flash_type::usdulks

Definition at line 254 of file at32f415_flash.h.

◆ user_d0

__IO uint32_t flash_type::user_d0

Definition at line 295 of file at32f415_flash.h.

◆ user_d1

__IO uint32_t flash_type::user_d1

Definition at line 296 of file at32f415_flash.h.

◆ wdt_ato_en

__IO uint32_t flash_type::wdt_ato_en

Definition at line 291 of file at32f415_flash.h.

◆ wtcyc

__IO uint32_t flash_type::wtcyc

Definition at line 187 of file at32f415_flash.h.

The documentation for this struct was generated from the following file:
  • at32f415_flash.h


AT32F415 Firmwary Library: usd_type Struct Reference

Data Fields
usd_type Struct Reference
AT32F415_periph_driver » FLASH » FLASH_exported_types

user system data More...

#include <at32f415_flash.h>

Data Fields

__IO uint16_t | fap
__IO uint16_t | ssb
__IO uint16_t | data0
__IO uint16_t | data1
__IO uint16_t | epp0
__IO uint16_t | epp1
__IO uint16_t | epp2
__IO uint16_t | epp3

Detailed Description

user system data

Definition at line 491 of file at32f415_flash.h.

Field Documentation

◆ data0

__IO uint16_t usd_type::data0

Definition at line 495 of file at32f415_flash.h.

◆ data1

__IO uint16_t usd_type::data1

Definition at line 496 of file at32f415_flash.h.

◆ epp0

__IO uint16_t usd_type::epp0

Definition at line 497 of file at32f415_flash.h.

◆ epp1

__IO uint16_t usd_type::epp1

Definition at line 498 of file at32f415_flash.h.

◆ epp2

__IO uint16_t usd_type::epp2

Definition at line 499 of file at32f415_flash.h.

◆ epp3

__IO uint16_t usd_type::epp3

Definition at line 500 of file at32f415_flash.h.

◆ fap

__IO uint16_t usd_type::fap

Definition at line 493 of file at32f415_flash.h.

◆ ssb

__IO uint16_t usd_type::ssb

Definition at line 494 of file at32f415_flash.h.

The documentation for this struct was generated from the following file:
  • at32f415_flash.h


AT32F415 Firmwary Library: FLASH_exported_functions

Functions
FLASH_exported_functions
AT32F415_periph_driver » FLASH

Functions

flag_status | flash_flag_get (uint32_t flash_flag)
check whether the specified flash flag is set or not. More...
void | flash_flag_clear (uint32_t flash_flag)
clear the flash flag. More...
flash_status_type | flash_operation_status_get (void)
return the flash operation status. More...
flash_status_type | flash_operation_wait_for (uint32_t time_out)
wait for flash operation complete or timeout. More...
void | flash_unlock (void)
unlock the flash controller. More...
void | flash_lock (void)
lock the flash controller. More...
flash_status_type | flash_sector_erase (uint32_t sector_address)
erase a specified flash sector. More...
flash_status_type | flash_internal_all_erase (void)
erase flash all internal sectors. More...
flash_status_type | flash_user_system_data_erase (void)
erase the flash user system data. More...
flash_status_type | flash_word_program (uint32_t address, uint32_t data)
program a word at a specified address. More...
flash_status_type | flash_halfword_program (uint32_t address, uint16_t data)
program a halfword at a specified address. More...
flash_status_type | flash_byte_program (uint32_t address, uint8_t data)
program a byte at a specified address. More...
flash_status_type | flash_user_system_data_program (uint32_t address, uint8_t data)
program a halfword at a specified user system data address. More...
flash_status_type | flash_epp_set (uint32_t *sector_bits)
config erase/program protection for the desired sectors. More...
void | flash_epp_status_get (uint32_t *sector_bits)
return the flash erase/program protection status. More...
flash_status_type | flash_fap_enable (confirm_state new_state)
enable or disable the flash access protection. More...
flag_status | flash_fap_status_get (void)
check the flash access protection status. More...
flash_status_type | flash_fap_high_level_enable (confirm_state new_state)
enable or disable the flash access protection high level. More...
flag_status | flash_fap_high_level_status_get (void)
check the flash access protection high level status. More...
flash_status_type | flash_ssb_set (uint8_t usd_ssb)
program the flash system setting byte in usd: wdt_ato_en / depslp_rst / stdby_rst . More...
uint8_t | flash_ssb_status_get (void)
return the flash system setting byte status. More...
void | flash_interrupt_enable (uint32_t flash_int, confirm_state new_state)
enable or disable the specified flash interrupts. More...
flash_status_type | flash_slib_enable (uint32_t pwd, uint16_t start_sector, uint16_t data_start_sector, uint16_t end_sector)
enable main block security library function. More...
error_status | flash_slib_disable (uint32_t pwd)
disable main block slib when slib enabled. More...
flag_status | flash_slib_state_get (void)
get the main block slib state. More...
uint16_t | flash_slib_start_sector_get (void)
get the main block start sector of slib. More...
uint16_t | flash_slib_datastart_sector_get (void)
get the main block data start sector of slib. More...
uint16_t | flash_slib_end_sector_get (void)
get the main block end sector of slib. More...
uint32_t | flash_crc_calibrate (uint32_t start_addr, uint32_t sector_cnt)
flash crc calibration. More...
void | flash_boot_memory_extension_mode_enable (void)
enable boot memory as extension mode. More...
flash_status_type | flash_extension_memory_slib_enable (uint32_t pwd, uint16_t data_start_sector)
enable extension memory security library function. More...
flag_status | flash_extension_memory_slib_state_get (void)
get the extension memory slib state. More...
uint16_t | flash_em_slib_datastart_sector_get (void)
get the extension memory data start sector of slib. More...

Detailed Description

Function Documentation

◆ flash_boot_memory_extension_mode_enable()

void flash_boot_memory_extension_mode_enable ( void )

enable boot memory as extension mode.

Note
this function is irreversible, can not disable!!!
Parameters
none
Return values
none.

< flash slib operation unlock order key

< flash common operation timeout

Definition at line 806 of file at32f415_flash.c.

◆ flash_byte_program()

flash_status_type flash_byte_program | ( | uint32_t | address,
 |  | uint8_t | data
 | ) |  |

program a byte at a specified address.

Parameters
address | specifies the address to be programmed.
data | specifies the data to be programmed.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< internal flash program operation timeout

Definition at line 342 of file at32f415_flash.c.

Referenced by flash_write_data(), and msc_disk_write().

◆ flash_crc_calibrate()

uint32_t flash_crc_calibrate | ( | uint32_t | start_addr,
 |  | uint32_t | sector_cnt
 | ) |  |

flash crc calibration.

Parameters
start_addr crc calibration start sector address sector_cnt: crc calibration sector count
Return values
uint32 crc calibration result

< flash common operation timeout

Definition at line 792 of file at32f415_flash.c.

◆ flash_em_slib_datastart_sector_get()

uint16_t flash_em_slib_datastart_sector_get ( void )

get the extension memory data start sector of slib.

Parameters
none
Return values
uint16_t

Definition at line 863 of file at32f415_flash.c.

◆ flash_epp_set()

flash_status_type flash_epp_set ( uint32_t * sector_bits )

config erase/program protection for the desired sectors.

Parameters
sector_bits the pointer of the address of the sectors to be erase/program protected. the first 31 bits general every bit is used to protect 2 sectors. the bit 31 is used to protect the rest sectors and extension memory.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< flash operation unlock order key1

< flash operation unlock order key2

< internal flash program operation timeout

< internal flash program operation timeout

< internal flash program operation timeout

< internal flash program operation timeout

Definition at line 403 of file at32f415_flash.c.

◆ flash_epp_status_get()

void flash_epp_status_get ( uint32_t * sector_bits )

return the flash erase/program protection status.

Parameters
sector_bits pointer to get the epps register.
Return values
none

Definition at line 457 of file at32f415_flash.c.

◆ flash_extension_memory_slib_enable()

flash_status_type flash_extension_memory_slib_enable | ( | uint32_t | pwd,
 |  | uint16_t | data_start_sector
 | ) |  |

enable extension memory security library function.

Parameters
pwd slib password data_start_sector: extension memory security library d-bus area start sector, range 1~17 or 0xFF
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< flash slib operation unlock order key

< internal flash program operation timeout

< internal flash program operation timeout

Definition at line 824 of file at32f415_flash.c.

◆ flash_extension_memory_slib_state_get()

flag_status flash_extension_memory_slib_state_get ( void )

get the extension memory slib state.

Parameters
none
Return values
SET or RESET

Definition at line 850 of file at32f415_flash.c.

◆ flash_fap_enable()

flash_status_type flash_fap_enable ( confirm_state new_state )

enable or disable the flash access protection.

Note
if the user has already programmed the other user system data before calling this function, must re-program them since this function erase all user system data.
Parameters
new_state new state of the flash access protection. this parameter can be: TRUE or FALSE.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash erase operation timeout

< flash operation unlock order key1

< flash operation unlock order key2

< internal flash erase operation timeout

< flash fap relieve key val

< internal flash erase operation timeout

Definition at line 472 of file at32f415_flash.c.

◆ flash_fap_high_level_enable()

flash_status_type flash_fap_high_level_enable ( confirm_state new_state )

enable or disable the flash access protection high level.

Note
if the user has already programmed the other user system data before calling this function, must re-program them since this function erase all user system data.
Parameters
new_state new state of the flash access protection high level. this parameter can be: TRUE or FALSE.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash erase operation timeout

< flash operation unlock order key1

< flash operation unlock order key2

< internal flash erase operation timeout

< internal flash erase operation timeout

< flash fap relieve key val

< internal flash erase operation timeout

< internal flash erase operation timeout

< flash fap high level enable key val

< internal flash program operation timeout

Definition at line 530 of file at32f415_flash.c.

◆ flash_fap_high_level_status_get()

flag_status flash_fap_high_level_status_get ( void )

check the flash access protection high level status.

Parameters
none
Return values
flash access protection high level status(SET or RESET)

Definition at line 601 of file at32f415_flash.c.

◆ flash_fap_status_get()

flag_status flash_fap_status_get ( void )

check the flash access protection status.

Parameters
none
Return values
flash access protection status(SET or RESET)

Definition at line 516 of file at32f415_flash.c.

Referenced by flash_user_system_data_erase().

◆ flash_flag_clear()

void flash_flag_clear ( uint32_t flash_flag )

clear the flash flag.

Parameters
flash_flag specifies the flash flags to clear. this parameter can be any combination of the following values:
  • FLASH_ODF_FLAG
  • FLASH_PRGMERR_FLAG
  • FLASH_EPPERR_FLAG
Return values
none

Definition at line 87 of file at32f415_flash.c.

Referenced by FLASH_IRQHandler().

◆ flash_flag_get()

flag_status flash_flag_get ( uint32_t flash_flag )

check whether the specified flash flag is set or not.

Parameters
flash_flag specifies the flash flag to check. this parameter can be one of flash flag status:
  • FLASH_OBF_FLAG
  • FLASH_ODF_FLAG
  • FLASH_PRGMERR_FLAG
  • FLASH_EPPERR_FLAG
  • FLASH_USDERR_FLAG
Return values
the new state of flash_flag (SET or RESET).

Definition at line 55 of file at32f415_flash.c.

Referenced by FLASH_IRQHandler().

◆ flash_halfword_program()

flash_status_type flash_halfword_program | ( | uint32_t | address,
 |  | uint16_t | data
 | ) |  |

program a halfword at a specified address.

Parameters
address | specifies the address to be programmed, halfword alignment is recommended.
data | specifies the data to be programmed.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< internal flash program operation timeout

Definition at line 315 of file at32f415_flash.c.

Referenced by flash_2kb_write(), flash_write_nocheck(), and main().

◆ flash_internal_all_erase()

flash_status_type flash_internal_all_erase ( void )

erase flash all internal sectors.

Parameters
none
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash erase operation timeout

< internal flash erase operation timeout

Definition at line 202 of file at32f415_flash.c.

◆ flash_interrupt_enable()

void flash_interrupt_enable | ( | uint32_t | flash_int,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the specified flash interrupts.

Parameters
flash_int specifies the flash interrupt sources to be enabled or disabled. this parameter can be any combination of the following values:
  • FLASH_ERR_INT
  • FLASH_ODF_INT
new_state new state of the specified flash interrupts. this parameter can be: TRUE or FALSE.
Return values
none

< flash error interrupt

< flash operate done interrupt

Definition at line 674 of file at32f415_flash.c.

Referenced by config_flash_interrupt().

◆ flash_lock()

void flash_lock ( void )

lock the flash controller.

Parameters
none
Return values
none

Definition at line 162 of file at32f415_flash.c.

Referenced by config_flash_interrupt(), flash_2kb_write(), flash_fat16_clear_upgrade_flag(), flash_fat16_set_upgrade_flag(), flash_write(), flash_write_data(), iap_clear_upgrade_flag(), iap_command_handle(), iap_data_write(), iap_erase_sector(), iap_init(), iap_set_upgrade_flag(), and msc_disk_write().

◆ flash_operation_status_get()

flash_status_type flash_operation_status_get ( void )

return the flash operation status.

Parameters
none
Return values
status the returned value can be: FLASH_OPERATE_BUSY, FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR or FLASH_OPERATE_DONE.

Definition at line 98 of file at32f415_flash.c.

Referenced by flash_operation_wait_for().

◆ flash_operation_wait_for()

flash_status_type flash_operation_wait_for ( uint32_t time_out )

wait for flash operation complete or timeout.

Parameters
time_out flash operation timeout
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

Definition at line 127 of file at32f415_flash.c.

Referenced by flash_boot_memory_extension_mode_enable(), flash_byte_program(), flash_crc_calibrate(), flash_epp_set(), flash_extension_memory_slib_enable(), flash_fap_enable(), flash_fap_high_level_enable(), flash_halfword_program(), flash_internal_all_erase(), flash_sector_erase(), flash_slib_disable(), flash_slib_enable(), flash_ssb_set(), flash_user_system_data_erase(), flash_user_system_data_program(), and flash_word_program().

◆ flash_sector_erase()

flash_status_type flash_sector_erase ( uint32_t sector_address )

erase a specified flash sector.

Parameters
sector_address the sector address to be erased.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash erase operation timeout

< internal flash erase operation timeout

Definition at line 173 of file at32f415_flash.c.

Referenced by flash_2kb_write(), flash_fat16_clear_upgrade_flag(), flash_write(), flash_write_data(), iap_clear_upgrade_flag(), iap_command_handle(), iap_erase_sector(), iap_init(), main(), msc_disk_write(), and slib_enable().

◆ flash_slib_datastart_sector_get()

uint16_t flash_slib_datastart_sector_get ( void )

get the main block data start sector of slib.

Parameters
none
Return values
uint16_t

Definition at line 771 of file at32f415_flash.c.

◆ flash_slib_disable()

error_status flash_slib_disable ( uint32_t pwd )

disable main block slib when slib enabled.

Parameters
pwd slib password
Return values
success or error

< internal flash erase operation timeout

Definition at line 726 of file at32f415_flash.c.

◆ flash_slib_enable()

flash_status_type flash_slib_enable | ( | uint32_t | pwd,
 |  | uint16_t | start_sector,
 |  | uint16_t | data_start_sector,
 |  | uint16_t | end_sector
 | ) |  |

enable main block security library function.

Parameters
pwd slib password start_sector: security library start sector data_start_sector: security library d-bus area start sector end_sector: security library end sector
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< flash slib operation unlock order key

< flash slib d-bus area start sector

< flash slib end sector

< flash slib start sector

< internal flash program operation timeout

< internal flash program operation timeout

Definition at line 691 of file at32f415_flash.c.

Referenced by slib_enable().

◆ flash_slib_end_sector_get()

uint16_t flash_slib_end_sector_get ( void )

get the main block end sector of slib.

Parameters
none
Return values
uint16_t

Definition at line 781 of file at32f415_flash.c.

◆ flash_slib_start_sector_get()

uint16_t flash_slib_start_sector_get ( void )

get the main block start sector of slib.

Parameters
none
Return values
uint16_t

Definition at line 761 of file at32f415_flash.c.

◆ flash_slib_state_get()

flag_status flash_slib_state_get ( void )

get the main block slib state.

Parameters
none
Return values
SET or RESET

Definition at line 748 of file at32f415_flash.c.

Referenced by main().

◆ flash_ssb_set()

flash_status_type flash_ssb_set ( uint8_t usd_ssb )

program the flash system setting byte in usd: wdt_ato_en / depslp_rst / stdby_rst .

Parameters
usd_ssb the system setting byte
Note
this parameter usd_ssb must contain a combination of all the following 3 types of data
type 1: wdt_ato_en, select the wdt auto start this data can be one of the following values:
  • USD_WDT_ATO_DISABLE: disable wdt auto start
  • USD_WDT_ATO_ENABLE: enable wdt auto start type 2: depslp_rst, reset event when entering deepsleep mode. this data can be one of the following values:
  • USD_DEPSLP_NO_RST: no reset generated when entering in deepsleep
  • USD_DEPSLP_RST: reset generated when entering in deepsleep type 3: stdby_rst, reset event when entering standby mode. this data can be one of the following values:
  • USD_STDBY_NO_RST: no reset generated when entering in standby
  • USD_STDBY_RST: reset generated when entering in standby
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< flash operation unlock order key1

< flash operation unlock order key2

< internal flash program operation timeout

Definition at line 625 of file at32f415_flash.c.

◆ flash_ssb_status_get()

uint8_t flash_ssb_status_get ( void )

return the flash system setting byte status.

Parameters
none
Return values
values from flash_usd register: wdt_ato_en(bit0), depslp_rst(bit1), stdby_rst(bit2).

Definition at line 658 of file at32f415_flash.c.

◆ flash_unlock()

void flash_unlock ( void )

unlock the flash controller.

Parameters
none
Return values
none

< flash operation unlock order key1

< flash operation unlock order key2

Definition at line 151 of file at32f415_flash.c.

Referenced by config_flash_interrupt(), flash_2kb_write(), flash_fat16_clear_upgrade_flag(), flash_fat16_set_upgrade_flag(), flash_write(), flash_write_data(), iap_clear_upgrade_flag(), iap_command_handle(), iap_data_write(), iap_erase_sector(), iap_init(), iap_set_upgrade_flag(), main(), msc_disk_write(), and slib_enable().

◆ flash_user_system_data_erase()

flash_status_type flash_user_system_data_erase ( void )

erase the flash user system data.

Note
this functions erases all user system data except the fap byte. when fap high level enabled, can't use this function.
Parameters
none
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< flash fap relieve key val

< internal flash erase operation timeout

< flash operation unlock order key1

< flash operation unlock order key2

< internal flash erase operation timeout

< flash fap relieve key val

< internal flash program operation timeout

Definition at line 232 of file at32f415_flash.c.

◆ flash_user_system_data_program()

flash_status_type flash_user_system_data_program | ( | uint32_t | address,
 |  | uint8_t | data
 | ) |  |

program a halfword at a specified user system data address.

Parameters
address | specifies the address to be programmed.
data | specifies the data to be programmed.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< flash operation unlock order key1

< flash operation unlock order key2

< internal flash program operation timeout

Definition at line 369 of file at32f415_flash.c.

◆ flash_word_program()

flash_status_type flash_word_program | ( | uint32_t | address,
 |  | uint32_t | data
 | ) |  |

program a word at a specified address.

Parameters
address | specifies the address to be programmed, word alignment is recommended.
data | specifies the data to be programmed.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< internal flash program operation timeout

Definition at line 288 of file at32f415_flash.c.

Referenced by flash_fat16_set_upgrade_flag(), iap_command_handle(), iap_data_write(), iap_set_upgrade_flag(), and slib_enable().


AT32F415 Firmwary Library: FLASH_private_functions

Functions
FLASH_private_functions
AT32F415_periph_driver » FLASH

Functions

flag_status | flash_flag_get (uint32_t flash_flag)
check whether the specified flash flag is set or not. More...
void | flash_flag_clear (uint32_t flash_flag)
clear the flash flag. More...
flash_status_type | flash_operation_status_get (void)
return the flash operation status. More...
flash_status_type | flash_operation_wait_for (uint32_t time_out)
wait for flash operation complete or timeout. More...
void | flash_unlock (void)
unlock the flash controller. More...
void | flash_lock (void)
lock the flash controller. More...
flash_status_type | flash_sector_erase (uint32_t sector_address)
erase a specified flash sector. More...
flash_status_type | flash_internal_all_erase (void)
erase flash all internal sectors. More...
flash_status_type | flash_user_system_data_erase (void)
erase the flash user system data. More...
flash_status_type | flash_word_program (uint32_t address, uint32_t data)
program a word at a specified address. More...
flash_status_type | flash_halfword_program (uint32_t address, uint16_t data)
program a halfword at a specified address. More...
flash_status_type | flash_byte_program (uint32_t address, uint8_t data)
program a byte at a specified address. More...
flash_status_type | flash_user_system_data_program (uint32_t address, uint8_t data)
program a halfword at a specified user system data address. More...
flash_status_type | flash_epp_set (uint32_t *sector_bits)
config erase/program protection for the desired sectors. More...
void | flash_epp_status_get (uint32_t *sector_bits)
return the flash erase/program protection status. More...
flash_status_type | flash_fap_enable (confirm_state new_state)
enable or disable the flash access protection. More...
flag_status | flash_fap_status_get (void)
check the flash access protection status. More...
flash_status_type | flash_fap_high_level_enable (confirm_state new_state)
enable or disable the flash access protection high level. More...
flag_status | flash_fap_high_level_status_get (void)
check the flash access protection high level status. More...
flash_status_type | flash_ssb_set (uint8_t usd_ssb)
program the flash system setting byte in usd: wdt_ato_en / depslp_rst / stdby_rst . More...
uint8_t | flash_ssb_status_get (void)
return the flash system setting byte status. More...
void | flash_interrupt_enable (uint32_t flash_int, confirm_state new_state)
enable or disable the specified flash interrupts. More...
flash_status_type | flash_slib_enable (uint32_t pwd, uint16_t start_sector, uint16_t data_start_sector, uint16_t end_sector)
enable main block security library function. More...
error_status | flash_slib_disable (uint32_t pwd)
disable main block slib when slib enabled. More...
flag_status | flash_slib_state_get (void)
get the main block slib state. More...
uint16_t | flash_slib_start_sector_get (void)
get the main block start sector of slib. More...
uint16_t | flash_slib_datastart_sector_get (void)
get the main block data start sector of slib. More...
uint16_t | flash_slib_end_sector_get (void)
get the main block end sector of slib. More...
uint32_t | flash_crc_calibrate (uint32_t start_addr, uint32_t sector_cnt)
flash crc calibration. More...
void | flash_boot_memory_extension_mode_enable (void)
enable boot memory as extension mode. More...
flash_status_type | flash_extension_memory_slib_enable (uint32_t pwd, uint16_t data_start_sector)
enable extension memory security library function. More...
flag_status | flash_extension_memory_slib_state_get (void)
get the extension memory slib state. More...
uint16_t | flash_em_slib_datastart_sector_get (void)
get the extension memory data start sector of slib. More...

Detailed Description

Function Documentation

◆ flash_boot_memory_extension_mode_enable()

void flash_boot_memory_extension_mode_enable ( void )

enable boot memory as extension mode.

Note
this function is irreversible, can not disable!!!
Parameters
none
Return values
none.

< flash slib operation unlock order key

< flash common operation timeout

Definition at line 806 of file at32f415_flash.c.

◆ flash_byte_program()

flash_status_type flash_byte_program | ( | uint32_t | address,
 |  | uint8_t | data
 | ) |  |

program a byte at a specified address.

Parameters
address | specifies the address to be programmed.
data | specifies the data to be programmed.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< internal flash program operation timeout

Definition at line 342 of file at32f415_flash.c.

Referenced by flash_write_data(), and msc_disk_write().

◆ flash_crc_calibrate()

uint32_t flash_crc_calibrate | ( | uint32_t | start_addr,
 |  | uint32_t | sector_cnt
 | ) |  |

flash crc calibration.

Parameters
start_addr crc calibration start sector address sector_cnt: crc calibration sector count
Return values
uint32 crc calibration result

< flash common operation timeout

Definition at line 792 of file at32f415_flash.c.

◆ flash_em_slib_datastart_sector_get()

uint16_t flash_em_slib_datastart_sector_get ( void )

get the extension memory data start sector of slib.

Parameters
none
Return values
uint16_t

Definition at line 863 of file at32f415_flash.c.

◆ flash_epp_set()

flash_status_type flash_epp_set ( uint32_t * sector_bits )

config erase/program protection for the desired sectors.

Parameters
sector_bits the pointer of the address of the sectors to be erase/program protected. the first 31 bits general every bit is used to protect 2 sectors. the bit 31 is used to protect the rest sectors and extension memory.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< flash operation unlock order key1

< flash operation unlock order key2

< internal flash program operation timeout

< internal flash program operation timeout

< internal flash program operation timeout

< internal flash program operation timeout

Definition at line 403 of file at32f415_flash.c.

◆ flash_epp_status_get()

void flash_epp_status_get ( uint32_t * sector_bits )

return the flash erase/program protection status.

Parameters
sector_bits pointer to get the epps register.
Return values
none

Definition at line 457 of file at32f415_flash.c.

◆ flash_extension_memory_slib_enable()

flash_status_type flash_extension_memory_slib_enable | ( | uint32_t | pwd,
 |  | uint16_t | data_start_sector
 | ) |  |

enable extension memory security library function.

Parameters
pwd slib password data_start_sector: extension memory security library d-bus area start sector, range 1~17 or 0xFF
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< flash slib operation unlock order key

< internal flash program operation timeout

< internal flash program operation timeout

Definition at line 824 of file at32f415_flash.c.

◆ flash_extension_memory_slib_state_get()

flag_status flash_extension_memory_slib_state_get ( void )

get the extension memory slib state.

Parameters
none
Return values
SET or RESET

Definition at line 850 of file at32f415_flash.c.

◆ flash_fap_enable()

flash_status_type flash_fap_enable ( confirm_state new_state )

enable or disable the flash access protection.

Note
if the user has already programmed the other user system data before calling this function, must re-program them since this function erase all user system data.
Parameters
new_state new state of the flash access protection. this parameter can be: TRUE or FALSE.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash erase operation timeout

< flash operation unlock order key1

< flash operation unlock order key2

< internal flash erase operation timeout

< flash fap relieve key val

< internal flash erase operation timeout

Definition at line 472 of file at32f415_flash.c.

◆ flash_fap_high_level_enable()

flash_status_type flash_fap_high_level_enable ( confirm_state new_state )

enable or disable the flash access protection high level.

Note
if the user has already programmed the other user system data before calling this function, must re-program them since this function erase all user system data.
Parameters
new_state new state of the flash access protection high level. this parameter can be: TRUE or FALSE.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash erase operation timeout

< flash operation unlock order key1

< flash operation unlock order key2

< internal flash erase operation timeout

< internal flash erase operation timeout

< flash fap relieve key val

< internal flash erase operation timeout

< internal flash erase operation timeout

< flash fap high level enable key val

< internal flash program operation timeout

Definition at line 530 of file at32f415_flash.c.

◆ flash_fap_high_level_status_get()

flag_status flash_fap_high_level_status_get ( void )

check the flash access protection high level status.

Parameters
none
Return values
flash access protection high level status(SET or RESET)

Definition at line 601 of file at32f415_flash.c.

◆ flash_fap_status_get()

flag_status flash_fap_status_get ( void )

check the flash access protection status.

Parameters
none
Return values
flash access protection status(SET or RESET)

Definition at line 516 of file at32f415_flash.c.

Referenced by flash_user_system_data_erase().

◆ flash_flag_clear()

void flash_flag_clear ( uint32_t flash_flag )

clear the flash flag.

Parameters
flash_flag specifies the flash flags to clear. this parameter can be any combination of the following values:
  • FLASH_ODF_FLAG
  • FLASH_PRGMERR_FLAG
  • FLASH_EPPERR_FLAG
Return values
none

Definition at line 87 of file at32f415_flash.c.

Referenced by FLASH_IRQHandler().

◆ flash_flag_get()

flag_status flash_flag_get ( uint32_t flash_flag )

check whether the specified flash flag is set or not.

Parameters
flash_flag specifies the flash flag to check. this parameter can be one of flash flag status:
  • FLASH_OBF_FLAG
  • FLASH_ODF_FLAG
  • FLASH_PRGMERR_FLAG
  • FLASH_EPPERR_FLAG
  • FLASH_USDERR_FLAG
Return values
the new state of flash_flag (SET or RESET).

Definition at line 55 of file at32f415_flash.c.

Referenced by FLASH_IRQHandler().

◆ flash_halfword_program()

flash_status_type flash_halfword_program | ( | uint32_t | address,
 |  | uint16_t | data
 | ) |  |

program a halfword at a specified address.

Parameters
address | specifies the address to be programmed, halfword alignment is recommended.
data | specifies the data to be programmed.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< internal flash program operation timeout

Definition at line 315 of file at32f415_flash.c.

Referenced by flash_2kb_write(), flash_write_nocheck(), and main().

◆ flash_internal_all_erase()

flash_status_type flash_internal_all_erase ( void )

erase flash all internal sectors.

Parameters
none
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash erase operation timeout

< internal flash erase operation timeout

Definition at line 202 of file at32f415_flash.c.

◆ flash_interrupt_enable()

void flash_interrupt_enable | ( | uint32_t | flash_int,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the specified flash interrupts.

Parameters
flash_int specifies the flash interrupt sources to be enabled or disabled. this parameter can be any combination of the following values:
  • FLASH_ERR_INT
  • FLASH_ODF_INT
new_state new state of the specified flash interrupts. this parameter can be: TRUE or FALSE.
Return values
none

< flash error interrupt

< flash operate done interrupt

Definition at line 674 of file at32f415_flash.c.

Referenced by config_flash_interrupt().

◆ flash_lock()

void flash_lock ( void )

lock the flash controller.

Parameters
none
Return values
none

Definition at line 162 of file at32f415_flash.c.

Referenced by config_flash_interrupt(), flash_2kb_write(), flash_fat16_clear_upgrade_flag(), flash_fat16_set_upgrade_flag(), flash_write(), flash_write_data(), iap_clear_upgrade_flag(), iap_command_handle(), iap_data_write(), iap_erase_sector(), iap_init(), iap_set_upgrade_flag(), and msc_disk_write().

◆ flash_operation_status_get()

flash_status_type flash_operation_status_get ( void )

return the flash operation status.

Parameters
none
Return values
status the returned value can be: FLASH_OPERATE_BUSY, FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR or FLASH_OPERATE_DONE.

Definition at line 98 of file at32f415_flash.c.

Referenced by flash_operation_wait_for().

◆ flash_operation_wait_for()

flash_status_type flash_operation_wait_for ( uint32_t time_out )

wait for flash operation complete or timeout.

Parameters
time_out flash operation timeout
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

Definition at line 127 of file at32f415_flash.c.

Referenced by flash_boot_memory_extension_mode_enable(), flash_byte_program(), flash_crc_calibrate(), flash_epp_set(), flash_extension_memory_slib_enable(), flash_fap_enable(), flash_fap_high_level_enable(), flash_halfword_program(), flash_internal_all_erase(), flash_sector_erase(), flash_slib_disable(), flash_slib_enable(), flash_ssb_set(), flash_user_system_data_erase(), flash_user_system_data_program(), and flash_word_program().

◆ flash_sector_erase()

flash_status_type flash_sector_erase ( uint32_t sector_address )

erase a specified flash sector.

Parameters
sector_address the sector address to be erased.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash erase operation timeout

< internal flash erase operation timeout

Definition at line 173 of file at32f415_flash.c.

Referenced by flash_2kb_write(), flash_fat16_clear_upgrade_flag(), flash_write(), flash_write_data(), iap_clear_upgrade_flag(), iap_command_handle(), iap_erase_sector(), iap_init(), main(), msc_disk_write(), and slib_enable().

◆ flash_slib_datastart_sector_get()

uint16_t flash_slib_datastart_sector_get ( void )

get the main block data start sector of slib.

Parameters
none
Return values
uint16_t

Definition at line 771 of file at32f415_flash.c.

◆ flash_slib_disable()

error_status flash_slib_disable ( uint32_t pwd )

disable main block slib when slib enabled.

Parameters
pwd slib password
Return values
success or error

< internal flash erase operation timeout

Definition at line 726 of file at32f415_flash.c.

◆ flash_slib_enable()

flash_status_type flash_slib_enable | ( | uint32_t | pwd,
 |  | uint16_t | start_sector,
 |  | uint16_t | data_start_sector,
 |  | uint16_t | end_sector
 | ) |  |

enable main block security library function.

Parameters
pwd slib password start_sector: security library start sector data_start_sector: security library d-bus area start sector end_sector: security library end sector
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< flash slib operation unlock order key

< flash slib d-bus area start sector

< flash slib end sector

< flash slib start sector

< internal flash program operation timeout

< internal flash program operation timeout

Definition at line 691 of file at32f415_flash.c.

Referenced by slib_enable().

◆ flash_slib_end_sector_get()

uint16_t flash_slib_end_sector_get ( void )

get the main block end sector of slib.

Parameters
none
Return values
uint16_t

Definition at line 781 of file at32f415_flash.c.

◆ flash_slib_start_sector_get()

uint16_t flash_slib_start_sector_get ( void )

get the main block start sector of slib.

Parameters
none
Return values
uint16_t

Definition at line 761 of file at32f415_flash.c.

◆ flash_slib_state_get()

flag_status flash_slib_state_get ( void )

get the main block slib state.

Parameters
none
Return values
SET or RESET

Definition at line 748 of file at32f415_flash.c.

Referenced by main().

◆ flash_ssb_set()

flash_status_type flash_ssb_set ( uint8_t usd_ssb )

program the flash system setting byte in usd: wdt_ato_en / depslp_rst / stdby_rst .

Parameters
usd_ssb the system setting byte
Note
this parameter usd_ssb must contain a combination of all the following 3 types of data
type 1: wdt_ato_en, select the wdt auto start this data can be one of the following values:
  • USD_WDT_ATO_DISABLE: disable wdt auto start
  • USD_WDT_ATO_ENABLE: enable wdt auto start type 2: depslp_rst, reset event when entering deepsleep mode. this data can be one of the following values:
  • USD_DEPSLP_NO_RST: no reset generated when entering in deepsleep
  • USD_DEPSLP_RST: reset generated when entering in deepsleep type 3: stdby_rst, reset event when entering standby mode. this data can be one of the following values:
  • USD_STDBY_NO_RST: no reset generated when entering in standby
  • USD_STDBY_RST: reset generated when entering in standby
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< flash operation unlock order key1

< flash operation unlock order key2

< internal flash program operation timeout

Definition at line 625 of file at32f415_flash.c.

◆ flash_ssb_status_get()

uint8_t flash_ssb_status_get ( void )

return the flash system setting byte status.

Parameters
none
Return values
values from flash_usd register: wdt_ato_en(bit0), depslp_rst(bit1), stdby_rst(bit2).

Definition at line 658 of file at32f415_flash.c.

◆ flash_unlock()

void flash_unlock ( void )

unlock the flash controller.

Parameters
none
Return values
none

< flash operation unlock order key1

< flash operation unlock order key2

Definition at line 151 of file at32f415_flash.c.

Referenced by config_flash_interrupt(), flash_2kb_write(), flash_fat16_clear_upgrade_flag(), flash_fat16_set_upgrade_flag(), flash_write(), flash_write_data(), iap_clear_upgrade_flag(), iap_command_handle(), iap_data_write(), iap_erase_sector(), iap_init(), iap_set_upgrade_flag(), main(), msc_disk_write(), and slib_enable().

◆ flash_user_system_data_erase()

flash_status_type flash_user_system_data_erase ( void )

erase the flash user system data.

Note
this functions erases all user system data except the fap byte. when fap high level enabled, can't use this function.
Parameters
none
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< flash fap relieve key val

< internal flash erase operation timeout

< flash operation unlock order key1

< flash operation unlock order key2

< internal flash erase operation timeout

< flash fap relieve key val

< internal flash program operation timeout

Definition at line 232 of file at32f415_flash.c.

◆ flash_user_system_data_program()

flash_status_type flash_user_system_data_program | ( | uint32_t | address,
 |  | uint8_t | data
 | ) |  |

program a halfword at a specified user system data address.

Parameters
address | specifies the address to be programmed.
data | specifies the data to be programmed.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< flash operation unlock order key1

< flash operation unlock order key2

< internal flash program operation timeout

Definition at line 369 of file at32f415_flash.c.

◆ flash_word_program()

flash_status_type flash_word_program | ( | uint32_t | address,
 |  | uint32_t | data
 | ) |  |

program a word at a specified address.

Parameters
address | specifies the address to be programmed, word alignment is recommended.
data | specifies the data to be programmed.
Return values
status the returned value can be: FLASH_PROGRAM_ERROR, FLASH_EPP_ERROR, FLASH_OPERATE_DONE or FLASH_OPERATE_TIMEOUT.

< internal flash program operation timeout

< internal flash program operation timeout

Definition at line 288 of file at32f415_flash.c.

Referenced by flash_fat16_set_upgrade_flag(), iap_command_handle(), iap_data_write(), iap_set_upgrade_flag(), and slib_enable().


AT32F415 Firmwary Library: GPIO

Modules | Macros
GPIO
AT32F415_periph_driver

GPIO driver modules. More...

Modules

GPIO_pins_number_definition
IOMUX_map_definition
iomux map definitions
IOMUX_map2_definition
iomux map2 definitions
IOMUX_map3_definition
iomux map3 definitions
IOMUX_map4_definition
iomux map4 definitions
IOMUX_map5_definition
iomux map5 definitions
IOMUX_map6_definition
iomux map6 definitions
IOMUX_map7_definition
iomux map7 definitions
IOMUX_map8_definition
iomux map8 definitions
GPIO_exported_types
GPIO_exported_functions
GPIO_private_functions

Macros

#define | IOMUX_MAKE_VALUE(reg_offset, bit_addr, bit_num, bit_val) (uint32_t)(((reg_offset) << 24) | ((bit_addr) << 16) | ((bit_num) << 8) | (bit_val))
#define | GPIOA ((gpio_type *) GPIOA_BASE)
#define | GPIOB ((gpio_type *) GPIOB_BASE)
#define | GPIOC ((gpio_type *) GPIOC_BASE)
#define | GPIOD ((gpio_type *) GPIOD_BASE)
#define | GPIOF ((gpio_type *) GPIOF_BASE)
#define | IOMUX ((iomux_type *) IOMUX_BASE)

Detailed Description

GPIO driver modules.

Macro Definition Documentation

◆ GPIOA

#define GPIOA ((gpio_type *) GPIOA_BASE)

Definition at line 770 of file at32f415_gpio.h.

◆ GPIOB

#define GPIOB ((gpio_type *) GPIOB_BASE)

Definition at line 771 of file at32f415_gpio.h.

◆ GPIOC

#define GPIOC ((gpio_type *) GPIOC_BASE)

Definition at line 772 of file at32f415_gpio.h.

◆ GPIOD

#define GPIOD ((gpio_type *) GPIOD_BASE)

Definition at line 773 of file at32f415_gpio.h.

◆ GPIOF

#define GPIOF ((gpio_type *) GPIOF_BASE)

Definition at line 774 of file at32f415_gpio.h.

◆ IOMUX

#define IOMUX ((iomux_type *) IOMUX_BASE)

Definition at line 775 of file at32f415_gpio.h.

◆ IOMUX_MAKE_VALUE

#define IOMUX_MAKE_VALUE | ( | reg_offset,
 |  | bit_addr,
 |  | bit_num,
 |  | bit_val
 | ) | (uint32_t)(((reg_offset) << 24) | ((bit_addr) << 16) | ((bit_num) << 8) | (bit_val))

Definition at line 73 of file at32f415_gpio.h.


AT32F415 Firmwary Library: GPIO_pins_number_definition

Macros
GPIO_pins_number_definition
AT32F415_periph_driver » GPIO

Macros

#define | GPIO_PINS_0 0x0001
#define | GPIO_PINS_1 0x0002
#define | GPIO_PINS_2 0x0004
#define | GPIO_PINS_3 0x0008
#define | GPIO_PINS_4 0x0010
#define | GPIO_PINS_5 0x0020
#define | GPIO_PINS_6 0x0040
#define | GPIO_PINS_7 0x0080
#define | GPIO_PINS_8 0x0100
#define | GPIO_PINS_9 0x0200
#define | GPIO_PINS_10 0x0400
#define | GPIO_PINS_11 0x0800
#define | GPIO_PINS_12 0x1000
#define | GPIO_PINS_13 0x2000
#define | GPIO_PINS_14 0x4000
#define | GPIO_PINS_15 0x8000
#define | GPIO_PINS_ALL 0xFFFF

Detailed Description

Macro Definition Documentation

◆ GPIO_PINS_0

#define GPIO_PINS_0 0x0001

gpio pins number 0

Definition at line 51 of file at32f415_gpio.h.

◆ GPIO_PINS_1

#define GPIO_PINS_1 0x0002

gpio pins number 1

Definition at line 52 of file at32f415_gpio.h.

◆ GPIO_PINS_10

#define GPIO_PINS_10 0x0400

gpio pins number 10

Definition at line 61 of file at32f415_gpio.h.

◆ GPIO_PINS_11

#define GPIO_PINS_11 0x0800

gpio pins number 11

Definition at line 62 of file at32f415_gpio.h.

◆ GPIO_PINS_12

#define GPIO_PINS_12 0x1000

gpio pins number 12

Definition at line 63 of file at32f415_gpio.h.

◆ GPIO_PINS_13

#define GPIO_PINS_13 0x2000

gpio pins number 13

Definition at line 64 of file at32f415_gpio.h.

◆ GPIO_PINS_14

#define GPIO_PINS_14 0x4000

gpio pins number 14

Definition at line 65 of file at32f415_gpio.h.

◆ GPIO_PINS_15

#define GPIO_PINS_15 0x8000

gpio pins number 15

Definition at line 66 of file at32f415_gpio.h.

◆ GPIO_PINS_2

#define GPIO_PINS_2 0x0004

gpio pins number 2

Definition at line 53 of file at32f415_gpio.h.

◆ GPIO_PINS_3

#define GPIO_PINS_3 0x0008

gpio pins number 3

Definition at line 54 of file at32f415_gpio.h.

◆ GPIO_PINS_4

#define GPIO_PINS_4 0x0010

gpio pins number 4

Definition at line 55 of file at32f415_gpio.h.

◆ GPIO_PINS_5

#define GPIO_PINS_5 0x0020

gpio pins number 5

Definition at line 56 of file at32f415_gpio.h.

◆ GPIO_PINS_6

#define GPIO_PINS_6 0x0040

gpio pins number 6

Definition at line 57 of file at32f415_gpio.h.

◆ GPIO_PINS_7

#define GPIO_PINS_7 0x0080

gpio pins number 7

Definition at line 58 of file at32f415_gpio.h.

◆ GPIO_PINS_8

#define GPIO_PINS_8 0x0100

gpio pins number 8

Definition at line 59 of file at32f415_gpio.h.

◆ GPIO_PINS_9

#define GPIO_PINS_9 0x0200

gpio pins number 9

Definition at line 60 of file at32f415_gpio.h.

◆ GPIO_PINS_ALL

#define GPIO_PINS_ALL 0xFFFF

gpio all pins

Definition at line 67 of file at32f415_gpio.h.


AT32F415 Firmwary Library: IOMUX_map_definition

Macros
IOMUX_map_definition
AT32F415_periph_driver » GPIO

iomux map definitions More...

Macros

#define | SPI1_MUX_01 SPI1_GMUX_0001
#define | I2C1_MUX I2C1_GMUX_0001
#define | USART1_MUX USART1_GMUX_0001
#define | USART3_MUX_01 USART3_GMUX_0001
#define | USART3_MUX_10 USART3_GMUX_0010
#define | TMR1_MUX_01 TMR1_GMUX_0001
#define | TMR2_MUX_01 TMR2_GMUX_001
#define | TMR2_MUX_10 TMR2_GMUX_010
#define | TMR2_MUX_11 TMR2_GMUX_011
#define | TMR3_MUX_10 TMR3_GMUX_0010
#define | TMR3_MUX_11 TMR3_GMUX_0011
#define | CAN_MUX_10 CAN1_GMUX_0010
#define | PD01_MUX PD01_GMUX
#define | TMR5CH4_MUX TMR5CH4_GMUX
#define | ADC1_ETP_MUX ADC1_ETP_GMUX
#define | ADC1_ETO_MUX ADC1_ETO_GMUX
#define | SWJTAG_MUX_001 SWJTAG_GMUX_001
#define | SWJTAG_MUX_010 SWJTAG_GMUX_010
#define | SWJTAG_MUX_100 SWJTAG_GMUX_100

Detailed Description

iomux map definitions

Macro Definition Documentation

◆ ADC1_ETO_MUX

#define ADC1_ETO_MUX ADC1_ETO_GMUX

adc1 external trigger ordinary conversion muxing

Definition at line 96 of file at32f415_gpio.h.

◆ ADC1_ETP_MUX

#define ADC1_ETP_MUX ADC1_ETP_GMUX

adc1 external trigger preempted conversion muxing

Definition at line 95 of file at32f415_gpio.h.

◆ CAN_MUX_10

#define CAN_MUX_10 CAN1_GMUX_0010

can_rx(pb8), can_tx(pb9)

Definition at line 92 of file at32f415_gpio.h.

◆ I2C1_MUX

#define I2C1_MUX I2C1_GMUX_0001

i2c1_scl(pb8), i2c1_sda(pb9), i2c1_smba(pb5)

Definition at line 82 of file at32f415_gpio.h.

◆ PD01_MUX

#define PD01_MUX PD01_GMUX

pd0/pd1 mapping on osc_in/osc_out

Definition at line 93 of file at32f415_gpio.h.

◆ SPI1_MUX_01

#define SPI1_MUX_01 SPI1_GMUX_0001

spi1_cs/i2s1_ws(pa15), spi1_sck/i2s1_ck(pb3), spi1_miso(pb4), spi1_mosi/i2s1_sd(pb5), i2s1_mck(pb6)

Definition at line 81 of file at32f415_gpio.h.

◆ SWJTAG_MUX_001

#define SWJTAG_MUX_001 SWJTAG_GMUX_001

full swj enabled (jtag-dp + sw-dp) but without jtrst

Definition at line 97 of file at32f415_gpio.h.

◆ SWJTAG_MUX_010

#define SWJTAG_MUX_010 SWJTAG_GMUX_010

jtag-dp disabled and sw-dp enabled

Definition at line 98 of file at32f415_gpio.h.

◆ SWJTAG_MUX_100

#define SWJTAG_MUX_100 SWJTAG_GMUX_100

full swj disabled (jtag-dp + sw-dp)

Definition at line 99 of file at32f415_gpio.h.

◆ TMR1_MUX_01

#define TMR1_MUX_01 TMR1_GMUX_0001

tmr1_ext(pa12), tmr1_ch1(pa8), tmr1_ch2(pa9), tmr1_ch3(pa10), tmr1_ch4(pa11), tmr1_brkin(pa6), tmr1_ch1c(pa7), tmr1_ch2c(pb0), tmr1_ch3c(pb1)

Definition at line 86 of file at32f415_gpio.h.

◆ TMR2_MUX_01

#define TMR2_MUX_01 TMR2_GMUX_001

tmr2_ch1_ext(pa15), tmr2_ch2(pb3), tmr2_ch3(pa2), tmr2_ch4(pa3)

Definition at line 87 of file at32f415_gpio.h.

◆ TMR2_MUX_10

#define TMR2_MUX_10 TMR2_GMUX_010

tmr2_ch1_ext(pa0), tmr2_ch2(pa1), tmr2_ch3(pb10), tmr2_ch4(pb11)

Definition at line 88 of file at32f415_gpio.h.

◆ TMR2_MUX_11

#define TMR2_MUX_11 TMR2_GMUX_011

tmr2_ch1_ext(pa15), tmr2_ch2(pb3), tmr2_ch3(pb10), tmr2_ch4(pb11)

Definition at line 89 of file at32f415_gpio.h.

◆ TMR3_MUX_10

#define TMR3_MUX_10 TMR3_GMUX_0010

tmr3_ch1(pb4), tmr3_ch2(pb5), tmr3_ch3(pb0), tmr3_ch4(pb1)

Definition at line 90 of file at32f415_gpio.h.

◆ TMR3_MUX_11

#define TMR3_MUX_11 TMR3_GMUX_0011

tmr3_ch1(pc6), tmr3_ch2(pc7), tmr3_ch3(pc8), tmr3_ch4(pc9)

Definition at line 91 of file at32f415_gpio.h.

◆ TMR5CH4_MUX

#define TMR5CH4_MUX TMR5CH4_GMUX

lick connected to tmr5_ch4 input capture for calibration

Definition at line 94 of file at32f415_gpio.h.

◆ USART1_MUX

#define USART1_MUX USART1_GMUX_0001

usart1_tx(pb6), usart1_rx(pb7)

Definition at line 83 of file at32f415_gpio.h.

◆ USART3_MUX_01

#define USART3_MUX_01 USART3_GMUX_0001

usart3_tx(pc10), usart3_rx(pc11), usart3_ck(pc12), usart3_cts(pb13), usart3_rts(pb14)

Definition at line 84 of file at32f415_gpio.h.

◆ USART3_MUX_10

#define USART3_MUX_10 USART3_GMUX_0010

usart3_tx(pa7), usart3_rx(pa6), usart3_ck(pa5), usart3_cts(pb1), usart3_rts(pb0)

Definition at line 85 of file at32f415_gpio.h.


AT32F415 Firmwary Library: IOMUX_map2_definition

Macros
IOMUX_map2_definition
AT32F415_periph_driver » GPIO

iomux map2 definitions More...

Macros

#define | CMP_MUX_01 IOMUX_MAKE_VALUE(0x1C, 26, 2, 0x01)
#define | CMP_MUX_10 IOMUX_MAKE_VALUE(0x1C, 26, 2, 0x02)

Detailed Description

iomux map2 definitions

Macro Definition Documentation

◆ CMP_MUX_01

#define CMP_MUX_01 IOMUX_MAKE_VALUE(0x1C, 26, 2, 0x01)

cmp1_out connect pa6, cmp2_out connect pa7

Definition at line 110 of file at32f415_gpio.h.

◆ CMP_MUX_10

#define CMP_MUX_10 IOMUX_MAKE_VALUE(0x1C, 26, 2, 0x02)

cmp1_out connect pa11, cmp2_out connect pa12

Definition at line 111 of file at32f415_gpio.h.


AT32F415 Firmwary Library: IOMUX_map3_definition

Macros
IOMUX_map3_definition
AT32F415_periph_driver » GPIO

iomux map3 definitions More...

Macros

#define | TMR9_GMUX IOMUX_MAKE_VALUE(0x20, 0, 4, 0x02)
#define | TMR10_GMUX IOMUX_MAKE_VALUE(0x20, 4, 4, 0x02)
#define | TMR11_GMUX IOMUX_MAKE_VALUE(0x20, 8, 4, 0x02)

Detailed Description

iomux map3 definitions

Macro Definition Documentation

◆ TMR10_GMUX

#define TMR10_GMUX IOMUX_MAKE_VALUE(0x20, 4, 4, 0x02)

tmr10_ch1(pa6)

Definition at line 123 of file at32f415_gpio.h.

◆ TMR11_GMUX

#define TMR11_GMUX IOMUX_MAKE_VALUE(0x20, 8, 4, 0x02)

tmr11_ch1(pa7)

Definition at line 124 of file at32f415_gpio.h.

◆ TMR9_GMUX

#define TMR9_GMUX IOMUX_MAKE_VALUE(0x20, 0, 4, 0x02)

tmr9_ch1(pb14), tmr9_ch2(pb15)

Definition at line 122 of file at32f415_gpio.h.


AT32F415 Firmwary Library: IOMUX_map4_definition

Macros
IOMUX_map4_definition
AT32F415_periph_driver » GPIO

iomux map4 definitions More...

Macros

#define | TMR1_GMUX_0001 IOMUX_MAKE_VALUE(0x24, 0, 4, 0x01)
#define | TMR1_GMUX_0010 IOMUX_MAKE_VALUE(0x24, 0, 4, 0x02)
#define | TMR2_GMUX_001 IOMUX_MAKE_VALUE(0x24, 4, 3, 0x01)
#define | TMR2_GMUX_010 IOMUX_MAKE_VALUE(0x24, 4, 3, 0x02)
#define | TMR2_GMUX_011 IOMUX_MAKE_VALUE(0x24, 4, 3, 0x03)
#define | TMR3_GMUX_0010 IOMUX_MAKE_VALUE(0x24, 8, 4, 0x02)
#define | TMR3_GMUX_0011 IOMUX_MAKE_VALUE(0x24, 8, 4, 0x03)
#define | TMR5_GMUX_001 IOMUX_MAKE_VALUE(0x24, 16, 3, 0x01)
#define | TMR5CH4_GMUX IOMUX_MAKE_VALUE(0x24, 19, 1, 0x01)

Detailed Description

iomux map4 definitions

Macro Definition Documentation

◆ TMR1_GMUX_0001

#define TMR1_GMUX_0001 IOMUX_MAKE_VALUE(0x24, 0, 4, 0x01)

tmr1_ext(pa12), tmr1_ch1(pa8), tmr1_ch2(pa9), tmr1_ch3(pa10), tmr1_ch4(pa11), tmr1_brkin(pa6), tmr1_ch1c(pa7), tmr1_ch2c(pb0), tmr1_ch3c(pb1)

Definition at line 135 of file at32f415_gpio.h.

◆ TMR1_GMUX_0010

#define TMR1_GMUX_0010 IOMUX_MAKE_VALUE(0x24, 0, 4, 0x02)

tmr1_ext(pa0), tmr1_ch1(pc6), tmr1_ch2(pc7), tmr1_ch3(pc8), tmr1_ch4(pc9), tmr1_brkin(pa6), tmr1_ch1c(pa7), tmr1_ch2c(pb0), tmr1_ch3c(pb1)

Definition at line 136 of file at32f415_gpio.h.

◆ TMR2_GMUX_001

#define TMR2_GMUX_001 IOMUX_MAKE_VALUE(0x24, 4, 3, 0x01)

tmr2_ch1_ext(pa15), tmr2_ch2(pb3), tmr2_ch3(pa2), tmr2_ch4(pa3)

Definition at line 137 of file at32f415_gpio.h.

◆ TMR2_GMUX_010

#define TMR2_GMUX_010 IOMUX_MAKE_VALUE(0x24, 4, 3, 0x02)

tmr2_ch1_ext(pa0), tmr2_ch2(pa1), tmr2_ch3(pb10), tmr2_ch4(pb11)

Definition at line 138 of file at32f415_gpio.h.

◆ TMR2_GMUX_011

#define TMR2_GMUX_011 IOMUX_MAKE_VALUE(0x24, 4, 3, 0x03)

tmr2_ch1_ext(pa15), tmr2_ch2(pb3), tmr2_ch3(pb10), tmr2_ch4(pb11)

Definition at line 139 of file at32f415_gpio.h.

◆ TMR3_GMUX_0010

#define TMR3_GMUX_0010 IOMUX_MAKE_VALUE(0x24, 8, 4, 0x02)

tmr3_ch1(pb4), tmr3_ch2(pb5), tmr3_ch3(pb0), tmr3_ch4(pb1)

Definition at line 140 of file at32f415_gpio.h.

◆ TMR3_GMUX_0011

#define TMR3_GMUX_0011 IOMUX_MAKE_VALUE(0x24, 8, 4, 0x03)

tmr3_ch1(pc6), tmr3_ch2(pc7), tmr3_ch3(pc8), tmr3_ch4(pc9)

Definition at line 141 of file at32f415_gpio.h.

◆ TMR5_GMUX_001

#define TMR5_GMUX_001 IOMUX_MAKE_VALUE(0x24, 16, 3, 0x01)

tmr5_ch1(pf4), tmr5_ch2(pf5), tmr5_ch3(pa2), tmr5_ch4(pa3)

Definition at line 142 of file at32f415_gpio.h.

◆ TMR5CH4_GMUX

#define TMR5CH4_GMUX IOMUX_MAKE_VALUE(0x24, 19, 1, 0x01)

lick connected to tmr5_ch4 input capture for calibration

Definition at line 143 of file at32f415_gpio.h.


AT32F415 Firmwary Library: IOMUX_map5_definition

Macros
IOMUX_map5_definition
AT32F415_periph_driver » GPIO

iomux map5 definitions More...

Macros

#define | I2C1_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 4, 4, 0x01)
#define | I2C1_GMUX_0010 IOMUX_MAKE_VALUE(0x28, 4, 4, 0x02)
#define | I2C2_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 8, 4, 0x01)
#define | I2C2_GMUX_0010 IOMUX_MAKE_VALUE(0x28, 8, 4, 0x02)
#define | I2C2_GMUX_0011 IOMUX_MAKE_VALUE(0x28, 8, 4, 0x03)
#define | SPI1_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 16, 4, 0x01)
#define | SPI2_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 20, 4, 0x01)

Detailed Description

iomux map5 definitions

Macro Definition Documentation

◆ I2C1_GMUX_0001

#define I2C1_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 4, 4, 0x01)

i2c1_scl(pb8), i2c1_sda(pb9), i2c1_smba(pb5)

Definition at line 154 of file at32f415_gpio.h.

◆ I2C1_GMUX_0010

#define I2C1_GMUX_0010 IOMUX_MAKE_VALUE(0x28, 4, 4, 0x02)

i2c1_scl(pf6), i2c1_sda(pf7), i2c1_smba(pb5)

Definition at line 155 of file at32f415_gpio.h.

◆ I2C2_GMUX_0001

#define I2C2_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 8, 4, 0x01)

i2c2_scl(pa8), i2c2_sda(pc9), i2c2_smba(pa9)

Definition at line 156 of file at32f415_gpio.h.

◆ I2C2_GMUX_0010

#define I2C2_GMUX_0010 IOMUX_MAKE_VALUE(0x28, 8, 4, 0x02)

i2c2_scl(pa8), i2c2_sda(pb4), i2c2_smba(pa9)

Definition at line 157 of file at32f415_gpio.h.

◆ I2C2_GMUX_0011

#define I2C2_GMUX_0011 IOMUX_MAKE_VALUE(0x28, 8, 4, 0x03)

i2c2_scl(pf6), i2c2_sda(pf7), i2c2_smba(pa9)

Definition at line 158 of file at32f415_gpio.h.

◆ SPI1_GMUX_0001

#define SPI1_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 16, 4, 0x01)

spi1_cs/i2s1_ws(pa15), spi1_sck/i2s1_ck(pb3), spi1_miso(pb4), spi1_mosi/i2s1_sd(pb5), i2s1_mck(pb6)

Definition at line 159 of file at32f415_gpio.h.

◆ SPI2_GMUX_0001

#define SPI2_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 20, 4, 0x01)

spi2_cs/i2s2_ws(pa15), spi2_sck/i2s2_ck(pb3), spi2_miso(pb4), spi2_mosi/i2s2_sd(pb5), i2s2_mck(pc7)

Definition at line 160 of file at32f415_gpio.h.


AT32F415 Firmwary Library: IOMUX_map6_definition

Macros
IOMUX_map6_definition
AT32F415_periph_driver » GPIO

iomux map6 definitions More...

Macros

#define | CAN1_GMUX_0010 IOMUX_MAKE_VALUE(0x2C, 0, 4, 0x02)
#define | SDIO1_GMUX_0100 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x04)
#define | SDIO1_GMUX_0101 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x05)
#define | SDIO1_GMUX_0110 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x06)
#define | SDIO1_GMUX_0111 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x07)
#define | USART1_GMUX_0001 IOMUX_MAKE_VALUE(0x2C, 16, 4, 0x01)
#define | USART3_GMUX_0001 IOMUX_MAKE_VALUE(0x2C, 24, 4, 0x01)
#define | USART3_GMUX_0010 IOMUX_MAKE_VALUE(0x2C, 24, 4, 0x02)
#define | UART4_GMUX_0001 IOMUX_MAKE_VALUE(0x2C, 28, 4, 0x01)

Detailed Description

iomux map6 definitions

Macro Definition Documentation

◆ CAN1_GMUX_0010

#define CAN1_GMUX_0010 IOMUX_MAKE_VALUE(0x2C, 0, 4, 0x02)

can_rx(pb8), can_tx(pb9)

Definition at line 171 of file at32f415_gpio.h.

◆ SDIO1_GMUX_0100

#define SDIO1_GMUX_0100 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x04)

sdio1_ck(pc4), sdio1_cmd(pc5), sdio1_d0(pc0), sdio1_d1(pc1), sdio1_d2(pc2), sdio1_d3(pc3), sdio1_d4(pa4), sdio1_d5(pa5), sdio1_d6(pa6), sdio1_d7(pa7)

Definition at line 172 of file at32f415_gpio.h.

◆ SDIO1_GMUX_0101

#define SDIO1_GMUX_0101 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x05)

sdio1_ck(pc4), sdio1_cmd(pc5), sdio1_d0(pa4), sdio1_d1(pa5), sdio1_d2(pa6), sdio1_d3(pa7)

Definition at line 173 of file at32f415_gpio.h.

◆ SDIO1_GMUX_0110

#define SDIO1_GMUX_0110 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x06)

sdio1_ck(pa2), sdio1_cmd(pa3), sdio1_d0(pc0), sdio1_d1(pc1), sdio1_d2(pc2), sdio1_d3(pc3), sdio1_d4(pa4), sdio1_d5(pa5), sdio1_d6(pa6), sdio1_d7(pa7)

Definition at line 174 of file at32f415_gpio.h.

◆ SDIO1_GMUX_0111

#define SDIO1_GMUX_0111 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x07)

sdio1_ck(pa2), sdio1_cmd(pa3), sdio1_d0(pa4), sdio1_d1(pa5), sdio1_d2(pa6), sdio1_d3(pa7)

Definition at line 175 of file at32f415_gpio.h.

◆ UART4_GMUX_0001

#define UART4_GMUX_0001 IOMUX_MAKE_VALUE(0x2C, 28, 4, 0x01)

uart4_tx(pf4), uart4_rx(pf5)

Definition at line 179 of file at32f415_gpio.h.

◆ USART1_GMUX_0001

#define USART1_GMUX_0001 IOMUX_MAKE_VALUE(0x2C, 16, 4, 0x01)

usart1_tx(pb6), usart1_rx(pb7)

Definition at line 176 of file at32f415_gpio.h.

◆ USART3_GMUX_0001

#define USART3_GMUX_0001 IOMUX_MAKE_VALUE(0x2C, 24, 4, 0x01)

usart3_tx(pc10), usart3_rx(pc11), usart3_ck(pc12), usart3_cts(pb13), usart3_rts(pb14)

Definition at line 177 of file at32f415_gpio.h.

◆ USART3_GMUX_0010

#define USART3_GMUX_0010 IOMUX_MAKE_VALUE(0x2C, 24, 4, 0x02)

usart3_tx(pa7), usart3_rx(pa6), usart3_ck(pa5), usart3_cts(pb1), usart3_rts(pb0)

Definition at line 178 of file at32f415_gpio.h.


AT32F415 Firmwary Library: IOMUX_map7_definition

Macros
IOMUX_map7_definition
AT32F415_periph_driver » GPIO

iomux map7 definitions More...

Macros

#define | ADC1_ETP_GMUX IOMUX_MAKE_VALUE(0x30, 4, 1, 0x01)
#define | ADC1_ETO_GMUX IOMUX_MAKE_VALUE(0x30, 5, 1, 0x01)
#define | SWJTAG_GMUX_001 IOMUX_MAKE_VALUE(0x30, 16, 3, 0x01)
#define | SWJTAG_GMUX_010 IOMUX_MAKE_VALUE(0x30, 16, 3, 0x02)
#define | SWJTAG_GMUX_100 IOMUX_MAKE_VALUE(0x30, 16, 3, 0x04)
#define | PD01_GMUX IOMUX_MAKE_VALUE(0x30, 20, 1, 0x01)

Detailed Description

iomux map7 definitions

Macro Definition Documentation

◆ ADC1_ETO_GMUX

#define ADC1_ETO_GMUX IOMUX_MAKE_VALUE(0x30, 5, 1, 0x01)

adc1 external trigger ordinary conversion muxing

Definition at line 191 of file at32f415_gpio.h.

◆ ADC1_ETP_GMUX

#define ADC1_ETP_GMUX IOMUX_MAKE_VALUE(0x30, 4, 1, 0x01)

adc1 external trigger preempted conversion muxing

Definition at line 190 of file at32f415_gpio.h.

◆ PD01_GMUX

#define PD01_GMUX IOMUX_MAKE_VALUE(0x30, 20, 1, 0x01)

pd0/pd1 mapping on osc_in/osc_out

Definition at line 195 of file at32f415_gpio.h.

◆ SWJTAG_GMUX_001

#define SWJTAG_GMUX_001 IOMUX_MAKE_VALUE(0x30, 16, 3, 0x01)

full swj enabled (jtag-dp + sw-dp) but without jtrst

Definition at line 192 of file at32f415_gpio.h.

◆ SWJTAG_GMUX_010

#define SWJTAG_GMUX_010 IOMUX_MAKE_VALUE(0x30, 16, 3, 0x02)

jtag-dp disabled and sw-dp enabled

Definition at line 193 of file at32f415_gpio.h.

◆ SWJTAG_GMUX_100

#define SWJTAG_GMUX_100 IOMUX_MAKE_VALUE(0x30, 16, 3, 0x04)

full swj disabled (jtag-dp + sw-dp)

Definition at line 194 of file at32f415_gpio.h.


AT32F415 Firmwary Library: IOMUX_map8_definition

Macros
IOMUX_map8_definition
AT32F415_periph_driver » GPIO

iomux map8 definitions More...

Macros

#define | TMR1_BK1_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 0, 2, 0x02)
#define | TMR1_BK1_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 0, 2, 0x03)
#define | TMR1_CH1_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 2, 2, 0x02)
#define | TMR1_CH1_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 2, 2, 0x03)
#define | TMR2_CH4_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 4, 2, 0x02)
#define | TMR2_CH4_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 4, 2, 0x03)
#define | TMR3_CH1_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 6, 2, 0x02)
#define | TMR3_CH1_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 6, 2, 0x03)

Detailed Description

iomux map8 definitions

Macro Definition Documentation

◆ TMR1_BK1_CMP_GMUX_10

#define TMR1_BK1_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 0, 2, 0x02)

cmp tmr1_bpr1 connect tmr1 bk1

Definition at line 206 of file at32f415_gpio.h.

◆ TMR1_BK1_CMP_GMUX_11

#define TMR1_BK1_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 0, 2, 0x03)

cmp tmr1_bpr1 and io connect tmr1 bk1

Definition at line 207 of file at32f415_gpio.h.

◆ TMR1_CH1_CMP_GMUX_10

#define TMR1_CH1_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 2, 2, 0x02)

cmp connect tmr1 ch1

Definition at line 208 of file at32f415_gpio.h.

◆ TMR1_CH1_CMP_GMUX_11

#define TMR1_CH1_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 2, 2, 0x03)

cmp and io connect tmr1 ch1

Definition at line 209 of file at32f415_gpio.h.

◆ TMR2_CH4_CMP_GMUX_10

#define TMR2_CH4_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 4, 2, 0x02)

cmp connect tmr2 ch4

Definition at line 210 of file at32f415_gpio.h.

◆ TMR2_CH4_CMP_GMUX_11

#define TMR2_CH4_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 4, 2, 0x03)

cmp and io connect tmr2 ch4

Definition at line 211 of file at32f415_gpio.h.

◆ TMR3_CH1_CMP_GMUX_10

#define TMR3_CH1_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 6, 2, 0x02)

cmp connect tmr3 ch1

Definition at line 212 of file at32f415_gpio.h.

◆ TMR3_CH1_CMP_GMUX_11

#define TMR3_CH1_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 6, 2, 0x03)

cmp and io connect tmr3 ch1

Definition at line 213 of file at32f415_gpio.h.


AT32F415 Firmwary Library: GPIO_exported_types

Data Structures | Enumerations
GPIO_exported_types
AT32F415_periph_driver » GPIO

Data Structures

struct | gpio_init_type
gpio init type More...
struct | gpio_type
type define gpio register all More...
struct | iomux_type
type define iomux register all More...

Enumerations

enum | gpio_mode_type { GPIO_MODE_INPUT = 0x00 , GPIO_MODE_OUTPUT = 0x10 , GPIO_MODE_MUX = 0x08 , GPIO_MODE_ANALOG = 0x03 }
gpio mode select More...
enum | gpio_drive_type { GPIO_DRIVE_STRENGTH_STRONGER = 0x01 , GPIO_DRIVE_STRENGTH_MODERATE = 0x02 , GPIO_DRIVE_STRENGTH_MAXIMUM = 0x03 }
gpio output drive strength select More...
enum | gpio_output_type { GPIO_OUTPUT_PUSH_PULL = 0x00 , GPIO_OUTPUT_OPEN_DRAIN = 0x04 }
gpio output type More...
enum | gpio_pull_type { GPIO_PULL_NONE = 0x0004 , GPIO_PULL_UP = 0x0018 , GPIO_PULL_DOWN = 0x0028 }
gpio pull type More...
enum gpio_pins_source_type {
GPIO_PINS_SOURCE0 = 0x00 , GPIO_PINS_SOURCE1 = 0x01 , GPIO_PINS_SOURCE2 = 0x02 , GPIO_PINS_SOURCE3 = 0x03 ,
GPIO_PINS_SOURCE4 = 0x04 , GPIO_PINS_SOURCE5 = 0x05 , GPIO_PINS_SOURCE6 = 0x06 , GPIO_PINS_SOURCE7 = 0x07 ,
GPIO_PINS_SOURCE8 = 0x08 , GPIO_PINS_SOURCE9 = 0x09 , GPIO_PINS_SOURCE10 = 0x0A , GPIO_PINS_SOURCE11 = 0x0B ,
GPIO_PINS_SOURCE12 = 0x0C , GPIO_PINS_SOURCE13 = 0x0D , GPIO_PINS_SOURCE14 = 0x0E , GPIO_PINS_SOURCE15 = 0x0F
}
gpio pins source type More...
enum gpio_port_source_type {
GPIO_PORT_SOURCE_GPIOA = 0x00 , GPIO_PORT_SOURCE_GPIOB = 0x01 , GPIO_PORT_SOURCE_GPIOC = 0x02 , GPIO_PORT_SOURCE_GPIOD = 0x03 ,
GPIO_PORT_SOURCE_GPIOF = 0x05
}
gpio port source type More...

Detailed Description

Enumeration Type Documentation

◆ gpio_drive_type

enum gpio_drive_type

gpio output drive strength select

Enumerator
GPIO_DRIVE_STRENGTH_STRONGER | stronger sourcing/sinking strength
GPIO_DRIVE_STRENGTH_MODERATE | moderate sourcing/sinking strength
GPIO_DRIVE_STRENGTH_MAXIMUM | maximum sourcing/sinking strength

Definition at line 237 of file at32f415_gpio.h.

◆ gpio_mode_type

enum gpio_mode_type

gpio mode select

Enumerator
GPIO_MODE_INPUT | gpio input mode
GPIO_MODE_OUTPUT | gpio output mode
GPIO_MODE_MUX | gpio mux function mode
GPIO_MODE_ANALOG | gpio analog in/out mode

Definition at line 226 of file at32f415_gpio.h.

◆ gpio_output_type

enum gpio_output_type

gpio output type

Enumerator
GPIO_OUTPUT_PUSH_PULL | output push-pull
GPIO_OUTPUT_OPEN_DRAIN | output open-drain

Definition at line 247 of file at32f415_gpio.h.

◆ gpio_pins_source_type

enum gpio_pins_source_type

gpio pins source type

Enumerator
GPIO_PINS_SOURCE0 | gpio pins source number 0
GPIO_PINS_SOURCE1 | gpio pins source number 1
GPIO_PINS_SOURCE2 | gpio pins source number 2
GPIO_PINS_SOURCE3 | gpio pins source number 3
GPIO_PINS_SOURCE4 | gpio pins source number 4
GPIO_PINS_SOURCE5 | gpio pins source number 5
GPIO_PINS_SOURCE6 | gpio pins source number 6
GPIO_PINS_SOURCE7 | gpio pins source number 7
GPIO_PINS_SOURCE8 | gpio pins source number 8
GPIO_PINS_SOURCE9 | gpio pins source number 9
GPIO_PINS_SOURCE10 | gpio pins source number 10
GPIO_PINS_SOURCE11 | gpio pins source number 11
GPIO_PINS_SOURCE12 | gpio pins source number 12
GPIO_PINS_SOURCE13 | gpio pins source number 13
GPIO_PINS_SOURCE14 | gpio pins source number 14
GPIO_PINS_SOURCE15 | gpio pins source number 15

Definition at line 266 of file at32f415_gpio.h.

◆ gpio_port_source_type

enum gpio_port_source_type

gpio port source type

Enumerator
GPIO_PORT_SOURCE_GPIOA | gpio port source gpioa
GPIO_PORT_SOURCE_GPIOB | gpio port source gpiob
GPIO_PORT_SOURCE_GPIOC | gpio port source gpioc
GPIO_PORT_SOURCE_GPIOD | gpio port source gpiod
GPIO_PORT_SOURCE_GPIOF | gpio port source gpiof

Definition at line 289 of file at32f415_gpio.h.

◆ gpio_pull_type

enum gpio_pull_type

gpio pull type

Enumerator
GPIO_PULL_NONE | floating for input, no pull for output
GPIO_PULL_UP | pull-up
GPIO_PULL_DOWN | pull-down

Definition at line 256 of file at32f415_gpio.h.


AT32F415 Firmwary Library: gpio_init_type Struct Reference

Data Fields
gpio_init_type Struct Reference
AT32F415_periph_driver » GPIO » GPIO_exported_types

gpio init type More...

#include <at32f415_gpio.h>

Data Fields

uint32_t gpio_pins
gpio_output_type gpio_out_type
gpio_pull_type gpio_pull
gpio_mode_type gpio_mode
gpio_drive_type gpio_drive_strength

Detailed Description

gpio init type

Definition at line 301 of file at32f415_gpio.h.

Field Documentation

◆ gpio_drive_strength

gpio_drive_type gpio_init_type::gpio_drive_strength

drive strength selection

Definition at line 307 of file at32f415_gpio.h.

Referenced by at32_button_init(), at32_led_init(), can_gpio_config(), clkout_config(), cmp_config(), codec_i2s_init(), exint_config(), gpio_config(), gpio_configuration(), gpio_default_para_init(), gpio_init(), i2c_lowlevel_init(), main(), mclk_tmr1_init(), sd_init(), spiflash_init(), swj_dp_config(), tmr1_config(), tmr1_init(), uart_init(), uart_print_init(), usart1_config(), usart_configuration(), usart_spi_configuration(), and usb_gpio_config().

◆ gpio_mode

gpio_mode_type gpio_init_type::gpio_mode

mode selection

Definition at line 306 of file at32f415_gpio.h.

Referenced by at32_button_init(), at32_led_init(), can_gpio_config(), clkout_config(), cmp_config(), codec_i2s_init(), exint_config(), gpio_config(), gpio_configuration(), gpio_default_para_init(), gpio_init(), i2c_lowlevel_init(), main(), mclk_tmr1_init(), sd_init(), spiflash_init(), swj_dp_config(), tmr1_config(), tmr1_init(), uart_init(), uart_print_init(), usart1_config(), usart_configuration(), usart_spi_configuration(), and usb_gpio_config().

◆ gpio_out_type

gpio_output_type gpio_init_type::gpio_out_type

output type selection

Definition at line 304 of file at32f415_gpio.h.

Referenced by at32_button_init(), at32_led_init(), can_gpio_config(), clkout_config(), cmp_config(), gpio_config(), gpio_configuration(), gpio_default_para_init(), gpio_init(), i2c_lowlevel_init(), main(), sd_init(), spiflash_init(), swj_dp_config(), tmr1_config(), uart_init(), uart_print_init(), usart1_config(), usart_configuration(), usart_spi_configuration(), and usb_gpio_config().

◆ gpio_pins

uint32_t gpio_init_type::gpio_pins

pins number selection

Definition at line 303 of file at32f415_gpio.h.

Referenced by at32_button_init(), at32_led_init(), can_gpio_config(), clkout_config(), cmp_config(), codec_i2s_init(), exint_config(), gpio_config(), gpio_configuration(), gpio_default_para_init(), gpio_init(), i2c_lowlevel_init(), main(), mclk_tmr1_init(), sd_init(), spiflash_init(), swj_dp_config(), tmr1_config(), tmr1_init(), uart_init(), uart_print_init(), usart1_config(), usart_configuration(), usart_spi_configuration(), and usb_gpio_config().

◆ gpio_pull

gpio_pull_type gpio_init_type::gpio_pull

pull type selection

Definition at line 305 of file at32f415_gpio.h.

Referenced by at32_button_init(), at32_led_init(), can_gpio_config(), clkout_config(), cmp_config(), codec_i2s_init(), exint_config(), gpio_config(), gpio_configuration(), gpio_default_para_init(), gpio_init(), i2c_lowlevel_init(), main(), sd_init(), spiflash_init(), swj_dp_config(), tmr1_config(), uart_init(), uart_print_init(), usart1_config(), usart_configuration(), usart_spi_configuration(), and usb_gpio_config().

The documentation for this struct was generated from the following file:
  • at32f415_gpio.h


AT32F415 Firmwary Library: gpio_type Struct Reference

Data Fields
gpio_type Struct Reference
AT32F415_periph_driver » GPIO » GPIO_exported_types

type define gpio register all More...

#include <at32f415_gpio.h>

Data Fields

union {
__IO uint32_t cfglr
struct {
__IO uint32_t iomc0: 2
__IO uint32_t iofc0: 2
__IO uint32_t iomc1: 2
__IO uint32_t iofc1: 2
__IO uint32_t iomc2: 2
__IO uint32_t iofc2: 2
__IO uint32_t iomc3: 2
__IO uint32_t iofc3: 2
__IO uint32_t iomc4: 2
__IO uint32_t iofc4: 2
__IO uint32_t iomc5: 2
__IO uint32_t iofc5: 2
__IO uint32_t iomc6: 2
__IO uint32_t iofc6: 2
__IO uint32_t iomc7: 2
__IO uint32_t iofc7: 2
} cfglr_bit
};
gpio cfglr register, offset:0x00 More...
union {
__IO uint32_t cfghr
struct {
__IO uint32_t iomc8: 2
__IO uint32_t iofc8: 2
__IO uint32_t iomc9: 2
__IO uint32_t iofc9: 2
__IO uint32_t iomc10: 2
__IO uint32_t iofc10: 2
__IO uint32_t iomc11: 2
__IO uint32_t iofc11: 2
__IO uint32_t iomc12: 2
__IO uint32_t iofc12: 2
__IO uint32_t iomc13: 2
__IO uint32_t iofc13: 2
__IO uint32_t iomc14: 2
__IO uint32_t iofc14: 2
__IO uint32_t iomc15: 2
__IO uint32_t iofc15: 2
} cfghr_bit
};
gpio cfghr register, offset:0x04 More...
union {
__IO uint32_t idt
struct {
__IO uint32_t idt0: 1
__IO uint32_t idt1: 1
__IO uint32_t idt2: 1
__IO uint32_t idt3: 1
__IO uint32_t idt4: 1
__IO uint32_t idt5: 1
__IO uint32_t idt6: 1
__IO uint32_t idt7: 1
__IO uint32_t idt8: 1
__IO uint32_t idt9: 1
__IO uint32_t idt10: 1
__IO uint32_t idt11: 1
__IO uint32_t idt12: 1
__IO uint32_t idt13: 1
__IO uint32_t idt14: 1
__IO uint32_t idt15: 1
__IO uint32_t reserved1: 16
} idt_bit
};
gpio idt register, offset:0x08 More...
union {
__IO uint32_t odt
struct {
__IO uint32_t odt0: 1
__IO uint32_t odt1: 1
__IO uint32_t odt2: 1
__IO uint32_t odt3: 1
__IO uint32_t odt4: 1
__IO uint32_t odt5: 1
__IO uint32_t odt6: 1
__IO uint32_t odt7: 1
__IO uint32_t odt8: 1
__IO uint32_t odt9: 1
__IO uint32_t odt10: 1
__IO uint32_t odt11: 1
__IO uint32_t odt12: 1
__IO uint32_t odt13: 1
__IO uint32_t odt14: 1
__IO uint32_t odt15: 1
__IO uint32_t reserved1: 16
} odt_bit
};
gpio odt register, offset:0x0C More...
union {
__IO uint32_t scr
struct {
__IO uint32_t iosb0: 1
__IO uint32_t iosb1: 1
__IO uint32_t iosb2: 1
__IO uint32_t iosb3: 1
__IO uint32_t iosb4: 1
__IO uint32_t iosb5: 1
__IO uint32_t iosb6: 1
__IO uint32_t iosb7: 1
__IO uint32_t iosb8: 1
__IO uint32_t iosb9: 1
__IO uint32_t iosb10: 1
__IO uint32_t iosb11: 1
__IO uint32_t iosb12: 1
__IO uint32_t iosb13: 1
__IO uint32_t iosb14: 1
__IO uint32_t iosb15: 1
__IO uint32_t iocb0: 1
__IO uint32_t iocb1: 1
__IO uint32_t iocb2: 1
__IO uint32_t iocb3: 1
__IO uint32_t iocb4: 1
__IO uint32_t iocb5: 1
__IO uint32_t iocb6: 1
__IO uint32_t iocb7: 1
__IO uint32_t iocb8: 1
__IO uint32_t iocb9: 1
__IO uint32_t iocb10: 1
__IO uint32_t iocb11: 1
__IO uint32_t iocb12: 1
__IO uint32_t iocb13: 1
__IO uint32_t iocb14: 1
__IO uint32_t iocb15: 1
} scr_bit
};
gpio scr register, offset:0x10 More...
union {
__IO uint32_t clr
struct {
__IO uint32_t iocb0: 1
__IO uint32_t iocb1: 1
__IO uint32_t iocb2: 1
__IO uint32_t iocb3: 1
__IO uint32_t iocb4: 1
__IO uint32_t iocb5: 1
__IO uint32_t iocb6: 1
__IO uint32_t iocb7: 1
__IO uint32_t iocb8: 1
__IO uint32_t iocb9: 1
__IO uint32_t iocb10: 1
__IO uint32_t iocb11: 1
__IO uint32_t iocb12: 1
__IO uint32_t iocb13: 1
__IO uint32_t iocb14: 1
__IO uint32_t iocb15: 1
__IO uint32_t reserved1: 16
} clr_bit
};
gpio clr register, offset:0x14 More...
union {
__IO uint32_t wpr
struct {
__IO uint32_t wpen0: 1
__IO uint32_t wpen1: 1
__IO uint32_t wpen2: 1
__IO uint32_t wpen3: 1
__IO uint32_t wpen4: 1
__IO uint32_t wpen5: 1
__IO uint32_t wpen6: 1
__IO uint32_t wpen7: 1
__IO uint32_t wpen8: 1
__IO uint32_t wpen9: 1
__IO uint32_t wpen10: 1
__IO uint32_t wpen11: 1
__IO uint32_t wpen12: 1
__IO uint32_t wpen13: 1
__IO uint32_t wpen14: 1
__IO uint32_t wpen15: 1
__IO uint32_t wpseq: 1
__IO uint32_t reserved1: 15
} wpr_bit
};
gpio wpr register, offset:0x18 More...

Detailed Description

type define gpio register all

Definition at line 313 of file at32f415_gpio.h.

Field Documentation

◆

union { ... } gpio_type::@419

gpio cfglr register, offset:0x00

◆

union { ... } gpio_type::@421

gpio cfghr register, offset:0x04

◆

union { ... } gpio_type::@423

gpio idt register, offset:0x08

◆

union { ... } gpio_type::@425

gpio odt register, offset:0x0C

◆

union { ... } gpio_type::@427

gpio scr register, offset:0x10

◆

union { ... } gpio_type::@429

gpio clr register, offset:0x14

◆

union { ... } gpio_type::@431

gpio wpr register, offset:0x18

◆ cfghr

__IO uint32_t gpio_type::cfghr

Definition at line 347 of file at32f415_gpio.h.

Referenced by gpio_init().

◆

struct { ... } gpio_type::cfghr_bit

◆ cfglr

__IO uint32_t gpio_type::cfglr

Definition at line 320 of file at32f415_gpio.h.

Referenced by gpio_init().

◆

struct { ... } gpio_type::cfglr_bit

◆ clr

__IO uint32_t gpio_type::clr

Definition at line 473 of file at32f415_gpio.h.

Referenced by at32_led_on(), gpio_bits_reset(), gpio_bits_write(), and gpio_init().

◆

struct { ... } gpio_type::clr_bit

◆ idt

__IO uint32_t gpio_type::idt

Definition at line 374 of file at32f415_gpio.h.

Referenced by gpio_input_data_bit_read(), and gpio_input_data_read().

◆ idt0

__IO uint32_t gpio_type::idt0

Definition at line 377 of file at32f415_gpio.h.

◆ idt1

__IO uint32_t gpio_type::idt1

Definition at line 378 of file at32f415_gpio.h.

◆ idt10

__IO uint32_t gpio_type::idt10

Definition at line 387 of file at32f415_gpio.h.

◆ idt11

__IO uint32_t gpio_type::idt11

Definition at line 388 of file at32f415_gpio.h.

◆ idt12

__IO uint32_t gpio_type::idt12

Definition at line 389 of file at32f415_gpio.h.

◆ idt13

__IO uint32_t gpio_type::idt13

Definition at line 390 of file at32f415_gpio.h.

◆ idt14

__IO uint32_t gpio_type::idt14

Definition at line 391 of file at32f415_gpio.h.

◆ idt15

__IO uint32_t gpio_type::idt15

Definition at line 392 of file at32f415_gpio.h.

◆ idt2

__IO uint32_t gpio_type::idt2

Definition at line 379 of file at32f415_gpio.h.

◆ idt3

__IO uint32_t gpio_type::idt3

Definition at line 380 of file at32f415_gpio.h.

◆ idt4

__IO uint32_t gpio_type::idt4

Definition at line 381 of file at32f415_gpio.h.

◆ idt5

__IO uint32_t gpio_type::idt5

Definition at line 382 of file at32f415_gpio.h.

◆ idt6

__IO uint32_t gpio_type::idt6

Definition at line 383 of file at32f415_gpio.h.

◆ idt7

__IO uint32_t gpio_type::idt7

Definition at line 384 of file at32f415_gpio.h.

◆ idt8

__IO uint32_t gpio_type::idt8

Definition at line 385 of file at32f415_gpio.h.

◆ idt9

__IO uint32_t gpio_type::idt9

Definition at line 386 of file at32f415_gpio.h.

◆

struct { ... } gpio_type::idt_bit

◆ iocb0

__IO uint32_t gpio_type::iocb0

Definition at line 449 of file at32f415_gpio.h.

◆ iocb1

__IO uint32_t gpio_type::iocb1

Definition at line 450 of file at32f415_gpio.h.

◆ iocb10

__IO uint32_t gpio_type::iocb10

Definition at line 459 of file at32f415_gpio.h.

◆ iocb11

__IO uint32_t gpio_type::iocb11

Definition at line 460 of file at32f415_gpio.h.

◆ iocb12

__IO uint32_t gpio_type::iocb12

Definition at line 461 of file at32f415_gpio.h.

◆ iocb13

__IO uint32_t gpio_type::iocb13

Definition at line 462 of file at32f415_gpio.h.

◆ iocb14

__IO uint32_t gpio_type::iocb14

Definition at line 463 of file at32f415_gpio.h.

◆ iocb15

__IO uint32_t gpio_type::iocb15

Definition at line 464 of file at32f415_gpio.h.

◆ iocb2

__IO uint32_t gpio_type::iocb2

Definition at line 451 of file at32f415_gpio.h.

◆ iocb3

__IO uint32_t gpio_type::iocb3

Definition at line 452 of file at32f415_gpio.h.

◆ iocb4

__IO uint32_t gpio_type::iocb4

Definition at line 453 of file at32f415_gpio.h.

◆ iocb5

__IO uint32_t gpio_type::iocb5

Definition at line 454 of file at32f415_gpio.h.

◆ iocb6

__IO uint32_t gpio_type::iocb6

Definition at line 455 of file at32f415_gpio.h.

◆ iocb7

__IO uint32_t gpio_type::iocb7

Definition at line 456 of file at32f415_gpio.h.

◆ iocb8

__IO uint32_t gpio_type::iocb8

Definition at line 457 of file at32f415_gpio.h.

◆ iocb9

__IO uint32_t gpio_type::iocb9

Definition at line 458 of file at32f415_gpio.h.

◆ iofc0

__IO uint32_t gpio_type::iofc0

Definition at line 324 of file at32f415_gpio.h.

◆ iofc1

__IO uint32_t gpio_type::iofc1

Definition at line 326 of file at32f415_gpio.h.

◆ iofc10

__IO uint32_t gpio_type::iofc10

Definition at line 355 of file at32f415_gpio.h.

◆ iofc11

__IO uint32_t gpio_type::iofc11

Definition at line 357 of file at32f415_gpio.h.

◆ iofc12

__IO uint32_t gpio_type::iofc12

Definition at line 359 of file at32f415_gpio.h.

◆ iofc13

__IO uint32_t gpio_type::iofc13

Definition at line 361 of file at32f415_gpio.h.

◆ iofc14

__IO uint32_t gpio_type::iofc14

Definition at line 363 of file at32f415_gpio.h.

◆ iofc15

__IO uint32_t gpio_type::iofc15

Definition at line 365 of file at32f415_gpio.h.

◆ iofc2

__IO uint32_t gpio_type::iofc2

Definition at line 328 of file at32f415_gpio.h.

◆ iofc3

__IO uint32_t gpio_type::iofc3

Definition at line 330 of file at32f415_gpio.h.

◆ iofc4

__IO uint32_t gpio_type::iofc4

Definition at line 332 of file at32f415_gpio.h.

◆ iofc5

__IO uint32_t gpio_type::iofc5

Definition at line 334 of file at32f415_gpio.h.

◆ iofc6

__IO uint32_t gpio_type::iofc6

Definition at line 336 of file at32f415_gpio.h.

◆ iofc7

__IO uint32_t gpio_type::iofc7

Definition at line 338 of file at32f415_gpio.h.

◆ iofc8

__IO uint32_t gpio_type::iofc8

Definition at line 351 of file at32f415_gpio.h.

◆ iofc9

__IO uint32_t gpio_type::iofc9

Definition at line 353 of file at32f415_gpio.h.

◆ iomc0

__IO uint32_t gpio_type::iomc0

Definition at line 323 of file at32f415_gpio.h.

◆ iomc1

__IO uint32_t gpio_type::iomc1

Definition at line 325 of file at32f415_gpio.h.

◆ iomc10

__IO uint32_t gpio_type::iomc10

Definition at line 354 of file at32f415_gpio.h.

◆ iomc11

__IO uint32_t gpio_type::iomc11

Definition at line 356 of file at32f415_gpio.h.

◆ iomc12

__IO uint32_t gpio_type::iomc12

Definition at line 358 of file at32f415_gpio.h.

◆ iomc13

__IO uint32_t gpio_type::iomc13

Definition at line 360 of file at32f415_gpio.h.

◆ iomc14

__IO uint32_t gpio_type::iomc14

Definition at line 362 of file at32f415_gpio.h.

◆ iomc15

__IO uint32_t gpio_type::iomc15

Definition at line 364 of file at32f415_gpio.h.

◆ iomc2

__IO uint32_t gpio_type::iomc2

Definition at line 327 of file at32f415_gpio.h.

◆ iomc3

__IO uint32_t gpio_type::iomc3

Definition at line 329 of file at32f415_gpio.h.

◆ iomc4

__IO uint32_t gpio_type::iomc4

Definition at line 331 of file at32f415_gpio.h.

◆ iomc5

__IO uint32_t gpio_type::iomc5

Definition at line 333 of file at32f415_gpio.h.

◆ iomc6

__IO uint32_t gpio_type::iomc6

Definition at line 335 of file at32f415_gpio.h.

◆ iomc7

__IO uint32_t gpio_type::iomc7

Definition at line 337 of file at32f415_gpio.h.

◆ iomc8

__IO uint32_t gpio_type::iomc8

Definition at line 350 of file at32f415_gpio.h.

◆ iomc9

__IO uint32_t gpio_type::iomc9

Definition at line 352 of file at32f415_gpio.h.

◆ iosb0

__IO uint32_t gpio_type::iosb0

Definition at line 433 of file at32f415_gpio.h.

◆ iosb1

__IO uint32_t gpio_type::iosb1

Definition at line 434 of file at32f415_gpio.h.

◆ iosb10

__IO uint32_t gpio_type::iosb10

Definition at line 443 of file at32f415_gpio.h.

◆ iosb11

__IO uint32_t gpio_type::iosb11

Definition at line 444 of file at32f415_gpio.h.

◆ iosb12

__IO uint32_t gpio_type::iosb12

Definition at line 445 of file at32f415_gpio.h.

◆ iosb13

__IO uint32_t gpio_type::iosb13

Definition at line 446 of file at32f415_gpio.h.

◆ iosb14

__IO uint32_t gpio_type::iosb14

Definition at line 447 of file at32f415_gpio.h.

◆ iosb15

__IO uint32_t gpio_type::iosb15

Definition at line 448 of file at32f415_gpio.h.

◆ iosb2

__IO uint32_t gpio_type::iosb2

Definition at line 435 of file at32f415_gpio.h.

◆ iosb3

__IO uint32_t gpio_type::iosb3

Definition at line 436 of file at32f415_gpio.h.

◆ iosb4

__IO uint32_t gpio_type::iosb4

Definition at line 437 of file at32f415_gpio.h.

◆ iosb5

__IO uint32_t gpio_type::iosb5

Definition at line 438 of file at32f415_gpio.h.

◆ iosb6

__IO uint32_t gpio_type::iosb6

Definition at line 439 of file at32f415_gpio.h.

◆ iosb7

__IO uint32_t gpio_type::iosb7

Definition at line 440 of file at32f415_gpio.h.

◆ iosb8

__IO uint32_t gpio_type::iosb8

Definition at line 441 of file at32f415_gpio.h.

◆ iosb9

__IO uint32_t gpio_type::iosb9

Definition at line 442 of file at32f415_gpio.h.

◆ odt

__IO uint32_t gpio_type::odt

Definition at line 402 of file at32f415_gpio.h.

Referenced by at32_led_toggle(), gpio_output_data_bit_read(), gpio_output_data_read(), gpio_pins_toggle(), and gpio_port_wirte().

◆ odt0

__IO uint32_t gpio_type::odt0

Definition at line 405 of file at32f415_gpio.h.

◆ odt1

__IO uint32_t gpio_type::odt1

Definition at line 406 of file at32f415_gpio.h.

◆ odt10

__IO uint32_t gpio_type::odt10

Definition at line 415 of file at32f415_gpio.h.

◆ odt11

__IO uint32_t gpio_type::odt11

Definition at line 416 of file at32f415_gpio.h.

◆ odt12

__IO uint32_t gpio_type::odt12

Definition at line 417 of file at32f415_gpio.h.

◆ odt13

__IO uint32_t gpio_type::odt13

Definition at line 418 of file at32f415_gpio.h.

◆ odt14

__IO uint32_t gpio_type::odt14

Definition at line 419 of file at32f415_gpio.h.

◆ odt15

__IO uint32_t gpio_type::odt15

Definition at line 420 of file at32f415_gpio.h.

◆ odt2

__IO uint32_t gpio_type::odt2

Definition at line 407 of file at32f415_gpio.h.

◆ odt3

__IO uint32_t gpio_type::odt3

Definition at line 408 of file at32f415_gpio.h.

◆ odt4

__IO uint32_t gpio_type::odt4

Definition at line 409 of file at32f415_gpio.h.

◆ odt5

__IO uint32_t gpio_type::odt5

Definition at line 410 of file at32f415_gpio.h.

◆ odt6

__IO uint32_t gpio_type::odt6

Definition at line 411 of file at32f415_gpio.h.

◆ odt7

__IO uint32_t gpio_type::odt7

Definition at line 412 of file at32f415_gpio.h.

◆ odt8

__IO uint32_t gpio_type::odt8

Definition at line 413 of file at32f415_gpio.h.

◆ odt9

__IO uint32_t gpio_type::odt9

Definition at line 414 of file at32f415_gpio.h.

◆

struct { ... } gpio_type::odt_bit

◆ reserved1

__IO uint32_t gpio_type::reserved1

Definition at line 393 of file at32f415_gpio.h.

◆ scr

__IO uint32_t gpio_type::scr

Definition at line 430 of file at32f415_gpio.h.

Referenced by at32_led_off(), gpio_bits_set(), gpio_bits_write(), and gpio_init().

◆

struct { ... } gpio_type::scr_bit

◆ wpen0

__IO uint32_t gpio_type::wpen0

Definition at line 504 of file at32f415_gpio.h.

◆ wpen1

__IO uint32_t gpio_type::wpen1

Definition at line 505 of file at32f415_gpio.h.

◆ wpen10

__IO uint32_t gpio_type::wpen10

Definition at line 514 of file at32f415_gpio.h.

◆ wpen11

__IO uint32_t gpio_type::wpen11

Definition at line 515 of file at32f415_gpio.h.

◆ wpen12

__IO uint32_t gpio_type::wpen12

Definition at line 516 of file at32f415_gpio.h.

◆ wpen13

__IO uint32_t gpio_type::wpen13

Definition at line 517 of file at32f415_gpio.h.

◆ wpen14

__IO uint32_t gpio_type::wpen14

Definition at line 518 of file at32f415_gpio.h.

◆ wpen15

__IO uint32_t gpio_type::wpen15

Definition at line 519 of file at32f415_gpio.h.

◆ wpen2

__IO uint32_t gpio_type::wpen2

Definition at line 506 of file at32f415_gpio.h.

◆ wpen3

__IO uint32_t gpio_type::wpen3

Definition at line 507 of file at32f415_gpio.h.

◆ wpen4

__IO uint32_t gpio_type::wpen4

Definition at line 508 of file at32f415_gpio.h.

◆ wpen5

__IO uint32_t gpio_type::wpen5

Definition at line 509 of file at32f415_gpio.h.

◆ wpen6

__IO uint32_t gpio_type::wpen6

Definition at line 510 of file at32f415_gpio.h.

◆ wpen7

__IO uint32_t gpio_type::wpen7

Definition at line 511 of file at32f415_gpio.h.

◆ wpen8

__IO uint32_t gpio_type::wpen8

Definition at line 512 of file at32f415_gpio.h.

◆ wpen9

__IO uint32_t gpio_type::wpen9

Definition at line 513 of file at32f415_gpio.h.

◆ wpr

__IO uint32_t gpio_type::wpr

Definition at line 501 of file at32f415_gpio.h.

Referenced by gpio_pin_wp_config().

◆

struct { ... } gpio_type::wpr_bit

◆ wpseq

__IO uint32_t gpio_type::wpseq

Definition at line 520 of file at32f415_gpio.h.

The documentation for this struct was generated from the following file:
  • at32f415_gpio.h


AT32F415 Firmwary Library: iomux_type Struct Reference

Data Fields
iomux_type Struct Reference
AT32F415_periph_driver » GPIO » GPIO_exported_types

type define iomux register all More...

#include <at32f415_gpio.h>

Data Fields

union {
__IO uint32_t evtout
struct {
__IO uint32_t selpin: 4
__IO uint32_t selport: 3
__IO uint32_t evoen: 1
__IO uint32_t reserved1: 24
} evtout_bit
};
mux event control register, offset:0x00 More...
union {
__IO uint32_t remap
struct {
__IO uint32_t spi1_mux_l: 1
__IO uint32_t i2c1_mux: 1
__IO uint32_t usart1_mux: 1
__IO uint32_t reserved1: 1
__IO uint32_t usart3_mux: 2
__IO uint32_t tmr1_mux: 2
__IO uint32_t tmr2_mux: 2
__IO uint32_t tmr3_mux: 2
__IO uint32_t reserved2: 1
__IO uint32_t can_mux: 2
__IO uint32_t pd01_mux: 1
__IO uint32_t tmr5ch4_mux: 1
__IO uint32_t adc1_extrgpre_mux: 1
__IO uint32_t adc1_extrgord_mux: 1
__IO uint32_t reserved3: 5
__IO uint32_t swjtag_conf: 3
__IO uint32_t reserved4: 4
__IO uint32_t spi1_mux_h: 1
} remap_bit
};
iomux remap register, offset:0x04 More...
union {
__IO uint32_t exintc1
struct {
__IO uint32_t exint0: 4
__IO uint32_t exint1: 4
__IO uint32_t exint2: 4
__IO uint32_t exint3: 4
__IO uint32_t reserved1: 16
} exintc1_bit
};
mux external interrupt configuration register 1, offset:0x08 More...
union {
__IO uint32_t exintc2
struct {
__IO uint32_t exint4: 4
__IO uint32_t exint5: 4
__IO uint32_t exint6: 4
__IO uint32_t exint7: 4
__IO uint32_t reserved1: 16
} exintc2_bit
};
mux external interrupt configuration register 2, offset:0x0c More...
union {
__IO uint32_t exintc3
struct {
__IO uint32_t exint8: 4
__IO uint32_t exint9: 4
__IO uint32_t exint10: 4
__IO uint32_t exint11: 4
__IO uint32_t reserved1: 16
} exintc3_bit
};
mux external interrupt configuration register 3, offset:0x10 More...
union {
__IO uint32_t exintc4
struct {
__IO uint32_t exint12: 4
__IO uint32_t exint13: 4
__IO uint32_t exint14: 4
__IO uint32_t exint15: 4
__IO uint32_t reserved1: 16
} exintc4_bit
};
mux external interrupt configuration register 4, offset:0x14 More...
union {
__IO uint32_t remap2
struct {
__IO uint32_t reserved1: 26
__IO uint32_t cmp_mux: 2
__IO uint32_t reserved2: 4
} remap2_bit
};
iomux remap register 2, offset:0x1C More...
union {
__IO uint32_t remap3
struct {
__IO uint32_t tmr9_gmux: 4
__IO uint32_t tmr10_gmux: 4
__IO uint32_t tmr11_gmux: 4
__IO uint32_t reserved1: 20
} remap3_bit
};
iomux remap register 3, offset:0x20 More...
union {
__IO uint32_t remap4
struct {
__IO uint32_t tmr1_gmux: 4
__IO uint32_t tmr2_gmux: 3
__IO uint32_t reserved1: 1
__IO uint32_t tmr3_gmux: 4
__IO uint32_t reserved2: 4
__IO uint32_t tmr5_gmux: 3
__IO uint32_t tmr5ch4_gmux: 1
__IO uint32_t reserved3: 12
} remap4_bit
};
iomux remap register 4, offset:0x24 More...
union {
__IO uint32_t remap5
struct {
__IO uint32_t reserved1: 4
__IO uint32_t i2c1_gmux: 4
__IO uint32_t i2c2_gmux: 4
__IO uint32_t reserved2: 4
__IO uint32_t spi1_gmux: 4
__IO uint32_t spi2_gmux: 4
__IO uint32_t reserved3: 8
} remap5_bit
};
iomux remap register 5, offset:0x28 More...
union {
__IO uint32_t remap6
struct {
__IO uint32_t can1_gmux: 4
__IO uint32_t reserved1: 4
__IO uint32_t sdio1_gmux: 4
__IO uint32_t reserved2: 4
__IO uint32_t usart1_gmux: 4
__IO uint32_t reserved3: 4
__IO uint32_t usart3_gmux: 4
__IO uint32_t uart4_gmux: 4
} remap6_bit
};
iomux remap register 6, offset:0x2C More...
union {
__IO uint32_t remap7
struct {
__IO uint32_t reserved1: 4
__IO uint32_t adc1_etp_gmux: 1
__IO uint32_t adc1_eto_gmux: 1
__IO uint32_t reserved2: 10
__IO uint32_t swjtag_gmux: 3
__IO uint32_t reserved3: 1
__IO uint32_t pd01_gmux: 1
__IO uint32_t reserved4: 11
} remap7_bit
};
iomux remap register 7, offset:0x30 More...
union {
__IO uint32_t remap8
struct {
__IO uint32_t tmr1_bk1_cmp_gmux: 2
__IO uint32_t tmr1_ch1_cmp_gmux: 2
__IO uint32_t tmr2_ch4_cmp_gmux: 2
__IO uint32_t tmr3_ch1_cmp_gmux: 2
__IO uint32_t reserved1: 24
} remap8_bit
};
iomux remap register 8, offset:0x34 More...

Detailed Description

type define iomux register all

Definition at line 530 of file at32f415_gpio.h.

Field Documentation

◆

union { ... } iomux_type::@440

mux event control register, offset:0x00

◆

union { ... } iomux_type::@442

iomux remap register, offset:0x04

◆

union { ... } iomux_type::@444

mux external interrupt configuration register 1, offset:0x08

◆

union { ... } iomux_type::@446

mux external interrupt configuration register 2, offset:0x0c

◆

union { ... } iomux_type::@448

mux external interrupt configuration register 3, offset:0x10

◆

union { ... } iomux_type::@450

mux external interrupt configuration register 4, offset:0x14

◆

union { ... } iomux_type::@452

iomux remap register 2, offset:0x1C

◆

union { ... } iomux_type::@454

iomux remap register 3, offset:0x20

◆

union { ... } iomux_type::@456

iomux remap register 4, offset:0x24

◆

union { ... } iomux_type::@458

iomux remap register 5, offset:0x28

◆

union { ... } iomux_type::@460

iomux remap register 6, offset:0x2C

◆

union { ... } iomux_type::@462

iomux remap register 7, offset:0x30

◆

union { ... } iomux_type::@464

iomux remap register 8, offset:0x34

◆ adc1_eto_gmux

__IO uint32_t iomux_type::adc1_eto_gmux

Definition at line 740 of file at32f415_gpio.h.

◆ adc1_etp_gmux

__IO uint32_t iomux_type::adc1_etp_gmux

Definition at line 739 of file at32f415_gpio.h.

◆ adc1_extrgord_mux

__IO uint32_t iomux_type::adc1_extrgord_mux

Definition at line 568 of file at32f415_gpio.h.

◆ adc1_extrgpre_mux

__IO uint32_t iomux_type::adc1_extrgpre_mux

Definition at line 567 of file at32f415_gpio.h.

◆ can1_gmux

__IO uint32_t iomux_type::can1_gmux

Definition at line 719 of file at32f415_gpio.h.

◆ can_mux

__IO uint32_t iomux_type::can_mux

Definition at line 564 of file at32f415_gpio.h.

◆ cmp_mux

__IO uint32_t iomux_type::cmp_mux

Definition at line 654 of file at32f415_gpio.h.

◆ evoen

__IO uint32_t iomux_type::evoen

Definition at line 542 of file at32f415_gpio.h.

◆ evtout

__IO uint32_t iomux_type::evtout

Definition at line 537 of file at32f415_gpio.h.

◆

struct { ... } iomux_type::evtout_bit

◆ exint0

__IO uint32_t iomux_type::exint0

Definition at line 584 of file at32f415_gpio.h.

◆ exint1

__IO uint32_t iomux_type::exint1

Definition at line 585 of file at32f415_gpio.h.

◆ exint10

__IO uint32_t iomux_type::exint10

Definition at line 618 of file at32f415_gpio.h.

◆ exint11

__IO uint32_t iomux_type::exint11

Definition at line 619 of file at32f415_gpio.h.

◆ exint12

__IO uint32_t iomux_type::exint12

Definition at line 632 of file at32f415_gpio.h.

◆ exint13

__IO uint32_t iomux_type::exint13

Definition at line 633 of file at32f415_gpio.h.

◆ exint14

__IO uint32_t iomux_type::exint14

Definition at line 634 of file at32f415_gpio.h.

◆ exint15

__IO uint32_t iomux_type::exint15

Definition at line 635 of file at32f415_gpio.h.

◆ exint2

__IO uint32_t iomux_type::exint2

Definition at line 586 of file at32f415_gpio.h.

◆ exint3

__IO uint32_t iomux_type::exint3

Definition at line 587 of file at32f415_gpio.h.

◆ exint4

__IO uint32_t iomux_type::exint4

Definition at line 600 of file at32f415_gpio.h.

◆ exint5

__IO uint32_t iomux_type::exint5

Definition at line 601 of file at32f415_gpio.h.

◆ exint6

__IO uint32_t iomux_type::exint6

Definition at line 602 of file at32f415_gpio.h.

◆ exint7

__IO uint32_t iomux_type::exint7

Definition at line 603 of file at32f415_gpio.h.

◆ exint8

__IO uint32_t iomux_type::exint8

Definition at line 616 of file at32f415_gpio.h.

◆ exint9

__IO uint32_t iomux_type::exint9

Definition at line 617 of file at32f415_gpio.h.

◆ exintc1

__IO uint32_t iomux_type::exintc1

Definition at line 581 of file at32f415_gpio.h.

◆

struct { ... } iomux_type::exintc1_bit

◆ exintc2

__IO uint32_t iomux_type::exintc2

Definition at line 597 of file at32f415_gpio.h.

◆

struct { ... } iomux_type::exintc2_bit

◆ exintc3

__IO uint32_t iomux_type::exintc3

Definition at line 613 of file at32f415_gpio.h.

◆

struct { ... } iomux_type::exintc3_bit

◆ exintc4

__IO uint32_t iomux_type::exintc4

Definition at line 629 of file at32f415_gpio.h.

◆

struct { ... } iomux_type::exintc4_bit

◆ i2c1_gmux

__IO uint32_t iomux_type::i2c1_gmux

Definition at line 702 of file at32f415_gpio.h.

◆ i2c1_mux

__IO uint32_t iomux_type::i2c1_mux

Definition at line 556 of file at32f415_gpio.h.

◆ i2c2_gmux

__IO uint32_t iomux_type::i2c2_gmux

Definition at line 703 of file at32f415_gpio.h.

◆ pd01_gmux

__IO uint32_t iomux_type::pd01_gmux

Definition at line 744 of file at32f415_gpio.h.

◆ pd01_mux

__IO uint32_t iomux_type::pd01_mux

Definition at line 565 of file at32f415_gpio.h.

◆ remap

__IO uint32_t iomux_type::remap

Definition at line 552 of file at32f415_gpio.h.

◆ remap2

__IO uint32_t iomux_type::remap2

Definition at line 650 of file at32f415_gpio.h.

◆

struct { ... } iomux_type::remap2_bit

◆ remap3

__IO uint32_t iomux_type::remap3

Definition at line 664 of file at32f415_gpio.h.

◆

struct { ... } iomux_type::remap3_bit

◆ remap4

__IO uint32_t iomux_type::remap4

Definition at line 679 of file at32f415_gpio.h.

◆

struct { ... } iomux_type::remap4_bit

◆ remap5

__IO uint32_t iomux_type::remap5

Definition at line 698 of file at32f415_gpio.h.

◆

struct { ... } iomux_type::remap5_bit

◆ remap6

__IO uint32_t iomux_type::remap6

Definition at line 716 of file at32f415_gpio.h.

◆

struct { ... } iomux_type::remap6_bit

◆ remap7

__IO uint32_t iomux_type::remap7

Definition at line 735 of file at32f415_gpio.h.

◆

struct { ... } iomux_type::remap7_bit

◆ remap8

__IO uint32_t iomux_type::remap8

Definition at line 754 of file at32f415_gpio.h.

◆

struct { ... } iomux_type::remap8_bit

◆

struct { ... } iomux_type::remap_bit

◆ reserved1

__IO uint32_t iomux_type::reserved1

iomux reserved1 register, offset:0x18

Definition at line 543 of file at32f415_gpio.h.

◆ reserved2

__IO uint32_t iomux_type::reserved2

Definition at line 563 of file at32f415_gpio.h.

◆ reserved3

__IO uint32_t iomux_type::reserved3

Definition at line 569 of file at32f415_gpio.h.

◆ reserved4

__IO uint32_t iomux_type::reserved4

Definition at line 571 of file at32f415_gpio.h.

◆ sdio1_gmux

__IO uint32_t iomux_type::sdio1_gmux

Definition at line 721 of file at32f415_gpio.h.

◆ selpin

__IO uint32_t iomux_type::selpin

Definition at line 540 of file at32f415_gpio.h.

◆ selport

__IO uint32_t iomux_type::selport

Definition at line 541 of file at32f415_gpio.h.

◆ spi1_gmux

__IO uint32_t iomux_type::spi1_gmux

Definition at line 705 of file at32f415_gpio.h.

◆ spi1_mux_h

__IO uint32_t iomux_type::spi1_mux_h

Definition at line 572 of file at32f415_gpio.h.

◆ spi1_mux_l

__IO uint32_t iomux_type::spi1_mux_l

Definition at line 555 of file at32f415_gpio.h.

◆ spi2_gmux

__IO uint32_t iomux_type::spi2_gmux

Definition at line 706 of file at32f415_gpio.h.

◆ swjtag_conf

__IO uint32_t iomux_type::swjtag_conf

Definition at line 570 of file at32f415_gpio.h.

◆ swjtag_gmux

__IO uint32_t iomux_type::swjtag_gmux

Definition at line 742 of file at32f415_gpio.h.

◆ tmr10_gmux

__IO uint32_t iomux_type::tmr10_gmux

Definition at line 668 of file at32f415_gpio.h.

◆ tmr11_gmux

__IO uint32_t iomux_type::tmr11_gmux

Definition at line 669 of file at32f415_gpio.h.

◆ tmr1_bk1_cmp_gmux

__IO uint32_t iomux_type::tmr1_bk1_cmp_gmux

Definition at line 757 of file at32f415_gpio.h.

◆ tmr1_ch1_cmp_gmux

__IO uint32_t iomux_type::tmr1_ch1_cmp_gmux

Definition at line 758 of file at32f415_gpio.h.

◆ tmr1_gmux

__IO uint32_t iomux_type::tmr1_gmux

Definition at line 682 of file at32f415_gpio.h.

◆ tmr1_mux

__IO uint32_t iomux_type::tmr1_mux

Definition at line 560 of file at32f415_gpio.h.

◆ tmr2_ch4_cmp_gmux

__IO uint32_t iomux_type::tmr2_ch4_cmp_gmux

Definition at line 759 of file at32f415_gpio.h.

◆ tmr2_gmux

__IO uint32_t iomux_type::tmr2_gmux

Definition at line 683 of file at32f415_gpio.h.

◆ tmr2_mux

__IO uint32_t iomux_type::tmr2_mux

Definition at line 561 of file at32f415_gpio.h.

◆ tmr3_ch1_cmp_gmux

__IO uint32_t iomux_type::tmr3_ch1_cmp_gmux

Definition at line 760 of file at32f415_gpio.h.

◆ tmr3_gmux

__IO uint32_t iomux_type::tmr3_gmux

Definition at line 685 of file at32f415_gpio.h.

◆ tmr3_mux

__IO uint32_t iomux_type::tmr3_mux

Definition at line 562 of file at32f415_gpio.h.

◆ tmr5_gmux

__IO uint32_t iomux_type::tmr5_gmux

Definition at line 687 of file at32f415_gpio.h.

◆ tmr5ch4_gmux

__IO uint32_t iomux_type::tmr5ch4_gmux

Definition at line 688 of file at32f415_gpio.h.

◆ tmr5ch4_mux

__IO uint32_t iomux_type::tmr5ch4_mux

Definition at line 566 of file at32f415_gpio.h.

◆ tmr9_gmux

__IO uint32_t iomux_type::tmr9_gmux

Definition at line 667 of file at32f415_gpio.h.

◆ uart4_gmux

__IO uint32_t iomux_type::uart4_gmux

Definition at line 726 of file at32f415_gpio.h.

◆ usart1_gmux

__IO uint32_t iomux_type::usart1_gmux

Definition at line 723 of file at32f415_gpio.h.

◆ usart1_mux

__IO uint32_t iomux_type::usart1_mux

Definition at line 557 of file at32f415_gpio.h.

◆ usart3_gmux

__IO uint32_t iomux_type::usart3_gmux

Definition at line 725 of file at32f415_gpio.h.

◆ usart3_mux

__IO uint32_t iomux_type::usart3_mux

Definition at line 559 of file at32f415_gpio.h.

The documentation for this struct was generated from the following file:
  • at32f415_gpio.h


AT32F415 Firmwary Library: GPIO_exported_functions

Functions
GPIO_exported_functions
AT32F415_periph_driver » GPIO

Functions

void | gpio_reset (gpio_type *gpio_x)
reset the gpio register More...
void | gpio_iomux_reset (void)
reset the mux functions (remap, event control and exint configuration) registers to their default values. More...
void | gpio_init (gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral. More...
void | gpio_default_para_init (gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value. More...
flag_status | gpio_input_data_bit_read (gpio_type *gpio_x, uint16_t pins)
read the specified input port pin. More...
uint16_t | gpio_input_data_read (gpio_type *gpio_x)
read the specified gpio input data port. More...
flag_status | gpio_output_data_bit_read (gpio_type *gpio_x, uint16_t pins)
read the specified output port pin. More...
uint16_t | gpio_output_data_read (gpio_type *gpio_x)
read the specified gpio ouput data port. More...
void | gpio_bits_set (gpio_type *gpio_x, uint16_t pins)
set the selected data port bits. More...
void | gpio_bits_reset (gpio_type *gpio_x, uint16_t pins)
clear the selected data port bits. More...
void | gpio_bits_write (gpio_type *gpio_x, uint16_t pins, confirm_state bit_state)
set or clear the selected data port bit. More...
void | gpio_port_wirte (gpio_type *gpio_x, uint16_t port_value)
write data to the specified gpio data port. More...
void | gpio_pin_wp_config (gpio_type *gpio_x, uint16_t pins)
write protect gpio pins configuration registers. More...
void | gpio_event_output_config (gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as event output. More...
void | gpio_event_output_enable (confirm_state new_state)
enable or disable the event output. More...
void | gpio_pin_remap_config (uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration. More...
void | gpio_exint_line_config (gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line. More...

Detailed Description

Function Documentation

◆ gpio_bits_reset()

void gpio_bits_reset | ( | gpio_type * | gpio_x,
 |  | uint16_t | pins
 | ) |  |

clear the selected data port bits.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
pins gpio pin number parameter can be any combination of gpio_pin_x, gpio_pin_x as following values:
  • GPIO_PINS_0
  • GPIO_PINS_1
  • GPIO_PINS_2
  • GPIO_PINS_3
  • GPIO_PINS_4
  • GPIO_PINS_5
  • GPIO_PINS_6
  • GPIO_PINS_7
  • GPIO_PINS_8
  • GPIO_PINS_9
  • GPIO_PINS_10
  • GPIO_PINS_11
  • GPIO_PINS_12
  • GPIO_PINS_13
  • GPIO_PINS_14
  • GPIO_PINS_15
  • GPIO_PINS_ALL
Return values
none

Definition at line 341 of file at32f415_gpio.c.

Referenced by EXINT9_5_IRQHandler(), main(), TMR2_GLOBAL_IRQHandler(), and usbh_user_active_vbus().

◆ gpio_bits_set()

void gpio_bits_set | ( | gpio_type * | gpio_x,
 |  | uint16_t | pins
 | ) |  |

set the selected data port bits.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
pins gpio pin number parameter can be any combination of gpio_pin_x, gpio_pin_x as following values:
  • GPIO_PINS_0
  • GPIO_PINS_1
  • GPIO_PINS_2
  • GPIO_PINS_3
  • GPIO_PINS_4
  • GPIO_PINS_5
  • GPIO_PINS_6
  • GPIO_PINS_7
  • GPIO_PINS_8
  • GPIO_PINS_9
  • GPIO_PINS_10
  • GPIO_PINS_11
  • GPIO_PINS_12
  • GPIO_PINS_13
  • GPIO_PINS_14
  • GPIO_PINS_15
  • GPIO_PINS_ALL
Return values
none

Definition at line 310 of file at32f415_gpio.c.

Referenced by EXINT9_5_IRQHandler(), main(), usart_configuration(), usb_gpio_config(), and usbh_user_active_vbus().

◆ gpio_bits_write()

void gpio_bits_write | ( | gpio_type * | gpio_x,
 |  | uint16_t | pins,
 |  | confirm_state | bit_state
 | ) |  |

set or clear the selected data port bit.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
pins gpio pin number parameter can be any combination of gpio_pin_x, gpio_pin_x as following values:
  • GPIO_PINS_0
  • GPIO_PINS_1
  • GPIO_PINS_2
  • GPIO_PINS_3
  • GPIO_PINS_4
  • GPIO_PINS_5
  • GPIO_PINS_6
  • GPIO_PINS_7
  • GPIO_PINS_8
  • GPIO_PINS_9
  • GPIO_PINS_10
  • GPIO_PINS_11
  • GPIO_PINS_12
  • GPIO_PINS_13
  • GPIO_PINS_14
  • GPIO_PINS_15
  • GPIO_PINS_ALL
bit_state specifies the value to be written to the selected bit (TRUE or FALSE).
Return values
none

Definition at line 373 of file at32f415_gpio.c.

Referenced by TMR2_GLOBAL_IRQHandler().

◆ gpio_default_para_init()

void gpio_default_para_init ( gpio_init_type * gpio_init_struct )

fill each gpio_init_type member with its default value.

Parameters
gpio_init_struct : pointer to a gpio_init_type structure which will be initialized.
Return values
none

< gpio all pins

Definition at line 168 of file at32f415_gpio.c.

Referenced by at32_button_init(), at32_led_init(), can_gpio_config(), clkout_config(), codec_i2s_init(), exint_config(), gpio_config(), gpio_configuration(), mclk_tmr1_init(), tmr1_config(), tmr1_init(), uart_init(), uart_print_init(), usart1_config(), usart_configuration(), usart_spi_configuration(), and usb_gpio_config().

◆ gpio_event_output_config()

void gpio_event_output_config | ( | gpio_port_source_type | gpio_port_source,
 |  | gpio_pins_source_type | gpio_pin_source
 | ) |  |

select the gpio pin used as event output.

Parameters
gpio_port_source select the gpio port to be used as source for event output. this parameter can be one of the following values:
  • GPIO_PORT_SOURCE_GPIOA
  • GPIO_PORT_SOURCE_GPIOB
  • GPIO_PORT_SOURCE_GPIOC
  • GPIO_PORT_SOURCE_GPIOD
  • GPIO_PORT_SOURCE_GPIOF
gpio_pin_source specifies the pin for the event output. this parameter can be one of the following values:
  • GPIO_PINS_SOURCE0
  • GPIO_PINS_SOURCE1
  • GPIO_PINS_SOURCE2
  • GPIO_PINS_SOURCE3
  • GPIO_PINS_SOURCE4
  • GPIO_PINS_SOURCE5
  • GPIO_PINS_SOURCE6
  • GPIO_PINS_SOURCE7
  • GPIO_PINS_SOURCE8
  • GPIO_PINS_SOURCE9
  • GPIO_PINS_SOURCE10
  • GPIO_PINS_SOURCE11
  • GPIO_PINS_SOURCE12
  • GPIO_PINS_SOURCE13
  • GPIO_PINS_SOURCE14
  • GPIO_PINS_SOURCE15
Return values
none

Definition at line 471 of file at32f415_gpio.c.

◆ gpio_event_output_enable()

void gpio_event_output_enable ( confirm_state new_state )

enable or disable the event output.

Parameters
confirm_state new state of the event output. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 490 of file at32f415_gpio.c.

◆ gpio_exint_line_config()

void gpio_exint_line_config | ( | gpio_port_source_type | gpio_port_source,
 |  | gpio_pins_source_type | gpio_pin_source
 | ) |  |

select the gpio pin used as exint line.

Parameters
gpio_port_source select the gpio port to be used as source for exint. this parameter can be one of the following values:
  • GPIO_PORT_SOURCE_GPIOA
  • GPIO_PORT_SOURCE_GPIOB
  • GPIO_PORT_SOURCE_GPIOC
  • GPIO_PORT_SOURCE_GPIOD
  • GPIO_PORT_SOURCE_GPIOF
gpio_pin_source specifies the pin for the event output. this parameter can be one of the following values:
  • GPIO_PINS_SOURCE0
  • GPIO_PINS_SOURCE1
  • GPIO_PINS_SOURCE2
  • GPIO_PINS_SOURCE3
  • GPIO_PINS_SOURCE4
  • GPIO_PINS_SOURCE5
  • GPIO_PINS_SOURCE6
  • GPIO_PINS_SOURCE7
  • GPIO_PINS_SOURCE8
  • GPIO_PINS_SOURCE9
  • GPIO_PINS_SOURCE10
  • GPIO_PINS_SOURCE11
  • GPIO_PINS_SOURCE12
  • GPIO_PINS_SOURCE13
  • GPIO_PINS_SOURCE14
  • GPIO_PINS_SOURCE15
Return values
none

Definition at line 577 of file at32f415_gpio.c.

Referenced by button_exint_init(), exint_config(), exint_line0_config(), and usart_configuration().

◆ gpio_init()

void gpio_init | ( | gpio_type * | gpio_x,
 |  | gpio_init_type * | gpio_init_struct
 | ) |  |

initialize the gpio peripheral.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
gpio_init_struct pointer to gpio init structure.
Return values
none

Definition at line 100 of file at32f415_gpio.c.

Referenced by at32_button_init(), at32_led_init(), can_gpio_config(), clkout_config(), cmp_config(), codec_i2s_init(), exint_config(), gpio_config(), gpio_configuration(), i2c_lowlevel_init(), main(), mclk_tmr1_init(), sd_init(), spiflash_init(), swj_dp_config(), tmr1_config(), tmr1_init(), uart_init(), uart_print_init(), usart1_config(), usart_configuration(), usart_spi_configuration(), and usb_gpio_config().

◆ gpio_input_data_bit_read()

flag_status gpio_input_data_bit_read | ( | gpio_type * | gpio_x,
 |  | uint16_t | pins
 | ) |  |

read the specified input port pin.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
pins gpio pin number this parameter can be one of the following values:
  • GPIO_PINS_0
  • GPIO_PINS_1
  • GPIO_PINS_2
  • GPIO_PINS_3
  • GPIO_PINS_4
  • GPIO_PINS_5
  • GPIO_PINS_6
  • GPIO_PINS_7
  • GPIO_PINS_8
  • GPIO_PINS_9
  • GPIO_PINS_10
  • GPIO_PINS_11
  • GPIO_PINS_12
  • GPIO_PINS_13
  • GPIO_PINS_14
  • GPIO_PINS_15
Return values
flag_status (SET or RESET)

Definition at line 203 of file at32f415_gpio.c.

Referenced by at32_button_state(), button_isr(), and gpio_config().

◆ gpio_input_data_read()

uint16_t gpio_input_data_read ( gpio_type * gpio_x )

read the specified gpio input data port.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
Return values
gpio input data port value.

Definition at line 226 of file at32f415_gpio.c.

◆ gpio_iomux_reset()

void gpio_iomux_reset ( void )

reset the mux functions (remap, event control and exint configuration) registers to their default values.

Parameters
none
Return values
none

Definition at line 86 of file at32f415_gpio.c.

◆ gpio_output_data_bit_read()

flag_status gpio_output_data_bit_read | ( | gpio_type * | gpio_x,
 |  | uint16_t | pins
 | ) |  |

read the specified output port pin.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
pins gpio pin number this parameter can be one of the following values:
  • GPIO_PINS_0
  • GPIO_PINS_1
  • GPIO_PINS_2
  • GPIO_PINS_3
  • GPIO_PINS_4
  • GPIO_PINS_5
  • GPIO_PINS_6
  • GPIO_PINS_7
  • GPIO_PINS_8
  • GPIO_PINS_9
  • GPIO_PINS_10
  • GPIO_PINS_11
  • GPIO_PINS_12
  • GPIO_PINS_13
  • GPIO_PINS_14
  • GPIO_PINS_15
Return values
flag_status (SET or RESET)

Definition at line 256 of file at32f415_gpio.c.

Referenced by TMR2_GLOBAL_IRQHandler().

◆ gpio_output_data_read()

uint16_t gpio_output_data_read ( gpio_type * gpio_x )

read the specified gpio ouput data port.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
Return values
gpio input data port value.

Definition at line 279 of file at32f415_gpio.c.

◆ gpio_pin_remap_config()

void gpio_pin_remap_config | ( | uint32_t | gpio_remap,
 |  | confirm_state | new_state
 | ) |  |

iomux remap and debug i/o configuration.

Parameters
gpio_remap select the pin to remap. this parameter can be one of the following values:
  • SPI1_MUX_01 - I2C1_MUX - USART1_MUX - USART3_MUX_01
  • USART3_MUX_10 - TMR1_MUX_01 - TMR2_MUX_01 - TMR2_MUX_10
  • TMR2_MUX_11 - TMR3_MUX_10 - TMR3_MUX_11 - CAN_MUX_10
  • PD01_MUX - TMR5CH4_MUX - ADC1_ETP_MUX - ADC1_ETO_MUX
  • SWJTAG_MUX_001 - SWJTAG_MUX_010 - SWJTAG_MUX_100
  • CMP_MUX_01 - CMP_MUX_10
  • TMR9_GMUX - TMR10_GMUX - TMR11_GMUX
  • TMR1_GMUX_0001 - TMR1_GMUX_0010 - TMR2_GMUX_001 - TMR2_GMUX_010
  • TMR2_GMUX_011 - TMR3_GMUX_0010 - TMR3_GMUX_0011 - TMR5_GMUX_001
  • TMR5CH4_GMUX
  • I2C1_GMUX_0001 - I2C1_GMUX_0010 - I2C2_GMUX_0001 - I2C2_GMUX_0010
  • I2C2_GMUX_0011 - SPI1_GMUX_0001 - SPI2_GMUX_0001
  • CAN1_GMUX_0010 - SDIO1_GMUX_0100 - SDIO1_GMUX_0101 - SDIO1_GMUX_0110
  • SDIO1_GMUX_0111 - USART1_GMUX_0001 - USART3_GMUX_0001 - USART3_GMUX_0010
  • UART4_GMUX_0001
  • ADC1_ETP_GMUX - ADC1_ETO_GMUX - SWJTAG_GMUX_001 - SWJTAG_GMUX_010
  • SWJTAG_GMUX_100 - PD01_GMUX
  • TMR1_BK1_CMP_GMUX_10 - TMR1_BK1_CMP_GMUX_11 - TMR1_CH1_CMP_GMUX_10 - TMR1_CH1_CMP_GMUX_11
  • TMR2_CH4_CMP_GMUX_10 - TMR2_CH4_CMP_GMUX_11 - TMR3_CH1_CMP_GMUX_10 - TMR3_CH1_CMP_GMUX_11
new_state (TRUE or FALSE)
Return values
none

Definition at line 521 of file at32f415_gpio.c.

Referenced by can_gpio_config(), cmp_config(), gpio_config(), i2c_lowlevel_init(), lick_frequency_get(), and main().

◆ gpio_pin_wp_config()

void gpio_pin_wp_config | ( | gpio_type * | gpio_x,
 |  | uint16_t | pins
 | ) |  |

write protect gpio pins configuration registers.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
pins gpio pin number this parameter can be any combination of the following:
  • GPIO_PINS_0
  • GPIO_PINS_1
  • GPIO_PINS_2
  • GPIO_PINS_3
  • GPIO_PINS_4
  • GPIO_PINS_5
  • GPIO_PINS_6
  • GPIO_PINS_7
  • GPIO_PINS_8
  • GPIO_PINS_9
  • GPIO_PINS_10
  • GPIO_PINS_11
  • GPIO_PINS_12
  • GPIO_PINS_13
  • GPIO_PINS_14
  • GPIO_PINS_15
  • GPIO_PINS_ALL
Return values
none

Definition at line 424 of file at32f415_gpio.c.

◆ gpio_port_wirte()

void gpio_port_wirte | ( | gpio_type * | gpio_x,
 |  | uint16_t | port_value
 | ) |  |

write data to the specified gpio data port.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
port_value specifies the value to be written to the port output data register.
Return values
none

Definition at line 393 of file at32f415_gpio.c.

◆ gpio_reset()

void gpio_reset ( gpio_type * gpio_x )

reset the gpio register

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values: GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
Return values
none

Definition at line 51 of file at32f415_gpio.c.


AT32F415 Firmwary Library: GPIO_private_functions

Functions
GPIO_private_functions
AT32F415_periph_driver » GPIO

Functions

void | gpio_reset (gpio_type *gpio_x)
reset the gpio register More...
void | gpio_iomux_reset (void)
reset the mux functions (remap, event control and exint configuration) registers to their default values. More...
void | gpio_init (gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral. More...
void | gpio_default_para_init (gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value. More...
flag_status | gpio_input_data_bit_read (gpio_type *gpio_x, uint16_t pins)
read the specified input port pin. More...
uint16_t | gpio_input_data_read (gpio_type *gpio_x)
read the specified gpio input data port. More...
flag_status | gpio_output_data_bit_read (gpio_type *gpio_x, uint16_t pins)
read the specified output port pin. More...
uint16_t | gpio_output_data_read (gpio_type *gpio_x)
read the specified gpio ouput data port. More...
void | gpio_bits_set (gpio_type *gpio_x, uint16_t pins)
set the selected data port bits. More...
void | gpio_bits_reset (gpio_type *gpio_x, uint16_t pins)
clear the selected data port bits. More...
void | gpio_bits_write (gpio_type *gpio_x, uint16_t pins, confirm_state bit_state)
set or clear the selected data port bit. More...
void | gpio_port_wirte (gpio_type *gpio_x, uint16_t port_value)
write data to the specified gpio data port. More...
void | gpio_pin_wp_config (gpio_type *gpio_x, uint16_t pins)
write protect gpio pins configuration registers. More...
void | gpio_event_output_config (gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as event output. More...
void | gpio_event_output_enable (confirm_state new_state)
enable or disable the event output. More...
void | gpio_pin_remap_config (uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration. More...
void | gpio_exint_line_config (gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line. More...

Detailed Description

Function Documentation

◆ gpio_bits_reset()

void gpio_bits_reset | ( | gpio_type * | gpio_x,
 |  | uint16_t | pins
 | ) |  |

clear the selected data port bits.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
pins gpio pin number parameter can be any combination of gpio_pin_x, gpio_pin_x as following values:
  • GPIO_PINS_0
  • GPIO_PINS_1
  • GPIO_PINS_2
  • GPIO_PINS_3
  • GPIO_PINS_4
  • GPIO_PINS_5
  • GPIO_PINS_6
  • GPIO_PINS_7
  • GPIO_PINS_8
  • GPIO_PINS_9
  • GPIO_PINS_10
  • GPIO_PINS_11
  • GPIO_PINS_12
  • GPIO_PINS_13
  • GPIO_PINS_14
  • GPIO_PINS_15
  • GPIO_PINS_ALL
Return values
none

Definition at line 341 of file at32f415_gpio.c.

Referenced by EXINT9_5_IRQHandler(), main(), TMR2_GLOBAL_IRQHandler(), and usbh_user_active_vbus().

◆ gpio_bits_set()

void gpio_bits_set | ( | gpio_type * | gpio_x,
 |  | uint16_t | pins
 | ) |  |

set the selected data port bits.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
pins gpio pin number parameter can be any combination of gpio_pin_x, gpio_pin_x as following values:
  • GPIO_PINS_0
  • GPIO_PINS_1
  • GPIO_PINS_2
  • GPIO_PINS_3
  • GPIO_PINS_4
  • GPIO_PINS_5
  • GPIO_PINS_6
  • GPIO_PINS_7
  • GPIO_PINS_8
  • GPIO_PINS_9
  • GPIO_PINS_10
  • GPIO_PINS_11
  • GPIO_PINS_12
  • GPIO_PINS_13
  • GPIO_PINS_14
  • GPIO_PINS_15
  • GPIO_PINS_ALL
Return values
none

Definition at line 310 of file at32f415_gpio.c.

Referenced by EXINT9_5_IRQHandler(), main(), usart_configuration(), usb_gpio_config(), and usbh_user_active_vbus().

◆ gpio_bits_write()

void gpio_bits_write | ( | gpio_type * | gpio_x,
 |  | uint16_t | pins,
 |  | confirm_state | bit_state
 | ) |  |

set or clear the selected data port bit.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
pins gpio pin number parameter can be any combination of gpio_pin_x, gpio_pin_x as following values:
  • GPIO_PINS_0
  • GPIO_PINS_1
  • GPIO_PINS_2
  • GPIO_PINS_3
  • GPIO_PINS_4
  • GPIO_PINS_5
  • GPIO_PINS_6
  • GPIO_PINS_7
  • GPIO_PINS_8
  • GPIO_PINS_9
  • GPIO_PINS_10
  • GPIO_PINS_11
  • GPIO_PINS_12
  • GPIO_PINS_13
  • GPIO_PINS_14
  • GPIO_PINS_15
  • GPIO_PINS_ALL
bit_state specifies the value to be written to the selected bit (TRUE or FALSE).
Return values
none

Definition at line 373 of file at32f415_gpio.c.

Referenced by TMR2_GLOBAL_IRQHandler().

◆ gpio_default_para_init()

void gpio_default_para_init ( gpio_init_type * gpio_init_struct )

fill each gpio_init_type member with its default value.

Parameters
gpio_init_struct : pointer to a gpio_init_type structure which will be initialized.
Return values
none

< gpio all pins

Definition at line 168 of file at32f415_gpio.c.

Referenced by at32_button_init(), at32_led_init(), can_gpio_config(), clkout_config(), codec_i2s_init(), exint_config(), gpio_config(), gpio_configuration(), mclk_tmr1_init(), tmr1_config(), tmr1_init(), uart_init(), uart_print_init(), usart1_config(), usart_configuration(), usart_spi_configuration(), and usb_gpio_config().

◆ gpio_event_output_config()

void gpio_event_output_config | ( | gpio_port_source_type | gpio_port_source,
 |  | gpio_pins_source_type | gpio_pin_source
 | ) |  |

select the gpio pin used as event output.

Parameters
gpio_port_source select the gpio port to be used as source for event output. this parameter can be one of the following values:
  • GPIO_PORT_SOURCE_GPIOA
  • GPIO_PORT_SOURCE_GPIOB
  • GPIO_PORT_SOURCE_GPIOC
  • GPIO_PORT_SOURCE_GPIOD
  • GPIO_PORT_SOURCE_GPIOF
gpio_pin_source specifies the pin for the event output. this parameter can be one of the following values:
  • GPIO_PINS_SOURCE0
  • GPIO_PINS_SOURCE1
  • GPIO_PINS_SOURCE2
  • GPIO_PINS_SOURCE3
  • GPIO_PINS_SOURCE4
  • GPIO_PINS_SOURCE5
  • GPIO_PINS_SOURCE6
  • GPIO_PINS_SOURCE7
  • GPIO_PINS_SOURCE8
  • GPIO_PINS_SOURCE9
  • GPIO_PINS_SOURCE10
  • GPIO_PINS_SOURCE11
  • GPIO_PINS_SOURCE12
  • GPIO_PINS_SOURCE13
  • GPIO_PINS_SOURCE14
  • GPIO_PINS_SOURCE15
Return values
none

Definition at line 471 of file at32f415_gpio.c.

◆ gpio_event_output_enable()

void gpio_event_output_enable ( confirm_state new_state )

enable or disable the event output.

Parameters
confirm_state new state of the event output. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 490 of file at32f415_gpio.c.

◆ gpio_exint_line_config()

void gpio_exint_line_config | ( | gpio_port_source_type | gpio_port_source,
 |  | gpio_pins_source_type | gpio_pin_source
 | ) |  |

select the gpio pin used as exint line.

Parameters
gpio_port_source select the gpio port to be used as source for exint. this parameter can be one of the following values:
  • GPIO_PORT_SOURCE_GPIOA
  • GPIO_PORT_SOURCE_GPIOB
  • GPIO_PORT_SOURCE_GPIOC
  • GPIO_PORT_SOURCE_GPIOD
  • GPIO_PORT_SOURCE_GPIOF
gpio_pin_source specifies the pin for the event output. this parameter can be one of the following values:
  • GPIO_PINS_SOURCE0
  • GPIO_PINS_SOURCE1
  • GPIO_PINS_SOURCE2
  • GPIO_PINS_SOURCE3
  • GPIO_PINS_SOURCE4
  • GPIO_PINS_SOURCE5
  • GPIO_PINS_SOURCE6
  • GPIO_PINS_SOURCE7
  • GPIO_PINS_SOURCE8
  • GPIO_PINS_SOURCE9
  • GPIO_PINS_SOURCE10
  • GPIO_PINS_SOURCE11
  • GPIO_PINS_SOURCE12
  • GPIO_PINS_SOURCE13
  • GPIO_PINS_SOURCE14
  • GPIO_PINS_SOURCE15
Return values
none

Definition at line 577 of file at32f415_gpio.c.

Referenced by button_exint_init(), exint_config(), exint_line0_config(), and usart_configuration().

◆ gpio_init()

void gpio_init | ( | gpio_type * | gpio_x,
 |  | gpio_init_type * | gpio_init_struct
 | ) |  |

initialize the gpio peripheral.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
gpio_init_struct pointer to gpio init structure.
Return values
none

Definition at line 100 of file at32f415_gpio.c.

Referenced by at32_button_init(), at32_led_init(), can_gpio_config(), clkout_config(), cmp_config(), codec_i2s_init(), exint_config(), gpio_config(), gpio_configuration(), i2c_lowlevel_init(), main(), mclk_tmr1_init(), sd_init(), spiflash_init(), swj_dp_config(), tmr1_config(), tmr1_init(), uart_init(), uart_print_init(), usart1_config(), usart_configuration(), usart_spi_configuration(), and usb_gpio_config().

◆ gpio_input_data_bit_read()

flag_status gpio_input_data_bit_read | ( | gpio_type * | gpio_x,
 |  | uint16_t | pins
 | ) |  |

read the specified input port pin.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
pins gpio pin number this parameter can be one of the following values:
  • GPIO_PINS_0
  • GPIO_PINS_1
  • GPIO_PINS_2
  • GPIO_PINS_3
  • GPIO_PINS_4
  • GPIO_PINS_5
  • GPIO_PINS_6
  • GPIO_PINS_7
  • GPIO_PINS_8
  • GPIO_PINS_9
  • GPIO_PINS_10
  • GPIO_PINS_11
  • GPIO_PINS_12
  • GPIO_PINS_13
  • GPIO_PINS_14
  • GPIO_PINS_15
Return values
flag_status (SET or RESET)

Definition at line 203 of file at32f415_gpio.c.

Referenced by at32_button_state(), button_isr(), and gpio_config().

◆ gpio_input_data_read()

uint16_t gpio_input_data_read ( gpio_type * gpio_x )

read the specified gpio input data port.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
Return values
gpio input data port value.

Definition at line 226 of file at32f415_gpio.c.

◆ gpio_iomux_reset()

void gpio_iomux_reset ( void )

reset the mux functions (remap, event control and exint configuration) registers to their default values.

Parameters
none
Return values
none

Definition at line 86 of file at32f415_gpio.c.

◆ gpio_output_data_bit_read()

flag_status gpio_output_data_bit_read | ( | gpio_type * | gpio_x,
 |  | uint16_t | pins
 | ) |  |

read the specified output port pin.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
pins gpio pin number this parameter can be one of the following values:
  • GPIO_PINS_0
  • GPIO_PINS_1
  • GPIO_PINS_2
  • GPIO_PINS_3
  • GPIO_PINS_4
  • GPIO_PINS_5
  • GPIO_PINS_6
  • GPIO_PINS_7
  • GPIO_PINS_8
  • GPIO_PINS_9
  • GPIO_PINS_10
  • GPIO_PINS_11
  • GPIO_PINS_12
  • GPIO_PINS_13
  • GPIO_PINS_14
  • GPIO_PINS_15
Return values
flag_status (SET or RESET)

Definition at line 256 of file at32f415_gpio.c.

Referenced by TMR2_GLOBAL_IRQHandler().

◆ gpio_output_data_read()

uint16_t gpio_output_data_read ( gpio_type * gpio_x )

read the specified gpio ouput data port.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
Return values
gpio input data port value.

Definition at line 279 of file at32f415_gpio.c.

◆ gpio_pin_remap_config()

void gpio_pin_remap_config | ( | uint32_t | gpio_remap,
 |  | confirm_state | new_state
 | ) |  |

iomux remap and debug i/o configuration.

Parameters
gpio_remap select the pin to remap. this parameter can be one of the following values:
  • SPI1_MUX_01 - I2C1_MUX - USART1_MUX - USART3_MUX_01
  • USART3_MUX_10 - TMR1_MUX_01 - TMR2_MUX_01 - TMR2_MUX_10
  • TMR2_MUX_11 - TMR3_MUX_10 - TMR3_MUX_11 - CAN_MUX_10
  • PD01_MUX - TMR5CH4_MUX - ADC1_ETP_MUX - ADC1_ETO_MUX
  • SWJTAG_MUX_001 - SWJTAG_MUX_010 - SWJTAG_MUX_100
  • CMP_MUX_01 - CMP_MUX_10
  • TMR9_GMUX - TMR10_GMUX - TMR11_GMUX
  • TMR1_GMUX_0001 - TMR1_GMUX_0010 - TMR2_GMUX_001 - TMR2_GMUX_010
  • TMR2_GMUX_011 - TMR3_GMUX_0010 - TMR3_GMUX_0011 - TMR5_GMUX_001
  • TMR5CH4_GMUX
  • I2C1_GMUX_0001 - I2C1_GMUX_0010 - I2C2_GMUX_0001 - I2C2_GMUX_0010
  • I2C2_GMUX_0011 - SPI1_GMUX_0001 - SPI2_GMUX_0001
  • CAN1_GMUX_0010 - SDIO1_GMUX_0100 - SDIO1_GMUX_0101 - SDIO1_GMUX_0110
  • SDIO1_GMUX_0111 - USART1_GMUX_0001 - USART3_GMUX_0001 - USART3_GMUX_0010
  • UART4_GMUX_0001
  • ADC1_ETP_GMUX - ADC1_ETO_GMUX - SWJTAG_GMUX_001 - SWJTAG_GMUX_010
  • SWJTAG_GMUX_100 - PD01_GMUX
  • TMR1_BK1_CMP_GMUX_10 - TMR1_BK1_CMP_GMUX_11 - TMR1_CH1_CMP_GMUX_10 - TMR1_CH1_CMP_GMUX_11
  • TMR2_CH4_CMP_GMUX_10 - TMR2_CH4_CMP_GMUX_11 - TMR3_CH1_CMP_GMUX_10 - TMR3_CH1_CMP_GMUX_11
new_state (TRUE or FALSE)
Return values
none

Definition at line 521 of file at32f415_gpio.c.

Referenced by can_gpio_config(), cmp_config(), gpio_config(), i2c_lowlevel_init(), lick_frequency_get(), and main().

◆ gpio_pin_wp_config()

void gpio_pin_wp_config | ( | gpio_type * | gpio_x,
 |  | uint16_t | pins
 | ) |  |

write protect gpio pins configuration registers.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
pins gpio pin number this parameter can be any combination of the following:
  • GPIO_PINS_0
  • GPIO_PINS_1
  • GPIO_PINS_2
  • GPIO_PINS_3
  • GPIO_PINS_4
  • GPIO_PINS_5
  • GPIO_PINS_6
  • GPIO_PINS_7
  • GPIO_PINS_8
  • GPIO_PINS_9
  • GPIO_PINS_10
  • GPIO_PINS_11
  • GPIO_PINS_12
  • GPIO_PINS_13
  • GPIO_PINS_14
  • GPIO_PINS_15
  • GPIO_PINS_ALL
Return values
none

Definition at line 424 of file at32f415_gpio.c.

◆ gpio_port_wirte()

void gpio_port_wirte | ( | gpio_type * | gpio_x,
 |  | uint16_t | port_value
 | ) |  |

write data to the specified gpio data port.

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values:
GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
port_value specifies the value to be written to the port output data register.
Return values
none

Definition at line 393 of file at32f415_gpio.c.

◆ gpio_reset()

void gpio_reset ( gpio_type * gpio_x )

reset the gpio register

Parameters
gpio_x to select the gpio peripheral. this parameter can be one of the following values: GPIOA, GPIOB, GPIOC, GPIOD, GPIOF.
Return values
none

Definition at line 51 of file at32f415_gpio.c.


AT32F415 Firmwary Library: I2C

Modules | Macros
I2C
AT32F415_periph_driver

I2C driver modules. More...

Modules

I2C_sts1_flags_definition
i2c sts1 flag
I2C_sts2_flags_definition
i2c sts2 flag
I2C_interrupts_definition
i2c interrupt

I2C_exported_types
I2C_exported_functions
I2C_private_functions

Macros

#define | I2C1 ((i2c_type *) I2C1_BASE)
#define | I2C2 ((i2c_type *) I2C2_BASE)

Detailed Description

I2C driver modules.

Macro Definition Documentation

◆ I2C1

#define I2C1 ((i2c_type *) I2C1_BASE)

Definition at line 347 of file at32f415_i2c.h.

◆ I2C2

#define I2C2 ((i2c_type *) I2C2_BASE)

Definition at line 348 of file at32f415_i2c.h.


AT32F415 Firmwary Library: I2C_sts1_flags_definition

Macros
I2C_sts1_flags_definition
AT32F415_periph_driver » I2C

i2c sts1 flag More...

Macros

#define | I2C_STARTF_FLAG ((uint32_t)0x00000001)
#define | I2C_ADDR7F_FLAG ((uint32_t)0x00000002)
#define | I2C_TDC_FLAG ((uint32_t)0x00000004)
#define | I2C_ADDRHF_FLAG ((uint32_t)0x00000008)
#define | I2C_STOPF_FLAG ((uint32_t)0x00000010)
#define | I2C_RDBF_FLAG ((uint32_t)0x00000040)
#define | I2C_TDBE_FLAG ((uint32_t)0x00000080)
#define | I2C_BUSERR_FLAG ((uint32_t)0x00000100)
#define | I2C_ARLOST_FLAG ((uint32_t)0x00000200)
#define | I2C_ACKFAIL_FLAG ((uint32_t)0x00000400)
#define | I2C_OUF_FLAG ((uint32_t)0x00000800)
#define | I2C_PECERR_FLAG ((uint32_t)0x00001000)
#define | I2C_TMOUT_FLAG ((uint32_t)0x00004000)
#define | I2C_ALERTF_FLAG ((uint32_t)0x00008000)

Detailed Description

i2c sts1 flag

Macro Definition Documentation

◆ I2C_ACKFAIL_FLAG

#define I2C_ACKFAIL_FLAG ((uint32_t)0x00000400)

i2c acknowledge failure flag

Definition at line 61 of file at32f415_i2c.h.

◆ I2C_ADDR7F_FLAG

#define I2C_ADDR7F_FLAG ((uint32_t)0x00000002)

i2c 0~7 bit address match flag

Definition at line 53 of file at32f415_i2c.h.

◆ I2C_ADDRHF_FLAG

#define I2C_ADDRHF_FLAG ((uint32_t)0x00000008)

i2c master 9~8 bit address header match flag

Definition at line 55 of file at32f415_i2c.h.

◆ I2C_ALERTF_FLAG

#define I2C_ALERTF_FLAG ((uint32_t)0x00008000)

i2c smbus alert flag

Definition at line 65 of file at32f415_i2c.h.

◆ I2C_ARLOST_FLAG

#define I2C_ARLOST_FLAG ((uint32_t)0x00000200)

i2c arbitration lost flag

Definition at line 60 of file at32f415_i2c.h.

◆ I2C_BUSERR_FLAG

#define I2C_BUSERR_FLAG ((uint32_t)0x00000100)

i2c bus error flag

Definition at line 59 of file at32f415_i2c.h.

◆ I2C_OUF_FLAG

#define I2C_OUF_FLAG ((uint32_t)0x00000800)

i2c overflow or underflow flag

Definition at line 62 of file at32f415_i2c.h.

◆ I2C_PECERR_FLAG

#define I2C_PECERR_FLAG ((uint32_t)0x00001000)

i2c pec receive error flag

Definition at line 63 of file at32f415_i2c.h.

◆ I2C_RDBF_FLAG

#define I2C_RDBF_FLAG ((uint32_t)0x00000040)

i2c receive data buffer full flag

Definition at line 57 of file at32f415_i2c.h.

◆ I2C_STARTF_FLAG

#define I2C_STARTF_FLAG ((uint32_t)0x00000001)

i2c start condition generation complete flag

Definition at line 52 of file at32f415_i2c.h.

◆ I2C_STOPF_FLAG

#define I2C_STOPF_FLAG ((uint32_t)0x00000010)

i2c stop condition generation complete flag

Definition at line 56 of file at32f415_i2c.h.

◆ I2C_TDBE_FLAG

#define I2C_TDBE_FLAG ((uint32_t)0x00000080)

i2c transmit data buffer empty flag

Definition at line 58 of file at32f415_i2c.h.

◆ I2C_TDC_FLAG

#define I2C_TDC_FLAG ((uint32_t)0x00000004)

i2c transmit data complete flag

Definition at line 54 of file at32f415_i2c.h.

◆ I2C_TMOUT_FLAG

#define I2C_TMOUT_FLAG ((uint32_t)0x00004000)

i2c smbus timeout flag

Definition at line 64 of file at32f415_i2c.h.


AT32F415 Firmwary Library: I2C_sts2_flags_definition

Macros
I2C_sts2_flags_definition
AT32F415_periph_driver » I2C

i2c sts2 flag More...

Macros

#define | I2C_TRMODE_FLAG ((uint32_t)0x10010000)
#define | I2C_BUSYF_FLAG ((uint32_t)0x10020000)
#define | I2C_DIRF_FLAG ((uint32_t)0x10040000)
#define | I2C_GCADDRF_FLAG ((uint32_t)0x10100000)
#define | I2C_DEVADDRF_FLAG ((uint32_t)0x10200000)
#define | I2C_HOSTADDRF_FLAG ((uint32_t)0x10400000)
#define | I2C_ADDR2_FLAG ((uint32_t)0x10800000)

Detailed Description

i2c sts2 flag

Macro Definition Documentation

◆ I2C_ADDR2_FLAG

#define I2C_ADDR2_FLAG ((uint32_t)0x10800000)

i2c own address 2 received flag

Definition at line 82 of file at32f415_i2c.h.

◆ I2C_BUSYF_FLAG

#define I2C_BUSYF_FLAG ((uint32_t)0x10020000)

i2c bus busy flag transmission mode

Definition at line 77 of file at32f415_i2c.h.

◆ I2C_DEVADDRF_FLAG

#define I2C_DEVADDRF_FLAG ((uint32_t)0x10200000)

i2c smbus device address received flag

Definition at line 80 of file at32f415_i2c.h.

◆ I2C_DIRF_FLAG

#define I2C_DIRF_FLAG ((uint32_t)0x10040000)

i2c transmission direction flag

Definition at line 78 of file at32f415_i2c.h.

◆ I2C_GCADDRF_FLAG

#define I2C_GCADDRF_FLAG ((uint32_t)0x10100000)

i2c general call address received flag

Definition at line 79 of file at32f415_i2c.h.

◆ I2C_HOSTADDRF_FLAG

#define I2C_HOSTADDRF_FLAG ((uint32_t)0x10400000)

i2c smbus host address received flag

Definition at line 81 of file at32f415_i2c.h.

◆ I2C_TRMODE_FLAG

#define I2C_TRMODE_FLAG ((uint32_t)0x10010000)

i2c transmission mode

Definition at line 76 of file at32f415_i2c.h.


AT32F415 Firmwary Library: I2C_interrupts_definition

Macros
I2C_interrupts_definition
AT32F415_periph_driver » I2C

i2c interrupt
More...

Macros

#define | I2C_DATA_INT ((uint16_t)0x0400)
#define | I2C_EVT_INT ((uint16_t)0x0200)
#define | I2C_ERR_INT ((uint16_t)0x0100)

Detailed Description

i2c interrupt

Macro Definition Documentation

◆ I2C_DATA_INT

#define I2C_DATA_INT ((uint16_t)0x0400)

i2c data transmission interrupt

Definition at line 93 of file at32f415_i2c.h.

◆ I2C_ERR_INT

#define I2C_ERR_INT ((uint16_t)0x0100)

i2c error interrupt

Definition at line 95 of file at32f415_i2c.h.

◆ I2C_EVT_INT

#define I2C_EVT_INT ((uint16_t)0x0200)

i2c event interrupt

Definition at line 94 of file at32f415_i2c.h.


AT32F415 Firmwary Library: I2C_exported_types

Data Structures | Enumerations
I2C_exported_types
AT32F415_periph_driver » I2C

Data Structures

struct i2c_type
type define i2c register all More...

Enumerations

enum | i2c_master_ack_type { I2C_MASTER_ACK_CURRENT = 0x00 , I2C_MASTER_ACK_NEXT = 0x01 }
i2c master receiving mode acknowledge control More...
enum | i2c_pec_position_type { I2C_PEC_POSITION_CURRENT = 0x00 , I2C_PEC_POSITION_NEXT = 0x01 }
i2c pec position set More...
enum | i2c_smbus_alert_set_type { I2C_SMBUS_ALERT_HIGH = 0x00 , I2C_SMBUS_ALERT_LOW = 0x01 }
i2c smbus alert pin set More...
enum | i2c_smbus_mode_set_type { I2C_SMBUS_MODE_DEVICE = 0x00 , I2C_SMBUS_MODE_HOST = 0x01 }
i2c smbus mode set More...
enum | i2c_fsmode_duty_cycle_type { I2C_FSMODE_DUTY_2_1 = 0x00 , I2C_FSMODE_DUTY_16_9 = 0x01 }
i2c fast mode duty cycle More...
enum | i2c_address_mode_type { I2C_ADDRESS_MODE_7BIT = 0x00 , I2C_ADDRESS_MODE_10BIT = 0x01 }
i2c address mode More...
enum | i2c_direction_type { I2C_DIRECTION_TRANSMIT = 0x00 , I2C_DIRECTION_RECEIVE = 0x01 }
i2c address direction More...

Detailed Description

Enumeration Type Documentation

◆ i2c_address_mode_type

enum i2c_address_mode_type

i2c address mode

Enumerator
I2C_ADDRESS_MODE_7BIT | 7bit address mode
I2C_ADDRESS_MODE_10BIT | 10bit address mode

Definition at line 155 of file at32f415_i2c.h.

◆ i2c_direction_type

enum i2c_direction_type

i2c address direction

Enumerator
I2C_DIRECTION_TRANSMIT | transmit mode
I2C_DIRECTION_RECEIVE | receive mode

Definition at line 164 of file at32f415_i2c.h.

◆ i2c_fsmode_duty_cycle_type

enum i2c_fsmode_duty_cycle_type

i2c fast mode duty cycle

Enumerator
I2C_FSMODE_DUTY_2_1 | duty cycle is 2:1 in fast mode
I2C_FSMODE_DUTY_16_9 | duty cycle is 16:9 in fast mode

Definition at line 146 of file at32f415_i2c.h.

◆ i2c_master_ack_type

enum i2c_master_ack_type

i2c master receiving mode acknowledge control

Enumerator
I2C_MASTER_ACK_CURRENT | acken bit acts on the current byte
I2C_MASTER_ACK_NEXT | acken bit acts on the next byte

Definition at line 108 of file at32f415_i2c.h.

◆ i2c_pec_position_type

enum i2c_pec_position_type

i2c pec position set

Enumerator
I2C_PEC_POSITION_CURRENT | the current byte is pec
I2C_PEC_POSITION_NEXT | the next byte is pec

Definition at line 117 of file at32f415_i2c.h.

◆ i2c_smbus_alert_set_type

enum i2c_smbus_alert_set_type

i2c smbus alert pin set

Enumerator
I2C_SMBUS_ALERT_HIGH | smbus alert pin set high
I2C_SMBUS_ALERT_LOW | smbus alert pin set low

Definition at line 127 of file at32f415_i2c.h.

◆ i2c_smbus_mode_set_type

enum i2c_smbus_mode_set_type

i2c smbus mode set

Enumerator
I2C_SMBUS_MODE_DEVICE | smbus device mode
I2C_SMBUS_MODE_HOST | smbus host mode

Definition at line 136 of file at32f415_i2c.h.


AT32F415 Firmwary Library: i2c_type Struct Reference

Data Fields
i2c_type Struct Reference
AT32F415_periph_driver » I2C » I2C_exported_types

type define i2c register all More...

#include <at32f415_i2c.h>

Data Fields

union {
__IO uint32_t ctrl1
struct {
__IO uint32_t i2cen: 1
__IO uint32_t permode: 1
__IO uint32_t reserved1: 1
__IO uint32_t smbmode: 1
__IO uint32_t arpen: 1
__IO uint32_t pecen: 1
__IO uint32_t gcaen: 1
__IO uint32_t stretch: 1
__IO uint32_t genstart: 1
__IO uint32_t genstop: 1
__IO uint32_t acken: 1
__IO uint32_t mackctrl: 1
__IO uint32_t pecten: 1
__IO uint32_t smbalert: 1
__IO uint32_t reserved2: 1
__IO uint32_t reset: 1
__IO uint32_t reserved3: 16
} ctrl1_bit
};
i2c ctrl1 register, offset:0x00 More...
union {
__IO uint32_t ctrl2
struct {
__IO uint32_t clkfreq: 8
__IO uint32_t errien: 1
__IO uint32_t evtien: 1
__IO uint32_t dataien: 1
__IO uint32_t dmaen: 1
__IO uint32_t dmaend: 1
__IO uint32_t reserved1: 19
} ctrl2_bit
};
i2c ctrl2 register, offset:0x04 More...
union {
__IO uint32_t oaddr1
struct {
__IO uint32_t addr1: 10
__IO uint32_t reserved1: 5
__IO uint32_t addr1mode: 1
__IO uint32_t reserved2: 16
} oaddr1_bit
};
i2c oaddr1 register, offset:0x08 More...
union {
__IO uint32_t oaddr2
struct {
__IO uint32_t addr2en: 1
__IO uint32_t addr2: 7
__IO uint32_t reserved1: 24
} oaddr2_bit
};
i2c oaddr2 register, offset:0x0C More...
union {
__IO uint32_t dt
struct {
__IO uint32_t dt: 8
__IO uint32_t reserved1: 24
} dt_bit
};
i2c dt register, offset:0x10 More...
union {
__IO uint32_t sts1
struct {
__IO uint32_t startf: 1
__IO uint32_t addr7f: 1
__IO uint32_t tdc: 1
__IO uint32_t addrhf: 1
__IO uint32_t stopf: 1
__IO uint32_t reserved1: 1
__IO uint32_t rdbf: 1
__IO uint32_t tdbe: 1
__IO uint32_t buserr: 1
__IO uint32_t arlost: 1
__IO uint32_t ackfail: 1
__IO uint32_t ouf: 1
__IO uint32_t pecerr: 1
__IO uint32_t reserved2: 1
__IO uint32_t tmout: 1
__IO uint32_t alertf: 1
__IO uint32_t reserved3: 16
} sts1_bit
};
i2c sts1 register, offset:0x14 More...
union {
__IO uint32_t sts2
struct {
__IO uint32_t trmode: 1
__IO uint32_t busyf: 1
__IO uint32_t dirf: 1
__IO uint32_t reserved1: 1
__IO uint32_t gcaddrf: 1
__IO uint32_t devaddrf: 1
__IO uint32_t hostaddrf: 1
__IO uint32_t addr2: 1
__IO uint32_t pecval: 8
__IO uint32_t reserved2: 16
} sts2_bit
};
i2c sts2 register, offset:0x18 More...
union {
__IO uint32_t clkctrl
struct {
__IO uint32_t speed: 12
__IO uint32_t reserved1: 2
__IO uint32_t dutymode: 1
__IO uint32_t speedmode: 1
__IO uint32_t reserved2: 16
} clkctrl_bit
};
i2c clkctrl register, offset:0x1C More...
union {
__IO uint32_t tmrise
struct {
__IO uint32_t risetime: 6
__IO uint32_t reserved1: 26
} tmrise_bit
};
i2c tmrise register, offset:0x20 More...

Detailed Description

type define i2c register all

Definition at line 173 of file at32f415_i2c.h.

Field Documentation

◆

union { ... } i2c_type::@479

i2c ctrl1 register, offset:0x00

◆

union { ... } i2c_type::@481

i2c ctrl2 register, offset:0x04

◆

union { ... } i2c_type::@483

i2c oaddr1 register, offset:0x08

◆

union { ... } i2c_type::@485

i2c oaddr2 register, offset:0x0C

◆

union { ... } i2c_type::@487

i2c dt register, offset:0x10

◆

union { ... } i2c_type::@489

i2c sts1 register, offset:0x14

◆

union { ... } i2c_type::@491

i2c sts2 register, offset:0x18

◆

union { ... } i2c_type::@493

i2c clkctrl register, offset:0x1C

◆

union { ... } i2c_type::@495

i2c tmrise register, offset:0x20

◆ acken

__IO uint32_t i2c_type::acken

Definition at line 193 of file at32f415_i2c.h.

Referenced by i2c_ack_enable().

◆ ackfail

__IO uint32_t i2c_type::ackfail

Definition at line 281 of file at32f415_i2c.h.

◆ addr1

__IO uint32_t i2c_type::addr1

Definition at line 229 of file at32f415_i2c.h.

Referenced by i2c_own_address1_set().

◆ addr1mode

__IO uint32_t i2c_type::addr1mode

Definition at line 231 of file at32f415_i2c.h.

Referenced by i2c_master_read_addr(), i2c_master_write_addr(), i2c_own_address1_set(), i2c_slave_transmit(), i2c_slave_transmit_dma(), and i2c_slave_transmit_int().

◆ addr2

__IO uint32_t i2c_type::addr2

Definition at line 245 of file at32f415_i2c.h.

Referenced by i2c_own_address2_set().

◆ addr2en

__IO uint32_t i2c_type::addr2en

Definition at line 244 of file at32f415_i2c.h.

Referenced by i2c_own_address2_enable().

◆ addr7f

__IO uint32_t i2c_type::addr7f

Definition at line 272 of file at32f415_i2c.h.

◆ addrhf

__IO uint32_t i2c_type::addrhf

Definition at line 274 of file at32f415_i2c.h.

◆ alertf

__IO uint32_t i2c_type::alertf

Definition at line 286 of file at32f415_i2c.h.

◆ arlost

__IO uint32_t i2c_type::arlost

Definition at line 280 of file at32f415_i2c.h.

◆ arpen

__IO uint32_t i2c_type::arpen

Definition at line 187 of file at32f415_i2c.h.

Referenced by i2c_arp_mode_enable().

◆ buserr

__IO uint32_t i2c_type::buserr

Definition at line 279 of file at32f415_i2c.h.

◆ busyf

__IO uint32_t i2c_type::busyf

Definition at line 300 of file at32f415_i2c.h.

◆ clkctrl

__IO uint32_t i2c_type::clkctrl

Definition at line 317 of file at32f415_i2c.h.

◆

struct { ... } i2c_type::clkctrl_bit

Referenced by i2c_fast_mode_duty_set(), and i2c_init().

◆ clkfreq

__IO uint32_t i2c_type::clkfreq

Definition at line 211 of file at32f415_i2c.h.

Referenced by i2c_init().

◆ ctrl1

__IO uint32_t i2c_type::ctrl1

Definition at line 180 of file at32f415_i2c.h.

◆

struct { ... } i2c_type::ctrl1_bit

Referenced by i2c_ack_enable(), i2c_arp_mode_enable(), i2c_clock_stretch_enable(), i2c_enable(), i2c_general_call_enable(), i2c_init(), i2c_master_receive_ack_set(), i2c_pec_calculate_enable(), i2c_pec_position_set(), i2c_pec_transmit_enable(), i2c_smbus_alert_set(), i2c_smbus_enable(), i2c_smbus_mode_set(), i2c_software_reset(), i2c_start_generate(), i2c_stop_flag_clear(), and i2c_stop_generate().

◆ ctrl2

__IO uint32_t i2c_type::ctrl2

Definition at line 208 of file at32f415_i2c.h.

Referenced by i2c_interrupt_enable().

◆

struct { ... } i2c_type::ctrl2_bit

Referenced by i2c_dma_enable(), i2c_dma_end_transfer_set(), and i2c_init().

◆ dataien

__IO uint32_t i2c_type::dataien

Definition at line 214 of file at32f415_i2c.h.

◆ devaddrf

__IO uint32_t i2c_type::devaddrf

Definition at line 304 of file at32f415_i2c.h.

◆ dirf

__IO uint32_t i2c_type::dirf

Definition at line 301 of file at32f415_i2c.h.

◆ dmaen

__IO uint32_t i2c_type::dmaen

Definition at line 215 of file at32f415_i2c.h.

Referenced by i2c_dma_enable().

◆ dmaend

__IO uint32_t i2c_type::dmaend

Definition at line 216 of file at32f415_i2c.h.

Referenced by i2c_dma_end_transfer_set().

◆ dt

__IO uint32_t i2c_type::dt

Definition at line 255 of file at32f415_i2c.h.

Referenced by i2c_7bit_address_send(), i2c_data_receive(), i2c_data_send(), and i2c_dma_config().

◆

struct { ... } i2c_type::dt_bit

◆ dutymode

__IO uint32_t i2c_type::dutymode

Definition at line 322 of file at32f415_i2c.h.

Referenced by i2c_fast_mode_duty_set(), and i2c_init().

◆ errien

__IO uint32_t i2c_type::errien

Definition at line 212 of file at32f415_i2c.h.

◆ evtien

__IO uint32_t i2c_type::evtien

Definition at line 213 of file at32f415_i2c.h.

◆ gcaddrf

__IO uint32_t i2c_type::gcaddrf

Definition at line 303 of file at32f415_i2c.h.

◆ gcaen

__IO uint32_t i2c_type::gcaen

Definition at line 189 of file at32f415_i2c.h.

Referenced by i2c_general_call_enable().

◆ genstart

__IO uint32_t i2c_type::genstart

Definition at line 191 of file at32f415_i2c.h.

Referenced by i2c_start_generate().

◆ genstop

__IO uint32_t i2c_type::genstop

Definition at line 192 of file at32f415_i2c.h.

Referenced by i2c_stop_generate().

◆ hostaddrf

__IO uint32_t i2c_type::hostaddrf

Definition at line 305 of file at32f415_i2c.h.

◆ i2cen

__IO uint32_t i2c_type::i2cen

Definition at line 183 of file at32f415_i2c.h.

Referenced by i2c_enable(), i2c_init(), and i2c_stop_flag_clear().

◆ mackctrl

__IO uint32_t i2c_type::mackctrl

Definition at line 194 of file at32f415_i2c.h.

Referenced by i2c_master_receive_ack_set(), and i2c_pec_position_set().

◆ oaddr1

__IO uint32_t i2c_type::oaddr1

Definition at line 226 of file at32f415_i2c.h.

◆

struct { ... } i2c_type::oaddr1_bit

Referenced by i2c_master_read_addr(), i2c_master_write_addr(), i2c_own_address1_set(), i2c_slave_transmit(), i2c_slave_transmit_dma(), and i2c_slave_transmit_int().

◆ oaddr2

__IO uint32_t i2c_type::oaddr2

Definition at line 241 of file at32f415_i2c.h.

◆

struct { ... } i2c_type::oaddr2_bit

Referenced by i2c_own_address2_enable(), and i2c_own_address2_set().

◆ ouf

__IO uint32_t i2c_type::ouf

Definition at line 282 of file at32f415_i2c.h.

◆ pecen

__IO uint32_t i2c_type::pecen

Definition at line 188 of file at32f415_i2c.h.

Referenced by i2c_pec_calculate_enable().

◆ pecerr

__IO uint32_t i2c_type::pecerr

Definition at line 283 of file at32f415_i2c.h.

◆ pecten

__IO uint32_t i2c_type::pecten

Definition at line 195 of file at32f415_i2c.h.

Referenced by i2c_pec_transmit_enable().

◆ pecval

__IO uint32_t i2c_type::pecval

Definition at line 307 of file at32f415_i2c.h.

Referenced by i2c_pec_value_get().

◆ permode

__IO uint32_t i2c_type::permode

Definition at line 184 of file at32f415_i2c.h.

Referenced by i2c_smbus_enable().

◆ rdbf

__IO uint32_t i2c_type::rdbf

Definition at line 277 of file at32f415_i2c.h.

◆ reserved1

__IO uint32_t i2c_type::reserved1

Definition at line 185 of file at32f415_i2c.h.

◆ reserved2

__IO uint32_t i2c_type::reserved2

Definition at line 197 of file at32f415_i2c.h.

◆ reserved3

__IO uint32_t i2c_type::reserved3

Definition at line 199 of file at32f415_i2c.h.

◆ reset

__IO uint32_t i2c_type::reset

Definition at line 198 of file at32f415_i2c.h.

Referenced by i2c_software_reset().

◆ risetime

__IO uint32_t i2c_type::risetime

Definition at line 336 of file at32f415_i2c.h.

Referenced by i2c_init().

◆ smbalert

__IO uint32_t i2c_type::smbalert

Definition at line 196 of file at32f415_i2c.h.

Referenced by i2c_smbus_alert_set().

◆ smbmode

__IO uint32_t i2c_type::smbmode

Definition at line 186 of file at32f415_i2c.h.

Referenced by i2c_smbus_mode_set().

◆ speed

__IO uint32_t i2c_type::speed

Definition at line 320 of file at32f415_i2c.h.

Referenced by i2c_init().

◆ speedmode

__IO uint32_t i2c_type::speedmode

Definition at line 323 of file at32f415_i2c.h.

Referenced by i2c_init().

◆ startf

__IO uint32_t i2c_type::startf

Definition at line 271 of file at32f415_i2c.h.

◆ stopf

__IO uint32_t i2c_type::stopf

Definition at line 275 of file at32f415_i2c.h.

◆ stretch

__IO uint32_t i2c_type::stretch

Definition at line 190 of file at32f415_i2c.h.

Referenced by i2c_clock_stretch_enable().

◆ sts1

__IO uint32_t i2c_type::sts1

Definition at line 268 of file at32f415_i2c.h.

Referenced by i2c_addr_flag_clear(), i2c_flag_clear(), i2c_flag_get(), and i2c_stop_flag_clear().

◆

struct { ... } i2c_type::sts1_bit

◆ sts2

__IO uint32_t i2c_type::sts2

Definition at line 296 of file at32f415_i2c.h.

Referenced by i2c_addr_flag_clear(), and i2c_flag_get().

◆

struct { ... } i2c_type::sts2_bit

Referenced by i2c_pec_value_get().

◆ tdbe

__IO uint32_t i2c_type::tdbe

Definition at line 278 of file at32f415_i2c.h.

◆ tdc

__IO uint32_t i2c_type::tdc

Definition at line 273 of file at32f415_i2c.h.

◆ tmout

__IO uint32_t i2c_type::tmout

Definition at line 285 of file at32f415_i2c.h.

◆ tmrise

__IO uint32_t i2c_type::tmrise

Definition at line 333 of file at32f415_i2c.h.

◆

struct { ... } i2c_type::tmrise_bit

Referenced by i2c_init().

◆ trmode

__IO uint32_t i2c_type::trmode

Definition at line 299 of file at32f415_i2c.h.

The documentation for this struct was generated from the following file:
  • at32f415_i2c.h


AT32F415 Firmwary Library: I2C_exported_functions

Functions
I2C_exported_functions
AT32F415_periph_driver » I2C

Functions

void | i2c_reset (i2c_type *i2c_x)
reset the i2c register More...
void | i2c_software_reset (i2c_type *i2c_x, confirm_state new_state)
software reset. More...
void | i2c_init (i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed)
init i2c speed and duty cycle. More...
void | i2c_own_address1_set (i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address)
config own address1. More...
void | i2c_own_address2_set (i2c_type *i2c_x, uint8_t address)
config own address2. More...
void | i2c_own_address2_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable own address2. More...
void | i2c_smbus_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable the smbus mode More...
void | i2c_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable i2c periph More...
void | i2c_fast_mode_duty_set (i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty)
config fast mode duty cycle More...
void | i2c_clock_stretch_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable clock stretch. More...
void | i2c_ack_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable acknowledge. More...
void | i2c_master_receive_ack_set (i2c_type *i2c_x, i2c_master_ack_type pos)
master receiving mode acknowledge control. More...
void | i2c_pec_position_set (i2c_type *i2c_x, i2c_pec_position_type pos)
pec position set. More...
void | i2c_general_call_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable general call. More...
void | i2c_arp_mode_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable arp mode. More...
void | i2c_smbus_mode_set (i2c_type *i2c_x, i2c_smbus_mode_set_type mode)
config smbus host or device. More...
void | i2c_smbus_alert_set (i2c_type *i2c_x, i2c_smbus_alert_set_type level)
drive the smbus alert pin high or low. More...
void | i2c_pec_transmit_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable pec transfer. More...
void | i2c_pec_calculate_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable pec calcultetion. More...
uint8_t | i2c_pec_value_get (i2c_type *i2c_x)
get pec value. More...
void | i2c_dma_end_transfer_set (i2c_type *i2c_x, confirm_state new_state)
enable or disable if the next dma transfer will be the last one. More...
void | i2c_dma_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable dma requests. More...
void | i2c_interrupt_enable (i2c_type *i2c_x, uint16_t source, confirm_state new_state)
enable or disable interrupt More...
void | i2c_start_generate (i2c_type *i2c_x)
generate start condition. More...
void | i2c_stop_generate (i2c_type *i2c_x)
generate stop condition. More...
void | i2c_7bit_address_send (i2c_type *i2c_x, uint8_t address, i2c_direction_type direction)
transmit the slave address. More...
void | i2c_data_send (i2c_type *i2c_x, uint8_t data)
send a byte through the i2c periph. More...
uint8_t | i2c_data_receive (i2c_type *i2c_x)
receive a byte through the i2c periph. More...
flag_status | i2c_flag_get (i2c_type *i2c_x, uint32_t flag)
get flag status More...
void | i2c_flag_clear (i2c_type *i2c_x, uint32_t flag)
clear flag status More...

Detailed Description

Function Documentation

◆ i2c_7bit_address_send()

void i2c_7bit_address_send | ( | i2c_type * | i2c_x,
 |  | uint8_t | address,
 |  | i2c_direction_type | direction
 | ) |  |

transmit the slave address.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
address specifies the slave address which will be transmitted
direction this parameter can be one of the following values:
  • I2C_DIRECTION_TRANSMIT: transmit mode.
  • I2C_DIRECTION_RECEIVE: receive mode.
Return values
none.

Definition at line 503 of file at32f415_i2c.c.

Referenced by i2c_master_read_addr(), and i2c_master_write_addr().

◆ i2c_ack_enable()

void i2c_ack_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable acknowledge.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none.

Definition at line 283 of file at32f415_i2c.c.

Referenced by i2c_dma_tx_irq_handler(), i2c_master_read_addr(), i2c_master_receive(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_rx_isr_int(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_slave_receive(), i2c_slave_receive_dma(), i2c_slave_receive_int(), i2c_slave_transmit(), i2c_slave_transmit_dma(), and i2c_slave_transmit_int().

◆ i2c_arp_mode_enable()

void i2c_arp_mode_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable arp mode.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 341 of file at32f415_i2c.c.

◆ i2c_clock_stretch_enable()

void i2c_clock_stretch_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable clock stretch.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 270 of file at32f415_i2c.c.

◆ i2c_data_receive()

uint8_t i2c_data_receive ( i2c_type * i2c_x )

receive a byte through the i2c periph.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
Return values
uint8_t received byte

Definition at line 535 of file at32f415_i2c.c.

Referenced by i2c_master_receive(), i2c_master_rx_isr_int(), i2c_memory_read(), i2c_slave_receive(), and i2c_slave_rx_isr_int().

◆ i2c_data_send()

void i2c_data_send | ( | i2c_type * | i2c_x,
 |  | uint8_t | data
 | ) |  |

send a byte through the i2c periph.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
data byte to be transmitted.
Return values
none

Definition at line 523 of file at32f415_i2c.c.

Referenced by i2c_master_read_addr(), i2c_master_transmit(), i2c_master_tx_isr_int(), i2c_master_write_addr(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write(), i2c_memory_write_dma(), i2c_memory_write_int(), i2c_slave_transmit(), and i2c_slave_tx_isr_int().

◆ i2c_dma_enable()

void i2c_dma_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable dma requests.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 437 of file at32f415_i2c.c.

Referenced by i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), i2c_master_receive_dma(), i2c_master_transmit_dma(), i2c_memory_read_dma(), i2c_memory_write_dma(), i2c_slave_receive_dma(), and i2c_slave_transmit_dma().

◆ i2c_dma_end_transfer_set()

void i2c_dma_end_transfer_set | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable if the next dma transfer will be the last one.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 424 of file at32f415_i2c.c.

Referenced by i2c_master_receive_dma(), and i2c_memory_read_dma().

◆ i2c_enable()

void i2c_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable i2c periph

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 241 of file at32f415_i2c.c.

Referenced by i2c_config().

◆ i2c_fast_mode_duty_set()

void i2c_fast_mode_duty_set | ( | i2c_type * | i2c_x,
 |  | i2c_fsmode_duty_cycle_type | duty
 | ) |  |

config fast mode duty cycle

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
duty this parameter can be one of the following values:
  • I2C_FSMODE_DUTY_2_1: duty cycle 2:1
  • I2C_FSMODE_DUTY_16_9: duty cycle 16:9
Return values
none

Definition at line 257 of file at32f415_i2c.c.

◆ i2c_flag_clear()

void i2c_flag_clear | ( | i2c_type * | i2c_x,
 |  | uint32_t | flag
 | ) |  |

clear flag status

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
flag this parameter can be any combination of the following values:
  • I2C_BUSERR_FLAG: bus error flag.
  • I2C_ARLOST_FLAG: arbitration lost flag.
  • I2C_ACKFAIL_FLAG: acknowledge failure flag.
  • I2C_OUF_FLAG: overflow or underflow flag.
  • I2C_PECERR_FLAG: pec receive error flag.
  • I2C_TMOUT_FLAG: smbus timeout flag.
  • I2C_ALERTF_FLAG: smbus alert flag.
Return values
none

Definition at line 615 of file at32f415_i2c.c.

Referenced by i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), i2c_err_irq_handler(), i2c_slave_transmit(), i2c_slave_tx_isr_int(), and i2c_wait_flag().

◆ i2c_flag_get()

flag_status i2c_flag_get | ( | i2c_type * | i2c_x,
 |  | uint32_t | flag
 | ) |  |

get flag status

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
flag this parameter can be one of the following values:
  • I2C_STARTF_FLAG: start condition generation complete flag.
  • I2C_ADDR7F_FLAG: 0~7 bit address match flag.
  • I2C_TDC_FLAG: transmit data complete flag.
  • I2C_ADDRHF_FLAG: master 9~8 bit address header match flag.
  • I2C_STOPF_FLAG: stop condition generation complete flag.
  • I2C_RDBF_FLAG: receive data buffer full flag.
  • I2C_TDBE_FLAG: transmit data buffer empty flag.
  • I2C_BUSERR_FLAG: bus error flag.
  • I2C_ARLOST_FLAG: arbitration lost flag.
  • I2C_ACKFAIL_FLAG: acknowledge failure flag.
  • I2C_OUF_FLAG: overflow or underflow flag.
  • I2C_PECERR_FLAG: pec receive error flag.
  • I2C_TMOUT_FLAG: smbus timeout flag.
  • I2C_ALERTF_FLAG: smbus alert flag.
  • I2C_TRMODE_FLAG: transmission mode.
  • I2C_BUSYF_FLAG: bus busy flag transmission mode.
  • I2C_DIRF_FLAG: transmission direction flag.
  • I2C_GCADDRF_FLAG: general call address received flag.
  • I2C_DEVADDRF_FLAG: smbus device address received flag.
  • I2C_HOSTADDRF_FLAG: smbus host address received flag.
  • I2C_ADDR2_FLAG: own address 2 received flag.
Return values
flag_status (SET or RESET)

Definition at line 570 of file at32f415_i2c.c.

Referenced by i2c_err_irq_handler(), i2c_master_rx_isr_int(), i2c_master_tx_isr_int(), i2c_slave_rx_isr_int(), i2c_slave_tx_isr_int(), and i2c_wait_flag().

◆ i2c_general_call_enable()

void i2c_general_call_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable general call.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 328 of file at32f415_i2c.c.

◆ i2c_init()

void i2c_init | ( | i2c_type * | i2c_x,
 |  | i2c_fsmode_duty_cycle_type | duty,
 |  | uint32_t | speed
 | ) |  |

init i2c speed and duty cycle.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
duty this parameter can be one of the following values:
  • I2C_FSMODE_DUTY_2_1: duty cycle 2:1
  • I2C_FSMODE_DUTY_16_9: duty cycle 16:9
speed i2c scl clock speed, such as 100000
Return values
none

Definition at line 90 of file at32f415_i2c.c.

Referenced by i2c_lowlevel_init().

◆ i2c_interrupt_enable()

void i2c_interrupt_enable | ( | i2c_type * | i2c_x,
 |  | uint16_t | source,
 |  | confirm_state | new_state
 | ) |  |

enable or disable interrupt

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
source this parameter can be one of the following values:
  • I2C_DATA_INT: data interrupt.
  • I2C_EV_INT: event interrupt.
  • I2C_ERR_INT: error interrupt.
new_state (TRUE or FALSE)
Return values
none

Definition at line 455 of file at32f415_i2c.c.

Referenced by i2c_err_irq_handler(), i2c_master_receive_int(), i2c_master_rx_isr_int(), i2c_master_transmit_int(), i2c_master_tx_isr_int(), i2c_memory_read_int(), i2c_memory_write_int(), i2c_slave_receive_int(), i2c_slave_rx_isr_int(), i2c_slave_transmit_int(), and i2c_slave_tx_isr_int().

◆ i2c_master_receive_ack_set()

void i2c_master_receive_ack_set | ( | i2c_type * | i2c_x,
 |  | i2c_master_ack_type | pos
 | ) |  |

master receiving mode acknowledge control.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
pos this parameter can be one of the following values:
  • I2C_MASTER_ACK_CURRENT: acken bit acts on the current byte
  • I2C_MASTER_ACK_NEXT: acken bit acts on the next byte
Return values
none

Definition at line 299 of file at32f415_i2c.c.

Referenced by i2c_master_receive(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_transmit(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write(), i2c_memory_write_dma(), i2c_memory_write_int(), i2c_slave_receive(), i2c_slave_receive_dma(), i2c_slave_receive_int(), i2c_slave_transmit(), i2c_slave_transmit_dma(), and i2c_slave_transmit_int().

◆ i2c_own_address1_set()

void i2c_own_address1_set | ( | i2c_type * | i2c_x,
 |  | i2c_address_mode_type | mode,
 |  | uint16_t | address
 | ) |  |

config own address1.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
mode this parameter can be one of the following values:
  • I2C_ADDRESS_MODE_7BIT: 7bit address.
  • I2C_ADDRESS_MODE_10BIT: 10bit address.
address own address1, such as 0xb0.
Return values
none

Definition at line 185 of file at32f415_i2c.c.

Referenced by i2c_lowlevel_init().

◆ i2c_own_address2_enable()

void i2c_own_address2_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable own address2.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 215 of file at32f415_i2c.c.

◆ i2c_own_address2_set()

void i2c_own_address2_set | ( | i2c_type * | i2c_x,
 |  | uint8_t | address
 | ) |  |

config own address2.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
address specifies the 7bit i2c own address2, such as 0xa0.
Return values
none.

Definition at line 202 of file at32f415_i2c.c.

◆ i2c_pec_calculate_enable()

void i2c_pec_calculate_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable pec calcultetion.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 399 of file at32f415_i2c.c.

◆ i2c_pec_position_set()

void i2c_pec_position_set | ( | i2c_type * | i2c_x,
 |  | i2c_pec_position_type | pos
 | ) |  |

pec position set.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
pos this parameter can be one of the following values:
  • I2C_PEC_POSITION_CURRENT: the current byte is pec
  • I2C_PEC_POSITION_NEXT: the next byte is pec
Return values
none

Definition at line 315 of file at32f415_i2c.c.

◆ i2c_pec_transmit_enable()

void i2c_pec_transmit_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable pec transfer.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 386 of file at32f415_i2c.c.

◆ i2c_pec_value_get()

uint8_t i2c_pec_value_get ( i2c_type * i2c_x )

get pec value.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
Return values
uint8_t pec value.

Definition at line 411 of file at32f415_i2c.c.

◆ i2c_reset()

void i2c_reset ( i2c_type * i2c_x )

reset the i2c register

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
Return values
none

Definition at line 51 of file at32f415_i2c.c.

Referenced by i2c_config().

◆ i2c_smbus_alert_set()

void i2c_smbus_alert_set | ( | i2c_type * | i2c_x,
 |  | i2c_smbus_alert_set_type | level
 | ) |  |

drive the smbus alert pin high or low.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
level this parameter can be one of the following values:
  • I2C_SMBUS_ALERT_LOW: smbus alert pin set low.
  • I2C_SMBUS_ALERT_HIGH: smbus alert pin set high.
Return values
none

Definition at line 373 of file at32f415_i2c.c.

◆ i2c_smbus_enable()

void i2c_smbus_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the smbus mode

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 228 of file at32f415_i2c.c.

◆ i2c_smbus_mode_set()

void i2c_smbus_mode_set | ( | i2c_type * | i2c_x,
 |  | i2c_smbus_mode_set_type | mode
 | ) |  |

config smbus host or device.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
level this parameter can be one of the following values:
  • I2C_SMBUS_MODE_DEVICE: smbus device.
  • I2C_SMBUS_MODE_HOST: smbus host.
Return values
none

Definition at line 357 of file at32f415_i2c.c.

◆ i2c_software_reset()

void i2c_software_reset | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

software reset.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 73 of file at32f415_i2c.c.

◆ i2c_start_generate()

void i2c_start_generate ( i2c_type * i2c_x )

generate start condition.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
Return values
none.

Definition at line 474 of file at32f415_i2c.c.

Referenced by i2c_master_read_addr(), and i2c_master_write_addr().

◆ i2c_stop_generate()

void i2c_stop_generate ( i2c_type * i2c_x )

generate stop condition.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
Return values
none.

Definition at line 486 of file at32f415_i2c.c.

Referenced by i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), i2c_master_receive(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_rx_isr_int(), i2c_master_transmit(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_master_tx_isr_int(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write(), i2c_memory_write_dma(), i2c_memory_write_int(), and i2c_wait_flag().


AT32F415 Firmwary Library: I2C_private_functions

Functions
I2C_private_functions
AT32F415_periph_driver » I2C

Functions

void | i2c_reset (i2c_type *i2c_x)
reset the i2c register More...
void | i2c_software_reset (i2c_type *i2c_x, confirm_state new_state)
software reset. More...
void | i2c_init (i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed)
init i2c speed and duty cycle. More...
void | i2c_own_address1_set (i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address)
config own address1. More...
void | i2c_own_address2_set (i2c_type *i2c_x, uint8_t address)
config own address2. More...
void | i2c_own_address2_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable own address2. More...
void | i2c_smbus_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable the smbus mode More...
void | i2c_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable i2c periph More...
void | i2c_fast_mode_duty_set (i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty)
config fast mode duty cycle More...
void | i2c_clock_stretch_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable clock stretch. More...
void | i2c_ack_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable acknowledge. More...
void | i2c_master_receive_ack_set (i2c_type *i2c_x, i2c_master_ack_type pos)
master receiving mode acknowledge control. More...
void | i2c_pec_position_set (i2c_type *i2c_x, i2c_pec_position_type pos)
pec position set. More...
void | i2c_general_call_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable general call. More...
void | i2c_arp_mode_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable arp mode. More...
void | i2c_smbus_mode_set (i2c_type *i2c_x, i2c_smbus_mode_set_type mode)
config smbus host or device. More...
void | i2c_smbus_alert_set (i2c_type *i2c_x, i2c_smbus_alert_set_type level)
drive the smbus alert pin high or low. More...
void | i2c_pec_transmit_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable pec transfer. More...
void | i2c_pec_calculate_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable pec calcultetion. More...
uint8_t | i2c_pec_value_get (i2c_type *i2c_x)
get pec value. More...
void | i2c_dma_end_transfer_set (i2c_type *i2c_x, confirm_state new_state)
enable or disable if the next dma transfer will be the last one. More...
void | i2c_dma_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable dma requests. More...
void | i2c_interrupt_enable (i2c_type *i2c_x, uint16_t source, confirm_state new_state)
enable or disable interrupt More...
void | i2c_start_generate (i2c_type *i2c_x)
generate start condition. More...
void | i2c_stop_generate (i2c_type *i2c_x)
generate stop condition. More...
void | i2c_7bit_address_send (i2c_type *i2c_x, uint8_t address, i2c_direction_type direction)
transmit the slave address. More...
void | i2c_data_send (i2c_type *i2c_x, uint8_t data)
send a byte through the i2c periph. More...
uint8_t | i2c_data_receive (i2c_type *i2c_x)
receive a byte through the i2c periph. More...
flag_status | i2c_flag_get (i2c_type *i2c_x, uint32_t flag)
get flag status More...
void | i2c_flag_clear (i2c_type *i2c_x, uint32_t flag)
clear flag status More...

Detailed Description

Function Documentation

◆ i2c_7bit_address_send()

void i2c_7bit_address_send | ( | i2c_type * | i2c_x,
 |  | uint8_t | address,
 |  | i2c_direction_type | direction
 | ) |  |

transmit the slave address.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
address specifies the slave address which will be transmitted
direction this parameter can be one of the following values:
  • I2C_DIRECTION_TRANSMIT: transmit mode.
  • I2C_DIRECTION_RECEIVE: receive mode.
Return values
none.

Definition at line 503 of file at32f415_i2c.c.

Referenced by i2c_master_read_addr(), and i2c_master_write_addr().

◆ i2c_ack_enable()

void i2c_ack_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable acknowledge.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none.

Definition at line 283 of file at32f415_i2c.c.

Referenced by i2c_dma_tx_irq_handler(), i2c_master_read_addr(), i2c_master_receive(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_rx_isr_int(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_slave_receive(), i2c_slave_receive_dma(), i2c_slave_receive_int(), i2c_slave_transmit(), i2c_slave_transmit_dma(), and i2c_slave_transmit_int().

◆ i2c_arp_mode_enable()

void i2c_arp_mode_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable arp mode.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 341 of file at32f415_i2c.c.

◆ i2c_clock_stretch_enable()

void i2c_clock_stretch_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable clock stretch.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 270 of file at32f415_i2c.c.

◆ i2c_data_receive()

uint8_t i2c_data_receive ( i2c_type * i2c_x )

receive a byte through the i2c periph.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
Return values
uint8_t received byte

Definition at line 535 of file at32f415_i2c.c.

Referenced by i2c_master_receive(), i2c_master_rx_isr_int(), i2c_memory_read(), i2c_slave_receive(), and i2c_slave_rx_isr_int().

◆ i2c_data_send()

void i2c_data_send | ( | i2c_type * | i2c_x,
 |  | uint8_t | data
 | ) |  |

send a byte through the i2c periph.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
data byte to be transmitted.
Return values
none

Definition at line 523 of file at32f415_i2c.c.

Referenced by i2c_master_read_addr(), i2c_master_transmit(), i2c_master_tx_isr_int(), i2c_master_write_addr(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write(), i2c_memory_write_dma(), i2c_memory_write_int(), i2c_slave_transmit(), and i2c_slave_tx_isr_int().

◆ i2c_dma_enable()

void i2c_dma_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable dma requests.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 437 of file at32f415_i2c.c.

Referenced by i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), i2c_master_receive_dma(), i2c_master_transmit_dma(), i2c_memory_read_dma(), i2c_memory_write_dma(), i2c_slave_receive_dma(), and i2c_slave_transmit_dma().

◆ i2c_dma_end_transfer_set()

void i2c_dma_end_transfer_set | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable if the next dma transfer will be the last one.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 424 of file at32f415_i2c.c.

Referenced by i2c_master_receive_dma(), and i2c_memory_read_dma().

◆ i2c_enable()

void i2c_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable i2c periph

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 241 of file at32f415_i2c.c.

Referenced by i2c_config().

◆ i2c_fast_mode_duty_set()

void i2c_fast_mode_duty_set | ( | i2c_type * | i2c_x,
 |  | i2c_fsmode_duty_cycle_type | duty
 | ) |  |

config fast mode duty cycle

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
duty this parameter can be one of the following values:
  • I2C_FSMODE_DUTY_2_1: duty cycle 2:1
  • I2C_FSMODE_DUTY_16_9: duty cycle 16:9
Return values
none

Definition at line 257 of file at32f415_i2c.c.

◆ i2c_flag_clear()

void i2c_flag_clear | ( | i2c_type * | i2c_x,
 |  | uint32_t | flag
 | ) |  |

clear flag status

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
flag this parameter can be any combination of the following values:
  • I2C_BUSERR_FLAG: bus error flag.
  • I2C_ARLOST_FLAG: arbitration lost flag.
  • I2C_ACKFAIL_FLAG: acknowledge failure flag.
  • I2C_OUF_FLAG: overflow or underflow flag.
  • I2C_PECERR_FLAG: pec receive error flag.
  • I2C_TMOUT_FLAG: smbus timeout flag.
  • I2C_ALERTF_FLAG: smbus alert flag.
Return values
none

Definition at line 615 of file at32f415_i2c.c.

Referenced by i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), i2c_err_irq_handler(), i2c_slave_transmit(), i2c_slave_tx_isr_int(), and i2c_wait_flag().

◆ i2c_flag_get()

flag_status i2c_flag_get | ( | i2c_type * | i2c_x,
 |  | uint32_t | flag
 | ) |  |

get flag status

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
flag this parameter can be one of the following values:
  • I2C_STARTF_FLAG: start condition generation complete flag.
  • I2C_ADDR7F_FLAG: 0~7 bit address match flag.
  • I2C_TDC_FLAG: transmit data complete flag.
  • I2C_ADDRHF_FLAG: master 9~8 bit address header match flag.
  • I2C_STOPF_FLAG: stop condition generation complete flag.
  • I2C_RDBF_FLAG: receive data buffer full flag.
  • I2C_TDBE_FLAG: transmit data buffer empty flag.
  • I2C_BUSERR_FLAG: bus error flag.
  • I2C_ARLOST_FLAG: arbitration lost flag.
  • I2C_ACKFAIL_FLAG: acknowledge failure flag.
  • I2C_OUF_FLAG: overflow or underflow flag.
  • I2C_PECERR_FLAG: pec receive error flag.
  • I2C_TMOUT_FLAG: smbus timeout flag.
  • I2C_ALERTF_FLAG: smbus alert flag.
  • I2C_TRMODE_FLAG: transmission mode.
  • I2C_BUSYF_FLAG: bus busy flag transmission mode.
  • I2C_DIRF_FLAG: transmission direction flag.
  • I2C_GCADDRF_FLAG: general call address received flag.
  • I2C_DEVADDRF_FLAG: smbus device address received flag.
  • I2C_HOSTADDRF_FLAG: smbus host address received flag.
  • I2C_ADDR2_FLAG: own address 2 received flag.
Return values
flag_status (SET or RESET)

Definition at line 570 of file at32f415_i2c.c.

Referenced by i2c_err_irq_handler(), i2c_master_rx_isr_int(), i2c_master_tx_isr_int(), i2c_slave_rx_isr_int(), i2c_slave_tx_isr_int(), and i2c_wait_flag().

◆ i2c_general_call_enable()

void i2c_general_call_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable general call.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 328 of file at32f415_i2c.c.

◆ i2c_init()

void i2c_init | ( | i2c_type * | i2c_x,
 |  | i2c_fsmode_duty_cycle_type | duty,
 |  | uint32_t | speed
 | ) |  |

init i2c speed and duty cycle.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
duty this parameter can be one of the following values:
  • I2C_FSMODE_DUTY_2_1: duty cycle 2:1
  • I2C_FSMODE_DUTY_16_9: duty cycle 16:9
speed i2c scl clock speed, such as 100000
Return values
none

Definition at line 90 of file at32f415_i2c.c.

Referenced by i2c_lowlevel_init().

◆ i2c_interrupt_enable()

void i2c_interrupt_enable | ( | i2c_type * | i2c_x,
 |  | uint16_t | source,
 |  | confirm_state | new_state
 | ) |  |

enable or disable interrupt

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
source this parameter can be one of the following values:
  • I2C_DATA_INT: data interrupt.
  • I2C_EV_INT: event interrupt.
  • I2C_ERR_INT: error interrupt.
new_state (TRUE or FALSE)
Return values
none

Definition at line 455 of file at32f415_i2c.c.

Referenced by i2c_err_irq_handler(), i2c_master_receive_int(), i2c_master_rx_isr_int(), i2c_master_transmit_int(), i2c_master_tx_isr_int(), i2c_memory_read_int(), i2c_memory_write_int(), i2c_slave_receive_int(), i2c_slave_rx_isr_int(), i2c_slave_transmit_int(), and i2c_slave_tx_isr_int().

◆ i2c_master_receive_ack_set()

void i2c_master_receive_ack_set | ( | i2c_type * | i2c_x,
 |  | i2c_master_ack_type | pos
 | ) |  |

master receiving mode acknowledge control.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
pos this parameter can be one of the following values:
  • I2C_MASTER_ACK_CURRENT: acken bit acts on the current byte
  • I2C_MASTER_ACK_NEXT: acken bit acts on the next byte
Return values
none

Definition at line 299 of file at32f415_i2c.c.

Referenced by i2c_master_receive(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_transmit(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write(), i2c_memory_write_dma(), i2c_memory_write_int(), i2c_slave_receive(), i2c_slave_receive_dma(), i2c_slave_receive_int(), i2c_slave_transmit(), i2c_slave_transmit_dma(), and i2c_slave_transmit_int().

◆ i2c_own_address1_set()

void i2c_own_address1_set | ( | i2c_type * | i2c_x,
 |  | i2c_address_mode_type | mode,
 |  | uint16_t | address
 | ) |  |

config own address1.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
mode this parameter can be one of the following values:
  • I2C_ADDRESS_MODE_7BIT: 7bit address.
  • I2C_ADDRESS_MODE_10BIT: 10bit address.
address own address1, such as 0xb0.
Return values
none

Definition at line 185 of file at32f415_i2c.c.

Referenced by i2c_lowlevel_init().

◆ i2c_own_address2_enable()

void i2c_own_address2_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable own address2.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 215 of file at32f415_i2c.c.

◆ i2c_own_address2_set()

void i2c_own_address2_set | ( | i2c_type * | i2c_x,
 |  | uint8_t | address
 | ) |  |

config own address2.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
address specifies the 7bit i2c own address2, such as 0xa0.
Return values
none.

Definition at line 202 of file at32f415_i2c.c.

◆ i2c_pec_calculate_enable()

void i2c_pec_calculate_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable pec calcultetion.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 399 of file at32f415_i2c.c.

◆ i2c_pec_position_set()

void i2c_pec_position_set | ( | i2c_type * | i2c_x,
 |  | i2c_pec_position_type | pos
 | ) |  |

pec position set.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
pos this parameter can be one of the following values:
  • I2C_PEC_POSITION_CURRENT: the current byte is pec
  • I2C_PEC_POSITION_NEXT: the next byte is pec
Return values
none

Definition at line 315 of file at32f415_i2c.c.

◆ i2c_pec_transmit_enable()

void i2c_pec_transmit_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable pec transfer.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 386 of file at32f415_i2c.c.

◆ i2c_pec_value_get()

uint8_t i2c_pec_value_get ( i2c_type * i2c_x )

get pec value.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
Return values
uint8_t pec value.

Definition at line 411 of file at32f415_i2c.c.

◆ i2c_reset()

void i2c_reset ( i2c_type * i2c_x )

reset the i2c register

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
Return values
none

Definition at line 51 of file at32f415_i2c.c.

Referenced by i2c_config().

◆ i2c_smbus_alert_set()

void i2c_smbus_alert_set | ( | i2c_type * | i2c_x,
 |  | i2c_smbus_alert_set_type | level
 | ) |  |

drive the smbus alert pin high or low.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
level this parameter can be one of the following values:
  • I2C_SMBUS_ALERT_LOW: smbus alert pin set low.
  • I2C_SMBUS_ALERT_HIGH: smbus alert pin set high.
Return values
none

Definition at line 373 of file at32f415_i2c.c.

◆ i2c_smbus_enable()

void i2c_smbus_enable | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the smbus mode

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 228 of file at32f415_i2c.c.

◆ i2c_smbus_mode_set()

void i2c_smbus_mode_set | ( | i2c_type * | i2c_x,
 |  | i2c_smbus_mode_set_type | mode
 | ) |  |

config smbus host or device.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
level this parameter can be one of the following values:
  • I2C_SMBUS_MODE_DEVICE: smbus device.
  • I2C_SMBUS_MODE_HOST: smbus host.
Return values
none

Definition at line 357 of file at32f415_i2c.c.

◆ i2c_software_reset()

void i2c_software_reset | ( | i2c_type * | i2c_x,
 |  | confirm_state | new_state
 | ) |  |

software reset.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
new_state (TRUE or FALSE)
Return values
none

Definition at line 73 of file at32f415_i2c.c.

◆ i2c_start_generate()

void i2c_start_generate ( i2c_type * i2c_x )

generate start condition.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
Return values
none.

Definition at line 474 of file at32f415_i2c.c.

Referenced by i2c_master_read_addr(), and i2c_master_write_addr().

◆ i2c_stop_generate()

void i2c_stop_generate ( i2c_type * i2c_x )

generate stop condition.

Parameters
i2c_x to select the i2c peripheral. this parameter can be one of the following values:
I2C1, I2C2.
Return values
none.

Definition at line 486 of file at32f415_i2c.c.

Referenced by i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), i2c_master_receive(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_rx_isr_int(), i2c_master_transmit(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_master_tx_isr_int(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write(), i2c_memory_write_dma(), i2c_memory_write_int(), and i2c_wait_flag().


AT32F415 Firmwary Library: MISC

Modules
MISC
AT32F415_periph_driver

MISC driver modules. More...

Modules

MISC_vector_table_base_address
MISC_exported_types
MISC_exported_functions
MISC_private_functions

Detailed Description

MISC driver modules.


AT32F415 Firmwary Library: MISC_vector_table_base_address

Macros
MISC_vector_table_base_address
AT32F415_periph_driver » MISC

Macros

#define | NVIC_VECTTAB_RAM ((uint32_t)0x20000000)
#define | NVIC_VECTTAB_FLASH ((uint32_t)0x08000000)

Detailed Description

Macro Definition Documentation

◆ NVIC_VECTTAB_FLASH

#define NVIC_VECTTAB_FLASH ((uint32_t)0x08000000)

nvic vector table based flash address

Definition at line 52 of file at32f415_misc.h.

◆ NVIC_VECTTAB_RAM

#define NVIC_VECTTAB_RAM ((uint32_t)0x20000000)

nvic vector table based ram address

Definition at line 51 of file at32f415_misc.h.


AT32F415 Firmwary Library: MISC_exported_types

Enumerations
MISC_exported_types
AT32F415_periph_driver » MISC

Enumerations

enum nvic_priority_group_type {
NVIC_PRIORITY_GROUP_0 = ((uint32_t)0x7) , NVIC_PRIORITY_GROUP_1 = ((uint32_t)0x6) , NVIC_PRIORITY_GROUP_2 = ((uint32_t)0x5) , NVIC_PRIORITY_GROUP_3 = ((uint32_t)0x4) ,
NVIC_PRIORITY_GROUP_4 = ((uint32_t)0x3)
}
nvic interrupt priority group More...
enum | nvic_lowpower_mode_type { NVIC_LP_SLEEPONEXIT = 0x02 , NVIC_LP_SLEEPDEEP = 0x04 , NVIC_LP_SEVONPEND = 0x10 }
nvic low power mode More...
enum | systick_clock_source_type { SYSTICK_CLOCK_SOURCE_AHBCLK_DIV8 = ((uint32_t)0x00000000) , SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV = ((uint32_t)0x00000004) }
systick clock source More...

Detailed Description

Enumeration Type Documentation

◆ nvic_lowpower_mode_type

enum nvic_lowpower_mode_type

nvic low power mode

Enumerator
NVIC_LP_SLEEPONEXIT | send event on pending
NVIC_LP_SLEEPDEEP | enable sleep-deep output signal when entering sleep mode
NVIC_LP_SEVONPEND | enable sleep-on-exit feature

Definition at line 77 of file at32f415_misc.h.

◆ nvic_priority_group_type

enum nvic_priority_group_type

nvic interrupt priority group

Enumerator
NVIC_PRIORITY_GROUP_0 | 0 bits for preemption priority, 4 bits for subpriority
NVIC_PRIORITY_GROUP_1 | 1 bits for preemption priority, 3 bits for subpriority
NVIC_PRIORITY_GROUP_2 | 2 bits for preemption priority, 2 bits for subpriority
NVIC_PRIORITY_GROUP_3 | 3 bits for preemption priority, 1 bits for subpriority
NVIC_PRIORITY_GROUP_4 | 4 bits for preemption priority, 0 bits for subpriority

Definition at line 65 of file at32f415_misc.h.

◆ systick_clock_source_type

enum systick_clock_source_type

systick clock source

Enumerator
SYSTICK_CLOCK_SOURCE_AHBCLK_DIV8 | systick clock source from core clock div8
SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV | systick clock source from core clock

Definition at line 87 of file at32f415_misc.h.


AT32F415 Firmwary Library: MISC_exported_functions

Functions
MISC_exported_functions
AT32F415_periph_driver » MISC

Functions

void | nvic_system_reset (void)
system reset More...
void | nvic_irq_enable (uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq More...
void | nvic_irq_disable (uint32_t irqn)
disable nvic irq number More...
void | nvic_priority_group_config (nvic_priority_group_type priority_group)
config nvic priority group More...
void | nvic_vector_table_set (uint32_t base, uint32_t offset)
set the vector table location and offset. More...
void | nvic_lowpower_mode_config (nvic_lowpower_mode_type lp_mode, confirm_state new_state)
config nvic lowpower mode More...
void | systick_clock_source_config (systick_clock_source_type source)
config systick clock source More...

Detailed Description

Function Documentation

◆ nvic_irq_disable()

void nvic_irq_disable ( uint32_t irqn )

disable nvic irq number

Parameters
irqn (IRQn_Type number)
Return values
none

Definition at line 81 of file at32f415_misc.c.

Referenced by app_load(), and jump_to_app().

◆ nvic_irq_enable()

void nvic_irq_enable | ( | uint32_t | irqn,
 |  | uint32_t | preempt_priority,
 |  | uint32_t | sub_priority
 | ) |  |

enable nvic irq

Parameters
irqn | (IRQn_Type number)
preempt_priority | preemptive priority value (starting from 0)
sub_priority | subpriority value (starting from 0)
Return values
none

Definition at line 64 of file at32f415_misc.c.

Referenced by adc_config(), button_exint_init(), can_configuration(), cmp_exint_init(), codec_i2s_init(), config_flash_interrupt(), dma_config(), dma_configuration(), ertc_alarm_config(), ertc_tamper_config(), ertc_timestamp_config(), exint_line0_config(), exint_line4_config(), i2c_lowlevel_init(), i2s_config(), lick_frequency_get(), main(), nvic_configuration(), spi_config(), tmr1_config(), tmr1_init(), tmr2_config(), tmr_init(), uart_init(), usart1_config(), usart_configuration(), and wakeup_timer_config().

◆ nvic_lowpower_mode_config()

void nvic_lowpower_mode_config | ( | nvic_lowpower_mode_type | lp_mode,
 |  | confirm_state | new_state
 | ) |  |

config nvic lowpower mode

Parameters
lp_mode this parameter can be one of the following values:
  • NVIC_LP_SEVONPEND
  • NVIC_LP_SLEEPDEEP
  • NVIC_LP_SLEEPONEXIT
new_state (new state of lp condition. ENABLE or DISABLE)
Return values
none

Definition at line 127 of file at32f415_misc.c.

◆ nvic_priority_group_config()

void nvic_priority_group_config ( nvic_priority_group_type priority_group )

config nvic priority group

Parameters
priority_group this parameter can be one of the following values:
  • NVIC_PRIORITY_GROUP_0
  • NVIC_PRIORITY_GROUP_1
  • NVIC_PRIORITY_GROUP_2
  • NVIC_PRIORITY_GROUP_3
  • NVIC_PRIORITY_GROUP_4
Return values
none

Definition at line 97 of file at32f415_misc.c.

Referenced by button_exint_init(), cmp_exint_init(), config_flash_interrupt(), exint_line0_config(), main(), nvic_configuration(), and usart_configuration().

◆ nvic_system_reset()

void nvic_system_reset ( void )

system reset

Parameters
none
Return values
none

Definition at line 52 of file at32f415_misc.c.

Referenced by app_loop(), iap_command_handle(), and main().

◆ nvic_vector_table_set()

void nvic_vector_table_set | ( | uint32_t | base,
 |  | uint32_t | offset
 | ) |  |

set the vector table location and offset.

Parameters
base this parameter can be one of the following values:
  • NVIC_VECTTAB_RAM
  • NVIC_VECTTAB_FLASH
offset (vector table base offset field. this value must be a multiple of 0x200)
Return values
none

Definition at line 112 of file at32f415_misc.c.

Referenced by main().

◆ systick_clock_source_config()

void systick_clock_source_config ( systick_clock_source_type source )

config systick clock source

Parameters
source this parameter can be one of the following values:
  • SYSTICK_CLOCK_SOURCE_AHBCLK_DIV8
  • SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV
Return values
none

Definition at line 147 of file at32f415_misc.c.

Referenced by delay_init(), and main().


AT32F415 Firmwary Library: MISC_private_functions

Macros | Functions
MISC_private_functions
AT32F415_periph_driver » MISC

Macros

#define AIRCR_VECTKEY_MASK ((uint32_t)0x05FA0000)

Functions

void | nvic_system_reset (void)
system reset More...
void | nvic_irq_enable (uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq More...
void | nvic_irq_disable (uint32_t irqn)
disable nvic irq number More...
void | nvic_priority_group_config (nvic_priority_group_type priority_group)
config nvic priority group More...
void | nvic_vector_table_set (uint32_t base, uint32_t offset)
set the vector table location and offset. More...
void | nvic_lowpower_mode_config (nvic_lowpower_mode_type lp_mode, confirm_state new_state)
config nvic lowpower mode More...
void | systick_clock_source_config (systick_clock_source_type source)
config systick clock source More...

Detailed Description

Macro Definition Documentation

◆ AIRCR_VECTKEY_MASK

#define AIRCR_VECTKEY_MASK ((uint32_t)0x05FA0000)

Definition at line 45 of file at32f415_misc.c.

Function Documentation

◆ nvic_irq_disable()

void nvic_irq_disable ( uint32_t irqn )

disable nvic irq number

Parameters
irqn (IRQn_Type number)
Return values
none

Definition at line 81 of file at32f415_misc.c.

Referenced by app_load(), and jump_to_app().

◆ nvic_irq_enable()

void nvic_irq_enable | ( | uint32_t | irqn,
 |  | uint32_t | preempt_priority,
 |  | uint32_t | sub_priority
 | ) |  |

enable nvic irq

Parameters
irqn | (IRQn_Type number)
preempt_priority | preemptive priority value (starting from 0)
sub_priority | subpriority value (starting from 0)
Return values
none

Definition at line 64 of file at32f415_misc.c.

Referenced by adc_config(), button_exint_init(), can_configuration(), cmp_exint_init(), codec_i2s_init(), config_flash_interrupt(), dma_config(), dma_configuration(), ertc_alarm_config(), ertc_tamper_config(), ertc_timestamp_config(), exint_line0_config(), exint_line4_config(), i2c_lowlevel_init(), i2s_config(), lick_frequency_get(), main(), nvic_configuration(), spi_config(), tmr1_config(), tmr1_init(), tmr2_config(), tmr_init(), uart_init(), usart1_config(), usart_configuration(), and wakeup_timer_config().

◆ nvic_lowpower_mode_config()

void nvic_lowpower_mode_config | ( | nvic_lowpower_mode_type | lp_mode,
 |  | confirm_state | new_state
 | ) |  |

config nvic lowpower mode

Parameters
lp_mode this parameter can be one of the following values:
  • NVIC_LP_SEVONPEND
  • NVIC_LP_SLEEPDEEP
  • NVIC_LP_SLEEPONEXIT
new_state (new state of lp condition. ENABLE or DISABLE)
Return values
none

Definition at line 127 of file at32f415_misc.c.

◆ nvic_priority_group_config()

void nvic_priority_group_config ( nvic_priority_group_type priority_group )

config nvic priority group

Parameters
priority_group this parameter can be one of the following values:
  • NVIC_PRIORITY_GROUP_0
  • NVIC_PRIORITY_GROUP_1
  • NVIC_PRIORITY_GROUP_2
  • NVIC_PRIORITY_GROUP_3
  • NVIC_PRIORITY_GROUP_4
Return values
none

Definition at line 97 of file at32f415_misc.c.

Referenced by button_exint_init(), cmp_exint_init(), config_flash_interrupt(), exint_line0_config(), main(), nvic_configuration(), and usart_configuration().

◆ nvic_system_reset()

void nvic_system_reset ( void )

system reset

Parameters
none
Return values
none

Definition at line 52 of file at32f415_misc.c.

Referenced by app_loop(), iap_command_handle(), and main().

◆ nvic_vector_table_set()

void nvic_vector_table_set | ( | uint32_t | base,
 |  | uint32_t | offset
 | ) |  |

set the vector table location and offset.

Parameters
base this parameter can be one of the following values:
  • NVIC_VECTTAB_RAM
  • NVIC_VECTTAB_FLASH
offset (vector table base offset field. this value must be a multiple of 0x200)
Return values
none

Definition at line 112 of file at32f415_misc.c.

Referenced by main().

◆ systick_clock_source_config()

void systick_clock_source_config ( systick_clock_source_type source )

config systick clock source

Parameters
source this parameter can be one of the following values:
  • SYSTICK_CLOCK_SOURCE_AHBCLK_DIV8
  • SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV
Return values
none

Definition at line 147 of file at32f415_misc.c.

Referenced by delay_init(), and main().


AT32F415 Firmwary Library: PWC

Modules | Macros
PWC
AT32F415_periph_driver

PWC driver modules. More...

Modules

PWC_flags_definition
pwc flag

PWC_exported_types
PWC_exported_functions
PWC_private_functions

Macros

#define | PWC_WAKEUP_PIN_1 ((uint32_t)0x00000100)
pwc wakeup pin num definition More...
#define | PWC ((pwc_type *) PWC_BASE)

Detailed Description

PWC driver modules.

Macro Definition Documentation

◆ PWC

#define PWC ((pwc_type *) PWC_BASE)

Definition at line 157 of file at32f415_pwc.h.

◆ PWC_WAKEUP_PIN_1

#define PWC_WAKEUP_PIN_1 ((uint32_t)0x00000100)

pwc wakeup pin num definition

standby wake-up pin1

Definition at line 63 of file at32f415_pwc.h.


AT32F415 Firmwary Library: PWC_flags_definition

Macros
PWC_flags_definition
AT32F415_periph_driver » PWC

pwc flag
More...

Macros

#define | PWC_WAKEUP_FLAG ((uint32_t)0x00000001)
#define | PWC_STANDBY_FLAG ((uint32_t)0x00000002)
#define | PWC_PVM_OUTPUT_FLAG ((uint32_t)0x00000004)

Detailed Description

pwc flag

Macro Definition Documentation

◆ PWC_PVM_OUTPUT_FLAG

#define PWC_PVM_OUTPUT_FLAG ((uint32_t)0x00000004)

pvm output flag

Definition at line 54 of file at32f415_pwc.h.

◆ PWC_STANDBY_FLAG

#define PWC_STANDBY_FLAG ((uint32_t)0x00000002)

standby flag

Definition at line 53 of file at32f415_pwc.h.

◆ PWC_WAKEUP_FLAG

#define PWC_WAKEUP_FLAG ((uint32_t)0x00000001)

wakeup flag

Definition at line 52 of file at32f415_pwc.h.


AT32F415 Firmwary Library: PWC_exported_types

Data Structures | Enumerations
PWC_exported_types
AT32F415_periph_driver » PWC

Data Structures

struct pwc_type
type define pwc register all More...

Enumerations

enum pwc_pvm_voltage_type {
PWC_PVM_VOLTAGE_2V3 = 0x01 , PWC_PVM_VOLTAGE_2V4 = 0x02 , PWC_PVM_VOLTAGE_2V5 = 0x03 , PWC_PVM_VOLTAGE_2V6 = 0x04 ,
PWC_PVM_VOLTAGE_2V7 = 0x05 , PWC_PVM_VOLTAGE_2V8 = 0x06 , PWC_PVM_VOLTAGE_2V9 = 0x07
}
pwc pvm voltage type More...
enum | pwc_sleep_enter_type { PWC_SLEEP_ENTER_WFI = 0x00 , PWC_SLEEP_ENTER_WFE = 0x01 }
pwc sleep enter type More...
enum | pwc_deep_sleep_enter_type { PWC_DEEP_SLEEP_ENTER_WFI = 0x00 , PWC_DEEP_SLEEP_ENTER_WFE = 0x01 }
pwc deep sleep enter type More...
enum | pwc_regulator_type { PWC_REGULATOR_ON = 0x00 , PWC_REGULATOR_LOW_POWER = 0x01 }
pwc regulator type More...

Detailed Description

Enumeration Type Documentation

◆ pwc_deep_sleep_enter_type

enum pwc_deep_sleep_enter_type

pwc deep sleep enter type

Enumerator
PWC_DEEP_SLEEP_ENTER_WFI | use wfi enter deepsleep mode
PWC_DEEP_SLEEP_ENTER_WFE | use wfe enter deepsleep mode

Definition at line 95 of file at32f415_pwc.h.

◆ pwc_pvm_voltage_type

enum pwc_pvm_voltage_type

pwc pvm voltage type

Enumerator
PWC_PVM_VOLTAGE_2V3 | power voltage monitoring boundary 2.3v
PWC_PVM_VOLTAGE_2V4 | power voltage monitoring boundary 2.4v
PWC_PVM_VOLTAGE_2V5 | power voltage monitoring boundary 2.5v
PWC_PVM_VOLTAGE_2V6 | power voltage monitoring boundary 2.6v
PWC_PVM_VOLTAGE_2V7 | power voltage monitoring boundary 2.7v
PWC_PVM_VOLTAGE_2V8 | power voltage monitoring boundary 2.8v
PWC_PVM_VOLTAGE_2V9 | power voltage monitoring boundary 2.9v

Definition at line 72 of file at32f415_pwc.h.

◆ pwc_regulator_type

enum pwc_regulator_type

pwc regulator type

Enumerator
PWC_REGULATOR_ON | voltage regulator state on when deepsleep mode
PWC_REGULATOR_LOW_POWER | voltage regulator state low power when deepsleep mode

Definition at line 104 of file at32f415_pwc.h.

◆ pwc_sleep_enter_type

enum pwc_sleep_enter_type

pwc sleep enter type

Enumerator
PWC_SLEEP_ENTER_WFI | use wfi enter sleep mode
PWC_SLEEP_ENTER_WFE | use wfe enter sleep mode

Definition at line 86 of file at32f415_pwc.h.


AT32F415 Firmwary Library: pwc_type Struct Reference

Data Fields
pwc_type Struct Reference
AT32F415_periph_driver » PWC » PWC_exported_types

type define pwc register all More...

#include <at32f415_pwc.h>

Data Fields

union {
__IO uint32_t ctrl
struct {
__IO uint32_t vrsel: 1
__IO uint32_t lpsel: 1
__IO uint32_t clswef: 1
__IO uint32_t clsef: 1
__IO uint32_t pvmen: 1
__IO uint32_t pvmsel: 3
__IO uint32_t bpwen: 1
__IO uint32_t reserved1: 23
} ctrl_bit
};
pwc ctrl register, offset:0x00 More...
union {
__IO uint32_t ctrlsts
struct {
__IO uint32_t swef: 1
__IO uint32_t sef: 1
__IO uint32_t pvmof: 1
__IO uint32_t reserved1: 5
__IO uint32_t swpen: 1
__IO uint32_t reserved2: 23
} ctrlsts_bit
};
pwc ctrlsts register, offset:0x04 More...

Detailed Description

type define pwc register all

Definition at line 113 of file at32f415_pwc.h.

Field Documentation

◆

union { ... } pwc_type::@506

pwc ctrl register, offset:0x00

◆

union { ... } pwc_type::@508

pwc ctrlsts register, offset:0x04

◆ bpwen

__IO uint32_t pwc_type::bpwen

Definition at line 129 of file at32f415_pwc.h.

◆ clsef

__IO uint32_t pwc_type::clsef

Definition at line 126 of file at32f415_pwc.h.

◆ clswef

__IO uint32_t pwc_type::clswef

Definition at line 125 of file at32f415_pwc.h.

◆ ctrl

__IO uint32_t pwc_type::ctrl

Definition at line 120 of file at32f415_pwc.h.

◆

struct { ... } pwc_type::ctrl_bit

◆ ctrlsts

__IO uint32_t pwc_type::ctrlsts

Definition at line 139 of file at32f415_pwc.h.

◆

struct { ... } pwc_type::ctrlsts_bit

◆ lpsel

__IO uint32_t pwc_type::lpsel

Definition at line 124 of file at32f415_pwc.h.

◆ pvmen

__IO uint32_t pwc_type::pvmen

Definition at line 127 of file at32f415_pwc.h.

◆ pvmof

__IO uint32_t pwc_type::pvmof

Definition at line 144 of file at32f415_pwc.h.

◆ pvmsel

__IO uint32_t pwc_type::pvmsel

Definition at line 128 of file at32f415_pwc.h.

◆ reserved1

__IO uint32_t pwc_type::reserved1

Definition at line 130 of file at32f415_pwc.h.

◆ reserved2

__IO uint32_t pwc_type::reserved2

Definition at line 147 of file at32f415_pwc.h.

◆ sef

__IO uint32_t pwc_type::sef

Definition at line 143 of file at32f415_pwc.h.

◆ swef

__IO uint32_t pwc_type::swef

Definition at line 142 of file at32f415_pwc.h.

◆ swpen

__IO uint32_t pwc_type::swpen

Definition at line 146 of file at32f415_pwc.h.

◆ vrsel

__IO uint32_t pwc_type::vrsel

Definition at line 123 of file at32f415_pwc.h.

The documentation for this struct was generated from the following file:
  • at32f415_pwc.h


AT32F415 Firmwary Library: PWC_exported_functions

Functions
PWC_exported_functions
AT32F415_periph_driver » PWC

Functions

void | pwc_reset (void)
deinitialize the pwc peripheral registers to their default reset values. More...
void | pwc_battery_powered_domain_access (confirm_state new_state)
enable or disable access to the battery powered domain. More...
void | pwc_pvm_level_select (pwc_pvm_voltage_type pvm_voltage)
select the voltage threshold detected by the power voltage detector. More...
void | pwc_power_voltage_monitor_enable (confirm_state new_state)
enable or disable pwc power voltage monitor (pvm)
More...
void | pwc_wakeup_pin_enable (uint32_t pin_num, confirm_state new_state)
enable or disable pwc standby wakeup pin
More...
void | pwc_flag_clear (uint32_t pwc_flag)
clear flag of pwc More...
flag_status | pwc_flag_get (uint32_t pwc_flag)
get flag of pwc More...
void | pwc_sleep_mode_enter (pwc_sleep_enter_type pwc_sleep_enter)
enter pwc sleep mode
More...
void | pwc_deep_sleep_mode_enter (pwc_deep_sleep_enter_type pwc_deep_sleep_enter)
enter pwc deep-sleep mode
More...
void | pwc_voltage_regulate_set (pwc_regulator_type pwc_regulator)
regulate low power consumption in the deep sleep mode More...
void | pwc_standby_mode_enter (void)
enter pwc standby mode
More...

Detailed Description

Function Documentation

◆ pwc_battery_powered_domain_access()

void pwc_battery_powered_domain_access ( confirm_state new_state )

enable or disable access to the battery powered domain.

Parameters
new_state new state of battery powered domain access. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 61 of file at32f415_pwc.c.

Referenced by ertc_config(), and main().

◆ pwc_deep_sleep_mode_enter()

void pwc_deep_sleep_mode_enter ( pwc_deep_sleep_enter_type pwc_deep_sleep_enter )

enter pwc deep-sleep mode

Parameters
pwc_deep_sleep_enter choose the instruction to enter deep sleep mode. this parameter can be one of the following values:
  • PWC_DEEP_SLEEP_ENTER_WFI
  • PWC_DEEP_SLEEP_ENTER_WFE
Return values
none

Definition at line 189 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_flag_clear()

void pwc_flag_clear ( uint32_t pwc_flag )

clear flag of pwc

Parameters
pwc_flag select the pwc flag. this parameter can be any combination of the following values:
  • PWC_WAKEUP_FLAG
  • PWC_STANDBY_FLAG
  • note:"PWC_PVM_OUTPUT_FLAG" cannot be choose!this bit is readonly bit,it means the voltage monitoring output state
Return values
none

< standby flag

< wakeup flag

Definition at line 127 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_flag_get()

flag_status pwc_flag_get ( uint32_t pwc_flag )

get flag of pwc

Parameters
pwc_flag select the pwc flag. this parameter can be one of the following values:
  • PWC_WAKEUP_FLAG
  • PWC_STANDBY_FLAG
  • PWC_PVM_OUTPUT_FLAG
Return values
state of select flag(SET or RESET).

Definition at line 144 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_power_voltage_monitor_enable()

void pwc_power_voltage_monitor_enable ( confirm_state new_state )

enable or disable pwc power voltage monitor (pvm)

Parameters
new_state new state of pvm. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 90 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_pvm_level_select()

void pwc_pvm_level_select ( pwc_pvm_voltage_type pvm_voltage )

select the voltage threshold detected by the power voltage detector.

Parameters
pvm_voltage select pwc pvm voltage this parameter can be one of the following values:
  • PWC_PVM_VOLTAGE_2V3
  • PWC_PVM_VOLTAGE_2V4
  • PWC_PVM_VOLTAGE_2V5
  • PWC_PVM_VOLTAGE_2V6
  • PWC_PVM_VOLTAGE_2V7
  • PWC_PVM_VOLTAGE_2V8
  • PWC_PVM_VOLTAGE_2V9
Return values
none

Definition at line 79 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_reset()

void pwc_reset ( void )

deinitialize the pwc peripheral registers to their default reset values.

Parameters
none
Return values
none

Definition at line 49 of file at32f415_pwc.c.

◆ pwc_sleep_mode_enter()

void pwc_sleep_mode_enter ( pwc_sleep_enter_type pwc_sleep_enter )

enter pwc sleep mode

Parameters
sleep_mode_enter choose the instruction to enter sleep mode. this parameter can be one of the following values:
  • PWC_SLEEP_ENTER_WFI
  • PWC_SLEEP_ENTER_WFE
Return values
none

Definition at line 166 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_standby_mode_enter()

void pwc_standby_mode_enter ( void )

enter pwc standby mode

Parameters
none
Return values
none

Definition at line 223 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_voltage_regulate_set()

void pwc_voltage_regulate_set ( pwc_regulator_type pwc_regulator )

regulate low power consumption in the deep sleep mode

Parameters
pwc_regulator set the regulator state. this parameter can be one of the following values:
  • PWC_REGULATOR_ON
  • PWC_REGULATOR_LOW_POWER
Return values
none

Definition at line 213 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_wakeup_pin_enable()

void pwc_wakeup_pin_enable | ( | uint32_t | pin_num,
 |  | confirm_state | new_state
 | ) |  |

enable or disable pwc standby wakeup pin

Parameters
pin_num choose the wakeup pin. this parameter can be be any combination of the following values:
  • PWC_WAKEUP_PIN_1
new_state new state of the standby wakeup pin. this parameter can be one of the following values:
  • TRUE <wakeup pin is used for wake up cpu from standby mode>
  • FALSE <wakeup pin is used for general purpose I/O>
Return values
none

Definition at line 106 of file at32f415_pwc.c.

Referenced by main().


AT32F415 Firmwary Library: PWC_private_functions

Functions
PWC_private_functions
AT32F415_periph_driver » PWC

Functions

void | pwc_reset (void)
deinitialize the pwc peripheral registers to their default reset values. More...
void | pwc_battery_powered_domain_access (confirm_state new_state)
enable or disable access to the battery powered domain. More...
void | pwc_pvm_level_select (pwc_pvm_voltage_type pvm_voltage)
select the voltage threshold detected by the power voltage detector. More...
void | pwc_power_voltage_monitor_enable (confirm_state new_state)
enable or disable pwc power voltage monitor (pvm)
More...
void | pwc_wakeup_pin_enable (uint32_t pin_num, confirm_state new_state)
enable or disable pwc standby wakeup pin
More...
void | pwc_flag_clear (uint32_t pwc_flag)
clear flag of pwc More...
flag_status | pwc_flag_get (uint32_t pwc_flag)
get flag of pwc More...
void | pwc_sleep_mode_enter (pwc_sleep_enter_type pwc_sleep_enter)
enter pwc sleep mode
More...
void | pwc_deep_sleep_mode_enter (pwc_deep_sleep_enter_type pwc_deep_sleep_enter)
enter pwc deep-sleep mode
More...
void | pwc_voltage_regulate_set (pwc_regulator_type pwc_regulator)
regulate low power consumption in the deep sleep mode More...
void | pwc_standby_mode_enter (void)
enter pwc standby mode
More...

Detailed Description

Function Documentation

◆ pwc_battery_powered_domain_access()

void pwc_battery_powered_domain_access ( confirm_state new_state )

enable or disable access to the battery powered domain.

Parameters
new_state new state of battery powered domain access. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 61 of file at32f415_pwc.c.

Referenced by ertc_config(), and main().

◆ pwc_deep_sleep_mode_enter()

void pwc_deep_sleep_mode_enter ( pwc_deep_sleep_enter_type pwc_deep_sleep_enter )

enter pwc deep-sleep mode

Parameters
pwc_deep_sleep_enter choose the instruction to enter deep sleep mode. this parameter can be one of the following values:
  • PWC_DEEP_SLEEP_ENTER_WFI
  • PWC_DEEP_SLEEP_ENTER_WFE
Return values
none

Definition at line 189 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_flag_clear()

void pwc_flag_clear ( uint32_t pwc_flag )

clear flag of pwc

Parameters
pwc_flag select the pwc flag. this parameter can be any combination of the following values:
  • PWC_WAKEUP_FLAG
  • PWC_STANDBY_FLAG
  • note:"PWC_PVM_OUTPUT_FLAG" cannot be choose!this bit is readonly bit,it means the voltage monitoring output state
Return values
none

< standby flag

< wakeup flag

Definition at line 127 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_flag_get()

flag_status pwc_flag_get ( uint32_t pwc_flag )

get flag of pwc

Parameters
pwc_flag select the pwc flag. this parameter can be one of the following values:
  • PWC_WAKEUP_FLAG
  • PWC_STANDBY_FLAG
  • PWC_PVM_OUTPUT_FLAG
Return values
state of select flag(SET or RESET).

Definition at line 144 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_power_voltage_monitor_enable()

void pwc_power_voltage_monitor_enable ( confirm_state new_state )

enable or disable pwc power voltage monitor (pvm)

Parameters
new_state new state of pvm. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 90 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_pvm_level_select()

void pwc_pvm_level_select ( pwc_pvm_voltage_type pvm_voltage )

select the voltage threshold detected by the power voltage detector.

Parameters
pvm_voltage select pwc pvm voltage this parameter can be one of the following values:
  • PWC_PVM_VOLTAGE_2V3
  • PWC_PVM_VOLTAGE_2V4
  • PWC_PVM_VOLTAGE_2V5
  • PWC_PVM_VOLTAGE_2V6
  • PWC_PVM_VOLTAGE_2V7
  • PWC_PVM_VOLTAGE_2V8
  • PWC_PVM_VOLTAGE_2V9
Return values
none

Definition at line 79 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_reset()

void pwc_reset ( void )

deinitialize the pwc peripheral registers to their default reset values.

Parameters
none
Return values
none

Definition at line 49 of file at32f415_pwc.c.

◆ pwc_sleep_mode_enter()

void pwc_sleep_mode_enter ( pwc_sleep_enter_type pwc_sleep_enter )

enter pwc sleep mode

Parameters
sleep_mode_enter choose the instruction to enter sleep mode. this parameter can be one of the following values:
  • PWC_SLEEP_ENTER_WFI
  • PWC_SLEEP_ENTER_WFE
Return values
none

Definition at line 166 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_standby_mode_enter()

void pwc_standby_mode_enter ( void )

enter pwc standby mode

Parameters
none
Return values
none

Definition at line 223 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_voltage_regulate_set()

void pwc_voltage_regulate_set ( pwc_regulator_type pwc_regulator )

regulate low power consumption in the deep sleep mode

Parameters
pwc_regulator set the regulator state. this parameter can be one of the following values:
  • PWC_REGULATOR_ON
  • PWC_REGULATOR_LOW_POWER
Return values
none

Definition at line 213 of file at32f415_pwc.c.

Referenced by main().

◆ pwc_wakeup_pin_enable()

void pwc_wakeup_pin_enable | ( | uint32_t | pin_num,
 |  | confirm_state | new_state
 | ) |  |

enable or disable pwc standby wakeup pin

Parameters
pin_num choose the wakeup pin. this parameter can be be any combination of the following values:
  • PWC_WAKEUP_PIN_1
new_state new state of the standby wakeup pin. this parameter can be one of the following values:
  • TRUE <wakeup pin is used for wake up cpu from standby mode>
  • FALSE <wakeup pin is used for general purpose I/O>
Return values
none

Definition at line 106 of file at32f415_pwc.c.

Referenced by main().


AT32F415 Firmwary Library: SDIO

Modules | Macros
SDIO
AT32F415_periph_driver

SDIO driver modules. More...

Modules

SDIO_interrupts_definition
sdio interrupt

SDIO_flags_definition
sdio flag
SDIO_exported_types
SDIO_exported_functions
SDIO_private_functions

Macros

#define SDIO1 ((sdio_type *) SDIO1_BASE)

Detailed Description

SDIO driver modules.

Macro Definition Documentation

◆ SDIO1

#define SDIO1 ((sdio_type *) SDIO1_BASE)

Definition at line 572 of file at32f415_sdio.h.


AT32F415 Firmwary Library: SDIO_interrupts_definition

Macros
SDIO_interrupts_definition
AT32F415_periph_driver » SDIO

sdio interrupt
More...

Macros

#define | SDIO_CMDFAIL_INT ((uint32_t)0x00000001)
#define | SDIO_DTFAIL_INT ((uint32_t)0x00000002)
#define | SDIO_CMDTIMEOUT_INT ((uint32_t)0x00000004)
#define | SDIO_DTTIMEOUT_INT ((uint32_t)0x00000008)
#define | SDIO_TXERRU_INT ((uint32_t)0x00000010)
#define | SDIO_RXERRO_INT ((uint32_t)0x00000020)
#define | SDIO_CMDRSPCMPL_INT ((uint32_t)0x00000040)
#define | SDIO_CMDCMPL_INT ((uint32_t)0x00000080)
#define | SDIO_DTCMP_INT ((uint32_t)0x00000100)
#define | SDIO_SBITERR_INT ((uint32_t)0x00000200)
#define | SDIO_DTBLKCMPL_INT ((uint32_t)0x00000400)
#define | SDIO_DOCMD_INT ((uint32_t)0x00000800)
#define | SDIO_DOTX_INT ((uint32_t)0x00001000)
#define | SDIO_DORX_INT ((uint32_t)0x00002000)
#define | SDIO_TXBUFH_INT ((uint32_t)0x00004000)
#define | SDIO_RXBUFH_INT ((uint32_t)0x00008000)
#define | SDIO_TXBUFF_INT ((uint32_t)0x00010000)
#define | SDIO_RXBUFF_INT ((uint32_t)0x00020000)
#define | SDIO_TXBUFE_INT ((uint32_t)0x00040000)
#define | SDIO_RXBUFE_INT ((uint32_t)0x00080000)
#define | SDIO_TXBUF_INT ((uint32_t)0x00100000)
#define | SDIO_RXBUF_INT ((uint32_t)0x00200000)
#define | SDIO_SDIOIF_INT ((uint32_t)0x00400000)

Detailed Description

sdio interrupt

Macro Definition Documentation

◆ SDIO_CMDCMPL_INT

#define SDIO_CMDCMPL_INT ((uint32_t)0x00000080)

command sent interrupt

Definition at line 59 of file at32f415_sdio.h.

◆ SDIO_CMDFAIL_INT

#define SDIO_CMDFAIL_INT ((uint32_t)0x00000001)

command response received check failed interrupt

Definition at line 52 of file at32f415_sdio.h.

◆ SDIO_CMDRSPCMPL_INT

#define SDIO_CMDRSPCMPL_INT ((uint32_t)0x00000040)

command response received interrupt

Definition at line 58 of file at32f415_sdio.h.

◆ SDIO_CMDTIMEOUT_INT

#define SDIO_CMDTIMEOUT_INT ((uint32_t)0x00000004)

command response timerout interrupt

Definition at line 54 of file at32f415_sdio.h.

◆ SDIO_DOCMD_INT

#define SDIO_DOCMD_INT ((uint32_t)0x00000800)

command transfer in progress interrupt

Definition at line 63 of file at32f415_sdio.h.

◆ SDIO_DORX_INT

#define SDIO_DORX_INT ((uint32_t)0x00002000)

data receive in progress interrupt

Definition at line 65 of file at32f415_sdio.h.

◆ SDIO_DOTX_INT

#define SDIO_DOTX_INT ((uint32_t)0x00001000)

data transmit in progress interrupt

Definition at line 64 of file at32f415_sdio.h.

◆ SDIO_DTBLKCMPL_INT

#define SDIO_DTBLKCMPL_INT ((uint32_t)0x00000400)

data block sent/received interrupt

Definition at line 62 of file at32f415_sdio.h.

◆ SDIO_DTCMP_INT

#define SDIO_DTCMP_INT ((uint32_t)0x00000100)

data sent interrupt

Definition at line 60 of file at32f415_sdio.h.

◆ SDIO_DTFAIL_INT

#define SDIO_DTFAIL_INT ((uint32_t)0x00000002)

data block sent/received check failed interrupt

Definition at line 53 of file at32f415_sdio.h.

◆ SDIO_DTTIMEOUT_INT

#define SDIO_DTTIMEOUT_INT ((uint32_t)0x00000008)

data timeout interrupt

Definition at line 55 of file at32f415_sdio.h.

◆ SDIO_RXBUF_INT

#define SDIO_RXBUF_INT ((uint32_t)0x00200000)

data available in receive interrupt

Definition at line 73 of file at32f415_sdio.h.

◆ SDIO_RXBUFE_INT

#define SDIO_RXBUFE_INT ((uint32_t)0x00080000)

receive buf empty interrupt

Definition at line 71 of file at32f415_sdio.h.

◆ SDIO_RXBUFF_INT

#define SDIO_RXBUFF_INT ((uint32_t)0x00020000)

receive buf full interrupt

Definition at line 69 of file at32f415_sdio.h.

◆ SDIO_RXBUFH_INT

#define SDIO_RXBUFH_INT ((uint32_t)0x00008000)

receive buf half full interrupt

Definition at line 67 of file at32f415_sdio.h.

◆ SDIO_RXERRO_INT

#define SDIO_RXERRO_INT ((uint32_t)0x00000020)

received overrun error interrupt

Definition at line 57 of file at32f415_sdio.h.

◆ SDIO_SBITERR_INT

#define SDIO_SBITERR_INT ((uint32_t)0x00000200)

start bit not detected on data bus interrupt

Definition at line 61 of file at32f415_sdio.h.

◆ SDIO_SDIOIF_INT

#define SDIO_SDIOIF_INT ((uint32_t)0x00400000)

sdio interface received interrupt

Definition at line 74 of file at32f415_sdio.h.

◆ SDIO_TXBUF_INT

#define SDIO_TXBUF_INT ((uint32_t)0x00100000)

data available in transmit interrupt

Definition at line 72 of file at32f415_sdio.h.

◆ SDIO_TXBUFE_INT

#define SDIO_TXBUFE_INT ((uint32_t)0x00040000)

transmit buf empty interrupt

Definition at line 70 of file at32f415_sdio.h.

◆ SDIO_TXBUFF_INT

#define SDIO_TXBUFF_INT ((uint32_t)0x00010000)

transmit buf full interrupt

Definition at line 68 of file at32f415_sdio.h.

◆ SDIO_TXBUFH_INT

#define SDIO_TXBUFH_INT ((uint32_t)0x00004000)

transmit buf half empty interrupt

Definition at line 66 of file at32f415_sdio.h.

◆ SDIO_TXERRU_INT

#define SDIO_TXERRU_INT ((uint32_t)0x00000010)

transmit underrun error interrupt

Definition at line 56 of file at32f415_sdio.h.


AT32F415 Firmwary Library: SDIO_flags_definition

Macros
SDIO_flags_definition
AT32F415_periph_driver » SDIO

sdio flag More...

Macros

#define | SDIO_CMDFAIL_FLAG ((uint32_t)0x00000001)
#define | SDIO_DTFAIL_FLAG ((uint32_t)0x00000002)
#define | SDIO_CMDTIMEOUT_FLAG ((uint32_t)0x00000004)
#define | SDIO_DTTIMEOUT_FLAG ((uint32_t)0x00000008)
#define | SDIO_TXERRU_FLAG ((uint32_t)0x00000010)
#define | SDIO_RXERRO_FLAG ((uint32_t)0x00000020)
#define | SDIO_CMDRSPCMPL_FLAG ((uint32_t)0x00000040)
#define | SDIO_CMDCMPL_FLAG ((uint32_t)0x00000080)
#define | SDIO_DTCMPL_FLAG ((uint32_t)0x00000100)
#define | SDIO_SBITERR_FLAG ((uint32_t)0x00000200)
#define | SDIO_DTBLKCMPL_FLAG ((uint32_t)0x00000400)
#define | SDIO_DOCMD_FLAG ((uint32_t)0x00000800)
#define | SDIO_DOTX_FLAG ((uint32_t)0x00001000)
#define | SDIO_DORX_FLAG ((uint32_t)0x00002000)
#define | SDIO_TXBUFH_FLAG ((uint32_t)0x00004000)
#define | SDIO_RXBUFH_FLAG ((uint32_t)0x00008000)
#define | SDIO_TXBUFF_FLAG ((uint32_t)0x00010000)
#define | SDIO_RXBUFF_FLAG ((uint32_t)0x00020000)
#define | SDIO_TXBUFE_FLAG ((uint32_t)0x00040000)
#define | SDIO_RXBUFE_FLAG ((uint32_t)0x00080000)
#define | SDIO_TXBUF_FLAG ((uint32_t)0x00100000)
#define | SDIO_RXBUF_FLAG ((uint32_t)0x00200000)
#define | SDIO_SDIOIF_FLAG ((uint32_t)0x00400000)

Detailed Description

sdio flag

Macro Definition Documentation

◆ SDIO_CMDCMPL_FLAG

#define SDIO_CMDCMPL_FLAG ((uint32_t)0x00000080)

command sent flag

Definition at line 92 of file at32f415_sdio.h.

◆ SDIO_CMDFAIL_FLAG

#define SDIO_CMDFAIL_FLAG ((uint32_t)0x00000001)

command response received check failed flag

Definition at line 85 of file at32f415_sdio.h.

◆ SDIO_CMDRSPCMPL_FLAG

#define SDIO_CMDRSPCMPL_FLAG ((uint32_t)0x00000040)

command response received flag

Definition at line 91 of file at32f415_sdio.h.

◆ SDIO_CMDTIMEOUT_FLAG

#define SDIO_CMDTIMEOUT_FLAG ((uint32_t)0x00000004)

command response timerout flag

Definition at line 87 of file at32f415_sdio.h.

◆ SDIO_DOCMD_FLAG

#define SDIO_DOCMD_FLAG ((uint32_t)0x00000800)

command transfer in progress flag

Definition at line 96 of file at32f415_sdio.h.

◆ SDIO_DORX_FLAG

#define SDIO_DORX_FLAG ((uint32_t)0x00002000)

data receive in progress flag

Definition at line 98 of file at32f415_sdio.h.

◆ SDIO_DOTX_FLAG

#define SDIO_DOTX_FLAG ((uint32_t)0x00001000)

data transmit in progress flag

Definition at line 97 of file at32f415_sdio.h.

◆ SDIO_DTBLKCMPL_FLAG

#define SDIO_DTBLKCMPL_FLAG ((uint32_t)0x00000400)

data block sent/received flag

Definition at line 95 of file at32f415_sdio.h.

◆ SDIO_DTCMPL_FLAG

#define SDIO_DTCMPL_FLAG ((uint32_t)0x00000100)

data sent flag

Definition at line 93 of file at32f415_sdio.h.

◆ SDIO_DTFAIL_FLAG

#define SDIO_DTFAIL_FLAG ((uint32_t)0x00000002)

data block sent/received check failed flag

Definition at line 86 of file at32f415_sdio.h.

◆ SDIO_DTTIMEOUT_FLAG

#define SDIO_DTTIMEOUT_FLAG ((uint32_t)0x00000008)

data timeout flag

Definition at line 88 of file at32f415_sdio.h.

◆ SDIO_RXBUF_FLAG

#define SDIO_RXBUF_FLAG ((uint32_t)0x00200000)

data available in receive flag

Definition at line 106 of file at32f415_sdio.h.

◆ SDIO_RXBUFE_FLAG

#define SDIO_RXBUFE_FLAG ((uint32_t)0x00080000)

receive buf empty flag

Definition at line 104 of file at32f415_sdio.h.

◆ SDIO_RXBUFF_FLAG

#define SDIO_RXBUFF_FLAG ((uint32_t)0x00020000)

receive buf full flag

Definition at line 102 of file at32f415_sdio.h.

◆ SDIO_RXBUFH_FLAG

#define SDIO_RXBUFH_FLAG ((uint32_t)0x00008000)

receive buf half full flag

Definition at line 100 of file at32f415_sdio.h.

◆ SDIO_RXERRO_FLAG

#define SDIO_RXERRO_FLAG ((uint32_t)0x00000020)

received overrun error flag

Definition at line 90 of file at32f415_sdio.h.

◆ SDIO_SBITERR_FLAG

#define SDIO_SBITERR_FLAG ((uint32_t)0x00000200)

start bit not detected on data bus flag

Definition at line 94 of file at32f415_sdio.h.

◆ SDIO_SDIOIF_FLAG

#define SDIO_SDIOIF_FLAG ((uint32_t)0x00400000)

sdio interface received flag

Definition at line 107 of file at32f415_sdio.h.

◆ SDIO_TXBUF_FLAG

#define SDIO_TXBUF_FLAG ((uint32_t)0x00100000)

data available in transmit flag

Definition at line 105 of file at32f415_sdio.h.

◆ SDIO_TXBUFE_FLAG

#define SDIO_TXBUFE_FLAG ((uint32_t)0x00040000)

transmit buf empty flag

Definition at line 103 of file at32f415_sdio.h.

◆ SDIO_TXBUFF_FLAG

#define SDIO_TXBUFF_FLAG ((uint32_t)0x00010000)

transmit buf full flag

Definition at line 101 of file at32f415_sdio.h.

◆ SDIO_TXBUFH_FLAG

#define SDIO_TXBUFH_FLAG ((uint32_t)0x00004000)

transmit buf half empty flag

Definition at line 99 of file at32f415_sdio.h.

◆ SDIO_TXERRU_FLAG

#define SDIO_TXERRU_FLAG ((uint32_t)0x00000010)

transmit underrun error flag

Definition at line 89 of file at32f415_sdio.h.


AT32F415 Firmwary Library: SDIO_exported_types

Data Structures | Enumerations
SDIO_exported_types
AT32F415_periph_driver » SDIO

Data Structures

struct | sdio_command_struct_type
sdio command structure More...
struct | sdio_data_struct_type
sdio data structure More...
struct | sdio_type
type define sdio register all More...

Enumerations

enum | sdio_power_state_type { SDIO_POWER_OFF = 0x00 , SDIO_POWER_ON = 0x03 }
sdio power state More...
enum | sdio_edge_phase_type { SDIO_CLOCK_EDGE_RISING = 0x00 , SDIO_CLOCK_EDGE_FALLING = 0x01 }
sdio edge phase More...
enum | sdio_bus_width_type { SDIO_BUS_WIDTH_D1 = 0x00 , SDIO_BUS_WIDTH_D4 = 0x01 , SDIO_BUS_WIDTH_D8 = 0x02 }
sdio bus width More...
enum | sdio_reponse_type { SDIO_RESPONSE_NO = 0x00 , SDIO_RESPONSE_SHORT = 0x01 , SDIO_RESPONSE_LONG = 0x03 }
sdio response type More...
enum | sdio_wait_type { SDIO_WAIT_FOR_NO = 0x00 , SDIO_WAIT_FOR_INT = 0x01 , SDIO_WAIT_FOR_PEND = 0x02 }
sdio wait type More...
enum | sdio_rsp_index_type { SDIO_RSP1_INDEX = 0x00 , SDIO_RSP2_INDEX = 0x01 , SDIO_RSP3_INDEX = 0x02 , SDIO_RSP4_INDEX = 0x03 }
sdio response register index More...
enum sdio_block_size_type {
SDIO_DATA_BLOCK_SIZE_1B = 0x00 , SDIO_DATA_BLOCK_SIZE_2B = 0x01 , SDIO_DATA_BLOCK_SIZE_4B = 0x02 , SDIO_DATA_BLOCK_SIZE_8B = 0x03 ,
SDIO_DATA_BLOCK_SIZE_16B = 0x04 , SDIO_DATA_BLOCK_SIZE_32B = 0x05 , SDIO_DATA_BLOCK_SIZE_64B = 0x06 , SDIO_DATA_BLOCK_SIZE_128B = 0x07 ,
SDIO_DATA_BLOCK_SIZE_256B = 0x08 , SDIO_DATA_BLOCK_SIZE_512B = 0x09 , SDIO_DATA_BLOCK_SIZE_1024B = 0x0A , SDIO_DATA_BLOCK_SIZE_2048B = 0x0B ,
SDIO_DATA_BLOCK_SIZE_4096B = 0x0C , SDIO_DATA_BLOCK_SIZE_8192B = 0x0D , SDIO_DATA_BLOCK_SIZE_16384B = 0x0E
}
sdio data block size More...
enum | sdio_transfer_mode_type { SDIO_DATA_BLOCK_TRANSFER = 0x00 , SDIO_DATA_STREAM_TRANSFER = 0x01 }
sdio data transfer mode More...
enum | sdio_transfer_direction_type { SDIO_DATA_TRANSFER_TO_CARD = 0x00 , SDIO_DATA_TRANSFER_TO_CONTROLLER = 0x01 }
sdio data transfer direction More...
enum | sdio_read_wait_mode_type { SDIO_READ_WAIT_CONTROLLED_BY_D2 = 0x00 , SDIO_READ_WAIT_CONTROLLED_BY_CK = 0x01 }
sdio read wait mode More...

Detailed Description

Enumeration Type Documentation

◆ sdio_block_size_type

enum sdio_block_size_type

sdio data block size

Enumerator
SDIO_DATA_BLOCK_SIZE_1B | data block size 1 byte
SDIO_DATA_BLOCK_SIZE_2B | data block size 2 bytes
SDIO_DATA_BLOCK_SIZE_4B | data block size 4 bytes
SDIO_DATA_BLOCK_SIZE_8B | data block size 8 bytes
SDIO_DATA_BLOCK_SIZE_16B | data block size 16 bytes
SDIO_DATA_BLOCK_SIZE_32B | data block size 32 bytes
SDIO_DATA_BLOCK_SIZE_64B | data block size 64 bytes
SDIO_DATA_BLOCK_SIZE_128B | data block size 128 bytes
SDIO_DATA_BLOCK_SIZE_256B | data block size 256 bytes
SDIO_DATA_BLOCK_SIZE_512B | data block size 512 bytes
SDIO_DATA_BLOCK_SIZE_1024B | data block size 1024 bytes
SDIO_DATA_BLOCK_SIZE_2048B | data block size 2048 bytes
SDIO_DATA_BLOCK_SIZE_4096B | data block size 4096 bytes
SDIO_DATA_BLOCK_SIZE_8192B | data block size 8192 bytes
SDIO_DATA_BLOCK_SIZE_16384B | data block size 16384 bytes

Definition at line 179 of file at32f415_sdio.h.

◆ sdio_bus_width_type

enum sdio_bus_width_type

sdio bus width

Enumerator
SDIO_BUS_WIDTH_D1 | sdio wide bus select 1-bit
SDIO_BUS_WIDTH_D4 | sdio wide bus select 4-bit
SDIO_BUS_WIDTH_D8 | sdio wide bus select 8-bit

Definition at line 138 of file at32f415_sdio.h.

◆ sdio_edge_phase_type

enum sdio_edge_phase_type

sdio edge phase

Enumerator
SDIO_CLOCK_EDGE_RISING | sdio bus clock generated on the rising edge of the master clock
SDIO_CLOCK_EDGE_FALLING | sdio bus clock generated on the falling edge of the master clock

Definition at line 129 of file at32f415_sdio.h.

◆ sdio_power_state_type

enum sdio_power_state_type

sdio power state

Enumerator
SDIO_POWER_OFF | power-off, clock to card is stopped
SDIO_POWER_ON | power-on, the card is clocked

Definition at line 120 of file at32f415_sdio.h.

◆ sdio_read_wait_mode_type

enum sdio_read_wait_mode_type

sdio read wait mode

Enumerator
SDIO_READ_WAIT_CONTROLLED_BY_D2 | the sdio read wait on data2 line
SDIO_READ_WAIT_CONTROLLED_BY_CK | the sdio read wait on clock line

Definition at line 219 of file at32f415_sdio.h.

◆ sdio_reponse_type

enum sdio_reponse_type

sdio response type

Enumerator
SDIO_RESPONSE_NO | no response
SDIO_RESPONSE_SHORT | short response
SDIO_RESPONSE_LONG | long response

Definition at line 148 of file at32f415_sdio.h.

◆ sdio_rsp_index_type

enum sdio_rsp_index_type

sdio response register index

Enumerator
SDIO_RSP1_INDEX | response index 1, corresponding to sdio_rsp register 1
SDIO_RSP2_INDEX | response index 2, corresponding to sdio_rsp register 2
SDIO_RSP3_INDEX | response index 3, corresponding to sdio_rsp register 3
SDIO_RSP4_INDEX | response index 4, corresponding to sdio_rsp register 4

Definition at line 168 of file at32f415_sdio.h.

◆ sdio_transfer_direction_type

enum sdio_transfer_direction_type

sdio data transfer direction

Enumerator
SDIO_DATA_TRANSFER_TO_CARD | the sdio controller write
SDIO_DATA_TRANSFER_TO_CONTROLLER | the sdio controller read

Definition at line 210 of file at32f415_sdio.h.

◆ sdio_transfer_mode_type

enum sdio_transfer_mode_type

sdio data transfer mode

Enumerator
SDIO_DATA_BLOCK_TRANSFER | the sdio block transfer mode
SDIO_DATA_STREAM_TRANSFER | the sdio stream transfer mode

Definition at line 201 of file at32f415_sdio.h.

◆ sdio_wait_type

enum sdio_wait_type

sdio wait type

Enumerator
SDIO_WAIT_FOR_NO | no wait
SDIO_WAIT_FOR_INT | wait interrupt request
SDIO_WAIT_FOR_PEND | wait end of transfer

Definition at line 158 of file at32f415_sdio.h.


AT32F415 Firmwary Library: sdio_command_struct_type Struct Reference

Data Fields
sdio_command_struct_type Struct Reference
AT32F415_periph_driver » SDIO » SDIO_exported_types

sdio command structure More...

#include <at32f415_sdio.h>

Data Fields

uint32_t | argument
uint8_t | cmd_index
sdio_reponse_type rsp_type
sdio_wait_type wait_type

Detailed Description

sdio command structure

Definition at line 228 of file at32f415_sdio.h.

Field Documentation

◆ argument

uint32_t sdio_command_struct_type::argument

the sdio command argument is sent to a card as part of command message

Definition at line 230 of file at32f415_sdio.h.

Referenced by __align(), check_card_programming(), mmc_stream_read(), mmc_stream_write(), mmc_switch(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_bus_wide_enable(), sd_card_init(), sd_deselect_select(), sd_irq_service(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_power_on(), sd_status_send(), sd_switch(), sdio_command_config(), and sdio_command_data_send().

◆ cmd_index

uint8_t sdio_command_struct_type::cmd_index

the sdio command index

Definition at line 231 of file at32f415_sdio.h.

Referenced by __align(), check_card_programming(), mmc_stream_read(), mmc_stream_write(), mmc_switch(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_bus_wide_enable(), sd_card_init(), sd_deselect_select(), sd_irq_service(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_power_on(), sd_status_send(), sd_switch(), sdio_command_config(), and sdio_command_data_send().

◆ rsp_type

sdio_reponse_type sdio_command_struct_type::rsp_type

the sdio response type

Definition at line 232 of file at32f415_sdio.h.

Referenced by __align(), check_card_programming(), mmc_stream_read(), mmc_stream_write(), mmc_switch(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_bus_wide_enable(), sd_card_init(), sd_deselect_select(), sd_irq_service(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_power_on(), sd_status_send(), sd_switch(), sdio_command_config(), and sdio_command_data_send().

◆ wait_type

sdio_wait_type sdio_command_struct_type::wait_type

the sdio wait for interrupt request is enabled or disable

Definition at line 233 of file at32f415_sdio.h.

Referenced by __align(), check_card_programming(), mmc_stream_read(), mmc_stream_write(), mmc_switch(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_bus_wide_enable(), sd_card_init(), sd_deselect_select(), sd_irq_service(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_power_on(), sd_status_send(), sd_switch(), sdio_command_config(), and sdio_command_data_send().

The documentation for this struct was generated from the following file:
  • at32f415_sdio.h


AT32F415 Firmwary Library: sdio_data_struct_type Struct Reference

Data Fields
sdio_data_struct_type Struct Reference
AT32F415_periph_driver » SDIO » SDIO_exported_types

sdio data structure More...

#include <at32f415_sdio.h>

Data Fields

uint32_t | timeout
uint32_t | data_length
sdio_block_size_type block_size
sdio_transfer_mode_type transfer_mode
sdio_transfer_direction_type transfer_direction

Detailed Description

sdio data structure

Definition at line 239 of file at32f415_sdio.h.

Field Documentation

◆ block_size

sdio_block_size_type sdio_data_struct_type::block_size

the sdio data block size of block transfer mode

Definition at line 243 of file at32f415_sdio.h.

Referenced by __align(), mmc_stream_read(), mmc_stream_write(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_switch(), and sdio_data_config().

◆ data_length

uint32_t sdio_data_struct_type::data_length

the sdio data length

Definition at line 242 of file at32f415_sdio.h.

Referenced by __align(), mmc_stream_read(), mmc_stream_write(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_switch(), sdio_command_data_send(), and sdio_data_config().

◆ timeout

uint32_t sdio_data_struct_type::timeout

the sdio data timeout period in car bus clock periods

Definition at line 241 of file at32f415_sdio.h.

Referenced by __align(), mmc_stream_read(), mmc_stream_write(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_switch(), and sdio_data_config().

◆ transfer_direction

sdio_transfer_direction_type sdio_data_struct_type::transfer_direction

the sdio data transfer direction

Definition at line 245 of file at32f415_sdio.h.

Referenced by __align(), mmc_stream_read(), mmc_stream_write(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_switch(), sdio_command_data_send(), and sdio_data_config().

◆ transfer_mode

sdio_transfer_mode_type sdio_data_struct_type::transfer_mode

the sdio transfer mode, block or stream

Definition at line 244 of file at32f415_sdio.h.

Referenced by __align(), mmc_stream_read(), mmc_stream_write(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_switch(), and sdio_data_config().

The documentation for this struct was generated from the following file:
  • at32f415_sdio.h


AT32F415 Firmwary Library: sdio_type Struct Reference

Data Fields
sdio_type Struct Reference
AT32F415_periph_driver » SDIO » SDIO_exported_types

type define sdio register all More...

#include <at32f415_sdio.h>

Data Fields

union {
__IO uint32_t pwrctrl
struct {
__IO uint32_t ps: 2
__IO uint32_t reserved1: 30
} pwrctrl_bit
};
sdio pwrctrl register, offset:0x00 More...
union {
__IO uint32_t clkctrl
struct {
__IO uint32_t clkdiv_l: 8
__IO uint32_t clkoen: 1
__IO uint32_t pwrsven: 1
__IO uint32_t bypsen: 1
__IO uint32_t busws: 2
__IO uint32_t clkegs: 1
__IO uint32_t hfcen: 1
__IO uint32_t clkdiv_h: 2
__IO uint32_t reserved1: 15
} clkctrl_bit
};
sdio clkctrl register, offset:0x04 More...
union {
__IO uint32_t argu
struct {
__IO uint32_t argu: 32
} argu_bit
};
sdio argu register, offset:0x08 More...
union {
__IO uint32_t cmdctrl
struct {
__IO uint32_t cmdidx: 6
__IO uint32_t rspwt: 2
__IO uint32_t intwt: 1
__IO uint32_t pndwt: 1
__IO uint32_t ccsmen: 1
__IO uint32_t iosusp: 1
__IO uint32_t reserved1: 20
} cmdctrl_bit
};
sdio cmdctrl register, offset:0x0C More...
union {
__IO uint32_t rspcmd
struct {
__IO uint32_t rspcmd: 6
__IO uint32_t reserved1: 26
} rspcmd_bit
};
sdio rspcmd register, offset:0x10 More...
union {
__IO uint32_t rsp1
struct {
__IO uint32_t cardsts1: 32
} rsp1_bit
};
sdio rsp1 register, offset:0x14 More...
union {
__IO uint32_t rsp2
struct {
__IO uint32_t cardsts2: 32
} rsp2_bit
};
sdio rsp2 register, offset:0x18 More...
union {
__IO uint32_t rsp3
struct {
__IO uint32_t cardsts3: 32
} rsp3_bit
};
sdio rsp3 register, offset:0x1C More...
union {
__IO uint32_t rsp4
struct {
__IO uint32_t cardsts4: 32
} rsp4_bit
};
sdio rsp4 register, offset:0x20 More...
union {
__IO uint32_t dttmr
struct {
__IO uint32_t timeout: 32
} dttmr_bit
};
sdio dttmr register, offset:0x24 More...
union {
__IO uint32_t dtlen
struct {
__IO uint32_t dtlen: 25
__IO uint32_t reserved1: 7
} dtlen_bit
};
sdio dtlen register, offset:0x28 More...
union {
__IO uint32_t dtctrl
struct {
__IO uint32_t tfren: 1
__IO uint32_t tfrdir: 1
__IO uint32_t tfrmode: 1
__IO uint32_t dmaen: 1
__IO uint32_t blksize: 4
__IO uint32_t rdwtstart: 1
__IO uint32_t rdwtstop: 1
__IO uint32_t rdwtmode: 1
__IO uint32_t ioen: 1
__IO uint32_t reserved1: 20
} dtctrl_bit
};
sdio dtctrl register, offset:0x2C More...
union {
__IO uint32_t dtcnt
struct {
__IO uint32_t cnt: 25
__IO uint32_t reserved1: 7
} dtcnt_bit
};
sdio dtcnt register, offset:0x30 More...
union {
__IO uint32_t sts
struct {
__IO uint32_t cmdfail: 1
__IO uint32_t dtfail: 1
__IO uint32_t cmdtimeout: 1
__IO uint32_t dttimeout: 1
__IO uint32_t txerru: 1
__IO uint32_t rxerro: 1
__IO uint32_t cmdrspcmpl: 1
__IO uint32_t cmdcmpl: 1
__IO uint32_t dtcmpl: 1
__IO uint32_t sbiterr: 1
__IO uint32_t dtblkcmpl: 1
__IO uint32_t docmd: 1
__IO uint32_t dotx: 1
__IO uint32_t dorx: 1
__IO uint32_t txbufh: 1
__IO uint32_t rxbufh: 1
__IO uint32_t txbuff: 1
__IO uint32_t rxbuff: 1
__IO uint32_t txbufe: 1
__IO uint32_t rxbufe: 1
__IO uint32_t txbuf: 1
__IO uint32_t rxbuf: 1
__IO uint32_t ioif: 1
__IO uint32_t reserved1: 9
} sts_bit
};
sdio sts register, offset:0x34 More...
union {
__IO uint32_t intclr
struct {
__IO uint32_t cmdfail: 1
__IO uint32_t dtfail: 1
__IO uint32_t cmdtimeout: 1
__IO uint32_t dttimeout: 1
__IO uint32_t txerru: 1
__IO uint32_t rxerro: 1
__IO uint32_t cmdrspcmpl: 1
__IO uint32_t cmdcmpl: 1
__IO uint32_t dtcmpl: 1
__IO uint32_t sbiterr: 1
__IO uint32_t dtblkcmpl: 1
__IO uint32_t reserved1: 11
__IO uint32_t ioif: 1
__IO uint32_t reserved2: 9
} intclr_bit
};
sdio intclr register, offset:0x38 More...
union {
__IO uint32_t inten
struct {
__IO uint32_t cmdfailien: 1
__IO uint32_t dtfailien: 1
__IO uint32_t cmdtimeoutien: 1
__IO uint32_t dttimeoutien: 1
__IO uint32_t txerruien: 1
__IO uint32_t rxerroien: 1
__IO uint32_t cmdrspcmplien: 1
__IO uint32_t cmdcmplien: 1
__IO uint32_t dtcmplien: 1
__IO uint32_t sbiterrien: 1
__IO uint32_t dtblkcmplien: 1
__IO uint32_t docmdien: 1
__IO uint32_t dotxien: 1
__IO uint32_t dorxien: 1
__IO uint32_t txbufhien: 1
__IO uint32_t rxbufhien: 1
__IO uint32_t txbuffien: 1
__IO uint32_t rxbuffien: 1
__IO uint32_t txbufeien: 1
__IO uint32_t rxbufeien: 1
__IO uint32_t txbufien: 1
__IO uint32_t rxbufien: 1
__IO uint32_t ioifien: 1
__IO uint32_t reserved1: 9
} inten_bit
};
sdio inten register, offset:0x3C More...
union {
__IO uint32_t bufcnt
struct {
__IO uint32_t cnt: 24
__IO uint32_t reserved1: 8
} bufcnt_bit
};
sdio bufcnt register, offset:0x48 More...
union {
__IO uint32_t buf
struct {
__IO uint32_t dt: 32
} buf_bit
};
sdio buf register, offset:0x80 More...

Detailed Description

type define sdio register all

Definition at line 251 of file at32f415_sdio.h.

Field Documentation

◆

union { ... } sdio_type::@512

sdio pwrctrl register, offset:0x00

◆

union { ... } sdio_type::@514

sdio clkctrl register, offset:0x04

◆

union { ... } sdio_type::@516

sdio argu register, offset:0x08

◆

union { ... } sdio_type::@518

sdio cmdctrl register, offset:0x0C

◆

union { ... } sdio_type::@520

sdio rspcmd register, offset:0x10

◆

union { ... } sdio_type::@522

sdio rsp1 register, offset:0x14

◆

union { ... } sdio_type::@524

sdio rsp2 register, offset:0x18

◆

union { ... } sdio_type::@526

sdio rsp3 register, offset:0x1C

◆

union { ... } sdio_type::@528

sdio rsp4 register, offset:0x20

◆

union { ... } sdio_type::@530

sdio dttmr register, offset:0x24

◆

union { ... } sdio_type::@532

sdio dtlen register, offset:0x28

◆

union { ... } sdio_type::@534

sdio dtctrl register, offset:0x2C

◆

union { ... } sdio_type::@536

sdio dtcnt register, offset:0x30

◆

union { ... } sdio_type::@538

sdio sts register, offset:0x34

◆

union { ... } sdio_type::@540

sdio intclr register, offset:0x38

◆

union { ... } sdio_type::@542

sdio inten register, offset:0x3C

◆

union { ... } sdio_type::@544

sdio bufcnt register, offset:0x48

◆

union { ... } sdio_type::@546

sdio buf register, offset:0x80

◆ argu

__IO uint32_t sdio_type::argu

Definition at line 291 of file at32f415_sdio.h.

Referenced by sdio_command_config(), and sdio_reset().

◆

struct { ... } sdio_type::argu_bit

◆ blksize

__IO uint32_t sdio_type::blksize

Definition at line 414 of file at32f415_sdio.h.

Referenced by sdio_data_config().

◆ buf

__IO uint32_t sdio_type::buf

Definition at line 559 of file at32f415_sdio.h.

Referenced by sdio_data_read(), and sdio_data_write().

◆

struct { ... } sdio_type::buf_bit

◆ bufcnt

__IO uint32_t sdio_type::bufcnt

Definition at line 541 of file at32f415_sdio.h.

Referenced by sdio_buffer_counter_get().

◆

struct { ... } sdio_type::bufcnt_bit

◆ busws

__IO uint32_t sdio_type::busws

Definition at line 278 of file at32f415_sdio.h.

Referenced by sdio_bus_width_config().

◆ bypsen

__IO uint32_t sdio_type::bypsen

Definition at line 277 of file at32f415_sdio.h.

Referenced by sdio_clock_bypass().

◆ cardsts1

__IO uint32_t sdio_type::cardsts1

Definition at line 337 of file at32f415_sdio.h.

◆ cardsts2

__IO uint32_t sdio_type::cardsts2

Definition at line 349 of file at32f415_sdio.h.

◆ cardsts3

__IO uint32_t sdio_type::cardsts3

Definition at line 361 of file at32f415_sdio.h.

◆ cardsts4

__IO uint32_t sdio_type::cardsts4

Definition at line 373 of file at32f415_sdio.h.

◆ ccsmen

__IO uint32_t sdio_type::ccsmen

Definition at line 310 of file at32f415_sdio.h.

Referenced by sdio_command_config(), and sdio_command_state_machine_enable().

◆ clkctrl

__IO uint32_t sdio_type::clkctrl

Definition at line 271 of file at32f415_sdio.h.

Referenced by sdio_reset().

◆

struct { ... } sdio_type::clkctrl_bit

Referenced by sdio_bus_width_config(), sdio_clock_bypass(), sdio_clock_config(), sdio_clock_enable(), sdio_flow_control_enable(), and sdio_power_saving_mode_enable().

◆ clkdiv_h

__IO uint32_t sdio_type::clkdiv_h

Definition at line 281 of file at32f415_sdio.h.

Referenced by sdio_clock_config().

◆ clkdiv_l

__IO uint32_t sdio_type::clkdiv_l

Definition at line 274 of file at32f415_sdio.h.

Referenced by sdio_clock_config().

◆ clkegs

__IO uint32_t sdio_type::clkegs

Definition at line 279 of file at32f415_sdio.h.

Referenced by sdio_clock_config().

◆ clkoen

__IO uint32_t sdio_type::clkoen

Definition at line 275 of file at32f415_sdio.h.

Referenced by sdio_clock_enable().

◆ cmdcmpl

__IO uint32_t sdio_type::cmdcmpl

Definition at line 451 of file at32f415_sdio.h.

◆ cmdcmplien

__IO uint32_t sdio_type::cmdcmplien

Definition at line 511 of file at32f415_sdio.h.

◆ cmdctrl

__IO uint32_t sdio_type::cmdctrl

Definition at line 303 of file at32f415_sdio.h.

Referenced by sdio_reset().

◆

struct { ... } sdio_type::cmdctrl_bit

Referenced by sdio_command_config(), sdio_command_state_machine_enable(), and sdio_io_suspend_command_set().

◆ cmdfail

__IO uint32_t sdio_type::cmdfail

Definition at line 444 of file at32f415_sdio.h.

◆ cmdfailien

__IO uint32_t sdio_type::cmdfailien

Definition at line 504 of file at32f415_sdio.h.

◆ cmdidx

__IO uint32_t sdio_type::cmdidx

Definition at line 306 of file at32f415_sdio.h.

Referenced by sdio_command_config().

◆ cmdrspcmpl

__IO uint32_t sdio_type::cmdrspcmpl

Definition at line 450 of file at32f415_sdio.h.

◆ cmdrspcmplien

__IO uint32_t sdio_type::cmdrspcmplien

Definition at line 510 of file at32f415_sdio.h.

◆ cmdtimeout

__IO uint32_t sdio_type::cmdtimeout

Definition at line 446 of file at32f415_sdio.h.

◆ cmdtimeoutien

__IO uint32_t sdio_type::cmdtimeoutien

Definition at line 506 of file at32f415_sdio.h.

◆ cnt

__IO uint32_t sdio_type::cnt

Definition at line 431 of file at32f415_sdio.h.

◆ dmaen

__IO uint32_t sdio_type::dmaen

Definition at line 413 of file at32f415_sdio.h.

Referenced by sdio_dma_enable().

◆ docmd

__IO uint32_t sdio_type::docmd

Definition at line 455 of file at32f415_sdio.h.

◆ docmdien

__IO uint32_t sdio_type::docmdien

Definition at line 515 of file at32f415_sdio.h.

◆ dorx

__IO uint32_t sdio_type::dorx

Definition at line 457 of file at32f415_sdio.h.

◆ dorxien

__IO uint32_t sdio_type::dorxien

Definition at line 517 of file at32f415_sdio.h.

◆ dotx

__IO uint32_t sdio_type::dotx

Definition at line 456 of file at32f415_sdio.h.

◆ dotxien

__IO uint32_t sdio_type::dotxien

Definition at line 516 of file at32f415_sdio.h.

◆ dt

__IO uint32_t sdio_type::dt

Definition at line 562 of file at32f415_sdio.h.

◆ dtblkcmpl

__IO uint32_t sdio_type::dtblkcmpl

Definition at line 454 of file at32f415_sdio.h.

◆ dtblkcmplien

__IO uint32_t sdio_type::dtblkcmplien

Definition at line 514 of file at32f415_sdio.h.

◆ dtcmpl

__IO uint32_t sdio_type::dtcmpl

Definition at line 452 of file at32f415_sdio.h.

◆ dtcmplien

__IO uint32_t sdio_type::dtcmplien

Definition at line 512 of file at32f415_sdio.h.

◆ dtcnt

__IO uint32_t sdio_type::dtcnt

Definition at line 428 of file at32f415_sdio.h.

Referenced by sdio_data_counter_get().

◆

struct { ... } sdio_type::dtcnt_bit

◆ dtctrl

__IO uint32_t sdio_type::dtctrl

Definition at line 407 of file at32f415_sdio.h.

Referenced by sdio_reset().

◆

struct { ... } sdio_type::dtctrl_bit

Referenced by sdio_data_config(), sdio_data_state_machine_enable(), sdio_dma_enable(), sdio_io_function_enable(), sdio_read_wait_mode_set(), sdio_read_wait_start(), and sdio_read_wait_stop().

◆ dtfail

__IO uint32_t sdio_type::dtfail

Definition at line 445 of file at32f415_sdio.h.

◆ dtfailien

__IO uint32_t sdio_type::dtfailien

Definition at line 505 of file at32f415_sdio.h.

◆ dtlen

__IO uint32_t sdio_type::dtlen

Definition at line 394 of file at32f415_sdio.h.

Referenced by sdio_data_config(), and sdio_reset().

◆

struct { ... } sdio_type::dtlen_bit

Referenced by sdio_data_config().

◆ dttimeout

__IO uint32_t sdio_type::dttimeout

Definition at line 447 of file at32f415_sdio.h.

◆ dttimeoutien

__IO uint32_t sdio_type::dttimeoutien

Definition at line 507 of file at32f415_sdio.h.

◆ dttmr

__IO uint32_t sdio_type::dttmr

Definition at line 382 of file at32f415_sdio.h.

Referenced by sdio_reset().

◆

struct { ... } sdio_type::dttmr_bit

Referenced by sdio_data_config().

◆ hfcen

__IO uint32_t sdio_type::hfcen

Definition at line 280 of file at32f415_sdio.h.

Referenced by sdio_flow_control_enable().

◆ intclr

__IO uint32_t sdio_type::intclr

Definition at line 476 of file at32f415_sdio.h.

Referenced by sdio_flag_clear(), and sdio_reset().

◆

struct { ... } sdio_type::intclr_bit

◆ inten

__IO uint32_t sdio_type::inten

Definition at line 501 of file at32f415_sdio.h.

Referenced by sdio_interrupt_enable(), and sdio_reset().

◆

struct { ... } sdio_type::inten_bit

◆ intwt

__IO uint32_t sdio_type::intwt

Definition at line 308 of file at32f415_sdio.h.

Referenced by sdio_command_config().

◆ ioen

__IO uint32_t sdio_type::ioen

Definition at line 418 of file at32f415_sdio.h.

Referenced by sdio_io_function_enable().

◆ ioif

__IO uint32_t sdio_type::ioif

Definition at line 466 of file at32f415_sdio.h.

◆ ioifien

__IO uint32_t sdio_type::ioifien

Definition at line 526 of file at32f415_sdio.h.

◆ iosusp

__IO uint32_t sdio_type::iosusp

Definition at line 311 of file at32f415_sdio.h.

Referenced by sdio_io_suspend_command_set().

◆ pndwt

__IO uint32_t sdio_type::pndwt

Definition at line 309 of file at32f415_sdio.h.

Referenced by sdio_command_config().

◆ ps

__IO uint32_t sdio_type::ps

Definition at line 261 of file at32f415_sdio.h.

Referenced by sdio_power_set(), and sdio_power_status_get().

◆ pwrctrl

__IO uint32_t sdio_type::pwrctrl

Definition at line 258 of file at32f415_sdio.h.

Referenced by sdio_reset().

◆

struct { ... } sdio_type::pwrctrl_bit

Referenced by sdio_power_set(), and sdio_power_status_get().

◆ pwrsven

__IO uint32_t sdio_type::pwrsven

Definition at line 276 of file at32f415_sdio.h.

Referenced by sdio_power_saving_mode_enable().

◆ rdwtmode

__IO uint32_t sdio_type::rdwtmode

Definition at line 417 of file at32f415_sdio.h.

Referenced by sdio_read_wait_mode_set().

◆ rdwtstart

__IO uint32_t sdio_type::rdwtstart

Definition at line 415 of file at32f415_sdio.h.

Referenced by sdio_read_wait_start().

◆ rdwtstop

__IO uint32_t sdio_type::rdwtstop

Definition at line 416 of file at32f415_sdio.h.

Referenced by sdio_read_wait_stop().

◆ reserved1

__IO uint32_t sdio_type::reserved1

sdio reserved1 register, offset:0x40~0x44

Definition at line 262 of file at32f415_sdio.h.

◆ reserved2

__IO uint32_t sdio_type::reserved2

sdio reserved2 register, offset:0x4C~0x7C

Definition at line 492 of file at32f415_sdio.h.

◆ rsp1

__IO uint32_t sdio_type::rsp1

Definition at line 334 of file at32f415_sdio.h.

Referenced by sdio_response_get().

◆

struct { ... } sdio_type::rsp1_bit

◆ rsp2

__IO uint32_t sdio_type::rsp2

Definition at line 346 of file at32f415_sdio.h.

Referenced by sdio_response_get().

◆

struct { ... } sdio_type::rsp2_bit

◆ rsp3

__IO uint32_t sdio_type::rsp3

Definition at line 358 of file at32f415_sdio.h.

Referenced by sdio_response_get().

◆

struct { ... } sdio_type::rsp3_bit

◆ rsp4

__IO uint32_t sdio_type::rsp4

Definition at line 370 of file at32f415_sdio.h.

Referenced by sdio_response_get().

◆

struct { ... } sdio_type::rsp4_bit

◆ rspcmd

__IO uint32_t sdio_type::rspcmd

Definition at line 321 of file at32f415_sdio.h.

Referenced by sdio_command_response_get().

◆

struct { ... } sdio_type::rspcmd_bit

Referenced by sdio_command_response_get().

◆ rspwt

__IO uint32_t sdio_type::rspwt

Definition at line 307 of file at32f415_sdio.h.

Referenced by sdio_command_config().

◆ rxbuf

__IO uint32_t sdio_type::rxbuf

Definition at line 465 of file at32f415_sdio.h.

◆ rxbufe

__IO uint32_t sdio_type::rxbufe

Definition at line 463 of file at32f415_sdio.h.

◆ rxbufeien

__IO uint32_t sdio_type::rxbufeien

Definition at line 523 of file at32f415_sdio.h.

◆ rxbuff

__IO uint32_t sdio_type::rxbuff

Definition at line 461 of file at32f415_sdio.h.

◆ rxbuffien

__IO uint32_t sdio_type::rxbuffien

Definition at line 521 of file at32f415_sdio.h.

◆ rxbufh

__IO uint32_t sdio_type::rxbufh

Definition at line 459 of file at32f415_sdio.h.

◆ rxbufhien

__IO uint32_t sdio_type::rxbufhien

Definition at line 519 of file at32f415_sdio.h.

◆ rxbufien

__IO uint32_t sdio_type::rxbufien

Definition at line 525 of file at32f415_sdio.h.

◆ rxerro

__IO uint32_t sdio_type::rxerro

Definition at line 449 of file at32f415_sdio.h.

◆ rxerroien

__IO uint32_t sdio_type::rxerroien

Definition at line 509 of file at32f415_sdio.h.

◆ sbiterr

__IO uint32_t sdio_type::sbiterr

Definition at line 453 of file at32f415_sdio.h.

◆ sbiterrien

__IO uint32_t sdio_type::sbiterrien

Definition at line 513 of file at32f415_sdio.h.

◆ sts

__IO uint32_t sdio_type::sts

Definition at line 441 of file at32f415_sdio.h.

Referenced by sdio_flag_get().

◆

struct { ... } sdio_type::sts_bit

◆ tfrdir

__IO uint32_t sdio_type::tfrdir

Definition at line 411 of file at32f415_sdio.h.

Referenced by sdio_data_config().

◆ tfren

__IO uint32_t sdio_type::tfren

Definition at line 410 of file at32f415_sdio.h.

Referenced by sdio_data_config(), and sdio_data_state_machine_enable().

◆ tfrmode

__IO uint32_t sdio_type::tfrmode

Definition at line 412 of file at32f415_sdio.h.

Referenced by sdio_data_config().

◆ timeout

__IO uint32_t sdio_type::timeout

Definition at line 385 of file at32f415_sdio.h.

Referenced by sdio_data_config().

◆ txbuf

__IO uint32_t sdio_type::txbuf

Definition at line 464 of file at32f415_sdio.h.

◆ txbufe

__IO uint32_t sdio_type::txbufe

Definition at line 462 of file at32f415_sdio.h.

◆ txbufeien

__IO uint32_t sdio_type::txbufeien

Definition at line 522 of file at32f415_sdio.h.

◆ txbuff

__IO uint32_t sdio_type::txbuff

Definition at line 460 of file at32f415_sdio.h.

◆ txbuffien

__IO uint32_t sdio_type::txbuffien

Definition at line 520 of file at32f415_sdio.h.

◆ txbufh

__IO uint32_t sdio_type::txbufh

Definition at line 458 of file at32f415_sdio.h.

◆ txbufhien

__IO uint32_t sdio_type::txbufhien

Definition at line 518 of file at32f415_sdio.h.

◆ txbufien

__IO uint32_t sdio_type::txbufien

Definition at line 524 of file at32f415_sdio.h.

◆ txerru

__IO uint32_t sdio_type::txerru

Definition at line 448 of file at32f415_sdio.h.

◆ txerruien

__IO uint32_t sdio_type::txerruien

Definition at line 508 of file at32f415_sdio.h.

The documentation for this struct was generated from the following file:
  • at32f415_sdio.h


AT32F415 Firmwary Library: SDIO_exported_functions

Functions
SDIO_exported_functions
AT32F415_periph_driver » SDIO

Functions

void | sdio_reset (sdio_type *sdio_x)
reset the sdio register More...
void | sdio_power_set (sdio_type *sdio_x, sdio_power_state_type power_state)
set the power status of the controller More...
flag_status | sdio_power_status_get (sdio_type *sdio_x)
get power status. More...
void | sdio_clock_config (sdio_type *sdio_x, uint16_t clk_div, sdio_edge_phase_type clk_edg)
config sdio clock More...
void | sdio_bus_width_config (sdio_type *sdio_x, sdio_bus_width_type width)
config sdio bus width More...
void | sdio_clock_bypass (sdio_type *sdio_x, confirm_state new_state)
enable or disable clock divider bypss More...
void | sdio_power_saving_mode_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable power saving mode, config sdio_ck clock output when the bus is idle. More...
void | sdio_flow_control_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable hardware flow control. More...
void | sdio_clock_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable sdio_ck output. More...
void | sdio_dma_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable dma. More...
void | sdio_interrupt_enable (sdio_type *sdio_x, uint32_t int_opt, confirm_state new_state)
config corresponding interrupt. More...
flag_status | sdio_flag_get (sdio_type *sdio_x, uint32_t flag)
get sdio flag. More...
void | sdio_flag_clear (sdio_type *sdio_x, uint32_t flag)
clear sdio flag. More...
void | sdio_command_config (sdio_type *sdio_x, sdio_command_struct_type *command_struct)
config sdio command. More...
void | sdio_command_state_machine_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable command path state machine(CPSM). More...
uint8_t | sdio_command_response_get (sdio_type *sdio_x)
get command index of last command for which response received. More...
uint32_t | sdio_response_get (sdio_type *sdio_x, sdio_rsp_index_type reg_index)
get response received from the card for the last command. More...
void | sdio_data_config (sdio_type *sdio_x, sdio_data_struct_type *data_struct)
config sdio data. More...
void | sdio_data_state_machine_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable data path state machine(DPSM). More...
uint32_t | sdio_data_counter_get (sdio_type *sdio_x)
get the number of remaining data bytes to be transferred. More...
uint32_t | sdio_data_read (sdio_type *sdio_x)
read a word data from sdio fifo. More...
uint32_t | sdio_buffer_counter_get (sdio_type *sdio_x)
get the number of words left to be written to or read from fifo.. More...
void | sdio_data_write (sdio_type *sdio_x, uint32_t data)
write one word data to fifo. More...
void | sdio_read_wait_mode_set (sdio_type *sdio_x, sdio_read_wait_mode_type mode)
set the read wait mode. More...
void | sdio_read_wait_start (sdio_type *sdio_x, confirm_state new_state)
enable or disable to start sd i/o read wait operation. More...
void | sdio_read_wait_stop (sdio_type *sdio_x, confirm_state new_state)
enable or disable to stop sd i/o read wait operation. More...
void | sdio_io_function_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable the sd i/o function. More...
void | sdio_io_suspend_command_set (sdio_type *sdio_x, confirm_state new_state)
enable or disable sd i/o suspend command sending. More...

Detailed Description

Function Documentation

◆ sdio_buffer_counter_get()

uint32_t sdio_buffer_counter_get ( sdio_type * sdio_x )

get the number of words left to be written to or read from fifo..

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
Return values
uint32_t number of words

Definition at line 488 of file at32f415_sdio.c.

◆ sdio_bus_width_config()

void sdio_bus_width_config | ( | sdio_type * | sdio_x,
 |  | sdio_bus_width_type | width
 | ) |  |

config sdio bus width

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
width this parameter can be one of the following values:
  • SDIO_BUS_WIDTH_D1
  • SDIO_BUS_WIDTH_D4
  • SDIO_BUS_WIDTH_D8
Return values
none

Definition at line 139 of file at32f415_sdio.c.

Referenced by sd_power_on(), and sd_wide_bus_operation_config().

◆ sdio_clock_bypass()

void sdio_clock_bypass | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable clock divider bypss

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 152 of file at32f415_sdio.c.

Referenced by sd_power_on().

◆ sdio_clock_config()

void sdio_clock_config | ( | sdio_type * | sdio_x,
 |  | uint16_t | clk_div,
 |  | sdio_edge_phase_type | clk_edg
 | ) |  |

config sdio clock

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
clk_div sdio clock divide factor(frequency = sdio_clk / [clk_psc + 2]).
clk_edg this parameter can be one of the following values:
  • SDIO_CLOCK_EDGE_RISING
  • SDIO_CLOCK_EDGE_FALLING
Return values
none

Definition at line 115 of file at32f415_sdio.c.

Referenced by sd_power_on().

◆ sdio_clock_enable()

void sdio_clock_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable sdio_ck output.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 192 of file at32f415_sdio.c.

Referenced by sd_power_on().

◆ sdio_command_config()

void sdio_command_config | ( | sdio_type * | sdio_x,
 |  | sdio_command_struct_type * | command_struct
 | ) |  |

config sdio command.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
command_struct : pointer to a sdio_command_struct_type structure that contains the configuration information for the sdio command.
Return values
none

Definition at line 340 of file at32f415_sdio.c.

Referenced by __align(), check_card_programming(), mmc_switch(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_bus_wide_enable(), sd_card_init(), sd_deselect_select(), sd_irq_service(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_power_on(), sd_status_send(), sd_switch(), and sdio_command_data_send().

◆ sdio_command_response_get()

uint8_t sdio_command_response_get ( sdio_type * sdio_x )

get command index of last command for which response received.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
uint8_t command index

Definition at line 376 of file at32f415_sdio.c.

Referenced by check_card_programming(), command_rsp1_error(), command_rsp4_error(), command_rsp5_error(), and command_rsp6_error().

◆ sdio_command_state_machine_enable()

void sdio_command_state_machine_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable command path state machine(CPSM).

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 363 of file at32f415_sdio.c.

Referenced by __align(), check_card_programming(), mmc_switch(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_bus_wide_enable(), sd_card_init(), sd_deselect_select(), sd_irq_service(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_power_on(), sd_status_send(), sd_switch(), and sdio_command_data_send().

◆ sdio_data_config()

void sdio_data_config | ( | sdio_type * | sdio_x,
 |  | sdio_data_struct_type * | data_struct
 | ) |  |

config sdio data.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
data_struct : pointer to a sdio_data_struct_type structure that contains the configuration information for the sdio data.
Return values
none

Definition at line 427 of file at32f415_sdio.c.

Referenced by __align(), mmc_stream_read(), mmc_stream_write(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_mult_blocks_read(), sd_mult_blocks_write(), and sdio_command_data_send().

◆ sdio_data_counter_get()

uint32_t sdio_data_counter_get ( sdio_type * sdio_x )

get the number of remaining data bytes to be transferred.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
Return values
uint32_t number of bytes

Definition at line 464 of file at32f415_sdio.c.

◆ sdio_data_read()

uint32_t sdio_data_read ( sdio_type * sdio_x )

read a word data from sdio fifo.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
Return values
uint32_t data received

Definition at line 476 of file at32f415_sdio.c.

Referenced by scr_find(), and sdio_command_data_send().

◆ sdio_data_state_machine_enable()

void sdio_data_state_machine_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable data path state machine(DPSM).

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 452 of file at32f415_sdio.c.

Referenced by __align(), mmc_stream_read(), mmc_stream_write(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_mult_blocks_read(), sd_mult_blocks_write(), and sdio_command_data_send().

◆ sdio_data_write()

void sdio_data_write | ( | sdio_type * | sdio_x,
 |  | uint32_t | data
 | ) |  |

write one word data to fifo.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
data data to be transferred.
Return values
none

Definition at line 501 of file at32f415_sdio.c.

Referenced by sdio_command_data_send().

◆ sdio_dma_enable()

void sdio_dma_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable dma.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 205 of file at32f415_sdio.c.

Referenced by sdio_command_data_send().

◆ sdio_flag_clear()

void sdio_flag_clear | ( | sdio_type * | sdio_x,
 |  | uint32_t | flag
 | ) |  |

clear sdio flag.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
int_opt this parameter can be any combination of the following values:
  • SDIO_CMDFAIL_FLAG
  • SDIO_DTFAIL_FLAG
  • SDIO_CMDTIMEOUT_FLAG
  • SDIO_DTTIMEOUT_FLAG
  • SDIO_TXERRU_FLAG
  • SDIO_RXERRO_FLAG
  • SDIO_CMDRSPCMPL_FLAG
  • SDIO_CMDCMPL_FLAG
  • SDIO_DTCMPL_FLAG
  • SDIO_SBITERR_FLAG
  • SDIO_DTBLKCMPL_FLAG
  • SDIO_SDIOIF_FLAG
Return values
none

Definition at line 326 of file at32f415_sdio.c.

Referenced by check_card_programming(), command_error(), command_rsp1_error(), command_rsp2_error(), command_rsp3_error(), command_rsp4_error(), command_rsp5_error(), command_rsp6_error(), command_rsp7_error(), mmc_stream_write(), scr_find(), sd_block_write(), sd_irq_service(), sd_mult_blocks_write(), and sdio_command_data_send().

◆ sdio_flag_get()

flag_status sdio_flag_get | ( | sdio_type * | sdio_x,
 |  | uint32_t | flag
 | ) |  |

get sdio flag.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
flag this parameter can be one of the following values:
  • SDIO_CMDFAIL_FLAG
  • SDIO_DTFAIL_FLAG
  • SDIO_CMDTIMEOUT_FLAG
  • SDIO_DTTIMEOUT_FLAG
  • SDIO_TXERRU_FLAG
  • SDIO_RXERRO_FLAG
  • SDIO_CMDRSPCMPL_FLAG
  • SDIO_CMDCMPL_FLAG
  • SDIO_DTCMPL_FLAG
  • SDIO_SBITERR_FLAG
  • SDIO_DTBLKCMPL_FLAG
  • SDIO_DOCMD_FLAG
  • SDIO_DOTX_FLAG
  • SDIO_DORX_FLAG
  • SDIO_TXBUFH_FLAG
  • SDIO_RXBUFH_FLAG
  • SDIO_TXBUFF_FLAG
  • SDIO_RXBUFF_FLAG
  • SDIO_TXBUFE_FLAG
  • SDIO_RXBUFE_FLAG
  • SDIO_TXBUF_FLAG
  • SDIO_RXBUF_FLAG
  • SDIO_SDIOIF_FLAG
Return values
flag_status (SET or RESET)

Definition at line 289 of file at32f415_sdio.c.

Referenced by check_card_programming(), command_error(), command_rsp1_error(), command_rsp2_error(), command_rsp3_error(), command_rsp4_error(), command_rsp5_error(), command_rsp6_error(), scr_find(), sd_irq_service(), and sdio_command_data_send().

◆ sdio_flow_control_enable()

void sdio_flow_control_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable hardware flow control.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 179 of file at32f415_sdio.c.

Referenced by sd_power_on().

◆ sdio_interrupt_enable()

void sdio_interrupt_enable | ( | sdio_type * | sdio_x,
 |  | uint32_t | int_opt,
 |  | confirm_state | new_state
 | ) |  |

config corresponding interrupt.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
int_opt this parameter can be one of the following values:
  • SDIO_CMDFAIL_INT
  • SDIO_DTFAIL_INT
  • SDIO_CMDTIMEOUT_INT
  • SDIO_DTTIMEOUT_INT
  • SDIO_TXERRU_INT
  • SDIO_RXERRO_INT
  • SDIO_CMDRSPCMPL_INT
  • SDIO_CMDCMPL_INT
  • SDIO_DTCMP_INT
  • SDIO_SBITERR_INT
  • SDIO_DTBLKCMPL_INT
  • SDIO_DOCMD_INT
  • SDIO_DOTX_INT
  • SDIO_DORX_INT
  • SDIO_TXBUFH_INT
  • SDIO_RXBUFH_INT
  • SDIO_TXBUFF_INT
  • SDIO_RXBUFF_INT
  • SDIO_TXBUFE_INT
  • SDIO_RXBUFE_INT
  • SDIO_TXBUF_INT
  • SDIO_RXBUF_INT
  • SDIO_SDIOIF_INT
new_state (TRUE or FALSE)
Return values
none

Definition at line 243 of file at32f415_sdio.c.

Referenced by sd_irq_service().

◆ sdio_io_function_enable()

void sdio_io_function_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the sd i/o function.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 556 of file at32f415_sdio.c.

◆ sdio_io_suspend_command_set()

void sdio_io_suspend_command_set | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable sd i/o suspend command sending.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 569 of file at32f415_sdio.c.

◆ sdio_power_saving_mode_enable()

void sdio_power_saving_mode_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable power saving mode, config sdio_ck clock output when the bus is idle.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 166 of file at32f415_sdio.c.

Referenced by sd_power_on().

◆ sdio_power_set()

void sdio_power_set | ( | sdio_type * | sdio_x,
 |  | sdio_power_state_type | power_state
 | ) |  |

set the power status of the controller

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
power_state this parameter can be one of the following values:
  • SDIO_POWER_OFF
  • SDIO_POWER_ON
Return values
none

Definition at line 75 of file at32f415_sdio.c.

Referenced by sd_power_off(), and sd_power_on().

◆ sdio_power_status_get()

flag_status sdio_power_status_get ( sdio_type * sdio_x )

get power status.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
Return values
flag_status (SET or RESET)

Definition at line 87 of file at32f415_sdio.c.

Referenced by sd_card_init().

◆ sdio_read_wait_mode_set()

void sdio_read_wait_mode_set | ( | sdio_type * | sdio_x,
 |  | sdio_read_wait_mode_type | mode
 | ) |  |

set the read wait mode.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
mode this parameter can be one of the following values:
  • SDIO_READ_WAIT_CONTROLLED_BY_D2
  • SDIO_READ_WAIT_CONTROLLED_BY_CK
Return values
none

Definition at line 517 of file at32f415_sdio.c.

◆ sdio_read_wait_start()

void sdio_read_wait_start | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable to start sd i/o read wait operation.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 530 of file at32f415_sdio.c.

◆ sdio_read_wait_stop()

void sdio_read_wait_stop | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable to stop sd i/o read wait operation.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 543 of file at32f415_sdio.c.

◆ sdio_reset()

void sdio_reset ( sdio_type * sdio_x )

reset the sdio register

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
Return values
none

Definition at line 51 of file at32f415_sdio.c.

Referenced by sd_init().

◆ sdio_response_get()

uint32_t sdio_response_get | ( | sdio_type * | sdio_x,
 |  | sdio_rsp_index_type | reg_index
 | ) |  |

get response received from the card for the last command.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
reg_index this parameter can be one of the following values:
  • SDIO_RSP1_INDEX
  • SDIO_RSP2_INDEX
  • SDIO_RSP3_INDEX
  • SDIO_RSP4_INDEX
Return values
uint32_t response register value

Definition at line 394 of file at32f415_sdio.c.

Referenced by __align(), check_card_programming(), command_rsp1_error(), command_rsp5_error(), command_rsp6_error(), mmc_stream_read(), mmc_stream_write(), mmc_switch(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_bus_wide_enable(), sd_card_init(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_power_on(), and sd_status_send().


AT32F415 Firmwary Library: SDIO_private_functions

Functions
SDIO_private_functions
AT32F415_periph_driver » SDIO

Functions

void | sdio_reset (sdio_type *sdio_x)
reset the sdio register More...
void | sdio_power_set (sdio_type *sdio_x, sdio_power_state_type power_state)
set the power status of the controller More...
flag_status | sdio_power_status_get (sdio_type *sdio_x)
get power status. More...
void | sdio_clock_config (sdio_type *sdio_x, uint16_t clk_div, sdio_edge_phase_type clk_edg)
config sdio clock More...
void | sdio_bus_width_config (sdio_type *sdio_x, sdio_bus_width_type width)
config sdio bus width More...
void | sdio_clock_bypass (sdio_type *sdio_x, confirm_state new_state)
enable or disable clock divider bypss More...
void | sdio_power_saving_mode_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable power saving mode, config sdio_ck clock output when the bus is idle. More...
void | sdio_flow_control_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable hardware flow control. More...
void | sdio_clock_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable sdio_ck output. More...
void | sdio_dma_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable dma. More...
void | sdio_interrupt_enable (sdio_type *sdio_x, uint32_t int_opt, confirm_state new_state)
config corresponding interrupt. More...
flag_status | sdio_flag_get (sdio_type *sdio_x, uint32_t flag)
get sdio flag. More...
void | sdio_flag_clear (sdio_type *sdio_x, uint32_t flag)
clear sdio flag. More...
void | sdio_command_config (sdio_type *sdio_x, sdio_command_struct_type *command_struct)
config sdio command. More...
void | sdio_command_state_machine_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable command path state machine(CPSM). More...
uint8_t | sdio_command_response_get (sdio_type *sdio_x)
get command index of last command for which response received. More...
uint32_t | sdio_response_get (sdio_type *sdio_x, sdio_rsp_index_type reg_index)
get response received from the card for the last command. More...
void | sdio_data_config (sdio_type *sdio_x, sdio_data_struct_type *data_struct)
config sdio data. More...
void | sdio_data_state_machine_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable data path state machine(DPSM). More...
uint32_t | sdio_data_counter_get (sdio_type *sdio_x)
get the number of remaining data bytes to be transferred. More...
uint32_t | sdio_data_read (sdio_type *sdio_x)
read a word data from sdio fifo. More...
uint32_t | sdio_buffer_counter_get (sdio_type *sdio_x)
get the number of words left to be written to or read from fifo.. More...
void | sdio_data_write (sdio_type *sdio_x, uint32_t data)
write one word data to fifo. More...
void | sdio_read_wait_mode_set (sdio_type *sdio_x, sdio_read_wait_mode_type mode)
set the read wait mode. More...
void | sdio_read_wait_start (sdio_type *sdio_x, confirm_state new_state)
enable or disable to start sd i/o read wait operation. More...
void | sdio_read_wait_stop (sdio_type *sdio_x, confirm_state new_state)
enable or disable to stop sd i/o read wait operation. More...
void | sdio_io_function_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable the sd i/o function. More...
void | sdio_io_suspend_command_set (sdio_type *sdio_x, confirm_state new_state)
enable or disable sd i/o suspend command sending. More...

Detailed Description

Function Documentation

◆ sdio_buffer_counter_get()

uint32_t sdio_buffer_counter_get ( sdio_type * sdio_x )

get the number of words left to be written to or read from fifo..

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
Return values
uint32_t number of words

Definition at line 488 of file at32f415_sdio.c.

◆ sdio_bus_width_config()

void sdio_bus_width_config | ( | sdio_type * | sdio_x,
 |  | sdio_bus_width_type | width
 | ) |  |

config sdio bus width

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
width this parameter can be one of the following values:
  • SDIO_BUS_WIDTH_D1
  • SDIO_BUS_WIDTH_D4
  • SDIO_BUS_WIDTH_D8
Return values
none

Definition at line 139 of file at32f415_sdio.c.

Referenced by sd_power_on(), and sd_wide_bus_operation_config().

◆ sdio_clock_bypass()

void sdio_clock_bypass | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable clock divider bypss

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 152 of file at32f415_sdio.c.

Referenced by sd_power_on().

◆ sdio_clock_config()

void sdio_clock_config | ( | sdio_type * | sdio_x,
 |  | uint16_t | clk_div,
 |  | sdio_edge_phase_type | clk_edg
 | ) |  |

config sdio clock

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
clk_div sdio clock divide factor(frequency = sdio_clk / [clk_psc + 2]).
clk_edg this parameter can be one of the following values:
  • SDIO_CLOCK_EDGE_RISING
  • SDIO_CLOCK_EDGE_FALLING
Return values
none

Definition at line 115 of file at32f415_sdio.c.

Referenced by sd_power_on().

◆ sdio_clock_enable()

void sdio_clock_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable sdio_ck output.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 192 of file at32f415_sdio.c.

Referenced by sd_power_on().

◆ sdio_command_config()

void sdio_command_config | ( | sdio_type * | sdio_x,
 |  | sdio_command_struct_type * | command_struct
 | ) |  |

config sdio command.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
command_struct : pointer to a sdio_command_struct_type structure that contains the configuration information for the sdio command.
Return values
none

Definition at line 340 of file at32f415_sdio.c.

Referenced by __align(), check_card_programming(), mmc_switch(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_bus_wide_enable(), sd_card_init(), sd_deselect_select(), sd_irq_service(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_power_on(), sd_status_send(), sd_switch(), and sdio_command_data_send().

◆ sdio_command_response_get()

uint8_t sdio_command_response_get ( sdio_type * sdio_x )

get command index of last command for which response received.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
uint8_t command index

Definition at line 376 of file at32f415_sdio.c.

Referenced by check_card_programming(), command_rsp1_error(), command_rsp4_error(), command_rsp5_error(), and command_rsp6_error().

◆ sdio_command_state_machine_enable()

void sdio_command_state_machine_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable command path state machine(CPSM).

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 363 of file at32f415_sdio.c.

Referenced by __align(), check_card_programming(), mmc_switch(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_bus_wide_enable(), sd_card_init(), sd_deselect_select(), sd_irq_service(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_power_on(), sd_status_send(), sd_switch(), and sdio_command_data_send().

◆ sdio_data_config()

void sdio_data_config | ( | sdio_type * | sdio_x,
 |  | sdio_data_struct_type * | data_struct
 | ) |  |

config sdio data.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
data_struct : pointer to a sdio_data_struct_type structure that contains the configuration information for the sdio data.
Return values
none

Definition at line 427 of file at32f415_sdio.c.

Referenced by __align(), mmc_stream_read(), mmc_stream_write(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_mult_blocks_read(), sd_mult_blocks_write(), and sdio_command_data_send().

◆ sdio_data_counter_get()

uint32_t sdio_data_counter_get ( sdio_type * sdio_x )

get the number of remaining data bytes to be transferred.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
Return values
uint32_t number of bytes

Definition at line 464 of file at32f415_sdio.c.

◆ sdio_data_read()

uint32_t sdio_data_read ( sdio_type * sdio_x )

read a word data from sdio fifo.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
Return values
uint32_t data received

Definition at line 476 of file at32f415_sdio.c.

Referenced by scr_find(), and sdio_command_data_send().

◆ sdio_data_state_machine_enable()

void sdio_data_state_machine_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable data path state machine(DPSM).

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 452 of file at32f415_sdio.c.

Referenced by __align(), mmc_stream_read(), mmc_stream_write(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_mult_blocks_read(), sd_mult_blocks_write(), and sdio_command_data_send().

◆ sdio_data_write()

void sdio_data_write | ( | sdio_type * | sdio_x,
 |  | uint32_t | data
 | ) |  |

write one word data to fifo.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
data data to be transferred.
Return values
none

Definition at line 501 of file at32f415_sdio.c.

Referenced by sdio_command_data_send().

◆ sdio_dma_enable()

void sdio_dma_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable dma.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 205 of file at32f415_sdio.c.

Referenced by sdio_command_data_send().

◆ sdio_flag_clear()

void sdio_flag_clear | ( | sdio_type * | sdio_x,
 |  | uint32_t | flag
 | ) |  |

clear sdio flag.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
int_opt this parameter can be any combination of the following values:
  • SDIO_CMDFAIL_FLAG
  • SDIO_DTFAIL_FLAG
  • SDIO_CMDTIMEOUT_FLAG
  • SDIO_DTTIMEOUT_FLAG
  • SDIO_TXERRU_FLAG
  • SDIO_RXERRO_FLAG
  • SDIO_CMDRSPCMPL_FLAG
  • SDIO_CMDCMPL_FLAG
  • SDIO_DTCMPL_FLAG
  • SDIO_SBITERR_FLAG
  • SDIO_DTBLKCMPL_FLAG
  • SDIO_SDIOIF_FLAG
Return values
none

Definition at line 326 of file at32f415_sdio.c.

Referenced by check_card_programming(), command_error(), command_rsp1_error(), command_rsp2_error(), command_rsp3_error(), command_rsp4_error(), command_rsp5_error(), command_rsp6_error(), command_rsp7_error(), mmc_stream_write(), scr_find(), sd_block_write(), sd_irq_service(), sd_mult_blocks_write(), and sdio_command_data_send().

◆ sdio_flag_get()

flag_status sdio_flag_get | ( | sdio_type * | sdio_x,
 |  | uint32_t | flag
 | ) |  |

get sdio flag.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
flag this parameter can be one of the following values:
  • SDIO_CMDFAIL_FLAG
  • SDIO_DTFAIL_FLAG
  • SDIO_CMDTIMEOUT_FLAG
  • SDIO_DTTIMEOUT_FLAG
  • SDIO_TXERRU_FLAG
  • SDIO_RXERRO_FLAG
  • SDIO_CMDRSPCMPL_FLAG
  • SDIO_CMDCMPL_FLAG
  • SDIO_DTCMPL_FLAG
  • SDIO_SBITERR_FLAG
  • SDIO_DTBLKCMPL_FLAG
  • SDIO_DOCMD_FLAG
  • SDIO_DOTX_FLAG
  • SDIO_DORX_FLAG
  • SDIO_TXBUFH_FLAG
  • SDIO_RXBUFH_FLAG
  • SDIO_TXBUFF_FLAG
  • SDIO_RXBUFF_FLAG
  • SDIO_TXBUFE_FLAG
  • SDIO_RXBUFE_FLAG
  • SDIO_TXBUF_FLAG
  • SDIO_RXBUF_FLAG
  • SDIO_SDIOIF_FLAG
Return values
flag_status (SET or RESET)

Definition at line 289 of file at32f415_sdio.c.

Referenced by check_card_programming(), command_error(), command_rsp1_error(), command_rsp2_error(), command_rsp3_error(), command_rsp4_error(), command_rsp5_error(), command_rsp6_error(), scr_find(), sd_irq_service(), and sdio_command_data_send().

◆ sdio_flow_control_enable()

void sdio_flow_control_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable hardware flow control.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 179 of file at32f415_sdio.c.

Referenced by sd_power_on().

◆ sdio_interrupt_enable()

void sdio_interrupt_enable | ( | sdio_type * | sdio_x,
 |  | uint32_t | int_opt,
 |  | confirm_state | new_state
 | ) |  |

config corresponding interrupt.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
int_opt this parameter can be one of the following values:
  • SDIO_CMDFAIL_INT
  • SDIO_DTFAIL_INT
  • SDIO_CMDTIMEOUT_INT
  • SDIO_DTTIMEOUT_INT
  • SDIO_TXERRU_INT
  • SDIO_RXERRO_INT
  • SDIO_CMDRSPCMPL_INT
  • SDIO_CMDCMPL_INT
  • SDIO_DTCMP_INT
  • SDIO_SBITERR_INT
  • SDIO_DTBLKCMPL_INT
  • SDIO_DOCMD_INT
  • SDIO_DOTX_INT
  • SDIO_DORX_INT
  • SDIO_TXBUFH_INT
  • SDIO_RXBUFH_INT
  • SDIO_TXBUFF_INT
  • SDIO_RXBUFF_INT
  • SDIO_TXBUFE_INT
  • SDIO_RXBUFE_INT
  • SDIO_TXBUF_INT
  • SDIO_RXBUF_INT
  • SDIO_SDIOIF_INT
new_state (TRUE or FALSE)
Return values
none

Definition at line 243 of file at32f415_sdio.c.

Referenced by sd_irq_service().

◆ sdio_io_function_enable()

void sdio_io_function_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the sd i/o function.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 556 of file at32f415_sdio.c.

◆ sdio_io_suspend_command_set()

void sdio_io_suspend_command_set | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable sd i/o suspend command sending.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 569 of file at32f415_sdio.c.

◆ sdio_power_saving_mode_enable()

void sdio_power_saving_mode_enable | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable power saving mode, config sdio_ck clock output when the bus is idle.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 166 of file at32f415_sdio.c.

Referenced by sd_power_on().

◆ sdio_power_set()

void sdio_power_set | ( | sdio_type * | sdio_x,
 |  | sdio_power_state_type | power_state
 | ) |  |

set the power status of the controller

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
power_state this parameter can be one of the following values:
  • SDIO_POWER_OFF
  • SDIO_POWER_ON
Return values
none

Definition at line 75 of file at32f415_sdio.c.

Referenced by sd_power_off(), and sd_power_on().

◆ sdio_power_status_get()

flag_status sdio_power_status_get ( sdio_type * sdio_x )

get power status.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
Return values
flag_status (SET or RESET)

Definition at line 87 of file at32f415_sdio.c.

Referenced by sd_card_init().

◆ sdio_read_wait_mode_set()

void sdio_read_wait_mode_set | ( | sdio_type * | sdio_x,
 |  | sdio_read_wait_mode_type | mode
 | ) |  |

set the read wait mode.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
mode this parameter can be one of the following values:
  • SDIO_READ_WAIT_CONTROLLED_BY_D2
  • SDIO_READ_WAIT_CONTROLLED_BY_CK
Return values
none

Definition at line 517 of file at32f415_sdio.c.

◆ sdio_read_wait_start()

void sdio_read_wait_start | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable to start sd i/o read wait operation.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 530 of file at32f415_sdio.c.

◆ sdio_read_wait_stop()

void sdio_read_wait_stop | ( | sdio_type * | sdio_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable to stop sd i/o read wait operation.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
new_state (TRUE or FALSE)
Return values
none

Definition at line 543 of file at32f415_sdio.c.

◆ sdio_reset()

void sdio_reset ( sdio_type * sdio_x )

reset the sdio register

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
Return values
none

Definition at line 51 of file at32f415_sdio.c.

Referenced by sd_init().

◆ sdio_response_get()

uint32_t sdio_response_get | ( | sdio_type * | sdio_x,
 |  | sdio_rsp_index_type | reg_index
 | ) |  |

get response received from the card for the last command.

Parameters
sdio_x to select the sdio peripheral. this parameter can be one of the following values:
SDIO1.
reg_index this parameter can be one of the following values:
  • SDIO_RSP1_INDEX
  • SDIO_RSP2_INDEX
  • SDIO_RSP3_INDEX
  • SDIO_RSP4_INDEX
Return values
uint32_t response register value

Definition at line 394 of file at32f415_sdio.c.

Referenced by __align(), check_card_programming(), command_rsp1_error(), command_rsp5_error(), command_rsp6_error(), mmc_stream_read(), mmc_stream_write(), mmc_switch(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_bus_wide_enable(), sd_card_init(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_power_on(), and sd_status_send().


AT32F415 Firmwary Library: SPI

Modules | Macros
SPI
AT32F415_periph_driver

SPI driver modules. More...

Modules

SPI_I2S_flags_definition
spi i2s flag

SPI_I2S_interrupts_definition
spi i2s interrupt

SPI_exported_types
SPI_exported_functions
SPI_private_functions

Macros

#define | SPI1 ((spi_type *) SPI1_BASE)
#define | SPI2 ((spi_type *) SPI2_BASE)

Detailed Description

SPI driver modules.

Macro Definition Documentation

◆ SPI1

#define SPI1 ((spi_type *) SPI1_BASE)

Definition at line 448 of file at32f415_spi.h.

◆ SPI2

#define SPI2 ((spi_type *) SPI2_BASE)

Definition at line 449 of file at32f415_spi.h.


AT32F415 Firmwary Library: SPI_I2S_flags_definition

Macros
SPI_I2S_flags_definition
AT32F415_periph_driver » SPI

spi i2s flag

More...

Macros

#define | SPI_I2S_RDBF_FLAG 0x0001
#define | SPI_I2S_TDBE_FLAG 0x0002
#define | I2S_ACS_FLAG 0x0004
#define | I2S_TUERR_FLAG 0x0008
#define | SPI_CCERR_FLAG 0x0010
#define | SPI_MMERR_FLAG 0x0020
#define | SPI_I2S_ROERR_FLAG 0x0040
#define | SPI_I2S_BF_FLAG 0x0080

Detailed Description

spi i2s flag

Macro Definition Documentation

◆ I2S_ACS_FLAG

#define I2S_ACS_FLAG 0x0004

i2s audio channel state flag

Definition at line 55 of file at32f415_spi.h.

◆ I2S_TUERR_FLAG

#define I2S_TUERR_FLAG 0x0008

i2s transmitter underload error flag

Definition at line 56 of file at32f415_spi.h.

◆ SPI_CCERR_FLAG

#define SPI_CCERR_FLAG 0x0010

spi crc calculation error flag

Definition at line 57 of file at32f415_spi.h.

◆ SPI_I2S_BF_FLAG

#define SPI_I2S_BF_FLAG 0x0080

spi or i2s busy flag

Definition at line 60 of file at32f415_spi.h.

◆ SPI_I2S_RDBF_FLAG

#define SPI_I2S_RDBF_FLAG 0x0001

spi or i2s receive data buffer full flag

Definition at line 53 of file at32f415_spi.h.

◆ SPI_I2S_ROERR_FLAG

#define SPI_I2S_ROERR_FLAG 0x0040

spi or i2s receiver overflow error flag

Definition at line 59 of file at32f415_spi.h.

◆ SPI_I2S_TDBE_FLAG

#define SPI_I2S_TDBE_FLAG 0x0002

spi or i2s transmit data buffer empty flag

Definition at line 54 of file at32f415_spi.h.

◆ SPI_MMERR_FLAG

#define SPI_MMERR_FLAG 0x0020

spi master mode error flag

Definition at line 58 of file at32f415_spi.h.


AT32F415 Firmwary Library: SPI_I2S_interrupts_definition

Macros
SPI_I2S_interrupts_definition
AT32F415_periph_driver » SPI

spi i2s interrupt

More...

Macros

#define | SPI_I2S_ERROR_INT 0x0020
#define | SPI_I2S_RDBF_INT 0x0040
#define | SPI_I2S_TDBE_INT 0x0080

Detailed Description

spi i2s interrupt

Macro Definition Documentation

◆ SPI_I2S_ERROR_INT

#define SPI_I2S_ERROR_INT 0x0020

error interrupt

Definition at line 72 of file at32f415_spi.h.

◆ SPI_I2S_RDBF_INT

#define SPI_I2S_RDBF_INT 0x0040

receive data buffer full interrupt

Definition at line 73 of file at32f415_spi.h.

◆ SPI_I2S_TDBE_INT

#define SPI_I2S_TDBE_INT 0x0080

transmit data buffer empty interrupt

Definition at line 74 of file at32f415_spi.h.


AT32F415 Firmwary Library: SPI_exported_types

Data Structures | Enumerations
SPI_exported_types
AT32F415_periph_driver » SPI

Data Structures

struct | spi_init_type
spi init type More...
struct | i2s_init_type
i2s init type More...
struct | spi_type
type define spi register all More...

Enumerations

enum | spi_frame_bit_num_type { SPI_FRAME_8BIT = 0x00 , SPI_FRAME_16BIT = 0x01 }
spi frame bit num type More...
enum | spi_master_slave_mode_type { SPI_MODE_SLAVE = 0x00 , SPI_MODE_MASTER = 0x01 }
spi master/slave mode type More...
enum | spi_clock_polarity_type { SPI_CLOCK_POLARITY_LOW = 0x00 , SPI_CLOCK_POLARITY_HIGH = 0x01 }
spi clock polarity (clkpol) type More...
enum | spi_clock_phase_type { SPI_CLOCK_PHASE_1EDGE = 0x00 , SPI_CLOCK_PHASE_2EDGE = 0x01 }
spi clock phase (clkpha) type More...
enum | spi_cs_mode_type { SPI_CS_HARDWARE_MODE = 0x00 , SPI_CS_SOFTWARE_MODE = 0x01 }
spi cs mode type More...
enum spi_mclk_freq_div_type {
SPI_MCLK_DIV_2 = 0x00 , SPI_MCLK_DIV_4 = 0x01 , SPI_MCLK_DIV_8 = 0x02 , SPI_MCLK_DIV_16 = 0x03 ,
SPI_MCLK_DIV_32 = 0x04 , SPI_MCLK_DIV_64 = 0x05 , SPI_MCLK_DIV_128 = 0x06 , SPI_MCLK_DIV_256 = 0x07 ,
SPI_MCLK_DIV_512 = 0x08 , SPI_MCLK_DIV_1024 = 0x09
}
spi master clock frequency division type More...
enum | spi_first_bit_type { SPI_FIRST_BIT_MSB = 0x00 , SPI_FIRST_BIT_LSB = 0x01 }
spi transmit first bit (lsb/msb) type More...
enum | spi_transmission_mode_type { SPI_TRANSMIT_FULL_DUPLEX = 0x00 , SPI_TRANSMIT_SIMPLEX_RX = 0x01 , SPI_TRANSMIT_HALF_DUPLEX_RX = 0x02 , SPI_TRANSMIT_HALF_DUPLEX_TX = 0x03 }
spi transmission mode type More...
enum | spi_crc_direction_type { SPI_CRC_RX = 0x0014 , SPI_CRC_TX = 0x0018 }
spi crc direction type More...
enum | spi_half_duplex_direction_type { SPI_HALF_DUPLEX_DIRECTION_RX = 0x00 , SPI_HALF_DUPLEX_DIRECTION_TX = 0x01 }
spi single line bidirectional direction type More...
enum | spi_software_cs_level_type { SPI_SWCS_INTERNAL_LEVEL_LOW = 0x00 , SPI_SWCS_INTERNAL_LEVEL_HIGHT = 0x01 }
spi software cs internal level type More...
enum i2s_audio_protocol_type {
I2S_AUDIO_PROTOCOL_PHILLIPS = 0x00 , I2S_AUDIO_PROTOCOL_MSB = 0x01 , I2S_AUDIO_PROTOCOL_LSB = 0x02 , I2S_AUDIO_PROTOCOL_PCM_SHORT = 0x03 ,
I2S_AUDIO_PROTOCOL_PCM_LONG = 0x04
}
i2s audio protocol type More...
enum i2s_audio_sampling_freq_type {
I2S_AUDIO_FREQUENCY_DEFAULT = 2 , I2S_AUDIO_FREQUENCY_8K = 8000 , I2S_AUDIO_FREQUENCY_11_025K = 11025 , I2S_AUDIO_FREQUENCY_16K = 16000 ,
I2S_AUDIO_FREQUENCY_22_05K = 22050 , I2S_AUDIO_FREQUENCY_32K = 32000 , I2S_AUDIO_FREQUENCY_44_1K = 44100 , I2S_AUDIO_FREQUENCY_48K = 48000 ,
I2S_AUDIO_FREQUENCY_96K = 96000 , I2S_AUDIO_FREQUENCY_192K = 192000
}
i2s audio frequency type More...
enum | i2s_data_channel_format_type { I2S_DATA_16BIT_CHANNEL_16BIT = 0x01 , I2S_DATA_16BIT_CHANNEL_32BIT = 0x02 , I2S_DATA_24BIT_CHANNEL_32BIT = 0x03 , I2S_DATA_32BIT_CHANNEL_32BIT = 0x04 }
i2s data bit num and channel bit num type More...
enum | i2s_operation_mode_type { I2S_MODE_SLAVE_TX = 0x00 , I2S_MODE_SLAVE_RX = 0x01 , I2S_MODE_MASTER_TX = 0x02 , I2S_MODE_MASTER_RX = 0x03 }
i2s operation mode type More...
enum | i2s_clock_polarity_type { I2S_CLOCK_POLARITY_LOW = 0x00 , I2S_CLOCK_POLARITY_HIGH = 0x01 }
i2s clock polarity type More...

Detailed Description

Enumeration Type Documentation

◆ i2s_audio_protocol_type

enum i2s_audio_protocol_type

i2s audio protocol type

Enumerator
I2S_AUDIO_PROTOCOL_PHILLIPS | i2s philip standard
I2S_AUDIO_PROTOCOL_MSB | msb-justified standard
I2S_AUDIO_PROTOCOL_LSB | lsb-justified standard
I2S_AUDIO_PROTOCOL_PCM_SHORT | pcm standard-short frame
I2S_AUDIO_PROTOCOL_PCM_LONG | pcm standard-long frame

Definition at line 196 of file at32f415_spi.h.

◆ i2s_audio_sampling_freq_type

enum i2s_audio_sampling_freq_type

i2s audio frequency type

Enumerator
I2S_AUDIO_FREQUENCY_DEFAULT | i2s audio sampling frequency default
I2S_AUDIO_FREQUENCY_8K | i2s audio sampling frequency 8k
I2S_AUDIO_FREQUENCY_11_025K | i2s audio sampling frequency 11.025k
I2S_AUDIO_FREQUENCY_16K | i2s audio sampling frequency 16k
I2S_AUDIO_FREQUENCY_22_05K | i2s audio sampling frequency 22.05k
I2S_AUDIO_FREQUENCY_32K | i2s audio sampling frequency 32k
I2S_AUDIO_FREQUENCY_44_1K | i2s audio sampling frequency 44.1k
I2S_AUDIO_FREQUENCY_48K | i2s audio sampling frequency 48k
I2S_AUDIO_FREQUENCY_96K | i2s audio sampling frequency 96k
I2S_AUDIO_FREQUENCY_192K | i2s audio sampling frequency 192k

Definition at line 208 of file at32f415_spi.h.

◆ i2s_clock_polarity_type

enum i2s_clock_polarity_type

i2s clock polarity type

Enumerator
I2S_CLOCK_POLARITY_LOW | i2s clock steady state is low level
I2S_CLOCK_POLARITY_HIGH | i2s clock steady state is high level

Definition at line 247 of file at32f415_spi.h.

◆ i2s_data_channel_format_type

enum i2s_data_channel_format_type

i2s data bit num and channel bit num type

Enumerator
I2S_DATA_16BIT_CHANNEL_16BIT | 16-bit data packed in 16-bit channel frame
I2S_DATA_16BIT_CHANNEL_32BIT | 16-bit data packed in 32-bit channel frame
I2S_DATA_24BIT_CHANNEL_32BIT | 24-bit data packed in 32-bit channel frame
I2S_DATA_32BIT_CHANNEL_32BIT | 32-bit data packed in 32-bit channel frame

Definition at line 225 of file at32f415_spi.h.

◆ i2s_operation_mode_type

enum i2s_operation_mode_type

i2s operation mode type

Enumerator
I2S_MODE_SLAVE_TX | slave transmission mode
I2S_MODE_SLAVE_RX | slave reception mode
I2S_MODE_MASTER_TX | master transmission mode
I2S_MODE_MASTER_RX | master reception mode

Definition at line 236 of file at32f415_spi.h.

◆ spi_clock_phase_type

enum spi_clock_phase_type

spi clock phase (clkpha) type

Enumerator
SPI_CLOCK_PHASE_1EDGE | data capture start from the first clock edge
SPI_CLOCK_PHASE_2EDGE | data capture start from the second clock edge

Definition at line 114 of file at32f415_spi.h.

◆ spi_clock_polarity_type

enum spi_clock_polarity_type

spi clock polarity (clkpol) type

Enumerator
SPI_CLOCK_POLARITY_LOW | sck keeps low at idle state
SPI_CLOCK_POLARITY_HIGH | sck keeps high at idle state

Definition at line 105 of file at32f415_spi.h.

◆ spi_crc_direction_type

enum spi_crc_direction_type

spi crc direction type

Enumerator
SPI_CRC_RX | crc direction is rx
SPI_CRC_TX | crc direction is tx

Definition at line 169 of file at32f415_spi.h.

◆ spi_cs_mode_type

enum spi_cs_mode_type

spi cs mode type

Enumerator
SPI_CS_HARDWARE_MODE | cs is hardware mode
SPI_CS_SOFTWARE_MODE | cs is software mode

Definition at line 123 of file at32f415_spi.h.

◆ spi_first_bit_type

enum spi_first_bit_type

spi transmit first bit (lsb/msb) type

Enumerator
SPI_FIRST_BIT_MSB | the frame format is msb first
SPI_FIRST_BIT_LSB | the frame format is lsb first

Definition at line 149 of file at32f415_spi.h.

◆ spi_frame_bit_num_type

enum spi_frame_bit_num_type

spi frame bit num type

Enumerator
SPI_FRAME_8BIT | 8-bit data frame format
SPI_FRAME_16BIT | 16-bit data frame format

Definition at line 87 of file at32f415_spi.h.

◆ spi_half_duplex_direction_type

enum spi_half_duplex_direction_type

spi single line bidirectional direction type

Enumerator
SPI_HALF_DUPLEX_DIRECTION_RX | single line bidirectional half duplex mode direction: receive(slbtd = 0)
SPI_HALF_DUPLEX_DIRECTION_TX | single line bidirectional half duplex mode direction: transmit(slbtd = 1)

Definition at line 178 of file at32f415_spi.h.

◆ spi_master_slave_mode_type

enum spi_master_slave_mode_type

spi master/slave mode type

Enumerator
SPI_MODE_SLAVE | select as slave mode
SPI_MODE_MASTER | select as master mode

Definition at line 96 of file at32f415_spi.h.

◆ spi_mclk_freq_div_type

enum spi_mclk_freq_div_type

spi master clock frequency division type

Enumerator
SPI_MCLK_DIV_2 | master clock frequency division 2
SPI_MCLK_DIV_4 | master clock frequency division 4
SPI_MCLK_DIV_8 | master clock frequency division 8
SPI_MCLK_DIV_16 | master clock frequency division 16
SPI_MCLK_DIV_32 | master clock frequency division 32
SPI_MCLK_DIV_64 | master clock frequency division 64
SPI_MCLK_DIV_128 | master clock frequency division 128
SPI_MCLK_DIV_256 | master clock frequency division 256
SPI_MCLK_DIV_512 | master clock frequency division 512
SPI_MCLK_DIV_1024 | master clock frequency division 1024

Definition at line 132 of file at32f415_spi.h.

◆ spi_software_cs_level_type

enum spi_software_cs_level_type

spi software cs internal level type

Enumerator
SPI_SWCS_INTERNAL_LEVEL_LOW | internal level low
SPI_SWCS_INTERNAL_LEVEL_HIGHT | internal level high

Definition at line 187 of file at32f415_spi.h.

◆ spi_transmission_mode_type

enum spi_transmission_mode_type

spi transmission mode type

Enumerator
SPI_TRANSMIT_FULL_DUPLEX | dual line unidirectional full-duplex mode(slben = 0 and ora = 0)
SPI_TRANSMIT_SIMPLEX_RX | dual line unidirectional simplex receive-only mode(slben = 0 and ora = 1)
SPI_TRANSMIT_HALF_DUPLEX_RX | single line bidirectional half duplex mode-receiving(slben = 1 and slbtd = 0)
SPI_TRANSMIT_HALF_DUPLEX_TX | single line bidirectional half duplex mode-transmitting(slben = 1 and slbtd = 1)

Definition at line 158 of file at32f415_spi.h.


AT32F415 Firmwary Library: spi_init_type Struct Reference

Data Fields
spi_init_type Struct Reference
AT32F415_periph_driver » SPI » SPI_exported_types

spi init type More...

#include <at32f415_spi.h>

Data Fields

spi_transmission_mode_type transmission_mode
spi_master_slave_mode_type master_slave_mode
spi_mclk_freq_div_type mclk_freq_division
spi_first_bit_type first_bit_transmission
spi_frame_bit_num_type frame_bit_num
spi_clock_polarity_type clock_polarity
spi_clock_phase_type clock_phase
spi_cs_mode_type cs_mode_selection

Detailed Description

spi init type

Definition at line 256 of file at32f415_spi.h.

Field Documentation

◆ clock_phase

spi_clock_phase_type spi_init_type::clock_phase

clock phase selection

Definition at line 264 of file at32f415_spi.h.

Referenced by spi_config(), spi_default_para_init(), spi_init(), spiflash_init(), and usart_spi_configuration().

◆ clock_polarity

spi_clock_polarity_type spi_init_type::clock_polarity

clock polarity selection

Definition at line 263 of file at32f415_spi.h.

Referenced by spi_config(), spi_default_para_init(), spi_init(), spiflash_init(), and usart_spi_configuration().

◆ cs_mode_selection

spi_cs_mode_type spi_init_type::cs_mode_selection

hardware or software cs mode selection

Definition at line 265 of file at32f415_spi.h.

Referenced by spi_config(), spi_default_para_init(), spi_init(), spiflash_init(), and usart_spi_configuration().

◆ first_bit_transmission

spi_first_bit_type spi_init_type::first_bit_transmission

transmit lsb or msb selection

Definition at line 261 of file at32f415_spi.h.

Referenced by spi_config(), spi_default_para_init(), spi_init(), spiflash_init(), and usart_spi_configuration().

◆ frame_bit_num

spi_frame_bit_num_type spi_init_type::frame_bit_num

frame bit num 8 or 16 bit selection

Definition at line 262 of file at32f415_spi.h.

Referenced by spi_config(), spi_default_para_init(), spi_init(), spiflash_init(), and usart_spi_configuration().

◆ master_slave_mode

spi_master_slave_mode_type spi_init_type::master_slave_mode

master or slave mode selection

Definition at line 259 of file at32f415_spi.h.

Referenced by main(), spi_config(), spi_default_para_init(), spi_init(), spiflash_init(), and usart_spi_configuration().

◆ mclk_freq_division

spi_mclk_freq_div_type spi_init_type::mclk_freq_division

master clock frequency division selection

Definition at line 260 of file at32f415_spi.h.

Referenced by spi_config(), spi_default_para_init(), spi_init(), and spiflash_init().

◆ transmission_mode

spi_transmission_mode_type spi_init_type::transmission_mode

transmission mode selection

Definition at line 258 of file at32f415_spi.h.

Referenced by main(), spi_config(), spi_default_para_init(), spi_init(), spiflash_init(), and usart_spi_configuration().

The documentation for this struct was generated from the following file:
  • at32f415_spi.h


AT32F415 Firmwary Library: i2s_init_type Struct Reference

Data Fields
i2s_init_type Struct Reference
AT32F415_periph_driver » SPI » SPI_exported_types

i2s init type More...

#include <at32f415_spi.h>

Data Fields

i2s_operation_mode_type operation_mode
i2s_audio_protocol_type audio_protocol
i2s_audio_sampling_freq_type audio_sampling_freq
i2s_data_channel_format_type data_channel_format
i2s_clock_polarity_type clock_polarity
confirm_state mclk_output_enable

Detailed Description

i2s init type

Definition at line 271 of file at32f415_spi.h.

Field Documentation

◆ audio_protocol

i2s_audio_protocol_type i2s_init_type::audio_protocol

audio protocol selection

Definition at line 274 of file at32f415_spi.h.

Referenced by codec_i2s_init(), i2s_config(), i2s_default_para_init(), and i2s_init().

◆ audio_sampling_freq

i2s_audio_sampling_freq_type i2s_init_type::audio_sampling_freq

audio frequency selection

Definition at line 275 of file at32f415_spi.h.

Referenced by codec_i2s_init(), i2s_config(), i2s_default_para_init(), and i2s_init().

◆ clock_polarity

i2s_clock_polarity_type i2s_init_type::clock_polarity

clock polarity selection

Definition at line 277 of file at32f415_spi.h.

Referenced by codec_i2s_init(), i2s_config(), i2s_default_para_init(), and i2s_init().

◆ data_channel_format

i2s_data_channel_format_type i2s_init_type::data_channel_format

data bit num and channel bit num selection

Definition at line 276 of file at32f415_spi.h.

Referenced by codec_i2s_init(), i2s_config(), i2s_default_para_init(), and i2s_init().

◆ mclk_output_enable

confirm_state i2s_init_type::mclk_output_enable

mclk_output selection

Definition at line 278 of file at32f415_spi.h.

Referenced by codec_i2s_init(), i2s_config(), i2s_default_para_init(), and i2s_init().

◆ operation_mode

i2s_operation_mode_type i2s_init_type::operation_mode

operation mode selection

Definition at line 273 of file at32f415_spi.h.

Referenced by codec_i2s_init(), i2s_config(), i2s_default_para_init(), and i2s_init().

The documentation for this struct was generated from the following file:
  • at32f415_spi.h


AT32F415 Firmwary Library: spi_type Struct Reference

Data Fields
spi_type Struct Reference
AT32F415_periph_driver » SPI » SPI_exported_types

type define spi register all More...

#include <at32f415_spi.h>

Data Fields

union {
__IO uint32_t ctrl1
struct {
__IO uint32_t clkpha: 1
__IO uint32_t clkpol: 1
__IO uint32_t msten: 1
__IO uint32_t mdiv_l: 3
__IO uint32_t spien: 1
__IO uint32_t ltf: 1
__IO uint32_t swcsil: 1
__IO uint32_t swcsen: 1
__IO uint32_t ora: 1
__IO uint32_t fbn: 1
__IO uint32_t ntc: 1
__IO uint32_t ccen: 1
__IO uint32_t slbtd: 1
__IO uint32_t slben: 1
__IO uint32_t reserved1: 16
} ctrl1_bit
};
spi ctrl1 register, offset:0x00 More...
union {
__IO uint32_t ctrl2
struct {
__IO uint32_t dmaren: 1
__IO uint32_t dmaten: 1
__IO uint32_t hwcsoe: 1
__IO uint32_t reserved1: 2
__IO uint32_t errie: 1
__IO uint32_t rdbfie: 1
__IO uint32_t tdbeie: 1
__IO uint32_t mdiv_h: 1
__IO uint32_t reserved2: 23
} ctrl2_bit
};
spi ctrl2 register, offset:0x04 More...
union {
__IO uint32_t sts
struct {
__IO uint32_t rdbf: 1
__IO uint32_t tdbe: 1
__IO uint32_t acs: 1
__IO uint32_t tuerr: 1
__IO uint32_t ccerr: 1
__IO uint32_t mmerr: 1
__IO uint32_t roerr: 1
__IO uint32_t bf: 1
__IO uint32_t reserved1: 24
} sts_bit
};
spi sts register, offset:0x08 More...
union {
__IO uint32_t dt
struct {
__IO uint32_t dt: 16
__IO uint32_t reserved1: 16
} dt_bit
};
spi dt register, offset:0x0C More...
union {
__IO uint32_t cpoly
struct {
__IO uint32_t cpoly: 16
__IO uint32_t reserved1: 16
} cpoly_bit
};
spi cpoly register, offset:0x10 More...
union {
__IO uint32_t rcrc
struct {
__IO uint32_t rcrc: 16
__IO uint32_t reserved1: 16
} rcrc_bit
};
spi rcrc register, offset:0x14 More...
union {
__IO uint32_t tcrc
struct {
__IO uint32_t tcrc: 16
__IO uint32_t reserved1: 16
} tcrc_bit
};
spi tcrc register, offset:0x18 More...
union {
__IO uint32_t i2sctrl
struct {
__IO uint32_t i2scbn: 1
__IO uint32_t i2sdbn: 2
__IO uint32_t i2sclkpol: 1
__IO uint32_t stdsel: 2
__IO uint32_t reserved1: 1
__IO uint32_t pcmfssel: 1
__IO uint32_t opersel: 2
__IO uint32_t i2sen: 1
__IO uint32_t i2smsel: 1
__IO uint32_t reserved2: 20
} i2sctrl_bit
};
spi i2sctrl register, offset:0x1C More...
union {
__IO uint32_t i2sclk
struct {
__IO uint32_t i2sdiv_l: 8
__IO uint32_t i2sodd: 1
__IO uint32_t i2smclkoe: 1
__IO uint32_t i2sdiv_h: 2
__IO uint32_t reserved1: 20
} i2sclk_bit
};
spi i2sclk register, offset:0x20 More...

Detailed Description

type define spi register all

Definition at line 284 of file at32f415_spi.h.

Field Documentation

◆

union { ... } spi_type::@566

spi ctrl1 register, offset:0x00

◆

union { ... } spi_type::@568

spi ctrl2 register, offset:0x04

◆

union { ... } spi_type::@570

spi sts register, offset:0x08

◆

union { ... } spi_type::@572

spi dt register, offset:0x0C

◆

union { ... } spi_type::@574

spi cpoly register, offset:0x10

◆

union { ... } spi_type::@576

spi rcrc register, offset:0x14

◆

union { ... } spi_type::@578

spi tcrc register, offset:0x18

◆

union { ... } spi_type::@580

spi i2sctrl register, offset:0x1C

◆

union { ... } spi_type::@582

spi i2sclk register, offset:0x20

◆ acs

__IO uint32_t spi_type::acs

Definition at line 343 of file at32f415_spi.h.

◆ bf

__IO uint32_t spi_type::bf

Definition at line 348 of file at32f415_spi.h.

◆ ccen

__IO uint32_t spi_type::ccen

Definition at line 306 of file at32f415_spi.h.

Referenced by spi_crc_enable().

◆ ccerr

__IO uint32_t spi_type::ccerr

Definition at line 345 of file at32f415_spi.h.

◆ clkpha

__IO uint32_t spi_type::clkpha

Definition at line 295 of file at32f415_spi.h.

Referenced by spi_init().

◆ clkpol

__IO uint32_t spi_type::clkpol

Definition at line 296 of file at32f415_spi.h.

Referenced by spi_init().

◆ cpoly

__IO uint32_t spi_type::cpoly

Definition at line 371 of file at32f415_spi.h.

Referenced by spi_crc_polynomial_get(), and spi_crc_polynomial_set().

◆

struct { ... } spi_type::cpoly_bit

Referenced by spi_crc_polynomial_get(), and spi_crc_polynomial_set().

◆ ctrl1

__IO uint32_t spi_type::ctrl1

Definition at line 292 of file at32f415_spi.h.

Referenced by spi_i2s_flag_clear().

◆

struct { ... } spi_type::ctrl1_bit

Referenced by spi_crc_enable(), spi_crc_next_transmit(), spi_enable(), spi_frame_bit_num_set(), spi_half_duplex_direction_set(), spi_init(), and spi_software_cs_internal_level_set().

◆ ctrl2

__IO uint32_t spi_type::ctrl2

Definition at line 318 of file at32f415_spi.h.

Referenced by spi_i2s_interrupt_enable().

◆

struct { ... } spi_type::ctrl2_bit

Referenced by spi_hardware_cs_output_enable(), spi_i2s_dma_receiver_enable(), spi_i2s_dma_transmitter_enable(), and spi_init().

◆ dmaren

__IO uint32_t spi_type::dmaren

Definition at line 321 of file at32f415_spi.h.

Referenced by spi_i2s_dma_receiver_enable().

◆ dmaten

__IO uint32_t spi_type::dmaten

Definition at line 322 of file at32f415_spi.h.

Referenced by spi_i2s_dma_transmitter_enable().

◆ dt

__IO uint32_t spi_type::dt

Definition at line 358 of file at32f415_spi.h.

Referenced by spi_i2s_data_receive(), spi_i2s_data_transmit(), and spi_i2s_flag_clear().

◆

struct { ... } spi_type::dt_bit

◆ errie

__IO uint32_t spi_type::errie

Definition at line 325 of file at32f415_spi.h.

◆ fbn

__IO uint32_t spi_type::fbn

Definition at line 304 of file at32f415_spi.h.

Referenced by spi_frame_bit_num_set(), and spi_init().

◆ hwcsoe

__IO uint32_t spi_type::hwcsoe

Definition at line 323 of file at32f415_spi.h.

Referenced by spi_hardware_cs_output_enable().

◆ i2scbn

__IO uint32_t spi_type::i2scbn

Definition at line 413 of file at32f415_spi.h.

Referenced by i2s_init().

◆ i2sclk

__IO uint32_t spi_type::i2sclk

Definition at line 431 of file at32f415_spi.h.

◆

struct { ... } spi_type::i2sclk_bit

Referenced by i2s_init().

◆ i2sclkpol

__IO uint32_t spi_type::i2sclkpol

Definition at line 415 of file at32f415_spi.h.

Referenced by i2s_init().

◆ i2sctrl

__IO uint32_t spi_type::i2sctrl

Definition at line 410 of file at32f415_spi.h.

◆

struct { ... } spi_type::i2sctrl_bit

Referenced by i2s_enable(), i2s_init(), and spi_init().

◆ i2sdbn

__IO uint32_t spi_type::i2sdbn

Definition at line 414 of file at32f415_spi.h.

Referenced by i2s_init().

◆ i2sdiv_h

__IO uint32_t spi_type::i2sdiv_h

Definition at line 437 of file at32f415_spi.h.

Referenced by i2s_init().

◆ i2sdiv_l

__IO uint32_t spi_type::i2sdiv_l

Definition at line 434 of file at32f415_spi.h.

Referenced by i2s_init().

◆ i2sen

__IO uint32_t spi_type::i2sen

Definition at line 420 of file at32f415_spi.h.

Referenced by i2s_enable().

◆ i2smclkoe

__IO uint32_t spi_type::i2smclkoe

Definition at line 436 of file at32f415_spi.h.

Referenced by i2s_init().

◆ i2smsel

__IO uint32_t spi_type::i2smsel

Definition at line 421 of file at32f415_spi.h.

Referenced by i2s_init(), and spi_init().

◆ i2sodd

__IO uint32_t spi_type::i2sodd

Definition at line 435 of file at32f415_spi.h.

Referenced by i2s_init().

◆ ltf

__IO uint32_t spi_type::ltf

Definition at line 300 of file at32f415_spi.h.

Referenced by spi_init().

◆ mdiv_h

__IO uint32_t spi_type::mdiv_h

Definition at line 328 of file at32f415_spi.h.

Referenced by spi_init().

◆ mdiv_l

__IO uint32_t spi_type::mdiv_l

Definition at line 298 of file at32f415_spi.h.

Referenced by spi_init().

◆ mmerr

__IO uint32_t spi_type::mmerr

Definition at line 346 of file at32f415_spi.h.

◆ msten

__IO uint32_t spi_type::msten

Definition at line 297 of file at32f415_spi.h.

Referenced by spi_init().

◆ ntc

__IO uint32_t spi_type::ntc

Definition at line 305 of file at32f415_spi.h.

Referenced by spi_crc_next_transmit().

◆ opersel

__IO uint32_t spi_type::opersel

Definition at line 419 of file at32f415_spi.h.

Referenced by i2s_init().

◆ ora

__IO uint32_t spi_type::ora

Definition at line 303 of file at32f415_spi.h.

Referenced by spi_init().

◆ pcmfssel

__IO uint32_t spi_type::pcmfssel

Definition at line 418 of file at32f415_spi.h.

Referenced by i2s_init().

◆ rcrc

__IO uint32_t spi_type::rcrc

Definition at line 384 of file at32f415_spi.h.

Referenced by spi_crc_value_get().

◆

struct { ... } spi_type::rcrc_bit

Referenced by spi_crc_value_get().

◆ rdbf

__IO uint32_t spi_type::rdbf

Definition at line 341 of file at32f415_spi.h.

◆ rdbfie

__IO uint32_t spi_type::rdbfie

Definition at line 326 of file at32f415_spi.h.

◆ reserved1

__IO uint32_t spi_type::reserved1

Definition at line 309 of file at32f415_spi.h.

◆ reserved2

__IO uint32_t spi_type::reserved2

Definition at line 329 of file at32f415_spi.h.

◆ roerr

__IO uint32_t spi_type::roerr

Definition at line 347 of file at32f415_spi.h.

◆ slben

__IO uint32_t spi_type::slben

Definition at line 308 of file at32f415_spi.h.

Referenced by spi_init().

◆ slbtd

__IO uint32_t spi_type::slbtd

Definition at line 307 of file at32f415_spi.h.

Referenced by spi_half_duplex_direction_set(), and spi_init().

◆ spien

__IO uint32_t spi_type::spien

Definition at line 299 of file at32f415_spi.h.

Referenced by spi_enable().

◆ stdsel

__IO uint32_t spi_type::stdsel

Definition at line 416 of file at32f415_spi.h.

Referenced by i2s_init().

◆ sts

__IO uint32_t spi_type::sts

Definition at line 338 of file at32f415_spi.h.

Referenced by spi_i2s_flag_clear(), and spi_i2s_flag_get().

◆

struct { ... } spi_type::sts_bit

◆ swcsen

__IO uint32_t spi_type::swcsen

Definition at line 302 of file at32f415_spi.h.

Referenced by spi_init().

◆ swcsil

__IO uint32_t spi_type::swcsil

Definition at line 301 of file at32f415_spi.h.

Referenced by spi_init(), and spi_software_cs_internal_level_set().

◆ tcrc

__IO uint32_t spi_type::tcrc

Definition at line 397 of file at32f415_spi.h.

Referenced by spi_crc_value_get().

◆

struct { ... } spi_type::tcrc_bit

Referenced by spi_crc_value_get().

◆ tdbe

__IO uint32_t spi_type::tdbe

Definition at line 342 of file at32f415_spi.h.

◆ tdbeie

__IO uint32_t spi_type::tdbeie

Definition at line 327 of file at32f415_spi.h.

◆ tuerr

__IO uint32_t spi_type::tuerr

Definition at line 344 of file at32f415_spi.h.

The documentation for this struct was generated from the following file:
  • at32f415_spi.h


AT32F415 Firmwary Library: SPI_exported_functions

Functions
SPI_exported_functions
AT32F415_periph_driver » SPI

Functions

void | spi_i2s_reset (spi_type *spi_x)
spi reset by crm reset register More...
void | spi_default_para_init (spi_init_type *spi_init_struct)
spi init config with its default value. More...
void | spi_init (spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value. More...
void | spi_crc_next_transmit (spi_type *spi_x)
spi next transmit crc for the spi peripheral. More...
void | spi_crc_polynomial_set (spi_type *spi_x, uint16_t crc_poly)
set the crc polynomial value for the spi peripheral. More...
uint16_t | spi_crc_polynomial_get (spi_type *spi_x)
return the crc polynomial register value for the spi peripheral. More...
void | spi_crc_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the hardware crc calculation for the spi peripheral. More...
uint16_t | spi_crc_value_get (spi_type *spi_x, spi_crc_direction_type crc_direction)
return the transmit or the receive crc value for the spi peripheral. More...
void | spi_hardware_cs_output_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the hardware cs output for the spi peripheral. More...
void | spi_software_cs_internal_level_set (spi_type *spi_x, spi_software_cs_level_type level)
set the software cs internal level for the spi peripheral. More...
void | spi_frame_bit_num_set (spi_type *spi_x, spi_frame_bit_num_type bit_num)
set the data frame bit num for the spi peripheral. More...
void | spi_half_duplex_direction_set (spi_type *spi_x, spi_half_duplex_direction_type direction)
set the data transmission direction in single line bidirectiona half duplex mode of the spi peripheral. More...
void | spi_enable (spi_type *spi_x, confirm_state new_state)
enable or disable spi. More...
void | i2s_default_para_init (i2s_init_type *i2s_init_struct)
i2s init config with its default value. More...
void | i2s_init (spi_type *spi_x, i2s_init_type *i2s_init_struct)
i2s init config with its setting value. More...
void | i2s_enable (spi_type *spi_x, confirm_state new_state)
enable or disable i2s. More...
void | spi_i2s_interrupt_enable (spi_type *spi_x, uint32_t spi_i2s_int, confirm_state new_state)
enable or disable the specified spi/i2s interrupts. More...
void | spi_i2s_dma_transmitter_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma transmitter mode. More...
void | spi_i2s_dma_receiver_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma receiver mode. More...
void | spi_i2s_data_transmit (spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit More...
uint16_t | spi_i2s_data_receive (spi_type *spi_x)
spi/i2s data receive More...
flag_status | spi_i2s_flag_get (spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral. More...
void | spi_i2s_flag_clear (spi_type *spi_x, uint32_t spi_i2s_flag)
clear flag of the specified spi/i2s peripheral. More...

Detailed Description

Function Documentation

◆ i2s_default_para_init()

void i2s_default_para_init ( i2s_init_type * i2s_init_struct )

i2s init config with its default value.

Parameters
i2s_init_struct : pointer to a i2s_init_type structure which will be initialized.
Return values
none

Definition at line 298 of file at32f415_spi.c.

Referenced by codec_i2s_init(), and i2s_config().

◆ i2s_enable()

void i2s_enable | ( | spi_type * | spi_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable i2s.

Parameters
spi_x | select the i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
new_state | new state of i2s. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 445 of file at32f415_spi.c.

Referenced by codec_i2s_init(), codec_i2s_reset(), i2s_config(), and main().

◆ i2s_init()

void i2s_init | ( | spi_type * | spi_x,
 |  | i2s_init_type * | i2s_init_struct
 | ) |  |

i2s init config with its setting value.

Parameters
spi_x | select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
i2s_init_struct | : pointer to a i2s_init_type structure which will be initialized.
Return values
none

Definition at line 316 of file at32f415_spi.c.

Referenced by codec_i2s_init(), and i2s_config().

◆ spi_crc_enable()

void spi_crc_enable | ( | spi_type * | spi_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the hardware crc calculation for the spi peripheral.

Parameters
spi_x | select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
new_state | new state of crc calculation. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 191 of file at32f415_spi.c.

Referenced by spi_config().

◆ spi_crc_next_transmit()

void spi_crc_next_transmit ( spi_type * spi_x )

spi next transmit crc for the spi peripheral.

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
Return values
none

Definition at line 152 of file at32f415_spi.c.

Referenced by main().

◆ spi_crc_polynomial_get()

uint16_t spi_crc_polynomial_get ( spi_type * spi_x )

return the crc polynomial register value for the spi peripheral.

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
Return values
the select crc polynomial register value

Definition at line 177 of file at32f415_spi.c.

◆ spi_crc_polynomial_set()

void spi_crc_polynomial_set | ( | spi_type * | spi_x,
 |  | uint16_t | crc_poly
 | ) |  |

set the crc polynomial value for the spi peripheral.

Parameters
spi_x | select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
crc_poly | crc polynomial value.
Return values
none

Definition at line 165 of file at32f415_spi.c.

Referenced by spi_config().

◆ spi_crc_value_get()

uint16_t spi_crc_value_get | ( | spi_type * | spi_x,
 |  | spi_crc_direction_type | crc_direction
 | ) |  |

return the transmit or the receive crc value for the spi peripheral.

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
crc_direction select transmit or receive crc value to be read
  • SPI_CRC_RX
  • SPI_CRC_TX
Return values
the select crc register value

Definition at line 206 of file at32f415_spi.c.

◆ spi_default_para_init()

void spi_default_para_init ( spi_init_type * spi_init_struct )

spi init config with its default value.

Parameters
spi_init_struct : pointer to a spi_init_type structure which will be initialized.
Return values
none

Definition at line 71 of file at32f415_spi.c.

Referenced by spi_config(), spiflash_init(), and usart_spi_configuration().

◆ spi_enable()

void spi_enable | ( | spi_type * | spi_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable spi.

Parameters
spi_x | select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
new_state | new state of spi. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 287 of file at32f415_spi.c.

Referenced by main(), SPI1_IRQHandler(), spi_config(), spiflash_init(), and usart_spi_configuration().

◆ spi_frame_bit_num_set()

void spi_frame_bit_num_set | ( | spi_type * | spi_x,
 |  | spi_frame_bit_num_type | bit_num
 | ) |  |

set the data frame bit num for the spi peripheral.

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
bit_num set the data frame size
  • SPI_FRAME_8BIT
  • SPI_FRAME_16BIT
Return values
none

Definition at line 257 of file at32f415_spi.c.

◆ spi_half_duplex_direction_set()

void spi_half_duplex_direction_set | ( | spi_type * | spi_x,
 |  | spi_half_duplex_direction_type | direction
 | ) |  |

set the data transmission direction in single line bidirectiona half duplex mode of the spi peripheral.

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
direction data transfer direction this parameter can be one of the following values:
  • SPI_HALF_DUPLEX_DIRECTION_RX
  • SPI_HALF_DUPLEX_DIRECTION_TX
Return values
none

Definition at line 273 of file at32f415_spi.c.

◆ spi_hardware_cs_output_enable()

void spi_hardware_cs_output_enable | ( | spi_type * | spi_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the hardware cs output for the spi peripheral.

Parameters
spi_x | select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
new_state | new state of spi master cs output. this parameter can be: TRUE or FALSE. note:the bit only use in spi master mode
Return values
none

Definition at line 224 of file at32f415_spi.c.

Referenced by spi_config().

◆ spi_i2s_data_receive()

uint16_t spi_i2s_data_receive ( spi_type * spi_x )

spi/i2s data receive

Parameters
spi_x select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
Return values
the received data value

Definition at line 526 of file at32f415_spi.c.

Referenced by main(), SPI1_IRQHandler(), SPI2_IRQHandler(), spi_byte_write(), spi_bytes_read(), and spi_bytes_write().

◆ spi_i2s_data_transmit()

void spi_i2s_data_transmit | ( | spi_type * | spi_x,
 |  | uint16_t | tx_data
 | ) |  |

spi/i2s data transmit

Parameters
spi_x select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
tx_data the data to be transmit. this parameter can be:
  • (0x0000~0xFFFF)
Return values
none

Definition at line 514 of file at32f415_spi.c.

Referenced by main(), SPI1_IRQHandler(), SPI2_IRQHandler(), spi_byte_write(), spi_bytes_read(), and spi_bytes_write().

◆ spi_i2s_dma_receiver_enable()

void spi_i2s_dma_receiver_enable | ( | spi_type * | spi_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the spi/i2s dma receiver mode.

Parameters
spi_x | select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
new_state | new state of the dma request. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 499 of file at32f415_spi.c.

Referenced by codec_i2s_init(), i2s_config(), spi_byte_write(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ spi_i2s_dma_transmitter_enable()

void spi_i2s_dma_transmitter_enable | ( | spi_type * | spi_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the spi/i2s dma transmitter mode.

Parameters
spi_x | select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
new_state | new state of the dma request. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 485 of file at32f415_spi.c.

Referenced by codec_i2s_init(), main(), spi_byte_write(), spi_bytes_read(), and spi_bytes_write().

◆ spi_i2s_flag_clear()

void spi_i2s_flag_clear | ( | spi_type * | spi_x,
 |  | uint32_t | spi_i2s_flag
 | ) |  |

clear flag of the specified spi/i2s peripheral.

Parameters
spi_x select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
spi_i2s_flag select the spi/i2s flag this parameter can be one of the following values:
  • SPI_CCERR_FLAG
  • SPI_I2S_RDBF_FLAG
  • I2S_TUERR_FLAG
  • SPI_MMERR_FLAG
  • SPI_I2S_ROERR_FLAG
Note
SPI_I2S_TDBE_FLAG this flag is cleared when the tx buffer already contain data to be transmit.
I2S_ACS_FLAG this flag cann't cleared by software,the flag indicate the channel side(not use in pcm standard mode).
SPI_I2S_BF_FLAG this flag cann't cleared by software, it's set and cleared by hardware.
Return values
none

< spi crc calculation error flag

< spi crc calculation error flag

< spi or i2s receive data buffer full flag

< i2s transmitter underload error flag

< spi master mode error flag

< spi or i2s receiver overflow error flag

Definition at line 580 of file at32f415_spi.c.

Referenced by main().

◆ spi_i2s_flag_get()

flag_status spi_i2s_flag_get | ( | spi_type * | spi_x,
 |  | uint32_t | spi_i2s_flag
 | ) |  |

get flag of the specified spi/i2s peripheral.

Parameters
spi_x select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
spi_i2s_flag select the spi/i2s flag this parameter can be one of the following values:
  • SPI_I2S_RDBF_FLAG
  • SPI_I2S_TDBE_FLAG
  • I2S_ACS_FLAG (this flag only use in i2s mode)
  • I2S_TUERR_FLAG (this flag only use in i2s mode)
  • SPI_CCERR_FLAG (this flag only use in spi mode)
  • SPI_MMERR_FLAG (this flag only use in spi mode)
  • SPI_I2S_ROERR_FLAG
  • SPI_I2S_BF_FLAG
Return values
the new state of spi/i2s flag

Definition at line 548 of file at32f415_spi.c.

Referenced by main(), SPI1_IRQHandler(), SPI2_IRQHandler(), spi_byte_write(), spi_bytes_read(), and spi_bytes_write().

◆ spi_i2s_interrupt_enable()

void spi_i2s_interrupt_enable | ( | spi_type * | spi_x,
 |  | uint32_t | spi_i2s_int,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the specified spi/i2s interrupts.

Parameters
spi_x | select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
spi_i2s_int specifies the spi/i2s interrupt sources to be enabled or disabled. this parameter can be one of the following values:
  • SPI_I2S_ERROR_INT
  • SPI_I2S_RDBF_INT
  • SPI_I2S_TDBE_INT
new_state | new state of the specified spi/i2s interrupts. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 464 of file at32f415_spi.c.

Referenced by i2s_config(), main(), SPI1_IRQHandler(), SPI2_IRQHandler(), and spi_config().

◆ spi_i2s_reset()

void spi_i2s_reset ( spi_type * spi_x )

spi reset by crm reset register

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
Return values
none

Definition at line 51 of file at32f415_spi.c.

Referenced by codec_i2s_init(), i2s_config(), and spi_config().

◆ spi_init()

void spi_init | ( | spi_type * | spi_x,
 |  | spi_init_type * | spi_init_struct
 | ) |  |

spi init config with its setting value.

Parameters
spi_x | select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
spi_init_struct | : pointer to a spi_init_type structure which will be initialized.
Return values
none

Definition at line 91 of file at32f415_spi.c.

Referenced by main(), spi_config(), spiflash_init(), and usart_spi_configuration().

◆ spi_software_cs_internal_level_set()

void spi_software_cs_internal_level_set | ( | spi_type * | spi_x,
 |  | spi_software_cs_level_type | level
 | ) |  |

set the software cs internal level for the spi peripheral.

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
level set the state of spi cs level. this parameter can be one of the following values:
  • SPI_SWCS_INTERNAL_LEVEL_LOW
  • SPI_SWCS_INTERNAL_LEVEL_HIGHT
    note:the bit only use when swcsen bit is set. note:when use this bit,io operation on the cs pin are invalid.
Return values
none

Definition at line 242 of file at32f415_spi.c.


AT32F415 Firmwary Library: SPI_private_functions

Functions
SPI_private_functions
AT32F415_periph_driver » SPI

Functions

void | spi_i2s_reset (spi_type *spi_x)
spi reset by crm reset register More...
void | spi_default_para_init (spi_init_type *spi_init_struct)
spi init config with its default value. More...
void | spi_init (spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value. More...
void | spi_crc_next_transmit (spi_type *spi_x)
spi next transmit crc for the spi peripheral. More...
void | spi_crc_polynomial_set (spi_type *spi_x, uint16_t crc_poly)
set the crc polynomial value for the spi peripheral. More...
uint16_t | spi_crc_polynomial_get (spi_type *spi_x)
return the crc polynomial register value for the spi peripheral. More...
void | spi_crc_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the hardware crc calculation for the spi peripheral. More...
uint16_t | spi_crc_value_get (spi_type *spi_x, spi_crc_direction_type crc_direction)
return the transmit or the receive crc value for the spi peripheral. More...
void | spi_hardware_cs_output_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the hardware cs output for the spi peripheral. More...
void | spi_software_cs_internal_level_set (spi_type *spi_x, spi_software_cs_level_type level)
set the software cs internal level for the spi peripheral. More...
void | spi_frame_bit_num_set (spi_type *spi_x, spi_frame_bit_num_type bit_num)
set the data frame bit num for the spi peripheral. More...
void | spi_half_duplex_direction_set (spi_type *spi_x, spi_half_duplex_direction_type direction)
set the data transmission direction in single line bidirectiona half duplex mode of the spi peripheral. More...
void | spi_enable (spi_type *spi_x, confirm_state new_state)
enable or disable spi. More...
void | i2s_default_para_init (i2s_init_type *i2s_init_struct)
i2s init config with its default value. More...
void | i2s_init (spi_type *spi_x, i2s_init_type *i2s_init_struct)
i2s init config with its setting value. More...
void | i2s_enable (spi_type *spi_x, confirm_state new_state)
enable or disable i2s. More...
void | spi_i2s_interrupt_enable (spi_type *spi_x, uint32_t spi_i2s_int, confirm_state new_state)
enable or disable the specified spi/i2s interrupts. More...
void | spi_i2s_dma_transmitter_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma transmitter mode. More...
void | spi_i2s_dma_receiver_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma receiver mode. More...
void | spi_i2s_data_transmit (spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit More...
uint16_t | spi_i2s_data_receive (spi_type *spi_x)
spi/i2s data receive More...
flag_status | spi_i2s_flag_get (spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral. More...
void | spi_i2s_flag_clear (spi_type *spi_x, uint32_t spi_i2s_flag)
clear flag of the specified spi/i2s peripheral. More...

Detailed Description

Function Documentation

◆ i2s_default_para_init()

void i2s_default_para_init ( i2s_init_type * i2s_init_struct )

i2s init config with its default value.

Parameters
i2s_init_struct : pointer to a i2s_init_type structure which will be initialized.
Return values
none

Definition at line 298 of file at32f415_spi.c.

Referenced by codec_i2s_init(), and i2s_config().

◆ i2s_enable()

void i2s_enable | ( | spi_type * | spi_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable i2s.

Parameters
spi_x | select the i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
new_state | new state of i2s. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 445 of file at32f415_spi.c.

Referenced by codec_i2s_init(), codec_i2s_reset(), i2s_config(), and main().

◆ i2s_init()

void i2s_init | ( | spi_type * | spi_x,
 |  | i2s_init_type * | i2s_init_struct
 | ) |  |

i2s init config with its setting value.

Parameters
spi_x | select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
i2s_init_struct | : pointer to a i2s_init_type structure which will be initialized.
Return values
none

Definition at line 316 of file at32f415_spi.c.

Referenced by codec_i2s_init(), and i2s_config().

◆ spi_crc_enable()

void spi_crc_enable | ( | spi_type * | spi_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the hardware crc calculation for the spi peripheral.

Parameters
spi_x | select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
new_state | new state of crc calculation. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 191 of file at32f415_spi.c.

Referenced by spi_config().

◆ spi_crc_next_transmit()

void spi_crc_next_transmit ( spi_type * spi_x )

spi next transmit crc for the spi peripheral.

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
Return values
none

Definition at line 152 of file at32f415_spi.c.

Referenced by main().

◆ spi_crc_polynomial_get()

uint16_t spi_crc_polynomial_get ( spi_type * spi_x )

return the crc polynomial register value for the spi peripheral.

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
Return values
the select crc polynomial register value

Definition at line 177 of file at32f415_spi.c.

◆ spi_crc_polynomial_set()

void spi_crc_polynomial_set | ( | spi_type * | spi_x,
 |  | uint16_t | crc_poly
 | ) |  |

set the crc polynomial value for the spi peripheral.

Parameters
spi_x | select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
crc_poly | crc polynomial value.
Return values
none

Definition at line 165 of file at32f415_spi.c.

Referenced by spi_config().

◆ spi_crc_value_get()

uint16_t spi_crc_value_get | ( | spi_type * | spi_x,
 |  | spi_crc_direction_type | crc_direction
 | ) |  |

return the transmit or the receive crc value for the spi peripheral.

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
crc_direction select transmit or receive crc value to be read
  • SPI_CRC_RX
  • SPI_CRC_TX
Return values
the select crc register value

Definition at line 206 of file at32f415_spi.c.

◆ spi_default_para_init()

void spi_default_para_init ( spi_init_type * spi_init_struct )

spi init config with its default value.

Parameters
spi_init_struct : pointer to a spi_init_type structure which will be initialized.
Return values
none

Definition at line 71 of file at32f415_spi.c.

Referenced by spi_config(), spiflash_init(), and usart_spi_configuration().

◆ spi_enable()

void spi_enable | ( | spi_type * | spi_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable spi.

Parameters
spi_x | select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
new_state | new state of spi. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 287 of file at32f415_spi.c.

Referenced by main(), SPI1_IRQHandler(), spi_config(), spiflash_init(), and usart_spi_configuration().

◆ spi_frame_bit_num_set()

void spi_frame_bit_num_set | ( | spi_type * | spi_x,
 |  | spi_frame_bit_num_type | bit_num
 | ) |  |

set the data frame bit num for the spi peripheral.

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
bit_num set the data frame size
  • SPI_FRAME_8BIT
  • SPI_FRAME_16BIT
Return values
none

Definition at line 257 of file at32f415_spi.c.

◆ spi_half_duplex_direction_set()

void spi_half_duplex_direction_set | ( | spi_type * | spi_x,
 |  | spi_half_duplex_direction_type | direction
 | ) |  |

set the data transmission direction in single line bidirectiona half duplex mode of the spi peripheral.

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
direction data transfer direction this parameter can be one of the following values:
  • SPI_HALF_DUPLEX_DIRECTION_RX
  • SPI_HALF_DUPLEX_DIRECTION_TX
Return values
none

Definition at line 273 of file at32f415_spi.c.

◆ spi_hardware_cs_output_enable()

void spi_hardware_cs_output_enable | ( | spi_type * | spi_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the hardware cs output for the spi peripheral.

Parameters
spi_x | select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
new_state | new state of spi master cs output. this parameter can be: TRUE or FALSE. note:the bit only use in spi master mode
Return values
none

Definition at line 224 of file at32f415_spi.c.

Referenced by spi_config().

◆ spi_i2s_data_receive()

uint16_t spi_i2s_data_receive ( spi_type * spi_x )

spi/i2s data receive

Parameters
spi_x select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
Return values
the received data value

Definition at line 526 of file at32f415_spi.c.

Referenced by main(), SPI1_IRQHandler(), SPI2_IRQHandler(), spi_byte_write(), spi_bytes_read(), and spi_bytes_write().

◆ spi_i2s_data_transmit()

void spi_i2s_data_transmit | ( | spi_type * | spi_x,
 |  | uint16_t | tx_data
 | ) |  |

spi/i2s data transmit

Parameters
spi_x select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
tx_data the data to be transmit. this parameter can be:
  • (0x0000~0xFFFF)
Return values
none

Definition at line 514 of file at32f415_spi.c.

Referenced by main(), SPI1_IRQHandler(), SPI2_IRQHandler(), spi_byte_write(), spi_bytes_read(), and spi_bytes_write().

◆ spi_i2s_dma_receiver_enable()

void spi_i2s_dma_receiver_enable | ( | spi_type * | spi_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the spi/i2s dma receiver mode.

Parameters
spi_x | select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
new_state | new state of the dma request. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 499 of file at32f415_spi.c.

Referenced by codec_i2s_init(), i2s_config(), spi_byte_write(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ spi_i2s_dma_transmitter_enable()

void spi_i2s_dma_transmitter_enable | ( | spi_type * | spi_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the spi/i2s dma transmitter mode.

Parameters
spi_x | select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
new_state | new state of the dma request. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 485 of file at32f415_spi.c.

Referenced by codec_i2s_init(), main(), spi_byte_write(), spi_bytes_read(), and spi_bytes_write().

◆ spi_i2s_flag_clear()

void spi_i2s_flag_clear | ( | spi_type * | spi_x,
 |  | uint32_t | spi_i2s_flag
 | ) |  |

clear flag of the specified spi/i2s peripheral.

Parameters
spi_x select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
spi_i2s_flag select the spi/i2s flag this parameter can be one of the following values:
  • SPI_CCERR_FLAG
  • SPI_I2S_RDBF_FLAG
  • I2S_TUERR_FLAG
  • SPI_MMERR_FLAG
  • SPI_I2S_ROERR_FLAG
Note
SPI_I2S_TDBE_FLAG this flag is cleared when the tx buffer already contain data to be transmit.
I2S_ACS_FLAG this flag cann't cleared by software,the flag indicate the channel side(not use in pcm standard mode).
SPI_I2S_BF_FLAG this flag cann't cleared by software, it's set and cleared by hardware.
Return values
none

< spi crc calculation error flag

< spi crc calculation error flag

< spi or i2s receive data buffer full flag

< i2s transmitter underload error flag

< spi master mode error flag

< spi or i2s receiver overflow error flag

Definition at line 580 of file at32f415_spi.c.

Referenced by main().

◆ spi_i2s_flag_get()

flag_status spi_i2s_flag_get | ( | spi_type * | spi_x,
 |  | uint32_t | spi_i2s_flag
 | ) |  |

get flag of the specified spi/i2s peripheral.

Parameters
spi_x select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
spi_i2s_flag select the spi/i2s flag this parameter can be one of the following values:
  • SPI_I2S_RDBF_FLAG
  • SPI_I2S_TDBE_FLAG
  • I2S_ACS_FLAG (this flag only use in i2s mode)
  • I2S_TUERR_FLAG (this flag only use in i2s mode)
  • SPI_CCERR_FLAG (this flag only use in spi mode)
  • SPI_MMERR_FLAG (this flag only use in spi mode)
  • SPI_I2S_ROERR_FLAG
  • SPI_I2S_BF_FLAG
Return values
the new state of spi/i2s flag

Definition at line 548 of file at32f415_spi.c.

Referenced by main(), SPI1_IRQHandler(), SPI2_IRQHandler(), spi_byte_write(), spi_bytes_read(), and spi_bytes_write().

◆ spi_i2s_interrupt_enable()

void spi_i2s_interrupt_enable | ( | spi_type * | spi_x,
 |  | uint32_t | spi_i2s_int,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the specified spi/i2s interrupts.

Parameters
spi_x | select the spi/i2s peripheral. this parameter can be one of the following values: SPI1, SPI2
spi_i2s_int specifies the spi/i2s interrupt sources to be enabled or disabled. this parameter can be one of the following values:
  • SPI_I2S_ERROR_INT
  • SPI_I2S_RDBF_INT
  • SPI_I2S_TDBE_INT
new_state | new state of the specified spi/i2s interrupts. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 464 of file at32f415_spi.c.

Referenced by i2s_config(), main(), SPI1_IRQHandler(), SPI2_IRQHandler(), and spi_config().

◆ spi_i2s_reset()

void spi_i2s_reset ( spi_type * spi_x )

spi reset by crm reset register

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
Return values
none

Definition at line 51 of file at32f415_spi.c.

Referenced by codec_i2s_init(), i2s_config(), and spi_config().

◆ spi_init()

void spi_init | ( | spi_type * | spi_x,
 |  | spi_init_type * | spi_init_struct
 | ) |  |

spi init config with its setting value.

Parameters
spi_x | select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
spi_init_struct | : pointer to a spi_init_type structure which will be initialized.
Return values
none

Definition at line 91 of file at32f415_spi.c.

Referenced by main(), spi_config(), spiflash_init(), and usart_spi_configuration().

◆ spi_software_cs_internal_level_set()

void spi_software_cs_internal_level_set | ( | spi_type * | spi_x,
 |  | spi_software_cs_level_type | level
 | ) |  |

set the software cs internal level for the spi peripheral.

Parameters
spi_x select the spi peripheral. this parameter can be one of the following values: SPI1, SPI2
level set the state of spi cs level. this parameter can be one of the following values:
  • SPI_SWCS_INTERNAL_LEVEL_LOW
  • SPI_SWCS_INTERNAL_LEVEL_HIGHT
    note:the bit only use when swcsen bit is set. note:when use this bit,io operation on the cs pin are invalid.
Return values
none

Definition at line 242 of file at32f415_spi.c.


AT32F415 Firmwary Library: TMR

Modules | Macros
TMR
AT32F415_periph_driver

TMR driver modules. More...

Modules

TMR_flags_definition
tmr flag
TMR_interrupt_select_type_definition
tmr interrupt select type
TMR_exported_types
TMR_exported_functions
TMR_private_functions

Macros

#define | TMR1 ((tmr_type *) TMR1_BASE)
#define | TMR2 ((tmr_type *) TMR2_BASE)
#define | TMR3 ((tmr_type *) TMR3_BASE)
#define | TMR4 ((tmr_type *) TMR4_BASE)
#define | TMR5 ((tmr_type *) TMR5_BASE)
#define | TMR6 ((tmr_type *) TMR6_BASE)
#define | TMR7 ((tmr_type *) TMR7_BASE)
#define | TMR8 ((tmr_type *) TMR8_BASE)
#define | TMR9 ((tmr_type *) TMR9_BASE)
#define | TMR10 ((tmr_type *) TMR10_BASE)
#define | TMR11 ((tmr_type *) TMR11_BASE)
#define | TMR12 ((tmr_type *) TMR12_BASE)
#define | TMR13 ((tmr_type *) TMR13_BASE)
#define | TMR14 ((tmr_type *) TMR14_BASE)

Detailed Description

TMR driver modules.

Macro Definition Documentation

◆ TMR1

#define TMR1 ((tmr_type *) TMR1_BASE)

Definition at line 832 of file at32f415_tmr.h.

◆ TMR10

#define TMR10 ((tmr_type *) TMR10_BASE)

Definition at line 841 of file at32f415_tmr.h.

◆ TMR11

#define TMR11 ((tmr_type *) TMR11_BASE)

Definition at line 842 of file at32f415_tmr.h.

◆ TMR12

#define TMR12 ((tmr_type *) TMR12_BASE)

Definition at line 843 of file at32f415_tmr.h.

◆ TMR13

#define TMR13 ((tmr_type *) TMR13_BASE)

Definition at line 844 of file at32f415_tmr.h.

◆ TMR14

#define TMR14 ((tmr_type *) TMR14_BASE)

Definition at line 845 of file at32f415_tmr.h.

◆ TMR2

#define TMR2 ((tmr_type *) TMR2_BASE)

Definition at line 833 of file at32f415_tmr.h.

◆ TMR3

#define TMR3 ((tmr_type *) TMR3_BASE)

Definition at line 834 of file at32f415_tmr.h.

◆ TMR4

#define TMR4 ((tmr_type *) TMR4_BASE)

Definition at line 835 of file at32f415_tmr.h.

◆ TMR5

#define TMR5 ((tmr_type *) TMR5_BASE)

Definition at line 836 of file at32f415_tmr.h.

◆ TMR6

#define TMR6 ((tmr_type *) TMR6_BASE)

Definition at line 837 of file at32f415_tmr.h.

◆ TMR7

#define TMR7 ((tmr_type *) TMR7_BASE)

Definition at line 838 of file at32f415_tmr.h.

◆ TMR8

#define TMR8 ((tmr_type *) TMR8_BASE)

Definition at line 839 of file at32f415_tmr.h.

◆ TMR9

#define TMR9 ((tmr_type *) TMR9_BASE)

Definition at line 840 of file at32f415_tmr.h.


AT32F415 Firmwary Library: TMR_flags_definition

Macros
TMR_flags_definition
AT32F415_periph_driver » TMR

tmr flag More...

Macros

#define | TMR_OVF_FLAG ((uint32_t)0x000001)
#define | TMR_C1_FLAG ((uint32_t)0x000002)
#define | TMR_C2_FLAG ((uint32_t)0x000004)
#define | TMR_C3_FLAG ((uint32_t)0x000008)
#define | TMR_C4_FLAG ((uint32_t)0x000010)
#define | TMR_HALL_FLAG ((uint32_t)0x000020)
#define | TMR_TRIGGER_FLAG ((uint32_t)0x000040)
#define | TMR_BRK_FLAG ((uint32_t)0x000080)
#define | TMR_C1_RECAPTURE_FLAG ((uint32_t)0x000200)
#define | TMR_C2_RECAPTURE_FLAG ((uint32_t)0x000400)
#define | TMR_C3_RECAPTURE_FLAG ((uint32_t)0x000800)
#define | TMR_C4_RECAPTURE_FLAG ((uint32_t)0x001000)

Detailed Description

tmr flag

Macro Definition Documentation

◆ TMR_BRK_FLAG

#define TMR_BRK_FLAG ((uint32_t)0x000080)

tmr flag brake

Definition at line 59 of file at32f415_tmr.h.

◆ TMR_C1_FLAG

#define TMR_C1_FLAG ((uint32_t)0x000002)

tmr flag channel 1

Definition at line 53 of file at32f415_tmr.h.

◆ TMR_C1_RECAPTURE_FLAG

#define TMR_C1_RECAPTURE_FLAG ((uint32_t)0x000200)

tmr flag channel 1 recapture

Definition at line 60 of file at32f415_tmr.h.

◆ TMR_C2_FLAG

#define TMR_C2_FLAG ((uint32_t)0x000004)

tmr flag channel 2

Definition at line 54 of file at32f415_tmr.h.

◆ TMR_C2_RECAPTURE_FLAG

#define TMR_C2_RECAPTURE_FLAG ((uint32_t)0x000400)

tmr flag channel 2 recapture

Definition at line 61 of file at32f415_tmr.h.

◆ TMR_C3_FLAG

#define TMR_C3_FLAG ((uint32_t)0x000008)

tmr flag channel 3

Definition at line 55 of file at32f415_tmr.h.

◆ TMR_C3_RECAPTURE_FLAG

#define TMR_C3_RECAPTURE_FLAG ((uint32_t)0x000800)

tmr flag channel 3 recapture

Definition at line 62 of file at32f415_tmr.h.

◆ TMR_C4_FLAG

#define TMR_C4_FLAG ((uint32_t)0x000010)

tmr flag channel 4

Definition at line 56 of file at32f415_tmr.h.

◆ TMR_C4_RECAPTURE_FLAG

#define TMR_C4_RECAPTURE_FLAG ((uint32_t)0x001000)

tmr flag channel 4 recapture

Definition at line 63 of file at32f415_tmr.h.

◆ TMR_HALL_FLAG

#define TMR_HALL_FLAG ((uint32_t)0x000020)

tmr flag hall

Definition at line 57 of file at32f415_tmr.h.

◆ TMR_OVF_FLAG

#define TMR_OVF_FLAG ((uint32_t)0x000001)

tmr flag overflow

Definition at line 52 of file at32f415_tmr.h.

◆ TMR_TRIGGER_FLAG

#define TMR_TRIGGER_FLAG ((uint32_t)0x000040)

tmr flag trigger

Definition at line 58 of file at32f415_tmr.h.


AT32F415 Firmwary Library: TMR_interrupt_select_type_definition

Macros
TMR_interrupt_select_type_definition
AT32F415_periph_driver » TMR

tmr interrupt select type More...

Macros

#define | TMR_OVF_INT ((uint32_t)0x000001)
#define | TMR_C1_INT ((uint32_t)0x000002)
#define | TMR_C2_INT ((uint32_t)0x000004)
#define | TMR_C3_INT ((uint32_t)0x000008)
#define | TMR_C4_INT ((uint32_t)0x000010)
#define | TMR_HALL_INT ((uint32_t)0x000020)
#define | TMR_TRIGGER_INT ((uint32_t)0x000040)
#define | TMR_BRK_INT ((uint32_t)0x000080)

Detailed Description

tmr interrupt select type

Macro Definition Documentation

◆ TMR_BRK_INT

#define TMR_BRK_INT ((uint32_t)0x000080)

tmr interrupt brake

Definition at line 81 of file at32f415_tmr.h.

◆ TMR_C1_INT

#define TMR_C1_INT ((uint32_t)0x000002)

tmr interrupt channel 1

Definition at line 75 of file at32f415_tmr.h.

◆ TMR_C2_INT

#define TMR_C2_INT ((uint32_t)0x000004)

tmr interrupt channel 2

Definition at line 76 of file at32f415_tmr.h.

◆ TMR_C3_INT

#define TMR_C3_INT ((uint32_t)0x000008)

tmr interrupt channel 3

Definition at line 77 of file at32f415_tmr.h.

◆ TMR_C4_INT

#define TMR_C4_INT ((uint32_t)0x000010)

tmr interrupt channel 4

Definition at line 78 of file at32f415_tmr.h.

◆ TMR_HALL_INT

#define TMR_HALL_INT ((uint32_t)0x000020)

tmr interrupt hall

Definition at line 79 of file at32f415_tmr.h.

◆ TMR_OVF_INT

#define TMR_OVF_INT ((uint32_t)0x000001)

tmr interrupt overflow

Definition at line 74 of file at32f415_tmr.h.

◆ TMR_TRIGGER_INT

#define TMR_TRIGGER_INT ((uint32_t)0x000040)

tmr interrupt trigger

Definition at line 80 of file at32f415_tmr.h.


AT32F415 Firmwary Library: TMR_exported_types

Data Structures | Enumerations
TMR_exported_types
AT32F415_periph_driver » TMR

Data Structures

struct | tmr_output_config_type
tmr output config type More...
struct | tmr_input_config_type
tmr input capture config type More...
struct | tmr_brkdt_config_type
tmr brkdt config type More...
struct | tmr_type
type define tmr register all More...

Enumerations

enum | tmr_clock_division_type { TMR_CLOCK_DIV1 = 0x00 , TMR_CLOCK_DIV2 = 0x01 , TMR_CLOCK_DIV4 = 0x02 }
tmr clock division type More...
enum tmr_count_mode_type {
TMR_COUNT_UP = 0x00 , TMR_COUNT_DOWN = 0x01 , TMR_COUNT_TWO_WAY_1 = 0x02 , TMR_COUNT_TWO_WAY_2 = 0x04 ,
TMR_COUNT_TWO_WAY_3 = 0x06
}
tmr counter mode type More...
enum tmr_primary_select_type {
TMR_PRIMARY_SEL_RESET = 0x00 , TMR_PRIMARY_SEL_ENABLE = 0x01 , TMR_PRIMARY_SEL_OVERFLOW = 0x02 , TMR_PRIMARY_SEL_COMPARE = 0x03 ,
TMR_PRIMARY_SEL_C1ORAW = 0x04 , TMR_PRIMARY_SEL_C2ORAW = 0x05 , TMR_PRIMARY_SEL_C3ORAW = 0x06 , TMR_PRIMARY_SEL_C4ORAW = 0x07
}
tmr primary mode select type
More...
enum sub_tmr_input_sel_type {
TMR_SUB_INPUT_SEL_IS0 = 0x00 , TMR_SUB_INPUT_SEL_IS1 = 0x01 , TMR_SUB_INPUT_SEL_IS2 = 0x02 , TMR_SUB_INPUT_SEL_IS3 = 0x03 ,
TMR_SUB_INPUT_SEL_C1INC = 0x04 , TMR_SUB_INPUT_SEL_C1DF1 = 0x05 , TMR_SUB_INPUT_SEL_C2DF2 = 0x06 , TMR_SUB_INPUT_SEL_EXTIN = 0x07
}
tmr subordinate mode input select type More...
enum tmr_sub_mode_select_type {
TMR_SUB_MODE_DIABLE = 0x00 , TMR_SUB_ENCODER_MODE_A = 0x01 , TMR_SUB_ENCODER_MODE_B = 0x02 , TMR_SUB_ENCODER_MODE_C = 0x03 ,
TMR_SUB_RESET_MODE = 0x04 , TMR_SUB_HANG_MODE = 0x05 , TMR_SUB_TRIGGER_MODE = 0x06 , TMR_SUB_EXTERNAL_CLOCK_MODE_A = 0x07
}
tmr subordinate mode select type More...
enum | tmr_encoder_mode_type { TMR_ENCODER_MODE_A = TMR_SUB_ENCODER_MODE_A , TMR_ENCODER_MODE_B = TMR_SUB_ENCODER_MODE_B , TMR_ENCODER_MODE_C = TMR_SUB_ENCODER_MODE_C }
tmr encoder mode type More...
enum tmr_output_control_mode_type {
TMR_OUTPUT_CONTROL_OFF = 0x00 , TMR_OUTPUT_CONTROL_HIGH = 0x01 , TMR_OUTPUT_CONTROL_LOW = 0x02 , TMR_OUTPUT_CONTROL_SWITCH = 0x03 ,
TMR_OUTPUT_CONTROL_FORCE_HIGH = 0x04 , TMR_OUTPUT_CONTROL_FORCE_LOW = 0x05 , TMR_OUTPUT_CONTROL_PWM_MODE_A = 0x06 , TMR_OUTPUT_CONTROL_PWM_MODE_B = 0x07
}
tmr output control mode type More...
enum | tmr_force_output_type { TMR_FORCE_OUTPUT_HIGH = TMR_OUTPUT_CONTROL_FORCE_HIGH , TMR_FORCE_OUTPUT_LOW = TMR_OUTPUT_CONTROL_FORCE_LOW }
tmr force output type More...
enum | tmr_output_polarity_type { TMR_OUTPUT_ACTIVE_HIGH = 0x00 , TMR_OUTPUT_ACTIVE_LOW = 0x01 }
tmr output channel polarity type More...
enum | tmr_input_polarity_type { TMR_INPUT_RISING_EDGE = 0x00 , TMR_INPUT_FALLING_EDGE = 0x01 , TMR_INPUT_BOTH_EDGE = 0x03 }
tmr input channel polarity type More...
enum tmr_channel_select_type {
TMR_SELECT_CHANNEL_1 = 0x00 , TMR_SELECT_CHANNEL_1C = 0x01 , TMR_SELECT_CHANNEL_2 = 0x02 , TMR_SELECT_CHANNEL_2C = 0x03 ,
TMR_SELECT_CHANNEL_3 = 0x04 , TMR_SELECT_CHANNEL_3C = 0x05 , TMR_SELECT_CHANNEL_4 = 0x06
}
tmr channel select type More...
enum | tmr_channel1_input_connected_type { TMR_CHANEL1_CONNECTED_C1IRAW = 0x00 , TMR_CHANEL1_2_3_CONNECTED_C1IRAW_XOR = 0x01 }
tmr channel1 input connected type More...
enum | tmr_input_direction_mapped_type { TMR_CC_CHANNEL_MAPPED_DIRECT = 0x01 , TMR_CC_CHANNEL_MAPPED_INDIRECT = 0x02 , TMR_CC_CHANNEL_MAPPED_STI = 0x03 }
tmr input channel mapped type channel direction More...
enum | tmr_channel_input_divider_type { TMR_CHANNEL_INPUT_DIV_1 = 0x00 , TMR_CHANNEL_INPUT_DIV_2 = 0x01 , TMR_CHANNEL_INPUT_DIV_4 = 0x02 , TMR_CHANNEL_INPUT_DIV_8 = 0x03 }
tmr input divider type More...
enum | tmr_dma_request_source_type { TMR_DMA_REQUEST_BY_CHANNEL = 0x00 , TMR_DMA_REQUEST_BY_OVERFLOW = 0x01 }
tmr dma request source select type More...
enum tmr_dma_request_type {
TMR_OVERFLOW_DMA_REQUEST = 0x00000100 , TMR_C1_DMA_REQUEST = 0x00000200 , TMR_C2_DMA_REQUEST = 0x00000400 , TMR_C3_DMA_REQUEST = 0x00000800 ,
TMR_C4_DMA_REQUEST = 0x00001000 , TMR_HALL_DMA_REQUEST = 0x00002000 , TMR_TRIGGER_DMA_REQUEST = 0x00004000
}
tmr dma request type More...
enum tmr_event_trigger_type {
TMR_OVERFLOW_SWTRIG = 0x00000001 , TMR_C1_SWTRIG = 0x00000002 , TMR_C2_SWTRIG = 0x00000004 , TMR_C3_SWTRIG = 0x00000008 ,
TMR_C4_SWTRIG = 0x00000010 , TMR_HALL_SWTRIG = 0x00000020 , TMR_TRIGGER_SWTRIG = 0x00000040 , TMR_BRK_SWTRIG = 0x00000080
}
tmr event triggered by software type
More...
enum | tmr_polarity_active_type { TMR_POLARITY_ACTIVE_HIGH = 0x00 , TMR_POLARITY_ACTIVE_LOW = 0x01 , TMR_POLARITY_ACTIVE_BOTH = 0x02 }
tmr polarity active type More...
enum | tmr_external_signal_divider_type { TMR_ES_FREQUENCY_DIV_1 = 0x00 , TMR_ES_FREQUENCY_DIV_2 = 0x01 , TMR_ES_FREQUENCY_DIV_4 = 0x02 , TMR_ES_FREQUENCY_DIV_8 = 0x03 }
tmr external signal divider type More...
enum | tmr_external_signal_polarity_type { TMR_ES_POLARITY_NON_INVERTED = 0x00 , TMR_ES_POLARITY_INVERTED = 0x01 }
tmr external signal polarity type More...
enum tmr_dma_transfer_length_type {
TMR_DMA_TRANSFER_1BYTE = 0x00 , TMR_DMA_TRANSFER_2BYTES = 0x01 , TMR_DMA_TRANSFER_3BYTES = 0x02 , TMR_DMA_TRANSFER_4BYTES = 0x03 ,
TMR_DMA_TRANSFER_5BYTES = 0x04 , TMR_DMA_TRANSFER_6BYTES = 0x05 , TMR_DMA_TRANSFER_7BYTES = 0x06 , TMR_DMA_TRANSFER_8BYTES = 0x07 ,
TMR_DMA_TRANSFER_9BYTES = 0x08 , TMR_DMA_TRANSFER_10BYTES = 0x09 , TMR_DMA_TRANSFER_11BYTES = 0x0A , TMR_DMA_TRANSFER_12BYTES = 0x0B ,
TMR_DMA_TRANSFER_13BYTES = 0x0C , TMR_DMA_TRANSFER_14BYTES = 0x0D , TMR_DMA_TRANSFER_15BYTES = 0x0E , TMR_DMA_TRANSFER_16BYTES = 0x0F ,
TMR_DMA_TRANSFER_17BYTES = 0x10 , TMR_DMA_TRANSFER_18BYTES = 0x11
}
tmr dma transfer length type More...
enum tmr_dma_address_type {
TMR_CTRL1_ADDRESS = 0x0000 , TMR_CTRL2_ADDRESS = 0x0001 , TMR_STCTRL_ADDRESS = 0x0002 , TMR_IDEN_ADDRESS = 0x0003 ,
TMR_ISTS_ADDRESS = 0x0004 , TMR_SWEVT_ADDRESS = 0x0005 , TMR_CM1_ADDRESS = 0x0006 , TMR_CM2_ADDRESS = 0x0007 ,
TMR_CCTRL_ADDRESS = 0x0008 , TMR_CVAL_ADDRESS = 0x0009 , TMR_DIV_ADDRESS = 0x000A , TMR_PR_ADDRESS = 0x000B ,
TMR_RPR_ADDRESS = 0x000C , TMR_C1DT_ADDRESS = 0x000D , TMR_C2DT_ADDRESS = 0x000E , TMR_C3DT_ADDRESS = 0x000F ,
TMR_C4DT_ADDRESS = 0x0010 , TMR_BRK_ADDRESS = 0x0011 , TMR_DMACTRL_ADDRESS = 0x0012
}
tmr dma base address type More...
enum | tmr_brk_polarity_type { TMR_BRK_INPUT_ACTIVE_LOW = 0x00 , TMR_BRK_INPUT_ACTIVE_HIGH = 0x01 }
tmr brk polarity type More...
enum | tmr_wp_level_type { TMR_WP_OFF = 0x00 , TMR_WP_LEVEL_3 = 0x01 , TMR_WP_LEVEL_2 = 0x02 , TMR_WP_LEVEL_1 = 0x03 }
tmr write protect level type More...

Detailed Description

Enumeration Type Documentation

◆ sub_tmr_input_sel_type

enum sub_tmr_input_sel_type

tmr subordinate mode input select type

Enumerator
TMR_SUB_INPUT_SEL_IS0 | subordinate mode input select is0
TMR_SUB_INPUT_SEL_IS1 | subordinate mode input select is1
TMR_SUB_INPUT_SEL_IS2 | subordinate mode input select is2
TMR_SUB_INPUT_SEL_IS3 | subordinate mode input select is3
TMR_SUB_INPUT_SEL_C1INC | subordinate mode input select c1inc
TMR_SUB_INPUT_SEL_C1DF1 | subordinate mode input select c1df1
TMR_SUB_INPUT_SEL_C2DF2 | subordinate mode input select c2df2
TMR_SUB_INPUT_SEL_EXTIN | subordinate mode input select extin

Definition at line 131 of file at32f415_tmr.h.

◆ tmr_brk_polarity_type

enum tmr_brk_polarity_type

tmr brk polarity type

Enumerator
TMR_BRK_INPUT_ACTIVE_LOW | tmr brk input channel active low
TMR_BRK_INPUT_ACTIVE_HIGH | tmr brk input channel active high

Definition at line 377 of file at32f415_tmr.h.

◆ tmr_channel1_input_connected_type

enum tmr_channel1_input_connected_type

tmr channel1 input connected type

Enumerator
TMR_CHANEL1_CONNECTED_C1IRAW | channel1 pins is only connected to C1IRAW input
TMR_CHANEL1_2_3_CONNECTED_C1IRAW_XOR | channel1/2/3 pins are connected to C1IRAW input after xored

Definition at line 228 of file at32f415_tmr.h.

◆ tmr_channel_input_divider_type

enum tmr_channel_input_divider_type

tmr input divider type

Enumerator
TMR_CHANNEL_INPUT_DIV_1 | tmr channel input divider 1
TMR_CHANNEL_INPUT_DIV_2 | tmr channel input divider 2
TMR_CHANNEL_INPUT_DIV_4 | tmr channel input divider 4
TMR_CHANNEL_INPUT_DIV_8 | tmr channel input divider 8

Definition at line 247 of file at32f415_tmr.h.

◆ tmr_channel_select_type

enum tmr_channel_select_type

tmr channel select type

Enumerator
TMR_SELECT_CHANNEL_1 | tmr channel select channel 1
TMR_SELECT_CHANNEL_1C | tmr channel select channel 1 complementary
TMR_SELECT_CHANNEL_2 | tmr channel select channel 2
TMR_SELECT_CHANNEL_2C | tmr channel select channel 2 complementary
TMR_SELECT_CHANNEL_3 | tmr channel select channel 3
TMR_SELECT_CHANNEL_3C | tmr channel select channel 3 complementary
TMR_SELECT_CHANNEL_4 | tmr channel select channel 4

Definition at line 214 of file at32f415_tmr.h.

◆ tmr_clock_division_type

enum tmr_clock_division_type

tmr clock division type

Enumerator
TMR_CLOCK_DIV1 | tmr clock division 1
TMR_CLOCK_DIV2 | tmr clock division 2
TMR_CLOCK_DIV4 | tmr clock division 4

Definition at line 94 of file at32f415_tmr.h.

◆ tmr_count_mode_type

enum tmr_count_mode_type

tmr counter mode type

Enumerator
TMR_COUNT_UP | tmr counter mode up
TMR_COUNT_DOWN | tmr counter mode down
TMR_COUNT_TWO_WAY_1 | tmr counter mode two way 1
TMR_COUNT_TWO_WAY_2 | tmr counter mode two way 2
TMR_COUNT_TWO_WAY_3 | tmr counter mode two way 3

Definition at line 104 of file at32f415_tmr.h.

◆ tmr_dma_address_type

enum tmr_dma_address_type

tmr dma base address type

Enumerator
TMR_CTRL1_ADDRESS | tmr dma base address ctrl1
TMR_CTRL2_ADDRESS | tmr dma base address ctrl2
TMR_STCTRL_ADDRESS | tmr dma base address stctrl
TMR_IDEN_ADDRESS | tmr dma base address iden
TMR_ISTS_ADDRESS | tmr dma base address ists
TMR_SWEVT_ADDRESS | tmr dma base address swevt
TMR_CM1_ADDRESS | tmr dma base address cm1
TMR_CM2_ADDRESS | tmr dma base address cm2
TMR_CCTRL_ADDRESS | tmr dma base address cctrl
TMR_CVAL_ADDRESS | tmr dma base address cval
TMR_DIV_ADDRESS | tmr dma base address div
TMR_PR_ADDRESS | tmr dma base address pr
TMR_RPR_ADDRESS | tmr dma base address rpr
TMR_C1DT_ADDRESS | tmr dma base address c1dt
TMR_C2DT_ADDRESS | tmr dma base address c2dt
TMR_C3DT_ADDRESS | tmr dma base address c3dt
TMR_C4DT_ADDRESS | tmr dma base address c4dt
TMR_BRK_ADDRESS | tmr dma base address brake
TMR_DMACTRL_ADDRESS | tmr dma base address dmactrl

Definition at line 351 of file at32f415_tmr.h.

◆ tmr_dma_request_source_type

enum tmr_dma_request_source_type

tmr dma request source select type

Enumerator
TMR_DMA_REQUEST_BY_CHANNEL | tmr dma request source select channel
TMR_DMA_REQUEST_BY_OVERFLOW | tmr dma request source select overflow

Definition at line 258 of file at32f415_tmr.h.

◆ tmr_dma_request_type

enum tmr_dma_request_type

tmr dma request type

Enumerator
TMR_OVERFLOW_DMA_REQUEST | tmr dma request select overflow
TMR_C1_DMA_REQUEST | tmr dma request select channel 1
TMR_C2_DMA_REQUEST | tmr dma request select channel 2
TMR_C3_DMA_REQUEST | tmr dma request select channel 3
TMR_C4_DMA_REQUEST | tmr dma request select channel 4
TMR_HALL_DMA_REQUEST | tmr dma request select hall
TMR_TRIGGER_DMA_REQUEST | tmr dma request select trigger

Definition at line 267 of file at32f415_tmr.h.

◆ tmr_dma_transfer_length_type

enum tmr_dma_transfer_length_type

tmr dma transfer length type

Enumerator
TMR_DMA_TRANSFER_1BYTE | tmr dma transfer length 1 byte
TMR_DMA_TRANSFER_2BYTES | tmr dma transfer length 2 bytes
TMR_DMA_TRANSFER_3BYTES | tmr dma transfer length 3 bytes
TMR_DMA_TRANSFER_4BYTES | tmr dma transfer length 4 bytes
TMR_DMA_TRANSFER_5BYTES | tmr dma transfer length 5 bytes
TMR_DMA_TRANSFER_6BYTES | tmr dma transfer length 6 bytes
TMR_DMA_TRANSFER_7BYTES | tmr dma transfer length 7 bytes
TMR_DMA_TRANSFER_8BYTES | tmr dma transfer length 8 bytes
TMR_DMA_TRANSFER_9BYTES | tmr dma transfer length 9 bytes
TMR_DMA_TRANSFER_10BYTES | tmr dma transfer length 10 bytes
TMR_DMA_TRANSFER_11BYTES | tmr dma transfer length 11 bytes
TMR_DMA_TRANSFER_12BYTES | tmr dma transfer length 12 bytes
TMR_DMA_TRANSFER_13BYTES | tmr dma transfer length 13 bytes
TMR_DMA_TRANSFER_14BYTES | tmr dma transfer length 14 bytes
TMR_DMA_TRANSFER_15BYTES | tmr dma transfer length 15 bytes
TMR_DMA_TRANSFER_16BYTES | tmr dma transfer length 16 bytes
TMR_DMA_TRANSFER_17BYTES | tmr dma transfer length 17 bytes
TMR_DMA_TRANSFER_18BYTES | tmr dma transfer length 18 bytes

Definition at line 326 of file at32f415_tmr.h.

◆ tmr_encoder_mode_type

enum tmr_encoder_mode_type

tmr encoder mode type

Enumerator
TMR_ENCODER_MODE_A | tmr encoder mode a
TMR_ENCODER_MODE_B | tmr encoder mode b
TMR_ENCODER_MODE_C | tmr encoder mode c

Definition at line 161 of file at32f415_tmr.h.

◆ tmr_event_trigger_type

enum tmr_event_trigger_type

tmr event triggered by software type

Enumerator
TMR_OVERFLOW_SWTRIG | tmr event triggered by software of overflow
TMR_C1_SWTRIG | tmr event triggered by software of channel 1
TMR_C2_SWTRIG | tmr event triggered by software of channel 2
TMR_C3_SWTRIG | tmr event triggered by software of channel 3
TMR_C4_SWTRIG | tmr event triggered by software of channel 4
TMR_HALL_SWTRIG | tmr event triggered by software of hall
TMR_TRIGGER_SWTRIG | tmr event triggered by software of trigger
TMR_BRK_SWTRIG | tmr event triggered by software of brake

Definition at line 281 of file at32f415_tmr.h.

◆ tmr_external_signal_divider_type

enum tmr_external_signal_divider_type

tmr external signal divider type

Enumerator
TMR_ES_FREQUENCY_DIV_1 | tmr external signal frequency divider 1
TMR_ES_FREQUENCY_DIV_2 | tmr external signal frequency divider 2
TMR_ES_FREQUENCY_DIV_4 | tmr external signal frequency divider 4
TMR_ES_FREQUENCY_DIV_8 | tmr external signal frequency divider 8

Definition at line 306 of file at32f415_tmr.h.

◆ tmr_external_signal_polarity_type

enum tmr_external_signal_polarity_type

tmr external signal polarity type

Enumerator
TMR_ES_POLARITY_NON_INVERTED | tmr external signal polarity non-inerted
TMR_ES_POLARITY_INVERTED | tmr external signal polarity inerted

Definition at line 317 of file at32f415_tmr.h.

◆ tmr_force_output_type

enum tmr_force_output_type

tmr force output type

Enumerator
TMR_FORCE_OUTPUT_HIGH | tmr force output high
TMR_FORCE_OUTPUT_LOW | tmr force output low

Definition at line 186 of file at32f415_tmr.h.

◆ tmr_input_direction_mapped_type

enum tmr_input_direction_mapped_type

tmr input channel mapped type channel direction

Enumerator
TMR_CC_CHANNEL_MAPPED_DIRECT | channel is configured as input, mapped direct
TMR_CC_CHANNEL_MAPPED_INDIRECT | channel is configured as input, mapped indirect
TMR_CC_CHANNEL_MAPPED_STI | channel is configured as input, mapped trc

Definition at line 237 of file at32f415_tmr.h.

◆ tmr_input_polarity_type

enum tmr_input_polarity_type

tmr input channel polarity type

Enumerator
TMR_INPUT_RISING_EDGE | tmr input channel polarity rising
TMR_INPUT_FALLING_EDGE | tmr input channel polarity falling
TMR_INPUT_BOTH_EDGE | tmr input channel polarity both edge

Definition at line 204 of file at32f415_tmr.h.

◆ tmr_output_control_mode_type

enum tmr_output_control_mode_type

tmr output control mode type

Enumerator
TMR_OUTPUT_CONTROL_OFF | tmr output control mode off
TMR_OUTPUT_CONTROL_HIGH | tmr output control mode high
TMR_OUTPUT_CONTROL_LOW | tmr output control mode low
TMR_OUTPUT_CONTROL_SWITCH | tmr output control mode switch
TMR_OUTPUT_CONTROL_FORCE_HIGH | tmr output control mode force high
TMR_OUTPUT_CONTROL_FORCE_LOW | tmr output control mode force low
TMR_OUTPUT_CONTROL_PWM_MODE_A | tmr output control mode pwm a
TMR_OUTPUT_CONTROL_PWM_MODE_B | tmr output control mode pwm b

Definition at line 171 of file at32f415_tmr.h.

◆ tmr_output_polarity_type

enum tmr_output_polarity_type

tmr output channel polarity type

Enumerator
TMR_OUTPUT_ACTIVE_HIGH | tmr output channel polarity high
TMR_OUTPUT_ACTIVE_LOW | tmr output channel polarity low

Definition at line 195 of file at32f415_tmr.h.

◆ tmr_polarity_active_type

enum tmr_polarity_active_type

tmr polarity active type

Enumerator
TMR_POLARITY_ACTIVE_HIGH | tmr polarity active high
TMR_POLARITY_ACTIVE_LOW | tmr polarity active low
TMR_POLARITY_ACTIVE_BOTH | tmr polarity active both high ande low

Definition at line 296 of file at32f415_tmr.h.

◆ tmr_primary_select_type

enum tmr_primary_select_type

tmr primary mode select type

Enumerator
TMR_PRIMARY_SEL_RESET | tmr primary mode select reset
TMR_PRIMARY_SEL_ENABLE | tmr primary mode select enable
TMR_PRIMARY_SEL_OVERFLOW | tmr primary mode select overflow
TMR_PRIMARY_SEL_COMPARE | tmr primary mode select compare
TMR_PRIMARY_SEL_C1ORAW | tmr primary mode select c1oraw
TMR_PRIMARY_SEL_C2ORAW | tmr primary mode select c2oraw
TMR_PRIMARY_SEL_C3ORAW | tmr primary mode select c3oraw
TMR_PRIMARY_SEL_C4ORAW | tmr primary mode select c4oraw

Definition at line 116 of file at32f415_tmr.h.

◆ tmr_sub_mode_select_type

enum tmr_sub_mode_select_type

tmr subordinate mode select type

Enumerator
TMR_SUB_MODE_DIABLE | subordinate mode disable
TMR_SUB_ENCODER_MODE_A | subordinate mode select encoder mode a
TMR_SUB_ENCODER_MODE_B | subordinate mode select encoder mode b
TMR_SUB_ENCODER_MODE_C | subordinate mode select encoder mode c
TMR_SUB_RESET_MODE | subordinate mode select reset
TMR_SUB_HANG_MODE | subordinate mode select hang
TMR_SUB_TRIGGER_MODE | subordinate mode select trigger
TMR_SUB_EXTERNAL_CLOCK_MODE_A | subordinate mode external clock mode a

Definition at line 146 of file at32f415_tmr.h.

◆ tmr_wp_level_type

enum tmr_wp_level_type

tmr write protect level type

Enumerator
TMR_WP_OFF | tmr write protect off
TMR_WP_LEVEL_3 | tmr write protect level 3
TMR_WP_LEVEL_2 | tmr write protect level 2
TMR_WP_LEVEL_1 | tmr write protect level 1

Definition at line 386 of file at32f415_tmr.h.


AT32F415 Firmwary Library: tmr_output_config_type Struct Reference

Data Fields
tmr_output_config_type Struct Reference
AT32F415_periph_driver » TMR » TMR_exported_types

tmr output config type More...

#include <at32f415_tmr.h>

Data Fields

tmr_output_control_mode_type oc_mode
confirm_state oc_idle_state
confirm_state occ_idle_state
tmr_output_polarity_type oc_polarity
tmr_output_polarity_type occ_polarity
confirm_state oc_output_state
confirm_state occ_output_state

Detailed Description

tmr output config type

Definition at line 397 of file at32f415_tmr.h.

Field Documentation

◆ oc_idle_state

confirm_state tmr_output_config_type::oc_idle_state

output channel idle state

Definition at line 400 of file at32f415_tmr.h.

Referenced by main(), mclk_tmr1_init(), tmr1_config(), tmr_output_channel_config(), and tmr_output_default_para_init().

◆ oc_mode

tmr_output_control_mode_type tmr_output_config_type::oc_mode

output channel mode

Definition at line 399 of file at32f415_tmr.h.

Referenced by main(), mclk_tmr1_init(), tmr1_config(), tmr_output_channel_config(), and tmr_output_default_para_init().

◆ oc_output_state

confirm_state tmr_output_config_type::oc_output_state

output channel enable

Definition at line 404 of file at32f415_tmr.h.

Referenced by main(), mclk_tmr1_init(), tmr1_config(), tmr_output_channel_config(), and tmr_output_default_para_init().

◆ oc_polarity

tmr_output_polarity_type tmr_output_config_type::oc_polarity

output channel polarity

Definition at line 402 of file at32f415_tmr.h.

Referenced by main(), mclk_tmr1_init(), tmr1_config(), tmr_output_channel_config(), and tmr_output_default_para_init().

◆ occ_idle_state

confirm_state tmr_output_config_type::occ_idle_state

output channel complementary idle state

Definition at line 401 of file at32f415_tmr.h.

Referenced by main(), tmr_output_channel_config(), and tmr_output_default_para_init().

◆ occ_output_state

confirm_state tmr_output_config_type::occ_output_state

output channel complementary enable

Definition at line 405 of file at32f415_tmr.h.

Referenced by main(), tmr_output_channel_config(), and tmr_output_default_para_init().

◆ occ_polarity

tmr_output_polarity_type tmr_output_config_type::occ_polarity

output channel complementary polarity

Definition at line 403 of file at32f415_tmr.h.

Referenced by main(), tmr_output_channel_config(), and tmr_output_default_para_init().

The documentation for this struct was generated from the following file:
  • at32f415_tmr.h


AT32F415 Firmwary Library: tmr_input_config_type Struct Reference

Data Fields
tmr_input_config_type Struct Reference
AT32F415_periph_driver » TMR » TMR_exported_types

tmr input capture config type More...

#include <at32f415_tmr.h>

Data Fields

tmr_channel_select_type input_channel_select
tmr_input_polarity_type input_polarity_select
tmr_input_direction_mapped_type input_mapped_select
uint8_t input_filter_value

Detailed Description

tmr input capture config type

Definition at line 411 of file at32f415_tmr.h.

Field Documentation

◆ input_channel_select

tmr_channel_select_type tmr_input_config_type::input_channel_select

tmr input channel select

Definition at line 413 of file at32f415_tmr.h.

Referenced by lick_frequency_get(), main(), tmr1_init(), tmr_input_channel_init(), tmr_input_default_para_init(), and tmr_pwm_input_config().

◆ input_filter_value

uint8_t tmr_input_config_type::input_filter_value

tmr channel filter value

Definition at line 416 of file at32f415_tmr.h.

Referenced by lick_frequency_get(), main(), tmr1_init(), tmr_input_channel_init(), tmr_input_default_para_init(), and tmr_pwm_input_config().

◆ input_mapped_select

tmr_input_direction_mapped_type tmr_input_config_type::input_mapped_select

tmr channel mapped direct or indirect

Definition at line 415 of file at32f415_tmr.h.

Referenced by lick_frequency_get(), main(), tmr1_init(), tmr_input_channel_init(), tmr_input_default_para_init(), and tmr_pwm_input_config().

◆ input_polarity_select

tmr_input_polarity_type tmr_input_config_type::input_polarity_select

tmr input polarity select

Definition at line 414 of file at32f415_tmr.h.

Referenced by lick_frequency_get(), main(), tmr1_init(), tmr_input_channel_init(), tmr_input_default_para_init(), and tmr_pwm_input_config().

The documentation for this struct was generated from the following file:
  • at32f415_tmr.h


AT32F415 Firmwary Library: tmr_brkdt_config_type Struct Reference

Data Fields
tmr_brkdt_config_type Struct Reference
AT32F415_periph_driver » TMR » TMR_exported_types

tmr brkdt config type More...

#include <at32f415_tmr.h>

Data Fields

uint8_t deadtime
tmr_brk_polarity_type brk_polarity
tmr_wp_level_type wp_level
confirm_state auto_output_enable
confirm_state fcsoen_state
confirm_state fcsodis_state
confirm_state brk_enable

Detailed Description

tmr brkdt config type

Definition at line 422 of file at32f415_tmr.h.

Field Documentation

◆ auto_output_enable

confirm_state tmr_brkdt_config_type::auto_output_enable

automatic output enable

Definition at line 427 of file at32f415_tmr.h.

Referenced by main(), tmr_brkdt_config(), and tmr_brkdt_default_para_init().

◆ brk_enable

confirm_state tmr_brkdt_config_type::brk_enable

tmr brk enale

Definition at line 430 of file at32f415_tmr.h.

Referenced by main(), tmr_brkdt_config(), and tmr_brkdt_default_para_init().

◆ brk_polarity

tmr_brk_polarity_type tmr_brkdt_config_type::brk_polarity

tmr brake polarity

Definition at line 425 of file at32f415_tmr.h.

Referenced by main(), tmr_brkdt_config(), and tmr_brkdt_default_para_init().

◆ deadtime

uint8_t tmr_brkdt_config_type::deadtime

dead-time generator setup

Definition at line 424 of file at32f415_tmr.h.

Referenced by main(), tmr_brkdt_config(), and tmr_brkdt_default_para_init().

◆ fcsodis_state

confirm_state tmr_brkdt_config_type::fcsodis_state

frozen channel status when output disable

Definition at line 429 of file at32f415_tmr.h.

Referenced by main(), tmr_brkdt_config(), and tmr_brkdt_default_para_init().

◆ fcsoen_state

confirm_state tmr_brkdt_config_type::fcsoen_state

frozen channel status when output enable

Definition at line 428 of file at32f415_tmr.h.

Referenced by main(), tmr_brkdt_config(), and tmr_brkdt_default_para_init().

◆ wp_level

tmr_wp_level_type tmr_brkdt_config_type::wp_level

write protect configuration

Definition at line 426 of file at32f415_tmr.h.

Referenced by main(), tmr_brkdt_config(), and tmr_brkdt_default_para_init().

The documentation for this struct was generated from the following file:
  • at32f415_tmr.h


AT32F415 Firmwary Library: tmr_type Struct Reference

Data Fields
tmr_type Struct Reference
AT32F415_periph_driver » TMR » TMR_exported_types

type define tmr register all More...

#include <at32f415_tmr.h>

Data Fields

union {
__IO uint32_t ctrl1
struct {
__IO uint32_t tmren: 1
__IO uint32_t ovfen: 1
__IO uint32_t ovfs: 1
__IO uint32_t ocmen: 1
__IO uint32_t cnt_dir: 3
__IO uint32_t prben: 1
__IO uint32_t clkdiv: 2
__IO uint32_t pmen: 1
__IO uint32_t reserved1: 21
} ctrl1_bit
};
tmr ctrl1 register, offset:0x00 More...
union {
__IO uint32_t ctrl2
struct {
__IO uint32_t cbctrl: 1
__IO uint32_t reserved1: 1
__IO uint32_t ccfs: 1
__IO uint32_t drs: 1
__IO uint32_t ptos: 3
__IO uint32_t c1insel: 1
__IO uint32_t c1ios: 1
__IO uint32_t c1cios: 1
__IO uint32_t c2ios: 1
__IO uint32_t c2cios: 1
__IO uint32_t c3ios: 1
__IO uint32_t c3cios: 1
__IO uint32_t c4ios: 1
__IO uint32_t reserved2: 17
} ctrl2_bit
};
tmr ctrl2 register, offset:0x04 More...
union {
__IO uint32_t stctrl
struct {
__IO uint32_t smsel: 3
__IO uint32_t reserved1: 1
__IO uint32_t stis: 3
__IO uint32_t sts: 1
__IO uint32_t esf: 4
__IO uint32_t esdiv: 2
__IO uint32_t ecmben: 1
__IO uint32_t esp: 1
__IO uint32_t reserved2: 16
} stctrl_bit
};
tmr smc register, offset:0x08 More...
union {
__IO uint32_t iden
struct {
__IO uint32_t ovfien: 1
__IO uint32_t c1ien: 1
__IO uint32_t c2ien: 1
__IO uint32_t c3ien: 1
__IO uint32_t c4ien: 1
__IO uint32_t hallien: 1
__IO uint32_t tien: 1
__IO uint32_t brkie: 1
__IO uint32_t ovfden: 1
__IO uint32_t c1den: 1
__IO uint32_t c2den: 1
__IO uint32_t c3den: 1
__IO uint32_t c4den: 1
__IO uint32_t hallde: 1
__IO uint32_t tden: 1
__IO uint32_t reserved1: 17
} iden_bit
};
tmr die register, offset:0x0C More...
union {
__IO uint32_t ists
struct {
__IO uint32_t ovfif: 1
__IO uint32_t c1if: 1
__IO uint32_t c2if: 1
__IO uint32_t c3if: 1
__IO uint32_t c4if: 1
__IO uint32_t hallif: 1
__IO uint32_t trgif: 1
__IO uint32_t brkif: 1
__IO uint32_t reserved1: 1
__IO uint32_t c1rf: 1
__IO uint32_t c2rf: 1
__IO uint32_t c3rf: 1
__IO uint32_t c4rf: 1
__IO uint32_t reserved2: 19
} ists_bit
};
tmr ists register, offset:0x10 More...
union {
__IO uint32_t swevt
struct {
__IO uint32_t ovfswtr: 1
__IO uint32_t c1swtr: 1
__IO uint32_t c2swtr: 1
__IO uint32_t c3swtr: 1
__IO uint32_t c4swtr: 1
__IO uint32_t hallswtr: 1
__IO uint32_t trgswtr: 1
__IO uint32_t brkswtr: 1
__IO uint32_t reserved: 24
} swevt_bit
};
tmr eveg register, offset:0x14 More...
union {
__IO uint32_t cm1
struct {
__IO uint32_t c1c: 2
__IO uint32_t c1oien: 1
__IO uint32_t c1oben: 1
__IO uint32_t c1octrl: 3
__IO uint32_t c1osen: 1
__IO uint32_t c2c: 2
__IO uint32_t c2oien: 1
__IO uint32_t c2oben: 1
__IO uint32_t c2octrl: 3
__IO uint32_t c2osen: 1
__IO uint32_t reserved1: 16
} cm1_output_bit
channel mode More...
struct {
__IO uint32_t c1c: 2
__IO uint32_t c1idiv: 2
__IO uint32_t c1df: 4
__IO uint32_t c2c: 2
__IO uint32_t c2idiv: 2
__IO uint32_t c2df: 4
__IO uint32_t reserved1: 16
} cm1_input_bit
input capture mode More...
};
tmr ccm1 register, offset:0x18 More...
union {
__IO uint32_t cm2
struct {
__IO uint32_t c3c: 2
__IO uint32_t c3oien: 1
__IO uint32_t c3oben: 1
__IO uint32_t c3octrl: 3
__IO uint32_t c3osen: 1
__IO uint32_t c4c: 2
__IO uint32_t c4oien: 1
__IO uint32_t c4oben: 1
__IO uint32_t c4octrl: 3
__IO uint32_t c4osen: 1
__IO uint32_t reserved1: 16
} cm2_output_bit
channel mode More...
struct {
__IO uint32_t c3c: 2
__IO uint32_t c3idiv: 2
__IO uint32_t c3df: 4
__IO uint32_t c4c: 2
__IO uint32_t c4idiv: 2
__IO uint32_t c4df: 4
__IO uint32_t reserved1: 16
} cm2_input_bit
input capture mode More...
};
tmr ccm2 register, offset:0x1C More...
union {
uint32_t cctrl
struct {
__IO uint32_t c1en: 1
__IO uint32_t c1p: 1
__IO uint32_t c1cen: 1
__IO uint32_t c1cp: 1
__IO uint32_t c2en: 1
__IO uint32_t c2p: 1
__IO uint32_t c2cen: 1
__IO uint32_t c2cp: 1
__IO uint32_t c3en: 1
__IO uint32_t c3p: 1
__IO uint32_t c3cen: 1
__IO uint32_t c3cp: 1
__IO uint32_t c4en: 1
__IO uint32_t c4p: 1
__IO uint32_t reserved1: 18
} cctrl_bit
};
tmr cce register, offset:0x20 More...
union {
__IO uint32_t cval
struct {
__IO uint32_t cval: 32
} cval_bit
};
tmr cnt register, offset:0x24 More...
union {
__IO uint32_t div
struct {
__IO uint32_t div: 16
__IO uint32_t reserved1: 16
} div_bit
};
tmr div, offset:0x28 More...
union {
__IO uint32_t pr
struct {
__IO uint32_t pr: 32
} pr_bit
};
tmr pr register, offset:0x2C More...
union {
__IO uint32_t rpr
struct {
__IO uint32_t rpr: 8
__IO uint32_t reserved1: 24
} rpr_bit
};
tmr rpr register, offset:0x30 More...
union {
uint32_t c1dt
struct {
__IO uint32_t c1dt: 32
} c1dt_bit
};
tmr c1dt register, offset:0x34 More...
union {
uint32_t c2dt
struct {
__IO uint32_t c2dt: 32
} c2dt_bit
};
tmr c2dt register, offset:0x38 More...
union {
__IO uint32_t c3dt
struct {
__IO uint32_t c3dt: 32
} c3dt_bit
};
tmr c3dt register, offset:0x3C More...
union {
__IO uint32_t c4dt
struct {
__IO uint32_t c4dt: 32
} c4dt_bit
};
tmr c4dt register, offset:0x40 More...
union {
__IO uint32_t brk
struct {
__IO uint32_t dtc: 8
__IO uint32_t wpc: 2
__IO uint32_t fcsodis: 1
__IO uint32_t fcsoen: 1
__IO uint32_t brken: 1
__IO uint32_t brkv: 1
__IO uint32_t aoen: 1
__IO uint32_t oen: 1
__IO uint32_t reserved1: 16
} brk_bit
};
tmr brk register, offset:0x44 More...
union {
__IO uint32_t dmactrl
struct {
__IO uint32_t addr: 5
__IO uint32_t reserved1: 3
__IO uint32_t dtb: 5
__IO uint32_t reserved2: 19
} dmactrl_bit
};
tmr dmactrl register, offset:0x48 More...
union {
__IO uint32_t dmadt
struct {
__IO uint32_t dmadt: 16
__IO uint32_t reserved1: 16
} dmadt_bit
};
tmr dmadt register, offset:0x4C More...

Detailed Description

type define tmr register all

Definition at line 436 of file at32f415_tmr.h.

Field Documentation

◆

union { ... } tmr_type::@593

tmr ctrl1 register, offset:0x00

◆

union { ... } tmr_type::@595

tmr ctrl2 register, offset:0x04

◆

union { ... } tmr_type::@597

tmr smc register, offset:0x08

◆

union { ... } tmr_type::@599

tmr die register, offset:0x0C

◆

union { ... } tmr_type::@601

tmr ists register, offset:0x10

◆

union { ... } tmr_type::@603

tmr eveg register, offset:0x14

◆

union { ... } tmr_type::@605

tmr ccm1 register, offset:0x18

◆

union { ... } tmr_type::@607

tmr ccm2 register, offset:0x1C

◆

union { ... } tmr_type::@609

tmr cce register, offset:0x20

◆

union { ... } tmr_type::@611

tmr cnt register, offset:0x24

◆

union { ... } tmr_type::@613

tmr div, offset:0x28

◆

union { ... } tmr_type::@615

tmr pr register, offset:0x2C

◆

union { ... } tmr_type::@617

tmr rpr register, offset:0x30

◆

union { ... } tmr_type::@619

tmr c1dt register, offset:0x34

◆

union { ... } tmr_type::@621

tmr c2dt register, offset:0x38

◆

union { ... } tmr_type::@623

tmr c3dt register, offset:0x3C

◆

union { ... } tmr_type::@625

tmr c4dt register, offset:0x40

◆

union { ... } tmr_type::@627

tmr brk register, offset:0x44

◆

union { ... } tmr_type::@629

tmr dmactrl register, offset:0x48

◆

union { ... } tmr_type::@631

tmr dmadt register, offset:0x4C

◆ addr

__IO uint32_t tmr_type::addr

Definition at line 806 of file at32f415_tmr.h.

Referenced by tmr_dma_control_config().

◆ aoen

__IO uint32_t tmr_type::aoen

Definition at line 793 of file at32f415_tmr.h.

Referenced by tmr_brkdt_config().

◆ brk

__IO uint32_t tmr_type::brk

Definition at line 784 of file at32f415_tmr.h.

◆

struct { ... } tmr_type::brk_bit

Referenced by tmr_brkdt_config(), and tmr_output_enable().

◆ brken

__IO uint32_t tmr_type::brken

Definition at line 791 of file at32f415_tmr.h.

Referenced by tmr_brkdt_config().

◆ brkie

__IO uint32_t tmr_type::brkie

Definition at line 518 of file at32f415_tmr.h.

◆ brkif

__IO uint32_t tmr_type::brkif

Definition at line 545 of file at32f415_tmr.h.

◆ brkswtr

__IO uint32_t tmr_type::brkswtr

Definition at line 570 of file at32f415_tmr.h.

◆ brkv

__IO uint32_t tmr_type::brkv

Definition at line 792 of file at32f415_tmr.h.

Referenced by tmr_brkdt_config().

◆ c1c

__IO uint32_t tmr_type::c1c

Definition at line 587 of file at32f415_tmr.h.

Referenced by tmr_encoder_mode_config(), tmr_input_channel_init(), and tmr_pwm_input_config().

◆ c1cen

__IO uint32_t tmr_type::c1cen

Definition at line 665 of file at32f415_tmr.h.

Referenced by tmr_channel_enable().

◆ c1cios

__IO uint32_t tmr_type::c1cios

Definition at line 473 of file at32f415_tmr.h.

◆ c1cp

__IO uint32_t tmr_type::c1cp

Definition at line 666 of file at32f415_tmr.h.

Referenced by tmr_encoder_mode_config(), tmr_input_channel_init(), and tmr_output_channel_polarity_set().

◆ c1den

__IO uint32_t tmr_type::c1den

Definition at line 520 of file at32f415_tmr.h.

◆ c1df

__IO uint32_t tmr_type::c1df

Definition at line 607 of file at32f415_tmr.h.

Referenced by tmr_input_channel_filter_set(), tmr_input_channel_init(), and tmr_pwm_input_config().

◆ c1dt [1/2]

uint32_t tmr_type::c1dt

Definition at line 736 of file at32f415_tmr.h.

Referenced by tmr_channel_value_get(), and tmr_channel_value_set().

◆ c1dt [2/2]

__IO uint32_t tmr_type::c1dt

Definition at line 739 of file at32f415_tmr.h.

◆

struct { ... } tmr_type::c1dt_bit

◆ c1en

__IO uint32_t tmr_type::c1en

Definition at line 663 of file at32f415_tmr.h.

Referenced by tmr_channel_enable(), tmr_input_channel_init(), and tmr_pwm_input_config().

◆ c1idiv

__IO uint32_t tmr_type::c1idiv

Definition at line 606 of file at32f415_tmr.h.

Referenced by tmr_input_channel_divider_set(), tmr_input_channel_init(), and tmr_pwm_input_config().

◆ c1ien

__IO uint32_t tmr_type::c1ien

Definition at line 512 of file at32f415_tmr.h.

◆ c1if

__IO uint32_t tmr_type::c1if

Definition at line 539 of file at32f415_tmr.h.

◆ c1insel

__IO uint32_t tmr_type::c1insel

Definition at line 471 of file at32f415_tmr.h.

Referenced by tmr_channel1_input_select().

◆ c1ios

__IO uint32_t tmr_type::c1ios

Definition at line 472 of file at32f415_tmr.h.

◆ c1oben

__IO uint32_t tmr_type::c1oben

Definition at line 589 of file at32f415_tmr.h.

Referenced by tmr_output_channel_buffer_enable().

◆ c1octrl

__IO uint32_t tmr_type::c1octrl

Definition at line 590 of file at32f415_tmr.h.

Referenced by tmr_force_output_set(), tmr_output_channel_config(), and tmr_output_channel_mode_select().

◆ c1oien

__IO uint32_t tmr_type::c1oien

Definition at line 588 of file at32f415_tmr.h.

Referenced by tmr_output_channel_immediately_set().

◆ c1osen

__IO uint32_t tmr_type::c1osen

Definition at line 591 of file at32f415_tmr.h.

Referenced by tmr_output_channel_switch_set().

◆ c1p

__IO uint32_t tmr_type::c1p

Definition at line 664 of file at32f415_tmr.h.

Referenced by tmr_encoder_mode_config(), tmr_input_channel_init(), tmr_output_channel_polarity_set(), and tmr_pwm_input_config().

◆ c1rf

__IO uint32_t tmr_type::c1rf

Definition at line 547 of file at32f415_tmr.h.

◆ c1swtr

__IO uint32_t tmr_type::c1swtr

Definition at line 564 of file at32f415_tmr.h.

◆ c2c

__IO uint32_t tmr_type::c2c

Definition at line 592 of file at32f415_tmr.h.

Referenced by tmr_encoder_mode_config(), tmr_input_channel_init(), and tmr_pwm_input_config().

◆ c2cen

__IO uint32_t tmr_type::c2cen

Definition at line 669 of file at32f415_tmr.h.

Referenced by tmr_channel_enable().

◆ c2cios

__IO uint32_t tmr_type::c2cios

Definition at line 475 of file at32f415_tmr.h.

◆ c2cp

__IO uint32_t tmr_type::c2cp

Definition at line 670 of file at32f415_tmr.h.

Referenced by tmr_encoder_mode_config(), tmr_input_channel_init(), and tmr_output_channel_polarity_set().

◆ c2den

__IO uint32_t tmr_type::c2den

Definition at line 521 of file at32f415_tmr.h.

◆ c2df

__IO uint32_t tmr_type::c2df

Definition at line 610 of file at32f415_tmr.h.

Referenced by tmr_input_channel_filter_set(), tmr_input_channel_init(), and tmr_pwm_input_config().

◆ c2dt [1/2]

uint32_t tmr_type::c2dt

Definition at line 748 of file at32f415_tmr.h.

Referenced by tmr_channel_value_get(), and tmr_channel_value_set().

◆ c2dt [2/2]

__IO uint32_t tmr_type::c2dt

Definition at line 751 of file at32f415_tmr.h.

◆

struct { ... } tmr_type::c2dt_bit

◆ c2en

__IO uint32_t tmr_type::c2en

Definition at line 667 of file at32f415_tmr.h.

Referenced by tmr_channel_enable(), tmr_input_channel_init(), and tmr_pwm_input_config().

◆ c2idiv

__IO uint32_t tmr_type::c2idiv

Definition at line 609 of file at32f415_tmr.h.

Referenced by tmr_input_channel_divider_set(), tmr_input_channel_init(), and tmr_pwm_input_config().

◆ c2ien

__IO uint32_t tmr_type::c2ien

Definition at line 513 of file at32f415_tmr.h.

◆ c2if

__IO uint32_t tmr_type::c2if

Definition at line 540 of file at32f415_tmr.h.

◆ c2ios

__IO uint32_t tmr_type::c2ios

Definition at line 474 of file at32f415_tmr.h.

◆ c2oben

__IO uint32_t tmr_type::c2oben

Definition at line 594 of file at32f415_tmr.h.

Referenced by tmr_output_channel_buffer_enable().

◆ c2octrl

__IO uint32_t tmr_type::c2octrl

Definition at line 595 of file at32f415_tmr.h.

Referenced by tmr_force_output_set(), tmr_output_channel_config(), and tmr_output_channel_mode_select().

◆ c2oien

__IO uint32_t tmr_type::c2oien

Definition at line 593 of file at32f415_tmr.h.

Referenced by tmr_output_channel_immediately_set().

◆ c2osen

__IO uint32_t tmr_type::c2osen

Definition at line 596 of file at32f415_tmr.h.

Referenced by tmr_output_channel_switch_set().

◆ c2p

__IO uint32_t tmr_type::c2p

Definition at line 668 of file at32f415_tmr.h.

Referenced by tmr_encoder_mode_config(), tmr_input_channel_init(), tmr_output_channel_polarity_set(), and tmr_pwm_input_config().

◆ c2rf

__IO uint32_t tmr_type::c2rf

Definition at line 548 of file at32f415_tmr.h.

◆ c2swtr

__IO uint32_t tmr_type::c2swtr

Definition at line 565 of file at32f415_tmr.h.

◆ c3c

__IO uint32_t tmr_type::c3c

Definition at line 627 of file at32f415_tmr.h.

Referenced by tmr_input_channel_init().

◆ c3cen

__IO uint32_t tmr_type::c3cen

Definition at line 673 of file at32f415_tmr.h.

Referenced by tmr_channel_enable().

◆ c3cios

__IO uint32_t tmr_type::c3cios

Definition at line 477 of file at32f415_tmr.h.

◆ c3cp

__IO uint32_t tmr_type::c3cp

Definition at line 674 of file at32f415_tmr.h.

Referenced by tmr_input_channel_init(), and tmr_output_channel_polarity_set().

◆ c3den

__IO uint32_t tmr_type::c3den

Definition at line 522 of file at32f415_tmr.h.

◆ c3df

__IO uint32_t tmr_type::c3df

Definition at line 647 of file at32f415_tmr.h.

Referenced by tmr_input_channel_filter_set(), and tmr_input_channel_init().

◆ c3dt

__IO uint32_t tmr_type::c3dt

Definition at line 760 of file at32f415_tmr.h.

Referenced by tmr_channel_value_get(), and tmr_channel_value_set().

◆

struct { ... } tmr_type::c3dt_bit

◆ c3en

__IO uint32_t tmr_type::c3en

Definition at line 671 of file at32f415_tmr.h.

Referenced by tmr_channel_enable(), and tmr_input_channel_init().

◆ c3idiv

__IO uint32_t tmr_type::c3idiv

Definition at line 646 of file at32f415_tmr.h.

Referenced by tmr_input_channel_divider_set(), and tmr_input_channel_init().

◆ c3ien

__IO uint32_t tmr_type::c3ien

Definition at line 514 of file at32f415_tmr.h.

◆ c3if

__IO uint32_t tmr_type::c3if

Definition at line 541 of file at32f415_tmr.h.

◆ c3ios

__IO uint32_t tmr_type::c3ios

Definition at line 476 of file at32f415_tmr.h.

◆ c3oben

__IO uint32_t tmr_type::c3oben

Definition at line 629 of file at32f415_tmr.h.

Referenced by tmr_output_channel_buffer_enable().

◆ c3octrl

__IO uint32_t tmr_type::c3octrl

Definition at line 630 of file at32f415_tmr.h.

Referenced by tmr_force_output_set(), tmr_output_channel_config(), and tmr_output_channel_mode_select().

◆ c3oien

__IO uint32_t tmr_type::c3oien

Definition at line 628 of file at32f415_tmr.h.

Referenced by tmr_output_channel_immediately_set().

◆ c3osen

__IO uint32_t tmr_type::c3osen

Definition at line 631 of file at32f415_tmr.h.

Referenced by tmr_output_channel_switch_set().

◆ c3p

__IO uint32_t tmr_type::c3p

Definition at line 672 of file at32f415_tmr.h.

Referenced by tmr_input_channel_init(), and tmr_output_channel_polarity_set().

◆ c3rf

__IO uint32_t tmr_type::c3rf

Definition at line 549 of file at32f415_tmr.h.

◆ c3swtr

__IO uint32_t tmr_type::c3swtr

Definition at line 566 of file at32f415_tmr.h.

◆ c4c

__IO uint32_t tmr_type::c4c

Definition at line 632 of file at32f415_tmr.h.

Referenced by tmr_input_channel_init().

◆ c4den

__IO uint32_t tmr_type::c4den

Definition at line 523 of file at32f415_tmr.h.

◆ c4df

__IO uint32_t tmr_type::c4df

Definition at line 650 of file at32f415_tmr.h.

Referenced by tmr_input_channel_filter_set(), and tmr_input_channel_init().

◆ c4dt

__IO uint32_t tmr_type::c4dt

Definition at line 772 of file at32f415_tmr.h.

Referenced by tmr_channel_value_get(), and tmr_channel_value_set().

◆

struct { ... } tmr_type::c4dt_bit

◆ c4en

__IO uint32_t tmr_type::c4en

Definition at line 675 of file at32f415_tmr.h.

Referenced by tmr_channel_enable(), and tmr_input_channel_init().

◆ c4idiv

__IO uint32_t tmr_type::c4idiv

Definition at line 649 of file at32f415_tmr.h.

Referenced by tmr_input_channel_divider_set(), and tmr_input_channel_init().

◆ c4ien

__IO uint32_t tmr_type::c4ien

Definition at line 515 of file at32f415_tmr.h.

◆ c4if

__IO uint32_t tmr_type::c4if

Definition at line 542 of file at32f415_tmr.h.

◆ c4ios

__IO uint32_t tmr_type::c4ios

Definition at line 478 of file at32f415_tmr.h.

◆ c4oben

__IO uint32_t tmr_type::c4oben

Definition at line 634 of file at32f415_tmr.h.

Referenced by tmr_output_channel_buffer_enable().

◆ c4octrl

__IO uint32_t tmr_type::c4octrl

Definition at line 635 of file at32f415_tmr.h.

Referenced by tmr_force_output_set(), tmr_output_channel_config(), and tmr_output_channel_mode_select().

◆ c4oien

__IO uint32_t tmr_type::c4oien

Definition at line 633 of file at32f415_tmr.h.

Referenced by tmr_output_channel_immediately_set().

◆ c4osen

__IO uint32_t tmr_type::c4osen

Definition at line 636 of file at32f415_tmr.h.

Referenced by tmr_output_channel_switch_set().

◆ c4p

__IO uint32_t tmr_type::c4p

Definition at line 676 of file at32f415_tmr.h.

Referenced by tmr_input_channel_init(), and tmr_output_channel_polarity_set().

◆ c4rf

__IO uint32_t tmr_type::c4rf

Definition at line 550 of file at32f415_tmr.h.

◆ c4swtr

__IO uint32_t tmr_type::c4swtr

Definition at line 567 of file at32f415_tmr.h.

◆ cbctrl

__IO uint32_t tmr_type::cbctrl

Definition at line 466 of file at32f415_tmr.h.

Referenced by tmr_channel_buffer_enable().

◆ ccfs

__IO uint32_t tmr_type::ccfs

Definition at line 468 of file at32f415_tmr.h.

Referenced by tmr_hall_select().

◆ cctrl

uint32_t tmr_type::cctrl

Definition at line 660 of file at32f415_tmr.h.

Referenced by tmr_output_channel_config().

◆

struct { ... } tmr_type::cctrl_bit

Referenced by tmr_channel_enable(), tmr_encoder_mode_config(), tmr_input_channel_init(), tmr_output_channel_polarity_set(), and tmr_pwm_input_config().

◆ clkdiv

__IO uint32_t tmr_type::clkdiv

Definition at line 452 of file at32f415_tmr.h.

Referenced by tmr_clock_source_div_set().

◆ cm1

__IO uint32_t tmr_type::cm1

Definition at line 580 of file at32f415_tmr.h.

◆

struct { ... } tmr_type::cm1_input_bit

input capture mode

Referenced by tmr_encoder_mode_config(), tmr_input_channel_divider_set(), tmr_input_channel_filter_set(), tmr_input_channel_init(), and tmr_pwm_input_config().

◆

struct { ... } tmr_type::cm1_output_bit

channel mode

Referenced by tmr_force_output_set(), tmr_output_channel_buffer_enable(), tmr_output_channel_config(), tmr_output_channel_immediately_set(), tmr_output_channel_mode_select(), and tmr_output_channel_switch_set().

◆ cm2

__IO uint32_t tmr_type::cm2

Definition at line 620 of file at32f415_tmr.h.

◆

struct { ... } tmr_type::cm2_input_bit

input capture mode

Referenced by tmr_input_channel_divider_set(), tmr_input_channel_filter_set(), and tmr_input_channel_init().

◆

struct { ... } tmr_type::cm2_output_bit

channel mode

Referenced by tmr_force_output_set(), tmr_output_channel_buffer_enable(), tmr_output_channel_config(), tmr_output_channel_immediately_set(), tmr_output_channel_mode_select(), and tmr_output_channel_switch_set().

◆ cnt_dir

__IO uint32_t tmr_type::cnt_dir

Definition at line 450 of file at32f415_tmr.h.

Referenced by tmr_cnt_dir_set().

◆ ctrl1

__IO uint32_t tmr_type::ctrl1

Definition at line 443 of file at32f415_tmr.h.

◆

struct { ... } tmr_type::ctrl1_bit

Referenced by tmr_32_bit_function_enable(), tmr_clock_source_div_set(), tmr_cnt_dir_set(), tmr_counter_enable(), tmr_one_cycle_mode_enable(), tmr_overflow_event_disable(), tmr_overflow_request_source_set(), and tmr_period_buffer_enable().

◆ ctrl2

__IO uint32_t tmr_type::ctrl2

Definition at line 463 of file at32f415_tmr.h.

Referenced by tmr_output_channel_config().

◆

struct { ... } tmr_type::ctrl2_bit

Referenced by tmr_channel1_input_select(), tmr_channel_buffer_enable(), tmr_channel_dma_select(), tmr_hall_select(), and tmr_primary_mode_select().

◆ cval

__IO uint32_t tmr_type::cval

Definition at line 686 of file at32f415_tmr.h.

Referenced by tmr_counter_value_get(), and tmr_counter_value_set().

◆

struct { ... } tmr_type::cval_bit

◆ div

__IO uint32_t tmr_type::div

Definition at line 698 of file at32f415_tmr.h.

Referenced by tmr_base_init(), tmr_div_value_get(), and tmr_div_value_set().

◆

struct { ... } tmr_type::div_bit

◆ dmactrl

__IO uint32_t tmr_type::dmactrl

Definition at line 803 of file at32f415_tmr.h.

◆

struct { ... } tmr_type::dmactrl_bit

Referenced by tmr_dma_control_config().

◆ dmadt

__IO uint32_t tmr_type::dmadt

Definition at line 818 of file at32f415_tmr.h.

◆

struct { ... } tmr_type::dmadt_bit

◆ drs

__IO uint32_t tmr_type::drs

Definition at line 469 of file at32f415_tmr.h.

Referenced by tmr_channel_dma_select().

◆ dtb

__IO uint32_t tmr_type::dtb

Definition at line 808 of file at32f415_tmr.h.

Referenced by tmr_dma_control_config().

◆ dtc

__IO uint32_t tmr_type::dtc

Definition at line 787 of file at32f415_tmr.h.

Referenced by tmr_brkdt_config().

◆ ecmben

__IO uint32_t tmr_type::ecmben

Definition at line 497 of file at32f415_tmr.h.

Referenced by tmr_external_clock_mode2_config().

◆ esdiv

__IO uint32_t tmr_type::esdiv

Definition at line 496 of file at32f415_tmr.h.

Referenced by tmr_external_clock_config().

◆ esf

__IO uint32_t tmr_type::esf

Definition at line 495 of file at32f415_tmr.h.

Referenced by tmr_external_clock_config().

◆ esp

__IO uint32_t tmr_type::esp

Definition at line 498 of file at32f415_tmr.h.

Referenced by tmr_external_clock_config().

◆ fcsodis

__IO uint32_t tmr_type::fcsodis

Definition at line 789 of file at32f415_tmr.h.

Referenced by tmr_brkdt_config().

◆ fcsoen

__IO uint32_t tmr_type::fcsoen

Definition at line 790 of file at32f415_tmr.h.

Referenced by tmr_brkdt_config().

◆ hallde

__IO uint32_t tmr_type::hallde

Definition at line 524 of file at32f415_tmr.h.

◆ hallien

__IO uint32_t tmr_type::hallien

Definition at line 516 of file at32f415_tmr.h.

◆ hallif

__IO uint32_t tmr_type::hallif

Definition at line 543 of file at32f415_tmr.h.

◆ hallswtr

__IO uint32_t tmr_type::hallswtr

Definition at line 568 of file at32f415_tmr.h.

◆ iden

__IO uint32_t tmr_type::iden

Definition at line 508 of file at32f415_tmr.h.

Referenced by tmr_dma_request_enable(), and tmr_interrupt_enable().

◆

struct { ... } tmr_type::iden_bit

◆ ists

__IO uint32_t tmr_type::ists

Definition at line 535 of file at32f415_tmr.h.

Referenced by tmr_flag_clear(), and tmr_flag_get().

◆

struct { ... } tmr_type::ists_bit

◆ ocmen

__IO uint32_t tmr_type::ocmen

Definition at line 449 of file at32f415_tmr.h.

Referenced by tmr_one_cycle_mode_enable().

◆ oen

__IO uint32_t tmr_type::oen

Definition at line 794 of file at32f415_tmr.h.

Referenced by tmr_output_enable().

◆ ovfden

__IO uint32_t tmr_type::ovfden

Definition at line 519 of file at32f415_tmr.h.

◆ ovfen

__IO uint32_t tmr_type::ovfen

Definition at line 447 of file at32f415_tmr.h.

Referenced by tmr_overflow_event_disable().

◆ ovfien

__IO uint32_t tmr_type::ovfien

Definition at line 511 of file at32f415_tmr.h.

◆ ovfif

__IO uint32_t tmr_type::ovfif

Definition at line 538 of file at32f415_tmr.h.

◆ ovfs

__IO uint32_t tmr_type::ovfs

Definition at line 448 of file at32f415_tmr.h.

Referenced by tmr_overflow_request_source_set().

◆ ovfswtr

__IO uint32_t tmr_type::ovfswtr

Definition at line 563 of file at32f415_tmr.h.

Referenced by tmr_base_init().

◆ pmen

__IO uint32_t tmr_type::pmen

Definition at line 453 of file at32f415_tmr.h.

Referenced by tmr_32_bit_function_enable().

◆ pr

__IO uint32_t tmr_type::pr

Definition at line 711 of file at32f415_tmr.h.

Referenced by tmr_base_init(), tmr_period_value_get(), and tmr_period_value_set().

◆

struct { ... } tmr_type::pr_bit

◆ prben

__IO uint32_t tmr_type::prben

Definition at line 451 of file at32f415_tmr.h.

Referenced by tmr_period_buffer_enable().

◆ ptos

__IO uint32_t tmr_type::ptos

Definition at line 470 of file at32f415_tmr.h.

Referenced by tmr_primary_mode_select().

◆ reserved

__IO uint32_t tmr_type::reserved

Definition at line 571 of file at32f415_tmr.h.

◆ reserved1

__IO uint32_t tmr_type::reserved1

Definition at line 454 of file at32f415_tmr.h.

◆ reserved2

__IO uint32_t tmr_type::reserved2

Definition at line 479 of file at32f415_tmr.h.

◆ rpr

__IO uint32_t tmr_type::rpr

Definition at line 723 of file at32f415_tmr.h.

Referenced by tmr_repetition_counter_set().

◆

struct { ... } tmr_type::rpr_bit

Referenced by tmr_repetition_counter_set().

◆ smsel

__IO uint32_t tmr_type::smsel

Definition at line 491 of file at32f415_tmr.h.

Referenced by tmr_encoder_mode_config(), tmr_external_clock_mode1_config(), tmr_internal_clock_set(), and tmr_sub_mode_select().

◆ stctrl

__IO uint32_t tmr_type::stctrl

Definition at line 488 of file at32f415_tmr.h.

◆

struct { ... } tmr_type::stctrl_bit

Referenced by tmr_encoder_mode_config(), tmr_external_clock_config(), tmr_external_clock_mode1_config(), tmr_external_clock_mode2_config(), tmr_internal_clock_set(), tmr_sub_mode_select(), tmr_sub_sync_mode_set(), and tmr_trigger_input_select().

◆ stis

__IO uint32_t tmr_type::stis

Definition at line 493 of file at32f415_tmr.h.

Referenced by tmr_external_clock_mode1_config(), and tmr_trigger_input_select().

◆ sts

__IO uint32_t tmr_type::sts

Definition at line 494 of file at32f415_tmr.h.

Referenced by tmr_sub_sync_mode_set().

◆ swevt

__IO uint32_t tmr_type::swevt

Definition at line 560 of file at32f415_tmr.h.

Referenced by tmr_event_sw_trigger().

◆

struct { ... } tmr_type::swevt_bit

Referenced by tmr_base_init().

◆ tden

__IO uint32_t tmr_type::tden

Definition at line 525 of file at32f415_tmr.h.

◆ tien

__IO uint32_t tmr_type::tien

Definition at line 517 of file at32f415_tmr.h.

◆ tmren

__IO uint32_t tmr_type::tmren

Definition at line 446 of file at32f415_tmr.h.

Referenced by tmr_counter_enable().

◆ trgif

__IO uint32_t tmr_type::trgif

Definition at line 544 of file at32f415_tmr.h.

◆ trgswtr

__IO uint32_t tmr_type::trgswtr

Definition at line 569 of file at32f415_tmr.h.

◆ wpc

__IO uint32_t tmr_type::wpc

Definition at line 788 of file at32f415_tmr.h.

Referenced by tmr_brkdt_config().

The documentation for this struct was generated from the following file:
  • at32f415_tmr.h


AT32F415 Firmwary Library: TMR_exported_functions

Functions
TMR_exported_functions
AT32F415_periph_driver » TMR

Functions

void | tmr_reset (tmr_type *tmr_x)
tmr reset by crm reset register More...
void | tmr_counter_enable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter More...
void | tmr_output_default_para_init (tmr_output_config_type *tmr_output_struct)
init tmr output default para More...
void | tmr_input_default_para_init (tmr_input_config_type *tmr_input_struct)
init tmr input default para More...
void | tmr_brkdt_default_para_init (tmr_brkdt_config_type *tmr_brkdt_struct)
init tmr brkdt default para More...
void | tmr_base_init (tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base More...
void | tmr_clock_source_div_set (tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division More...
void | tmr_cnt_dir_set (tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction More...
void | tmr_repetition_counter_set (tmr_type *tmr_x, uint8_t tmr_rpr_value)
set the repetition counter register(rpr) value More...
void | tmr_counter_value_set (tmr_type *tmr_x, uint32_t tmr_cnt_value)
set tmr counter value More...
uint32_t | tmr_counter_value_get (tmr_type *tmr_x)
get tmr counter value More...
void | tmr_div_value_set (tmr_type *tmr_x, uint32_t tmr_div_value)
set tmr div value More...
uint32_t | tmr_div_value_get (tmr_type *tmr_x)
get tmr div value More...
void | tmr_output_channel_config (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel More...
void | tmr_output_channel_mode_select (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_control_mode_type oc_mode)
select tmr output channel mode More...
void | tmr_period_value_set (tmr_type *tmr_x, uint32_t tmr_pr_value)
set tmr period value More...
uint32_t | tmr_period_value_get (tmr_type *tmr_x)
get tmr period value More...
void | tmr_channel_value_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value More...
uint32_t | tmr_channel_value_get (tmr_type *tmr_x, tmr_channel_select_type tmr_channel)
get tmr channel value More...
void | tmr_period_buffer_enable (tmr_type *tmr_x, confirm_state new_state)
enable tmr period buffer More...
void | tmr_output_channel_buffer_enable (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
enable tmr output channel buffer More...
void | tmr_output_channel_immediately_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
set tmr output channel immediately More...
void | tmr_output_channel_switch_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
set tmr output channel switch More...
void | tmr_one_cycle_mode_enable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr one cycle mode More...
void | tmr_32_bit_function_enable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr 32 bit function(plus mode) More...
void | tmr_overflow_request_source_set (tmr_type *tmr_x, confirm_state new_state)
select tmr the overflow event sources More...
void | tmr_overflow_event_disable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr overflow event generation More...
void | tmr_input_channel_init (tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
init tmr input channel More...
void | tmr_channel_enable (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
tmr channel enable More...
void | tmr_input_channel_filter_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint16_t filter_value)
set tmr input channel filter More...
void | tmr_pwm_input_config (tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
config tmr pwm input More...
void | tmr_channel1_input_select (tmr_type *tmr_x, tmr_channel1_input_connected_type ti1_connect)
select tmr channel1 input More...
void | tmr_input_channel_divider_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_channel_input_divider_type divider_factor)
set tmr input channel divider More...
void | tmr_primary_mode_select (tmr_type *tmr_x, tmr_primary_select_type primary_mode)
select tmr primary mode More...
void | tmr_sub_mode_select (tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode More...
void | tmr_channel_dma_select (tmr_type *tmr_x, tmr_dma_request_source_type cc_dma_select)
select tmr channel dma More...
void | tmr_hall_select (tmr_type *tmr_x, confirm_state new_state)
select tmr hall More...
void | tmr_channel_buffer_enable (tmr_type *tmr_x, confirm_state new_state)
enable tmr channel buffer More...
void | tmr_trigger_input_select (tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger More...
void | tmr_sub_sync_mode_set (tmr_type *tmr_x, confirm_state new_state)
set tmr subordinate synchronization mode More...
void | tmr_dma_request_enable (tmr_type *tmr_x, tmr_dma_request_type dma_request, confirm_state new_state)
enable or disable tmr dma request More...
void | tmr_interrupt_enable (tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt More...
flag_status | tmr_flag_get (tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag More...
void | tmr_flag_clear (tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag More...
void | tmr_event_sw_trigger (tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event More...
void | tmr_output_enable (tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable More...
void | tmr_internal_clock_set (tmr_type *tmr_x)
set tmr select internal clock More...
void | tmr_output_channel_polarity_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_polarity_active_type oc_polarity)
set tmr output channel polarity More...
void | tmr_external_clock_config (tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock More...
void | tmr_external_clock_mode1_config (tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock mode1 More...
void | tmr_external_clock_mode2_config (tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock mode2 More...
void | tmr_encoder_mode_config (tmr_type *tmr_x, tmr_encoder_mode_type encoder_mode, tmr_input_polarity_type ic1_polarity, tmr_input_polarity_type ic2_polarity)
config tmr encoder mode More...
void | tmr_force_output_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_force_output_type force_output)
set tmr force output More...
void | tmr_dma_control_config (tmr_type *tmr_x, tmr_dma_transfer_length_type dma_length, tmr_dma_address_type dma_base_address)
config tmr dma control More...
void | tmr_brkdt_config (tmr_type *tmr_x, tmr_brkdt_config_type *brkdt_struct)
config tmr break mode and dead-time More...

Detailed Description

Function Documentation

◆ tmr_32_bit_function_enable()

void tmr_32_bit_function_enable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tmr 32 bit function(plus mode)

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR2, TMR5
new_state | (TRUE or FALSE)
Return values
none

Definition at line 730 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_base_init()

void tmr_base_init | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_pr,
 |  | uint32_t | tmr_div
 | ) |  |

init tmr base

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_pr | (for 16 bit tmr 0x0000~0xFFFF, for 32 bit tmr 0x0000_0000~0xFFFF_FFFF)
tmr_div | (timer div value:0x0000~0xFFFF)
Return values
none

Definition at line 167 of file at32f415_tmr.c.

Referenced by main(), mclk_tmr1_init(), tmr1_config(), tmr1_init(), tmr2_config(), and tmr_init().

◆ tmr_brkdt_config()

void tmr_brkdt_config | ( | tmr_type * | tmr_x,
 |  | tmr_brkdt_config_type * | brkdt_struct
 | ) |  |

config tmr break mode and dead-time

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1
brkdt_struct
  • to the structure of tmr_brkdt_config_type
Return values
none

Definition at line 1677 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_brkdt_default_para_init()

void tmr_brkdt_default_para_init ( tmr_brkdt_config_type * tmr_brkdt_struct )

init tmr brkdt default para

Parameters
tmr_brkdt_struct
  • to the structure of tmr_brkdt_config_type
Return values
none

Definition at line 146 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_channel1_input_select()

void tmr_channel1_input_select | ( | tmr_type * | tmr_x,
 |  | tmr_channel1_input_connected_type | ti1_connect
 | ) |  |

select tmr channel1 input

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5
ti1_connect this parameter can be one of the following values:
  • TMR_CHANEL1_CONNECTED_C1IRAW
  • TMR_CHANEL1_2_3_CONNECTED_C1IRAW_XOR
Return values
none

Definition at line 1055 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_channel_buffer_enable()

void tmr_channel_buffer_enable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

enable tmr channel buffer

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1
new_state | (TRUE or FALSE)
Return values
none

Definition at line 1190 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_channel_dma_select()

void tmr_channel_dma_select | ( | tmr_type * | tmr_x,
 |  | tmr_dma_request_source_type | cc_dma_select
 | ) |  |

select tmr channel dma

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
cc_dma_select this parameter can be one of the following values:
  • TMR_DMA_REQUEST_BY_CHANNEL
  • TMR_DMA_REQUEST_BY_OVERFLOW
Return values
none

Definition at line 1164 of file at32f415_tmr.c.

◆ tmr_channel_enable()

void tmr_channel_enable | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | confirm_state | new_state
 | ) |  |

tmr channel enable

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_1C
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_2C
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_3C
  • TMR_SELECT_CHANNEL_4
new_state | (TRUE or FALSE)
Return values
none

Definition at line 847 of file at32f415_tmr.c.

Referenced by main(), and TMR1_TRG_HALL_TMR11_IRQHandler().

◆ tmr_channel_value_get()

uint32_t tmr_channel_value_get | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel
 | ) |  |

get tmr channel value

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
Return values
tmr channel value

Definition at line 527 of file at32f415_tmr.c.

Referenced by TMR1_BRK_TMR9_IRQHandler(), TMR2_GLOBAL_IRQHandler(), TMR3_GLOBAL_IRQHandler(), and TMR5_GLOBAL_IRQHandler().

◆ tmr_channel_value_set()

void tmr_channel_value_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | uint32_t | tmr_channel_value
 | ) |  |

set tmr channel value

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
tmr_channel_value | (for 16 bit tmr 0x0000~0xFFFF, for 32 bit tmr 0x0000_0000~0xFFFF_FFFF)
Return values
none

Definition at line 483 of file at32f415_tmr.c.

Referenced by main(), mclk_tmr1_init(), TMR1_BRK_TMR9_IRQHandler(), tmr1_config(), TMR2_GLOBAL_IRQHandler(), and TMR3_GLOBAL_IRQHandler().

◆ tmr_clock_source_div_set()

void tmr_clock_source_div_set | ( | tmr_type * | tmr_x,
 |  | tmr_clock_division_type | tmr_clock_div
 | ) |  |

set tmr clock source division

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_clock_div this parameter can be one of the following values:
  • TMR_CLOCK_DIV1
  • TMR_CLOCK_DIV2
  • TMR_CLOCK_DIV4
Return values
none

Definition at line 191 of file at32f415_tmr.c.

Referenced by main(), mclk_tmr1_init(), tmr1_config(), tmr1_init(), and tmr2_config().

◆ tmr_cnt_dir_set()

void tmr_cnt_dir_set | ( | tmr_type * | tmr_x,
 |  | tmr_count_mode_type | tmr_cnt_dir
 | ) |  |

set tmr counter count direction

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_cnt_dir this parameter can be one of the following values:
  • TMR_COUNT_UP
  • TMR_COUNT_DOWN
  • TMR_COUNT_TWO_WAY_1
  • TMR_COUNT_TWO_WAY_2
  • TMR_COUNT_TWO_WAY_3
Return values
none

Definition at line 211 of file at32f415_tmr.c.

Referenced by main(), mclk_tmr1_init(), tmr1_config(), tmr1_init(), tmr2_config(), and tmr_init().

◆ tmr_counter_enable()

void tmr_counter_enable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tmr counter

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
new_state | (TRUE or FALSE)
Return values
none

Definition at line 103 of file at32f415_tmr.c.

Referenced by lick_frequency_get(), main(), mclk_tmr1_init(), tmr1_init(), tmr2_config(), and tmr_init().

◆ tmr_counter_value_get()

uint32_t tmr_counter_value_get ( tmr_type * tmr_x )

get tmr counter value

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
Return values
tmr counter value

Definition at line 257 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_counter_value_set()

void tmr_counter_value_set | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_cnt_value
 | ) |  |

set tmr counter value

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_cnt_value | (for 16 bit tmr 0x0000~0xFFFF, for 32 bit tmr 0x0000_0000~0xFFFF_FFFF)
Return values
none

Definition at line 244 of file at32f415_tmr.c.

◆ tmr_div_value_get()

uint32_t tmr_div_value_get ( tmr_type * tmr_x )

get tmr div value

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
Return values
tmr div value

Definition at line 284 of file at32f415_tmr.c.

◆ tmr_div_value_set()

void tmr_div_value_set | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_div_value
 | ) |  |

set tmr div value

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_div_value | (for 16 bit tmr 0x0000~0xFFFF, for 32 bit tmr 0x0000_0000~0xFFFF_FFFF)
Return values
none

Definition at line 271 of file at32f415_tmr.c.

Referenced by lick_frequency_get().

◆ tmr_dma_control_config()

void tmr_dma_control_config | ( | tmr_type * | tmr_x,
 |  | tmr_dma_transfer_length_type | dma_length,
 |  | tmr_dma_address_type | dma_base_address
 | ) |  |

config tmr dma control

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5
dma_length this parameter can be one of the following values:
  • TMR_DMA_TRANSFER_1BYTE
  • TMR_DMA_TRANSFER_2BYTES
  • TMR_DMA_TRANSFER_3BYTES ...
  • TMR_DMA_TRANSFER_17BYTES
  • TMR_DMA_TRANSFER_18BYTES
dma_base_address this parameter can be one of the following values:
  • TMR_CTRL1_ADDRESS
  • TMR_CTRL2_ADDRESS
  • TMR_STCTRL_ADDRESS
  • TMR_IDEN_ADDRESS
  • TMR_ISTS_ADDRESS
  • TMR_SWEVT_ADDRESS
  • TMR_CM1_ADDRESS
  • TMR_CM2_ADDRESS
  • TMR_CCTRL_ADDRESS
  • TMR_CVAL_ADDRESS
  • TMR_DIV_ADDRESS
  • TMR_PR_ADDRESS
  • TMR_RPR_ADDRESS
  • TMR_C1DT_ADDRESS
  • TMR_C2DT_ADDRESS
  • TMR_C3DT_ADDRESS
  • TMR_C4DT_ADDRESS
  • TMR_BRK_ADDRESS
  • TMR_DMACTRL_ADDRESS
Return values
none

Definition at line 1661 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_dma_request_enable()

void tmr_dma_request_enable | ( | tmr_type * | tmr_x,
 |  | tmr_dma_request_type | dma_request,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tmr dma request

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
dma_request this parameter can be one of the following values:
  • TMR_OVERFLOW_DMA_REQUEST
  • TMR_C1_DMA_REQUEST
  • TMR_C2_DMA_REQUEST
  • TMR_C3_DMA_REQUEST
  • TMR_C4_DMA_REQUEST
  • TMR_HALL_DMA_REQUEST
  • TMR_TRIGGER_DMA_REQUEST
new_state | (TRUE or FALSE)
Return values
none

Definition at line 1247 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_encoder_mode_config()

void tmr_encoder_mode_config | ( | tmr_type * | tmr_x,
 |  | tmr_encoder_mode_type | encoder_mode,
 |  | tmr_input_polarity_type | ic1_polarity,
 |  | tmr_input_polarity_type | ic2_polarity
 | ) |  |

config tmr encoder mode

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5
encoder_mode this parameter can be one of the following values:
  • TMR_ENCODER_MODE_A
  • TMR_ENCODER_MODE_B
  • TMR_ENCODER_MODE_C
ic1_polarity this parameter can be one of the following values:
  • TMR_INPUT_RISING_EDGE
  • TMR_INPUT_FALLING_EDGE
  • TMR_INPUT_BOTH_EDGE
ic2_polarity this parameter can be one of the following values:
  • TMR_INPUT_RISING_EDGE
  • TMR_INPUT_FALLING_EDGE
  • TMR_INPUT_BOTH_EDGE
Return values
none

Definition at line 1560 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_event_sw_trigger()

void tmr_event_sw_trigger | ( | tmr_type * | tmr_x,
 |  | tmr_event_trigger_type | tmr_event
 | ) |  |

generate tmr event

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_event this parameter can be one of the following values:
  • TMR_OVERFLOW_SWTRIG
  • TMR_C1_SWTRIG
  • TMR_C2_SWTRIG
  • TMR_C3_SWTRIG
  • TMR_C4_SWTRIG
  • TMR_HALL_SWTRIG
  • TMR_TRIGGER_SWTRIG
  • TMR_BRK_SWTRIG
Return values
none

Definition at line 1369 of file at32f415_tmr.c.

Referenced by lick_frequency_get(), and SysTick_Handler().

◆ tmr_external_clock_config()

void tmr_external_clock_config | ( | tmr_type * | tmr_x,
 |  | tmr_external_signal_divider_type | es_divide,
 |  | tmr_external_signal_polarity_type | es_polarity,
 |  | uint16_t | es_filter
 | ) |  |

config tmr external clock

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5
es_divide this parameter can be one of the following values:
  • TMR_ES_FREQUENCY_DIV_1
  • TMR_ES_FREQUENCY_DIV_2
  • TMR_ES_FREQUENCY_DIV_4
  • TMR_ES_FREQUENCY_DIV_8
es_polarity this parameter can be one of the following values:
  • TMR_ES_POLARITY_NON_INVERTED
  • TMR_ES_POLARITY_INVERTED
es_filter | (0x0~0xf)
Return values
none

Definition at line 1479 of file at32f415_tmr.c.

Referenced by tmr_external_clock_mode1_config(), and tmr_external_clock_mode2_config().

◆ tmr_external_clock_mode1_config()

void tmr_external_clock_mode1_config | ( | tmr_type * | tmr_x,
 |  | tmr_external_signal_divider_type | es_divide,
 |  | tmr_external_signal_polarity_type | es_polarity,
 |  | uint16_t | es_filter
 | ) |  |

config tmr external clock mode1

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
es_divide this parameter can be one of the following values:
  • TMR_ES_FREQUENCY_DIV_1
  • TMR_ES_FREQUENCY_DIV_2
  • TMR_ES_FREQUENCY_DIV_4
  • TMR_ES_FREQUENCY_DIV_8
es_polarity this parameter can be one of the following values:
  • TMR_ES_POLARITY_NON_INVERTED
  • TMR_ES_POLARITY_INVERTED
es_filter | (0x0~0xf)
Return values
none

Definition at line 1505 of file at32f415_tmr.c.

◆ tmr_external_clock_mode2_config()

void tmr_external_clock_mode2_config | ( | tmr_type * | tmr_x,
 |  | tmr_external_signal_divider_type | es_divide,
 |  | tmr_external_signal_polarity_type | es_polarity,
 |  | uint16_t | es_filter
 | ) |  |

config tmr external clock mode2

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5
es_divide this parameter can be one of the following values:
  • TMR_ES_FREQUENCY_DIV_1
  • TMR_ES_FREQUENCY_DIV_2
  • TMR_ES_FREQUENCY_DIV_4
  • TMR_ES_FREQUENCY_DIV_8
es_polarity this parameter can be one of the following values:
  • TMR_ES_POLARITY_NON_INVERTED
  • TMR_ES_POLARITY_INVERTED
es_filter | (0x0~0xf)
Return values
none

Definition at line 1531 of file at32f415_tmr.c.

◆ tmr_flag_clear()

void tmr_flag_clear | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_flag
 | ) |  |

clear tmr flag

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_flag this parameter can be any combination of the following values:
  • TMR_OVF_FLAG
  • TMR_C1_FLAG
  • TMR_C2_FLAG
  • TMR_C3_FLAG
  • TMR_C4_FLAG
  • TMR_HALL_FLAG
  • TMR_TRIGGER_FLAG
  • TMR_BRK_FLAG
  • TMR_C1_RECAPTURE_FLAG
  • TMR_C2_RECAPTURE_FLAG
  • TMR_C3_RECAPTURE_FLAG
  • TMR_C4_RECAPTURE_FLAG
Return values
none

Definition at line 1347 of file at32f415_tmr.c.

Referenced by TMR1_BRK_TMR9_IRQHandler(), TMR1_OVF_TMR10_IRQHandler(), TMR1_TRG_HALL_TMR11_IRQHandler(), TMR2_GLOBAL_IRQHandler(), TMR3_GLOBAL_IRQHandler(), and TMR5_GLOBAL_IRQHandler().

◆ tmr_flag_get()

flag_status tmr_flag_get | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_flag
 | ) |  |

get tmr flag

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_flag this parameter can be one of the following values:
  • TMR_OVF_FLAG
  • TMR_C1_FLAG
  • TMR_C2_FLAG
  • TMR_C3_FLAG
  • TMR_C4_FLAG
  • TMR_HALL_FLAG
  • TMR_TRIGGER_FLAG
  • TMR_BRK_FLAG
  • TMR_C1_RECAPTURE_FLAG
  • TMR_C2_RECAPTURE_FLAG
  • TMR_C3_RECAPTURE_FLAG
  • TMR_C4_RECAPTURE_FLAG
Return values
state of tmr flag

Definition at line 1310 of file at32f415_tmr.c.

Referenced by TMR1_BRK_TMR9_IRQHandler(), TMR1_OVF_TMR10_IRQHandler(), TMR2_GLOBAL_IRQHandler(), TMR3_GLOBAL_IRQHandler(), and TMR5_GLOBAL_IRQHandler().

◆ tmr_force_output_set()

void tmr_force_output_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | tmr_force_output_type | force_output
 | ) |  |

set tmr force output

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
force_output this parameter can be one of the following values:
  • TMR_FORCE_OUTPUT_HIGH
  • TMR_FORCE_OUTPUT_LOW
Return values
none

Definition at line 1595 of file at32f415_tmr.c.

◆ tmr_hall_select()

void tmr_hall_select | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

select tmr hall

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1
new_state | (TRUE or FALSE)
Return values
none

Definition at line 1177 of file at32f415_tmr.c.

◆ tmr_input_channel_divider_set()

void tmr_input_channel_divider_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | tmr_channel_input_divider_type | divider_factor
 | ) |  |

set tmr input channel divider

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
divider_factor this parameter can be one of the following values:
  • TMR_CHANNEL_INPUT_DIV_1
  • TMR_CHANNEL_INPUT_DIV_2
  • TMR_CHANNEL_INPUT_DIV_4
  • TMR_CHANNEL_INPUT_DIV_8
Return values
none

Definition at line 1079 of file at32f415_tmr.c.

Referenced by lick_frequency_get().

◆ tmr_input_channel_filter_set()

void tmr_input_channel_filter_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | uint16_t | filter_value
 | ) |  |

set tmr input channel filter

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
filter_value | (0x0~0xf)
Return values
none

Definition at line 902 of file at32f415_tmr.c.

◆ tmr_input_channel_init()

void tmr_input_channel_init | ( | tmr_type * | tmr_x,
 |  | tmr_input_config_type * | input_struct,
 |  | tmr_channel_input_divider_type | divider_factor
 | ) |  |

init tmr input channel

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
input_struct
  • to the structure of tmr_input_config_type
divider_factor this parameter can be one of the following values:
  • TMR_CHANNEL_INPUT_DIV_1
  • TMR_CHANNEL_INPUT_DIV_2
  • TMR_CHANNEL_INPUT_DIV_4
  • TMR_CHANNEL_INPUT_DIV_8
Return values
none

Definition at line 780 of file at32f415_tmr.c.

Referenced by lick_frequency_get(), main(), and tmr1_init().

◆ tmr_input_default_para_init()

void tmr_input_default_para_init ( tmr_input_config_type * tmr_input_struct )

init tmr input default para

Parameters
tmr_input_struct
  • to the structure of tmr_input_config_type
Return values
none

Definition at line 132 of file at32f415_tmr.c.

Referenced by main(), and tmr1_init().

◆ tmr_internal_clock_set()

void tmr_internal_clock_set ( tmr_type * tmr_x )

set tmr select internal clock

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
Return values
none

Definition at line 1394 of file at32f415_tmr.c.

◆ tmr_interrupt_enable()

void tmr_interrupt_enable | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_interrupt,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tmr interrupt

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_interrupt this parameter can be one of the following values:
  • TMR_OVF_INT
  • TMR_C1_INT
  • TMR_C2_INT
  • TMR_C3_INT
  • TMR_C4_INT
  • TMR_HALL_INT
  • TMR_TRIGGER_INT
  • TMR_BRK_INT
new_state | (TRUE or FALSE)
Return values
none

Definition at line 1277 of file at32f415_tmr.c.

Referenced by lick_frequency_get(), main(), tmr1_config(), tmr1_init(), tmr2_config(), and tmr_init().

◆ tmr_one_cycle_mode_enable()

void tmr_one_cycle_mode_enable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tmr one cycle mode

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
new_state | (TRUE or FALSE)
Return values
none

Definition at line 716 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_output_channel_buffer_enable()

void tmr_output_channel_buffer_enable | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | confirm_state | new_state
 | ) |  |

enable tmr output channel buffer

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
new_state | (TRUE or FALSE)
Return values
none

Definition at line 587 of file at32f415_tmr.c.

Referenced by main(), and mclk_tmr1_init().

◆ tmr_output_channel_config()

void tmr_output_channel_config | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | tmr_output_config_type * | tmr_output_struct
 | ) |  |

config tmr output channel

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
tmr_output_struct
  • to the structure of tmr_output_config_type
Return values
none

Definition at line 304 of file at32f415_tmr.c.

Referenced by main(), mclk_tmr1_init(), and tmr1_config().

◆ tmr_output_channel_immediately_set()

void tmr_output_channel_immediately_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | confirm_state | new_state
 | ) |  |

set tmr output channel immediately

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
new_state | (TRUE or FALSE)
Return values
none

Definition at line 632 of file at32f415_tmr.c.

◆ tmr_output_channel_mode_select()

void tmr_output_channel_mode_select | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | tmr_output_control_mode_type | oc_mode
 | ) |  |

select tmr output channel mode

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
oc_mode this parameter can be one of the following values:
  • TMR_OUTPUT_CONTROL_OFF
  • TMR_OUTPUT_CONTROL_HIGH
  • TMR_OUTPUT_CONTROL_LOW
  • TMR_OUTPUT_CONTROL_SWITCH
  • TMR_OUTPUT_CONTROL_FORCE_HIGH
  • TMR_OUTPUT_CONTROL_FORCE_LOW
  • TMR_OUTPUT_CONTROL_PWM_MODE_A
  • TMR_OUTPUT_CONTROL_PWM_MODE_B
Return values
none

Definition at line 409 of file at32f415_tmr.c.

Referenced by TMR1_TRG_HALL_TMR11_IRQHandler().

◆ tmr_output_channel_polarity_set()

void tmr_output_channel_polarity_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | tmr_polarity_active_type | oc_polarity
 | ) |  |

set tmr output channel polarity

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
  • TMR_SELECT_CHANNEL_1C
  • TMR_SELECT_CHANNEL_2C
  • TMR_SELECT_CHANNEL_3C
oc_polarity this parameter can be one of the following values:
  • TMR_POLARITY_ACTIVE_HIGH
  • TMR_POLARITY_ACTIVE_LOW
Return values
none

Definition at line 1419 of file at32f415_tmr.c.

◆ tmr_output_channel_switch_set()

void tmr_output_channel_switch_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | confirm_state | new_state
 | ) |  |

set tmr output channel switch

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
new_state | (TRUE or FALSE)
Return values
none

Definition at line 677 of file at32f415_tmr.c.

◆ tmr_output_default_para_init()

void tmr_output_default_para_init ( tmr_output_config_type * tmr_output_struct )

init tmr output default para

Parameters
tmr_output_struct
  • to the structure of tmr_output_config_type
Return values
none

Definition at line 115 of file at32f415_tmr.c.

Referenced by main(), mclk_tmr1_init(), and tmr1_config().

◆ tmr_output_enable()

void tmr_output_enable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

tmr output enable(oen),this function is important for advtm output enable

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1
new_state | (TRUE or FALSE)
Return values
none

Definition at line 1382 of file at32f415_tmr.c.

Referenced by main(), and mclk_tmr1_init().

◆ tmr_overflow_event_disable()

void tmr_overflow_event_disable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tmr overflow event generation

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
new_state | (TRUE or FALSE)
Return values
none

Definition at line 760 of file at32f415_tmr.c.

◆ tmr_overflow_request_source_set()

void tmr_overflow_request_source_set | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

select tmr the overflow event sources

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
new_state | (TRUE or FALSE)
Return values
none

Definition at line 747 of file at32f415_tmr.c.

◆ tmr_period_buffer_enable()

void tmr_period_buffer_enable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

enable tmr period buffer

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
new_state | (TRUE or FALSE)
Return values
none

Definition at line 567 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_period_value_get()

uint32_t tmr_period_value_get ( tmr_type * tmr_x )

get tmr period value

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
Return values
timer period register value of counter (for 16 bit tmr 0x0000~0xFFFF, for 32 bit tmr 0x0000_0000~0xFFFF_FFFF)

Definition at line 463 of file at32f415_tmr.c.

◆ tmr_period_value_set()

void tmr_period_value_set | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_pr_value
 | ) |  |

set tmr period value

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_pr_value | timer period register value of counter (for 16 bit tmr 0x0000~0xFFFF, for 32 bit tmr 0x0000_0000~0xFFFF_FFFF)
Return values
none

Definition at line 448 of file at32f415_tmr.c.

◆ tmr_primary_mode_select()

void tmr_primary_mode_select | ( | tmr_type * | tmr_x,
 |  | tmr_primary_select_type | primary_mode
 | ) |  |

select tmr primary mode

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5
primary_mode this parameter can be one of the following values:
  • TMR_PRIMARY_SEL_RESET
  • TMR_PRIMARY_SEL_ENABLE
  • TMR_PRIMARY_SEL_OVERFLOW
  • TMR_PRIMARY_SEL_COMPARE
  • TMR_PRIMARY_SEL_C1ORAW
  • TMR_PRIMARY_SEL_C2ORAW
  • TMR_PRIMARY_SEL_C3ORAW
  • TMR_PRIMARY_SEL_C4ORAW
Return values
none

Definition at line 1126 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_pwm_input_config()

void tmr_pwm_input_config | ( | tmr_type * | tmr_x,
 |  | tmr_input_config_type * | input_struct,
 |  | tmr_channel_input_divider_type | divider_factor
 | ) |  |

config tmr pwm input

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
input_struct
  • to the structure of tmr_input_config_type
divider_factor this parameter can be one of the following values:
  • TMR_CHANNEL_INPUT_DIV_1
  • TMR_CHANNEL_INPUT_DIV_2
  • TMR_CHANNEL_INPUT_DIV_4
  • TMR_CHANNEL_INPUT_DIV_8
Return values
none

Definition at line 947 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_repetition_counter_set()

void tmr_repetition_counter_set | ( | tmr_type * | tmr_x,
 |  | uint8_t | tmr_rpr_value
 | ) |  |

set the repetition counter register(rpr) value

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1
tmr_rpr_value | (0x00~0xFF)
Return values
none

Definition at line 225 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_reset()

void tmr_reset ( tmr_type * tmr_x )

tmr reset by crm reset register

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
Return values
none

Definition at line 51 of file at32f415_tmr.c.

Referenced by lick_frequency_get().

◆ tmr_sub_mode_select()

void tmr_sub_mode_select | ( | tmr_type * | tmr_x,
 |  | tmr_sub_mode_select_type | sub_mode
 | ) |  |

select tmr subordinate mode

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
sub_mode this parameter can be one of the following values:
  • TMR_SUB_MODE_DIABLE
  • TMR_SUB_ENCODER_MODE_A
  • TMR_SUB_ENCODER_MODE_B
  • TMR_SUB_ENCODER_MODE_C
  • TMR_SUB_RESET_MODE
  • TMR_SUB_HANG_MODE
  • TMR_SUB_TRIGGER_MODE
  • TMR_SUB_EXTERNAL_CLOCK_MODE_A
Return values
none

Definition at line 1148 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_sub_sync_mode_set()

void tmr_sub_sync_mode_set | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

set tmr subordinate synchronization mode

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
new_state | (TRUE or FALSE)
Return values
none

Definition at line 1225 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_trigger_input_select()

void tmr_trigger_input_select | ( | tmr_type * | tmr_x,
 |  | sub_tmr_input_sel_type | trigger_select
 | ) |  |

select tmr sub-trigger

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
trigger_select this parameter can be one of the following values:
  • TMR_SUB_INPUT_SEL_IS0
  • TMR_SUB_INPUT_SEL_IS1
  • TMR_SUB_INPUT_SEL_IS2
  • TMR_SUB_INPUT_SEL_IS3
  • TMR_SUB_INPUT_SEL_C1INC
  • TMR_SUB_INPUT_SEL_C1DF1
  • TMR_SUB_INPUT_SEL_C2DF2
  • TMR_SUB_INPUT_SEL_EXTIN
Return values
none

Definition at line 1212 of file at32f415_tmr.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_private_functions

Functions
TMR_private_functions
AT32F415_periph_driver » TMR

Functions

void | tmr_reset (tmr_type *tmr_x)
tmr reset by crm reset register More...
void | tmr_counter_enable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter More...
void | tmr_output_default_para_init (tmr_output_config_type *tmr_output_struct)
init tmr output default para More...
void | tmr_input_default_para_init (tmr_input_config_type *tmr_input_struct)
init tmr input default para More...
void | tmr_brkdt_default_para_init (tmr_brkdt_config_type *tmr_brkdt_struct)
init tmr brkdt default para More...
void | tmr_base_init (tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base More...
void | tmr_clock_source_div_set (tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division More...
void | tmr_cnt_dir_set (tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction More...
void | tmr_repetition_counter_set (tmr_type *tmr_x, uint8_t tmr_rpr_value)
set the repetition counter register(rpr) value More...
void | tmr_counter_value_set (tmr_type *tmr_x, uint32_t tmr_cnt_value)
set tmr counter value More...
uint32_t | tmr_counter_value_get (tmr_type *tmr_x)
get tmr counter value More...
void | tmr_div_value_set (tmr_type *tmr_x, uint32_t tmr_div_value)
set tmr div value More...
uint32_t | tmr_div_value_get (tmr_type *tmr_x)
get tmr div value More...
void | tmr_output_channel_config (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel More...
void | tmr_output_channel_mode_select (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_control_mode_type oc_mode)
select tmr output channel mode More...
void | tmr_period_value_set (tmr_type *tmr_x, uint32_t tmr_pr_value)
set tmr period value More...
uint32_t | tmr_period_value_get (tmr_type *tmr_x)
get tmr period value More...
void | tmr_channel_value_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value More...
uint32_t | tmr_channel_value_get (tmr_type *tmr_x, tmr_channel_select_type tmr_channel)
get tmr channel value More...
void | tmr_period_buffer_enable (tmr_type *tmr_x, confirm_state new_state)
enable tmr period buffer More...
void | tmr_output_channel_buffer_enable (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
enable tmr output channel buffer More...
void | tmr_output_channel_immediately_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
set tmr output channel immediately More...
void | tmr_output_channel_switch_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
set tmr output channel switch More...
void | tmr_one_cycle_mode_enable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr one cycle mode More...
void | tmr_32_bit_function_enable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr 32 bit function(plus mode) More...
void | tmr_overflow_request_source_set (tmr_type *tmr_x, confirm_state new_state)
select tmr the overflow event sources More...
void | tmr_overflow_event_disable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr overflow event generation More...
void | tmr_input_channel_init (tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
init tmr input channel More...
void | tmr_channel_enable (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
tmr channel enable More...
void | tmr_input_channel_filter_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint16_t filter_value)
set tmr input channel filter More...
void | tmr_pwm_input_config (tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
config tmr pwm input More...
void | tmr_channel1_input_select (tmr_type *tmr_x, tmr_channel1_input_connected_type ti1_connect)
select tmr channel1 input More...
void | tmr_input_channel_divider_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_channel_input_divider_type divider_factor)
set tmr input channel divider More...
void | tmr_primary_mode_select (tmr_type *tmr_x, tmr_primary_select_type primary_mode)
select tmr primary mode More...
void | tmr_sub_mode_select (tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode More...
void | tmr_channel_dma_select (tmr_type *tmr_x, tmr_dma_request_source_type cc_dma_select)
select tmr channel dma More...
void | tmr_hall_select (tmr_type *tmr_x, confirm_state new_state)
select tmr hall More...
void | tmr_channel_buffer_enable (tmr_type *tmr_x, confirm_state new_state)
enable tmr channel buffer More...
void | tmr_trigger_input_select (tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger More...
void | tmr_sub_sync_mode_set (tmr_type *tmr_x, confirm_state new_state)
set tmr subordinate synchronization mode More...
void | tmr_dma_request_enable (tmr_type *tmr_x, tmr_dma_request_type dma_request, confirm_state new_state)
enable or disable tmr dma request More...
void | tmr_interrupt_enable (tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt More...
flag_status | tmr_flag_get (tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag More...
void | tmr_flag_clear (tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag More...
void | tmr_event_sw_trigger (tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event More...
void | tmr_output_enable (tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable More...
void | tmr_internal_clock_set (tmr_type *tmr_x)
set tmr select internal clock More...
void | tmr_output_channel_polarity_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_polarity_active_type oc_polarity)
set tmr output channel polarity More...
void | tmr_external_clock_config (tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock More...
void | tmr_external_clock_mode1_config (tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock mode1 More...
void | tmr_external_clock_mode2_config (tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock mode2 More...
void | tmr_encoder_mode_config (tmr_type *tmr_x, tmr_encoder_mode_type encoder_mode, tmr_input_polarity_type ic1_polarity, tmr_input_polarity_type ic2_polarity)
config tmr encoder mode More...
void | tmr_force_output_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_force_output_type force_output)
set tmr force output More...
void | tmr_dma_control_config (tmr_type *tmr_x, tmr_dma_transfer_length_type dma_length, tmr_dma_address_type dma_base_address)
config tmr dma control More...
void | tmr_brkdt_config (tmr_type *tmr_x, tmr_brkdt_config_type *brkdt_struct)
config tmr break mode and dead-time More...

Detailed Description

Function Documentation

◆ tmr_32_bit_function_enable()

void tmr_32_bit_function_enable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tmr 32 bit function(plus mode)

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR2, TMR5
new_state | (TRUE or FALSE)
Return values
none

Definition at line 730 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_base_init()

void tmr_base_init | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_pr,
 |  | uint32_t | tmr_div
 | ) |  |

init tmr base

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_pr | (for 16 bit tmr 0x0000~0xFFFF, for 32 bit tmr 0x0000_0000~0xFFFF_FFFF)
tmr_div | (timer div value:0x0000~0xFFFF)
Return values
none

Definition at line 167 of file at32f415_tmr.c.

Referenced by main(), mclk_tmr1_init(), tmr1_config(), tmr1_init(), tmr2_config(), and tmr_init().

◆ tmr_brkdt_config()

void tmr_brkdt_config | ( | tmr_type * | tmr_x,
 |  | tmr_brkdt_config_type * | brkdt_struct
 | ) |  |

config tmr break mode and dead-time

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1
brkdt_struct
  • to the structure of tmr_brkdt_config_type
Return values
none

Definition at line 1677 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_brkdt_default_para_init()

void tmr_brkdt_default_para_init ( tmr_brkdt_config_type * tmr_brkdt_struct )

init tmr brkdt default para

Parameters
tmr_brkdt_struct
  • to the structure of tmr_brkdt_config_type
Return values
none

Definition at line 146 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_channel1_input_select()

void tmr_channel1_input_select | ( | tmr_type * | tmr_x,
 |  | tmr_channel1_input_connected_type | ti1_connect
 | ) |  |

select tmr channel1 input

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5
ti1_connect this parameter can be one of the following values:
  • TMR_CHANEL1_CONNECTED_C1IRAW
  • TMR_CHANEL1_2_3_CONNECTED_C1IRAW_XOR
Return values
none

Definition at line 1055 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_channel_buffer_enable()

void tmr_channel_buffer_enable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

enable tmr channel buffer

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1
new_state | (TRUE or FALSE)
Return values
none

Definition at line 1190 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_channel_dma_select()

void tmr_channel_dma_select | ( | tmr_type * | tmr_x,
 |  | tmr_dma_request_source_type | cc_dma_select
 | ) |  |

select tmr channel dma

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
cc_dma_select this parameter can be one of the following values:
  • TMR_DMA_REQUEST_BY_CHANNEL
  • TMR_DMA_REQUEST_BY_OVERFLOW
Return values
none

Definition at line 1164 of file at32f415_tmr.c.

◆ tmr_channel_enable()

void tmr_channel_enable | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | confirm_state | new_state
 | ) |  |

tmr channel enable

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_1C
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_2C
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_3C
  • TMR_SELECT_CHANNEL_4
new_state | (TRUE or FALSE)
Return values
none

Definition at line 847 of file at32f415_tmr.c.

Referenced by main(), and TMR1_TRG_HALL_TMR11_IRQHandler().

◆ tmr_channel_value_get()

uint32_t tmr_channel_value_get | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel
 | ) |  |

get tmr channel value

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
Return values
tmr channel value

Definition at line 527 of file at32f415_tmr.c.

Referenced by TMR1_BRK_TMR9_IRQHandler(), TMR2_GLOBAL_IRQHandler(), TMR3_GLOBAL_IRQHandler(), and TMR5_GLOBAL_IRQHandler().

◆ tmr_channel_value_set()

void tmr_channel_value_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | uint32_t | tmr_channel_value
 | ) |  |

set tmr channel value

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
tmr_channel_value | (for 16 bit tmr 0x0000~0xFFFF, for 32 bit tmr 0x0000_0000~0xFFFF_FFFF)
Return values
none

Definition at line 483 of file at32f415_tmr.c.

Referenced by main(), mclk_tmr1_init(), TMR1_BRK_TMR9_IRQHandler(), tmr1_config(), TMR2_GLOBAL_IRQHandler(), and TMR3_GLOBAL_IRQHandler().

◆ tmr_clock_source_div_set()

void tmr_clock_source_div_set | ( | tmr_type * | tmr_x,
 |  | tmr_clock_division_type | tmr_clock_div
 | ) |  |

set tmr clock source division

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_clock_div this parameter can be one of the following values:
  • TMR_CLOCK_DIV1
  • TMR_CLOCK_DIV2
  • TMR_CLOCK_DIV4
Return values
none

Definition at line 191 of file at32f415_tmr.c.

Referenced by main(), mclk_tmr1_init(), tmr1_config(), tmr1_init(), and tmr2_config().

◆ tmr_cnt_dir_set()

void tmr_cnt_dir_set | ( | tmr_type * | tmr_x,
 |  | tmr_count_mode_type | tmr_cnt_dir
 | ) |  |

set tmr counter count direction

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_cnt_dir this parameter can be one of the following values:
  • TMR_COUNT_UP
  • TMR_COUNT_DOWN
  • TMR_COUNT_TWO_WAY_1
  • TMR_COUNT_TWO_WAY_2
  • TMR_COUNT_TWO_WAY_3
Return values
none

Definition at line 211 of file at32f415_tmr.c.

Referenced by main(), mclk_tmr1_init(), tmr1_config(), tmr1_init(), tmr2_config(), and tmr_init().

◆ tmr_counter_enable()

void tmr_counter_enable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tmr counter

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
new_state | (TRUE or FALSE)
Return values
none

Definition at line 103 of file at32f415_tmr.c.

Referenced by lick_frequency_get(), main(), mclk_tmr1_init(), tmr1_init(), tmr2_config(), and tmr_init().

◆ tmr_counter_value_get()

uint32_t tmr_counter_value_get ( tmr_type * tmr_x )

get tmr counter value

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
Return values
tmr counter value

Definition at line 257 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_counter_value_set()

void tmr_counter_value_set | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_cnt_value
 | ) |  |

set tmr counter value

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_cnt_value | (for 16 bit tmr 0x0000~0xFFFF, for 32 bit tmr 0x0000_0000~0xFFFF_FFFF)
Return values
none

Definition at line 244 of file at32f415_tmr.c.

◆ tmr_div_value_get()

uint32_t tmr_div_value_get ( tmr_type * tmr_x )

get tmr div value

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
Return values
tmr div value

Definition at line 284 of file at32f415_tmr.c.

◆ tmr_div_value_set()

void tmr_div_value_set | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_div_value
 | ) |  |

set tmr div value

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_div_value | (for 16 bit tmr 0x0000~0xFFFF, for 32 bit tmr 0x0000_0000~0xFFFF_FFFF)
Return values
none

Definition at line 271 of file at32f415_tmr.c.

Referenced by lick_frequency_get().

◆ tmr_dma_control_config()

void tmr_dma_control_config | ( | tmr_type * | tmr_x,
 |  | tmr_dma_transfer_length_type | dma_length,
 |  | tmr_dma_address_type | dma_base_address
 | ) |  |

config tmr dma control

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5
dma_length this parameter can be one of the following values:
  • TMR_DMA_TRANSFER_1BYTE
  • TMR_DMA_TRANSFER_2BYTES
  • TMR_DMA_TRANSFER_3BYTES ...
  • TMR_DMA_TRANSFER_17BYTES
  • TMR_DMA_TRANSFER_18BYTES
dma_base_address this parameter can be one of the following values:
  • TMR_CTRL1_ADDRESS
  • TMR_CTRL2_ADDRESS
  • TMR_STCTRL_ADDRESS
  • TMR_IDEN_ADDRESS
  • TMR_ISTS_ADDRESS
  • TMR_SWEVT_ADDRESS
  • TMR_CM1_ADDRESS
  • TMR_CM2_ADDRESS
  • TMR_CCTRL_ADDRESS
  • TMR_CVAL_ADDRESS
  • TMR_DIV_ADDRESS
  • TMR_PR_ADDRESS
  • TMR_RPR_ADDRESS
  • TMR_C1DT_ADDRESS
  • TMR_C2DT_ADDRESS
  • TMR_C3DT_ADDRESS
  • TMR_C4DT_ADDRESS
  • TMR_BRK_ADDRESS
  • TMR_DMACTRL_ADDRESS
Return values
none

Definition at line 1661 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_dma_request_enable()

void tmr_dma_request_enable | ( | tmr_type * | tmr_x,
 |  | tmr_dma_request_type | dma_request,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tmr dma request

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
dma_request this parameter can be one of the following values:
  • TMR_OVERFLOW_DMA_REQUEST
  • TMR_C1_DMA_REQUEST
  • TMR_C2_DMA_REQUEST
  • TMR_C3_DMA_REQUEST
  • TMR_C4_DMA_REQUEST
  • TMR_HALL_DMA_REQUEST
  • TMR_TRIGGER_DMA_REQUEST
new_state | (TRUE or FALSE)
Return values
none

Definition at line 1247 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_encoder_mode_config()

void tmr_encoder_mode_config | ( | tmr_type * | tmr_x,
 |  | tmr_encoder_mode_type | encoder_mode,
 |  | tmr_input_polarity_type | ic1_polarity,
 |  | tmr_input_polarity_type | ic2_polarity
 | ) |  |

config tmr encoder mode

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5
encoder_mode this parameter can be one of the following values:
  • TMR_ENCODER_MODE_A
  • TMR_ENCODER_MODE_B
  • TMR_ENCODER_MODE_C
ic1_polarity this parameter can be one of the following values:
  • TMR_INPUT_RISING_EDGE
  • TMR_INPUT_FALLING_EDGE
  • TMR_INPUT_BOTH_EDGE
ic2_polarity this parameter can be one of the following values:
  • TMR_INPUT_RISING_EDGE
  • TMR_INPUT_FALLING_EDGE
  • TMR_INPUT_BOTH_EDGE
Return values
none

Definition at line 1560 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_event_sw_trigger()

void tmr_event_sw_trigger | ( | tmr_type * | tmr_x,
 |  | tmr_event_trigger_type | tmr_event
 | ) |  |

generate tmr event

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_event this parameter can be one of the following values:
  • TMR_OVERFLOW_SWTRIG
  • TMR_C1_SWTRIG
  • TMR_C2_SWTRIG
  • TMR_C3_SWTRIG
  • TMR_C4_SWTRIG
  • TMR_HALL_SWTRIG
  • TMR_TRIGGER_SWTRIG
  • TMR_BRK_SWTRIG
Return values
none

Definition at line 1369 of file at32f415_tmr.c.

Referenced by lick_frequency_get(), and SysTick_Handler().

◆ tmr_external_clock_config()

void tmr_external_clock_config | ( | tmr_type * | tmr_x,
 |  | tmr_external_signal_divider_type | es_divide,
 |  | tmr_external_signal_polarity_type | es_polarity,
 |  | uint16_t | es_filter
 | ) |  |

config tmr external clock

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5
es_divide this parameter can be one of the following values:
  • TMR_ES_FREQUENCY_DIV_1
  • TMR_ES_FREQUENCY_DIV_2
  • TMR_ES_FREQUENCY_DIV_4
  • TMR_ES_FREQUENCY_DIV_8
es_polarity this parameter can be one of the following values:
  • TMR_ES_POLARITY_NON_INVERTED
  • TMR_ES_POLARITY_INVERTED
es_filter | (0x0~0xf)
Return values
none

Definition at line 1479 of file at32f415_tmr.c.

Referenced by tmr_external_clock_mode1_config(), and tmr_external_clock_mode2_config().

◆ tmr_external_clock_mode1_config()

void tmr_external_clock_mode1_config | ( | tmr_type * | tmr_x,
 |  | tmr_external_signal_divider_type | es_divide,
 |  | tmr_external_signal_polarity_type | es_polarity,
 |  | uint16_t | es_filter
 | ) |  |

config tmr external clock mode1

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
es_divide this parameter can be one of the following values:
  • TMR_ES_FREQUENCY_DIV_1
  • TMR_ES_FREQUENCY_DIV_2
  • TMR_ES_FREQUENCY_DIV_4
  • TMR_ES_FREQUENCY_DIV_8
es_polarity this parameter can be one of the following values:
  • TMR_ES_POLARITY_NON_INVERTED
  • TMR_ES_POLARITY_INVERTED
es_filter | (0x0~0xf)
Return values
none

Definition at line 1505 of file at32f415_tmr.c.

◆ tmr_external_clock_mode2_config()

void tmr_external_clock_mode2_config | ( | tmr_type * | tmr_x,
 |  | tmr_external_signal_divider_type | es_divide,
 |  | tmr_external_signal_polarity_type | es_polarity,
 |  | uint16_t | es_filter
 | ) |  |

config tmr external clock mode2

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5
es_divide this parameter can be one of the following values:
  • TMR_ES_FREQUENCY_DIV_1
  • TMR_ES_FREQUENCY_DIV_2
  • TMR_ES_FREQUENCY_DIV_4
  • TMR_ES_FREQUENCY_DIV_8
es_polarity this parameter can be one of the following values:
  • TMR_ES_POLARITY_NON_INVERTED
  • TMR_ES_POLARITY_INVERTED
es_filter | (0x0~0xf)
Return values
none

Definition at line 1531 of file at32f415_tmr.c.

◆ tmr_flag_clear()

void tmr_flag_clear | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_flag
 | ) |  |

clear tmr flag

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_flag this parameter can be any combination of the following values:
  • TMR_OVF_FLAG
  • TMR_C1_FLAG
  • TMR_C2_FLAG
  • TMR_C3_FLAG
  • TMR_C4_FLAG
  • TMR_HALL_FLAG
  • TMR_TRIGGER_FLAG
  • TMR_BRK_FLAG
  • TMR_C1_RECAPTURE_FLAG
  • TMR_C2_RECAPTURE_FLAG
  • TMR_C3_RECAPTURE_FLAG
  • TMR_C4_RECAPTURE_FLAG
Return values
none

Definition at line 1347 of file at32f415_tmr.c.

Referenced by TMR1_BRK_TMR9_IRQHandler(), TMR1_OVF_TMR10_IRQHandler(), TMR1_TRG_HALL_TMR11_IRQHandler(), TMR2_GLOBAL_IRQHandler(), TMR3_GLOBAL_IRQHandler(), and TMR5_GLOBAL_IRQHandler().

◆ tmr_flag_get()

flag_status tmr_flag_get | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_flag
 | ) |  |

get tmr flag

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_flag this parameter can be one of the following values:
  • TMR_OVF_FLAG
  • TMR_C1_FLAG
  • TMR_C2_FLAG
  • TMR_C3_FLAG
  • TMR_C4_FLAG
  • TMR_HALL_FLAG
  • TMR_TRIGGER_FLAG
  • TMR_BRK_FLAG
  • TMR_C1_RECAPTURE_FLAG
  • TMR_C2_RECAPTURE_FLAG
  • TMR_C3_RECAPTURE_FLAG
  • TMR_C4_RECAPTURE_FLAG
Return values
state of tmr flag

Definition at line 1310 of file at32f415_tmr.c.

Referenced by TMR1_BRK_TMR9_IRQHandler(), TMR1_OVF_TMR10_IRQHandler(), TMR2_GLOBAL_IRQHandler(), TMR3_GLOBAL_IRQHandler(), and TMR5_GLOBAL_IRQHandler().

◆ tmr_force_output_set()

void tmr_force_output_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | tmr_force_output_type | force_output
 | ) |  |

set tmr force output

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
force_output this parameter can be one of the following values:
  • TMR_FORCE_OUTPUT_HIGH
  • TMR_FORCE_OUTPUT_LOW
Return values
none

Definition at line 1595 of file at32f415_tmr.c.

◆ tmr_hall_select()

void tmr_hall_select | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

select tmr hall

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1
new_state | (TRUE or FALSE)
Return values
none

Definition at line 1177 of file at32f415_tmr.c.

◆ tmr_input_channel_divider_set()

void tmr_input_channel_divider_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | tmr_channel_input_divider_type | divider_factor
 | ) |  |

set tmr input channel divider

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
divider_factor this parameter can be one of the following values:
  • TMR_CHANNEL_INPUT_DIV_1
  • TMR_CHANNEL_INPUT_DIV_2
  • TMR_CHANNEL_INPUT_DIV_4
  • TMR_CHANNEL_INPUT_DIV_8
Return values
none

Definition at line 1079 of file at32f415_tmr.c.

Referenced by lick_frequency_get().

◆ tmr_input_channel_filter_set()

void tmr_input_channel_filter_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | uint16_t | filter_value
 | ) |  |

set tmr input channel filter

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
filter_value | (0x0~0xf)
Return values
none

Definition at line 902 of file at32f415_tmr.c.

◆ tmr_input_channel_init()

void tmr_input_channel_init | ( | tmr_type * | tmr_x,
 |  | tmr_input_config_type * | input_struct,
 |  | tmr_channel_input_divider_type | divider_factor
 | ) |  |

init tmr input channel

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
input_struct
  • to the structure of tmr_input_config_type
divider_factor this parameter can be one of the following values:
  • TMR_CHANNEL_INPUT_DIV_1
  • TMR_CHANNEL_INPUT_DIV_2
  • TMR_CHANNEL_INPUT_DIV_4
  • TMR_CHANNEL_INPUT_DIV_8
Return values
none

Definition at line 780 of file at32f415_tmr.c.

Referenced by lick_frequency_get(), main(), and tmr1_init().

◆ tmr_input_default_para_init()

void tmr_input_default_para_init ( tmr_input_config_type * tmr_input_struct )

init tmr input default para

Parameters
tmr_input_struct
  • to the structure of tmr_input_config_type
Return values
none

Definition at line 132 of file at32f415_tmr.c.

Referenced by main(), and tmr1_init().

◆ tmr_internal_clock_set()

void tmr_internal_clock_set ( tmr_type * tmr_x )

set tmr select internal clock

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
Return values
none

Definition at line 1394 of file at32f415_tmr.c.

◆ tmr_interrupt_enable()

void tmr_interrupt_enable | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_interrupt,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tmr interrupt

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_interrupt this parameter can be one of the following values:
  • TMR_OVF_INT
  • TMR_C1_INT
  • TMR_C2_INT
  • TMR_C3_INT
  • TMR_C4_INT
  • TMR_HALL_INT
  • TMR_TRIGGER_INT
  • TMR_BRK_INT
new_state | (TRUE or FALSE)
Return values
none

Definition at line 1277 of file at32f415_tmr.c.

Referenced by lick_frequency_get(), main(), tmr1_config(), tmr1_init(), tmr2_config(), and tmr_init().

◆ tmr_one_cycle_mode_enable()

void tmr_one_cycle_mode_enable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tmr one cycle mode

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
new_state | (TRUE or FALSE)
Return values
none

Definition at line 716 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_output_channel_buffer_enable()

void tmr_output_channel_buffer_enable | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | confirm_state | new_state
 | ) |  |

enable tmr output channel buffer

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
new_state | (TRUE or FALSE)
Return values
none

Definition at line 587 of file at32f415_tmr.c.

Referenced by main(), and mclk_tmr1_init().

◆ tmr_output_channel_config()

void tmr_output_channel_config | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | tmr_output_config_type * | tmr_output_struct
 | ) |  |

config tmr output channel

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
tmr_output_struct
  • to the structure of tmr_output_config_type
Return values
none

Definition at line 304 of file at32f415_tmr.c.

Referenced by main(), mclk_tmr1_init(), and tmr1_config().

◆ tmr_output_channel_immediately_set()

void tmr_output_channel_immediately_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | confirm_state | new_state
 | ) |  |

set tmr output channel immediately

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
new_state | (TRUE or FALSE)
Return values
none

Definition at line 632 of file at32f415_tmr.c.

◆ tmr_output_channel_mode_select()

void tmr_output_channel_mode_select | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | tmr_output_control_mode_type | oc_mode
 | ) |  |

select tmr output channel mode

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
oc_mode this parameter can be one of the following values:
  • TMR_OUTPUT_CONTROL_OFF
  • TMR_OUTPUT_CONTROL_HIGH
  • TMR_OUTPUT_CONTROL_LOW
  • TMR_OUTPUT_CONTROL_SWITCH
  • TMR_OUTPUT_CONTROL_FORCE_HIGH
  • TMR_OUTPUT_CONTROL_FORCE_LOW
  • TMR_OUTPUT_CONTROL_PWM_MODE_A
  • TMR_OUTPUT_CONTROL_PWM_MODE_B
Return values
none

Definition at line 409 of file at32f415_tmr.c.

Referenced by TMR1_TRG_HALL_TMR11_IRQHandler().

◆ tmr_output_channel_polarity_set()

void tmr_output_channel_polarity_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | tmr_polarity_active_type | oc_polarity
 | ) |  |

set tmr output channel polarity

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
  • TMR_SELECT_CHANNEL_1C
  • TMR_SELECT_CHANNEL_2C
  • TMR_SELECT_CHANNEL_3C
oc_polarity this parameter can be one of the following values:
  • TMR_POLARITY_ACTIVE_HIGH
  • TMR_POLARITY_ACTIVE_LOW
Return values
none

Definition at line 1419 of file at32f415_tmr.c.

◆ tmr_output_channel_switch_set()

void tmr_output_channel_switch_set | ( | tmr_type * | tmr_x,
 |  | tmr_channel_select_type | tmr_channel,
 |  | confirm_state | new_state
 | ) |  |

set tmr output channel switch

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_channel this parameter can be one of the following values:
  • TMR_SELECT_CHANNEL_1
  • TMR_SELECT_CHANNEL_2
  • TMR_SELECT_CHANNEL_3
  • TMR_SELECT_CHANNEL_4
new_state | (TRUE or FALSE)
Return values
none

Definition at line 677 of file at32f415_tmr.c.

◆ tmr_output_default_para_init()

void tmr_output_default_para_init ( tmr_output_config_type * tmr_output_struct )

init tmr output default para

Parameters
tmr_output_struct
  • to the structure of tmr_output_config_type
Return values
none

Definition at line 115 of file at32f415_tmr.c.

Referenced by main(), mclk_tmr1_init(), and tmr1_config().

◆ tmr_output_enable()

void tmr_output_enable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

tmr output enable(oen),this function is important for advtm output enable

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1
new_state | (TRUE or FALSE)
Return values
none

Definition at line 1382 of file at32f415_tmr.c.

Referenced by main(), and mclk_tmr1_init().

◆ tmr_overflow_event_disable()

void tmr_overflow_event_disable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable tmr overflow event generation

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
new_state | (TRUE or FALSE)
Return values
none

Definition at line 760 of file at32f415_tmr.c.

◆ tmr_overflow_request_source_set()

void tmr_overflow_request_source_set | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

select tmr the overflow event sources

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
new_state | (TRUE or FALSE)
Return values
none

Definition at line 747 of file at32f415_tmr.c.

◆ tmr_period_buffer_enable()

void tmr_period_buffer_enable | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

enable tmr period buffer

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
new_state | (TRUE or FALSE)
Return values
none

Definition at line 567 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_period_value_get()

uint32_t tmr_period_value_get ( tmr_type * tmr_x )

get tmr period value

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
Return values
timer period register value of counter (for 16 bit tmr 0x0000~0xFFFF, for 32 bit tmr 0x0000_0000~0xFFFF_FFFF)

Definition at line 463 of file at32f415_tmr.c.

◆ tmr_period_value_set()

void tmr_period_value_set | ( | tmr_type * | tmr_x,
 |  | uint32_t | tmr_pr_value
 | ) |  |

set tmr period value

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
tmr_pr_value | timer period register value of counter (for 16 bit tmr 0x0000~0xFFFF, for 32 bit tmr 0x0000_0000~0xFFFF_FFFF)
Return values
none

Definition at line 448 of file at32f415_tmr.c.

◆ tmr_primary_mode_select()

void tmr_primary_mode_select | ( | tmr_type * | tmr_x,
 |  | tmr_primary_select_type | primary_mode
 | ) |  |

select tmr primary mode

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5
primary_mode this parameter can be one of the following values:
  • TMR_PRIMARY_SEL_RESET
  • TMR_PRIMARY_SEL_ENABLE
  • TMR_PRIMARY_SEL_OVERFLOW
  • TMR_PRIMARY_SEL_COMPARE
  • TMR_PRIMARY_SEL_C1ORAW
  • TMR_PRIMARY_SEL_C2ORAW
  • TMR_PRIMARY_SEL_C3ORAW
  • TMR_PRIMARY_SEL_C4ORAW
Return values
none

Definition at line 1126 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_pwm_input_config()

void tmr_pwm_input_config | ( | tmr_type * | tmr_x,
 |  | tmr_input_config_type * | input_struct,
 |  | tmr_channel_input_divider_type | divider_factor
 | ) |  |

config tmr pwm input

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
input_struct
  • to the structure of tmr_input_config_type
divider_factor this parameter can be one of the following values:
  • TMR_CHANNEL_INPUT_DIV_1
  • TMR_CHANNEL_INPUT_DIV_2
  • TMR_CHANNEL_INPUT_DIV_4
  • TMR_CHANNEL_INPUT_DIV_8
Return values
none

Definition at line 947 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_repetition_counter_set()

void tmr_repetition_counter_set | ( | tmr_type * | tmr_x,
 |  | uint8_t | tmr_rpr_value
 | ) |  |

set the repetition counter register(rpr) value

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1
tmr_rpr_value | (0x00~0xFF)
Return values
none

Definition at line 225 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_reset()

void tmr_reset ( tmr_type * tmr_x )

tmr reset by crm reset register

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9, TMR10, TMR11
Return values
none

Definition at line 51 of file at32f415_tmr.c.

Referenced by lick_frequency_get().

◆ tmr_sub_mode_select()

void tmr_sub_mode_select | ( | tmr_type * | tmr_x,
 |  | tmr_sub_mode_select_type | sub_mode
 | ) |  |

select tmr subordinate mode

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
sub_mode this parameter can be one of the following values:
  • TMR_SUB_MODE_DIABLE
  • TMR_SUB_ENCODER_MODE_A
  • TMR_SUB_ENCODER_MODE_B
  • TMR_SUB_ENCODER_MODE_C
  • TMR_SUB_RESET_MODE
  • TMR_SUB_HANG_MODE
  • TMR_SUB_TRIGGER_MODE
  • TMR_SUB_EXTERNAL_CLOCK_MODE_A
Return values
none

Definition at line 1148 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_sub_sync_mode_set()

void tmr_sub_sync_mode_set | ( | tmr_type * | tmr_x,
 |  | confirm_state | new_state
 | ) |  |

set tmr subordinate synchronization mode

Parameters
tmr_x | select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
new_state | (TRUE or FALSE)
Return values
none

Definition at line 1225 of file at32f415_tmr.c.

Referenced by main().

◆ tmr_trigger_input_select()

void tmr_trigger_input_select | ( | tmr_type * | tmr_x,
 |  | sub_tmr_input_sel_type | trigger_select
 | ) |  |

select tmr sub-trigger

Parameters
tmr_x select the tmr peripheral. this parameter can be one of the following values: TMR1, TMR2, TMR3, TMR4, TMR5, TMR9
trigger_select this parameter can be one of the following values:
  • TMR_SUB_INPUT_SEL_IS0
  • TMR_SUB_INPUT_SEL_IS1
  • TMR_SUB_INPUT_SEL_IS2
  • TMR_SUB_INPUT_SEL_IS3
  • TMR_SUB_INPUT_SEL_C1INC
  • TMR_SUB_INPUT_SEL_C1DF1
  • TMR_SUB_INPUT_SEL_C2DF2
  • TMR_SUB_INPUT_SEL_EXTIN
Return values
none

Definition at line 1212 of file at32f415_tmr.c.

Referenced by main().


AT32F415 Firmwary Library: USART

Modules | Macros
USART
AT32F415_periph_driver

USART driver modules. More...

Modules

USART_flags_definition
usart flag

USART_interrupts_definition
usart interrupt
USART_exported_types
USART_exported_functions
USART_private_functions

Macros

#define | USART1 ((usart_type *) USART1_BASE)
#define | USART2 ((usart_type *) USART2_BASE)
#define | USART3 ((usart_type *) USART3_BASE)
#define | UART4 ((usart_type *) UART4_BASE)
#define | UART5 ((usart_type *) UART5_BASE)

Detailed Description

USART driver modules.

Macro Definition Documentation

◆ UART4

#define UART4 ((usart_type *) UART4_BASE)

Definition at line 322 of file at32f415_usart.h.

◆ UART5

#define UART5 ((usart_type *) UART5_BASE)

Definition at line 323 of file at32f415_usart.h.

◆ USART1

#define USART1 ((usart_type *) USART1_BASE)

Definition at line 319 of file at32f415_usart.h.

◆ USART2

#define USART2 ((usart_type *) USART2_BASE)

Definition at line 320 of file at32f415_usart.h.

◆ USART3

#define USART3 ((usart_type *) USART3_BASE)

Definition at line 321 of file at32f415_usart.h.


AT32F415 Firmwary Library: USART_flags_definition

Macros
USART_flags_definition
AT32F415_periph_driver » USART

usart flag
More...

Macros

#define | USART_PERR_FLAG ((uint32_t)0x00000001)
#define | USART_FERR_FLAG ((uint32_t)0x00000002)
#define | USART_NERR_FLAG ((uint32_t)0x00000004)
#define | USART_ROERR_FLAG ((uint32_t)0x00000008)
#define | USART_IDLEF_FLAG ((uint32_t)0x00000010)
#define | USART_RDBF_FLAG ((uint32_t)0x00000020)
#define | USART_TDC_FLAG ((uint32_t)0x00000040)
#define | USART_TDBE_FLAG ((uint32_t)0x00000080)
#define | USART_BFF_FLAG ((uint32_t)0x00000100)
#define | USART_CTSCF_FLAG ((uint32_t)0x00000200)

Detailed Description

usart flag

Macro Definition Documentation

◆ USART_BFF_FLAG

#define USART_BFF_FLAG ((uint32_t)0x00000100)

usart break frame flag

Definition at line 60 of file at32f415_usart.h.

◆ USART_CTSCF_FLAG

#define USART_CTSCF_FLAG ((uint32_t)0x00000200)

usart cts change flag

Definition at line 61 of file at32f415_usart.h.

◆ USART_FERR_FLAG

#define USART_FERR_FLAG ((uint32_t)0x00000002)

usart framing error flag

Definition at line 53 of file at32f415_usart.h.

◆ USART_IDLEF_FLAG

#define USART_IDLEF_FLAG ((uint32_t)0x00000010)

usart idle flag

Definition at line 56 of file at32f415_usart.h.

◆ USART_NERR_FLAG

#define USART_NERR_FLAG ((uint32_t)0x00000004)

usart noise error flag

Definition at line 54 of file at32f415_usart.h.

◆ USART_PERR_FLAG

#define USART_PERR_FLAG ((uint32_t)0x00000001)

usart parity error flag

Definition at line 52 of file at32f415_usart.h.

◆ USART_RDBF_FLAG

#define USART_RDBF_FLAG ((uint32_t)0x00000020)

usart receive data buffer full flag

Definition at line 57 of file at32f415_usart.h.

◆ USART_ROERR_FLAG

#define USART_ROERR_FLAG ((uint32_t)0x00000008)

usart receiver overflow error flag

Definition at line 55 of file at32f415_usart.h.

◆ USART_TDBE_FLAG

#define USART_TDBE_FLAG ((uint32_t)0x00000080)

usart transmit data buffer empty flag

Definition at line 59 of file at32f415_usart.h.

◆ USART_TDC_FLAG

#define USART_TDC_FLAG ((uint32_t)0x00000040)

usart transmit data complete flag

Definition at line 58 of file at32f415_usart.h.


AT32F415 Firmwary Library: USART_interrupts_definition

Macros
USART_interrupts_definition
AT32F415_periph_driver » USART

usart interrupt More...

Macros

#define | USART_IDLE_INT MAKE_VALUE(0x0C,0x04)
#define | USART_RDBF_INT MAKE_VALUE(0x0C,0x05)
#define | USART_TDC_INT MAKE_VALUE(0x0C,0x06)
#define | USART_TDBE_INT MAKE_VALUE(0x0C,0x07)
#define | USART_PERR_INT MAKE_VALUE(0x0C,0x08)
#define | USART_BF_INT MAKE_VALUE(0x10,0x06)
#define | USART_ERR_INT MAKE_VALUE(0x14,0x00)
#define | USART_CTSCF_INT MAKE_VALUE(0x14,0x0A)

Detailed Description

usart interrupt

Macro Definition Documentation

◆ USART_BF_INT

#define USART_BF_INT MAKE_VALUE(0x10,0x06)

usart break frame interrupt

Definition at line 77 of file at32f415_usart.h.

◆ USART_CTSCF_INT

#define USART_CTSCF_INT MAKE_VALUE(0x14,0x0A)

usart cts change interrupt

Definition at line 79 of file at32f415_usart.h.

◆ USART_ERR_INT

#define USART_ERR_INT MAKE_VALUE(0x14,0x00)

usart error interrupt

Definition at line 78 of file at32f415_usart.h.

◆ USART_IDLE_INT

#define USART_IDLE_INT MAKE_VALUE(0x0C,0x04)

usart idle interrupt

Definition at line 72 of file at32f415_usart.h.

◆ USART_PERR_INT

#define USART_PERR_INT MAKE_VALUE(0x0C,0x08)

usart parity error interrupt

Definition at line 76 of file at32f415_usart.h.

◆ USART_RDBF_INT

#define USART_RDBF_INT MAKE_VALUE(0x0C,0x05)

usart receive data buffer full interrupt

Definition at line 73 of file at32f415_usart.h.

◆ USART_TDBE_INT

#define USART_TDBE_INT MAKE_VALUE(0x0C,0x07)

usart transmit data buffer empty interrupt

Definition at line 75 of file at32f415_usart.h.

◆ USART_TDC_INT

#define USART_TDC_INT MAKE_VALUE(0x0C,0x06)

usart transmit data complete interrupt

Definition at line 74 of file at32f415_usart.h.


AT32F415 Firmwary Library: USART_exported_types

Data Structures | Enumerations
USART_exported_types
AT32F415_periph_driver » USART

Data Structures

struct usart_type
type define usart register all More...

Enumerations

enum | usart_parity_selection_type { USART_PARITY_NONE = 0x00 , USART_PARITY_EVEN = 0x01 , USART_PARITY_ODD = 0x02 }
usart parity selection type More...
enum | usart_wakeup_mode_type { USART_WAKEUP_BY_IDLE_FRAME = 0x00 , USART_WAKEUP_BY_MATCHING_ID = 0x01 }
usart wakeup mode type More...
enum | usart_data_bit_num_type { USART_DATA_8BITS = 0x00 , USART_DATA_9BITS = 0x01 }
usart data bit num type More...
enum | usart_break_bit_num_type { USART_BREAK_10BITS = 0x00 , USART_BREAK_11BITS = 0x01 }
usart break frame bit num type More...
enum | usart_clock_phase_type { USART_CLOCK_PHASE_1EDGE = 0x00 , USART_CLOCK_PHASE_2EDGE = 0x01 }
usart phase of the clock type More...
enum | usart_clock_polarity_type { USART_CLOCK_POLARITY_LOW = 0x00 , USART_CLOCK_POLARITY_HIGH = 0x01 }
usart polarity of the clock type More...
enum | usart_lbcp_type { USART_CLOCK_LAST_BIT_NONE = 0x00 , USART_CLOCK_LAST_BIT_OUTPUT = 0x01 }
usart last bit clock pulse type More...
enum | usart_stop_bit_num_type { USART_STOP_1_BIT = 0x00 , USART_STOP_0_5_BIT = 0x01 , USART_STOP_2_BIT = 0x02 , USART_STOP_1_5_BIT = 0x03 }
usart stop bit num type More...
enum | usart_hardware_flow_control_type { USART_HARDWARE_FLOW_NONE = 0x00 , USART_HARDWARE_FLOW_RTS = 0x01 , USART_HARDWARE_FLOW_CTS = 0x02 , USART_HARDWARE_FLOW_RTS_CTS = 0x03 }
usart hardware flow control type More...

Detailed Description

Enumeration Type Documentation

◆ usart_break_bit_num_type

enum usart_break_bit_num_type

usart break frame bit num type

Enumerator
USART_BREAK_10BITS | usart lin mode berak frame detection 10 bits
USART_BREAK_11BITS | usart lin mode berak frame detection 11 bits

Definition at line 120 of file at32f415_usart.h.

◆ usart_clock_phase_type

enum usart_clock_phase_type

usart phase of the clock type

Enumerator
USART_CLOCK_PHASE_1EDGE | usart data capture is done on the clock leading edge
USART_CLOCK_PHASE_2EDGE | usart data capture is done on the clock trailing edge

Definition at line 129 of file at32f415_usart.h.

◆ usart_clock_polarity_type

enum usart_clock_polarity_type

usart polarity of the clock type

Enumerator
USART_CLOCK_POLARITY_LOW | usart clock stay low level outside transmission window
USART_CLOCK_POLARITY_HIGH | usart clock stay high level outside transmission window

Definition at line 138 of file at32f415_usart.h.

◆ usart_data_bit_num_type

enum usart_data_bit_num_type

usart data bit num type

Enumerator
USART_DATA_8BITS | usart data size is 8 bits
USART_DATA_9BITS | usart data size is 9 bits

Definition at line 111 of file at32f415_usart.h.

◆ usart_hardware_flow_control_type

enum usart_hardware_flow_control_type

usart hardware flow control type

Enumerator
USART_HARDWARE_FLOW_NONE | usart without hardware flow
USART_HARDWARE_FLOW_RTS | usart hardware flow only rts
USART_HARDWARE_FLOW_CTS | usart hardware flow only cts
USART_HARDWARE_FLOW_RTS_CTS | usart hardware flow both rts and cts

Definition at line 167 of file at32f415_usart.h.

◆ usart_lbcp_type

enum usart_lbcp_type

usart last bit clock pulse type

Enumerator
USART_CLOCK_LAST_BIT_NONE | usart clock pulse of the last data bit is not outputted
USART_CLOCK_LAST_BIT_OUTPUT | usart clock pulse of the last data bit is outputted

Definition at line 147 of file at32f415_usart.h.

◆ usart_parity_selection_type

enum usart_parity_selection_type

usart parity selection type

Enumerator
USART_PARITY_NONE | usart no parity
USART_PARITY_EVEN | usart even parity
USART_PARITY_ODD | usart odd parity

Definition at line 92 of file at32f415_usart.h.

◆ usart_stop_bit_num_type

enum usart_stop_bit_num_type

usart stop bit num type

Enumerator
USART_STOP_1_BIT | usart stop bits num is 1
USART_STOP_0_5_BIT | usart stop bits num is 0.5
USART_STOP_2_BIT | usart stop bits num is 2
USART_STOP_1_5_BIT | usart stop bits num is 1.5

Definition at line 156 of file at32f415_usart.h.

◆ usart_wakeup_mode_type

enum usart_wakeup_mode_type

usart wakeup mode type

Enumerator
USART_WAKEUP_BY_IDLE_FRAME | usart wakeup by idle frame
USART_WAKEUP_BY_MATCHING_ID | usart wakeup by matching id

Definition at line 102 of file at32f415_usart.h.


AT32F415 Firmwary Library: usart_type Struct Reference

Data Fields
usart_type Struct Reference
AT32F415_periph_driver » USART » USART_exported_types

type define usart register all More...

#include <at32f415_usart.h>

Data Fields

union {
__IO uint32_t sts
struct {
__IO uint32_t perr: 1
__IO uint32_t ferr: 1
__IO uint32_t nerr: 1
__IO uint32_t roerr: 1
__IO uint32_t idlef: 1
__IO uint32_t rdbf: 1
__IO uint32_t tdc: 1
__IO uint32_t tdbe: 1
__IO uint32_t bff: 1
__IO uint32_t ctscf: 1
__IO uint32_t reserved1: 22
} sts_bit
};
usart sts register, offset:0x00 More...
union {
__IO uint32_t dt
struct {
__IO uint32_t dt: 9
__IO uint32_t reserved1: 23
} dt_bit
};
usart dt register, offset:0x04 More...
union {
__IO uint32_t baudr
struct {
__IO uint32_t div: 16
__IO uint32_t reserved1: 16
} baudr_bit
};
usart baudr register, offset:0x08 More...
union {
__IO uint32_t ctrl1
struct {
__IO uint32_t sbf: 1
__IO uint32_t rm: 1
__IO uint32_t ren: 1
__IO uint32_t ten: 1
__IO uint32_t idleien: 1
__IO uint32_t rdbfien: 1
__IO uint32_t tdcien: 1
__IO uint32_t tdbeien: 1
__IO uint32_t perrien: 1
__IO uint32_t psel: 1
__IO uint32_t pen: 1
__IO uint32_t wum: 1
__IO uint32_t dbn: 1
__IO uint32_t uen: 1
__IO uint32_t reserved1: 18
} ctrl1_bit
};
usart ctrl1 register, offset:0x0C More...
union {
__IO uint32_t ctrl2
struct {
__IO uint32_t id: 4
__IO uint32_t reserved1: 1
__IO uint32_t bfbn: 1
__IO uint32_t bfien: 1
__IO uint32_t reserved2: 1
__IO uint32_t lbcp: 1
__IO uint32_t clkpha: 1
__IO uint32_t clkpol: 1
__IO uint32_t clken: 1
__IO uint32_t stopbn: 2
__IO uint32_t linen: 1
__IO uint32_t reserved3: 17
} ctrl2_bit
};
usart ctrl2 register, offset:0x10 More...
union {
__IO uint32_t ctrl3
struct {
__IO uint32_t errien: 1
__IO uint32_t irdaen: 1
__IO uint32_t irdalp: 1
__IO uint32_t slben: 1
__IO uint32_t scnacken: 1
__IO uint32_t scmen: 1
__IO uint32_t dmaren: 1
__IO uint32_t dmaten: 1
__IO uint32_t rtsen: 1
__IO uint32_t ctsen: 1
__IO uint32_t ctscfien: 1
__IO uint32_t reserved1: 21
} ctrl3_bit
};
usart ctrl3 register, offset:0x14 More...
union {
__IO uint32_t gdiv
struct {
__IO uint32_t isdiv: 8
__IO uint32_t scgt: 8
__IO uint32_t reserved1: 16
} gdiv_bit
};
usart gdiv register, offset:0x18 More...

Detailed Description

type define usart register all

Definition at line 178 of file at32f415_usart.h.

Field Documentation

◆

union { ... } usart_type::@655

usart sts register, offset:0x00

◆

union { ... } usart_type::@657

usart dt register, offset:0x04

◆

union { ... } usart_type::@659

usart baudr register, offset:0x08

◆

union { ... } usart_type::@661

usart ctrl1 register, offset:0x0C

◆

union { ... } usart_type::@663

usart ctrl2 register, offset:0x10

◆

union { ... } usart_type::@665

usart ctrl3 register, offset:0x14

◆

union { ... } usart_type::@667

usart gdiv register, offset:0x18

◆ baudr

__IO uint32_t usart_type::baudr

Definition at line 220 of file at32f415_usart.h.

◆

struct { ... } usart_type::baudr_bit

Referenced by usart_init().

◆ bfbn

__IO uint32_t usart_type::bfbn

Definition at line 264 of file at32f415_usart.h.

Referenced by usart_break_bit_num_set().

◆ bff

__IO uint32_t usart_type::bff

Definition at line 196 of file at32f415_usart.h.

◆ bfien

__IO uint32_t usart_type::bfien

Definition at line 265 of file at32f415_usart.h.

◆ clken

__IO uint32_t usart_type::clken

Definition at line 270 of file at32f415_usart.h.

Referenced by usart_clock_enable().

◆ clkpha

__IO uint32_t usart_type::clkpha

Definition at line 268 of file at32f415_usart.h.

Referenced by usart_clock_config().

◆ clkpol

__IO uint32_t usart_type::clkpol

Definition at line 269 of file at32f415_usart.h.

Referenced by usart_clock_config().

◆ ctrl1

__IO uint32_t usart_type::ctrl1

Definition at line 233 of file at32f415_usart.h.

◆

struct { ... } usart_type::ctrl1_bit

Referenced by usart_break_send(), usart_enable(), usart_init(), usart_parity_selection_config(), usart_receiver_enable(), usart_receiver_mute_enable(), usart_transmitter_enable(), and usart_wakeup_mode_set().

◆ ctrl2

__IO uint32_t usart_type::ctrl2

Definition at line 259 of file at32f415_usart.h.

◆

struct { ... } usart_type::ctrl2_bit

Referenced by usart_break_bit_num_set(), usart_clock_config(), usart_clock_enable(), usart_init(), usart_lin_mode_enable(), and usart_wakeup_id_set().

◆ ctrl3

__IO uint32_t usart_type::ctrl3

Definition at line 282 of file at32f415_usart.h.

◆

struct { ... } usart_type::ctrl3_bit

Referenced by usart_dma_receiver_enable(), usart_dma_transmitter_enable(), usart_hardware_flow_control_set(), usart_irda_low_power_enable(), usart_irda_mode_enable(), usart_single_line_halfduplex_select(), usart_smartcard_mode_enable(), and usart_smartcard_nack_set().

◆ ctscf

__IO uint32_t usart_type::ctscf

Definition at line 197 of file at32f415_usart.h.

◆ ctscfien

__IO uint32_t usart_type::ctscfien

Definition at line 295 of file at32f415_usart.h.

◆ ctsen

__IO uint32_t usart_type::ctsen

Definition at line 294 of file at32f415_usart.h.

Referenced by usart_hardware_flow_control_set().

◆ dbn

__IO uint32_t usart_type::dbn

Definition at line 248 of file at32f415_usart.h.

Referenced by usart_init().

◆ div

__IO uint32_t usart_type::div

Definition at line 223 of file at32f415_usart.h.

Referenced by usart_init().

◆ dmaren

__IO uint32_t usart_type::dmaren

Definition at line 291 of file at32f415_usart.h.

Referenced by usart_dma_receiver_enable().

◆ dmaten

__IO uint32_t usart_type::dmaten

Definition at line 292 of file at32f415_usart.h.

Referenced by usart_dma_transmitter_enable().

◆ dt

__IO uint32_t usart_type::dt

Definition at line 207 of file at32f415_usart.h.

Referenced by usart_data_receive(), and usart_data_transmit().

◆

struct { ... } usart_type::dt_bit

◆ errien

__IO uint32_t usart_type::errien

Definition at line 285 of file at32f415_usart.h.

◆ ferr

__IO uint32_t usart_type::ferr

Definition at line 189 of file at32f415_usart.h.

◆ gdiv

__IO uint32_t usart_type::gdiv

Definition at line 305 of file at32f415_usart.h.

◆

struct { ... } usart_type::gdiv_bit

Referenced by usart_irda_smartcard_division_set(), and usart_smartcard_guard_time_set().

◆ id

__IO uint32_t usart_type::id

Definition at line 262 of file at32f415_usart.h.

Referenced by usart_wakeup_id_set().

◆ idlef

__IO uint32_t usart_type::idlef

Definition at line 192 of file at32f415_usart.h.

◆ idleien

__IO uint32_t usart_type::idleien

Definition at line 240 of file at32f415_usart.h.

◆ irdaen

__IO uint32_t usart_type::irdaen

Definition at line 286 of file at32f415_usart.h.

Referenced by usart_irda_mode_enable().

◆ irdalp

__IO uint32_t usart_type::irdalp

Definition at line 287 of file at32f415_usart.h.

Referenced by usart_irda_low_power_enable().

◆ isdiv

__IO uint32_t usart_type::isdiv

Definition at line 308 of file at32f415_usart.h.

Referenced by usart_irda_smartcard_division_set().

◆ lbcp

__IO uint32_t usart_type::lbcp

Definition at line 267 of file at32f415_usart.h.

Referenced by usart_clock_config().

◆ linen

__IO uint32_t usart_type::linen

Definition at line 272 of file at32f415_usart.h.

Referenced by usart_lin_mode_enable().

◆ nerr

__IO uint32_t usart_type::nerr

Definition at line 190 of file at32f415_usart.h.

◆ pen

__IO uint32_t usart_type::pen

Definition at line 246 of file at32f415_usart.h.

Referenced by usart_parity_selection_config().

◆ perr

__IO uint32_t usart_type::perr

Definition at line 188 of file at32f415_usart.h.

◆ perrien

__IO uint32_t usart_type::perrien

Definition at line 244 of file at32f415_usart.h.

◆ psel

__IO uint32_t usart_type::psel

Definition at line 245 of file at32f415_usart.h.

Referenced by usart_parity_selection_config().

◆ rdbf

__IO uint32_t usart_type::rdbf

Definition at line 193 of file at32f415_usart.h.

◆ rdbfien

__IO uint32_t usart_type::rdbfien

Definition at line 241 of file at32f415_usart.h.

◆ ren

__IO uint32_t usart_type::ren

Definition at line 238 of file at32f415_usart.h.

Referenced by usart_receiver_enable().

◆ reserved1

__IO uint32_t usart_type::reserved1

Definition at line 198 of file at32f415_usart.h.

◆ reserved2

__IO uint32_t usart_type::reserved2

Definition at line 266 of file at32f415_usart.h.

◆ reserved3

__IO uint32_t usart_type::reserved3

Definition at line 273 of file at32f415_usart.h.

◆ rm

__IO uint32_t usart_type::rm

Definition at line 237 of file at32f415_usart.h.

Referenced by usart_receiver_mute_enable().

◆ roerr

__IO uint32_t usart_type::roerr

Definition at line 191 of file at32f415_usart.h.

◆ rtsen

__IO uint32_t usart_type::rtsen

Definition at line 293 of file at32f415_usart.h.

Referenced by usart_hardware_flow_control_set().

◆ sbf

__IO uint32_t usart_type::sbf

Definition at line 236 of file at32f415_usart.h.

Referenced by usart_break_send().

◆ scgt

__IO uint32_t usart_type::scgt

Definition at line 309 of file at32f415_usart.h.

Referenced by usart_smartcard_guard_time_set().

◆ scmen

__IO uint32_t usart_type::scmen

Definition at line 290 of file at32f415_usart.h.

Referenced by usart_smartcard_mode_enable().

◆ scnacken

__IO uint32_t usart_type::scnacken

Definition at line 289 of file at32f415_usart.h.

Referenced by usart_smartcard_nack_set().

◆ slben

__IO uint32_t usart_type::slben

Definition at line 288 of file at32f415_usart.h.

Referenced by usart_single_line_halfduplex_select().

◆ stopbn

__IO uint32_t usart_type::stopbn

Definition at line 271 of file at32f415_usart.h.

Referenced by usart_init().

◆ sts

__IO uint32_t usart_type::sts

Definition at line 185 of file at32f415_usart.h.

Referenced by usart_flag_clear(), and usart_flag_get().

◆

struct { ... } usart_type::sts_bit

◆ tdbe

__IO uint32_t usart_type::tdbe

Definition at line 195 of file at32f415_usart.h.

◆ tdbeien

__IO uint32_t usart_type::tdbeien

Definition at line 243 of file at32f415_usart.h.

◆ tdc

__IO uint32_t usart_type::tdc

Definition at line 194 of file at32f415_usart.h.

◆ tdcien

__IO uint32_t usart_type::tdcien

Definition at line 242 of file at32f415_usart.h.

◆ ten

__IO uint32_t usart_type::ten

Definition at line 239 of file at32f415_usart.h.

Referenced by usart_transmitter_enable().

◆ uen

__IO uint32_t usart_type::uen

Definition at line 249 of file at32f415_usart.h.

Referenced by usart_enable().

◆ wum

__IO uint32_t usart_type::wum

Definition at line 247 of file at32f415_usart.h.

Referenced by usart_wakeup_mode_set().

The documentation for this struct was generated from the following file:
  • at32f415_usart.h


AT32F415 Firmwary Library: USART_exported_functions

Functions
USART_exported_functions
AT32F415_periph_driver » USART

Functions

void | usart_reset (usart_type *usart_x)
deinitialize the usart peripheral registers to their default reset values. More...
void | usart_init (usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters. More...
void | usart_parity_selection_config (usart_type *usart_x, usart_parity_selection_type parity)
usart parity selection config. More...
void | usart_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral. More...
void | usart_transmitter_enable (usart_type *usart_x, confirm_state new_state)
usart transmitter enable. More...
void | usart_receiver_enable (usart_type *usart_x, confirm_state new_state)
usart receiver enable. More...
void | usart_clock_config (usart_type *usart_x, usart_clock_polarity_type clk_pol, usart_clock_phase_type clk_pha, usart_lbcp_type clk_lb)
usart clock config. More...
void | usart_clock_enable (usart_type *usart_x, confirm_state new_state)
usart enable the ck pin. More...
void | usart_interrupt_enable (usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts. More...
void | usart_dma_transmitter_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma transmitter interface. More...
void | usart_dma_receiver_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma receiver interface. More...
void | usart_wakeup_id_set (usart_type *usart_x, uint8_t usart_id)
set the wakeup id of the usart. More...
void | usart_wakeup_mode_set (usart_type *usart_x, usart_wakeup_mode_type wakeup_mode)
select the usart wakeup method in multi-processor communication. More...
void | usart_receiver_mute_enable (usart_type *usart_x, confirm_state new_state)
config the usart in mute mode in multi-processor communication. More...
void | usart_break_bit_num_set (usart_type *usart_x, usart_break_bit_num_type break_bit)
set the usart break frame bit num. More...
void | usart_lin_mode_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart lin mode. More...
void | usart_data_transmit (usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral. More...
uint16_t | usart_data_receive (usart_type *usart_x)
return the most recent received data by the usart peripheral. More...
void | usart_break_send (usart_type *usart_x)
transmit break characters. More...
void | usart_smartcard_guard_time_set (usart_type *usart_x, uint8_t guard_time_val)
config the specified usart smartcard guard time. More...
void | usart_irda_smartcard_division_set (usart_type *usart_x, uint8_t div_val)
config the irda/smartcard division. More...
void | usart_smartcard_mode_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart smart card mode. More...
void | usart_smartcard_nack_set (usart_type *usart_x, confirm_state new_state)
enable or disable nack transmission in smartcard mode. More...
void | usart_single_line_halfduplex_select (usart_type *usart_x, confirm_state new_state)
enable or disable the usart single line bidirectional half-duplex communication. More...
void | usart_irda_mode_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart's irda interface. More...
void | usart_irda_low_power_enable (usart_type *usart_x, confirm_state new_state)
configure the usart's irda low power. More...
void | usart_hardware_flow_control_set (usart_type *usart_x, usart_hardware_flow_control_type flow_state)
configure the usart's hardware flow control. More...
flag_status | usart_flag_get (usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not. More...
void | usart_flag_clear (usart_type *usart_x, uint32_t flag)
clear the usart's pending flags. More...

Detailed Description

Function Documentation

◆ usart_break_bit_num_set()

void usart_break_bit_num_set | ( | usart_type * | usart_x,
 |  | usart_break_bit_num_type | break_bit
 | ) |  |

set the usart break frame bit num.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
break_bit specifies the break bit num. this parameter can be one of the following values:
  • USART_BREAK_10BITS
  • USART_BREAK_11BITS
Return values
none

Definition at line 347 of file at32f415_usart.c.

◆ usart_break_send()

void usart_break_send ( usart_type * usart_x )

transmit break characters.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
Return values
none

Definition at line 398 of file at32f415_usart.c.

◆ usart_clock_config()

void usart_clock_config | ( | usart_type * | usart_x,
 |  | usart_clock_polarity_type | clk_pol,
 |  | usart_clock_phase_type | clk_pha,
 |  | usart_lbcp_type | clk_lb
 | ) |  |

usart clock config.

Note
clock config are not available for UART4 or UART5.
Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2 or USART3.
clk_pol polarity of the clock output on the ck pin. this parameter can be one of the following values:
  • USART_CLOCK_POLARITY_LOW
  • USART_CLOCK_POLARITY_HIGH
clk_pha phase of the clock output on the ck pin. this parameter can be one of the following values:
  • USART_CLOCK_PHASE_1EDGE
  • USART_CLOCK_PHASE_2EDGE
clk_lb whether the clock pulse of the last data bit transmitted (MSB) is outputted on the ck pin. this parameter can be one of the following values:
  • USART_CLOCK_LAST_BIT_NONE
  • USART_CLOCK_LAST_BIT_OUTPUT
Return values
none

Definition at line 217 of file at32f415_usart.c.

Referenced by usart_configuration(), and usart_spi_configuration().

◆ usart_clock_enable()

void usart_clock_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

usart enable the ck pin.

Note
clock enable are not available for UART4 or UART5.
Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2 or USART3.
new_state | TRUE or FALSE
Return values
none

Definition at line 233 of file at32f415_usart.c.

Referenced by usart_configuration(), and usart_spi_configuration().

◆ usart_data_receive()

uint16_t usart_data_receive ( usart_type * usart_x )

return the most recent received data by the usart peripheral.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
Return values
the received data.

Definition at line 386 of file at32f415_usart.c.

Referenced by main(), SC_USART_IRQHandler(), USART1_IRQHandler(), USART2_IRQHandler(), and USART3_IRQHandler().

◆ usart_data_transmit()

void usart_data_transmit | ( | usart_type * | usart_x,
 |  | uint16_t | data
 | ) |  |

transmit single data through the usart peripheral.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
data | the data to transmit.
Return values
none

Definition at line 374 of file at32f415_usart.c.

Referenced by back_err(), back_ok(), fputc(), main(), USART2_IRQHandler(), and USART3_IRQHandler().

◆ usart_dma_receiver_enable()

void usart_dma_receiver_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the usart's dma receiver interface.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | new state of the dma request sources. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 288 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_dma_transmitter_enable()

void usart_dma_transmitter_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the usart's dma transmitter interface.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | new state of the dma request sources. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 274 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_enable()

void usart_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the specified usart peripheral.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | new state of the usart peripheral. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 166 of file at32f415_usart.c.

Referenced by uart_init(), uart_print_init(), usart1_config(), usart_configuration(), and usart_spi_configuration().

◆ usart_flag_clear()

void usart_flag_clear | ( | usart_type * | usart_x,
 |  | uint32_t | flag
 | ) |  |

clear the usart's pending flags.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
flag specifies the flag to clear. this parameter can be any combination of the following values:
  • USART_CTSCF_FLAG: (not available for UART4 or UART5).
  • USART_BFF_FLAG:
  • USART_TDC_FLAG:
  • USART_RDBF_FLAG:
Note
  • USART_PERR_FLAG, USART_FERR_FLAG, USART_NERR_FLAG, USART_ROERR_FLAG and USART_IDLEF_FLAG are cleared by software sequence: a read operation to usart sts register (usart_flag_get()) followed by a read operation to usart dt register (usart_data_receive()).
  • USART_RDBF_FLAG can be also cleared by a read to the usart dt register(usart_data_receive()).
  • USART_TDC_FLAG can be also cleared by software sequence: a read operation to usart sts register (usart_flag_get()) followed by a write operation to usart dt register (usart_data_transmit()).
  • USART_TDBE_FLAG is cleared only by a write to the usart dt register(usart_data_transmit()).
Return values
none

Definition at line 592 of file at32f415_usart.c.

◆ usart_flag_get()

flag_status usart_flag_get | ( | usart_type * | usart_x,
 |  | uint32_t | flag
 | ) |  |

check whether the specified usart flag is set or not.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
flag specifies the flag to check. this parameter can be one of the following values:
  • USART_CTSCF_FLAG: cts change flag (not available for UART4, UART5)
  • USART_BFF_FLAG: break frame flag
  • USART_TDBE_FLAG: transmit data buffer empty flag
  • USART_TDC_FLAG: transmit data complete flag
  • USART_RDBF_FLAG: receive data buffer full flag
  • USART_IDLEF_FLAG: idle flag
  • USART_ROERR_FLAG: receiver overflow error flag
  • USART_NERR_FLAG: noise error flag
  • USART_FERR_FLAG: framing error flag
  • USART_PERR_FLAG: parity error flag
Return values
the new state of usart_flag (SET or RESET).

Definition at line 559 of file at32f415_usart.c.

Referenced by back_err(), back_ok(), fputc(), main(), SC_USART_IRQHandler(), USART1_IRQHandler(), USART2_IRQHandler(), and USART3_IRQHandler().

◆ usart_hardware_flow_control_set()

void usart_hardware_flow_control_set | ( | usart_type * | usart_x,
 |  | usart_hardware_flow_control_type | flow_state
 | ) |  |

configure the usart's hardware flow control.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3
flow_state specifies the hardware flow control. this parameter can be one of the following values:
  • USART_HARDWARE_FLOW_NONE
  • USART_HARDWARE_FLOW_RTS,
  • USART_HARDWARE_FLOW_CTS,
  • USART_HARDWARE_FLOW_RTS_CTS
Return values
none

Definition at line 516 of file at32f415_usart.c.

Referenced by usart1_config(), and usart_configuration().

◆ usart_init()

void usart_init | ( | usart_type * | usart_x,
 |  | uint32_t | baud_rate,
 |  | usart_data_bit_num_type | data_bit,
 |  | usart_stop_bit_num_type | stop_bit
 | ) |  |

initialize the usart peripheral according to the specified parameters.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
baud_rate | configure the usart communication baud rate.
data_bit data bits transmitted or received in a frame
this parameter can be one of the following values:
  • USART_DATA_8BITS
  • USART_DATA_9BITS.
stop_bit stop bits transmitted this parameter can be one of the following values:
  • USART_STOP_1_BIT
  • USART_STOP_0_5_BIT.
  • USART_STOP_2_BIT
  • USART_STOP_1_5_BIT.
Return values
none

Definition at line 99 of file at32f415_usart.c.

Referenced by uart_init(), uart_print_init(), usart1_config(), usart_configuration(), and usart_spi_configuration().

◆ usart_interrupt_enable()

void usart_interrupt_enable | ( | usart_type * | usart_x,
 |  | uint32_t | usart_int,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the specified usart interrupts.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
usart_int specifies the USART interrupt sources to be enabled or disabled. this parameter can be one of the following values:
  • USART_IDLE_INT: idle interrupt
  • USART_RDBF_INT: rdbf interrupt
  • USART_TDC_INT: tdc interrupt
  • USART_TDBE_INT: tdbe interrupt
  • USART_PERR_INT: perr interrupt
  • USART_BF_INT: break frame interrupt
  • USART_ERR_INT: err interrupt
  • USART_CTSCF_INT: ctscf interrupt
new_state | new state of the specified usart interrupts. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 257 of file at32f415_usart.c.

Referenced by data_take(), SC_USART_IRQHandler(), uart_init(), usart1_config(), USART2_IRQHandler(), USART3_IRQHandler(), and usart_configuration().

◆ usart_irda_low_power_enable()

void usart_irda_low_power_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

configure the usart's irda low power.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
new_state | new state of the irda mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 498 of file at32f415_usart.c.

◆ usart_irda_mode_enable()

void usart_irda_mode_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the usart's irda interface.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
new_state | new state of the irda mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 484 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_irda_smartcard_division_set()

void usart_irda_smartcard_division_set | ( | usart_type * | usart_x,
 |  | uint8_t | div_val
 | ) |  |

config the irda/smartcard division.

Note
the division are not available for UART4 or UART5.
Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2 or USART3.
div_val | specifies the division.
Return values
none

Definition at line 426 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_lin_mode_enable()

void usart_lin_mode_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the usart lin mode.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | new state of the usart lin mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 361 of file at32f415_usart.c.

◆ usart_parity_selection_config()

void usart_parity_selection_config | ( | usart_type * | usart_x,
 |  | usart_parity_selection_type | parity
 | ) |  |

usart parity selection config.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
parity select the none, odd or even parity. this parameter can be one of the following values:
  • USART_PARITY_NONE
  • USART_PARITY_EVEN.
  • USART_PARITY_ODD
Return values
none

Definition at line 138 of file at32f415_usart.c.

Referenced by usart1_config(), and usart_configuration().

◆ usart_receiver_enable()

void usart_receiver_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

usart receiver enable.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | TRUE or FALSE.
Return values
none

Definition at line 192 of file at32f415_usart.c.

Referenced by uart_init(), usart1_config(), usart_configuration(), and usart_spi_configuration().

◆ usart_receiver_mute_enable()

void usart_receiver_mute_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

config the usart in mute mode in multi-processor communication.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | new state of the usart mute mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 331 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_reset()

void usart_reset ( usart_type * usart_x )

deinitialize the usart peripheral registers to their default reset values.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
Return values
none

Definition at line 52 of file at32f415_usart.c.

◆ usart_single_line_halfduplex_select()

void usart_single_line_halfduplex_select | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the usart single line bidirectional half-duplex communication.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
new_state | new state of the single line half-duplex select. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 470 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_smartcard_guard_time_set()

void usart_smartcard_guard_time_set | ( | usart_type * | usart_x,
 |  | uint8_t | guard_time_val
 | ) |  |

config the specified usart smartcard guard time.

Note
The guard time bits are not available for UART4 or UART5.
Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2 or USART3.
guard_time_val | specifies the guard time (0x00~0xFF).
Return values
none

Definition at line 412 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_smartcard_mode_enable()

void usart_smartcard_mode_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the usart smart card mode.

Note
the smart card mode are not available for UART4 or UART5.
Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2 or USART3.
new_state | new state of the smart card mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 441 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_smartcard_nack_set()

void usart_smartcard_nack_set | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable nack transmission in smartcard mode.

Note
the smart card nack are not available for UART4 or UART5.
Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2 or USART3.
new_state | new state of the nack transmission. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 456 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_transmitter_enable()

void usart_transmitter_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

usart transmitter enable.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | TRUE or FALSE.
Return values
none

Definition at line 179 of file at32f415_usart.c.

Referenced by uart_init(), uart_print_init(), usart1_config(), usart_configuration(), and usart_spi_configuration().

◆ usart_wakeup_id_set()

void usart_wakeup_id_set | ( | usart_type * | usart_x,
 |  | uint8_t | usart_id
 | ) |  |

set the wakeup id of the usart.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
usart_id | the matching id(0x0~0xF).
Return values
none

Definition at line 301 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_wakeup_mode_set()

void usart_wakeup_mode_set | ( | usart_type * | usart_x,
 |  | usart_wakeup_mode_type | wakeup_mode
 | ) |  |

select the usart wakeup method in multi-processor communication.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
wakeup_mode determines the way to wake up usart method. this parameter can be one of the following values:
  • USART_WAKEUP_BY_IDLE_FRAME
  • USART_WAKEUP_BY_MATCHING_ID
Return values
none

Definition at line 317 of file at32f415_usart.c.

Referenced by usart_configuration().


AT32F415 Firmwary Library: USART_private_functions

Functions
USART_private_functions
AT32F415_periph_driver » USART

Functions

void | usart_reset (usart_type *usart_x)
deinitialize the usart peripheral registers to their default reset values. More...
void | usart_init (usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters. More...
void | usart_parity_selection_config (usart_type *usart_x, usart_parity_selection_type parity)
usart parity selection config. More...
void | usart_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral. More...
void | usart_transmitter_enable (usart_type *usart_x, confirm_state new_state)
usart transmitter enable. More...
void | usart_receiver_enable (usart_type *usart_x, confirm_state new_state)
usart receiver enable. More...
void | usart_clock_config (usart_type *usart_x, usart_clock_polarity_type clk_pol, usart_clock_phase_type clk_pha, usart_lbcp_type clk_lb)
usart clock config. More...
void | usart_clock_enable (usart_type *usart_x, confirm_state new_state)
usart enable the ck pin. More...
void | usart_interrupt_enable (usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts. More...
void | usart_dma_transmitter_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma transmitter interface. More...
void | usart_dma_receiver_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma receiver interface. More...
void | usart_wakeup_id_set (usart_type *usart_x, uint8_t usart_id)
set the wakeup id of the usart. More...
void | usart_wakeup_mode_set (usart_type *usart_x, usart_wakeup_mode_type wakeup_mode)
select the usart wakeup method in multi-processor communication. More...
void | usart_receiver_mute_enable (usart_type *usart_x, confirm_state new_state)
config the usart in mute mode in multi-processor communication. More...
void | usart_break_bit_num_set (usart_type *usart_x, usart_break_bit_num_type break_bit)
set the usart break frame bit num. More...
void | usart_lin_mode_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart lin mode. More...
void | usart_data_transmit (usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral. More...
uint16_t | usart_data_receive (usart_type *usart_x)
return the most recent received data by the usart peripheral. More...
void | usart_break_send (usart_type *usart_x)
transmit break characters. More...
void | usart_smartcard_guard_time_set (usart_type *usart_x, uint8_t guard_time_val)
config the specified usart smartcard guard time. More...
void | usart_irda_smartcard_division_set (usart_type *usart_x, uint8_t div_val)
config the irda/smartcard division. More...
void | usart_smartcard_mode_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart smart card mode. More...
void | usart_smartcard_nack_set (usart_type *usart_x, confirm_state new_state)
enable or disable nack transmission in smartcard mode. More...
void | usart_single_line_halfduplex_select (usart_type *usart_x, confirm_state new_state)
enable or disable the usart single line bidirectional half-duplex communication. More...
void | usart_irda_mode_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart's irda interface. More...
void | usart_irda_low_power_enable (usart_type *usart_x, confirm_state new_state)
configure the usart's irda low power. More...
void | usart_hardware_flow_control_set (usart_type *usart_x, usart_hardware_flow_control_type flow_state)
configure the usart's hardware flow control. More...
flag_status | usart_flag_get (usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not. More...
void | usart_flag_clear (usart_type *usart_x, uint32_t flag)
clear the usart's pending flags. More...

Detailed Description

Function Documentation

◆ usart_break_bit_num_set()

void usart_break_bit_num_set | ( | usart_type * | usart_x,
 |  | usart_break_bit_num_type | break_bit
 | ) |  |

set the usart break frame bit num.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
break_bit specifies the break bit num. this parameter can be one of the following values:
  • USART_BREAK_10BITS
  • USART_BREAK_11BITS
Return values
none

Definition at line 347 of file at32f415_usart.c.

◆ usart_break_send()

void usart_break_send ( usart_type * usart_x )

transmit break characters.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
Return values
none

Definition at line 398 of file at32f415_usart.c.

◆ usart_clock_config()

void usart_clock_config | ( | usart_type * | usart_x,
 |  | usart_clock_polarity_type | clk_pol,
 |  | usart_clock_phase_type | clk_pha,
 |  | usart_lbcp_type | clk_lb
 | ) |  |

usart clock config.

Note
clock config are not available for UART4 or UART5.
Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2 or USART3.
clk_pol polarity of the clock output on the ck pin. this parameter can be one of the following values:
  • USART_CLOCK_POLARITY_LOW
  • USART_CLOCK_POLARITY_HIGH
clk_pha phase of the clock output on the ck pin. this parameter can be one of the following values:
  • USART_CLOCK_PHASE_1EDGE
  • USART_CLOCK_PHASE_2EDGE
clk_lb whether the clock pulse of the last data bit transmitted (MSB) is outputted on the ck pin. this parameter can be one of the following values:
  • USART_CLOCK_LAST_BIT_NONE
  • USART_CLOCK_LAST_BIT_OUTPUT
Return values
none

Definition at line 217 of file at32f415_usart.c.

Referenced by usart_configuration(), and usart_spi_configuration().

◆ usart_clock_enable()

void usart_clock_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

usart enable the ck pin.

Note
clock enable are not available for UART4 or UART5.
Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2 or USART3.
new_state | TRUE or FALSE
Return values
none

Definition at line 233 of file at32f415_usart.c.

Referenced by usart_configuration(), and usart_spi_configuration().

◆ usart_data_receive()

uint16_t usart_data_receive ( usart_type * usart_x )

return the most recent received data by the usart peripheral.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
Return values
the received data.

Definition at line 386 of file at32f415_usart.c.

Referenced by main(), SC_USART_IRQHandler(), USART1_IRQHandler(), USART2_IRQHandler(), and USART3_IRQHandler().

◆ usart_data_transmit()

void usart_data_transmit | ( | usart_type * | usart_x,
 |  | uint16_t | data
 | ) |  |

transmit single data through the usart peripheral.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
data | the data to transmit.
Return values
none

Definition at line 374 of file at32f415_usart.c.

Referenced by back_err(), back_ok(), fputc(), main(), USART2_IRQHandler(), and USART3_IRQHandler().

◆ usart_dma_receiver_enable()

void usart_dma_receiver_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the usart's dma receiver interface.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | new state of the dma request sources. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 288 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_dma_transmitter_enable()

void usart_dma_transmitter_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the usart's dma transmitter interface.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | new state of the dma request sources. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 274 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_enable()

void usart_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the specified usart peripheral.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | new state of the usart peripheral. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 166 of file at32f415_usart.c.

Referenced by uart_init(), uart_print_init(), usart1_config(), usart_configuration(), and usart_spi_configuration().

◆ usart_flag_clear()

void usart_flag_clear | ( | usart_type * | usart_x,
 |  | uint32_t | flag
 | ) |  |

clear the usart's pending flags.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
flag specifies the flag to clear. this parameter can be any combination of the following values:
  • USART_CTSCF_FLAG: (not available for UART4 or UART5).
  • USART_BFF_FLAG:
  • USART_TDC_FLAG:
  • USART_RDBF_FLAG:
Note
  • USART_PERR_FLAG, USART_FERR_FLAG, USART_NERR_FLAG, USART_ROERR_FLAG and USART_IDLEF_FLAG are cleared by software sequence: a read operation to usart sts register (usart_flag_get()) followed by a read operation to usart dt register (usart_data_receive()).
  • USART_RDBF_FLAG can be also cleared by a read to the usart dt register(usart_data_receive()).
  • USART_TDC_FLAG can be also cleared by software sequence: a read operation to usart sts register (usart_flag_get()) followed by a write operation to usart dt register (usart_data_transmit()).
  • USART_TDBE_FLAG is cleared only by a write to the usart dt register(usart_data_transmit()).
Return values
none

Definition at line 592 of file at32f415_usart.c.

◆ usart_flag_get()

flag_status usart_flag_get | ( | usart_type * | usart_x,
 |  | uint32_t | flag
 | ) |  |

check whether the specified usart flag is set or not.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
flag specifies the flag to check. this parameter can be one of the following values:
  • USART_CTSCF_FLAG: cts change flag (not available for UART4, UART5)
  • USART_BFF_FLAG: break frame flag
  • USART_TDBE_FLAG: transmit data buffer empty flag
  • USART_TDC_FLAG: transmit data complete flag
  • USART_RDBF_FLAG: receive data buffer full flag
  • USART_IDLEF_FLAG: idle flag
  • USART_ROERR_FLAG: receiver overflow error flag
  • USART_NERR_FLAG: noise error flag
  • USART_FERR_FLAG: framing error flag
  • USART_PERR_FLAG: parity error flag
Return values
the new state of usart_flag (SET or RESET).

Definition at line 559 of file at32f415_usart.c.

Referenced by back_err(), back_ok(), fputc(), main(), SC_USART_IRQHandler(), USART1_IRQHandler(), USART2_IRQHandler(), and USART3_IRQHandler().

◆ usart_hardware_flow_control_set()

void usart_hardware_flow_control_set | ( | usart_type * | usart_x,
 |  | usart_hardware_flow_control_type | flow_state
 | ) |  |

configure the usart's hardware flow control.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3
flow_state specifies the hardware flow control. this parameter can be one of the following values:
  • USART_HARDWARE_FLOW_NONE
  • USART_HARDWARE_FLOW_RTS,
  • USART_HARDWARE_FLOW_CTS,
  • USART_HARDWARE_FLOW_RTS_CTS
Return values
none

Definition at line 516 of file at32f415_usart.c.

Referenced by usart1_config(), and usart_configuration().

◆ usart_init()

void usart_init | ( | usart_type * | usart_x,
 |  | uint32_t | baud_rate,
 |  | usart_data_bit_num_type | data_bit,
 |  | usart_stop_bit_num_type | stop_bit
 | ) |  |

initialize the usart peripheral according to the specified parameters.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
baud_rate | configure the usart communication baud rate.
data_bit data bits transmitted or received in a frame
this parameter can be one of the following values:
  • USART_DATA_8BITS
  • USART_DATA_9BITS.
stop_bit stop bits transmitted this parameter can be one of the following values:
  • USART_STOP_1_BIT
  • USART_STOP_0_5_BIT.
  • USART_STOP_2_BIT
  • USART_STOP_1_5_BIT.
Return values
none

Definition at line 99 of file at32f415_usart.c.

Referenced by uart_init(), uart_print_init(), usart1_config(), usart_configuration(), and usart_spi_configuration().

◆ usart_interrupt_enable()

void usart_interrupt_enable | ( | usart_type * | usart_x,
 |  | uint32_t | usart_int,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the specified usart interrupts.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
usart_int specifies the USART interrupt sources to be enabled or disabled. this parameter can be one of the following values:
  • USART_IDLE_INT: idle interrupt
  • USART_RDBF_INT: rdbf interrupt
  • USART_TDC_INT: tdc interrupt
  • USART_TDBE_INT: tdbe interrupt
  • USART_PERR_INT: perr interrupt
  • USART_BF_INT: break frame interrupt
  • USART_ERR_INT: err interrupt
  • USART_CTSCF_INT: ctscf interrupt
new_state | new state of the specified usart interrupts. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 257 of file at32f415_usart.c.

Referenced by data_take(), SC_USART_IRQHandler(), uart_init(), usart1_config(), USART2_IRQHandler(), USART3_IRQHandler(), and usart_configuration().

◆ usart_irda_low_power_enable()

void usart_irda_low_power_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

configure the usart's irda low power.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
new_state | new state of the irda mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 498 of file at32f415_usart.c.

◆ usart_irda_mode_enable()

void usart_irda_mode_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the usart's irda interface.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
new_state | new state of the irda mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 484 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_irda_smartcard_division_set()

void usart_irda_smartcard_division_set | ( | usart_type * | usart_x,
 |  | uint8_t | div_val
 | ) |  |

config the irda/smartcard division.

Note
the division are not available for UART4 or UART5.
Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2 or USART3.
div_val | specifies the division.
Return values
none

Definition at line 426 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_lin_mode_enable()

void usart_lin_mode_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the usart lin mode.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | new state of the usart lin mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 361 of file at32f415_usart.c.

◆ usart_parity_selection_config()

void usart_parity_selection_config | ( | usart_type * | usart_x,
 |  | usart_parity_selection_type | parity
 | ) |  |

usart parity selection config.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
parity select the none, odd or even parity. this parameter can be one of the following values:
  • USART_PARITY_NONE
  • USART_PARITY_EVEN.
  • USART_PARITY_ODD
Return values
none

Definition at line 138 of file at32f415_usart.c.

Referenced by usart1_config(), and usart_configuration().

◆ usart_receiver_enable()

void usart_receiver_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

usart receiver enable.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | TRUE or FALSE.
Return values
none

Definition at line 192 of file at32f415_usart.c.

Referenced by uart_init(), usart1_config(), usart_configuration(), and usart_spi_configuration().

◆ usart_receiver_mute_enable()

void usart_receiver_mute_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

config the usart in mute mode in multi-processor communication.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | new state of the usart mute mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 331 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_reset()

void usart_reset ( usart_type * usart_x )

deinitialize the usart peripheral registers to their default reset values.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
Return values
none

Definition at line 52 of file at32f415_usart.c.

◆ usart_single_line_halfduplex_select()

void usart_single_line_halfduplex_select | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the usart single line bidirectional half-duplex communication.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4 or UART5.
new_state | new state of the single line half-duplex select. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 470 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_smartcard_guard_time_set()

void usart_smartcard_guard_time_set | ( | usart_type * | usart_x,
 |  | uint8_t | guard_time_val
 | ) |  |

config the specified usart smartcard guard time.

Note
The guard time bits are not available for UART4 or UART5.
Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2 or USART3.
guard_time_val | specifies the guard time (0x00~0xFF).
Return values
none

Definition at line 412 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_smartcard_mode_enable()

void usart_smartcard_mode_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable the usart smart card mode.

Note
the smart card mode are not available for UART4 or UART5.
Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2 or USART3.
new_state | new state of the smart card mode. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 441 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_smartcard_nack_set()

void usart_smartcard_nack_set | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

enable or disable nack transmission in smartcard mode.

Note
the smart card nack are not available for UART4 or UART5.
Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2 or USART3.
new_state | new state of the nack transmission. this parameter can be: TRUE or FALSE.
Return values
none

Definition at line 456 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_transmitter_enable()

void usart_transmitter_enable | ( | usart_type * | usart_x,
 |  | confirm_state | new_state
 | ) |  |

usart transmitter enable.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
new_state | TRUE or FALSE.
Return values
none

Definition at line 179 of file at32f415_usart.c.

Referenced by uart_init(), uart_print_init(), usart1_config(), usart_configuration(), and usart_spi_configuration().

◆ usart_wakeup_id_set()

void usart_wakeup_id_set | ( | usart_type * | usart_x,
 |  | uint8_t | usart_id
 | ) |  |

set the wakeup id of the usart.

Parameters
usart_x | select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
usart_id | the matching id(0x0~0xF).
Return values
none

Definition at line 301 of file at32f415_usart.c.

Referenced by usart_configuration().

◆ usart_wakeup_mode_set()

void usart_wakeup_mode_set | ( | usart_type * | usart_x,
 |  | usart_wakeup_mode_type | wakeup_mode
 | ) |  |

select the usart wakeup method in multi-processor communication.

Parameters
usart_x select the usart or the uart peripheral. this parameter can be one of the following values: USART1, USART2, USART3, UART4, or UART5.
wakeup_mode determines the way to wake up usart method. this parameter can be one of the following values:
  • USART_WAKEUP_BY_IDLE_FRAME
  • USART_WAKEUP_BY_MATCHING_ID
Return values
none

Definition at line 317 of file at32f415_usart.c.

Referenced by usart_configuration().


AT32F415 Firmwary Library: USB

Modules | Macros
USB
AT32F415_periph_driver

USB driver modules. More...

Modules

USB_global_interrupts_definition
usb global interrupt mask
USB_global_interrupt_flags_definition
usb global interrupt flag
USB_global_setting_definition
usb global setting
USB_host_config_definition
USB_device_config_definition
USB_exported_enum_types
USB_exported_types
USB_exported_functions
USB_private_functions

Macros

#define | OTG_FIFO_SIZE 320
otg fifo size (word) More...
#define | USB_MAX_DATA_LENGTH 0x200
otg host max buffer length (byte) More...
#define | OTGFS_USB_GLOBAL
#define | OTGFS_USB_DEVICE
#define | OTGFS_USB_HOST

Detailed Description

USB driver modules.

Macro Definition Documentation

◆ OTG_FIFO_SIZE

#define OTG_FIFO_SIZE 320

otg fifo size (word)

otg usb total fifo size

Definition at line 316 of file at32f415_usb.h.

◆ OTGFS_USB_DEVICE

#define OTGFS_USB_DEVICE

Definition at line 324 of file at32f415_usb.h.

◆ OTGFS_USB_GLOBAL

#define OTGFS_USB_GLOBAL

Definition at line 323 of file at32f415_usb.h.

◆ OTGFS_USB_HOST

#define OTGFS_USB_HOST

Definition at line 325 of file at32f415_usb.h.

◆ USB_MAX_DATA_LENGTH

#define USB_MAX_DATA_LENGTH 0x200

otg host max buffer length (byte)

usb host maximum buffer size

Definition at line 321 of file at32f415_usb.h.


AT32F415 Firmwary Library: USB_global_interrupts_definition

Macros
USB_global_interrupts_definition
AT32F415_periph_driver » USB

usb global interrupt mask More...

Macros

#define | USB_OTG_MODEMIS_INT ((uint32_t)0x00000002)
#define | USB_OTG_OTGINT_INT ((uint32_t)0x00000004)
#define | USB_OTG_SOF_INT ((uint32_t)0x00000008)
#define | USB_OTG_RXFLVL_INT ((uint32_t)0x00000010)
#define | USB_OTG_NPTXFEMP_INT ((uint32_t)0x00000020)
#define | USB_OTG_GINNAKEFF_INT ((uint32_t)0x00000040)
#define | USB_OTG_GOUTNAKEFF_INT ((uint32_t)0x00000080)
#define | USB_OTG_ERLYSUSP_INT ((uint32_t)0x00000400)
#define | USB_OTG_USBSUSP_INT ((uint32_t)0x00000800)
#define | USB_OTG_USBRST_INT ((uint32_t)0x00001000)
#define | USB_OTG_ENUMDONE_INT ((uint32_t)0x00002000)
#define | USB_OTG_ISOOUTDROP_INT ((uint32_t)0x00004000)
#define | USB_OTG_EOPF_INT ((uint32_t)0x00008000)
#define | USB_OTG_IEPT_INT ((uint32_t)0x00040000)
#define | USB_OTG_OEPT_INT ((uint32_t)0x00080000)
#define | USB_OTG_INCOMISOIN_INT ((uint32_t)0x00100000)
#define | USB_OTG_INCOMPIP_INCOMPISOOUT_INT ((uint32_t)0x00200000)
#define | USB_OTG_PRT_INT ((uint32_t)0x01000000)
#define | USB_OTG_HCH_INT ((uint32_t)0x02000000)
#define | USB_OTG_PTXFEMP_INT ((uint32_t)0x04000000)
#define | USB_OTG_CONIDSCHG_INT ((uint32_t)0x10000000)
#define | USB_OTG_DISCON_INT ((uint32_t)0x20000000)
#define | USB_OTG_WKUP_INT ((uint32_t)0x80000000)

Detailed Description

usb global interrupt mask

Macro Definition Documentation

◆ USB_OTG_CONIDSCHG_INT

#define USB_OTG_CONIDSCHG_INT ((uint32_t)0x10000000)

usb otg connector id status change interrupt

Definition at line 72 of file at32f415_usb.h.

◆ USB_OTG_DISCON_INT

#define USB_OTG_DISCON_INT ((uint32_t)0x20000000)

usb otg disconnect detected interrupt

Definition at line 73 of file at32f415_usb.h.

◆ USB_OTG_ENUMDONE_INT

#define USB_OTG_ENUMDONE_INT ((uint32_t)0x00002000)

usb otg enumeration done interrupt

Definition at line 62 of file at32f415_usb.h.

◆ USB_OTG_EOPF_INT

#define USB_OTG_EOPF_INT ((uint32_t)0x00008000)

usb otg eop interrupt

Definition at line 64 of file at32f415_usb.h.

◆ USB_OTG_ERLYSUSP_INT

#define USB_OTG_ERLYSUSP_INT ((uint32_t)0x00000400)

usb otg early suspend interrupt

Definition at line 59 of file at32f415_usb.h.

◆ USB_OTG_GINNAKEFF_INT

#define USB_OTG_GINNAKEFF_INT ((uint32_t)0x00000040)

usb otg global non-periodic in nak effective interrupt

Definition at line 57 of file at32f415_usb.h.

◆ USB_OTG_GOUTNAKEFF_INT

#define USB_OTG_GOUTNAKEFF_INT ((uint32_t)0x00000080)

usb otg global out nak effective interrupt

Definition at line 58 of file at32f415_usb.h.

◆ USB_OTG_HCH_INT

#define USB_OTG_HCH_INT ((uint32_t)0x02000000)

usb otg host channel interrupt

Definition at line 70 of file at32f415_usb.h.

◆ USB_OTG_IEPT_INT

#define USB_OTG_IEPT_INT ((uint32_t)0x00040000)

usb otg in endpoint interrupt

Definition at line 65 of file at32f415_usb.h.

◆ USB_OTG_INCOMISOIN_INT

#define USB_OTG_INCOMISOIN_INT ((uint32_t)0x00100000)

usb otg incomplete isochronous in transfer interrupt

Definition at line 67 of file at32f415_usb.h.

◆ USB_OTG_INCOMPIP_INCOMPISOOUT_INT

#define USB_OTG_INCOMPIP_INCOMPISOOUT_INT ((uint32_t)0x00200000)

usb otg incomplete periodic transfer/isochronous out interrupt

Definition at line 68 of file at32f415_usb.h.

◆ USB_OTG_ISOOUTDROP_INT

#define USB_OTG_ISOOUTDROP_INT ((uint32_t)0x00004000)

usb otg isochronous out packet dropped interrut

Definition at line 63 of file at32f415_usb.h.

◆ USB_OTG_MODEMIS_INT

#define USB_OTG_MODEMIS_INT ((uint32_t)0x00000002)

usb otg mode mismatch interrupt

Definition at line 52 of file at32f415_usb.h.

◆ USB_OTG_NPTXFEMP_INT

#define USB_OTG_NPTXFEMP_INT ((uint32_t)0x00000020)

usb otg non-periodic tx fifo empty interrupt

Definition at line 56 of file at32f415_usb.h.

◆ USB_OTG_OEPT_INT

#define USB_OTG_OEPT_INT ((uint32_t)0x00080000)

usb otg out endpoint interrupt

Definition at line 66 of file at32f415_usb.h.

◆ USB_OTG_OTGINT_INT

#define USB_OTG_OTGINT_INT ((uint32_t)0x00000004)

usb otg interrupt

Definition at line 53 of file at32f415_usb.h.

◆ USB_OTG_PRT_INT

#define USB_OTG_PRT_INT ((uint32_t)0x01000000)

usb otg host port interrupt

Definition at line 69 of file at32f415_usb.h.

◆ USB_OTG_PTXFEMP_INT

#define USB_OTG_PTXFEMP_INT ((uint32_t)0x04000000)

usb otg periodic txfifo empty interrupt

Definition at line 71 of file at32f415_usb.h.

◆ USB_OTG_RXFLVL_INT

#define USB_OTG_RXFLVL_INT ((uint32_t)0x00000010)

usb otg receive fifo non-empty interrupt

Definition at line 55 of file at32f415_usb.h.

◆ USB_OTG_SOF_INT

#define USB_OTG_SOF_INT ((uint32_t)0x00000008)

usb otg sof interrupt

Definition at line 54 of file at32f415_usb.h.

◆ USB_OTG_USBRST_INT

#define USB_OTG_USBRST_INT ((uint32_t)0x00001000)

usb otg reset interrupt

Definition at line 61 of file at32f415_usb.h.

◆ USB_OTG_USBSUSP_INT

#define USB_OTG_USBSUSP_INT ((uint32_t)0x00000800)

usb otg suspend interrupt

Definition at line 60 of file at32f415_usb.h.

◆ USB_OTG_WKUP_INT

#define USB_OTG_WKUP_INT ((uint32_t)0x80000000)

usb otg wakeup interrupt

Definition at line 74 of file at32f415_usb.h.


AT32F415 Firmwary Library: USB_global_interrupt_flags_definition

Macros
USB_global_interrupt_flags_definition
AT32F415_periph_driver » USB

usb global interrupt flag More...

Macros

#define | USB_OTG_CURMODE ((uint32_t)0x00000001)
#define | USB_OTG_MODEMIS_FLAG ((uint32_t)0x00000002)
#define | USB_OTG_OTGINT_FLAG ((uint32_t)0x00000004)
#define | USB_OTG_SOF_FLAG ((uint32_t)0x00000008)
#define | USB_OTG_RXFLVL_FLAG ((uint32_t)0x00000010)
#define | USB_OTG_NPTXFEMP_FLAG ((uint32_t)0x00000020)
#define | USB_OTG_GINNAKEFF_FLAG ((uint32_t)0x00000040)
#define | USB_OTG_GOUTNAKEFF_FLAG ((uint32_t)0x00000080)
#define | USB_OTG_ERLYSUSP_FLAG ((uint32_t)0x00000400)
#define | USB_OTG_USBSUSP_FLAG ((uint32_t)0x00000800)
#define | USB_OTG_USBRST_FLAG ((uint32_t)0x00001000)
#define | USB_OTG_ENUMDONE_FLAG ((uint32_t)0x00002000)
#define | USB_OTG_ISOOUTDROP_FLAG ((uint32_t)0x00004000)
#define | USB_OTG_EOPF_FLAG ((uint32_t)0x00008000)
#define | USB_OTG_IEPT_FLAG ((uint32_t)0x00040000)
#define | USB_OTG_OEPT_FLAG ((uint32_t)0x00080000)
#define | USB_OTG_INCOMISOIN_FLAG ((uint32_t)0x00100000)
#define | USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG ((uint32_t)0x00200000)
#define | USB_OTG_PRT_FLAG ((uint32_t)0x01000000)
#define | USB_OTG_HCH_FLAG ((uint32_t)0x02000000)
#define | USB_OTG_PTXFEMP_FLAG ((uint32_t)0x04000000)
#define | USB_OTG_CONIDSCHG_FLAG ((uint32_t)0x10000000)
#define | USB_OTG_DISCON_FLAG ((uint32_t)0x20000000)
#define | USB_OTG_WKUP_FLAG ((uint32_t)0x80000000)

Detailed Description

usb global interrupt flag

Macro Definition Documentation

◆ USB_OTG_CONIDSCHG_FLAG

#define USB_OTG_CONIDSCHG_FLAG ((uint32_t)0x10000000)

usb otg connector id status change flag

Definition at line 106 of file at32f415_usb.h.

◆ USB_OTG_CURMODE

#define USB_OTG_CURMODE ((uint32_t)0x00000001)

usb otg current mode

Definition at line 85 of file at32f415_usb.h.

◆ USB_OTG_DISCON_FLAG

#define USB_OTG_DISCON_FLAG ((uint32_t)0x20000000)

usb otg disconnect detected flag

Definition at line 107 of file at32f415_usb.h.

◆ USB_OTG_ENUMDONE_FLAG

#define USB_OTG_ENUMDONE_FLAG ((uint32_t)0x00002000)

usb otg enumeration done flag

Definition at line 96 of file at32f415_usb.h.

◆ USB_OTG_EOPF_FLAG

#define USB_OTG_EOPF_FLAG ((uint32_t)0x00008000)

usb otg eop flag

Definition at line 98 of file at32f415_usb.h.

◆ USB_OTG_ERLYSUSP_FLAG

#define USB_OTG_ERLYSUSP_FLAG ((uint32_t)0x00000400)

usb otg early suspend flag

Definition at line 93 of file at32f415_usb.h.

◆ USB_OTG_GINNAKEFF_FLAG

#define USB_OTG_GINNAKEFF_FLAG ((uint32_t)0x00000040)

usb otg global non-periodic in nak effective flag

Definition at line 91 of file at32f415_usb.h.

◆ USB_OTG_GOUTNAKEFF_FLAG

#define USB_OTG_GOUTNAKEFF_FLAG ((uint32_t)0x00000080)

usb otg global out nak effective flag

Definition at line 92 of file at32f415_usb.h.

◆ USB_OTG_HCH_FLAG

#define USB_OTG_HCH_FLAG ((uint32_t)0x02000000)

usb otg host channel flag

Definition at line 104 of file at32f415_usb.h.

◆ USB_OTG_IEPT_FLAG

#define USB_OTG_IEPT_FLAG ((uint32_t)0x00040000)

usb otg in endpoint flag

Definition at line 99 of file at32f415_usb.h.

◆ USB_OTG_INCOMISOIN_FLAG

#define USB_OTG_INCOMISOIN_FLAG ((uint32_t)0x00100000)

usb otg incomplete isochronous in transfer flag

Definition at line 101 of file at32f415_usb.h.

◆ USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG

#define USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG ((uint32_t)0x00200000)

usb otg incomplete periodic transfer/isochronous out flag

Definition at line 102 of file at32f415_usb.h.

◆ USB_OTG_ISOOUTDROP_FLAG

#define USB_OTG_ISOOUTDROP_FLAG ((uint32_t)0x00004000)

usb otg isochronous out packet dropped flag

Definition at line 97 of file at32f415_usb.h.

◆ USB_OTG_MODEMIS_FLAG

#define USB_OTG_MODEMIS_FLAG ((uint32_t)0x00000002)

usb otg mode mismatch flag

Definition at line 86 of file at32f415_usb.h.

◆ USB_OTG_NPTXFEMP_FLAG

#define USB_OTG_NPTXFEMP_FLAG ((uint32_t)0x00000020)

usb otg non-periodic tx fifo empty flag

Definition at line 90 of file at32f415_usb.h.

◆ USB_OTG_OEPT_FLAG

#define USB_OTG_OEPT_FLAG ((uint32_t)0x00080000)

usb otg out endpoint flag

Definition at line 100 of file at32f415_usb.h.

◆ USB_OTG_OTGINT_FLAG

#define USB_OTG_OTGINT_FLAG ((uint32_t)0x00000004)

usb otg flag

Definition at line 87 of file at32f415_usb.h.

◆ USB_OTG_PRT_FLAG

#define USB_OTG_PRT_FLAG ((uint32_t)0x01000000)

usb otg host port flag

Definition at line 103 of file at32f415_usb.h.

◆ USB_OTG_PTXFEMP_FLAG

#define USB_OTG_PTXFEMP_FLAG ((uint32_t)0x04000000)

usb otg periodic txfifo empty flag

Definition at line 105 of file at32f415_usb.h.

◆ USB_OTG_RXFLVL_FLAG

#define USB_OTG_RXFLVL_FLAG ((uint32_t)0x00000010)

usb otg receive fifo non-empty flag

Definition at line 89 of file at32f415_usb.h.

◆ USB_OTG_SOF_FLAG

#define USB_OTG_SOF_FLAG ((uint32_t)0x00000008)

usb otg sof flag

Definition at line 88 of file at32f415_usb.h.

◆ USB_OTG_USBRST_FLAG

#define USB_OTG_USBRST_FLAG ((uint32_t)0x00001000)

usb otg reset flag

Definition at line 95 of file at32f415_usb.h.

◆ USB_OTG_USBSUSP_FLAG

#define USB_OTG_USBSUSP_FLAG ((uint32_t)0x00000800)

usb otg suspend flag

Definition at line 94 of file at32f415_usb.h.

◆ USB_OTG_WKUP_FLAG

#define USB_OTG_WKUP_FLAG ((uint32_t)0x80000000)

usb otg wakeup flag

Definition at line 108 of file at32f415_usb.h.


AT32F415 Firmwary Library: USB_global_setting_definition

Macros
USB_global_setting_definition
AT32F415_periph_driver » USB

usb global setting More...

Macros

#define | USB_TRDTIM_8 0x9
usb turnaround time More...
#define | USB_TRDTIM_16 0x5
#define | USB_OTG_GRXSTSP_EPTNUM ((uint32_t)0x0000000F)
usb receive status More...
#define | USB_OTG_GRXSTSP_CHNUM ((uint32_t)0x0000000F)
#define | USB_OTG_GRXSTSP_BCNT ((uint32_t)0x00007FF0)
#define | USB_OTG_GRXSTSP_DPID ((uint32_t)0x00018000)
#define | USB_OTG_GRXSTSP_PKTSTS ((uint32_t)0x001E0000)
#define | PKTSTS_IN_DATA_PACKET_RECV 0x2
usb host packet status More...
#define | PKTSTS_IN_TRANSFER_COMPLETE 0x3
#define | PKTSTS_DATA_BIT_ERROR 0x5
#define | PKTSTS_CHANNEL_STOP 0x7
#define | USB_OUT_STS_NAK 0x1
usb device packet status More...
#define | USB_OUT_STS_DATA 0x2
#define | USB_OUT_STS_COMP 0x3
#define | USB_SETUP_STS_COMP 0x4
#define | USB_SETUP_STS_DATA 0x6

Detailed Description

usb global setting

Macro Definition Documentation

◆ PKTSTS_CHANNEL_STOP

#define PKTSTS_CHANNEL_STOP 0x7

usb host channel halted

Definition at line 141 of file at32f415_usb.h.

◆ PKTSTS_DATA_BIT_ERROR

#define PKTSTS_DATA_BIT_ERROR 0x5

usb host data toggle error

Definition at line 140 of file at32f415_usb.h.

◆ PKTSTS_IN_DATA_PACKET_RECV

#define PKTSTS_IN_DATA_PACKET_RECV 0x2

usb host packet status

usb host in data packet received

Definition at line 138 of file at32f415_usb.h.

◆ PKTSTS_IN_TRANSFER_COMPLETE

#define PKTSTS_IN_TRANSFER_COMPLETE 0x3

usb host in transfer completed

Definition at line 139 of file at32f415_usb.h.

◆ USB_OTG_GRXSTSP_BCNT

#define USB_OTG_GRXSTSP_BCNT ((uint32_t)0x00007FF0)

usb receive packet byte count

Definition at line 131 of file at32f415_usb.h.

◆ USB_OTG_GRXSTSP_CHNUM

#define USB_OTG_GRXSTSP_CHNUM ((uint32_t)0x0000000F)

usb host receive packet channel number

Definition at line 130 of file at32f415_usb.h.

◆ USB_OTG_GRXSTSP_DPID

#define USB_OTG_GRXSTSP_DPID ((uint32_t)0x00018000)

usb receive packet pid

Definition at line 132 of file at32f415_usb.h.

◆ USB_OTG_GRXSTSP_EPTNUM

#define USB_OTG_GRXSTSP_EPTNUM ((uint32_t)0x0000000F)

usb receive status

usb device receive packet endpoint number

Definition at line 129 of file at32f415_usb.h.

◆ USB_OTG_GRXSTSP_PKTSTS

#define USB_OTG_GRXSTSP_PKTSTS ((uint32_t)0x001E0000)

usb receive packet status

Definition at line 133 of file at32f415_usb.h.

◆ USB_OUT_STS_COMP

#define USB_OUT_STS_COMP 0x3

usb device out transfer completed

Definition at line 148 of file at32f415_usb.h.

◆ USB_OUT_STS_DATA

#define USB_OUT_STS_DATA 0x2

usb device out data packet received

Definition at line 147 of file at32f415_usb.h.

◆ USB_OUT_STS_NAK

#define USB_OUT_STS_NAK 0x1

usb device packet status

usb device global out nak

Definition at line 146 of file at32f415_usb.h.

◆ USB_SETUP_STS_COMP

#define USB_SETUP_STS_COMP 0x4

usb device setup transcation completed

Definition at line 149 of file at32f415_usb.h.

◆ USB_SETUP_STS_DATA

#define USB_SETUP_STS_DATA 0x6

usb device setup data packet received

Definition at line 150 of file at32f415_usb.h.

◆ USB_TRDTIM_16

#define USB_TRDTIM_16 0x5

usb turn around time 16

Definition at line 124 of file at32f415_usb.h.

◆ USB_TRDTIM_8

#define USB_TRDTIM_8 0x9

usb turnaround time

usb turn around time 8

Definition at line 123 of file at32f415_usb.h.


AT32F415 Firmwary Library: USB_host_config_definition

Macros
USB_host_config_definition
AT32F415_periph_driver » USB

Macros

#define | USB_HCFG_CLK_60M 0
usb host phy clock More...
#define | USB_HCFG_CLK_48M 1
#define | USB_HCFG_CLK_6M 2
#define | USB_OTG_HPRT_PRTCONSTS ((uint32_t)0x00000001)
usb host port status More...
#define | USB_OTG_HPRT_PRTCONDET ((uint32_t)0x00000002)
#define | USB_OTG_HPRT_PRTENA ((uint32_t)0x00000004)
#define | USB_OTG_HPRT_PRTENCHNG ((uint32_t)0x00000008)
#define | USB_OTG_HPRT_PRTOVRCACT ((uint32_t)0x00000010)
#define | USB_OTG_HPRT_PRTOVRCCHNG ((uint32_t)0x00000020)
#define | USB_OTG_HPRT_PRTRES ((uint32_t)0x00000040)
#define | USB_OTG_HPRT_PRTSUSP ((uint32_t)0x00000080)
#define | USB_OTG_HPRT_PRTRST ((uint32_t)0x00000100)
#define | USB_OTG_HPRT_PRTLNSTS ((uint32_t)0x00000C00)
#define | USB_OTG_HPRT_PRTPWR ((uint32_t)0x00001000)
#define | USB_OTG_HPRT_PRTSPD ((uint32_t)0x00060000)
#define | USB_PRTSPD_HIGH_SPEED 0
usb port speed More...
#define | USB_PRTSPD_FULL_SPEED 1
#define | USB_PRTSPD_LOW_SPEED 2
#define | USB_OTG_HCCHAR_MPS ((uint32_t)0x000007FF)
usb host register hcchar bit define More...
#define | USB_OTG_HCCHAR_EPTNUM ((uint32_t)0x00007800)
#define | USB_OTG_HCCHAR_EPTDIR ((uint32_t)0x00008000)
#define | USB_OTG_HCCHAR_LSPDDEV ((uint32_t)0x00020000)
#define | USB_OTG_HCCHAR_EPTYPE ((uint32_t)0x000C0000)
#define | USB_OTG_HCCHAR_MC ((uint32_t)0x00300000)
#define | USB_OTG_HCCHAR_DEVADDR ((uint32_t)0x1FC00000)
#define | USB_OTG_HCCHAR_ODDFRM ((uint32_t)0x20000000)
#define | USB_OTG_HCCHAR_CHDIS ((uint32_t)0x40000000)
#define | USB_OTG_HCCHAR_CHENA ((uint32_t)0x80000000)
#define | USB_OTG_HCTSIZ_XFERSIZE ((uint32_t)0x0007FFFF)
usb host register hctsiz bit define More...
#define | USB_OTG_HCTSIZ_PKTCNT ((uint32_t)0x1FF80000)
#define | USB_OTG_HCTSIZ_PID ((uint32_t)0x60000000)
#define | USB_OTG_HC_XFERCM_INT ((uint32_t)0x00000001)
usb host channel interrupt mask More...
#define | USB_OTG_HC_CHHLTDM_INT ((uint32_t)0x00000002)
#define | USB_OTG_HC_STALLM_INT ((uint32_t)0x00000008)
#define | USB_OTG_HC_NAKM_INT ((uint32_t)0x00000010)
#define | USB_OTG_HC_ACKM_INT ((uint32_t)0x00000020)
#define | USB_OTG_HC_NYETM_INT ((uint32_t)0x00000040)
#define | USB_OTG_HC_XACTERRM_INT ((uint32_t)0x00000080)
#define | USB_OTG_HC_BBLERRM_INT ((uint32_t)0x00000100)
#define | USB_OTG_HC_FRMOVRRUN_INT ((uint32_t)0x00000200)
#define | USB_OTG_HC_DTGLERRM_INT ((uint32_t)0x00000400)
#define | USB_OTG_HC_XFERC_FLAG ((uint32_t)0x00000001)
usb host channel interrupt flag More...
#define | USB_OTG_HC_CHHLTD_FLAG ((uint32_t)0x00000002)
#define | USB_OTG_HC_STALL_FLAG ((uint32_t)0x00000008)
#define | USB_OTG_HC_NAK_FLAG ((uint32_t)0x00000010)
#define | USB_OTG_HC_ACK_FLAG ((uint32_t)0x00000020)
#define | USB_OTG_HC_NYET_FLAG ((uint32_t)0x00000040)
#define | USB_OTG_HC_XACTERR_FLAG ((uint32_t)0x00000080)
#define | USB_OTG_HC_BBLERR_FLAG ((uint32_t)0x00000100)
#define | USB_OTG_HC_FRMOVRRUN_FLAG ((uint32_t)0x00000200)
#define | USB_OTG_HC_DTGLERR_FLAG ((uint32_t)0x00000400)

Detailed Description

Macro Definition Documentation

◆ USB_HCFG_CLK_48M

#define USB_HCFG_CLK_48M 1

usb host phy clock 48mhz

Definition at line 164 of file at32f415_usb.h.

◆ USB_HCFG_CLK_60M

#define USB_HCFG_CLK_60M 0

usb host phy clock

usb host phy clock 60mhz

Definition at line 163 of file at32f415_usb.h.

◆ USB_HCFG_CLK_6M

#define USB_HCFG_CLK_6M 2

usb host phy clock 6mhz

Definition at line 165 of file at32f415_usb.h.

◆ USB_OTG_HC_ACK_FLAG

#define USB_OTG_HC_ACK_FLAG ((uint32_t)0x00000020)

channel ack flag

Definition at line 232 of file at32f415_usb.h.

◆ USB_OTG_HC_ACKM_INT

#define USB_OTG_HC_ACKM_INT ((uint32_t)0x00000020)

channel ack interrupt

Definition at line 218 of file at32f415_usb.h.

◆ USB_OTG_HC_BBLERR_FLAG

#define USB_OTG_HC_BBLERR_FLAG ((uint32_t)0x00000100)

channel babble error flag

Definition at line 235 of file at32f415_usb.h.

◆ USB_OTG_HC_BBLERRM_INT

#define USB_OTG_HC_BBLERRM_INT ((uint32_t)0x00000100)

channel babble error interrupt

Definition at line 221 of file at32f415_usb.h.

◆ USB_OTG_HC_CHHLTD_FLAG

#define USB_OTG_HC_CHHLTD_FLAG ((uint32_t)0x00000002)

channel halted flag

Definition at line 229 of file at32f415_usb.h.

◆ USB_OTG_HC_CHHLTDM_INT

#define USB_OTG_HC_CHHLTDM_INT ((uint32_t)0x00000002)

channel halted interrupt

Definition at line 215 of file at32f415_usb.h.

◆ USB_OTG_HC_DTGLERR_FLAG

#define USB_OTG_HC_DTGLERR_FLAG ((uint32_t)0x00000400)

channel data toggle flag

Definition at line 237 of file at32f415_usb.h.

◆ USB_OTG_HC_DTGLERRM_INT

#define USB_OTG_HC_DTGLERRM_INT ((uint32_t)0x00000400)

channel data toggle interrupt

Definition at line 223 of file at32f415_usb.h.

◆ USB_OTG_HC_FRMOVRRUN_FLAG

#define USB_OTG_HC_FRMOVRRUN_FLAG ((uint32_t)0x00000200)

channel frame overrun flag

Definition at line 236 of file at32f415_usb.h.

◆ USB_OTG_HC_FRMOVRRUN_INT

#define USB_OTG_HC_FRMOVRRUN_INT ((uint32_t)0x00000200)

channel frame overrun interrupt

Definition at line 222 of file at32f415_usb.h.

◆ USB_OTG_HC_NAK_FLAG

#define USB_OTG_HC_NAK_FLAG ((uint32_t)0x00000010)

channel nak flag

Definition at line 231 of file at32f415_usb.h.

◆ USB_OTG_HC_NAKM_INT

#define USB_OTG_HC_NAKM_INT ((uint32_t)0x00000010)

channel nak interrupt

Definition at line 217 of file at32f415_usb.h.

◆ USB_OTG_HC_NYET_FLAG

#define USB_OTG_HC_NYET_FLAG ((uint32_t)0x00000040)

channel nyet flag

Definition at line 233 of file at32f415_usb.h.

◆ USB_OTG_HC_NYETM_INT

#define USB_OTG_HC_NYETM_INT ((uint32_t)0x00000040)

channel nyet interrupt

Definition at line 219 of file at32f415_usb.h.

◆ USB_OTG_HC_STALL_FLAG

#define USB_OTG_HC_STALL_FLAG ((uint32_t)0x00000008)

channel stall flag

Definition at line 230 of file at32f415_usb.h.

◆ USB_OTG_HC_STALLM_INT

#define USB_OTG_HC_STALLM_INT ((uint32_t)0x00000008)

channel stall interrupt

Definition at line 216 of file at32f415_usb.h.

◆ USB_OTG_HC_XACTERR_FLAG

#define USB_OTG_HC_XACTERR_FLAG ((uint32_t)0x00000080)

channel transaction error flag

Definition at line 234 of file at32f415_usb.h.

◆ USB_OTG_HC_XACTERRM_INT

#define USB_OTG_HC_XACTERRM_INT ((uint32_t)0x00000080)

channel transaction error interrupt

Definition at line 220 of file at32f415_usb.h.

◆ USB_OTG_HC_XFERC_FLAG

#define USB_OTG_HC_XFERC_FLAG ((uint32_t)0x00000001)

usb host channel interrupt flag

channel transfer complete flag

Definition at line 228 of file at32f415_usb.h.

◆ USB_OTG_HC_XFERCM_INT

#define USB_OTG_HC_XFERCM_INT ((uint32_t)0x00000001)

usb host channel interrupt mask

channel transfer complete interrupt

Definition at line 214 of file at32f415_usb.h.

◆ USB_OTG_HCCHAR_CHDIS

#define USB_OTG_HCCHAR_CHDIS ((uint32_t)0x40000000)

channel disable

Definition at line 201 of file at32f415_usb.h.

◆ USB_OTG_HCCHAR_CHENA

#define USB_OTG_HCCHAR_CHENA ((uint32_t)0x80000000)

channel enable

Definition at line 202 of file at32f415_usb.h.

◆ USB_OTG_HCCHAR_DEVADDR

#define USB_OTG_HCCHAR_DEVADDR ((uint32_t)0x1FC00000)

device address

Definition at line 199 of file at32f415_usb.h.

◆ USB_OTG_HCCHAR_EPTDIR

#define USB_OTG_HCCHAR_EPTDIR ((uint32_t)0x00008000)

endpoint direction

Definition at line 195 of file at32f415_usb.h.

◆ USB_OTG_HCCHAR_EPTNUM

#define USB_OTG_HCCHAR_EPTNUM ((uint32_t)0x00007800)

endpoint number

Definition at line 194 of file at32f415_usb.h.

◆ USB_OTG_HCCHAR_EPTYPE

#define USB_OTG_HCCHAR_EPTYPE ((uint32_t)0x000C0000)

endpoint type

Definition at line 197 of file at32f415_usb.h.

◆ USB_OTG_HCCHAR_LSPDDEV

#define USB_OTG_HCCHAR_LSPDDEV ((uint32_t)0x00020000)

low speed device

Definition at line 196 of file at32f415_usb.h.

◆ USB_OTG_HCCHAR_MC

#define USB_OTG_HCCHAR_MC ((uint32_t)0x00300000)

multi count

Definition at line 198 of file at32f415_usb.h.

◆ USB_OTG_HCCHAR_MPS

#define USB_OTG_HCCHAR_MPS ((uint32_t)0x000007FF)

usb host register hcchar bit define

channel maximum packet size

Definition at line 193 of file at32f415_usb.h.

◆ USB_OTG_HCCHAR_ODDFRM

#define USB_OTG_HCCHAR_ODDFRM ((uint32_t)0x20000000)

odd frame

Definition at line 200 of file at32f415_usb.h.

◆ USB_OTG_HCTSIZ_PID

#define USB_OTG_HCTSIZ_PID ((uint32_t)0x60000000)

channel pid

Definition at line 209 of file at32f415_usb.h.

◆ USB_OTG_HCTSIZ_PKTCNT

#define USB_OTG_HCTSIZ_PKTCNT ((uint32_t)0x1FF80000)

channel packet count

Definition at line 208 of file at32f415_usb.h.

◆ USB_OTG_HCTSIZ_XFERSIZE

#define USB_OTG_HCTSIZ_XFERSIZE ((uint32_t)0x0007FFFF)

usb host register hctsiz bit define

channel transfer size

Definition at line 207 of file at32f415_usb.h.

◆ USB_OTG_HPRT_PRTCONDET

#define USB_OTG_HPRT_PRTCONDET ((uint32_t)0x00000002)

usb host port connect detected

Definition at line 171 of file at32f415_usb.h.

◆ USB_OTG_HPRT_PRTCONSTS

#define USB_OTG_HPRT_PRTCONSTS ((uint32_t)0x00000001)

usb host port status

usb host port connect status

Definition at line 170 of file at32f415_usb.h.

◆ USB_OTG_HPRT_PRTENA

#define USB_OTG_HPRT_PRTENA ((uint32_t)0x00000004)

usb host port enable

Definition at line 172 of file at32f415_usb.h.

◆ USB_OTG_HPRT_PRTENCHNG

#define USB_OTG_HPRT_PRTENCHNG ((uint32_t)0x00000008)

usb host port enable/disable change

Definition at line 173 of file at32f415_usb.h.

◆ USB_OTG_HPRT_PRTLNSTS

#define USB_OTG_HPRT_PRTLNSTS ((uint32_t)0x00000C00)

usb host port line status

Definition at line 179 of file at32f415_usb.h.

◆ USB_OTG_HPRT_PRTOVRCACT

#define USB_OTG_HPRT_PRTOVRCACT ((uint32_t)0x00000010)

usb host port overcurrent active

Definition at line 174 of file at32f415_usb.h.

◆ USB_OTG_HPRT_PRTOVRCCHNG

#define USB_OTG_HPRT_PRTOVRCCHNG ((uint32_t)0x00000020)

usb host port overcurrent change

Definition at line 175 of file at32f415_usb.h.

◆ USB_OTG_HPRT_PRTPWR

#define USB_OTG_HPRT_PRTPWR ((uint32_t)0x00001000)

usb host port power

Definition at line 180 of file at32f415_usb.h.

◆ USB_OTG_HPRT_PRTRES

#define USB_OTG_HPRT_PRTRES ((uint32_t)0x00000040)

usb host port resume

Definition at line 176 of file at32f415_usb.h.

◆ USB_OTG_HPRT_PRTRST

#define USB_OTG_HPRT_PRTRST ((uint32_t)0x00000100)

usb host port reset

Definition at line 178 of file at32f415_usb.h.

◆ USB_OTG_HPRT_PRTSPD

#define USB_OTG_HPRT_PRTSPD ((uint32_t)0x00060000)

usb host port speed

Definition at line 181 of file at32f415_usb.h.

◆ USB_OTG_HPRT_PRTSUSP

#define USB_OTG_HPRT_PRTSUSP ((uint32_t)0x00000080)

usb host port suspend

Definition at line 177 of file at32f415_usb.h.

◆ USB_PRTSPD_FULL_SPEED

#define USB_PRTSPD_FULL_SPEED 1

usb host port full speed

Definition at line 187 of file at32f415_usb.h.

◆ USB_PRTSPD_HIGH_SPEED

#define USB_PRTSPD_HIGH_SPEED 0

usb port speed

usb host port high speed

Definition at line 186 of file at32f415_usb.h.

◆ USB_PRTSPD_LOW_SPEED

#define USB_PRTSPD_LOW_SPEED 2

usb host port low speed

Definition at line 188 of file at32f415_usb.h.


AT32F415 Firmwary Library: USB_device_config_definition

Macros | Enumerations
USB_device_config_definition
AT32F415_periph_driver » USB

Macros

#define | USB_DCFG_FULL_SPEED 3
usb device full speed More...
#define | USB_OTG_DCTL_RWKUPSIG ((uint32_t)0x00000001)
usb device ctrl define More...
#define | USB_OTG_DCTL_SFTDISCON ((uint32_t)0x00000002)
#define | USB_OTG_DCTL_GNPINNAKSTS ((uint32_t)0x00000004)
#define | USB_OTG_DCTL_GOUTNAKSTS ((uint32_t)0x00000008)
#define | USB_OTG_DCTL_SGNPINNAK ((uint32_t)0x00000080)
#define | USB_OTG_DCTL_CGNPINNAK ((uint32_t)0x00000100)
#define | USB_OTG_DCTL_SGOUTNAK ((uint32_t)0x00000200)
#define | USB_OTG_DCTL_CGOUTNAK ((uint32_t)0x00000400)
#define | USB_OTG_DCTL_PWROPRGDNE ((uint32_t)0x00000800)
#define | USB_OTG_DIEPINT_XFERC_FLAG ((uint32_t)0x00000001)
usb device in endpoint flag More...
#define | USB_OTG_DIEPINT_EPTDISD_FLAG ((uint32_t)0x00000002)
#define | USB_OTG_DIEPINT_TIMEOUT_FLAG ((uint32_t)0x00000008)
#define | USB_OTG_DIEPINT_INTKNTXFEMP_FLAG ((uint32_t)0x00000010)
#define | USB_OTG_DIEPINT_INEPTNAK_FLAG ((uint32_t)0x00000040)
#define | USB_OTG_DIEPINT_TXFEMP_FLAG ((uint32_t)0x00000080)
#define | USB_OTG_DOEPINT_XFERC_FLAG ((uint32_t)0x00000001)
usb device out endpoint flag More...
#define | USB_OTG_DOEPINT_EPTDISD_FLAG ((uint32_t)0x00000002)
#define | USB_OTG_DOEPINT_SETUP_FLAG ((uint32_t)0x00000008)
#define | USB_OTG_DOEPINT_OUTTEPD_FLAG ((uint32_t)0x00000010)
#define | USB_OTG_DOEPINT_B2BSTUP_FLAG ((uint32_t)0x00000040)
#define | USB_OTG_DTXFSTS_INEPTFSAV ((uint32_t)0x0000FFFF)
usb device in endpoint fifo space mask More...
#define | USB_EPT0_MPS_64 0
endpoint0 maximum packet size More...
#define | USB_EPT0_MPS_32 1
#define | USB_EPT0_MPS_16 2
#define | USB_EPT0_MPS_8 3

Enumerations

enum dcfg_perfrint_type { DCFG_PERFRINT_80 = 0x00 , DCFG_PERFRINT_85 = 0x01 , DCFG_PERFRINT_90 = 0x02 , DCFG_PERFRINT_95 = 0x03 }
usb device periodic frame interval More...

Detailed Description

Macro Definition Documentation

◆ USB_DCFG_FULL_SPEED

#define USB_DCFG_FULL_SPEED 3

usb device full speed

device full speed

Definition at line 262 of file at32f415_usb.h.

◆ USB_EPT0_MPS_16

#define USB_EPT0_MPS_16 2

usb device endpoint 0 maximum packet size 16byte

Definition at line 306 of file at32f415_usb.h.

◆ USB_EPT0_MPS_32

#define USB_EPT0_MPS_32 1

usb device endpoint 0 maximum packet size 32byte

Definition at line 305 of file at32f415_usb.h.

◆ USB_EPT0_MPS_64

#define USB_EPT0_MPS_64 0

endpoint0 maximum packet size

usb device endpoint 0 maximum packet size 64byte

Definition at line 304 of file at32f415_usb.h.

◆ USB_EPT0_MPS_8

#define USB_EPT0_MPS_8 3

usb device endpoint 0 maximum packet size 8byte

Definition at line 307 of file at32f415_usb.h.

◆ USB_OTG_DCTL_CGNPINNAK

#define USB_OTG_DCTL_CGNPINNAK ((uint32_t)0x00000100)

usb device clear global non-periodic in nak

Definition at line 272 of file at32f415_usb.h.

◆ USB_OTG_DCTL_CGOUTNAK

#define USB_OTG_DCTL_CGOUTNAK ((uint32_t)0x00000400)

usb device clear global out nak status

Definition at line 274 of file at32f415_usb.h.

◆ USB_OTG_DCTL_GNPINNAKSTS

#define USB_OTG_DCTL_GNPINNAKSTS ((uint32_t)0x00000004)

usb device global non-periodic in nak status

Definition at line 269 of file at32f415_usb.h.

◆ USB_OTG_DCTL_GOUTNAKSTS

#define USB_OTG_DCTL_GOUTNAKSTS ((uint32_t)0x00000008)

usb device global out nak status

Definition at line 270 of file at32f415_usb.h.

◆ USB_OTG_DCTL_PWROPRGDNE

#define USB_OTG_DCTL_PWROPRGDNE ((uint32_t)0x00000800)

usb device power on programming done

Definition at line 275 of file at32f415_usb.h.

◆ USB_OTG_DCTL_RWKUPSIG

#define USB_OTG_DCTL_RWKUPSIG ((uint32_t)0x00000001)

usb device ctrl define

usb device remote wakeup signaling

Definition at line 267 of file at32f415_usb.h.

◆ USB_OTG_DCTL_SFTDISCON

#define USB_OTG_DCTL_SFTDISCON ((uint32_t)0x00000002)

usb device soft disconnect

Definition at line 268 of file at32f415_usb.h.

◆ USB_OTG_DCTL_SGNPINNAK

#define USB_OTG_DCTL_SGNPINNAK ((uint32_t)0x00000080)

usb device set global non-periodic in nak

Definition at line 271 of file at32f415_usb.h.

◆ USB_OTG_DCTL_SGOUTNAK

#define USB_OTG_DCTL_SGOUTNAK ((uint32_t)0x00000200)

usb device set global out nak status

Definition at line 273 of file at32f415_usb.h.

◆ USB_OTG_DIEPINT_EPTDISD_FLAG

#define USB_OTG_DIEPINT_EPTDISD_FLAG ((uint32_t)0x00000002)

usb device endpoint disable flag

Definition at line 281 of file at32f415_usb.h.

◆ USB_OTG_DIEPINT_INEPTNAK_FLAG

#define USB_OTG_DIEPINT_INEPTNAK_FLAG ((uint32_t)0x00000040)

usb device in endpoint nak effective flag

Definition at line 284 of file at32f415_usb.h.

◆ USB_OTG_DIEPINT_INTKNTXFEMP_FLAG

#define USB_OTG_DIEPINT_INTKNTXFEMP_FLAG ((uint32_t)0x00000010)

usb device in token received when tx fifo is empty flag

Definition at line 283 of file at32f415_usb.h.

◆ USB_OTG_DIEPINT_TIMEOUT_FLAG

#define USB_OTG_DIEPINT_TIMEOUT_FLAG ((uint32_t)0x00000008)

usb device in timeout

Definition at line 282 of file at32f415_usb.h.

◆ USB_OTG_DIEPINT_TXFEMP_FLAG

#define USB_OTG_DIEPINT_TXFEMP_FLAG ((uint32_t)0x00000080)

usb device transmit fifo empty flag

Definition at line 285 of file at32f415_usb.h.

◆ USB_OTG_DIEPINT_XFERC_FLAG

#define USB_OTG_DIEPINT_XFERC_FLAG ((uint32_t)0x00000001)

usb device in endpoint flag

usb device in transfer completed flag

Definition at line 280 of file at32f415_usb.h.

◆ USB_OTG_DOEPINT_B2BSTUP_FLAG

#define USB_OTG_DOEPINT_B2BSTUP_FLAG ((uint32_t)0x00000040)

back-to-back setup packets received

Definition at line 294 of file at32f415_usb.h.

◆ USB_OTG_DOEPINT_EPTDISD_FLAG

#define USB_OTG_DOEPINT_EPTDISD_FLAG ((uint32_t)0x00000002)

usb device endpoint disable flag

Definition at line 291 of file at32f415_usb.h.

◆ USB_OTG_DOEPINT_OUTTEPD_FLAG

#define USB_OTG_DOEPINT_OUTTEPD_FLAG ((uint32_t)0x00000010)

usb device out token recevied when endpoint disable flag

Definition at line 293 of file at32f415_usb.h.

◆ USB_OTG_DOEPINT_SETUP_FLAG

#define USB_OTG_DOEPINT_SETUP_FLAG ((uint32_t)0x00000008)

usb device setup flag

Definition at line 292 of file at32f415_usb.h.

◆ USB_OTG_DOEPINT_XFERC_FLAG

#define USB_OTG_DOEPINT_XFERC_FLAG ((uint32_t)0x00000001)

usb device out endpoint flag

usb device out transfer completed flag

Definition at line 290 of file at32f415_usb.h.

◆ USB_OTG_DTXFSTS_INEPTFSAV

#define USB_OTG_DTXFSTS_INEPTFSAV ((uint32_t)0x0000FFFF)

usb device in endpoint fifo space mask

usb device in endpoint tx fifo space avail

Definition at line 299 of file at32f415_usb.h.

Enumeration Type Documentation

◆ dcfg_perfrint_type

enum dcfg_perfrint_type

usb device periodic frame interval

Enumerator
DCFG_PERFRINT_80 | periodic frame interval 80%
DCFG_PERFRINT_85 | periodic frame interval 85%
DCFG_PERFRINT_90 | periodic frame interval 90%
DCFG_PERFRINT_95 | periodic frame interval 95%

Definition at line 250 of file at32f415_usb.h.


AT32F415 Firmwary Library: USB_exported_enum_types

Enumerations
USB_exported_enum_types
AT32F415_periph_driver » USB

Enumerations

enum | otg_mode_type { OTG_DEVICE_MODE , OTG_HOST_MODE , OTG_DRD_MODE }
usb mode define(device, host, drd) More...
enum | endpoint_trans_type { EPT_CONTROL_TYPE = 0x00 , EPT_ISO_TYPE = 0x01 , EPT_BULK_TYPE = 0x02 , EPT_INT_TYPE = 0x03 }
endpoint type define More...
enum usb_endpoint_number_type {
USB_EPT0 = 0x00 , USB_EPT1 = 0x01 , USB_EPT2 = 0x02 , USB_EPT3 = 0x03 ,
USB_EPT4 = 0x04 , USB_EPT5 = 0x05 , USB_EPT6 = 0x06 , USB_EPT7 = 0x07
}
usb endpoint number define type More...
enum | endpoint_dir_type { EPT_DIR_IN = 0x00 , EPT_DIR_OUT = 0x01 }
usb endpoint max num define More...
enum | otg_id_type { USB_OTG1_ID , USB_OTG2_ID }
otgfs1 and otgfs2 select type More...
enum | usb_clk48_s { USB_CLK_HICK , USB_CLK_HEXT }
usb clock select More...

Detailed Description

Enumeration Type Documentation

◆ endpoint_dir_type

enum endpoint_dir_type

usb endpoint max num define

usb channel max num define

endpoint trans dir type

Enumerator
EPT_DIR_IN | usb transfer direction in
EPT_DIR_OUT | usb transfer direction out

Definition at line 383 of file at32f415_usb.h.

◆ endpoint_trans_type

enum endpoint_trans_type

endpoint type define

Enumerator
EPT_CONTROL_TYPE | usb endpoint type control
EPT_ISO_TYPE | usb endpoint type iso
EPT_BULK_TYPE | usb endpoint type bulk
EPT_INT_TYPE | usb endpoint type interrupt

Definition at line 344 of file at32f415_usb.h.

◆ otg_id_type

enum otg_id_type

otgfs1 and otgfs2 select type

Enumerator
USB_OTG1_ID | usb otg 1 id
USB_OTG2_ID | usb otg 2 id

Definition at line 392 of file at32f415_usb.h.

◆ otg_mode_type

enum otg_mode_type

usb mode define(device, host, drd)

Enumerator
OTG_DEVICE_MODE | usb device mode
OTG_HOST_MODE | usb host mode
OTG_DRD_MODE | usb drd mode

Definition at line 334 of file at32f415_usb.h.

◆ usb_clk48_s

enum usb_clk48_s

usb clock select

Enumerator
USB_CLK_HICK | usb clock use hick
USB_CLK_HEXT | usb clock use hext

Definition at line 401 of file at32f415_usb.h.

◆ usb_endpoint_number_type

enum usb_endpoint_number_type

usb endpoint number define type

Enumerator
USB_EPT0 | usb endpoint 0
USB_EPT1 | usb endpoint 1
USB_EPT2 | usb endpoint 2
USB_EPT3 | usb endpoint 3
USB_EPT4 | usb endpoint 4
USB_EPT5 | usb endpoint 5
USB_EPT6 | usb endpoint 6
USB_EPT7 | usb endpoint 7

Definition at line 355 of file at32f415_usb.h.


AT32F415 Firmwary Library: USB_exported_types

Data Structures
USB_exported_types
AT32F415_periph_driver » USB

Data Structures

struct | usb_ept_info
usb endpoint infomation structure definition More...
struct | usb_hch_type
usb host channel infomation structure definition More...
struct | otg_global_type
struct | otg_host_type
struct | otg_hchannel_type
struct | otg_device_type
struct | otg_eptin_type
struct | otg_eptout_type
struct | otg_pcgcctl_type

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: usb_ept_info Struct Reference

Data Fields
usb_ept_info Struct Reference
AT32F415_periph_driver » USB » USB_exported_types

usb endpoint infomation structure definition More...

#include <at32f415_usb.h>

Data Fields

uint8_t | eptn
uint8_t | ept_address
uint8_t | inout
uint8_t | trans_type
uint16_t | tx_addr
uint16_t | rx_addr
uint32_t | maxpacket
uint8_t | is_double_buffer
uint8_t | stall
uint32_t | status
uint8_t * | trans_buf
uint32_t | total_len
uint32_t | trans_len
uint32_t | last_len
uint32_t | ept0_slen

Detailed Description

usb endpoint infomation structure definition

Definition at line 420 of file at32f415_usb.h.

Field Documentation

◆ ept0_slen

uint32_t usb_ept_info::ept0_slen

endpoint 0 transfer sum length

Definition at line 440 of file at32f415_usb.h.

Referenced by usbd_core_in_handler(), usbd_core_out_handler(), usbd_ctrl_recv(), and usbd_ctrl_send().

◆ ept_address

uint8_t usb_ept_info::ept_address

endpoint address

Definition at line 423 of file at32f415_usb.h.

◆ eptn

uint8_t usb_ept_info::eptn

endpoint register number (0~7)

Definition at line 422 of file at32f415_usb.h.

Referenced by usb_ept_clear_stall(), usb_ept_close(), usb_ept_open(), usb_ept_stall(), usbd_ept_recv(), and usbd_ept_send().

◆ inout

uint8_t usb_ept_info::inout

endpoint dir EPT_DIR_IN or EPT_DIR_OUT

Definition at line 424 of file at32f415_usb.h.

Referenced by usb_ept_clear_stall(), usb_ept_close(), usb_ept_open(), usb_ept_stall(), and usbd_ept_open().

◆ is_double_buffer

uint8_t usb_ept_info::is_double_buffer

endpoint double buffer flag

Definition at line 430 of file at32f415_usb.h.

◆ last_len

uint32_t usb_ept_info::last_len

last transfer length

Definition at line 439 of file at32f415_usb.h.

Referenced by usbd_core_in_handler(), and usbd_ept_send().

◆ maxpacket

uint32_t usb_ept_info::maxpacket

endpoint max packet

Definition at line 429 of file at32f415_usb.h.

Referenced by usb_ept_open(), usb_write_empty_txfifo(), usbd_core_in_handler(), usbd_core_out_handler(), usbd_ept_open(), usbd_ept_recv(), and usbd_ept_send().

◆ rx_addr

uint16_t usb_ept_info::rx_addr

endpoint rx buffer offset address

Definition at line 428 of file at32f415_usb.h.

◆ stall

uint8_t usb_ept_info::stall

endpoint is stall state

Definition at line 431 of file at32f415_usb.h.

Referenced by usbd_clear_stall(), usbd_endpoint_request(), and usbd_set_stall().

◆ status

uint32_t usb_ept_info::status

Definition at line 432 of file at32f415_usb.h.

Referenced by usbd_endpoint_request().

◆ total_len

uint32_t usb_ept_info::total_len

endpoint transmission lengtg

Definition at line 436 of file at32f415_usb.h.

Referenced by usb_write_empty_txfifo(), usbd_ept_recv(), and usbd_ept_send().

◆ trans_buf

uint8_t* usb_ept_info::trans_buf

endpoint transmission buffer

Definition at line 435 of file at32f415_usb.h.

Referenced by usb_write_empty_txfifo(), usbd_core_in_handler(), usbd_core_out_handler(), usbd_ept_recv(), usbd_ept_send(), and usbd_rxflvl_handler().

◆ trans_len

uint32_t usb_ept_info::trans_len

endpoint transmission length

Definition at line 437 of file at32f415_usb.h.

Referenced by usb_write_empty_txfifo(), usbd_ept_recv(), usbd_ept_send(), usbd_get_recv_len(), and usbd_rxflvl_handler().

◆ trans_type

uint8_t usb_ept_info::trans_type

endpoint type: EPT_CONTROL_TYPE, EPT_BULK_TYPE, EPT_INT_TYPE, EPT_ISO_TYPE

Definition at line 425 of file at32f415_usb.h.

Referenced by usb_ept_clear_stall(), usb_ept_open(), usbd_ept_open(), usbd_ept_recv(), and usbd_ept_send().

◆ tx_addr

uint16_t usb_ept_info::tx_addr

endpoint tx buffer offset address

Definition at line 427 of file at32f415_usb.h.

The documentation for this struct was generated from the following file:
  • at32f415_usb.h


AT32F415 Firmwary Library: usb_hch_type Struct Reference

Data Fields
usb_hch_type Struct Reference
AT32F415_periph_driver » USB » USB_exported_types

usb host channel infomation structure definition More...

#include <at32f415_usb.h>

Data Fields

uint8_t | ch_num
uint8_t | address
uint8_t | dir
uint8_t | ept_num
uint8_t | ept_type
uint32_t | maxpacket
uint8_t | data_pid
uint8_t | speed
uint8_t | stall
uint32_t | status
uint32_t | state
uint32_t | urb_sts
uint8_t | toggle_in
uint8_t | toggle_out
uint8_t * | trans_buf
uint32_t | trans_len
uint32_t | trans_count

Detailed Description

usb host channel infomation structure definition

Definition at line 447 of file at32f415_usb.h.

Field Documentation

◆ address

uint8_t usb_hch_type::address

device address

Definition at line 450 of file at32f415_usb.h.

◆ ch_num

uint8_t usb_hch_type::ch_num

host channel number

Definition at line 449 of file at32f415_usb.h.

◆ data_pid

uint8_t usb_hch_type::data_pid

data pid

Definition at line 455 of file at32f415_usb.h.

◆ dir

uint8_t usb_hch_type::dir

transmission direction

Definition at line 451 of file at32f415_usb.h.

◆ ept_num

uint8_t usb_hch_type::ept_num

device endpoint number

Definition at line 452 of file at32f415_usb.h.

◆ ept_type

uint8_t usb_hch_type::ept_type

channel transmission type

Definition at line 453 of file at32f415_usb.h.

◆ maxpacket

uint32_t usb_hch_type::maxpacket

support max packet size

Definition at line 454 of file at32f415_usb.h.

◆ speed

uint8_t usb_hch_type::speed

usb speed

Definition at line 456 of file at32f415_usb.h.

◆ stall

uint8_t usb_hch_type::stall

channel stall flag

Definition at line 457 of file at32f415_usb.h.

◆ state

uint32_t usb_hch_type::state

channel state

Definition at line 459 of file at32f415_usb.h.

◆ status

uint32_t usb_hch_type::status

channel status

Definition at line 458 of file at32f415_usb.h.

◆ toggle_in

uint8_t usb_hch_type::toggle_in

channel in transfer toggle

Definition at line 462 of file at32f415_usb.h.

◆ toggle_out

uint8_t usb_hch_type::toggle_out

channel out transfer toggle

Definition at line 463 of file at32f415_usb.h.

◆ trans_buf

uint8_t* usb_hch_type::trans_buf

Definition at line 466 of file at32f415_usb.h.

◆ trans_count

uint32_t usb_hch_type::trans_count

Definition at line 468 of file at32f415_usb.h.

◆ trans_len

uint32_t usb_hch_type::trans_len

Definition at line 467 of file at32f415_usb.h.

◆ urb_sts

uint32_t usb_hch_type::urb_sts

usb channel request block state

Definition at line 460 of file at32f415_usb.h.

The documentation for this struct was generated from the following file:
  • at32f415_usb.h


AT32F415 Firmwary Library: otg_global_type Struct Reference

Data Fields
otg_global_type Struct Reference
AT32F415_periph_driver » USB » USB_exported_types

#include <at32f415_usb.h>

Data Fields

union {
__IO uint32_t gotgctrl
struct {
__IO uint32_t reserved1: 16
__IO uint32_t cidsts: 1
__IO uint32_t reserved2: 4
__IO uint32_t curmod: 1
__IO uint32_t reserved3: 10
} gotgctrl_bit
};
otgfs control and status register, offset:0x00 More...
union {
__IO uint32_t gotgint
struct {
__IO uint32_t reserved1: 2
__IO uint32_t sesenddet: 1
__IO uint32_t reserved2: 29
} gotgint_bit
};
otgfs interrupt register, offset:0x04 More...
union {
__IO uint32_t gahbcfg
struct {
__IO uint32_t glbintmsk: 1
__IO uint32_t reserved1: 6
__IO uint32_t nptxfemplvl: 1
__IO uint32_t ptxfemplvl: 1
__IO uint32_t reserved2: 23
} gahbcfg_bit
};
otgfs gahbcfg configuration register, offset:0x08 More...
union {
__IO uint32_t gusbcfg
struct {
__IO uint32_t toutcal: 3
__IO uint32_t reserved1: 7
__IO uint32_t usbtrdtim: 4
__IO uint32_t reserved2: 15
__IO uint32_t fhstmode: 1
__IO uint32_t fdevmode: 1
__IO uint32_t cotxpkt: 1
} gusbcfg_bit
};
otgfs usb configuration register, offset:0x0C More...
union {
__IO uint32_t grstctl
struct {
__IO uint32_t csftrst: 1
__IO uint32_t piusftrst: 1
__IO uint32_t frmcntrst: 1
__IO uint32_t reserved1: 1
__IO uint32_t rxfflsh: 1
__IO uint32_t txfflsh: 1
__IO uint32_t txfnum: 5
__IO uint32_t reserved2: 20
__IO uint32_t ahbidle: 1
} grstctl_bit
};
otgfs reset register, offset:0x10 More...
union {
__IO uint32_t gintsts
struct {
__IO uint32_t curmode: 1
__IO uint32_t modemis: 1
__IO uint32_t otgint: 1
__IO uint32_t sof: 1
__IO uint32_t rxflvl: 1
__IO uint32_t nptxfemp: 1
__IO uint32_t ginnakeff: 1
__IO uint32_t goutnakeff: 1
__IO uint32_t reserved1: 2
__IO uint32_t erlysusp: 1
__IO uint32_t usbsusp: 1
__IO uint32_t usbrst: 1
__IO uint32_t enumdone: 1
__IO uint32_t isooutdrop: 1
__IO uint32_t eopf: 1
__IO uint32_t reserved2: 2
__IO uint32_t ieptint: 1
__IO uint32_t oeptint: 1
__IO uint32_t incompisoin: 1
__IO uint32_t incompip_incompisoout: 1
__IO uint32_t reserved3: 2
__IO uint32_t prtint: 1
__IO uint32_t hchint: 1
__IO uint32_t ptxfemp: 1
__IO uint32_t reserved4: 1
__IO uint32_t conidschg: 1
__IO uint32_t disconint: 1
__IO uint32_t reserved5: 1
__IO uint32_t wkupint: 1
} gintsts_bit
};
otgfs core interrupt register, offset:0x14 More...
union {
__IO uint32_t gintmsk
struct {
__IO uint32_t reserved1: 1
__IO uint32_t modemismsk: 1
__IO uint32_t otgintmsk: 1
__IO uint32_t sofmsk: 1
__IO uint32_t rxflvlmsk: 1
__IO uint32_t nptxfempmsk: 1
__IO uint32_t ginnakeffmsk: 1
__IO uint32_t goutnakeffmsk: 1
__IO uint32_t reserved2: 2
__IO uint32_t erlysuspmsk: 1
__IO uint32_t usbsuspmsk: 1
__IO uint32_t usbrstmsk: 1
__IO uint32_t enumdonemsk: 1
__IO uint32_t isooutdropmsk: 1
__IO uint32_t eopfmsk: 1
__IO uint32_t reserved3: 2
__IO uint32_t ieptintmsk: 1
__IO uint32_t oeptintmsk: 1
__IO uint32_t incompisoinmsk: 1
__IO uint32_t incompip_incompisooutmsk: 1
__IO uint32_t reserved4: 2
__IO uint32_t prtintmsk: 1
__IO uint32_t hchintmsk: 1
__IO uint32_t ptxfempmsk: 1
__IO uint32_t reserved5: 1
__IO uint32_t conidschgmsk: 1
__IO uint32_t disconintmsk: 1
__IO uint32_t reserved6: 1
__IO uint32_t wkupintmsk: 1
} gintmsk_bit
};
otgfs interrupt mask register, offset:0x18 More...
union {
__IO uint32_t grxstsr
struct {
__IO uint32_t eptnum: 4
__IO uint32_t bcnt: 11
__IO uint32_t dpid: 2
__IO uint32_t pktsts: 4
__IO uint32_t fn: 4
__IO uint32_t reserved1: 7
} grxstsr_bit
};
otgfs rx status debug read register, offset:0x1C More...
union {
__IO uint32_t grxstsp
struct {
__IO uint32_t chnum: 4
__IO uint32_t bcnt: 11
__IO uint32_t dpid: 2
__IO uint32_t pktsts: 4
__IO uint32_t reserved1: 11
} grxstsp_bit
};
otgfs rx status read and pop register, offset:0x20 More...
union {
__IO uint32_t grxfsiz
struct {
__IO uint32_t rxfdep: 16
__IO uint32_t reserved1: 16
} grxfsiz_bit
};
otgfs rx fifo size register, offset:0x24 More...
union {
__IO uint32_t gnptxfsiz_ept0tx
struct {
__IO uint32_t nptxfstaddr: 16
__IO uint32_t nptxfdep: 16
} gnptxfsiz_ept0tx_bit
};
otgfs non-periodic and ept0 tx fifo size register, offset:0x28 More...
union {
__IO uint32_t gnptxsts
struct {
__IO uint32_t nptxfspcavail: 16
__IO uint32_t nptxqspcavail: 8
__IO uint32_t nptxqtop: 7
} gnptxsts_bit
};
otgfs non-periodic tx fifo request queue status register, offset:0x2C More...
union {
__IO uint32_t gccfg
struct {
__IO uint32_t reserved1: 16
__IO uint32_t pwrdown: 1
__IO uint32_t reserved2: 1
__IO uint32_t avalidsesen: 1
__IO uint32_t bvalidsesen: 1
__IO uint32_t sofouten: 1
__IO uint32_t vbusig: 1
ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD. More...
__IO uint32_t reserved3: 10
} gccfg_bit
};
otgfs general core configuration register, offset:0x38 More...
union {
__IO uint32_t guid
struct {
__IO uint32_t userid: 32
} guid_bit
};
otgfs core id register, offset:0x3C More...
union {
__IO uint32_t hptxfsiz
struct {
__IO uint32_t ptxfstaddr: 16
__IO uint32_t ptxfsize: 16
} hptxfsiz_bit
};
otgfs host periodic tx fifo size register, offset:0x100 More...
union {
__IO uint32_t dieptxfn [7]
struct {
__IO uint32_t ineptxfstaddr: 16
__IO uint32_t ineptxfdep: 16
} dieptxfn_bit [7]
};
otgfs host periodic tx fifo size register, offset:0x100 More...

Detailed Description

Definition at line 472 of file at32f415_usb.h.

Field Documentation

◆

union { ... } otg_global_type::@676

otgfs control and status register, offset:0x00

◆

union { ... } otg_global_type::@678

otgfs interrupt register, offset:0x04

◆

union { ... } otg_global_type::@680

otgfs gahbcfg configuration register, offset:0x08

◆

union { ... } otg_global_type::@682

otgfs usb configuration register, offset:0x0C

◆

union { ... } otg_global_type::@684

otgfs reset register, offset:0x10

◆

union { ... } otg_global_type::@686

otgfs core interrupt register, offset:0x14

◆

union { ... } otg_global_type::@688

otgfs interrupt mask register, offset:0x18

◆

union { ... } otg_global_type::@690

otgfs rx status debug read register, offset:0x1C

◆

union { ... } otg_global_type::@692

otgfs rx status read and pop register, offset:0x20

◆

union { ... } otg_global_type::@694

otgfs rx fifo size register, offset:0x24

◆

union { ... } otg_global_type::@696

otgfs non-periodic and ept0 tx fifo size register, offset:0x28

◆

union { ... } otg_global_type::@698

otgfs non-periodic tx fifo request queue status register, offset:0x2C

◆

union { ... } otg_global_type::@700

otgfs general core configuration register, offset:0x38

◆

union { ... } otg_global_type::@702

otgfs core id register, offset:0x3C

◆

union { ... } otg_global_type::@704

otgfs host periodic tx fifo size register, offset:0x100

◆

union { ... } otg_global_type::@706

otgfs host periodic tx fifo size register, offset:0x100

◆ ahbidle

__IO uint32_t otg_global_type::ahbidle

Definition at line 555 of file at32f415_usb.h.

Referenced by usb_global_reset().

◆ avalidsesen

__IO uint32_t otg_global_type::avalidsesen

Definition at line 725 of file at32f415_usb.h.

Referenced by usb_global_init().

◆ bcnt

__IO uint32_t otg_global_type::bcnt

Definition at line 648 of file at32f415_usb.h.

◆ bvalidsesen

__IO uint32_t otg_global_type::bvalidsesen

Definition at line 726 of file at32f415_usb.h.

Referenced by usb_global_init().

◆ chnum

__IO uint32_t otg_global_type::chnum

Definition at line 664 of file at32f415_usb.h.

◆ cidsts

__IO uint32_t otg_global_type::cidsts

Definition at line 483 of file at32f415_usb.h.

◆ conidschg

__IO uint32_t otg_global_type::conidschg

Definition at line 592 of file at32f415_usb.h.

◆ conidschgmsk

__IO uint32_t otg_global_type::conidschgmsk

Definition at line 632 of file at32f415_usb.h.

◆ cotxpkt

__IO uint32_t otg_global_type::cotxpkt

Definition at line 535 of file at32f415_usb.h.

◆ csftrst

__IO uint32_t otg_global_type::csftrst

Definition at line 547 of file at32f415_usb.h.

Referenced by usb_global_power_on(), and usb_global_reset().

◆ curmod

__IO uint32_t otg_global_type::curmod

Definition at line 485 of file at32f415_usb.h.

◆ curmode

__IO uint32_t otg_global_type::curmode

Definition at line 567 of file at32f415_usb.h.

Referenced by usbd_irq_handler(), and usbh_irq_handler().

◆ dieptxfn

__IO uint32_t otg_global_type::dieptxfn[7]

Definition at line 776 of file at32f415_usb.h.

Referenced by usb_set_tx_fifo(), and usbd_core_init().

◆

struct { ... } otg_global_type::dieptxfn_bit[7]

Referenced by usb_set_tx_fifo().

◆ disconint

__IO uint32_t otg_global_type::disconint

Definition at line 593 of file at32f415_usb.h.

◆ disconintmsk

__IO uint32_t otg_global_type::disconintmsk

Definition at line 633 of file at32f415_usb.h.

◆ dpid

__IO uint32_t otg_global_type::dpid

Definition at line 649 of file at32f415_usb.h.

◆ enumdone

__IO uint32_t otg_global_type::enumdone

Definition at line 579 of file at32f415_usb.h.

◆ enumdonemsk

__IO uint32_t otg_global_type::enumdonemsk

Definition at line 619 of file at32f415_usb.h.

◆ eopf

__IO uint32_t otg_global_type::eopf

Definition at line 581 of file at32f415_usb.h.

◆ eopfmsk

__IO uint32_t otg_global_type::eopfmsk

Definition at line 621 of file at32f415_usb.h.

◆ eptnum

__IO uint32_t otg_global_type::eptnum

Definition at line 647 of file at32f415_usb.h.

◆ erlysusp

__IO uint32_t otg_global_type::erlysusp

Definition at line 576 of file at32f415_usb.h.

◆ erlysuspmsk

__IO uint32_t otg_global_type::erlysuspmsk

Definition at line 616 of file at32f415_usb.h.

◆ fdevmode

__IO uint32_t otg_global_type::fdevmode

Definition at line 534 of file at32f415_usb.h.

Referenced by usb_global_set_mode().

◆ fhstmode

__IO uint32_t otg_global_type::fhstmode

Definition at line 533 of file at32f415_usb.h.

Referenced by usb_global_set_mode().

◆ fn

__IO uint32_t otg_global_type::fn

Definition at line 651 of file at32f415_usb.h.

◆ frmcntrst

__IO uint32_t otg_global_type::frmcntrst

Definition at line 549 of file at32f415_usb.h.

◆ gahbcfg

__IO uint32_t otg_global_type::gahbcfg

Definition at line 510 of file at32f415_usb.h.

◆

struct { ... } otg_global_type::gahbcfg_bit

Referenced by usb_host_disable(), usb_interrupt_disable(), and usb_interrupt_enable().

◆ gccfg

__IO uint32_t otg_global_type::gccfg

Definition at line 719 of file at32f415_usb.h.

◆

struct { ... } otg_global_type::gccfg_bit

Referenced by usb_global_init(), and usb_global_power_on().

◆ ginnakeff

__IO uint32_t otg_global_type::ginnakeff

Definition at line 573 of file at32f415_usb.h.

◆ ginnakeffmsk

__IO uint32_t otg_global_type::ginnakeffmsk

Definition at line 613 of file at32f415_usb.h.

◆ gintmsk

__IO uint32_t otg_global_type::gintmsk

Definition at line 604 of file at32f415_usb.h.

Referenced by usb_global_get_all_interrupt(), usb_global_interrupt_enable(), usbd_core_init(), and usbh_core_init().

◆

struct { ... } otg_global_type::gintmsk_bit

Referenced by usb_hc_enable(), usbh_in_out_request(), and usbh_rx_qlvl_handler().

◆ gintsts

__IO uint32_t otg_global_type::gintsts

Definition at line 564 of file at32f415_usb.h.

Referenced by usb_global_clear_interrupt(), usb_global_get_all_interrupt(), usb_host_disable(), usbd_core_init(), and usbh_core_init().

◆

struct { ... } otg_global_type::gintsts_bit

Referenced by usbd_irq_handler(), and usbh_irq_handler().

◆ glbintmsk

__IO uint32_t otg_global_type::glbintmsk

Definition at line 513 of file at32f415_usb.h.

Referenced by usb_host_disable(), usb_interrupt_disable(), and usb_interrupt_enable().

◆ gnptxfsiz_ept0tx

__IO uint32_t otg_global_type::gnptxfsiz_ept0tx

Definition at line 690 of file at32f415_usb.h.

Referenced by usb_set_tx_fifo().

◆

struct { ... } otg_global_type::gnptxfsiz_ept0tx_bit

Referenced by usb_set_tx_fifo(), and usbh_core_init().

◆ gnptxsts

__IO uint32_t otg_global_type::gnptxsts

Definition at line 703 of file at32f415_usb.h.

Referenced by usb_hch_halt().

◆

struct { ... } otg_global_type::gnptxsts_bit

Referenced by usbh_in_out_request().

◆ gotgctrl

__IO uint32_t otg_global_type::gotgctrl

Definition at line 479 of file at32f415_usb.h.

◆

struct { ... } otg_global_type::gotgctrl_bit

◆ gotgint

__IO uint32_t otg_global_type::gotgint

Definition at line 495 of file at32f415_usb.h.

◆

struct { ... } otg_global_type::gotgint_bit

◆ goutnakeff

__IO uint32_t otg_global_type::goutnakeff

Definition at line 574 of file at32f415_usb.h.

◆ goutnakeffmsk

__IO uint32_t otg_global_type::goutnakeffmsk

Definition at line 614 of file at32f415_usb.h.

◆ grstctl

__IO uint32_t otg_global_type::grstctl

Definition at line 544 of file at32f415_usb.h.

◆

struct { ... } otg_global_type::grstctl_bit

Referenced by usb_flush_rx_fifo(), usb_flush_tx_fifo(), usb_global_power_on(), and usb_global_reset().

◆ grxfsiz

__IO uint32_t otg_global_type::grxfsiz

Definition at line 677 of file at32f415_usb.h.

Referenced by usb_set_rx_fifo(), usb_set_tx_fifo(), and usbh_core_init().

◆

struct { ... } otg_global_type::grxfsiz_bit

◆ grxstsp

__IO uint32_t otg_global_type::grxstsp

Definition at line 661 of file at32f415_usb.h.

Referenced by usbd_rxflvl_handler(), and usbh_rx_qlvl_handler().

◆

struct { ... } otg_global_type::grxstsp_bit

◆ grxstsr

__IO uint32_t otg_global_type::grxstsr

Definition at line 644 of file at32f415_usb.h.

◆

struct { ... } otg_global_type::grxstsr_bit

◆ guid

__IO uint32_t otg_global_type::guid

Definition at line 749 of file at32f415_usb.h.

◆

struct { ... } otg_global_type::guid_bit

◆ gusbcfg

__IO uint32_t otg_global_type::gusbcfg

Definition at line 526 of file at32f415_usb.h.

◆

struct { ... } otg_global_type::gusbcfg_bit

Referenced by usb_global_set_mode(), and usbd_enumdone_handler().

◆ hchint

__IO uint32_t otg_global_type::hchint

Definition at line 589 of file at32f415_usb.h.

◆ hchintmsk

__IO uint32_t otg_global_type::hchintmsk

Definition at line 629 of file at32f415_usb.h.

Referenced by usb_hc_enable().

◆ hptxfsiz

__IO uint32_t otg_global_type::hptxfsiz

Definition at line 763 of file at32f415_usb.h.

◆

struct { ... } otg_global_type::hptxfsiz_bit

Referenced by usbh_core_init().

◆ ieptint

__IO uint32_t otg_global_type::ieptint

Definition at line 583 of file at32f415_usb.h.

◆ ieptintmsk

__IO uint32_t otg_global_type::ieptintmsk

Definition at line 623 of file at32f415_usb.h.

◆ incompip_incompisoout

__IO uint32_t otg_global_type::incompip_incompisoout

Definition at line 586 of file at32f415_usb.h.

◆ incompip_incompisooutmsk

__IO uint32_t otg_global_type::incompip_incompisooutmsk

Definition at line 626 of file at32f415_usb.h.

◆ incompisoin

__IO uint32_t otg_global_type::incompisoin

Definition at line 585 of file at32f415_usb.h.

◆ incompisoinmsk

__IO uint32_t otg_global_type::incompisoinmsk

Definition at line 625 of file at32f415_usb.h.

◆ ineptxfdep

__IO uint32_t otg_global_type::ineptxfdep

Definition at line 780 of file at32f415_usb.h.

Referenced by usb_set_tx_fifo().

◆ ineptxfstaddr

__IO uint32_t otg_global_type::ineptxfstaddr

Definition at line 779 of file at32f415_usb.h.

◆ isooutdrop

__IO uint32_t otg_global_type::isooutdrop

Definition at line 580 of file at32f415_usb.h.

◆ isooutdropmsk

__IO uint32_t otg_global_type::isooutdropmsk

Definition at line 620 of file at32f415_usb.h.

◆ modemis

__IO uint32_t otg_global_type::modemis

Definition at line 568 of file at32f415_usb.h.

◆ modemismsk

__IO uint32_t otg_global_type::modemismsk

Definition at line 608 of file at32f415_usb.h.

◆ nptxfdep

__IO uint32_t otg_global_type::nptxfdep

Definition at line 694 of file at32f415_usb.h.

Referenced by usb_set_tx_fifo(), and usbh_core_init().

◆ nptxfemp

__IO uint32_t otg_global_type::nptxfemp

Definition at line 572 of file at32f415_usb.h.

◆ nptxfemplvl

__IO uint32_t otg_global_type::nptxfemplvl

Definition at line 515 of file at32f415_usb.h.

◆ nptxfempmsk

__IO uint32_t otg_global_type::nptxfempmsk

Definition at line 612 of file at32f415_usb.h.

Referenced by usbh_in_out_request().

◆ nptxfspcavail

__IO uint32_t otg_global_type::nptxfspcavail

Definition at line 706 of file at32f415_usb.h.

Referenced by usbh_in_out_request().

◆ nptxfstaddr

__IO uint32_t otg_global_type::nptxfstaddr

Definition at line 693 of file at32f415_usb.h.

Referenced by usbh_core_init().

◆ nptxqspcavail

__IO uint32_t otg_global_type::nptxqspcavail

Definition at line 707 of file at32f415_usb.h.

◆ nptxqtop

__IO uint32_t otg_global_type::nptxqtop

Definition at line 708 of file at32f415_usb.h.

◆ oeptint

__IO uint32_t otg_global_type::oeptint

Definition at line 584 of file at32f415_usb.h.

◆ oeptintmsk

__IO uint32_t otg_global_type::oeptintmsk

Definition at line 624 of file at32f415_usb.h.

◆ otgint

__IO uint32_t otg_global_type::otgint

Definition at line 569 of file at32f415_usb.h.

◆ otgintmsk

__IO uint32_t otg_global_type::otgintmsk

Definition at line 609 of file at32f415_usb.h.

◆ piusftrst

__IO uint32_t otg_global_type::piusftrst

Definition at line 548 of file at32f415_usb.h.

◆ pktsts

__IO uint32_t otg_global_type::pktsts

Definition at line 650 of file at32f415_usb.h.

◆ prtint

__IO uint32_t otg_global_type::prtint

Definition at line 588 of file at32f415_usb.h.

◆ prtintmsk

__IO uint32_t otg_global_type::prtintmsk

Definition at line 628 of file at32f415_usb.h.

◆ ptxfemp

__IO uint32_t otg_global_type::ptxfemp

Definition at line 590 of file at32f415_usb.h.

◆ ptxfemplvl

__IO uint32_t otg_global_type::ptxfemplvl

Definition at line 516 of file at32f415_usb.h.

◆ ptxfempmsk

__IO uint32_t otg_global_type::ptxfempmsk

Definition at line 630 of file at32f415_usb.h.

◆ ptxfsize

__IO uint32_t otg_global_type::ptxfsize

Definition at line 767 of file at32f415_usb.h.

Referenced by usbh_core_init().

◆ ptxfstaddr

__IO uint32_t otg_global_type::ptxfstaddr

Definition at line 766 of file at32f415_usb.h.

Referenced by usbh_core_init().

◆ pwrdown

__IO uint32_t otg_global_type::pwrdown

Definition at line 723 of file at32f415_usb.h.

Referenced by usb_global_init(), and usb_global_power_on().

◆ reserved1

__IO uint32_t otg_global_type::reserved1

Definition at line 482 of file at32f415_usb.h.

◆ reserved2

__IO uint32_t otg_global_type::reserved2

Definition at line 484 of file at32f415_usb.h.

◆ reserved3

__IO uint32_t otg_global_type::reserved3

Definition at line 486 of file at32f415_usb.h.

◆ reserved4

__IO uint32_t otg_global_type::reserved4

Definition at line 591 of file at32f415_usb.h.

◆ reserved5

__IO uint32_t otg_global_type::reserved5

Definition at line 594 of file at32f415_usb.h.

◆ reserved6

__IO uint32_t otg_global_type::reserved6

Definition at line 634 of file at32f415_usb.h.

◆ rxfdep

__IO uint32_t otg_global_type::rxfdep

Definition at line 680 of file at32f415_usb.h.

◆ rxfflsh

__IO uint32_t otg_global_type::rxfflsh

Definition at line 551 of file at32f415_usb.h.

Referenced by usb_flush_rx_fifo().

◆ rxflvl

__IO uint32_t otg_global_type::rxflvl

Definition at line 571 of file at32f415_usb.h.

◆ rxflvlmsk

__IO uint32_t otg_global_type::rxflvlmsk

Definition at line 611 of file at32f415_usb.h.

Referenced by usbh_rx_qlvl_handler().

◆ sesenddet

__IO uint32_t otg_global_type::sesenddet

Definition at line 499 of file at32f415_usb.h.

◆ sof

__IO uint32_t otg_global_type::sof

Definition at line 570 of file at32f415_usb.h.

◆ sofmsk

__IO uint32_t otg_global_type::sofmsk

Definition at line 610 of file at32f415_usb.h.

◆ sofouten

__IO uint32_t otg_global_type::sofouten

Definition at line 727 of file at32f415_usb.h.

◆ toutcal

__IO uint32_t otg_global_type::toutcal

Definition at line 529 of file at32f415_usb.h.

◆ txfflsh

__IO uint32_t otg_global_type::txfflsh

Definition at line 552 of file at32f415_usb.h.

Referenced by usb_flush_tx_fifo().

◆ txfnum

__IO uint32_t otg_global_type::txfnum

Definition at line 553 of file at32f415_usb.h.

Referenced by usb_flush_tx_fifo().

◆ usbrst

__IO uint32_t otg_global_type::usbrst

Definition at line 578 of file at32f415_usb.h.

◆ usbrstmsk

__IO uint32_t otg_global_type::usbrstmsk

Definition at line 618 of file at32f415_usb.h.

◆ usbsusp

__IO uint32_t otg_global_type::usbsusp

Definition at line 577 of file at32f415_usb.h.

◆ usbsuspmsk

__IO uint32_t otg_global_type::usbsuspmsk

Definition at line 617 of file at32f415_usb.h.

◆ usbtrdtim

__IO uint32_t otg_global_type::usbtrdtim

Definition at line 531 of file at32f415_usb.h.

Referenced by usbd_enumdone_handler().

◆ userid

__IO uint32_t otg_global_type::userid

Definition at line 752 of file at32f415_usb.h.

◆ vbusig

__IO uint32_t otg_global_type::vbusig

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

Definition at line 739 of file at32f415_usb.h.

◆ wkupint

__IO uint32_t otg_global_type::wkupint

Definition at line 595 of file at32f415_usb.h.

◆ wkupintmsk

__IO uint32_t otg_global_type::wkupintmsk

Definition at line 635 of file at32f415_usb.h.

The documentation for this struct was generated from the following file:
  • at32f415_usb.h


AT32F415 Firmwary Library: otg_host_type Struct Reference

Data Fields
otg_host_type Struct Reference
AT32F415_periph_driver » USB » USB_exported_types

#include <at32f415_usb.h>

Data Fields

union {
__IO uint32_t hcfg
struct {
__IO uint32_t fslspclksel: 2
__IO uint32_t fslssupp: 1
__IO uint32_t reserved1: 29
} hcfg_bit
};
otgfs host mode configuration register, offset:0x400 More...
union {
__IO uint32_t hfir
struct {
__IO uint32_t frint: 16
__IO uint32_t reserved1: 16
} hfir_bit
};
otgfs host frame interval register, offset:0x404 More...
union {
__IO uint32_t hfnum
struct {
__IO uint32_t frnum: 16
__IO uint32_t ftrem: 16
} hfnum_bit
};
otgfs host frame number and time remaining register, offset:0x408 More...
union {
__IO uint32_t hptxsts
struct {
__IO uint32_t ptxfspcavil: 16
__IO uint32_t ptxqspcavil: 8
__IO uint32_t ptxqtop: 8
} hptxsts_bit
};
otgfs host periodic tx fifo request queue register, offset:0x410 More...
union {
__IO uint32_t haint
struct {
__IO uint32_t haint: 16
__IO uint32_t reserved1: 16
} haint_bit
};
otgfs host all channel interrupt register, offset:0x414 More...
union {
__IO uint32_t haintmsk
struct {
__IO uint32_t haintmsk: 16
__IO uint32_t reserved1: 16
} haintmsk_bit
};
otgfs host all channel interrupt mask register, offset:0x418 More...
__IO uint32_t reserved2 [9]
union {
__IO uint32_t hprt
struct {
__IO uint32_t prtconsts: 1
__IO uint32_t prtcondet: 1
__IO uint32_t prtena: 1
__IO uint32_t prtenchng: 1
__IO uint32_t prtovrcact: 1
__IO uint32_t prtovrcchng: 1
__IO uint32_t prtres: 1
__IO uint32_t prtsusp: 1
__IO uint32_t prtrst: 1
__IO uint32_t reserved1: 1
__IO uint32_t prtlnsts: 2
__IO uint32_t prtpwr: 1
__IO uint32_t prttsctl: 4
__IO uint32_t prtspd: 2
__IO uint32_t reserved2: 13
} hprt_bit
};
otgfs host port control and status register, offset:0x440 More...

Detailed Description

Definition at line 786 of file at32f415_usb.h.

Field Documentation

◆

union { ... } otg_host_type::@724

otgfs host mode configuration register, offset:0x400

◆

union { ... } otg_host_type::@726

otgfs host frame interval register, offset:0x404

◆

union { ... } otg_host_type::@728

otgfs host frame number and time remaining register, offset:0x408

◆

union { ... } otg_host_type::@730

otgfs host periodic tx fifo request queue register, offset:0x410

◆

union { ... } otg_host_type::@732

otgfs host all channel interrupt register, offset:0x414

◆

union { ... } otg_host_type::@734

otgfs host all channel interrupt mask register, offset:0x418

◆

union { ... } otg_host_type::@736

otgfs host port control and status register, offset:0x440

◆ frint

__IO uint32_t otg_host_type::frint

Definition at line 810 of file at32f415_usb.h.

◆ frnum

__IO uint32_t otg_host_type::frnum

Definition at line 823 of file at32f415_usb.h.

◆ fslspclksel

__IO uint32_t otg_host_type::fslspclksel

Definition at line 796 of file at32f415_usb.h.

Referenced by usbh_fsls_clksel().

◆ fslssupp

__IO uint32_t otg_host_type::fslssupp

Definition at line 797 of file at32f415_usb.h.

Referenced by usbh_core_init().

◆ ftrem

__IO uint32_t otg_host_type::ftrem

Definition at line 824 of file at32f415_usb.h.

◆ haint

__IO uint32_t otg_host_type::haint

Definition at line 849 of file at32f415_usb.h.

Referenced by usb_hch_read_interrupt(), usb_host_disable(), and usbh_hch_handler().

◆

struct { ... } otg_host_type::haint_bit

◆ haintmsk

__IO uint32_t otg_host_type::haintmsk

Definition at line 862 of file at32f415_usb.h.

Referenced by usb_hc_enable().

◆

struct { ... } otg_host_type::haintmsk_bit

◆ hcfg

__IO uint32_t otg_host_type::hcfg

Definition at line 793 of file at32f415_usb.h.

◆

struct { ... } otg_host_type::hcfg_bit

Referenced by usbh_core_init(), and usbh_fsls_clksel().

◆ hfir

__IO uint32_t otg_host_type::hfir

Definition at line 807 of file at32f415_usb.h.

Referenced by usbh_fsls_clksel().

◆

struct { ... } otg_host_type::hfir_bit

◆ hfnum

__IO uint32_t otg_host_type::hfnum

Definition at line 820 of file at32f415_usb.h.

Referenced by usbh_get_frame().

◆

struct { ... } otg_host_type::hfnum_bit

◆ hprt

__IO uint32_t otg_host_type::hprt

Definition at line 877 of file at32f415_usb.h.

Referenced by usb_port_power_on(), usbh_disconnect_handler(), usbh_enter_suspend(), usbh_port_handler(), usbh_reset_port(), and usbh_resume().

◆

struct { ... } otg_host_type::hprt_bit

◆ hptxsts

__IO uint32_t otg_host_type::hptxsts

Definition at line 835 of file at32f415_usb.h.

Referenced by usb_hch_halt().

◆

struct { ... } otg_host_type::hptxsts_bit

◆ prtcondet

__IO uint32_t otg_host_type::prtcondet

Definition at line 881 of file at32f415_usb.h.

◆ prtconsts

__IO uint32_t otg_host_type::prtconsts

Definition at line 880 of file at32f415_usb.h.

◆ prtena

__IO uint32_t otg_host_type::prtena

Definition at line 882 of file at32f415_usb.h.

◆ prtenchng

__IO uint32_t otg_host_type::prtenchng

Definition at line 883 of file at32f415_usb.h.

◆ prtlnsts

__IO uint32_t otg_host_type::prtlnsts

Definition at line 890 of file at32f415_usb.h.

◆ prtovrcact

__IO uint32_t otg_host_type::prtovrcact

Definition at line 884 of file at32f415_usb.h.

◆ prtovrcchng

__IO uint32_t otg_host_type::prtovrcchng

Definition at line 885 of file at32f415_usb.h.

◆ prtpwr

__IO uint32_t otg_host_type::prtpwr

Definition at line 891 of file at32f415_usb.h.

◆ prtres

__IO uint32_t otg_host_type::prtres

Definition at line 886 of file at32f415_usb.h.

◆ prtrst

__IO uint32_t otg_host_type::prtrst

Definition at line 888 of file at32f415_usb.h.

◆ prtspd

__IO uint32_t otg_host_type::prtspd

Definition at line 893 of file at32f415_usb.h.

◆ prtsusp

__IO uint32_t otg_host_type::prtsusp

Definition at line 887 of file at32f415_usb.h.

◆ prttsctl

__IO uint32_t otg_host_type::prttsctl

Definition at line 892 of file at32f415_usb.h.

◆ ptxfspcavil

__IO uint32_t otg_host_type::ptxfspcavil

Definition at line 838 of file at32f415_usb.h.

◆ ptxqspcavil

__IO uint32_t otg_host_type::ptxqspcavil

Definition at line 839 of file at32f415_usb.h.

◆ ptxqtop

__IO uint32_t otg_host_type::ptxqtop

Definition at line 840 of file at32f415_usb.h.

◆ reserved1

__IO uint32_t otg_host_type::reserved1

Definition at line 798 of file at32f415_usb.h.

◆ reserved2

__IO uint32_t otg_host_type::reserved2

Definition at line 870 of file at32f415_usb.h.

The documentation for this struct was generated from the following file:
  • at32f415_usb.h


AT32F415 Firmwary Library: otg_hchannel_type Struct Reference

Data Fields
otg_hchannel_type Struct Reference
AT32F415_periph_driver » USB » USB_exported_types

#include <at32f415_usb.h>

Data Fields

union {
__IO uint32_t hcchar
struct {
__IO uint32_t mps: 11
__IO uint32_t eptnum: 4
__IO uint32_t eptdir: 1
__IO uint32_t reserved1: 1
__IO uint32_t lspddev: 1
__IO uint32_t eptype: 2
__IO uint32_t mc: 2
__IO uint32_t devaddr: 7
__IO uint32_t oddfrm: 1
__IO uint32_t chdis: 1
__IO uint32_t chena: 1
} hcchar_bit
};
otgfs host channel x characterisic register, offset:0x500 More...
union {
__IO uint32_t hcsplt
struct {
__IO uint32_t prtaddr: 7
__IO uint32_t hubaddr: 7
__IO uint32_t xactpos: 2
__IO uint32_t compsplt: 1
__IO uint32_t reserved1: 14
__IO uint32_t spltena: 1
} hcsplt_bit
};
otgfs host channel split control register, offset:0x504 More...
union {
__IO uint32_t hcint
struct {
__IO uint32_t xferc: 1
__IO uint32_t chhltd: 1
__IO uint32_t reserved1: 1
__IO uint32_t stall: 1
__IO uint32_t nak: 1
__IO uint32_t ack: 1
__IO uint32_t reserved2: 1
__IO uint32_t xacterr: 1
__IO uint32_t bblerr: 1
__IO uint32_t frmovrun: 1
__IO uint32_t dtglerr: 1
__IO uint32_t reserved3: 21
} hcint_bit
};
otgfs host channel interrupt register, offset:0x508 More...
union {
__IO uint32_t hcintmsk
struct {
__IO uint32_t xfercmsk: 1
__IO uint32_t chhltdmsk: 1
__IO uint32_t reserved1: 1
__IO uint32_t stallmsk: 1
__IO uint32_t nakmsk: 1
__IO uint32_t ackmsk: 1
__IO uint32_t reserved2: 1
__IO uint32_t xacterrmsk: 1
__IO uint32_t bblerrmsk: 1
__IO uint32_t frmovrunmsk: 1
__IO uint32_t dtglerrmsk: 1
__IO uint32_t reserved3: 21
} hcintmsk_bit
};
otgfs host channel interrupt mask register, offset:0x50C More...
union {
__IO uint32_t hctsiz
struct {
__IO uint32_t xfersize: 19
__IO uint32_t pktcnt: 10
__IO uint32_t pid: 2
__IO uint32_t reserved1: 1
} hctsiz_bit
};
otgfs host channel transfer size register, offset:0x510 More...

Detailed Description

Definition at line 900 of file at32f415_usb.h.

Field Documentation

◆

union { ... } otg_hchannel_type::@745

otgfs host channel x characterisic register, offset:0x500

◆

union { ... } otg_hchannel_type::@747

otgfs host channel split control register, offset:0x504

◆

union { ... } otg_hchannel_type::@749

otgfs host channel interrupt register, offset:0x508

◆

union { ... } otg_hchannel_type::@751

otgfs host channel interrupt mask register, offset:0x50C

◆

union { ... } otg_hchannel_type::@753

otgfs host channel transfer size register, offset:0x510

◆ ack

__IO uint32_t otg_hchannel_type::ack

Definition at line 954 of file at32f415_usb.h.

◆ ackmsk

__IO uint32_t otg_hchannel_type::ackmsk

Definition at line 977 of file at32f415_usb.h.

◆ bblerr

__IO uint32_t otg_hchannel_type::bblerr

Definition at line 957 of file at32f415_usb.h.

◆ bblerrmsk

__IO uint32_t otg_hchannel_type::bblerrmsk

Definition at line 980 of file at32f415_usb.h.

Referenced by usb_hc_enable().

◆ chdis

__IO uint32_t otg_hchannel_type::chdis

Definition at line 919 of file at32f415_usb.h.

Referenced by usb_hch_halt(), usb_host_disable(), usbh_hch_in_handler(), usbh_hch_out_handler(), and usbh_rx_qlvl_handler().

◆ chena

__IO uint32_t otg_hchannel_type::chena

Definition at line 920 of file at32f415_usb.h.

Referenced by usb_hch_halt(), usb_host_disable(), usbh_hch_in_handler(), usbh_hch_out_handler(), and usbh_rx_qlvl_handler().

◆ chhltd

__IO uint32_t otg_hchannel_type::chhltd

Definition at line 950 of file at32f415_usb.h.

◆ chhltdmsk

__IO uint32_t otg_hchannel_type::chhltdmsk

Definition at line 973 of file at32f415_usb.h.

Referenced by usbh_hch_in_handler(), and usbh_hch_out_handler().

◆ compsplt

__IO uint32_t otg_hchannel_type::compsplt

Definition at line 935 of file at32f415_usb.h.

◆ devaddr

__IO uint32_t otg_hchannel_type::devaddr

Definition at line 917 of file at32f415_usb.h.

Referenced by usb_hc_enable().

◆ dtglerr

__IO uint32_t otg_hchannel_type::dtglerr

Definition at line 959 of file at32f415_usb.h.

◆ dtglerrmsk

__IO uint32_t otg_hchannel_type::dtglerrmsk

Definition at line 982 of file at32f415_usb.h.

◆ eptdir

__IO uint32_t otg_hchannel_type::eptdir

Definition at line 912 of file at32f415_usb.h.

Referenced by usb_hc_enable(), usb_hch_halt(), and usb_host_disable().

◆ eptnum

__IO uint32_t otg_hchannel_type::eptnum

Definition at line 911 of file at32f415_usb.h.

Referenced by usb_hc_enable().

◆ eptype

__IO uint32_t otg_hchannel_type::eptype

Definition at line 915 of file at32f415_usb.h.

Referenced by usb_hc_enable(), usb_hch_halt(), and usbh_hch_in_handler().

◆ frmovrun

__IO uint32_t otg_hchannel_type::frmovrun

Definition at line 958 of file at32f415_usb.h.

◆ frmovrunmsk

__IO uint32_t otg_hchannel_type::frmovrunmsk

Definition at line 981 of file at32f415_usb.h.

◆ hcchar

__IO uint32_t otg_hchannel_type::hcchar

Definition at line 907 of file at32f415_usb.h.

Referenced by usbh_in_out_request().

◆

struct { ... } otg_hchannel_type::hcchar_bit

Referenced by usb_hc_enable(), usb_hch_halt(), usb_host_disable(), usbh_hch_in_handler(), usbh_hch_out_handler(), usbh_in_out_request(), and usbh_rx_qlvl_handler().

◆ hcint

__IO uint32_t otg_hchannel_type::hcint

Definition at line 946 of file at32f415_usb.h.

Referenced by usbh_hch_in_handler(), and usbh_hch_out_handler().

◆

struct { ... } otg_hchannel_type::hcint_bit

◆ hcintmsk

__IO uint32_t otg_hchannel_type::hcintmsk

Definition at line 969 of file at32f415_usb.h.

Referenced by usb_hc_enable(), usbh_hch_in_handler(), and usbh_hch_out_handler().

◆

struct { ... } otg_hchannel_type::hcintmsk_bit

Referenced by usb_hc_enable(), usbh_hch_in_handler(), and usbh_hch_out_handler().

◆ hcsplt

__IO uint32_t otg_hchannel_type::hcsplt

Definition at line 929 of file at32f415_usb.h.

◆

struct { ... } otg_hchannel_type::hcsplt_bit

◆ hctsiz

__IO uint32_t otg_hchannel_type::hctsiz

Definition at line 992 of file at32f415_usb.h.

Referenced by usbh_in_out_request().

◆

struct { ... } otg_hchannel_type::hctsiz_bit

Referenced by usbh_rx_qlvl_handler().

◆ hubaddr

__IO uint32_t otg_hchannel_type::hubaddr

Definition at line 933 of file at32f415_usb.h.

◆ lspddev

__IO uint32_t otg_hchannel_type::lspddev

Definition at line 914 of file at32f415_usb.h.

Referenced by usb_hc_enable().

◆ mc

__IO uint32_t otg_hchannel_type::mc

Definition at line 916 of file at32f415_usb.h.

◆ mps

__IO uint32_t otg_hchannel_type::mps

Definition at line 910 of file at32f415_usb.h.

Referenced by usb_hc_enable().

◆ nak

__IO uint32_t otg_hchannel_type::nak

Definition at line 953 of file at32f415_usb.h.

◆ nakmsk

__IO uint32_t otg_hchannel_type::nakmsk

Definition at line 976 of file at32f415_usb.h.

◆ oddfrm

__IO uint32_t otg_hchannel_type::oddfrm

Definition at line 918 of file at32f415_usb.h.

Referenced by usb_hc_enable(), usbh_hch_in_handler(), and usbh_in_out_request().

◆ pid

__IO uint32_t otg_hchannel_type::pid

Definition at line 997 of file at32f415_usb.h.

◆ pktcnt

__IO uint32_t otg_hchannel_type::pktcnt

Definition at line 996 of file at32f415_usb.h.

Referenced by usbh_rx_qlvl_handler().

◆ prtaddr

__IO uint32_t otg_hchannel_type::prtaddr

Definition at line 932 of file at32f415_usb.h.

◆ reserved1

__IO uint32_t otg_hchannel_type::reserved1

Definition at line 913 of file at32f415_usb.h.

◆ reserved2

__IO uint32_t otg_hchannel_type::reserved2

Definition at line 955 of file at32f415_usb.h.

◆ reserved3

__IO uint32_t otg_hchannel_type::reserved3

Definition at line 960 of file at32f415_usb.h.

◆ spltena

__IO uint32_t otg_hchannel_type::spltena

Definition at line 937 of file at32f415_usb.h.

◆ stall

__IO uint32_t otg_hchannel_type::stall

Definition at line 952 of file at32f415_usb.h.

◆ stallmsk

__IO uint32_t otg_hchannel_type::stallmsk

Definition at line 975 of file at32f415_usb.h.

◆ xacterr

__IO uint32_t otg_hchannel_type::xacterr

Definition at line 956 of file at32f415_usb.h.

◆ xacterrmsk

__IO uint32_t otg_hchannel_type::xacterrmsk

Definition at line 979 of file at32f415_usb.h.

◆ xactpos

__IO uint32_t otg_hchannel_type::xactpos

Definition at line 934 of file at32f415_usb.h.

◆ xferc

__IO uint32_t otg_hchannel_type::xferc

Definition at line 949 of file at32f415_usb.h.

◆ xfercmsk

__IO uint32_t otg_hchannel_type::xfercmsk

Definition at line 972 of file at32f415_usb.h.

◆ xfersize

__IO uint32_t otg_hchannel_type::xfersize

Definition at line 995 of file at32f415_usb.h.

The documentation for this struct was generated from the following file:
  • at32f415_usb.h


AT32F415 Firmwary Library: otg_device_type Struct Reference

Data Fields
otg_device_type Struct Reference
AT32F415_periph_driver » USB » USB_exported_types

#include <at32f415_usb.h>

Data Fields

union {
__IO uint32_t dcfg
struct {
__IO uint32_t devspd: 2
__IO uint32_t nzstsouthshk: 1
__IO uint32_t reserved1: 1
__IO uint32_t devaddr: 7
__IO uint32_t perfrint: 2
__IO uint32_t reserved2: 19
} dcfg_bit
};
otgfs device configuration register, offset:0x800 More...
union {
__IO uint32_t dctl
struct {
__IO uint32_t rwkupsig: 1
__IO uint32_t sftdiscon: 1
__IO uint32_t gnpinnaksts: 1
__IO uint32_t goutnaksts: 1
__IO uint32_t tstctl: 3
__IO uint32_t sgnpinak: 1
__IO uint32_t cgnpinak: 1
__IO uint32_t sgoutnak: 1
__IO uint32_t cgoutnak: 1
__IO uint32_t pwroprgdne: 1
__IO uint32_t reserved1: 20
} dctl_bit
};
otgfs device controls register, offset:0x804 More...
union {
__IO uint32_t dsts
struct {
__IO uint32_t suspsts: 1
__IO uint32_t enumspd: 2
__IO uint32_t eticerr: 1
__IO uint32_t reserved1: 4
__IO uint32_t soffn: 14
__IO uint32_t reserved2: 10
} dsts_bit
};
otgfs device status register, offset:0x80C More...
union {
__IO uint32_t diepmsk
struct {
__IO uint32_t xfercmsk: 1
__IO uint32_t eptdismsk: 1
__IO uint32_t reserved1: 1
__IO uint32_t timeoutmsk: 1
__IO uint32_t intkntxfempmsk: 1
__IO uint32_t intkneptmismsk: 1
__IO uint32_t ineptnakmsk: 1
__IO uint32_t reserved2: 1
__IO uint32_t txfifoudrmsk: 1
__IO uint32_t bnainmsk: 1
__IO uint32_t reserved3: 22
} diepmsk_bit
};
otgfs device in endpoint general interrupt mask register, offset:0x810 More...
union {
__IO uint32_t doepmsk
struct {
__IO uint32_t xfercmsk: 1
__IO uint32_t eptdismsk: 1
__IO uint32_t reserved1: 1
__IO uint32_t setupmsk: 1
__IO uint32_t outtepdmsk: 1
__IO uint32_t reserved2: 1
__IO uint32_t b2bsetupmsk: 1
__IO uint32_t reserved3: 1
__IO uint32_t outperrmsk: 1
__IO uint32_t bnaoutmsk: 1
__IO uint32_t reserved4: 22
} doepmsk_bit
};
otgfs device out endpoint general interrupt mask register, offset:0x814 More...
union {
__IO uint32_t daint
struct {
__IO uint32_t ineptint: 16
__IO uint32_t outeptint: 16
} daint_bit
};
otgfs device all endpoint interrupt register, offset:0x818 More...
union {
__IO uint32_t daintmsk
struct {
__IO uint32_t ineptmsk: 16
__IO uint32_t outeptmsk: 16
} daintmsk_bit
};
otgfs device all endpoint interrupt mask register, offset:0x81C More...
union {
__IO uint32_t diepempmsk
struct {
__IO uint32_t ineptxfemsk: 16
__IO uint32_t reserved1: 16
} diepempmsk_bit
};
otgfs device in endpoint fifo empty interrupt mask register, offset:0x834 More...

Detailed Description

Definition at line 1006 of file at32f415_usb.h.

Field Documentation

◆

union { ... } otg_device_type::@760

otgfs device configuration register, offset:0x800

◆

union { ... } otg_device_type::@762

otgfs device controls register, offset:0x804

◆

union { ... } otg_device_type::@764

otgfs device status register, offset:0x80C

◆

union { ... } otg_device_type::@766

otgfs device in endpoint general interrupt mask register, offset:0x810

◆

union { ... } otg_device_type::@768

otgfs device out endpoint general interrupt mask register, offset:0x814

◆

union { ... } otg_device_type::@770

otgfs device all endpoint interrupt register, offset:0x818

◆

union { ... } otg_device_type::@772

otgfs device all endpoint interrupt mask register, offset:0x81C

◆

union { ... } otg_device_type::@774

otgfs device in endpoint fifo empty interrupt mask register, offset:0x834

◆ b2bsetupmsk

__IO uint32_t otg_device_type::b2bsetupmsk

Definition at line 1101 of file at32f415_usb.h.

◆ bnainmsk

__IO uint32_t otg_device_type::bnainmsk

Definition at line 1082 of file at32f415_usb.h.

◆ bnaoutmsk

__IO uint32_t otg_device_type::bnaoutmsk

Definition at line 1104 of file at32f415_usb.h.

◆ cgnpinak

__IO uint32_t otg_device_type::cgnpinak

Definition at line 1039 of file at32f415_usb.h.

◆ cgoutnak

__IO uint32_t otg_device_type::cgoutnak

Definition at line 1041 of file at32f415_usb.h.

◆ daint

__IO uint32_t otg_device_type::daint

Definition at line 1114 of file at32f415_usb.h.

Referenced by usbd_core_init(), and usbd_reset_handler().

◆

struct { ... } otg_device_type::daint_bit

◆ daintmsk

__IO uint32_t otg_device_type::daintmsk

Definition at line 1127 of file at32f415_usb.h.

Referenced by usbd_core_init(), and usbd_reset_handler().

◆

struct { ... } otg_device_type::daintmsk_bit

◆ dcfg

__IO uint32_t otg_device_type::dcfg

Definition at line 1013 of file at32f415_usb.h.

◆

struct { ... } otg_device_type::dcfg_bit

Referenced by usbd_core_init().

◆ dctl

__IO uint32_t otg_device_type::dctl

Definition at line 1030 of file at32f415_usb.h.

◆

struct { ... } otg_device_type::dctl_bit

Referenced by usbd_reset_handler().

◆ devaddr

__IO uint32_t otg_device_type::devaddr

Definition at line 1019 of file at32f415_usb.h.

◆ devspd

__IO uint32_t otg_device_type::devspd

Definition at line 1016 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆ diepempmsk

__IO uint32_t otg_device_type::diepempmsk

Definition at line 1142 of file at32f415_usb.h.

Referenced by usbd_ept_send().

◆

struct { ... } otg_device_type::diepempmsk_bit

◆ diepmsk

__IO uint32_t otg_device_type::diepmsk

Definition at line 1070 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆

struct { ... } otg_device_type::diepmsk_bit

Referenced by usbd_core_init(), and usbd_reset_handler().

◆ doepmsk

__IO uint32_t otg_device_type::doepmsk

Definition at line 1092 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆

struct { ... } otg_device_type::doepmsk_bit

Referenced by usbd_reset_handler().

◆ dsts

__IO uint32_t otg_device_type::dsts

Definition at line 1052 of file at32f415_usb.h.

◆

struct { ... } otg_device_type::dsts_bit

Referenced by usbd_ept_recv(), and usbd_ept_send().

◆ enumspd

__IO uint32_t otg_device_type::enumspd

Definition at line 1056 of file at32f415_usb.h.

◆ eptdismsk

__IO uint32_t otg_device_type::eptdismsk

Definition at line 1074 of file at32f415_usb.h.

Referenced by usbd_reset_handler().

◆ eticerr

__IO uint32_t otg_device_type::eticerr

Definition at line 1057 of file at32f415_usb.h.

◆ gnpinnaksts

__IO uint32_t otg_device_type::gnpinnaksts

Definition at line 1035 of file at32f415_usb.h.

◆ goutnaksts

__IO uint32_t otg_device_type::goutnaksts

Definition at line 1036 of file at32f415_usb.h.

◆ ineptint

__IO uint32_t otg_device_type::ineptint

Definition at line 1117 of file at32f415_usb.h.

◆ ineptmsk

__IO uint32_t otg_device_type::ineptmsk

Definition at line 1130 of file at32f415_usb.h.

◆ ineptnakmsk

__IO uint32_t otg_device_type::ineptnakmsk

Definition at line 1079 of file at32f415_usb.h.

◆ ineptxfemsk

__IO uint32_t otg_device_type::ineptxfemsk

Definition at line 1145 of file at32f415_usb.h.

◆ intkneptmismsk

__IO uint32_t otg_device_type::intkneptmismsk

Definition at line 1078 of file at32f415_usb.h.

◆ intkntxfempmsk

__IO uint32_t otg_device_type::intkntxfempmsk

Definition at line 1077 of file at32f415_usb.h.

◆ nzstsouthshk

__IO uint32_t otg_device_type::nzstsouthshk

Definition at line 1017 of file at32f415_usb.h.

◆ outeptint

__IO uint32_t otg_device_type::outeptint

Definition at line 1118 of file at32f415_usb.h.

◆ outeptmsk

__IO uint32_t otg_device_type::outeptmsk

Definition at line 1131 of file at32f415_usb.h.

◆ outperrmsk

__IO uint32_t otg_device_type::outperrmsk

Definition at line 1103 of file at32f415_usb.h.

◆ outtepdmsk

__IO uint32_t otg_device_type::outtepdmsk

Definition at line 1099 of file at32f415_usb.h.

◆ perfrint

__IO uint32_t otg_device_type::perfrint

Definition at line 1020 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆ pwroprgdne

__IO uint32_t otg_device_type::pwroprgdne

Definition at line 1042 of file at32f415_usb.h.

◆ reserved1

__IO uint32_t otg_device_type::reserved1

Definition at line 1018 of file at32f415_usb.h.

◆ reserved2

__IO uint32_t otg_device_type::reserved2

Definition at line 1021 of file at32f415_usb.h.

◆ reserved3

__IO uint32_t otg_device_type::reserved3

Definition at line 1083 of file at32f415_usb.h.

◆ reserved4

__IO uint32_t otg_device_type::reserved4

Definition at line 1105 of file at32f415_usb.h.

◆ rwkupsig

__IO uint32_t otg_device_type::rwkupsig

Definition at line 1033 of file at32f415_usb.h.

Referenced by usbd_reset_handler().

◆ setupmsk

__IO uint32_t otg_device_type::setupmsk

Definition at line 1098 of file at32f415_usb.h.

Referenced by usbd_reset_handler().

◆ sftdiscon

__IO uint32_t otg_device_type::sftdiscon

Definition at line 1034 of file at32f415_usb.h.

◆ sgnpinak

__IO uint32_t otg_device_type::sgnpinak

Definition at line 1038 of file at32f415_usb.h.

◆ sgoutnak

__IO uint32_t otg_device_type::sgoutnak

Definition at line 1040 of file at32f415_usb.h.

◆ soffn

__IO uint32_t otg_device_type::soffn

Definition at line 1059 of file at32f415_usb.h.

Referenced by usbd_ept_recv(), and usbd_ept_send().

◆ suspsts

__IO uint32_t otg_device_type::suspsts

Definition at line 1055 of file at32f415_usb.h.

◆ timeoutmsk

__IO uint32_t otg_device_type::timeoutmsk

Definition at line 1076 of file at32f415_usb.h.

Referenced by usbd_reset_handler().

◆ tstctl

__IO uint32_t otg_device_type::tstctl

Definition at line 1037 of file at32f415_usb.h.

◆ txfifoudrmsk

__IO uint32_t otg_device_type::txfifoudrmsk

Definition at line 1081 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆ xfercmsk

__IO uint32_t otg_device_type::xfercmsk

Definition at line 1073 of file at32f415_usb.h.

Referenced by usbd_reset_handler().

The documentation for this struct was generated from the following file:
  • at32f415_usb.h


AT32F415 Firmwary Library: otg_eptin_type Struct Reference

Data Fields
otg_eptin_type Struct Reference
AT32F415_periph_driver » USB » USB_exported_types

#include <at32f415_usb.h>

Data Fields

union {
__IO uint32_t diepctl
struct {
__IO uint32_t mps: 11
__IO uint32_t reserved1: 4
__IO uint32_t usbacept: 1
__IO uint32_t dpid: 1
__IO uint32_t naksts: 1
__IO uint32_t eptype: 2
__IO uint32_t reserved2: 1
__IO uint32_t stall: 1
__IO uint32_t txfnum: 4
__IO uint32_t cnak: 1
__IO uint32_t snak: 1
__IO uint32_t setd0pid: 1
__IO uint32_t setd1pid: 1
__IO uint32_t eptdis: 1
__IO uint32_t eptena: 1
} diepctl_bit
};
otgfs device out endpoint control register, offset:0x900 More...
union {
__IO uint32_t diepint
struct {
__IO uint32_t xferc: 1
__IO uint32_t epdisd: 1
__IO uint32_t reserved1: 1
__IO uint32_t timeout: 1
__IO uint32_t intkntxfemp: 1
__IO uint32_t reserved2: 1
__IO uint32_t ineptnak: 1
__IO uint32_t txfemp: 1
__IO uint32_t reserved3: 24
} diepint_bit
};
otgfs device in endpoint interrupt register, offset:0x908 More...
union {
__IO uint32_t dieptsiz
struct {
__IO uint32_t xfersize: 19
__IO uint32_t pktcnt: 10
__IO uint32_t mc: 2
__IO uint32_t reserved1: 1
} dieptsiz_bit
};
otgfs device in endpoint transfer size register, offset:0x910 + endpoint number * 0x20 More...
union {
__IO uint32_t dtxfsts
struct {
__IO uint32_t ineptxfsav: 16
__IO uint32_t reserved1: 16
} dtxfsts_bit
};
otgfs device in endpoint tx fifo status register, offset:0x918 + endpoint number * 0x20 More...

Detailed Description

Definition at line 1152 of file at32f415_usb.h.

Field Documentation

◆

union { ... } otg_eptin_type::@784

otgfs device out endpoint control register, offset:0x900

◆

union { ... } otg_eptin_type::@786

otgfs device in endpoint interrupt register, offset:0x908

◆

union { ... } otg_eptin_type::@788

otgfs device in endpoint transfer size register, offset:0x910 + endpoint number * 0x20

◆

union { ... } otg_eptin_type::@790

otgfs device in endpoint tx fifo status register, offset:0x918 + endpoint number * 0x20

◆ cnak

__IO uint32_t otg_eptin_type::cnak

Definition at line 1171 of file at32f415_usb.h.

Referenced by usbd_ept_send().

◆ diepctl

__IO uint32_t otg_eptin_type::diepctl

Definition at line 1159 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆

struct { ... } otg_eptin_type::diepctl_bit

Referenced by usbd_core_init(), and usbd_ept_send().

◆ diepint

__IO uint32_t otg_eptin_type::diepint

Definition at line 1186 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆

struct { ... } otg_eptin_type::diepint_bit

◆ dieptsiz

__IO uint32_t otg_eptin_type::dieptsiz

Definition at line 1207 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆

struct { ... } otg_eptin_type::dieptsiz_bit

Referenced by usbd_ept_send().

◆ dpid

__IO uint32_t otg_eptin_type::dpid

Definition at line 1165 of file at32f415_usb.h.

◆ dtxfsts

__IO uint32_t otg_eptin_type::dtxfsts

Definition at line 1224 of file at32f415_usb.h.

◆

struct { ... } otg_eptin_type::dtxfsts_bit

◆ epdisd

__IO uint32_t otg_eptin_type::epdisd

Definition at line 1190 of file at32f415_usb.h.

◆ eptdis

__IO uint32_t otg_eptin_type::eptdis

Definition at line 1175 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆ eptena

__IO uint32_t otg_eptin_type::eptena

Definition at line 1176 of file at32f415_usb.h.

Referenced by usbd_core_init(), and usbd_ept_send().

◆ eptype

__IO uint32_t otg_eptin_type::eptype

Definition at line 1167 of file at32f415_usb.h.

◆ ineptnak

__IO uint32_t otg_eptin_type::ineptnak

Definition at line 1195 of file at32f415_usb.h.

◆ ineptxfsav

__IO uint32_t otg_eptin_type::ineptxfsav

Definition at line 1227 of file at32f415_usb.h.

◆ intkntxfemp

__IO uint32_t otg_eptin_type::intkntxfemp

Definition at line 1193 of file at32f415_usb.h.

◆ mc

__IO uint32_t otg_eptin_type::mc

Definition at line 1212 of file at32f415_usb.h.

Referenced by usbd_ept_send().

◆ mps

__IO uint32_t otg_eptin_type::mps

Definition at line 1162 of file at32f415_usb.h.

◆ naksts

__IO uint32_t otg_eptin_type::naksts

Definition at line 1166 of file at32f415_usb.h.

◆ pktcnt

__IO uint32_t otg_eptin_type::pktcnt

Definition at line 1211 of file at32f415_usb.h.

Referenced by usbd_ept_send().

◆ reserved1

__IO uint32_t otg_eptin_type::reserved1

Definition at line 1163 of file at32f415_usb.h.

◆ reserved2

__IO uint32_t otg_eptin_type::reserved2

Definition at line 1168 of file at32f415_usb.h.

◆ reserved3

__IO uint32_t otg_eptin_type::reserved3

Definition at line 1197 of file at32f415_usb.h.

◆ setd0pid

__IO uint32_t otg_eptin_type::setd0pid

Definition at line 1173 of file at32f415_usb.h.

Referenced by usbd_ept_send().

◆ setd1pid

__IO uint32_t otg_eptin_type::setd1pid

Definition at line 1174 of file at32f415_usb.h.

Referenced by usbd_ept_send().

◆ snak

__IO uint32_t otg_eptin_type::snak

Definition at line 1172 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆ stall

__IO uint32_t otg_eptin_type::stall

Definition at line 1169 of file at32f415_usb.h.

◆ timeout

__IO uint32_t otg_eptin_type::timeout

Definition at line 1192 of file at32f415_usb.h.

◆ txfemp

__IO uint32_t otg_eptin_type::txfemp

Definition at line 1196 of file at32f415_usb.h.

◆ txfnum

__IO uint32_t otg_eptin_type::txfnum

Definition at line 1170 of file at32f415_usb.h.

◆ usbacept

__IO uint32_t otg_eptin_type::usbacept

Definition at line 1164 of file at32f415_usb.h.

◆ xferc

__IO uint32_t otg_eptin_type::xferc

Definition at line 1189 of file at32f415_usb.h.

◆ xfersize

__IO uint32_t otg_eptin_type::xfersize

Definition at line 1210 of file at32f415_usb.h.

Referenced by usbd_ept_send().

The documentation for this struct was generated from the following file:
  • at32f415_usb.h


AT32F415 Firmwary Library: otg_eptout_type Struct Reference

Data Fields
otg_eptout_type Struct Reference
AT32F415_periph_driver » USB » USB_exported_types

#include <at32f415_usb.h>

Data Fields

union {
__IO uint32_t doepctl
struct {
__IO uint32_t mps: 11
__IO uint32_t reserved1: 4
__IO uint32_t usbacept: 1
__IO uint32_t dpid: 1
__IO uint32_t naksts: 1
__IO uint32_t eptype: 2
__IO uint32_t snpm: 1
__IO uint32_t stall: 1
__IO uint32_t reserved2: 4
__IO uint32_t cnak: 1
__IO uint32_t snak: 1
__IO uint32_t setd0pid: 1
__IO uint32_t setd1pid: 1
__IO uint32_t eptdis: 1
__IO uint32_t eptena: 1
} doepctl_bit
};
otgfs device out endpoint control register, offset:0xb00 + endpoint number * 0x20 More...
union {
__IO uint32_t doepint
struct {
__IO uint32_t xferc: 1
__IO uint32_t epdisd: 1
__IO uint32_t reserved1: 1
__IO uint32_t setup: 1
__IO uint32_t outtepd: 1
__IO uint32_t reserved2: 1
__IO uint32_t b2pstup: 1
__IO uint32_t reserved3: 25
} doepint_bit
};
otgfs device out endpoint interrupt register, offset:0xb08 + endpoint number * 0x20 More...
union {
__IO uint32_t doeptsiz
struct {
__IO uint32_t xfersize: 19
__IO uint32_t pktcnt: 10
__IO uint32_t rxdpid_setupcnt: 2
__IO uint32_t reserved1: 1
} doeptsiz_bit
};
otgfs device out endpoint transfer size register, offset:0xb10 + endpoint number * 0x20 More...

Detailed Description

Definition at line 1234 of file at32f415_usb.h.

Field Documentation

◆

union { ... } otg_eptout_type::@796

otgfs device out endpoint control register, offset:0xb00 + endpoint number * 0x20

◆

union { ... } otg_eptout_type::@798

otgfs device out endpoint interrupt register, offset:0xb08 + endpoint number * 0x20

◆

union { ... } otg_eptout_type::@800

otgfs device out endpoint transfer size register, offset:0xb10 + endpoint number * 0x20

◆ b2pstup

__IO uint32_t otg_eptout_type::b2pstup

Definition at line 1277 of file at32f415_usb.h.

◆ cnak

__IO uint32_t otg_eptout_type::cnak

Definition at line 1253 of file at32f415_usb.h.

Referenced by usbd_ept_recv().

◆ doepctl

__IO uint32_t otg_eptout_type::doepctl

Definition at line 1241 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆

struct { ... } otg_eptout_type::doepctl_bit

Referenced by usbd_core_init(), and usbd_ept_recv().

◆ doepint

__IO uint32_t otg_eptout_type::doepint

Definition at line 1268 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆

struct { ... } otg_eptout_type::doepint_bit

◆ doeptsiz

__IO uint32_t otg_eptout_type::doeptsiz

Definition at line 1288 of file at32f415_usb.h.

Referenced by usb_ept0_start(), and usbd_core_init().

◆

struct { ... } otg_eptout_type::doeptsiz_bit

Referenced by usb_ept0_start(), and usbd_ept_recv().

◆ dpid

__IO uint32_t otg_eptout_type::dpid

Definition at line 1247 of file at32f415_usb.h.

◆ epdisd

__IO uint32_t otg_eptout_type::epdisd

Definition at line 1272 of file at32f415_usb.h.

◆ eptdis

__IO uint32_t otg_eptout_type::eptdis

Definition at line 1257 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆ eptena

__IO uint32_t otg_eptout_type::eptena

Definition at line 1258 of file at32f415_usb.h.

Referenced by usbd_core_init(), and usbd_ept_recv().

◆ eptype

__IO uint32_t otg_eptout_type::eptype

Definition at line 1249 of file at32f415_usb.h.

◆ mps

__IO uint32_t otg_eptout_type::mps

Definition at line 1244 of file at32f415_usb.h.

◆ naksts

__IO uint32_t otg_eptout_type::naksts

Definition at line 1248 of file at32f415_usb.h.

◆ outtepd

__IO uint32_t otg_eptout_type::outtepd

Definition at line 1275 of file at32f415_usb.h.

◆ pktcnt

__IO uint32_t otg_eptout_type::pktcnt

Definition at line 1292 of file at32f415_usb.h.

Referenced by usb_ept0_start(), and usbd_ept_recv().

◆ reserved1

__IO uint32_t otg_eptout_type::reserved1

Definition at line 1245 of file at32f415_usb.h.

◆ reserved2

__IO uint32_t otg_eptout_type::reserved2

Definition at line 1252 of file at32f415_usb.h.

◆ reserved3

__IO uint32_t otg_eptout_type::reserved3

Definition at line 1278 of file at32f415_usb.h.

◆ rxdpid_setupcnt

__IO uint32_t otg_eptout_type::rxdpid_setupcnt

Definition at line 1293 of file at32f415_usb.h.

Referenced by usb_ept0_start().

◆ setd0pid

__IO uint32_t otg_eptout_type::setd0pid

Definition at line 1255 of file at32f415_usb.h.

Referenced by usbd_ept_recv().

◆ setd1pid

__IO uint32_t otg_eptout_type::setd1pid

Definition at line 1256 of file at32f415_usb.h.

Referenced by usbd_ept_recv().

◆ setup

__IO uint32_t otg_eptout_type::setup

Definition at line 1274 of file at32f415_usb.h.

◆ snak

__IO uint32_t otg_eptout_type::snak

Definition at line 1254 of file at32f415_usb.h.

Referenced by usbd_core_init().

◆ snpm

__IO uint32_t otg_eptout_type::snpm

Definition at line 1250 of file at32f415_usb.h.

◆ stall

__IO uint32_t otg_eptout_type::stall

Definition at line 1251 of file at32f415_usb.h.

◆ usbacept

__IO uint32_t otg_eptout_type::usbacept

Definition at line 1246 of file at32f415_usb.h.

◆ xferc

__IO uint32_t otg_eptout_type::xferc

Definition at line 1271 of file at32f415_usb.h.

◆ xfersize

__IO uint32_t otg_eptout_type::xfersize

Definition at line 1291 of file at32f415_usb.h.

Referenced by usb_ept0_start(), and usbd_ept_recv().

The documentation for this struct was generated from the following file:
  • at32f415_usb.h


AT32F415 Firmwary Library: otg_pcgcctl_type Struct Reference

Data Fields
otg_pcgcctl_type Struct Reference
AT32F415_periph_driver » USB » USB_exported_types

#include <at32f415_usb.h>

Data Fields

union {
__IO uint32_t pcgcctl
struct {
__IO uint32_t stoppclk: 1
__IO uint32_t reserved1: 3
__IO uint32_t suspendm: 1
__IO uint32_t reserved2: 27
} pcgcctl_bit
};
otgfs power and clock gating control registers, offset:0xe00 More...

Detailed Description

Definition at line 1299 of file at32f415_usb.h.

Field Documentation

◆

union { ... } otg_pcgcctl_type::@805

otgfs power and clock gating control registers, offset:0xe00

◆ pcgcctl

__IO uint32_t otg_pcgcctl_type::pcgcctl

Definition at line 1306 of file at32f415_usb.h.

◆

struct { ... } otg_pcgcctl_type::pcgcctl_bit

◆ reserved1

__IO uint32_t otg_pcgcctl_type::reserved1

Definition at line 1310 of file at32f415_usb.h.

◆ reserved2

__IO uint32_t otg_pcgcctl_type::reserved2

Definition at line 1312 of file at32f415_usb.h.

◆ stoppclk

__IO uint32_t otg_pcgcctl_type::stoppclk

Definition at line 1309 of file at32f415_usb.h.

◆ suspendm

__IO uint32_t otg_pcgcctl_type::suspendm

Definition at line 1311 of file at32f415_usb.h.

The documentation for this struct was generated from the following file:
  • at32f415_usb.h


AT32F415 Firmwary Library: USB_exported_functions

Macros | Typedefs | Functions
USB_exported_functions
AT32F415_periph_driver » USB

Macros

#define | OTG_HOST_ADDR_OFFSET 0x400
usb host and device offset address More...
#define | OTG_HOST_CHANNEL_ADDR_OFFSET 0x500
#define | OTG_DEVICE_ADDR_OFFSET 0x800
#define | OTG_DEVICE_EPTIN_ADDR_OFFSET 0x900
#define | OTG_DEVICE_EPTOUT_ADDR_OFFSET 0xB00
#define | OTG_PCGCCTL_ADDR_OFFSET 0xE00
#define | OTG_FIFO_ADDR_OFFSET 0x1000
#define | OTG1_GLOBAL ((otg_global_type *)(OTGFS1_BASE))
usb host and device register define More...
#define | OTG_PCGCCTL(usbx) ((otg_pcgcctl_type *)((uint32_t)usbx + OTG_PCGCCTL_ADDR_OFFSET))
#define | OTG_DEVICE(usbx) ((otg_device_type *)((uint32_t)usbx + OTG_DEVICE_ADDR_OFFSET))
#define | OTG_HOST(usbx) ((otg_host_type *)((uint32_t)usbx + OTG_HOST_ADDR_OFFSET))
#define | USB_CHL(usbx, n) ((otg_hchannel_type *)((uint32_t)usbx + OTG_HOST_CHANNEL_ADDR_OFFSET + n * 0x20))
#define | USB_INEPT(usbx, eptn) ((otg_eptin_type *)((uint32_t)usbx + OTG_DEVICE_EPTIN_ADDR_OFFSET + eptn * 0x20))
#define | USB_OUTEPT(usbx, eptn) ((otg_eptout_type *)((uint32_t)usbx + OTG_DEVICE_EPTOUT_ADDR_OFFSET + eptn * 0x20))
#define | USB_FIFO(usbx, eptn) *(__IO uint32_t *)((uint32_t)usbx + OTG_FIFO_ADDR_OFFSET + eptn * 0x1000)

Typedefs

typedef otg_global_type usb_reg_type

Functions

error_status | usb_global_reset (otg_global_type *usbx)
usb global core soft reset More...
void | usb_global_init (otg_global_type *usbx)
usb global initialization More...
otg_global_type * | usb_global_select_core (uint8_t usb_id)
usb global select usb core (otg1 or otg2). More...
void | usb_flush_tx_fifo (otg_global_type *usbx, uint32_t fifo_num)
flush tx fifo More...
void | usb_flush_rx_fifo (otg_global_type *usbx)
flush rx fifo More...
void | usb_global_interrupt_enable (otg_global_type *usbx, uint16_t interrupt, confirm_state new_state)
usb interrupt mask enable More...
uint32_t | usb_global_get_all_interrupt (otg_global_type *usbx)
get all global core interrupt flag More...
void | usb_global_clear_interrupt (otg_global_type *usbx, uint32_t flag)
clear the global interrupt flag More...
void | usb_interrupt_enable (otg_global_type *usbx)
usb global interrupt enable More...
void | usb_interrupt_disable (otg_global_type *usbx)
usb global interrupt disable More...
void | usb_set_rx_fifo (otg_global_type *usbx, uint16_t size)
usb set rx fifo size More...
void | usb_set_tx_fifo (otg_global_type *usbx, uint8_t txfifo, uint16_t size)
usb set tx fifo size More...
void | usb_global_set_mode (otg_global_type *usbx, uint32_t mode)
set otg mode(device or host mode) More...
void | usb_global_power_on (otg_global_type *usbx)
disable the transceiver power down mode More...
void | usb_write_packet (otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
write data from user memory to usb buffer More...
void | usb_read_packet (otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
read data from usb buffer to user buffer More...
void | usb_stop_phy_clk (otg_global_type *usbx)
usb stop phy clock More...
void | usb_open_phy_clk (otg_global_type *usbx)
usb open phy clock More...
void | usb_ept_open (otg_global_type *usbx, usb_ept_info *ept_info)
open usb endpoint More...
void | usb_ept_close (otg_global_type *usbx, usb_ept_info *ept_info)
close usb endpoint More...
void | usb_ept_stall (otg_global_type *usbx, usb_ept_info *ept_info)
set endpoint tx or rx status to stall More...
void | usb_ept_clear_stall (otg_global_type *usbx, usb_ept_info *ept_info)
clear endpoint tx or rx status to stall More...
uint32_t | usb_get_all_out_interrupt (otg_global_type *usbx)
get all out endpoint interrupt bits More...
uint32_t | usb_get_all_in_interrupt (otg_global_type *usbx)
get all in endpoint interrupt bits More...
uint32_t | usb_ept_out_interrupt (otg_global_type *usbx, uint32_t eptn)
get out endpoint interrupt flag More...
uint32_t | usb_ept_in_interrupt (otg_global_type *usbx, uint32_t eptn)
get in endpoint interrupt flag More...
void | usb_ept_out_clear (otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear out endpoint interrupt flag More...
void | usb_ept_in_clear (otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear in endpoint interrupt flag More...
void | usb_set_address (otg_global_type *usbx, uint8_t address)
set the host assignment address More...
void | usb_ept0_start (otg_global_type *usbx)
enable endpoint 0 out More...
void | usb_ept0_setup (otg_global_type *usbx)
endpoint 0 start setup More...
void | usb_connect (otg_global_type *usbx)
connect usb device by enable pull-up More...
void | usb_disconnect (otg_global_type *usbx)
disconnect usb device by disable pull-up More...
void | usb_remote_wkup_set (otg_global_type *usbx)
usb remote wakeup set More...
void | usb_remote_wkup_clear (otg_global_type *usbx)
usb remote wakeup clear More...
uint8_t | usb_suspend_status_get (otg_global_type *usbx)
usb suspend status get More...
void | usb_port_power_on (otg_global_type *usbx, confirm_state state)
usb port power on More...
uint32_t | usbh_get_frame (otg_global_type *usbx)
get current frame number More...
void | usb_hc_enable (otg_global_type *usbx, uint8_t chn, uint8_t ept_num, uint8_t dev_address, uint8_t type, uint8_t maxpacket, uint8_t speed)
enable one host channel More...
uint32_t | usb_hch_read_interrupt (otg_global_type *usbx)
host read channel interrupt More...
void | usb_host_disable (otg_global_type *usbx)
disable host More...
void | usb_hch_halt (otg_global_type *usbx, uint8_t chn)
halt channel More...
void | usbh_fsls_clksel (otg_global_type *usbx, uint8_t clk)
select full or low speed clock More...

Detailed Description

Macro Definition Documentation

◆ OTG1_GLOBAL

#define OTG1_GLOBAL ((otg_global_type *)(OTGFS1_BASE))

usb host and device register define

usb otg1 global register

Definition at line 1339 of file at32f415_usb.h.

◆ OTG_DEVICE

#define OTG_DEVICE ( usbx ) ((otg_device_type *)((uint32_t)usbx + OTG_DEVICE_ADDR_OFFSET))

usb device register

Definition at line 1342 of file at32f415_usb.h.

◆ OTG_DEVICE_ADDR_OFFSET

#define OTG_DEVICE_ADDR_OFFSET 0x800

usb device register offset address

Definition at line 1330 of file at32f415_usb.h.

◆ OTG_DEVICE_EPTIN_ADDR_OFFSET

#define OTG_DEVICE_EPTIN_ADDR_OFFSET 0x900

usb device endpoint in register offset address

Definition at line 1331 of file at32f415_usb.h.

◆ OTG_DEVICE_EPTOUT_ADDR_OFFSET

#define OTG_DEVICE_EPTOUT_ADDR_OFFSET 0xB00

usb device endpoint out register offset address

Definition at line 1332 of file at32f415_usb.h.

◆ OTG_FIFO_ADDR_OFFSET

#define OTG_FIFO_ADDR_OFFSET 0x1000

usb fifo offset address

Definition at line 1334 of file at32f415_usb.h.

◆ OTG_HOST

#define OTG_HOST ( usbx ) ((otg_host_type *)((uint32_t)usbx + OTG_HOST_ADDR_OFFSET))

usb host register

Definition at line 1343 of file at32f415_usb.h.

◆ OTG_HOST_ADDR_OFFSET

#define OTG_HOST_ADDR_OFFSET 0x400

usb host and device offset address

usb host register offset address

Definition at line 1328 of file at32f415_usb.h.

◆ OTG_HOST_CHANNEL_ADDR_OFFSET

#define OTG_HOST_CHANNEL_ADDR_OFFSET 0x500

usb host channel register offset address

Definition at line 1329 of file at32f415_usb.h.

◆ OTG_PCGCCTL

#define OTG_PCGCCTL ( usbx ) ((otg_pcgcctl_type *)((uint32_t)usbx + OTG_PCGCCTL_ADDR_OFFSET))

usb power and clock control register

Definition at line 1341 of file at32f415_usb.h.

◆ OTG_PCGCCTL_ADDR_OFFSET

#define OTG_PCGCCTL_ADDR_OFFSET 0xE00

usb power and clock control register offset address

Definition at line 1333 of file at32f415_usb.h.

◆ USB_CHL

#define USB_CHL | ( | usbx,
 |  | n
 | ) | ((otg_hchannel_type *)((uint32_t)usbx + OTG_HOST_CHANNEL_ADDR_OFFSET + n * 0x20))

usb channel n register

Definition at line 1344 of file at32f415_usb.h.

◆ USB_FIFO

#define USB_FIFO | ( | usbx,
 |  | eptn
 | ) | *(__IO uint32_t *)((uint32_t)usbx + OTG_FIFO_ADDR_OFFSET + eptn * 0x1000)

usb fifo address

Definition at line 1347 of file at32f415_usb.h.

◆ USB_INEPT

#define USB_INEPT | ( | usbx,
 |  | eptn
 | ) | ((otg_eptin_type *)((uint32_t)usbx + OTG_DEVICE_EPTIN_ADDR_OFFSET + eptn * 0x20))

usb device endpoint in register

Definition at line 1345 of file at32f415_usb.h.

◆ USB_OUTEPT

#define USB_OUTEPT | ( | usbx,
 |  | eptn
 | ) | ((otg_eptout_type *)((uint32_t)usbx + OTG_DEVICE_EPTOUT_ADDR_OFFSET + eptn * 0x20))

usb device endpoint out register

Definition at line 1346 of file at32f415_usb.h.

Typedef Documentation

◆ usb_reg_type

typedef otg_global_type usb_reg_type

Definition at line 1351 of file at32f415_usb.h.

Function Documentation

◆ usb_connect()

void usb_connect ( otg_global_type * usbx )

connect usb device by enable pull-up

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb device register offset address

< usb device register

Definition at line 766 of file at32f415_usb.c.

Referenced by usbd_connect().

◆ usb_disconnect()

void usb_disconnect ( otg_global_type * usbx )

disconnect usb device by disable pull-up

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb device register offset address

< usb device register

Definition at line 780 of file at32f415_usb.c.

Referenced by usbd_disconnect().

◆ usb_ept0_setup()

void usb_ept0_setup ( otg_global_type * usbx )

endpoint 0 start setup

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device register offset address

< usb device register

Definition at line 752 of file at32f415_usb.c.

Referenced by usbd_enumdone_handler().

◆ usb_ept0_start()

void usb_ept0_start ( otg_global_type * usbx )

enable endpoint 0 out

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb device endpoint out register offset address

< usb device endpoint out register

Definition at line 734 of file at32f415_usb.c.

Referenced by usbd_reset_handler().

◆ usb_ept_clear_stall()

void usb_ept_clear_stall | ( | otg_global_type * | usbx,
 |  | usb_ept_info * | ept_info
 | ) |  |

clear endpoint tx or rx status to stall

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
ept_info endpoint information structure
Return values
none

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

Definition at line 587 of file at32f415_usb.c.

Referenced by usbd_clear_stall().

◆ usb_ept_close()

void usb_ept_close | ( | otg_global_type * | usbx,
 |  | usb_ept_info * | ept_info
 | ) |  |

close usb endpoint

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
ept_info endpoint information structure
Return values
none

< usb device register offset address

< usb device register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device register offset address

< usb device register

< usb device endpoint out register offset address

< usb device endpoint out register

Definition at line 534 of file at32f415_usb.c.

Referenced by usbd_ept_close().

◆ usb_ept_in_clear()

void usb_ept_in_clear | ( | otg_global_type * | usbx,
 |  | uint32_t | eptn,
 |  | uint32_t | flag
 | ) |  |

clear in endpoint interrupt flag

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
eptn endpoint number
Return values
flag interrupt flag this parameter can be any combination of the following values:
  • USB_OTG_DIEPINT_XFERC_FLAG
  • USB_OTG_DIEPINT_EPTDISD_FLAG
  • USB_OTG_DIEPINT_TMROC_FLAG
  • USB_OTG_DIEPINT_INTTXFE_FLAG
  • USB_OTG_DIEPINT_INEPNE_FLAG
  • USB_OTG_DIEPINT_TXFE_FLAG

< usb device endpoint in register offset address

< usb device endpoint in register

Definition at line 706 of file at32f415_usb.c.

Referenced by usbd_inept_handler().

◆ usb_ept_in_interrupt()

uint32_t usb_ept_in_interrupt | ( | otg_global_type * | usbx,
 |  | uint32_t | eptn
 | ) |  |

get in endpoint interrupt flag

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
eptn endpoint number
Return values
in endpoint intterupt flags

< usb device register offset address

< usb device register

< usb device register offset address

< usb device register

< usb device endpoint in register offset address

< usb device endpoint in register

Definition at line 660 of file at32f415_usb.c.

Referenced by usbd_inept_handler().

◆ usb_ept_open()

void usb_ept_open | ( | otg_global_type * | usbx,
 |  | usb_ept_info * | ept_info
 | ) |  |

open usb endpoint

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
ept_info endpoint information structure
Return values
none

< usb device endpoint 0 maximum packet size 64byte

< usb device endpoint 0 maximum packet size 64byte

< usb device endpoint 0 maximum packet size 32byte

< usb device endpoint 0 maximum packet size 16byte

< usb device endpoint 0 maximum packet size 8byte

< usb device register offset address

< usb device register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device register offset address

< usb device register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

Definition at line 468 of file at32f415_usb.c.

Referenced by usbd_ept_open().

◆ usb_ept_out_clear()

void usb_ept_out_clear | ( | otg_global_type * | usbx,
 |  | uint32_t | eptn,
 |  | uint32_t | flag
 | ) |  |

clear out endpoint interrupt flag

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
eptn endpoint number
Return values
flag interrupt flag this parameter can be any combination of the following values:
  • USB_OTG_DOEPINT_XFERC_FLAG
  • USB_OTG_DOEPINT_EPTDISD_FLAG
  • USB_OTG_DOEPINT_SETUP_FLAG
  • USB_OTG_DOEPINT_OTEPDIS_FLAG
  • USB_OTG_DOEPINT_B2BSTUP_FLAG

< usb device endpoint out register offset address

< usb device endpoint out register

Definition at line 685 of file at32f415_usb.c.

Referenced by usbd_outept_handler().

◆ usb_ept_out_interrupt()

uint32_t usb_ept_out_interrupt | ( | otg_global_type * | usbx,
 |  | uint32_t | eptn
 | ) |  |

get out endpoint interrupt flag

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
eptn endpoint number
Return values
out endpoint interrupt flags

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device register offset address

< usb device register

Definition at line 645 of file at32f415_usb.c.

Referenced by usbd_outept_handler().

◆ usb_ept_stall()

void usb_ept_stall | ( | otg_global_type * | usbx,
 |  | usb_ept_info * | ept_info
 | ) |  |

set endpoint tx or rx status to stall

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
ept_info endpoint information structure
Return values
none

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

Definition at line 558 of file at32f415_usb.c.

Referenced by usbd_set_stall().

◆ usb_flush_rx_fifo()

void usb_flush_rx_fifo ( otg_global_type * usbx )

flush rx fifo

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

Definition at line 145 of file at32f415_usb.c.

Referenced by usb_host_disable(), usbd_core_init(), usbh_attached(), and usbh_core_init().

◆ usb_flush_tx_fifo()

void usb_flush_tx_fifo | ( | otg_global_type * | usbx,
 |  | uint32_t | fifo_num
 | ) |  |

flush tx fifo

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
fifo_num tx fifo num,when fifo_num=16,flush all tx fifo parameter as following values: 0-16
Return values
none

Definition at line 119 of file at32f415_usb.c.

Referenced by audio_inisoincom_event(), bot_scsi_init(), bot_scsi_reset(), class_in_handler(), class_setup_handler(), usb_host_disable(), usbd_core_init(), usbd_flush_tx_fifo(), usbd_reset_handler(), usbh_attached(), and usbh_core_init().

◆ usb_get_all_in_interrupt()

uint32_t usb_get_all_in_interrupt ( otg_global_type * usbx )

get all in endpoint interrupt bits

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
in endpoint interrupt bits

< usb device register offset address

< usb device register

< usb device register offset address

< usb device register

Definition at line 629 of file at32f415_usb.c.

Referenced by usbd_inept_handler().

◆ usb_get_all_out_interrupt()

uint32_t usb_get_all_out_interrupt ( otg_global_type * usbx )

get all out endpoint interrupt bits

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
out endpoint interrupt bits

< usb device register offset address

< usb device register

< usb device register offset address

< usb device register

Definition at line 615 of file at32f415_usb.c.

Referenced by usbd_outept_handler().

◆ usb_global_clear_interrupt()

void usb_global_clear_interrupt | ( | otg_global_type * | usbx,
 |  | uint32_t | flag
 | ) |  |

clear the global interrupt flag

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
flag interrupt flag this parameter can be any combination of the following values:
  • USB_OTG_MODEMIS_FLAG
  • USB_OTG_OTGINT_FLAG
  • USB_OTG_SOF_FLAG
  • USB_OTG_RXFLVL_FLAG
  • USB_OTG_NPTXFEMP_FLAG
  • USB_OTG_GINNAKEFF_FLAG
  • USB_OTG_GOUTNAKEFF_FLAG
  • USB_OTG_ERLYSUSP_FLAG
  • USB_OTG_USBSUSP_FLAG
  • USB_OTG_USBRST_FLAG
  • USB_OTG_ENUMDONE_FLAG
  • USB_OTG_ISOOUTDROP_FLAG
  • USB_OTG_EOPF_FLAG
  • USB_OTG_IEPT_FLAG
  • USB_OTG_OEPT_FLAG
  • USB_OTG_INCOMISOIN_FLAG
  • USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG
  • USB_OTG_PRT_FLAG
  • USB_OTG_HCH_FLAG
  • USB_OTG_PTXFEMP_FLAG
  • USB_OTG_CONIDSCHG_FLAG
  • USB_OTG_DISCON_FLAG
  • USB_OTG_WKUP_FLAG
Return values
none

Definition at line 250 of file at32f415_usb.c.

Referenced by usbd_irq_handler(), and usbh_irq_handler().

◆ usb_global_get_all_interrupt()

uint32_t usb_global_get_all_interrupt ( otg_global_type * usbx )

get all global core interrupt flag

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
intterupt flag

Definition at line 211 of file at32f415_usb.c.

Referenced by usbd_irq_handler(), and usbh_irq_handler().

◆ usb_global_init()

void usb_global_init ( otg_global_type * usbx )

usb global initialization

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

Definition at line 83 of file at32f415_usb.c.

Referenced by usbd_core_init(), and usbh_core_init().

◆ usb_global_interrupt_enable()

void usb_global_interrupt_enable | ( | otg_global_type * | usbx,
 |  | uint16_t | interrupt,
 |  | confirm_state | new_state
 | ) |  |

usb interrupt mask enable

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
interrupt this parameter can be any combination of the following values:
  • USB_OTG_MODEMIS_INT
  • USB_OTG_OTGINT_INT
  • USB_OTG_SOF_INT
  • USB_OTG_RXFLVL_INT
  • USB_OTG_NPTXFEMP_INT
  • USB_OTG_GINNAKEFF_INT
  • USB_OTG_GOUTNAKEFF_INT
  • USB_OTG_ERLYSUSP_INT
  • USB_OTG_USBSUSP_INT
  • USB_OTG_USBRST_INT
  • USB_OTG_ENUMDONE_INT
  • USB_OTG_ISOOUTDROP_INT
  • USB_OTG_IEPT_INT
  • USB_OTG_OEPT_INT
  • USB_OTG_INCOMISOIN_INT
  • USB_OTG_INCOMPIP_INCOMPISOOUT_INT
  • USB_OTG_PRT_INT
  • USB_OTG_HCH_INT
  • USB_OTG_PTXFEMP_INT
  • USB_OTG_CONIDSCHG_INT
  • USB_OTG_DISCON_INT
  • USB_OTG_WKUP_INT
new_state TRUE or FALSE
Return values
none

Definition at line 191 of file at32f415_usb.c.

Referenced by usbd_rxflvl_handler().

◆ usb_global_power_on()

void usb_global_power_on ( otg_global_type * usbx )

disable the transceiver power down mode

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

Definition at line 372 of file at32f415_usb.c.

◆ usb_global_reset()

error_status usb_global_reset ( otg_global_type * usbx )

usb global core soft reset

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
error status

Definition at line 53 of file at32f415_usb.c.

Referenced by usb_global_init().

◆ usb_global_select_core()

otg_global_type * usb_global_select_core ( uint8_t usb_id )

usb global select usb core (otg1 or otg2).

Parameters
usb_id select otg1 or otg2 this parameter can be one of the following values:
  • USB_OTG1_ID
  • USB_OTG2_ID
Return values
usb global register type pointer

< usb otg1 global register

Definition at line 103 of file at32f415_usb.c.

◆ usb_global_set_mode()

void usb_global_set_mode | ( | otg_global_type * | usbx,
 |  | uint32_t | mode
 | ) |  |

set otg mode(device or host mode)

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
mode this parameter can be one of the following values:
  • OTG_DEVICE_MODE
  • OTG_HOST_MODE
  • OTG_DRD_MODE
Return values
none

Definition at line 339 of file at32f415_usb.c.

Referenced by usbd_core_init(), and usbh_core_init().

◆ usb_hc_enable()

void usb_hc_enable | ( | otg_global_type * | usbx,
 |  | uint8_t | chn,
 |  | uint8_t | ept_num,
 |  | uint8_t | dev_address,
 |  | uint8_t | type,
 |  | uint8_t | maxpacket,
 |  | uint8_t | speed
 | ) |  |

enable one host channel

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
chn | host channel number
ept_num | devvice endpoint number
dev_address | device address
type channel transfer type this parameter can be one of the following values:
  • EPT_CONTROL_TYPE
  • EPT_BULK_TYPE
  • EPT_INT_TYPE
  • EPT_ISO_TYPE
maxpacket | support max packe size for this channel
speed device speed this parameter can be one of the following values:
  • USB_PRTSPD_FULL_SPEED
  • USB_PRTSPD_LOW_SPEED
Return values
none

< usb host channel register offset address

< usb channel chn register

< usb host register offset address

< usb host register

< channel transfer complete interrupt

< channel stall interrupt

< channel transaction error interrupt

< channel nak interrupt

< channel data toggle interrupt

< channel transfer complete interrupt

< channel stall interrupt

< channel transaction error interrupt

< channel nak interrupt

< channel data toggle interrupt

< channel frame overrun interrupt

< channel transfer complete interrupt

< channel ack interrupt

< channel frame overrun interrupt

< usb host port low speed

Definition at line 891 of file at32f415_usb.c.

Referenced by usbh_hc_open().

◆ usb_hch_halt()

void usb_hch_halt | ( | otg_global_type * | usbx,
 |  | uint8_t | chn
 | ) |  |

halt channel

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
chn channel number
Return values
none

< usb host channel register offset address

< usb channel chn register

< usb host register offset address

< usb host register

Definition at line 1007 of file at32f415_usb.c.

Referenced by usbh_ch_disable(), usbh_hch_in_handler(), and usbh_hch_out_handler().

◆ usb_hch_read_interrupt()

uint32_t usb_hch_read_interrupt ( otg_global_type * usbx )

host read channel interrupt

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
interrupt flag

< usb host register offset address

< usb host register

Definition at line 949 of file at32f415_usb.c.

◆ usb_host_disable()

void usb_host_disable ( otg_global_type * usbx )

disable host

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb host register offset address

< usb host register

< usb host channel register offset address

< usb channel i_index register

< usb host channel register offset address

< usb channel i_index register

Definition at line 963 of file at32f415_usb.c.

Referenced by usbh_disconnect_handler().

◆ usb_interrupt_disable()

void usb_interrupt_disable ( otg_global_type * usbx )

usb global interrupt disable

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

Definition at line 275 of file at32f415_usb.c.

Referenced by usbd_core_init(), and usbh_core_init().

◆ usb_interrupt_enable()

void usb_interrupt_enable ( otg_global_type * usbx )

usb global interrupt enable

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values: OTG1_GLOBAL , OTG2_GLOBAL
Return values
none

Definition at line 262 of file at32f415_usb.c.

Referenced by usbd_core_init(), and usbh_core_init().

◆ usb_open_phy_clk()

void usb_open_phy_clk ( otg_global_type * usbx )

usb open phy clock

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb power and clock control register offset address

< usb power and clock control register

Definition at line 404 of file at32f415_usb.c.

Referenced by usbd_core_init(), usbd_remote_wakeup(), usbd_wakeup_handler(), usbh_core_init(), and usbh_resume().

◆ usb_port_power_on()

void usb_port_power_on | ( | otg_global_type * | usbx,
 |  | confirm_state | state
 | ) |  |

usb port power on

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
state state (TRUE or FALSE)
Return values
none

< usb host register offset address

< usb host register

< usb host port enable

< usb host port enable/disable change

< usb host port overcurrent active

< usb host port connect detected

< usb host port power

< usb host port power

Definition at line 837 of file at32f415_usb.c.

Referenced by usbh_core_init().

◆ usb_read_packet()

void usb_read_packet | ( | otg_global_type * | usbx,
 |  | uint8_t * | pusr_buf,
 |  | uint16_t | num,
 |  | uint16_t | nbytes
 | ) |  |

read data from usb buffer to user buffer

Parameters
pusr_buf | point to user buffer
offset_addr | endpoint rx offset address
nbytes | number of bytes data write to usb buffer
Return values
none

< usb fifo offset address

< usb fifo address

Definition at line 440 of file at32f415_usb.c.

Referenced by usbd_rxflvl_handler(), and usbh_rx_qlvl_handler().

◆ usb_remote_wkup_clear()

void usb_remote_wkup_clear ( otg_global_type * usbx )

usb remote wakeup clear

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb device register offset address

< usb device register

Definition at line 808 of file at32f415_usb.c.

Referenced by usbd_remote_wakeup().

◆ usb_remote_wkup_set()

void usb_remote_wkup_set ( otg_global_type * usbx )

usb remote wakeup set

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb device register offset address

< usb device register

Definition at line 795 of file at32f415_usb.c.

Referenced by usbd_remote_wakeup().

◆ usb_set_address()

void usb_set_address | ( | otg_global_type * | usbx,
 |  | uint8_t | address
 | ) |  |

set the host assignment address

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
address host assignment address
Return values
none

< usb device register offset address

< usb device register

Definition at line 721 of file at32f415_usb.c.

Referenced by usbd_reset_handler(), and usbd_set_device_addr().

◆ usb_set_rx_fifo()

void usb_set_rx_fifo | ( | otg_global_type * | usbx,
 |  | uint16_t | size
 | ) |  |

usb set rx fifo size

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
size rx fifo size
Return values
none

Definition at line 289 of file at32f415_usb.c.

Referenced by usbd_fifo_alloc().

◆ usb_set_tx_fifo()

void usb_set_tx_fifo | ( | otg_global_type * | usbx,
 |  | uint8_t | txfifo,
 |  | uint16_t | size
 | ) |  |

usb set tx fifo size

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
txfifo | the fifo number
size | tx fifo size
Return values
none

Definition at line 304 of file at32f415_usb.c.

Referenced by usbd_fifo_alloc().

◆ usb_stop_phy_clk()

void usb_stop_phy_clk ( otg_global_type * usbx )

usb stop phy clock

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb power and clock control register offset address

< usb power and clock control register

Definition at line 391 of file at32f415_usb.c.

Referenced by usbd_enter_suspend(), and usbh_enter_suspend().

◆ usb_suspend_status_get()

uint8_t usb_suspend_status_get ( otg_global_type * usbx )

usb suspend status get

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
usb suspend status

< usb device register offset address

< usb device register

Definition at line 821 of file at32f415_usb.c.

Referenced by usbd_enter_suspend(), and usbd_remote_wakeup().

◆ usb_write_packet()

void usb_write_packet | ( | otg_global_type * | usbx,
 |  | uint8_t * | pusr_buf,
 |  | uint16_t | num,
 |  | uint16_t | nbytes
 | ) |  |

write data from user memory to usb buffer

Parameters
pusr_buf | point to user buffer
offset_addr | endpoint tx offset address
nbytes | number of bytes data write to usb buffer
Return values
none

< usb fifo offset address

< usb fifo address

Definition at line 417 of file at32f415_usb.c.

Referenced by usb_write_empty_txfifo(), usbd_ept_send(), and usbh_in_out_request().

◆ usbh_fsls_clksel()

void usbh_fsls_clksel | ( | otg_global_type * | usbx,
 |  | uint8_t | clk
 | ) |  |

select full or low speed clock

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
clk clock frequency
Return values
none

< usb host register offset address

< usb host register

< usb host phy clock 6mhz

Definition at line 1063 of file at32f415_usb.c.

Referenced by usbh_core_init(), usbh_disconnect_handler(), and usbh_port_handler().

◆ usbh_get_frame()

uint32_t usbh_get_frame ( otg_global_type * usbx )

get current frame number

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb host register offset address

< usb host register

Definition at line 863 of file at32f415_usb.c.

Referenced by uhost_process_handler().


AT32F415 Firmwary Library: USB_private_functions

Functions
USB_private_functions
AT32F415_periph_driver » USB

Functions

error_status | usb_global_reset (otg_global_type *usbx)
usb global core soft reset More...
void | usb_global_init (otg_global_type *usbx)
usb global initialization More...
otg_global_type * | usb_global_select_core (uint8_t usb_id)
usb global select usb core (otg1 or otg2). More...
void | usb_flush_tx_fifo (otg_global_type *usbx, uint32_t fifo_num)
flush tx fifo More...
void | usb_flush_rx_fifo (otg_global_type *usbx)
flush rx fifo More...
void | usb_global_interrupt_enable (otg_global_type *usbx, uint16_t interrupt, confirm_state new_state)
usb interrupt mask enable More...
uint32_t | usb_global_get_all_interrupt (otg_global_type *usbx)
get all global core interrupt flag More...
void | usb_global_clear_interrupt (otg_global_type *usbx, uint32_t flag)
clear the global interrupt flag More...
void | usb_interrupt_enable (otg_global_type *usbx)
usb global interrupt enable More...
void | usb_interrupt_disable (otg_global_type *usbx)
usb global interrupt disable More...
void | usb_set_rx_fifo (otg_global_type *usbx, uint16_t size)
usb set rx fifo size More...
void | usb_set_tx_fifo (otg_global_type *usbx, uint8_t txfifo, uint16_t size)
usb set tx fifo size More...
void | usb_global_set_mode (otg_global_type *usbx, uint32_t mode)
set otg mode(device or host mode) More...
void | usb_global_power_on (otg_global_type *usbx)
disable the transceiver power down mode More...
void | usb_stop_phy_clk (otg_global_type *usbx)
usb stop phy clock More...
void | usb_open_phy_clk (otg_global_type *usbx)
usb open phy clock More...
void | usb_write_packet (otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
write data from user memory to usb buffer More...
void | usb_read_packet (otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
read data from usb buffer to user buffer More...
void | usb_ept_open (otg_global_type *usbx, usb_ept_info *ept_info)
open usb endpoint More...
void | usb_ept_close (otg_global_type *usbx, usb_ept_info *ept_info)
close usb endpoint More...
void | usb_ept_stall (otg_global_type *usbx, usb_ept_info *ept_info)
set endpoint tx or rx status to stall More...
void | usb_ept_clear_stall (otg_global_type *usbx, usb_ept_info *ept_info)
clear endpoint tx or rx status to stall More...
uint32_t | usb_get_all_out_interrupt (otg_global_type *usbx)
get all out endpoint interrupt bits More...
uint32_t | usb_get_all_in_interrupt (otg_global_type *usbx)
get all in endpoint interrupt bits More...
uint32_t | usb_ept_out_interrupt (otg_global_type *usbx, uint32_t eptn)
get out endpoint interrupt flag More...
uint32_t | usb_ept_in_interrupt (otg_global_type *usbx, uint32_t eptn)
get in endpoint interrupt flag More...
void | usb_ept_out_clear (otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear out endpoint interrupt flag More...
void | usb_ept_in_clear (otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear in endpoint interrupt flag More...
void | usb_set_address (otg_global_type *usbx, uint8_t address)
set the host assignment address More...
void | usb_ept0_start (otg_global_type *usbx)
enable endpoint 0 out More...
void | usb_ept0_setup (otg_global_type *usbx)
endpoint 0 start setup More...
void | usb_connect (otg_global_type *usbx)
connect usb device by enable pull-up More...
void | usb_disconnect (otg_global_type *usbx)
disconnect usb device by disable pull-up More...
void | usb_remote_wkup_set (otg_global_type *usbx)
usb remote wakeup set More...
void | usb_remote_wkup_clear (otg_global_type *usbx)
usb remote wakeup clear More...
uint8_t | usb_suspend_status_get (otg_global_type *usbx)
usb suspend status get More...
void | usb_port_power_on (otg_global_type *usbx, confirm_state state)
usb port power on More...
uint32_t | usbh_get_frame (otg_global_type *usbx)
get current frame number More...
void | usb_hc_enable (otg_global_type *usbx, uint8_t chn, uint8_t ept_num, uint8_t dev_address, uint8_t type, uint8_t maxpacket, uint8_t speed)
enable one host channel More...
uint32_t | usb_hch_read_interrupt (otg_global_type *usbx)
host read channel interrupt More...
void | usb_host_disable (otg_global_type *usbx)
disable host More...
void | usb_hch_halt (otg_global_type *usbx, uint8_t chn)
halt channel More...
void | usbh_fsls_clksel (otg_global_type *usbx, uint8_t clk)
select full or low speed clock More...

Detailed Description

Function Documentation

◆ usb_connect()

void usb_connect ( otg_global_type * usbx )

connect usb device by enable pull-up

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb device register offset address

< usb device register

Definition at line 766 of file at32f415_usb.c.

Referenced by usbd_connect().

◆ usb_disconnect()

void usb_disconnect ( otg_global_type * usbx )

disconnect usb device by disable pull-up

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb device register offset address

< usb device register

Definition at line 780 of file at32f415_usb.c.

Referenced by usbd_disconnect().

◆ usb_ept0_setup()

void usb_ept0_setup ( otg_global_type * usbx )

endpoint 0 start setup

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device register offset address

< usb device register

Definition at line 752 of file at32f415_usb.c.

Referenced by usbd_enumdone_handler().

◆ usb_ept0_start()

void usb_ept0_start ( otg_global_type * usbx )

enable endpoint 0 out

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb device endpoint out register offset address

< usb device endpoint out register

Definition at line 734 of file at32f415_usb.c.

Referenced by usbd_reset_handler().

◆ usb_ept_clear_stall()

void usb_ept_clear_stall | ( | otg_global_type * | usbx,
 |  | usb_ept_info * | ept_info
 | ) |  |

clear endpoint tx or rx status to stall

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
ept_info endpoint information structure
Return values
none

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

Definition at line 587 of file at32f415_usb.c.

Referenced by usbd_clear_stall().

◆ usb_ept_close()

void usb_ept_close | ( | otg_global_type * | usbx,
 |  | usb_ept_info * | ept_info
 | ) |  |

close usb endpoint

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
ept_info endpoint information structure
Return values
none

< usb device register offset address

< usb device register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device register offset address

< usb device register

< usb device endpoint out register offset address

< usb device endpoint out register

Definition at line 534 of file at32f415_usb.c.

Referenced by usbd_ept_close().

◆ usb_ept_in_clear()

void usb_ept_in_clear | ( | otg_global_type * | usbx,
 |  | uint32_t | eptn,
 |  | uint32_t | flag
 | ) |  |

clear in endpoint interrupt flag

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
eptn endpoint number
Return values
flag interrupt flag this parameter can be any combination of the following values:
  • USB_OTG_DIEPINT_XFERC_FLAG
  • USB_OTG_DIEPINT_EPTDISD_FLAG
  • USB_OTG_DIEPINT_TMROC_FLAG
  • USB_OTG_DIEPINT_INTTXFE_FLAG
  • USB_OTG_DIEPINT_INEPNE_FLAG
  • USB_OTG_DIEPINT_TXFE_FLAG

< usb device endpoint in register offset address

< usb device endpoint in register

Definition at line 706 of file at32f415_usb.c.

Referenced by usbd_inept_handler().

◆ usb_ept_in_interrupt()

uint32_t usb_ept_in_interrupt | ( | otg_global_type * | usbx,
 |  | uint32_t | eptn
 | ) |  |

get in endpoint interrupt flag

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
eptn endpoint number
Return values
in endpoint intterupt flags

< usb device register offset address

< usb device register

< usb device register offset address

< usb device register

< usb device endpoint in register offset address

< usb device endpoint in register

Definition at line 660 of file at32f415_usb.c.

Referenced by usbd_inept_handler().

◆ usb_ept_open()

void usb_ept_open | ( | otg_global_type * | usbx,
 |  | usb_ept_info * | ept_info
 | ) |  |

open usb endpoint

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
ept_info endpoint information structure
Return values
none

< usb device endpoint 0 maximum packet size 64byte

< usb device endpoint 0 maximum packet size 64byte

< usb device endpoint 0 maximum packet size 32byte

< usb device endpoint 0 maximum packet size 16byte

< usb device endpoint 0 maximum packet size 8byte

< usb device register offset address

< usb device register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device register offset address

< usb device register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

Definition at line 468 of file at32f415_usb.c.

Referenced by usbd_ept_open().

◆ usb_ept_out_clear()

void usb_ept_out_clear | ( | otg_global_type * | usbx,
 |  | uint32_t | eptn,
 |  | uint32_t | flag
 | ) |  |

clear out endpoint interrupt flag

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
eptn endpoint number
Return values
flag interrupt flag this parameter can be any combination of the following values:
  • USB_OTG_DOEPINT_XFERC_FLAG
  • USB_OTG_DOEPINT_EPTDISD_FLAG
  • USB_OTG_DOEPINT_SETUP_FLAG
  • USB_OTG_DOEPINT_OTEPDIS_FLAG
  • USB_OTG_DOEPINT_B2BSTUP_FLAG

< usb device endpoint out register offset address

< usb device endpoint out register

Definition at line 685 of file at32f415_usb.c.

Referenced by usbd_outept_handler().

◆ usb_ept_out_interrupt()

uint32_t usb_ept_out_interrupt | ( | otg_global_type * | usbx,
 |  | uint32_t | eptn
 | ) |  |

get out endpoint interrupt flag

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
eptn endpoint number
Return values
out endpoint interrupt flags

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device register offset address

< usb device register

Definition at line 645 of file at32f415_usb.c.

Referenced by usbd_outept_handler().

◆ usb_ept_stall()

void usb_ept_stall | ( | otg_global_type * | usbx,
 |  | usb_ept_info * | ept_info
 | ) |  |

set endpoint tx or rx status to stall

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
ept_info endpoint information structure
Return values
none

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint in register offset address

< usb device endpoint in register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

< usb device endpoint out register offset address

< usb device endpoint out register

Definition at line 558 of file at32f415_usb.c.

Referenced by usbd_set_stall().

◆ usb_flush_rx_fifo()

void usb_flush_rx_fifo ( otg_global_type * usbx )

flush rx fifo

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

Definition at line 145 of file at32f415_usb.c.

Referenced by usb_host_disable(), usbd_core_init(), usbh_attached(), and usbh_core_init().

◆ usb_flush_tx_fifo()

void usb_flush_tx_fifo | ( | otg_global_type * | usbx,
 |  | uint32_t | fifo_num
 | ) |  |

flush tx fifo

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
fifo_num tx fifo num,when fifo_num=16,flush all tx fifo parameter as following values: 0-16
Return values
none

Definition at line 119 of file at32f415_usb.c.

Referenced by audio_inisoincom_event(), bot_scsi_init(), bot_scsi_reset(), class_in_handler(), class_setup_handler(), usb_host_disable(), usbd_core_init(), usbd_flush_tx_fifo(), usbd_reset_handler(), usbh_attached(), and usbh_core_init().

◆ usb_get_all_in_interrupt()

uint32_t usb_get_all_in_interrupt ( otg_global_type * usbx )

get all in endpoint interrupt bits

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
in endpoint interrupt bits

< usb device register offset address

< usb device register

< usb device register offset address

< usb device register

Definition at line 629 of file at32f415_usb.c.

Referenced by usbd_inept_handler().

◆ usb_get_all_out_interrupt()

uint32_t usb_get_all_out_interrupt ( otg_global_type * usbx )

get all out endpoint interrupt bits

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
out endpoint interrupt bits

< usb device register offset address

< usb device register

< usb device register offset address

< usb device register

Definition at line 615 of file at32f415_usb.c.

Referenced by usbd_outept_handler().

◆ usb_global_clear_interrupt()

void usb_global_clear_interrupt | ( | otg_global_type * | usbx,
 |  | uint32_t | flag
 | ) |  |

clear the global interrupt flag

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
flag interrupt flag this parameter can be any combination of the following values:
  • USB_OTG_MODEMIS_FLAG
  • USB_OTG_OTGINT_FLAG
  • USB_OTG_SOF_FLAG
  • USB_OTG_RXFLVL_FLAG
  • USB_OTG_NPTXFEMP_FLAG
  • USB_OTG_GINNAKEFF_FLAG
  • USB_OTG_GOUTNAKEFF_FLAG
  • USB_OTG_ERLYSUSP_FLAG
  • USB_OTG_USBSUSP_FLAG
  • USB_OTG_USBRST_FLAG
  • USB_OTG_ENUMDONE_FLAG
  • USB_OTG_ISOOUTDROP_FLAG
  • USB_OTG_EOPF_FLAG
  • USB_OTG_IEPT_FLAG
  • USB_OTG_OEPT_FLAG
  • USB_OTG_INCOMISOIN_FLAG
  • USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG
  • USB_OTG_PRT_FLAG
  • USB_OTG_HCH_FLAG
  • USB_OTG_PTXFEMP_FLAG
  • USB_OTG_CONIDSCHG_FLAG
  • USB_OTG_DISCON_FLAG
  • USB_OTG_WKUP_FLAG
Return values
none

Definition at line 250 of file at32f415_usb.c.

Referenced by usbd_irq_handler(), and usbh_irq_handler().

◆ usb_global_get_all_interrupt()

uint32_t usb_global_get_all_interrupt ( otg_global_type * usbx )

get all global core interrupt flag

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
intterupt flag

Definition at line 211 of file at32f415_usb.c.

Referenced by usbd_irq_handler(), and usbh_irq_handler().

◆ usb_global_init()

void usb_global_init ( otg_global_type * usbx )

usb global initialization

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

Definition at line 83 of file at32f415_usb.c.

Referenced by usbd_core_init(), and usbh_core_init().

◆ usb_global_interrupt_enable()

void usb_global_interrupt_enable | ( | otg_global_type * | usbx,
 |  | uint16_t | interrupt,
 |  | confirm_state | new_state
 | ) |  |

usb interrupt mask enable

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
interrupt this parameter can be any combination of the following values:
  • USB_OTG_MODEMIS_INT
  • USB_OTG_OTGINT_INT
  • USB_OTG_SOF_INT
  • USB_OTG_RXFLVL_INT
  • USB_OTG_NPTXFEMP_INT
  • USB_OTG_GINNAKEFF_INT
  • USB_OTG_GOUTNAKEFF_INT
  • USB_OTG_ERLYSUSP_INT
  • USB_OTG_USBSUSP_INT
  • USB_OTG_USBRST_INT
  • USB_OTG_ENUMDONE_INT
  • USB_OTG_ISOOUTDROP_INT
  • USB_OTG_IEPT_INT
  • USB_OTG_OEPT_INT
  • USB_OTG_INCOMISOIN_INT
  • USB_OTG_INCOMPIP_INCOMPISOOUT_INT
  • USB_OTG_PRT_INT
  • USB_OTG_HCH_INT
  • USB_OTG_PTXFEMP_INT
  • USB_OTG_CONIDSCHG_INT
  • USB_OTG_DISCON_INT
  • USB_OTG_WKUP_INT
new_state TRUE or FALSE
Return values
none

Definition at line 191 of file at32f415_usb.c.

Referenced by usbd_rxflvl_handler().

◆ usb_global_power_on()

void usb_global_power_on ( otg_global_type * usbx )

disable the transceiver power down mode

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

Definition at line 372 of file at32f415_usb.c.

◆ usb_global_reset()

error_status usb_global_reset ( otg_global_type * usbx )

usb global core soft reset

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
error status

Definition at line 53 of file at32f415_usb.c.

Referenced by usb_global_init().

◆ usb_global_select_core()

otg_global_type * usb_global_select_core ( uint8_t usb_id )

usb global select usb core (otg1 or otg2).

Parameters
usb_id select otg1 or otg2 this parameter can be one of the following values:
  • USB_OTG1_ID
  • USB_OTG2_ID
Return values
usb global register type pointer

< usb otg1 global register

Definition at line 103 of file at32f415_usb.c.

◆ usb_global_set_mode()

void usb_global_set_mode | ( | otg_global_type * | usbx,
 |  | uint32_t | mode
 | ) |  |

set otg mode(device or host mode)

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
mode this parameter can be one of the following values:
  • OTG_DEVICE_MODE
  • OTG_HOST_MODE
  • OTG_DRD_MODE
Return values
none

Definition at line 339 of file at32f415_usb.c.

Referenced by usbd_core_init(), and usbh_core_init().

◆ usb_hc_enable()

void usb_hc_enable | ( | otg_global_type * | usbx,
 |  | uint8_t | chn,
 |  | uint8_t | ept_num,
 |  | uint8_t | dev_address,
 |  | uint8_t | type,
 |  | uint8_t | maxpacket,
 |  | uint8_t | speed
 | ) |  |

enable one host channel

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
chn | host channel number
ept_num | devvice endpoint number
dev_address | device address
type channel transfer type this parameter can be one of the following values:
  • EPT_CONTROL_TYPE
  • EPT_BULK_TYPE
  • EPT_INT_TYPE
  • EPT_ISO_TYPE
maxpacket | support max packe size for this channel
speed device speed this parameter can be one of the following values:
  • USB_PRTSPD_FULL_SPEED
  • USB_PRTSPD_LOW_SPEED
Return values
none

< usb host channel register offset address

< usb channel chn register

< usb host register offset address

< usb host register

< channel transfer complete interrupt

< channel stall interrupt

< channel transaction error interrupt

< channel nak interrupt

< channel data toggle interrupt

< channel transfer complete interrupt

< channel stall interrupt

< channel transaction error interrupt

< channel nak interrupt

< channel data toggle interrupt

< channel frame overrun interrupt

< channel transfer complete interrupt

< channel ack interrupt

< channel frame overrun interrupt

< usb host port low speed

Definition at line 891 of file at32f415_usb.c.

Referenced by usbh_hc_open().

◆ usb_hch_halt()

void usb_hch_halt | ( | otg_global_type * | usbx,
 |  | uint8_t | chn
 | ) |  |

halt channel

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
chn channel number
Return values
none

< usb host channel register offset address

< usb channel chn register

< usb host register offset address

< usb host register

Definition at line 1007 of file at32f415_usb.c.

Referenced by usbh_ch_disable(), usbh_hch_in_handler(), and usbh_hch_out_handler().

◆ usb_hch_read_interrupt()

uint32_t usb_hch_read_interrupt ( otg_global_type * usbx )

host read channel interrupt

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
interrupt flag

< usb host register offset address

< usb host register

Definition at line 949 of file at32f415_usb.c.

◆ usb_host_disable()

void usb_host_disable ( otg_global_type * usbx )

disable host

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb host register offset address

< usb host register

< usb host channel register offset address

< usb channel i_index register

< usb host channel register offset address

< usb channel i_index register

Definition at line 963 of file at32f415_usb.c.

Referenced by usbh_disconnect_handler().

◆ usb_interrupt_disable()

void usb_interrupt_disable ( otg_global_type * usbx )

usb global interrupt disable

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

Definition at line 275 of file at32f415_usb.c.

Referenced by usbd_core_init(), and usbh_core_init().

◆ usb_interrupt_enable()

void usb_interrupt_enable ( otg_global_type * usbx )

usb global interrupt enable

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values: OTG1_GLOBAL , OTG2_GLOBAL
Return values
none

Definition at line 262 of file at32f415_usb.c.

Referenced by usbd_core_init(), and usbh_core_init().

◆ usb_open_phy_clk()

void usb_open_phy_clk ( otg_global_type * usbx )

usb open phy clock

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb power and clock control register offset address

< usb power and clock control register

Definition at line 404 of file at32f415_usb.c.

Referenced by usbd_core_init(), usbd_remote_wakeup(), usbd_wakeup_handler(), usbh_core_init(), and usbh_resume().

◆ usb_port_power_on()

void usb_port_power_on | ( | otg_global_type * | usbx,
 |  | confirm_state | state
 | ) |  |

usb port power on

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
state state (TRUE or FALSE)
Return values
none

< usb host register offset address

< usb host register

< usb host port enable

< usb host port enable/disable change

< usb host port overcurrent active

< usb host port connect detected

< usb host port power

< usb host port power

Definition at line 837 of file at32f415_usb.c.

Referenced by usbh_core_init().

◆ usb_read_packet()

void usb_read_packet | ( | otg_global_type * | usbx,
 |  | uint8_t * | pusr_buf,
 |  | uint16_t | num,
 |  | uint16_t | nbytes
 | ) |  |

read data from usb buffer to user buffer

Parameters
pusr_buf | point to user buffer
offset_addr | endpoint rx offset address
nbytes | number of bytes data write to usb buffer
Return values
none

< usb fifo offset address

< usb fifo address

Definition at line 440 of file at32f415_usb.c.

Referenced by usbd_rxflvl_handler(), and usbh_rx_qlvl_handler().

◆ usb_remote_wkup_clear()

void usb_remote_wkup_clear ( otg_global_type * usbx )

usb remote wakeup clear

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb device register offset address

< usb device register

Definition at line 808 of file at32f415_usb.c.

Referenced by usbd_remote_wakeup().

◆ usb_remote_wkup_set()

void usb_remote_wkup_set ( otg_global_type * usbx )

usb remote wakeup set

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb device register offset address

< usb device register

Definition at line 795 of file at32f415_usb.c.

Referenced by usbd_remote_wakeup().

◆ usb_set_address()

void usb_set_address | ( | otg_global_type * | usbx,
 |  | uint8_t | address
 | ) |  |

set the host assignment address

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
address host assignment address
Return values
none

< usb device register offset address

< usb device register

Definition at line 721 of file at32f415_usb.c.

Referenced by usbd_reset_handler(), and usbd_set_device_addr().

◆ usb_set_rx_fifo()

void usb_set_rx_fifo | ( | otg_global_type * | usbx,
 |  | uint16_t | size
 | ) |  |

usb set rx fifo size

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
size rx fifo size
Return values
none

Definition at line 289 of file at32f415_usb.c.

Referenced by usbd_fifo_alloc().

◆ usb_set_tx_fifo()

void usb_set_tx_fifo | ( | otg_global_type * | usbx,
 |  | uint8_t | txfifo,
 |  | uint16_t | size
 | ) |  |

usb set tx fifo size

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
txfifo | the fifo number
size | tx fifo size
Return values
none

Definition at line 304 of file at32f415_usb.c.

Referenced by usbd_fifo_alloc().

◆ usb_stop_phy_clk()

void usb_stop_phy_clk ( otg_global_type * usbx )

usb stop phy clock

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb power and clock control register offset address

< usb power and clock control register

Definition at line 391 of file at32f415_usb.c.

Referenced by usbd_enter_suspend(), and usbh_enter_suspend().

◆ usb_suspend_status_get()

uint8_t usb_suspend_status_get ( otg_global_type * usbx )

usb suspend status get

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
usb suspend status

< usb device register offset address

< usb device register

Definition at line 821 of file at32f415_usb.c.

Referenced by usbd_enter_suspend(), and usbd_remote_wakeup().

◆ usb_write_packet()

void usb_write_packet | ( | otg_global_type * | usbx,
 |  | uint8_t * | pusr_buf,
 |  | uint16_t | num,
 |  | uint16_t | nbytes
 | ) |  |

write data from user memory to usb buffer

Parameters
pusr_buf | point to user buffer
offset_addr | endpoint tx offset address
nbytes | number of bytes data write to usb buffer
Return values
none

< usb fifo offset address

< usb fifo address

Definition at line 417 of file at32f415_usb.c.

Referenced by usb_write_empty_txfifo(), usbd_ept_send(), and usbh_in_out_request().

◆ usbh_fsls_clksel()

void usbh_fsls_clksel | ( | otg_global_type * | usbx,
 |  | uint8_t | clk
 | ) |  |

select full or low speed clock

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
clk clock frequency
Return values
none

< usb host register offset address

< usb host register

< usb host phy clock 6mhz

Definition at line 1063 of file at32f415_usb.c.

Referenced by usbh_core_init(), usbh_disconnect_handler(), and usbh_port_handler().

◆ usbh_get_frame()

uint32_t usbh_get_frame ( otg_global_type * usbx )

get current frame number

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
Return values
none

< usb host register offset address

< usb host register

Definition at line 863 of file at32f415_usb.c.

Referenced by uhost_process_handler().


AT32F415 Firmwary Library: WDT

Modules | Macros
WDT
AT32F415_periph_driver

WDT driver modules. More...

Modules

WDT_flags_definition
wdt flag
WDT_exported_types
WDT_exported_functions
WDT_private_functions

Macros

#define WDT ((wdt_type *) WDT_BASE)

Detailed Description

WDT driver modules.

Macro Definition Documentation

◆ WDT

#define WDT ((wdt_type *) WDT_BASE)

Definition at line 154 of file at32f415_wdt.h.


AT32F415 Firmwary Library: WDT_flags_definition

Macros
WDT_flags_definition
AT32F415_periph_driver » WDT

wdt flag More...

Macros

#define | WDT_DIVF_UPDATE_FLAG ((uint16_t)0x0001)
#define | WDT_RLDF_UPDATE_FLAG ((uint16_t)0x0002)

Detailed Description

wdt flag

Macro Definition Documentation

◆ WDT_DIVF_UPDATE_FLAG

#define WDT_DIVF_UPDATE_FLAG ((uint16_t)0x0001)

wdt division value update complete flag

Definition at line 53 of file at32f415_wdt.h.

◆ WDT_RLDF_UPDATE_FLAG

#define WDT_RLDF_UPDATE_FLAG ((uint16_t)0x0002)

wdt reload value update complete flag

Definition at line 54 of file at32f415_wdt.h.


AT32F415 Firmwary Library: WDT_exported_types

Data Structures | Enumerations
WDT_exported_types
AT32F415_periph_driver » WDT

Data Structures

struct wdt_type
type define wdt register all More...

Enumerations

enum wdt_division_type {
WDT_CLK_DIV_4 = 0x00 , WDT_CLK_DIV_8 = 0x01 , WDT_CLK_DIV_16 = 0x02 , WDT_CLK_DIV_32 = 0x03 ,
WDT_CLK_DIV_64 = 0x04 , WDT_CLK_DIV_128 = 0x05 , WDT_CLK_DIV_256 = 0x06
}
wdt division value type
More...
enum wdt_cmd_value_type { WDT_CMD_LOCK = 0x0000 , WDT_CMD_UNLOCK = 0x5555 , WDT_CMD_ENABLE = 0xCCCC , WDT_CMD_RELOAD = 0xAAAA }
wdt cmd value type
More...

Detailed Description

Enumeration Type Documentation

◆ wdt_cmd_value_type

enum wdt_cmd_value_type

wdt cmd value type

Enumerator
WDT_CMD_LOCK | disable write protection command
WDT_CMD_UNLOCK | enable write protection command
WDT_CMD_ENABLE | enable wdt command
WDT_CMD_RELOAD | reload command

Definition at line 81 of file at32f415_wdt.h.

◆ wdt_division_type

enum wdt_division_type

wdt division value type

Enumerator
WDT_CLK_DIV_4 | wdt clock divider value is 4
WDT_CLK_DIV_8 | wdt clock divider value is 8
WDT_CLK_DIV_16 | wdt clock divider value is 16
WDT_CLK_DIV_32 | wdt clock divider value is 32
WDT_CLK_DIV_64 | wdt clock divider value is 64
WDT_CLK_DIV_128 | wdt clock divider value is 128
WDT_CLK_DIV_256 | wdt clock divider value is 256

Definition at line 67 of file at32f415_wdt.h.


AT32F415 Firmwary Library: wdt_type Struct Reference

Data Fields
wdt_type Struct Reference
AT32F415_periph_driver » WDT » WDT_exported_types

type define wdt register all More...

#include <at32f415_wdt.h>

Data Fields

union {
__IO uint32_t cmd
struct {
__IO uint32_t cmd: 16
__IO uint32_t reserved1: 16
} cmd_bit
};
wdt cmd register, offset:0x00 More...
union {
__IO uint32_t div
struct {
__IO uint32_t div: 3
__IO uint32_t reserved1: 29
} div_bit
};
wdt div register, offset:0x04 More...
union {
__IO uint32_t rld
struct {
__IO uint32_t rld: 12
__IO uint32_t reserved1: 20
} rld_bit
};
wdt rld register, offset:0x08 More...
union {
__IO uint32_t sts
struct {
__IO uint32_t divf: 1
__IO uint32_t rldf: 1
__IO uint32_t reserved1: 30
} sts_bit
};
wdt sts register, offset:0x0C More...

Detailed Description

type define wdt register all

Definition at line 92 of file at32f415_wdt.h.

Field Documentation

◆

union { ... } wdt_type::@808

wdt cmd register, offset:0x00

◆

union { ... } wdt_type::@810

wdt div register, offset:0x04

◆

union { ... } wdt_type::@812

wdt rld register, offset:0x08

◆

union { ... } wdt_type::@814

wdt sts register, offset:0x0C

◆ cmd

__IO uint32_t wdt_type::cmd

Definition at line 100 of file at32f415_wdt.h.

◆

struct { ... } wdt_type::cmd_bit

◆ div

__IO uint32_t wdt_type::div

Definition at line 113 of file at32f415_wdt.h.

◆

struct { ... } wdt_type::div_bit

◆ divf

__IO uint32_t wdt_type::divf

Definition at line 142 of file at32f415_wdt.h.

◆ reserved1

__IO uint32_t wdt_type::reserved1

Definition at line 104 of file at32f415_wdt.h.

◆ rld

__IO uint32_t wdt_type::rld

Definition at line 126 of file at32f415_wdt.h.

◆

struct { ... } wdt_type::rld_bit

◆ rldf

__IO uint32_t wdt_type::rldf

Definition at line 143 of file at32f415_wdt.h.

◆ sts

__IO uint32_t wdt_type::sts

Definition at line 139 of file at32f415_wdt.h.

◆

struct { ... } wdt_type::sts_bit
The documentation for this struct was generated from the following file:
  • at32f415_wdt.h


AT32F415 Firmwary Library: WDT_exported_functions

Functions
WDT_exported_functions
AT32F415_periph_driver » WDT

Functions

void | wdt_enable (void)
wdt enable ,the reload value will be sent to the counter More...
void | wdt_counter_reload (void)
reload wdt counter More...
void | wdt_reload_value_set (uint16_t reload_value)
set wdt counter reload value More...
void | wdt_divider_set (wdt_division_type division)
set wdt division divider
More...
void | wdt_register_write_enable (confirm_state new_state)
enable or disable wdt cmd register write More...
flag_status | wdt_flag_get (uint16_t wdt_flag)
get wdt flag More...

Detailed Description

Function Documentation

◆ wdt_counter_reload()

void wdt_counter_reload ( void )

reload wdt counter

Parameters
none
Return values
none

Definition at line 59 of file at32f415_wdt.c.

Referenced by main().

◆ wdt_divider_set()

void wdt_divider_set ( wdt_division_type division )

set wdt division divider

Parameters
division
this parameter can be one of the following values:
  • WDT_CLK_DIV_4
  • WDT_CLK_DIV_8
  • WDT_CLK_DIV_16
  • WDT_CLK_DIV_32
  • WDT_CLK_DIV_64
  • WDT_CLK_DIV_128
  • WDT_CLK_DIV_256
Return values
none

Definition at line 87 of file at32f415_wdt.c.

Referenced by main().

◆ wdt_enable()

void wdt_enable ( void )

wdt enable ,the reload value will be sent to the counter

Parameters
none
Return values
none

Definition at line 49 of file at32f415_wdt.c.

Referenced by main().

◆ wdt_flag_get()

flag_status wdt_flag_get ( uint16_t wdt_flag )

get wdt flag

Parameters
wdt_flag
this parameter can be one of the following values:
  • WDT_DIVF_UPDATE_FLAG: division value update complete flag.
  • WDT_RLDF_UPDATE_FLAG: reload value update complete flag.
Return values
state of wdt flag

Definition at line 117 of file at32f415_wdt.c.

◆ wdt_register_write_enable()

void wdt_register_write_enable ( confirm_state new_state )

enable or disable wdt cmd register write

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 97 of file at32f415_wdt.c.

Referenced by main().

◆ wdt_reload_value_set()

void wdt_reload_value_set ( uint16_t reload_value )

set wdt counter reload value

Parameters
reload_value (0x0000~0x0FFF)
Return values
none

Definition at line 69 of file at32f415_wdt.c.

Referenced by main().


AT32F415 Firmwary Library: WDT_private_functions

Functions
WDT_private_functions
AT32F415_periph_driver » WDT

Functions

void | wdt_enable (void)
wdt enable ,the reload value will be sent to the counter More...
void | wdt_counter_reload (void)
reload wdt counter More...
void | wdt_reload_value_set (uint16_t reload_value)
set wdt counter reload value More...
void | wdt_divider_set (wdt_division_type division)
set wdt division divider
More...
void | wdt_register_write_enable (confirm_state new_state)
enable or disable wdt cmd register write More...
flag_status | wdt_flag_get (uint16_t wdt_flag)
get wdt flag More...

Detailed Description

Function Documentation

◆ wdt_counter_reload()

void wdt_counter_reload ( void )

reload wdt counter

Parameters
none
Return values
none

Definition at line 59 of file at32f415_wdt.c.

Referenced by main().

◆ wdt_divider_set()

void wdt_divider_set ( wdt_division_type division )

set wdt division divider

Parameters
division
this parameter can be one of the following values:
  • WDT_CLK_DIV_4
  • WDT_CLK_DIV_8
  • WDT_CLK_DIV_16
  • WDT_CLK_DIV_32
  • WDT_CLK_DIV_64
  • WDT_CLK_DIV_128
  • WDT_CLK_DIV_256
Return values
none

Definition at line 87 of file at32f415_wdt.c.

Referenced by main().

◆ wdt_enable()

void wdt_enable ( void )

wdt enable ,the reload value will be sent to the counter

Parameters
none
Return values
none

Definition at line 49 of file at32f415_wdt.c.

Referenced by main().

◆ wdt_flag_get()

flag_status wdt_flag_get ( uint16_t wdt_flag )

get wdt flag

Parameters
wdt_flag
this parameter can be one of the following values:
  • WDT_DIVF_UPDATE_FLAG: division value update complete flag.
  • WDT_RLDF_UPDATE_FLAG: reload value update complete flag.
Return values
state of wdt flag

Definition at line 117 of file at32f415_wdt.c.

◆ wdt_register_write_enable()

void wdt_register_write_enable ( confirm_state new_state )

enable or disable wdt cmd register write

Parameters
new_state (TRUE or FALSE)
Return values
none

Definition at line 97 of file at32f415_wdt.c.

Referenced by main().

◆ wdt_reload_value_set()

void wdt_reload_value_set ( uint16_t reload_value )

set wdt counter reload value

Parameters
reload_value (0x0000~0x0FFF)
Return values
none

Definition at line 69 of file at32f415_wdt.c.

Referenced by main().


AT32F415 Firmwary Library: WWDT

Modules | Macros
WWDT
AT32F415_periph_driver

WWDT driver modules. More...

Modules

WWDT_enable_bit_definition
wwdt enable bit
WWDT_exported_types
WWDT_exported_functions
WWDT_private_functions

Macros

#define WWDT ((wwdt_type *) WWDT_BASE)

Detailed Description

WWDT driver modules.

Macro Definition Documentation

◆ WWDT

#define WWDT ((wwdt_type *) WWDT_BASE)

Definition at line 127 of file at32f415_wwdt.h.


AT32F415 Firmwary Library: WWDT_enable_bit_definition

Macros
WWDT_enable_bit_definition
AT32F415_periph_driver » WWDT

wwdt enable bit More...

Macros

#define WWDT_EN_BIT ((uint32_t)0x00000080)

Detailed Description

wwdt enable bit

Macro Definition Documentation

◆ WWDT_EN_BIT

#define WWDT_EN_BIT ((uint32_t)0x00000080)

wwdt enable bit

Definition at line 52 of file at32f415_wwdt.h.


AT32F415 Firmwary Library: WWDT_exported_types

Data Structures | Enumerations
WWDT_exported_types
AT32F415_periph_driver » WWDT

Data Structures

struct wwdt_type
type define wwdt register all More...

Enumerations

enum wwdt_division_type { WWDT_PCLK1_DIV_4096 = 0x00 , WWDT_PCLK1_DIV_8192 = 0x01 , WWDT_PCLK1_DIV_16384 = 0x02 , WWDT_PCLK1_DIV_32768 = 0x03 }
wwdt division type More...

Detailed Description

Enumeration Type Documentation

◆ wwdt_division_type

enum wwdt_division_type

wwdt division type

Enumerator
WWDT_PCLK1_DIV_4096 | wwdt counter clock = (pclk1/4096)/1)
WWDT_PCLK1_DIV_8192 | wwdt counter clock = (pclk1/4096)/2)
WWDT_PCLK1_DIV_16384 | wwdt counter clock = (pclk1/4096)/4)
WWDT_PCLK1_DIV_32768 | wwdt counter clock = (pclk1/4096)/8)

Definition at line 65 of file at32f415_wwdt.h.


AT32F415 Firmwary Library: wwdt_type Struct Reference

Data Fields
wwdt_type Struct Reference
AT32F415_periph_driver » WWDT » WWDT_exported_types

type define wwdt register all More...

#include <at32f415_wwdt.h>

Data Fields

union {
__IO uint32_t ctrl
struct {
__IO uint32_t cnt: 7
__IO uint32_t wwdten: 1
__IO uint32_t reserved1: 24
} ctrl_bit
};
wwdt ctrl register, offset:0x00 More...
union {
__IO uint32_t cfg
struct {
__IO uint32_t win: 7
__IO uint32_t div: 2
__IO uint32_t rldien: 1
__IO uint32_t reserved1: 22
} cfg_bit
};
wwdt cfg register, offset:0x04 More...
union {
__IO uint32_t sts
struct {
__IO uint32_t rldf: 1
__IO uint32_t reserved1: 31
} sts_bit
};
wwdt cfg register, offset:0x08 More...

Detailed Description

type define wwdt register all

Definition at line 76 of file at32f415_wwdt.h.

Field Documentation

◆

union { ... } wwdt_type::@820

wwdt ctrl register, offset:0x00

◆

union { ... } wwdt_type::@822

wwdt cfg register, offset:0x04

◆

union { ... } wwdt_type::@824

wwdt cfg register, offset:0x08

◆ cfg

__IO uint32_t wwdt_type::cfg

Definition at line 98 of file at32f415_wwdt.h.

◆

struct { ... } wwdt_type::cfg_bit

◆ cnt

__IO uint32_t wwdt_type::cnt

Definition at line 87 of file at32f415_wwdt.h.

◆ ctrl

__IO uint32_t wwdt_type::ctrl

Definition at line 84 of file at32f415_wwdt.h.

◆

struct { ... } wwdt_type::ctrl_bit

◆ div

__IO uint32_t wwdt_type::div

Definition at line 102 of file at32f415_wwdt.h.

◆ reserved1

__IO uint32_t wwdt_type::reserved1

Definition at line 89 of file at32f415_wwdt.h.

◆ rldf

__IO uint32_t wwdt_type::rldf

Definition at line 116 of file at32f415_wwdt.h.

◆ rldien

__IO uint32_t wwdt_type::rldien

Definition at line 103 of file at32f415_wwdt.h.

◆ sts

__IO uint32_t wwdt_type::sts

Definition at line 113 of file at32f415_wwdt.h.

◆

struct { ... } wwdt_type::sts_bit

◆ win

__IO uint32_t wwdt_type::win

Definition at line 101 of file at32f415_wwdt.h.

◆ wwdten

__IO uint32_t wwdt_type::wwdten

Definition at line 88 of file at32f415_wwdt.h.

The documentation for this struct was generated from the following file:
  • at32f415_wwdt.h


AT32F415 Firmwary Library: WWDT_exported_functions

Functions
WWDT_exported_functions
AT32F415_periph_driver » WWDT

Functions

void | wwdt_reset (void)
wwdt reset by crm reset register More...
void | wwdt_divider_set (wwdt_division_type division)
wwdt division set More...
void | wwdt_flag_clear (void)
wwdt reload counter interrupt flag clear More...
void | wwdt_enable (uint8_t wwdt_cnt)
wwdt enable and the counter value load More...
void | wwdt_interrupt_enable (void)
wwdt reload counter interrupt enable More...
flag_status | wwdt_flag_get (void)
wwdt reload counter interrupt flag get More...
void | wwdt_counter_set (uint8_t wwdt_cnt)
wwdt counter value set More...
void | wwdt_window_counter_set (uint8_t window_cnt)
wwdt window counter value set More...

Detailed Description

Function Documentation

◆ wwdt_counter_set()

void wwdt_counter_set ( uint8_t wwdt_cnt )

wwdt counter value set

Parameters
wwdt_cnt (0x40~0x7f)
Return values
none

Definition at line 114 of file at32f415_wwdt.c.

Referenced by main().

◆ wwdt_divider_set()

void wwdt_divider_set ( wwdt_division_type division )

wwdt division set

Parameters
division
this parameter can be one of the following values:
  • WWDT_PCLK1_DIV_4096 (wwdt counter clock = (pclk1/4096)/1)
  • WWDT_PCLK1_DIV_8192 (wwdt counter clock = (pclk1/4096)/2)
  • WWDT_PCLK1_DIV_16384 (wwdt counter clock = (pclk1/4096)/4)
  • WWDT_PCLK1_DIV_32768 (wwdt counter clock = (pclk1/4096)/8)
Return values
none

Definition at line 64 of file at32f415_wwdt.c.

Referenced by main().

◆ wwdt_enable()

void wwdt_enable ( uint8_t wwdt_cnt )

wwdt enable and the counter value load

Parameters
wwdt_cnt (0x40~0x7f)
Return values
none

< wwdt enable bit

Definition at line 84 of file at32f415_wwdt.c.

Referenced by main().

◆ wwdt_flag_clear()

void wwdt_flag_clear ( void )

wwdt reload counter interrupt flag clear

Parameters
none
Return values
none

Definition at line 74 of file at32f415_wwdt.c.

◆ wwdt_flag_get()

flag_status wwdt_flag_get ( void )

wwdt reload counter interrupt flag get

Parameters
none
Return values
state of reload counter interrupt flag

Definition at line 104 of file at32f415_wwdt.c.

◆ wwdt_interrupt_enable()

void wwdt_interrupt_enable ( void )

wwdt reload counter interrupt enable

Parameters
none
Return values
none

Definition at line 94 of file at32f415_wwdt.c.

◆ wwdt_reset()

void wwdt_reset ( void )

wwdt reset by crm reset register

Return values
none

Definition at line 48 of file at32f415_wwdt.c.

◆ wwdt_window_counter_set()

void wwdt_window_counter_set ( uint8_t window_cnt )

wwdt window counter value set

Parameters
window_cnt (0x40~0x7f)
Return values
none

Definition at line 124 of file at32f415_wwdt.c.

Referenced by main().


AT32F415 Firmwary Library: WWDT_private_functions

Functions
WWDT_private_functions
AT32F415_periph_driver » WWDT

Functions

void | wwdt_reset (void)
wwdt reset by crm reset register More...
void | wwdt_divider_set (wwdt_division_type division)
wwdt division set More...
void | wwdt_flag_clear (void)
wwdt reload counter interrupt flag clear More...
void | wwdt_enable (uint8_t wwdt_cnt)
wwdt enable and the counter value load More...
void | wwdt_interrupt_enable (void)
wwdt reload counter interrupt enable More...
flag_status | wwdt_flag_get (void)
wwdt reload counter interrupt flag get More...
void | wwdt_counter_set (uint8_t wwdt_cnt)
wwdt counter value set More...
void | wwdt_window_counter_set (uint8_t window_cnt)
wwdt window counter value set More...

Detailed Description

Function Documentation

◆ wwdt_counter_set()

void wwdt_counter_set ( uint8_t wwdt_cnt )

wwdt counter value set

Parameters
wwdt_cnt (0x40~0x7f)
Return values
none

Definition at line 114 of file at32f415_wwdt.c.

Referenced by main().

◆ wwdt_divider_set()

void wwdt_divider_set ( wwdt_division_type division )

wwdt division set

Parameters
division
this parameter can be one of the following values:
  • WWDT_PCLK1_DIV_4096 (wwdt counter clock = (pclk1/4096)/1)
  • WWDT_PCLK1_DIV_8192 (wwdt counter clock = (pclk1/4096)/2)
  • WWDT_PCLK1_DIV_16384 (wwdt counter clock = (pclk1/4096)/4)
  • WWDT_PCLK1_DIV_32768 (wwdt counter clock = (pclk1/4096)/8)
Return values
none

Definition at line 64 of file at32f415_wwdt.c.

Referenced by main().

◆ wwdt_enable()

void wwdt_enable ( uint8_t wwdt_cnt )

wwdt enable and the counter value load

Parameters
wwdt_cnt (0x40~0x7f)
Return values
none

< wwdt enable bit

Definition at line 84 of file at32f415_wwdt.c.

Referenced by main().

◆ wwdt_flag_clear()

void wwdt_flag_clear ( void )

wwdt reload counter interrupt flag clear

Parameters
none
Return values
none

Definition at line 74 of file at32f415_wwdt.c.

◆ wwdt_flag_get()

flag_status wwdt_flag_get ( void )

wwdt reload counter interrupt flag get

Parameters
none
Return values
state of reload counter interrupt flag

Definition at line 104 of file at32f415_wwdt.c.

◆ wwdt_interrupt_enable()

void wwdt_interrupt_enable ( void )

wwdt reload counter interrupt enable

Parameters
none
Return values
none

Definition at line 94 of file at32f415_wwdt.c.

◆ wwdt_reset()

void wwdt_reset ( void )

wwdt reset by crm reset register

Return values
none

Definition at line 48 of file at32f415_wwdt.c.

◆ wwdt_window_counter_set()

void wwdt_window_counter_set ( uint8_t window_cnt )

wwdt window counter value set

Parameters
window_cnt (0x40~0x7f)
Return values
none

Definition at line 124 of file at32f415_wwdt.c.

Referenced by main().


AT32F415 Firmwary Library: AT32F415_middlewares_i2c_application_library

Modules | Macros | Functions
AT32F415_middlewares_i2c_application_library

Modules

I2C_library_event_check_flag
I2C_library_transmission_mode
I2C_library_status_code
I2C_library_handler
I2C_library_exported_functions

Macros

#define | DMA_GET_TC_FLAG(DMA_CHANNEL)
get the dma transfer complete flag through the channel More...
#define | DMA_GET_HT_FLAG(DMA_CHANNEL)
get the dma half transfer flag through the channel More...
#define | DMA_GET_TERR_FLAG(DMA_CHANNEL)
get the dma transfer error flag through the channel More...
#define | I2C_START 0
i2c transmission status More...
#define | I2C_END 1

Functions

void | i2c_config (i2c_handle_type *hi2c)
i2c peripheral initialization. More...
void | i2c_addr_flag_clear (i2c_handle_type *hi2c)
clear the addr flag. More...
void | i2c_stop_flag_clear (i2c_handle_type *hi2c)
clear the stop flag. More...
i2c_status_type | i2c_wait_end (i2c_handle_type *hi2c, uint32_t timeout)
wait for the transfer to end. More...
i2c_status_type | i2c_wait_flag (i2c_handle_type *hi2c, uint32_t flag, flag_status status, uint32_t event_check, uint32_t timeout)
wait for the flag. More...
void | i2c_dma_config (i2c_handle_type *hi2c, dma_channel_type *dma_channelx, uint8_t *pdata, uint16_t size)
dma transfer cofiguration. More...
i2c_status_type | i2c_master_write_addr (i2c_handle_type *hi2c, uint16_t address, uint32_t timeout)
send address in master transmits mode. More...
i2c_status_type | i2c_master_read_addr (i2c_handle_type *hi2c, uint16_t address, uint32_t timeout)
send address in master receive mode. More...
i2c_status_type | i2c_master_transmit (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through polling mode. More...
i2c_status_type | i2c_slave_receive (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through polling mode. More...
i2c_status_type | i2c_master_receive (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through polling mode. More...
i2c_status_type | i2c_slave_transmit (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through polling mode. More...
i2c_status_type | i2c_master_transmit_int (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through interrupt mode. More...
i2c_status_type | i2c_slave_receive_int (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through interrupt mode. More...
i2c_status_type | i2c_master_receive_int (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through interrupt mode. More...
i2c_status_type | i2c_slave_transmit_int (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through interrupt mode. More...
i2c_status_type | i2c_master_transmit_dma (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through dma mode. More...
i2c_status_type | i2c_slave_receive_dma (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through dma mode. More...
i2c_status_type | i2c_master_receive_dma (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through dma mode. More...
i2c_status_type | i2c_slave_transmit_dma (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through dma mode. More...
i2c_status_type | i2c_memory_write (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through polling mode. More...
i2c_status_type | i2c_memory_read (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode. More...
i2c_status_type | i2c_memory_write_int (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through interrupt mode. More...
i2c_status_type | i2c_memory_read_int (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through interrupt mode. More...
i2c_status_type | i2c_memory_write_dma (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through dma mode. More...
i2c_status_type | i2c_memory_read_dma (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode. More...
void | i2c_master_tx_isr_int (i2c_handle_type *hi2c)
master transfer mode interrupt procession function More...
void | i2c_master_rx_isr_int (i2c_handle_type *hi2c)
master receive mode interrupt procession function More...
void | i2c_slave_tx_isr_int (i2c_handle_type *hi2c)
slave transfer mode interrupt procession function More...
void | i2c_slave_rx_isr_int (i2c_handle_type *hi2c)
slave receive mode interrupt procession function More...
void | i2c_evt_irq_handler (i2c_handle_type *hi2c)
interrupt procession function. More...
void | i2c_dma_tx_irq_handler (i2c_handle_type *hi2c)
dma transmission complete interrupt function. More...
void | i2c_dma_rx_irq_handler (i2c_handle_type *hi2c)
dma reveive complete interrupt function. More...
void | i2c_err_irq_handler (i2c_handle_type *hi2c)
i2c error interrupt function. More...

Detailed Description

< define to prevent recursive inclusion ----------------------------------—

Macro Definition Documentation

◆ DMA_GET_HT_FLAG

#define DMA_GET_HT_FLAG ( DMA_CHANNEL )
Value:
(((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL1))? DMA1_HDT1_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL2))? DMA1_HDT2_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL3))? DMA1_HDT3_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL4))? DMA1_HDT4_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL5))? DMA1_HDT5_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL6))? DMA1_HDT6_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL7))? DMA1_HDT7_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL1))? DMA2_HDT1_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL2))? DMA2_HDT2_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL3))? DMA2_HDT3_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL4))? DMA2_HDT4_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL5))? DMA2_HDT5_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL6))? DMA2_HDT6_FLAG : \
DMA2_HDT7_FLAG)
DMA1_HDT5_FLAG
#define DMA1_HDT5_FLAG
Definition: at32f415_dma.h:99
DMA2_HDT6_FLAG
#define DMA2_HDT6_FLAG
Definition: at32f415_dma.h:132
DMA1_HDT7_FLAG
#define DMA1_HDT7_FLAG
Definition: at32f415_dma.h:107
DMA2_HDT3_FLAG
#define DMA2_HDT3_FLAG
Definition: at32f415_dma.h:120
DMA1_HDT4_FLAG
#define DMA1_HDT4_FLAG
Definition: at32f415_dma.h:95
DMA2_HDT5_FLAG
#define DMA2_HDT5_FLAG
Definition: at32f415_dma.h:128
DMA1_HDT3_FLAG
#define DMA1_HDT3_FLAG
Definition: at32f415_dma.h:91
DMA2_HDT1_FLAG
#define DMA2_HDT1_FLAG
Definition: at32f415_dma.h:112
DMA2_HDT2_FLAG
#define DMA2_HDT2_FLAG
Definition: at32f415_dma.h:116
DMA1_HDT1_FLAG
#define DMA1_HDT1_FLAG
Definition: at32f415_dma.h:83
DMA2_HDT4_FLAG
#define DMA2_HDT4_FLAG
Definition: at32f415_dma.h:124
DMA2_HDT7_FLAG
#define DMA2_HDT7_FLAG
Definition: at32f415_dma.h:136
DMA1_HDT2_FLAG
#define DMA1_HDT2_FLAG
Definition: at32f415_dma.h:87
DMA1_HDT6_FLAG
#define DMA1_HDT6_FLAG
Definition: at32f415_dma.h:103
DMA2_CHANNEL5
#define DMA2_CHANNEL5
Definition: at32f415_dma.h:486
DMA1_CHANNEL3
#define DMA1_CHANNEL3
Definition: at32f415_dma.h:475
DMA1_CHANNEL5
#define DMA1_CHANNEL5
Definition: at32f415_dma.h:477
DMA2_CHANNEL2
#define DMA2_CHANNEL2
Definition: at32f415_dma.h:483
DMA2_CHANNEL3
#define DMA2_CHANNEL3
Definition: at32f415_dma.h:484
DMA1_CHANNEL4
#define DMA1_CHANNEL4
Definition: at32f415_dma.h:476
DMA1_CHANNEL1
#define DMA1_CHANNEL1
Definition: at32f415_dma.h:473
DMA2_CHANNEL6
#define DMA2_CHANNEL6
Definition: at32f415_dma.h:487
DMA1_CHANNEL2
#define DMA1_CHANNEL2
Definition: at32f415_dma.h:474
DMA2_CHANNEL4
#define DMA2_CHANNEL4
Definition: at32f415_dma.h:485
DMA2_CHANNEL1
#define DMA2_CHANNEL1
Definition: at32f415_dma.h:482
DMA1_CHANNEL6
#define DMA1_CHANNEL6
Definition: at32f415_dma.h:478
DMA1_CHANNEL7
#define DMA1_CHANNEL7
Definition: at32f415_dma.h:479

get the dma half transfer flag through the channel

Definition at line 56 of file i2c_application.c.

◆ DMA_GET_TC_FLAG

#define DMA_GET_TC_FLAG ( DMA_CHANNEL )
Value:
(((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL1))? DMA1_FDT1_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL2))? DMA1_FDT2_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL3))? DMA1_FDT3_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL4))? DMA1_FDT4_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL5))? DMA1_FDT5_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL6))? DMA1_FDT6_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL7))? DMA1_FDT7_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL1))? DMA2_FDT1_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL2))? DMA2_FDT2_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL3))? DMA2_FDT3_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL4))? DMA2_FDT4_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL5))? DMA2_FDT5_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL6))? DMA2_FDT6_FLAG : \
DMA2_FDT7_FLAG)
DMA1_FDT7_FLAG
#define DMA1_FDT7_FLAG
Definition: at32f415_dma.h:106
DMA2_FDT7_FLAG
#define DMA2_FDT7_FLAG
Definition: at32f415_dma.h:135
DMA2_FDT4_FLAG
#define DMA2_FDT4_FLAG
Definition: at32f415_dma.h:123
DMA2_FDT6_FLAG
#define DMA2_FDT6_FLAG
Definition: at32f415_dma.h:131
DMA2_FDT2_FLAG
#define DMA2_FDT2_FLAG
Definition: at32f415_dma.h:115
DMA1_FDT4_FLAG
#define DMA1_FDT4_FLAG
Definition: at32f415_dma.h:94
DMA1_FDT1_FLAG
#define DMA1_FDT1_FLAG
Definition: at32f415_dma.h:82
DMA1_FDT6_FLAG
#define DMA1_FDT6_FLAG
Definition: at32f415_dma.h:102
DMA2_FDT5_FLAG
#define DMA2_FDT5_FLAG
Definition: at32f415_dma.h:127
DMA2_FDT1_FLAG
#define DMA2_FDT1_FLAG
Definition: at32f415_dma.h:111
DMA2_FDT3_FLAG
#define DMA2_FDT3_FLAG
Definition: at32f415_dma.h:119
DMA1_FDT5_FLAG
#define DMA1_FDT5_FLAG
Definition: at32f415_dma.h:98
DMA1_FDT2_FLAG
#define DMA1_FDT2_FLAG
Definition: at32f415_dma.h:86
DMA1_FDT3_FLAG
#define DMA1_FDT3_FLAG
Definition: at32f415_dma.h:90

get the dma transfer complete flag through the channel

Definition at line 37 of file i2c_application.c.

◆ DMA_GET_TERR_FLAG

#define DMA_GET_TERR_FLAG ( DMA_CHANNEL )
Value:
(((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL1))? DMA1_DTERR1_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL2))? DMA1_DTERR2_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL3))? DMA1_DTERR3_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL4))? DMA1_DTERR4_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL5))? DMA1_DTERR5_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL6))? DMA1_DTERR6_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL7))? DMA1_DTERR7_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL1))? DMA2_DTERR1_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL2))? DMA2_DTERR2_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL3))? DMA2_DTERR3_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL4))? DMA2_DTERR4_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL5))? DMA2_DTERR5_FLAG : \
((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL6))? DMA2_DTERR6_FLAG : \
DMA2_DTERR7_FLAG)
DMA1_DTERR7_FLAG
#define DMA1_DTERR7_FLAG
Definition: at32f415_dma.h:108
DMA1_DTERR3_FLAG
#define DMA1_DTERR3_FLAG
Definition: at32f415_dma.h:92
DMA2_DTERR4_FLAG
#define DMA2_DTERR4_FLAG
Definition: at32f415_dma.h:125
DMA2_DTERR7_FLAG
#define DMA2_DTERR7_FLAG
Definition: at32f415_dma.h:137
DMA1_DTERR1_FLAG
#define DMA1_DTERR1_FLAG
Definition: at32f415_dma.h:84
DMA1_DTERR4_FLAG
#define DMA1_DTERR4_FLAG
Definition: at32f415_dma.h:96
DMA2_DTERR6_FLAG
#define DMA2_DTERR6_FLAG
Definition: at32f415_dma.h:133
DMA1_DTERR6_FLAG
#define DMA1_DTERR6_FLAG
Definition: at32f415_dma.h:104
DMA1_DTERR5_FLAG
#define DMA1_DTERR5_FLAG
Definition: at32f415_dma.h:100
DMA1_DTERR2_FLAG
#define DMA1_DTERR2_FLAG
Definition: at32f415_dma.h:88
DMA2_DTERR3_FLAG
#define DMA2_DTERR3_FLAG
Definition: at32f415_dma.h:121
DMA2_DTERR5_FLAG
#define DMA2_DTERR5_FLAG
Definition: at32f415_dma.h:129
DMA2_DTERR1_FLAG
#define DMA2_DTERR1_FLAG
Definition: at32f415_dma.h:113
DMA2_DTERR2_FLAG
#define DMA2_DTERR2_FLAG
Definition: at32f415_dma.h:117

get the dma transfer error flag through the channel

Definition at line 75 of file i2c_application.c.

◆ I2C_END

#define I2C_END 1

Definition at line 95 of file i2c_application.c.

◆ I2C_START

#define I2C_START 0

i2c transmission status

Definition at line 94 of file i2c_application.c.

Function Documentation

◆ i2c_addr_flag_clear()

void i2c_addr_flag_clear ( i2c_handle_type * hi2c )

clear the addr flag.

Parameters
hi2c the handle points to the operation information.
Return values
none.

Definition at line 119 of file i2c_application.c.

Referenced by i2c_master_read_addr(), i2c_master_receive(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_transmit(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write(), i2c_memory_write_dma(), i2c_memory_write_int(), i2c_slave_receive(), i2c_slave_receive_dma(), i2c_slave_receive_int(), i2c_slave_transmit(), i2c_slave_transmit_dma(), and i2c_slave_transmit_int().

◆ i2c_config()

void i2c_config ( i2c_handle_type * hi2c )

i2c peripheral initialization.

Parameters
hi2c the handle points to the operation information.
Return values
none.

Definition at line 102 of file i2c_application.c.

Referenced by audio_codec_init(), and main().

◆ i2c_dma_config()

void i2c_dma_config | ( | i2c_handle_type * | hi2c,
 |  | dma_channel_type * | dma_channelx,
 |  | uint8_t * | pdata,
 |  | uint16_t | size
 | ) |  |

dma transfer cofiguration.

Parameters
hi2c | the handle points to the operation information.
dma_channelx | dma channel to be cofigured.
pdata | data buffer.
size | data size.
Return values
none.

< dma full data transfer interrupt

< dma full data transfer interrupt

Definition at line 237 of file i2c_application.c.

Referenced by i2c_master_receive_dma(), i2c_master_transmit_dma(), i2c_memory_read_dma(), i2c_memory_write_dma(), i2c_slave_receive_dma(), and i2c_slave_transmit_dma().

◆ i2c_dma_rx_irq_handler()

void i2c_dma_rx_irq_handler ( i2c_handle_type * hi2c )

dma reveive complete interrupt function.

Parameters
hi2c the handle points to the operation information.
Return values
none.

< dma1 channel1 full data transfer flag

< dma1 channel2 full data transfer flag

< dma1 channel3 full data transfer flag

< dma1 channel4 full data transfer flag

< dma1 channel5 full data transfer flag

< dma1 channel6 full data transfer flag

< dma1 channel7 full data transfer flag

< dma2 channel1 full data transfer flag

< dma2 channel2 full data transfer flag

< dma2 channel3 full data transfer flag

< dma2 channel4 full data transfer flag

< dma2 channel5 full data transfer flag

< dma2 channel6 full data transfer flag

< dma2 channel7 full data transfer flag

< dma full data transfer interrupt

< dma1 channel1 full data transfer flag

< dma1 channel2 full data transfer flag

< dma1 channel3 full data transfer flag

< dma1 channel4 full data transfer flag

< dma1 channel5 full data transfer flag

< dma1 channel6 full data transfer flag

< dma1 channel7 full data transfer flag

< dma2 channel1 full data transfer flag

< dma2 channel2 full data transfer flag

< dma2 channel3 full data transfer flag

< dma2 channel4 full data transfer flag

< dma2 channel5 full data transfer flag

< dma2 channel6 full data transfer flag

< dma2 channel7 full data transfer flag

< i2c acknowledge failure flag

< i2c stop condition generation complete flag

< check flag none

Definition at line 2194 of file i2c_application.c.

Referenced by DMA1_Channel7_IRQHandler().

◆ i2c_dma_tx_irq_handler()

void i2c_dma_tx_irq_handler ( i2c_handle_type * hi2c )

dma transmission complete interrupt function.

Parameters
hi2c the handle points to the operation information.
Return values
none.

< dma1 channel1 full data transfer flag

< dma1 channel2 full data transfer flag

< dma1 channel3 full data transfer flag

< dma1 channel4 full data transfer flag

< dma1 channel5 full data transfer flag

< dma1 channel6 full data transfer flag

< dma1 channel7 full data transfer flag

< dma2 channel1 full data transfer flag

< dma2 channel2 full data transfer flag

< dma2 channel3 full data transfer flag

< dma2 channel4 full data transfer flag

< dma2 channel5 full data transfer flag

< dma2 channel6 full data transfer flag

< dma2 channel7 full data transfer flag

< dma full data transfer interrupt

< dma1 channel1 full data transfer flag

< dma1 channel2 full data transfer flag

< dma1 channel3 full data transfer flag

< dma1 channel4 full data transfer flag

< dma1 channel5 full data transfer flag

< dma1 channel6 full data transfer flag

< dma1 channel7 full data transfer flag

< dma2 channel1 full data transfer flag

< dma2 channel2 full data transfer flag

< dma2 channel3 full data transfer flag

< dma2 channel4 full data transfer flag

< dma2 channel5 full data transfer flag

< dma2 channel6 full data transfer flag

< dma2 channel7 full data transfer flag

< i2c transmit data complete flag

< check flag none

< i2c acknowledge failure flag

< check flag none

< i2c acknowledge failure flag

Definition at line 2145 of file i2c_application.c.

Referenced by DMA1_Channel6_IRQHandler().

◆ i2c_err_irq_handler()

void i2c_err_irq_handler ( i2c_handle_type * hi2c )

i2c error interrupt function.

Parameters
hi2c the handle points to the operation information.
Return values
none.

< i2c bus error flag

< i2c bus error flag

< i2c arbitration lost flag

< i2c arbitration lost flag

< i2c acknowledge failure flag

< i2c acknowledge failure flag

< i2c overflow or underflow flag

< i2c overflow or underflow flag

< i2c pec receive error flag

< i2c pec receive error flag

< i2c smbus timeout flag

< i2c smbus timeout flag

< i2c smbus alert flag

< i2c smbus alert flag

< i2c error interrupt

Definition at line 2243 of file i2c_application.c.

Referenced by I2C1_ERR_IRQHandler().

◆ i2c_evt_irq_handler()

void i2c_evt_irq_handler ( i2c_handle_type * hi2c )

interrupt procession function.

Parameters
hi2c the handle points to the operation information.
Return values
none.

Definition at line 2119 of file i2c_application.c.

Referenced by I2C1_EVT_IRQHandler().

◆ i2c_master_read_addr()

i2c_status_type i2c_master_read_addr | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint32_t | timeout
 | ) |  |

send address in master receive mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
timeout | maximum waiting time.
Return values
i2c status.

< i2c start condition generation complete flag

< check flag none

< i2c master 9~8 bit address header match flag

< check flag ackfail

< i2c 0~7 bit address match flag

< check flag ackfail

< i2c start condition generation complete flag

< check flag none

< i2c 0~7 bit address match flag

< check flag ackfail

Definition at line 319 of file i2c_application.c.

Referenced by i2c_master_receive(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_memory_read(), i2c_memory_read_dma(), and i2c_memory_read_int().

◆ i2c_master_receive()

i2c_status_type i2c_master_receive | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the master receive data through polling mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c receive data buffer full flag

< check flag none

< i2c transmit data complete flag

< check flag none

< i2c transmit data complete flag

< check flag none

< i2c transmit data complete flag

< check flag none

< i2c receive data buffer full flag

< check flag none

Definition at line 545 of file i2c_application.c.

Referenced by main().

◆ i2c_master_receive_dma()

i2c_status_type i2c_master_receive_dma | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the master receive data through dma mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

Definition at line 1149 of file i2c_application.c.

Referenced by main().

◆ i2c_master_receive_int()

i2c_status_type i2c_master_receive_int | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the master receive data through interrupt mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 898 of file i2c_application.c.

Referenced by main().

◆ i2c_master_rx_isr_int()

void i2c_master_rx_isr_int ( i2c_handle_type * hi2c )

master receive mode interrupt procession function

Parameters
hi2c the handle points to the operation information.
Return values
none.

< i2c transmit data complete flag

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

< i2c receive data buffer full flag

< i2c data transmission interrupt

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 1979 of file i2c_application.c.

Referenced by i2c_evt_irq_handler().

◆ i2c_master_transmit()

i2c_status_type i2c_master_transmit | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the master transmits data through polling mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data complete flag

< check flag ackfail

Definition at line 402 of file i2c_application.c.

Referenced by audio_codec_init(), audio_codec_loop(), audio_codec_modify_freq(), and main().

◆ i2c_master_transmit_dma()

i2c_status_type i2c_master_transmit_dma | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the master transmits data through dma mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

Definition at line 1039 of file i2c_application.c.

Referenced by main().

◆ i2c_master_transmit_int()

i2c_status_type i2c_master_transmit_int | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the master transmits data through interrupt mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 803 of file i2c_application.c.

Referenced by main().

◆ i2c_master_tx_isr_int()

void i2c_master_tx_isr_int ( i2c_handle_type * hi2c )

master transfer mode interrupt procession function

Parameters
hi2c the handle points to the operation information.
Return values
none.

< i2c transmit data buffer empty flag

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 1949 of file i2c_application.c.

Referenced by i2c_evt_irq_handler().

◆ i2c_master_write_addr()

i2c_status_type i2c_master_write_addr | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint32_t | timeout
 | ) |  |

send address in master transmits mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
timeout | maximum waiting time.
Return values
i2c status.

< i2c start condition generation complete flag

< check flag none

< i2c master 9~8 bit address header match flag

< check flag ackfail

< i2c 0~7 bit address match flag

< check flag ackfail

Definition at line 266 of file i2c_application.c.

Referenced by i2c_master_transmit(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write(), i2c_memory_write_dma(), and i2c_memory_write_int().

◆ i2c_memory_read()

i2c_status_type i2c_memory_read | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint16_t | memaddress,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

read data from memory device through polling mode.

Parameters
hi2c | the handle points to the operation information.
address | memory device address.
memaddress | memory address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c receive data buffer full flag

< check flag none

< i2c transmit data complete flag

< check flag none

< i2c transmit data complete flag

< check flag none

< i2c transmit data complete flag

< check flag none

< i2c receive data buffer full flag

< check flag none

Definition at line 1381 of file i2c_application.c.

Referenced by main().

◆ i2c_memory_read_dma()

i2c_status_type i2c_memory_read_dma | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint16_t | memaddress,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

read data from memory device through polling mode.

Parameters
hi2c | the handle points to the operation information.
address | memory device address.
memaddress | memory address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data buffer empty flag

< check flag ackfail

Definition at line 1843 of file i2c_application.c.

Referenced by main().

◆ i2c_memory_read_int()

i2c_status_type i2c_memory_read_int | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint16_t | memaddress,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

read data from memory device through interrupt mode.

Parameters
hi2c | the handle points to the operation information.
address | memory device address.
memaddress | memory address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 1657 of file i2c_application.c.

Referenced by main().

◆ i2c_memory_write()

i2c_status_type i2c_memory_write | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint16_t | memaddress,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

write data to the memory device through polling mode.

Parameters
hi2c | the handle points to the operation information.
address | memory device address.
memaddress | memory address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data complete flag

< check flag ackfail

Definition at line 1299 of file i2c_application.c.

Referenced by main().

◆ i2c_memory_write_dma()

i2c_status_type i2c_memory_write_dma | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint16_t | memaddress,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

write data to the memory device through dma mode.

Parameters
hi2c | the handle points to the operation information.
address | memory device address.
memaddress | memory address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data buffer empty flag

< check flag ackfail

Definition at line 1767 of file i2c_application.c.

Referenced by main().

◆ i2c_memory_write_int()

i2c_status_type i2c_memory_write_int | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint16_t | memaddress,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

write data to the memory device through interrupt mode.

Parameters
hi2c | the handle points to the operation information.
address | memory device address.
memaddress | memory address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 1587 of file i2c_application.c.

Referenced by main().

◆ i2c_slave_receive()

i2c_status_type i2c_slave_receive | ( | i2c_handle_type * | hi2c,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the slave receive data through polling mode.

Parameters
hi2c | the handle points to the operation information.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c receive data buffer full flag

< check flag stop

< i2c stop condition generation complete flag

< check flag ackfail

Definition at line 470 of file i2c_application.c.

Referenced by main().

◆ i2c_slave_receive_dma()

i2c_status_type i2c_slave_receive_dma | ( | i2c_handle_type * | hi2c,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the slave receive data through dma mode.

Parameters
hi2c | the handle points to the operation information.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c 0~7 bit address match flag

< check flag none

Definition at line 1092 of file i2c_application.c.

Referenced by main().

◆ i2c_slave_receive_int()

i2c_status_type i2c_slave_receive_int | ( | i2c_handle_type * | hi2c,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the slave receive data through interrupt mode.

Parameters
hi2c | the handle points to the operation information.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 850 of file i2c_application.c.

Referenced by main().

◆ i2c_slave_rx_isr_int()

void i2c_slave_rx_isr_int ( i2c_handle_type * hi2c )

slave receive mode interrupt procession function

Parameters
hi2c the handle points to the operation information.
Return values
none.

< i2c receive data buffer full flag

< i2c stop condition generation complete flag

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 2086 of file i2c_application.c.

Referenced by i2c_evt_irq_handler().

◆ i2c_slave_transmit()

i2c_status_type i2c_slave_transmit | ( | i2c_handle_type * | hi2c,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the slave transmits data through polling mode.

Parameters
hi2c | the handle points to the operation information.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c acknowledge failure flag

< check flag none

< i2c acknowledge failure flag

Definition at line 716 of file i2c_application.c.

Referenced by main().

◆ i2c_slave_transmit_dma()

i2c_status_type i2c_slave_transmit_dma | ( | i2c_handle_type * | hi2c,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the slave transmits data through dma mode.

Parameters
hi2c | the handle points to the operation information.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c 0~7 bit address match flag

< check flag none

Definition at line 1225 of file i2c_application.c.

Referenced by main().

◆ i2c_slave_transmit_int()

i2c_status_type i2c_slave_transmit_int | ( | i2c_handle_type * | hi2c,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the slave transmits data through interrupt mode.

Parameters
hi2c | the handle points to the operation information.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 976 of file i2c_application.c.

Referenced by main().

◆ i2c_slave_tx_isr_int()

void i2c_slave_tx_isr_int ( i2c_handle_type * hi2c )

slave transfer mode interrupt procession function

Parameters
hi2c the handle points to the operation information.
Return values
none.

< i2c transmit data buffer empty flag

< i2c data transmission interrupt

< i2c event interrupt

< i2c error interrupt

< i2c acknowledge failure flag

< check flag none

< i2c acknowledge failure flag

Definition at line 2052 of file i2c_application.c.

Referenced by i2c_evt_irq_handler().

◆ i2c_stop_flag_clear()

void i2c_stop_flag_clear ( i2c_handle_type * hi2c )

clear the stop flag.

Parameters
hi2c the handle points to the operation information.
Return values
none.

Definition at line 133 of file i2c_application.c.

Referenced by i2c_dma_rx_irq_handler(), i2c_slave_receive(), i2c_slave_rx_isr_int(), and i2c_wait_flag().

◆ i2c_wait_end()

i2c_status_type i2c_wait_end | ( | i2c_handle_type * | hi2c,
 |  | uint32_t | timeout
 | ) |  |

wait for the transfer to end.

Parameters
hi2c | the handle points to the operation information.
timeout | maximum waiting time.
Return values
i2c status.

Definition at line 148 of file i2c_application.c.

Referenced by main().

◆ i2c_wait_flag()

i2c_status_type i2c_wait_flag | ( | i2c_handle_type * | hi2c,
 |  | uint32_t | flag,
 |  | flag_status | status,
 |  | uint32_t | event_check,
 |  | uint32_t | timeout
 | ) |  |

wait for the flag.

Parameters
hi2c | the handle points to the operation information.
flag | flag to wait.
status | status to wait.
event_check flag to check while waiting for the flag. parameter as following values:
  • I2C_EVENT_CHECK_NONE
  • I2C_EVENT_CHECK_ACKFAIL
  • I2C_EVENT_CHECK_STOP
timeout | maximum waiting time.
Return values
i2c status.

< check flag ackfail

< i2c acknowledge failure flag

< i2c acknowledge failure flag

< check flag stop

< i2c stop condition generation complete flag

Definition at line 182 of file i2c_application.c.

Referenced by i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), i2c_master_read_addr(), i2c_master_receive(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_transmit(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_master_write_addr(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write(), i2c_memory_write_dma(), i2c_memory_write_int(), i2c_slave_receive(), i2c_slave_receive_dma(), i2c_slave_receive_int(), i2c_slave_transmit(), i2c_slave_transmit_dma(), i2c_slave_transmit_int(), and i2c_slave_tx_isr_int().


AT32F415 Firmwary Library: I2C_library_event_check_flag

Macros
I2C_library_event_check_flag
AT32F415_middlewares_i2c_application_library

Macros

#define | I2C_EVENT_CHECK_NONE ((uint32_t)0x00000000)
#define | I2C_EVENT_CHECK_ACKFAIL ((uint32_t)0x00000001)
#define | I2C_EVENT_CHECK_STOP ((uint32_t)0x00000002)

Detailed Description

Macro Definition Documentation

◆ I2C_EVENT_CHECK_ACKFAIL

#define I2C_EVENT_CHECK_ACKFAIL ((uint32_t)0x00000001)

check flag ackfail

Definition at line 48 of file i2c_application.h.

◆ I2C_EVENT_CHECK_NONE

#define I2C_EVENT_CHECK_NONE ((uint32_t)0x00000000)

check flag none

Definition at line 47 of file i2c_application.h.

◆ I2C_EVENT_CHECK_STOP

#define I2C_EVENT_CHECK_STOP ((uint32_t)0x00000002)

check flag stop

Definition at line 49 of file i2c_application.h.


AT32F415 Firmwary Library: I2C_library_transmission_mode

Enumerations
I2C_library_transmission_mode
AT32F415_middlewares_i2c_application_library

Enumerations

enum i2c_mode_type {
I2C_INT_MA_TX = 0 , I2C_INT_MA_RX , I2C_INT_SLA_TX , I2C_INT_SLA_RX ,
I2C_DMA_MA_TX , I2C_DMA_MA_RX , I2C_DMA_SLA_TX , I2C_DMA_SLA_RX
}

Detailed Description

Enumeration Type Documentation

◆ i2c_mode_type

enum i2c_mode_type
Enumerator
I2C_INT_MA_TX
I2C_INT_MA_RX
I2C_INT_SLA_TX
I2C_INT_SLA_RX
I2C_DMA_MA_TX
I2C_DMA_MA_RX
I2C_DMA_SLA_TX
I2C_DMA_SLA_RX

Definition at line 59 of file i2c_application.h.


AT32F415 Firmwary Library: I2C_library_status_code

Enumerations
I2C_library_status_code
AT32F415_middlewares_i2c_application_library

Enumerations

enum i2c_status_type {
I2C_OK = 0 , I2C_ERR_STEP_1 , I2C_ERR_STEP_2 , I2C_ERR_STEP_3 ,
I2C_ERR_STEP_4 , I2C_ERR_STEP_5 , I2C_ERR_STEP_6 , I2C_ERR_STEP_7 ,
I2C_ERR_STEP_8 , I2C_ERR_STEP_9 , I2C_ERR_STEP_10 , I2C_ERR_STEP_11 ,
I2C_ERR_STEP_12 , I2C_ERR_START , I2C_ERR_ADDR10 , I2C_ERR_ADDR ,
I2C_ERR_STOP , I2C_ERR_ACKFAIL , I2C_ERR_TIMEOUT , I2C_ERR_INTERRUPT
}

Detailed Description

Enumeration Type Documentation

◆ i2c_status_type

enum i2c_status_type
Enumerator
I2C_OK | no error
I2C_ERR_STEP_1 | step 1 error
I2C_ERR_STEP_2 | step 2 error
I2C_ERR_STEP_3 | step 3 error
I2C_ERR_STEP_4 | step 4 error
I2C_ERR_STEP_5 | step 5 error
I2C_ERR_STEP_6 | step 6 error
I2C_ERR_STEP_7 | step 7 error
I2C_ERR_STEP_8 | step 8 error
I2C_ERR_STEP_9 | step 9 error
I2C_ERR_STEP_10 | step 10 error
I2C_ERR_STEP_11 | step 11 error
I2C_ERR_STEP_12 | step 12 error
I2C_ERR_START | start error
I2C_ERR_ADDR10 | addr10 error
I2C_ERR_ADDR | addr error
I2C_ERR_STOP | stop error
I2C_ERR_ACKFAIL | ackfail error
I2C_ERR_TIMEOUT | timeout error
I2C_ERR_INTERRUPT | interrupt error

Definition at line 80 of file i2c_application.h.


AT32F415 Firmwary Library: I2C_library_handler

Data Structures
I2C_library_handler
AT32F415_middlewares_i2c_application_library

Data Structures

struct i2c_handle_type

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: i2c_handle_type Struct Reference

Data Fields
i2c_handle_type Struct Reference
AT32F415_middlewares_i2c_application_library » I2C_library_handler

#include <i2c_application.h>

Data Fields

i2c_type * i2cx
uint8_t * | pbuff
__IO uint16_t | psize
__IO uint16_t | pcount
__IO uint32_t | mode
__IO uint32_t | timeout
__IO uint32_t | status
__IO i2c_status_type | error_code
dma_channel_type * dma_tx_channel
dma_channel_type * dma_rx_channel
dma_init_type dma_init_struct

Detailed Description

Definition at line 113 of file i2c_application.h.

Field Documentation

◆ dma_init_struct

dma_init_type i2c_handle_type::dma_init_struct

dma init parameters

Definition at line 125 of file i2c_application.h.

Referenced by i2c_dma_config(), and i2c_lowlevel_init().

◆ dma_rx_channel

dma_channel_type* i2c_handle_type::dma_rx_channel

dma receive channel

Definition at line 124 of file i2c_application.h.

Referenced by i2c_dma_rx_irq_handler(), i2c_lowlevel_init(), i2c_master_receive_dma(), i2c_memory_read_dma(), and i2c_slave_receive_dma().

◆ dma_tx_channel

dma_channel_type* i2c_handle_type::dma_tx_channel

dma transmit channel

Definition at line 123 of file i2c_application.h.

Referenced by i2c_dma_config(), i2c_dma_tx_irq_handler(), i2c_lowlevel_init(), i2c_master_transmit_dma(), i2c_memory_write_dma(), and i2c_slave_transmit_dma().

◆ error_code

__IO i2c_status_type i2c_handle_type::error_code

i2c error code

Definition at line 122 of file i2c_application.h.

Referenced by i2c_err_irq_handler(), i2c_master_read_addr(), i2c_master_receive(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_transmit(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_master_write_addr(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write(), i2c_memory_write_dma(), i2c_memory_write_int(), i2c_slave_receive(), i2c_slave_receive_dma(), i2c_slave_receive_int(), i2c_slave_transmit(), i2c_slave_transmit_dma(), i2c_slave_transmit_int(), i2c_wait_end(), and i2c_wait_flag().

◆ i2cx

i2c_type* i2c_handle_type::i2cx

i2c registers base address

Definition at line 115 of file i2c_application.h.

Referenced by audio_codec_init(), i2c_addr_flag_clear(), i2c_config(), i2c_dma_config(), i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), i2c_err_irq_handler(), i2c_lowlevel_init(), i2c_master_read_addr(), i2c_master_receive(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_rx_isr_int(), i2c_master_transmit(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_master_tx_isr_int(), i2c_master_write_addr(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write(), i2c_memory_write_dma(), i2c_memory_write_int(), i2c_slave_receive(), i2c_slave_receive_dma(), i2c_slave_receive_int(), i2c_slave_rx_isr_int(), i2c_slave_transmit(), i2c_slave_transmit_dma(), i2c_slave_transmit_int(), i2c_slave_tx_isr_int(), i2c_stop_flag_clear(), i2c_wait_flag(), and main().

◆ mode

__IO uint32_t i2c_handle_type::mode

i2c communication mode

Definition at line 119 of file i2c_application.h.

Referenced by i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), i2c_evt_irq_handler(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write_dma(), i2c_memory_write_int(), i2c_slave_receive_dma(), i2c_slave_receive_int(), i2c_slave_transmit_dma(), and i2c_slave_transmit_int().

◆ pbuff

uint8_t* i2c_handle_type::pbuff

pointer to i2c transfer buffer

Definition at line 116 of file i2c_application.h.

Referenced by i2c_master_receive(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_rx_isr_int(), i2c_master_transmit(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_master_tx_isr_int(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write(), i2c_memory_write_dma(), i2c_memory_write_int(), i2c_slave_receive(), i2c_slave_receive_dma(), i2c_slave_receive_int(), i2c_slave_rx_isr_int(), i2c_slave_transmit(), i2c_slave_transmit_dma(), i2c_slave_transmit_int(), and i2c_slave_tx_isr_int().

◆ pcount

__IO uint16_t i2c_handle_type::pcount

i2c transfer counter

Definition at line 118 of file i2c_application.h.

Referenced by i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), i2c_master_receive(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_rx_isr_int(), i2c_master_transmit(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_master_tx_isr_int(), i2c_memory_read(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write(), i2c_memory_write_dma(), i2c_memory_write_int(), i2c_slave_receive(), i2c_slave_receive_dma(), i2c_slave_receive_int(), i2c_slave_rx_isr_int(), i2c_slave_transmit(), i2c_slave_transmit_dma(), i2c_slave_transmit_int(), and i2c_slave_tx_isr_int().

◆ psize

__IO uint16_t i2c_handle_type::psize

i2c transfer size

Definition at line 117 of file i2c_application.h.

◆ status

__IO uint32_t i2c_handle_type::status

i2c communication status

Definition at line 121 of file i2c_application.h.

Referenced by i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_rx_isr_int(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_master_tx_isr_int(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write_dma(), i2c_memory_write_int(), i2c_slave_receive_dma(), i2c_slave_receive_int(), i2c_slave_rx_isr_int(), i2c_slave_transmit_dma(), i2c_slave_transmit_int(), i2c_slave_tx_isr_int(), and i2c_wait_end().

◆ timeout

__IO uint32_t i2c_handle_type::timeout

i2c wait time

Definition at line 120 of file i2c_application.h.

Referenced by i2c_dma_rx_irq_handler(), i2c_dma_tx_irq_handler(), i2c_master_receive_dma(), i2c_master_receive_int(), i2c_master_transmit_dma(), i2c_master_transmit_int(), i2c_memory_read_dma(), i2c_memory_read_int(), i2c_memory_write_dma(), i2c_memory_write_int(), i2c_slave_receive_dma(), i2c_slave_receive_int(), i2c_slave_transmit_dma(), i2c_slave_transmit_int(), and i2c_slave_tx_isr_int().

The documentation for this struct was generated from the following file:
  • i2c_application.h


AT32F415 Firmwary Library: I2C_library_exported_functions

Functions
I2C_library_exported_functions
AT32F415_middlewares_i2c_application_library

Functions

void | i2c_config (i2c_handle_type *hi2c)
i2c peripheral initialization. More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
i2c_status_type | i2c_wait_end (i2c_handle_type *hi2c, uint32_t timeout)
wait for the transfer to end. More...
i2c_status_type | i2c_master_transmit (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through polling mode. More...
i2c_status_type | i2c_master_receive (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through polling mode. More...
i2c_status_type | i2c_slave_transmit (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through polling mode. More...
i2c_status_type | i2c_slave_receive (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through polling mode. More...
i2c_status_type | i2c_master_transmit_int (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through interrupt mode. More...
i2c_status_type | i2c_master_receive_int (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through interrupt mode. More...
i2c_status_type | i2c_slave_transmit_int (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through interrupt mode. More...
i2c_status_type | i2c_slave_receive_int (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through interrupt mode. More...
i2c_status_type | i2c_master_transmit_dma (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through dma mode. More...
i2c_status_type | i2c_master_receive_dma (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through dma mode. More...
i2c_status_type | i2c_slave_transmit_dma (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through dma mode. More...
i2c_status_type | i2c_slave_receive_dma (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through dma mode. More...
i2c_status_type | i2c_memory_write (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through polling mode. More...
i2c_status_type | i2c_memory_write_int (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through interrupt mode. More...
i2c_status_type | i2c_memory_write_dma (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through dma mode. More...
i2c_status_type | i2c_memory_read (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode. More...
i2c_status_type | i2c_memory_read_int (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through interrupt mode. More...
i2c_status_type | i2c_memory_read_dma (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode. More...
void | i2c_evt_irq_handler (i2c_handle_type *hi2c)
interrupt procession function. More...
void | i2c_err_irq_handler (i2c_handle_type *hi2c)
i2c error interrupt function. More...
void | i2c_dma_tx_irq_handler (i2c_handle_type *hi2c)
dma transmission complete interrupt function. More...
void | i2c_dma_rx_irq_handler (i2c_handle_type *hi2c)
dma reveive complete interrupt function. More...

Detailed Description

Function Documentation

◆ i2c_config()

void i2c_config ( i2c_handle_type * hi2c )

i2c peripheral initialization.

Parameters
hi2c the handle points to the operation information.
Return values
none.

Definition at line 102 of file i2c_application.c.

Referenced by audio_codec_init(), and main().

◆ i2c_dma_rx_irq_handler()

void i2c_dma_rx_irq_handler ( i2c_handle_type * hi2c )

dma reveive complete interrupt function.

Parameters
hi2c the handle points to the operation information.
Return values
none.

< dma1 channel1 full data transfer flag

< dma1 channel2 full data transfer flag

< dma1 channel3 full data transfer flag

< dma1 channel4 full data transfer flag

< dma1 channel5 full data transfer flag

< dma1 channel6 full data transfer flag

< dma1 channel7 full data transfer flag

< dma2 channel1 full data transfer flag

< dma2 channel2 full data transfer flag

< dma2 channel3 full data transfer flag

< dma2 channel4 full data transfer flag

< dma2 channel5 full data transfer flag

< dma2 channel6 full data transfer flag

< dma2 channel7 full data transfer flag

< dma full data transfer interrupt

< dma1 channel1 full data transfer flag

< dma1 channel2 full data transfer flag

< dma1 channel3 full data transfer flag

< dma1 channel4 full data transfer flag

< dma1 channel5 full data transfer flag

< dma1 channel6 full data transfer flag

< dma1 channel7 full data transfer flag

< dma2 channel1 full data transfer flag

< dma2 channel2 full data transfer flag

< dma2 channel3 full data transfer flag

< dma2 channel4 full data transfer flag

< dma2 channel5 full data transfer flag

< dma2 channel6 full data transfer flag

< dma2 channel7 full data transfer flag

< i2c acknowledge failure flag

< i2c stop condition generation complete flag

< check flag none

Definition at line 2194 of file i2c_application.c.

Referenced by DMA1_Channel7_IRQHandler().

◆ i2c_dma_tx_irq_handler()

void i2c_dma_tx_irq_handler ( i2c_handle_type * hi2c )

dma transmission complete interrupt function.

Parameters
hi2c the handle points to the operation information.
Return values
none.

< dma1 channel1 full data transfer flag

< dma1 channel2 full data transfer flag

< dma1 channel3 full data transfer flag

< dma1 channel4 full data transfer flag

< dma1 channel5 full data transfer flag

< dma1 channel6 full data transfer flag

< dma1 channel7 full data transfer flag

< dma2 channel1 full data transfer flag

< dma2 channel2 full data transfer flag

< dma2 channel3 full data transfer flag

< dma2 channel4 full data transfer flag

< dma2 channel5 full data transfer flag

< dma2 channel6 full data transfer flag

< dma2 channel7 full data transfer flag

< dma full data transfer interrupt

< dma1 channel1 full data transfer flag

< dma1 channel2 full data transfer flag

< dma1 channel3 full data transfer flag

< dma1 channel4 full data transfer flag

< dma1 channel5 full data transfer flag

< dma1 channel6 full data transfer flag

< dma1 channel7 full data transfer flag

< dma2 channel1 full data transfer flag

< dma2 channel2 full data transfer flag

< dma2 channel3 full data transfer flag

< dma2 channel4 full data transfer flag

< dma2 channel5 full data transfer flag

< dma2 channel6 full data transfer flag

< dma2 channel7 full data transfer flag

< i2c transmit data complete flag

< check flag none

< i2c acknowledge failure flag

< check flag none

< i2c acknowledge failure flag

Definition at line 2145 of file i2c_application.c.

Referenced by DMA1_Channel6_IRQHandler().

◆ i2c_err_irq_handler()

void i2c_err_irq_handler ( i2c_handle_type * hi2c )

i2c error interrupt function.

Parameters
hi2c the handle points to the operation information.
Return values
none.

< i2c bus error flag

< i2c bus error flag

< i2c arbitration lost flag

< i2c arbitration lost flag

< i2c acknowledge failure flag

< i2c acknowledge failure flag

< i2c overflow or underflow flag

< i2c overflow or underflow flag

< i2c pec receive error flag

< i2c pec receive error flag

< i2c smbus timeout flag

< i2c smbus timeout flag

< i2c smbus alert flag

< i2c smbus alert flag

< i2c error interrupt

Definition at line 2243 of file i2c_application.c.

Referenced by I2C1_ERR_IRQHandler().

◆ i2c_evt_irq_handler()

void i2c_evt_irq_handler ( i2c_handle_type * hi2c )

interrupt procession function.

Parameters
hi2c the handle points to the operation information.
Return values
none.

Definition at line 2119 of file i2c_application.c.

Referenced by I2C1_EVT_IRQHandler().

◆ i2c_lowlevel_init()

void i2c_lowlevel_init ( i2c_handle_type * hi2c )

initializes peripherals used by the i2c.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 7

< gpio pins number 6

< gpio pins number 7

< gpio pins number 6

< gpio pins number 7

< gpio pins number 6

< gpio pins number 7

< gpio pins number 6

< gpio pins number 7

Definition at line 117 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

Referenced by i2c_config().

◆ i2c_master_receive()

i2c_status_type i2c_master_receive | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the master receive data through polling mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c receive data buffer full flag

< check flag none

< i2c transmit data complete flag

< check flag none

< i2c transmit data complete flag

< check flag none

< i2c transmit data complete flag

< check flag none

< i2c receive data buffer full flag

< check flag none

Definition at line 545 of file i2c_application.c.

Referenced by main().

◆ i2c_master_receive_dma()

i2c_status_type i2c_master_receive_dma | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the master receive data through dma mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

Definition at line 1149 of file i2c_application.c.

Referenced by main().

◆ i2c_master_receive_int()

i2c_status_type i2c_master_receive_int | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the master receive data through interrupt mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 898 of file i2c_application.c.

Referenced by main().

◆ i2c_master_transmit()

i2c_status_type i2c_master_transmit | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the master transmits data through polling mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data complete flag

< check flag ackfail

Definition at line 402 of file i2c_application.c.

Referenced by audio_codec_init(), audio_codec_loop(), audio_codec_modify_freq(), and main().

◆ i2c_master_transmit_dma()

i2c_status_type i2c_master_transmit_dma | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the master transmits data through dma mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

Definition at line 1039 of file i2c_application.c.

Referenced by main().

◆ i2c_master_transmit_int()

i2c_status_type i2c_master_transmit_int | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the master transmits data through interrupt mode.

Parameters
hi2c | the handle points to the operation information.
address | slave address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 803 of file i2c_application.c.

Referenced by main().

◆ i2c_memory_read()

i2c_status_type i2c_memory_read | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint16_t | memaddress,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

read data from memory device through polling mode.

Parameters
hi2c | the handle points to the operation information.
address | memory device address.
memaddress | memory address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c receive data buffer full flag

< check flag none

< i2c transmit data complete flag

< check flag none

< i2c transmit data complete flag

< check flag none

< i2c transmit data complete flag

< check flag none

< i2c receive data buffer full flag

< check flag none

Definition at line 1381 of file i2c_application.c.

Referenced by main().

◆ i2c_memory_read_dma()

i2c_status_type i2c_memory_read_dma | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint16_t | memaddress,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

read data from memory device through polling mode.

Parameters
hi2c | the handle points to the operation information.
address | memory device address.
memaddress | memory address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data buffer empty flag

< check flag ackfail

Definition at line 1843 of file i2c_application.c.

Referenced by main().

◆ i2c_memory_read_int()

i2c_status_type i2c_memory_read_int | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint16_t | memaddress,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

read data from memory device through interrupt mode.

Parameters
hi2c | the handle points to the operation information.
address | memory device address.
memaddress | memory address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 1657 of file i2c_application.c.

Referenced by main().

◆ i2c_memory_write()

i2c_status_type i2c_memory_write | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint16_t | memaddress,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

write data to the memory device through polling mode.

Parameters
hi2c | the handle points to the operation information.
address | memory device address.
memaddress | memory address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data complete flag

< check flag ackfail

Definition at line 1299 of file i2c_application.c.

Referenced by main().

◆ i2c_memory_write_dma()

i2c_status_type i2c_memory_write_dma | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint16_t | memaddress,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

write data to the memory device through dma mode.

Parameters
hi2c | the handle points to the operation information.
address | memory device address.
memaddress | memory address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data buffer empty flag

< check flag ackfail

Definition at line 1767 of file i2c_application.c.

Referenced by main().

◆ i2c_memory_write_int()

i2c_status_type i2c_memory_write_int | ( | i2c_handle_type * | hi2c,
 |  | uint16_t | address,
 |  | uint16_t | memaddress,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

write data to the memory device through interrupt mode.

Parameters
hi2c | the handle points to the operation information.
address | memory device address.
memaddress | memory address.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 1587 of file i2c_application.c.

Referenced by main().

◆ i2c_slave_receive()

i2c_status_type i2c_slave_receive | ( | i2c_handle_type * | hi2c,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the slave receive data through polling mode.

Parameters
hi2c | the handle points to the operation information.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c receive data buffer full flag

< check flag stop

< i2c stop condition generation complete flag

< check flag ackfail

Definition at line 470 of file i2c_application.c.

Referenced by main().

◆ i2c_slave_receive_dma()

i2c_status_type i2c_slave_receive_dma | ( | i2c_handle_type * | hi2c,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the slave receive data through dma mode.

Parameters
hi2c | the handle points to the operation information.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c 0~7 bit address match flag

< check flag none

Definition at line 1092 of file i2c_application.c.

Referenced by main().

◆ i2c_slave_receive_int()

i2c_status_type i2c_slave_receive_int | ( | i2c_handle_type * | hi2c,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the slave receive data through interrupt mode.

Parameters
hi2c | the handle points to the operation information.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 850 of file i2c_application.c.

Referenced by main().

◆ i2c_slave_transmit()

i2c_status_type i2c_slave_transmit | ( | i2c_handle_type * | hi2c,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the slave transmits data through polling mode.

Parameters
hi2c | the handle points to the operation information.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c transmit data buffer empty flag

< check flag ackfail

< i2c acknowledge failure flag

< check flag none

< i2c acknowledge failure flag

Definition at line 716 of file i2c_application.c.

Referenced by main().

◆ i2c_slave_transmit_dma()

i2c_status_type i2c_slave_transmit_dma | ( | i2c_handle_type * | hi2c,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the slave transmits data through dma mode.

Parameters
hi2c | the handle points to the operation information.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c 0~7 bit address match flag

< check flag none

Definition at line 1225 of file i2c_application.c.

Referenced by main().

◆ i2c_slave_transmit_int()

i2c_status_type i2c_slave_transmit_int | ( | i2c_handle_type * | hi2c,
 |  | uint8_t * | pdata,
 |  | uint16_t | size,
 |  | uint32_t | timeout
 | ) |  |

the slave transmits data through interrupt mode.

Parameters
hi2c | the handle points to the operation information.
pdata | data buffer.
size | data size.
timeout | maximum waiting time.
Return values
i2c status.

< i2c bus busy flag transmission mode

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c 0~7 bit address match flag

< check flag none

< i2c event interrupt

< i2c data transmission interrupt

< i2c error interrupt

Definition at line 976 of file i2c_application.c.

Referenced by main().

◆ i2c_wait_end()

i2c_status_type i2c_wait_end | ( | i2c_handle_type * | hi2c,
 |  | uint32_t | timeout
 | ) |  |

wait for the transfer to end.

Parameters
hi2c | the handle points to the operation information.
timeout | maximum waiting time.
Return values
i2c status.

Definition at line 148 of file i2c_application.c.

Referenced by main().


AT32F415 Firmwary Library: AT32F415_middlewares_usb_drivers

Modules
AT32F415_middlewares_usb_drivers

Modules

USB_drivers_core
usb global drivers core
USB_standard

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: USB_drivers_core

Modules
USB_drivers_core
AT32F415_middlewares_usb_drivers

usb global drivers core More...

Modules

USB_core_exported_types
USB_core_private_functions

Detailed Description

usb global drivers core


AT32F415 Firmwary Library: USB_core_exported_types

Data Structures | Enumerations
USB_core_exported_types
AT32F415_middlewares_usb_drivers » USB_drivers_core

Data Structures

struct | usb_core_cfg
usb core cofig struct More...
struct | otg_core_type
usb otg core struct type More...

Enumerations

enum usb_speed_type { USB_LOW_SPEED_CORE_ID , USB_FULL_SPEED_CORE_ID , USB_HIGH_SPEED_CORE_ID }
usb core speed select More...

Detailed Description

Enumeration Type Documentation

◆ usb_speed_type

enum usb_speed_type

usb core speed select

Enumerator
USB_LOW_SPEED_CORE_ID | usb low speed core id
USB_FULL_SPEED_CORE_ID | usb full speed core id
USB_HIGH_SPEED_CORE_ID | usb high speed core id

Definition at line 61 of file usb_core.h.


AT32F415 Firmwary Library: usb_core_cfg Struct Reference

Data Fields
usb_core_cfg Struct Reference
AT32F415_middlewares_usb_drivers » USB_drivers_core » USB_core_exported_types

usb core cofig struct More...

#include <usb_core.h>

Data Fields

uint8_t | speed
uint8_t | dma_en
uint8_t | hc_num
uint8_t | ept_num
uint16_t | max_size
uint16_t | fifo_size
uint8_t | phy_itface
uint8_t | core_id
uint8_t | low_power
uint8_t | sof_out
uint8_t | usb_id
uint8_t | vbusig

Detailed Description

usb core cofig struct

Definition at line 71 of file usb_core.h.

Field Documentation

◆ core_id

uint8_t usb_core_cfg::core_id

the usb otg core id

Definition at line 81 of file usb_core.h.

Referenced by usb_core_config().

◆ dma_en

uint8_t usb_core_cfg::dma_en

dma enable state, not use

Definition at line 74 of file usb_core.h.

◆ ept_num

uint8_t usb_core_cfg::ept_num

the otg device support number of endpoint

Definition at line 76 of file usb_core.h.

Referenced by usb_core_config().

◆ fifo_size

uint16_t usb_core_cfg::fifo_size

the usb otg total file size

Definition at line 79 of file usb_core.h.

Referenced by usb_core_config().

◆ hc_num

uint8_t usb_core_cfg::hc_num

the otg host support number of channel

Definition at line 75 of file usb_core.h.

Referenced by usb_core_config().

◆ low_power

uint8_t usb_core_cfg::low_power

the usb otg low power option

Definition at line 82 of file usb_core.h.

◆ max_size

uint16_t usb_core_cfg::max_size

support max packet size

Definition at line 78 of file usb_core.h.

Referenced by usb_core_config().

◆ phy_itface

uint8_t usb_core_cfg::phy_itface

usb phy select

Definition at line 80 of file usb_core.h.

Referenced by usb_core_config().

◆ sof_out

uint8_t usb_core_cfg::sof_out

the sof signal output

Definition at line 83 of file usb_core.h.

Referenced by usb_core_config().

◆ speed

uint8_t usb_core_cfg::speed

otg speed

Definition at line 73 of file usb_core.h.

Referenced by usb_core_config().

◆ usb_id

uint8_t usb_core_cfg::usb_id

select otgfs1 or otgfs2

Definition at line 84 of file usb_core.h.

◆ vbusig

uint8_t usb_core_cfg::vbusig

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

Definition at line 86 of file usb_core.h.

Referenced by usb_core_config().

The documentation for this struct was generated from the following file:
  • usb_core.h


AT32F415 Firmwary Library: otg_core_type Struct Reference

Data Fields
otg_core_type Struct Reference
AT32F415_middlewares_usb_drivers » USB_drivers_core » USB_core_exported_types

usb otg core struct type More...

#include <usb_core.h>

Data Fields

usb_reg_type * usb_reg
usb_core_cfg cfg

Detailed Description

usb otg core struct type

Definition at line 100 of file usb_core.h.

Field Documentation

◆ cfg

usb_core_cfg otg_core_type::cfg

the usb otg core config type

Definition at line 111 of file usb_core.h.

Referenced by usb_core_config().

◆ usb_reg

usb_reg_type* otg_core_type::usb_reg

the usb otg register type

Definition at line 102 of file usb_core.h.

Referenced by usbd_irq_handler(), and usbh_irq_handler().

The documentation for this struct was generated from the following file:
  • usb_core.h


AT32F415 Firmwary Library: USB_core_private_functions

Functions
USB_core_private_functions
AT32F415_middlewares_usb_drivers » USB_drivers_core

Functions

usb_sts_type usb_core_config (otg_core_type *otgdev, uint8_t core_id)
usb core config More...

Detailed Description

Function Documentation

◆ usb_core_config()

usb_sts_type usb_core_config | ( | otg_core_type * | otgdev,
 |  | uint8_t | core_id
 | ) |  |

usb core config

Parameters
otgdev | to the structure of otg_core_type
core_id | usb core id number (USB_FULL_SPEED_CORE_ID)
Return values
usb_sts_type

Definition at line 49 of file usb_core.c.


AT32F415 Firmwary Library: USB_standard

Modules
USB_standard
AT32F415_middlewares_usb_drivers

Modules

USB_standard_define

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: USB_standard_define

Data Structures | Macros | Enumerations
USB_standard_define
AT32F415_middlewares_usb_drivers » USB_standard

Data Structures

struct | usb_setup_type
format of usb setup data More...
struct | usb_device_desc_type
format of standard device descriptor More...
struct | usb_configuration_desc_type
format of standard configuration descriptor More...
struct | usb_interface_desc_type
format of standard interface descriptor More...
struct | usb_endpoint_desc_type
format of standard endpoint descriptor More...
struct | usb_header_desc_type
format of header More...

Macros

#define | USB_REQ_RECIPIENT_DEVICE 0x00
usb request recipient More...
#define | USB_REQ_RECIPIENT_INTERFACE 0x01
#define | USB_REQ_RECIPIENT_ENDPOINT 0x02
#define | USB_REQ_RECIPIENT_OTHER 0x03
#define | USB_REQ_RECIPIENT_MASK 0x1F
#define | USB_REQ_TYPE_STANDARD 0x00
usb request type More...
#define | USB_REQ_TYPE_CLASS 0x20
#define | USB_REQ_TYPE_VENDOR 0x40
#define | USB_REQ_TYPE_RESERVED 0x60
#define | USB_REQ_DIR_HTD 0x00
usb request data transfer direction More...
#define | USB_REQ_DIR_DTH 0x80
#define | USB_STD_REQ_GET_STATUS 0
usb standard device requests codes More...
#define | USB_STD_REQ_CLEAR_FEATURE 1
#define | USB_STD_REQ_SET_FEATURE 3
#define | USB_STD_REQ_SET_ADDRESS 5
#define | USB_STD_REQ_GET_DESCRIPTOR 6
#define | USB_STD_REQ_SET_DESCRIPTOR 7
#define | USB_STD_REQ_GET_CONFIGURATION 8
#define | USB_STD_REQ_SET_CONFIGURATION 9
#define | USB_STD_REQ_GET_INTERFACE 10
#define | USB_STD_REQ_SET_INTERFACE 11
#define | USB_STD_REQ_SYNCH_FRAME 12
#define | USB_DESCIPTOR_TYPE_DEVICE 1
usb standard device type More...
#define | USB_DESCIPTOR_TYPE_CONFIGURATION 2
#define | USB_DESCIPTOR_TYPE_STRING 3
#define | USB_DESCIPTOR_TYPE_INTERFACE 4
#define | USB_DESCIPTOR_TYPE_ENDPOINT 5
#define | USB_DESCIPTOR_TYPE_DEVICE_QUALIFIER 6
#define | USB_DESCIPTOR_TYPE_OTHER_SPEED 7
#define | USB_DESCIPTOR_TYPE_INTERFACE_POWER 8
#define | USB_LANGID_STRING 0
usb standard string type More...
#define | USB_MFC_STRING 1
#define | USB_PRODUCT_STRING 2
#define | USB_SERIAL_STRING 3
#define | USB_CONFIG_STRING 4
#define | USB_INTERFACE_STRING 5
#define | USB_CONF_REMOTE_WAKEUP 2
usb configuration attributes More...
#define | USB_CONF_SELF_POWERED 1
#define | USB_FEATURE_EPT_HALT 0
usb standard feature selectors More...
#define | USB_FEATURE_REMOTE_WAKEUP 1
#define | USB_FEATURE_TEST_MODE 2
#define | USB_EPT0_IDLE 0
endpoint 0 state More...
#define | USB_EPT0_SETUP 1
#define | USB_EPT0_DATA_IN 2
#define | USB_EPT0_DATA_OUT 3
#define | USB_EPT0_STATUS_IN 4
#define | USB_EPT0_STATUS_OUT 5
#define | USB_EPT0_STALL 6
#define | USB_DEVICE_QUALIFIER_DESC_LEN 0x0A
usb descriptor length More...
#define | USB_DEVICE_DESC_LEN 0x12
#define | USB_DEVICE_CFG_DESC_LEN 0x09
#define | USB_DEVICE_IF_DESC_LEN 0x09
#define | USB_DEVICE_EPT_LEN 0x07
#define | USB_DEVICE_OTG_DESC_LEN 0x03
#define | USB_DEVICE_LANGID_STR_DESC_LEN 0x04
#define | USB_DEVICE_OTHER_SPEED_DESC_SIZ_LEN 0x09
#define | USB_CLASS_CODE_AUDIO 0x01
usb class code More...
#define | USB_CLASS_CODE_CDC 0x02
#define | USB_CLASS_CODE_HID 0x03
#define | USB_CLASS_CODE_PRINTER 0x07
#define | USB_CLASS_CODE_MSC 0x08
#define | USB_CLASS_CODE_HUB 0x09
#define | USB_CLASS_CODE_CDCDATA 0x0A
#define | USB_CLASS_CODE_CCID 0x0B
#define | USB_CLASS_CODE_VIDEO 0x0E
#define | USB_CLASS_CODE_VENDOR 0xFF
#define | USB_EPT_DESC_CONTROL 0x00
usb endpoint type More...
#define | USB_EPT_DESC_ISO 0x01
#define | USB_EPT_DESC_BULK 0x02
#define | USB_EPT_DESC_INTERRUPT 0x03
#define | USB_EPT_DESC_NSYNC 0x00
#define | USB_ETP_DESC_ASYNC 0x04
#define | USB_ETP_DESC_ADAPTIVE 0x08
#define | USB_ETP_DESC_SYNC 0x0C
#define | USB_EPT_DESC_DATA_EPT 0x00
#define | USB_EPT_DESC_FD_EPT 0x10
#define | USB_EPT_DESC_FDDATA_EPT 0x20
#define | USB_MAX_EP0_SIZE 64
endpoint 0 max size More...
#define | SWAPBYTE(addr)
usb swap address More...
#define | MIN(a, b) (uint16_t)(((a) < (b)) ? (a) : (b))
min and max define More...
#define | MAX(a, b) (uint16_t)(((a) > (b)) ? (a) : (b))
#define | LBYTE(x) ((uint8_t)(x & 0x00FF))
low byte and high byte define More...
#define | HBYTE(x) ((uint8_t)((x & 0xFF00) >>8))

Enumerations

enum usbd_conn_state { USB_CONN_STATE_DEFAULT =1 , USB_CONN_STATE_ADDRESSED , USB_CONN_STATE_CONFIGURED , USB_CONN_STATE_SUSPENDED }
usb device connect state More...
enum usb_sts_type {
USB_OK , USB_FAIL , USB_WAIT , USB_NOT_SUPPORT ,
USB_ERROR
}
usb return status More...

Detailed Description

Macro Definition Documentation

◆ HBYTE

#define HBYTE ( x ) ((uint8_t)((x & 0xFF00) >>8))

high byte define

Definition at line 211 of file usb_std.h.

◆ LBYTE

#define LBYTE ( x ) ((uint8_t)(x & 0x00FF))

low byte and high byte define

low byte define

Definition at line 210 of file usb_std.h.

◆ MAX

#define MAX | ( | a,
 |  | b
 | ) | (uint16_t)(((a) > (b)) ? (a) : (b))

max define

Definition at line 205 of file usb_std.h.

◆ MIN

#define MIN | ( | a,
 |  | b
 | ) | (uint16_t)(((a) < (b)) ? (a) : (b))

min and max define

min define

Definition at line 204 of file usb_std.h.

◆ SWAPBYTE

#define SWAPBYTE ( addr )
Value:
(uint16_t)(((uint16_t)(*((uint8_t *)(addr)))) + \
(((uint16_t)(*(((uint8_t *)(addr)) + 1))) << 8))

usb swap address

swap address

Definition at line 199 of file usb_std.h.

◆ USB_CLASS_CODE_AUDIO

#define USB_CLASS_CODE_AUDIO 0x01

usb class code

usb class code audio

Definition at line 161 of file usb_std.h.

◆ USB_CLASS_CODE_CCID

#define USB_CLASS_CODE_CCID 0x0B

usb class code ccid

Definition at line 168 of file usb_std.h.

◆ USB_CLASS_CODE_CDC

#define USB_CLASS_CODE_CDC 0x02

usb class code cdc

Definition at line 162 of file usb_std.h.

◆ USB_CLASS_CODE_CDCDATA

#define USB_CLASS_CODE_CDCDATA 0x0A

usb class code cdc data

Definition at line 167 of file usb_std.h.

◆ USB_CLASS_CODE_HID

#define USB_CLASS_CODE_HID 0x03

usb class code hid

Definition at line 163 of file usb_std.h.

◆ USB_CLASS_CODE_HUB

#define USB_CLASS_CODE_HUB 0x09

usb class code hub

Definition at line 166 of file usb_std.h.

◆ USB_CLASS_CODE_MSC

#define USB_CLASS_CODE_MSC 0x08

usb class code msc

Definition at line 165 of file usb_std.h.

◆ USB_CLASS_CODE_PRINTER

#define USB_CLASS_CODE_PRINTER 0x07

usb class code printer

Definition at line 164 of file usb_std.h.

◆ USB_CLASS_CODE_VENDOR

#define USB_CLASS_CODE_VENDOR 0xFF

usb class code vendor

Definition at line 170 of file usb_std.h.

◆ USB_CLASS_CODE_VIDEO

#define USB_CLASS_CODE_VIDEO 0x0E

usb class code video

Definition at line 169 of file usb_std.h.

◆ USB_CONF_REMOTE_WAKEUP

#define USB_CONF_REMOTE_WAKEUP 2

usb configuration attributes

usb configuration attributes remote wakeup

Definition at line 114 of file usb_std.h.

◆ USB_CONF_SELF_POWERED

#define USB_CONF_SELF_POWERED 1

usb configuration attributes self powered

Definition at line 115 of file usb_std.h.

◆ USB_CONFIG_STRING

#define USB_CONFIG_STRING 4

usb standard string type config

Definition at line 108 of file usb_std.h.

◆ USB_DESCIPTOR_TYPE_CONFIGURATION

#define USB_DESCIPTOR_TYPE_CONFIGURATION 2

usb standard device type configuration

Definition at line 93 of file usb_std.h.

◆ USB_DESCIPTOR_TYPE_DEVICE

#define USB_DESCIPTOR_TYPE_DEVICE 1

usb standard device type

usb standard device type device

Definition at line 92 of file usb_std.h.

◆ USB_DESCIPTOR_TYPE_DEVICE_QUALIFIER

#define USB_DESCIPTOR_TYPE_DEVICE_QUALIFIER 6

usb standard device type qualifier

Definition at line 97 of file usb_std.h.

◆ USB_DESCIPTOR_TYPE_ENDPOINT

#define USB_DESCIPTOR_TYPE_ENDPOINT 5

usb standard device type endpoint

Definition at line 96 of file usb_std.h.

◆ USB_DESCIPTOR_TYPE_INTERFACE

#define USB_DESCIPTOR_TYPE_INTERFACE 4

usb standard device type interface

Definition at line 95 of file usb_std.h.

◆ USB_DESCIPTOR_TYPE_INTERFACE_POWER

#define USB_DESCIPTOR_TYPE_INTERFACE_POWER 8

usb standard device type interface power

Definition at line 99 of file usb_std.h.

◆ USB_DESCIPTOR_TYPE_OTHER_SPEED

#define USB_DESCIPTOR_TYPE_OTHER_SPEED 7

usb standard device type other speed

Definition at line 98 of file usb_std.h.

◆ USB_DESCIPTOR_TYPE_STRING

#define USB_DESCIPTOR_TYPE_STRING 3

usb standard device type string

Definition at line 94 of file usb_std.h.

◆ USB_DEVICE_CFG_DESC_LEN

#define USB_DEVICE_CFG_DESC_LEN 0x09

usb configuration descriptor length

Definition at line 151 of file usb_std.h.

◆ USB_DEVICE_DESC_LEN

#define USB_DEVICE_DESC_LEN 0x12

usb device descriptor length

Definition at line 150 of file usb_std.h.

◆ USB_DEVICE_EPT_LEN

#define USB_DEVICE_EPT_LEN 0x07

usb endpoint descriptor length

Definition at line 153 of file usb_std.h.

◆ USB_DEVICE_IF_DESC_LEN

#define USB_DEVICE_IF_DESC_LEN 0x09

usb interface descriptor length

Definition at line 152 of file usb_std.h.

◆ USB_DEVICE_LANGID_STR_DESC_LEN

#define USB_DEVICE_LANGID_STR_DESC_LEN 0x04

usb lang id string descriptor length

Definition at line 155 of file usb_std.h.

◆ USB_DEVICE_OTG_DESC_LEN

#define USB_DEVICE_OTG_DESC_LEN 0x03

usb otg descriptor length

Definition at line 154 of file usb_std.h.

◆ USB_DEVICE_OTHER_SPEED_DESC_SIZ_LEN

#define USB_DEVICE_OTHER_SPEED_DESC_SIZ_LEN 0x09

usb other speed descriptor length

Definition at line 156 of file usb_std.h.

◆ USB_DEVICE_QUALIFIER_DESC_LEN

#define USB_DEVICE_QUALIFIER_DESC_LEN 0x0A

usb descriptor length

usb qualifier descriptor length

Definition at line 149 of file usb_std.h.

◆ USB_EPT0_DATA_IN

#define USB_EPT0_DATA_IN 2

usb endpoint state data in

Definition at line 140 of file usb_std.h.

◆ USB_EPT0_DATA_OUT

#define USB_EPT0_DATA_OUT 3

usb endpoint state data out

Definition at line 141 of file usb_std.h.

◆ USB_EPT0_IDLE

#define USB_EPT0_IDLE 0

endpoint 0 state

usb endpoint state idle

Definition at line 138 of file usb_std.h.

◆ USB_EPT0_SETUP

#define USB_EPT0_SETUP 1

usb endpoint state setup

Definition at line 139 of file usb_std.h.

◆ USB_EPT0_STALL

#define USB_EPT0_STALL 6

usb endpoint state stall

Definition at line 144 of file usb_std.h.

◆ USB_EPT0_STATUS_IN

#define USB_EPT0_STATUS_IN 4

usb endpoint state status in

Definition at line 142 of file usb_std.h.

◆ USB_EPT0_STATUS_OUT

#define USB_EPT0_STATUS_OUT 5

usb endpoint state status out

Definition at line 143 of file usb_std.h.

◆ USB_EPT_DESC_BULK

#define USB_EPT_DESC_BULK 0x02

usb endpoint description type bulk

Definition at line 177 of file usb_std.h.

◆ USB_EPT_DESC_CONTROL

#define USB_EPT_DESC_CONTROL 0x00

usb endpoint type

usb endpoint description type control

Definition at line 175 of file usb_std.h.

◆ USB_EPT_DESC_DATA_EPT

#define USB_EPT_DESC_DATA_EPT 0x00

usb endpoint description data

Definition at line 185 of file usb_std.h.

◆ USB_EPT_DESC_FD_EPT

#define USB_EPT_DESC_FD_EPT 0x10

usb endpoint description fd

Definition at line 186 of file usb_std.h.

◆ USB_EPT_DESC_FDDATA_EPT

#define USB_EPT_DESC_FDDATA_EPT 0x20

usb endpoint description fddata

Definition at line 187 of file usb_std.h.

◆ USB_EPT_DESC_INTERRUPT

#define USB_EPT_DESC_INTERRUPT 0x03

usb endpoint description type interrupt

Definition at line 178 of file usb_std.h.

◆ USB_EPT_DESC_ISO

#define USB_EPT_DESC_ISO 0x01

usb endpoint description type iso

Definition at line 176 of file usb_std.h.

◆ USB_EPT_DESC_NSYNC

#define USB_EPT_DESC_NSYNC 0x00

usb endpoint description nsync

Definition at line 180 of file usb_std.h.

◆ USB_ETP_DESC_ADAPTIVE

#define USB_ETP_DESC_ADAPTIVE 0x08

usb endpoint description adaptive

Definition at line 182 of file usb_std.h.

◆ USB_ETP_DESC_ASYNC

#define USB_ETP_DESC_ASYNC 0x04

usb endpoint description async

Definition at line 181 of file usb_std.h.

◆ USB_ETP_DESC_SYNC

#define USB_ETP_DESC_SYNC 0x0C

usb endpoint description sync

Definition at line 183 of file usb_std.h.

◆ USB_FEATURE_EPT_HALT

#define USB_FEATURE_EPT_HALT 0

usb standard feature selectors

usb standard feature selectors endpoint halt

Definition at line 120 of file usb_std.h.

◆ USB_FEATURE_REMOTE_WAKEUP

#define USB_FEATURE_REMOTE_WAKEUP 1

usb standard feature selectors remote wakeup

Definition at line 121 of file usb_std.h.

◆ USB_FEATURE_TEST_MODE

#define USB_FEATURE_TEST_MODE 2

usb standard feature selectors test mode

Definition at line 122 of file usb_std.h.

◆ USB_INTERFACE_STRING

#define USB_INTERFACE_STRING 5

usb standard string type interface

Definition at line 109 of file usb_std.h.

◆ USB_LANGID_STRING

#define USB_LANGID_STRING 0

usb standard string type

usb standard string type lang id

Definition at line 104 of file usb_std.h.

◆ USB_MAX_EP0_SIZE

#define USB_MAX_EP0_SIZE 64

endpoint 0 max size

usb endpoint 0 max size

Definition at line 192 of file usb_std.h.

◆ USB_MFC_STRING

#define USB_MFC_STRING 1

usb standard string type mfc

Definition at line 105 of file usb_std.h.

◆ USB_PRODUCT_STRING

#define USB_PRODUCT_STRING 2

usb standard string type product

Definition at line 106 of file usb_std.h.

◆ USB_REQ_DIR_DTH

#define USB_REQ_DIR_DTH 0x80

usb request data transfer direction device to host

Definition at line 72 of file usb_std.h.

◆ USB_REQ_DIR_HTD

#define USB_REQ_DIR_HTD 0x00

usb request data transfer direction

usb request data transfer direction host to device

Definition at line 71 of file usb_std.h.

◆ USB_REQ_RECIPIENT_DEVICE

#define USB_REQ_RECIPIENT_DEVICE 0x00

usb request recipient

usb request recipient device

Definition at line 54 of file usb_std.h.

◆ USB_REQ_RECIPIENT_ENDPOINT

#define USB_REQ_RECIPIENT_ENDPOINT 0x02

usb request recipient endpoint

Definition at line 56 of file usb_std.h.

◆ USB_REQ_RECIPIENT_INTERFACE

#define USB_REQ_RECIPIENT_INTERFACE 0x01

usb request recipient interface

Definition at line 55 of file usb_std.h.

◆ USB_REQ_RECIPIENT_MASK

#define USB_REQ_RECIPIENT_MASK 0x1F

usb request recipient mask

Definition at line 58 of file usb_std.h.

◆ USB_REQ_RECIPIENT_OTHER

#define USB_REQ_RECIPIENT_OTHER 0x03

usb request recipient other

Definition at line 57 of file usb_std.h.

◆ USB_REQ_TYPE_CLASS

#define USB_REQ_TYPE_CLASS 0x20

usb request type class

Definition at line 64 of file usb_std.h.

◆ USB_REQ_TYPE_RESERVED

#define USB_REQ_TYPE_RESERVED 0x60

usb request type reserved

Definition at line 66 of file usb_std.h.

◆ USB_REQ_TYPE_STANDARD

#define USB_REQ_TYPE_STANDARD 0x00

usb request type

usb request type standard

Definition at line 63 of file usb_std.h.

◆ USB_REQ_TYPE_VENDOR

#define USB_REQ_TYPE_VENDOR 0x40

usb request type vendor

Definition at line 65 of file usb_std.h.

◆ USB_SERIAL_STRING

#define USB_SERIAL_STRING 3

usb standard string type serial

Definition at line 107 of file usb_std.h.

◆ USB_STD_REQ_CLEAR_FEATURE

#define USB_STD_REQ_CLEAR_FEATURE 1

usb request code clear feature

Definition at line 78 of file usb_std.h.

◆ USB_STD_REQ_GET_CONFIGURATION

#define USB_STD_REQ_GET_CONFIGURATION 8

usb request code get configuration

Definition at line 83 of file usb_std.h.

◆ USB_STD_REQ_GET_DESCRIPTOR

#define USB_STD_REQ_GET_DESCRIPTOR 6

usb request code get descriptor

Definition at line 81 of file usb_std.h.

◆ USB_STD_REQ_GET_INTERFACE

#define USB_STD_REQ_GET_INTERFACE 10

usb request code get interface

Definition at line 85 of file usb_std.h.

◆ USB_STD_REQ_GET_STATUS

#define USB_STD_REQ_GET_STATUS 0

usb standard device requests codes

usb request code status

Definition at line 77 of file usb_std.h.

◆ USB_STD_REQ_SET_ADDRESS

#define USB_STD_REQ_SET_ADDRESS 5

usb request code address

Definition at line 80 of file usb_std.h.

◆ USB_STD_REQ_SET_CONFIGURATION

#define USB_STD_REQ_SET_CONFIGURATION 9

usb request code set configuration

Definition at line 84 of file usb_std.h.

◆ USB_STD_REQ_SET_DESCRIPTOR

#define USB_STD_REQ_SET_DESCRIPTOR 7

usb request code set descriptor

Definition at line 82 of file usb_std.h.

◆ USB_STD_REQ_SET_FEATURE

#define USB_STD_REQ_SET_FEATURE 3

usb request code feature

Definition at line 79 of file usb_std.h.

◆ USB_STD_REQ_SET_INTERFACE

#define USB_STD_REQ_SET_INTERFACE 11

usb request code set interface

Definition at line 86 of file usb_std.h.

◆ USB_STD_REQ_SYNCH_FRAME

#define USB_STD_REQ_SYNCH_FRAME 12

usb request code synch frame

Definition at line 87 of file usb_std.h.

Enumeration Type Documentation

◆ usb_sts_type

enum usb_sts_type

usb return status

Enumerator
USB_OK | usb status ok
USB_FAIL | usb status fail
USB_WAIT | usb status wait
USB_NOT_SUPPORT | usb status not support
USB_ERROR | usb status error

Definition at line 216 of file usb_std.h.

◆ usbd_conn_state

enum usbd_conn_state

usb device connect state

Enumerator
USB_CONN_STATE_DEFAULT | usb device connect state default
USB_CONN_STATE_ADDRESSED | usb device connect state address
USB_CONN_STATE_CONFIGURED | usb device connect state configured
USB_CONN_STATE_SUSPENDED | usb device connect state suspend

Definition at line 127 of file usb_std.h.


AT32F415 Firmwary Library: usb_setup_type Struct Reference

Data Fields
usb_setup_type Struct Reference
AT32F415_middlewares_usb_drivers » USB_standard » USB_standard_define

format of usb setup data More...

#include <usb_std.h>

Data Fields

uint8_t | bmRequestType
uint8_t | bRequest
uint16_t | wValue
uint16_t | wIndex
uint16_t | wLength

Detailed Description

format of usb setup data

Definition at line 229 of file usb_std.h.

Field Documentation

◆ bmRequestType

uint8_t usb_setup_type::bmRequestType

characteristics of request

Definition at line 231 of file usb_std.h.

Referenced by audio_req_set_cur(), cdc_class_setup_handler(), class_audio_setup_handler(), class_hid_setup_handler(), class_setup_handler(), keyboard_class_setup_handler(), usbd_device_request(), usbd_endpoint_request(), and usbd_setup_request_parse().

◆ bRequest

uint8_t usb_setup_type::bRequest

specific request

Definition at line 232 of file usb_std.h.

Referenced by cdc_class_setup_handler(), class_audio_setup_handler(), class_hid_setup_handler(), class_setup_handler(), keyboard_class_setup_handler(), usbd_endpoint_request(), and usbd_setup_request_parse().

◆ wIndex

uint16_t usb_setup_type::wIndex

word-sized field that varies according to request typically used to pass an index or offset

Definition at line 234 of file usb_std.h.

Referenced by audio_get_interface(), audio_req_get_cur(), audio_req_get_max(), audio_req_get_min(), audio_req_get_res(), audio_req_set_cur(), audio_set_interface(), class_ept0_rx_handler(), class_setup_handler(), usbd_endpoint_request(), usbd_set_address(), usbd_set_configuration(), and usbd_setup_request_parse().

◆ wLength

uint16_t usb_setup_type::wLength

number of bytes to transfer if there is a data stage

Definition at line 236 of file usb_std.h.

Referenced by audio_req_get_cur(), audio_req_get_max(), audio_req_get_min(), audio_req_get_res(), audio_req_set_cur(), cdc_class_setup_handler(), class_audio_setup_handler(), class_hid_setup_handler(), class_setup_handler(), keyboard_class_setup_handler(), usbd_get_configuration(), usbd_interface_request(), usbd_set_address(), usbd_set_configuration(), and usbd_setup_request_parse().

◆ wValue

uint16_t usb_setup_type::wValue

word-sized field that varies according to request

Definition at line 233 of file usb_std.h.

Referenced by audio_req_get_cur(), audio_req_set_cur(), audio_set_interface(), cdc_class_setup_handler(), class_audio_setup_handler(), class_hid_setup_handler(), class_setup_handler(), keyboard_class_setup_handler(), usbd_clear_feature(), usbd_endpoint_request(), usbd_set_address(), usbd_set_configuration(), usbd_set_feature(), and usbd_setup_request_parse().

The documentation for this struct was generated from the following file:
  • usb_std.h


AT32F415 Firmwary Library: usb_device_desc_type Struct Reference

Data Fields
usb_device_desc_type Struct Reference
AT32F415_middlewares_usb_drivers » USB_standard » USB_standard_define

format of standard device descriptor More...

#include <usb_std.h>

Data Fields

uint8_t | bLength
uint8_t | bDescriptorType
uint16_t | bcdUSB
uint8_t | bDeviceClass
uint8_t | bDeviceSubClass
uint8_t | bDeviceProtocol
uint8_t | bMaxPacketSize0
uint16_t | idVendor
uint16_t | idProduct
uint16_t | bcdDevice
uint8_t | iManufacturer
uint8_t | iProduct
uint8_t | iSerialNumber
uint8_t | bNumConfigurations

Detailed Description

format of standard device descriptor

Definition at line 242 of file usb_std.h.

Field Documentation

◆ bcdDevice

uint16_t usb_device_desc_type::bcdDevice

device release number in binary-coded decimal

Definition at line 253 of file usb_std.h.

◆ bcdUSB

uint16_t usb_device_desc_type::bcdUSB

usb specification release number

Definition at line 246 of file usb_std.h.

◆ bDescriptorType

uint8_t usb_device_desc_type::bDescriptorType

device descriptor type

Definition at line 245 of file usb_std.h.

◆ bDeviceClass

uint8_t usb_device_desc_type::bDeviceClass

class code (assigned by the usb-if)

Definition at line 247 of file usb_std.h.

◆ bDeviceProtocol

uint8_t usb_device_desc_type::bDeviceProtocol

protocol code ((assigned by the usb-if))

Definition at line 249 of file usb_std.h.

◆ bDeviceSubClass

uint8_t usb_device_desc_type::bDeviceSubClass

subclass code (assigned by the usb-if)

Definition at line 248 of file usb_std.h.

◆ bLength

uint8_t usb_device_desc_type::bLength

size of this descriptor in bytes

Definition at line 244 of file usb_std.h.

◆ bMaxPacketSize0

uint8_t usb_device_desc_type::bMaxPacketSize0

maximum packet size for endpoint zero

Definition at line 250 of file usb_std.h.

◆ bNumConfigurations

uint8_t usb_device_desc_type::bNumConfigurations

number of possible configurations

Definition at line 257 of file usb_std.h.

◆ idProduct

uint16_t usb_device_desc_type::idProduct

product id ((assigned by the usb-if))

Definition at line 252 of file usb_std.h.

◆ idVendor

uint16_t usb_device_desc_type::idVendor

verndor id ((assigned by the usb-if))

Definition at line 251 of file usb_std.h.

◆ iManufacturer

uint8_t usb_device_desc_type::iManufacturer

index of string descriptor describing manufacturer

Definition at line 254 of file usb_std.h.

◆ iProduct

uint8_t usb_device_desc_type::iProduct

index of string descriptor describing product

Definition at line 255 of file usb_std.h.

◆ iSerialNumber

uint8_t usb_device_desc_type::iSerialNumber

index of string descriptor describing serial number

Definition at line 256 of file usb_std.h.

The documentation for this struct was generated from the following file:
  • usb_std.h


AT32F415 Firmwary Library: usb_configuration_desc_type Struct Reference

Data Fields
usb_configuration_desc_type Struct Reference
AT32F415_middlewares_usb_drivers » USB_standard » USB_standard_define

format of standard configuration descriptor More...

#include <usb_std.h>

Data Fields

uint8_t | bLength
uint8_t | bDescriptorType
uint16_t | wTotalLength
uint8_t | bNumInterfaces
uint8_t | bConfigurationValue
uint8_t | iConfiguration
uint8_t | bmAttributes
uint8_t | bMaxPower

Detailed Description

format of standard configuration descriptor

Definition at line 263 of file usb_std.h.

Field Documentation

◆ bConfigurationValue

uint8_t usb_configuration_desc_type::bConfigurationValue

value to use as an argument to the SetConfiguration() request

Definition at line 269 of file usb_std.h.

◆ bDescriptorType

uint8_t usb_configuration_desc_type::bDescriptorType

configuration descriptor type

Definition at line 266 of file usb_std.h.

◆ bLength

uint8_t usb_configuration_desc_type::bLength

size of this descriptor in bytes

Definition at line 265 of file usb_std.h.

◆ bmAttributes

uint8_t usb_configuration_desc_type::bmAttributes

configuration characteristics D7 reserved D6 self-powered D5 remote wakeup D4~D0 reserved

Definition at line 271 of file usb_std.h.

◆ bMaxPower

uint8_t usb_configuration_desc_type::bMaxPower

maximum power consumption of the usb device from the bus

Definition at line 276 of file usb_std.h.

◆ bNumInterfaces

uint8_t usb_configuration_desc_type::bNumInterfaces

number of interfaces supported by this configuration

Definition at line 268 of file usb_std.h.

◆ iConfiguration

uint8_t usb_configuration_desc_type::iConfiguration

index of string descriptor describing this configuration

Definition at line 270 of file usb_std.h.

◆ wTotalLength

uint16_t usb_configuration_desc_type::wTotalLength

total length of data returned for this configuration

Definition at line 267 of file usb_std.h.

The documentation for this struct was generated from the following file:
  • usb_std.h


AT32F415 Firmwary Library: usb_interface_desc_type Struct Reference

Data Fields
usb_interface_desc_type Struct Reference
AT32F415_middlewares_usb_drivers » USB_standard » USB_standard_define

format of standard interface descriptor More...

#include <usb_std.h>

Data Fields

uint8_t | bLength
uint8_t | bDescriptorType
uint8_t | bInterfaceNumber
uint8_t | bAlternateSetting
uint8_t | bNumEndpoints
uint8_t | bInterfaceClass
uint8_t | bInterfaceSubClass
uint8_t | bInterfaceProtocol
uint8_t | iInterface

Detailed Description

format of standard interface descriptor

Definition at line 284 of file usb_std.h.

Field Documentation

◆ bAlternateSetting

uint8_t usb_interface_desc_type::bAlternateSetting

value used to select this alternate setting for the interface

Definition at line 289 of file usb_std.h.

Referenced by usbh_parse_interface_desc().

◆ bDescriptorType

uint8_t usb_interface_desc_type::bDescriptorType

interface descriptor type

Definition at line 287 of file usb_std.h.

Referenced by usbh_parse_interface_desc().

◆ bInterfaceClass

uint8_t usb_interface_desc_type::bInterfaceClass

class code (assigned by the usb-if)

Definition at line 291 of file usb_std.h.

Referenced by usbh_parse_interface_desc().

◆ bInterfaceNumber

uint8_t usb_interface_desc_type::bInterfaceNumber

number of this interface

Definition at line 288 of file usb_std.h.

Referenced by usbh_parse_interface_desc().

◆ bInterfaceProtocol

uint8_t usb_interface_desc_type::bInterfaceProtocol

protocol code (assigned by the usb-if)

Definition at line 293 of file usb_std.h.

Referenced by usbh_parse_interface_desc().

◆ bInterfaceSubClass

uint8_t usb_interface_desc_type::bInterfaceSubClass

subclass code (assigned by the usb-if)

Definition at line 292 of file usb_std.h.

Referenced by usbh_parse_interface_desc().

◆ bLength

uint8_t usb_interface_desc_type::bLength

size of this descriptor in bytes

Definition at line 286 of file usb_std.h.

Referenced by usbh_parse_interface_desc().

◆ bNumEndpoints

uint8_t usb_interface_desc_type::bNumEndpoints

number of endpoints used by this interface

Definition at line 290 of file usb_std.h.

Referenced by usbh_parse_interface_desc().

◆ iInterface

uint8_t usb_interface_desc_type::iInterface

index of string descriptor describing this interface

Definition at line 294 of file usb_std.h.

Referenced by usbh_parse_interface_desc().

The documentation for this struct was generated from the following file:
  • usb_std.h


AT32F415 Firmwary Library: usb_endpoint_desc_type Struct Reference

Data Fields
usb_endpoint_desc_type Struct Reference
AT32F415_middlewares_usb_drivers » USB_standard » USB_standard_define

format of standard endpoint descriptor More...

#include <usb_std.h>

Data Fields

uint8_t | bLength
uint8_t | bDescriptorType
uint8_t | bEndpointAddress
uint8_t | bmAttributes
uint16_t | wMaxPacketSize
uint8_t | bInterval

Detailed Description

format of standard endpoint descriptor

Definition at line 300 of file usb_std.h.

Field Documentation

◆ bDescriptorType

uint8_t usb_endpoint_desc_type::bDescriptorType

endpoint descriptor type

Definition at line 303 of file usb_std.h.

Referenced by usbh_parse_endpoint_desc().

◆ bEndpointAddress

uint8_t usb_endpoint_desc_type::bEndpointAddress

the address of the endpoint on the usb device described by this descriptor

Definition at line 304 of file usb_std.h.

Referenced by usbh_parse_endpoint_desc().

◆ bInterval

uint8_t usb_endpoint_desc_type::bInterval

interval for polling endpoint for data transfers

Definition at line 307 of file usb_std.h.

Referenced by usbh_parse_endpoint_desc().

◆ bLength

uint8_t usb_endpoint_desc_type::bLength

size of this descriptor in bytes

Definition at line 302 of file usb_std.h.

Referenced by usbh_parse_endpoint_desc().

◆ bmAttributes

uint8_t usb_endpoint_desc_type::bmAttributes

describes the endpoints attributes when it is configured using bConfiguration value

Definition at line 305 of file usb_std.h.

Referenced by usbh_parse_endpoint_desc().

◆ wMaxPacketSize

uint16_t usb_endpoint_desc_type::wMaxPacketSize

maximum packet size this endpoint

Definition at line 306 of file usb_std.h.

Referenced by usbh_parse_endpoint_desc().

The documentation for this struct was generated from the following file:
  • usb_std.h


AT32F415 Firmwary Library: usb_header_desc_type Struct Reference

Data Fields
usb_header_desc_type Struct Reference
AT32F415_middlewares_usb_drivers » USB_standard » USB_standard_define

format of header More...

#include <usb_std.h>

Data Fields

uint8_t | bLength
uint8_t | bDescriptorType

Detailed Description

format of header

Definition at line 313 of file usb_std.h.

Field Documentation

◆ bDescriptorType

uint8_t usb_header_desc_type::bDescriptorType

descriptor type

Definition at line 316 of file usb_std.h.

◆ bLength

uint8_t usb_header_desc_type::bLength

size of this descriptor in bytes

Definition at line 315 of file usb_std.h.

Referenced by usbh_get_next_header(), and usbh_parse_configure_desc().

The documentation for this struct was generated from the following file:
  • usb_std.h


AT32F415 Firmwary Library: AT32F415_middlewares_usbd_drivers

Modules
AT32F415_middlewares_usbd_drivers

Modules

USBD_drivers_core
usb device drivers core
USBD_drivers_interrupt
usb device interrupt
USBD_drivers_standard_request
usb device standard_request
USBD_drivers_int

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: USBD_drivers_core

Modules
USBD_drivers_core
AT32F415_middlewares_usbd_drivers

usb device drivers core More...

Modules

USBD_core_exported_types
USBD_core_private_functions

Detailed Description

usb device drivers core


AT32F415 Firmwary Library: USBD_core_exported_types

USBD_core_exported_types
AT32F415_middlewares_usbd_drivers » USBD_drivers_core


AT32F415 Firmwary Library: USBD_core_private_functions

Functions
USBD_core_private_functions
AT32F415_middlewares_usbd_drivers » USBD_drivers_core

Functions

void | usbd_core_in_handler (usbd_core_type *udev, uint8_t ept_addr)
usb core in transfer complete handler More...
void | usbd_core_out_handler (usbd_core_type *udev, uint8_t ept_addr)
usb core out transfer complete handler More...
void | usbd_core_setup_handler (usbd_core_type *udev, uint8_t ept_num)
usb core setup transfer complete handler More...
void | usbd_ctrl_send (usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data More...
void | usbd_ctrl_recv (usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint recv data More...
void | usbd_ctrl_send_status (usbd_core_type *udev)
usb control endpoint send in status More...
void | usbd_ctrl_recv_status (usbd_core_type *udev)
usb control endpoint send out status More...
void | usbd_clear_stall (usbd_core_type *udev, uint8_t ept_addr)
clear endpoint stall More...
void | usbd_set_stall (usbd_core_type *udev, uint8_t ept_addr)
usb set endpoint to stall status More...
void | usbd_ctrl_unsupport (usbd_core_type *udev)
un-support device request More...
uint32_t | usbd_get_recv_len (usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length More...
void | usbd_ept_open (usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint More...
void | usbd_ept_close (usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint More...
void | usbd_connect (usbd_core_type *udev)
usb device connect to host More...
void | usbd_disconnect (usbd_core_type *udev)
usb device disconnect to host More...
void | usbd_set_device_addr (usbd_core_type *udev, uint8_t address)
usb device set device address. More...
void | usb_ept_default_init (usbd_core_type *udev)
usb endpoint structure initialization More...
void | usbd_ept_send (usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data More...
void | usbd_ept_recv (usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint receive data More...
usbd_conn_state | usbd_connect_state_get (usbd_core_type *udev)
get usb connect state More...
void | usbd_remote_wakeup (usbd_core_type *udev)
usb device remote wakeup More...
void | usbd_enter_suspend (usbd_core_type *udev)
usb device enter suspend mode More...
void | usbd_flush_tx_fifo (usbd_core_type *udev, uint8_t ept_num)
usb device flush in endpoint fifo More...
void | usbd_fifo_alloc (usbd_core_type *udev)
usb device endpoint fifo alloc More...
usb_sts_type | usbd_core_init (usbd_core_type *udev, usb_reg_type *usb_reg, usbd_class_handler *class_handler, usbd_desc_handler *desc_handler, uint8_t core_id)
usb device core initialization More...

Detailed Description

Function Documentation

◆ usb_ept_default_init()

void usb_ept_default_init ( usbd_core_type * udev )

usb endpoint structure initialization

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 395 of file usbd_core.c.

Referenced by usbd_core_init().

◆ usbd_clear_stall()

void usbd_clear_stall | ( | usbd_core_type * | udev,
 |  | uint8_t | ept_addr
 | ) |  |

clear endpoint stall

Parameters
udev | to the structure of usbd_core_type
ept_addr | endpoint number
Return values
none

Definition at line 232 of file usbd_core.c.

Referenced by usbd_endpoint_request().

◆ usbd_connect()

void usbd_connect ( usbd_core_type * udev )

usb device connect to host

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 364 of file usbd_core.c.

Referenced by usb_re_connect(), and usbd_core_init().

◆ usbd_connect_state_get()

usbd_conn_state usbd_connect_state_get ( usbd_core_type * udev )

get usb connect state

Parameters
udev to the structure of usbd_core_type
Return values
usb connect state

Definition at line 592 of file usbd_core.c.

Referenced by class_send_report(), and main().

◆ usbd_core_in_handler()

void usbd_core_in_handler | ( | usbd_core_type * | udev,
 |  | uint8_t | ept_addr
 | ) |  |

usb core in transfer complete handler

Parameters
udev | to the structure of usbd_core_type
ept_addr | endpoint number
Return values
none

Definition at line 50 of file usbd_core.c.

Referenced by usbd_inept_handler().

◆ usbd_core_init()

usb_sts_type usbd_core_init | ( | usbd_core_type * | udev,
 |  | usb_reg_type * | usb_reg,
 |  | usbd_class_handler * | class_handler,
 |  | usbd_desc_handler * | desc_handler,
 |  | uint8_t | core_id
 | ) |  |

usb device core initialization

Parameters
udev | to the structure of usbd_core_type
usb_reg | usb otgfs peripheral global register this parameter can be one of the following values: OTG1_GLOBAL , OTG2_GLOBAL
class_handler | usb class handler
desc_handler | device config handler
core_id | usb core id number
Return values
usb_sts_type

Definition at line 740 of file usbd_core.c.

◆ usbd_core_out_handler()

void usbd_core_out_handler | ( | usbd_core_type * | udev,
 |  | uint8_t | ept_addr
 | ) |  |

usb core out transfer complete handler

Parameters
udev | to the structure of usbd_core_type
ept_addr | endpoint number
Return values
none

Definition at line 98 of file usbd_core.c.

Referenced by usbd_outept_handler().

◆ usbd_core_setup_handler()

void usbd_core_setup_handler | ( | usbd_core_type * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb core setup transfer complete handler

Parameters
udev | to the structure of usbd_core_type
ept_addr | endpoint number
Return values
none

Definition at line 138 of file usbd_core.c.

Referenced by usbd_outept_handler().

◆ usbd_ctrl_recv()

void usbd_ctrl_recv | ( | usbd_core_type * | udev,
 |  | uint8_t * | buffer,
 |  | uint16_t | len
 | ) |  |

usb control endpoint recv data

Parameters
udev | to the structure of usbd_core_type
ept_addr | endpoint number
buffer | recv data buffer
len | recv data length
Return values
none

Definition at line 192 of file usbd_core.c.

Referenced by audio_req_set_cur(), cdc_class_setup_handler(), class_hid_setup_handler(), class_setup_handler(), and keyboard_class_setup_handler().

◆ usbd_ctrl_recv_status()

void usbd_ctrl_recv_status ( usbd_core_type * udev )

usb control endpoint send out status

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 219 of file usbd_core.c.

Referenced by usbd_core_in_handler().

◆ usbd_ctrl_send()

void usbd_ctrl_send | ( | usbd_core_type * | udev,
 |  | uint8_t * | buffer,
 |  | uint16_t | len
 | ) |  |

usb control endpoint send data

Parameters
udev | to the structure of usbd_core_type
ept_addr | endpoint number
buffer | send data buffer
len | send data length
Return values
none

Definition at line 174 of file usbd_core.c.

Referenced by audio_get_interface(), audio_req_get_cur(), audio_req_get_max(), audio_req_get_min(), audio_req_get_res(), cdc_class_setup_handler(), class_audio_setup_handler(), class_hid_setup_handler(), class_setup_handler(), keyboard_class_setup_handler(), usbd_endpoint_request(), usbd_get_configuration(), usbd_get_descriptor(), and usbd_get_status().

◆ usbd_ctrl_send_status()

void usbd_ctrl_send_status ( usbd_core_type * udev )

usb control endpoint send in status

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 207 of file usbd_core.c.

Referenced by class_audio_setup_handler(), class_setup_handler(), usbd_clear_feature(), usbd_core_out_handler(), usbd_endpoint_request(), usbd_interface_request(), usbd_set_address(), usbd_set_configuration(), and usbd_set_feature().

◆ usbd_ctrl_unsupport()

void usbd_ctrl_unsupport ( usbd_core_type * udev )

un-support device request

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 282 of file usbd_core.c.

Referenced by cdc_class_setup_handler(), class_audio_setup_handler(), class_hid_setup_handler(), class_setup_handler(), keyboard_class_setup_handler(), usbd_clear_feature(), usbd_device_request(), usbd_endpoint_request(), usbd_get_configuration(), usbd_get_descriptor(), usbd_get_status(), usbd_interface_request(), usbd_set_address(), and usbd_set_configuration().

◆ usbd_disconnect()

void usbd_disconnect ( usbd_core_type * udev )

usb device disconnect to host

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 374 of file usbd_core.c.

Referenced by usb_re_connect(), and usbd_core_init().

◆ usbd_enter_suspend()

void usbd_enter_suspend ( usbd_core_type * udev )

usb device enter suspend mode

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 629 of file usbd_core.c.

Referenced by usbd_suspend_handler().

◆ usbd_ept_close()

void usbd_ept_close | ( | usbd_core_type * | udev,
 |  | uint8_t | ept_addr
 | ) |  |

usb close endpoint

Parameters
udev | to the structure of usbd_core_type
ept_addr | endpoint number
Return values
none

Definition at line 341 of file usbd_core.c.

Referenced by class_clear_handler(), and class_setup_handler().

◆ usbd_ept_open()

void usbd_ept_open | ( | usbd_core_type * | udev,
 |  | uint8_t | ept_addr,
 |  | uint8_t | ept_type,
 |  | uint16_t | maxpacket
 | ) |  |

usb open endpoint

Parameters
udev | to the structure of usbd_core_type
ept_addr | endpoint number
ept_type | endpoint type
maxpacket | endpoint support max buffer size
Return values
none

Definition at line 309 of file usbd_core.c.

Referenced by class_init_handler(), class_setup_handler(), and usbd_enumdone_handler().

◆ usbd_ept_recv()

void usbd_ept_recv | ( | usbd_core_type * | udev,
 |  | uint8_t | ept_addr,
 |  | uint8_t * | buffer,
 |  | uint16_t | len
 | ) |  |

endpoint receive data

Parameters
udev | to the structure of usbd_core_type
ept_addr | endpoint number
buffer | receive data buffer
len | receive data length
Return values
none

Definition at line 529 of file usbd_core.c.

Referenced by audio_set_interface(), bot_scsi_init(), bot_scsi_reset(), bot_scsi_send_csw(), bot_scsi_stall(), bot_scsi_write10(), class_init_handler(), class_out_handler(), usb_vcp_get_rxdata(), usbd_core_in_handler(), usbd_core_out_handler(), usbd_ctrl_recv(), and usbd_ctrl_recv_status().

◆ usbd_ept_send()

void usbd_ept_send | ( | usbd_core_type * | udev,
 |  | uint8_t | ept_addr,
 |  | uint8_t * | buffer,
 |  | uint16_t | len
 | ) |  |

endpoint send data

Parameters
udev | to the structure of usbd_core_type
ept_addr | endpoint number
buffer | send data buffer
len | send data length
Return values
none

Definition at line 429 of file usbd_core.c.

Referenced by audio_inisoincom_event(), audio_set_interface(), bot_scsi_read10(), bot_scsi_send_csw(), bot_scsi_send_data(), class_in_handler(), class_send_report(), class_sof_handler(), usb_hid_buf_process(), usb_printer_send_data(), usb_vcp_send_data(), usbd_core_in_handler(), usbd_ctrl_send(), and usbd_ctrl_send_status().

◆ usbd_fifo_alloc()

void usbd_fifo_alloc ( usbd_core_type * udev )

usb device endpoint fifo alloc

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 656 of file usbd_core.c.

Referenced by usbd_core_init(), and usbd_reset_handler().

◆ usbd_flush_tx_fifo()

void usbd_flush_tx_fifo | ( | usbd_core_type * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device flush in endpoint fifo

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
none

Definition at line 645 of file usbd_core.c.

Referenced by class_in_handler(), class_send_report(), and class_sof_handler().

◆ usbd_get_recv_len()

uint32_t usbd_get_recv_len | ( | usbd_core_type * | udev,
 |  | uint8_t | ept_addr
 | ) |  |

get endpoint receive data length

Parameters
udev | to the structure of usbd_core_type
ept_addr | endpoint number
Return values
data receive len

Definition at line 295 of file usbd_core.c.

Referenced by bot_cbw_decode(), class_ept0_rx_handler(), and class_out_handler().

◆ usbd_remote_wakeup()

void usbd_remote_wakeup ( usbd_core_type * udev )

usb device remote wakeup

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 602 of file usbd_core.c.

Referenced by main().

◆ usbd_set_device_addr()

void usbd_set_device_addr | ( | usbd_core_type * | udev,
 |  | uint8_t | address
 | ) |  |

usb device set device address.

Parameters
udev | to the structure of usbd_core_type
address | host assignment address
Return values
none

Definition at line 385 of file usbd_core.c.

◆ usbd_set_stall()

void usbd_set_stall | ( | usbd_core_type * | udev,
 |  | uint8_t | ept_addr
 | ) |  |

usb set endpoint to stall status

Parameters
udev | to the structure of usbd_core_type
ept_addr | endpoint number
Return values
none

Definition at line 257 of file usbd_core.c.

Referenced by bot_scsi_clear_feature(), bot_scsi_stall(), usbd_ctrl_unsupport(), and usbd_endpoint_request().


AT32F415 Firmwary Library: USBD_drivers_interrupt

Modules
USBD_drivers_interrupt
AT32F415_middlewares_usbd_drivers

usb device interrupt More...

Modules

USBD_int_private_functions

Detailed Description

usb device interrupt


AT32F415 Firmwary Library: USBD_int_private_functions

Functions
USBD_int_private_functions
AT32F415_middlewares_usbd_drivers » USBD_drivers_interrupt

Functions

void | usbd_irq_handler (otg_core_type *otgdev)
usb device interrput request handler. More...
void | usb_write_empty_txfifo (usbd_core_type *udev, uint32_t ept_num)
usb write tx fifo. More...
void | usbd_inept_handler (usbd_core_type *udev)
usb in endpoint handler More...
void | usbd_outept_handler (usbd_core_type *udev)
usb out endpoint handler More...
void | usbd_enumdone_handler (usbd_core_type *udev)
usb enumeration done handler More...
void | usbd_rxflvl_handler (usbd_core_type *udev)
usb rx non-empty handler More...
void | usbd_discon_handler (usbd_core_type *udev)
usb disconnect handler More...
void | usbd_incomisoout_handler (usbd_core_type *udev)
usb incomplete out handler More...
void | usbd_incomisioin_handler (usbd_core_type *udev)
usb incomplete in handler More...
void | usbd_reset_handler (usbd_core_type *udev)
usb device reset interrupt request handler. More...
void | usbd_sof_handler (usbd_core_type *udev)
usb device sof interrupt request handler. More...
void | usbd_suspend_handler (usbd_core_type *udev)
usb device suspend interrupt request handler. More...
void | usbd_wakeup_handler (usbd_core_type *udev)
usb device wakup interrupt request handler. More...

Detailed Description

Function Documentation

◆ usb_write_empty_txfifo()

void usb_write_empty_txfifo | ( | usbd_core_type * | udev,
 |  | uint32_t | ept_num
 | ) |  |

usb write tx fifo.

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
none

Definition at line 147 of file usbd_int.c.

Referenced by usbd_inept_handler().

◆ usbd_discon_handler()

void usbd_discon_handler ( usbd_core_type * udev )

usb disconnect handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 381 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_enumdone_handler()

void usbd_enumdone_handler ( usbd_core_type * udev )

usb enumeration done handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 301 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_incomisioin_handler()

void usbd_incomisioin_handler ( usbd_core_type * udev )

usb incomplete in handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 405 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_incomisoout_handler()

void usbd_incomisoout_handler ( usbd_core_type * udev )

usb incomplete out handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 394 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_inept_handler()

void usbd_inept_handler ( usbd_core_type * udev )

usb in endpoint handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 187 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_irq_handler()

void usbd_irq_handler ( otg_core_type * otgdev )

usb device interrput request handler.

Parameters
otgdev to the structure of otg_core_type
Return values
none

Definition at line 46 of file usbd_int.c.

Referenced by OTG_IRQ_HANDLER().

◆ usbd_outept_handler()

void usbd_outept_handler ( usbd_core_type * udev )

usb out endpoint handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 250 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_reset_handler()

void usbd_reset_handler ( usbd_core_type * udev )

usb device reset interrupt request handler.

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 416 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_rxflvl_handler()

void usbd_rxflvl_handler ( usbd_core_type * udev )

usb rx non-empty handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 328 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_sof_handler()

void usbd_sof_handler ( usbd_core_type * udev )

usb device sof interrupt request handler.

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 473 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_suspend_handler()

void usbd_suspend_handler ( usbd_core_type * udev )

usb device suspend interrupt request handler.

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 485 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_wakeup_handler()

void usbd_wakeup_handler ( usbd_core_type * udev )

usb device wakup interrupt request handler.

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 511 of file usbd_int.c.

Referenced by usbd_irq_handler().


AT32F415 Firmwary Library: USBD_drivers_standard_request

Modules
USBD_drivers_standard_request
AT32F415_middlewares_usbd_drivers

usb device standard_request More...

Modules

USBD_sdr_exported_functions
USBD_sdr_private_functions

Detailed Description

usb device standard_request


AT32F415 Firmwary Library: USBD_sdr_exported_functions

Functions
USBD_sdr_exported_functions
AT32F415_middlewares_usbd_drivers » USBD_drivers_standard_request

Functions

void | usbd_setup_request_parse (usb_setup_type *setup, uint8_t *buf)
usb parse standard setup request More...
usb_sts_type | usbd_device_request (usbd_core_type *udev)
standard usb device requests More...
usb_sts_type | usbd_interface_request (usbd_core_type *udev)
standard usb interface requests More...
usb_sts_type | usbd_endpoint_request (usbd_core_type *udev)
standard usb endpoint requests More...

Detailed Description

Function Documentation

◆ usbd_device_request()

usb_sts_type usbd_device_request ( usbd_core_type * udev )

standard usb device requests

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 350 of file usbd_sdr.c.

Referenced by usbd_core_setup_handler().

◆ usbd_endpoint_request()

usb_sts_type usbd_endpoint_request ( usbd_core_type * udev )

standard usb endpoint requests

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 419 of file usbd_sdr.c.

Referenced by usbd_core_setup_handler().

◆ usbd_interface_request()

usb_sts_type usbd_interface_request ( usbd_core_type * udev )

standard usb interface requests

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 394 of file usbd_sdr.c.

Referenced by usbd_core_setup_handler().

◆ usbd_setup_request_parse()

void usbd_setup_request_parse | ( | usb_setup_type * | setup,
 |  | uint8_t * | buf
 | ) |  |

usb parse standard setup request

Parameters
setup | setup structure
buf | setup buffer
Return values
none

Definition at line 55 of file usbd_sdr.c.

Referenced by usbd_core_setup_handler().


AT32F415 Firmwary Library: USBD_sdr_private_functions

Functions
USBD_sdr_private_functions
AT32F415_middlewares_usbd_drivers » USBD_drivers_standard_request

Functions

static usb_sts_type | usbd_get_descriptor (usbd_core_type *udev)
get usb standard device description request More...
static usb_sts_type | usbd_set_address (usbd_core_type *udev)
this request sets the device address More...
static usb_sts_type | usbd_get_status (usbd_core_type *udev)
get usb status request More...
static usb_sts_type | usbd_clear_feature (usbd_core_type *udev)
clear usb feature request More...
static usb_sts_type | usbd_set_feature (usbd_core_type *udev)
set usb feature request More...
static usb_sts_type | usbd_get_configuration (usbd_core_type *udev)
get usb configuration request More...
static usb_sts_type | usbd_set_configuration (usbd_core_type *udev)
sets the usb device configuration request More...
void | usbd_setup_request_parse (usb_setup_type *setup, uint8_t *buf)
usb parse standard setup request More...
usb_sts_type | usbd_device_request (usbd_core_type *udev)
standard usb device requests More...
usb_sts_type | usbd_interface_request (usbd_core_type *udev)
standard usb interface requests More...
usb_sts_type | usbd_endpoint_request (usbd_core_type *udev)
standard usb endpoint requests More...

Detailed Description

Function Documentation

◆ usbd_clear_feature()

static usb_sts_type usbd_clear_feature ( usbd_core_type * udev )
static

clear usb feature request

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 210 of file usbd_sdr.c.

Referenced by usbd_device_request().

◆ usbd_device_request()

usb_sts_type usbd_device_request ( usbd_core_type * udev )

standard usb device requests

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 350 of file usbd_sdr.c.

Referenced by usbd_core_setup_handler().

◆ usbd_endpoint_request()

usb_sts_type usbd_endpoint_request ( usbd_core_type * udev )

standard usb endpoint requests

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 419 of file usbd_sdr.c.

Referenced by usbd_core_setup_handler().

◆ usbd_get_configuration()

static usb_sts_type usbd_get_configuration ( usbd_core_type * udev )
static

get usb configuration request

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 256 of file usbd_sdr.c.

Referenced by usbd_device_request().

◆ usbd_get_descriptor()

static usb_sts_type usbd_get_descriptor ( usbd_core_type * udev )
static

get usb standard device description request

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 69 of file usbd_sdr.c.

Referenced by usbd_device_request().

◆ usbd_get_status()

static usb_sts_type usbd_get_status ( usbd_core_type * udev )
static

get usb status request

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 185 of file usbd_sdr.c.

Referenced by usbd_device_request().

◆ usbd_interface_request()

usb_sts_type usbd_interface_request ( usbd_core_type * udev )

standard usb interface requests

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 394 of file usbd_sdr.c.

Referenced by usbd_core_setup_handler().

◆ usbd_set_address()

static usb_sts_type usbd_set_address ( usbd_core_type * udev )
static

this request sets the device address

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 139 of file usbd_sdr.c.

Referenced by usbd_device_request().

◆ usbd_set_configuration()

static usb_sts_type usbd_set_configuration ( usbd_core_type * udev )
static

sets the usb device configuration request

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 288 of file usbd_sdr.c.

Referenced by usbd_device_request().

◆ usbd_set_feature()

static usb_sts_type usbd_set_feature ( usbd_core_type * udev )
static

set usb feature request

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 238 of file usbd_sdr.c.

Referenced by usbd_device_request().

◆ usbd_setup_request_parse()

void usbd_setup_request_parse | ( | usb_setup_type * | setup,
 |  | uint8_t * | buf
 | ) |  |

usb parse standard setup request

Parameters
setup | setup structure
buf | setup buffer
Return values
none

Definition at line 55 of file usbd_sdr.c.

Referenced by usbd_core_setup_handler().


AT32F415 Firmwary Library: USBD_drivers_int

Modules
USBD_drivers_int
AT32F415_middlewares_usbd_drivers

Modules

USBD_interrupt_exported_types

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: USBD_interrupt_exported_types

Functions
USBD_interrupt_exported_types
AT32F415_middlewares_usbd_drivers » USBD_drivers_int

Functions

void | usbd_irq_handler (otg_core_type *udev)
usb device interrput request handler. More...
void | usbd_ept_handler (usbd_core_type *udev)
void | usbd_reset_handler (usbd_core_type *udev)
usb device reset interrupt request handler. More...
void | usbd_sof_handler (usbd_core_type *udev)
usb device sof interrupt request handler. More...
void | usbd_suspend_handler (usbd_core_type *udev)
usb device suspend interrupt request handler. More...
void | usbd_wakeup_handler (usbd_core_type *udev)
usb device wakup interrupt request handler. More...
void | usbd_inept_handler (usbd_core_type *udev)
usb in endpoint handler More...
void | usbd_outept_handler (usbd_core_type *udev)
usb out endpoint handler More...
void | usbd_enumdone_handler (usbd_core_type *udev)
usb enumeration done handler More...
void | usbd_rxflvl_handler (usbd_core_type *udev)
usb rx non-empty handler More...
void | usbd_incomisioin_handler (usbd_core_type *udev)
usb incomplete in handler More...
void | usbd_discon_handler (usbd_core_type *udev)
usb disconnect handler More...
void | usbd_incomisoout_handler (usbd_core_type *udev)
usb incomplete out handler More...
void | usb_write_empty_txfifo (usbd_core_type *udev, uint32_t ept_num)
usb write tx fifo. More...

Detailed Description

Function Documentation

◆ usb_write_empty_txfifo()

void usb_write_empty_txfifo | ( | usbd_core_type * | udev,
 |  | uint32_t | ept_num
 | ) |  |

usb write tx fifo.

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
none

Definition at line 147 of file usbd_int.c.

Referenced by usbd_inept_handler().

◆ usbd_discon_handler()

void usbd_discon_handler ( usbd_core_type * udev )

usb disconnect handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 381 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_enumdone_handler()

void usbd_enumdone_handler ( usbd_core_type * udev )

usb enumeration done handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 301 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_ept_handler()

void usbd_ept_handler ( usbd_core_type * udev )

◆ usbd_incomisioin_handler()

void usbd_incomisioin_handler ( usbd_core_type * udev )

usb incomplete in handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 405 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_incomisoout_handler()

void usbd_incomisoout_handler ( usbd_core_type * udev )

usb incomplete out handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 394 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_inept_handler()

void usbd_inept_handler ( usbd_core_type * udev )

usb in endpoint handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 187 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_irq_handler()

void usbd_irq_handler ( otg_core_type * otgdev )

usb device interrput request handler.

Parameters
otgdev to the structure of otg_core_type
Return values
none

Definition at line 46 of file usbd_int.c.

Referenced by OTG_IRQ_HANDLER().

◆ usbd_outept_handler()

void usbd_outept_handler ( usbd_core_type * udev )

usb out endpoint handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 250 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_reset_handler()

void usbd_reset_handler ( usbd_core_type * udev )

usb device reset interrupt request handler.

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 416 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_rxflvl_handler()

void usbd_rxflvl_handler ( usbd_core_type * udev )

usb rx non-empty handler

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 328 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_sof_handler()

void usbd_sof_handler ( usbd_core_type * udev )

usb device sof interrupt request handler.

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 473 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_suspend_handler()

void usbd_suspend_handler ( usbd_core_type * udev )

usb device suspend interrupt request handler.

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 485 of file usbd_int.c.

Referenced by usbd_irq_handler().

◆ usbd_wakeup_handler()

void usbd_wakeup_handler ( usbd_core_type * udev )

usb device wakup interrupt request handler.

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 511 of file usbd_int.c.

Referenced by usbd_irq_handler().


AT32F415 Firmwary Library: AT32F415_middlewares_usbh_drivers

Modules
AT32F415_middlewares_usbh_drivers

Modules

USBH_drivers_core
usb host drivers core
USBH_drivers_control
usb host drivers control
USBH_drivers_interrupt
usb host interrupt
USBH_drivers_int

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: USBH_drivers_core

Modules
USBH_drivers_core
AT32F415_middlewares_usbh_drivers

usb host drivers core More...

Modules

USBH_core_exported_types
USBH_core_private_functions

Detailed Description

usb host drivers core


AT32F415 Firmwary Library: USBH_core_exported_types

USBH_core_exported_types
AT32F415_middlewares_usbh_drivers » USBH_drivers_core


AT32F415 Firmwary Library: USBH_core_private_functions

Functions
USBH_core_private_functions
AT32F415_middlewares_usbh_drivers » USBH_drivers_core

Functions

static void | usbh_attached (usbh_core_type *uhost)
usb host attached More...
static void | usbh_enumeration (usbh_core_type *uhost)
usb host enumeration More...
static void | usbh_class_request (usbh_core_type *uhost)
usb host class request More...
static void | usbh_class (usbh_core_type *uhost)
usb host class handler More...
static void | usbh_suspend (usbh_core_type *uhost)
usb host suspend More...
static void | usbh_wakeup (usbh_core_type *uhost)
usb host wakeup More...
static void | usbh_disconnect (usbh_core_type *uhost)
usb host disconnect More...
void | usbh_free_channel (usbh_core_type *uhost, uint8_t index)
usb host free channel More...
uint16_t | usbh_get_free_channel (usbh_core_type *uhost)
get usb host free channel More...
usb_sts_type | usbh_set_toggle (usbh_core_type *uhost, uint8_t hc_num, uint8_t toggle)
usb host set toggle More...
usb_sts_type | usbh_in_out_request (usbh_core_type *uhost, uint8_t hc_num)
usb host in out request More...
usb_sts_type | usbh_interrupt_recv (usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host interrupt receive request More...
usb_sts_type | usbh_interrupt_send (usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host interrupt send request More...
usb_sts_type | usbh_bulk_recv (usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host bulk receive request More...
usb_sts_type | usbh_bulk_send (usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host bulk send request More...
usb_sts_type | usbh_isoc_send (usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host iso send request More...
usb_sts_type | usbh_isoc_recv (usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host iso receive request More...
usb_sts_type | usbh_cfg_default_init (usbh_core_type *uhost)
usb host cfg default init More...
void | usbh_enter_suspend (usbh_core_type *uhost)
usb host enter suspend More...
void | usbh_resume (usbh_core_type *uhost)
usb host resume More...
usb_sts_type | usbh_core_init (usbh_core_type *uhost, usb_reg_type *usb_reg, usbh_class_handler_type *class_handler, usbh_user_handler_type *user_handler, uint8_t core_id)
usb host core initialize More...
void | usbh_hc_open (usbh_core_type *uhost, uint8_t chn, uint8_t ept_num, uint8_t dev_address, uint8_t type, uint8_t maxpacket, uint8_t speed)
usb host open channel More...
void | usbh_ch_disable (usbh_core_type *uhost, uint8_t chn)
disable host channel More...
uint16_t | usbh_alloc_channel (usbh_core_type *uhost, uint8_t ept_addr)
usb host alloc channel More...
urb_sts_type | usbh_get_urb_status (usbh_core_type *uhost, uint8_t ch_num)
usb host get urb status More...
usb_sts_type | usbh_ctrl_result_check (usbh_core_type *uhost, ctrl_ept0_sts_type next_ctrl_state, uint8_t next_enum_state)
usb wait control setup complete More...
uint8_t | usbh_alloc_address (void)
auto alloc address (1...127) More...
usb_sts_type | usbh_enum_handler (usbh_core_type *uhost)
usb host enumeration handler More...
void | usbh_active_vbus (usbh_core_type *uhost, confirm_state state)
active vbus. More...
void | usbh_reset_port (usbh_core_type *uhost)
reset usb port More...
usb_sts_type | usbh_loop_handler (usbh_core_type *uhost)
usb host enum loop handler More...

Detailed Description

Function Documentation

◆ usbh_active_vbus()

void usbh_active_vbus | ( | usbh_core_type * | uhost,
 |  | confirm_state | state
 | ) |  |

active vbus.

Parameters
uhost | to the structure of usbh_core_type
state | vbus state
Return values
none

Definition at line 931 of file usbh_core.c.

Referenced by usbh_core_init().

◆ usbh_alloc_address()

uint8_t usbh_alloc_address ( void )

auto alloc address (1...127)

Parameters
none
Return values
address (1...127)

Definition at line 748 of file usbh_core.c.

Referenced by usbh_enum_handler().

◆ usbh_alloc_channel()

uint16_t usbh_alloc_channel | ( | usbh_core_type * | uhost,
 |  | uint8_t | ept_addr
 | ) |  |

usb host alloc channel

Parameters
uhost | to the structure of usbh_core_type
ept_addr | endpoint address
Return values
usb_sts_type

Definition at line 686 of file usbh_core.c.

Referenced by uhost_init_handler(), and usbh_attached().

◆ usbh_attached()

static void usbh_attached ( usbh_core_type * uhost )
static

usb host attached

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 966 of file usbh_core.c.

Referenced by usbh_loop_handler().

◆ usbh_bulk_recv()

usb_sts_type usbh_bulk_recv | ( | usbh_core_type * | uhost,
 |  | uint8_t | hc_num,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host bulk receive request

Parameters
uhost | to the structure of usbh_core_type
hc_num | channel number
buffer | receive buffer
length | receive length
Return values
status usb_sts_type status

Definition at line 285 of file usbh_core.c.

Referenced by usb_bot_request().

◆ usbh_bulk_send()

usb_sts_type usbh_bulk_send | ( | usbh_core_type * | uhost,
 |  | uint8_t | hc_num,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host bulk send request

Parameters
uhost | to the structure of usbh_core_type
hc_num | channel number
buffer | receive buffer
length | receive length
Return values
status usb_sts_type status

Definition at line 320 of file usbh_core.c.

Referenced by usb_bot_request().

◆ usbh_cfg_default_init()

usb_sts_type usbh_cfg_default_init ( usbh_core_type * uhost )

usb host cfg default init

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 404 of file usbh_core.c.

Referenced by usbh_core_init(), usbh_disconnect(), and usbh_loop_handler().

◆ usbh_ch_disable()

void usbh_ch_disable | ( | usbh_core_type * | uhost,
 |  | uint8_t | chn
 | ) |  |

disable host channel

Parameters
usbx to select the otgfs peripheral. this parameter can be one of the following values:
  • OTG1_GLOBAL
  • OTG2_GLOBAL
chn channel number
Return values
none

Definition at line 675 of file usbh_core.c.

Referenced by uhost_reset_handler().

◆ usbh_class()

static void usbh_class ( usbh_core_type * uhost )
static

usb host class handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 1046 of file usbh_core.c.

Referenced by usbh_loop_handler().

◆ usbh_class_request()

static void usbh_class_request ( usbh_core_type * uhost )
static

usb host class request

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 1021 of file usbh_core.c.

Referenced by usbh_loop_handler().

◆ usbh_core_init()

usb_sts_type usbh_core_init | ( | usbh_core_type * | uhost,
 |  | usb_reg_type * | usb_reg,
 |  | usbh_class_handler_type * | class_handler,
 |  | usbh_user_handler_type * | user_handler,
 |  | uint8_t | core_id
 | ) |  |

usb host core initialize

Parameters
uhost | to the structure of usbh_core_type
usb_reg | usb otgfs peripheral global register this parameter can be one of the following values: OTG1_GLOBAL , OTG2_GLOBAL
class_handler | usb host class handler type pointer
user_handler | usb host user handler type pointer
core_id | usb core select id
Return values
status usb_sts_type status

Definition at line 496 of file usbh_core.c.

◆ usbh_ctrl_result_check()

usb_sts_type usbh_ctrl_result_check | ( | usbh_core_type * | uhost,
 |  | ctrl_ept0_sts_type | next_ctrl_state,
 |  | uint8_t | next_enum_state
 | ) |  |

usb wait control setup complete

Parameters
uhost | to the structure of usbh_core_type
next_ctrl_state | next ctrl state when setup complete
next_enum_state | next enum state when setup complete
Return values
status usb_sts_type status

Definition at line 716 of file usbh_core.c.

Referenced by usbh_clear_endpoint_feature(), usbh_clear_ept_feature(), usbh_enum_handler(), usbh_hid_get_desc(), usbh_hid_get_report(), usbh_hid_set_idle(), usbh_hid_set_protocol(), usbh_msc_clear_feature(), usbh_msc_get_max_lun(), usbh_suspend(), and usbh_wakeup().

◆ usbh_disconnect()

static void usbh_disconnect ( usbh_core_type * uhost )
static

usb host disconnect

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 1102 of file usbh_core.c.

Referenced by usbh_loop_handler().

◆ usbh_enter_suspend()

void usbh_enter_suspend ( usbh_core_type * uhost )

usb host enter suspend

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 438 of file usbh_core.c.

Referenced by usbh_suspend().

◆ usbh_enum_handler()

usb_sts_type usbh_enum_handler ( usbh_core_type * uhost )

usb host enumeration handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 762 of file usbh_core.c.

Referenced by usbh_enumeration().

◆ usbh_enumeration()

static void usbh_enumeration ( usbh_core_type * uhost )
static

usb host enumeration

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 1005 of file usbh_core.c.

Referenced by usbh_loop_handler().

◆ usbh_free_channel()

void usbh_free_channel | ( | usbh_core_type * | uhost,
 |  | uint8_t | index
 | ) |  |

usb host free channel

Parameters
uhost | to the structure of usbh_core_type
index | channle number
Return values
none

Definition at line 57 of file usbh_core.c.

Referenced by uhost_reset_handler(), usbh_cfg_default_init(), usbh_disconnect(), and usbh_disconnect_handler().

◆ usbh_get_free_channel()

uint16_t usbh_get_free_channel ( usbh_core_type * uhost )

get usb host free channel

Parameters
uhost to the structure of usbh_core_type
Return values
channel index

Definition at line 71 of file usbh_core.c.

Referenced by usbh_alloc_channel().

◆ usbh_get_urb_status()

urb_sts_type usbh_get_urb_status | ( | usbh_core_type * | uhost,
 |  | uint8_t | ch_num
 | ) |  |

usb host get urb status

Parameters
uhost | to the structure of usbh_core_type
ch_num | channel number
Return values
urb_sts_type urb status

Definition at line 705 of file usbh_core.c.

Referenced by uhost_process_handler(), and usb_bot_request().

◆ usbh_hc_open()

void usbh_hc_open | ( | usbh_core_type * | uhost,
 |  | uint8_t | chn,
 |  | uint8_t | ept_num,
 |  | uint8_t | dev_address,
 |  | uint8_t | type,
 |  | uint8_t | maxpacket,
 |  | uint8_t | speed
 | ) |  |

usb host open channel

Parameters
uhost | to the structure of usbh_core_type
chn | host channel number
ept_num | devvice endpoint number
dev_address | device address
type channel transfer type this parameter can be one of the following values:
  • EPT_CONTROL_TYPE
  • EPT_BULK_TYPE
  • EPT_INT_TYPE
  • EPT_ISO_TYPE
maxpacket | support max packe size for this channel
speed device speed this parameter can be one of the following values:
  • USB_PRTSPD_FULL_SPEED
  • USB_PRTSPD_LOW_SPEED
ept_addr | endpoint address
Return values
usb_sts_type

Definition at line 630 of file usbh_core.c.

Referenced by uhost_init_handler(), usbh_attached(), and usbh_enum_handler().

◆ usbh_in_out_request()

usb_sts_type usbh_in_out_request | ( | usbh_core_type * | uhost,
 |  | uint8_t | hc_num
 | ) |  |

usb host in out request

Parameters
uhost | to the structure of usbh_core_type
hc_num | channel number
Return values
status usb_sts_type status

Definition at line 115 of file usbh_core.c.

Referenced by usbh_bulk_recv(), usbh_bulk_send(), usbh_ctrl_recv_data(), usbh_ctrl_send_data(), usbh_ctrl_send_setup(), usbh_interrupt_recv(), usbh_interrupt_send(), usbh_isoc_recv(), and usbh_isoc_send().

◆ usbh_interrupt_recv()

usb_sts_type usbh_interrupt_recv | ( | usbh_core_type * | uhost,
 |  | uint8_t | hc_num,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host interrupt receive request

Parameters
uhost | to the structure of usbh_core_type
hc_num | channel number
buffer | receive buffer
length | receive length
Return values
status usb_sts_type status

Definition at line 216 of file usbh_core.c.

Referenced by uhost_process_handler().

◆ usbh_interrupt_send()

usb_sts_type usbh_interrupt_send | ( | usbh_core_type * | uhost,
 |  | uint8_t | hc_num,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host interrupt send request

Parameters
uhost | to the structure of usbh_core_type
hc_num | channel number
buffer | send buffer
length | send length
Return values
status usb_sts_type status

Definition at line 250 of file usbh_core.c.

◆ usbh_isoc_recv()

usb_sts_type usbh_isoc_recv | ( | usbh_core_type * | uhost,
 |  | uint8_t | hc_num,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host iso receive request

Parameters
uhost | to the structure of usbh_core_type
hc_num | channel number
buffer | receive buffer
length | receive length
Return values
status usb_sts_type status

Definition at line 381 of file usbh_core.c.

◆ usbh_isoc_send()

usb_sts_type usbh_isoc_send | ( | usbh_core_type * | uhost,
 |  | uint8_t | hc_num,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host iso send request

Parameters
uhost | to the structure of usbh_core_type
hc_num | channel number
buffer | send buffer
length | send length
Return values
status usb_sts_type status

Definition at line 355 of file usbh_core.c.

◆ usbh_loop_handler()

usb_sts_type usbh_loop_handler ( usbh_core_type * uhost )

usb host enum loop handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 1134 of file usbh_core.c.

Referenced by main().

◆ usbh_reset_port()

void usbh_reset_port ( usbh_core_type * uhost )

reset usb port

Parameters
usbx to the structure of otg_global_type
Return values
none

Definition at line 941 of file usbh_core.c.

Referenced by usbh_loop_handler().

◆ usbh_resume()

void usbh_resume ( usbh_core_type * uhost )

usb host resume

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 459 of file usbh_core.c.

Referenced by usbh_wakeup().

◆ usbh_set_toggle()

usb_sts_type usbh_set_toggle | ( | usbh_core_type * | uhost,
 |  | uint8_t | hc_num,
 |  | uint8_t | toggle
 | ) |  |

usb host set toggle

Parameters
uhost | to the structure of usbh_core_type
hc_num | channel number
toggle | toggle value
Return values
status usb_sts_type status

Definition at line 94 of file usbh_core.c.

Referenced by uhost_init_handler().

◆ usbh_suspend()

static void usbh_suspend ( usbh_core_type * uhost )
static

usb host suspend

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 1059 of file usbh_core.c.

Referenced by usbh_loop_handler().

◆ usbh_wakeup()

static void usbh_wakeup ( usbh_core_type * uhost )
static

usb host wakeup

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 1081 of file usbh_core.c.

Referenced by usbh_loop_handler().


AT32F415 Firmwary Library: USBH_drivers_control

Modules
USBH_drivers_control
AT32F415_middlewares_usbh_drivers

usb host drivers control More...

Modules

USBH_ctrl_exported_types
USBH_ctrl_private_functions

Detailed Description

usb host drivers control


AT32F415 Firmwary Library: USBH_ctrl_exported_types

Functions
USBH_ctrl_exported_types
AT32F415_middlewares_usbh_drivers » USBH_drivers_control

Functions

usb_sts_type | usbh_ctrl_send_setup (usbh_core_type *uhost, uint8_t *buffer, uint8_t hc_num)
usb host control send setup packet More...
usb_sts_type | usbh_ctrl_recv_data (usbh_core_type *uhost, uint8_t *buffer, uint8_t length, uint16_t hc_num)
usb host control receive data from device More...
usb_sts_type | usbh_ctrl_send_data (usbh_core_type *uhost, uint8_t *buffer, uint8_t length, uint16_t hc_num)
usb host control send data packet More...
usb_sts_type | usbh_ctrl_setup_handler (usbh_core_type *uhost)
usb host control setup request handler More...
usb_sts_type | usbh_ctrl_setup_wait_handler (usbh_core_type *uhost, uint32_t *timeout)
usb host control setup request wait handler More...
usb_sts_type | usbh_ctrl_data_in_handler (usbh_core_type *uhost)
usb host control data in request handler More...
usb_sts_type | usbh_ctrl_data_in_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control data in wait handler More...
usb_sts_type | usbh_ctrl_data_out_handler (usbh_core_type *uhost)
usb host control data out request handler More...
usb_sts_type | usbh_ctrl_data_out_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control data out wait handler More...
usb_sts_type | usbh_ctrl_status_in_handler (usbh_core_type *uhost)
usb host control status data in handler More...
usb_sts_type | usbh_ctrl_status_in_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control status data in wait handler More...
usb_sts_type | usbh_ctrl_status_out_handler (usbh_core_type *uhost)
usb host control status data out wait handler More...
usb_sts_type | usbh_ctrl_status_out_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control status data out wait handler More...
usb_sts_type | usbh_ctrl_error_handler (usbh_core_type *uhost)
usb host control error handler More...
usb_sts_type | usbh_ctrl_stall_handler (usbh_core_type *uhost)
usb host control stall handler More...
usb_sts_type | usbh_ctrl_complete_handler (usbh_core_type *uhost)
usb host control complete handler More...
usb_sts_type | usbh_ctrl_transfer_loop (usbh_core_type *uhost)
usb host control transfer loop function More...
usb_sts_type | usbh_ctrl_request (usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host control request More...
usb_sts_type | usbh_get_descriptor (usbh_core_type *uhost, uint16_t length, uint8_t req_type, uint16_t wvalue, uint8_t *buffer)
usb host get device descriptor More...
void | usbh_parse_dev_desc (usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse device descriptor More...
usb_header_desc_type * | usbh_get_next_header (uint8_t *buf, uint16_t *index_len)
usb host get next header More...
void | usbh_parse_interface_desc (usb_interface_desc_type *intf, uint8_t *buf)
usb host parse interface descriptor More...
void | usbh_parse_endpoint_desc (usb_endpoint_desc_type *ept_desc, uint8_t *buf)
usb host parse endpoint descriptor More...
usb_sts_type | usbh_parse_configure_desc (usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse configure descriptor More...
uint8_t | usbh_find_interface (usbh_core_type *uhost, uint8_t class_code, uint8_t sub_class, uint8_t protocol)
usb host find interface More...
void | usbh_parse_string_desc (uint8_t *src, uint8_t *dest, uint16_t length)
usbh parse string descriptor More...
usb_sts_type | usbh_get_device_descriptor (usbh_core_type *uhost, uint16_t length)
usb host get device descriptor More...
usb_sts_type | usbh_get_configure_descriptor (usbh_core_type *uhost, uint16_t length)
usb host get configure descriptor More...
usb_sts_type | usbh_get_sting_descriptor (usbh_core_type *uhost, uint8_t string_id, uint8_t *buffer, uint16_t length)
usb host get string descriptor More...
usb_sts_type | usbh_set_configuration (usbh_core_type *uhost, uint16_t config)
usb host set configurtion More...
usb_sts_type | usbh_set_address (usbh_core_type *uhost, uint8_t address)
usb host set device address More...
usb_sts_type | usbh_set_interface (usbh_core_type *uhost, uint8_t ept_num, uint8_t altsetting)
usb host set interface More...
usb_sts_type | usbh_set_feature (usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host set feature More...
usb_sts_type | usbh_clear_dev_feature (usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host clear device feature More...
usb_sts_type | usbh_clear_ept_feature (usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num)
usb host clear endpoint feature More...

Detailed Description

Function Documentation

◆ usbh_clear_dev_feature()

usb_sts_type usbh_clear_dev_feature | ( | usbh_core_type * | uhost,
 |  | uint8_t | feature,
 |  | uint16_t | index
 | ) |  |

usb host clear device feature

Parameters
uhost | to the structure of usbh_core_type
feature | feature number
index | index number
Return values
status usb_sts_type status

Definition at line 864 of file usbh_ctrl.c.

Referenced by usbh_wakeup().

◆ usbh_clear_ept_feature()

usb_sts_type usbh_clear_ept_feature | ( | usbh_core_type * | uhost,
 |  | uint8_t | ept_num,
 |  | uint8_t | hc_num
 | ) |  |

usb host clear endpoint feature

Parameters
uhost | to the structure of usbh_core_type
ept_num | endpoint number
hc_num | host channel number
Return values
status usb_sts_type status

Definition at line 886 of file usbh_ctrl.c.

Referenced by usb_bot_request().

◆ usbh_ctrl_complete_handler()

usb_sts_type usbh_ctrl_complete_handler ( usbh_core_type * uhost )

usb host control complete handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 391 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_data_in_handler()

usb_sts_type usbh_ctrl_data_in_handler ( usbh_core_type * uhost )

usb host control data in request handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 178 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_data_in_wait_handler()

usb_sts_type usbh_ctrl_data_in_wait_handler | ( | usbh_core_type * | uhost,
 |  | uint32_t | timeout
 | ) |  |

usb host control data in wait handler

Parameters
uhost | to the structure of usbh_core_type
timeout | wait timeout
Return values
status usb_sts_type status

Definition at line 195 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_data_out_handler()

usb_sts_type usbh_ctrl_data_out_handler ( usbh_core_type * uhost )

usb host control data out request handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 221 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_data_out_wait_handler()

usb_sts_type usbh_ctrl_data_out_wait_handler | ( | usbh_core_type * | uhost,
 |  | uint32_t | timeout
 | ) |  |

usb host control data out wait handler

Parameters
uhost | to the structure of usbh_core_type
timeout | wait timeout
Return values
status usb_sts_type status

Definition at line 240 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_error_handler()

usb_sts_type usbh_ctrl_error_handler ( usbh_core_type * uhost )

usb host control error handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 358 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_recv_data()

usb_sts_type usbh_ctrl_recv_data | ( | usbh_core_type * | uhost,
 |  | uint8_t * | buffer,
 |  | uint8_t | length,
 |  | uint16_t | hc_num
 | ) |  |

usb host control receive data from device

Parameters
uhost | to the structure of usbh_core_type
buffer | usb control receive data buffer
length | usb control receive data length
hc_num | channel number
Return values
status usb_sts_type status

Definition at line 68 of file usbh_ctrl.c.

Referenced by usbh_ctrl_data_in_handler(), and usbh_ctrl_status_in_handler().

◆ usbh_ctrl_request()

usb_sts_type usbh_ctrl_request | ( | usbh_core_type * | uhost,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host control request

Parameters
uhost | to the structure of usbh_core_type
buffer | usb request buffer
length | usb request length
Return values
status usb_sts_type status

Definition at line 472 of file usbh_ctrl.c.

Referenced by usbh_clear_dev_feature(), usbh_clear_endpoint_feature(), usbh_clear_ept_feature(), usbh_get_descriptor(), usbh_hid_set_idle(), usbh_hid_set_protocol(), usbh_msc_clear_feature(), usbh_msc_get_max_lun(), usbh_set_address(), usbh_set_configuration(), usbh_set_feature(), and usbh_set_interface().

◆ usbh_ctrl_send_data()

usb_sts_type usbh_ctrl_send_data | ( | usbh_core_type * | uhost,
 |  | uint8_t * | buffer,
 |  | uint8_t | length,
 |  | uint16_t | hc_num
 | ) |  |

usb host control send data packet

Parameters
uhost | to the structure of usbh_core_type
buffer | usb control send data buffer
length | usb control send data length
hc_num | channel number
Return values
status usb_sts_type status

Definition at line 87 of file usbh_ctrl.c.

Referenced by usbh_ctrl_data_out_handler(), and usbh_ctrl_status_out_handler().

◆ usbh_ctrl_send_setup()

usb_sts_type usbh_ctrl_send_setup | ( | usbh_core_type * | uhost,
 |  | uint8_t * | buffer,
 |  | uint8_t | hc_num
 | ) |  |

usb host control send setup packet

Parameters
uhost | to the structure of usbh_core_type
buffer | usb control setup send buffer
hc_num | channel number
Return values
status usb_sts_type status

Definition at line 50 of file usbh_ctrl.c.

Referenced by usbh_ctrl_setup_handler().

◆ usbh_ctrl_setup_handler()

usb_sts_type usbh_ctrl_setup_handler ( usbh_core_type * uhost )

usb host control setup request handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 114 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_setup_wait_handler()

usb_sts_type usbh_ctrl_setup_wait_handler | ( | usbh_core_type * | uhost,
 |  | uint32_t * | timeout
 | ) |  |

usb host control setup request wait handler

Parameters
uhost | to the structure of usbh_core_type
timeout | pointer of wait timeout
Return values
status usb_sts_type status

Definition at line 128 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_stall_handler()

usb_sts_type usbh_ctrl_stall_handler ( usbh_core_type * uhost )

usb host control stall handler

Parameters
uhost to the structure of usbh_core_type
Return values
usb_sts_type

Definition at line 381 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_status_in_handler()

usb_sts_type usbh_ctrl_status_in_handler ( usbh_core_type * uhost )

usb host control status data in handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 269 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_status_in_wait_handler()

usb_sts_type usbh_ctrl_status_in_wait_handler | ( | usbh_core_type * | uhost,
 |  | uint32_t | timeout
 | ) |  |

usb host control status data in wait handler

Parameters
uhost | to the structure of usbh_core_type
timeout | wait timeout
Return values
status usb_sts_type status

Definition at line 286 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_status_out_handler()

usb_sts_type usbh_ctrl_status_out_handler ( usbh_core_type * uhost )

usb host control status data out wait handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 312 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_status_out_wait_handler()

usb_sts_type usbh_ctrl_status_out_wait_handler | ( | usbh_core_type * | uhost,
 |  | uint32_t | timeout
 | ) |  |

usb host control status data out wait handler

Parameters
uhost | to the structure of usbh_core_type
timeout | wait timeout
Return values
status usb_sts_type status

Definition at line 329 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_transfer_loop()

usb_sts_type usbh_ctrl_transfer_loop ( usbh_core_type * uhost )

usb host control transfer loop function

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 401 of file usbh_ctrl.c.

Referenced by usbh_ctrl_result_check().

◆ usbh_find_interface()

uint8_t usbh_find_interface | ( | usbh_core_type * | uhost,
 |  | uint8_t | class_code,
 |  | uint8_t | sub_class,
 |  | uint8_t | protocol
 | ) |  |

usb host find interface

Parameters
uhost | to the structure of usbh_core_type
class_code | class code
sub_class | subclass code
protocol | prtocol code
Return values
idx interface index

Definition at line 662 of file usbh_ctrl.c.

Referenced by uhost_init_handler().

◆ usbh_get_configure_descriptor()

usb_sts_type usbh_get_configure_descriptor | ( | usbh_core_type * | uhost,
 |  | uint16_t | length
 | ) |  |

usb host get configure descriptor

Parameters
uhost | to the structure of usbh_core_type
length | get device configure length
Return values
status usb_sts_type status

Definition at line 731 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_get_descriptor()

usb_sts_type usbh_get_descriptor | ( | usbh_core_type * | uhost,
 |  | uint16_t | length,
 |  | uint8_t | req_type,
 |  | uint16_t | wvalue,
 |  | uint8_t * | buffer
 | ) |  |

usb host get device descriptor

Parameters
uhost | to the structure of usbh_core_type
length | get descriptor request length
req_type | usb request type
wvalue | usb wvalue
buffer | request buffer
Return values
status usb_sts_type status

Definition at line 494 of file usbh_ctrl.c.

Referenced by usbh_get_configure_descriptor(), usbh_get_device_descriptor(), usbh_get_sting_descriptor(), usbh_hid_get_desc(), and usbh_hid_get_report().

◆ usbh_get_device_descriptor()

usb_sts_type usbh_get_device_descriptor | ( | usbh_core_type * | uhost,
 |  | uint16_t | length
 | ) |  |

usb host get device descriptor

Parameters
uhost | to the structure of usbh_core_type
length | get device descriptor length
Return values
status usb_sts_type status

Definition at line 711 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_get_next_header()

usb_header_desc_type * usbh_get_next_header | ( | uint8_t * | buf,
 |  | uint16_t * | index_len
 | ) |  |

usb host get next header

Parameters
buffer | usb data buffer
index_len | pointer of index len
Return values
status usb_sts_type status

Definition at line 554 of file usbh_ctrl.c.

Referenced by usbh_parse_configure_desc().

◆ usbh_get_sting_descriptor()

usb_sts_type usbh_get_sting_descriptor | ( | usbh_core_type * | uhost,
 |  | uint8_t | string_id,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host get string descriptor

Parameters
uhost | to the structure of usbh_core_type
string_id | string id
buffer | receive data buffer
length | get device string length
Return values
status usb_sts_type status

Definition at line 754 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_parse_configure_desc()

usb_sts_type usbh_parse_configure_desc | ( | usbh_core_type * | uhost,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host parse configure descriptor

Parameters
uhost | to the structure of usbh_core_type
buffer | configure buffer
length | configure length
Return values
status usb_sts_type status

Definition at line 603 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_parse_dev_desc()

void usbh_parse_dev_desc | ( | usbh_core_type * | uhost,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host parse device descriptor

Parameters
uhost | to the structure of usbh_core_type
buffer | usb device descriptor buffer
length | usb device descriptor length
Return values
status usb_sts_type status

Definition at line 524 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_parse_endpoint_desc()

void usbh_parse_endpoint_desc | ( | usb_endpoint_desc_type * | ept_desc,
 |  | uint8_t * | buf
 | ) |  |

usb host parse endpoint descriptor

Parameters
ept_desc | endpoint type
buf | endpoint description data buffer
Return values
none

Definition at line 586 of file usbh_ctrl.c.

Referenced by usbh_parse_configure_desc().

◆ usbh_parse_interface_desc()

void usbh_parse_interface_desc | ( | usb_interface_desc_type * | intf,
 |  | uint8_t * | buf
 | ) |  |

usb host parse interface descriptor

Parameters
intf | usb interface description type
buf | interface description data buffer
Return values
none

Definition at line 567 of file usbh_ctrl.c.

Referenced by usbh_parse_configure_desc().

◆ usbh_parse_string_desc()

void usbh_parse_string_desc | ( | uint8_t * | src,
 |  | uint8_t * | dest,
 |  | uint16_t | length
 | ) |  |

usbh parse string descriptor

Parameters
src | string source pointer
dest | string destination pointer
length | string length
Return values
none

Definition at line 687 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_set_address()

usb_sts_type usbh_set_address | ( | usbh_core_type * | uhost,
 |  | uint8_t | address
 | ) |  |

usb host set device address

Parameters
uhost | to the structure of usbh_core_type
address | device address
Return values
status usb_sts_type status

Definition at line 797 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_set_configuration()

usb_sts_type usbh_set_configuration | ( | usbh_core_type * | uhost,
 |  | uint16_t | config
 | ) |  |

usb host set configurtion

Parameters
uhost | to the structure of usbh_core_type
config | usb configuration
Return values
status usb_sts_type status

Definition at line 776 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_set_feature()

usb_sts_type usbh_set_feature | ( | usbh_core_type * | uhost,
 |  | uint8_t | feature,
 |  | uint16_t | index
 | ) |  |

usb host set feature

Parameters
uhost | to the structure of usbh_core_type
feature | feature number
index | index number
Return values
status usb_sts_type status

Definition at line 841 of file usbh_ctrl.c.

Referenced by usbh_suspend().

◆ usbh_set_interface()

usb_sts_type usbh_set_interface | ( | usbh_core_type * | uhost,
 |  | uint8_t | ept_num,
 |  | uint8_t | altsetting
 | ) |  |

usb host set interface

Parameters
uhost | to the structure of usbh_core_type
ept_num | endpoint number
altsetting | alter setting
Return values
status usb_sts_type status

Definition at line 819 of file usbh_ctrl.c.


AT32F415 Firmwary Library: USBH_ctrl_private_functions

Functions
USBH_ctrl_private_functions
AT32F415_middlewares_usbh_drivers » USBH_drivers_control

Functions

usb_sts_type | usbh_ctrl_send_setup (usbh_core_type *uhost, uint8_t *buffer, uint8_t hc_num)
usb host control send setup packet More...
usb_sts_type | usbh_ctrl_recv_data (usbh_core_type *uhost, uint8_t *buffer, uint8_t length, uint16_t hc_num)
usb host control receive data from device More...
usb_sts_type | usbh_ctrl_send_data (usbh_core_type *uhost, uint8_t *buffer, uint8_t length, uint16_t hc_num)
usb host control send data packet More...
usb_sts_type | usbh_ctrl_setup_handler (usbh_core_type *uhost)
usb host control setup request handler More...
usb_sts_type | usbh_ctrl_setup_wait_handler (usbh_core_type *uhost, uint32_t *timeout)
usb host control setup request wait handler More...
usb_sts_type | usbh_ctrl_data_in_handler (usbh_core_type *uhost)
usb host control data in request handler More...
usb_sts_type | usbh_ctrl_data_in_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control data in wait handler More...
usb_sts_type | usbh_ctrl_data_out_handler (usbh_core_type *uhost)
usb host control data out request handler More...
usb_sts_type | usbh_ctrl_data_out_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control data out wait handler More...
usb_sts_type | usbh_ctrl_status_in_handler (usbh_core_type *uhost)
usb host control status data in handler More...
usb_sts_type | usbh_ctrl_status_in_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control status data in wait handler More...
usb_sts_type | usbh_ctrl_status_out_handler (usbh_core_type *uhost)
usb host control status data out wait handler More...
usb_sts_type | usbh_ctrl_status_out_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control status data out wait handler More...
usb_sts_type | usbh_ctrl_error_handler (usbh_core_type *uhost)
usb host control error handler More...
usb_sts_type | usbh_ctrl_stall_handler (usbh_core_type *uhost)
usb host control stall handler More...
usb_sts_type | usbh_ctrl_complete_handler (usbh_core_type *uhost)
usb host control complete handler More...
usb_sts_type | usbh_ctrl_transfer_loop (usbh_core_type *uhost)
usb host control transfer loop function More...
usb_sts_type | usbh_ctrl_request (usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host control request More...
usb_sts_type | usbh_get_descriptor (usbh_core_type *uhost, uint16_t length, uint8_t req_type, uint16_t wvalue, uint8_t *buffer)
usb host get device descriptor More...
void | usbh_parse_dev_desc (usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse device descriptor More...
usb_header_desc_type * | usbh_get_next_header (uint8_t *buf, uint16_t *index_len)
usb host get next header More...
void | usbh_parse_interface_desc (usb_interface_desc_type *intf, uint8_t *buf)
usb host parse interface descriptor More...
void | usbh_parse_endpoint_desc (usb_endpoint_desc_type *ept_desc, uint8_t *buf)
usb host parse endpoint descriptor More...
usb_sts_type | usbh_parse_configure_desc (usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse configure descriptor More...
uint8_t | usbh_find_interface (usbh_core_type *uhost, uint8_t class_code, uint8_t sub_class, uint8_t protocol)
usb host find interface More...
void | usbh_parse_string_desc (uint8_t *src, uint8_t *dest, uint16_t length)
usbh parse string descriptor More...
usb_sts_type | usbh_get_device_descriptor (usbh_core_type *uhost, uint16_t length)
usb host get device descriptor More...
usb_sts_type | usbh_get_configure_descriptor (usbh_core_type *uhost, uint16_t length)
usb host get configure descriptor More...
usb_sts_type | usbh_get_sting_descriptor (usbh_core_type *uhost, uint8_t string_id, uint8_t *buffer, uint16_t length)
usb host get string descriptor More...
usb_sts_type | usbh_set_configuration (usbh_core_type *uhost, uint16_t config)
usb host set configurtion More...
usb_sts_type | usbh_set_address (usbh_core_type *uhost, uint8_t address)
usb host set device address More...
usb_sts_type | usbh_set_interface (usbh_core_type *uhost, uint8_t ept_num, uint8_t altsetting)
usb host set interface More...
usb_sts_type | usbh_set_feature (usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host set feature More...
usb_sts_type | usbh_clear_dev_feature (usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host clear device feature More...
usb_sts_type | usbh_clear_ept_feature (usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num)
usb host clear endpoint feature More...

Detailed Description

Function Documentation

◆ usbh_clear_dev_feature()

usb_sts_type usbh_clear_dev_feature | ( | usbh_core_type * | uhost,
 |  | uint8_t | feature,
 |  | uint16_t | index
 | ) |  |

usb host clear device feature

Parameters
uhost | to the structure of usbh_core_type
feature | feature number
index | index number
Return values
status usb_sts_type status

Definition at line 864 of file usbh_ctrl.c.

Referenced by usbh_wakeup().

◆ usbh_clear_ept_feature()

usb_sts_type usbh_clear_ept_feature | ( | usbh_core_type * | uhost,
 |  | uint8_t | ept_num,
 |  | uint8_t | hc_num
 | ) |  |

usb host clear endpoint feature

Parameters
uhost | to the structure of usbh_core_type
ept_num | endpoint number
hc_num | host channel number
Return values
status usb_sts_type status

Definition at line 886 of file usbh_ctrl.c.

Referenced by usb_bot_request().

◆ usbh_ctrl_complete_handler()

usb_sts_type usbh_ctrl_complete_handler ( usbh_core_type * uhost )

usb host control complete handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 391 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_data_in_handler()

usb_sts_type usbh_ctrl_data_in_handler ( usbh_core_type * uhost )

usb host control data in request handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 178 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_data_in_wait_handler()

usb_sts_type usbh_ctrl_data_in_wait_handler | ( | usbh_core_type * | uhost,
 |  | uint32_t | timeout
 | ) |  |

usb host control data in wait handler

Parameters
uhost | to the structure of usbh_core_type
timeout | wait timeout
Return values
status usb_sts_type status

Definition at line 195 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_data_out_handler()

usb_sts_type usbh_ctrl_data_out_handler ( usbh_core_type * uhost )

usb host control data out request handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 221 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_data_out_wait_handler()

usb_sts_type usbh_ctrl_data_out_wait_handler | ( | usbh_core_type * | uhost,
 |  | uint32_t | timeout
 | ) |  |

usb host control data out wait handler

Parameters
uhost | to the structure of usbh_core_type
timeout | wait timeout
Return values
status usb_sts_type status

Definition at line 240 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_error_handler()

usb_sts_type usbh_ctrl_error_handler ( usbh_core_type * uhost )

usb host control error handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 358 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_recv_data()

usb_sts_type usbh_ctrl_recv_data | ( | usbh_core_type * | uhost,
 |  | uint8_t * | buffer,
 |  | uint8_t | length,
 |  | uint16_t | hc_num
 | ) |  |

usb host control receive data from device

Parameters
uhost | to the structure of usbh_core_type
buffer | usb control receive data buffer
length | usb control receive data length
hc_num | channel number
Return values
status usb_sts_type status

Definition at line 68 of file usbh_ctrl.c.

Referenced by usbh_ctrl_data_in_handler(), and usbh_ctrl_status_in_handler().

◆ usbh_ctrl_request()

usb_sts_type usbh_ctrl_request | ( | usbh_core_type * | uhost,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host control request

Parameters
uhost | to the structure of usbh_core_type
buffer | usb request buffer
length | usb request length
Return values
status usb_sts_type status

Definition at line 472 of file usbh_ctrl.c.

Referenced by usbh_clear_dev_feature(), usbh_clear_endpoint_feature(), usbh_clear_ept_feature(), usbh_get_descriptor(), usbh_hid_set_idle(), usbh_hid_set_protocol(), usbh_msc_clear_feature(), usbh_msc_get_max_lun(), usbh_set_address(), usbh_set_configuration(), usbh_set_feature(), and usbh_set_interface().

◆ usbh_ctrl_send_data()

usb_sts_type usbh_ctrl_send_data | ( | usbh_core_type * | uhost,
 |  | uint8_t * | buffer,
 |  | uint8_t | length,
 |  | uint16_t | hc_num
 | ) |  |

usb host control send data packet

Parameters
uhost | to the structure of usbh_core_type
buffer | usb control send data buffer
length | usb control send data length
hc_num | channel number
Return values
status usb_sts_type status

Definition at line 87 of file usbh_ctrl.c.

Referenced by usbh_ctrl_data_out_handler(), and usbh_ctrl_status_out_handler().

◆ usbh_ctrl_send_setup()

usb_sts_type usbh_ctrl_send_setup | ( | usbh_core_type * | uhost,
 |  | uint8_t * | buffer,
 |  | uint8_t | hc_num
 | ) |  |

usb host control send setup packet

Parameters
uhost | to the structure of usbh_core_type
buffer | usb control setup send buffer
hc_num | channel number
Return values
status usb_sts_type status

Definition at line 50 of file usbh_ctrl.c.

Referenced by usbh_ctrl_setup_handler().

◆ usbh_ctrl_setup_handler()

usb_sts_type usbh_ctrl_setup_handler ( usbh_core_type * uhost )

usb host control setup request handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 114 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_setup_wait_handler()

usb_sts_type usbh_ctrl_setup_wait_handler | ( | usbh_core_type * | uhost,
 |  | uint32_t * | timeout
 | ) |  |

usb host control setup request wait handler

Parameters
uhost | to the structure of usbh_core_type
timeout | pointer of wait timeout
Return values
status usb_sts_type status

Definition at line 128 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_stall_handler()

usb_sts_type usbh_ctrl_stall_handler ( usbh_core_type * uhost )

usb host control stall handler

Parameters
uhost to the structure of usbh_core_type
Return values
usb_sts_type

Definition at line 381 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_status_in_handler()

usb_sts_type usbh_ctrl_status_in_handler ( usbh_core_type * uhost )

usb host control status data in handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 269 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_status_in_wait_handler()

usb_sts_type usbh_ctrl_status_in_wait_handler | ( | usbh_core_type * | uhost,
 |  | uint32_t | timeout
 | ) |  |

usb host control status data in wait handler

Parameters
uhost | to the structure of usbh_core_type
timeout | wait timeout
Return values
status usb_sts_type status

Definition at line 286 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_status_out_handler()

usb_sts_type usbh_ctrl_status_out_handler ( usbh_core_type * uhost )

usb host control status data out wait handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 312 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_status_out_wait_handler()

usb_sts_type usbh_ctrl_status_out_wait_handler | ( | usbh_core_type * | uhost,
 |  | uint32_t | timeout
 | ) |  |

usb host control status data out wait handler

Parameters
uhost | to the structure of usbh_core_type
timeout | wait timeout
Return values
status usb_sts_type status

Definition at line 329 of file usbh_ctrl.c.

Referenced by usbh_ctrl_transfer_loop().

◆ usbh_ctrl_transfer_loop()

usb_sts_type usbh_ctrl_transfer_loop ( usbh_core_type * uhost )

usb host control transfer loop function

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 401 of file usbh_ctrl.c.

Referenced by usbh_ctrl_result_check().

◆ usbh_find_interface()

uint8_t usbh_find_interface | ( | usbh_core_type * | uhost,
 |  | uint8_t | class_code,
 |  | uint8_t | sub_class,
 |  | uint8_t | protocol
 | ) |  |

usb host find interface

Parameters
uhost | to the structure of usbh_core_type
class_code | class code
sub_class | subclass code
protocol | prtocol code
Return values
idx interface index

Definition at line 662 of file usbh_ctrl.c.

Referenced by uhost_init_handler().

◆ usbh_get_configure_descriptor()

usb_sts_type usbh_get_configure_descriptor | ( | usbh_core_type * | uhost,
 |  | uint16_t | length
 | ) |  |

usb host get configure descriptor

Parameters
uhost | to the structure of usbh_core_type
length | get device configure length
Return values
status usb_sts_type status

Definition at line 731 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_get_descriptor()

usb_sts_type usbh_get_descriptor | ( | usbh_core_type * | uhost,
 |  | uint16_t | length,
 |  | uint8_t | req_type,
 |  | uint16_t | wvalue,
 |  | uint8_t * | buffer
 | ) |  |

usb host get device descriptor

Parameters
uhost | to the structure of usbh_core_type
length | get descriptor request length
req_type | usb request type
wvalue | usb wvalue
buffer | request buffer
Return values
status usb_sts_type status

Definition at line 494 of file usbh_ctrl.c.

Referenced by usbh_get_configure_descriptor(), usbh_get_device_descriptor(), usbh_get_sting_descriptor(), usbh_hid_get_desc(), and usbh_hid_get_report().

◆ usbh_get_device_descriptor()

usb_sts_type usbh_get_device_descriptor | ( | usbh_core_type * | uhost,
 |  | uint16_t | length
 | ) |  |

usb host get device descriptor

Parameters
uhost | to the structure of usbh_core_type
length | get device descriptor length
Return values
status usb_sts_type status

Definition at line 711 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_get_next_header()

usb_header_desc_type * usbh_get_next_header | ( | uint8_t * | buf,
 |  | uint16_t * | index_len
 | ) |  |

usb host get next header

Parameters
buffer | usb data buffer
index_len | pointer of index len
Return values
status usb_sts_type status

Definition at line 554 of file usbh_ctrl.c.

Referenced by usbh_parse_configure_desc().

◆ usbh_get_sting_descriptor()

usb_sts_type usbh_get_sting_descriptor | ( | usbh_core_type * | uhost,
 |  | uint8_t | string_id,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host get string descriptor

Parameters
uhost | to the structure of usbh_core_type
string_id | string id
buffer | receive data buffer
length | get device string length
Return values
status usb_sts_type status

Definition at line 754 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_parse_configure_desc()

usb_sts_type usbh_parse_configure_desc | ( | usbh_core_type * | uhost,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host parse configure descriptor

Parameters
uhost | to the structure of usbh_core_type
buffer | configure buffer
length | configure length
Return values
status usb_sts_type status

Definition at line 603 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_parse_dev_desc()

void usbh_parse_dev_desc | ( | usbh_core_type * | uhost,
 |  | uint8_t * | buffer,
 |  | uint16_t | length
 | ) |  |

usb host parse device descriptor

Parameters
uhost | to the structure of usbh_core_type
buffer | usb device descriptor buffer
length | usb device descriptor length
Return values
status usb_sts_type status

Definition at line 524 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_parse_endpoint_desc()

void usbh_parse_endpoint_desc | ( | usb_endpoint_desc_type * | ept_desc,
 |  | uint8_t * | buf
 | ) |  |

usb host parse endpoint descriptor

Parameters
ept_desc | endpoint type
buf | endpoint description data buffer
Return values
none

Definition at line 586 of file usbh_ctrl.c.

Referenced by usbh_parse_configure_desc().

◆ usbh_parse_interface_desc()

void usbh_parse_interface_desc | ( | usb_interface_desc_type * | intf,
 |  | uint8_t * | buf
 | ) |  |

usb host parse interface descriptor

Parameters
intf | usb interface description type
buf | interface description data buffer
Return values
none

Definition at line 567 of file usbh_ctrl.c.

Referenced by usbh_parse_configure_desc().

◆ usbh_parse_string_desc()

void usbh_parse_string_desc | ( | uint8_t * | src,
 |  | uint8_t * | dest,
 |  | uint16_t | length
 | ) |  |

usbh parse string descriptor

Parameters
src | string source pointer
dest | string destination pointer
length | string length
Return values
none

Definition at line 687 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_set_address()

usb_sts_type usbh_set_address | ( | usbh_core_type * | uhost,
 |  | uint8_t | address
 | ) |  |

usb host set device address

Parameters
uhost | to the structure of usbh_core_type
address | device address
Return values
status usb_sts_type status

Definition at line 797 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_set_configuration()

usb_sts_type usbh_set_configuration | ( | usbh_core_type * | uhost,
 |  | uint16_t | config
 | ) |  |

usb host set configurtion

Parameters
uhost | to the structure of usbh_core_type
config | usb configuration
Return values
status usb_sts_type status

Definition at line 776 of file usbh_ctrl.c.

Referenced by usbh_enum_handler().

◆ usbh_set_feature()

usb_sts_type usbh_set_feature | ( | usbh_core_type * | uhost,
 |  | uint8_t | feature,
 |  | uint16_t | index
 | ) |  |

usb host set feature

Parameters
uhost | to the structure of usbh_core_type
feature | feature number
index | index number
Return values
status usb_sts_type status

Definition at line 841 of file usbh_ctrl.c.

Referenced by usbh_suspend().

◆ usbh_set_interface()

usb_sts_type usbh_set_interface | ( | usbh_core_type * | uhost,
 |  | uint8_t | ept_num,
 |  | uint8_t | altsetting
 | ) |  |

usb host set interface

Parameters
uhost | to the structure of usbh_core_type
ept_num | endpoint number
altsetting | alter setting
Return values
status usb_sts_type status

Definition at line 819 of file usbh_ctrl.c.


AT32F415 Firmwary Library: USBH_drivers_interrupt

Modules
USBH_drivers_interrupt
AT32F415_middlewares_usbh_drivers

usb host interrupt More...

Modules

USBH_int_private_functions

Detailed Description

usb host interrupt


AT32F415 Firmwary Library: USBH_int_private_functions

Functions
USBH_int_private_functions
AT32F415_middlewares_usbh_drivers » USBH_drivers_interrupt

Functions

void | usbh_irq_handler (otg_core_type *otgdev)
usb host interrupt handler More...
void | usbh_wakeup_handler (usbh_core_type *uhost)
usb host wakeup handler More...
void | usbh_sof_handler (usbh_core_type *uhost)
usb host sof handler More...
void | usbh_disconnect_handler (usbh_core_type *uhost)
usb host disconnect handler More...
void | usbh_hch_in_handler (usbh_core_type *uhost, uint8_t chn)
usb host in transfer request handler More...
void | usbh_hch_out_handler (usbh_core_type *uhost, uint8_t chn)
usb host out transfer request handler More...
void | usbh_hch_handler (usbh_core_type *uhost)
usb host channel request handler More...
void | usbh_rx_qlvl_handler (usbh_core_type *uhost)
usb host rx buffer not empty request handler More...
void | usbh_port_handler (usbh_core_type *uhost)
usb host port request handler More...

Detailed Description

Function Documentation

◆ usbh_disconnect_handler()

void usbh_disconnect_handler ( usbh_core_type * uhost )

usb host disconnect handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 133 of file usbh_int.c.

Referenced by usbh_irq_handler().

◆ usbh_hch_handler()

void usbh_hch_handler ( usbh_core_type * uhost )

usb host channel request handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 357 of file usbh_int.c.

Referenced by usbh_irq_handler().

◆ usbh_hch_in_handler()

void usbh_hch_in_handler | ( | usbh_core_type * | uhost,
 |  | uint8_t | chn
 | ) |  |

usb host in transfer request handler

Parameters
uhost | to the structure of usbh_core_type
chn | channel number
Return values
none

Definition at line 161 of file usbh_int.c.

Referenced by usbh_hch_handler().

◆ usbh_hch_out_handler()

void usbh_hch_out_handler | ( | usbh_core_type * | uhost,
 |  | uint8_t | chn
 | ) |  |

usb host out transfer request handler

Parameters
uhost | to the structure of usbh_core_type
chn | channel number
Return values
none

Definition at line 270 of file usbh_int.c.

Referenced by usbh_hch_handler().

◆ usbh_irq_handler()

void usbh_irq_handler ( otg_core_type * otgdev )

usb host interrupt handler

Parameters
otgdev to the structure of otg_core_type
Return values
none

Definition at line 47 of file usbh_int.c.

Referenced by OTG_IRQ_HANDLER().

◆ usbh_port_handler()

void usbh_port_handler ( usbh_core_type * uhost )

usb host port request handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 438 of file usbh_int.c.

Referenced by usbh_irq_handler().

◆ usbh_rx_qlvl_handler()

void usbh_rx_qlvl_handler ( usbh_core_type * uhost )

usb host rx buffer not empty request handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 387 of file usbh_int.c.

Referenced by usbh_irq_handler().

◆ usbh_sof_handler()

void usbh_sof_handler ( usbh_core_type * uhost )

usb host sof handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 123 of file usbh_int.c.

Referenced by usbh_irq_handler().

◆ usbh_wakeup_handler()

void usbh_wakeup_handler ( usbh_core_type * uhost )

usb host wakeup handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 113 of file usbh_int.c.

Referenced by usbh_irq_handler().


AT32F415 Firmwary Library: USBH_drivers_int

Modules
USBH_drivers_int
AT32F415_middlewares_usbh_drivers

Modules

USBH_interrupt_exported_types

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: USBH_interrupt_exported_types

Functions
USBH_interrupt_exported_types
AT32F415_middlewares_usbh_drivers » USBH_drivers_int

Functions

void | usbh_irq_handler (otg_core_type *hdev)
usb host interrupt handler More...
void | usbh_hch_handler (usbh_core_type *uhost)
usb host channel request handler More...
void | usbh_port_handler (usbh_core_type *uhost)
usb host port request handler More...
void | usbh_disconnect_handler (usbh_core_type *uhost)
usb host disconnect handler More...
void | usbh_hch_in_handler (usbh_core_type *uhost, uint8_t chn)
usb host in transfer request handler More...
void | usbh_hch_out_handler (usbh_core_type *uhost, uint8_t chn)
usb host out transfer request handler More...
void | usbh_rx_qlvl_handler (usbh_core_type *uhost)
usb host rx buffer not empty request handler More...
void | usbh_wakeup_handler (usbh_core_type *uhost)
usb host wakeup handler More...
void | usbh_sof_handler (usbh_core_type *uhost)
usb host sof handler More...

Detailed Description

Function Documentation

◆ usbh_disconnect_handler()

void usbh_disconnect_handler ( usbh_core_type * uhost )

usb host disconnect handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 133 of file usbh_int.c.

Referenced by usbh_irq_handler().

◆ usbh_hch_handler()

void usbh_hch_handler ( usbh_core_type * uhost )

usb host channel request handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 357 of file usbh_int.c.

Referenced by usbh_irq_handler().

◆ usbh_hch_in_handler()

void usbh_hch_in_handler | ( | usbh_core_type * | uhost,
 |  | uint8_t | chn
 | ) |  |

usb host in transfer request handler

Parameters
uhost | to the structure of usbh_core_type
chn | channel number
Return values
none

Definition at line 161 of file usbh_int.c.

Referenced by usbh_hch_handler().

◆ usbh_hch_out_handler()

void usbh_hch_out_handler | ( | usbh_core_type * | uhost,
 |  | uint8_t | chn
 | ) |  |

usb host out transfer request handler

Parameters
uhost | to the structure of usbh_core_type
chn | channel number
Return values
none

Definition at line 270 of file usbh_int.c.

Referenced by usbh_hch_handler().

◆ usbh_irq_handler()

void usbh_irq_handler ( otg_core_type * otgdev )

usb host interrupt handler

Parameters
otgdev to the structure of otg_core_type
Return values
none

Definition at line 47 of file usbh_int.c.

Referenced by OTG_IRQ_HANDLER().

◆ usbh_port_handler()

void usbh_port_handler ( usbh_core_type * uhost )

usb host port request handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 438 of file usbh_int.c.

Referenced by usbh_irq_handler().

◆ usbh_rx_qlvl_handler()

void usbh_rx_qlvl_handler ( usbh_core_type * uhost )

usb host rx buffer not empty request handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 387 of file usbh_int.c.

Referenced by usbh_irq_handler().

◆ usbh_sof_handler()

void usbh_sof_handler ( usbh_core_type * uhost )

usb host sof handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 123 of file usbh_int.c.

Referenced by usbh_irq_handler().

◆ usbh_wakeup_handler()

void usbh_wakeup_handler ( usbh_core_type * uhost )

usb host wakeup handler

Parameters
uhost to the structure of usbh_core_type
Return values
none

Definition at line 113 of file usbh_int.c.

Referenced by usbh_irq_handler().


AT32F415 Firmwary Library: AT32F415_middlewares_usbd_class

Modules
AT32F415_middlewares_usbd_class

Modules

USB_audio_class
usb device class audio demo
USB_audio_desc
usb device audio descriptor
USB_audio_hid_class
usb device class audio hid demo
USB_audio_hid_desc
usb device audio hid descriptor
USB_cdc_class
usb device class cdc demo
USB_cdc_desc
usb device cdc descriptor
USB_cdc_keyboard_class
usb device class composite cdc and keyboard
USB_cdc_keyboard_desc
usb device cdc keyboard descriptor
USB_custom_hid_class
usb device custom hid demo
USB_custom_hid_desc
usb device custom_hid descriptor
USB_hid_iap_class
usb device class hid iap demo
USB_hid_iap_desc
usb device hid_iap descriptor
USB_keyboard_class
usb device keyboard demo
USB_keyboard_desc
usb device keyboard descriptor
USB_mouse_class
usb device mouse demo
USB_mouse_desc
usb device mouse descriptor
USB_msc_bot_scsi
usb device class mass storage demo
USB_msc_class
usb device class msc demo
USB_msc_desc
usb device msc descriptor
USB_printer_class
usb device class printer demo
USB_printer_desc
usb device printer descriptor

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: USB_audio_class

Modules
USB_audio_class
AT32F415_middlewares_usbd_class

usb device class audio demo More...

Modules

USB_audio_class_private_functions
USB_audio_class_definition
USB_device_audio_config_definition

Detailed Description

usb device class audio demo


AT32F415 Firmwary Library: USB_audio_class_private_functions

Variables
USB_audio_class_private_functions
AT32F415_middlewares_usbd_class » USB_audio_class

Variables

usb_audio_type | audio_struct = {0, 0, 0, 0, 0, 0x1400, 0, 0, 0, {0x0000, 0x1400, 0x33}, {0x0000, 0x1400, 0x33}}
static __IO uint16_t | audio_feedback_state = 0
static __IO uint8_t | audio_spk_out_stage = 0
usbd_class_handler | audio_class_handler

Detailed Description

Variable Documentation

◆ audio_class_handler

usbd_class_handler audio_class_handler
Initial value:
=
{
class_init_handler,
class_clear_handler,
class_setup_handler,
class_ept0_tx_handler,
class_ept0_rx_handler,
class_in_handler,
class_out_handler,
class_sof_handler,
class_event_handler,
}
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: audio_class.c:394
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: audio_class.c:353
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: audio_class.c:136
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: audio_class.c:214
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: audio_class.c:298
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb custom hid endpoint
Definition: audio_class.c:86
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: audio_class.c:228
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: audio_class.c:327
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: audio_class.c:111

Definition at line 68 of file audio_class.c.

Referenced by main().

◆ audio_feedback_state

__IO uint16_t audio_feedback_state = 0
static

Definition at line 65 of file audio_class.c.

Referenced by class_in_handler(), and class_sof_handler().

◆ audio_spk_out_stage

__IO uint8_t audio_spk_out_stage = 0
static

Definition at line 66 of file audio_class.c.

Referenced by class_out_handler(), and class_sof_handler().

◆ audio_struct

usb_audio_type audio_struct = {0, 0, 0, 0, 0, 0x1400, 0, 0, 0, {0x0000, 0x1400, 0x33}, {0x0000, 0x1400, 0x33}}

Definition at line 63 of file audio_class.c.

Referenced by audio_get_interface(), audio_inisoincom_event(), audio_req_get_cur(), audio_req_get_max(), audio_req_get_min(), audio_req_get_res(), audio_req_set_cur(), audio_set_interface(), class_ept0_rx_handler(), class_event_handler(), class_in_handler(), class_init_handler(), class_out_handler(), and class_sof_handler().


AT32F415 Firmwary Library: USB_audio_class_definition

Data Structures | Macros | Variables
USB_audio_class_definition
AT32F415_middlewares_usbd_class » USB_audio_class

Data Structures

struct usb_audio_type
usb audio control struct More...

Macros

#define | USBD_AUDIO_MIC_IN_EPT 0x81
endpoint define More...
#define | USBD_AUDIO_SPK_OUT_EPT 0x02
#define | USBD_AUDIO_FEEDBACK_EPT 0x83
#define | AUDIO_REMAIN_SIZE 40
endpoint support max size More...
#define | AUDIO_MIC_IN_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_MIC_CHANEL_NUM * (AUDIO_MIC_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)
#define | AUDIO_SPK_OUT_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_SPK_CHANEL_NUM * (AUDIO_SPK_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)
#define | AUDIO_FEEDBACK_MAXPACKET_SIZE 0x3
#define | FEEDBACK_REFRESH_TIME 0x8
#define | AUDIO_REQ_CONTROL_INTERFACE 0x01
request type define More...
#define | AUDIO_REQ_CONTROL_ENDPOINT 0x02
#define | AUDIO_REQ_CONTROL_MASK 0x03
#define | AUDIO_MUTE_CONTROL 0x01
audio set cur type define More...
#define | AUDIO_VOLUME_CONTROL 0x02
#define | AUDIO_FREQ_SET_CONTROL 0x03
#define | AUDIO_DESCRIPTOR_TYPE 0x21
audio descriptor type More...
#define | AUDIO_DESCRIPTOR_SIZE 0x09

Variables

usbd_class_handler audio_class_handler

Detailed Description

Macro Definition Documentation

◆ AUDIO_DESCRIPTOR_SIZE

#define AUDIO_DESCRIPTOR_SIZE 0x09

Definition at line 84 of file audio_class.h.

◆ AUDIO_DESCRIPTOR_TYPE

#define AUDIO_DESCRIPTOR_TYPE 0x21

audio descriptor type

Definition at line 83 of file audio_class.h.

◆ AUDIO_FEEDBACK_MAXPACKET_SIZE

#define AUDIO_FEEDBACK_MAXPACKET_SIZE 0x3

Definition at line 64 of file audio_class.h.

◆ AUDIO_FREQ_SET_CONTROL

#define AUDIO_FREQ_SET_CONTROL 0x03

Definition at line 78 of file audio_class.h.

◆ AUDIO_MIC_IN_MAXPACKET_SIZE

#define AUDIO_MIC_IN_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_MIC_CHANEL_NUM * (AUDIO_MIC_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)

Definition at line 62 of file audio_class.h.

◆ AUDIO_MUTE_CONTROL

#define AUDIO_MUTE_CONTROL 0x01

audio set cur type define

Definition at line 76 of file audio_class.h.

◆ AUDIO_REMAIN_SIZE

#define AUDIO_REMAIN_SIZE 40

endpoint support max size

Definition at line 61 of file audio_class.h.

◆ AUDIO_REQ_CONTROL_ENDPOINT

#define AUDIO_REQ_CONTROL_ENDPOINT 0x02

Definition at line 70 of file audio_class.h.

◆ AUDIO_REQ_CONTROL_INTERFACE

#define AUDIO_REQ_CONTROL_INTERFACE 0x01

request type define

Definition at line 69 of file audio_class.h.

◆ AUDIO_REQ_CONTROL_MASK

#define AUDIO_REQ_CONTROL_MASK 0x03

Definition at line 71 of file audio_class.h.

◆ AUDIO_SPK_OUT_MAXPACKET_SIZE

#define AUDIO_SPK_OUT_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_SPK_CHANEL_NUM * (AUDIO_SPK_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)

Definition at line 63 of file audio_class.h.

◆ AUDIO_VOLUME_CONTROL

#define AUDIO_VOLUME_CONTROL 0x02

Definition at line 77 of file audio_class.h.

◆ FEEDBACK_REFRESH_TIME

#define FEEDBACK_REFRESH_TIME 0x8

Definition at line 65 of file audio_class.h.

◆ USBD_AUDIO_FEEDBACK_EPT

#define USBD_AUDIO_FEEDBACK_EPT 0x83

Definition at line 56 of file audio_class.h.

◆ USBD_AUDIO_MIC_IN_EPT

#define USBD_AUDIO_MIC_IN_EPT 0x81

endpoint define

Definition at line 54 of file audio_class.h.

◆ USBD_AUDIO_SPK_OUT_EPT

#define USBD_AUDIO_SPK_OUT_EPT 0x02

Definition at line 55 of file audio_class.h.

Variable Documentation

◆ audio_class_handler

usbd_class_handler audio_class_handler
extern

Definition at line 68 of file audio_class.c.

Referenced by main().


AT32F415 Firmwary Library: usb_audio_type Struct Reference

Data Fields
usb_audio_type Struct Reference
AT32F415_middlewares_usbd_class » USB_audio_class » USB_audio_class_definition | AT32F415_middlewares_usbd_class » USB_audio_hid_class » USB_audio_hid_class_definition

usb audio control struct More...

#include <audio_class.h>

Data Fields

uint8_t | enpd
uint8_t | interface
uint8_t | request_no
uint8_t | spk_mute
uint8_t | mic_mute
uint16_t | spk_volume
uint16_t | mic_volume
uint32_t | spk_freq
uint32_t | mic_freq
uint16_t | spk_volume_limits [3]
uint16_t | mic_volume_limits [3]
uint8_t | audio_cmd
uint32_t | audio_cmd_len
uint32_t | spk_alt_setting
uint32_t | mic_alt_setting
uint8_t | g_audio_cur [64]
uint8_t | audio_spk_data [(48 *2 *(16/8)+40)]
uint8_t | audio_mic_data [(48 *2 *(16/8)+40)]
uint8_t | audio_feed_back [0x3+1]

Detailed Description

usb audio control struct

Definition at line 89 of file audio_class.h.

Field Documentation

◆ audio_cmd

uint8_t usb_audio_type::audio_cmd

Definition at line 103 of file audio_class.h.

Referenced by audio_req_set_cur(), and class_ept0_rx_handler().

◆ audio_cmd_len

uint32_t usb_audio_type::audio_cmd_len

Definition at line 104 of file audio_class.h.

Referenced by audio_req_set_cur().

◆ audio_feed_back

uint8_t usb_audio_type::audio_feed_back

Definition at line 110 of file audio_class.h.

Referenced by audio_inisoincom_event(), and class_sof_handler().

◆ audio_mic_data

uint8_t usb_audio_type::audio_mic_data

Definition at line 109 of file audio_class.h.

Referenced by audio_inisoincom_event(), audio_set_interface(), and class_in_handler().

◆ audio_spk_data

uint8_t usb_audio_type::audio_spk_data

Definition at line 108 of file audio_class.h.

Referenced by audio_set_interface(), class_init_handler(), and class_out_handler().

◆ enpd

uint8_t usb_audio_type::enpd

Definition at line 91 of file audio_class.h.

Referenced by audio_req_set_cur(), and class_ept0_rx_handler().

◆ g_audio_cur

uint8_t usb_audio_type::g_audio_cur

Definition at line 107 of file audio_class.h.

Referenced by audio_req_get_cur(), audio_req_get_max(), audio_req_get_min(), audio_req_get_res(), audio_req_set_cur(), and class_ept0_rx_handler().

◆ interface

uint8_t usb_audio_type::interface

Definition at line 92 of file audio_class.h.

Referenced by audio_req_set_cur(), and class_ept0_rx_handler().

◆ mic_alt_setting

uint32_t usb_audio_type::mic_alt_setting

Definition at line 106 of file audio_class.h.

Referenced by audio_get_interface(), audio_set_interface(), and class_event_handler().

◆ mic_freq

uint32_t usb_audio_type::mic_freq

Definition at line 99 of file audio_class.h.

Referenced by class_ept0_rx_handler().

◆ mic_mute

uint8_t usb_audio_type::mic_mute

Definition at line 95 of file audio_class.h.

Referenced by audio_req_get_cur(), and class_ept0_rx_handler().

◆ mic_volume

uint16_t usb_audio_type::mic_volume

Definition at line 97 of file audio_class.h.

Referenced by audio_req_get_cur(), and class_ept0_rx_handler().

◆ mic_volume_limits

uint16_t usb_audio_type::mic_volume_limits

Definition at line 101 of file audio_class.h.

Referenced by audio_req_get_max(), audio_req_get_min(), audio_req_get_res(), and class_ept0_rx_handler().

◆ request_no

uint8_t usb_audio_type::request_no

Definition at line 93 of file audio_class.h.

Referenced by audio_req_set_cur(), and class_ept0_rx_handler().

◆ spk_alt_setting

uint32_t usb_audio_type::spk_alt_setting

Definition at line 105 of file audio_class.h.

Referenced by audio_get_interface(), audio_set_interface(), and class_event_handler().

◆ spk_freq

uint32_t usb_audio_type::spk_freq

Definition at line 98 of file audio_class.h.

Referenced by class_ept0_rx_handler().

◆ spk_mute

uint8_t usb_audio_type::spk_mute

Definition at line 94 of file audio_class.h.

Referenced by audio_req_get_cur(), and class_ept0_rx_handler().

◆ spk_volume

uint16_t usb_audio_type::spk_volume

Definition at line 96 of file audio_class.h.

Referenced by audio_req_get_cur(), and class_ept0_rx_handler().

◆ spk_volume_limits

uint16_t usb_audio_type::spk_volume_limits

Definition at line 100 of file audio_class.h.

Referenced by audio_req_get_max(), audio_req_get_min(), audio_req_get_res(), and class_ept0_rx_handler().

The documentation for this struct was generated from the following files:
  • audio_class.h
  • audio_hid_class.h


AT32F415 Firmwary Library: USB_device_audio_config_definition

Macros
USB_device_audio_config_definition
AT32F415_middlewares_usbd_class » USB_audio_class

Macros

#define | AUDIO_SUPPORT_SPK 1
#define | AUDIO_SUPPORT_MIC 1
#define | AUDIO_SUPPORT_FEEDBACK 1
#define | AUDIO_SUPPORT_FREQ_16K 1
#define | AUDIO_SUPPORT_FREQ_48K 1
#define | AUDIO_SUPPORT_FREQ
#define | AUDIO_FREQ_16K 16000
#define | AUDIO_FREQ_48K 48000
#define | AUDIO_BITW_16 16
#define | AUDIO_MIC_CHANEL_NUM 2
#define | AUDIO_MIC_DEFAULT_BITW AUDIO_BITW_16
#define | AUDIO_SPK_CHANEL_NUM 2
#define | AUDIO_SPK_DEFAULT_BITW AUDIO_BITW_16
#define | AUDIO_SUPPORT_MAX_FREQ 48
#define | AUDIO_DEFAULT_FREQ AUDIO_FREQ_48K
#define | AUDIO_DEFAULT_BITW AUDIO_BITW_16

Detailed Description

Macro Definition Documentation

◆ AUDIO_BITW_16

#define AUDIO_BITW_16 16

Definition at line 61 of file audio/audio_conf.h.

◆ AUDIO_DEFAULT_BITW

#define AUDIO_DEFAULT_BITW AUDIO_BITW_16

Definition at line 72 of file audio/audio_conf.h.

◆ AUDIO_DEFAULT_FREQ

#define AUDIO_DEFAULT_FREQ AUDIO_FREQ_48K

Definition at line 71 of file audio/audio_conf.h.

◆ AUDIO_FREQ_16K

#define AUDIO_FREQ_16K 16000

Definition at line 59 of file audio/audio_conf.h.

◆ AUDIO_FREQ_48K

#define AUDIO_FREQ_48K 48000

Definition at line 60 of file audio/audio_conf.h.

◆ AUDIO_MIC_CHANEL_NUM

#define AUDIO_MIC_CHANEL_NUM 2

Definition at line 63 of file audio/audio_conf.h.

◆ AUDIO_MIC_DEFAULT_BITW

#define AUDIO_MIC_DEFAULT_BITW AUDIO_BITW_16

Definition at line 64 of file audio/audio_conf.h.

◆ AUDIO_SPK_CHANEL_NUM

#define AUDIO_SPK_CHANEL_NUM 2

Definition at line 66 of file audio/audio_conf.h.

◆ AUDIO_SPK_DEFAULT_BITW

#define AUDIO_SPK_DEFAULT_BITW AUDIO_BITW_16

Definition at line 67 of file audio/audio_conf.h.

◆ AUDIO_SUPPORT_FEEDBACK

#define AUDIO_SUPPORT_FEEDBACK 1

Definition at line 49 of file audio/audio_conf.h.

◆ AUDIO_SUPPORT_FREQ

#define AUDIO_SUPPORT_FREQ
Value:
(AUDIO_SUPPORT_FREQ_16K + \
AUDIO_SUPPORT_FREQ_48K \
)
AUDIO_SUPPORT_FREQ_16K
#define AUDIO_SUPPORT_FREQ_16K
Definition: audio/audio_conf.h:51

Definition at line 55 of file audio/audio_conf.h.

◆ AUDIO_SUPPORT_FREQ_16K

#define AUDIO_SUPPORT_FREQ_16K 1

Definition at line 51 of file audio/audio_conf.h.

◆ AUDIO_SUPPORT_FREQ_48K

#define AUDIO_SUPPORT_FREQ_48K 1

Definition at line 52 of file audio/audio_conf.h.

◆ AUDIO_SUPPORT_MAX_FREQ

#define AUDIO_SUPPORT_MAX_FREQ 48

Definition at line 70 of file audio/audio_conf.h.

◆ AUDIO_SUPPORT_MIC

#define AUDIO_SUPPORT_MIC 1

Definition at line 48 of file audio/audio_conf.h.

◆ AUDIO_SUPPORT_SPK

#define AUDIO_SUPPORT_SPK 1

Definition at line 47 of file audio/audio_conf.h.


AT32F415 Firmwary Library: USB_audio_desc

Modules
USB_audio_desc
AT32F415_middlewares_usbd_class

usb device audio descriptor More...

Modules

USB_audio_desc_private_functions
USB_audio_desc_definition

Detailed Description

usb device audio descriptor


AT32F415 Firmwary Library: USB_audio_desc_private_functions

Functions | Variables
USB_audio_desc_private_functions
AT32F415_middlewares_usbd_class » USB_audio_desc

Functions

static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | audio_desc_handler
device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

Function Documentation

◆ get_serial_num()

static void get_serial_num ( void )
static

usb get serial number

Parameters
none
Return values
none

Definition at line 496 of file audio_desc.c.

Referenced by get_device_serial_string().

◆ usbd_int_to_unicode()

static void usbd_int_to_unicode | ( | uint32_t | value,
 |  | uint8_t * | pbuf,
 |  | uint8_t | len
 | ) |  |
static

usb int convert to unicode

Parameters
value | int value
pbus | unicode buffer
len | length
Return values
none

Definition at line 470 of file audio_desc.c.

Referenced by get_serial_num().

Variable Documentation

◆ ALIGNED_TAIL

ALIGNED_HEAD sense_type sense_data ALIGNED_TAIL
Initial value:
=
{
USB_DEVICE_DESC_LEN,
USB_DESCIPTOR_TYPE_DEVICE,
0x00,
0x02,
0x00,
0x00,
0x00,
USB_MAX_EP0_SIZE,
LBYTE( 0x2E3C ),
HBYTE( 0x2E3C ),
LBYTE( 0x5730 ),
HBYTE( 0x5730 ),
0x00,
0x02,
USB_MFC_STRING,
USB_PRODUCT_STRING,
USB_SERIAL_STRING,
0x01
}
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92

usb device standard descriptor

usb string serial

usb string lang id

usb configuration standard descriptor

Definition at line 84 of file audio_desc.c.

◆ audio_desc_handler

usbd_desc_handler audio_desc_handler
Initial value:
=
{
get_device_descriptor,
get_device_qualifier,
get_device_configuration,
get_device_other_speed,
get_device_lang_id,
get_device_manufacturer_string,
get_device_product_string,
get_device_serial_string,
get_device_interface_string,
get_device_config_string,
}
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: audio_desc.c:569
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: audio_desc.c:528
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: audio_desc.c:604
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: audio_desc.c:548
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: audio_desc.c:538
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: audio_desc.c:581
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: audio_desc.c:558
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: audio_desc.c:518
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: audio_desc.c:593
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: audio_desc.c:616

device descriptor handler structure

Definition at line 64 of file audio_desc.c.

Referenced by main().

◆ config_descriptor

usbd_desc_t config_descriptor
Initial value:
=
{
( 0x12 + ((0x08 + ( 1 + 1 ) ) + ( 1 + 1 ) * 0x1E) + + (0x31 + ( ( 1 + 1 ) ) * 3) + (0x31 + ( ( 1 + 1 ) ) * 3) + (9 * 1 ) ) ,
g_usbd_configuration
}
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112

Definition at line 416 of file audio_desc.c.

Referenced by get_device_configuration().

◆ device_descriptor

usbd_desc_t device_descriptor
Initial value:
=
{
USB_DEVICE_DESC_LEN,
g_usbd_descriptor
}
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]

Definition at line 409 of file audio_desc.c.

Referenced by get_device_descriptor().

◆ g_usbd_desc_buffer

uint8_t g_usbd_desc_buffer[256]
static

Definition at line 59 of file audio_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

◆ langid_descriptor

usbd_desc_t langid_descriptor
Initial value:
=
{
4 ,
g_string_lang_id
}

Definition at line 423 of file audio_desc.c.

Referenced by get_device_lang_id().

◆ serial_descriptor

usbd_desc_t serial_descriptor
Initial value:
=
{
0x1A ,
g_string_serial
}

Definition at line 430 of file audio_desc.c.

Referenced by get_device_serial_string().

◆ vp_desc

usbd_desc_t vp_desc

Definition at line 436 of file audio_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().


AT32F415 Firmwary Library: USB_audio_desc_definition

Macros | Variables
USB_audio_desc_definition
AT32F415_middlewares_usbd_class » USB_audio_desc

Macros

#define | BCD_NUM 0x0100
#define | USBD_VENDOR_ID 0x2E3C
#define | USBD_PRODUCT_ID 0x5730
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
#define | USBD_DESC_PRODUCT_STRING "AT32 Audio"
#define | USBD_DESC_CONFIGURATION_STRING "Audio Config"
#define | USBD_DESC_INTERFACE_STRING "Audio Interface"
#define | AUDIO_SUBCLASS_UNDEFINED 0x00
audio interface subclass codes More...
#define | AUDIO_SUBCLASS_AUDIOCONTROL 0x01
#define | AUDIO_SUBCLASS_AUDIOSTREAMING 0x02
#define | AUDIO_SUBCLASS_MIDISTREMING 0x03
#define | AUDIO_CS_INTERFACE 0x24
audio class-specific descriptor types More...
#define | AUDIO_CS_ENDPOINT 0x25
#define | AUDIO_CS_STRING 0x23
#define | AUDIO_CS_CONFIGURATION 0x22
#define | AUDIO_CS_DEVICE 0x21
#define | AUDIO_CS_UNDEFINED 0x20
#define | AUDIO_PROTOCOL_UNDEFINED 0x00
audio interface protocol codes More...
#define | AUDIO_AC_DESCRIPTOR_UNDEFINED 0x00
audio class-specific ac interface descriptor subtypes More...
#define | AUDIO_AC_HEADER 0x01
#define | AUDIO_AC_INPUT_TERMINAL 0x02
#define | AUDIO_AC_OUTPUT_TERMINAL 0x03
#define | AUDIO_AC_MIXER_UNIT 0x04
#define | AUDIO_AC_SELECTOR_UNIT 0x05
#define | AUDIO_AC_FEATURE_UNIT 0x06
#define | AUDIO_AC_PROCESSING_UNIT 0x07
#define | AUDIO_AC_EXTENSION_UNIT 0x08
#define | AUDIO_AS_DESCRIPTOR_UNDEFINED 0x00
audio class-specific as interface descriptor subtypes More...
#define | AUDIO_AS_GENERAL 0x01
#define | AUDIO_AS_FORMAT_TYPE 0x02
#define | AUDIO_AS_FORMAT_SPECIFIC 0x03
#define | AUDIO_REQUEST_CODE_UNDEFINED 0x00
audio class-specific request codes More...
#define | AUDIO_REQ_SET_CUR 0x01
#define | AUDIO_REQ_GET_CUR 0x81
#define | AUDIO_REQ_SET_MIN 0x02
#define | AUDIO_REQ_GET_MIN 0x82
#define | AUDIO_REQ_SET_MAX 0x03
#define | AUDIO_REQ_GET_MAX 0x83
#define | AUDIO_REQ_SET_RES 0x04
#define | AUDIO_REQ_GET_RES 0x84
#define | AUDIO_REQ_SET_MEM 0x05
#define | AUDIO_REQ_GET_MEM 0x85
#define | AUDIO_REQ_GET_STAT 0xFF
#define | AUDIO_FU_CONTROL_UNDEFINED 0x00
audio feature unit control selectors More...
#define | AUDIO_FU_MUTE_CONTROL 0x01
#define | AUDIO_FU_VOLUME_CONTROL 0x02
#define | AUDIO_FU_BASS_CONTROL 0x03
#define | AUDIO_FU_MID_CONTROL 0x04
#define | AUDIO_FU_TREBLE_CONTROL 0x05
#define | AUDIO_TERMINAL_TYPE_UNDEFINED 0x0100
audio terminal type More...
#define | AUDIO_TERMINAL_TYPE_STREAMING 0x0101
#define | AUDIO_TERMINAL_TYPE_VENDOR 0x01FF
#define | AUDIO_INPUT_TERMINAL_UNDEFINED 0x0200
#define | AUDIO_INPUT_TERMINAL_MICROPHONE 0x0201
#define | AUDIO_OUTPUT_TERMINAL_UNDEFINED 0x0300
#define | AUDIO_OUTPUT_TERMINAL_SPEAKER 0x0301
#define | AUDIO_FORMAT_TYPE_I 0x01
audio format type 1 More...
#define | AUDIO_INTERFACE_NUM (AUDIO_SUPPORT_SPK + AUDIO_SUPPORT_MIC)
audio interface config More...
#define | AUDIO_INTERFACE_LEN ((0x08 + AUDIO_INTERFACE_NUM) + AUDIO_INTERFACE_NUM * 0x1E)
#define | AUDIO_MIC_INTERFACE 0x01
#define | AUDIO_SPK_INTERFACE 0x02
#define | AUDIO_INPUT_TERMINAL_SIZE 0x0C
audio interface descriptor size define More...
#define | AUDIO_OUTPUT_TERMINAL_SIZE 0x09
#define | AUDIO_FEATURE_UNIT_SIZE 0x09
#define | AUDIO_MIC_INPUT_TERMINAL_ID 0x01
audio terminal id define More...
#define | AUDIO_MIC_FEATURE_UNIT_ID 0x02
#define | AUDIO_MIC_OUTPUT_TERMINAL_ID 0x03
#define | AUDIO_SPK_INPUT_TERMINAL_ID 0x04
#define | AUDIO_SPK_FEATURE_UNIT_ID 0x05
#define | AUDIO_SPK_OUTPUT_TERMINAL_ID 0x06
#define | AUDIO_MIC_INTERFACE_NUMBER 0x01
audio interface number More...
#define | AUDIO_SPK_INTERFACE_NUMBER 0x02
#define | AT32_AUDIO_FREQ_16K 16000
audio support freq More...
#define | AT32_AUDIO_FREQ_48K 48000
#define | AUDIO_MIC_FREQ_SIZE (AUDIO_SUPPORT_FREQ)
audio microphone freq and channel config More...
#define | AUDIO_MIC_CHR AUDIO_MIC_CHANEL_NUM
#define | AUDIO_MIC_BITW (AUDIO_MIC_DEFAULT_BITW)
#define | AUDIO_SPK_FREQ_SIZE (AUDIO_SUPPORT_FREQ)
audio speaker freq and channel config More...
#define | AUDIO_SPK_CHR AUDIO_SPK_CHANEL_NUM
#define | AUDIO_SPK_BITW (AUDIO_SPK_DEFAULT_BITW)
#define | HID_BINTERVAL_TIME 0x01
#define | USBD_CONFIG_DESC_SIZE
#define | SAMPLE_FREQ(frq) (uint8_t)(frq), (uint8_t)((frq >> 8)), (uint8_t)((frq >> 16))
#define | MCU_ID1 (0x1FFFF7E8)
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor More...
usbd_desc_handler | audio_desc_handler
device descriptor handler structure More...

Detailed Description

Macro Definition Documentation

◆ AT32_AUDIO_FREQ_16K

#define AT32_AUDIO_FREQ_16K 16000

audio support freq

Definition at line 188 of file audio_desc.h.

◆ AT32_AUDIO_FREQ_48K

#define AT32_AUDIO_FREQ_48K 48000

Definition at line 189 of file audio_desc.h.

◆ AUDIO_AC_DESCRIPTOR_UNDEFINED

#define AUDIO_AC_DESCRIPTOR_UNDEFINED 0x00

audio class-specific ac interface descriptor subtypes

Definition at line 90 of file audio_desc.h.

◆ AUDIO_AC_EXTENSION_UNIT

#define AUDIO_AC_EXTENSION_UNIT 0x08

Definition at line 98 of file audio_desc.h.

◆ AUDIO_AC_FEATURE_UNIT

#define AUDIO_AC_FEATURE_UNIT 0x06

Definition at line 96 of file audio_desc.h.

◆ AUDIO_AC_HEADER

#define AUDIO_AC_HEADER 0x01

Definition at line 91 of file audio_desc.h.

◆ AUDIO_AC_INPUT_TERMINAL

#define AUDIO_AC_INPUT_TERMINAL 0x02

Definition at line 92 of file audio_desc.h.

◆ AUDIO_AC_MIXER_UNIT

#define AUDIO_AC_MIXER_UNIT 0x04

Definition at line 94 of file audio_desc.h.

◆ AUDIO_AC_OUTPUT_TERMINAL

#define AUDIO_AC_OUTPUT_TERMINAL 0x03

Definition at line 93 of file audio_desc.h.

◆ AUDIO_AC_PROCESSING_UNIT

#define AUDIO_AC_PROCESSING_UNIT 0x07

Definition at line 97 of file audio_desc.h.

◆ AUDIO_AC_SELECTOR_UNIT

#define AUDIO_AC_SELECTOR_UNIT 0x05

Definition at line 95 of file audio_desc.h.

◆ AUDIO_AS_DESCRIPTOR_UNDEFINED

#define AUDIO_AS_DESCRIPTOR_UNDEFINED 0x00

audio class-specific as interface descriptor subtypes

Definition at line 103 of file audio_desc.h.

◆ AUDIO_AS_FORMAT_SPECIFIC

#define AUDIO_AS_FORMAT_SPECIFIC 0x03

Definition at line 106 of file audio_desc.h.

◆ AUDIO_AS_FORMAT_TYPE

#define AUDIO_AS_FORMAT_TYPE 0x02

Definition at line 105 of file audio_desc.h.

◆ AUDIO_AS_GENERAL

#define AUDIO_AS_GENERAL 0x01

Definition at line 104 of file audio_desc.h.

◆ AUDIO_CS_CONFIGURATION

#define AUDIO_CS_CONFIGURATION 0x22

Definition at line 78 of file audio_desc.h.

◆ AUDIO_CS_DEVICE

#define AUDIO_CS_DEVICE 0x21

Definition at line 79 of file audio_desc.h.

◆ AUDIO_CS_ENDPOINT

#define AUDIO_CS_ENDPOINT 0x25

Definition at line 76 of file audio_desc.h.

◆ AUDIO_CS_INTERFACE

#define AUDIO_CS_INTERFACE 0x24

audio class-specific descriptor types

Definition at line 75 of file audio_desc.h.

◆ AUDIO_CS_STRING

#define AUDIO_CS_STRING 0x23

Definition at line 77 of file audio_desc.h.

◆ AUDIO_CS_UNDEFINED

#define AUDIO_CS_UNDEFINED 0x20

Definition at line 80 of file audio_desc.h.

◆ AUDIO_FEATURE_UNIT_SIZE

#define AUDIO_FEATURE_UNIT_SIZE 0x09

Definition at line 163 of file audio_desc.h.

◆ AUDIO_FORMAT_TYPE_I

#define AUDIO_FORMAT_TYPE_I 0x01

audio format type 1

Definition at line 148 of file audio_desc.h.

◆ AUDIO_FU_BASS_CONTROL

#define AUDIO_FU_BASS_CONTROL 0x03

Definition at line 130 of file audio_desc.h.

◆ AUDIO_FU_CONTROL_UNDEFINED

#define AUDIO_FU_CONTROL_UNDEFINED 0x00

audio feature unit control selectors

Definition at line 127 of file audio_desc.h.

◆ AUDIO_FU_MID_CONTROL

#define AUDIO_FU_MID_CONTROL 0x04

Definition at line 131 of file audio_desc.h.

◆ AUDIO_FU_MUTE_CONTROL

#define AUDIO_FU_MUTE_CONTROL 0x01

Definition at line 128 of file audio_desc.h.

◆ AUDIO_FU_TREBLE_CONTROL

#define AUDIO_FU_TREBLE_CONTROL 0x05

Definition at line 132 of file audio_desc.h.

◆ AUDIO_FU_VOLUME_CONTROL

#define AUDIO_FU_VOLUME_CONTROL 0x02

Definition at line 129 of file audio_desc.h.

◆ AUDIO_INPUT_TERMINAL_MICROPHONE

#define AUDIO_INPUT_TERMINAL_MICROPHONE 0x0201

Definition at line 141 of file audio_desc.h.

◆ AUDIO_INPUT_TERMINAL_SIZE

#define AUDIO_INPUT_TERMINAL_SIZE 0x0C

audio interface descriptor size define

Definition at line 161 of file audio_desc.h.

◆ AUDIO_INPUT_TERMINAL_UNDEFINED

#define AUDIO_INPUT_TERMINAL_UNDEFINED 0x0200

Definition at line 140 of file audio_desc.h.

◆ AUDIO_INTERFACE_LEN

#define AUDIO_INTERFACE_LEN ((0x08 + AUDIO_INTERFACE_NUM) + AUDIO_INTERFACE_NUM * 0x1E)

Definition at line 154 of file audio_desc.h.

◆ AUDIO_INTERFACE_NUM

#define AUDIO_INTERFACE_NUM (AUDIO_SUPPORT_SPK + AUDIO_SUPPORT_MIC)

audio interface config

Definition at line 153 of file audio_desc.h.

◆ AUDIO_MIC_BITW

#define AUDIO_MIC_BITW (AUDIO_MIC_DEFAULT_BITW)

Definition at line 196 of file audio_desc.h.

◆ AUDIO_MIC_CHR

#define AUDIO_MIC_CHR AUDIO_MIC_CHANEL_NUM

Definition at line 195 of file audio_desc.h.

◆ AUDIO_MIC_FEATURE_UNIT_ID

#define AUDIO_MIC_FEATURE_UNIT_ID 0x02

Definition at line 169 of file audio_desc.h.

◆ AUDIO_MIC_FREQ_SIZE

#define AUDIO_MIC_FREQ_SIZE (AUDIO_SUPPORT_FREQ)

audio microphone freq and channel config

Definition at line 194 of file audio_desc.h.

◆ AUDIO_MIC_INPUT_TERMINAL_ID

#define AUDIO_MIC_INPUT_TERMINAL_ID 0x01

audio terminal id define

Definition at line 168 of file audio_desc.h.

◆ AUDIO_MIC_INTERFACE

#define AUDIO_MIC_INTERFACE 0x01

Definition at line 155 of file audio_desc.h.

◆ AUDIO_MIC_INTERFACE_NUMBER

#define AUDIO_MIC_INTERFACE_NUMBER 0x01

audio interface number

Definition at line 178 of file audio_desc.h.

◆ AUDIO_MIC_OUTPUT_TERMINAL_ID

#define AUDIO_MIC_OUTPUT_TERMINAL_ID 0x03

Definition at line 170 of file audio_desc.h.

◆ AUDIO_OUTPUT_TERMINAL_SIZE

#define AUDIO_OUTPUT_TERMINAL_SIZE 0x09

Definition at line 162 of file audio_desc.h.

◆ AUDIO_OUTPUT_TERMINAL_SPEAKER

#define AUDIO_OUTPUT_TERMINAL_SPEAKER 0x0301

Definition at line 143 of file audio_desc.h.

◆ AUDIO_OUTPUT_TERMINAL_UNDEFINED

#define AUDIO_OUTPUT_TERMINAL_UNDEFINED 0x0300

Definition at line 142 of file audio_desc.h.

◆ AUDIO_PROTOCOL_UNDEFINED

#define AUDIO_PROTOCOL_UNDEFINED 0x00

audio interface protocol codes

Definition at line 85 of file audio_desc.h.

◆ AUDIO_REQ_GET_CUR

#define AUDIO_REQ_GET_CUR 0x81

Definition at line 113 of file audio_desc.h.

◆ AUDIO_REQ_GET_MAX

#define AUDIO_REQ_GET_MAX 0x83

Definition at line 117 of file audio_desc.h.

◆ AUDIO_REQ_GET_MEM

#define AUDIO_REQ_GET_MEM 0x85

Definition at line 121 of file audio_desc.h.

◆ AUDIO_REQ_GET_MIN

#define AUDIO_REQ_GET_MIN 0x82

Definition at line 115 of file audio_desc.h.

◆ AUDIO_REQ_GET_RES

#define AUDIO_REQ_GET_RES 0x84

Definition at line 119 of file audio_desc.h.

◆ AUDIO_REQ_GET_STAT

#define AUDIO_REQ_GET_STAT 0xFF

Definition at line 122 of file audio_desc.h.

◆ AUDIO_REQ_SET_CUR

#define AUDIO_REQ_SET_CUR 0x01

Definition at line 112 of file audio_desc.h.

◆ AUDIO_REQ_SET_MAX

#define AUDIO_REQ_SET_MAX 0x03

Definition at line 116 of file audio_desc.h.

◆ AUDIO_REQ_SET_MEM

#define AUDIO_REQ_SET_MEM 0x05

Definition at line 120 of file audio_desc.h.

◆ AUDIO_REQ_SET_MIN

#define AUDIO_REQ_SET_MIN 0x02

Definition at line 114 of file audio_desc.h.

◆ AUDIO_REQ_SET_RES

#define AUDIO_REQ_SET_RES 0x04

Definition at line 118 of file audio_desc.h.

◆ AUDIO_REQUEST_CODE_UNDEFINED

#define AUDIO_REQUEST_CODE_UNDEFINED 0x00

audio class-specific request codes

Definition at line 111 of file audio_desc.h.

◆ AUDIO_SPK_BITW

#define AUDIO_SPK_BITW (AUDIO_SPK_DEFAULT_BITW)

Definition at line 203 of file audio_desc.h.

◆ AUDIO_SPK_CHR

#define AUDIO_SPK_CHR AUDIO_SPK_CHANEL_NUM

Definition at line 202 of file audio_desc.h.

◆ AUDIO_SPK_FEATURE_UNIT_ID

#define AUDIO_SPK_FEATURE_UNIT_ID 0x05

Definition at line 172 of file audio_desc.h.

◆ AUDIO_SPK_FREQ_SIZE

#define AUDIO_SPK_FREQ_SIZE (AUDIO_SUPPORT_FREQ)

audio speaker freq and channel config

Definition at line 201 of file audio_desc.h.

◆ AUDIO_SPK_INPUT_TERMINAL_ID

#define AUDIO_SPK_INPUT_TERMINAL_ID 0x04

Definition at line 171 of file audio_desc.h.

◆ AUDIO_SPK_INTERFACE

#define AUDIO_SPK_INTERFACE 0x02

Definition at line 156 of file audio_desc.h.

◆ AUDIO_SPK_INTERFACE_NUMBER

#define AUDIO_SPK_INTERFACE_NUMBER 0x02

Definition at line 180 of file audio_desc.h.

◆ AUDIO_SPK_OUTPUT_TERMINAL_ID

#define AUDIO_SPK_OUTPUT_TERMINAL_ID 0x06

Definition at line 173 of file audio_desc.h.

◆ AUDIO_SUBCLASS_AUDIOCONTROL

#define AUDIO_SUBCLASS_AUDIOCONTROL 0x01

Definition at line 68 of file audio_desc.h.

◆ AUDIO_SUBCLASS_AUDIOSTREAMING

#define AUDIO_SUBCLASS_AUDIOSTREAMING 0x02

Definition at line 69 of file audio_desc.h.

◆ AUDIO_SUBCLASS_MIDISTREMING

#define AUDIO_SUBCLASS_MIDISTREMING 0x03

Definition at line 70 of file audio_desc.h.

◆ AUDIO_SUBCLASS_UNDEFINED

#define AUDIO_SUBCLASS_UNDEFINED 0x00

audio interface subclass codes

Definition at line 67 of file audio_desc.h.

◆ AUDIO_TERMINAL_TYPE_STREAMING

#define AUDIO_TERMINAL_TYPE_STREAMING 0x0101

Definition at line 138 of file audio_desc.h.

◆ AUDIO_TERMINAL_TYPE_UNDEFINED

#define AUDIO_TERMINAL_TYPE_UNDEFINED 0x0100

audio terminal type

Definition at line 137 of file audio_desc.h.

◆ AUDIO_TERMINAL_TYPE_VENDOR

#define AUDIO_TERMINAL_TYPE_VENDOR 0x01FF

Definition at line 139 of file audio_desc.h.

◆ BCD_NUM

#define BCD_NUM 0x0100

Definition at line 51 of file audio_desc.h.

◆ HID_BINTERVAL_TIME

#define HID_BINTERVAL_TIME 0x01

Definition at line 205 of file audio_desc.h.

◆ MCU_ID1

#define MCU_ID1 (0x1FFFF7E8)

Definition at line 215 of file audio_desc.h.

◆ MCU_ID2

#define MCU_ID2 (0x1FFFF7EC)

Definition at line 216 of file audio_desc.h.

◆ MCU_ID3

#define MCU_ID3 (0x1FFFF7F0)

Definition at line 217 of file audio_desc.h.

◆ SAMPLE_FREQ

#define SAMPLE_FREQ ( frq ) (uint8_t)(frq), (uint8_t)((frq >> 8)), (uint8_t)((frq >> 16))

Definition at line 213 of file audio_desc.h.

◆ USBD_CONFIG_DESC_SIZE

#define USBD_CONFIG_DESC_SIZE
Value:
( 0x12 + AUDIO_INTERFACE_LEN + \
+ (0x31 + AUDIO_SPK_FREQ_SIZE * 3) \
+ (0x31 + AUDIO_MIC_FREQ_SIZE * 3) \
+ (9 * AUDIO_SUPPORT_FEEDBACK) \
)
AUDIO_MIC_FREQ_SIZE
#define AUDIO_MIC_FREQ_SIZE
audio microphone freq and channel config
Definition: audio_desc.h:194
AUDIO_SPK_FREQ_SIZE
#define AUDIO_SPK_FREQ_SIZE
audio speaker freq and channel config
Definition: audio_desc.h:201
AUDIO_INTERFACE_LEN
#define AUDIO_INTERFACE_LEN
Definition: audio_desc.h:154
AUDIO_SUPPORT_FEEDBACK
#define AUDIO_SUPPORT_FEEDBACK
Definition: audio/audio_conf.h:49

Definition at line 208 of file audio_desc.h.

◆ USBD_DESC_CONFIGURATION_STRING

#define USBD_DESC_CONFIGURATION_STRING "Audio Config"

Definition at line 61 of file audio_desc.h.

◆ USBD_DESC_INTERFACE_STRING

#define USBD_DESC_INTERFACE_STRING "Audio Interface"

Definition at line 62 of file audio_desc.h.

◆ USBD_DESC_MANUFACTURER_STRING

#define USBD_DESC_MANUFACTURER_STRING "Artery"

Definition at line 59 of file audio_desc.h.

◆ USBD_DESC_PRODUCT_STRING

#define USBD_DESC_PRODUCT_STRING "AT32 Audio"

Definition at line 60 of file audio_desc.h.

◆ USBD_PRODUCT_ID

#define USBD_PRODUCT_ID 0x5730

Definition at line 54 of file audio_desc.h.

◆ USBD_SIZ_STRING_LANGID

#define USBD_SIZ_STRING_LANGID 4

Definition at line 56 of file audio_desc.h.

◆ USBD_SIZ_STRING_SERIAL

#define USBD_SIZ_STRING_SERIAL 0x1A

Definition at line 57 of file audio_desc.h.

◆ USBD_VENDOR_ID

#define USBD_VENDOR_ID 0x2E3C

Definition at line 53 of file audio_desc.h.

Variable Documentation

◆ audio_desc_handler

usbd_desc_handler audio_desc_handler
extern

device descriptor handler structure

Definition at line 64 of file audio_desc.c.

Referenced by main().

◆ g_usbd_configuration

ALIGNED_HEAD uint8_t g_usbd_configuration
extern

usb configuration standard descriptor

Definition at line 112 of file audio_desc.c.

Referenced by class_audio_setup_handler(), and class_setup_handler().

◆ g_usbd_descriptor

uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
extern


AT32F415 Firmwary Library: USB_audio_hid_class

Modules
USB_audio_hid_class
AT32F415_middlewares_usbd_class

usb device class audio hid demo More...

Modules

USB_device_audio_hid_config_definition
USB_audio_hid_class_private_functions
USB_audio_hid_class_definition

Detailed Description

usb device class audio hid demo


AT32F415 Firmwary Library: USB_device_audio_hid_config_definition

Macros
USB_device_audio_hid_config_definition
AT32F415_middlewares_usbd_class » USB_audio_hid_class

Macros

#define | AUDIO_SUPPORT_SPK 1
#define | AUDIO_SUPPORT_MIC 1
#define | AUDIO_SUPPORT_FEEDBACK 1
#define | AUDIO_SUPPORT_FREQ_16K 0
#define | AUDIO_SUPPORT_FREQ_48K 1
#define | AUDIO_SUPPORT_FREQ
#define | AUDIO_FREQ_16K 16000
#define | AUDIO_FREQ_48K 48000
#define | AUDIO_BITW_16 16
#define | AUDIO_MIC_CHANEL_NUM 2
#define | AUDIO_MIC_DEFAULT_BITW AUDIO_BITW_16
#define | AUDIO_SPK_CHANEL_NUM 2
#define | AUDIO_SPK_DEFAULT_BITW AUDIO_BITW_16
#define | AUDIO_SUPPORT_MAX_FREQ 48
#define | AUDIO_DEFAULT_FREQ AUDIO_FREQ_48K
#define | AUDIO_DEFAULT_BITW AUDIO_BITW_16

Detailed Description

Macro Definition Documentation

◆ AUDIO_BITW_16

#define AUDIO_BITW_16 16

Definition at line 61 of file audio_hid/audio_conf.h.

◆ AUDIO_DEFAULT_BITW

#define AUDIO_DEFAULT_BITW AUDIO_BITW_16

Definition at line 72 of file audio_hid/audio_conf.h.

◆ AUDIO_DEFAULT_FREQ

#define AUDIO_DEFAULT_FREQ AUDIO_FREQ_48K

Definition at line 71 of file audio_hid/audio_conf.h.

◆ AUDIO_FREQ_16K

#define AUDIO_FREQ_16K 16000

Definition at line 59 of file audio_hid/audio_conf.h.

◆ AUDIO_FREQ_48K

#define AUDIO_FREQ_48K 48000

Definition at line 60 of file audio_hid/audio_conf.h.

◆ AUDIO_MIC_CHANEL_NUM

#define AUDIO_MIC_CHANEL_NUM 2

Definition at line 63 of file audio_hid/audio_conf.h.

◆ AUDIO_MIC_DEFAULT_BITW

#define AUDIO_MIC_DEFAULT_BITW AUDIO_BITW_16

Definition at line 64 of file audio_hid/audio_conf.h.

◆ AUDIO_SPK_CHANEL_NUM

#define AUDIO_SPK_CHANEL_NUM 2

Definition at line 66 of file audio_hid/audio_conf.h.

◆ AUDIO_SPK_DEFAULT_BITW

#define AUDIO_SPK_DEFAULT_BITW AUDIO_BITW_16

Definition at line 67 of file audio_hid/audio_conf.h.

◆ AUDIO_SUPPORT_FEEDBACK

#define AUDIO_SUPPORT_FEEDBACK 1

Definition at line 49 of file audio_hid/audio_conf.h.

◆ AUDIO_SUPPORT_FREQ

#define AUDIO_SUPPORT_FREQ
Value:
(AUDIO_SUPPORT_FREQ_16K + \
AUDIO_SUPPORT_FREQ_48K \
)
AUDIO_SUPPORT_FREQ_16K
#define AUDIO_SUPPORT_FREQ_16K
Definition: audio_hid/audio_conf.h:51

Definition at line 55 of file audio_hid/audio_conf.h.

◆ AUDIO_SUPPORT_FREQ_16K

#define AUDIO_SUPPORT_FREQ_16K 0

Definition at line 51 of file audio_hid/audio_conf.h.

◆ AUDIO_SUPPORT_FREQ_48K

#define AUDIO_SUPPORT_FREQ_48K 1

Definition at line 52 of file audio_hid/audio_conf.h.

◆ AUDIO_SUPPORT_MAX_FREQ

#define AUDIO_SUPPORT_MAX_FREQ 48

Definition at line 70 of file audio_hid/audio_conf.h.

◆ AUDIO_SUPPORT_MIC

#define AUDIO_SUPPORT_MIC 1

Definition at line 48 of file audio_hid/audio_conf.h.

◆ AUDIO_SUPPORT_SPK

#define AUDIO_SUPPORT_SPK 1

Definition at line 47 of file audio_hid/audio_conf.h.


AT32F415 Firmwary Library: USB_audio_hid_class_private_functions

Functions | Variables
USB_audio_hid_class_private_functions
AT32F415_middlewares_usbd_class » USB_audio_hid_class

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb custom hid endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device event handler More...
void | audio_inisoincom_event (void *udev)
usb audio in iso incom event More...
void | audio_req_get_cur (void *udev, usb_setup_type *setup)
usb audio request get cur More...
void | audio_req_set_cur (void *udev, usb_setup_type *setup)
usb audio request set cur More...
void | audio_req_get_min (void *udev, usb_setup_type *setup)
usb audio request get min More...
void | audio_req_get_max (void *udev, usb_setup_type *setup)
usb audio request get max More...
void | audio_req_get_res (void *udev, usb_setup_type *setup)
usb audio request get res More...
void | audio_get_interface (void *udev, usb_setup_type *setup)
usb audio get interface More...
void | audio_set_interface (void *udev, usb_setup_type *setup)
usb audio set interface More...
usb_sts_type | class_audio_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_hid_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...

Variables

static uint8_t | g_rxhid_buff [0x40]
static uint8_t | g_txhid_buff [0x40]
usb_audio_type | audio_struct = {0, 0, 0, 0, 0, 0x1400, 0, 0, 0, {0x0000, 0x1400, 0x33}, {0x0000, 0x1400, 0x33}}
static uint32_t | hid_protocol = 0
static uint32_t | hid_set_idle = 0
static uint32_t | alt_setting = 0
static uint8_t | hid_state
uint8_t | hid_set_report [64]
static __IO uint16_t | audio_feedback_state = 0
static __IO uint8_t | audio_spk_out_stage = 0
usbd_class_handler | audio_hid_class_handler

Detailed Description

Function Documentation

◆ audio_get_interface()

void audio_get_interface | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb audio get interface

Parameters
udev | usb device core handler type
setup | setup class
Return values
none

Definition at line 797 of file audio_hid_class.c.

Referenced by class_audio_setup_handler().

◆ audio_inisoincom_event()

void audio_inisoincom_event ( void * udev )

usb audio in iso incom event

Parameters
udev usb device core handler type
Return values
none

Definition at line 588 of file audio_hid_class.c.

Referenced by class_event_handler().

◆ audio_req_get_cur()

void audio_req_get_cur | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb audio request get cur

Parameters
udev | usb device core handler type
setup | setup class
Return values
none

Definition at line 624 of file audio_hid_class.c.

Referenced by class_audio_setup_handler().

◆ audio_req_get_max()

void audio_req_get_max | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb audio request get max

Parameters
udev | usb device core handler type
setup | setup class
Return values
none

Definition at line 722 of file audio_hid_class.c.

Referenced by class_audio_setup_handler().

◆ audio_req_get_min()

void audio_req_get_min | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb audio request get min

Parameters
udev | usb device core handler type
setup | setup class
Return values
none

Definition at line 701 of file audio_hid_class.c.

Referenced by class_audio_setup_handler().

◆ audio_req_get_res()

void audio_req_get_res | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb audio request get res

Parameters
udev | usb device core handler type
setup | setup class
Return values
none

Definition at line 743 of file audio_hid_class.c.

Referenced by class_audio_setup_handler().

◆ audio_req_set_cur()

void audio_req_set_cur | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb audio request set cur

Parameters
udev | usb device core handler type
setup | setup class
Return values
none

Definition at line 662 of file audio_hid_class.c.

Referenced by class_audio_setup_handler().

◆ audio_set_interface()

void audio_set_interface | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb audio set interface

Parameters
udev | usb device core handler type
setup | setup class
Return values
none

Definition at line 764 of file audio_hid_class.c.

Referenced by class_audio_setup_handler().

◆ class_audio_setup_handler()

usb_sts_type class_audio_setup_handler | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb device class setup request handler

Parameters
udev | usb device core handler type
setup | setup packet
Return values
status of usb_sts_type

Definition at line 162 of file audio_hid_class.c.

Referenced by class_setup_handler().

◆ class_clear_handler()

usb_sts_type class_clear_handler ( void * udev )

clear endpoint or other state

Parameters
udev usb device core handler type
Return values
status of usb_sts_type

Definition at line 130 of file audio_hid_class.c.

◆ class_ept0_rx_handler()

usb_sts_type class_ept0_rx_handler ( void * udev )

usb device endpoint 0 out status stage complete

Parameters
udev usb device core handler type
Return values
status of usb_sts_type

Definition at line 359 of file audio_hid_class.c.

◆ class_ept0_tx_handler()

usb_sts_type class_ept0_tx_handler ( void * udev )

usb device endpoint 0 in status stage complete

Parameters
udev usb device core handler type
Return values
status of usb_sts_type

Definition at line 345 of file audio_hid_class.c.

◆ class_event_handler()

usb_sts_type class_event_handler | ( | void * | udev,
 |  | usbd_event_type | event
 | ) |  |

usb device event handler

Parameters
udev | usb device core handler type
event | usb device event
Return values
status of usb_sts_type

Definition at line 551 of file audio_hid_class.c.

◆ class_hid_setup_handler()

usb_sts_type class_hid_setup_handler | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb device class setup request handler

Parameters
udev | usb device core handler type
setup | setup packet
Return values
status of usb_sts_type

Definition at line 241 of file audio_hid_class.c.

Referenced by class_setup_handler().

◆ class_in_handler()

usb_sts_type class_in_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device transmision complete handler

Parameters
udev | usb device core handler type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 444 of file audio_hid_class.c.

◆ class_init_handler()

usb_sts_type class_init_handler ( void * udev )

initialize usb custom hid endpoint

Parameters
udev usb device core handler type
Return values
status of usb_sts_type

Definition at line 95 of file audio_hid_class.c.

◆ class_out_handler()

usb_sts_type class_out_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device endpoint receive data

Parameters
udev | usb device core handler type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 477 of file audio_hid_class.c.

◆ class_send_report()

usb_sts_type class_send_report | ( | void * | udev,
 |  | uint8_t * | report,
 |  | uint16_t | len
 | ) |  |

usb device class send report

Parameters
udev | to the structure of usbd_core_type
report | report buffer
len | report length
Return values
status of usb_sts_type

Definition at line 818 of file audio_hid_class.c.

Referenced by main(), and usbd_hid_iap_process().

◆ class_setup_handler()

usb_sts_type class_setup_handler | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb device class setup request handler

Parameters
udev | usb device core handler type
setup | setup packet
Return values
status of usb_sts_type

Definition at line 314 of file audio_hid_class.c.

◆ class_sof_handler()

usb_sts_type class_sof_handler ( void * udev )

usb device sof handler

Parameters
udev usb device core handler type
Return values
status of usb_sts_type

Definition at line 510 of file audio_hid_class.c.

Variable Documentation

◆ alt_setting

uint32_t alt_setting = 0
static

Definition at line 71 of file audio_hid_class.c.

Referenced by class_hid_setup_handler().

◆ audio_feedback_state

__IO uint16_t audio_feedback_state = 0
static

Definition at line 74 of file audio_hid_class.c.

Referenced by class_in_handler(), and class_sof_handler().

◆ audio_hid_class_handler

usbd_class_handler audio_hid_class_handler
Initial value:
=
{
class_init_handler,
class_clear_handler,
class_setup_handler,
class_ept0_tx_handler,
class_ept0_rx_handler,
class_in_handler,
class_out_handler,
class_sof_handler,
class_event_handler,
}
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: audio_hid_class.c:551
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: audio_hid_class.c:510
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: audio_hid_class.c:314
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: audio_hid_class.c:345
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: audio_hid_class.c:444
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb custom hid endpoint
Definition: audio_hid_class.c:95
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: audio_hid_class.c:359
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: audio_hid_class.c:477
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: audio_hid_class.c:130

Definition at line 77 of file audio_hid_class.c.

Referenced by main().

◆ audio_spk_out_stage

__IO uint8_t audio_spk_out_stage = 0
static

Definition at line 75 of file audio_hid_class.c.

Referenced by class_out_handler(), and class_sof_handler().

◆ audio_struct

usb_audio_type audio_struct = {0, 0, 0, 0, 0, 0x1400, 0, 0, 0, {0x0000, 0x1400, 0x33}, {0x0000, 0x1400, 0x33}}

Definition at line 67 of file audio_hid_class.c.

Referenced by audio_get_interface(), audio_inisoincom_event(), audio_req_get_cur(), audio_req_get_max(), audio_req_get_min(), audio_req_get_res(), audio_req_set_cur(), audio_set_interface(), class_ept0_rx_handler(), class_event_handler(), class_in_handler(), class_init_handler(), class_out_handler(), and class_sof_handler().

◆ g_rxhid_buff

uint8_t g_rxhid_buff[0x40]
static

Definition at line 64 of file audio_hid_class.c.

Referenced by class_init_handler(), class_out_handler(), and usb_hid_buf_process().

◆ g_txhid_buff

uint8_t g_txhid_buff[0x40]
static

Definition at line 65 of file audio_hid_class.c.

Referenced by usb_hid_buf_process().

◆ hid_protocol

uint32_t hid_protocol = 0
static

Definition at line 69 of file audio_hid_class.c.

Referenced by class_hid_setup_handler().

◆ hid_set_idle

uint32_t hid_set_idle = 0
static

Definition at line 70 of file audio_hid_class.c.

Referenced by class_hid_setup_handler().

◆ hid_set_report

uint8_t hid_set_report[64]

Definition at line 73 of file audio_hid_class.c.

Referenced by class_ept0_rx_handler(), and class_hid_setup_handler().

◆ hid_state

uint8_t hid_state
static

Definition at line 72 of file audio_hid_class.c.

Referenced by class_ept0_rx_handler(), and class_hid_setup_handler().


AT32F415 Firmwary Library: USB_audio_hid_class_definition

Data Structures | Macros | Functions | Variables
USB_audio_hid_class_definition
AT32F415_middlewares_usbd_class » USB_audio_hid_class

Data Structures

struct usb_audio_type
usb audio control struct More...

Macros

#define | USBD_AUDIO_MIC_IN_EPT 0x81
endpoint define More...
#define | USBD_AUDIO_SPK_OUT_EPT 0x02
#define | USBD_AUDIO_FEEDBACK_EPT 0x83
#define | USBD_HID_IN_EPT 0x82
usb custom hid use endpoint define More...
#define | USBD_HID_OUT_EPT 0x01
#define | USBD_IN_MAXPACKET_SIZE 0x40
usb custom hid in and out max packet size define More...
#define | USBD_OUT_MAXPACKET_SIZE 0x40
#define | AUDIO_REMAIN_SIZE 40
endpoint support max size More...
#define | AUDIO_MIC_IN_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_MIC_CHANEL_NUM * (AUDIO_MIC_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)
#define | AUDIO_SPK_OUT_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_SPK_CHANEL_NUM * (AUDIO_SPK_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)
#define | AUDIO_FEEDBACK_MAXPACKET_SIZE 0x3
#define | FEEDBACK_REFRESH_TIME 0x8
#define | AUDIO_REQ_CONTROL_INTERFACE 0x01
request type define More...
#define | AUDIO_REQ_CONTROL_ENDPOINT 0x02
#define | AUDIO_REQ_CONTROL_MASK 0x03
#define | AUDIO_MUTE_CONTROL 0x01
audio set cur type define More...
#define | AUDIO_MUTE_CONTROL 0x01
audio set cur type define More...
#define | AUDIO_VOLUME_CONTROL 0x02
#define | AUDIO_VOLUME_CONTROL 0x02
#define | AUDIO_FREQ_SET_CONTROL 0x03
#define | AUDIO_FREQ_SET_CONTROL 0x03
#define | AUDIO_DESCRIPTOR_TYPE 0x21
audio descriptor type More...
#define | AUDIO_DESCRIPTOR_SIZE 0x09
#define | HID_REQ_SET_PROTOCOL 0x0B
usb custom hid class request code define More...
#define | HID_REQ_GET_PROTOCOL 0x03
#define | HID_REQ_SET_IDLE 0x0A
#define | HID_REQ_GET_IDLE 0x02
#define | HID_REQ_SET_REPORT 0x09
#define | HID_REQ_GET_REPORT 0x01
#define | HID_DESCRIPTOR_TYPE 0x21
#define | HID_REPORT_DESC 0x22

Functions

usb_sts_type class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...

Variables

usbd_class_handler audio_hid_class_handler

Detailed Description

Macro Definition Documentation

◆ AUDIO_DESCRIPTOR_SIZE

#define AUDIO_DESCRIPTOR_SIZE 0x09

Definition at line 107 of file audio_hid_class.h.

◆ AUDIO_DESCRIPTOR_TYPE

#define AUDIO_DESCRIPTOR_TYPE 0x21

audio descriptor type

Definition at line 106 of file audio_hid_class.h.

◆ AUDIO_FEEDBACK_MAXPACKET_SIZE

#define AUDIO_FEEDBACK_MAXPACKET_SIZE 0x3

Definition at line 76 of file audio_hid_class.h.

◆ AUDIO_FREQ_SET_CONTROL [1/2]

#define AUDIO_FREQ_SET_CONTROL 0x03

Definition at line 101 of file audio_hid_class.h.

◆ AUDIO_FREQ_SET_CONTROL [2/2]

#define AUDIO_FREQ_SET_CONTROL 0x03

Definition at line 101 of file audio_hid_class.h.

◆ AUDIO_MIC_IN_MAXPACKET_SIZE

#define AUDIO_MIC_IN_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_MIC_CHANEL_NUM * (AUDIO_MIC_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)

Definition at line 74 of file audio_hid_class.h.

◆ AUDIO_MUTE_CONTROL [1/2]

#define AUDIO_MUTE_CONTROL 0x01

audio set cur type define

audio descriptor type

audio set cur type define

Definition at line 99 of file audio_hid_class.h.

◆ AUDIO_MUTE_CONTROL [2/2]

#define AUDIO_MUTE_CONTROL 0x01

audio set cur type define

audio descriptor type

audio set cur type define

Definition at line 99 of file audio_hid_class.h.

◆ AUDIO_REMAIN_SIZE

#define AUDIO_REMAIN_SIZE 40

endpoint support max size

Definition at line 73 of file audio_hid_class.h.

◆ AUDIO_REQ_CONTROL_ENDPOINT

#define AUDIO_REQ_CONTROL_ENDPOINT 0x02

Definition at line 82 of file audio_hid_class.h.

◆ AUDIO_REQ_CONTROL_INTERFACE

#define AUDIO_REQ_CONTROL_INTERFACE 0x01

request type define

Definition at line 81 of file audio_hid_class.h.

◆ AUDIO_REQ_CONTROL_MASK

#define AUDIO_REQ_CONTROL_MASK 0x03

Definition at line 83 of file audio_hid_class.h.

◆ AUDIO_SPK_OUT_MAXPACKET_SIZE

#define AUDIO_SPK_OUT_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_SPK_CHANEL_NUM * (AUDIO_SPK_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)

Definition at line 75 of file audio_hid_class.h.

◆ AUDIO_VOLUME_CONTROL [1/2]

#define AUDIO_VOLUME_CONTROL 0x02

Definition at line 100 of file audio_hid_class.h.

◆ AUDIO_VOLUME_CONTROL [2/2]

#define AUDIO_VOLUME_CONTROL 0x02

Definition at line 100 of file audio_hid_class.h.

◆ FEEDBACK_REFRESH_TIME

#define FEEDBACK_REFRESH_TIME 0x8

Definition at line 77 of file audio_hid_class.h.

◆ HID_DESCRIPTOR_TYPE

#define HID_DESCRIPTOR_TYPE 0x21

Definition at line 118 of file audio_hid_class.h.

◆ HID_REPORT_DESC

#define HID_REPORT_DESC 0x22

Definition at line 119 of file audio_hid_class.h.

◆ HID_REQ_GET_IDLE

#define HID_REQ_GET_IDLE 0x02

Definition at line 115 of file audio_hid_class.h.

◆ HID_REQ_GET_PROTOCOL

#define HID_REQ_GET_PROTOCOL 0x03

Definition at line 113 of file audio_hid_class.h.

◆ HID_REQ_GET_REPORT

#define HID_REQ_GET_REPORT 0x01

Definition at line 117 of file audio_hid_class.h.

◆ HID_REQ_SET_IDLE

#define HID_REQ_SET_IDLE 0x0A

Definition at line 114 of file audio_hid_class.h.

◆ HID_REQ_SET_PROTOCOL

#define HID_REQ_SET_PROTOCOL 0x0B

usb custom hid class request code define

Definition at line 112 of file audio_hid_class.h.

◆ HID_REQ_SET_REPORT

#define HID_REQ_SET_REPORT 0x09

Definition at line 116 of file audio_hid_class.h.

◆ USBD_AUDIO_FEEDBACK_EPT

#define USBD_AUDIO_FEEDBACK_EPT 0x83

Definition at line 56 of file audio_hid_class.h.

◆ USBD_AUDIO_MIC_IN_EPT

#define USBD_AUDIO_MIC_IN_EPT 0x81

endpoint define

Definition at line 54 of file audio_hid_class.h.

◆ USBD_AUDIO_SPK_OUT_EPT

#define USBD_AUDIO_SPK_OUT_EPT 0x02

Definition at line 55 of file audio_hid_class.h.

◆ USBD_HID_IN_EPT

#define USBD_HID_IN_EPT 0x82

usb custom hid use endpoint define

Definition at line 61 of file audio_hid_class.h.

◆ USBD_HID_OUT_EPT

#define USBD_HID_OUT_EPT 0x01

Definition at line 62 of file audio_hid_class.h.

◆ USBD_IN_MAXPACKET_SIZE

#define USBD_IN_MAXPACKET_SIZE 0x40

usb custom hid in and out max packet size define

Definition at line 67 of file audio_hid_class.h.

◆ USBD_OUT_MAXPACKET_SIZE

#define USBD_OUT_MAXPACKET_SIZE 0x40

Definition at line 68 of file audio_hid_class.h.

Function Documentation

◆ class_send_report()

usb_sts_type class_send_report | ( | void * | udev,
 |  | uint8_t * | report,
 |  | uint16_t | len
 | ) |  |

usb device class send report

Parameters
udev | to the structure of usbd_core_type
report | report buffer
len | report length
Return values
status of usb_sts_type

Definition at line 818 of file audio_hid_class.c.

Variable Documentation

◆ audio_hid_class_handler

usbd_class_handler audio_hid_class_handler
extern

Definition at line 77 of file audio_hid_class.c.

Referenced by main().


AT32F415 Firmwary Library: USB_audio_hid_desc

Modules
USB_audio_hid_desc
AT32F415_middlewares_usbd_class

usb device audio hid descriptor More...

Modules

USB_audio_hid_desc_private_functions
USB_audio_hid_desc_definition

Detailed Description

usb device audio hid descriptor


AT32F415 Firmwary Library: USB_audio_hid_desc_private_functions

Functions | Variables
USB_audio_hid_desc_private_functions
AT32F415_middlewares_usbd_class » USB_audio_hid_desc

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | audio_hid_desc_handler
device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

Function Documentation

◆ get_device_config_string()

usbd_desc_t * get_device_config_string ( void )

get device config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 776 of file audio_hid_desc.c.

◆ get_device_configuration()

usbd_desc_t * get_device_configuration ( void )

get config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 698 of file audio_hid_desc.c.

◆ get_device_descriptor()

usbd_desc_t * get_device_descriptor ( void )

get device descriptor

Parameters
none
Return values
usbd_desc

Definition at line 678 of file audio_hid_desc.c.

◆ get_device_interface_string()

usbd_desc_t * get_device_interface_string ( void )

get interface descriptor

Parameters
none
Return values
usbd_desc

Definition at line 764 of file audio_hid_desc.c.

◆ get_device_lang_id()

usbd_desc_t * get_device_lang_id ( void )

get lang id descriptor

Parameters
none
Return values
usbd_desc

Definition at line 718 of file audio_hid_desc.c.

◆ get_device_manufacturer_string()

usbd_desc_t * get_device_manufacturer_string ( void )

get manufacturer descriptor

Parameters
none
Return values
usbd_desc

Definition at line 729 of file audio_hid_desc.c.

◆ get_device_other_speed()

usbd_desc_t * get_device_other_speed ( void )

get other speed descriptor

Parameters
none
Return values
usbd_desc

Definition at line 708 of file audio_hid_desc.c.

◆ get_device_product_string()

usbd_desc_t * get_device_product_string ( void )

get product descriptor

Parameters
none
Return values
usbd_desc

Definition at line 741 of file audio_hid_desc.c.

◆ get_device_qualifier()

usbd_desc_t * get_device_qualifier ( void )

get device qualifier

Parameters
none
Return values
usbd_desc

Definition at line 688 of file audio_hid_desc.c.

◆ get_device_serial_string()

usbd_desc_t * get_device_serial_string ( void )

get serial descriptor

Parameters
none
Return values
usbd_desc

Definition at line 753 of file audio_hid_desc.c.

◆ get_serial_num()

static void get_serial_num ( void )
static

usb get serial number

Parameters
none
Return values
none

Definition at line 656 of file audio_hid_desc.c.

Referenced by get_device_serial_string().

◆ usbd_int_to_unicode()

static void usbd_int_to_unicode | ( | uint32_t | value,
 |  | uint8_t * | pbuf,
 |  | uint8_t | len
 | ) |  |
static

usb int convert to unicode

Parameters
value | int value
pbus | unicode buffer
len | length
Return values
none

Definition at line 630 of file audio_hid_desc.c.

Referenced by get_serial_num().

◆ usbd_unicode_convert()

uint16_t usbd_unicode_convert | ( | uint8_t * | string,
 |  | uint8_t * | unicode_buf
 | ) |  |

standard usb unicode convert

Parameters
string | source string
unicode_buf | unicode buffer
Return values
length

Definition at line 604 of file audio_hid_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

Variable Documentation

◆ ALIGNED_TAIL

ALIGNED_HEAD uint8_t g_string_serial [ 0x1A ] ALIGNED_TAIL
Initial value:
=
{
USB_DEVICE_DESC_LEN,
USB_DESCIPTOR_TYPE_DEVICE,
0x00,
0x02,
0x00,
0x00,
0x00,
USB_MAX_EP0_SIZE,
LBYTE( 0x2E3C ),
HBYTE( 0x2E3C ),
LBYTE( 0x5555 ),
HBYTE( 0x5555 ),
0x00,
0x02,
USB_MFC_STRING,
USB_PRODUCT_STRING,
USB_SERIAL_STRING,
0x01
}
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92

usb device standard descriptor

usb string serial

usb string lang id

usb hid descriptor

usb hid report descriptor

usb configuration standard descriptor

Definition at line 84 of file audio_hid_desc.c.

◆ audio_hid_desc_handler

usbd_desc_handler audio_hid_desc_handler
Initial value:
=
{
get_device_descriptor,
get_device_qualifier,
get_device_configuration,
get_device_other_speed,
get_device_lang_id,
get_device_manufacturer_string,
get_device_product_string,
get_device_serial_string,
get_device_interface_string,
get_device_config_string,
}
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: audio_hid_desc.c:729
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: audio_hid_desc.c:688
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: audio_hid_desc.c:764
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: audio_hid_desc.c:708
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: audio_hid_desc.c:698
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: audio_hid_desc.c:741
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: audio_hid_desc.c:718
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: audio_hid_desc.c:678
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: audio_hid_desc.c:753
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: audio_hid_desc.c:776

device descriptor handler structure

Definition at line 64 of file audio_hid_desc.c.

Referenced by main().

◆ config_descriptor

usbd_desc_t config_descriptor
Initial value:
=
{
( 0x12 + ((0x08 + ( 1 + 1 ) ) + ( 1 + 1 ) * 0x1E) + + (0x31 + ( ( 0 + 1 ) ) * 3) + (0x31 + ( ( 0 + 1 ) ) * 3) + (9 * 1 ) + 32 ) ,
g_usbd_configuration
}
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112

Definition at line 576 of file audio_hid_desc.c.

Referenced by get_device_configuration().

◆ device_descriptor

usbd_desc_t device_descriptor
Initial value:
=
{
USB_DEVICE_DESC_LEN,
g_usbd_descriptor
}
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]

Definition at line 569 of file audio_hid_desc.c.

Referenced by get_device_descriptor().

◆ g_usbd_desc_buffer

uint8_t g_usbd_desc_buffer[256]
static

Definition at line 59 of file audio_hid_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

◆ langid_descriptor

usbd_desc_t langid_descriptor
Initial value:
=
{
4 ,
g_string_lang_id
}

Definition at line 583 of file audio_hid_desc.c.

Referenced by get_device_lang_id().

◆ serial_descriptor

usbd_desc_t serial_descriptor
Initial value:
=
{
0x1A ,
g_string_serial
}

Definition at line 590 of file audio_hid_desc.c.

Referenced by get_device_serial_string().

◆ vp_desc

usbd_desc_t vp_desc

Definition at line 596 of file audio_hid_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().


AT32F415 Firmwary Library: USB_audio_hid_desc_definition

Macros | Variables
USB_audio_hid_desc_definition
AT32F415_middlewares_usbd_class » USB_audio_hid_desc

Macros

#define | BCD_NUM 0x0100
#define | USBD_VENDOR_ID 0x2E3C
#define | USBD_PRODUCT_ID 0x5555
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
#define | USBD_DESC_PRODUCT_STRING "AT32 Audio"
#define | USBD_DESC_CONFIGURATION_STRING "Audio Config"
#define | USBD_DESC_INTERFACE_STRING "Audio Interface"
#define | AUDIO_SUBCLASS_UNDEFINED 0x00
audio interface subclass codes More...
#define | AUDIO_SUBCLASS_AUDIOCONTROL 0x01
#define | AUDIO_SUBCLASS_AUDIOSTREAMING 0x02
#define | AUDIO_SUBCLASS_MIDISTREMING 0x03
#define | AUDIO_CS_INTERFACE 0x24
audio class-specific descriptor types More...
#define | AUDIO_CS_ENDPOINT 0x25
#define | AUDIO_CS_STRING 0x23
#define | AUDIO_CS_CONFIGURATION 0x22
#define | AUDIO_CS_DEVICE 0x21
#define | AUDIO_CS_UNDEFINED 0x20
#define | AUDIO_PROTOCOL_UNDEFINED 0x00
audio interface protocol codes More...
#define | AUDIO_AC_DESCRIPTOR_UNDEFINED 0x00
audio class-specific ac interface descriptor subtypes More...
#define | AUDIO_AC_HEADER 0x01
#define | AUDIO_AC_INPUT_TERMINAL 0x02
#define | AUDIO_AC_OUTPUT_TERMINAL 0x03
#define | AUDIO_AC_MIXER_UNIT 0x04
#define | AUDIO_AC_SELECTOR_UNIT 0x05
#define | AUDIO_AC_FEATURE_UNIT 0x06
#define | AUDIO_AC_PROCESSING_UNIT 0x07
#define | AUDIO_AC_EXTENSION_UNIT 0x08
#define | AUDIO_AS_DESCRIPTOR_UNDEFINED 0x00
audio class-specific as interface descriptor subtypes More...
#define | AUDIO_AS_GENERAL 0x01
#define | AUDIO_AS_FORMAT_TYPE 0x02
#define | AUDIO_AS_FORMAT_SPECIFIC 0x03
#define | AUDIO_REQUEST_CODE_UNDEFINED 0x00
audio class-specific request codes More...
#define | AUDIO_REQ_SET_CUR 0x01
#define | AUDIO_REQ_GET_CUR 0x81
#define | AUDIO_REQ_SET_MIN 0x02
#define | AUDIO_REQ_GET_MIN 0x82
#define | AUDIO_REQ_SET_MAX 0x03
#define | AUDIO_REQ_GET_MAX 0x83
#define | AUDIO_REQ_SET_RES 0x04
#define | AUDIO_REQ_GET_RES 0x84
#define | AUDIO_REQ_SET_MEM 0x05
#define | AUDIO_REQ_GET_MEM 0x85
#define | AUDIO_REQ_GET_STAT 0xFF
#define | AUDIO_FU_CONTROL_UNDEFINED 0x00
audio feature unit control selectors More...
#define | AUDIO_FU_MUTE_CONTROL 0x01
#define | AUDIO_FU_VOLUME_CONTROL 0x02
#define | AUDIO_FU_BASS_CONTROL 0x03
#define | AUDIO_FU_MID_CONTROL 0x04
#define | AUDIO_FU_TREBLE_CONTROL 0x05
#define | AUDIO_TERMINAL_TYPE_UNDEFINED 0x0100
audio terminal type More...
#define | AUDIO_TERMINAL_TYPE_STREAMING 0x0101
#define | AUDIO_TERMINAL_TYPE_VENDOR 0x01FF
#define | AUDIO_INPUT_TERMINAL_UNDEFINED 0x0200
#define | AUDIO_INPUT_TERMINAL_MICROPHONE 0x0201
#define | AUDIO_OUTPUT_TERMINAL_UNDEFINED 0x0300
#define | AUDIO_OUTPUT_TERMINAL_SPEAKER 0x0301
#define | AUDIO_FORMAT_TYPE_I 0x01
audio format type 1 More...
#define | AUDIO_INTERFACE_NUM (AUDIO_SUPPORT_SPK + AUDIO_SUPPORT_MIC)
audio interface config More...
#define | AUDIO_INTERFACE_LEN ((0x08 + AUDIO_INTERFACE_NUM) + AUDIO_INTERFACE_NUM * 0x1E)
#define | AUDIO_MIC_INTERFACE 0x01
#define | AUDIO_SPK_INTERFACE 0x02
#define | AUDIO_INPUT_TERMINAL_SIZE 0x0C
audio interface descriptor size define More...
#define | AUDIO_OUTPUT_TERMINAL_SIZE 0x09
#define | AUDIO_FEATURE_UNIT_SIZE 0x09
#define | AUDIO_MIC_INPUT_TERMINAL_ID 0x01
audio terminal id define More...
#define | AUDIO_MIC_FEATURE_UNIT_ID 0x02
#define | AUDIO_MIC_OUTPUT_TERMINAL_ID 0x03
#define | AUDIO_SPK_INPUT_TERMINAL_ID 0x04
#define | AUDIO_SPK_FEATURE_UNIT_ID 0x05
#define | AUDIO_SPK_OUTPUT_TERMINAL_ID 0x06
#define | AUDIO_MIC_INTERFACE_NUMBER 0x01
audio interface number More...
#define | AUDIO_SPK_INTERFACE_NUMBER 0x02
#define | HID_INTERFACE_NUMBER 0x03
#define | AT32_AUDIO_FREQ_16K 16000
audio support freq More...
#define | AT32_AUDIO_FREQ_48K 48000
#define | AUDIO_MIC_FREQ_SIZE (AUDIO_SUPPORT_FREQ)
audio microphone freq and channel config More...
#define | AUDIO_MIC_CHR AUDIO_MIC_CHANEL_NUM
#define | AUDIO_MIC_BITW (AUDIO_MIC_DEFAULT_BITW)
#define | AUDIO_SPK_FREQ_SIZE (AUDIO_SUPPORT_FREQ)
audio speaker freq and channel config More...
#define | AUDIO_SPK_CHR AUDIO_SPK_CHANEL_NUM
#define | AUDIO_SPK_BITW (AUDIO_SPK_DEFAULT_BITW)
#define | HID_BINTERVAL_TIME 0x01
#define | HID_BCD_NUM 0x0110
usb bcd number define More...
#define | HID_CLASS_DESC_HID 0x21
usb hid class descriptor define More...
#define | HID_CLASS_DESC_REPORT 0x22
#define | HID_CLASS_DESC_PHYSICAL 0x23
#define | HID_REPORT_ID_1 0x01
usb hid report id define More...
#define | HID_REPORT_ID_2 0x02
#define | HID_REPORT_ID_3 0x03
#define | HID_REPORT_ID_4 0x04
#define | HID_REPORT_ID_5 0x05
#define | HID_REPORT_ID_6 0xF0
#define | USBD_HID_DESC_SIZE 32
#define | USBD_CONFIG_DESC_SIZE
#define | USBD_HID_SIZ_REPORT_DESC 126
#define | SAMPLE_FREQ(frq) (uint8_t)(frq), (uint8_t)((frq >> 8)), (uint8_t)((frq >> 16))
#define | MCU_ID1 (0x1FFFF7E8)
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_hid_report [126]
usb hid report descriptor More...
uint8_t | g_hid_usb_desc [9]
usb hid descriptor More...
uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((0+1)) *3)+(0x31+((0+1)) *3)+(9 *1)+32)]
usbd_desc_handler | audio_hid_desc_handler
device descriptor handler structure More...

Detailed Description

Macro Definition Documentation

◆ AT32_AUDIO_FREQ_16K

#define AT32_AUDIO_FREQ_16K 16000

audio support freq

Definition at line 189 of file audio_hid_desc.h.

◆ AT32_AUDIO_FREQ_48K

#define AT32_AUDIO_FREQ_48K 48000

Definition at line 190 of file audio_hid_desc.h.

◆ AUDIO_AC_DESCRIPTOR_UNDEFINED

#define AUDIO_AC_DESCRIPTOR_UNDEFINED 0x00

audio class-specific ac interface descriptor subtypes

Definition at line 90 of file audio_hid_desc.h.

◆ AUDIO_AC_EXTENSION_UNIT

#define AUDIO_AC_EXTENSION_UNIT 0x08

Definition at line 98 of file audio_hid_desc.h.

◆ AUDIO_AC_FEATURE_UNIT

#define AUDIO_AC_FEATURE_UNIT 0x06

Definition at line 96 of file audio_hid_desc.h.

◆ AUDIO_AC_HEADER

#define AUDIO_AC_HEADER 0x01

Definition at line 91 of file audio_hid_desc.h.

◆ AUDIO_AC_INPUT_TERMINAL

#define AUDIO_AC_INPUT_TERMINAL 0x02

Definition at line 92 of file audio_hid_desc.h.

◆ AUDIO_AC_MIXER_UNIT

#define AUDIO_AC_MIXER_UNIT 0x04

Definition at line 94 of file audio_hid_desc.h.

◆ AUDIO_AC_OUTPUT_TERMINAL

#define AUDIO_AC_OUTPUT_TERMINAL 0x03

Definition at line 93 of file audio_hid_desc.h.

◆ AUDIO_AC_PROCESSING_UNIT

#define AUDIO_AC_PROCESSING_UNIT 0x07

Definition at line 97 of file audio_hid_desc.h.

◆ AUDIO_AC_SELECTOR_UNIT

#define AUDIO_AC_SELECTOR_UNIT 0x05

Definition at line 95 of file audio_hid_desc.h.

◆ AUDIO_AS_DESCRIPTOR_UNDEFINED

#define AUDIO_AS_DESCRIPTOR_UNDEFINED 0x00

audio class-specific as interface descriptor subtypes

Definition at line 103 of file audio_hid_desc.h.

◆ AUDIO_AS_FORMAT_SPECIFIC

#define AUDIO_AS_FORMAT_SPECIFIC 0x03

Definition at line 106 of file audio_hid_desc.h.

◆ AUDIO_AS_FORMAT_TYPE

#define AUDIO_AS_FORMAT_TYPE 0x02

Definition at line 105 of file audio_hid_desc.h.

◆ AUDIO_AS_GENERAL

#define AUDIO_AS_GENERAL 0x01

Definition at line 104 of file audio_hid_desc.h.

◆ AUDIO_CS_CONFIGURATION

#define AUDIO_CS_CONFIGURATION 0x22

Definition at line 78 of file audio_hid_desc.h.

◆ AUDIO_CS_DEVICE

#define AUDIO_CS_DEVICE 0x21

Definition at line 79 of file audio_hid_desc.h.

◆ AUDIO_CS_ENDPOINT

#define AUDIO_CS_ENDPOINT 0x25

Definition at line 76 of file audio_hid_desc.h.

◆ AUDIO_CS_INTERFACE

#define AUDIO_CS_INTERFACE 0x24

audio class-specific descriptor types

Definition at line 75 of file audio_hid_desc.h.

◆ AUDIO_CS_STRING

#define AUDIO_CS_STRING 0x23

Definition at line 77 of file audio_hid_desc.h.

◆ AUDIO_CS_UNDEFINED

#define AUDIO_CS_UNDEFINED 0x20

Definition at line 80 of file audio_hid_desc.h.

◆ AUDIO_FEATURE_UNIT_SIZE

#define AUDIO_FEATURE_UNIT_SIZE 0x09

Definition at line 163 of file audio_hid_desc.h.

◆ AUDIO_FORMAT_TYPE_I

#define AUDIO_FORMAT_TYPE_I 0x01

audio format type 1

Definition at line 148 of file audio_hid_desc.h.

◆ AUDIO_FU_BASS_CONTROL

#define AUDIO_FU_BASS_CONTROL 0x03

Definition at line 130 of file audio_hid_desc.h.

◆ AUDIO_FU_CONTROL_UNDEFINED

#define AUDIO_FU_CONTROL_UNDEFINED 0x00

audio feature unit control selectors

Definition at line 127 of file audio_hid_desc.h.

◆ AUDIO_FU_MID_CONTROL

#define AUDIO_FU_MID_CONTROL 0x04

Definition at line 131 of file audio_hid_desc.h.

◆ AUDIO_FU_MUTE_CONTROL

#define AUDIO_FU_MUTE_CONTROL 0x01

Definition at line 128 of file audio_hid_desc.h.

◆ AUDIO_FU_TREBLE_CONTROL

#define AUDIO_FU_TREBLE_CONTROL 0x05

Definition at line 132 of file audio_hid_desc.h.

◆ AUDIO_FU_VOLUME_CONTROL

#define AUDIO_FU_VOLUME_CONTROL 0x02

Definition at line 129 of file audio_hid_desc.h.

◆ AUDIO_INPUT_TERMINAL_MICROPHONE

#define AUDIO_INPUT_TERMINAL_MICROPHONE 0x0201

Definition at line 141 of file audio_hid_desc.h.

◆ AUDIO_INPUT_TERMINAL_SIZE

#define AUDIO_INPUT_TERMINAL_SIZE 0x0C

audio interface descriptor size define

Definition at line 161 of file audio_hid_desc.h.

◆ AUDIO_INPUT_TERMINAL_UNDEFINED

#define AUDIO_INPUT_TERMINAL_UNDEFINED 0x0200

Definition at line 140 of file audio_hid_desc.h.

◆ AUDIO_INTERFACE_LEN

#define AUDIO_INTERFACE_LEN ((0x08 + AUDIO_INTERFACE_NUM) + AUDIO_INTERFACE_NUM * 0x1E)

Definition at line 154 of file audio_hid_desc.h.

◆ AUDIO_INTERFACE_NUM

#define AUDIO_INTERFACE_NUM (AUDIO_SUPPORT_SPK + AUDIO_SUPPORT_MIC)

audio interface config

Definition at line 153 of file audio_hid_desc.h.

◆ AUDIO_MIC_BITW

#define AUDIO_MIC_BITW (AUDIO_MIC_DEFAULT_BITW)

Definition at line 197 of file audio_hid_desc.h.

◆ AUDIO_MIC_CHR

#define AUDIO_MIC_CHR AUDIO_MIC_CHANEL_NUM

Definition at line 196 of file audio_hid_desc.h.

◆ AUDIO_MIC_FEATURE_UNIT_ID

#define AUDIO_MIC_FEATURE_UNIT_ID 0x02

Definition at line 169 of file audio_hid_desc.h.

◆ AUDIO_MIC_FREQ_SIZE

#define AUDIO_MIC_FREQ_SIZE (AUDIO_SUPPORT_FREQ)

audio microphone freq and channel config

Definition at line 195 of file audio_hid_desc.h.

◆ AUDIO_MIC_INPUT_TERMINAL_ID

#define AUDIO_MIC_INPUT_TERMINAL_ID 0x01

audio terminal id define

Definition at line 168 of file audio_hid_desc.h.

◆ AUDIO_MIC_INTERFACE

#define AUDIO_MIC_INTERFACE 0x01

Definition at line 155 of file audio_hid_desc.h.

◆ AUDIO_MIC_INTERFACE_NUMBER

#define AUDIO_MIC_INTERFACE_NUMBER 0x01

audio interface number

Definition at line 178 of file audio_hid_desc.h.

◆ AUDIO_MIC_OUTPUT_TERMINAL_ID

#define AUDIO_MIC_OUTPUT_TERMINAL_ID 0x03

Definition at line 170 of file audio_hid_desc.h.

◆ AUDIO_OUTPUT_TERMINAL_SIZE

#define AUDIO_OUTPUT_TERMINAL_SIZE 0x09

Definition at line 162 of file audio_hid_desc.h.

◆ AUDIO_OUTPUT_TERMINAL_SPEAKER

#define AUDIO_OUTPUT_TERMINAL_SPEAKER 0x0301

Definition at line 143 of file audio_hid_desc.h.

◆ AUDIO_OUTPUT_TERMINAL_UNDEFINED

#define AUDIO_OUTPUT_TERMINAL_UNDEFINED 0x0300

Definition at line 142 of file audio_hid_desc.h.

◆ AUDIO_PROTOCOL_UNDEFINED

#define AUDIO_PROTOCOL_UNDEFINED 0x00

audio interface protocol codes

Definition at line 85 of file audio_hid_desc.h.

◆ AUDIO_REQ_GET_CUR

#define AUDIO_REQ_GET_CUR 0x81

Definition at line 113 of file audio_hid_desc.h.

◆ AUDIO_REQ_GET_MAX

#define AUDIO_REQ_GET_MAX 0x83

Definition at line 117 of file audio_hid_desc.h.

◆ AUDIO_REQ_GET_MEM

#define AUDIO_REQ_GET_MEM 0x85

Definition at line 121 of file audio_hid_desc.h.

◆ AUDIO_REQ_GET_MIN

#define AUDIO_REQ_GET_MIN 0x82

Definition at line 115 of file audio_hid_desc.h.

◆ AUDIO_REQ_GET_RES

#define AUDIO_REQ_GET_RES 0x84

Definition at line 119 of file audio_hid_desc.h.

◆ AUDIO_REQ_GET_STAT

#define AUDIO_REQ_GET_STAT 0xFF

Definition at line 122 of file audio_hid_desc.h.

◆ AUDIO_REQ_SET_CUR

#define AUDIO_REQ_SET_CUR 0x01

Definition at line 112 of file audio_hid_desc.h.

◆ AUDIO_REQ_SET_MAX

#define AUDIO_REQ_SET_MAX 0x03

Definition at line 116 of file audio_hid_desc.h.

◆ AUDIO_REQ_SET_MEM

#define AUDIO_REQ_SET_MEM 0x05

Definition at line 120 of file audio_hid_desc.h.

◆ AUDIO_REQ_SET_MIN

#define AUDIO_REQ_SET_MIN 0x02

Definition at line 114 of file audio_hid_desc.h.

◆ AUDIO_REQ_SET_RES

#define AUDIO_REQ_SET_RES 0x04

Definition at line 118 of file audio_hid_desc.h.

◆ AUDIO_REQUEST_CODE_UNDEFINED

#define AUDIO_REQUEST_CODE_UNDEFINED 0x00

audio class-specific request codes

Definition at line 111 of file audio_hid_desc.h.

◆ AUDIO_SPK_BITW

#define AUDIO_SPK_BITW (AUDIO_SPK_DEFAULT_BITW)

Definition at line 204 of file audio_hid_desc.h.

◆ AUDIO_SPK_CHR

#define AUDIO_SPK_CHR AUDIO_SPK_CHANEL_NUM

Definition at line 203 of file audio_hid_desc.h.

◆ AUDIO_SPK_FEATURE_UNIT_ID

#define AUDIO_SPK_FEATURE_UNIT_ID 0x05

Definition at line 172 of file audio_hid_desc.h.

◆ AUDIO_SPK_FREQ_SIZE

#define AUDIO_SPK_FREQ_SIZE (AUDIO_SUPPORT_FREQ)

audio speaker freq and channel config

Definition at line 202 of file audio_hid_desc.h.

◆ AUDIO_SPK_INPUT_TERMINAL_ID

#define AUDIO_SPK_INPUT_TERMINAL_ID 0x04

Definition at line 171 of file audio_hid_desc.h.

◆ AUDIO_SPK_INTERFACE

#define AUDIO_SPK_INTERFACE 0x02

Definition at line 156 of file audio_hid_desc.h.

◆ AUDIO_SPK_INTERFACE_NUMBER

#define AUDIO_SPK_INTERFACE_NUMBER 0x02

Definition at line 180 of file audio_hid_desc.h.

◆ AUDIO_SPK_OUTPUT_TERMINAL_ID

#define AUDIO_SPK_OUTPUT_TERMINAL_ID 0x06

Definition at line 173 of file audio_hid_desc.h.

◆ AUDIO_SUBCLASS_AUDIOCONTROL

#define AUDIO_SUBCLASS_AUDIOCONTROL 0x01

Definition at line 68 of file audio_hid_desc.h.

◆ AUDIO_SUBCLASS_AUDIOSTREAMING

#define AUDIO_SUBCLASS_AUDIOSTREAMING 0x02

Definition at line 69 of file audio_hid_desc.h.

◆ AUDIO_SUBCLASS_MIDISTREMING

#define AUDIO_SUBCLASS_MIDISTREMING 0x03

Definition at line 70 of file audio_hid_desc.h.

◆ AUDIO_SUBCLASS_UNDEFINED

#define AUDIO_SUBCLASS_UNDEFINED 0x00

audio interface subclass codes

Definition at line 67 of file audio_hid_desc.h.

◆ AUDIO_TERMINAL_TYPE_STREAMING

#define AUDIO_TERMINAL_TYPE_STREAMING 0x0101

Definition at line 138 of file audio_hid_desc.h.

◆ AUDIO_TERMINAL_TYPE_UNDEFINED

#define AUDIO_TERMINAL_TYPE_UNDEFINED 0x0100

audio terminal type

Definition at line 137 of file audio_hid_desc.h.

◆ AUDIO_TERMINAL_TYPE_VENDOR

#define AUDIO_TERMINAL_TYPE_VENDOR 0x01FF

Definition at line 139 of file audio_hid_desc.h.

◆ BCD_NUM

#define BCD_NUM 0x0100

Definition at line 51 of file audio_hid_desc.h.

◆ HID_BCD_NUM

#define HID_BCD_NUM 0x0110

usb bcd number define

Definition at line 211 of file audio_hid_desc.h.

◆ HID_BINTERVAL_TIME

#define HID_BINTERVAL_TIME 0x01

Definition at line 206 of file audio_hid_desc.h.

◆ HID_CLASS_DESC_HID

#define HID_CLASS_DESC_HID 0x21

usb hid class descriptor define

Definition at line 216 of file audio_hid_desc.h.

◆ HID_CLASS_DESC_PHYSICAL

#define HID_CLASS_DESC_PHYSICAL 0x23

Definition at line 218 of file audio_hid_desc.h.

◆ HID_CLASS_DESC_REPORT

#define HID_CLASS_DESC_REPORT 0x22

Definition at line 217 of file audio_hid_desc.h.

◆ HID_INTERFACE_NUMBER

#define HID_INTERFACE_NUMBER 0x03

Definition at line 184 of file audio_hid_desc.h.

◆ HID_REPORT_ID_1

#define HID_REPORT_ID_1 0x01

usb hid report id define

Definition at line 223 of file audio_hid_desc.h.

◆ HID_REPORT_ID_2

#define HID_REPORT_ID_2 0x02

Definition at line 224 of file audio_hid_desc.h.

◆ HID_REPORT_ID_3

#define HID_REPORT_ID_3 0x03

Definition at line 225 of file audio_hid_desc.h.

◆ HID_REPORT_ID_4

#define HID_REPORT_ID_4 0x04

Definition at line 226 of file audio_hid_desc.h.

◆ HID_REPORT_ID_5

#define HID_REPORT_ID_5 0x05

Definition at line 227 of file audio_hid_desc.h.

◆ HID_REPORT_ID_6

#define HID_REPORT_ID_6 0xF0

Definition at line 228 of file audio_hid_desc.h.

◆ MCU_ID1

#define MCU_ID1 (0x1FFFF7E8)

Definition at line 240 of file audio_hid_desc.h.

◆ MCU_ID2

#define MCU_ID2 (0x1FFFF7EC)

Definition at line 241 of file audio_hid_desc.h.

◆ MCU_ID3

#define MCU_ID3 (0x1FFFF7F0)

Definition at line 242 of file audio_hid_desc.h.

◆ SAMPLE_FREQ

#define SAMPLE_FREQ ( frq ) (uint8_t)(frq), (uint8_t)((frq >> 8)), (uint8_t)((frq >> 16))

Definition at line 238 of file audio_hid_desc.h.

◆ USBD_CONFIG_DESC_SIZE

#define USBD_CONFIG_DESC_SIZE
Value:
( 0x12 + AUDIO_INTERFACE_LEN + \
+ (0x31 + AUDIO_SPK_FREQ_SIZE * 3) \
+ (0x31 + AUDIO_MIC_FREQ_SIZE * 3) \
+ (9 * AUDIO_SUPPORT_FEEDBACK) \
+ USBD_HID_DESC_SIZE)
AUDIO_MIC_FREQ_SIZE
#define AUDIO_MIC_FREQ_SIZE
audio microphone freq and channel config
Definition: audio_hid_desc.h:195
AUDIO_SPK_FREQ_SIZE
#define AUDIO_SPK_FREQ_SIZE
audio speaker freq and channel config
Definition: audio_hid_desc.h:202
USBD_HID_DESC_SIZE
#define USBD_HID_DESC_SIZE
Definition: audio_hid_desc.h:230
AUDIO_INTERFACE_LEN
#define AUDIO_INTERFACE_LEN
Definition: audio_hid_desc.h:154
AUDIO_SUPPORT_FEEDBACK
#define AUDIO_SUPPORT_FEEDBACK
Definition: audio/audio_conf.h:49

Definition at line 231 of file audio_hid_desc.h.

◆ USBD_DESC_CONFIGURATION_STRING

#define USBD_DESC_CONFIGURATION_STRING "Audio Config"

Definition at line 61 of file audio_hid_desc.h.

◆ USBD_DESC_INTERFACE_STRING

#define USBD_DESC_INTERFACE_STRING "Audio Interface"

Definition at line 62 of file audio_hid_desc.h.

◆ USBD_DESC_MANUFACTURER_STRING

#define USBD_DESC_MANUFACTURER_STRING "Artery"

Definition at line 59 of file audio_hid_desc.h.

◆ USBD_DESC_PRODUCT_STRING

#define USBD_DESC_PRODUCT_STRING "AT32 Audio"

Definition at line 60 of file audio_hid_desc.h.

◆ USBD_HID_DESC_SIZE

#define USBD_HID_DESC_SIZE 32

Definition at line 230 of file audio_hid_desc.h.

◆ USBD_HID_SIZ_REPORT_DESC

#define USBD_HID_SIZ_REPORT_DESC 126

Definition at line 236 of file audio_hid_desc.h.

◆ USBD_PRODUCT_ID

#define USBD_PRODUCT_ID 0x5555

Definition at line 54 of file audio_hid_desc.h.

◆ USBD_SIZ_STRING_LANGID

#define USBD_SIZ_STRING_LANGID 4

Definition at line 56 of file audio_hid_desc.h.

◆ USBD_SIZ_STRING_SERIAL

#define USBD_SIZ_STRING_SERIAL 0x1A

Definition at line 57 of file audio_hid_desc.h.

◆ USBD_VENDOR_ID

#define USBD_VENDOR_ID 0x2E3C

Definition at line 53 of file audio_hid_desc.h.

Variable Documentation

◆ audio_hid_desc_handler

usbd_desc_handler audio_hid_desc_handler
extern

device descriptor handler structure

Definition at line 64 of file audio_hid_desc.c.

Referenced by main().

◆ g_hid_usb_desc

ALIGNED_HEAD uint8_t g_hid_usb_desc
extern
Initial value:
=
{
0x09,
0x21 ,
LBYTE( 0x0110 ),
HBYTE( 0x0110 ),
0x00,
0x01,
0x22 ,
LBYTE(sizeof(g_usbd_hid_report)),
HBYTE(sizeof(g_usbd_hid_report)),
}
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210

usb hid descriptor

Definition at line 527 of file audio_hid_desc.c.

Referenced by class_hid_setup_handler(), class_setup_handler(), and keyboard_class_setup_handler().

◆ g_usbd_configuration

uint8_t g_usbd_configuration[(0x12+((0x08+(1+ 1))+(1+ 1) *0x1E)++(0x31+((0+ 1)) *3)+(0x31+((0+ 1)) *3)+(9 * 1)+ 32)]
extern

◆ g_usbd_descriptor

uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
extern

◆ g_usbd_hid_report

ALIGNED_HEAD uint8_t g_usbd_hid_report
extern

usb hid report descriptor

usb mouse report descriptor

usb hid keyboard report descriptor

Definition at line 429 of file audio_hid_desc.c.

Referenced by class_hid_setup_handler(), class_setup_handler(), and keyboard_class_setup_handler().


AT32F415 Firmwary Library: USB_cdc_class

Modules
USB_cdc_class
AT32F415_middlewares_usbd_class

usb device class cdc demo More...

Modules

USB_cdc_class_private_functions
USB_cdc_class_definition
USB_cdc_class_exported_types
USB_cdc_class_exported_functions

Detailed Description

usb device class cdc demo


AT32F415 Firmwary Library: USB_cdc_class_private_functions

Functions | Variables
USB_cdc_class_private_functions
AT32F415_middlewares_usbd_class » USB_cdc_class

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb custom hid endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device event handler More...
uint16_t | usb_vcp_get_rxdata (void *udev, uint8_t *recv_data)
usb device class rx data process More...
error_status | usb_vcp_send_data (void *udev, uint8_t *send_data, uint16_t len)
usb device class send data More...

Variables

static uint32_t | alt_setting = 0
static uint8_t | g_rx_buff [0x40]
static uint8_t | g_cmd [0x08]
static uint8_t | g_req
static uint16_t | g_len
static uint16_t | g_rxlen
__IO uint8_t | g_tx_completed = 1
__IO uint8_t | g_rx_completed = 0
linecoding_type linecoding
usbd_class_handler | class_handler

Detailed Description

Function Documentation

◆ class_clear_handler()

usb_sts_type class_clear_handler ( void * udev )

clear endpoint or other state

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 120 of file cdc_class.c.

◆ class_ept0_rx_handler()

usb_sts_type class_ept0_rx_handler ( void * udev )

usb device endpoint 0 out status stage complete

Parameters
udev usb device core handler type
Return values
status of usb_sts_type

Definition at line 211 of file cdc_class.c.

◆ class_ept0_tx_handler()

usb_sts_type class_ept0_tx_handler ( void * udev )

usb device endpoint 0 in status stage complete

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 197 of file cdc_class.c.

◆ class_event_handler()

usb_sts_type class_event_handler | ( | void * | udev,
 |  | usbd_event_type | event
 | ) |  |

usb device event handler

Parameters
udev | to the structure of usbd_core_type
event | usb device event
Return values
status of usb_sts_type

Definition at line 286 of file cdc_class.c.

◆ class_in_handler()

usb_sts_type class_in_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device transmision complete handler

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 232 of file cdc_class.c.

◆ class_init_handler()

usb_sts_type class_init_handler ( void * udev )

initialize usb custom hid endpoint

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 93 of file cdc_class.c.

◆ class_out_handler()

usb_sts_type class_out_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device endpoint receive data

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 252 of file cdc_class.c.

◆ class_setup_handler()

usb_sts_type class_setup_handler | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb device class setup request handler

Parameters
udev | to the structure of usbd_core_type
setup | setup packet
Return values
status of usb_sts_type

Definition at line 143 of file cdc_class.c.

◆ class_sof_handler()

usb_sts_type class_sof_handler ( void * udev )

usb device sof handler

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 271 of file cdc_class.c.

◆ usb_vcp_get_rxdata()

uint16_t usb_vcp_get_rxdata | ( | void * | udev,
 |  | uint8_t * | recv_data
 | ) |  |

usb device class rx data process

Parameters
udev | to the structure of usbd_core_type
recv_data | receive buffer
Return values
receive data len

Definition at line 322 of file cdc_class.c.

Referenced by main().

◆ usb_vcp_send_data()

error_status usb_vcp_send_data | ( | void * | udev,
 |  | uint8_t * | send_data,
 |  | uint16_t | len
 | ) |  |

usb device class send data

Parameters
udev | to the structure of usbd_core_type
send_data | send data buffer
len | send length
Return values
error status

Definition at line 351 of file cdc_class.c.

Referenced by main().

Variable Documentation

◆ alt_setting

uint32_t alt_setting = 0
static

Definition at line 55 of file cdc_class.c.

Referenced by class_setup_handler().

◆ class_handler

usbd_class_handler class_handler
Initial value:
=
{
class_init_handler,
class_clear_handler,
class_setup_handler,
class_ept0_tx_handler,
class_ept0_rx_handler,
class_in_handler,
class_out_handler,
class_sof_handler,
class_event_handler,
}
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: cdc_class.c:286
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: cdc_class.c:271
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: cdc_class.c:143
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: cdc_class.c:197
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: cdc_class.c:232
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb custom hid endpoint
Definition: cdc_class.c:93
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: cdc_class.c:211
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: cdc_class.c:252
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: cdc_class.c:120

Definition at line 75 of file cdc_class.c.

Referenced by main(), usbd_core_init(), and usbh_core_init().

◆ g_cmd

uint8_t g_cmd[0x08]
static

Definition at line 58 of file cdc_class.c.

Referenced by class_ept0_rx_handler(), and class_setup_handler().

◆ g_len

uint16_t g_len
static

Definition at line 60 of file cdc_class.c.

Referenced by class_setup_handler().

◆ g_req

uint8_t g_req
static

Definition at line 59 of file cdc_class.c.

Referenced by class_ept0_rx_handler(), and class_setup_handler().

◆ g_rx_buff

uint8_t g_rx_buff[0x40]
static

Definition at line 56 of file cdc_class.c.

Referenced by class_init_handler(), and usb_vcp_get_rxdata().

◆ g_rx_completed

__IO uint8_t g_rx_completed = 0

Definition at line 61 of file cdc_class.c.

Referenced by class_out_handler(), and usb_vcp_get_rxdata().

◆ g_rxlen

uint16_t g_rxlen
static

Definition at line 60 of file cdc_class.c.

Referenced by class_out_handler(), and usb_vcp_get_rxdata().

◆ g_tx_completed

__IO uint8_t g_tx_completed = 1

Definition at line 61 of file cdc_class.c.

Referenced by class_in_handler(), class_init_handler(), and usb_vcp_send_data().

◆ linecoding

linecoding_type linecoding
Initial value:
=
{
115200,
0x00,
0x00,
0x08
}

Definition at line 63 of file cdc_class.c.

Referenced by usb_vcp_cmd_process().


AT32F415 Firmwary Library: USB_cdc_class_definition

Macros
USB_cdc_class_definition
AT32F415_middlewares_usbd_class » USB_cdc_class

Macros

#define | USBD_CDC_INT_EPT 0x82
usb cdc use endpoint define More...
#define | USBD_CDC_BULK_IN_EPT 0x81
#define | USBD_CDC_BULK_OUT_EPT 0x01
#define | USBD_IN_MAXPACKET_SIZE 0x40
usb cdc in and out max packet size define More...
#define | USBD_OUT_MAXPACKET_SIZE 0x40
#define | USBD_CMD_MAXPACKET_SIZE 0x08
#define | SET_LINE_CODING 0x20
usb cdc class request code define More...
#define | GET_LINE_CODING 0x21

Detailed Description

Macro Definition Documentation

◆ GET_LINE_CODING

#define GET_LINE_CODING 0x21

Definition at line 68 of file cdc_class.h.

◆ SET_LINE_CODING

#define SET_LINE_CODING 0x20

usb cdc class request code define

Definition at line 67 of file cdc_class.h.

◆ USBD_CDC_BULK_IN_EPT

#define USBD_CDC_BULK_IN_EPT 0x81

Definition at line 54 of file cdc_class.h.

◆ USBD_CDC_BULK_OUT_EPT

#define USBD_CDC_BULK_OUT_EPT 0x01

Definition at line 55 of file cdc_class.h.

◆ USBD_CDC_INT_EPT

#define USBD_CDC_INT_EPT 0x82

usb cdc use endpoint define

Definition at line 53 of file cdc_class.h.

◆ USBD_CMD_MAXPACKET_SIZE

#define USBD_CMD_MAXPACKET_SIZE 0x08

Definition at line 62 of file cdc_class.h.

◆ USBD_IN_MAXPACKET_SIZE

#define USBD_IN_MAXPACKET_SIZE 0x40

usb cdc in and out max packet size define

Definition at line 60 of file cdc_class.h.

◆ USBD_OUT_MAXPACKET_SIZE

#define USBD_OUT_MAXPACKET_SIZE 0x40

Definition at line 61 of file cdc_class.h.


AT32F415 Firmwary Library: USB_cdc_class_exported_types

Data Structures
USB_cdc_class_exported_types
AT32F415_middlewares_usbd_class » USB_cdc_class | AT32F415_middlewares_usbd_class » USB_cdc_keyboard_class

Data Structures

struct linecoding_type
usb cdc class set line coding struct More...

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: linecoding_type Struct Reference

Data Fields
linecoding_type Struct Reference
AT32F415_middlewares_usbd_class » USB_cdc_class | AT32F415_middlewares_usbd_class » USB_cdc_keyboard_class » USB_cdc_class_exported_types | AT32F415_middlewares_usbd_class » USB_printer_class » USB_printer_class_definition

usb cdc class set line coding struct More...

#include <cdc_class.h>

Data Fields

uint32_t | bitrate
uint8_t | format
uint8_t | parity
uint8_t | data

Detailed Description

usb cdc class set line coding struct

Definition at line 81 of file cdc_class.h.

Field Documentation

◆ bitrate

uint32_t linecoding_type::bitrate

Definition at line 83 of file cdc_class.h.

Referenced by usb_vcp_cmd_process().

◆ data

uint8_t linecoding_type::data

Definition at line 86 of file cdc_class.h.

Referenced by usb_vcp_cmd_process().

◆ format

uint8_t linecoding_type::format

Definition at line 84 of file cdc_class.h.

Referenced by usb_vcp_cmd_process().

◆ parity

uint8_t linecoding_type::parity

Definition at line 85 of file cdc_class.h.

Referenced by usb_vcp_cmd_process().

The documentation for this struct was generated from the following files:
  • cdc_class.h
  • cdc_keyboard_class.h
  • printer_class.h


AT32F415 Firmwary Library: USB_cdc_class_exported_functions

Functions | Variables
USB_cdc_class_exported_functions
AT32F415_middlewares_usbd_class » USB_cdc_class

Functions

uint16_t | usb_vcp_get_rxdata (void *udev, uint8_t *recv_data)
usb device class rx data process More...
error_status | usb_vcp_send_data (void *udev, uint8_t *send_data, uint16_t len)
usb device class send data More...

Variables

usbd_class_handler class_handler

Detailed Description

Function Documentation

◆ usb_vcp_get_rxdata()

uint16_t usb_vcp_get_rxdata | ( | void * | udev,
 |  | uint8_t * | recv_data
 | ) |  |

usb device class rx data process

Parameters
udev | to the structure of usbd_core_type
recv_data | receive buffer
Return values
receive data len

Definition at line 322 of file cdc_class.c.

◆ usb_vcp_send_data()

error_status usb_vcp_send_data | ( | void * | udev,
 |  | uint8_t * | send_data,
 |  | uint16_t | len
 | ) |  |

usb device class send data

Parameters
udev | to the structure of usbd_core_type
send_data | send data buffer
len | send length
Return values
error status

Definition at line 351 of file cdc_class.c.

Variable Documentation

◆ class_handler

usbd_class_handler class_handler
extern

Definition at line 75 of file cdc_class.c.


AT32F415 Firmwary Library: USB_cdc_desc

Modules | Variables
USB_cdc_desc
AT32F415_middlewares_usbd_class

usb device cdc descriptor More...

Modules

USB_cdc_desc_private_functions
USB_cdc_desc_definition

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [67]
usbd_desc_handler | desc_handler
device descriptor handler structure More...

Detailed Description

usb device cdc descriptor

Variable Documentation

◆ desc_handler

usbd_desc_handler desc_handler
extern

device descriptor handler structure

Definition at line 64 of file cdc_desc.c.

◆ g_usbd_configuration

uint8_t g_usbd_configuration[67]
extern

◆ g_usbd_descriptor

uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
extern


AT32F415 Firmwary Library: USB_cdc_desc_private_functions

Functions | Variables
USB_cdc_desc_private_functions
AT32F415_middlewares_usbd_class » USB_cdc_desc

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | desc_handler
device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

Function Documentation

◆ get_device_config_string()

usbd_desc_t * get_device_config_string ( void )

get device config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 429 of file cdc_desc.c.

◆ get_device_configuration()

usbd_desc_t * get_device_configuration ( void )

get config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 351 of file cdc_desc.c.

◆ get_device_descriptor()

usbd_desc_t * get_device_descriptor ( void )

get device descriptor

Parameters
none
Return values
usbd_desc

Definition at line 331 of file cdc_desc.c.

◆ get_device_interface_string()

usbd_desc_t * get_device_interface_string ( void )

get interface descriptor

Parameters
none
Return values
usbd_desc

Definition at line 417 of file cdc_desc.c.

◆ get_device_lang_id()

usbd_desc_t * get_device_lang_id ( void )

get lang id descriptor

Parameters
none
Return values
usbd_desc

Definition at line 371 of file cdc_desc.c.

◆ get_device_manufacturer_string()

usbd_desc_t * get_device_manufacturer_string ( void )

get manufacturer descriptor

Parameters
none
Return values
usbd_desc

Definition at line 382 of file cdc_desc.c.

◆ get_device_other_speed()

usbd_desc_t * get_device_other_speed ( void )

get other speed descriptor

Parameters
none
Return values
usbd_desc

Definition at line 361 of file cdc_desc.c.

◆ get_device_product_string()

usbd_desc_t * get_device_product_string ( void )

get product descriptor

Parameters
none
Return values
usbd_desc

Definition at line 394 of file cdc_desc.c.

◆ get_device_qualifier()

usbd_desc_t * get_device_qualifier ( void )

get device qualifier

Parameters
none
Return values
usbd_desc

Definition at line 341 of file cdc_desc.c.

◆ get_device_serial_string()

usbd_desc_t * get_device_serial_string ( void )

get serial descriptor

Parameters
none
Return values
usbd_desc

Definition at line 406 of file cdc_desc.c.

◆ get_serial_num()

static void get_serial_num ( void )
static

usb get serial number

Parameters
none
Return values
none

Definition at line 309 of file cdc_desc.c.

Referenced by get_device_serial_string().

◆ usbd_int_to_unicode()

static void usbd_int_to_unicode | ( | uint32_t | value,
 |  | uint8_t * | pbuf,
 |  | uint8_t | len
 | ) |  |
static

usb int convert to unicode

Parameters
value | int value
pbus | unicode buffer
len | length
Return values
none

Definition at line 283 of file cdc_desc.c.

Referenced by get_serial_num().

◆ usbd_unicode_convert()

uint16_t usbd_unicode_convert | ( | uint8_t * | string,
 |  | uint8_t * | unicode_buf
 | ) |  |

standard usb unicode convert

Parameters
string | source string
unicode_buf | unicode buffer
Return values
length

Definition at line 257 of file cdc_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

Variable Documentation

◆ ALIGNED_TAIL

ALIGNED_HEAD uint8_t g_string_serial [ 0x1A ] ALIGNED_TAIL
Initial value:
=
{
USB_DEVICE_DESC_LEN,
USB_DESCIPTOR_TYPE_DEVICE,
0x00,
0x02,
0x02,
0x00,
0x00,
USB_MAX_EP0_SIZE,
LBYTE( 0x2E3C ),
HBYTE( 0x2E3C ),
LBYTE( 0x5740 ),
HBYTE( 0x5740 ),
0x00,
0x02,
USB_MFC_STRING,
USB_PRODUCT_STRING,
USB_SERIAL_STRING,
1
}
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92

usb device standard descriptor

usb string serial

usb string lang id

usb configuration standard descriptor

Definition at line 84 of file cdc_desc.c.

◆ config_descriptor

usbd_desc_t config_descriptor
Initial value:
=
{
67 ,
g_usbd_configuration
}
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112

Definition at line 229 of file cdc_desc.c.

Referenced by get_device_configuration().

◆ desc_handler

usbd_desc_handler desc_handler
Initial value:
=
{
get_device_descriptor,
get_device_qualifier,
get_device_configuration,
get_device_other_speed,
get_device_lang_id,
get_device_manufacturer_string,
get_device_product_string,
get_device_serial_string,
get_device_interface_string,
get_device_config_string,
}
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: cdc_desc.c:382
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: cdc_desc.c:341
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: cdc_desc.c:417
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: cdc_desc.c:361
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: cdc_desc.c:351
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: cdc_desc.c:394
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: cdc_desc.c:371
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: cdc_desc.c:331
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: cdc_desc.c:406
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: cdc_desc.c:429

device descriptor handler structure

Definition at line 64 of file cdc_desc.c.

Referenced by main(), and usbd_core_init().

◆ device_descriptor

usbd_desc_t device_descriptor
Initial value:
=
{
USB_DEVICE_DESC_LEN,
g_usbd_descriptor
}
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]

Definition at line 222 of file cdc_desc.c.

Referenced by get_device_descriptor().

◆ g_usbd_desc_buffer

uint8_t g_usbd_desc_buffer[256]
static

Definition at line 59 of file cdc_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

◆ langid_descriptor

usbd_desc_t langid_descriptor
Initial value:
=
{
4 ,
g_string_lang_id
}

Definition at line 236 of file cdc_desc.c.

Referenced by get_device_lang_id().

◆ serial_descriptor

usbd_desc_t serial_descriptor
Initial value:
=
{
0x1A ,
g_string_serial
}

Definition at line 243 of file cdc_desc.c.

Referenced by get_device_serial_string().

◆ vp_desc

usbd_desc_t vp_desc

Definition at line 249 of file cdc_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().


AT32F415 Firmwary Library: USB_cdc_desc_definition

Macros
USB_cdc_desc_definition
AT32F415_middlewares_usbd_class » USB_cdc_desc

Macros

#define | BCD_NUM 0x0110
usb bcd number define More...
#define | USBD_VENDOR_ID 0x2E3C
usb vendor id and product id define More...
#define | USBD_PRODUCT_ID 0x5740
#define | USBD_CONFIG_DESC_SIZE 67
usb descriptor size define More...
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
usb string define(vendor, product configuration, interface) More...
#define | USBD_DESC_PRODUCT_STRING "AT32 Virtual Com Port "
#define | USBD_DESC_CONFIGURATION_STRING "Virtual ComPort Config"
#define | USBD_DESC_INTERFACE_STRING "Virtual ComPort Interface"
#define | HID_BINTERVAL_TIME 0xFF
usb endpoint interval define More...
#define | USBD_CDC_CS_INTERFACE 0x24
usb hid class descriptor define More...
#define | USBD_CDC_CS_ENDPOINT 0x25
#define | USBD_CDC_SUBTYPE_HEADER 0x00
usb hid class sub-type define More...
#define | USBD_CDC_SUBTYPE_CMF 0x01
#define | USBD_CDC_SUBTYPE_ACM 0x02
#define | USBD_CDC_SUBTYPE_UFD 0x06
#define | MCU_ID1 (0x1FFFF7E8)
usb mcu id address deine More...
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Detailed Description

Macro Definition Documentation

◆ BCD_NUM

#define BCD_NUM 0x0110

usb bcd number define

Definition at line 53 of file cdc_desc.h.

◆ HID_BINTERVAL_TIME

#define HID_BINTERVAL_TIME 0xFF

usb endpoint interval define

Definition at line 79 of file cdc_desc.h.

◆ MCU_ID1

#define MCU_ID1 (0x1FFFF7E8)

usb mcu id address deine

Definition at line 98 of file cdc_desc.h.

◆ MCU_ID2

#define MCU_ID2 (0x1FFFF7EC)

Definition at line 99 of file cdc_desc.h.

◆ MCU_ID3

#define MCU_ID3 (0x1FFFF7F0)

Definition at line 100 of file cdc_desc.h.

◆ USBD_CDC_CS_ENDPOINT

#define USBD_CDC_CS_ENDPOINT 0x25

Definition at line 85 of file cdc_desc.h.

◆ USBD_CDC_CS_INTERFACE

#define USBD_CDC_CS_INTERFACE 0x24

usb hid class descriptor define

Definition at line 84 of file cdc_desc.h.

◆ USBD_CDC_SUBTYPE_ACM

#define USBD_CDC_SUBTYPE_ACM 0x02

Definition at line 92 of file cdc_desc.h.

◆ USBD_CDC_SUBTYPE_CMF

#define USBD_CDC_SUBTYPE_CMF 0x01

Definition at line 91 of file cdc_desc.h.

◆ USBD_CDC_SUBTYPE_HEADER

#define USBD_CDC_SUBTYPE_HEADER 0x00

usb hid class sub-type define

Definition at line 90 of file cdc_desc.h.

◆ USBD_CDC_SUBTYPE_UFD

#define USBD_CDC_SUBTYPE_UFD 0x06

Definition at line 93 of file cdc_desc.h.

◆ USBD_CONFIG_DESC_SIZE

#define USBD_CONFIG_DESC_SIZE 67

usb descriptor size define

Definition at line 64 of file cdc_desc.h.

◆ USBD_DESC_CONFIGURATION_STRING

#define USBD_DESC_CONFIGURATION_STRING "Virtual ComPort Config"

Definition at line 73 of file cdc_desc.h.

◆ USBD_DESC_INTERFACE_STRING

#define USBD_DESC_INTERFACE_STRING "Virtual ComPort Interface"

Definition at line 74 of file cdc_desc.h.

◆ USBD_DESC_MANUFACTURER_STRING

#define USBD_DESC_MANUFACTURER_STRING "Artery"

usb string define(vendor, product configuration, interface)

Definition at line 71 of file cdc_desc.h.

◆ USBD_DESC_PRODUCT_STRING

#define USBD_DESC_PRODUCT_STRING "AT32 Virtual Com Port "

Definition at line 72 of file cdc_desc.h.

◆ USBD_PRODUCT_ID

#define USBD_PRODUCT_ID 0x5740

Definition at line 59 of file cdc_desc.h.

◆ USBD_SIZ_STRING_LANGID

#define USBD_SIZ_STRING_LANGID 4

Definition at line 65 of file cdc_desc.h.

◆ USBD_SIZ_STRING_SERIAL

#define USBD_SIZ_STRING_SERIAL 0x1A

Definition at line 66 of file cdc_desc.h.

◆ USBD_VENDOR_ID

#define USBD_VENDOR_ID 0x2E3C

usb vendor id and product id define

Definition at line 58 of file cdc_desc.h.


AT32F415 Firmwary Library: USB_cdc_keyboard_class

Modules
USB_cdc_keyboard_class
AT32F415_middlewares_usbd_class

usb device class composite cdc and keyboard More...

Modules

USB_cdc_keyboard_class_private_functions
USB_cdc_keyboard_class_definition
USB_cdc_class_exported_types
USB_cdc_keyboar_class_exported_functions

Detailed Description

usb device class composite cdc and keyboard


AT32F415 Firmwary Library: USB_cdc_keyboard_class_private_functions

Macros | Functions | Variables
USB_cdc_keyboard_class_private_functions
AT32F415_middlewares_usbd_class » USB_cdc_keyboard_class

Macros

#define SHIFT 0x80

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device class endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device class endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device class transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device class endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device class sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device class event handler More...
usb_sts_type | cdc_class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | keyboard_class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
void | usb_vcp_cmd_process (void *udev, uint8_t cmd, uint8_t *buff, uint16_t len)
usb device class request function More...
uint16_t | usb_vcp_get_rxdata (void *udev, uint8_t *recv_data)
usb device class rx data process More...
error_status | usb_vcp_send_data (void *udev, uint8_t *send_data, uint16_t len)
usb device class send data More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...
void | usb_hid_keyboard_send_char (void *udev, uint8_t ascii_code)
usb keyoard send char More...

Variables

static uint32_t | alt_setting = 0
static uint32_t | hid_protocol = 0
static uint32_t | hid_set_idle = 0
static uint8_t | hid_state
uint8_t | hid_set_report [64]
static uint8_t | g_rx_buff [0x40]
static uint8_t | g_cmd [0x08]
static uint8_t | g_req
static uint16_t | g_len
static uint16_t | g_rxlen
__IO uint8_t | g_tx_completed = 1
__IO uint8_t | g_rx_completed = 0
__IO uint8_t | g_keyboard_tx_completed = 0
const unsigned char | _asciimap [128]
linecoding_type linecoding
usbd_class_handler | cdc_keyboard_class_handler

Detailed Description

Macro Definition Documentation

◆ SHIFT

#define SHIFT 0x80

Definition at line 71 of file cdc_keyboard_class.c.

Function Documentation

◆ cdc_class_setup_handler()

usb_sts_type cdc_class_setup_handler | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb device class setup request handler

Parameters
udev | to the structure of usbd_core_type
setup | setup packet
Return values
status of usb_sts_type

Definition at line 321 of file cdc_keyboard_class.c.

Referenced by class_setup_handler().

◆ class_clear_handler()

usb_sts_type class_clear_handler ( void * udev )

clear endpoint or other state

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 266 of file cdc_keyboard_class.c.

◆ class_ept0_rx_handler()

usb_sts_type class_ept0_rx_handler ( void * udev )

usb device class endpoint 0 out status stage complete

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 463 of file cdc_keyboard_class.c.

◆ class_ept0_tx_handler()

usb_sts_type class_ept0_tx_handler ( void * udev )

usb device class endpoint 0 in status stage complete

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 449 of file cdc_keyboard_class.c.

◆ class_event_handler()

usb_sts_type class_event_handler | ( | void * | udev,
 |  | usbd_event_type | event
 | ) |  |

usb device class event handler

Parameters
udev | to the structure of usbd_core_type
event | usb device event
Return values
status of usb_sts_type

Definition at line 549 of file cdc_keyboard_class.c.

◆ class_in_handler()

usb_sts_type class_in_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device class transmision complete handler

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 489 of file cdc_keyboard_class.c.

◆ class_init_handler()

usb_sts_type class_init_handler ( void * udev )

initialize usb endpoint

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 235 of file cdc_keyboard_class.c.

◆ class_out_handler()

usb_sts_type class_out_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device class endpoint receive data

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 515 of file cdc_keyboard_class.c.

◆ class_send_report()

usb_sts_type class_send_report | ( | void * | udev,
 |  | uint8_t * | report,
 |  | uint16_t | len
 | ) |  |

usb device class send report

Parameters
udev | to the structure of usbd_core_type
report | report buffer
len | report length
Return values
status of usb_sts_type

Definition at line 668 of file cdc_keyboard_class.c.

Referenced by usb_hid_keyboard_send_char().

◆ class_setup_handler()

usb_sts_type class_setup_handler | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb device class setup request handler

Parameters
udev | to the structure of usbd_core_type
setup | setup packet
Return values
status of usb_sts_type

Definition at line 292 of file cdc_keyboard_class.c.

◆ class_sof_handler()

usb_sts_type class_sof_handler ( void * udev )

usb device class sof handler

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 534 of file cdc_keyboard_class.c.

◆ keyboard_class_setup_handler()

usb_sts_type keyboard_class_setup_handler | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb device class setup request handler

Parameters
udev | to the structure of usbd_core_type
setup | setup packet
Return values
status of usb_sts_type

Definition at line 376 of file cdc_keyboard_class.c.

Referenced by class_setup_handler().

◆ usb_hid_keyboard_send_char()

void usb_hid_keyboard_send_char | ( | void * | udev,
 |  | uint8_t | ascii_code
 | ) |  |

usb keyoard send char

Parameters
udev | to the structure of usbd_core_type
op | operation
Return values
none

Definition at line 686 of file cdc_keyboard_class.c.

Referenced by keyboard_send_string().

◆ usb_vcp_cmd_process()

void usb_vcp_cmd_process | ( | void * | udev,
 |  | uint8_t | cmd,
 |  | uint8_t * | buff,
 |  | uint16_t | len
 | ) |  |

usb device class request function

Parameters
udev | to the structure of usbd_core_type
cmd | request number
buff | request buffer
len | buffer length
Return values
none

Definition at line 635 of file cdc_keyboard_class.c.

Referenced by cdc_class_setup_handler(), and class_ept0_rx_handler().

◆ usb_vcp_get_rxdata()

uint16_t usb_vcp_get_rxdata | ( | void * | udev,
 |  | uint8_t * | recv_data
 | ) |  |

usb device class rx data process

Parameters
udev | to the structure of usbd_core_type
recv_data | receive buffer
Return values
receive data len

Definition at line 580 of file cdc_keyboard_class.c.

◆ usb_vcp_send_data()

error_status usb_vcp_send_data | ( | void * | udev,
 |  | uint8_t * | send_data,
 |  | uint16_t | len
 | ) |  |

usb device class send data

Parameters
udev | to the structure of usbd_core_type
send_data | send data buffer
len | send length
Return values
error status

Definition at line 610 of file cdc_keyboard_class.c.

Variable Documentation

◆ _asciimap

const unsigned char _asciimap[128]

Definition at line 72 of file cdc_keyboard_class.c.

Referenced by usb_hid_keyboard_send_char().

◆ alt_setting

uint32_t alt_setting = 0
static

Definition at line 57 of file cdc_keyboard_class.c.

Referenced by cdc_class_setup_handler(), and keyboard_class_setup_handler().

◆ cdc_keyboard_class_handler

usbd_class_handler cdc_keyboard_class_handler
Initial value:
=
{
class_init_handler,
class_clear_handler,
class_setup_handler,
class_ept0_tx_handler,
class_ept0_rx_handler,
class_in_handler,
class_out_handler,
class_sof_handler,
class_event_handler,
}
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device class event handler
Definition: cdc_keyboard_class.c:549
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device class sof handler
Definition: cdc_keyboard_class.c:534
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: cdc_keyboard_class.c:292
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device class endpoint 0 in status stage complete
Definition: cdc_keyboard_class.c:449
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device class transmision complete handler
Definition: cdc_keyboard_class.c:489
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb endpoint
Definition: cdc_keyboard_class.c:235
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device class endpoint 0 out status stage complete
Definition: cdc_keyboard_class.c:463
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device class endpoint receive data
Definition: cdc_keyboard_class.c:515
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: cdc_keyboard_class.c:266

Definition at line 217 of file cdc_keyboard_class.c.

Referenced by main().

◆ g_cmd

uint8_t g_cmd[0x08]
static

Definition at line 64 of file cdc_keyboard_class.c.

Referenced by cdc_class_setup_handler(), and class_ept0_rx_handler().

◆ g_keyboard_tx_completed

__IO uint8_t g_keyboard_tx_completed = 0

Definition at line 69 of file cdc_keyboard_class.c.

Referenced by class_in_handler(), class_init_handler(), and keyboard_send_string().

◆ g_len

uint16_t g_len
static

Definition at line 66 of file cdc_keyboard_class.c.

Referenced by cdc_class_setup_handler().

◆ g_req

uint8_t g_req
static

Definition at line 65 of file cdc_keyboard_class.c.

Referenced by cdc_class_setup_handler(), and class_ept0_rx_handler().

◆ g_rx_buff

uint8_t g_rx_buff[0x40]
static

Definition at line 62 of file cdc_keyboard_class.c.

Referenced by class_init_handler(), and usb_vcp_get_rxdata().

◆ g_rx_completed

__IO uint8_t g_rx_completed = 0

Definition at line 67 of file cdc_keyboard_class.c.

Referenced by class_out_handler(), and usb_vcp_get_rxdata().

◆ g_rxlen

uint16_t g_rxlen
static

Definition at line 66 of file cdc_keyboard_class.c.

Referenced by class_out_handler(), and usb_vcp_get_rxdata().

◆ g_tx_completed

__IO uint8_t g_tx_completed = 1

Definition at line 67 of file cdc_keyboard_class.c.

Referenced by class_in_handler(), class_init_handler(), and usb_vcp_send_data().

◆ hid_protocol

uint32_t hid_protocol = 0
static

Definition at line 58 of file cdc_keyboard_class.c.

Referenced by keyboard_class_setup_handler().

◆ hid_set_idle

uint32_t hid_set_idle = 0
static

Definition at line 59 of file cdc_keyboard_class.c.

Referenced by keyboard_class_setup_handler().

◆ hid_set_report

uint8_t hid_set_report[64]

Definition at line 61 of file cdc_keyboard_class.c.

Referenced by keyboard_class_setup_handler().

◆ hid_state

uint8_t hid_state
static

Definition at line 60 of file cdc_keyboard_class.c.

Referenced by class_ept0_rx_handler(), and keyboard_class_setup_handler().

◆ linecoding

linecoding_type linecoding
Initial value:
=
{
115200,
0x00,
0x00,
0x08
}

Definition at line 205 of file cdc_keyboard_class.c.

Referenced by usb_vcp_cmd_process().


AT32F415 Firmwary Library: USB_cdc_keyboard_class_definition

Macros
USB_cdc_keyboard_class_definition
AT32F415_middlewares_usbd_class » USB_cdc_keyboard_class

Macros

#define | USBD_CDC_INT_EPT 0x82
usb use endpoint define More...
#define | USBD_CDC_BULK_IN_EPT 0x81
#define | USBD_CDC_BULK_OUT_EPT 0x01
#define | USBD_HID_IN_EPT 0x83
#define | USBD_IN_MAXPACKET_SIZE 0x40
usb in and out max packet size define More...
#define | USBD_OUT_MAXPACKET_SIZE 0x40
#define | USBD_CMD_MAXPACKET_SIZE 0x08
#define | SET_LINE_CODING 0x20
usb cdc class request code define More...
#define | GET_LINE_CODING 0x21
#define | HID_REQ_SET_PROTOCOL 0x0B
usb hid class request code define More...
#define | HID_REQ_GET_PROTOCOL 0x03
#define | HID_REQ_SET_IDLE 0x0A
#define | HID_REQ_GET_IDLE 0x02
#define | HID_REQ_SET_REPORT 0x09
#define | HID_REQ_GET_REPORT 0x01
#define | HID_DESCRIPTOR_TYPE 0x21
#define | HID_REPORT_DESC 0x22

Detailed Description

Macro Definition Documentation

◆ GET_LINE_CODING

#define GET_LINE_CODING 0x21

Definition at line 69 of file cdc_keyboard_class.h.

◆ HID_DESCRIPTOR_TYPE

#define HID_DESCRIPTOR_TYPE 0x21

Definition at line 80 of file cdc_keyboard_class.h.

◆ HID_REPORT_DESC

#define HID_REPORT_DESC 0x22

Definition at line 81 of file cdc_keyboard_class.h.

◆ HID_REQ_GET_IDLE

#define HID_REQ_GET_IDLE 0x02

Definition at line 77 of file cdc_keyboard_class.h.

◆ HID_REQ_GET_PROTOCOL

#define HID_REQ_GET_PROTOCOL 0x03

Definition at line 75 of file cdc_keyboard_class.h.

◆ HID_REQ_GET_REPORT

#define HID_REQ_GET_REPORT 0x01

Definition at line 79 of file cdc_keyboard_class.h.

◆ HID_REQ_SET_IDLE

#define HID_REQ_SET_IDLE 0x0A

Definition at line 76 of file cdc_keyboard_class.h.

◆ HID_REQ_SET_PROTOCOL

#define HID_REQ_SET_PROTOCOL 0x0B

usb hid class request code define

Definition at line 74 of file cdc_keyboard_class.h.

◆ HID_REQ_SET_REPORT

#define HID_REQ_SET_REPORT 0x09

Definition at line 78 of file cdc_keyboard_class.h.

◆ SET_LINE_CODING

#define SET_LINE_CODING 0x20

usb cdc class request code define

Definition at line 68 of file cdc_keyboard_class.h.

◆ USBD_CDC_BULK_IN_EPT

#define USBD_CDC_BULK_IN_EPT 0x81

Definition at line 54 of file cdc_keyboard_class.h.

◆ USBD_CDC_BULK_OUT_EPT

#define USBD_CDC_BULK_OUT_EPT 0x01

Definition at line 55 of file cdc_keyboard_class.h.

◆ USBD_CDC_INT_EPT

#define USBD_CDC_INT_EPT 0x82

usb use endpoint define

Definition at line 53 of file cdc_keyboard_class.h.

◆ USBD_CMD_MAXPACKET_SIZE

#define USBD_CMD_MAXPACKET_SIZE 0x08

Definition at line 63 of file cdc_keyboard_class.h.

◆ USBD_HID_IN_EPT

#define USBD_HID_IN_EPT 0x83

Definition at line 56 of file cdc_keyboard_class.h.

◆ USBD_IN_MAXPACKET_SIZE

#define USBD_IN_MAXPACKET_SIZE 0x40

usb in and out max packet size define

Definition at line 61 of file cdc_keyboard_class.h.

◆ USBD_OUT_MAXPACKET_SIZE

#define USBD_OUT_MAXPACKET_SIZE 0x40

Definition at line 62 of file cdc_keyboard_class.h.


AT32F415 Firmwary Library: USB_cdc_keyboar_class_exported_functions

Functions | Variables
USB_cdc_keyboar_class_exported_functions
AT32F415_middlewares_usbd_class » USB_cdc_keyboard_class

Functions

uint16_t | usb_vcp_get_rxdata (void *udev, uint8_t *recv_data)
usb device class rx data process More...
error_status | usb_vcp_send_data (void *udev, uint8_t *send_data, uint16_t len)
usb device class send data More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...
void | usb_hid_keyboard_send_char (void *udev, uint8_t ascii_code)
usb keyoard send char More...

Variables

usbd_class_handler | cdc_keyboard_class_handler
__IO uint8_t | g_keyboard_tx_completed

Detailed Description

Function Documentation

◆ class_send_report()

usb_sts_type class_send_report | ( | void * | udev,
 |  | uint8_t * | report,
 |  | uint16_t | len
 | ) |  |

usb device class send report

Parameters
udev | to the structure of usbd_core_type
report | report buffer
len | report length
Return values
status of usb_sts_type

Definition at line 818 of file audio_hid_class.c.

◆ usb_hid_keyboard_send_char()

void usb_hid_keyboard_send_char | ( | void * | udev,
 |  | uint8_t | ascii_code
 | ) |  |

usb keyoard send char

Parameters
udev | to the structure of usbd_core_type
op | operation
Return values
none

usb keyoard send char

Parameters
udev | to the structure of usbd_core_type
op | operation
Return values
none

Definition at line 686 of file cdc_keyboard_class.c.

◆ usb_vcp_get_rxdata()

uint16_t usb_vcp_get_rxdata | ( | void * | udev,
 |  | uint8_t * | recv_data
 | ) |  |

usb device class rx data process

Parameters
udev | to the structure of usbd_core_type
recv_data | receive buffer
Return values
receive data len

Definition at line 322 of file cdc_class.c.

Referenced by main().

◆ usb_vcp_send_data()

error_status usb_vcp_send_data | ( | void * | udev,
 |  | uint8_t * | send_data,
 |  | uint16_t | len
 | ) |  |

usb device class send data

Parameters
udev | to the structure of usbd_core_type
send_data | send data buffer
len | send length
Return values
error status

Definition at line 351 of file cdc_class.c.

Referenced by main().

Variable Documentation

◆ cdc_keyboard_class_handler

usbd_class_handler cdc_keyboard_class_handler
extern

Definition at line 217 of file cdc_keyboard_class.c.

Referenced by main().

◆ g_keyboard_tx_completed

__IO uint8_t g_keyboard_tx_completed
extern

Definition at line 69 of file cdc_keyboard_class.c.

Referenced by class_in_handler(), class_init_handler(), and keyboard_send_string().


AT32F415 Firmwary Library: USB_cdc_keyboard_desc

Modules | Variables
USB_cdc_keyboard_desc
AT32F415_middlewares_usbd_class

usb device cdc keyboard descriptor More...

Modules

USB_cdc_keyboard_desc_private_functions
USB_cdc_keyboard_desc_definition

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [108]
uint8_t | g_usbd_hid_report [63]
uint8_t | g_hid_usb_desc [9]
usbd_desc_handler | cdc_keyboard_desc_handler
device descriptor handler structure More...

Detailed Description

usb device cdc keyboard descriptor

Variable Documentation

◆ cdc_keyboard_desc_handler

usbd_desc_handler cdc_keyboard_desc_handler
extern

device descriptor handler structure

Definition at line 62 of file cdc_keyboard_desc.c.

Referenced by main().

◆ g_hid_usb_desc

uint8_t g_hid_usb_desc[9]
extern

◆ g_usbd_configuration

uint8_t g_usbd_configuration[108]
extern

◆ g_usbd_descriptor

uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
extern

◆ g_usbd_hid_report

uint8_t g_usbd_hid_report[63]
extern


AT32F415 Firmwary Library: USB_cdc_keyboard_desc_private_functions

Functions | Variables
USB_cdc_keyboard_desc_private_functions
AT32F415_middlewares_usbd_class » USB_cdc_keyboard_desc

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | cdc_keyboard_desc_handler
device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

Function Documentation

◆ get_device_config_string()

usbd_desc_t * get_device_config_string ( void )

get device config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 533 of file cdc_keyboard_desc.c.

◆ get_device_configuration()

usbd_desc_t * get_device_configuration ( void )

get config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 455 of file cdc_keyboard_desc.c.

◆ get_device_descriptor()

usbd_desc_t * get_device_descriptor ( void )

get device descriptor

Parameters
none
Return values
usbd_desc

Definition at line 435 of file cdc_keyboard_desc.c.

◆ get_device_interface_string()

usbd_desc_t * get_device_interface_string ( void )

get interface descriptor

Parameters
none
Return values
usbd_desc

Definition at line 521 of file cdc_keyboard_desc.c.

◆ get_device_lang_id()

usbd_desc_t * get_device_lang_id ( void )

get lang id descriptor

Parameters
none
Return values
usbd_desc

Definition at line 475 of file cdc_keyboard_desc.c.

◆ get_device_manufacturer_string()

usbd_desc_t * get_device_manufacturer_string ( void )

get manufacturer descriptor

Parameters
none
Return values
usbd_desc

Definition at line 486 of file cdc_keyboard_desc.c.

◆ get_device_other_speed()

usbd_desc_t * get_device_other_speed ( void )

get other speed descriptor

Parameters
none
Return values
usbd_desc

Definition at line 465 of file cdc_keyboard_desc.c.

◆ get_device_product_string()

usbd_desc_t * get_device_product_string ( void )

get product descriptor

Parameters
none
Return values
usbd_desc

Definition at line 498 of file cdc_keyboard_desc.c.

◆ get_device_qualifier()

usbd_desc_t * get_device_qualifier ( void )

get device qualifier

Parameters
none
Return values
usbd_desc

Definition at line 445 of file cdc_keyboard_desc.c.

◆ get_device_serial_string()

usbd_desc_t * get_device_serial_string ( void )

get serial descriptor

Parameters
none
Return values
usbd_desc

Definition at line 510 of file cdc_keyboard_desc.c.

◆ get_serial_num()

static void get_serial_num ( void )
static

usb get serial number

Parameters
none
Return values
none

Definition at line 413 of file cdc_keyboard_desc.c.

Referenced by get_device_serial_string().

◆ usbd_int_to_unicode()

static void usbd_int_to_unicode | ( | uint32_t | value,
 |  | uint8_t * | pbuf,
 |  | uint8_t | len
 | ) |  |
static

usb int convert to unicode

Parameters
value | int value
pbus | unicode buffer
len | length
Return values
none

Definition at line 387 of file cdc_keyboard_desc.c.

Referenced by get_serial_num().

◆ usbd_unicode_convert()

uint16_t usbd_unicode_convert | ( | uint8_t * | string,
 |  | uint8_t * | unicode_buf
 | ) |  |

standard usb unicode convert

Parameters
string | source string
unicode_buf | unicode buffer
Return values
length

Definition at line 361 of file cdc_keyboard_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

Variable Documentation

◆ ALIGNED_TAIL

ALIGNED_HEAD uint8_t g_string_serial [ 0x1A ] ALIGNED_TAIL
Initial value:
=
{
USB_DEVICE_DESC_LEN,
USB_DESCIPTOR_TYPE_DEVICE,
0x00,
0x02,
0xEF,
0x02,
0x01,
USB_MAX_EP0_SIZE,
LBYTE( 0x2E3C ),
HBYTE( 0x2E3C ),
LBYTE( 0x5750 ),
HBYTE( 0x5750 ),
0x00,
0x02,
USB_MFC_STRING,
USB_PRODUCT_STRING,
USB_SERIAL_STRING,
1
}
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92

usb device standard descriptor

usb string serial

usb string lang id

usb hid keyboard report descriptor

usb hid descriptor

usb configuration standard descriptor

Definition at line 82 of file cdc_keyboard_desc.c.

◆ cdc_keyboard_desc_handler

usbd_desc_handler cdc_keyboard_desc_handler
Initial value:
=
{
get_device_descriptor,
get_device_qualifier,
get_device_configuration,
get_device_other_speed,
get_device_lang_id,
get_device_manufacturer_string,
get_device_product_string,
get_device_serial_string,
get_device_interface_string,
get_device_config_string,
}
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: cdc_keyboard_desc.c:486
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: cdc_keyboard_desc.c:445
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: cdc_keyboard_desc.c:521
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: cdc_keyboard_desc.c:465
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: cdc_keyboard_desc.c:455
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: cdc_keyboard_desc.c:498
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: cdc_keyboard_desc.c:475
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: cdc_keyboard_desc.c:435
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: cdc_keyboard_desc.c:510
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: cdc_keyboard_desc.c:533

device descriptor handler structure

Definition at line 62 of file cdc_keyboard_desc.c.

Referenced by main().

◆ config_descriptor

usbd_desc_t config_descriptor
Initial value:
=
{
108 ,
g_usbd_configuration
}
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112

Definition at line 333 of file cdc_keyboard_desc.c.

Referenced by get_device_configuration().

◆ device_descriptor

usbd_desc_t device_descriptor
Initial value:
=
{
USB_DEVICE_DESC_LEN,
g_usbd_descriptor
}
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]

Definition at line 326 of file cdc_keyboard_desc.c.

Referenced by get_device_descriptor().

◆ g_usbd_desc_buffer

uint8_t g_usbd_desc_buffer[256]
static

Definition at line 57 of file cdc_keyboard_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

◆ langid_descriptor

usbd_desc_t langid_descriptor
Initial value:
=
{
4 ,
g_string_lang_id
}

Definition at line 340 of file cdc_keyboard_desc.c.

Referenced by get_device_lang_id().

◆ serial_descriptor

usbd_desc_t serial_descriptor
Initial value:
=
{
0x1A ,
g_string_serial
}

Definition at line 347 of file cdc_keyboard_desc.c.

Referenced by get_device_serial_string().

◆ vp_desc

usbd_desc_t vp_desc

Definition at line 353 of file cdc_keyboard_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().


AT32F415 Firmwary Library: USB_cdc_keyboard_desc_definition

Macros
USB_cdc_keyboard_desc_definition
AT32F415_middlewares_usbd_class » USB_cdc_keyboard_desc

Macros

#define | BCD_NUM 0x0110
usb bcd number define More...
#define | USBD_VENDOR_ID 0x2E3C
usb vendor id and product id define More...
#define | USBD_PRODUCT_ID 0x5750
#define | HID_BCD_NUM 0x0110
usb bcd number define More...
#define | HID_CLASS_DESC_HID 0x21
usb hid class descriptor define More...
#define | HID_CLASS_DESC_REPORT 0x22
#define | HID_CLASS_DESC_PHYSICAL 0x23
#define | USBD_CONFIG_DESC_SIZE 108
usb descriptor size define More...
#define | USBD_HID_SIZ_REPORT_DESC 63
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
usb string define(vendor, product configuration, interface) More...
#define | USBD_DESC_PRODUCT_STRING "AT32 Composite VCP and Keyboard"
#define | USBD_DESC_CONFIGURATION_STRING "Composite VCP and Keyboard Config"
#define | USBD_DESC_INTERFACE_STRING "Composite VCP and Keyboard Interface"
#define | HID_BINTERVAL_TIME 0x0A
usb endpoint interval define More...
#define | USBD_CDC_CS_INTERFACE 0x24
usb cdc class descriptor define More...
#define | USBD_CDC_CS_ENDPOINT 0x25
#define | USBD_CDC_SUBTYPE_HEADER 0x00
usb cdc class sub-type define More...
#define | USBD_CDC_SUBTYPE_CMF 0x01
#define | USBD_CDC_SUBTYPE_ACM 0x02
#define | USBD_CDC_SUBTYPE_UFD 0x06
#define | CDC_INTERFACE 0x00
usb interface define More...
#define | CDC_DATA_INTERFACE 0x01
#define | HID_KEYBOARD_INTERFACE 0x02
#define | MCU_ID1 (0x1FFFF7E8)
usb mcu id address deine More...
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Detailed Description

Macro Definition Documentation

◆ BCD_NUM

#define BCD_NUM 0x0110

usb bcd number define

Definition at line 53 of file cdc_keyboard_desc.h.

◆ CDC_DATA_INTERFACE

#define CDC_DATA_INTERFACE 0x01

Definition at line 112 of file cdc_keyboard_desc.h.

◆ CDC_INTERFACE

#define CDC_INTERFACE 0x00

usb interface define

Definition at line 111 of file cdc_keyboard_desc.h.

◆ HID_BCD_NUM

#define HID_BCD_NUM 0x0110

usb bcd number define

Definition at line 64 of file cdc_keyboard_desc.h.

◆ HID_BINTERVAL_TIME

#define HID_BINTERVAL_TIME 0x0A

usb endpoint interval define

Definition at line 92 of file cdc_keyboard_desc.h.

◆ HID_CLASS_DESC_HID

#define HID_CLASS_DESC_HID 0x21

usb hid class descriptor define

Definition at line 69 of file cdc_keyboard_desc.h.

◆ HID_CLASS_DESC_PHYSICAL

#define HID_CLASS_DESC_PHYSICAL 0x23

Definition at line 71 of file cdc_keyboard_desc.h.

◆ HID_CLASS_DESC_REPORT

#define HID_CLASS_DESC_REPORT 0x22

Definition at line 70 of file cdc_keyboard_desc.h.

◆ HID_KEYBOARD_INTERFACE

#define HID_KEYBOARD_INTERFACE 0x02

Definition at line 113 of file cdc_keyboard_desc.h.

◆ MCU_ID1

#define MCU_ID1 (0x1FFFF7E8)

usb mcu id address deine

Definition at line 118 of file cdc_keyboard_desc.h.

◆ MCU_ID2

#define MCU_ID2 (0x1FFFF7EC)

Definition at line 119 of file cdc_keyboard_desc.h.

◆ MCU_ID3

#define MCU_ID3 (0x1FFFF7F0)

Definition at line 120 of file cdc_keyboard_desc.h.

◆ USBD_CDC_CS_ENDPOINT

#define USBD_CDC_CS_ENDPOINT 0x25

Definition at line 98 of file cdc_keyboard_desc.h.

◆ USBD_CDC_CS_INTERFACE

#define USBD_CDC_CS_INTERFACE 0x24

usb cdc class descriptor define

Definition at line 97 of file cdc_keyboard_desc.h.

◆ USBD_CDC_SUBTYPE_ACM

#define USBD_CDC_SUBTYPE_ACM 0x02

Definition at line 105 of file cdc_keyboard_desc.h.

◆ USBD_CDC_SUBTYPE_CMF

#define USBD_CDC_SUBTYPE_CMF 0x01

Definition at line 104 of file cdc_keyboard_desc.h.

◆ USBD_CDC_SUBTYPE_HEADER

#define USBD_CDC_SUBTYPE_HEADER 0x00

usb cdc class sub-type define

Definition at line 103 of file cdc_keyboard_desc.h.

◆ USBD_CDC_SUBTYPE_UFD

#define USBD_CDC_SUBTYPE_UFD 0x06

Definition at line 106 of file cdc_keyboard_desc.h.

◆ USBD_CONFIG_DESC_SIZE

#define USBD_CONFIG_DESC_SIZE 108

usb descriptor size define

Definition at line 76 of file cdc_keyboard_desc.h.

◆ USBD_DESC_CONFIGURATION_STRING

#define USBD_DESC_CONFIGURATION_STRING "Composite VCP and Keyboard Config"

Definition at line 86 of file cdc_keyboard_desc.h.

◆ USBD_DESC_INTERFACE_STRING

#define USBD_DESC_INTERFACE_STRING "Composite VCP and Keyboard Interface"

Definition at line 87 of file cdc_keyboard_desc.h.

◆ USBD_DESC_MANUFACTURER_STRING

#define USBD_DESC_MANUFACTURER_STRING "Artery"

usb string define(vendor, product configuration, interface)

Definition at line 84 of file cdc_keyboard_desc.h.

◆ USBD_DESC_PRODUCT_STRING

#define USBD_DESC_PRODUCT_STRING "AT32 Composite VCP and Keyboard"

Definition at line 85 of file cdc_keyboard_desc.h.

◆ USBD_HID_SIZ_REPORT_DESC

#define USBD_HID_SIZ_REPORT_DESC 63

Definition at line 77 of file cdc_keyboard_desc.h.

◆ USBD_PRODUCT_ID

#define USBD_PRODUCT_ID 0x5750

Definition at line 59 of file cdc_keyboard_desc.h.

◆ USBD_SIZ_STRING_LANGID

#define USBD_SIZ_STRING_LANGID 4

Definition at line 78 of file cdc_keyboard_desc.h.

◆ USBD_SIZ_STRING_SERIAL

#define USBD_SIZ_STRING_SERIAL 0x1A

Definition at line 79 of file cdc_keyboard_desc.h.

◆ USBD_VENDOR_ID

#define USBD_VENDOR_ID 0x2E3C

usb vendor id and product id define

Definition at line 58 of file cdc_keyboard_desc.h.


AT32F415 Firmwary Library: USB_custom_hid_class

Modules
USB_custom_hid_class
AT32F415_middlewares_usbd_class

usb device custom hid demo More...

Modules

USB_custom_hid_class_private_functions
USB_custom_hid_class_endpoint_definition
USB_custom_hid_class_request_code_definition
USB_custom_hid_class_exported_functions

Detailed Description

usb device custom hid demo


AT32F415 Firmwary Library: USB_custom_hid_class_private_functions

Functions | Variables
USB_custom_hid_class_private_functions
AT32F415_middlewares_usbd_class » USB_custom_hid_class

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb custom hid endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device event handler More...
void | usb_hid_buf_process (void *udev, uint8_t *report, uint16_t len)
usb device report function More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...

Variables

static uint8_t | g_rxhid_buff [0x40]
static uint8_t | g_txhid_buff [0x40]
static uint32_t | hid_protocol = 0
static uint32_t | hid_set_idle = 0
static uint32_t | alt_setting = 0
static uint8_t | hid_state
uint8_t | hid_set_report [64]
usbd_class_handler | custom_hid_class_handler

Detailed Description

Function Documentation

◆ class_clear_handler()

usb_sts_type class_clear_handler ( void * udev )

clear endpoint or other state

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 106 of file custom_hid_class.c.

◆ class_ept0_rx_handler()

usb_sts_type class_ept0_rx_handler ( void * udev )

usb device endpoint 0 out status stage complete

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 213 of file custom_hid_class.c.

◆ class_ept0_tx_handler()

usb_sts_type class_ept0_tx_handler ( void * udev )

usb device endpoint 0 in status stage complete

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 199 of file custom_hid_class.c.

◆ class_event_handler()

usb_sts_type class_event_handler | ( | void * | udev,
 |  | usbd_event_type | event
 | ) |  |

usb device event handler

Parameters
udev | to the structure of usbd_core_type
event | usb device event
Return values
status of usb_sts_type

Definition at line 289 of file custom_hid_class.c.

◆ class_in_handler()

usb_sts_type class_in_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device transmision complete handler

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 235 of file custom_hid_class.c.

◆ class_init_handler()

usb_sts_type class_init_handler ( void * udev )

initialize usb custom hid endpoint

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 84 of file custom_hid_class.c.

◆ class_out_handler()

usb_sts_type class_out_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device endpoint receive data

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 252 of file custom_hid_class.c.

◆ class_send_report()

usb_sts_type class_send_report | ( | void * | udev,
 |  | uint8_t * | report,
 |  | uint16_t | len
 | ) |  |

usb device class send report

Parameters
udev | to the structure of usbd_core_type
report | report buffer
len | report length
Return values
status of usb_sts_type

Definition at line 321 of file custom_hid_class.c.

◆ class_setup_handler()

usb_sts_type class_setup_handler | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb device class setup request handler

Parameters
udev | to the structure of usbd_core_type
setup | setup packet
Return values
status of usb_sts_type

Definition at line 126 of file custom_hid_class.c.

◆ class_sof_handler()

usb_sts_type class_sof_handler ( void * udev )

usb device sof handler

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 274 of file custom_hid_class.c.

◆ usb_hid_buf_process()

void usb_hid_buf_process | ( | void * | udev,
 |  | uint8_t * | report,
 |  | uint16_t | len
 | ) |  |

usb device report function

Parameters
udev | to the structure of usbd_core_type
report | report buffer
len | report length
Return values
none

Definition at line 339 of file custom_hid_class.c.

Referenced by class_ept0_rx_handler(), and class_out_handler().

Variable Documentation

◆ alt_setting

uint32_t alt_setting = 0
static

Definition at line 61 of file custom_hid_class.c.

Referenced by class_setup_handler().

◆ custom_hid_class_handler

usbd_class_handler custom_hid_class_handler
Initial value:
=
{
class_init_handler,
class_clear_handler,
class_setup_handler,
class_ept0_tx_handler,
class_ept0_rx_handler,
class_in_handler,
class_out_handler,
class_sof_handler,
class_event_handler,
}
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: custom_hid_class.c:289
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: custom_hid_class.c:274
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: custom_hid_class.c:126
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: custom_hid_class.c:199
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: custom_hid_class.c:235
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb custom hid endpoint
Definition: custom_hid_class.c:84
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: custom_hid_class.c:213
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: custom_hid_class.c:252
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: custom_hid_class.c:106

Definition at line 66 of file custom_hid_class.c.

Referenced by main().

◆ g_rxhid_buff

uint8_t g_rxhid_buff[0x40]
static

Definition at line 55 of file custom_hid_class.c.

Referenced by class_init_handler(), class_out_handler(), and usb_hid_buf_process().

◆ g_txhid_buff

uint8_t g_txhid_buff[0x40]
static

Definition at line 56 of file custom_hid_class.c.

Referenced by usb_hid_buf_process().

◆ hid_protocol

uint32_t hid_protocol = 0
static

Definition at line 59 of file custom_hid_class.c.

Referenced by class_setup_handler().

◆ hid_set_idle

uint32_t hid_set_idle = 0
static

Definition at line 60 of file custom_hid_class.c.

Referenced by class_setup_handler().

◆ hid_set_report

uint8_t hid_set_report[64]

Definition at line 63 of file custom_hid_class.c.

Referenced by class_ept0_rx_handler(), and class_setup_handler().

◆ hid_state

uint8_t hid_state
static

Definition at line 62 of file custom_hid_class.c.

Referenced by class_ept0_rx_handler(), and class_setup_handler().


AT32F415 Firmwary Library: USB_custom_hid_class_endpoint_definition

Macros
USB_custom_hid_class_endpoint_definition
AT32F415_middlewares_usbd_class » USB_custom_hid_class

Macros

#define | USBD_HID_IN_EPT 0x81
usb custom hid use endpoint define More...
#define | USBD_HID_OUT_EPT 0x01
#define | USBD_IN_MAXPACKET_SIZE 0x40
usb custom hid in and out max packet size define More...
#define | USBD_OUT_MAXPACKET_SIZE 0x40

Detailed Description

Macro Definition Documentation

◆ USBD_HID_IN_EPT

#define USBD_HID_IN_EPT 0x81

usb custom hid use endpoint define

Definition at line 53 of file custom_hid_class.h.

◆ USBD_HID_OUT_EPT

#define USBD_HID_OUT_EPT 0x01

Definition at line 54 of file custom_hid_class.h.

◆ USBD_IN_MAXPACKET_SIZE

#define USBD_IN_MAXPACKET_SIZE 0x40

usb custom hid in and out max packet size define

Definition at line 59 of file custom_hid_class.h.

◆ USBD_OUT_MAXPACKET_SIZE

#define USBD_OUT_MAXPACKET_SIZE 0x40

Definition at line 60 of file custom_hid_class.h.


AT32F415 Firmwary Library: USB_custom_hid_class_request_code_definition

Macros
USB_custom_hid_class_request_code_definition
AT32F415_middlewares_usbd_class » USB_custom_hid_class

Macros

#define | HID_REQ_SET_PROTOCOL 0x0B
usb custom hid class request code define More...
#define | HID_REQ_GET_PROTOCOL 0x03
#define | HID_REQ_SET_IDLE 0x0A
#define | HID_REQ_GET_IDLE 0x02
#define | HID_REQ_SET_REPORT 0x09
#define | HID_REQ_GET_REPORT 0x01
#define | HID_DESCRIPTOR_TYPE 0x21
#define | HID_REPORT_DESC 0x22

Detailed Description

Macro Definition Documentation

◆ HID_DESCRIPTOR_TYPE

#define HID_DESCRIPTOR_TYPE 0x21

Definition at line 79 of file custom_hid_class.h.

◆ HID_REPORT_DESC

#define HID_REPORT_DESC 0x22

Definition at line 80 of file custom_hid_class.h.

◆ HID_REQ_GET_IDLE

#define HID_REQ_GET_IDLE 0x02

Definition at line 76 of file custom_hid_class.h.

◆ HID_REQ_GET_PROTOCOL

#define HID_REQ_GET_PROTOCOL 0x03

Definition at line 74 of file custom_hid_class.h.

◆ HID_REQ_GET_REPORT

#define HID_REQ_GET_REPORT 0x01

Definition at line 78 of file custom_hid_class.h.

◆ HID_REQ_SET_IDLE

#define HID_REQ_SET_IDLE 0x0A

Definition at line 75 of file custom_hid_class.h.

◆ HID_REQ_SET_PROTOCOL

#define HID_REQ_SET_PROTOCOL 0x0B

usb custom hid class request code define

Definition at line 73 of file custom_hid_class.h.

◆ HID_REQ_SET_REPORT

#define HID_REQ_SET_REPORT 0x09

Definition at line 77 of file custom_hid_class.h.


AT32F415 Firmwary Library: USB_custom_hid_class_exported_functions

Functions | Variables
USB_custom_hid_class_exported_functions
AT32F415_middlewares_usbd_class » USB_custom_hid_class

Functions

usb_sts_type class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...

Variables

usbd_class_handler custom_hid_class_handler

Detailed Description

Function Documentation

◆ class_send_report()

usb_sts_type class_send_report | ( | void * | udev,
 |  | uint8_t * | report,
 |  | uint16_t | len
 | ) |  |

usb device class send report

Parameters
udev | to the structure of usbd_core_type
report | report buffer
len | report length
Return values
status of usb_sts_type

Definition at line 818 of file audio_hid_class.c.

Variable Documentation

◆ custom_hid_class_handler

usbd_class_handler custom_hid_class_handler
extern

Definition at line 66 of file custom_hid_class.c.

Referenced by main().


AT32F415 Firmwary Library: USB_custom_hid_desc

Modules | Variables
USB_custom_hid_desc
AT32F415_middlewares_usbd_class

usb device custom_hid descriptor More...

Modules

USB_custom_hid_desc_private_functions
USB_custom_hid_desc_definition

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [41]
uint8_t | g_usbd_hid_report [126]
uint8_t | g_hid_usb_desc [9]
usbd_desc_handler | hid_desc_handler
custom hid device descriptor handler structure More...

Detailed Description

usb device custom_hid descriptor

Variable Documentation

◆ g_hid_usb_desc

uint8_t g_hid_usb_desc[9]
extern

◆ g_usbd_configuration

uint8_t g_usbd_configuration[41]
extern

◆ g_usbd_descriptor

uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
extern

◆ g_usbd_hid_report

uint8_t g_usbd_hid_report[126]
extern

◆ hid_desc_handler

usbd_desc_handler hid_desc_handler
extern

custom hid device descriptor handler structure

Definition at line 63 of file custom_hid_desc.c.

Referenced by main().


AT32F415 Firmwary Library: USB_custom_hid_desc_private_functions

Functions | Variables
USB_custom_hid_desc_private_functions
AT32F415_middlewares_usbd_class » USB_custom_hid_desc

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | hid_desc_handler
custom hid device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

Function Documentation

◆ get_device_config_string()

usbd_desc_t * get_device_config_string ( void )

get device config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 514 of file custom_hid_desc.c.

◆ get_device_configuration()

usbd_desc_t * get_device_configuration ( void )

get config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 436 of file custom_hid_desc.c.

◆ get_device_descriptor()

usbd_desc_t * get_device_descriptor ( void )

get device descriptor

Parameters
none
Return values
usbd_desc

Definition at line 416 of file custom_hid_desc.c.

◆ get_device_interface_string()

usbd_desc_t * get_device_interface_string ( void )

get interface descriptor

Parameters
none
Return values
usbd_desc

Definition at line 502 of file custom_hid_desc.c.

◆ get_device_lang_id()

usbd_desc_t * get_device_lang_id ( void )

get lang id descriptor

Parameters
none
Return values
usbd_desc

Definition at line 456 of file custom_hid_desc.c.

◆ get_device_manufacturer_string()

usbd_desc_t * get_device_manufacturer_string ( void )

get manufacturer descriptor

Parameters
none
Return values
usbd_desc

Definition at line 467 of file custom_hid_desc.c.

◆ get_device_other_speed()

usbd_desc_t * get_device_other_speed ( void )

get other speed descriptor

Parameters
none
Return values
usbd_desc

Definition at line 446 of file custom_hid_desc.c.

◆ get_device_product_string()

usbd_desc_t * get_device_product_string ( void )

get product descriptor

Parameters
none
Return values
usbd_desc

Definition at line 479 of file custom_hid_desc.c.

◆ get_device_qualifier()

usbd_desc_t * get_device_qualifier ( void )

get device qualifier

Parameters
none
Return values
usbd_desc

Definition at line 426 of file custom_hid_desc.c.

◆ get_device_serial_string()

usbd_desc_t * get_device_serial_string ( void )

get serial descriptor

Parameters
none
Return values
usbd_desc

Definition at line 491 of file custom_hid_desc.c.

◆ get_serial_num()

static void get_serial_num ( void )
static

usb get serial number

Parameters
none
Return values
none

Definition at line 394 of file custom_hid_desc.c.

Referenced by get_device_serial_string().

◆ usbd_int_to_unicode()

static void usbd_int_to_unicode | ( | uint32_t | value,
 |  | uint8_t * | pbuf,
 |  | uint8_t | len
 | ) |  |
static

usb int convert to unicode

Parameters
value | int value
pbus | unicode buffer
len | length
Return values
none

Definition at line 368 of file custom_hid_desc.c.

Referenced by get_serial_num().

◆ usbd_unicode_convert()

uint16_t usbd_unicode_convert | ( | uint8_t * | string,
 |  | uint8_t * | unicode_buf
 | ) |  |

standard usb unicode convert

Parameters
string | source string
unicode_buf | unicode buffer
Return values
length

Definition at line 342 of file custom_hid_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

Variable Documentation

◆ ALIGNED_TAIL

ALIGNED_HEAD uint8_t g_string_serial [ 0x1A ] ALIGNED_TAIL
Initial value:
=
{
USB_DEVICE_DESC_LEN,
USB_DESCIPTOR_TYPE_DEVICE,
0x00,
0x02,
0x00,
0x00,
0x00,
USB_MAX_EP0_SIZE,
LBYTE( 0x2E3C ),
HBYTE( 0x2E3C ),
LBYTE( 0x5745 ),
HBYTE( 0x5745 ),
0x00,
0x02,
USB_MFC_STRING,
USB_PRODUCT_STRING,
USB_SERIAL_STRING,
1
}
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92

usb device standard descriptor

usb string serial

usb string lang id

usb hid descriptor

usb hid report descriptor

usb configuration standard descriptor

Definition at line 83 of file custom_hid_desc.c.

◆ config_descriptor

usbd_desc_t config_descriptor
Initial value:
=
{
41 ,
g_usbd_configuration
}
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112

Definition at line 314 of file custom_hid_desc.c.

Referenced by get_device_configuration().

◆ device_descriptor

usbd_desc_t device_descriptor
Initial value:
=
{
USB_DEVICE_DESC_LEN,
g_usbd_descriptor
}
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]

Definition at line 307 of file custom_hid_desc.c.

Referenced by get_device_descriptor().

◆ g_usbd_desc_buffer

uint8_t g_usbd_desc_buffer[256]
static

Definition at line 58 of file custom_hid_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

◆ hid_desc_handler

usbd_desc_handler hid_desc_handler
Initial value:
=
{
get_device_descriptor,
get_device_qualifier,
get_device_configuration,
get_device_other_speed,
get_device_lang_id,
get_device_manufacturer_string,
get_device_product_string,
get_device_serial_string,
get_device_interface_string,
get_device_config_string,
}
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: custom_hid_desc.c:467
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: custom_hid_desc.c:426
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: custom_hid_desc.c:502
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: custom_hid_desc.c:446
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: custom_hid_desc.c:436
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: custom_hid_desc.c:479
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: custom_hid_desc.c:456
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: custom_hid_desc.c:416
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: custom_hid_desc.c:491
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: custom_hid_desc.c:514

custom hid device descriptor handler structure

Definition at line 63 of file custom_hid_desc.c.

Referenced by main().

◆ langid_descriptor

usbd_desc_t langid_descriptor
Initial value:
=
{
4 ,
g_string_lang_id
}

Definition at line 321 of file custom_hid_desc.c.

Referenced by get_device_lang_id().

◆ serial_descriptor

usbd_desc_t serial_descriptor
Initial value:
=
{
0x1A ,
g_string_serial
}

Definition at line 328 of file custom_hid_desc.c.

Referenced by get_device_serial_string().

◆ vp_desc

usbd_desc_t vp_desc

Definition at line 334 of file custom_hid_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().


AT32F415 Firmwary Library: USB_custom_hid_desc_definition

Macros
USB_custom_hid_desc_definition
AT32F415_middlewares_usbd_class » USB_custom_hid_desc

Macros

#define | HID_BCD_NUM 0x0110
usb bcd number define More...
#define | HID_CLASS_DESC_HID 0x21
usb hid class descriptor define More...
#define | HID_CLASS_DESC_REPORT 0x22
#define | HID_CLASS_DESC_PHYSICAL 0x23
#define | USBD_VENDOR_ID 0x2E3C
usb vendor id and product id define More...
#define | USBD_PRODUCT_ID 0x5745
#define | USBD_CONFIG_DESC_SIZE 41
usb descriptor size define More...
#define | USBD_HID_SIZ_REPORT_DESC 126
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
usb string define(vendor, product configuration, interface) More...
#define | USBD_DESC_PRODUCT_STRING "Custom HID"
#define | USBD_DESC_CONFIGURATION_STRING "Custom HID Config"
#define | USBD_DESC_INTERFACE_STRING "Custom HID Interface"
#define | HID_BINTERVAL_TIME 0x0A
usb hid endpoint interval define More...
#define | HID_REPORT_ID_1 0x01
usb hid report id define More...
#define | HID_REPORT_ID_2 0x02
#define | HID_REPORT_ID_3 0x03
#define | HID_REPORT_ID_4 0x04
#define | HID_REPORT_ID_5 0x05
#define | HID_REPORT_ID_6 0xF0
#define | MCU_ID1 (0x1FFFF7E8)
usb mcu id address deine More...
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Detailed Description

Macro Definition Documentation

◆ HID_BCD_NUM

#define HID_BCD_NUM 0x0110

usb bcd number define

Definition at line 53 of file custom_hid_desc.h.

◆ HID_BINTERVAL_TIME

#define HID_BINTERVAL_TIME 0x0A

usb hid endpoint interval define

Definition at line 87 of file custom_hid_desc.h.

◆ HID_CLASS_DESC_HID

#define HID_CLASS_DESC_HID 0x21

usb hid class descriptor define

Definition at line 58 of file custom_hid_desc.h.

◆ HID_CLASS_DESC_PHYSICAL

#define HID_CLASS_DESC_PHYSICAL 0x23

Definition at line 60 of file custom_hid_desc.h.

◆ HID_CLASS_DESC_REPORT

#define HID_CLASS_DESC_REPORT 0x22

Definition at line 59 of file custom_hid_desc.h.

◆ HID_REPORT_ID_1

#define HID_REPORT_ID_1 0x01

usb hid report id define

Definition at line 92 of file custom_hid_desc.h.

◆ HID_REPORT_ID_2

#define HID_REPORT_ID_2 0x02

Definition at line 93 of file custom_hid_desc.h.

◆ HID_REPORT_ID_3

#define HID_REPORT_ID_3 0x03

Definition at line 94 of file custom_hid_desc.h.

◆ HID_REPORT_ID_4

#define HID_REPORT_ID_4 0x04

Definition at line 95 of file custom_hid_desc.h.

◆ HID_REPORT_ID_5

#define HID_REPORT_ID_5 0x05

Definition at line 96 of file custom_hid_desc.h.

◆ HID_REPORT_ID_6

#define HID_REPORT_ID_6 0xF0

Definition at line 97 of file custom_hid_desc.h.

◆ MCU_ID1

#define MCU_ID1 (0x1FFFF7E8)

usb mcu id address deine

Definition at line 102 of file custom_hid_desc.h.

◆ MCU_ID2

#define MCU_ID2 (0x1FFFF7EC)

Definition at line 103 of file custom_hid_desc.h.

◆ MCU_ID3

#define MCU_ID3 (0x1FFFF7F0)

Definition at line 104 of file custom_hid_desc.h.

◆ USBD_CONFIG_DESC_SIZE

#define USBD_CONFIG_DESC_SIZE 41

usb descriptor size define

Definition at line 71 of file custom_hid_desc.h.

◆ USBD_DESC_CONFIGURATION_STRING

#define USBD_DESC_CONFIGURATION_STRING "Custom HID Config"

Definition at line 81 of file custom_hid_desc.h.

◆ USBD_DESC_INTERFACE_STRING

#define USBD_DESC_INTERFACE_STRING "Custom HID Interface"

Definition at line 82 of file custom_hid_desc.h.

◆ USBD_DESC_MANUFACTURER_STRING

#define USBD_DESC_MANUFACTURER_STRING "Artery"

usb string define(vendor, product configuration, interface)

Definition at line 79 of file custom_hid_desc.h.

◆ USBD_DESC_PRODUCT_STRING

#define USBD_DESC_PRODUCT_STRING "Custom HID"

Definition at line 80 of file custom_hid_desc.h.

◆ USBD_HID_SIZ_REPORT_DESC

#define USBD_HID_SIZ_REPORT_DESC 126

Definition at line 72 of file custom_hid_desc.h.

◆ USBD_PRODUCT_ID

#define USBD_PRODUCT_ID 0x5745

Definition at line 66 of file custom_hid_desc.h.

◆ USBD_SIZ_STRING_LANGID

#define USBD_SIZ_STRING_LANGID 4

Definition at line 73 of file custom_hid_desc.h.

◆ USBD_SIZ_STRING_SERIAL

#define USBD_SIZ_STRING_SERIAL 0x1A

Definition at line 74 of file custom_hid_desc.h.

◆ USBD_VENDOR_ID

#define USBD_VENDOR_ID 0x2E3C

usb vendor id and product id define

Definition at line 65 of file custom_hid_desc.h.


AT32F415 Firmwary Library: USB_hid_iap_class

Modules
USB_hid_iap_class
AT32F415_middlewares_usbd_class

usb device class hid iap demo More...

Modules

USB_hid_iap_class_private_functions
USB_hid_iap_class_definition

Detailed Description

usb device class hid iap demo


AT32F415 Firmwary Library: USB_hid_iap_class_private_functions

Functions | Variables
USB_hid_iap_class_private_functions
AT32F415_middlewares_usbd_class » USB_hid_iap_class

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb custom hid endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device event handler More...
void | usb_hid_buf_process (void *udev, uint8_t *report, uint16_t len)
usb device report function More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...

Variables

static uint8_t | g_rxhid_buff [0x40]
static uint32_t | hid_protocol = 0
static uint32_t | hid_set_idle = 0
static uint32_t | alt_setting = 0
static uint8_t | hid_state
uint8_t | hid_set_report [64]
iap_info_type iap_info
usbd_class_handler | hid_iap_class_handler

Detailed Description

Function Documentation

◆ class_clear_handler()

usb_sts_type class_clear_handler ( void * udev )

clear endpoint or other state

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 108 of file hid_iap_class.c.

◆ class_ept0_rx_handler()

usb_sts_type class_ept0_rx_handler ( void * udev )

usb device endpoint 0 out status stage complete

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 215 of file hid_iap_class.c.

◆ class_ept0_tx_handler()

usb_sts_type class_ept0_tx_handler ( void * udev )

usb device endpoint 0 in status stage complete

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 201 of file hid_iap_class.c.

◆ class_event_handler()

usb_sts_type class_event_handler | ( | void * | udev,
 |  | usbd_event_type | event
 | ) |  |

usb device event handler

Parameters
udev | to the structure of usbd_core_type
event | usb device event
Return values
status of usb_sts_type

Definition at line 291 of file hid_iap_class.c.

◆ class_in_handler()

usb_sts_type class_in_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device transmision complete handler

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 236 of file hid_iap_class.c.

◆ class_init_handler()

usb_sts_type class_init_handler ( void * udev )

initialize usb custom hid endpoint

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 86 of file hid_iap_class.c.

◆ class_out_handler()

usb_sts_type class_out_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device endpoint receive data

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 254 of file hid_iap_class.c.

◆ class_send_report()

usb_sts_type class_send_report | ( | void * | udev,
 |  | uint8_t * | report,
 |  | uint16_t | len
 | ) |  |

usb device class send report

Parameters
udev | to the structure of usbd_core_type
report | report buffer
len | report length
Return values
status of usb_sts_type

Definition at line 323 of file hid_iap_class.c.

◆ class_setup_handler()

usb_sts_type class_setup_handler | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb device class setup request handler

Parameters
udev | to the structure of usbd_core_type
setup | setup packet
Return values
status of usb_sts_type

Definition at line 128 of file hid_iap_class.c.

◆ class_sof_handler()

usb_sts_type class_sof_handler ( void * udev )

usb device sof handler

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 276 of file hid_iap_class.c.

◆ usb_hid_buf_process()

void usb_hid_buf_process | ( | void * | udev,
 |  | uint8_t * | report,
 |  | uint16_t | len
 | ) |  |

usb device report function

Parameters
udev | to the structure of usbd_core_type
report | report buffer
len | report length
Return values
none

Definition at line 837 of file audio_hid_class.c.

Referenced by class_ept0_rx_handler(), and class_out_handler().

Variable Documentation

◆ alt_setting

uint32_t alt_setting = 0
static

Definition at line 61 of file hid_iap_class.c.

Referenced by class_setup_handler().

◆ g_rxhid_buff

uint8_t g_rxhid_buff[0x40]
static

Definition at line 56 of file hid_iap_class.c.

Referenced by class_init_handler(), and class_out_handler().

◆ hid_iap_class_handler

usbd_class_handler hid_iap_class_handler
Initial value:
=
{
class_init_handler,
class_clear_handler,
class_setup_handler,
class_ept0_tx_handler,
class_ept0_rx_handler,
class_in_handler,
class_out_handler,
class_sof_handler,
class_event_handler,
}
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: hid_iap_class.c:291
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: hid_iap_class.c:276
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: hid_iap_class.c:128
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: hid_iap_class.c:201
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: hid_iap_class.c:236
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb custom hid endpoint
Definition: hid_iap_class.c:86
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: hid_iap_class.c:215
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: hid_iap_class.c:254
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: hid_iap_class.c:108

Definition at line 68 of file hid_iap_class.c.

Referenced by main().

◆ hid_protocol

uint32_t hid_protocol = 0
static

Definition at line 59 of file hid_iap_class.c.

Referenced by class_setup_handler().

◆ hid_set_idle

uint32_t hid_set_idle = 0
static

Definition at line 60 of file hid_iap_class.c.

Referenced by class_setup_handler().

◆ hid_set_report

uint8_t hid_set_report[64]

Definition at line 63 of file hid_iap_class.c.

Referenced by class_setup_handler().

◆ hid_state

uint8_t hid_state
static

Definition at line 62 of file hid_iap_class.c.

Referenced by class_ept0_rx_handler(), and class_setup_handler().

◆ iap_info

iap_info_type iap_info

Definition at line 65 of file hid_iap_class.c.

Referenced by app_loop(), iap_address(), iap_clear_upgrade_flag(), iap_crc(), iap_data_write(), iap_erase_sector(), iap_finish(), iap_get(), iap_get_upgrade_flag(), iap_idle(), iap_init(), iap_jump(), iap_loop(), iap_respond(), iap_set_upgrade_flag(), iap_start(), usbd_hid_iap_in_complete(), and usbd_hid_iap_process().


AT32F415 Firmwary Library: USB_hid_iap_class_definition

Data Structures | Macros | Enumerations | Functions | Variables
USB_hid_iap_class_definition
AT32F415_middlewares_usbd_class » USB_hid_iap_class

Data Structures

struct iap_info_type

Macros

#define | USBD_HID_IN_EPT 0x81
#define | USBD_HID_OUT_EPT 0x01
#define | USBD_IN_MAXPACKET_SIZE 0x40
#define | USBD_OUT_MAXPACKET_SIZE 0x40
#define | HID_REQ_SET_PROTOCOL 0x0B
#define | HID_REQ_GET_PROTOCOL 0x03
#define | HID_REQ_SET_IDLE 0x0A
#define | HID_REQ_GET_IDLE 0x02
#define | HID_REQ_SET_REPORT 0x09
#define | HID_REQ_GET_REPORT 0x01
#define | HID_DESCRIPTOR_TYPE 0x21
#define | HID_REPORT_DESC 0x22
#define | FLASH_SIZE_REG() ((*(uint32_t *)0x1FFFF7E0) & 0xFFFF) /*Get Flash size*/
#define | KB_TO_B(kb) ((kb) << 10)
#define | SECTOR_SIZE_1K 0x400
#define | SECTOR_SIZE_2K 0x800
#define | SECTOR_SIZE_4K 0x1000
#define | IAP_CMD_IDLE 0x5AA0
iap command More...
#define | IAP_CMD_START 0x5AA1
#define | IAP_CMD_ADDR 0x5AA2
#define | IAP_CMD_DATA 0x5AA3
#define | IAP_CMD_FINISH 0x5AA4
#define | IAP_CMD_CRC 0x5AA5
#define | IAP_CMD_JMP 0x5AA6
#define | IAP_CMD_GET 0x5AA7
#define | HID_IAP_BUFFER_LEN 1024
#define | IAP_UPGRADE_COMPLETE_FLAG 0x41544B38
#define | CONVERT_ENDIAN(dwValue)
#define | IAP_ACK 0xFF00
#define | IAP_NACK 0x00FF

Enumerations

enum iap_result_type { IAP_SUCCESS , IAP_WAIT , IAP_FAILED }
enum iap_machine_state_type {
IAP_STS_IDLE , IAP_STS_START , IAP_STS_ADDR , IAP_STS_DATA ,
IAP_STS_FINISH , IAP_STS_CRC , IAP_STS_JMP_WAIT , IAP_STS_JMP
}

Functions

usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...
iap_result_type | usbd_hid_iap_process (void *udev, uint8_t *report, uint16_t len)
usb device iap function More...
void | usbd_hid_iap_in_complete (void *udev)
usb device in transfer complete function More...

Variables

usbd_class_handler hid_iap_class_handler
iap_info_type iap_info

Detailed Description

Macro Definition Documentation

◆ CONVERT_ENDIAN

#define CONVERT_ENDIAN ( dwValue )
Value:
((dwValue >> 24) | ((dwValue >> 8) & 0xFF00) | \
((dwValue << 8) & 0xFF0000) | (dwValue << 24) )

Definition at line 91 of file hid_iap_class.h.

◆ FLASH_SIZE_REG

#define FLASH_SIZE_REG ( ) ((*(uint32_t *)0x1FFFF7E0) & 0xFFFF) /*Get Flash size*/

Definition at line 70 of file hid_iap_class.h.

◆ HID_DESCRIPTOR_TYPE

#define HID_DESCRIPTOR_TYPE 0x21

Definition at line 67 of file hid_iap_class.h.

◆ HID_IAP_BUFFER_LEN

#define HID_IAP_BUFFER_LEN 1024

Definition at line 89 of file hid_iap_class.h.

◆ HID_REPORT_DESC

#define HID_REPORT_DESC 0x22

Definition at line 68 of file hid_iap_class.h.

◆ HID_REQ_GET_IDLE

#define HID_REQ_GET_IDLE 0x02

Definition at line 62 of file hid_iap_class.h.

◆ HID_REQ_GET_PROTOCOL

#define HID_REQ_GET_PROTOCOL 0x03

Definition at line 59 of file hid_iap_class.h.

◆ HID_REQ_GET_REPORT

#define HID_REQ_GET_REPORT 0x01

Definition at line 65 of file hid_iap_class.h.

◆ HID_REQ_SET_IDLE

#define HID_REQ_SET_IDLE 0x0A

Definition at line 61 of file hid_iap_class.h.

◆ HID_REQ_SET_PROTOCOL

#define HID_REQ_SET_PROTOCOL 0x0B

Definition at line 58 of file hid_iap_class.h.

◆ HID_REQ_SET_REPORT

#define HID_REQ_SET_REPORT 0x09

Definition at line 64 of file hid_iap_class.h.

◆ IAP_ACK

#define IAP_ACK 0xFF00

Definition at line 94 of file hid_iap_class.h.

◆ IAP_CMD_ADDR

#define IAP_CMD_ADDR 0x5AA2

Definition at line 82 of file hid_iap_class.h.

◆ IAP_CMD_CRC

#define IAP_CMD_CRC 0x5AA5

Definition at line 85 of file hid_iap_class.h.

◆ IAP_CMD_DATA

#define IAP_CMD_DATA 0x5AA3

Definition at line 83 of file hid_iap_class.h.

◆ IAP_CMD_FINISH

#define IAP_CMD_FINISH 0x5AA4

Definition at line 84 of file hid_iap_class.h.

◆ IAP_CMD_GET

#define IAP_CMD_GET 0x5AA7

Definition at line 87 of file hid_iap_class.h.

◆ IAP_CMD_IDLE

#define IAP_CMD_IDLE 0x5AA0

iap command

Definition at line 80 of file hid_iap_class.h.

◆ IAP_CMD_JMP

#define IAP_CMD_JMP 0x5AA6

Definition at line 86 of file hid_iap_class.h.

◆ IAP_CMD_START

#define IAP_CMD_START 0x5AA1

Definition at line 81 of file hid_iap_class.h.

◆ IAP_NACK

#define IAP_NACK 0x00FF

Definition at line 95 of file hid_iap_class.h.

◆ IAP_UPGRADE_COMPLETE_FLAG

#define IAP_UPGRADE_COMPLETE_FLAG 0x41544B38

Definition at line 90 of file hid_iap_class.h.

◆ KB_TO_B

#define KB_TO_B ( kb ) ((kb) << 10)

Definition at line 71 of file hid_iap_class.h.

◆ SECTOR_SIZE_1K

#define SECTOR_SIZE_1K 0x400

Definition at line 73 of file hid_iap_class.h.

◆ SECTOR_SIZE_2K

#define SECTOR_SIZE_2K 0x800

Definition at line 74 of file hid_iap_class.h.

◆ SECTOR_SIZE_4K

#define SECTOR_SIZE_4K 0x1000

Definition at line 75 of file hid_iap_class.h.

◆ USBD_HID_IN_EPT

#define USBD_HID_IN_EPT 0x81

Definition at line 52 of file hid_iap_class.h.

◆ USBD_HID_OUT_EPT

#define USBD_HID_OUT_EPT 0x01

Definition at line 53 of file hid_iap_class.h.

◆ USBD_IN_MAXPACKET_SIZE

#define USBD_IN_MAXPACKET_SIZE 0x40

Definition at line 55 of file hid_iap_class.h.

◆ USBD_OUT_MAXPACKET_SIZE

#define USBD_OUT_MAXPACKET_SIZE 0x40

Definition at line 56 of file hid_iap_class.h.

Enumeration Type Documentation

◆ iap_machine_state_type

enum iap_machine_state_type
Enumerator
IAP_STS_IDLE
IAP_STS_START
IAP_STS_ADDR
IAP_STS_DATA
IAP_STS_FINISH
IAP_STS_CRC
IAP_STS_JMP_WAIT
IAP_STS_JMP

Definition at line 104 of file hid_iap_class.h.

◆ iap_result_type

enum iap_result_type
Enumerator
IAP_SUCCESS
IAP_WAIT
IAP_FAILED

Definition at line 97 of file hid_iap_class.h.

Function Documentation

◆ class_send_report()

usb_sts_type class_send_report | ( | void * | udev,
 |  | uint8_t * | report,
 |  | uint16_t | len
 | ) |  |

usb device class send report

Parameters
udev | to the structure of usbd_core_type
report | report buffer
len | report length
Return values
status of usb_sts_type

Definition at line 818 of file audio_hid_class.c.

◆ usbd_hid_iap_in_complete()

void usbd_hid_iap_in_complete ( void * udev )

usb device in transfer complete function

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 240 of file app_led3_toggle/src/hid_iap_user.c.

Referenced by class_in_handler().

◆ usbd_hid_iap_process()

iap_result_type usbd_hid_iap_process | ( | void * | udev,
 |  | uint8_t * | pdata,
 |  | uint16_t | len
 | ) |  |

usb device iap function

Parameters
udev | to the structure of usbd_core_type
pdata | data buffer point
len | data length
Return values
iap_result_type

Definition at line 194 of file app_led3_toggle/src/hid_iap_user.c.

Referenced by class_out_handler().

Variable Documentation

◆ hid_iap_class_handler

usbd_class_handler hid_iap_class_handler
extern

Definition at line 68 of file hid_iap_class.c.

Referenced by main().

◆ iap_info

iap_info_type iap_info
extern

Definition at line 65 of file hid_iap_class.c.

Referenced by app_loop(), iap_address(), iap_clear_upgrade_flag(), iap_crc(), iap_data_write(), iap_erase_sector(), iap_finish(), iap_get(), iap_get_upgrade_flag(), iap_idle(), iap_init(), iap_jump(), iap_loop(), iap_respond(), iap_set_upgrade_flag(), iap_start(), usbd_hid_iap_in_complete(), and usbd_hid_iap_process().


AT32F415 Firmwary Library: iap_info_type Struct Reference

Data Fields
iap_info_type Struct Reference
AT32F415_middlewares_usbd_class » USB_hid_iap_class » USB_hid_iap_class_definition

#include <hid_iap_class.h>

Data Fields

uint8_t | iap_fifo [1024]
uint8_t | iap_rx [0x40]
uint8_t | iap_tx [0x40]
uint32_t | fifo_length
uint32_t | tx_length
uint32_t | app_address
uint32_t | iap_address
uint32_t | flag_address
uint32_t | flash_start_address
uint32_t | flash_end_address
uint32_t | sector_size
uint32_t | flash_size
iap_machine_state_type state
uint8_t | respond_flag

Detailed Description

Definition at line 116 of file hid_iap_class.h.

Field Documentation

◆ app_address

uint32_t iap_info_type::app_address

Definition at line 126 of file hid_iap_class.h.

Referenced by iap_get(), iap_init(), and iap_loop().

◆ fifo_length

uint32_t iap_info_type::fifo_length

Definition at line 123 of file hid_iap_class.h.

Referenced by iap_data_write(), and iap_init().

◆ flag_address

uint32_t iap_info_type::flag_address

Definition at line 128 of file hid_iap_class.h.

Referenced by iap_clear_upgrade_flag(), iap_get_upgrade_flag(), iap_init(), and iap_set_upgrade_flag().

◆ flash_end_address

uint32_t iap_info_type::flash_end_address

Definition at line 131 of file hid_iap_class.h.

Referenced by iap_address(), and iap_init().

◆ flash_size

uint32_t iap_info_type::flash_size

Definition at line 134 of file hid_iap_class.h.

Referenced by iap_init().

◆ flash_start_address

uint32_t iap_info_type::flash_start_address

Definition at line 130 of file hid_iap_class.h.

Referenced by iap_init().

◆ iap_address

uint32_t iap_info_type::iap_address

Definition at line 127 of file hid_iap_class.h.

Referenced by iap_address(), iap_data_write(), and iap_init().

◆ iap_fifo

uint8_t iap_info_type::iap_fifo[1024]

Definition at line 119 of file hid_iap_class.h.

Referenced by iap_data_write().

◆ iap_rx

uint8_t iap_info_type::iap_rx[0x40]

Definition at line 120 of file hid_iap_class.h.

◆ iap_tx

uint8_t iap_info_type::iap_tx[0x40]

Definition at line 121 of file hid_iap_class.h.

Referenced by iap_address(), iap_crc(), iap_data_write(), iap_finish(), iap_get(), iap_idle(), iap_jump(), iap_start(), and usbd_hid_iap_process().

◆ respond_flag

uint8_t iap_info_type::respond_flag

Definition at line 137 of file hid_iap_class.h.

Referenced by iap_respond(), and usbd_hid_iap_process().

◆ sector_size

uint32_t iap_info_type::sector_size

Definition at line 133 of file hid_iap_class.h.

Referenced by iap_erase_sector(), and iap_init().

◆ state

iap_machine_state_type iap_info_type::state

Definition at line 136 of file hid_iap_class.h.

Referenced by app_loop(), iap_address(), iap_data_write(), iap_finish(), iap_idle(), iap_jump(), iap_loop(), iap_start(), and usbd_hid_iap_in_complete().

◆ tx_length

uint32_t iap_info_type::tx_length

Definition at line 124 of file hid_iap_class.h.

The documentation for this struct was generated from the following file:
  • hid_iap_class.h


AT32F415 Firmwary Library: USB_hid_iap_desc

Modules
USB_hid_iap_desc
AT32F415_middlewares_usbd_class

usb device hid_iap descriptor More...

Modules

USB_hid_iap_desc_private_functions
USB_hid_iap_desc_definition

Detailed Description

usb device hid_iap descriptor


AT32F415 Firmwary Library: USB_hid_iap_desc_private_functions

Functions | Variables
USB_hid_iap_desc_private_functions
AT32F415_middlewares_usbd_class » USB_hid_iap_desc

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | hid_iap_desc_handler
hid device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

Function Documentation

◆ get_device_config_string()

usbd_desc_t * get_device_config_string ( void )

get device config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 449 of file hid_iap_desc.c.

◆ get_device_configuration()

usbd_desc_t * get_device_configuration ( void )

get config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 371 of file hid_iap_desc.c.

◆ get_device_descriptor()

usbd_desc_t * get_device_descriptor ( void )

get device descriptor

Parameters
none
Return values
usbd_desc

Definition at line 351 of file hid_iap_desc.c.

◆ get_device_interface_string()

usbd_desc_t * get_device_interface_string ( void )

get interface descriptor

Parameters
none
Return values
usbd_desc

Definition at line 437 of file hid_iap_desc.c.

◆ get_device_lang_id()

usbd_desc_t * get_device_lang_id ( void )

get lang id descriptor

Parameters
none
Return values
usbd_desc

Definition at line 391 of file hid_iap_desc.c.

◆ get_device_manufacturer_string()

usbd_desc_t * get_device_manufacturer_string ( void )

get manufacturer descriptor

Parameters
none
Return values
usbd_desc

Definition at line 402 of file hid_iap_desc.c.

◆ get_device_other_speed()

usbd_desc_t * get_device_other_speed ( void )

get other speed descriptor

Parameters
none
Return values
usbd_desc

Definition at line 381 of file hid_iap_desc.c.

◆ get_device_product_string()

usbd_desc_t * get_device_product_string ( void )

get product descriptor

Parameters
none
Return values
usbd_desc

Definition at line 414 of file hid_iap_desc.c.

◆ get_device_qualifier()

usbd_desc_t * get_device_qualifier ( void )

get device qualifier

Parameters
none
Return values
usbd_desc

Definition at line 361 of file hid_iap_desc.c.

◆ get_device_serial_string()

usbd_desc_t * get_device_serial_string ( void )

get serial descriptor

Parameters
none
Return values
usbd_desc

Definition at line 426 of file hid_iap_desc.c.

◆ get_serial_num()

static void get_serial_num ( void )
static

usb get serial number

Parameters
none
Return values
none

Definition at line 329 of file hid_iap_desc.c.

Referenced by get_device_serial_string().

◆ usbd_int_to_unicode()

static void usbd_int_to_unicode | ( | uint32_t | value,
 |  | uint8_t * | pbuf,
 |  | uint8_t | len
 | ) |  |
static

usb int convert to unicode

Parameters
value | int value
pbus | unicode buffer
len | length
Return values
none

Definition at line 303 of file hid_iap_desc.c.

Referenced by get_serial_num().

◆ usbd_unicode_convert()

uint16_t usbd_unicode_convert | ( | uint8_t * | string,
 |  | uint8_t * | unicode_buf
 | ) |  |

standard usb unicode convert

Parameters
string | source string
unicode_buf | unicode buffer
Return values
length

Definition at line 277 of file hid_iap_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

Variable Documentation

◆ ALIGNED_TAIL

ALIGNED_HEAD uint8_t g_string_serial [ 0x1A ] ALIGNED_TAIL
Initial value:
=
{
USB_DEVICE_DESC_LEN,
USB_DESCIPTOR_TYPE_DEVICE,
0x00,
0x02,
0x00,
0x00,
0x00,
USB_MAX_EP0_SIZE,
LBYTE( 0x2E3C ),
HBYTE( 0x2E3C ),
LBYTE( 0xAF01 ),
HBYTE( 0xAF01 ),
0x00,
0x02,
USB_MFC_STRING,
USB_PRODUCT_STRING,
USB_SERIAL_STRING,
1
}
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92

usb device standard descriptor

usb string serial

usb string lang id

usb hid descriptor

usb hid report descriptor

usb configuration standard descriptor

Definition at line 85 of file hid_iap_desc.c.

◆ config_descriptor

usbd_desc_t config_descriptor
Initial value:
=
{
41 ,
g_usbd_configuration
}
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112

Definition at line 249 of file hid_iap_desc.c.

Referenced by get_device_configuration().

◆ device_descriptor

usbd_desc_t device_descriptor
Initial value:
=
{
USB_DEVICE_DESC_LEN,
g_usbd_descriptor
}
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]

Definition at line 242 of file hid_iap_desc.c.

Referenced by get_device_descriptor().

◆ g_usbd_desc_buffer

uint8_t g_usbd_desc_buffer[256]
static

Definition at line 60 of file hid_iap_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

◆ hid_iap_desc_handler

usbd_desc_handler hid_iap_desc_handler
Initial value:
=
{
get_device_descriptor,
get_device_qualifier,
get_device_configuration,
get_device_other_speed,
get_device_lang_id,
get_device_manufacturer_string,
get_device_product_string,
get_device_serial_string,
get_device_interface_string,
get_device_config_string,
}
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: hid_iap_desc.c:402
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: hid_iap_desc.c:361
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: hid_iap_desc.c:437
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: hid_iap_desc.c:381
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: hid_iap_desc.c:371
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: hid_iap_desc.c:414
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: hid_iap_desc.c:391
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: hid_iap_desc.c:351
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: hid_iap_desc.c:426
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: hid_iap_desc.c:449

hid device descriptor handler structure

Definition at line 65 of file hid_iap_desc.c.

Referenced by main().

◆ langid_descriptor

usbd_desc_t langid_descriptor
Initial value:
=
{
4 ,
g_string_lang_id
}

Definition at line 256 of file hid_iap_desc.c.

Referenced by get_device_lang_id().

◆ serial_descriptor

usbd_desc_t serial_descriptor
Initial value:
=
{
0x1A ,
g_string_serial
}

Definition at line 263 of file hid_iap_desc.c.

Referenced by get_device_serial_string().

◆ vp_desc

usbd_desc_t vp_desc

Definition at line 269 of file hid_iap_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().


AT32F415 Firmwary Library: USB_hid_iap_desc_definition

Macros | Variables
USB_hid_iap_desc_definition
AT32F415_middlewares_usbd_class » USB_hid_iap_desc

Macros

#define | HID_BCD_NUM 0x0110
#define | HID_CLASS_DESC_HID 0x21
#define | HID_CLASS_DESC_REPORT 0x22
#define | HID_CLASS_DESC_PHYSICAL 0x23
#define | USBD_VENDOR_ID 0x2E3C
#define | USBD_PRODUCT_ID 0xAF01
#define | USBD_CONFIG_DESC_SIZE 41
#define | USBD_HID_SIZ_REPORT_DESC 32
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
#define | USBD_DESC_PRODUCT_STRING "HID IAP"
#define | USBD_DESC_CONFIGURATION_STRING "HID IAP Config"
#define | USBD_DESC_INTERFACE_STRING "HID IAP Interface"
#define | HID_BINTERVAL_TIME 0x01
#define | MCU_ID1 (0x1FFFF7E8)
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [41]
uint8_t | g_usbd_hid_report [32]
uint8_t | g_hid_usb_desc [9]
usbd_desc_handler | hid_iap_desc_handler
hid device descriptor handler structure More...

Detailed Description

Macro Definition Documentation

◆ HID_BCD_NUM

#define HID_BCD_NUM 0x0110

Definition at line 51 of file hid_iap_desc.h.

◆ HID_BINTERVAL_TIME

#define HID_BINTERVAL_TIME 0x01

Definition at line 71 of file hid_iap_desc.h.

◆ HID_CLASS_DESC_HID

#define HID_CLASS_DESC_HID 0x21

Definition at line 53 of file hid_iap_desc.h.

◆ HID_CLASS_DESC_PHYSICAL

#define HID_CLASS_DESC_PHYSICAL 0x23

Definition at line 55 of file hid_iap_desc.h.

◆ HID_CLASS_DESC_REPORT

#define HID_CLASS_DESC_REPORT 0x22

Definition at line 54 of file hid_iap_desc.h.

◆ MCU_ID1

#define MCU_ID1 (0x1FFFF7E8)

Definition at line 73 of file hid_iap_desc.h.

◆ MCU_ID2

#define MCU_ID2 (0x1FFFF7EC)

Definition at line 74 of file hid_iap_desc.h.

◆ MCU_ID3

#define MCU_ID3 (0x1FFFF7F0)

Definition at line 75 of file hid_iap_desc.h.

◆ USBD_CONFIG_DESC_SIZE

#define USBD_CONFIG_DESC_SIZE 41

Definition at line 61 of file hid_iap_desc.h.

◆ USBD_DESC_CONFIGURATION_STRING

#define USBD_DESC_CONFIGURATION_STRING "HID IAP Config"

Definition at line 68 of file hid_iap_desc.h.

◆ USBD_DESC_INTERFACE_STRING

#define USBD_DESC_INTERFACE_STRING "HID IAP Interface"

Definition at line 69 of file hid_iap_desc.h.

◆ USBD_DESC_MANUFACTURER_STRING

#define USBD_DESC_MANUFACTURER_STRING "Artery"

Definition at line 66 of file hid_iap_desc.h.

◆ USBD_DESC_PRODUCT_STRING

#define USBD_DESC_PRODUCT_STRING "HID IAP"

Definition at line 67 of file hid_iap_desc.h.

◆ USBD_HID_SIZ_REPORT_DESC

#define USBD_HID_SIZ_REPORT_DESC 32

Definition at line 62 of file hid_iap_desc.h.

◆ USBD_PRODUCT_ID

#define USBD_PRODUCT_ID 0xAF01

Definition at line 59 of file hid_iap_desc.h.

◆ USBD_SIZ_STRING_LANGID

#define USBD_SIZ_STRING_LANGID 4

Definition at line 63 of file hid_iap_desc.h.

◆ USBD_SIZ_STRING_SERIAL

#define USBD_SIZ_STRING_SERIAL 0x1A

Definition at line 64 of file hid_iap_desc.h.

◆ USBD_VENDOR_ID

#define USBD_VENDOR_ID 0x2E3C

Definition at line 58 of file hid_iap_desc.h.

Variable Documentation

◆ g_hid_usb_desc

uint8_t g_hid_usb_desc[9]
extern

◆ g_usbd_configuration

uint8_t g_usbd_configuration[41]
extern

◆ g_usbd_descriptor

uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
extern

◆ g_usbd_hid_report

uint8_t g_usbd_hid_report[32]
extern

◆ hid_iap_desc_handler

usbd_desc_handler hid_iap_desc_handler
extern

hid device descriptor handler structure

Definition at line 65 of file hid_iap_desc.c.

Referenced by main().


AT32F415 Firmwary Library: USB_keyboard_class

Modules
USB_keyboard_class
AT32F415_middlewares_usbd_class

usb device keyboard demo More...

Modules

USB_keyboard_class_private_functions
USB_keyboard_class_endpoint_definition
USB_hid_class_request_code_definition
USB_hid_class_exported_functions

Detailed Description

usb device keyboard demo


AT32F415 Firmwary Library: USB_keyboard_class_private_functions

Macros | Functions | Variables
USB_keyboard_class_private_functions
AT32F415_middlewares_usbd_class » USB_keyboard_class

Macros

#define SHIFT 0x80

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device class endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device class endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device class transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device class endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device class sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device class event handler More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...
void | usb_hid_keyboard_send_char (void *udev, uint8_t ascii_code)
usb device class report function More...

Variables

static uint32_t | hid_protocol = 0
static uint32_t | hid_set_idle = 0
static uint32_t | alt_setting = 0
static uint8_t | hid_state
uint8_t | hid_set_report [64]
__IO uint8_t | hid_suspend_flag = 0
__IO uint8_t | g_u8tx_completed = 0
const unsigned char | _asciimap [128]
usbd_class_handler | keyboard_class_handler

Detailed Description

Macro Definition Documentation

◆ SHIFT

#define SHIFT 0x80

Definition at line 62 of file keyboard_class.c.

Function Documentation

◆ class_clear_handler()

usb_sts_type class_clear_handler ( void * udev )

clear endpoint or other state

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 233 of file keyboard_class.c.

◆ class_ept0_rx_handler()

usb_sts_type class_ept0_rx_handler ( void * udev )

usb device class endpoint 0 out status stage complete

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 337 of file keyboard_class.c.

◆ class_ept0_tx_handler()

usb_sts_type class_ept0_tx_handler ( void * udev )

usb device class endpoint 0 in status stage complete

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 323 of file keyboard_class.c.

◆ class_event_handler()

usb_sts_type class_event_handler | ( | void * | udev,
 |  | usbd_event_type | event
 | ) |  |

usb device class event handler

Parameters
udev | to the structure of usbd_core_type
event | usb device event
Return values
status of usb_sts_type

Definition at line 403 of file keyboard_class.c.

◆ class_in_handler()

usb_sts_type class_in_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device class transmision complete handler

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 358 of file keyboard_class.c.

◆ class_init_handler()

usb_sts_type class_init_handler ( void * udev )

initialize usb endpoint

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 215 of file keyboard_class.c.

◆ class_out_handler()

usb_sts_type class_out_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device class endpoint receive data

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 376 of file keyboard_class.c.

◆ class_send_report()

usb_sts_type class_send_report | ( | void * | udev,
 |  | uint8_t * | report,
 |  | uint16_t | len
 | ) |  |

usb device class send report

Parameters
udev | to the structure of usbd_core_type
report | report buffer
len | report length
Return values
status of usb_sts_type

Definition at line 435 of file keyboard_class.c.

Referenced by usb_hid_keyboard_send_char().

◆ class_setup_handler()

usb_sts_type class_setup_handler | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb device class setup request handler

Parameters
udev | to the structure of usbd_core_type
setup | setup packet
Return values
status of usb_sts_type

Definition at line 250 of file keyboard_class.c.

◆ class_sof_handler()

usb_sts_type class_sof_handler ( void * udev )

usb device class sof handler

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 388 of file keyboard_class.c.

◆ usb_hid_keyboard_send_char()

void usb_hid_keyboard_send_char | ( | void * | udev,
 |  | uint8_t | ascii_code
 | ) |  |

usb device class report function

usb keyoard send char

Parameters
udev | to the structure of usbd_core_type
op | operation
Return values
none

Definition at line 453 of file keyboard_class.c.

Variable Documentation

◆ _asciimap

const unsigned char _asciimap[128]

Definition at line 63 of file keyboard_class.c.

Referenced by usb_hid_keyboard_send_char().

◆ alt_setting

uint32_t alt_setting = 0
static

Definition at line 56 of file keyboard_class.c.

Referenced by class_setup_handler().

◆ g_u8tx_completed

__IO uint8_t g_u8tx_completed = 0

Definition at line 60 of file keyboard_class.c.

Referenced by class_in_handler(), class_init_handler(), and keyboard_send_string().

◆ hid_protocol

uint32_t hid_protocol = 0
static

Definition at line 54 of file keyboard_class.c.

Referenced by class_setup_handler().

◆ hid_set_idle

uint32_t hid_set_idle = 0
static

Definition at line 55 of file keyboard_class.c.

Referenced by class_setup_handler().

◆ hid_set_report

uint8_t hid_set_report[64]

Definition at line 58 of file keyboard_class.c.

Referenced by class_setup_handler().

◆ hid_state

uint8_t hid_state
static

Definition at line 57 of file keyboard_class.c.

Referenced by class_ept0_rx_handler(), and class_setup_handler().

◆ hid_suspend_flag

__IO uint8_t hid_suspend_flag = 0

Definition at line 59 of file keyboard_class.c.

Referenced by class_event_handler().

◆ keyboard_class_handler

usbd_class_handler keyboard_class_handler
Initial value:
=
{
class_init_handler,
class_clear_handler,
class_setup_handler,
class_ept0_tx_handler,
class_ept0_rx_handler,
class_in_handler,
class_out_handler,
class_sof_handler,
class_event_handler,
}
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device class event handler
Definition: keyboard_class.c:403
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device class sof handler
Definition: keyboard_class.c:388
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: keyboard_class.c:250
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device class endpoint 0 in status stage complete
Definition: keyboard_class.c:323
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device class transmision complete handler
Definition: keyboard_class.c:358
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb endpoint
Definition: keyboard_class.c:215
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device class endpoint 0 out status stage complete
Definition: keyboard_class.c:337
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device class endpoint receive data
Definition: keyboard_class.c:376
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: keyboard_class.c:233

Definition at line 197 of file keyboard_class.c.

Referenced by main().


AT32F415 Firmwary Library: USB_keyboard_class_endpoint_definition

Macros
USB_keyboard_class_endpoint_definition
AT32F415_middlewares_usbd_class » USB_keyboard_class

Macros

#define | USBD_HID_IN_EPT 0x81
usb hid use endpoint define More...
#define | USBD_IN_MAXPACKET_SIZE 0x40
usb hid in and out max packet size define More...
#define | USBD_OUT_MAXPACKET_SIZE 0x40

Detailed Description

Macro Definition Documentation

◆ USBD_HID_IN_EPT

#define USBD_HID_IN_EPT 0x81

usb hid use endpoint define

Definition at line 53 of file keyboard_class.h.

◆ USBD_IN_MAXPACKET_SIZE

#define USBD_IN_MAXPACKET_SIZE 0x40

usb hid in and out max packet size define

Definition at line 58 of file keyboard_class.h.

◆ USBD_OUT_MAXPACKET_SIZE

#define USBD_OUT_MAXPACKET_SIZE 0x40

Definition at line 59 of file keyboard_class.h.


AT32F415 Firmwary Library: USB_hid_class_request_code_definition

Macros
USB_hid_class_request_code_definition
AT32F415_middlewares_usbd_class » USB_keyboard_class

Macros

#define | HID_REQ_SET_PROTOCOL 0x0B
usb hid class request code define More...
#define | HID_REQ_GET_PROTOCOL 0x03
#define | HID_REQ_SET_IDLE 0x0A
#define | HID_REQ_GET_IDLE 0x02
#define | HID_REQ_SET_REPORT 0x09
#define | HID_REQ_GET_REPORT 0x01
#define | HID_DESCRIPTOR_TYPE 0x21
#define | HID_REPORT_DESC 0x22

Detailed Description

Macro Definition Documentation

◆ HID_DESCRIPTOR_TYPE

#define HID_DESCRIPTOR_TYPE 0x21

Definition at line 78 of file keyboard_class.h.

◆ HID_REPORT_DESC

#define HID_REPORT_DESC 0x22

Definition at line 79 of file keyboard_class.h.

◆ HID_REQ_GET_IDLE

#define HID_REQ_GET_IDLE 0x02

Definition at line 75 of file keyboard_class.h.

◆ HID_REQ_GET_PROTOCOL

#define HID_REQ_GET_PROTOCOL 0x03

Definition at line 73 of file keyboard_class.h.

◆ HID_REQ_GET_REPORT

#define HID_REQ_GET_REPORT 0x01

Definition at line 77 of file keyboard_class.h.

◆ HID_REQ_SET_IDLE

#define HID_REQ_SET_IDLE 0x0A

Definition at line 74 of file keyboard_class.h.

◆ HID_REQ_SET_PROTOCOL

#define HID_REQ_SET_PROTOCOL 0x0B

usb hid class request code define

Definition at line 72 of file keyboard_class.h.

◆ HID_REQ_SET_REPORT

#define HID_REQ_SET_REPORT 0x09

Definition at line 76 of file keyboard_class.h.


AT32F415 Firmwary Library: USB_hid_class_exported_functions

Functions | Variables
USB_hid_class_exported_functions
AT32F415_middlewares_usbd_class » USB_keyboard_class | AT32F415_middlewares_usbd_class » USB_mouse_class

Functions

usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...
void | usb_hid_keyboard_send_char (void *udev, uint8_t ascii_code)
usb keyoard send char More...
void | usb_hid_mouse_send (void *udev, uint8_t op)
usb device class report function More...

Variables

usbd_class_handler | keyboard_class_handler
__IO uint8_t | g_u8tx_completed
usbd_class_handler | mouse_class_handler

Detailed Description

Function Documentation

◆ class_send_report()

usb_sts_type class_send_report | ( | void * | udev,
 |  | uint8_t * | report,
 |  | uint16_t | len
 | ) |  |

usb device class send report

Parameters
udev | to the structure of usbd_core_type
report | report buffer
len | report length
Return values
status of usb_sts_type

Definition at line 818 of file audio_hid_class.c.

Referenced by main(), usb_hid_keyboard_send_char(), usb_hid_mouse_send(), and usbd_hid_iap_process().

◆ usb_hid_keyboard_send_char()

void usb_hid_keyboard_send_char | ( | void * | udev,
 |  | uint8_t | ascii_code
 | ) |  |

usb keyoard send char

Parameters
udev | to the structure of usbd_core_type
op | operation
Return values
none

usb keyoard send char

Parameters
udev | to the structure of usbd_core_type
op | operation
Return values
none

Definition at line 686 of file cdc_keyboard_class.c.

Referenced by keyboard_send_string().

◆ usb_hid_mouse_send()

void usb_hid_mouse_send | ( | void * | udev,
 |  | uint8_t | op
 | ) |  |

usb device class report function

Parameters
udev | to the structure of usbd_core_type
op | operation
Return values
none

Definition at line 315 of file mouse_class.c.

Referenced by main().

Variable Documentation

◆ g_u8tx_completed

__IO uint8_t g_u8tx_completed
extern

Definition at line 60 of file keyboard_class.c.

Referenced by class_in_handler(), class_init_handler(), and keyboard_send_string().

◆ keyboard_class_handler

usbd_class_handler keyboard_class_handler
extern

Definition at line 197 of file keyboard_class.c.

Referenced by main().

◆ mouse_class_handler

usbd_class_handler mouse_class_handler
extern

Definition at line 62 of file mouse_class.c.

Referenced by main().


AT32F415 Firmwary Library: USB_keyboard_desc

Modules | Variables
USB_keyboard_desc
AT32F415_middlewares_usbd_class

usb device keyboard descriptor More...

Modules

USB_keyboard_desc_private_functions
USB_keyboard_desc_definition

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [34]
uint8_t | g_usbd_hid_report [63]
uint8_t | g_hid_usb_desc [9]
usbd_desc_handler | keyboard_desc_handler
keyboard device descriptor handler structure More...

Detailed Description

usb device keyboard descriptor

Variable Documentation

◆ g_hid_usb_desc

uint8_t g_hid_usb_desc[9]
extern

◆ g_usbd_configuration

uint8_t g_usbd_configuration[34]
extern

◆ g_usbd_descriptor

uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
extern

◆ g_usbd_hid_report

uint8_t g_usbd_hid_report[63]
extern

◆ keyboard_desc_handler

usbd_desc_handler keyboard_desc_handler
extern

keyboard device descriptor handler structure

Definition at line 63 of file keyboard_desc.c.

Referenced by main().


AT32F415 Firmwary Library: USB_keyboard_desc_private_functions

Functions | Variables
USB_keyboard_desc_private_functions
AT32F415_middlewares_usbd_class » USB_keyboard_desc

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | keyboard_desc_handler
keyboard device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

Function Documentation

◆ get_device_config_string()

usbd_desc_t * get_device_config_string ( void )

get device config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 450 of file keyboard_desc.c.

◆ get_device_configuration()

usbd_desc_t * get_device_configuration ( void )

get config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 372 of file keyboard_desc.c.

◆ get_device_descriptor()

usbd_desc_t * get_device_descriptor ( void )

get device descriptor

Parameters
none
Return values
usbd_desc

Definition at line 352 of file keyboard_desc.c.

◆ get_device_interface_string()

usbd_desc_t * get_device_interface_string ( void )

get interface descriptor

Parameters
none
Return values
usbd_desc

Definition at line 438 of file keyboard_desc.c.

◆ get_device_lang_id()

usbd_desc_t * get_device_lang_id ( void )

get lang id descriptor

Parameters
none
Return values
usbd_desc

Definition at line 392 of file keyboard_desc.c.

◆ get_device_manufacturer_string()

usbd_desc_t * get_device_manufacturer_string ( void )

get manufacturer descriptor

Parameters
none
Return values
usbd_desc

Definition at line 403 of file keyboard_desc.c.

◆ get_device_other_speed()

usbd_desc_t * get_device_other_speed ( void )

get other speed descriptor

Parameters
none
Return values
usbd_desc

Definition at line 382 of file keyboard_desc.c.

◆ get_device_product_string()

usbd_desc_t * get_device_product_string ( void )

get product descriptor

Parameters
none
Return values
usbd_desc

Definition at line 415 of file keyboard_desc.c.

◆ get_device_qualifier()

usbd_desc_t * get_device_qualifier ( void )

get device qualifier

Parameters
none
Return values
usbd_desc

Definition at line 362 of file keyboard_desc.c.

◆ get_device_serial_string()

usbd_desc_t * get_device_serial_string ( void )

get serial descriptor

Parameters
none
Return values
usbd_desc

Definition at line 427 of file keyboard_desc.c.

◆ get_serial_num()

static void get_serial_num ( void )
static

usb get serial number

Parameters
none
Return values
none

Definition at line 330 of file keyboard_desc.c.

Referenced by get_device_serial_string().

◆ usbd_int_to_unicode()

static void usbd_int_to_unicode | ( | uint32_t | value,
 |  | uint8_t * | pbuf,
 |  | uint8_t | len
 | ) |  |
static

usb int convert to unicode

Parameters
value | int value
pbus | unicode buffer
len | length
Return values
none

Definition at line 304 of file keyboard_desc.c.

Referenced by get_serial_num().

◆ usbd_unicode_convert()

uint16_t usbd_unicode_convert | ( | uint8_t * | string,
 |  | uint8_t * | unicode_buf
 | ) |  |

standard usb unicode convert

Parameters
string | source string
unicode_buf | unicode buffer
Return values
length

Definition at line 278 of file keyboard_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

Variable Documentation

◆ ALIGNED_TAIL

ALIGNED_HEAD uint8_t g_string_serial [ 0x1A ] ALIGNED_TAIL
Initial value:
=
{
USB_DEVICE_DESC_LEN,
USB_DESCIPTOR_TYPE_DEVICE,
0x00,
0x02,
0x00,
0x00,
0x00,
USB_MAX_EP0_SIZE,
LBYTE( 0x2E3C ),
HBYTE( 0x2E3C ),
LBYTE( 0x6040 ),
HBYTE( 0x6040 ),
0x00,
0x02,
USB_MFC_STRING,
USB_PRODUCT_STRING,
USB_SERIAL_STRING,
1
}
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92

usb device standard descriptor

usb string serial

usb string lang id

usb hid descriptor

usb mouse report descriptor

usb configuration standard descriptor

Definition at line 83 of file keyboard_desc.c.

◆ config_descriptor

usbd_desc_t config_descriptor
Initial value:
=
{
34 ,
g_usbd_configuration
}
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112

Definition at line 250 of file keyboard_desc.c.

Referenced by get_device_configuration().

◆ device_descriptor

usbd_desc_t device_descriptor
Initial value:
=
{
USB_DEVICE_DESC_LEN,
g_usbd_descriptor
}
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]

Definition at line 243 of file keyboard_desc.c.

Referenced by get_device_descriptor().

◆ g_usbd_desc_buffer

uint8_t g_usbd_desc_buffer[256]
static

Definition at line 58 of file keyboard_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

◆ keyboard_desc_handler

usbd_desc_handler keyboard_desc_handler
Initial value:
=
{
get_device_descriptor,
get_device_qualifier,
get_device_configuration,
get_device_other_speed,
get_device_lang_id,
get_device_manufacturer_string,
get_device_product_string,
get_device_serial_string,
get_device_interface_string,
get_device_config_string,
}
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: keyboard_desc.c:403
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: keyboard_desc.c:362
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: keyboard_desc.c:438
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: keyboard_desc.c:382
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: keyboard_desc.c:372
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: keyboard_desc.c:415
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: keyboard_desc.c:392
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: keyboard_desc.c:352
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: keyboard_desc.c:427
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: keyboard_desc.c:450

keyboard device descriptor handler structure

Definition at line 63 of file keyboard_desc.c.

Referenced by main().

◆ langid_descriptor

usbd_desc_t langid_descriptor
Initial value:
=
{
4 ,
g_string_lang_id
}

Definition at line 257 of file keyboard_desc.c.

Referenced by get_device_lang_id().

◆ serial_descriptor

usbd_desc_t serial_descriptor
Initial value:
=
{
0x1A ,
g_string_serial
}

Definition at line 264 of file keyboard_desc.c.

Referenced by get_device_serial_string().

◆ vp_desc

usbd_desc_t vp_desc

Definition at line 270 of file keyboard_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().


AT32F415 Firmwary Library: USB_keyboard_desc_definition

Macros
USB_keyboard_desc_definition
AT32F415_middlewares_usbd_class » USB_keyboard_desc

Macros

#define | HID_BCD_NUM 0x0110
usb bcd number define More...
#define | HID_CLASS_DESC_HID 0x21
usb hid class descriptor define More...
#define | HID_CLASS_DESC_REPORT 0x22
#define | HID_CLASS_DESC_PHYSICAL 0x23
#define | USBD_VENDOR_ID 0x2E3C
usb vendor id and product id define More...
#define | USBD_PRODUCT_ID 0x6040
#define | USBD_CONFIG_DESC_SIZE 34
usb descriptor size define More...
#define | USBD_HID_SIZ_REPORT_DESC 63
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
usb string define(vendor, product configuration, interface) More...
#define | USBD_DESC_PRODUCT_STRING "Keyboard"
#define | USBD_DESC_CONFIGURATION_STRING "Keyboard Config"
#define | USBD_DESC_INTERFACE_STRING "Keyboard Interface"
#define | HID_BINTERVAL_TIME 0x0A
usb hid endpoint interval define More...
#define | MCU_ID1 (0x1FFFF7E8)
usb mcu id address deine More...
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Detailed Description

Macro Definition Documentation

◆ HID_BCD_NUM

#define HID_BCD_NUM 0x0110

usb bcd number define

Definition at line 53 of file keyboard_desc.h.

◆ HID_BINTERVAL_TIME

#define HID_BINTERVAL_TIME 0x0A

usb hid endpoint interval define

Definition at line 87 of file keyboard_desc.h.

◆ HID_CLASS_DESC_HID

#define HID_CLASS_DESC_HID 0x21

usb hid class descriptor define

Definition at line 58 of file keyboard_desc.h.

◆ HID_CLASS_DESC_PHYSICAL

#define HID_CLASS_DESC_PHYSICAL 0x23

Definition at line 60 of file keyboard_desc.h.

◆ HID_CLASS_DESC_REPORT

#define HID_CLASS_DESC_REPORT 0x22

Definition at line 59 of file keyboard_desc.h.

◆ MCU_ID1

#define MCU_ID1 (0x1FFFF7E8)

usb mcu id address deine

Definition at line 92 of file keyboard_desc.h.

◆ MCU_ID2

#define MCU_ID2 (0x1FFFF7EC)

Definition at line 93 of file keyboard_desc.h.

◆ MCU_ID3

#define MCU_ID3 (0x1FFFF7F0)

Definition at line 94 of file keyboard_desc.h.

◆ USBD_CONFIG_DESC_SIZE

#define USBD_CONFIG_DESC_SIZE 34

usb descriptor size define

Definition at line 71 of file keyboard_desc.h.

◆ USBD_DESC_CONFIGURATION_STRING

#define USBD_DESC_CONFIGURATION_STRING "Keyboard Config"

Definition at line 81 of file keyboard_desc.h.

◆ USBD_DESC_INTERFACE_STRING

#define USBD_DESC_INTERFACE_STRING "Keyboard Interface"

Definition at line 82 of file keyboard_desc.h.

◆ USBD_DESC_MANUFACTURER_STRING

#define USBD_DESC_MANUFACTURER_STRING "Artery"

usb string define(vendor, product configuration, interface)

Definition at line 79 of file keyboard_desc.h.

◆ USBD_DESC_PRODUCT_STRING

#define USBD_DESC_PRODUCT_STRING "Keyboard"

Definition at line 80 of file keyboard_desc.h.

◆ USBD_HID_SIZ_REPORT_DESC

#define USBD_HID_SIZ_REPORT_DESC 63

Definition at line 72 of file keyboard_desc.h.

◆ USBD_PRODUCT_ID

#define USBD_PRODUCT_ID 0x6040

Definition at line 66 of file keyboard_desc.h.

◆ USBD_SIZ_STRING_LANGID

#define USBD_SIZ_STRING_LANGID 4

Definition at line 73 of file keyboard_desc.h.

◆ USBD_SIZ_STRING_SERIAL

#define USBD_SIZ_STRING_SERIAL 0x1A

Definition at line 74 of file keyboard_desc.h.

◆ USBD_VENDOR_ID

#define USBD_VENDOR_ID 0x2E3C

usb vendor id and product id define

Definition at line 65 of file keyboard_desc.h.


AT32F415 Firmwary Library: USB_mouse_class

Modules
USB_mouse_class
AT32F415_middlewares_usbd_class

usb device mouse demo More...

Modules

USB_mouse_class_private_functions
USB_mouse_class_endpoint_definition
USB_mouse_class_request_code_definition
USB_hid_class_exported_functions

Detailed Description

usb device mouse demo


AT32F415 Firmwary Library: USB_mouse_class_private_functions

Functions | Variables
USB_mouse_class_private_functions
AT32F415_middlewares_usbd_class » USB_mouse_class

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device class endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device class endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device class transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device class endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device class sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device class event handler More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...
void | usb_hid_mouse_send (void *udev, uint8_t op)
usb device class report function More...

Variables

static uint32_t | hid_protocol = 0
static uint32_t | hid_set_idle = 0
static uint32_t | alt_setting = 0
static uint8_t | hid_state
__IO uint8_t | hid_suspend_flag = 0
uint8_t | hid_set_report [64]
usbd_class_handler | mouse_class_handler

Detailed Description

Function Documentation

◆ class_clear_handler()

usb_sts_type class_clear_handler ( void * udev )

clear endpoint or other state

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 96 of file mouse_class.c.

◆ class_ept0_rx_handler()

usb_sts_type class_ept0_rx_handler ( void * udev )

usb device class endpoint 0 out status stage complete

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 198 of file mouse_class.c.

◆ class_ept0_tx_handler()

usb_sts_type class_ept0_tx_handler ( void * udev )

usb device class endpoint 0 in status stage complete

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 184 of file mouse_class.c.

◆ class_event_handler()

usb_sts_type class_event_handler | ( | void * | udev,
 |  | usbd_event_type | event
 | ) |  |

usb device class event handler

Parameters
udev | to the structure of usbd_core_type
event | usb device event
Return values
status of usb_sts_type

Definition at line 263 of file mouse_class.c.

◆ class_in_handler()

usb_sts_type class_in_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device class transmision complete handler

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 219 of file mouse_class.c.

◆ class_init_handler()

usb_sts_type class_init_handler ( void * udev )

initialize usb endpoint

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 80 of file mouse_class.c.

◆ class_out_handler()

usb_sts_type class_out_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device class endpoint receive data

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 236 of file mouse_class.c.

◆ class_send_report()

usb_sts_type class_send_report | ( | void * | udev,
 |  | uint8_t * | report,
 |  | uint16_t | len
 | ) |  |

usb device class send report

Parameters
udev | to the structure of usbd_core_type
report | report buffer
len | report length
Return values
status of usb_sts_type

Definition at line 295 of file mouse_class.c.

Referenced by usb_hid_mouse_send().

◆ class_setup_handler()

usb_sts_type class_setup_handler | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb device class setup request handler

Parameters
udev | to the structure of usbd_core_type
setup | setup packet
Return values
status of usb_sts_type

Definition at line 113 of file mouse_class.c.

◆ class_sof_handler()

usb_sts_type class_sof_handler ( void * udev )

usb device class sof handler

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 248 of file mouse_class.c.

◆ usb_hid_mouse_send()

void usb_hid_mouse_send | ( | void * | udev,
 |  | uint8_t | op
 | ) |  |

usb device class report function

Parameters
udev | to the structure of usbd_core_type
op | operation
Return values
none

Definition at line 315 of file mouse_class.c.

Referenced by main().

Variable Documentation

◆ alt_setting

uint32_t alt_setting = 0
static

Definition at line 56 of file mouse_class.c.

Referenced by class_setup_handler().

◆ hid_protocol

uint32_t hid_protocol = 0
static

Definition at line 54 of file mouse_class.c.

Referenced by class_setup_handler().

◆ hid_set_idle

uint32_t hid_set_idle = 0
static

Definition at line 55 of file mouse_class.c.

Referenced by class_setup_handler().

◆ hid_set_report

uint8_t hid_set_report[64]

Definition at line 59 of file mouse_class.c.

Referenced by class_setup_handler().

◆ hid_state

uint8_t hid_state
static

Definition at line 57 of file mouse_class.c.

Referenced by class_ept0_rx_handler(), and class_setup_handler().

◆ hid_suspend_flag

__IO uint8_t hid_suspend_flag = 0

Definition at line 58 of file mouse_class.c.

Referenced by class_event_handler(), and main().

◆ mouse_class_handler

usbd_class_handler mouse_class_handler
Initial value:
=
{
class_init_handler,
class_clear_handler,
class_setup_handler,
class_ept0_tx_handler,
class_ept0_rx_handler,
class_in_handler,
class_out_handler,
class_sof_handler,
class_event_handler,
}
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device class event handler
Definition: mouse_class.c:263
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device class sof handler
Definition: mouse_class.c:248
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: mouse_class.c:113
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device class endpoint 0 in status stage complete
Definition: mouse_class.c:184
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device class transmision complete handler
Definition: mouse_class.c:219
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb endpoint
Definition: mouse_class.c:80
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device class endpoint 0 out status stage complete
Definition: mouse_class.c:198
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device class endpoint receive data
Definition: mouse_class.c:236
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: mouse_class.c:96

Definition at line 62 of file mouse_class.c.

Referenced by main().


AT32F415 Firmwary Library: USB_mouse_class_endpoint_definition

Macros
USB_mouse_class_endpoint_definition
AT32F415_middlewares_usbd_class » USB_mouse_class

Macros

#define | USBD_HID_IN_EPT 0x81
usb hid use endpoint define More...
#define | USBD_IN_MAXPACKET_SIZE 0x40
usb hid in and out max packet size define More...

Detailed Description

Macro Definition Documentation

◆ USBD_HID_IN_EPT

#define USBD_HID_IN_EPT 0x81

usb hid use endpoint define

Definition at line 53 of file mouse_class.h.

◆ USBD_IN_MAXPACKET_SIZE

#define USBD_IN_MAXPACKET_SIZE 0x40

usb hid in and out max packet size define

Definition at line 58 of file mouse_class.h.


AT32F415 Firmwary Library: USB_mouse_class_request_code_definition

Macros
USB_mouse_class_request_code_definition
AT32F415_middlewares_usbd_class » USB_mouse_class

Macros

#define | HID_REQ_SET_PROTOCOL 0x0B
usb hid class request code define More...
#define | HID_REQ_GET_PROTOCOL 0x03
#define | HID_REQ_SET_IDLE 0x0A
#define | HID_REQ_GET_IDLE 0x02
#define | HID_REQ_SET_REPORT 0x09
#define | HID_REQ_GET_REPORT 0x01
#define | HID_DESCRIPTOR_TYPE 0x21
#define | HID_REPORT_DESC 0x22
#define | MOVE_STEP 20
usb hid mouse operation More...
#define | BUTTON_RELEASE 0
#define | LEFT_BUTTON 1
#define | RIGHT_BUTTON 2
#define | LEFT_MOVE 3
#define | RIGHT_MOVE 4
#define | UP_MOVE 5
#define | DOWN_MOVE 6

Detailed Description

Macro Definition Documentation

◆ BUTTON_RELEASE

#define BUTTON_RELEASE 0

Definition at line 85 of file mouse_class.h.

◆ DOWN_MOVE

#define DOWN_MOVE 6

Definition at line 91 of file mouse_class.h.

◆ HID_DESCRIPTOR_TYPE

#define HID_DESCRIPTOR_TYPE 0x21

Definition at line 77 of file mouse_class.h.

◆ HID_REPORT_DESC

#define HID_REPORT_DESC 0x22

Definition at line 78 of file mouse_class.h.

◆ HID_REQ_GET_IDLE

#define HID_REQ_GET_IDLE 0x02

Definition at line 74 of file mouse_class.h.

◆ HID_REQ_GET_PROTOCOL

#define HID_REQ_GET_PROTOCOL 0x03

Definition at line 72 of file mouse_class.h.

◆ HID_REQ_GET_REPORT

#define HID_REQ_GET_REPORT 0x01

Definition at line 76 of file mouse_class.h.

◆ HID_REQ_SET_IDLE

#define HID_REQ_SET_IDLE 0x0A

Definition at line 73 of file mouse_class.h.

◆ HID_REQ_SET_PROTOCOL

#define HID_REQ_SET_PROTOCOL 0x0B

usb hid class request code define

Definition at line 71 of file mouse_class.h.

◆ HID_REQ_SET_REPORT

#define HID_REQ_SET_REPORT 0x09

Definition at line 75 of file mouse_class.h.

◆ LEFT_BUTTON

#define LEFT_BUTTON 1

Definition at line 86 of file mouse_class.h.

◆ LEFT_MOVE

#define LEFT_MOVE 3

Definition at line 88 of file mouse_class.h.

◆ MOVE_STEP

#define MOVE_STEP 20

usb hid mouse operation

Definition at line 83 of file mouse_class.h.

◆ RIGHT_BUTTON

#define RIGHT_BUTTON 2

Definition at line 87 of file mouse_class.h.

◆ RIGHT_MOVE

#define RIGHT_MOVE 4

Definition at line 89 of file mouse_class.h.

◆ UP_MOVE

#define UP_MOVE 5

Definition at line 90 of file mouse_class.h.


AT32F415 Firmwary Library: USB_mouse_desc

Modules | Variables
USB_mouse_desc
AT32F415_middlewares_usbd_class

usb device mouse descriptor More...

Modules

USB_mouse_desc_private_functions
USB_mouse_desc_definition

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [34]
uint8_t | g_usbd_hid_report [74]
uint8_t | g_hid_usb_desc [9]
usbd_desc_handler | mouse_desc_handler
mouse device descriptor handler structure More...

Detailed Description

usb device mouse descriptor

Variable Documentation

◆ g_hid_usb_desc

uint8_t g_hid_usb_desc[9]
extern

◆ g_usbd_configuration

uint8_t g_usbd_configuration[34]
extern

◆ g_usbd_descriptor

uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
extern

◆ g_usbd_hid_report

uint8_t g_usbd_hid_report[74]
extern

◆ mouse_desc_handler

usbd_desc_handler mouse_desc_handler
extern

mouse device descriptor handler structure

Definition at line 63 of file mouse_desc.c.

Referenced by main().


AT32F415 Firmwary Library: USB_mouse_desc_private_functions

Functions | Variables
USB_mouse_desc_private_functions
AT32F415_middlewares_usbd_class » USB_mouse_desc

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | mouse_desc_handler
mouse device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

Function Documentation

◆ get_device_config_string()

usbd_desc_t * get_device_config_string ( void )

get device config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 464 of file mouse_desc.c.

◆ get_device_configuration()

usbd_desc_t * get_device_configuration ( void )

get config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 386 of file mouse_desc.c.

◆ get_device_descriptor()

usbd_desc_t * get_device_descriptor ( void )

get device descriptor

Parameters
none
Return values
usbd_desc

Definition at line 366 of file mouse_desc.c.

◆ get_device_interface_string()

usbd_desc_t * get_device_interface_string ( void )

get interface descriptor

Parameters
none
Return values
usbd_desc

Definition at line 452 of file mouse_desc.c.

◆ get_device_lang_id()

usbd_desc_t * get_device_lang_id ( void )

get lang id descriptor

Parameters
none
Return values
usbd_desc

Definition at line 406 of file mouse_desc.c.

◆ get_device_manufacturer_string()

usbd_desc_t * get_device_manufacturer_string ( void )

get manufacturer descriptor

Parameters
none
Return values
usbd_desc

Definition at line 417 of file mouse_desc.c.

◆ get_device_other_speed()

usbd_desc_t * get_device_other_speed ( void )

get other speed descriptor

Parameters
none
Return values
usbd_desc

Definition at line 396 of file mouse_desc.c.

◆ get_device_product_string()

usbd_desc_t * get_device_product_string ( void )

get product descriptor

Parameters
none
Return values
usbd_desc

Definition at line 429 of file mouse_desc.c.

◆ get_device_qualifier()

usbd_desc_t * get_device_qualifier ( void )

get device qualifier

Parameters
none
Return values
usbd_desc

Definition at line 376 of file mouse_desc.c.

◆ get_device_serial_string()

usbd_desc_t * get_device_serial_string ( void )

get serial descriptor

Parameters
none
Return values
usbd_desc

Definition at line 441 of file mouse_desc.c.

◆ get_serial_num()

static void get_serial_num ( void )
static

usb get serial number

Parameters
none
Return values
none

Definition at line 344 of file mouse_desc.c.

Referenced by get_device_serial_string().

◆ usbd_int_to_unicode()

static void usbd_int_to_unicode | ( | uint32_t | value,
 |  | uint8_t * | pbuf,
 |  | uint8_t | len
 | ) |  |
static

usb int convert to unicode

Parameters
value | int value
pbus | unicode buffer
len | length
Return values
none

Definition at line 318 of file mouse_desc.c.

Referenced by get_serial_num().

◆ usbd_unicode_convert()

uint16_t usbd_unicode_convert | ( | uint8_t * | string,
 |  | uint8_t * | unicode_buf
 | ) |  |

standard usb unicode convert

Parameters
string | source string
unicode_buf | unicode buffer
Return values
length

Definition at line 292 of file mouse_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

Variable Documentation

◆ ALIGNED_TAIL

ALIGNED_HEAD uint8_t g_string_serial [ 0x1A ] ALIGNED_TAIL
Initial value:
=
{
USB_DEVICE_DESC_LEN,
USB_DESCIPTOR_TYPE_DEVICE,
0x00,
0x02,
0x00,
0x00,
0x00,
USB_MAX_EP0_SIZE,
LBYTE( 0x2E3C ),
HBYTE( 0x2E3C ),
LBYTE( 0x5710 ),
HBYTE( 0x5710 ),
0x00,
0x02,
USB_MFC_STRING,
USB_PRODUCT_STRING,
USB_SERIAL_STRING,
1
}
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92

usb device standard descriptor

usb string serial

usb string lang id

usb hid descriptor

usb mouse report descriptor

usb configuration standard descriptor

Definition at line 83 of file mouse_desc.c.

◆ config_descriptor

usbd_desc_t config_descriptor
Initial value:
=
{
34 ,
g_usbd_configuration
}
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112

Definition at line 264 of file mouse_desc.c.

Referenced by get_device_configuration().

◆ device_descriptor

usbd_desc_t device_descriptor
Initial value:
=
{
USB_DEVICE_DESC_LEN,
g_usbd_descriptor
}
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]

Definition at line 257 of file mouse_desc.c.

Referenced by get_device_descriptor().

◆ g_usbd_desc_buffer

uint8_t g_usbd_desc_buffer[256]
static

Definition at line 58 of file mouse_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

◆ langid_descriptor

usbd_desc_t langid_descriptor
Initial value:
=
{
4 ,
g_string_lang_id
}

Definition at line 271 of file mouse_desc.c.

Referenced by get_device_lang_id().

◆ mouse_desc_handler

usbd_desc_handler mouse_desc_handler
Initial value:
=
{
get_device_descriptor,
get_device_qualifier,
get_device_configuration,
get_device_other_speed,
get_device_lang_id,
get_device_manufacturer_string,
get_device_product_string,
get_device_serial_string,
get_device_interface_string,
get_device_config_string,
}
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: mouse_desc.c:417
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: mouse_desc.c:376
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: mouse_desc.c:452
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: mouse_desc.c:396
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: mouse_desc.c:386
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: mouse_desc.c:429
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: mouse_desc.c:406
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: mouse_desc.c:366
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: mouse_desc.c:441
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: mouse_desc.c:464

mouse device descriptor handler structure

Definition at line 63 of file mouse_desc.c.

Referenced by main().

◆ serial_descriptor

usbd_desc_t serial_descriptor
Initial value:
=
{
0x1A ,
g_string_serial
}

Definition at line 278 of file mouse_desc.c.

Referenced by get_device_serial_string().

◆ vp_desc

usbd_desc_t vp_desc

Definition at line 284 of file mouse_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().


AT32F415 Firmwary Library: USB_mouse_desc_definition

Macros
USB_mouse_desc_definition
AT32F415_middlewares_usbd_class » USB_mouse_desc

Macros

#define | HID_BCD_NUM 0x0110
usb bcd number define More...
#define | HID_CLASS_DESC_HID 0x21
usb hid class descriptor define More...
#define | HID_CLASS_DESC_REPORT 0x22
#define | HID_CLASS_DESC_PHYSICAL 0x23
#define | USBD_VENDOR_ID 0x2E3C
usb vendor id and product id define More...
#define | USBD_PRODUCT_ID 0x5710
#define | USBD_CONFIG_DESC_SIZE 34
usb descriptor size define More...
#define | USBD_HID_SIZ_REPORT_DESC 74
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
usb string define(vendor, product configuration, interface) More...
#define | USBD_DESC_PRODUCT_STRING "Mouse"
#define | USBD_DESC_CONFIGURATION_STRING "Mouse Config"
#define | USBD_DESC_INTERFACE_STRING "Mouse Interface"
#define | HID_BINTERVAL_TIME 0x0A
usb hid endpoint interval define More...
#define | MCU_ID1 (0x1FFFF7E8)
usb mcu id address deine More...
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Detailed Description

Macro Definition Documentation

◆ HID_BCD_NUM

#define HID_BCD_NUM 0x0110

usb bcd number define

Definition at line 53 of file mouse_desc.h.

◆ HID_BINTERVAL_TIME

#define HID_BINTERVAL_TIME 0x0A

usb hid endpoint interval define

Definition at line 87 of file mouse_desc.h.

◆ HID_CLASS_DESC_HID

#define HID_CLASS_DESC_HID 0x21

usb hid class descriptor define

Definition at line 58 of file mouse_desc.h.

◆ HID_CLASS_DESC_PHYSICAL

#define HID_CLASS_DESC_PHYSICAL 0x23

Definition at line 60 of file mouse_desc.h.

◆ HID_CLASS_DESC_REPORT

#define HID_CLASS_DESC_REPORT 0x22

Definition at line 59 of file mouse_desc.h.

◆ MCU_ID1

#define MCU_ID1 (0x1FFFF7E8)

usb mcu id address deine

Definition at line 92 of file mouse_desc.h.

◆ MCU_ID2

#define MCU_ID2 (0x1FFFF7EC)

Definition at line 93 of file mouse_desc.h.

◆ MCU_ID3

#define MCU_ID3 (0x1FFFF7F0)

Definition at line 94 of file mouse_desc.h.

◆ USBD_CONFIG_DESC_SIZE

#define USBD_CONFIG_DESC_SIZE 34

usb descriptor size define

Definition at line 71 of file mouse_desc.h.

◆ USBD_DESC_CONFIGURATION_STRING

#define USBD_DESC_CONFIGURATION_STRING "Mouse Config"

Definition at line 81 of file mouse_desc.h.

◆ USBD_DESC_INTERFACE_STRING

#define USBD_DESC_INTERFACE_STRING "Mouse Interface"

Definition at line 82 of file mouse_desc.h.

◆ USBD_DESC_MANUFACTURER_STRING

#define USBD_DESC_MANUFACTURER_STRING "Artery"

usb string define(vendor, product configuration, interface)

Definition at line 79 of file mouse_desc.h.

◆ USBD_DESC_PRODUCT_STRING

#define USBD_DESC_PRODUCT_STRING "Mouse"

Definition at line 80 of file mouse_desc.h.

◆ USBD_HID_SIZ_REPORT_DESC

#define USBD_HID_SIZ_REPORT_DESC 74

Definition at line 72 of file mouse_desc.h.

◆ USBD_PRODUCT_ID

#define USBD_PRODUCT_ID 0x5710

Definition at line 66 of file mouse_desc.h.

◆ USBD_SIZ_STRING_LANGID

#define USBD_SIZ_STRING_LANGID 4

Definition at line 73 of file mouse_desc.h.

◆ USBD_SIZ_STRING_SERIAL

#define USBD_SIZ_STRING_SERIAL 0x1A

Definition at line 74 of file mouse_desc.h.

◆ USBD_VENDOR_ID

#define USBD_VENDOR_ID 0x2E3C

usb vendor id and product id define

Definition at line 65 of file mouse_desc.h.


AT32F415 Firmwary Library: USB_msc_bot_scsi

Modules
USB_msc_bot_scsi
AT32F415_middlewares_usbd_class

usb device class mass storage demo More...

Modules

USB_msc_bot_functions
USB_msc_bot_scsi_definition

Detailed Description

usb device class mass storage demo


AT32F415 Firmwary Library: USB_msc_bot_functions

Functions | Variables
USB_msc_bot_functions
AT32F415_middlewares_usbd_class » USB_msc_bot_scsi

Functions

void | bot_scsi_init (void *udev)
initialize bulk-only transport and scsi More...
void | bot_scsi_reset (void *udev)
reset bulk-only transport and scsi More...
void | bot_scsi_datain_handler (void *udev, uint8_t ept_num)
bulk-only transport data in handler More...
void | bot_scsi_dataout_handler (void *udev, uint8_t ept_num)
bulk-only transport data out handler More...
void | bot_cbw_decode (void *udev)
bulk-only cbw decode More...
void | bot_scsi_send_data (void *udev, uint8_t *buffer, uint32_t len)
send bot data More...
void | bot_scsi_send_csw (void *udev, uint8_t status)
send command status More...
void | bot_scsi_sense_code (void *udev, uint8_t sense_key, uint8_t asc)
send scsi sense code More...
usb_sts_type | bot_scsi_check_address (void *udev, uint8_t lun, uint32_t blk_offset, uint32_t blk_count)
check address More...
void | bot_scsi_stall (void *udev)
bot endpoint stall More...
usb_sts_type | bot_scsi_test_unit (void *udev, uint8_t lun)
bulk-only transport scsi command test unit More...
usb_sts_type | bot_scsi_inquiry (void *udev, uint8_t lun)
bulk-only transport scsi command inquiry More...
usb_sts_type | bot_scsi_start_stop (void *udev, uint8_t lun)
bulk-only transport scsi command start stop More...
usb_sts_type | bot_scsi_allow_medium_removal (void *udev, uint8_t lun)
bulk-only transport scsi command meidum removal More...
usb_sts_type | bot_scsi_mode_sense6 (void *udev, uint8_t lun)
bulk-only transport scsi command mode sense6 More...
usb_sts_type | bot_scsi_mode_sense10 (void *udev, uint8_t lun)
bulk-only transport scsi command mode sense10 More...
usb_sts_type | bot_scsi_capacity (void *udev, uint8_t lun)
bulk-only transport scsi command capacity More...
usb_sts_type | bot_scsi_format_capacity (void *udev, uint8_t lun)
bulk-only transport scsi command format capacity More...
usb_sts_type | bot_scsi_request_sense (void *udev, uint8_t lun)
bulk-only transport scsi command request sense More...
usb_sts_type | bot_scsi_verify (void *udev, uint8_t lun)
bulk-only transport scsi command verify More...
usb_sts_type | bot_scsi_read10 (void *udev, uint8_t lun)
bulk-only transport scsi command read10 More...
usb_sts_type | bot_scsi_write10 (void *udev, uint8_t lun)
bulk-only transport scsi command write10 More...
void | bot_scsi_clear_feature (void *udev, uint8_t ept_num)
clear feature More...
usb_sts_type | bot_scsi_cmd_process (void *udev)
bulk-only transport scsi command process More...

Variables

msc_type msc_struct
cbw_type cbw_struct
csw_type csw_struct
ALIGNED_HEAD uint8_t page00_inquiry_data[] ALIGNED_TAIL

Detailed Description

Function Documentation

◆ bot_cbw_decode()

void bot_cbw_decode ( void * udev )

bulk-only cbw decode

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 198 of file msc_bot_scsi.c.

Referenced by bot_scsi_dataout_handler().

◆ bot_scsi_allow_medium_removal()

usb_sts_type bot_scsi_allow_medium_removal | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command meidum removal

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 411 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_capacity()

usb_sts_type bot_scsi_capacity | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command capacity

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 459 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_check_address()

usb_sts_type bot_scsi_check_address | ( | void * | udev,
 |  | uint8_t | lun,
 |  | uint32_t | blk_offset,
 |  | uint32_t | blk_count
 | ) |  |

check address

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
blk_offset | blk offset address
blk_count | blk number
Return values
usb_sts_type

Definition at line 302 of file msc_bot_scsi.c.

Referenced by bot_scsi_read10(), bot_scsi_verify(), and bot_scsi_write10().

◆ bot_scsi_clear_feature()

void bot_scsi_clear_feature | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

clear feature

Parameters
udev | to the structure of usbd_core_type
etp_num | endpoint number
Return values
status of usb_sts_type

Definition at line 702 of file msc_bot_scsi.c.

Referenced by class_setup_handler().

◆ bot_scsi_cmd_process()

usb_sts_type bot_scsi_cmd_process ( void * udev )

bulk-only transport scsi command process

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 722 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode(), bot_scsi_datain_handler(), and bot_scsi_dataout_handler().

◆ bot_scsi_datain_handler()

void bot_scsi_datain_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

bulk-only transport data in handler

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
none

Definition at line 149 of file msc_bot_scsi.c.

Referenced by class_in_handler().

◆ bot_scsi_dataout_handler()

void bot_scsi_dataout_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

bulk-only transport data out handler

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
none

Definition at line 176 of file msc_bot_scsi.c.

Referenced by class_out_handler().

◆ bot_scsi_format_capacity()

usb_sts_type bot_scsi_format_capacity | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command format capacity

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 485 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_init()

void bot_scsi_init ( void * udev )

initialize bulk-only transport and scsi

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 113 of file msc_bot_scsi.c.

Referenced by class_init_handler().

◆ bot_scsi_inquiry()

usb_sts_type bot_scsi_inquiry | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command inquiry

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 360 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_mode_sense10()

usb_sts_type bot_scsi_mode_sense10 | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command mode sense10

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 441 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_mode_sense6()

usb_sts_type bot_scsi_mode_sense6 | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command mode sense6

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 423 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_read10()

usb_sts_type bot_scsi_read10 | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command read10

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 573 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_request_sense()

usb_sts_type bot_scsi_request_sense | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command request sense

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 518 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_reset()

void bot_scsi_reset ( void * udev )

reset bulk-only transport and scsi

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 131 of file msc_bot_scsi.c.

Referenced by class_setup_handler().

◆ bot_scsi_send_csw()

void bot_scsi_send_csw | ( | void * | udev,
 |  | uint8_t | status
 | ) |  |

send command status

Parameters
udev | to the structure of usbd_core_type
status | csw status
Return values
none

Definition at line 264 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode(), bot_scsi_clear_feature(), bot_scsi_datain_handler(), bot_scsi_dataout_handler(), and bot_scsi_write10().

◆ bot_scsi_send_data()

void bot_scsi_send_data | ( | void * | udev,
 |  | uint8_t * | buffer,
 |  | uint32_t | len
 | ) |  |

send bot data

Parameters
udev | to the structure of usbd_core_type
buffer | data buffer
len | data len
Return values
none

Definition at line 244 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode().

◆ bot_scsi_sense_code()

void bot_scsi_sense_code | ( | void * | udev,
 |  | uint8_t | sense_key,
 |  | uint8_t | asc
 | ) |  |

send scsi sense code

Parameters
udev | to the structure of usbd_core_type
sense_key | sense key
asc | asc
Return values
none

Definition at line 287 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode(), bot_scsi_check_address(), bot_scsi_cmd_process(), bot_scsi_read10(), bot_scsi_test_unit(), bot_scsi_verify(), and bot_scsi_write10().

◆ bot_scsi_stall()

void bot_scsi_stall ( void * udev )

bot endpoint stall

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 317 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode().

◆ bot_scsi_start_stop()

usb_sts_type bot_scsi_start_stop | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command start stop

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 399 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_test_unit()

usb_sts_type bot_scsi_test_unit | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command test unit

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 341 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_verify()

usb_sts_type bot_scsi_verify | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command verify

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 547 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_write10()

usb_sts_type bot_scsi_write10 | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command write10

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 633 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

Variable Documentation

◆ ALIGNED_TAIL

ALIGNED_HEAD uint8_t mode_sense10_data [8] ALIGNED_TAIL
Initial value:
= {
0x00,
0x00,
0x00,
0x00,
0x00,
}

Definition at line 55 of file msc_bot_scsi.c.

◆ cbw_struct

cbw_type cbw_struct

Definition at line 43 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode(), bot_scsi_cmd_process(), bot_scsi_init(), bot_scsi_inquiry(), bot_scsi_read10(), bot_scsi_request_sense(), bot_scsi_reset(), bot_scsi_send_csw(), bot_scsi_send_data(), bot_scsi_stall(), bot_scsi_test_unit(), bot_scsi_verify(), and bot_scsi_write10().

◆ csw_struct

csw_type csw_struct
Initial value:
=
{
0x53425355 ,
0x00,
0x00,
0x00 ,
}

Definition at line 44 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode(), bot_scsi_read10(), bot_scsi_send_csw(), bot_scsi_send_data(), and bot_scsi_write10().

◆ msc_struct

msc_type msc_struct

Definition at line 42 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode(), bot_scsi_allow_medium_removal(), bot_scsi_capacity(), bot_scsi_check_address(), bot_scsi_clear_feature(), bot_scsi_datain_handler(), bot_scsi_dataout_handler(), bot_scsi_format_capacity(), bot_scsi_init(), bot_scsi_inquiry(), bot_scsi_mode_sense10(), bot_scsi_mode_sense6(), bot_scsi_read10(), bot_scsi_request_sense(), bot_scsi_reset(), bot_scsi_send_csw(), bot_scsi_send_data(), bot_scsi_stall(), bot_scsi_start_stop(), bot_scsi_test_unit(), bot_scsi_verify(), bot_scsi_write10(), class_setup_handler(), msc_bot_scsi_init(), usb_bot_request(), usbh_cmd_capacity10(), and usbh_cmd_inquiry().


AT32F415 Firmwary Library: USB_msc_bot_scsi_definition

Data Structures | Macros | Functions
USB_msc_bot_scsi_definition
AT32F415_middlewares_usbd_class » USB_msc_bot_scsi

Data Structures

struct | cbd_typical_type
typical command block description More...
struct | cbd_extended_type
extended command block description More...
struct | cbw_type
command block wrapper More...
struct | csw_type
command block wrapper More...
struct | sense_type
request sense standard data More...
struct | msc_type

Macros

#define | MSC_SUPPORT_MAX_LUN 1
#define | MSC_MAX_DATA_BUF_LEN 4096
#define | MSC_CMD_FORMAT_UNIT 0x04
#define | MSC_CMD_INQUIRY 0x12
#define | MSC_CMD_START_STOP 0x1B
#define | MSC_CMD_MODE_SENSE6 0x1A
#define | MSC_CMD_MODE_SENSE10 0x5A
#define | MSC_CMD_ALLOW_MEDIUM_REMOVAL 0x1E
#define | MSC_CMD_READ_10 0x28
#define | MSC_CMD_READ_12 0xA8
#define | MSC_CMD_READ_CAPACITY 0x25
#define | MSC_CMD_READ_FORMAT_CAPACITY 0x23
#define | MSC_CMD_REQUEST_SENSE 0x03
#define | MSC_CMD_TEST_UNIT 0x00
#define | MSC_CMD_VERIFY 0x2F
#define | MSC_CMD_WRITE_10 0x2A
#define | MSC_CMD_WRITE_12 0xAA
#define | MSC_CMD_WRITE_VERIFY 0x2E
#define | MSC_REQ_GET_MAX_LUN 0xFE
#define | MSC_REQ_BO_RESET 0xFF
#define | SET_LINE_CODING 0x20
#define | GET_LINE_CODING 0x21
#define | CBW_CMD_LENGTH 31
#define | CBW_DCBWSIGNATURE 0x43425355
#define | CBW_BMCBWFLAGS_DIR_OUT 0x00
#define | CBW_BMCBWFLAGS_DIR_IN 0x80
#define | CSW_CMD_LENGTH 13
#define | CSW_DCSWSIGNATURE 0x53425355
#define | CSW_BCSWSTATUS_PASS 0x00
#define | CSW_BCSWSTATUS_FAILED 0x01
#define | CSW_BCSWSTATUS_PHASE_ERR 0x02
#define | MSC_STATE_MACHINE_CMD 0x00
#define | MSC_STATE_MACHINE_DATA_IN 0x01
#define | MSC_STATE_MACHINE_DATA_OUT 0x02
#define | MSC_STATE_MACHINE_SEND_DATA 0x03
#define | MSC_STATE_MACHINE_LAST_DATA 0x04
#define | MSC_STATE_MACHINE_STATUS 0x05
#define | MSC_STATE_MACHINE_FAILED 0x06
#define | MSC_STATE_MACHINE_IDLE 0x07
#define | MSC_BOT_STATE_IDLE 0x00
#define | MSC_BOT_STATE_RECOVERY 0x01
#define | MSC_BOT_STATE_ERROR 0x02
#define | REQ_SENSE_STANDARD_DATA_LEN 0x12
#define | SENSE_KEY_NO_SENSE 0x00
#define | SENSE_KEY_RECOVERED_ERROR 0x01
#define | SENSE_KEY_NOT_READY 0x02
#define | SENSE_KEY_MEDIUM_ERROR 0x03
#define | SENSE_KEY_HARDWARE_ERROR 0x04
#define | SENSE_KEY_ILLEGAL_REQUEST 0x05
#define | SENSE_KEY_UNIT_ATTENTION 0x06
#define | SENSE_KEY_DATA_PROTECT 0x07
#define | SENSE_KEY_BLANK_CHECK 0x08
#define | SENSE_KEY_VENDERO_SPECIFIC 0x09
#define | SENSE_KEY_ABORTED_COMMAND 0x0B
#define | SENSE_KEY_VOLUME_OVERFLOW 0x0D
#define | SENSE_KEY_MISCOMPARE 0x0E
#define | INVALID_COMMAND 0x20
#define | INVALID_FIELED_IN_COMMAND 0x24
#define | PARAMETER_LIST_LENGTH_ERROR 0x1A
#define | INVALID_FIELD_IN_PARAMETER_LIST 0x26
#define | ADDRESS_OUT_OF_RANGE 0x21
#define | MEDIUM_NOT_PRESENT 0x3A
#define | MEDIUM_HAVE_CHANGED 0x28
#define | SCSI_INQUIRY_DATA_LENGTH 36

Functions

void | bot_scsi_init (void *udev)
initialize bulk-only transport and scsi More...
void | bot_scsi_reset (void *udev)
reset bulk-only transport and scsi More...
void | bot_scsi_datain_handler (void *pudev, uint8_t ept_num)
bulk-only transport data in handler More...
void | bot_scsi_dataout_handler (void *pudev, uint8_t ept_num)
bulk-only transport data out handler More...
void | bot_cbw_decode (void *udev)
bulk-only cbw decode More...
void | bot_scsi_send_data (void *udev, uint8_t *buffer, uint32_t len)
send bot data More...
void | bot_scsi_send_csw (void *udev, uint8_t status)
send command status More...
void | bot_scsi_sense_code (void *udev, uint8_t sense_key, uint8_t asc)
send scsi sense code More...
usb_sts_type | bot_scsi_check_address (void *udev, uint8_t lun, uint32_t blk_offset, uint32_t blk_count)
check address More...
void | bot_scsi_stall (void *udev)
bot endpoint stall More...
usb_sts_type | bot_scsi_cmd_process (void *udev)
bulk-only transport scsi command process More...
usb_sts_type | bot_scsi_test_unit (void *udev, uint8_t lun)
bulk-only transport scsi command test unit More...
usb_sts_type | bot_scsi_inquiry (void *udev, uint8_t lun)
bulk-only transport scsi command inquiry More...
usb_sts_type | bot_scsi_start_stop (void *udev, uint8_t lun)
bulk-only transport scsi command start stop More...
usb_sts_type | bot_scsi_allow_medium_removal (void *udev, uint8_t lun)
bulk-only transport scsi command meidum removal More...
usb_sts_type | bot_scsi_mode_sense6 (void *udev, uint8_t lun)
bulk-only transport scsi command mode sense6 More...
usb_sts_type | bot_scsi_mode_sense10 (void *udev, uint8_t lun)
bulk-only transport scsi command mode sense10 More...
usb_sts_type | bot_scsi_read10 (void *udev, uint8_t lun)
bulk-only transport scsi command read10 More...
usb_sts_type | bot_scsi_capacity (void *udev, uint8_t lun)
bulk-only transport scsi command capacity More...
usb_sts_type | bot_scsi_format_capacity (void *udev, uint8_t lun)
bulk-only transport scsi command format capacity More...
usb_sts_type | bot_scsi_request_sense (void *udev, uint8_t lun)
bulk-only transport scsi command request sense More...
usb_sts_type | bot_scsi_verify (void *udev, uint8_t lun)
bulk-only transport scsi command verify More...
usb_sts_type | bot_scsi_write10 (void *udev, uint8_t lun)
bulk-only transport scsi command write10 More...
void | bot_scsi_clear_feature (void *udev, uint8_t ept_num)
clear feature More...

Detailed Description

Macro Definition Documentation

◆ ADDRESS_OUT_OF_RANGE

#define ADDRESS_OUT_OF_RANGE 0x21

Definition at line 119 of file msc_bot_scsi.h.

◆ CBW_BMCBWFLAGS_DIR_IN

#define CBW_BMCBWFLAGS_DIR_IN 0x80

Definition at line 78 of file msc_bot_scsi.h.

◆ CBW_BMCBWFLAGS_DIR_OUT

#define CBW_BMCBWFLAGS_DIR_OUT 0x00

Definition at line 77 of file msc_bot_scsi.h.

◆ CBW_CMD_LENGTH

#define CBW_CMD_LENGTH 31

Definition at line 75 of file msc_bot_scsi.h.

◆ CBW_DCBWSIGNATURE

#define CBW_DCBWSIGNATURE 0x43425355

Definition at line 76 of file msc_bot_scsi.h.

◆ CSW_BCSWSTATUS_FAILED

#define CSW_BCSWSTATUS_FAILED 0x01

Definition at line 83 of file msc_bot_scsi.h.

◆ CSW_BCSWSTATUS_PASS

#define CSW_BCSWSTATUS_PASS 0x00

Definition at line 82 of file msc_bot_scsi.h.

◆ CSW_BCSWSTATUS_PHASE_ERR

#define CSW_BCSWSTATUS_PHASE_ERR 0x02

Definition at line 84 of file msc_bot_scsi.h.

◆ CSW_CMD_LENGTH

#define CSW_CMD_LENGTH 13

Definition at line 80 of file msc_bot_scsi.h.

◆ CSW_DCSWSIGNATURE

#define CSW_DCSWSIGNATURE 0x53425355

Definition at line 81 of file msc_bot_scsi.h.

◆ GET_LINE_CODING

#define GET_LINE_CODING 0x21

Definition at line 73 of file msc_bot_scsi.h.

◆ INVALID_COMMAND

#define INVALID_COMMAND 0x20

Definition at line 115 of file msc_bot_scsi.h.

◆ INVALID_FIELD_IN_PARAMETER_LIST

#define INVALID_FIELD_IN_PARAMETER_LIST 0x26

Definition at line 118 of file msc_bot_scsi.h.

◆ INVALID_FIELED_IN_COMMAND

#define INVALID_FIELED_IN_COMMAND 0x24

Definition at line 116 of file msc_bot_scsi.h.

◆ MEDIUM_HAVE_CHANGED

#define MEDIUM_HAVE_CHANGED 0x28

Definition at line 121 of file msc_bot_scsi.h.

◆ MEDIUM_NOT_PRESENT

#define MEDIUM_NOT_PRESENT 0x3A

Definition at line 120 of file msc_bot_scsi.h.

◆ MSC_BOT_STATE_ERROR

#define MSC_BOT_STATE_ERROR 0x02

Definition at line 97 of file msc_bot_scsi.h.

◆ MSC_BOT_STATE_IDLE

#define MSC_BOT_STATE_IDLE 0x00

Definition at line 95 of file msc_bot_scsi.h.

◆ MSC_BOT_STATE_RECOVERY

#define MSC_BOT_STATE_RECOVERY 0x01

Definition at line 96 of file msc_bot_scsi.h.

◆ MSC_CMD_ALLOW_MEDIUM_REMOVAL

#define MSC_CMD_ALLOW_MEDIUM_REMOVAL 0x1E

Definition at line 57 of file msc_bot_scsi.h.

◆ MSC_CMD_FORMAT_UNIT

#define MSC_CMD_FORMAT_UNIT 0x04

Definition at line 52 of file msc_bot_scsi.h.

◆ MSC_CMD_INQUIRY

#define MSC_CMD_INQUIRY 0x12

Definition at line 53 of file msc_bot_scsi.h.

◆ MSC_CMD_MODE_SENSE10

#define MSC_CMD_MODE_SENSE10 0x5A

Definition at line 56 of file msc_bot_scsi.h.

◆ MSC_CMD_MODE_SENSE6

#define MSC_CMD_MODE_SENSE6 0x1A

Definition at line 55 of file msc_bot_scsi.h.

◆ MSC_CMD_READ_10

#define MSC_CMD_READ_10 0x28

Definition at line 58 of file msc_bot_scsi.h.

◆ MSC_CMD_READ_12

#define MSC_CMD_READ_12 0xA8

Definition at line 59 of file msc_bot_scsi.h.

◆ MSC_CMD_READ_CAPACITY

#define MSC_CMD_READ_CAPACITY 0x25

Definition at line 60 of file msc_bot_scsi.h.

◆ MSC_CMD_READ_FORMAT_CAPACITY

#define MSC_CMD_READ_FORMAT_CAPACITY 0x23

Definition at line 61 of file msc_bot_scsi.h.

◆ MSC_CMD_REQUEST_SENSE

#define MSC_CMD_REQUEST_SENSE 0x03

Definition at line 62 of file msc_bot_scsi.h.

◆ MSC_CMD_START_STOP

#define MSC_CMD_START_STOP 0x1B

Definition at line 54 of file msc_bot_scsi.h.

◆ MSC_CMD_TEST_UNIT

#define MSC_CMD_TEST_UNIT 0x00

Definition at line 63 of file msc_bot_scsi.h.

◆ MSC_CMD_VERIFY

#define MSC_CMD_VERIFY 0x2F

Definition at line 64 of file msc_bot_scsi.h.

◆ MSC_CMD_WRITE_10

#define MSC_CMD_WRITE_10 0x2A

Definition at line 65 of file msc_bot_scsi.h.

◆ MSC_CMD_WRITE_12

#define MSC_CMD_WRITE_12 0xAA

Definition at line 66 of file msc_bot_scsi.h.

◆ MSC_CMD_WRITE_VERIFY

#define MSC_CMD_WRITE_VERIFY 0x2E

Definition at line 67 of file msc_bot_scsi.h.

◆ MSC_MAX_DATA_BUF_LEN

#define MSC_MAX_DATA_BUF_LEN 4096

Definition at line 50 of file msc_bot_scsi.h.

◆ MSC_REQ_BO_RESET

#define MSC_REQ_BO_RESET 0xFF

bulk only mass storage reset

Definition at line 70 of file msc_bot_scsi.h.

◆ MSC_REQ_GET_MAX_LUN

#define MSC_REQ_GET_MAX_LUN 0xFE

get max lun

Definition at line 69 of file msc_bot_scsi.h.

◆ MSC_STATE_MACHINE_CMD

#define MSC_STATE_MACHINE_CMD 0x00

Definition at line 86 of file msc_bot_scsi.h.

◆ MSC_STATE_MACHINE_DATA_IN

#define MSC_STATE_MACHINE_DATA_IN 0x01

Definition at line 87 of file msc_bot_scsi.h.

◆ MSC_STATE_MACHINE_DATA_OUT

#define MSC_STATE_MACHINE_DATA_OUT 0x02

Definition at line 88 of file msc_bot_scsi.h.

◆ MSC_STATE_MACHINE_FAILED

#define MSC_STATE_MACHINE_FAILED 0x06

Definition at line 92 of file msc_bot_scsi.h.

◆ MSC_STATE_MACHINE_IDLE

#define MSC_STATE_MACHINE_IDLE 0x07

Definition at line 93 of file msc_bot_scsi.h.

◆ MSC_STATE_MACHINE_LAST_DATA

#define MSC_STATE_MACHINE_LAST_DATA 0x04

Definition at line 90 of file msc_bot_scsi.h.

◆ MSC_STATE_MACHINE_SEND_DATA

#define MSC_STATE_MACHINE_SEND_DATA 0x03

Definition at line 89 of file msc_bot_scsi.h.

◆ MSC_STATE_MACHINE_STATUS

#define MSC_STATE_MACHINE_STATUS 0x05

Definition at line 91 of file msc_bot_scsi.h.

◆ MSC_SUPPORT_MAX_LUN

#define MSC_SUPPORT_MAX_LUN 1

Definition at line 49 of file msc_bot_scsi.h.

◆ PARAMETER_LIST_LENGTH_ERROR

#define PARAMETER_LIST_LENGTH_ERROR 0x1A

Definition at line 117 of file msc_bot_scsi.h.

◆ REQ_SENSE_STANDARD_DATA_LEN

#define REQ_SENSE_STANDARD_DATA_LEN 0x12

Definition at line 99 of file msc_bot_scsi.h.

◆ SCSI_INQUIRY_DATA_LENGTH

#define SCSI_INQUIRY_DATA_LENGTH 36

Definition at line 123 of file msc_bot_scsi.h.

◆ SENSE_KEY_ABORTED_COMMAND

#define SENSE_KEY_ABORTED_COMMAND 0x0B

Definition at line 110 of file msc_bot_scsi.h.

◆ SENSE_KEY_BLANK_CHECK

#define SENSE_KEY_BLANK_CHECK 0x08

Definition at line 108 of file msc_bot_scsi.h.

◆ SENSE_KEY_DATA_PROTECT

#define SENSE_KEY_DATA_PROTECT 0x07

Definition at line 107 of file msc_bot_scsi.h.

◆ SENSE_KEY_HARDWARE_ERROR

#define SENSE_KEY_HARDWARE_ERROR 0x04

Definition at line 104 of file msc_bot_scsi.h.

◆ SENSE_KEY_ILLEGAL_REQUEST

#define SENSE_KEY_ILLEGAL_REQUEST 0x05

Definition at line 105 of file msc_bot_scsi.h.

◆ SENSE_KEY_MEDIUM_ERROR

#define SENSE_KEY_MEDIUM_ERROR 0x03

Definition at line 103 of file msc_bot_scsi.h.

◆ SENSE_KEY_MISCOMPARE

#define SENSE_KEY_MISCOMPARE 0x0E

Definition at line 112 of file msc_bot_scsi.h.

◆ SENSE_KEY_NO_SENSE

#define SENSE_KEY_NO_SENSE 0x00

Definition at line 100 of file msc_bot_scsi.h.

◆ SENSE_KEY_NOT_READY

#define SENSE_KEY_NOT_READY 0x02

Definition at line 102 of file msc_bot_scsi.h.

◆ SENSE_KEY_RECOVERED_ERROR

#define SENSE_KEY_RECOVERED_ERROR 0x01

Definition at line 101 of file msc_bot_scsi.h.

◆ SENSE_KEY_UNIT_ATTENTION

#define SENSE_KEY_UNIT_ATTENTION 0x06

Definition at line 106 of file msc_bot_scsi.h.

◆ SENSE_KEY_VENDERO_SPECIFIC

#define SENSE_KEY_VENDERO_SPECIFIC 0x09

Definition at line 109 of file msc_bot_scsi.h.

◆ SENSE_KEY_VOLUME_OVERFLOW

#define SENSE_KEY_VOLUME_OVERFLOW 0x0D

Definition at line 111 of file msc_bot_scsi.h.

◆ SET_LINE_CODING

#define SET_LINE_CODING 0x20

Definition at line 72 of file msc_bot_scsi.h.

Function Documentation

◆ bot_cbw_decode()

void bot_cbw_decode ( void * udev )

bulk-only cbw decode

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 198 of file msc_bot_scsi.c.

Referenced by bot_scsi_dataout_handler().

◆ bot_scsi_allow_medium_removal()

usb_sts_type bot_scsi_allow_medium_removal | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command meidum removal

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 411 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_capacity()

usb_sts_type bot_scsi_capacity | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command capacity

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 459 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_check_address()

usb_sts_type bot_scsi_check_address | ( | void * | udev,
 |  | uint8_t | lun,
 |  | uint32_t | blk_offset,
 |  | uint32_t | blk_count
 | ) |  |

check address

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
blk_offset | blk offset address
blk_count | blk number
Return values
usb_sts_type

Definition at line 302 of file msc_bot_scsi.c.

Referenced by bot_scsi_read10(), bot_scsi_verify(), and bot_scsi_write10().

◆ bot_scsi_clear_feature()

void bot_scsi_clear_feature | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

clear feature

Parameters
udev | to the structure of usbd_core_type
etp_num | endpoint number
Return values
status of usb_sts_type

Definition at line 702 of file msc_bot_scsi.c.

Referenced by class_setup_handler().

◆ bot_scsi_cmd_process()

usb_sts_type bot_scsi_cmd_process ( void * udev )

bulk-only transport scsi command process

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 722 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode(), bot_scsi_datain_handler(), and bot_scsi_dataout_handler().

◆ bot_scsi_datain_handler()

void bot_scsi_datain_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

bulk-only transport data in handler

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
none

Definition at line 149 of file msc_bot_scsi.c.

Referenced by class_in_handler().

◆ bot_scsi_dataout_handler()

void bot_scsi_dataout_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

bulk-only transport data out handler

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
none

Definition at line 176 of file msc_bot_scsi.c.

Referenced by class_out_handler().

◆ bot_scsi_format_capacity()

usb_sts_type bot_scsi_format_capacity | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command format capacity

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 485 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_init()

void bot_scsi_init ( void * udev )

initialize bulk-only transport and scsi

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 113 of file msc_bot_scsi.c.

Referenced by class_init_handler().

◆ bot_scsi_inquiry()

usb_sts_type bot_scsi_inquiry | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command inquiry

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 360 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_mode_sense10()

usb_sts_type bot_scsi_mode_sense10 | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command mode sense10

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 441 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_mode_sense6()

usb_sts_type bot_scsi_mode_sense6 | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command mode sense6

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 423 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_read10()

usb_sts_type bot_scsi_read10 | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command read10

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 573 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_request_sense()

usb_sts_type bot_scsi_request_sense | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command request sense

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 518 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_reset()

void bot_scsi_reset ( void * udev )

reset bulk-only transport and scsi

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 131 of file msc_bot_scsi.c.

Referenced by class_setup_handler().

◆ bot_scsi_send_csw()

void bot_scsi_send_csw | ( | void * | udev,
 |  | uint8_t | status
 | ) |  |

send command status

Parameters
udev | to the structure of usbd_core_type
status | csw status
Return values
none

Definition at line 264 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode(), bot_scsi_clear_feature(), bot_scsi_datain_handler(), bot_scsi_dataout_handler(), and bot_scsi_write10().

◆ bot_scsi_send_data()

void bot_scsi_send_data | ( | void * | udev,
 |  | uint8_t * | buffer,
 |  | uint32_t | len
 | ) |  |

send bot data

Parameters
udev | to the structure of usbd_core_type
buffer | data buffer
len | data len
Return values
none

Definition at line 244 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode().

◆ bot_scsi_sense_code()

void bot_scsi_sense_code | ( | void * | udev,
 |  | uint8_t | sense_key,
 |  | uint8_t | asc
 | ) |  |

send scsi sense code

Parameters
udev | to the structure of usbd_core_type
sense_key | sense key
asc | asc
Return values
none

Definition at line 287 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode(), bot_scsi_check_address(), bot_scsi_cmd_process(), bot_scsi_read10(), bot_scsi_test_unit(), bot_scsi_verify(), and bot_scsi_write10().

◆ bot_scsi_stall()

void bot_scsi_stall ( void * udev )

bot endpoint stall

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 317 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode().

◆ bot_scsi_start_stop()

usb_sts_type bot_scsi_start_stop | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command start stop

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 399 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_test_unit()

usb_sts_type bot_scsi_test_unit | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command test unit

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 341 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_verify()

usb_sts_type bot_scsi_verify | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command verify

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 547 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().

◆ bot_scsi_write10()

usb_sts_type bot_scsi_write10 | ( | void * | udev,
 |  | uint8_t | lun
 | ) |  |

bulk-only transport scsi command write10

Parameters
udev | to the structure of usbd_core_type
lun | logical units number
Return values
status of usb_sts_type

Definition at line 633 of file msc_bot_scsi.c.

Referenced by bot_scsi_cmd_process().


AT32F415 Firmwary Library: cbd_typical_type Struct Reference

Data Fields
cbd_typical_type Struct Reference
AT32F415_middlewares_usbd_class » USB_msc_bot_scsi » USB_msc_bot_scsi_definition

typical command block description More...

#include <msc_bot_scsi.h>

Data Fields

uint8_t | opcode
uint8_t | lun
uint32_t | address
uint8_t | reserved1
uint32_t | alloc_length
uint16_t | reserved2

Detailed Description

typical command block description

Definition at line 128 of file msc_bot_scsi.h.

Field Documentation

◆ address

uint32_t cbd_typical_type::address

Definition at line 132 of file msc_bot_scsi.h.

◆ alloc_length

uint32_t cbd_typical_type::alloc_length

Definition at line 134 of file msc_bot_scsi.h.

◆ lun

uint8_t cbd_typical_type::lun

Definition at line 131 of file msc_bot_scsi.h.

◆ opcode

uint8_t cbd_typical_type::opcode

Definition at line 130 of file msc_bot_scsi.h.

◆ reserved1

uint8_t cbd_typical_type::reserved1

Definition at line 133 of file msc_bot_scsi.h.

◆ reserved2

uint16_t cbd_typical_type::reserved2

Definition at line 135 of file msc_bot_scsi.h.

The documentation for this struct was generated from the following file:
  • msc_bot_scsi.h


AT32F415 Firmwary Library: cbd_extended_type Struct Reference

Data Fields
cbd_extended_type Struct Reference
AT32F415_middlewares_usbd_class » USB_msc_bot_scsi » USB_msc_bot_scsi_definition

extended command block description More...

#include <msc_bot_scsi.h>

Data Fields

uint8_t | opcode
uint8_t | lun
uint32_t | address
uint8_t | reserved1
uint32_t | alloc_length
uint16_t | reserved2

Detailed Description

extended command block description

Definition at line 141 of file msc_bot_scsi.h.

Field Documentation

◆ address

uint32_t cbd_extended_type::address

Definition at line 145 of file msc_bot_scsi.h.

◆ alloc_length

uint32_t cbd_extended_type::alloc_length

Definition at line 147 of file msc_bot_scsi.h.

◆ lun

uint8_t cbd_extended_type::lun

Definition at line 144 of file msc_bot_scsi.h.

◆ opcode

uint8_t cbd_extended_type::opcode

Definition at line 143 of file msc_bot_scsi.h.

◆ reserved1

uint8_t cbd_extended_type::reserved1

Definition at line 146 of file msc_bot_scsi.h.

◆ reserved2

uint16_t cbd_extended_type::reserved2

Definition at line 148 of file msc_bot_scsi.h.

The documentation for this struct was generated from the following file:
  • msc_bot_scsi.h


AT32F415 Firmwary Library: cbw_type Struct Reference

Data Fields
cbw_type Struct Reference
AT32F415_middlewares_usbd_class » USB_msc_bot_scsi » USB_msc_bot_scsi_definition

command block wrapper More...

#include <msc_bot_scsi.h>

Data Fields

uint32_t | dCBWSignature
uint32_t | dCBWTage
uint32_t | dCBWDataTransferLength
uint8_t | bmCBWFlags
uint8_t | bCBWLUN
uint8_t | bCBWCBLength
uint8_t | CBWCB [16]

Detailed Description

command block wrapper

Definition at line 154 of file msc_bot_scsi.h.

Field Documentation

◆ bCBWCBLength

uint8_t cbw_type::bCBWCBLength

Definition at line 161 of file msc_bot_scsi.h.

Referenced by bot_cbw_decode().

◆ bCBWLUN

uint8_t cbw_type::bCBWLUN

Definition at line 160 of file msc_bot_scsi.h.

Referenced by bot_cbw_decode(), and bot_scsi_cmd_process().

◆ bmCBWFlags

uint8_t cbw_type::bmCBWFlags

Definition at line 159 of file msc_bot_scsi.h.

Referenced by bot_scsi_read10(), bot_scsi_stall(), and bot_scsi_write10().

◆ CBWCB

uint8_t cbw_type::CBWCB[16]

Definition at line 162 of file msc_bot_scsi.h.

Referenced by bot_scsi_cmd_process(), bot_scsi_inquiry(), bot_scsi_read10(), bot_scsi_verify(), and bot_scsi_write10().

◆ dCBWDataTransferLength

uint32_t cbw_type::dCBWDataTransferLength

Definition at line 158 of file msc_bot_scsi.h.

Referenced by bot_cbw_decode(), bot_scsi_inquiry(), bot_scsi_read10(), bot_scsi_request_sense(), bot_scsi_send_data(), bot_scsi_stall(), bot_scsi_test_unit(), and bot_scsi_write10().

◆ dCBWSignature

uint32_t cbw_type::dCBWSignature

Definition at line 156 of file msc_bot_scsi.h.

Referenced by bot_cbw_decode().

◆ dCBWTage

uint32_t cbw_type::dCBWTage

Definition at line 157 of file msc_bot_scsi.h.

Referenced by bot_cbw_decode().

The documentation for this struct was generated from the following file:
  • msc_bot_scsi.h


AT32F415 Firmwary Library: csw_type Struct Reference

Data Fields
csw_type Struct Reference
AT32F415_middlewares_usbd_class » USB_msc_bot_scsi » USB_msc_bot_scsi_definition

command block wrapper More...

#include <msc_bot_scsi.h>

Data Fields

uint32_t | dCSWSignature
uint32_t | dCSWTag
uint32_t | dCSWDataResidue
uint32_t | bCSWStatus

Detailed Description

command block wrapper

Definition at line 168 of file msc_bot_scsi.h.

Field Documentation

◆ bCSWStatus

uint32_t csw_type::bCSWStatus

Definition at line 173 of file msc_bot_scsi.h.

Referenced by bot_scsi_send_csw(), and bot_scsi_send_data().

◆ dCSWDataResidue

uint32_t csw_type::dCSWDataResidue

Definition at line 172 of file msc_bot_scsi.h.

Referenced by bot_cbw_decode(), bot_scsi_read10(), bot_scsi_send_data(), and bot_scsi_write10().

◆ dCSWSignature

uint32_t csw_type::dCSWSignature

Definition at line 170 of file msc_bot_scsi.h.

Referenced by bot_scsi_send_csw().

◆ dCSWTag

uint32_t csw_type::dCSWTag

Definition at line 171 of file msc_bot_scsi.h.

Referenced by bot_cbw_decode().

The documentation for this struct was generated from the following file:
  • msc_bot_scsi.h


AT32F415 Firmwary Library: sense_type Struct Reference

Data Fields
sense_type Struct Reference
AT32F415_middlewares_usbd_class » USB_msc_bot_scsi » USB_msc_bot_scsi_definition

request sense standard data More...

#include <msc_bot_scsi.h>

Data Fields

uint8_t | err_code
uint8_t | reserved1
uint8_t | sense_key
uint32_t | information
uint8_t | as_length
uint32_t | reserved2
uint8_t | asc
uint8_t | ascq
uint32_t | reserved3

Detailed Description

request sense standard data

Definition at line 179 of file msc_bot_scsi.h.

Field Documentation

◆ as_length

uint8_t sense_type::as_length

Definition at line 185 of file msc_bot_scsi.h.

◆ asc

uint8_t sense_type::asc

Definition at line 187 of file msc_bot_scsi.h.

◆ ascq

uint8_t sense_type::ascq

Definition at line 188 of file msc_bot_scsi.h.

◆ err_code

uint8_t sense_type::err_code

Definition at line 181 of file msc_bot_scsi.h.

◆ information

uint32_t sense_type::information

Definition at line 184 of file msc_bot_scsi.h.

◆ reserved1

uint8_t sense_type::reserved1

Definition at line 182 of file msc_bot_scsi.h.

◆ reserved2

uint32_t sense_type::reserved2

Definition at line 186 of file msc_bot_scsi.h.

◆ reserved3

uint32_t sense_type::reserved3

Definition at line 189 of file msc_bot_scsi.h.

◆ sense_key

uint8_t sense_type::sense_key

Definition at line 183 of file msc_bot_scsi.h.

The documentation for this struct was generated from the following file:
  • msc_bot_scsi.h


AT32F415 Firmwary Library: msc_type Struct Reference

Data Fields
msc_type Struct Reference
AT32F415_middlewares_usbd_class » USB_msc_bot_scsi » USB_msc_bot_scsi_definition

#include <msc_bot_scsi.h>

Data Fields

uint8_t | msc_state
uint8_t | bot_status
uint32_t | max_lun
uint32_t | blk_nbr [1]
uint32_t | blk_size [1]
uint32_t | blk_addr
uint32_t | blk_len
uint32_t | data_len
uint8_t | data [4096]

Detailed Description

Definition at line 193 of file msc_bot_scsi.h.

Field Documentation

◆ blk_addr

uint32_t msc_type::blk_addr

Definition at line 202 of file msc_bot_scsi.h.

Referenced by bot_scsi_read10(), bot_scsi_verify(), and bot_scsi_write10().

◆ blk_len

uint32_t msc_type::blk_len

Definition at line 203 of file msc_bot_scsi.h.

Referenced by bot_scsi_read10(), bot_scsi_verify(), and bot_scsi_write10().

◆ blk_nbr

uint32_t msc_type::blk_nbr[1]

Definition at line 199 of file msc_bot_scsi.h.

Referenced by bot_scsi_capacity(), bot_scsi_check_address(), and bot_scsi_format_capacity().

◆ blk_size

uint32_t msc_type::blk_size[1]

Definition at line 200 of file msc_bot_scsi.h.

Referenced by bot_scsi_capacity(), bot_scsi_format_capacity(), bot_scsi_read10(), and bot_scsi_write10().

◆ bot_status

uint8_t msc_type::bot_status

Definition at line 196 of file msc_bot_scsi.h.

Referenced by bot_cbw_decode(), bot_scsi_clear_feature(), bot_scsi_init(), bot_scsi_reset(), and bot_scsi_stall().

◆ data

uint8_t msc_type::data[4096]

Definition at line 206 of file msc_bot_scsi.h.

Referenced by bot_cbw_decode(), bot_scsi_capacity(), bot_scsi_format_capacity(), bot_scsi_inquiry(), bot_scsi_mode_sense10(), bot_scsi_mode_sense6(), bot_scsi_read10(), bot_scsi_request_sense(), bot_scsi_write10(), and usbh_cmd_capacity10().

◆ data_len

uint32_t msc_type::data_len

Definition at line 205 of file msc_bot_scsi.h.

Referenced by bot_cbw_decode(), bot_scsi_allow_medium_removal(), bot_scsi_capacity(), bot_scsi_format_capacity(), bot_scsi_inquiry(), bot_scsi_mode_sense10(), bot_scsi_mode_sense6(), bot_scsi_read10(), bot_scsi_request_sense(), bot_scsi_start_stop(), bot_scsi_test_unit(), and bot_scsi_verify().

◆ max_lun

uint32_t msc_type::max_lun

Definition at line 197 of file msc_bot_scsi.h.

Referenced by bot_scsi_init(), bot_scsi_reset(), class_setup_handler(), and msc_bot_scsi_init().

◆ msc_state

uint8_t msc_type::msc_state

Definition at line 195 of file msc_bot_scsi.h.

Referenced by bot_cbw_decode(), bot_scsi_datain_handler(), bot_scsi_dataout_handler(), bot_scsi_init(), bot_scsi_read10(), bot_scsi_reset(), bot_scsi_send_csw(), bot_scsi_send_data(), and bot_scsi_write10().

The documentation for this struct was generated from the following file:
  • msc_bot_scsi.h


AT32F415 Firmwary Library: USB_msc_class

Modules
USB_msc_class
AT32F415_middlewares_usbd_class

usb device class msc demo More...

Modules

USB_msc_class_private_functions
USB_msc_class_definition

Detailed Description

usb device class msc demo


AT32F415 Firmwary Library: USB_msc_class_private_functions

Functions | Variables
USB_msc_class_private_functions
AT32F415_middlewares_usbd_class » USB_msc_class

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device event handler More...

Variables

static uint32_t | alt_setting = 0
msc_type msc_struct
cbw_type cbw_struct
csw_type csw_struct
usbd_class_handler | msc_class_handler

Detailed Description

Function Documentation

◆ class_clear_handler()

usb_sts_type class_clear_handler ( void * udev )

clear endpoint or other state

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 101 of file msc_class.c.

◆ class_ept0_rx_handler()

usb_sts_type class_ept0_rx_handler ( void * udev )

usb device endpoint 0 out status stage complete

Parameters
udev usb device core handler type
Return values
status of usb_sts_type

Definition at line 203 of file msc_class.c.

◆ class_ept0_tx_handler()

usb_sts_type class_ept0_tx_handler ( void * udev )

usb device endpoint 0 in status stage complete

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 189 of file msc_class.c.

◆ class_event_handler()

usb_sts_type class_event_handler | ( | void * | udev,
 |  | usbd_event_type | event
 | ) |  |

usb device event handler

Parameters
udev | to the structure of usbd_core_type
event | usb device event
Return values
status of usb_sts_type

Definition at line 260 of file msc_class.c.

◆ class_in_handler()

usb_sts_type class_in_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device transmision complete handler

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 218 of file msc_class.c.

◆ class_init_handler()

usb_sts_type class_init_handler ( void * udev )

initialize usb endpoint

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 80 of file msc_class.c.

◆ class_out_handler()

usb_sts_type class_out_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device endpoint receive data

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 233 of file msc_class.c.

◆ class_setup_handler()

usb_sts_type class_setup_handler | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb device class setup request handler

Parameters
udev | to the structure of usbd_core_type
setup | setup packet
Return values
status of usb_sts_type

< get max lun

< bulk only mass storage reset

Definition at line 121 of file msc_class.c.

◆ class_sof_handler()

usb_sts_type class_sof_handler ( void * udev )

usb device sof handler

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 245 of file msc_class.c.

Variable Documentation

◆ alt_setting

uint32_t alt_setting = 0
static

Definition at line 55 of file msc_class.c.

Referenced by class_setup_handler().

◆ cbw_struct

cbw_type cbw_struct
extern

Definition at line 43 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode(), bot_scsi_cmd_process(), bot_scsi_init(), bot_scsi_inquiry(), bot_scsi_read10(), bot_scsi_request_sense(), bot_scsi_reset(), bot_scsi_send_csw(), bot_scsi_send_data(), bot_scsi_stall(), bot_scsi_test_unit(), bot_scsi_verify(), and bot_scsi_write10().

◆ csw_struct

csw_type csw_struct
extern

Definition at line 44 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode(), bot_scsi_read10(), bot_scsi_send_csw(), bot_scsi_send_data(), and bot_scsi_write10().

◆ msc_class_handler

usbd_class_handler msc_class_handler
Initial value:
=
{
class_init_handler,
class_clear_handler,
class_setup_handler,
class_ept0_tx_handler,
class_ept0_rx_handler,
class_in_handler,
class_out_handler,
class_sof_handler,
class_event_handler,
}
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: msc_class.c:260
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: msc_class.c:245
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: msc_class.c:121
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: msc_class.c:189
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: msc_class.c:218
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb endpoint
Definition: msc_class.c:80
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: msc_class.c:203
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: msc_class.c:233
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: msc_class.c:101

Definition at line 62 of file msc_class.c.

Referenced by main().

◆ msc_struct

msc_type msc_struct
extern

Definition at line 42 of file msc_bot_scsi.c.

Referenced by bot_cbw_decode(), bot_scsi_allow_medium_removal(), bot_scsi_capacity(), bot_scsi_check_address(), bot_scsi_clear_feature(), bot_scsi_datain_handler(), bot_scsi_dataout_handler(), bot_scsi_format_capacity(), bot_scsi_init(), bot_scsi_inquiry(), bot_scsi_mode_sense10(), bot_scsi_mode_sense6(), bot_scsi_read10(), bot_scsi_request_sense(), bot_scsi_reset(), bot_scsi_send_csw(), bot_scsi_send_data(), bot_scsi_stall(), bot_scsi_start_stop(), bot_scsi_test_unit(), bot_scsi_verify(), bot_scsi_write10(), class_setup_handler(), msc_bot_scsi_init(), usb_bot_request(), usbh_cmd_capacity10(), and usbh_cmd_inquiry().


AT32F415 Firmwary Library: USB_msc_class_definition

Macros | Variables
USB_msc_class_definition
AT32F415_middlewares_usbd_class » USB_msc_class

Macros

#define | USBD_MSC_BULK_IN_EPT 0x81
#define | USBD_MSC_BULK_OUT_EPT 0x01
#define | USBD_IN_MAXPACKET_SIZE 0x40
#define | USBD_OUT_MAXPACKET_SIZE 0x40

Variables

usbd_class_handler msc_class_handler

Detailed Description

Macro Definition Documentation

◆ USBD_IN_MAXPACKET_SIZE

#define USBD_IN_MAXPACKET_SIZE 0x40

Definition at line 52 of file msc_class.h.

◆ USBD_MSC_BULK_IN_EPT

#define USBD_MSC_BULK_IN_EPT 0x81

Definition at line 49 of file msc_class.h.

◆ USBD_MSC_BULK_OUT_EPT

#define USBD_MSC_BULK_OUT_EPT 0x01

Definition at line 50 of file msc_class.h.

◆ USBD_OUT_MAXPACKET_SIZE

#define USBD_OUT_MAXPACKET_SIZE 0x40

Definition at line 53 of file msc_class.h.

Variable Documentation

◆ msc_class_handler

usbd_class_handler msc_class_handler
extern

Definition at line 62 of file msc_class.c.

Referenced by main().


AT32F415 Firmwary Library: USB_msc_desc

Modules
USB_msc_desc
AT32F415_middlewares_usbd_class

usb device msc descriptor More...

Modules

USB_msc_desc_private_functions
USB_msc_desc_definition

Detailed Description

usb device msc descriptor


AT32F415 Firmwary Library: USB_msc_desc_private_functions

Functions | Variables
USB_msc_desc_private_functions
AT32F415_middlewares_usbd_class » USB_msc_desc

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | msc_desc_handler
device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

Function Documentation

◆ get_device_config_string()

usbd_desc_t * get_device_config_string ( void )

get device config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 387 of file msc_desc.c.

◆ get_device_configuration()

usbd_desc_t * get_device_configuration ( void )

get config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 309 of file msc_desc.c.

◆ get_device_descriptor()

usbd_desc_t * get_device_descriptor ( void )

get device descriptor

Parameters
none
Return values
usbd_desc

Definition at line 289 of file msc_desc.c.

◆ get_device_interface_string()

usbd_desc_t * get_device_interface_string ( void )

get interface descriptor

Parameters
none
Return values
usbd_desc

Definition at line 375 of file msc_desc.c.

◆ get_device_lang_id()

usbd_desc_t * get_device_lang_id ( void )

get lang id descriptor

Parameters
none
Return values
usbd_desc

Definition at line 329 of file msc_desc.c.

◆ get_device_manufacturer_string()

usbd_desc_t * get_device_manufacturer_string ( void )

get manufacturer descriptor

Parameters
none
Return values
usbd_desc

Definition at line 340 of file msc_desc.c.

◆ get_device_other_speed()

usbd_desc_t * get_device_other_speed ( void )

get other speed descriptor

Parameters
none
Return values
usbd_desc

Definition at line 319 of file msc_desc.c.

◆ get_device_product_string()

usbd_desc_t * get_device_product_string ( void )

get product descriptor

Parameters
none
Return values
usbd_desc

Definition at line 352 of file msc_desc.c.

◆ get_device_qualifier()

usbd_desc_t * get_device_qualifier ( void )

get device qualifier

Parameters
none
Return values
usbd_desc

Definition at line 299 of file msc_desc.c.

◆ get_device_serial_string()

usbd_desc_t * get_device_serial_string ( void )

get serial descriptor

Parameters
none
Return values
usbd_desc

Definition at line 364 of file msc_desc.c.

◆ get_serial_num()

static void get_serial_num ( void )
static

usb get serial number

Parameters
none
Return values
none

Definition at line 267 of file msc_desc.c.

Referenced by get_device_serial_string().

◆ usbd_int_to_unicode()

static void usbd_int_to_unicode | ( | uint32_t | value,
 |  | uint8_t * | pbuf,
 |  | uint8_t | len
 | ) |  |
static

usb int convert to unicode

Parameters
value | int value
pbus | unicode buffer
len | length
Return values
none

Definition at line 241 of file msc_desc.c.

Referenced by get_serial_num().

◆ usbd_unicode_convert()

uint16_t usbd_unicode_convert | ( | uint8_t * | string,
 |  | uint8_t * | unicode_buf
 | ) |  |

standard usb unicode convert

Parameters
string | source string
unicode_buf | unicode buffer
Return values
length

Definition at line 215 of file msc_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

Variable Documentation

◆ ALIGNED_TAIL

ALIGNED_HEAD uint8_t g_string_serial [ 0x1A ] ALIGNED_TAIL
Initial value:
=
{
USB_DEVICE_DESC_LEN,
USB_DESCIPTOR_TYPE_DEVICE,
0x00,
0x02,
0x00,
0x00,
0x00,
USB_MAX_EP0_SIZE,
LBYTE( 0x2E3C ),
HBYTE( 0x2E3C ),
LBYTE( 0x5720 ),
HBYTE( 0x5720 ),
0x00,
0x02,
USB_MFC_STRING,
USB_PRODUCT_STRING,
USB_SERIAL_STRING,
1
}
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92

usb device standard descriptor

usb string serial

usb string lang id

usb configuration standard descriptor

Definition at line 84 of file msc_desc.c.

◆ config_descriptor

usbd_desc_t config_descriptor
Initial value:
=
{
32 ,
g_usbd_configuration
}
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112

Definition at line 187 of file msc_desc.c.

Referenced by get_device_configuration().

◆ device_descriptor

usbd_desc_t device_descriptor
Initial value:
=
{
USB_DEVICE_DESC_LEN,
g_usbd_descriptor
}
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]

Definition at line 180 of file msc_desc.c.

Referenced by get_device_descriptor().

◆ g_usbd_desc_buffer

uint8_t g_usbd_desc_buffer[256]
static

Definition at line 59 of file msc_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

◆ langid_descriptor

usbd_desc_t langid_descriptor
Initial value:
=
{
4 ,
g_string_lang_id
}

Definition at line 194 of file msc_desc.c.

Referenced by get_device_lang_id().

◆ msc_desc_handler

usbd_desc_handler msc_desc_handler
Initial value:
=
{
get_device_descriptor,
get_device_qualifier,
get_device_configuration,
get_device_other_speed,
get_device_lang_id,
get_device_manufacturer_string,
get_device_product_string,
get_device_serial_string,
get_device_interface_string,
get_device_config_string,
}
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: msc_desc.c:340
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: msc_desc.c:299
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: msc_desc.c:375
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: msc_desc.c:319
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: msc_desc.c:309
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: msc_desc.c:352
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: msc_desc.c:329
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: msc_desc.c:289
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: msc_desc.c:364
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: msc_desc.c:387

device descriptor handler structure

Definition at line 64 of file msc_desc.c.

Referenced by main().

◆ serial_descriptor

usbd_desc_t serial_descriptor
Initial value:
=
{
0x1A ,
g_string_serial
}

Definition at line 201 of file msc_desc.c.

Referenced by get_device_serial_string().

◆ vp_desc

usbd_desc_t vp_desc

Definition at line 207 of file msc_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().


AT32F415 Firmwary Library: USB_msc_desc_definition

Macros | Variables
USB_msc_desc_definition
AT32F415_middlewares_usbd_class » USB_msc_desc

Macros

#define | BCD_NUM 0x0110
#define | USBD_VENDOR_ID 0x2E3C
#define | USBD_PRODUCT_ID 0x5720
#define | USBD_CONFIG_DESC_SIZE 32
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
#define | USBD_DESC_PRODUCT_STRING "AT32 Mass Storage"
#define | USBD_DESC_CONFIGURATION_STRING "Mass Storage Config"
#define | USBD_DESC_INTERFACE_STRING "Mass Storage Interface"
#define | HID_BINTERVAL_TIME 0xFF
#define | USBD_CDC_CS_INTERFACE 0x24
#define | USBD_CDC_CS_ENDPOINT 0x25
#define | USBD_CDC_SUBTYPE_HEADER 0x00
#define | USBD_CDC_SUBTYPE_CMF 0x01
#define | USBD_CDC_SUBTYPE_ACM 0x02
#define | USBD_CDC_SUBTYPE_UFD 0x06
#define | MCU_ID1 (0x1FFFF7E8)
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [32]
usbd_desc_handler | msc_desc_handler
device descriptor handler structure More...

Detailed Description

Macro Definition Documentation

◆ BCD_NUM

#define BCD_NUM 0x0110

Definition at line 50 of file msc_desc.h.

◆ HID_BINTERVAL_TIME

#define HID_BINTERVAL_TIME 0xFF

Definition at line 64 of file msc_desc.h.

◆ MCU_ID1

#define MCU_ID1 (0x1FFFF7E8)

Definition at line 75 of file msc_desc.h.

◆ MCU_ID2

#define MCU_ID2 (0x1FFFF7EC)

Definition at line 76 of file msc_desc.h.

◆ MCU_ID3

#define MCU_ID3 (0x1FFFF7F0)

Definition at line 77 of file msc_desc.h.

◆ USBD_CDC_CS_ENDPOINT

#define USBD_CDC_CS_ENDPOINT 0x25

Definition at line 67 of file msc_desc.h.

◆ USBD_CDC_CS_INTERFACE

#define USBD_CDC_CS_INTERFACE 0x24

Definition at line 66 of file msc_desc.h.

◆ USBD_CDC_SUBTYPE_ACM

#define USBD_CDC_SUBTYPE_ACM 0x02

Definition at line 71 of file msc_desc.h.

◆ USBD_CDC_SUBTYPE_CMF

#define USBD_CDC_SUBTYPE_CMF 0x01

Definition at line 70 of file msc_desc.h.

◆ USBD_CDC_SUBTYPE_HEADER

#define USBD_CDC_SUBTYPE_HEADER 0x00

Definition at line 69 of file msc_desc.h.

◆ USBD_CDC_SUBTYPE_UFD

#define USBD_CDC_SUBTYPE_UFD 0x06

Definition at line 72 of file msc_desc.h.

◆ USBD_CONFIG_DESC_SIZE

#define USBD_CONFIG_DESC_SIZE 32

Definition at line 55 of file msc_desc.h.

◆ USBD_DESC_CONFIGURATION_STRING

#define USBD_DESC_CONFIGURATION_STRING "Mass Storage Config"

Definition at line 61 of file msc_desc.h.

◆ USBD_DESC_INTERFACE_STRING

#define USBD_DESC_INTERFACE_STRING "Mass Storage Interface"

Definition at line 62 of file msc_desc.h.

◆ USBD_DESC_MANUFACTURER_STRING

#define USBD_DESC_MANUFACTURER_STRING "Artery"

Definition at line 59 of file msc_desc.h.

◆ USBD_DESC_PRODUCT_STRING

#define USBD_DESC_PRODUCT_STRING "AT32 Mass Storage"

Definition at line 60 of file msc_desc.h.

◆ USBD_PRODUCT_ID

#define USBD_PRODUCT_ID 0x5720

Definition at line 53 of file msc_desc.h.

◆ USBD_SIZ_STRING_LANGID

#define USBD_SIZ_STRING_LANGID 4

Definition at line 56 of file msc_desc.h.

◆ USBD_SIZ_STRING_SERIAL

#define USBD_SIZ_STRING_SERIAL 0x1A

Definition at line 57 of file msc_desc.h.

◆ USBD_VENDOR_ID

#define USBD_VENDOR_ID 0x2E3C

Definition at line 52 of file msc_desc.h.

Variable Documentation

◆ g_usbd_configuration

uint8_t g_usbd_configuration[32]
extern

◆ g_usbd_descriptor

uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
extern

◆ msc_desc_handler

usbd_desc_handler msc_desc_handler
extern

device descriptor handler structure

Definition at line 64 of file msc_desc.c.

Referenced by main().


AT32F415 Firmwary Library: USB_printer_class

Modules
USB_printer_class
AT32F415_middlewares_usbd_class

usb device class printer demo More...

Modules

USB_printer_class_private_functions
USB_printer_class_definition

Detailed Description

usb device class printer demo


AT32F415 Firmwary Library: USB_printer_class_private_functions

Functions | Variables
USB_printer_class_private_functions
AT32F415_middlewares_usbd_class » USB_printer_class

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb custom hid endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device event handler More...
error_status | usb_printer_send_data (void *udev, uint8_t *send_data, uint16_t len)
usb device class send data More...

Variables

static uint32_t | alt_setting = 0
static uint8_t | g_rx_buff [0x40]
__IO uint8_t | g_tx_completed = 1
__IO uint8_t | g_rx_completed = 0
uint8_t | PRINTER_DEVICE_ID [24]
static uint32_t | g_printer_port_status = 0x18
uint8_t | g_printer_data [0x40]
usbd_class_handler | class_handler

Detailed Description

Function Documentation

◆ class_clear_handler()

usb_sts_type class_clear_handler ( void * udev )

clear endpoint or other state

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 113 of file printer_class.c.

◆ class_ept0_rx_handler()

usb_sts_type class_ept0_rx_handler ( void * udev )

usb device endpoint 0 out status stage complete

Parameters
udev usb device core handler type
Return values
status of usb_sts_type

Definition at line 201 of file printer_class.c.

◆ class_ept0_tx_handler()

usb_sts_type class_ept0_tx_handler ( void * udev )

usb device endpoint 0 in status stage complete

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 187 of file printer_class.c.

◆ class_event_handler()

usb_sts_type class_event_handler | ( | void * | udev,
 |  | usbd_event_type | event
 | ) |  |

usb device event handler

Parameters
udev | to the structure of usbd_core_type
event | usb device event
Return values
status of usb_sts_type

Definition at line 266 of file printer_class.c.

◆ class_in_handler()

usb_sts_type class_in_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device transmision complete handler

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 216 of file printer_class.c.

◆ class_init_handler()

usb_sts_type class_init_handler ( void * udev )

initialize usb custom hid endpoint

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 89 of file printer_class.c.

◆ class_out_handler()

usb_sts_type class_out_handler | ( | void * | udev,
 |  | uint8_t | ept_num
 | ) |  |

usb device endpoint receive data

Parameters
udev | to the structure of usbd_core_type
ept_num | endpoint number
Return values
status of usb_sts_type

Definition at line 236 of file printer_class.c.

◆ class_setup_handler()

usb_sts_type class_setup_handler | ( | void * | udev,
 |  | usb_setup_type * | setup
 | ) |  |

usb device class setup request handler

Parameters
udev | to the structure of usbd_core_type
setup | setup packet
Return values
status of usb_sts_type

Definition at line 133 of file printer_class.c.

◆ class_sof_handler()

usb_sts_type class_sof_handler ( void * udev )

usb device sof handler

Parameters
udev to the structure of usbd_core_type
Return values
status of usb_sts_type

Definition at line 251 of file printer_class.c.

◆ usb_printer_send_data()

error_status usb_printer_send_data | ( | void * | udev,
 |  | uint8_t * | send_data,
 |  | uint16_t | len
 | ) |  |

usb device class send data

Parameters
udev | to the structure of usbd_core_type
send_data | send data buffer
len | send length
Return values
error status

Definition at line 303 of file printer_class.c.

Variable Documentation

◆ alt_setting

uint32_t alt_setting = 0
static

Definition at line 54 of file printer_class.c.

Referenced by class_setup_handler().

◆ class_handler

usbd_class_handler class_handler
Initial value:
=
{
class_init_handler,
class_clear_handler,
class_setup_handler,
class_ept0_tx_handler,
class_ept0_rx_handler,
class_in_handler,
class_out_handler,
class_sof_handler,
class_event_handler,
}
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: printer_class.c:266
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: printer_class.c:251
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: printer_class.c:133
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: printer_class.c:187
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: printer_class.c:216
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb custom hid endpoint
Definition: printer_class.c:89
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: printer_class.c:201
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: printer_class.c:236
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: printer_class.c:113

Definition at line 71 of file printer_class.c.

◆ g_printer_data

uint8_t g_printer_data[0x40]

Definition at line 65 of file printer_class.c.

Referenced by class_setup_handler().

◆ g_printer_port_status

uint32_t g_printer_port_status = 0x18
static

Definition at line 64 of file printer_class.c.

Referenced by class_setup_handler().

◆ g_rx_buff

uint8_t g_rx_buff[0x40]
static

Definition at line 55 of file printer_class.c.

Referenced by class_init_handler().

◆ g_rx_completed

__IO uint8_t g_rx_completed = 0

Definition at line 56 of file printer_class.c.

Referenced by class_out_handler().

◆ g_tx_completed

__IO uint8_t g_tx_completed = 1

Definition at line 56 of file printer_class.c.

Referenced by class_in_handler(), class_init_handler(), and usb_printer_send_data().

◆ PRINTER_DEVICE_ID

uint8_t PRINTER_DEVICE_ID[24]
Initial value:
=
{
0x00, 0x16,
'M', 'F', 'G',':','A','r','t','e', 'r', 'y' ,' ',
'C','M', 'D', ':', 'E', 'S', 'C', 'P', 'O', 'S',' ',
}

Definition at line 58 of file printer_class.c.

Referenced by class_setup_handler().


AT32F415 Firmwary Library: USB_printer_class_definition

Data Structures | Macros | Enumerations | Functions | Variables
USB_printer_class_definition
AT32F415_middlewares_usbd_class » USB_printer_class

Data Structures

struct linecoding_type
usb cdc class set line coding struct More...

Macros

#define | USBD_PRINTER_BULK_IN_EPT 0x81
#define | USBD_PRINTER_BULK_OUT_EPT 0x01
#define | USBD_IN_MAXPACKET_SIZE 0x40
#define | USBD_OUT_MAXPACKET_SIZE 0x40
#define | PRINTER_DEVICE_ID_LEN 24
#define | SET_LINE_CODING 0x20
#define | GET_LINE_CODING 0x21

Enumerations

enum printer_req_type { PRINTER_REQ_GET_DEVICE_ID = 0x00 , PRINTER_REQ_GET_PORT_STATUS = 0x01 , PRINTER_REQ_GET_SOFT_RESET = 0x02 }

Functions

uint16_t | usb_printer_get_rxdata (void *udev, uint8_t *recv_data)
error_status | usb_printer_send_data (void *udev, uint8_t *send_data, uint16_t len)
usb device class send data More...

Variables

usbd_class_handler class_handler

Detailed Description

Macro Definition Documentation

◆ GET_LINE_CODING

#define GET_LINE_CODING 0x21

Definition at line 68 of file printer_class.h.

◆ PRINTER_DEVICE_ID_LEN

#define PRINTER_DEVICE_ID_LEN 24

Definition at line 57 of file printer_class.h.

◆ SET_LINE_CODING

#define SET_LINE_CODING 0x20

Definition at line 67 of file printer_class.h.

◆ USBD_IN_MAXPACKET_SIZE

#define USBD_IN_MAXPACKET_SIZE 0x40

Definition at line 54 of file printer_class.h.

◆ USBD_OUT_MAXPACKET_SIZE

#define USBD_OUT_MAXPACKET_SIZE 0x40

Definition at line 55 of file printer_class.h.

◆ USBD_PRINTER_BULK_IN_EPT

#define USBD_PRINTER_BULK_IN_EPT 0x81

Definition at line 50 of file printer_class.h.

◆ USBD_PRINTER_BULK_OUT_EPT

#define USBD_PRINTER_BULK_OUT_EPT 0x01

Definition at line 51 of file printer_class.h.

Enumeration Type Documentation

◆ printer_req_type

enum printer_req_type
Enumerator
PRINTER_REQ_GET_DEVICE_ID
PRINTER_REQ_GET_PORT_STATUS
PRINTER_REQ_GET_SOFT_RESET

Definition at line 59 of file printer_class.h.

Function Documentation

◆ usb_printer_get_rxdata()

uint16_t usb_printer_get_rxdata | ( | void * | udev,
 |  | uint8_t * | recv_data
 | ) |  |

◆ usb_printer_send_data()

error_status usb_printer_send_data | ( | void * | udev,
 |  | uint8_t * | send_data,
 |  | uint16_t | len
 | ) |  |

usb device class send data

Parameters
udev | to the structure of usbd_core_type
send_data | send data buffer
len | send length
Return values
error status

Definition at line 303 of file printer_class.c.

Variable Documentation

◆ class_handler

usbd_class_handler class_handler
extern

Definition at line 75 of file cdc_class.c.

Referenced by main(), usbd_core_init(), and usbh_core_init().


AT32F415 Firmwary Library: USB_printer_desc

Modules
USB_printer_desc
AT32F415_middlewares_usbd_class

usb device printer descriptor More...

Modules

USB_printer_desc_private_functions
USB_printer_desc_definition

Detailed Description

usb device printer descriptor


AT32F415 Firmwary Library: USB_printer_desc_private_functions

Functions | Variables
USB_printer_desc_private_functions
AT32F415_middlewares_usbd_class » USB_printer_desc

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | desc_handler
device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

Function Documentation

◆ get_device_config_string()

usbd_desc_t * get_device_config_string ( void )

get device config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 387 of file printer_desc.c.

◆ get_device_configuration()

usbd_desc_t * get_device_configuration ( void )

get config descriptor

Parameters
none
Return values
usbd_desc

Definition at line 309 of file printer_desc.c.

◆ get_device_descriptor()

usbd_desc_t * get_device_descriptor ( void )

get device descriptor

Parameters
none
Return values
usbd_desc

Definition at line 289 of file printer_desc.c.

◆ get_device_interface_string()

usbd_desc_t * get_device_interface_string ( void )

get interface descriptor

Parameters
none
Return values
usbd_desc

Definition at line 375 of file printer_desc.c.

◆ get_device_lang_id()

usbd_desc_t * get_device_lang_id ( void )

get lang id descriptor

Parameters
none
Return values
usbd_desc

Definition at line 329 of file printer_desc.c.

◆ get_device_manufacturer_string()

usbd_desc_t * get_device_manufacturer_string ( void )

get manufacturer descriptor

Parameters
none
Return values
usbd_desc

Definition at line 340 of file printer_desc.c.

◆ get_device_other_speed()

usbd_desc_t * get_device_other_speed ( void )

get other speed descriptor

Parameters
none
Return values
usbd_desc

Definition at line 319 of file printer_desc.c.

◆ get_device_product_string()

usbd_desc_t * get_device_product_string ( void )

get product descriptor

Parameters
none
Return values
usbd_desc

Definition at line 352 of file printer_desc.c.

◆ get_device_qualifier()

usbd_desc_t * get_device_qualifier ( void )

get device qualifier

Parameters
none
Return values
usbd_desc

Definition at line 299 of file printer_desc.c.

◆ get_device_serial_string()

usbd_desc_t * get_device_serial_string ( void )

get serial descriptor

Parameters
none
Return values
usbd_desc

Definition at line 364 of file printer_desc.c.

◆ get_serial_num()

static void get_serial_num ( void )
static

usb get serial number

Parameters
none
Return values
none

Definition at line 267 of file printer_desc.c.

Referenced by get_device_serial_string().

◆ usbd_int_to_unicode()

static void usbd_int_to_unicode | ( | uint32_t | value,
 |  | uint8_t * | pbuf,
 |  | uint8_t | len
 | ) |  |
static

usb int convert to unicode

Parameters
value | int value
pbus | unicode buffer
len | length
Return values
none

Definition at line 241 of file printer_desc.c.

Referenced by get_serial_num().

◆ usbd_unicode_convert()

uint16_t usbd_unicode_convert | ( | uint8_t * | string,
 |  | uint8_t * | unicode_buf
 | ) |  |

standard usb unicode convert

Parameters
string | source string
unicode_buf | unicode buffer
Return values
length

Definition at line 215 of file printer_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

Variable Documentation

◆ ALIGNED_TAIL

ALIGNED_HEAD uint8_t g_string_serial [ 0x1A ] ALIGNED_TAIL
Initial value:
=
{
USB_DEVICE_DESC_LEN,
USB_DESCIPTOR_TYPE_DEVICE,
0x00,
0x02,
0x00,
0x00,
0x00,
USB_MAX_EP0_SIZE,
LBYTE( 0x2E3C ),
HBYTE( 0x2E3C ),
LBYTE( 0x57FF ),
HBYTE( 0x57FF ),
0x00,
0x02,
USB_MFC_STRING,
USB_PRODUCT_STRING,
USB_SERIAL_STRING,
1
}
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92

usb device standard descriptor

usb string serial

usb string lang id

usb configuration standard descriptor

Definition at line 84 of file printer_desc.c.

◆ config_descriptor

usbd_desc_t config_descriptor
Initial value:
=
{
32 ,
g_usbd_configuration
}
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112

Definition at line 187 of file printer_desc.c.

Referenced by get_device_configuration().

◆ desc_handler

usbd_desc_handler desc_handler
Initial value:
=
{
get_device_descriptor,
get_device_qualifier,
get_device_configuration,
get_device_other_speed,
get_device_lang_id,
get_device_manufacturer_string,
get_device_product_string,
get_device_serial_string,
get_device_interface_string,
get_device_config_string,
}
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: printer_desc.c:340
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: printer_desc.c:299
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: printer_desc.c:375
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: printer_desc.c:319
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: printer_desc.c:309
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: printer_desc.c:352
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: printer_desc.c:329
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: printer_desc.c:289
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: printer_desc.c:364
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: printer_desc.c:387

device descriptor handler structure

Definition at line 64 of file printer_desc.c.

◆ device_descriptor

usbd_desc_t device_descriptor
Initial value:
=
{
USB_DEVICE_DESC_LEN,
g_usbd_descriptor
}
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]

Definition at line 180 of file printer_desc.c.

Referenced by get_device_descriptor().

◆ g_usbd_desc_buffer

uint8_t g_usbd_desc_buffer[256]
static

Definition at line 59 of file printer_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().

◆ langid_descriptor

usbd_desc_t langid_descriptor
Initial value:
=
{
4 ,
g_string_lang_id
}

Definition at line 194 of file printer_desc.c.

Referenced by get_device_lang_id().

◆ serial_descriptor

usbd_desc_t serial_descriptor
Initial value:
=
{
0x1A ,
g_string_serial
}

Definition at line 201 of file printer_desc.c.

Referenced by get_device_serial_string().

◆ vp_desc

usbd_desc_t vp_desc

Definition at line 207 of file printer_desc.c.

Referenced by get_device_config_string(), get_device_interface_string(), get_device_manufacturer_string(), and get_device_product_string().


AT32F415 Firmwary Library: USB_printer_desc_definition

Macros | Variables
USB_printer_desc_definition
AT32F415_middlewares_usbd_class » USB_printer_desc

Macros

#define | BCD_NUM 0x0110
#define | USBD_VENDOR_ID 0x2E3C
#define | USBD_PRODUCT_ID 0x57FF
#define | USBD_CONFIG_DESC_SIZE 32
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
#define | USBD_DESC_PRODUCT_STRING "AT32 Printer"
#define | USBD_DESC_CONFIGURATION_STRING "Printer Config"
#define | USBD_DESC_INTERFACE_STRING "Printer Interface"
#define | PRINTER_PROTOCOL_UNIDIRECTIONAL 0x01
#define | PRINTER_PROTOCOL_BI_DIRECTIONAL 0x02
#define | PRINTER_PROTOCOL_1284_4 0x03
#define | PRINTER_PROTOCOL_VENDOR_SPECIFIC 0xFF
#define | HID_BINTERVAL_TIME 0xFF
#define | MCU_ID1 (0x1FFFF7E8)
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [32]
usbd_desc_handler | desc_handler
device descriptor handler structure More...

Detailed Description

Macro Definition Documentation

◆ BCD_NUM

#define BCD_NUM 0x0110

Definition at line 50 of file printer_desc.h.

◆ HID_BINTERVAL_TIME

#define HID_BINTERVAL_TIME 0xFF

Definition at line 69 of file printer_desc.h.

◆ MCU_ID1

#define MCU_ID1 (0x1FFFF7E8)

Definition at line 71 of file printer_desc.h.

◆ MCU_ID2

#define MCU_ID2 (0x1FFFF7EC)

Definition at line 72 of file printer_desc.h.

◆ MCU_ID3

#define MCU_ID3 (0x1FFFF7F0)

Definition at line 73 of file printer_desc.h.

◆ PRINTER_PROTOCOL_1284_4

#define PRINTER_PROTOCOL_1284_4 0x03

Definition at line 66 of file printer_desc.h.

◆ PRINTER_PROTOCOL_BI_DIRECTIONAL

#define PRINTER_PROTOCOL_BI_DIRECTIONAL 0x02

Definition at line 65 of file printer_desc.h.

◆ PRINTER_PROTOCOL_UNIDIRECTIONAL

#define PRINTER_PROTOCOL_UNIDIRECTIONAL 0x01

Definition at line 64 of file printer_desc.h.

◆ PRINTER_PROTOCOL_VENDOR_SPECIFIC

#define PRINTER_PROTOCOL_VENDOR_SPECIFIC 0xFF

Definition at line 67 of file printer_desc.h.

◆ USBD_CONFIG_DESC_SIZE

#define USBD_CONFIG_DESC_SIZE 32

Definition at line 55 of file printer_desc.h.

◆ USBD_DESC_CONFIGURATION_STRING

#define USBD_DESC_CONFIGURATION_STRING "Printer Config"

Definition at line 61 of file printer_desc.h.

◆ USBD_DESC_INTERFACE_STRING

#define USBD_DESC_INTERFACE_STRING "Printer Interface"

Definition at line 62 of file printer_desc.h.

◆ USBD_DESC_MANUFACTURER_STRING

#define USBD_DESC_MANUFACTURER_STRING "Artery"

Definition at line 59 of file printer_desc.h.

◆ USBD_DESC_PRODUCT_STRING

#define USBD_DESC_PRODUCT_STRING "AT32 Printer"

Definition at line 60 of file printer_desc.h.

◆ USBD_PRODUCT_ID

#define USBD_PRODUCT_ID 0x57FF

Definition at line 53 of file printer_desc.h.

◆ USBD_SIZ_STRING_LANGID

#define USBD_SIZ_STRING_LANGID 4

Definition at line 56 of file printer_desc.h.

◆ USBD_SIZ_STRING_SERIAL

#define USBD_SIZ_STRING_SERIAL 0x1A

Definition at line 57 of file printer_desc.h.

◆ USBD_VENDOR_ID

#define USBD_VENDOR_ID 0x2E3C

Definition at line 52 of file printer_desc.h.

Variable Documentation

◆ desc_handler

usbd_desc_handler desc_handler
extern

device descriptor handler structure

Definition at line 64 of file cdc_desc.c.

Referenced by main(), and usbd_core_init().

◆ g_usbd_configuration

uint8_t g_usbd_configuration[32]
extern

◆ g_usbd_descriptor

uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
extern


AT32F415 Firmwary Library: AT32F415_middlewares_usbh_class

Modules
AT32F415_middlewares_usbh_class

Modules

USBH_hid_class
usb host class hid demo
USBH_hid_class_keyboard
usb host class hid keyboard
USBH_hid_class_mouse
usb host class hid mouse
USBH_msc_bot_scsi_class
usb host class msc bot scsi
USBH_msc_class
usb host class msc demo

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: USBH_hid_class

Modules
USBH_hid_class
AT32F415_middlewares_usbh_class

usb host class hid demo More...

Modules

USBH_hid_class_private_functions
USBH_hid_class_definition

Detailed Description

usb host class hid demo


AT32F415 Firmwary Library: USBH_hid_class_private_functions

Functions | Variables
USBH_hid_class_private_functions
AT32F415_middlewares_usbh_class » USBH_hid_class

Functions

usb_sts_type | usbh_hid_get_desc (void *uhost, uint16_t length)
usb host hid class get descriptor More...
usb_sts_type | usbh_hid_get_report (void *uhost, uint16_t length)
usb host hid class get report More...
usb_sts_type | usbh_hid_set_idle (void *uhost, uint8_t id, uint8_t dr)
usb host hid class set idle More...
usb_sts_type | usbh_hid_set_protocol (void *uhost, uint8_t protocol)
usb host hid class set protocol More...
usb_sts_type | usbh_clear_endpoint_feature (usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num)
usb host clear feature More...

Variables

usbh_hid_type usbh_hid
usbh_class_handler_type uhost_class_handler

Detailed Description

Function Documentation

◆ usbh_clear_endpoint_feature()

usb_sts_type usbh_clear_endpoint_feature | ( | usbh_core_type * | uhost,
 |  | uint8_t | ept_num,
 |  | uint8_t | hc_num
 | ) |  |

usb host clear feature

Parameters
uhost | to the structure of usbh_core_type
ept_num | endpoint number
hc_num | channel number
Return values
status usb_sts_type status

Definition at line 301 of file usbh_hid_class.c.

Referenced by uhost_process_handler().

◆ usbh_hid_get_desc()

usb_sts_type usbh_hid_get_desc | ( | void * | uhost,
 |  | uint16_t | length
 | ) |  |

usb host hid class get descriptor

Parameters
uhost | to the structure of usbh_core_type
length | descriptor length
Return values
status usb_sts_type status

Definition at line 170 of file usbh_hid_class.c.

Referenced by uhost_request_handler().

◆ usbh_hid_get_report()

usb_sts_type usbh_hid_get_report | ( | void * | uhost,
 |  | uint16_t | length
 | ) |  |

usb host hid class get report

Parameters
uhost | to the structure of usbh_core_type
length | reprot length
Return values
status usb_sts_type status

Definition at line 209 of file usbh_hid_class.c.

Referenced by uhost_request_handler().

◆ usbh_hid_set_idle()

usb_sts_type usbh_hid_set_idle | ( | void * | uhost,
 |  | uint8_t | id,
 |  | uint8_t | dr
 | ) |  |

usb host hid class set idle

Parameters
uhost | to the structure of usbh_core_type
id | id
dr | dr
Return values
status usb_sts_type status

Definition at line 240 of file usbh_hid_class.c.

Referenced by uhost_request_handler().

◆ usbh_hid_set_protocol()

usb_sts_type usbh_hid_set_protocol | ( | void * | uhost,
 |  | uint8_t | protocol
 | ) |  |

usb host hid class set protocol

Parameters
uhost | to the structure of usbh_core_type
protocol | portocol number
Return values
status usb_sts_type status

Definition at line 270 of file usbh_hid_class.c.

Referenced by uhost_request_handler().

Variable Documentation

◆ uhost_class_handler

usbh_class_handler_type uhost_class_handler
Initial value:
=
{
uhost_init_handler,
uhost_reset_handler,
uhost_request_handler,
uhost_process_handler,
&usbh_hid
}
uhost_process_handler
usb_sts_type uhost_process_handler(void *uhost)
usb host hid class process handler
Definition: usbh_hid_class.c:387
usbh_hid
usbh_hid_type usbh_hid
Definition: usbh_hid_class.c:51
uhost_init_handler
usb_sts_type uhost_init_handler(void *uhost)
usb host class init handler
Definition: usbh_hid_class.c:66
uhost_request_handler
usb_sts_type uhost_request_handler(void *uhost)
usb host hid class request handler
Definition: usbh_hid_class.c:336
uhost_reset_handler
usb_sts_type uhost_reset_handler(void *uhost)
usb host class reset handler
Definition: usbh_hid_class.c:135

Definition at line 52 of file usbh_hid_class.c.

Referenced by main().

◆ usbh_hid

usbh_hid_type usbh_hid

Definition at line 51 of file usbh_hid_class.c.

Referenced by uhost_init_handler().


AT32F415 Firmwary Library: USBH_hid_class_definition

Data Structures | Macros | Enumerations | Variables
USBH_hid_class_definition
AT32F415_middlewares_usbh_class » USBH_hid_class

Data Structures

struct | usb_hid_desc_type
usb hid descriptor type More...
struct | usbh_hid_type
usb hid struct More...

Macros

#define | USB_HID_NONE_PROTOCOL_CODE 0x00
usb hid protocol code More...
#define | USB_HID_KEYBOARD_PROTOCOL_CODE 0x01
#define | USB_HID_MOUSE_PROTOCOL_CODE 0x02
#define | USB_HID_GET_REPORT 0x01
usb hid request code More...
#define | USB_HID_GET_IDLE 0x02
#define | USB_HID_GET_PROTOCOL 0x03
#define | USB_HID_SET_REPORT 0x09
#define | USB_HID_SET_IDLE 0x0A
#define | USB_HID_SET_PROTOCOL 0x0B

Enumerations

enum usb_hid_ctrl_state_type {
USB_HID_STATE_IDLE , USB_HID_STATE_GET_DESC , USB_HID_STATE_GET_REPORT , USB_HID_STATE_SET_IDLE ,
USB_HID_STATE_SET_PROTOCOL , USB_HID_STATE_COMPLETE
}
usb hid request state More...
enum usb_hid_state_type {
USB_HID_INIT , USB_HID_GET , USB_HID_SEND , USB_HID_POLL ,
USB_HID_BUSY , USB_HID_ERROR
}
usb hid process state More...

Variables

usbh_class_handler_type uhost_class_handler

Detailed Description

Macro Definition Documentation

◆ USB_HID_GET_IDLE

#define USB_HID_GET_IDLE 0x02

Definition at line 60 of file usbh_hid_class.h.

◆ USB_HID_GET_PROTOCOL

#define USB_HID_GET_PROTOCOL 0x03

Definition at line 61 of file usbh_hid_class.h.

◆ USB_HID_GET_REPORT

#define USB_HID_GET_REPORT 0x01

usb hid request code

Definition at line 59 of file usbh_hid_class.h.

◆ USB_HID_KEYBOARD_PROTOCOL_CODE

#define USB_HID_KEYBOARD_PROTOCOL_CODE 0x01

Definition at line 53 of file usbh_hid_class.h.

◆ USB_HID_MOUSE_PROTOCOL_CODE

#define USB_HID_MOUSE_PROTOCOL_CODE 0x02

Definition at line 54 of file usbh_hid_class.h.

◆ USB_HID_NONE_PROTOCOL_CODE

#define USB_HID_NONE_PROTOCOL_CODE 0x00

usb hid protocol code

Definition at line 52 of file usbh_hid_class.h.

◆ USB_HID_SET_IDLE

#define USB_HID_SET_IDLE 0x0A

Definition at line 63 of file usbh_hid_class.h.

◆ USB_HID_SET_PROTOCOL

#define USB_HID_SET_PROTOCOL 0x0B

Definition at line 64 of file usbh_hid_class.h.

◆ USB_HID_SET_REPORT

#define USB_HID_SET_REPORT 0x09

Definition at line 62 of file usbh_hid_class.h.

Enumeration Type Documentation

◆ usb_hid_ctrl_state_type

enum usb_hid_ctrl_state_type

usb hid request state

Enumerator
USB_HID_STATE_IDLE
USB_HID_STATE_GET_DESC
USB_HID_STATE_GET_REPORT
USB_HID_STATE_SET_IDLE
USB_HID_STATE_SET_PROTOCOL
USB_HID_STATE_COMPLETE

Definition at line 69 of file usbh_hid_class.h.

◆ usb_hid_state_type

enum usb_hid_state_type

usb hid process state

Enumerator
USB_HID_INIT
USB_HID_GET
USB_HID_SEND
USB_HID_POLL
USB_HID_BUSY
USB_HID_ERROR

Definition at line 82 of file usbh_hid_class.h.

Variable Documentation

◆ uhost_class_handler

usbh_class_handler_type uhost_class_handler
extern

Definition at line 52 of file usbh_hid_class.c.


AT32F415 Firmwary Library: usb_hid_desc_type Struct Reference

Data Fields
usb_hid_desc_type Struct Reference
AT32F415_middlewares_usbh_class » USBH_hid_class » USBH_hid_class_definition | AT32F415_middlewares_usbh_class » USBH_msc_class » USBH_msc_class_definition

usb hid descriptor type More...

#include <usbh_hid_class.h>

Data Fields

uint8_t | bLength
uint8_t | bDescriptorType
uint16_t | bcdHID
uint8_t | bCountryCode
uint8_t | bNumDescriptors
uint8_t | bReportDescriptorType
uint16_t | wItemLength

Detailed Description

usb hid descriptor type

‍**

usb hid descriptor type

Definition at line 95 of file usbh_hid_class.h.

Field Documentation

◆ bcdHID

uint16_t usb_hid_desc_type::bcdHID

Definition at line 99 of file usbh_hid_class.h.

Referenced by usbh_hid_get_desc().

◆ bCountryCode

uint8_t usb_hid_desc_type::bCountryCode

Definition at line 100 of file usbh_hid_class.h.

Referenced by usbh_hid_get_desc().

◆ bDescriptorType

uint8_t usb_hid_desc_type::bDescriptorType

Definition at line 98 of file usbh_hid_class.h.

Referenced by usbh_hid_get_desc().

◆ bLength

uint8_t usb_hid_desc_type::bLength

Definition at line 97 of file usbh_hid_class.h.

Referenced by usbh_hid_get_desc().

◆ bNumDescriptors

uint8_t usb_hid_desc_type::bNumDescriptors

Definition at line 101 of file usbh_hid_class.h.

Referenced by usbh_hid_get_desc().

◆ bReportDescriptorType

uint8_t usb_hid_desc_type::bReportDescriptorType

Definition at line 102 of file usbh_hid_class.h.

Referenced by usbh_hid_get_desc().

◆ wItemLength

uint16_t usb_hid_desc_type::wItemLength

Definition at line 103 of file usbh_hid_class.h.

Referenced by uhost_request_handler(), and usbh_hid_get_desc().

The documentation for this struct was generated from the following files:
  • usbh_hid_class.h
  • usbh_msc_class.h


AT32F415 Firmwary Library: usbh_hid_type Struct Reference

Data Fields
usbh_hid_type Struct Reference
AT32F415_middlewares_usbh_class » USBH_hid_class » USBH_hid_class_definition

usb hid struct More...

#include <usbh_hid_class.h>

Data Fields

uint8_t | chin
uint8_t | eptin
uint16_t | in_maxpacket
uint8_t | in_poll
uint8_t | chout
uint8_t | eptout
uint16_t | out_maxpacket
uint8_t | out_poll
uint8_t | protocol
usb_hid_desc_type hid_desc
usb_hid_ctrl_state_type ctrl_state
usb_hid_state_type state
uint16_t | poll_timer
uint32_t | buffer [16]

Detailed Description

usb hid struct

Definition at line 109 of file usbh_hid_class.h.

Field Documentation

◆ buffer

uint32_t usbh_hid_type::buffer[16]

Definition at line 127 of file usbh_hid_class.h.

Referenced by uhost_process_handler().

◆ chin

uint8_t usbh_hid_type::chin

Definition at line 111 of file usbh_hid_class.h.

Referenced by uhost_init_handler(), uhost_process_handler(), and uhost_reset_handler().

◆ chout

uint8_t usbh_hid_type::chout

Definition at line 116 of file usbh_hid_class.h.

Referenced by uhost_init_handler(), and uhost_reset_handler().

◆ ctrl_state

usb_hid_ctrl_state_type usbh_hid_type::ctrl_state

Definition at line 124 of file usbh_hid_class.h.

Referenced by uhost_init_handler(), and uhost_request_handler().

◆ eptin

uint8_t usbh_hid_type::eptin

Definition at line 112 of file usbh_hid_class.h.

Referenced by uhost_init_handler(), and uhost_process_handler().

◆ eptout

uint8_t usbh_hid_type::eptout

Definition at line 117 of file usbh_hid_class.h.

Referenced by uhost_init_handler().

◆ hid_desc

usb_hid_desc_type usbh_hid_type::hid_desc

Definition at line 123 of file usbh_hid_class.h.

Referenced by uhost_request_handler(), and usbh_hid_get_desc().

◆ in_maxpacket

uint16_t usbh_hid_type::in_maxpacket

Definition at line 113 of file usbh_hid_class.h.

Referenced by uhost_init_handler(), and uhost_process_handler().

◆ in_poll

uint8_t usbh_hid_type::in_poll

Definition at line 114 of file usbh_hid_class.h.

Referenced by uhost_init_handler(), and uhost_process_handler().

◆ out_maxpacket

uint16_t usbh_hid_type::out_maxpacket

Definition at line 118 of file usbh_hid_class.h.

Referenced by uhost_init_handler().

◆ out_poll

uint8_t usbh_hid_type::out_poll

Definition at line 119 of file usbh_hid_class.h.

Referenced by uhost_init_handler().

◆ poll_timer

uint16_t usbh_hid_type::poll_timer

Definition at line 126 of file usbh_hid_class.h.

Referenced by uhost_process_handler().

◆ protocol

uint8_t usbh_hid_type::protocol

Definition at line 120 of file usbh_hid_class.h.

Referenced by uhost_init_handler(), and uhost_process_handler().

◆ state

usb_hid_state_type usbh_hid_type::state

Definition at line 125 of file usbh_hid_class.h.

Referenced by uhost_process_handler(), and uhost_request_handler().

The documentation for this struct was generated from the following file:
  • usbh_hid_class.h


AT32F415 Firmwary Library: USBH_hid_class_keyboard

Modules
USBH_hid_class_keyboard
AT32F415_middlewares_usbh_class

usb host class hid keyboard More...

Modules

USBH_hid_class_keyboard_private_functions
USBH_hid_class_keyboard_definition

Detailed Description

usb host class hid keyboard


AT32F415 Firmwary Library: USBH_hid_class_keyboard_private_functions

Functions | Variables
USBH_hid_class_keyboard_private_functions
AT32F415_middlewares_usbh_class » USBH_hid_class_keyboard

Functions

void usbh_hid_keyboard_decode (uint8_t *data)
usb host hid keyboard decode More...

Variables

static const uint8_t | hid_keyboard_codes []
static const int8_t | hid_keyboard_key []
static const int8_t | hid_keyboard_key_shift []

Detailed Description

Function Documentation

◆ usbh_hid_keyboard_decode()

void usbh_hid_keyboard_decode ( uint8_t * data )

usb host hid keyboard decode

Parameters
data keyboard data
Return values
none

Definition at line 145 of file usbh_hid_keyboard.c.

Referenced by uhost_process_handler().

Variable Documentation

◆ hid_keyboard_codes

const uint8_t hid_keyboard_codes[]
static

Definition at line 41 of file usbh_hid_keyboard.c.

Referenced by usbh_hid_keyboard_decode().

◆ hid_keyboard_key

const int8_t hid_keyboard_key[]
static
Initial value:
= {
'\0', '`', '1', '2', '3', '4', '5', '6',
'7', '8', '9', '0', '-', '=', '\0', '\r',
'\t', 'q', 'w', 'e', 'r', 't', 'y', 'u',
'i', 'o', 'p', '[', ']', '\\',
'\0', 'a', 's', 'd', 'f', 'g', 'h', 'j',
'k', 'l', ';', '\'', '\0', '\n',
'\0', '\0', 'z', 'x', 'c', 'v', 'b', 'n',
'm', ',', '.', '/', '\0', '\0',
'\0', '\0', '\0', ' ', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\r', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '7', '4', '1',
'\0', '/', '8', '5', '2',
'0', '*', '9', '6', '3',
'.', '-', '+', '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0'
}

Definition at line 76 of file usbh_hid_keyboard.c.

Referenced by usbh_hid_keyboard_decode().

◆ hid_keyboard_key_shift

const int8_t hid_keyboard_key_shift[]
static
Initial value:
= {
'\0', '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')',
'_', '+', '\0', '\0', '\0', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U',
'I', 'O', 'P', '{', '}', '|', '\0', 'A', 'S', 'D', 'F', 'G',
'H', 'J', 'K', 'L', ':', '"', '\0', '\n', '\0', '\0', 'Z', 'X',
'C', 'V', 'B', 'N', 'M', '<', '>', '?', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'
}

Definition at line 97 of file usbh_hid_keyboard.c.

Referenced by usbh_hid_keyboard_decode().


AT32F415 Firmwary Library: USBH_hid_class_keyboard_definition

Macros | Functions
USBH_hid_class_keyboard_definition
AT32F415_middlewares_usbh_class » USBH_hid_class_keyboard

Macros

#define | KEYBOARD_LEFT_CTRL 0x01
usb keyboard option code More...
#define | KEYBOARD_LEFT_SHIFT 0x02
#define | KEYBOARD_LEFT_ALT 0x04
#define | KEYBOARD_LEFT_GUI 0x08
#define | KEYBOARD_RIGHT_CTRL 0x10
#define | KEYBOARD_RIGHT_SHIFT 0x20
#define | KEYBOARD_RIGHT_ALT 0x40
#define | KEYBOARD_RIGHT_GUI 0x80
#define | KEYBOARD_MAX_NB_PRESSED 6
#define | QWERTY_KEYBOARD

Functions

void usbh_hid_keyboard_decode (uint8_t *data)
usb host hid keyboard decode More...

Detailed Description

Macro Definition Documentation

◆ KEYBOARD_LEFT_ALT

#define KEYBOARD_LEFT_ALT 0x04

Definition at line 53 of file usbh_hid_keyboard.h.

◆ KEYBOARD_LEFT_CTRL

#define KEYBOARD_LEFT_CTRL 0x01

usb keyboard option code

Definition at line 51 of file usbh_hid_keyboard.h.

◆ KEYBOARD_LEFT_GUI

#define KEYBOARD_LEFT_GUI 0x08

Definition at line 54 of file usbh_hid_keyboard.h.

◆ KEYBOARD_LEFT_SHIFT

#define KEYBOARD_LEFT_SHIFT 0x02

Definition at line 52 of file usbh_hid_keyboard.h.

◆ KEYBOARD_MAX_NB_PRESSED

#define KEYBOARD_MAX_NB_PRESSED 6

Definition at line 60 of file usbh_hid_keyboard.h.

◆ KEYBOARD_RIGHT_ALT

#define KEYBOARD_RIGHT_ALT 0x40

Definition at line 57 of file usbh_hid_keyboard.h.

◆ KEYBOARD_RIGHT_CTRL

#define KEYBOARD_RIGHT_CTRL 0x10

Definition at line 55 of file usbh_hid_keyboard.h.

◆ KEYBOARD_RIGHT_GUI

#define KEYBOARD_RIGHT_GUI 0x80

Definition at line 58 of file usbh_hid_keyboard.h.

◆ KEYBOARD_RIGHT_SHIFT

#define KEYBOARD_RIGHT_SHIFT 0x20

Definition at line 56 of file usbh_hid_keyboard.h.

◆ QWERTY_KEYBOARD

#define QWERTY_KEYBOARD

Definition at line 63 of file usbh_hid_keyboard.h.

Function Documentation

◆ usbh_hid_keyboard_decode()

void usbh_hid_keyboard_decode ( uint8_t * data )

usb host hid keyboard decode

Parameters
data keyboard data
Return values
none

Definition at line 145 of file usbh_hid_keyboard.c.

Referenced by uhost_process_handler().


AT32F415 Firmwary Library: USBH_hid_class_mouse

Modules
USBH_hid_class_mouse
AT32F415_middlewares_usbh_class

usb host class hid mouse More...

Modules

USBH_hid_class_mouse_private_functions
USBH_hid_class_mouse_definition

Detailed Description

usb host class hid mouse


AT32F415 Firmwary Library: USBH_hid_class_mouse_private_functions

Functions | Variables
USBH_hid_class_mouse_private_functions
AT32F415_middlewares_usbh_class » USBH_hid_class_mouse

Functions

void | usbh_hid_mouse_position (uint8_t x, uint8_t y)
usb host hid position More...
void | usbh_hid_mouse_button_press (uint8_t button)
usb host hid button press More...
void | usbh_hid_mouse_button_release (uint8_t button)
usb host hid button release More...
void | usbh_hid_mouse_process (usb_hid_mouse_type *mouse)
usb host hid mouse process More...
void | usbh_hid_mouse_decode (uint8_t *mouse_data)
usb host hid mouse decode More...

Variables

usb_hid_mouse_type hid_mouse
uint16_t | x_pos = 0
uint16_t | y_pos = 0

Detailed Description

Function Documentation

◆ usbh_hid_mouse_button_press()

void usbh_hid_mouse_button_press ( uint8_t button )

usb host hid button press

Parameters
button button id
Return values
none

Definition at line 84 of file usbh_hid_mouse.c.

Referenced by usbh_hid_mouse_process().

◆ usbh_hid_mouse_button_release()

void usbh_hid_mouse_button_release ( uint8_t button )

usb host hid button release

Parameters
button button id
Return values
none

Definition at line 108 of file usbh_hid_mouse.c.

Referenced by usbh_hid_mouse_process().

◆ usbh_hid_mouse_decode()

void usbh_hid_mouse_decode ( uint8_t * mouse_data )

usb host hid mouse decode

Parameters
mouse_data mouse data
Return values
none

Definition at line 167 of file usbh_hid_mouse.c.

Referenced by uhost_process_handler().

◆ usbh_hid_mouse_position()

void usbh_hid_mouse_position | ( | uint8_t | x,
 |  | uint8_t | y
 | ) |  |

usb host hid position

Parameters
x | x position
y | y position
Return values
none

Definition at line 50 of file usbh_hid_mouse.c.

Referenced by usbh_hid_mouse_process().

◆ usbh_hid_mouse_process()

void usbh_hid_mouse_process ( usb_hid_mouse_type * mouse )

usb host hid mouse process

Parameters
mouse mouse data type
Return values
none

Definition at line 132 of file usbh_hid_mouse.c.

Referenced by usbh_hid_mouse_decode().

Variable Documentation

◆ hid_mouse

usb_hid_mouse_type hid_mouse

Definition at line 41 of file usbh_hid_mouse.c.

Referenced by usbh_hid_mouse_decode().

◆ x_pos

uint16_t x_pos = 0

Definition at line 42 of file usbh_hid_mouse.c.

Referenced by usbh_hid_mouse_position().

◆ y_pos

uint16_t y_pos = 0

Definition at line 42 of file usbh_hid_mouse.c.

Referenced by usbh_hid_mouse_position().


AT32F415 Firmwary Library: USBH_hid_class_mouse_definition

Data Structures | Macros | Functions
USBH_hid_class_mouse_definition
AT32F415_middlewares_usbh_class » USBH_hid_class_mouse

Data Structures

struct usb_hid_mouse_type
usb hid mouse type More...

Macros

#define | MOUSE_WINDOW_X 100
usb hid mouse x y More...
#define | MOUSE_WINDOW_Y 220
#define | MOUSE_WINDOW_HEIGHT 90
#define | MOUSE_WINDOW_WIDTH 128
#define | MOUSE_BUTTON_LEFT 0x00
usb hid mouse button More...
#define | MOUSE_BUTTON_RIGHT 0x01
#define | MOUSE_BUTTON_MIDDLE 0x02

Functions

void usbh_hid_mouse_decode (uint8_t *mouse_data)
usb host hid mouse decode More...

Detailed Description

Macro Definition Documentation

◆ MOUSE_BUTTON_LEFT

#define MOUSE_BUTTON_LEFT 0x00

usb hid mouse button

Definition at line 59 of file usbh_hid_mouse.h.

◆ MOUSE_BUTTON_MIDDLE

#define MOUSE_BUTTON_MIDDLE 0x02

Definition at line 61 of file usbh_hid_mouse.h.

◆ MOUSE_BUTTON_RIGHT

#define MOUSE_BUTTON_RIGHT 0x01

Definition at line 60 of file usbh_hid_mouse.h.

◆ MOUSE_WINDOW_HEIGHT

#define MOUSE_WINDOW_HEIGHT 90

Definition at line 53 of file usbh_hid_mouse.h.

◆ MOUSE_WINDOW_WIDTH

#define MOUSE_WINDOW_WIDTH 128

Definition at line 54 of file usbh_hid_mouse.h.

◆ MOUSE_WINDOW_X

#define MOUSE_WINDOW_X 100

usb hid mouse x y

Definition at line 51 of file usbh_hid_mouse.h.

◆ MOUSE_WINDOW_Y

#define MOUSE_WINDOW_Y 220

Definition at line 52 of file usbh_hid_mouse.h.

Function Documentation

◆ usbh_hid_mouse_decode()

void usbh_hid_mouse_decode ( uint8_t * mouse_data )

usb host hid mouse decode

Parameters
mouse_data mouse data
Return values
none

Definition at line 167 of file usbh_hid_mouse.c.

Referenced by uhost_process_handler().


AT32F415 Firmwary Library: usb_hid_mouse_type Struct Reference

Data Fields
usb_hid_mouse_type Struct Reference
AT32F415_middlewares_usbh_class » USBH_hid_class_mouse » USBH_hid_class_mouse_definition

usb hid mouse type More...

#include <usbh_hid_mouse.h>

Data Fields

uint8_t | button
uint8_t | x
uint8_t | y
uint8_t | z

Detailed Description

usb hid mouse type

Definition at line 66 of file usbh_hid_mouse.h.

Field Documentation

◆ button

uint8_t usb_hid_mouse_type::button

Definition at line 68 of file usbh_hid_mouse.h.

Referenced by usbh_hid_mouse_decode(), and usbh_hid_mouse_process().

◆ x

uint8_t usb_hid_mouse_type::x

Definition at line 69 of file usbh_hid_mouse.h.

Referenced by usbh_hid_mouse_decode(), and usbh_hid_mouse_process().

◆ y

uint8_t usb_hid_mouse_type::y

Definition at line 70 of file usbh_hid_mouse.h.

Referenced by usbh_hid_mouse_decode(), and usbh_hid_mouse_process().

◆ z

uint8_t usb_hid_mouse_type::z

Definition at line 71 of file usbh_hid_mouse.h.

Referenced by usbh_hid_mouse_decode().

The documentation for this struct was generated from the following file:
  • usbh_hid_mouse.h


AT32F415 Firmwary Library: USBH_msc_bot_scsi_class

Modules
USBH_msc_bot_scsi_class
AT32F415_middlewares_usbh_class

usb host class msc bot scsi More...

Modules

USBH_msc_bot_scsi_class_private_functions
USBH_msc_bot_scsi_class_definition

Detailed Description

usb host class msc bot scsi


AT32F415 Firmwary Library: USBH_msc_bot_scsi_class_private_functions

Functions
USBH_msc_bot_scsi_class_private_functions
AT32F415_middlewares_usbh_class » USBH_msc_bot_scsi_class

Functions

static usb_sts_type | usbh_bot_cbw (msc_bot_cbw_type *cbw, uint32_t data_length, uint8_t cmd_len, uint8_t flag)
usb host bulk-only cbw More...
static usb_sts_type | usbh_cmd_inquiry (msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
usb host msc command inquiry More...
static usb_sts_type | usbh_cmd_capacity10 (msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
usb host msc command capacity10 More...
static usb_sts_type | usbh_cmd_test_unit_ready (msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
usb host msc command test unit ready More...
static usb_sts_type | usbh_cmd_requset_sense (msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
usb host msc command request sense More...
static usb_sts_type | usbh_cmd_write (msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun, uint32_t data_len, uint32_t address, uint8_t *buffer)
usb host msc command write More...
static usb_sts_type | usbh_cmd_read (msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun, uint32_t data_len, uint32_t address, uint8_t *buffer)
usb host msc command read More...
usb_sts_type | usbh_check_csw (msc_bot_cbw_type *cbw, msc_bot_csw_type *csw)
usb host csw check More...
usb_sts_type | usb_bot_request (void *uhost, msc_bot_trans_type *bot_trans)
usb host msc bulk-only request More...
usb_sts_type | usbh_msc_bot_scsi_get_inquiry (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_inquiry *inquiry)
usb host msc bulk-only get inquiry request More...
usb_sts_type | usbh_msc_bot_scsi_capacity (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_capacity *capacity)
usb host msc bulk-only capacity request More...
usb_sts_type | usbh_msc_bot_scsi_test_unit_ready (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only tet unit ready request More...
usb_sts_type | usbh_msc_bot_scsi_request_sense (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only request sense request More...
usb_sts_type | usbh_msc_bot_scsi_write (void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *write_data, uint32_t write_len, uint8_t lun)
usb host msc bulk-only write request More...
usb_sts_type | usbh_msc_bot_scsi_read (void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *read_data, uint32_t read_len, uint8_t lun)
usb host msc bulk-only read request More...
usb_sts_type msc_bot_scsi_init (usbh_msc_type *msc_struct)
usb host msc init More...

Detailed Description

Function Documentation

◆ msc_bot_scsi_init()

usb_sts_type msc_bot_scsi_init ( usbh_msc_type * msc_struct )

usb host msc init

Parameters
msc_struct to the structure of usbh_msc_type
Return values
status usb_sts_type status

Definition at line 592 of file usbh_msc_bot_scsi.c.

Referenced by uhost_init_handler().

◆ usb_bot_request()

usb_sts_type usb_bot_request | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans
 | ) |  |

usb host msc bulk-only request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
Return values
status usb_sts_type status

Definition at line 218 of file usbh_msc_bot_scsi.c.

Referenced by usbh_msc_bot_scsi_capacity(), usbh_msc_bot_scsi_get_inquiry(), usbh_msc_bot_scsi_read(), usbh_msc_bot_scsi_request_sense(), usbh_msc_bot_scsi_test_unit_ready(), and usbh_msc_bot_scsi_write().

◆ usbh_bot_cbw()

static usb_sts_type usbh_bot_cbw | ( | msc_bot_cbw_type * | cbw,
 |  | uint32_t | data_length,
 |  | uint8_t | cmd_len,
 |  | uint8_t | flag
 | ) |  |
static

usb host bulk-only cbw

Parameters
cbw | to the structure of msc_bot_cbw_type
data_length | data length
cmd_len | command len
flag | cbw flag
Return values
status usb_sts_type status

Definition at line 63 of file usbh_msc_bot_scsi.c.

Referenced by usbh_msc_bot_scsi_capacity(), usbh_msc_bot_scsi_get_inquiry(), usbh_msc_bot_scsi_read(), usbh_msc_bot_scsi_request_sense(), usbh_msc_bot_scsi_test_unit_ready(), and usbh_msc_bot_scsi_write().

◆ usbh_check_csw()

usb_sts_type usbh_check_csw | ( | msc_bot_cbw_type * | cbw,
 |  | msc_bot_csw_type * | csw
 | ) |  |

usb host csw check

Parameters
cbw | to the structure of msc_bot_cbw_type
csw | to the structure of msc_bot_csw_type
Return values
status usb_sts_type status

Definition at line 205 of file usbh_msc_bot_scsi.c.

Referenced by usb_bot_request().

◆ usbh_cmd_capacity10()

static usb_sts_type usbh_cmd_capacity10 | ( | msc_bot_trans_type * | bot_trans,
 |  | uint8_t * | cmd,
 |  | uint8_t | lun
 | ) |  |
static

usb host msc command capacity10

Parameters
bot_trans | to the structure of msc_bot_trans_type
cmd | command buffer
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 103 of file usbh_msc_bot_scsi.c.

Referenced by usbh_msc_bot_scsi_capacity().

◆ usbh_cmd_inquiry()

static usb_sts_type usbh_cmd_inquiry | ( | msc_bot_trans_type * | bot_trans,
 |  | uint8_t * | cmd,
 |  | uint8_t | lun
 | ) |  |
static

usb host msc command inquiry

Parameters
bot_trans | to the structure of msc_bot_trans_type
cmd | command buffer
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 85 of file usbh_msc_bot_scsi.c.

Referenced by usbh_msc_bot_scsi_get_inquiry().

◆ usbh_cmd_read()

static usb_sts_type usbh_cmd_read | ( | msc_bot_trans_type * | bot_trans,
 |  | uint8_t * | cmd,
 |  | uint8_t | lun,
 |  | uint32_t | data_len,
 |  | uint32_t | address,
 |  | uint8_t * | buffer
 | ) |  |
static

usb host msc command read

Parameters
bot_trans | to the structure of msc_bot_trans_type
cmd | command buffer
lun | logical unit number
data_len | transfer data length
address | logical block address
buffer | transfer data buffer
Return values
status usb_sts_type status

Definition at line 182 of file usbh_msc_bot_scsi.c.

Referenced by usbh_msc_bot_scsi_read().

◆ usbh_cmd_requset_sense()

static usb_sts_type usbh_cmd_requset_sense | ( | msc_bot_trans_type * | bot_trans,
 |  | uint8_t * | cmd,
 |  | uint8_t | lun
 | ) |  |
static

usb host msc command request sense

Parameters
bot_trans | to the structure of msc_bot_trans_type
cmd | command buffer
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 135 of file usbh_msc_bot_scsi.c.

Referenced by usbh_msc_bot_scsi_request_sense().

◆ usbh_cmd_test_unit_ready()

static usb_sts_type usbh_cmd_test_unit_ready | ( | msc_bot_trans_type * | bot_trans,
 |  | uint8_t * | cmd,
 |  | uint8_t | lun
 | ) |  |
static

usb host msc command test unit ready

Parameters
bot_trans | to the structure of msc_bot_trans_type
cmd | command buffer
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 120 of file usbh_msc_bot_scsi.c.

Referenced by usbh_msc_bot_scsi_test_unit_ready().

◆ usbh_cmd_write()

static usb_sts_type usbh_cmd_write | ( | msc_bot_trans_type * | bot_trans,
 |  | uint8_t * | cmd,
 |  | uint8_t | lun,
 |  | uint32_t | data_len,
 |  | uint32_t | address,
 |  | uint8_t * | buffer
 | ) |  |
static

usb host msc command write

Parameters
bot_trans | to the structure of msc_bot_trans_type
cmd | command buffer
lun | logical unit number
data_len | transfer data length
address | logical block address
buffer | transfer data buffer
Return values
status usb_sts_type status

Definition at line 155 of file usbh_msc_bot_scsi.c.

Referenced by usbh_msc_bot_scsi_write().

◆ usbh_msc_bot_scsi_capacity()

usb_sts_type usbh_msc_bot_scsi_capacity | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans,
 |  | uint8_t | lun,
 |  | msc_scsi_data_capacity * | capacity
 | ) |  |

usb host msc bulk-only capacity request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
lun | logical unit number
capacity | to the structure of msc_scsi_data_capacity
Return values
status usb_sts_type status

Definition at line 414 of file usbh_msc_bot_scsi.c.

Referenced by uhost_process_handler().

◆ usbh_msc_bot_scsi_get_inquiry()

usb_sts_type usbh_msc_bot_scsi_get_inquiry | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans,
 |  | uint8_t | lun,
 |  | msc_scsi_data_inquiry * | inquiry
 | ) |  |

usb host msc bulk-only get inquiry request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
lun | logical unit number
inquiry | to the structure of msc_scsi_data_inquiry
Return values
status usb_sts_type status

Definition at line 380 of file usbh_msc_bot_scsi.c.

Referenced by uhost_process_handler().

◆ usbh_msc_bot_scsi_read()

usb_sts_type usbh_msc_bot_scsi_read | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans,
 |  | uint32_t | address,
 |  | uint8_t * | read_data,
 |  | uint32_t | read_len,
 |  | uint8_t | lun
 | ) |  |

usb host msc bulk-only read request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
address | logical block address
read_data | read data buffer
read_len | read data length
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 559 of file usbh_msc_bot_scsi.c.

Referenced by usbh_msc_read().

◆ usbh_msc_bot_scsi_request_sense()

usb_sts_type usbh_msc_bot_scsi_request_sense | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans,
 |  | uint8_t | lun
 | ) |  |

usb host msc bulk-only request sense request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 484 of file usbh_msc_bot_scsi.c.

Referenced by uhost_process_handler().

◆ usbh_msc_bot_scsi_test_unit_ready()

usb_sts_type usbh_msc_bot_scsi_test_unit_ready | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans,
 |  | uint8_t | lun
 | ) |  |

usb host msc bulk-only tet unit ready request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 450 of file usbh_msc_bot_scsi.c.

Referenced by uhost_process_handler().

◆ usbh_msc_bot_scsi_write()

usb_sts_type usbh_msc_bot_scsi_write | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans,
 |  | uint32_t | address,
 |  | uint8_t * | write_data,
 |  | uint32_t | write_len,
 |  | uint8_t | lun
 | ) |  |

usb host msc bulk-only write request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
address | logical block address
write_data | write data buffer
write_len | write data length
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 521 of file usbh_msc_bot_scsi.c.

Referenced by usbh_msc_write().


AT32F415 Firmwary Library: USBH_msc_bot_scsi_class_definition

Data Structures | Macros | Enumerations | Functions
USBH_msc_bot_scsi_class_definition
AT32F415_middlewares_usbh_class » USBH_msc_bot_scsi_class

Data Structures

struct | msc_scsi_data_inquiry
usb msc inquiry data type More...
struct | msc_scsi_data_capacity
usb msc capacity data type More...
struct | msc_bot_cbw_type
usb msc bulk-only command block wrapper type More...
struct | msc_bot_csw_type
usb msc bulk-only command status wrapper type More...
struct | msc_bot_trans_type
usb msc bulk-only transfer control type More...
struct | usbh_msc_unit_type
usb msc bank type More...

Macros

#define | MSC_CBW_SIGNATURE 0x43425355
#define | MSC_CSW_SIGNATURE 0x53425355
#define | MSC_CBW_TAG 0x50607080
#define | MSC_CBW_FLAG_IN 0x80
#define | MSC_CBW_FLAG_OUT 0x00
#define | MSC_CBW_LEN 31
#define | MSC_CSW_LEN 13
#define | MSC_CBW_CB_LEN 16
#define | MSC_TEST_UNIT_READY_CMD_LEN 12
#define | MSC_TEST_UNIT_READY_DATA_LEN 0
#define | MSC_INQUIRY_CMD_LEN 12
#define | MSC_INQUIRY_DATA_LEN 36
#define | MSC_CAPACITY10_CMD_LEN 12
#define | MSC_CAPACITY10_DATA_LEN 8
#define | MSC_REQUEST_SENSE_CMD_LEN 12
#define | MSC_REQUEST_SENSE_DATA_LEN 18
#define | MSC_WRITE_CMD_LEN 12
#define | MSC_READ_CMD_LEN 10
#define | MSC_OPCODE_INQUIRY 0x12
#define | MSC_OPCODE_CAPACITY 0x25
#define | MSC_OPCODE_TEST_UNIT_READY 0x00
#define | MSC_OPCODE_REQUEST_SENSE 0x03
#define | MSC_OPCODE_WRITE10 0x2A
#define | MSC_OPCODE_READ10 0x28

Enumerations

enum msc_bot_state_type {
BOT_STATE_IDLE , BOT_STATE_SEND_CBW , BOT_STATE_SEND_CBW_WAIT , BOT_STATE_DATA_IN ,
BOT_STATE_DATA_IN_WAIT , BOT_STATE_DATA_OUT , BOT_STATE_DATA_OUT_WAIT , BOT_STATE_RECV_CSW ,
BOT_STATE_RECV_CSW_WAIT , BOT_STATE_ERROR , BOT_STATE_COMPLETE
}
enum | msc_cmd_state_type { CMD_STATE_SEND , CMD_STATE_WAIT }
enum msc_state_type {
USBH_MSC_INIT , USBH_MSC_INQUIRY , USBH_MSC_TEST_UNIT_READY , USBH_MSC_READ_CAPACITY10 ,
USBH_MSC_REQUEST_SENSE , USBH_MSC_READ10 , USBH_MSC_WRITE , USBH_MSC_BUSY ,
USBH_MSC_ERROR , USBH_MSC_IDLE
}
usb msc process state More...
enum | msc_error_type { MSC_OK , MSC_NOT_READY , MSC_ERROR }

Functions

usb_sts_type | usb_bot_request (void *uhost, msc_bot_trans_type *bot_trans)
usb host msc bulk-only request More...
usb_sts_type | usbh_msc_bot_scsi_get_inquiry (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_inquiry *inquiry)
usb host msc bulk-only get inquiry request More...
usb_sts_type | usbh_msc_bot_scsi_capacity (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_capacity *capacity)
usb host msc bulk-only capacity request More...
usb_sts_type | usbh_msc_bot_scsi_test_unit_ready (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only tet unit ready request More...
usb_sts_type | usbh_msc_bot_scsi_request_sense (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only request sense request More...
usb_sts_type | usbh_msc_bot_scsi_write (void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *write_data, uint32_t write_len, uint8_t lun)
usb host msc bulk-only write request More...
usb_sts_type | usbh_msc_bot_scsi_read (void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *read_data, uint32_t read_len, uint8_t lun)
usb host msc bulk-only read request More...

Detailed Description

Macro Definition Documentation

◆ MSC_CAPACITY10_CMD_LEN

#define MSC_CAPACITY10_CMD_LEN 12

Definition at line 62 of file usbh_msc_bot_scsi.h.

◆ MSC_CAPACITY10_DATA_LEN

#define MSC_CAPACITY10_DATA_LEN 8

Definition at line 63 of file usbh_msc_bot_scsi.h.

◆ MSC_CBW_CB_LEN

#define MSC_CBW_CB_LEN 16

Definition at line 57 of file usbh_msc_bot_scsi.h.

◆ MSC_CBW_FLAG_IN

#define MSC_CBW_FLAG_IN 0x80

Definition at line 52 of file usbh_msc_bot_scsi.h.

◆ MSC_CBW_FLAG_OUT

#define MSC_CBW_FLAG_OUT 0x00

Definition at line 53 of file usbh_msc_bot_scsi.h.

◆ MSC_CBW_LEN

#define MSC_CBW_LEN 31

Definition at line 55 of file usbh_msc_bot_scsi.h.

◆ MSC_CBW_SIGNATURE

#define MSC_CBW_SIGNATURE 0x43425355

Definition at line 49 of file usbh_msc_bot_scsi.h.

◆ MSC_CBW_TAG

#define MSC_CBW_TAG 0x50607080

Definition at line 51 of file usbh_msc_bot_scsi.h.

◆ MSC_CSW_LEN

#define MSC_CSW_LEN 13

Definition at line 56 of file usbh_msc_bot_scsi.h.

◆ MSC_CSW_SIGNATURE

#define MSC_CSW_SIGNATURE 0x53425355

Definition at line 50 of file usbh_msc_bot_scsi.h.

◆ MSC_INQUIRY_CMD_LEN

#define MSC_INQUIRY_CMD_LEN 12

Definition at line 60 of file usbh_msc_bot_scsi.h.

◆ MSC_INQUIRY_DATA_LEN

#define MSC_INQUIRY_DATA_LEN 36

Definition at line 61 of file usbh_msc_bot_scsi.h.

◆ MSC_OPCODE_CAPACITY

#define MSC_OPCODE_CAPACITY 0x25

Definition at line 70 of file usbh_msc_bot_scsi.h.

◆ MSC_OPCODE_INQUIRY

#define MSC_OPCODE_INQUIRY 0x12

Definition at line 69 of file usbh_msc_bot_scsi.h.

◆ MSC_OPCODE_READ10

#define MSC_OPCODE_READ10 0x28

Definition at line 74 of file usbh_msc_bot_scsi.h.

◆ MSC_OPCODE_REQUEST_SENSE

#define MSC_OPCODE_REQUEST_SENSE 0x03

Definition at line 72 of file usbh_msc_bot_scsi.h.

◆ MSC_OPCODE_TEST_UNIT_READY

#define MSC_OPCODE_TEST_UNIT_READY 0x00

Definition at line 71 of file usbh_msc_bot_scsi.h.

◆ MSC_OPCODE_WRITE10

#define MSC_OPCODE_WRITE10 0x2A

Definition at line 73 of file usbh_msc_bot_scsi.h.

◆ MSC_READ_CMD_LEN

#define MSC_READ_CMD_LEN 10

Definition at line 67 of file usbh_msc_bot_scsi.h.

◆ MSC_REQUEST_SENSE_CMD_LEN

#define MSC_REQUEST_SENSE_CMD_LEN 12

Definition at line 64 of file usbh_msc_bot_scsi.h.

◆ MSC_REQUEST_SENSE_DATA_LEN

#define MSC_REQUEST_SENSE_DATA_LEN 18

Definition at line 65 of file usbh_msc_bot_scsi.h.

◆ MSC_TEST_UNIT_READY_CMD_LEN

#define MSC_TEST_UNIT_READY_CMD_LEN 12

Definition at line 58 of file usbh_msc_bot_scsi.h.

◆ MSC_TEST_UNIT_READY_DATA_LEN

#define MSC_TEST_UNIT_READY_DATA_LEN 0

Definition at line 59 of file usbh_msc_bot_scsi.h.

◆ MSC_WRITE_CMD_LEN

#define MSC_WRITE_CMD_LEN 12

Definition at line 66 of file usbh_msc_bot_scsi.h.

Enumeration Type Documentation

◆ msc_bot_state_type

enum msc_bot_state_type
Enumerator
BOT_STATE_IDLE
BOT_STATE_SEND_CBW
BOT_STATE_SEND_CBW_WAIT
BOT_STATE_DATA_IN
BOT_STATE_DATA_IN_WAIT
BOT_STATE_DATA_OUT
BOT_STATE_DATA_OUT_WAIT
BOT_STATE_RECV_CSW
BOT_STATE_RECV_CSW_WAIT
BOT_STATE_ERROR
BOT_STATE_COMPLETE

Definition at line 76 of file usbh_msc_bot_scsi.h.

◆ msc_cmd_state_type

enum msc_cmd_state_type
Enumerator
CMD_STATE_SEND
CMD_STATE_WAIT

Definition at line 91 of file usbh_msc_bot_scsi.h.

◆ msc_error_type

enum msc_error_type
Enumerator
MSC_OK
MSC_NOT_READY
MSC_ERROR

Definition at line 114 of file usbh_msc_bot_scsi.h.

◆ msc_state_type

enum msc_state_type

usb msc process state

Enumerator
USBH_MSC_INIT
USBH_MSC_INQUIRY
USBH_MSC_TEST_UNIT_READY
USBH_MSC_READ_CAPACITY10
USBH_MSC_REQUEST_SENSE
USBH_MSC_READ10
USBH_MSC_WRITE
USBH_MSC_BUSY
USBH_MSC_ERROR
USBH_MSC_IDLE

Definition at line 100 of file usbh_msc_bot_scsi.h.

Function Documentation

◆ usb_bot_request()

usb_sts_type usb_bot_request | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans
 | ) |  |

usb host msc bulk-only request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
Return values
status usb_sts_type status

Definition at line 218 of file usbh_msc_bot_scsi.c.

Referenced by usbh_msc_bot_scsi_capacity(), usbh_msc_bot_scsi_get_inquiry(), usbh_msc_bot_scsi_read(), usbh_msc_bot_scsi_request_sense(), usbh_msc_bot_scsi_test_unit_ready(), and usbh_msc_bot_scsi_write().

◆ usbh_msc_bot_scsi_capacity()

usb_sts_type usbh_msc_bot_scsi_capacity | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans,
 |  | uint8_t | lun,
 |  | msc_scsi_data_capacity * | capacity
 | ) |  |

usb host msc bulk-only capacity request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
lun | logical unit number
capacity | to the structure of msc_scsi_data_capacity
Return values
status usb_sts_type status

Definition at line 414 of file usbh_msc_bot_scsi.c.

Referenced by uhost_process_handler().

◆ usbh_msc_bot_scsi_get_inquiry()

usb_sts_type usbh_msc_bot_scsi_get_inquiry | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans,
 |  | uint8_t | lun,
 |  | msc_scsi_data_inquiry * | inquiry
 | ) |  |

usb host msc bulk-only get inquiry request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
lun | logical unit number
inquiry | to the structure of msc_scsi_data_inquiry
Return values
status usb_sts_type status

Definition at line 380 of file usbh_msc_bot_scsi.c.

Referenced by uhost_process_handler().

◆ usbh_msc_bot_scsi_read()

usb_sts_type usbh_msc_bot_scsi_read | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans,
 |  | uint32_t | address,
 |  | uint8_t * | read_data,
 |  | uint32_t | read_len,
 |  | uint8_t | lun
 | ) |  |

usb host msc bulk-only read request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
address | logical block address
read_data | read data buffer
read_len | read data length
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 559 of file usbh_msc_bot_scsi.c.

Referenced by usbh_msc_read().

◆ usbh_msc_bot_scsi_request_sense()

usb_sts_type usbh_msc_bot_scsi_request_sense | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans,
 |  | uint8_t | lun
 | ) |  |

usb host msc bulk-only request sense request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 484 of file usbh_msc_bot_scsi.c.

Referenced by uhost_process_handler().

◆ usbh_msc_bot_scsi_test_unit_ready()

usb_sts_type usbh_msc_bot_scsi_test_unit_ready | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans,
 |  | uint8_t | lun
 | ) |  |

usb host msc bulk-only tet unit ready request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 450 of file usbh_msc_bot_scsi.c.

Referenced by uhost_process_handler().

◆ usbh_msc_bot_scsi_write()

usb_sts_type usbh_msc_bot_scsi_write | ( | void * | uhost,
 |  | msc_bot_trans_type * | bot_trans,
 |  | uint32_t | address,
 |  | uint8_t * | write_data,
 |  | uint32_t | write_len,
 |  | uint8_t | lun
 | ) |  |

usb host msc bulk-only write request

Parameters
uhost | to the structure of usbh_core_type
bot_trans | to the structure of msc_bot_trans_type
address | logical block address
write_data | write data buffer
write_len | write data length
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 521 of file usbh_msc_bot_scsi.c.

Referenced by usbh_msc_write().


AT32F415 Firmwary Library: msc_scsi_data_inquiry Struct Reference

Data Fields
msc_scsi_data_inquiry Struct Reference
AT32F415_middlewares_usbh_class » USBH_msc_bot_scsi_class » USBH_msc_bot_scsi_class_definition

usb msc inquiry data type More...

#include <usbh_msc_bot_scsi.h>

Data Fields

uint8_t | pdev_type
uint8_t | rmb
uint8_t | version
uint8_t | data_format
uint8_t | length
uint8_t | reserved [3]
uint8_t | vendor [8]
uint8_t | product [16]
uint8_t | revision [4]

Detailed Description

usb msc inquiry data type

Definition at line 125 of file usbh_msc_bot_scsi.h.

Field Documentation

◆ data_format

uint8_t msc_scsi_data_inquiry::data_format

Definition at line 130 of file usbh_msc_bot_scsi.h.

◆ length

uint8_t msc_scsi_data_inquiry::length

Definition at line 131 of file usbh_msc_bot_scsi.h.

◆ pdev_type

uint8_t msc_scsi_data_inquiry::pdev_type

Definition at line 127 of file usbh_msc_bot_scsi.h.

◆ product

uint8_t msc_scsi_data_inquiry::product[16]

Definition at line 134 of file usbh_msc_bot_scsi.h.

◆ reserved

uint8_t msc_scsi_data_inquiry::reserved[3]

Definition at line 132 of file usbh_msc_bot_scsi.h.

◆ revision

uint8_t msc_scsi_data_inquiry::revision[4]

Definition at line 135 of file usbh_msc_bot_scsi.h.

◆ rmb

uint8_t msc_scsi_data_inquiry::rmb

Definition at line 128 of file usbh_msc_bot_scsi.h.

◆ vendor

uint8_t msc_scsi_data_inquiry::vendor[8]

Definition at line 133 of file usbh_msc_bot_scsi.h.

◆ version

uint8_t msc_scsi_data_inquiry::version

Definition at line 129 of file usbh_msc_bot_scsi.h.

The documentation for this struct was generated from the following file:
  • usbh_msc_bot_scsi.h


AT32F415 Firmwary Library: msc_scsi_data_capacity Struct Reference

Data Fields
msc_scsi_data_capacity Struct Reference
AT32F415_middlewares_usbh_class » USBH_msc_bot_scsi_class » USBH_msc_bot_scsi_class_definition

usb msc capacity data type More...

#include <usbh_msc_bot_scsi.h>

Data Fields

uint32_t | blk_nbr
uint32_t | blk_size

Detailed Description

usb msc capacity data type

Definition at line 142 of file usbh_msc_bot_scsi.h.

Field Documentation

◆ blk_nbr

uint32_t msc_scsi_data_capacity::blk_nbr

Definition at line 144 of file usbh_msc_bot_scsi.h.

Referenced by disk_ioctl(), uhost_process_handler(), and usbh_msc_bot_scsi_capacity().

◆ blk_size

uint32_t msc_scsi_data_capacity::blk_size

Definition at line 145 of file usbh_msc_bot_scsi.h.

Referenced by uhost_process_handler(), and usbh_msc_bot_scsi_capacity().

The documentation for this struct was generated from the following file:
  • usbh_msc_bot_scsi.h


AT32F415 Firmwary Library: msc_bot_cbw_type Struct Reference

Data Fields
msc_bot_cbw_type Struct Reference
AT32F415_middlewares_usbh_class » USBH_msc_bot_scsi_class » USBH_msc_bot_scsi_class_definition

usb msc bulk-only command block wrapper type More...

#include <usbh_msc_bot_scsi.h>

Data Fields

uint32_t | dCBWSignature
uint32_t | dCBWTag
uint32_t | dCBWDataTransferLength
uint8_t | bmCBWFlags
uint8_t | bCBWLUN
uint8_t | bCBWCBLength
uint8_t | CBWCB [16]

Detailed Description

usb msc bulk-only command block wrapper type

Definition at line 151 of file usbh_msc_bot_scsi.h.

Field Documentation

◆ bCBWCBLength

uint8_t msc_bot_cbw_type::bCBWCBLength

Definition at line 158 of file usbh_msc_bot_scsi.h.

Referenced by usbh_bot_cbw().

◆ bCBWLUN

uint8_t msc_bot_cbw_type::bCBWLUN

Definition at line 157 of file usbh_msc_bot_scsi.h.

◆ bmCBWFlags

uint8_t msc_bot_cbw_type::bmCBWFlags

Definition at line 156 of file usbh_msc_bot_scsi.h.

Referenced by usb_bot_request(), and usbh_bot_cbw().

◆ CBWCB

uint8_t msc_bot_cbw_type::CBWCB[16]

Definition at line 159 of file usbh_msc_bot_scsi.h.

Referenced by usbh_bot_cbw(), usbh_msc_bot_scsi_capacity(), usbh_msc_bot_scsi_get_inquiry(), usbh_msc_bot_scsi_read(), usbh_msc_bot_scsi_request_sense(), usbh_msc_bot_scsi_test_unit_ready(), and usbh_msc_bot_scsi_write().

◆ dCBWDataTransferLength

uint32_t msc_bot_cbw_type::dCBWDataTransferLength

Definition at line 155 of file usbh_msc_bot_scsi.h.

Referenced by usb_bot_request(), and usbh_bot_cbw().

◆ dCBWSignature

uint32_t msc_bot_cbw_type::dCBWSignature

Definition at line 153 of file usbh_msc_bot_scsi.h.

Referenced by usbh_bot_cbw().

◆ dCBWTag

uint32_t msc_bot_cbw_type::dCBWTag

Definition at line 154 of file usbh_msc_bot_scsi.h.

Referenced by usbh_bot_cbw().

The documentation for this struct was generated from the following file:
  • usbh_msc_bot_scsi.h


AT32F415 Firmwary Library: msc_bot_csw_type Struct Reference

Data Fields
msc_bot_csw_type Struct Reference
AT32F415_middlewares_usbh_class » USBH_msc_bot_scsi_class » USBH_msc_bot_scsi_class_definition

usb msc bulk-only command status wrapper type More...

#include <usbh_msc_bot_scsi.h>

Data Fields

uint32_t | dCBWSignature
uint32_t | dCBWTag
uint32_t | dCSWDataResidue
uint8_t | bCSWStatus

Detailed Description

usb msc bulk-only command status wrapper type

Definition at line 165 of file usbh_msc_bot_scsi.h.

Field Documentation

◆ bCSWStatus

uint8_t msc_bot_csw_type::bCSWStatus

Definition at line 170 of file usbh_msc_bot_scsi.h.

◆ dCBWSignature

uint32_t msc_bot_csw_type::dCBWSignature

Definition at line 167 of file usbh_msc_bot_scsi.h.

◆ dCBWTag

uint32_t msc_bot_csw_type::dCBWTag

Definition at line 168 of file usbh_msc_bot_scsi.h.

◆ dCSWDataResidue

uint32_t msc_bot_csw_type::dCSWDataResidue

Definition at line 169 of file usbh_msc_bot_scsi.h.

The documentation for this struct was generated from the following file:
  • usbh_msc_bot_scsi.h


AT32F415 Firmwary Library: msc_bot_trans_type Struct Reference

Data Fields
msc_bot_trans_type Struct Reference
AT32F415_middlewares_usbh_class » USBH_msc_bot_scsi_class » USBH_msc_bot_scsi_class_definition

usb msc bulk-only transfer control type More...

#include <usbh_msc_bot_scsi.h>

Data Fields

uint8_t | buffer [32]
msc_bot_cbw_type cbw
msc_bot_csw_type csw
msc_cmd_state_type cmd_state
msc_bot_state_type bot_state
uint8_t * | data
void * | msc_struct

Detailed Description

usb msc bulk-only transfer control type

Definition at line 176 of file usbh_msc_bot_scsi.h.

Field Documentation

◆ bot_state

msc_bot_state_type msc_bot_trans_type::bot_state

Definition at line 182 of file usbh_msc_bot_scsi.h.

Referenced by usb_bot_request(), usbh_msc_bot_scsi_capacity(), usbh_msc_bot_scsi_get_inquiry(), usbh_msc_bot_scsi_read(), usbh_msc_bot_scsi_request_sense(), usbh_msc_bot_scsi_test_unit_ready(), and usbh_msc_bot_scsi_write().

◆ buffer

uint8_t msc_bot_trans_type::buffer[32]

Definition at line 178 of file usbh_msc_bot_scsi.h.

Referenced by usbh_cmd_capacity10(), usbh_cmd_requset_sense(), and usbh_msc_bot_scsi_capacity().

◆ cbw

msc_bot_cbw_type msc_bot_trans_type::cbw

Definition at line 179 of file usbh_msc_bot_scsi.h.

Referenced by usb_bot_request(), usbh_msc_bot_scsi_capacity(), usbh_msc_bot_scsi_get_inquiry(), usbh_msc_bot_scsi_read(), usbh_msc_bot_scsi_request_sense(), usbh_msc_bot_scsi_test_unit_ready(), and usbh_msc_bot_scsi_write().

◆ cmd_state

msc_cmd_state_type msc_bot_trans_type::cmd_state

Definition at line 181 of file usbh_msc_bot_scsi.h.

Referenced by usb_bot_request(), usbh_msc_bot_scsi_capacity(), usbh_msc_bot_scsi_get_inquiry(), usbh_msc_bot_scsi_read(), usbh_msc_bot_scsi_request_sense(), usbh_msc_bot_scsi_test_unit_ready(), and usbh_msc_bot_scsi_write().

◆ csw

msc_bot_csw_type msc_bot_trans_type::csw

Definition at line 180 of file usbh_msc_bot_scsi.h.

Referenced by usb_bot_request().

◆ data

uint8_t* msc_bot_trans_type::data

Definition at line 183 of file usbh_msc_bot_scsi.h.

Referenced by usb_bot_request(), usbh_cmd_inquiry(), usbh_cmd_read(), usbh_cmd_requset_sense(), and usbh_cmd_write().

◆ msc_struct

void* msc_bot_trans_type::msc_struct

Definition at line 184 of file usbh_msc_bot_scsi.h.

Referenced by usb_bot_request(), usbh_cmd_capacity10(), usbh_cmd_inquiry(), usbh_msc_read(), and usbh_msc_write().

The documentation for this struct was generated from the following file:
  • usbh_msc_bot_scsi.h


AT32F415 Firmwary Library: usbh_msc_unit_type Struct Reference

Data Fields
usbh_msc_unit_type Struct Reference
AT32F415_middlewares_usbh_class » USBH_msc_bot_scsi_class » USBH_msc_bot_scsi_class_definition

usb msc bank type More...

#include <usbh_msc_bot_scsi.h>

Data Fields

msc_scsi_data_inquiry inquiry
msc_scsi_data_capacity capacity
msc_state_type state
msc_error_type ready
usb_sts_type pre_state
uint8_t change

Detailed Description

usb msc bank type

Definition at line 190 of file usbh_msc_bot_scsi.h.

Field Documentation

◆ capacity

msc_scsi_data_capacity usbh_msc_unit_type::capacity

Definition at line 193 of file usbh_msc_bot_scsi.h.

Referenced by disk_ioctl(), and uhost_process_handler().

◆ change

uint8_t usbh_msc_unit_type::change

Definition at line 197 of file usbh_msc_bot_scsi.h.

Referenced by uhost_request_handler(), and uhost_reset_handler().

◆ inquiry

msc_scsi_data_inquiry usbh_msc_unit_type::inquiry

Definition at line 192 of file usbh_msc_bot_scsi.h.

Referenced by uhost_process_handler().

◆ pre_state

usb_sts_type usbh_msc_unit_type::pre_state

Definition at line 196 of file usbh_msc_bot_scsi.h.

Referenced by uhost_request_handler(), and uhost_reset_handler().

◆ ready

msc_error_type usbh_msc_unit_type::ready

Definition at line 195 of file usbh_msc_bot_scsi.h.

Referenced by uhost_process_handler(), uhost_reset_handler(), and usbh_msc_is_ready().

◆ state

msc_state_type usbh_msc_unit_type::state

Definition at line 194 of file usbh_msc_bot_scsi.h.

Referenced by uhost_process_handler(), uhost_request_handler(), uhost_reset_handler(), usbh_msc_read(), and usbh_msc_write().

The documentation for this struct was generated from the following file:
  • usbh_msc_bot_scsi.h


AT32F415 Firmwary Library: USBH_msc_class

Modules
USBH_msc_class
AT32F415_middlewares_usbh_class

usb host class msc demo More...

Modules

USBH_msc_class_private_functions
USBH_msc_class_definition

Detailed Description

usb host class msc demo


AT32F415 Firmwary Library: USBH_msc_class_private_functions

Functions | Variables
USBH_msc_class_private_functions
AT32F415_middlewares_usbh_class » USBH_msc_class

Functions

usb_sts_type | uhost_init_handler (void *uhost)
usb host class init handler More...
usb_sts_type | uhost_reset_handler (void *uhost)
usb host class reset handler More...
usb_sts_type | uhost_request_handler (void *uhost)
usb host hid class request handler More...
usb_sts_type | uhost_process_handler (void *uhost)
usb host class process handler More...
usb_sts_type | usbh_msc_get_max_lun (void *uhost, uint8_t *lun)
usb host msc get max lun More...
usb_sts_type | usbh_msc_clear_feature (void *uhost, uint8_t ept_num)
usb host msc clear feature More...
msc_error_type | usbh_msc_is_ready (void *uhost, uint8_t lun)
usb host msc clear feature More...
usb_sts_type | usbh_msc_read (void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc read More...
usb_sts_type | usbh_msc_write (void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc write More...

Variables

usbh_msc_type usbh_msc
usbh_class_handler_type uhost_class_handler

Detailed Description

Function Documentation

◆ uhost_init_handler()

usb_sts_type uhost_init_handler ( void * uhost )

usb host class init handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 71 of file usbh_msc_class.c.

◆ uhost_process_handler()

usb_sts_type uhost_process_handler ( void * uhost )

usb host class process handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 213 of file usbh_msc_class.c.

◆ uhost_request_handler()

usb_sts_type uhost_request_handler ( void * uhost )

usb host hid class request handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 170 of file usbh_msc_class.c.

◆ uhost_reset_handler()

usb_sts_type uhost_reset_handler ( void * uhost )

usb host class reset handler

Parameters
uhost to the structure of usbh_core_type
Return values
status usb_sts_type status

Definition at line 128 of file usbh_msc_class.c.

◆ usbh_msc_clear_feature()

usb_sts_type usbh_msc_clear_feature | ( | void * | uhost,
 |  | uint8_t | ept_num
 | ) |  |

usb host msc clear feature

Parameters
uhost | to the structure of usbh_core_type
ept_num | endpoint number
Return values
status usb_sts_type status

Definition at line 343 of file usbh_msc_class.c.

Referenced by uhost_request_handler().

◆ usbh_msc_get_max_lun()

usb_sts_type usbh_msc_get_max_lun | ( | void * | uhost,
 |  | uint8_t * | lun
 | ) |  |

usb host msc get max lun

Parameters
uhost | to the structure of usbh_core_type
lun | max lun buffer
Return values
status usb_sts_type status

Definition at line 313 of file usbh_msc_class.c.

Referenced by uhost_request_handler().

◆ usbh_msc_is_ready()

msc_error_type usbh_msc_is_ready | ( | void * | uhost,
 |  | uint8_t | lun
 | ) |  |

usb host msc clear feature

Parameters
lun logical unit number
Return values
msc_error_type status

Definition at line 372 of file usbh_msc_class.c.

Referenced by disk_status().

◆ usbh_msc_read()

usb_sts_type usbh_msc_read | ( | void * | uhost,
 |  | uint32_t | address,
 |  | uint32_t | len,
 |  | uint8_t * | buffer,
 |  | uint8_t | lun
 | ) |  |

usb host msc read

Parameters
uhost | to the structure of usbh_core_type
address | logical block address
data_len | transfer data length
buffer | transfer data buffer
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 388 of file usbh_msc_class.c.

Referenced by disk_read().

◆ usbh_msc_write()

usb_sts_type usbh_msc_write | ( | void * | uhost,
 |  | uint32_t | address,
 |  | uint32_t | len,
 |  | uint8_t * | buffer,
 |  | uint8_t | lun
 | ) |  |

usb host msc write

Parameters
uhost | to the structure of usbh_core_type
address | logical block address
data_len | transfer data length
buffer | transfer data buffer
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 436 of file usbh_msc_class.c.

Referenced by disk_write().

Variable Documentation

◆ uhost_class_handler

usbh_class_handler_type uhost_class_handler
Initial value:
=
{
uhost_init_handler,
uhost_reset_handler,
uhost_request_handler,
uhost_process_handler,
&usbh_msc
}
uhost_process_handler
usb_sts_type uhost_process_handler(void *uhost)
usb host class process handler
Definition: usbh_msc_class.c:213
uhost_init_handler
usb_sts_type uhost_init_handler(void *uhost)
usb host class init handler
Definition: usbh_msc_class.c:71
uhost_request_handler
usb_sts_type uhost_request_handler(void *uhost)
usb host hid class request handler
Definition: usbh_msc_class.c:170
usbh_msc
usbh_msc_type usbh_msc
Definition: usbh_msc_class.c:53
uhost_reset_handler
usb_sts_type uhost_reset_handler(void *uhost)
usb host class reset handler
Definition: usbh_msc_class.c:128

Definition at line 55 of file usbh_msc_class.c.

◆ usbh_msc

usbh_msc_type usbh_msc

Definition at line 53 of file usbh_msc_class.c.

Referenced by msc_bot_scsi_init(), uhost_init_handler(), usbh_msc_read(), and usbh_msc_write().


AT32F415 Firmwary Library: USBH_msc_class_definition

Data Structures | Macros | Enumerations | Functions | Variables
USBH_msc_class_definition
AT32F415_middlewares_usbh_class » USBH_msc_class

Data Structures

struct | usb_hid_desc_type
usb hid descriptor type More...
struct | usbh_msc_type
usb msc struct More...

Macros

#define | MSC_SUBCLASS_SCSI_TRANS 0x06
usb msc subclass code More...
#define | MSC_PROTOCOL_BBB 0x50
usb msc protocol code More...
#define | MSC_REQ_GET_MAX_LUN 0xFE
usb msc request code More...
#define | MSC_REQ_BOMSR 0xFF
#define | USB_HID_GET_REPORT 0x01
usb hid request code More...
#define | USB_HID_GET_IDLE 0x02
#define | USB_HID_GET_PROTOCOL 0x03
#define | USB_HID_SET_REPORT 0x09
#define | USB_HID_SET_IDLE 0x0A
#define | USB_HID_SET_PROTOCOL 0x0B
#define | USBH_SUPPORT_MAX_LUN 0x2

Enumerations

enum usbh_msc_ctrl_state_type { USBH_MSC_STATE_IDLE , USBH_MSC_STATE_GET_LUN , USBH_MSC_STATE_ERROR , USBH_MSC_STATE_COMPLETE }
usb msc request state More...

Functions

msc_error_type | usbh_msc_is_ready (void *uhost, uint8_t lun)
usb host msc clear feature More...
usb_sts_type | usbh_msc_write (void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc write More...
usb_sts_type | usbh_msc_read (void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc read More...
usb_sts_type msc_bot_scsi_init (usbh_msc_type *msc_struct)
usb host msc init More...

Variables

usbh_class_handler_type uhost_class_handler
usbh_msc_type usbh_msc

Detailed Description

Macro Definition Documentation

◆ MSC_PROTOCOL_BBB

#define MSC_PROTOCOL_BBB 0x50

usb msc protocol code

Definition at line 58 of file usbh_msc_class.h.

◆ MSC_REQ_BOMSR

#define MSC_REQ_BOMSR 0xFF

Definition at line 64 of file usbh_msc_class.h.

◆ MSC_REQ_GET_MAX_LUN

#define MSC_REQ_GET_MAX_LUN 0xFE

usb msc request code

Definition at line 63 of file usbh_msc_class.h.

◆ MSC_SUBCLASS_SCSI_TRANS

#define MSC_SUBCLASS_SCSI_TRANS 0x06

usb msc subclass code

Definition at line 53 of file usbh_msc_class.h.

◆ USB_HID_GET_IDLE

#define USB_HID_GET_IDLE 0x02

Definition at line 70 of file usbh_msc_class.h.

◆ USB_HID_GET_PROTOCOL

#define USB_HID_GET_PROTOCOL 0x03

Definition at line 71 of file usbh_msc_class.h.

◆ USB_HID_GET_REPORT

#define USB_HID_GET_REPORT 0x01

usb hid request code

Definition at line 69 of file usbh_msc_class.h.

◆ USB_HID_SET_IDLE

#define USB_HID_SET_IDLE 0x0A

Definition at line 73 of file usbh_msc_class.h.

◆ USB_HID_SET_PROTOCOL

#define USB_HID_SET_PROTOCOL 0x0B

Definition at line 74 of file usbh_msc_class.h.

◆ USB_HID_SET_REPORT

#define USB_HID_SET_REPORT 0x09

Definition at line 72 of file usbh_msc_class.h.

◆ USBH_SUPPORT_MAX_LUN

#define USBH_SUPPORT_MAX_LUN 0x2

Definition at line 77 of file usbh_msc_class.h.

Enumeration Type Documentation

◆ usbh_msc_ctrl_state_type

enum usbh_msc_ctrl_state_type

usb msc request state

Enumerator
USBH_MSC_STATE_IDLE
USBH_MSC_STATE_GET_LUN
USBH_MSC_STATE_ERROR
USBH_MSC_STATE_COMPLETE

Definition at line 82 of file usbh_msc_class.h.

Function Documentation

◆ msc_bot_scsi_init()

usb_sts_type msc_bot_scsi_init ( usbh_msc_type * msc_struct )

usb host msc init

Parameters
msc_struct to the structure of usbh_msc_type
Return values
status usb_sts_type status

Definition at line 592 of file usbh_msc_bot_scsi.c.

Referenced by uhost_init_handler().

◆ usbh_msc_is_ready()

msc_error_type usbh_msc_is_ready | ( | void * | uhost,
 |  | uint8_t | lun
 | ) |  |

usb host msc clear feature

Parameters
lun logical unit number
Return values
msc_error_type status

Definition at line 372 of file usbh_msc_class.c.

Referenced by disk_status().

◆ usbh_msc_read()

usb_sts_type usbh_msc_read | ( | void * | uhost,
 |  | uint32_t | address,
 |  | uint32_t | len,
 |  | uint8_t * | buffer,
 |  | uint8_t | lun
 | ) |  |

usb host msc read

Parameters
uhost | to the structure of usbh_core_type
address | logical block address
data_len | transfer data length
buffer | transfer data buffer
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 388 of file usbh_msc_class.c.

Referenced by disk_read().

◆ usbh_msc_write()

usb_sts_type usbh_msc_write | ( | void * | uhost,
 |  | uint32_t | address,
 |  | uint32_t | len,
 |  | uint8_t * | buffer,
 |  | uint8_t | lun
 | ) |  |

usb host msc write

Parameters
uhost | to the structure of usbh_core_type
address | logical block address
data_len | transfer data length
buffer | transfer data buffer
lun | logical unit number
Return values
status usb_sts_type status

Definition at line 436 of file usbh_msc_class.c.

Referenced by disk_write().

Variable Documentation

◆ uhost_class_handler

usbh_class_handler_type uhost_class_handler
extern

Definition at line 52 of file usbh_hid_class.c.

Referenced by main().

◆ usbh_msc

usbh_msc_type usbh_msc
extern

Definition at line 53 of file usbh_msc_class.c.

Referenced by msc_bot_scsi_init(), uhost_init_handler(), usbh_msc_read(), and usbh_msc_write().


AT32F415 Firmwary Library: usbh_msc_type Struct Reference

Data Fields
usbh_msc_type Struct Reference
AT32F415_middlewares_usbh_class » USBH_msc_class » USBH_msc_class_definition

usb msc struct More...

#include <usbh_msc_class.h>

Data Fields

uint8_t | chin
uint8_t | eptin
uint16_t | in_maxpacket
uint8_t | in_poll
uint8_t | chout
uint8_t | eptout
uint16_t | out_maxpacket
uint8_t | out_poll
uint8_t | protocol
uint32_t | max_lun
uint32_t | cur_lun
uint32_t | use_lun
usbh_msc_ctrl_state_type ctrl_state
msc_state_type state
uint8_t | error
msc_bot_trans_type bot_trans
usbh_msc_unit_type | l_unit_n [0x2]
uint16_t | poll_timer
uint8_t | buffer [64]

Detailed Description

usb msc struct

Definition at line 121 of file usbh_msc_class.h.

Field Documentation

◆ bot_trans

msc_bot_trans_type usbh_msc_type::bot_trans

Definition at line 142 of file usbh_msc_class.h.

Referenced by uhost_process_handler(), usbh_msc_read(), and usbh_msc_write().

◆ buffer

uint8_t usbh_msc_type::buffer[64]

Definition at line 145 of file usbh_msc_class.h.

◆ chin

uint8_t usbh_msc_type::chin

Definition at line 123 of file usbh_msc_class.h.

Referenced by uhost_init_handler(), and uhost_reset_handler().

◆ chout

uint8_t usbh_msc_type::chout

Definition at line 128 of file usbh_msc_class.h.

Referenced by uhost_init_handler(), and uhost_reset_handler().

◆ ctrl_state

usbh_msc_ctrl_state_type usbh_msc_type::ctrl_state

Definition at line 139 of file usbh_msc_class.h.

Referenced by uhost_request_handler().

◆ cur_lun

uint32_t usbh_msc_type::cur_lun

Definition at line 135 of file usbh_msc_class.h.

Referenced by uhost_process_handler().

◆ eptin

uint8_t usbh_msc_type::eptin

Definition at line 124 of file usbh_msc_class.h.

Referenced by uhost_init_handler().

◆ eptout

uint8_t usbh_msc_type::eptout

Definition at line 129 of file usbh_msc_class.h.

Referenced by uhost_init_handler().

◆ error

uint8_t usbh_msc_type::error

Definition at line 141 of file usbh_msc_class.h.

◆ in_maxpacket

uint16_t usbh_msc_type::in_maxpacket

Definition at line 125 of file usbh_msc_class.h.

Referenced by uhost_init_handler().

◆ in_poll

uint8_t usbh_msc_type::in_poll

Definition at line 126 of file usbh_msc_class.h.

Referenced by uhost_init_handler().

◆ l_unit_n

usbh_msc_unit_type usbh_msc_type::l_unit_n[0x2]

Definition at line 143 of file usbh_msc_class.h.

Referenced by disk_ioctl(), uhost_process_handler(), uhost_request_handler(), uhost_reset_handler(), usbh_msc_is_ready(), usbh_msc_read(), and usbh_msc_write().

◆ max_lun

uint32_t usbh_msc_type::max_lun

Definition at line 134 of file usbh_msc_class.h.

Referenced by uhost_process_handler(), uhost_request_handler(), and uhost_reset_handler().

◆ out_maxpacket

uint16_t usbh_msc_type::out_maxpacket

Definition at line 130 of file usbh_msc_class.h.

Referenced by uhost_init_handler().

◆ out_poll

uint8_t usbh_msc_type::out_poll

Definition at line 131 of file usbh_msc_class.h.

Referenced by uhost_init_handler().

◆ poll_timer

uint16_t usbh_msc_type::poll_timer

Definition at line 144 of file usbh_msc_class.h.

◆ protocol

uint8_t usbh_msc_type::protocol

Definition at line 132 of file usbh_msc_class.h.

Referenced by uhost_init_handler().

◆ state

msc_state_type usbh_msc_type::state

Definition at line 140 of file usbh_msc_class.h.

Referenced by uhost_process_handler(), usbh_msc_read(), and usbh_msc_write().

◆ use_lun

uint32_t usbh_msc_type::use_lun

Definition at line 136 of file usbh_msc_class.h.

Referenced by usbh_msc_read(), and usbh_msc_write().

The documentation for this struct was generated from the following file:
  • usbh_msc_class.h


AT32F415 Firmwary Library: AT32F415_board

Modules
AT32F415_board

Modules

BOARD
onboard periph driver

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: BOARD

Modules | Macros | Functions | Variables
BOARD
AT32F415_board

onboard periph driver More...

Modules

BOARD_pins_definition
BOARD_exported_functions

Macros

#define | STEP_DELAY_MS 50
#define | PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)

Functions

int | fputc (int ch, FILE *f)
retargets the c library printf function to the usart. More...
void | uart_print_init (uint32_t baudrate)
initialize uart More...
void | at32_board_init ()
board initialize interface init led and button More...
void | at32_button_init (void)
configure button gpio More...
uint8_t | at32_button_state (void)
returns the selected button state
More...
button_type at32_button_press ()
returns which button have press down More...
void | at32_led_init (led_type led)
configure led gpio
More...
void | at32_led_on (led_type led)
turns selected led on. More...
void | at32_led_off (led_type led)
turns selected led off. More...
void | at32_led_toggle (led_type led)
turns selected led tooggle. More...
void | delay_init ()
initialize delay function
More...
void | delay_us (uint32_t nus)
inserts a delay time. More...
void | delay_ms (uint16_t nms)
inserts a delay time. More...
void | delay_sec (uint16_t sec)
inserts a delay time. More...

Variables

gpio_type * | led_gpio_port [3] = {LED2_GPIO, LED3_GPIO, LED4_GPIO}
uint16_t | led_gpio_pin [3] = {LED2_PIN, LED3_PIN, LED4_PIN}
crm_periph_clock_type | led_gpio_crm_clk [3] = {LED2_GPIO_CRM_CLK, LED3_GPIO_CRM_CLK, LED4_GPIO_CRM_CLK}
static __IO uint32_t | fac_us
static __IO uint32_t | fac_ms

Detailed Description

onboard periph driver

Macro Definition Documentation

◆ PUTCHAR_PROTOTYPE

#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)

Definition at line 87 of file at32f415_board.c.

◆ STEP_DELAY_MS

#define STEP_DELAY_MS 50

Definition at line 40 of file at32f415_board.c.

Function Documentation

◆ at32_board_init()

void at32_board_init ( void )

board initialize interface init led and button

Parameters
none
Return values
none

Definition at line 136 of file at32f415_board.c.

Referenced by main().

◆ at32_button_init()

void at32_button_init ( void )

configure button gpio

Parameters
button specifies the button to be configured.
Return values
none

< gpio pins number 0

Definition at line 158 of file at32f415_board.c.

Referenced by at32_board_init().

◆ at32_button_press()

button_type at32_button_press ( void )

returns which button have press down

Parameters
none
Return values
the button have press down

Definition at line 192 of file at32f415_board.c.

Referenced by main().

◆ at32_button_state()

uint8_t at32_button_state ( void )

returns the selected button state

Parameters
none
Return values
the button gpio pin value

< gpio pins number 0

Definition at line 182 of file at32f415_board.c.

Referenced by at32_button_press().

◆ at32_led_init()

void at32_led_init ( led_type led )

configure led gpio

Parameters
led specifies the led to be configured.
Return values
none

Definition at line 216 of file at32f415_board.c.

Referenced by at32_board_init(), main(), and run_in_boot_memory_test().

◆ at32_led_off()

void at32_led_off ( led_type led )

turns selected led off.

Parameters
led specifies the led to be set off. this parameter can be one of following parameters:
  • LED2
  • LED3
  • LED4
Return values
none

Definition at line 261 of file at32f415_board.c.

Referenced by at32_board_init(), main(), sd_test_error(), and usb_hid_buf_process().

◆ at32_led_on()

void at32_led_on ( led_type led )

turns selected led on.

Parameters
led specifies the led to be set on. this parameter can be one of following parameters:
  • LED2
  • LED3
  • LED4
Return values
none

Definition at line 244 of file at32f415_board.c.

Referenced by DMA2_Channel1_IRQHandler(), ERTC_WKUP_IRQHandler(), ERTCAlarm_IRQHandler(), main(), sd_test_error(), USART2_IRQHandler(), and usb_hid_buf_process().

◆ at32_led_toggle()

void at32_led_toggle ( led_type led )

turns selected led tooggle.

Parameters
led specifies the led to be set off. this parameter can be one of following parameters:
  • LED2
  • LED3
  • LED4
Return values
none

Definition at line 278 of file at32f415_board.c.

Referenced by ADC1_IRQHandler(), CAN1_RX0_IRQHandler(), error_handler(), ERTCAlarm_IRQHandler(), EXINT0_IRQHandler(), EXINT4_IRQHandler(), led2_task_function(), led3_task_function(), main(), PVM_IRQHandler(), result_error(), run_in_boot_memory_test(), systick_handler(), TAMP_STAMP_IRQHandler(), TMR1_OVF_TMR10_IRQHandler(), TMR2_GLOBAL_IRQHandler(), TMR3_GLOBAL_IRQHandler(), and USART1_IRQHandler().

◆ delay_init()

void delay_init ( void )

initialize delay function

Parameters
none
Return values
none

Definition at line 291 of file at32f415_board.c.

Referenced by at32_board_init(), run_in_boot_memory_test(), sclk_144m_hick_config(), sclk_64m_hick_config(), and sclk_96m_hext_config().

◆ delay_ms()

void delay_ms ( uint16_t nms )

inserts a delay time.

Parameters
nms specifies the delay time length, in milliseconds.
Return values
none

Definition at line 324 of file at32f415_board.c.

Referenced by at32_button_press(), button_isr(), delay_sec(), error_handler(), EXINT0_IRQHandler(), flash_fat16_loop_status(), FLASH_IRQHandler(), main(), randnum_test(), run_in_boot_memory_test(), sd_test_error(), usb_delay_ms(), and usb_re_connect().

◆ delay_sec()

void delay_sec ( uint16_t sec )

inserts a delay time.

Parameters
sec specifies the delay time, in seconds.
Return values
none

Definition at line 356 of file at32f415_board.c.

Referenced by main(), and result_error().

◆ delay_us()

void delay_us ( uint32_t nus )

inserts a delay time.

Parameters
nus specifies the delay time length, in microsecond.
Return values
none

Definition at line 304 of file at32f415_board.c.

Referenced by main(), and usb_delay_us().

◆ fputc()

int fputc | ( | int | ch,
 |  | FILE * | f
 | ) |  |

retargets the c library printf function to the usart.

Parameters
none
Return values
none

< usart transmit data buffer empty flag

Definition at line 95 of file at32f415_board.c.

◆ uart_print_init()

void uart_print_init ( uint32_t baudrate )

initialize uart

Parameters
baudrate uart baudrate
Return values
none

< gpio pins number 9

Definition at line 107 of file at32f415_board.c.

Referenced by main().

Variable Documentation

◆ fac_ms

__IO uint32_t fac_ms
static

Definition at line 49 of file at32f415_board.c.

Referenced by delay_init(), and delay_ms().

◆ fac_us

__IO uint32_t fac_us
static

Definition at line 48 of file at32f415_board.c.

Referenced by delay_init(), and delay_us().

◆ led_gpio_crm_clk

crm_periph_clock_type led_gpio_crm_clk[3] = {LED2_GPIO_CRM_CLK, LED3_GPIO_CRM_CLK, LED4_GPIO_CRM_CLK}

Definition at line 45 of file at32f415_board.c.

Referenced by at32_led_init().

◆ led_gpio_pin

uint16_t led_gpio_pin[3] = {LED2_PIN, LED3_PIN, LED4_PIN}

Definition at line 44 of file at32f415_board.c.

Referenced by at32_led_init(), at32_led_off(), at32_led_on(), and at32_led_toggle().

◆ led_gpio_port

gpio_type* led_gpio_port[3] = {LED2_GPIO, LED3_GPIO, LED4_GPIO}

Definition at line 43 of file at32f415_board.c.

Referenced by at32_led_init(), at32_led_off(), at32_led_on(), and at32_led_toggle().


AT32F415 Firmwary Library: BOARD_pins_definition

Macros | Enumerations
BOARD_pins_definition
AT32F415_board » BOARD

Macros

#define | LED_NUM 3
#define | PRINT_UART USART1
#define | PRINT_UART_CRM_CLK CRM_USART1_PERIPH_CLOCK
#define | PRINT_UART_TX_PIN GPIO_PINS_9
#define | PRINT_UART_TX_GPIO GPIOA
#define | PRINT_UART_TX_GPIO_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
#define | USER_BUTTON_PIN GPIO_PINS_0
#define | USER_BUTTON_PORT GPIOA
#define | USER_BUTTON_CRM_CLK CRM_GPIOA_PERIPH_CLOCK

Enumerations

enum | led_type { LED2 = 0 , LED3 = 1 , LED4 = 2 }
enum | button_type { USER_BUTTON = 0 , NO_BUTTON = 1 }

Detailed Description

Macro Definition Documentation

◆ LED_NUM

#define LED_NUM 3

Definition at line 68 of file at32f415_board.h.

◆ PRINT_UART

#define PRINT_UART USART1

Definition at line 85 of file at32f415_board.h.

◆ PRINT_UART_CRM_CLK

#define PRINT_UART_CRM_CLK CRM_USART1_PERIPH_CLOCK

Definition at line 86 of file at32f415_board.h.

◆ PRINT_UART_TX_GPIO

#define PRINT_UART_TX_GPIO GPIOA

Definition at line 88 of file at32f415_board.h.

◆ PRINT_UART_TX_GPIO_CRM_CLK

#define PRINT_UART_TX_GPIO_CRM_CLK CRM_GPIOA_PERIPH_CLOCK

Definition at line 89 of file at32f415_board.h.

◆ PRINT_UART_TX_PIN

#define PRINT_UART_TX_PIN GPIO_PINS_9

Definition at line 87 of file at32f415_board.h.

◆ USER_BUTTON_CRM_CLK

#define USER_BUTTON_CRM_CLK CRM_GPIOA_PERIPH_CLOCK

Definition at line 100 of file at32f415_board.h.

◆ USER_BUTTON_PIN

#define USER_BUTTON_PIN GPIO_PINS_0

Definition at line 98 of file at32f415_board.h.

◆ USER_BUTTON_PORT

#define USER_BUTTON_PORT GPIOA

Definition at line 99 of file at32f415_board.h.

Enumeration Type Documentation

◆ button_type

enum button_type
Enumerator
USER_BUTTON
NO_BUTTON

Definition at line 92 of file at32f415_board.h.

◆ led_type

enum led_type

this header include define support list:

  1. at-start-f415 v1.x board if define AT_START_F415_V1, the header file support at-start-f415 v1.x board
Enumerator
LED2
LED3
LED4

Definition at line 61 of file at32f415_board.h.


AT32F415 Firmwary Library: BOARD_exported_functions

Functions
BOARD_exported_functions
AT32F415_board » BOARD

Functions

void | at32_board_init (void)
board initialize interface init led and button More...
void | at32_led_init (led_type led)
configure led gpio
More...
void | at32_led_on (led_type led)
turns selected led on. More...
void | at32_led_off (led_type led)
turns selected led off. More...
void | at32_led_toggle (led_type led)
turns selected led tooggle. More...
void | at32_button_init (void)
configure button gpio More...
button_type | at32_button_press (void)
returns which button have press down More...
uint8_t | at32_button_state (void)
returns the selected button state
More...
void | delay_init (void)
initialize delay function
More...
void | delay_us (uint32_t nus)
inserts a delay time. More...
void | delay_ms (uint16_t nms)
inserts a delay time. More...
void | delay_sec (uint16_t sec)
inserts a delay time. More...
void | uart_print_init (uint32_t baudrate)
initialize uart More...

Detailed Description

Function Documentation

◆ at32_board_init()

void at32_board_init ( void )

board initialize interface init led and button

Parameters
none
Return values
none

Definition at line 136 of file at32f415_board.c.

Referenced by main().

◆ at32_button_init()

void at32_button_init ( void )

configure button gpio

Parameters
button specifies the button to be configured.
Return values
none

< gpio pins number 0

Definition at line 158 of file at32f415_board.c.

Referenced by at32_board_init().

◆ at32_button_press()

button_type at32_button_press ( void )

returns which button have press down

Parameters
none
Return values
the button have press down

Definition at line 192 of file at32f415_board.c.

Referenced by main().

◆ at32_button_state()

uint8_t at32_button_state ( void )

returns the selected button state

Parameters
none
Return values
the button gpio pin value

< gpio pins number 0

Definition at line 182 of file at32f415_board.c.

Referenced by at32_button_press().

◆ at32_led_init()

void at32_led_init ( led_type led )

configure led gpio

Parameters
led specifies the led to be configured.
Return values
none

Definition at line 216 of file at32f415_board.c.

Referenced by at32_board_init(), main(), and run_in_boot_memory_test().

◆ at32_led_off()

void at32_led_off ( led_type led )

turns selected led off.

Parameters
led specifies the led to be set off. this parameter can be one of following parameters:
  • LED2
  • LED3
  • LED4
Return values
none

Definition at line 261 of file at32f415_board.c.

Referenced by at32_board_init(), main(), sd_test_error(), and usb_hid_buf_process().

◆ at32_led_on()

void at32_led_on ( led_type led )

turns selected led on.

Parameters
led specifies the led to be set on. this parameter can be one of following parameters:
  • LED2
  • LED3
  • LED4
Return values
none

Definition at line 244 of file at32f415_board.c.

Referenced by DMA2_Channel1_IRQHandler(), ERTC_WKUP_IRQHandler(), ERTCAlarm_IRQHandler(), main(), sd_test_error(), USART2_IRQHandler(), and usb_hid_buf_process().

◆ at32_led_toggle()

void at32_led_toggle ( led_type led )

turns selected led tooggle.

Parameters
led specifies the led to be set off. this parameter can be one of following parameters:
  • LED2
  • LED3
  • LED4
Return values
none

Definition at line 278 of file at32f415_board.c.

Referenced by ADC1_IRQHandler(), CAN1_RX0_IRQHandler(), error_handler(), ERTCAlarm_IRQHandler(), EXINT0_IRQHandler(), EXINT4_IRQHandler(), led2_task_function(), led3_task_function(), main(), PVM_IRQHandler(), result_error(), run_in_boot_memory_test(), systick_handler(), TAMP_STAMP_IRQHandler(), TMR1_OVF_TMR10_IRQHandler(), TMR2_GLOBAL_IRQHandler(), TMR3_GLOBAL_IRQHandler(), and USART1_IRQHandler().

◆ delay_init()

void delay_init ( void )

initialize delay function

Parameters
none
Return values
none

Definition at line 291 of file at32f415_board.c.

Referenced by at32_board_init(), run_in_boot_memory_test(), sclk_144m_hick_config(), sclk_64m_hick_config(), and sclk_96m_hext_config().

◆ delay_ms()

void delay_ms ( uint16_t nms )

inserts a delay time.

Parameters
nms specifies the delay time length, in milliseconds.
Return values
none

Definition at line 324 of file at32f415_board.c.

Referenced by at32_button_press(), button_isr(), delay_sec(), error_handler(), EXINT0_IRQHandler(), flash_fat16_loop_status(), FLASH_IRQHandler(), main(), randnum_test(), run_in_boot_memory_test(), sd_test_error(), usb_delay_ms(), and usb_re_connect().

◆ delay_sec()

void delay_sec ( uint16_t sec )

inserts a delay time.

Parameters
sec specifies the delay time, in seconds.
Return values
none

Definition at line 356 of file at32f415_board.c.

Referenced by main(), and result_error().

◆ delay_us()

void delay_us ( uint32_t nus )

inserts a delay time.

Parameters
nus specifies the delay time length, in microsecond.
Return values
none

Definition at line 304 of file at32f415_board.c.

Referenced by main(), and usb_delay_us().

◆ uart_print_init()

void uart_print_init ( uint32_t baudrate )

initialize uart

Parameters
baudrate uart baudrate
Return values
none

< gpio pins number 9

Definition at line 107 of file at32f415_board.c.

Referenced by main().


AT32F415 Firmwary Library: AT32F415_periph_examples

Modules
AT32F415_periph_examples

Modules

ADC_current_vref_value_check
ADC_exint_trigger_partitioned
ADC_internal_temperature_sensor
ADC_software_trigger_repeat
ADC_tmr_trigger_automatic_preempted
ADC_voltage_monitoring
CAN_communication_mode
CAN_filter
CAN_loopback_mode
CMP_deep_sleep_mode
CMP_output
CORTEX_m4_bit_band
CORTEX_m4_systick_interrupt
CRC_calculation
CRM_clock_failure_detection
CRM_sysclk_switch
DEBUG_tmr
DMA_data_to_gpio_flexible
DMA_flash_to_sram
ERTC_bpr_domain
ERTC_calendar
ERTC_lick_calibration
ERTC_tamper
ERTC_time_stamp
ERTC_wakeup_timer
EXINT_config
EXINT_software_trigger
FLASH_write_read
GPIO_led_toggle
GPIO_swjtag_remap
I2C_communication_dma
I2C_communication_int
I2C_communication_poll
I2C_eeprom
I2S_halfduplex_dma
I2S_halfduplex_interrupt
I2S_spii2s_switch_halfduplex_polling
PWC_deepsleep_ertc_alarm
PWC_deepsleep_ertc_tamper
PWC_power_voltage_monitor
PWC_sleep_tmr2
PWC_sleep_usart1
PWC_standby_ertc_alarm
PWC_standby_wakeup_pin
SDIO_sd_mmc_card
SDIO_sdio_fatfs
SPI_crc_transfer_polling
SPI_fullduplex_polling
SPI_halfduplex_interrupt
SPI_halfduplex_transceiver_switch
SPI_only_receive_mode_polling
SPI_use_jtagpin_hardwarecs_dma
SPI_w25q_flash
TMR_6_steps
TMR_7_pwm_output
TMR_cascade_synchro
TMR_complementary_signals
TMR_dma
TMR_dma_burst
TMR_encoder_tmr2
TMR_external_clock
TMR_hall_xor_tmr2
TMR_hang_mode
TMR_input_capture
TMR_oc_high
TMR_oc_low
TMR_oc_toggle_tmr3
TMR_oc_toggle_tmr9
TMR_one_cycle
TMR_parallel_synchro
TMR_pwm_input
TMR_pwm_input_dma
TMR_pwm_output_simulate
TMR_pwm_output_tmr10
TMR_pwm_output_tmr3
TMR_timer_base
TMR_tmr1_synchro
TMR_tmr2_32bit
USART_half_duplex
USART_hw_flow_control
USART_idle_detection
USART_interrupt
USART_irda
USART_polling
USART_printf
USART_receiver_mute
USART_smartcard
USART_synchronous
USART_transfer_by_dma_interrupt
USART_transfer_by_dma_polling
USB_device_audio
USB_device_audio_hid
USB_device_composite_vcp_keyboard
USB_device_custom_hid
USB_device_keyboard
USB_device_mouse
USB_device_msc
USB_device_printer
USB_device_vcp_loopback
USB_device_virtual_msc_iap
USB_host_hid
USB_host_msc
WDT_reset
WWDT_reset
_USB_device_hid_app_led3
_USB_device_hid_app_led4
_USB_device_hid_iap

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: ADC_current_vref_value_check

Functions | Variables
ADC_current_vref_value_check
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static void | dma_config (void)
dma configuration. More...
static void | adc_config (void)
adc configuration. More...
int | main (void)
main function. More...

Variables

__IO uint16_t adc1_ordinary_value = 0

Detailed Description

Function Documentation

◆ adc_config()

static void adc_config ( void )
static

adc configuration.

Parameters
none
Return values
none

Definition at line 74 of file project/at_start_f415/examples/adc/current_vref_value_check/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 80 of file project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 115 of file project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c.

◆ dma_config()

static void dma_config ( void )
static

dma configuration.

Parameters
none
Return values
none

Definition at line 48 of file project/at_start_f415/examples/adc/current_vref_value_check/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 54 of file project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< dma1 channel1 full data transfer flag

< dma1 channel1 full data transfer flag

Definition at line 105 of file project/at_start_f415/examples/adc/current_vref_value_check/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 67 of file project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 45 of file project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 124 of file project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 106 of file project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 133 of file project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 93 of file project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c.

Variable Documentation

◆ adc1_ordinary_value

__IO uint16_t adc1_ordinary_value = 0

Definition at line 38 of file project/at_start_f415/examples/adc/current_vref_value_check/src/main.c.

Referenced by dma_config(), and main().


AT32F415 Firmwary Library: ADC_exint_trigger_partitioned

Functions | Variables
ADC_exint_trigger_partitioned
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | DMA1_Channel1_IRQHandler (void)
this function handles dma1_channel1 handler. More...
void | ADC1_IRQHandler (void)
this function handles adc1_2 handler. More...
static void | gpio_config (void)
gpio configuration. More...
static void | exint_config (void)
exint configuration. More...
static void | dma_config (void)
dma configuration. More...
static void | adc_config (void)
adc configuration. More...
int | main (void)
main function. More...

Variables

__IO uint16_t | adc1_ordinary_valuetab [3][3] = {0}
__IO uint16_t | adc1_preempt_valuetab [3][3] = {0}
__IO uint16_t | dma_trans_complete_flag = 0
__IO uint16_t | preempt_trigger_count = 0

Detailed Description

Function Documentation

◆ ADC1_IRQHandler()

void ADC1_IRQHandler ( void )

this function handles adc1_2 handler.

Parameters
none
Return values
none

< preempt channels conversion end flag

< preempt channels conversion end flag

Definition at line 159 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c.

◆ adc_config()

static void adc_config ( void )
static

adc configuration.

Parameters
none
Return values
none

< preempt channels conversion end interrupt

Definition at line 143 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 83 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 118 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c.

◆ DMA1_Channel1_IRQHandler()

void DMA1_Channel1_IRQHandler ( void )

this function handles dma1_channel1 handler.

Parameters
none
Return values
none

< dma1 channel1 full data transfer flag

< dma1 channel1 full data transfer flag

Definition at line 145 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c.

◆ dma_config()

static void dma_config ( void )
static

dma configuration.

Parameters
none
Return values
none

< dma full data transfer interrupt

Definition at line 115 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c.

Referenced by main().

◆ exint_config()

static void exint_config ( void )
static

exint configuration.

Parameters
none
Return values
none

< gpio pins number 11

< gpio pins number 15

< external interrupt line 11

< external interrupt line 15

Definition at line 75 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c.

Referenced by main().

◆ gpio_config()

static void gpio_config ( void )
static

gpio configuration.

Parameters
none
Return values
none

< gpio pins number 4

< gpio pins number 5

< gpio pins number 6

< gpio pins number 7

< gpio pins number 0

< gpio pins number 1

Definition at line 54 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 57 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 185 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 70 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 48 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 127 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 109 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 136 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 96 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c.

Variable Documentation

◆ adc1_ordinary_valuetab

__IO uint16_t adc1_ordinary_valuetab[3][3] = {0}

Definition at line 39 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c.

Referenced by dma_config(), and main().

◆ adc1_preempt_valuetab

__IO uint16_t adc1_preempt_valuetab[3][3] = {0}

Definition at line 40 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c.

Referenced by main().

◆ dma_trans_complete_flag

__IO uint16_t dma_trans_complete_flag = 0

Definition at line 41 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c.

Referenced by main().

◆ preempt_trigger_count

__IO uint16_t preempt_trigger_count = 0

Definition at line 42 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c.

Referenced by ADC1_IRQHandler(), and main().


AT32F415 Firmwary Library: ADC_internal_temperature_sensor

Macros | Functions | Variables
ADC_internal_temperature_sensor
AT32F415_periph_examples

Macros

#define | ADC_VREF (3.3)
#define | ADC_TEMP_BASE (1.26)
#define | ADC_TEMP_SLOPE (-0.00423)

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static void | dma_config (void)
dma configuration. More...
static void | adc_config (void)
adc configuration. More...
int | main (void)
main function. More...

Variables

__IO uint16_t adc1_ordinary_value = 0

Detailed Description

Macro Definition Documentation

◆ ADC_TEMP_BASE

#define ADC_TEMP_BASE (1.26)

Definition at line 40 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c.

◆ ADC_TEMP_SLOPE

#define ADC_TEMP_SLOPE (-0.00423)

Definition at line 41 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c.

◆ ADC_VREF

#define ADC_VREF (3.3)

Definition at line 39 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c.

Function Documentation

◆ adc_config()

static void adc_config ( void )
static

adc configuration.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 81 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 116 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c.

◆ dma_config()

static void dma_config ( void )
static

dma configuration.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< dma1 channel1 full data transfer flag

< dma1 channel1 full data transfer flag

Definition at line 110 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 68 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 46 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 125 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 107 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 134 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 94 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c.

Variable Documentation

◆ adc1_ordinary_value

__IO uint16_t adc1_ordinary_value = 0

Definition at line 43 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c.

Referenced by dma_config(), and main().


AT32F415 Firmwary Library: ADC_software_trigger_repeat

Functions | Variables
ADC_software_trigger_repeat
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | DMA1_Channel1_IRQHandler (void)
this function handles dma1_channel1 handler. More...
static void | gpio_config (void)
gpio configuration. More...
static void | dma_config (void)
dma configuration. More...
static void | adc_config (void)
adc configuration. More...
int | main (void)
main function. More...

Variables

__IO uint16_t | adc1_ordinary_valuetab [10][3] = {0}
__IO uint16_t | dma_trans_complete_flag = 0

Detailed Description

Function Documentation

◆ adc_config()

static void adc_config ( void )
static

adc configuration.

Parameters
none
Return values
none

Definition at line 94 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 81 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 116 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c.

◆ DMA1_Channel1_IRQHandler()

void DMA1_Channel1_IRQHandler ( void )

this function handles dma1_channel1 handler.

Parameters
none
Return values
none

< dma1 channel1 full data transfer flag

< dma1 channel1 full data transfer flag

Definition at line 143 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c.

◆ dma_config()

static void dma_config ( void )
static

dma configuration.

Parameters
none
Return values
none

< dma full data transfer interrupt

Definition at line 66 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c.

Referenced by main().

◆ gpio_config()

static void gpio_config ( void )
static

gpio configuration.

Parameters
none
Return values
none

< gpio pins number 4

< gpio pins number 5

< gpio pins number 6

Definition at line 50 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 126 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 68 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 46 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 125 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 107 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 134 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 94 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c.

Variable Documentation

◆ adc1_ordinary_valuetab

__IO uint16_t adc1_ordinary_valuetab[10][3] = {0}

Definition at line 38 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c.

Referenced by dma_config(), and main().

◆ dma_trans_complete_flag

__IO uint16_t dma_trans_complete_flag = 0

Definition at line 39 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: ADC_tmr_trigger_automatic_preempted

Functions | Variables
ADC_tmr_trigger_automatic_preempted
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | DMA1_Channel1_IRQHandler (void)
this function handles dma1_channel1 handler. More...
void | ADC1_IRQHandler (void)
this function handles adc1_2 handler. More...
static void | gpio_config (void)
gpio configuration. More...
static void | dma_config (void)
dma configuration. More...
static void | tmr1_config (void)
tmr1 configuration. More...
static void | adc_config (void)
adc configuration. More...
int | main (void)
main function. More...

Variables

__IO uint16_t | adc1_ordinary_valuetab [5][3] = {0}
__IO uint16_t | adc1_preempt_valuetab [5][3] = {0}
__IO uint16_t | dma_trans_complete_flag = 0
__IO uint16_t | preempt_conversion_count = 0

Detailed Description

Function Documentation

◆ ADC1_IRQHandler()

void ADC1_IRQHandler ( void )

this function handles adc1_2 handler.

Parameters
none
Return values
none

< preempt channels conversion end flag

< preempt channels conversion end flag

Definition at line 160 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c.

◆ adc_config()

static void adc_config ( void )
static

adc configuration.

Parameters
none
Return values
none

< preempt channels conversion end interrupt

Definition at line 142 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 84 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 119 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c.

◆ DMA1_Channel1_IRQHandler()

void DMA1_Channel1_IRQHandler ( void )

this function handles dma1_channel1 handler.

Parameters
none
Return values
none

< dma1 channel1 full data transfer flag

< dma1 channel1 full data transfer flag

Definition at line 146 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c.

◆ dma_config()

static void dma_config ( void )
static

dma configuration.

Parameters
none
Return values
none

< dma full data transfer interrupt

Definition at line 75 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c.

Referenced by main().

◆ gpio_config()

static void gpio_config ( void )
static

gpio configuration.

Parameters
none
Return values
none

< gpio pins number 4

< gpio pins number 5

< gpio pins number 6

< gpio pins number 7

< gpio pins number 0

< gpio pins number 1

Definition at line 54 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 58 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 186 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 71 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 49 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 128 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 110 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 137 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c.

◆ tmr1_config()

static void tmr1_config ( void )
static

tmr1 configuration.

Parameters
none
Return values
none

< gpio pins number 8

Definition at line 103 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c.

Referenced by main().

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 97 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c.

Variable Documentation

◆ adc1_ordinary_valuetab

__IO uint16_t adc1_ordinary_valuetab[5][3] = {0}

Definition at line 39 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c.

Referenced by dma_config(), and main().

◆ adc1_preempt_valuetab

__IO uint16_t adc1_preempt_valuetab[5][3] = {0}

Definition at line 40 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c.

Referenced by ADC1_IRQHandler(), and main().

◆ dma_trans_complete_flag

__IO uint16_t dma_trans_complete_flag = 0

Definition at line 41 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c.

Referenced by DMA1_Channel1_IRQHandler(), and main().

◆ preempt_conversion_count

__IO uint16_t preempt_conversion_count = 0

Definition at line 42 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c.

Referenced by ADC1_IRQHandler(), and main().


AT32F415 Firmwary Library: ADC_voltage_monitoring

Functions | Variables
ADC_voltage_monitoring
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | ADC1_IRQHandler (void)
this function handles adc1_2 handler. More...
static void | gpio_config (void)
gpio configuration. More...
static void | dma_config (void)
dma configuration. More...
static void | adc_config (void)
adc configuration. More...
int | main (void)
main function. More...

Variables

__IO uint16_t | adc1_ordinary_valuetab [3] = {0}
__IO uint16_t | vmor_flag_index = 0

Detailed Description

Function Documentation

◆ ADC1_IRQHandler()

void ADC1_IRQHandler ( void )

this function handles adc1_2 handler.

Parameters
none
Return values
none

< voltage monitoring out of range flag

< voltage monitoring out of range flag

Definition at line 145 of file project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c.

◆ adc_config()

static void adc_config ( void )
static

adc configuration.

Parameters
none
Return values
none

< voltage monitoring out of range interrupt

Definition at line 92 of file project/at_start_f415/examples/adc/voltage_monitoring/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 83 of file project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 118 of file project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c.

◆ dma_config()

static void dma_config ( void )
static

dma configuration.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/adc/voltage_monitoring/src/main.c.

Referenced by main().

◆ gpio_config()

static void gpio_config ( void )
static

gpio configuration.

Parameters
none
Return values
none

< gpio pins number 4

< gpio pins number 5

< gpio pins number 6

Definition at line 50 of file project/at_start_f415/examples/adc/voltage_monitoring/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 57 of file project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 129 of file project/at_start_f415/examples/adc/voltage_monitoring/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 70 of file project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 48 of file project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 127 of file project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 109 of file project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 136 of file project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 96 of file project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c.

Variable Documentation

◆ adc1_ordinary_valuetab

__IO uint16_t adc1_ordinary_valuetab[3] = {0}

Definition at line 38 of file project/at_start_f415/examples/adc/voltage_monitoring/src/main.c.

Referenced by dma_config(), and main().

◆ vmor_flag_index

__IO uint16_t vmor_flag_index = 0

Definition at line 39 of file project/at_start_f415/examples/adc/voltage_monitoring/src/main.c.

Referenced by ADC1_IRQHandler(), and main().


AT32F415 Firmwary Library: CAN_communication_mode

Functions
CAN_communication_mode
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static void | can_gpio_config (void)
can gpio config More...
static void | can_configuration (void)
can configiguration. More...
static void | can_transmit_data (void)
can transmit data More...
void | CAN1_RX0_IRQHandler (void)
can1 interrupt function rx0 More...
void | CAN1_SE_IRQHandler (void)
can1 interrupt function se More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c.

◆ CAN1_RX0_IRQHandler()

void CAN1_RX0_IRQHandler ( void )

can1 interrupt function rx0

Parameters
none
Return values
none

< receive fifo 0 message num flag

Definition at line 148 of file project/at_start_f415/examples/can/communication_mode/src/main.c.

◆ CAN1_SE_IRQHandler()

void CAN1_SE_IRQHandler ( void )

can1 interrupt function se

Parameters
none
Return values
none

< error type record flag

< error type record flag

Definition at line 166 of file project/at_start_f415/examples/can/communication_mode/src/main.c.

◆ can_configuration()

static void can_configuration ( void )
static

can configiguration.

Parameters
none
Return values
none

< receive fifo 0 message interrupt

< error type record interrupt

< error occur interrupt

Definition at line 72 of file project/at_start_f415/examples/can/communication_mode/src/main.c.

Referenced by CAN1_SE_IRQHandler(), and main().

◆ can_gpio_config()

static void can_gpio_config ( void )
static

can gpio config

Parameters
none
Return values
none

< can_rx(pb8), can_tx(pb9)

< gpio pins number 9

< gpio pins number 8

Definition at line 43 of file project/at_start_f415/examples/can/communication_mode/src/main.c.

Referenced by main().

◆ can_transmit_data()

static void can_transmit_data ( void )
static

can transmit data

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/can/communication_mode/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 186 of file project/at_start_f415/examples/can/communication_mode/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c.


AT32F415 Firmwary Library: CAN_filter

Macros | Functions | Variables
CAN_filter
AT32F415_periph_examples

Macros

#define | FILTER_EXT_ID1 ((uint32_t)0x18F5F100)
#define | FILTER_EXT_ID2 ((uint32_t)0x18F5F200)
#define | FILTER_EXT_ID3 ((uint32_t)0x18F5F300)
#define | FILTER_STD_ID1 ((uint16_t)0x04F6)
#define | FILTER_STD_ID2 ((uint16_t)0x04F7)
#define | FILTER_STD_ID3 ((uint16_t)0x04F8)

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static void | can_gpio_config (void)
can gpio config More...
static void | can_configuration (void)
can configiguration. More...
static void | can_transmit_data (void)
can transmit data More...
void | CAN1_RX0_IRQHandler (void)
can1 interrupt function rx0 More...
void | CAN1_SE_IRQHandler (void)
can1 interrupt function se More...
int | main (void)
main function. More...

Variables

uint8_t test_result = 0

Detailed Description

Macro Definition Documentation

◆ FILTER_EXT_ID1

#define FILTER_EXT_ID1 ((uint32_t)0x18F5F100)

Definition at line 39 of file project/at_start_f415/examples/can/filter/src/main.c.

◆ FILTER_EXT_ID2

#define FILTER_EXT_ID2 ((uint32_t)0x18F5F200)

Definition at line 40 of file project/at_start_f415/examples/can/filter/src/main.c.

◆ FILTER_EXT_ID3

#define FILTER_EXT_ID3 ((uint32_t)0x18F5F300)

Definition at line 41 of file project/at_start_f415/examples/can/filter/src/main.c.

◆ FILTER_STD_ID1

#define FILTER_STD_ID1 ((uint16_t)0x04F6)

Definition at line 44 of file project/at_start_f415/examples/can/filter/src/main.c.

◆ FILTER_STD_ID2

#define FILTER_STD_ID2 ((uint16_t)0x04F7)

Definition at line 45 of file project/at_start_f415/examples/can/filter/src/main.c.

◆ FILTER_STD_ID3

#define FILTER_STD_ID3 ((uint16_t)0x04F8)

Definition at line 46 of file project/at_start_f415/examples/can/filter/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/can/filter/src/at32f415_int.c.

◆ CAN1_RX0_IRQHandler()

void CAN1_RX0_IRQHandler ( void )

can1 interrupt function rx0

Parameters
none
Return values
none

< receive fifo 0 message num flag

Definition at line 260 of file project/at_start_f415/examples/can/filter/src/main.c.

◆ CAN1_SE_IRQHandler()

void CAN1_SE_IRQHandler ( void )

can1 interrupt function se

Parameters
none
Return values
none

< error type record flag

< error type record flag

Definition at line 288 of file project/at_start_f415/examples/can/filter/src/main.c.

◆ can_configuration()

static void can_configuration ( void )
static

can configiguration.

Parameters
none
Return values
none

< receive fifo 0 message interrupt

< error type record interrupt

< error occur interrupt

Definition at line 85 of file project/at_start_f415/examples/can/filter/src/main.c.

Referenced by CAN1_SE_IRQHandler(), and main().

◆ can_gpio_config()

static void can_gpio_config ( void )
static

can gpio config

Parameters
none
Return values
none

< can_rx(pb8), can_tx(pb9)

< gpio pins number 9

< gpio pins number 8

Definition at line 54 of file project/at_start_f415/examples/can/filter/src/main.c.

Referenced by main().

◆ can_transmit_data()

static void can_transmit_data ( void )
static

can transmit data

Parameters
none
Return values
none

Definition at line 147 of file project/at_start_f415/examples/can/filter/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/can/filter/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/can/filter/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 308 of file project/at_start_f415/examples/can/filter/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/can/filter/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/can/filter/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/can/filter/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/can/filter/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/can/filter/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/can/filter/src/at32f415_int.c.

Variable Documentation

◆ test_result

uint8_t test_result = 0

Definition at line 48 of file project/at_start_f415/examples/can/filter/src/main.c.

Referenced by CAN1_RX0_IRQHandler(), and main().


AT32F415 Firmwary Library: CAN_loopback_mode

Functions
CAN_loopback_mode
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static void | can_gpio_config (void)
can gpio config More...
static void | can_configuration (void)
can configiguration. More...
static void | can_transmit_data (void)
can transmit data More...
void | CAN1_RX0_IRQHandler (void)
can1 interrupt function rx0 More...
void | CAN1_SE_IRQHandler (void)
can1 interrupt function se More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c.

◆ CAN1_RX0_IRQHandler()

void CAN1_RX0_IRQHandler ( void )

can1 interrupt function rx0

Parameters
none
Return values
none

< receive fifo 0 message num flag

Definition at line 148 of file project/at_start_f415/examples/can/loopback_mode/src/main.c.

◆ CAN1_SE_IRQHandler()

void CAN1_SE_IRQHandler ( void )

can1 interrupt function se

Parameters
none
Return values
none

< error type record flag

< error type record flag

Definition at line 164 of file project/at_start_f415/examples/can/loopback_mode/src/main.c.

◆ can_configuration()

static void can_configuration ( void )
static

can configiguration.

Parameters
none
Return values
none

< receive fifo 0 message interrupt

< error type record interrupt

< error occur interrupt

Definition at line 72 of file project/at_start_f415/examples/can/loopback_mode/src/main.c.

Referenced by CAN1_SE_IRQHandler(), and main().

◆ can_gpio_config()

static void can_gpio_config ( void )
static

can gpio config

Parameters
none
Return values
none

< can_rx(pb8), can_tx(pb9)

< gpio pins number 9

< gpio pins number 8

Definition at line 43 of file project/at_start_f415/examples/can/loopback_mode/src/main.c.

Referenced by main().

◆ can_transmit_data()

static void can_transmit_data ( void )
static

can transmit data

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/can/loopback_mode/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 184 of file project/at_start_f415/examples/can/loopback_mode/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c.


AT32F415 Firmwary Library: CMP_deep_sleep_mode

Functions | Variables
CMP_deep_sleep_mode
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | CMP1_IRQHandler (void)
this function handles cmp1 handler. More...
void | cmp_exint_init (void)
void | cmp_config (void)
configures cmp: pa1 to cmp inverting input and cmp output to tmr1 ch1. More...
void | sysclk_config_deep_sleep (void)
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
__IO uint32_t | capture = 0
__IO uint32_t | tmr1freq
__IO uint16_t | capturenumber
__IO uint32_t | ic1readvalue1
__IO uint32_t | ic1readvalue2

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c.

◆ CMP1_IRQHandler()

void CMP1_IRQHandler ( void )

this function handles cmp1 handler.

Parameters
none
Return values
none

< external interrupt line 19 connected to the comp1

< external interrupt line 19 connected to the comp1

Definition at line 141 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c.

◆ cmp_config()

void cmp_config ( void )

configures cmp: pa1 to cmp inverting input and cmp output to tmr1 ch1.

Parameters
none
Return values
none

< gpio pins number 1

< gpio pins number 6

Definition at line 66 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c.

Referenced by main().

◆ cmp_exint_init()

void cmp_exint_init ( void )

< external interrupt line 19 connected to the comp1

Definition at line 45 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c.

Referenced by cmp_config().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c.

◆ sysclk_config_deep_sleep()

void sysclk_config_deep_sleep ( void )

< phase locking loop stable flag

Definition at line 102 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c.

Referenced by main().

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c.

Variable Documentation

◆ capture

__IO uint32_t capture = 0

Definition at line 39 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c.

◆ capturenumber

__IO uint16_t capturenumber
extern

Definition at line 135 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c.

Referenced by at32_button_init(), at32_led_init(), can_gpio_config(), clkout_config(), cmp_config(), codec_i2s_init(), gpio_configuration(), gpio_default_para_init(), gpio_init(), mclk_tmr1_init(), sd_init(), swj_dp_config(), uart_init(), uart_print_init(), usart1_config(), usart_configuration(), usart_spi_configuration(), and usb_gpio_config().

◆ ic1readvalue1

__IO uint32_t ic1readvalue1
extern

◆ ic1readvalue2

__IO uint32_t ic1readvalue2
extern

◆ tmr1freq

__IO uint32_t tmr1freq

Definition at line 40 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c.


AT32F415 Firmwary Library: CMP_output

Functions | Variables
CMP_output
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR1_CH_IRQHandler (void)
void | cmp_config (void)
configures cmp More...
void | tmr1_init (void)
configures tmr1_ch1 as input More...
int | main (void)
main function. More...

Variables

__IO uint16_t | capturenumber = 0
__IO uint32_t | ch1readvalue1 = 0
__IO uint32_t | ch1readvalue2 = 0
gpio_init_type | gpio_init_struct = {0}
__IO uint32_t | capture = 0
__IO uint32_t | tmr1freq
__IO uint16_t | capturenumber
__IO uint32_t | ch1readvalue1
__IO uint32_t | ch1readvalue2

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

◆ cmp_config()

void cmp_config ( void )

configures cmp

Parameters
none
Return values
none

< gpio pins number 1

< gpio pins number 0

< cmp connect tmr1 ch1

Definition at line 50 of file project/at_start_f415/examples/cmp/output/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 133 of file project/at_start_f415/examples/cmp/output/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

◆ TMR1_CH_IRQHandler()

void TMR1_CH_IRQHandler ( void )

Definition at line 137 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

◆ tmr1_init()

void tmr1_init ( void )

configures tmr1_ch1 as input

Parameters
none
Return values
none

< gpio pins number 8

< tmr interrupt channel 1

Definition at line 92 of file project/at_start_f415/examples/cmp/output/src/main.c.

Referenced by main().

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

Variable Documentation

◆ capture

__IO uint32_t capture = 0

Definition at line 39 of file project/at_start_f415/examples/cmp/output/src/main.c.

Referenced by main().

◆ capturenumber [1/2]

__IO uint16_t capturenumber = 0

Definition at line 135 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

Referenced by TMR1_CH_IRQHandler().

◆ capturenumber [2/2]

__IO uint16_t capturenumber
extern

Definition at line 135 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

Referenced by main(), TMR1_CH_IRQHandler(), and TMR3_GLOBAL_IRQHandler().

◆ ch1readvalue1 [1/2]

__IO uint32_t ch1readvalue1 = 0

Definition at line 136 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

Referenced by main(), and TMR1_CH_IRQHandler().

◆ ch1readvalue1 [2/2]

__IO uint32_t ch1readvalue1
extern

Definition at line 136 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

Referenced by main(), and TMR1_CH_IRQHandler().

◆ ch1readvalue2 [1/2]

__IO uint32_t ch1readvalue2 = 0

Definition at line 136 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

Referenced by main(), and TMR1_CH_IRQHandler().

◆ ch1readvalue2 [2/2]

__IO uint32_t ch1readvalue2
extern

Definition at line 136 of file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.

Referenced by main(), and TMR1_CH_IRQHandler().

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/cmp/output/src/main.c.

Referenced by cmp_config(), and tmr1_init().

◆ tmr1freq

__IO uint32_t tmr1freq

Definition at line 40 of file project/at_start_f415/examples/cmp/output/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: CORTEX_m4_bit_band

Macros | Functions | Variables
CORTEX_m4_bit_band
AT32F415_periph_examples

Macros

#define | RAM_BASE 0x20000000
#define | RAM_BITBAND_BASE 0x22000000
#define | VARIABLES_RESET_BIT(variables_addr, bit_number) (*(uint32_t *)(RAM_BITBAND_BASE + ((variables_addr - RAM_BASE) * 32) + ((bit_number) * 4)) = 0)
#define | VARIABLES_SET_BIT(variables_addr, bit_number) (*(uint32_t *)(RAM_BITBAND_BASE + ((variables_addr - RAM_BASE) * 32) + ((bit_number) * 4)) = 1)
#define | VARIABLES_GET_BIT(variables_addr, bit_number) (*(uint32_t *)(RAM_BITBAND_BASE + ((variables_addr - RAM_BASE) * 32) + ((bit_number) * 4)))
#define | PERIPHERAL_BASE 0x40000000
#define | PERIPHERAL_BITBAND_BASE 0x42000000
#define | PERIPHERAL_RESET_BIT(peripheral_addr, bit_number) (*(uint32_t *)(PERIPHERAL_BITBAND_BASE + ((peripheral_addr - PERIPHERAL_BASE) * 32) + ((bit_number) * 4)) = 0)
#define | PERIPHERAL_SET_BIT(peripheral_addr, bit_number) (*(uint32_t *)(PERIPHERAL_BITBAND_BASE + ((peripheral_addr - PERIPHERAL_BASE) * 32) + ((bit_number) * 4)) = 1)

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | result_error (void)
led4 flick for error. More...
int | main (void)
main function. More...

Variables

__IO uint32_t | variables
__IO uint32_t | variables_addr = 0
__IO uint32_t | variables_bit_val = 0

Detailed Description

Macro Definition Documentation

◆ PERIPHERAL_BASE

#define PERIPHERAL_BASE 0x40000000

Definition at line 53 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.

◆ PERIPHERAL_BITBAND_BASE

#define PERIPHERAL_BITBAND_BASE 0x42000000

Definition at line 54 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.

◆ PERIPHERAL_RESET_BIT

#define PERIPHERAL_RESET_BIT | ( | peripheral_addr,
 |  | bit_number
 | ) | (*(uint32_t *)(PERIPHERAL_BITBAND_BASE + ((peripheral_addr - PERIPHERAL_BASE) * 32) + ((bit_number) * 4)) = 0)

Definition at line 56 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.

◆ PERIPHERAL_SET_BIT

#define PERIPHERAL_SET_BIT | ( | peripheral_addr,
 |  | bit_number
 | ) | (*(uint32_t *)(PERIPHERAL_BITBAND_BASE + ((peripheral_addr - PERIPHERAL_BASE) * 32) + ((bit_number) * 4)) = 1)

Definition at line 59 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.

◆ RAM_BASE

#define RAM_BASE 0x20000000

Definition at line 40 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.

◆ RAM_BITBAND_BASE

#define RAM_BITBAND_BASE 0x22000000

Definition at line 41 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.

◆ VARIABLES_GET_BIT

#define VARIABLES_GET_BIT | ( | variables_addr,
 |  | bit_number
 | ) | (*(uint32_t *)(RAM_BITBAND_BASE + ((variables_addr - RAM_BASE) * 32) + ((bit_number) * 4)))

Definition at line 49 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.

◆ VARIABLES_RESET_BIT

#define VARIABLES_RESET_BIT | ( | variables_addr,
 |  | bit_number
 | ) | (*(uint32_t *)(RAM_BITBAND_BASE + ((variables_addr - RAM_BASE) * 32) + ((bit_number) * 4)) = 0)

Definition at line 43 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.

◆ VARIABLES_SET_BIT

#define VARIABLES_SET_BIT | ( | variables_addr,
 |  | bit_number
 | ) | (*(uint32_t *)(RAM_BITBAND_BASE + ((variables_addr - RAM_BASE) * 32) + ((bit_number) * 4)) = 1)

Definition at line 46 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 83 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c.

◆ result_error()

void result_error ( void )

led4 flick for error.

Parameters
none
Return values
none

Definition at line 69 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.

Referenced by main().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c.

Variable Documentation

◆ variables

__IO uint32_t variables

Definition at line 62 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.

Referenced by main().

◆ variables_addr

__IO uint32_t variables_addr = 0

Definition at line 62 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.

Referenced by main().

◆ variables_bit_val

__IO uint32_t variables_bit_val = 0

Definition at line 62 of file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.


AT32F415 Firmwary Library: CORTEX_m4_systick_interrupt

Macros | Functions
CORTEX_m4_systick_interrupt
AT32F415_periph_examples

Macros

#define | MS_TICK (system_core_clock / 1000U)
#define | DELAY 200 /* 200 ms ticks */

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | systick_handler (void)
systick interrupt handler. More...
int | main (void)
main function. More...

Detailed Description

Macro Definition Documentation

◆ DELAY

#define DELAY 200 /* 200 ms ticks */

Definition at line 39 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c.

◆ MS_TICK

#define MS_TICK (system_core_clock / 1000U)

Definition at line 38 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 80 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 115 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 54 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 67 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 45 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 124 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 106 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 133 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c.

◆ systick_handler()

void systick_handler ( void )

systick interrupt handler.

Parameters
none
Return values
none

Definition at line 46 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c.

Referenced by SysTick_Handler().

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 93 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c.


AT32F415 Firmwary Library: CRC_calculation

Macros | Functions | Variables
CRC_calculation
AT32F415_periph_examples

Macros

#define BUFFER_SIZE 120

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Variables

static const uint32_t | data_buffer [120]
__IO uint32_t | crc_value = 0

Detailed Description

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE 120

Definition at line 38 of file project/at_start_f415/examples/crc/calculation/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/crc/calculation/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/crc/calculation/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/crc/calculation/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 71 of file project/at_start_f415/examples/crc/calculation/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/crc/calculation/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/crc/calculation/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/crc/calculation/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/crc/calculation/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/crc/calculation/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/crc/calculation/src/at32f415_int.c.

Variable Documentation

◆ crc_value

__IO uint32_t crc_value = 0

Definition at line 64 of file project/at_start_f415/examples/crc/calculation/src/main.c.

Referenced by iap_crc(), and main().

◆ data_buffer

const uint32_t data_buffer[120]
static
Initial value:
=
{
0xc33dd31c, 0xe37ff35e, 0x129022f3, 0x32d24235, 0x52146277, 0x7256b5ea,
0x4a755a54, 0x6a377a16, 0x0af11ad0, 0x2ab33a92, 0xed0fdd6c, 0xcd4dbdaa,
0xbb3bab1a, 0x6ca67c87, 0x5cc52c22, 0x3c030c60, 0x1c41edae, 0xfd8fcdec,
0xad8b9de8, 0x8dc97c26, 0x5c644c45, 0x3ca22c83, 0x1ce00cc1, 0xef1fff3e,
0x95a88589, 0xf56ee54f, 0xd52cc50d, 0x34e224c3, 0x04817466, 0x64475424,
0x78066827, 0x18c008e1, 0x28a3cb7d, 0xdb5ceb3f, 0xfb1e8bf9, 0x9bd8abbb,
0xdf7caf9b, 0xbfba8fd9, 0x9ff86e17, 0x7e364e55, 0x2e933eb2, 0x0ed11ef0,
0xa35ad3bd, 0xc39cf3ff, 0xe3de2462, 0x34430420, 0x64e674c7, 0x44a45485,
0xad2abd0b, 0x8d689d49, 0x7e976eb6, 0x5ed54ef4, 0x2e321e51, 0x0e70ff9f,
0xefbedfdd, 0xcffcbf1b, 0x9f598f78, 0x918881a9, 0xb1caa1eb, 0xd10cc12d,
0xe16f1080, 0x00a130c2, 0x20e35004, 0x40257046, 0x83b99398, 0xa3fbb3da,
0x00001021, 0x20423063, 0x408450a5, 0x60c670e7, 0x9129a14a, 0xb16bc18c,
0x569546b4, 0xb75ba77a, 0x97198738, 0xf7dfe7fe, 0xc7bc48c4, 0x58e56886,
0x4405a7db, 0xb7fa8799, 0xe75ff77e, 0xc71dd73c, 0x26d336f2, 0x069116b0,
0x76764615, 0x5634d94c, 0xc96df90e, 0xe92f99c8, 0xb98aa9ab, 0x58444865,
0x78a70840, 0x18612802, 0xc9ccd9ed, 0xe98ef9af, 0x89489969, 0xa90ab92b,
0xd1ade1ce, 0xf1ef1231, 0x32732252, 0x52b54294, 0x72f762d6, 0x93398318,
0xa56ab54b, 0x85289509, 0xf5cfc5ac, 0xd58d3653, 0x26721611, 0x063076d7,
0x8d689d49, 0xf7dfe7fe, 0xe98ef9af, 0x063076d7, 0x93398318, 0xb98aa9ab,
0x4ad47ab7, 0x6a961a71, 0x0a503a33, 0x2a12dbfd, 0xfbbfeb9e, 0x9b798b58
}

Definition at line 40 of file project/at_start_f415/examples/crc/calculation/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: CRM_clock_failure_detection

Functions
CRM_clock_failure_detection
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static void | clkout_config (void)
clkout configuration. More...
static void | sclk_144m_hick_config (void)
config sclk 144 mhz with hick clock source. More...
void | clock_failure_detection_handler (void)
clock failure detection handler. More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 81 of file project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c.

◆ clkout_config()

static void clkout_config ( void )
static

clkout configuration.

Parameters
none
Return values
none

< gpio pins number 8

Definition at line 47 of file project/at_start_f415/examples/crm/clock_failure_detection/src/main.c.

Referenced by main(), and sclk_144m_hick_config().

◆ clock_failure_detection_handler()

void clock_failure_detection_handler ( void )

clock failure detection handler.

Parameters
none
Return values
none

< clock failure interrupt ready flag

< clock failure interrupt ready flag

Definition at line 76 of file project/at_start_f415/examples/crm/clock_failure_detection/src/main.c.

Referenced by NMI_Handler().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 116 of file project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 174 of file project/at_start_f415/examples/crm/clock_failure_detection/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 68 of file project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 45 of file project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 125 of file project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c.

◆ sclk_144m_hick_config()

static void sclk_144m_hick_config ( void )
static

config sclk 144 mhz with hick clock source.

Note
the system clock is configured as follow:
  • system clock = hick / 2 * pll_mult
  • system clock source = pll (hick)
  • hick = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< high speed internal clock stable flag

< phase locking loop stable flag

Definition at line 110 of file project/at_start_f415/examples/crm/clock_failure_detection/src/main.c.

Referenced by clock_failure_detection_handler().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 107 of file project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 134 of file project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 94 of file project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c.


AT32F415 Firmwary Library: CRM_sysclk_switch

Functions
CRM_sysclk_switch
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static void | clkout_config (void)
clkout configuration. More...
int | main (void)
main function. More...
static void | sclk_64m_hick_config (void)
config sclk 64 mhz with hick clock source. More...
static void | sclk_96m_hext_config (void)
config sclk 96 mhz with hext clock source. More...
static void | switch_system_clock (void)
sclk switch function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c.

◆ clkout_config()

void clkout_config ( void )
static

clkout configuration.

Parameters
none
Return values
none

< gpio pins number 8

< gpio pins number 8

Definition at line 45 of file project/at_start_f415/examples/crm/pll_config2/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 74 of file project/at_start_f415/examples/crm/pll_config2/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c.

◆ sclk_64m_hick_config()

static void sclk_64m_hick_config ( void )
static

config sclk 64 mhz with hick clock source.

Note
the system clock is configured as follow:
  • system clock = hick / 2 * pll_mult
  • system clock source = pll (hick)
  • hick = 8000000
  • sclk = 64000000
  • ahbdiv = 1
  • ahbclk = 64000000
  • apb2div = 2
  • apb2clk = 32000000
  • apb1div = 2
  • apb1clk = 32000000
  • pll_mult = 16
  • flash_wtcyc = 1 cycle
Parameters
none
Return values
none

< high speed internal clock stable flag

< phase locking loop stable flag

Definition at line 107 of file project/at_start_f415/examples/crm/sysclk_switch/src/main.c.

Referenced by switch_system_clock().

◆ sclk_96m_hext_config()

static void sclk_96m_hext_config ( void )
static

config sclk 96 mhz with hext clock source.

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hick = 8000000
  • sclk = 96000000
  • ahbdiv = 1
  • ahbclk = 96000000
  • apb2div = 2
  • apb2clk = 48000000
  • apb1div = 2
  • apb1clk = 48000000
  • pll_mult = 24
  • flash_wtcyc = 2 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 184 of file project/at_start_f415/examples/crm/sysclk_switch/src/main.c.

Referenced by switch_system_clock().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c.

◆ switch_system_clock()

static void switch_system_clock ( void )
static

sclk switch function.

Parameters
none
Return values
none

Definition at line 77 of file project/at_start_f415/examples/crm/sysclk_switch/src/main.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c.


AT32F415 Firmwary Library: DEBUG_tmr

Functions | Variables
DEBUG_tmr
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR1_OVF_TMR10_IRQHandler (void)
this function handles tmr1 overflow handler. More...
int | main (void)
main function. More...

Variables

crm_clocks_freq_type | crm_clocks_freq_struct = {0}
uint16_t | counter = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< debug timer1 pause

< tmr interrupt overflow

Definition at line 62 of file project/at_start_f415/examples/debug/tmr1/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c.

◆ TMR1_OVF_TMR10_IRQHandler()

void TMR1_OVF_TMR10_IRQHandler ( void )

this function handles tmr1 overflow handler.

Parameters
none
Return values
none

< tmr flag overflow

< tmr flag overflow

Definition at line 47 of file project/at_start_f415/examples/debug/tmr1/src/main.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c.

Variable Documentation

◆ counter

uint16_t counter = 0

Definition at line 40 of file project/at_start_f415/examples/debug/tmr1/src/main.c.

Referenced by can_receive_error_counter_get(), can_transmit_error_counter_get(), ertc_wakeup_counter_set(), and main().

◆ crm_clocks_freq_struct

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Definition at line 39 of file project/at_start_f415/examples/debug/tmr1/src/main.c.

Referenced by main(), tmr1_config(), and tmr_init().


AT32F415 Firmwary Library: DMA_data_to_gpio_flexible

Macros | Functions | Variables
DMA_data_to_gpio_flexible
AT32F415_periph_examples

Macros

#define BUFFER_SIZE 16

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | DMA2_Channel1_IRQHandler (void)
this function handles DMA2 channel1 handler. More...
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
dma_init_type | dma_init_struct = {0}
uint16_t | src_buffer [16]

Detailed Description

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE 16

Definition at line 41 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c.

◆ DMA2_Channel1_IRQHandler()

void DMA2_Channel1_IRQHandler ( void )

this function handles DMA2 channel1 handler.

Parameters
none
Return values
none

< dma2 channel1 full data transfer flag

< dma2 channel1 full data transfer flag

Definition at line 50 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< jtag-dp disabled and sw-dp enabled

< jtag-dp disabled and sw-dp enabled

< gpio all pins

< dma full data transfer interrupt

< dma flexible channel1

Definition at line 67 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c.

Variable Documentation

◆ dma_init_struct

dma_init_type dma_init_struct = {0}

Definition at line 39 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c.

Referenced by codec_i2s_init(), dma_config(), dma_configuration(), dma_default_para_init(), dma_init(), i2s_config(), main(), sd_dma_config(), spi_bytes_read(), spi_bytes_write(), and spi_config().

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c.

Referenced by main().

◆ src_buffer

uint16_t src_buffer[16]
Initial value:
= {0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008,
0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010}

Definition at line 42 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: DMA_flash_to_sram

Macros | Functions | Variables
DMA_flash_to_sram
AT32F415_periph_examples

Macros

#define BUFFER_SIZE 32

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
error_status | buffer_compare (const uint32_t *pbuffer, uint32_t *pbuffer1, uint16_t buffer_length)
compares two buffers. More...
void | DMA1_Channel1_IRQHandler (void)
this function handles dma1 channel1 handler. More...
int | main (void)
main function. More...

Variables

const uint32_t | src_const_buffer [32]
uint32_t | dst_buffer [32]
gpio_init_type | gpio_init_struct = {0}
dma_init_type | dma_init_struct = {0}
__IO uint32_t | data_counter_end = 0x01
error_status transfer_status = ERROR

Detailed Description

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE 32

Definition at line 39 of file project/at_start_f415/examples/dma/flash_to_sram/src/main.c.

Function Documentation

◆ buffer_compare()

error_status buffer_compare | ( | const uint32_t * | pbuffer,
 |  | uint32_t * | pbuffer1,
 |  | uint16_t | buffer_length
 | ) |  |

compares two buffers.

Parameters
pbuffer,pbuffer1 | buffers to be compared.
buffer_length | buffer's length
Return values
SUCCESS pbuffer identical to pbuffer1 ERROR: pbuffer differs from pbuffer1

Definition at line 78 of file project/at_start_f415/examples/dma/flash_to_sram/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 80 of file project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 115 of file project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c.

◆ DMA1_Channel1_IRQHandler()

void DMA1_Channel1_IRQHandler ( void )

this function handles dma1 channel1 handler.

Parameters
none
Return values
none

< dma1 channel1 full data transfer flag

< dma1 channel1 full data transfer flag

Definition at line 62 of file project/at_start_f415/examples/dma/flash_to_sram/src/main.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 54 of file project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< dma full data transfer interrupt

Definition at line 99 of file project/at_start_f415/examples/dma/flash_to_sram/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 67 of file project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 45 of file project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 124 of file project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 106 of file project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 133 of file project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 93 of file project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c.

Variable Documentation

◆ data_counter_end

__IO uint32_t data_counter_end = 0x01

Definition at line 52 of file project/at_start_f415/examples/dma/flash_to_sram/src/main.c.

Referenced by DMA1_Channel1_IRQHandler(), and main().

◆ dma_init_struct

dma_init_type dma_init_struct = {0}

Definition at line 51 of file project/at_start_f415/examples/dma/flash_to_sram/src/main.c.

Referenced by main().

◆ dst_buffer

uint32_t dst_buffer[32]

Definition at line 49 of file project/at_start_f415/examples/dma/flash_to_sram/src/main.c.

Referenced by main().

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 50 of file project/at_start_f415/examples/dma/flash_to_sram/src/main.c.

◆ src_const_buffer

const uint32_t src_const_buffer[32]
Initial value:
= {0x01020304, 0x05060708, 0x090A0B0C, 0x0D0E0F10,
0x11121314, 0x15161718, 0x191A1B1C, 0x1D1E1F20,
0x21222324, 0x25262728, 0x292A2B2C, 0x2D2E2F30,
0x31323334, 0x35363738, 0x393A3B3C, 0x3D3E3F40,
0x41424344, 0x45464748, 0x494A4B4C, 0x4D4E4F50,
0x51525354, 0x55565758, 0x595A5B5C, 0x5D5E5F60,
0x61626364, 0x65666768, 0x696A6B6C, 0x6D6E6F70,
0x71727374, 0x75767778, 0x797A7B7C, 0x7D7E7F80}

Definition at line 41 of file project/at_start_f415/examples/dma/flash_to_sram/src/main.c.

Referenced by main().

◆ transfer_status

error_status transfer_status = ERROR

Definition at line 53 of file project/at_start_f415/examples/dma/flash_to_sram/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: ERTC_bpr_domain

Macros | Functions | Variables
ERTC_bpr_domain
AT32F415_periph_examples

Macros

#define ERTC_BPR_DT_NUMBER 20

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Variables

ertc_dt_type bpr_addr_tab [20]

Detailed Description

Macro Definition Documentation

◆ ERTC_BPR_DT_NUMBER

#define ERTC_BPR_DT_NUMBER 20

Definition at line 38 of file project/at_start_f415/examples/ertc/bpr_domain/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 57 of file project/at_start_f415/examples/ertc/bpr_domain/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c.

Variable Documentation

◆ bpr_addr_tab

ertc_dt_type bpr_addr_tab[20]
Initial value:
=
{
ERTC_DT1, ERTC_DT2, ERTC_DT3, ERTC_DT4, ERTC_DT5,
ERTC_DT6, ERTC_DT7, ERTC_DT8, ERTC_DT9, ERTC_DT10,
ERTC_DT11, ERTC_DT12, ERTC_DT13, ERTC_DT14, ERTC_DT15,
ERTC_DT16, ERTC_DT17, ERTC_DT18, ERTC_DT19, ERTC_DT20
}
ERTC_DT11
@ ERTC_DT11
Definition: at32f415_ertc.h:355
ERTC_DT13
@ ERTC_DT13
Definition: at32f415_ertc.h:357
ERTC_DT2
@ ERTC_DT2
Definition: at32f415_ertc.h:346
ERTC_DT1
@ ERTC_DT1
Definition: at32f415_ertc.h:345
ERTC_DT15
@ ERTC_DT15
Definition: at32f415_ertc.h:359
ERTC_DT18
@ ERTC_DT18
Definition: at32f415_ertc.h:362
ERTC_DT19
@ ERTC_DT19
Definition: at32f415_ertc.h:363
ERTC_DT6
@ ERTC_DT6
Definition: at32f415_ertc.h:350
ERTC_DT7
@ ERTC_DT7
Definition: at32f415_ertc.h:351
ERTC_DT20
@ ERTC_DT20
Definition: at32f415_ertc.h:364
ERTC_DT17
@ ERTC_DT17
Definition: at32f415_ertc.h:361
ERTC_DT3
@ ERTC_DT3
Definition: at32f415_ertc.h:347
ERTC_DT4
@ ERTC_DT4
Definition: at32f415_ertc.h:348
ERTC_DT8
@ ERTC_DT8
Definition: at32f415_ertc.h:352
ERTC_DT5
@ ERTC_DT5
Definition: at32f415_ertc.h:349
ERTC_DT10
@ ERTC_DT10
Definition: at32f415_ertc.h:354
ERTC_DT9
@ ERTC_DT9
Definition: at32f415_ertc.h:353
ERTC_DT16
@ ERTC_DT16
Definition: at32f415_ertc.h:360
ERTC_DT12
@ ERTC_DT12
Definition: at32f415_ertc.h:356
ERTC_DT14
@ ERTC_DT14
Definition: at32f415_ertc.h:358

Definition at line 40 of file project/at_start_f415/examples/ertc/bpr_domain/src/main.c.

Referenced by bpr_reg_check(), and bpr_reg_write().


AT32F415 Firmwary Library: ERTC_calendar

Macros | Functions | Variables
ERTC_calendar
AT32F415_periph_examples

Macros

#define ERTC_CLOCK_SOURCE_LEXT /* select lext as the ertc clock */

Functions

void | ertc_alarm_show (void)
display the current alarm. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | ERTCAlarm_IRQHandler (void)
this function handles ertc alarms interrupt request. More...
void | ertc_config (void)
configure the ertc peripheral by selecting the clock source. More...
int | main (void)
main program More...

Variables

__IO uint16_t | ertc_clk_div_a = 0
__IO uint16_t | ertc_clk_div_b = 0

Detailed Description

Macro Definition Documentation

◆ ERTC_CLOCK_SOURCE_LEXT

#define ERTC_CLOCK_SOURCE_LEXT /* select lext as the ertc clock */

Definition at line 39 of file project/at_start_f415/examples/ertc/calendar/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 81 of file project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 116 of file project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c.

◆ ertc_alarm_show()

void ertc_alarm_show ( void )

display the current alarm.

Parameters
none
Return values
none

Definition at line 250 of file project/at_start_f415/examples/ertc/calendar/src/main.c.

Referenced by ERTCAlarm_IRQHandler(), and main().

◆ ertc_config()

void ertc_config ( void )

configure the ertc peripheral by selecting the clock source.

Parameters
none
Return values
none

< low speed external crystal stable flag

< ertc alarm don't match date or week

< ertc alarm a interrupt

< ertc alarm clock a flag

Definition at line 144 of file project/at_start_f415/examples/ertc/calendar/src/main.c.

Referenced by main().

◆ ERTCAlarm_IRQHandler()

void ERTCAlarm_IRQHandler ( void )

this function handles ertc alarms interrupt request.

Parameters
none
Return values
none

< ertc alarm clock a flag

< ertc alarm clock a flag

< external interrupt line 17 connected to the rtc alarm event

Definition at line 143 of file project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c.

◆ main()

int main ( void )

main program

Parameters
none
Return values
none

< ertc alarm clock a flag

< external interrupt line 17 connected to the rtc alarm event

< external interrupt line 17 connected to the rtc alarm event

Definition at line 54 of file project/at_start_f415/examples/ertc/calendar/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 68 of file project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 46 of file project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 125 of file project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 107 of file project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 134 of file project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 94 of file project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c.

Variable Documentation

◆ ertc_clk_div_a

__IO uint16_t ertc_clk_div_a = 0

Definition at line 42 of file project/at_start_f415/examples/ertc/calendar/src/main.c.

Referenced by ertc_config().

◆ ertc_clk_div_b

__IO uint16_t ertc_clk_div_b = 0

Definition at line 43 of file project/at_start_f415/examples/ertc/calendar/src/main.c.

Referenced by ertc_config().


AT32F415 Firmwary Library: ERTC_lick_calibration

Functions | Variables
ERTC_lick_calibration
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR5_GLOBAL_IRQHandler (void)
this function handles tmr5 global interrupt request. More...
void | ertc_config (void)
configures the ertc peripheral by selecting the clock source. More...
uint32_t | lick_frequency_get (void)
configures tmr5 to measure the lick oscillator frequency. More...
int | main (void)
main program More...

Variables

__IO uint32_t | period_value
__IO uint32_t | capture_number
uint16_t | tmp_c4 [2] = {0, 0}
__IO uint32_t | lick_freq = 0
__IO uint32_t | capture_number = 0
__IO uint32_t | period_value = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 84 of file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 119 of file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c.

◆ ertc_config()

void ertc_config ( void )

configures the ertc peripheral by selecting the clock source.

Parameters
none
Return values
none

< low speed internal clock stable flag

Definition at line 105 of file project/at_start_f415/examples/ertc/lick_calibration/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 58 of file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c.

◆ lick_frequency_get()

uint32_t lick_frequency_get ( void )

configures tmr5 to measure the lick oscillator frequency.

Parameters
none
Return values
lick frequency

< lick connected to tmr5_ch4 input capture for calibration

< lick connected to tmr5_ch4 input capture for calibration

< tmr interrupt channel 4

Definition at line 155 of file project/at_start_f415/examples/ertc/lick_calibration/src/main.c.

Referenced by main().

◆ main()

int main ( void )

main program

Parameters
none
Return values
none

Definition at line 50 of file project/at_start_f415/examples/ertc/lick_calibration/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 71 of file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 49 of file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 128 of file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 110 of file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 137 of file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c.

◆ TMR5_GLOBAL_IRQHandler()

void TMR5_GLOBAL_IRQHandler ( void )

this function handles tmr5 global interrupt request.

Parameters
none
Return values
none

< tmr flag channel 4

< tmr flag channel 4

Definition at line 146 of file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 97 of file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c.

Variable Documentation

◆ capture_number [1/2]

__IO uint32_t capture_number
extern

Definition at line 39 of file project/at_start_f415/examples/ertc/lick_calibration/src/main.c.

Referenced by lick_frequency_get(), and TMR5_GLOBAL_IRQHandler().

◆ capture_number [2/2]

__IO uint32_t capture_number = 0

Definition at line 39 of file project/at_start_f415/examples/ertc/lick_calibration/src/main.c.

Referenced by lick_frequency_get(), and TMR5_GLOBAL_IRQHandler().

◆ lick_freq

__IO uint32_t lick_freq = 0

Definition at line 38 of file project/at_start_f415/examples/ertc/lick_calibration/src/main.c.

Referenced by main().

◆ period_value [1/2]

__IO uint32_t period_value
extern

Definition at line 40 of file project/at_start_f415/examples/ertc/lick_calibration/src/main.c.

Referenced by lick_frequency_get(), and TMR5_GLOBAL_IRQHandler().

◆ period_value [2/2]

__IO uint32_t period_value = 0

Definition at line 40 of file project/at_start_f415/examples/ertc/lick_calibration/src/main.c.

Referenced by lick_frequency_get(), and TMR5_GLOBAL_IRQHandler().

◆ tmp_c4

uint16_t tmp_c4[2] = {0, 0}

Definition at line 42 of file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c.

Referenced by TMR5_GLOBAL_IRQHandler().


AT32F415 Firmwary Library: ERTC_tamper

Macros | Functions | Variables
ERTC_tamper
AT32F415_periph_examples

Macros

#define ERTC_BPR_DT_NUMBER 20

Functions

uint32_t | is_bpr_reg_reset (void)
checks if the ertc bpr dtx registers are reset or not. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TAMP_STAMP_IRQHandler (void)
this function handles ertc tamper and time stamp interrupts requests. More...
void | ertc_config (void)
configure the ertc peripheral by selecting the clock source. More...
void | bpr_reg_write (void)
write data to bpr dt register. More...
uint32_t | bpr_reg_check (void)
checks if the bpr dt register values are correct or not. More...
void | ertc_tamper_config (void)
configure the ertc tamper. More...
int | main (void)
main program More...

Variables

ertc_dt_type bpr_addr_tab [20]

Detailed Description

Macro Definition Documentation

◆ ERTC_BPR_DT_NUMBER

#define ERTC_BPR_DT_NUMBER 20

Definition at line 38 of file project/at_start_f415/examples/ertc/tamper/src/main.c.

Function Documentation

◆ bpr_reg_check()

uint32_t bpr_reg_check ( void )

checks if the bpr dt register values are correct or not.

Parameters
none.
Return values
- TRUE: all bpr dt register values are correct
  • FALSE: number of the bpr register which value is not correct

Definition at line 210 of file project/at_start_f415/examples/ertc/tamper/src/main.c.

Referenced by main().

◆ bpr_reg_write()

void bpr_reg_write ( void )

write data to bpr dt register.

Parameters
none.
Return values
none

Definition at line 192 of file project/at_start_f415/examples/ertc/tamper/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 82 of file project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 117 of file project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c.

◆ ertc_config()

void ertc_config ( void )

configure the ertc peripheral by selecting the clock source.

Parameters
none
Return values
none

< low speed external crystal stable flag

Definition at line 102 of file project/at_start_f415/examples/ertc/tamper/src/main.c.

Referenced by main().

◆ ertc_tamper_config()

void ertc_tamper_config ( void )

configure the ertc tamper.

Parameters
none
Return values
none

< external interrupt line 21 connected to the rtc temper and timestamp event

< ertc tamper detection 1 flag

< ertc tamper interrupt

< ertc tamper detection 1 flag

Definition at line 153 of file project/at_start_f415/examples/ertc/tamper/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 56 of file project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c.

◆ is_bpr_reg_reset()

uint32_t is_bpr_reg_reset ( void )

checks if the ertc bpr dtx registers are reset or not.

Parameters
none
Return values
- 0: all ertc bpr dtx registers are reset
  • value different from 0: number of the first bpr register not reset

Definition at line 232 of file project/at_start_f415/examples/ertc/tamper/src/main.c.

Referenced by TAMP_STAMP_IRQHandler().

◆ main()

int main ( void )

main program

Parameters
none
Return values
none

Definition at line 59 of file project/at_start_f415/examples/ertc/tamper/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 69 of file project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 47 of file project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 126 of file project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 108 of file project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 135 of file project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c.

◆ TAMP_STAMP_IRQHandler()

void TAMP_STAMP_IRQHandler ( void )

this function handles ertc tamper and time stamp interrupts requests.

Parameters
none
Return values
none

< ertc tamper detection 1 flag

< ertc tamper detection 1 flag

< external interrupt line 21 connected to the rtc temper and timestamp event

Definition at line 144 of file project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 95 of file project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c.

Variable Documentation

◆ bpr_addr_tab

ertc_dt_type bpr_addr_tab[20]
Initial value:
=
{
ERTC_DT1, ERTC_DT2, ERTC_DT3, ERTC_DT4, ERTC_DT5,
ERTC_DT6, ERTC_DT7, ERTC_DT8, ERTC_DT9, ERTC_DT10,
ERTC_DT11, ERTC_DT12, ERTC_DT13, ERTC_DT14, ERTC_DT15,
ERTC_DT16, ERTC_DT17, ERTC_DT18, ERTC_DT19, ERTC_DT20,
}
ERTC_DT11
@ ERTC_DT11
Definition: at32f415_ertc.h:355
ERTC_DT13
@ ERTC_DT13
Definition: at32f415_ertc.h:357
ERTC_DT2
@ ERTC_DT2
Definition: at32f415_ertc.h:346
ERTC_DT1
@ ERTC_DT1
Definition: at32f415_ertc.h:345
ERTC_DT15
@ ERTC_DT15
Definition: at32f415_ertc.h:359
ERTC_DT18
@ ERTC_DT18
Definition: at32f415_ertc.h:362
ERTC_DT19
@ ERTC_DT19
Definition: at32f415_ertc.h:363
ERTC_DT6
@ ERTC_DT6
Definition: at32f415_ertc.h:350
ERTC_DT7
@ ERTC_DT7
Definition: at32f415_ertc.h:351
ERTC_DT20
@ ERTC_DT20
Definition: at32f415_ertc.h:364
ERTC_DT17
@ ERTC_DT17
Definition: at32f415_ertc.h:361
ERTC_DT3
@ ERTC_DT3
Definition: at32f415_ertc.h:347
ERTC_DT4
@ ERTC_DT4
Definition: at32f415_ertc.h:348
ERTC_DT8
@ ERTC_DT8
Definition: at32f415_ertc.h:352
ERTC_DT5
@ ERTC_DT5
Definition: at32f415_ertc.h:349
ERTC_DT10
@ ERTC_DT10
Definition: at32f415_ertc.h:354
ERTC_DT9
@ ERTC_DT9
Definition: at32f415_ertc.h:353
ERTC_DT16
@ ERTC_DT16
Definition: at32f415_ertc.h:360
ERTC_DT12
@ ERTC_DT12
Definition: at32f415_ertc.h:356
ERTC_DT14
@ ERTC_DT14
Definition: at32f415_ertc.h:358

Definition at line 40 of file project/at_start_f415/examples/ertc/tamper/src/main.c.

Referenced by bpr_reg_check(), bpr_reg_write(), and is_bpr_reg_reset().


AT32F415 Firmwary Library: ERTC_time_stamp

Functions
ERTC_time_stamp
AT32F415_periph_examples

Functions

void | ertc_time_show (void)
display the current date. More...
void | ertc_timestamp_show (void)
display the current timestamp. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TAMP_STAMP_IRQHandler (void)
this function handles external lines 15 to 10 interrupt request. More...
void | ertc_config (void)
configure the ertc peripheral by selecting the clock source. More...
void | ertc_timestamp_config (void)
configure the ertc timestamp. More...
int | main (void)
main program More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 83 of file project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 118 of file project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c.

◆ ertc_config()

void ertc_config ( void )

configure the ertc peripheral by selecting the clock source.

Parameters
none
Return values
none

< low speed external crystal stable flag

Definition at line 82 of file project/at_start_f415/examples/ertc/time_stamp/src/main.c.

Referenced by main().

◆ ertc_time_show()

void ertc_time_show ( void )

display the current date.

Parameters
none
Return values
none

Definition at line 161 of file project/at_start_f415/examples/ertc/time_stamp/src/main.c.

Referenced by TAMP_STAMP_IRQHandler().

◆ ertc_timestamp_config()

void ertc_timestamp_config ( void )

configure the ertc timestamp.

Parameters
none
Return values
none

< external interrupt line 21 connected to the rtc temper and timestamp event

< ertc timestamp interrupt

Definition at line 133 of file project/at_start_f415/examples/ertc/time_stamp/src/main.c.

Referenced by main().

◆ ertc_timestamp_show()

void ertc_timestamp_show ( void )

display the current timestamp.

Parameters
none
Return values
none

Definition at line 183 of file project/at_start_f415/examples/ertc/time_stamp/src/main.c.

Referenced by TAMP_STAMP_IRQHandler().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 57 of file project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c.

◆ main()

int main ( void )

main program

Parameters
none
Return values
none

Definition at line 48 of file project/at_start_f415/examples/ertc/time_stamp/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 70 of file project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 48 of file project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 127 of file project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 109 of file project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 136 of file project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c.

◆ TAMP_STAMP_IRQHandler()

void TAMP_STAMP_IRQHandler ( void )

this function handles external lines 15 to 10 interrupt request.

Parameters
none
Return values
none

< ertc timestamp flag

< external interrupt line 21 connected to the rtc temper and timestamp event

< ertc timestamp flag

Definition at line 145 of file project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 96 of file project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c.


AT32F415 Firmwary Library: ERTC_wakeup_timer

Functions
ERTC_wakeup_timer
AT32F415_periph_examples

Functions

void | ertc_wakeup_show (void)
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | ERTC_WKUP_IRQHandler (void)
this function handles ertc wakeup timer interrupt request. More...
void | ertc_config (void)
configure the ertc peripheral by selecting the clock source. More...
void | wakeup_timer_config (void)
configure the ertc peripheral by selecting the clock source. More...
int | main (void)
main program More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 82 of file project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 117 of file project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c.

◆ ertc_config()

void ertc_config ( void )

configure the ertc peripheral by selecting the clock source.

Parameters
none
Return values
none

< low speed external crystal stable flag

Definition at line 92 of file project/at_start_f415/examples/ertc/wakeup_timer/src/main.c.

Referenced by main().

◆ ertc_wakeup_show()

void ertc_wakeup_show ( void )

◆ ERTC_WKUP_IRQHandler()

void ERTC_WKUP_IRQHandler ( void )

this function handles ertc wakeup timer interrupt request.

Parameters
none
Return values
none

< ertc wakeup timer flag

< ertc wakeup timer flag

< external interrupt line 22 connected to the rtc wakeup event

Definition at line 144 of file project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 56 of file project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c.

◆ main()

int main ( void )

main program

Parameters
none
Return values
none

Definition at line 46 of file project/at_start_f415/examples/ertc/wakeup_timer/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 69 of file project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 47 of file project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 126 of file project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 108 of file project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 135 of file project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 95 of file project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c.

◆ wakeup_timer_config()

void wakeup_timer_config ( void )

configure the ertc peripheral by selecting the clock source.

Parameters
none
Return values
none

< ertc wakeup timer interrupt

< external interrupt line 22 connected to the rtc wakeup event

Definition at line 144 of file project/at_start_f415/examples/ertc/wakeup_timer/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: EXINT_config

Functions
EXINT_config
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | exint_line0_config (void)
exint line0 config. configure pa0 in interrupt mode More...
int | main (void)
main function. More...
void | EXINT0_IRQHandler (void)
exint0 interrupt handler More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c.

◆ EXINT0_IRQHandler()

void EXINT0_IRQHandler ( void )

exint0 interrupt handler

Parameters
none
Return values
none

< external interrupt line 0

< external interrupt line 0

Definition at line 96 of file project/at_start_f415/examples/exint/exint_config/src/main.c.

◆ exint_line0_config()

void exint_line0_config ( void )

exint line0 config. configure pa0 in interrupt mode

Parameters
None
Return values
None

< external interrupt line 0

Definition at line 71 of file project/at_start_f415/examples/exint/exint_config/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 47 of file project/at_start_f415/examples/exint/exint_config/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c.


AT32F415 Firmwary Library: EXINT_software_trigger

Functions
EXINT_software_trigger
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | exint_line4_config (void)
exint line4 config. configure pa0 in interrupt mode More...
static void | tmr1_config (void)
tmr1 configuration. More...
void | TMR1_OVF_TMR10_IRQHandler (void)
tmr1 interrupt handler More...
void | EXINT4_IRQHandler (void)
exint4 interrupt handler More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c.

◆ EXINT4_IRQHandler()

void EXINT4_IRQHandler ( void )

exint4 interrupt handler

Parameters
none
Return values
none

< external interrupt line 4

< external interrupt line 4

Definition at line 106 of file project/at_start_f415/examples/exint/exint_software_trigger/src/main.c.

◆ exint_line4_config()

void exint_line4_config ( void )

exint line4 config. configure pa0 in interrupt mode

Parameters
None
Return values
None

< external interrupt line 4

Definition at line 48 of file project/at_start_f415/examples/exint/exint_software_trigger/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 121 of file project/at_start_f415/examples/exint/exint_software_trigger/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c.

◆ tmr1_config()

static void tmr1_config ( void )
static

tmr1 configuration.

Parameters
none
Return values
none

< tmr interrupt overflow

Definition at line 69 of file project/at_start_f415/examples/exint/exint_software_trigger/src/main.c.

Referenced by main().

◆ TMR1_OVF_TMR10_IRQHandler()

void TMR1_OVF_TMR10_IRQHandler ( void )

tmr1 interrupt handler

Parameters
none
Return values
none

< tmr flag overflow

< external interrupt line 4

< tmr flag overflow

Definition at line 91 of file project/at_start_f415/examples/exint/exint_software_trigger/src/main.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c.


AT32F415 Firmwary Library: FLASH_write_read

Modules | Macros | Functions | Variables
FLASH_write_read
AT32F415_periph_examples

Modules

FLASH_write_read_functions

Macros

#define | SECTOR_SIZE 2048
#define | TEST_BUFEER_SIZE 3000
#define | TEST_FLASH_ADDRESS_START (0x08000000 + 1024 * 10)

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | flash_read (uint32_t read_addr, uint16_t *p_buffer, uint16_t num_read)
read data using halfword mode More...
void | flash_write_nocheck (uint32_t write_addr, uint16_t *p_buffer, uint16_t num_write)
write data using halfword mode without checking More...
void | flash_write (uint32_t write_addr, uint16_t *p_buffer, uint16_t num_write)
write data using halfword mode with checking More...
int | main (void)
main function. More...

Variables

uint16_t | flash_buf [2048/2]
uint16_t | buffer_write [3000]
uint16_t | buffer_read [3000]

Detailed Description

Macro Definition Documentation

◆ SECTOR_SIZE

#define SECTOR_SIZE 2048

Definition at line 38 of file project/at_start_f415/examples/flash/flash_write_read/src/flash.c.

◆ TEST_BUFEER_SIZE

#define TEST_BUFEER_SIZE 3000

Definition at line 39 of file project/at_start_f415/examples/flash/flash_write_read/src/main.c.

◆ TEST_FLASH_ADDRESS_START

#define TEST_FLASH_ADDRESS_START (0x08000000 + 1024 * 10)

Definition at line 40 of file project/at_start_f415/examples/flash/flash_write_read/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c.

◆ flash_read()

void flash_read | ( | uint32_t | read_addr,
 |  | uint16_t * | p_buffer,
 |  | uint16_t | num_read
 | ) |  |

read data using halfword mode

Parameters
read_addr | the address of reading
p_buffer | the buffer of reading data
num_read | the number of reading data
Return values
none

Definition at line 49 of file project/at_start_f415/examples/flash/flash_write_read/src/flash.c.

Referenced by flash_write(), and main().

◆ flash_write()

void flash_write | ( | uint32_t | write_addr,
 |  | uint16_t * | p_buffer,
 |  | uint16_t | num_write
 | ) |  |

write data using halfword mode with checking

Parameters
write_addr | the address of writing
p_buffer | the buffer of writing data
num_write | the number of writing data
Return values
none

Definition at line 83 of file project/at_start_f415/examples/flash/flash_write_read/src/flash.c.

Referenced by main().

◆ flash_write_nocheck()

void flash_write_nocheck | ( | uint32_t | write_addr,
 |  | uint16_t * | p_buffer,
 |  | uint16_t | num_write
 | ) |  |

write data using halfword mode without checking

Parameters
write_addr | the address of writing
p_buffer | the buffer of writing data
num_write | the number of writing data
Return values
none

Definition at line 66 of file project/at_start_f415/examples/flash/flash_write_read/src/flash.c.

Referenced by flash_write().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 73 of file project/at_start_f415/examples/flash/flash_write_read/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c.

Variable Documentation

◆ buffer_read

uint16_t buffer_read[3000]

Definition at line 43 of file project/at_start_f415/examples/flash/flash_write_read/src/main.c.

Referenced by main().

◆ buffer_write

uint16_t buffer_write[3000]

Definition at line 42 of file project/at_start_f415/examples/flash/flash_write_read/src/main.c.

Referenced by main().

◆ flash_buf

uint16_t flash_buf[2048/2]

Definition at line 40 of file project/at_start_f415/examples/flash/flash_write_read/src/flash.c.

Referenced by flash_write().


AT32F415 Firmwary Library: FLASH_write_read_functions

Functions
FLASH_write_read_functions
AT32F415_periph_examples » FLASH_write_read

Functions

void | flash_read (uint32_t read_addr, uint16_t *p_buffer, uint16_t num_read)
read data using halfword mode More...
void | flash_write_nocheck (uint32_t write_addr, uint16_t *p_buffer, uint16_t num_write)
write data using halfword mode without checking More...
void | flash_write (uint32_t write_addr, uint16_t *p_Buffer, uint16_t num_write)
write data using halfword mode with checking More...

Detailed Description

Function Documentation

◆ flash_read()

void flash_read | ( | uint32_t | read_addr,
 |  | uint16_t * | p_buffer,
 |  | uint16_t | num_read
 | ) |  |

read data using halfword mode

Parameters
read_addr | the address of reading
p_buffer | the buffer of reading data
num_read | the number of reading data
Return values
none

Definition at line 49 of file project/at_start_f415/examples/flash/flash_write_read/src/flash.c.

Referenced by flash_write(), and main().

◆ flash_write()

void flash_write | ( | uint32_t | write_addr,
 |  | uint16_t * | p_buffer,
 |  | uint16_t | num_write
 | ) |  |

write data using halfword mode with checking

Parameters
write_addr | the address of writing
p_buffer | the buffer of writing data
num_write | the number of writing data
Return values
none

Definition at line 83 of file project/at_start_f415/examples/flash/flash_write_read/src/flash.c.

Referenced by main().

◆ flash_write_nocheck()

void flash_write_nocheck | ( | uint32_t | write_addr,
 |  | uint16_t * | p_buffer,
 |  | uint16_t | num_write
 | ) |  |

write data using halfword mode without checking

Parameters
write_addr | the address of writing
p_buffer | the buffer of writing data
num_write | the number of writing data
Return values
none

Definition at line 66 of file project/at_start_f415/examples/flash/flash_write_read/src/flash.c.

Referenced by flash_write().


AT32F415 Firmwary Library: GPIO_led_toggle

Functions
GPIO_led_toggle
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/gpio/led_toggle/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c.


AT32F415 Firmwary Library: GPIO_swjtag_remap

Functions
GPIO_swjtag_remap
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | swj_dp_config (void)
configure the gpio of swj-dp. More...
void | gpio_pins_toggle (gpio_type *gpio_x, uint16_t gpio_pin)
toggles the specified gpio pin More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c.

◆ gpio_pins_toggle()

void gpio_pins_toggle | ( | gpio_type * | gpio_x,
 |  | uint16_t | gpio_pin
 | ) |  |

toggles the specified gpio pin

Parameters
gpiox | where x can be (a..g depending on device used) to select the gpio peripheral
gpio_pin | specifies the pins to be toggled.
Return values
none

Definition at line 70 of file project/at_start_f415/examples/gpio/swjtag_remap/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< full swj disabled (jtag-dp + sw-dp)

< full swj disabled (jtag-dp + sw-dp)

< gpio pins number 13

< gpio pins number 14

< gpio pins number 15

< gpio pins number 3

< gpio pins number 4

Definition at line 80 of file project/at_start_f415/examples/gpio/swjtag_remap/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c.

◆ swj_dp_config()

void swj_dp_config ( void )

configure the gpio of swj-dp.

Parameters
none
Return values
none

< gpio pins number 13

< gpio pins number 14

< gpio pins number 15

< gpio pins number 3

< gpio pins number 4

Definition at line 47 of file project/at_start_f415/examples/gpio/swjtag_remap/src/main.c.

Referenced by main().

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c.


AT32F415 Firmwary Library: I2C_communication_dma

Macros | Functions | Variables
I2C_communication_dma
AT32F415_periph_examples

Macros

#define | I2C_TIMEOUT 0xFFFFFFFF
#define | I2Cx_SPEED 100000
#define | I2Cx_ADDRESS 0xA0
#define | I2Cx_PORT I2C1
#define | I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
#define | I2Cx_SCL_PIN GPIO_PINS_6
#define | I2Cx_SCL_GPIO_PORT GPIOB
#define | I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SDA_PIN GPIO_PINS_7
#define | I2Cx_SDA_GPIO_PORT GPIOB
#define | I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_DMA_CLK CRM_DMA1_PERIPH_CLOCK
#define | I2Cx_DMA_TX_CHANNEL DMA1_CHANNEL6
#define | I2Cx_DMA_TX_IRQn DMA1_Channel6_IRQn
#define | I2Cx_DMA_RX_CHANNEL DMA1_CHANNEL7
#define | I2Cx_DMA_RX_IRQn DMA1_Channel7_IRQn
#define | I2Cx_EVT_IRQn I2C1_EVT_IRQn
#define | I2Cx_ERR_IRQn I2C1_ERR_IRQn
#define | BUF_SIZE 8
#define | MASTER_BOARD

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | DMA1_Channel7_IRQHandler (void)
this function handles dma interrupt request. More...
void | DMA1_Channel6_IRQHandler (void)
this function handles dma interrupt request. More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
void | error_handler (uint32_t error_code)
error handler program More...
int | main (void)
main function. More...

Variables

uint8_t | tx_buf [8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}
uint8_t | rx_buf [8] = {0}
i2c_handle_type hi2cx

Detailed Description

Macro Definition Documentation

◆ BUF_SIZE

#define BUF_SIZE 8

Definition at line 65 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2C_TIMEOUT

#define I2C_TIMEOUT 0xFFFFFFFF

Definition at line 39 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_ADDRESS

#define I2Cx_ADDRESS 0xA0

Definition at line 42 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_CLK

#define I2Cx_CLK CRM_I2C1_PERIPH_CLOCK

Definition at line 45 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_DMA_CLK

#define I2Cx_DMA_CLK CRM_DMA1_PERIPH_CLOCK

Definition at line 55 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_DMA_RX_CHANNEL

#define I2Cx_DMA_RX_CHANNEL DMA1_CHANNEL7

Definition at line 59 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_DMA_RX_IRQn

#define I2Cx_DMA_RX_IRQn DMA1_Channel7_IRQn

Definition at line 60 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_DMA_TX_CHANNEL

#define I2Cx_DMA_TX_CHANNEL DMA1_CHANNEL6

Definition at line 56 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_DMA_TX_IRQn

#define I2Cx_DMA_TX_IRQn DMA1_Channel6_IRQn

Definition at line 57 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_ERR_IRQn

#define I2Cx_ERR_IRQn I2C1_ERR_IRQn

Definition at line 63 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_EVT_IRQn

#define I2Cx_EVT_IRQn I2C1_EVT_IRQn

Definition at line 62 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_PORT

#define I2Cx_PORT I2C1

Definition at line 44 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_SCL_GPIO_CLK

#define I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 49 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_SCL_GPIO_PORT

#define I2Cx_SCL_GPIO_PORT GPIOB

Definition at line 48 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_SCL_PIN

#define I2Cx_SCL_PIN GPIO_PINS_6

Definition at line 47 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_SDA_GPIO_CLK

#define I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 53 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_SDA_GPIO_PORT

#define I2Cx_SDA_GPIO_PORT GPIOB

Definition at line 52 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_SDA_PIN

#define I2Cx_SDA_PIN GPIO_PINS_7

Definition at line 51 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ I2Cx_SPEED

#define I2Cx_SPEED 100000

Definition at line 41 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ MASTER_BOARD

#define MASTER_BOARD

Definition at line 66 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 86 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 121 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

◆ DMA1_Channel6_IRQHandler()

void DMA1_Channel6_IRQHandler ( void )

this function handles dma interrupt request.

Parameters
none
Return values
none

Definition at line 158 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

◆ DMA1_Channel7_IRQHandler()

void DMA1_Channel7_IRQHandler ( void )

this function handles dma interrupt request.

Parameters
none
Return values
none

Definition at line 148 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

◆ error_handler()

void error_handler ( uint32_t error_code )

error handler program

Parameters
i2c_status
Return values
none

Definition at line 81 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 60 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

◆ i2c_lowlevel_init()

void i2c_lowlevel_init ( i2c_handle_type * hi2c )

initializes peripherals used by the i2c.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 7

Definition at line 117 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 180 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 73 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 51 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 130 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 112 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 139 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 99 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

Variable Documentation

◆ hi2cx

i2c_handle_type hi2cx

Definition at line 71 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

Referenced by main().

◆ rx_buf

uint8_t rx_buf[8] = {0}

Definition at line 69 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

Referenced by main().

◆ tx_buf

uint8_t tx_buf[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}

Definition at line 68 of file project/at_start_f415/examples/i2c/communication_dma/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: I2C_communication_int

Macros | Functions | Variables
I2C_communication_int
AT32F415_periph_examples

Macros

#define | I2C_TIMEOUT 0xFFFFFFFF
#define | I2Cx_SPEED 100000
#define | I2Cx_ADDRESS 0xA0
#define | I2Cx_PORT I2C1
#define | I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
#define | I2Cx_SCL_PIN GPIO_PINS_6
#define | I2Cx_SCL_GPIO_PORT GPIOB
#define | I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SDA_PIN GPIO_PINS_7
#define | I2Cx_SDA_GPIO_PORT GPIOB
#define | I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_EVT_IRQn I2C1_EVT_IRQn
#define | I2Cx_ERR_IRQn I2C1_ERR_IRQn
#define | BUF_SIZE 8
#define | MASTER_BOARD

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | I2C1_EVT_IRQHandler (void)
this function handles i2c event interrupt request. More...
void | I2C1_ERR_IRQHandler (void)
this function handles i2c error interrupt request. More...
uint32_t | buffer_compare (uint8_t *buffer1, uint8_t *buffer2, uint32_t len)
compare whether the valus of buffer 1 and buffer 2 are equal. More...
void | error_handler (uint32_t error_code)
error handler program More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
int | main (void)
main function. More...

Variables

uint8_t | tx_buf [8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}
uint8_t | rx_buf [8] = {0}
i2c_handle_type hi2cx

Detailed Description

Macro Definition Documentation

◆ BUF_SIZE

#define BUF_SIZE 8

Definition at line 58 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ I2C_TIMEOUT

#define I2C_TIMEOUT 0xFFFFFFFF

Definition at line 39 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ I2Cx_ADDRESS

#define I2Cx_ADDRESS 0xA0

Definition at line 42 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ I2Cx_CLK

#define I2Cx_CLK CRM_I2C1_PERIPH_CLOCK

Definition at line 45 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ I2Cx_ERR_IRQn

#define I2Cx_ERR_IRQn I2C1_ERR_IRQn

Definition at line 56 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ I2Cx_EVT_IRQn

#define I2Cx_EVT_IRQn I2C1_EVT_IRQn

Definition at line 55 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ I2Cx_PORT

#define I2Cx_PORT I2C1

Definition at line 44 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ I2Cx_SCL_GPIO_CLK

#define I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 49 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ I2Cx_SCL_GPIO_PORT

#define I2Cx_SCL_GPIO_PORT GPIOB

Definition at line 48 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ I2Cx_SCL_PIN

#define I2Cx_SCL_PIN GPIO_PINS_6

Definition at line 47 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ I2Cx_SDA_GPIO_CLK

#define I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 53 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ I2Cx_SDA_GPIO_PORT

#define I2Cx_SDA_GPIO_PORT GPIOB

Definition at line 52 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ I2Cx_SDA_PIN

#define I2Cx_SDA_PIN GPIO_PINS_7

Definition at line 51 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ I2Cx_SPEED

#define I2Cx_SPEED 100000

Definition at line 41 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ MASTER_BOARD

#define MASTER_BOARD

Definition at line 59 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

Function Documentation

◆ buffer_compare()

uint32_t buffer_compare | ( | uint8_t * | buffer1,
 |  | uint8_t * | buffer2,
 |  | uint32_t | len
 | ) |  |

compare whether the valus of buffer 1 and buffer 2 are equal.

Parameters
buffer1 buffer 1 address. buffer2: buffer 2 address.
Return values
0 equal. 1: unequal.

Definition at line 91 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 84 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 119 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.

◆ error_handler()

void error_handler ( uint32_t error_code )

error handler program

Parameters
i2c_status
Return values
none

Definition at line 75 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 58 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.

◆ I2C1_ERR_IRQHandler()

void I2C1_ERR_IRQHandler ( void )

this function handles i2c error interrupt request.

Parameters
none
Return values
none

Definition at line 156 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.

◆ I2C1_EVT_IRQHandler()

void I2C1_EVT_IRQHandler ( void )

this function handles i2c event interrupt request.

Parameters
none
Return values
none

Definition at line 146 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.

◆ i2c_lowlevel_init()

void i2c_lowlevel_init ( i2c_handle_type * hi2c )

initializes peripherals used by the i2c.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 7

Definition at line 111 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 151 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 71 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 49 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 128 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 110 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 137 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 97 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.

Variable Documentation

◆ hi2cx

i2c_handle_type hi2cx

Definition at line 64 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

Referenced by main().

◆ rx_buf

uint8_t rx_buf[8] = {0}

Definition at line 62 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

Referenced by main().

◆ tx_buf

uint8_t tx_buf[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}

Definition at line 61 of file project/at_start_f415/examples/i2c/communication_int/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: I2C_communication_poll

Macros | Functions | Variables
I2C_communication_poll
AT32F415_periph_examples

Macros

#define | I2C_TIMEOUT 0xFFFFFFFF
#define | I2Cx_SPEED 100000
#define | I2Cx_ADDRESS 0xA0
#define | I2Cx_PORT I2C1
#define | I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
#define | I2Cx_SCL_PIN GPIO_PINS_6
#define | I2Cx_SCL_GPIO_PORT GPIOB
#define | I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SDA_PIN GPIO_PINS_7
#define | I2Cx_SDA_GPIO_PORT GPIOB
#define | I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | BUF_SIZE 8
#define | MASTER_BOARD

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | error_handler (uint32_t error_code)
error handler program More...
uint32_t | buffer_compare (uint8_t *buffer1, uint8_t *buffer2, uint32_t len)
compare whether the valus of buffer 1 and buffer 2 are equal. More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
int | main (void)
main function. More...

Variables

uint8_t | tx_buf [8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}
uint8_t | rx_buf [8] = {0}
i2c_handle_type hi2cx

Detailed Description

Macro Definition Documentation

◆ BUF_SIZE

#define BUF_SIZE 8

Definition at line 55 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ I2C_TIMEOUT

#define I2C_TIMEOUT 0xFFFFFFFF

Definition at line 39 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ I2Cx_ADDRESS

#define I2Cx_ADDRESS 0xA0

Definition at line 42 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ I2Cx_CLK

#define I2Cx_CLK CRM_I2C1_PERIPH_CLOCK

Definition at line 45 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ I2Cx_PORT

#define I2Cx_PORT I2C1

Definition at line 44 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ I2Cx_SCL_GPIO_CLK

#define I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 49 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ I2Cx_SCL_GPIO_PORT

#define I2Cx_SCL_GPIO_PORT GPIOB

Definition at line 48 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ I2Cx_SCL_PIN

#define I2Cx_SCL_PIN GPIO_PINS_6

Definition at line 47 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ I2Cx_SDA_GPIO_CLK

#define I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 53 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ I2Cx_SDA_GPIO_PORT

#define I2Cx_SDA_GPIO_PORT GPIOB

Definition at line 52 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ I2Cx_SDA_PIN

#define I2Cx_SDA_PIN GPIO_PINS_7

Definition at line 51 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ I2Cx_SPEED

#define I2Cx_SPEED 100000

Definition at line 41 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ MASTER_BOARD

#define MASTER_BOARD

Definition at line 56 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

Function Documentation

◆ buffer_compare()

uint32_t buffer_compare | ( | uint8_t * | buffer1,
 |  | uint8_t * | buffer2,
 |  | uint32_t | len
 | ) |  |

compare whether the valus of buffer 1 and buffer 2 are equal.

Parameters
buffer1 buffer 1 address. buffer2: buffer 2 address.
Return values
0 equal. 1: unequal.

Definition at line 88 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c.

◆ error_handler()

void error_handler ( uint32_t error_code )

error handler program

Parameters
i2c_status
Return values
none

Definition at line 72 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c.

◆ i2c_lowlevel_init()

void i2c_lowlevel_init ( i2c_handle_type * hi2c )

initializes peripherals used by the i2c.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 7

Definition at line 108 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 144 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c.

Variable Documentation

◆ hi2cx

i2c_handle_type hi2cx

Definition at line 61 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

Referenced by main().

◆ rx_buf

uint8_t rx_buf[8] = {0}

Definition at line 59 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

Referenced by main().

◆ tx_buf

uint8_t tx_buf[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}

Definition at line 58 of file project/at_start_f415/examples/i2c/communication_poll/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: I2C_eeprom

Macros | Functions | Variables
I2C_eeprom
AT32F415_periph_examples

Macros

#define | I2C_TIMEOUT 0xFFFFFFFF
#define | I2Cx_SPEED 100000
#define | I2Cx_ADDRESS 0xA0
#define | I2Cx_PORT I2C1
#define | I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
#define | I2Cx_SCL_PIN GPIO_PINS_6
#define | I2Cx_SCL_GPIO_PORT GPIOB
#define | I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SDA_PIN GPIO_PINS_7
#define | I2Cx_SDA_GPIO_PORT GPIOB
#define | I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_DMA_CLK CRM_DMA1_PERIPH_CLOCK
#define | I2Cx_DMA_TX_CHANNEL DMA1_CHANNEL6
#define | I2Cx_DMA_TX_IRQn DMA1_Channel6_IRQn
#define | I2Cx_DMA_RX_CHANNEL DMA1_CHANNEL7
#define | I2Cx_DMA_RX_IRQn DMA1_Channel7_IRQn
#define | I2Cx_EVT_IRQn I2C1_EVT_IRQn
#define | I2Cx_ERR_IRQn I2C1_ERR_IRQn
#define | BUF_SIZE 8

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | DMA1_Channel7_IRQHandler (void)
this function handles dma interrupt request. More...
void | DMA1_Channel6_IRQHandler (void)
this function handles dma interrupt request. More...
void | I2C1_EVT_IRQHandler (void)
this function handles i2c event interrupt request. More...
void | I2C1_ERR_IRQHandler (void)
this function handles i2c error interrupt request. More...
void | error_handler (uint32_t error_code)
error handler program More...
uint32_t | buffer_compare (uint8_t *buffer1, uint8_t *buffer2, uint32_t len)
compare whether the valus of buffer 1 and buffer 2 are equal. More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
int | main (void)
main function. More...

Variables

uint8_t | tx_buf1 [8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}
uint8_t | tx_buf2 [8] = {0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80}
uint8_t | tx_buf3 [8] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}
uint8_t | rx_buf1 [8] = {0}
uint8_t | rx_buf2 [8] = {0}
uint8_t | rx_buf3 [8] = {0}
i2c_handle_type hi2cx

Detailed Description

Macro Definition Documentation

◆ BUF_SIZE

#define BUF_SIZE 8

Definition at line 65 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2C_TIMEOUT

#define I2C_TIMEOUT 0xFFFFFFFF

Definition at line 39 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_ADDRESS

#define I2Cx_ADDRESS 0xA0

Definition at line 42 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_CLK

#define I2Cx_CLK CRM_I2C1_PERIPH_CLOCK

Definition at line 45 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_DMA_CLK

#define I2Cx_DMA_CLK CRM_DMA1_PERIPH_CLOCK

Definition at line 55 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_DMA_RX_CHANNEL

#define I2Cx_DMA_RX_CHANNEL DMA1_CHANNEL7

Definition at line 59 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_DMA_RX_IRQn

#define I2Cx_DMA_RX_IRQn DMA1_Channel7_IRQn

Definition at line 60 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_DMA_TX_CHANNEL

#define I2Cx_DMA_TX_CHANNEL DMA1_CHANNEL6

Definition at line 56 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_DMA_TX_IRQn

#define I2Cx_DMA_TX_IRQn DMA1_Channel6_IRQn

Definition at line 57 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_ERR_IRQn

#define I2Cx_ERR_IRQn I2C1_ERR_IRQn

Definition at line 63 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_EVT_IRQn

#define I2Cx_EVT_IRQn I2C1_EVT_IRQn

Definition at line 62 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_PORT

#define I2Cx_PORT I2C1

Definition at line 44 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_SCL_GPIO_CLK

#define I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 49 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_SCL_GPIO_PORT

#define I2Cx_SCL_GPIO_PORT GPIOB

Definition at line 48 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_SCL_PIN

#define I2Cx_SCL_PIN GPIO_PINS_6

Definition at line 47 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_SDA_GPIO_CLK

#define I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 53 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_SDA_GPIO_PORT

#define I2Cx_SDA_GPIO_PORT GPIOB

Definition at line 52 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_SDA_PIN

#define I2Cx_SDA_PIN GPIO_PINS_7

Definition at line 51 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ I2Cx_SPEED

#define I2Cx_SPEED 100000

Definition at line 41 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

Function Documentation

◆ buffer_compare()

uint32_t buffer_compare | ( | uint8_t * | buffer1,
 |  | uint8_t * | buffer2,
 |  | uint32_t | len
 | ) |  |

compare whether the valus of buffer 1 and buffer 2 are equal.

Parameters
buffer1 buffer 1 address. buffer2: buffer 2 address.
Return values
0 equal. 1: unequal.

Definition at line 101 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 86 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 121 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ DMA1_Channel6_IRQHandler()

void DMA1_Channel6_IRQHandler ( void )

this function handles dma interrupt request.

Parameters
none
Return values
none

Definition at line 158 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ DMA1_Channel7_IRQHandler()

void DMA1_Channel7_IRQHandler ( void )

this function handles dma interrupt request.

Parameters
none
Return values
none

Definition at line 148 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ error_handler()

void error_handler ( uint32_t error_code )

error handler program

Parameters
i2c_status
Return values
none

Definition at line 85 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 60 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ I2C1_ERR_IRQHandler()

void I2C1_ERR_IRQHandler ( void )

this function handles i2c error interrupt request.

Parameters
none
Return values
none

Definition at line 178 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ I2C1_EVT_IRQHandler()

void I2C1_EVT_IRQHandler ( void )

this function handles i2c event interrupt request.

Parameters
none
Return values
none

Definition at line 168 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ i2c_lowlevel_init()

void i2c_lowlevel_init ( i2c_handle_type * hi2c )

initializes peripherals used by the i2c.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 7

Definition at line 121 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 188 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 73 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 51 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 130 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 112 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 139 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 99 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

Variable Documentation

◆ hi2cx

i2c_handle_type hi2cx

Definition at line 74 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

Referenced by main().

◆ rx_buf1

uint8_t rx_buf1[8] = {0}

Definition at line 70 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

Referenced by main().

◆ rx_buf2

uint8_t rx_buf2[8] = {0}

Definition at line 71 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

Referenced by main().

◆ rx_buf3

uint8_t rx_buf3[8] = {0}

Definition at line 72 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

Referenced by main().

◆ tx_buf1

uint8_t tx_buf1[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}

Definition at line 67 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

Referenced by main().

◆ tx_buf2

uint8_t tx_buf2[8] = {0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80}

Definition at line 68 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

Referenced by main().

◆ tx_buf3

uint8_t tx_buf3[8] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}

Definition at line 69 of file project/at_start_f415/examples/i2c/eeprom/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: I2S_halfduplex_dma

Functions | Variables
I2S_halfduplex_dma
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static void | gpio_config (void)
gpio configuration. More...
static void | i2s_config (void)
i2s configuration. More...
error_status | buffer_compare (uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer_compare function. More...
int | main (void)
main function. More...

Variables

uint16_t | i2s1_buffer_tx [32]
uint16_t | i2s2_buffer_rx [32]
volatile error_status | transfer_status = ERROR

Detailed Description

Function Documentation

◆ buffer_compare()

error_status buffer_compare | ( | uint16_t * | pbuffer1,
 |  | uint16_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

buffer_compare function.

Parameters
none
Return values
the result of compare

Definition at line 58 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c.

◆ gpio_config()

static void gpio_config ( void )
static

gpio configuration.

Parameters
none
Return values
none

< gpio pins number 4

< gpio pins number 5

< gpio pins number 7

< gpio pins number 0

< gpio pins number 12

< gpio pins number 13

< gpio pins number 15

Definition at line 130 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c.

◆ i2s_config()

static void i2s_config ( void )
static

i2s configuration.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c.

Referenced by main().

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< dma1 channel4 full data transfer flag

Definition at line 186 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c.

Variable Documentation

◆ i2s1_buffer_tx

uint16_t i2s1_buffer_tx[32]
Initial value:
= {0x0102, 0x0304, 0x0506, 0x0708, 0x090A, 0x0B0C,
0x0D0E, 0x0F10, 0x1112, 0x1314, 0x1516, 0x1718,
0x191A, 0x1B1C, 0x1D1E, 0x1F20, 0x2122, 0x2324,
0x2526, 0x2728, 0x292A, 0x2B2C, 0x2D2E, 0x2F30,
0x3132, 0x3334, 0x3536, 0x3738, 0x393A, 0x3B3C,
0x3D3E, 0x3F40}

Definition at line 40 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c.

Referenced by i2s_config(), and main().

◆ i2s2_buffer_rx

uint16_t i2s2_buffer_rx[32]

Definition at line 46 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c.

Referenced by i2s_config(), and main().

◆ transfer_status

volatile error_status transfer_status = ERROR

Definition at line 47 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: I2S_halfduplex_interrupt

Functions | Variables
I2S_halfduplex_interrupt
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | SPI2_IRQHandler (void)
This function handles the spi2 interrupt request. More...
void | SPI1_IRQHandler (void)
This function handles the spi1 interrupt request. More...
static void | gpio_config (void)
gpio configuration. More...
static void | i2s_config (i2s_data_channel_format_type format, i2s_audio_sampling_freq_type freq)
i2s configuration. More...
error_status | buffer_compare (uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer_compare function. More...
error_status | buffer_compare_24bits (uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer_compare_24bits function. More...
int | main (void)
main function. More...

Variables

uint16_t | i2s1_buffer_tx [32]
uint16_t | i2s2_buffer_rx [32]
__IO uint32_t | tx_index = 0
__IO uint32_t | rx_index = 0
volatile error_status | transfer_status1 = ERROR
volatile error_status | transfer_status2 = ERROR

Detailed Description

Function Documentation

◆ buffer_compare()

error_status buffer_compare | ( | uint16_t * | pbuffer1,
 |  | uint16_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

buffer_compare function.

Parameters
none
Return values
the result of compare

Definition at line 59 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ buffer_compare_24bits()

error_status buffer_compare_24bits | ( | uint16_t * | pbuffer1,
 |  | uint16_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

buffer_compare_24bits function.

Parameters
none
Return values
the result of compare

Definition at line 79 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 83 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 118 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c.

◆ gpio_config()

static void gpio_config ( void )
static

gpio configuration.

Parameters
none
Return values
none

< gpio pins number 4

< gpio pins number 5

< gpio pins number 7

< gpio pins number 0

< gpio pins number 12

< gpio pins number 13

< gpio pins number 15

Definition at line 136 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 57 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c.

◆ i2s_config()

static void i2s_config | ( | i2s_data_channel_format_type | format,
 |  | i2s_audio_sampling_freq_type | freq
 | ) |  |
static

i2s configuration.

Parameters
none
Return values
none

< receive data buffer full interrupt

< transmit data buffer empty interrupt

Definition at line 102 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 192 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 70 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 48 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 127 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c.

◆ SPI1_IRQHandler()

void SPI1_IRQHandler ( void )

This function handles the spi1 interrupt request.

Parameters
None
Return values
None

< spi or i2s transmit data buffer empty flag

< transmit data buffer empty interrupt

Definition at line 159 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c.

◆ SPI2_IRQHandler()

void SPI2_IRQHandler ( void )

This function handles the spi2 interrupt request.

Parameters
None
Return values
None

< spi or i2s receive data buffer full flag

Definition at line 146 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 109 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 136 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 96 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c.

Variable Documentation

◆ i2s1_buffer_tx

uint16_t i2s1_buffer_tx[32]
Initial value:
= {0x0102, 0x0304, 0x0506, 0x0708, 0x090A, 0x0B0C,
0x0D0E, 0x0F10, 0x1112, 0x1314, 0x1516, 0x1718,
0x191A, 0x1B1C, 0x1D1E, 0x1F20, 0x2122, 0x2324,
0x2526, 0x2728, 0x292A, 0x2B2C, 0x2D2E, 0x2F30,
0x3132, 0x3334, 0x3536, 0x3738, 0x393A, 0x3B3C,
0x3D3E, 0x3F40}

Definition at line 39 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ i2s2_buffer_rx

uint16_t i2s2_buffer_rx[32]

Definition at line 45 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ rx_index

__IO uint32_t rx_index = 0

Definition at line 46 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ transfer_status1

volatile error_status transfer_status1 = ERROR

Definition at line 47 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ transfer_status2

volatile error_status transfer_status2 = ERROR

Definition at line 47 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ tx_index

__IO uint32_t tx_index = 0

Definition at line 46 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: I2S_spii2s_switch_halfduplex_polling

Functions | Variables
I2S_spii2s_switch_halfduplex_polling
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static void | gpio_config (void)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
static void | i2s_config (i2s_operation_mode_type i2s1_mode, i2s_operation_mode_type i2s2_mode)
i2s configuration. More...
error_status | buffer_compare (uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer_compare function. More...
int | main (void)
main function. More...

Variables

uint16_t | i2s1_buffer_tx [32]
uint16_t | SPI1_buffer_tx [32]
uint16_t | i2s2_buffer_rx [32]
uint16_t | spi2_buffer_rx [32]
__IO uint32_t | tx_index = 0
__IO uint32_t | rx_index = 0
volatile error_status | transfer_status1 = ERROR
volatile error_status | transfer_status2 = ERROR
volatile error_status | transfer_status3 = ERROR

Detailed Description

Function Documentation

◆ buffer_compare()

error_status buffer_compare | ( | uint16_t * | pbuffer1,
 |  | uint16_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

buffer_compare function.

Parameters
none
Return values
the result of compare

Definition at line 68 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c.

◆ gpio_config()

static void gpio_config ( void )
static

gpio configuration.

Parameters
none
Return values
none

< gpio pins number 4

< gpio pins number 5

< gpio pins number 7

< gpio pins number 0

< gpio pins number 12

< gpio pins number 13

< gpio pins number 15

Definition at line 147 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c.

◆ i2s_config()

static void i2s_config | ( | i2s_operation_mode_type | i2s1_mode,
 |  | i2s_operation_mode_type | i2s2_mode
 | ) |  |
static

i2s configuration.

Parameters
none
Return values
none

Definition at line 88 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

Referenced by main().

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< spi or i2s transmit data buffer empty flag

< spi or i2s receive data buffer full flag

< spi or i2s transmit data buffer empty flag

< spi or i2s receive data buffer full flag

< spi or i2s transmit data buffer empty flag

< spi or i2s receive data buffer full flag

< spi or i2s transmit data buffer empty flag

Definition at line 203 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c.

◆ spi_config()

static void spi_config ( void )
static

spi configuration.

Parameters
none
Return values
none

Definition at line 115 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

Referenced by main().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c.

Variable Documentation

◆ i2s1_buffer_tx

uint16_t i2s1_buffer_tx[32]
Initial value:
= {0x0102, 0x0304, 0x0506, 0x0708, 0x090A, 0x0B0C,
0x0D0E, 0x0F10, 0x1112, 0x1314, 0x1516, 0x1718,
0x191A, 0x1B1C, 0x1D1E, 0x1F20, 0x2122, 0x2324,
0x2526, 0x2728, 0x292A, 0x2B2C, 0x2D2E, 0x2F30,
0x3132, 0x3334, 0x3536, 0x3738, 0x393A, 0x3B3C,
0x3D3E, 0x3F40
}

Definition at line 39 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

Referenced by main(), and SPI1_IRQHandler().

◆ i2s2_buffer_rx

uint16_t i2s2_buffer_rx[32]

Definition at line 53 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

Referenced by main(), and SPI2_IRQHandler().

◆ rx_index

__IO uint32_t rx_index = 0

Definition at line 55 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

Referenced by main().

◆ SPI1_buffer_tx

uint16_t SPI1_buffer_tx[32]
Initial value:
= {0x5152, 0x5354, 0x5556, 0x5758, 0x595A, 0x5B5C,
0x5D5E, 0x5F60, 0x6162, 0x6364, 0x6566, 0x6768,
0x696A, 0x6B6C, 0x6D6E, 0x6F70, 0x7172, 0x7374,
0x7576, 0x7778, 0x797A, 0x7B7C, 0x7D7E, 0x7F80,
0x8182, 0x8384, 0x8586, 0x8788, 0x898A, 0x8B8C,
0x8D8E, 0x8F90
}

Definition at line 46 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

Referenced by main().

◆ spi2_buffer_rx

uint16_t spi2_buffer_rx[32]

Definition at line 54 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

Referenced by main().

◆ transfer_status1

volatile error_status transfer_status1 = ERROR

Definition at line 56 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

Referenced by main().

◆ transfer_status2

volatile error_status transfer_status2 = ERROR

Definition at line 56 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

Referenced by main().

◆ transfer_status3

volatile error_status transfer_status3 = ERROR

Definition at line 56 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

Referenced by main().

◆ tx_index

__IO uint32_t tx_index = 0

Definition at line 55 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: PWC_deepsleep_ertc_alarm

Functions
PWC_deepsleep_ertc_alarm
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | ERTCAlarm_IRQHandler (void)
this function handles the rtc alarm through exint line interrupt request. More...
void | ertc_config (void)
ertc configuration. More...
void | ertc_alarm_config (void)
ertc alarm configuration. More...
void | ertc_alarm_value_set (uint32_t alam_index)
ertc alarm value set. More...
void | system_clock_recover (void)
systemclock recover. More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 81 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 116 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c.

◆ ertc_alarm_config()

void ertc_alarm_config ( void )

ertc alarm configuration.

Parameters
none
Return values
none

< external interrupt line 17 connected to the rtc alarm event

< ertc alarm don't match date or week

< ertc alarm don't match hour

< ertc alarm don't match minute

< ertc alarm a interrupt

Definition at line 91 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c.

Referenced by main().

◆ ertc_alarm_value_set()

void ertc_alarm_value_set ( uint32_t alam_index )

ertc alarm value set.

Parameters
alam_index : ERTC Alarm Seconds value
Return values
none

Definition at line 122 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c.

Referenced by main().

◆ ertc_config()

void ertc_config ( void )

ertc configuration.

Parameters
none
Return values
none

< low speed external crystal stable flag

Definition at line 45 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c.

Referenced by main().

◆ ERTCAlarm_IRQHandler()

void ERTCAlarm_IRQHandler ( void )

this function handles the rtc alarm through exint line interrupt request.

Parameters
none
Return values
none

< ertc alarm clock a flag

< ertc alarm clock a flag

< external interrupt line 17 connected to the rtc alarm event

Definition at line 143 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 172 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 68 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 46 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 125 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 107 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c.

◆ system_clock_recover()

void system_clock_recover ( void )

systemclock recover.

Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 140 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c.

Referenced by main().

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 134 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 94 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c.


AT32F415 Firmwary Library: PWC_deepsleep_ertc_tamper

Functions
PWC_deepsleep_ertc_tamper
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TAMP_STAMP_IRQHandler (void)
this function handles the rtc alarm through exint line interrupt request. More...
void | ertc_config (void)
ertc configuration. More...
void | ertc_tamper_config (void)
ertc tamper configuration. More...
void | system_clock_recover (void)
systemclock recover. More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 81 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 116 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c.

◆ ertc_config()

void ertc_config ( void )

ertc configuration.

Parameters
none
Return values
none

< low speed external crystal stable flag

Definition at line 45 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c.

Referenced by main().

◆ ertc_tamper_config()

void ertc_tamper_config ( void )

ertc tamper configuration.

Parameters
none
Return values
none

< external interrupt line 21 connected to the rtc temper and timestamp event

< ertc tamper detection 1 flag

< ertc tamper interrupt

Definition at line 75 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 142 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 68 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 46 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 125 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 107 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c.

◆ system_clock_recover()

void system_clock_recover ( void )

systemclock recover.

Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 110 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c.

Referenced by main().

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 134 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c.

◆ TAMP_STAMP_IRQHandler()

void TAMP_STAMP_IRQHandler ( void )

this function handles the rtc alarm through exint line interrupt request.

Parameters
none
Return values
none

< ertc tamper detection 1 flag

< ertc tamper detection 1 flag

< external interrupt line 21 connected to the rtc temper and timestamp event

Definition at line 143 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 94 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c.


AT32F415 Firmwary Library: PWC_power_voltage_monitor

Functions
PWC_power_voltage_monitor
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | PVM_IRQHandler (void)
this function handles the power voltage monitoring output interrupt request. More...
void | pvm_exint_config (void)
power voltage monitor exint configuration. More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 81 of file project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 116 of file project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< external interrupt line 16 connected to the pvm output

< external interrupt line 16 connected to the pvm output

Definition at line 62 of file project/at_start_f415/examples/pwc/power_voltage_monitor/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 68 of file project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 46 of file project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 125 of file project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c.

◆ pvm_exint_config()

void pvm_exint_config ( void )

power voltage monitor exint configuration.

Parameters
none
Return values
none

< external interrupt line 16 connected to the pvm output

Definition at line 45 of file project/at_start_f415/examples/pwc/power_voltage_monitor/src/main.c.

Referenced by main().

◆ PVM_IRQHandler()

void PVM_IRQHandler ( void )

this function handles the power voltage monitoring output interrupt request.

Parameters
none
Return values
none

< external interrupt line 16 connected to the pvm output

< external interrupt line 16 connected to the pvm output

Definition at line 143 of file project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 107 of file project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 134 of file project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 94 of file project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c.


AT32F415 Firmwary Library: PWC_sleep_tmr2

Functions
PWC_sleep_tmr2
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR2_GLOBAL_IRQHandler (void)
this function handles the timer interrupt request. More...
void | tmr2_config (void)
tmr2 configuration. More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 80 of file project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 115 of file project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 54 of file project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 74 of file project/at_start_f415/examples/pwc/sleep_tmr2/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 67 of file project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 45 of file project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 124 of file project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 106 of file project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 133 of file project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c.

◆ tmr2_config()

void tmr2_config ( void )

tmr2 configuration.

Parameters
none
Return values
none

< tmr interrupt overflow

Definition at line 45 of file project/at_start_f415/examples/pwc/sleep_tmr2/src/main.c.

Referenced by main().

◆ TMR2_GLOBAL_IRQHandler()

void TMR2_GLOBAL_IRQHandler ( void )

this function handles the timer interrupt request.

Parameters
none
Return values
none

< tmr flag overflow

< tmr flag overflow

Definition at line 142 of file project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 93 of file project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c.


AT32F415 Firmwary Library: PWC_sleep_usart1

Functions | Variables
PWC_sleep_usart1
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | USART1_IRQHandler (void)
this function handles the usatt interrupt request. More...
void | usart1_config (uint32_t baudrate)
usart1 configuration. More...
int | main (void)
main function. More...

Variables

uint16_t usart1_index = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 82 of file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 117 of file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 56 of file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 85 of file project/at_start_f415/examples/pwc/sleep_usart1/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 69 of file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 47 of file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 126 of file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 108 of file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 135 of file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 95 of file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c.

◆ usart1_config()

void usart1_config ( uint32_t baudrate )

usart1 configuration.

Parameters
none
Return values
none

< gpio pins number 9

< gpio pins number 10

< usart receive data buffer full interrupt

Definition at line 43 of file project/at_start_f415/examples/pwc/sleep_usart1/src/main.c.

Referenced by main().

◆ USART1_IRQHandler()

void USART1_IRQHandler ( void )

this function handles the usatt interrupt request.

Parameters
none
Return values
none

< usart receive data buffer full flag

Definition at line 144 of file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c.

Variable Documentation

◆ usart1_index

uint16_t usart1_index = 0

Definition at line 41 of file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c.

Referenced by USART1_IRQHandler().


AT32F415 Firmwary Library: PWC_standby_ertc_alarm

Functions
PWC_standby_ertc_alarm
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | ertc_config (void)
ertc configuration. More...
void | ertc_alarm_config (void)
ertc alarm configuration. More...
void | ertc_alarm_value_set (uint32_t alam_index)
ertc alarm value set. More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 81 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 116 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c.

◆ ertc_alarm_config()

void ertc_alarm_config ( void )

ertc alarm configuration.

Parameters
none
Return values
none

< ertc alarm don't match date or week

< ertc alarm don't match hour

< ertc alarm don't match minute

< ertc alarm a interrupt

Definition at line 92 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c.

Referenced by main().

◆ ertc_alarm_value_set()

void ertc_alarm_value_set ( uint32_t alam_index )

ertc alarm value set.

Parameters
alam_index : ERTC Alarm Seconds value
Return values
none

Definition at line 107 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c.

Referenced by main().

◆ ertc_config()

void ertc_config ( void )

ertc configuration.

Parameters
none
Return values
none

< low speed external crystal stable flag

Definition at line 46 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< standby flag

< standby flag

< wakeup flag

< wakeup flag

Definition at line 125 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 68 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 46 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 125 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 107 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 134 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 94 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c.


AT32F415 Firmwary Library: PWC_standby_wakeup_pin

Functions
PWC_standby_wakeup_pin
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< standby flag

< standby flag

< wakeup flag

< wakeup flag

< standby wake-up pin1

Definition at line 44 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c.


AT32F415 Firmwary Library: SDIO_sd_mmc_card

Modules | Macros | Functions | Variables
SDIO_sd_mmc_card
AT32F415_periph_examples

Modules

SDIO_sd_mmc_card_instance_definition
SDIO_sd_mmc_card_exported_types
SDIO_sd_mmc_card_command_index_definition
SDIO_sd_mmc_card_paremeters_definition
SDIO_sd_mmc_card_response_definition
SDIO_sd_mmc_card_command_class_definition
SDIO_sd_mmc_card_cmd8_definition
SDIO_sd_mmc_card_mmc_extend_definition
SDIO_sd_mmc_card_interrupt_flags_definition
SDIO_sd_mmc_card_exported_functions

Macros

#define | BLOCK_SIZE (512)
#define | BLOCKS_NUMBER (8)
#define | MULTI_BUFFER_SIZE (BLOCK_SIZE * BLOCKS_NUMBER)
#define | STREAM_BUFFER_SIZE (1024)

Functions

sd_error_status_type | sd_init (void)
initializes the sd card and put it into standby state (ready for data transfer). More...
void | sdio_clock_set (uint32_t clk_div)
set sdio clock devision factor. More...
sd_error_status_type | sd_power_on (void)
enquires cards about their operating voltage and configures clock controls. More...
sd_error_status_type | sd_power_off (void)
turns the sdio output signals off. More...
sd_error_status_type | sd_card_init (void)
intialises all cards or single card as the case may be card(s) come into standby state. More...
sd_error_status_type | sd_card_info_get (sd_card_info_struct_type *card_info)
returns information about specific card. More...
sd_error_status_type | sd_wide_bus_operation_config (sdio_bus_width_type mode)
enable wide bus opeartion for the requeseted card if supported by card. More...
sd_error_status_type | sd_device_mode_set (uint32_t mode)
set sdio work mode. More...
sd_error_status_type | sd_deselect_select (uint32_t addr)
selects od deselects the corresponding card. More...
sd_error_status_type | sdio_command_data_send (sdio_command_struct_type *sdio_cmd_init_t, sdio_data_struct_type *sdio_data_init_t, uint32_t *buf)
read data from or write data to sd card. More...
sd_error_status_type | sd_blocks_erase (long long addr, uint32_t nblks)
erase continuous data block More...
sd_error_status_type | sd_block_read (uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
__align (4)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_block_write (const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_write (const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed by dma mode only. More...
sd_error_status_type | mmc_stream_read (uint8_t *buf, long long addr, uint32_t len)
read mmc card data stream. More...
sd_error_status_type | mmc_stream_write (uint8_t *buf, long long addr, uint32_t len)
write mmc card data stream. More...
void | SDIO1_IRQHandler (void)
sdio1 isr. More...
void | SDIO2_IRQHandler (void)
sdio2 isr. More...
sd_error_status_type | sd_irq_service (void)
allows to process all the interrupts that are high. More...
sd_error_status_type | sd_status_send (uint32_t *p_card_status)
read current card status. More...
sd_card_state_type | sd_state_get (void)
returns information about sd card. More...
void | sd_dma_config (uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
set dma configuation for sdio More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static error_status | sd_single_block_test (void)
sd card single block read/write test. More...
static error_status | sd_multiple_blocks_test (void)
sd card multiple blocks read/write test. More...
static void | sd_test_error (void)
LED2 on off every 300ms for sd test failed. More...
static void | nvic_configuration (void)
configures sdio1 irq channel. More...
static error_status | mmc_stream_test (void)
mmc card data stream read/write test. More...
void | show_card_info (void)
show sd/mmc card info. More...
int | main (void)
main function. More...

Variables

sd_card_info_struct_type sd_card_info
sdio_command_struct_type sdio_command_init_struct
sdio_data_struct_type sdio_data_init_struct
static sd_memory_card_type | card_type = SDIO_STD_CAPACITY_SD_CARD_V1_1
static uint32_t | csd_table [4]
static uint32_t | cid_table [4]
static uint32_t | rca = 0
static sd_data_transfer_mode_type | device_mode = SD_TRANSFER_POLLING_MODE
static uint8_t | stop_flag = 0
volatile sd_error_status_type | transfer_error = SD_OK
volatile uint8_t | transfer_end = 0
sd_card_info_struct_type sd_card_info
static uint8_t | sblock_tbuffer [(512)]
static uint8_t | sblock_rbuffer [(512)]
static uint8_t | mblock_tbuffer [((512) *(8))]
static uint8_t | mblock_rbuffer [((512) *(8))]
static uint8_t | stream_tbuffer [(1024)]
static uint8_t | stream_rbuffer [(1024)]

Detailed Description

Macro Definition Documentation

◆ BLOCK_SIZE

#define BLOCK_SIZE (512)

Definition at line 41 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

◆ BLOCKS_NUMBER

#define BLOCKS_NUMBER (8)

Definition at line 42 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

◆ MULTI_BUFFER_SIZE

#define MULTI_BUFFER_SIZE (BLOCK_SIZE * BLOCKS_NUMBER)

Definition at line 43 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

◆ STREAM_BUFFER_SIZE

#define STREAM_BUFFER_SIZE (1024)

Definition at line 44 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

Function Documentation

◆ __align()

__align ( 4 )

allows to read blocks from a specified address in a card. the data transfer can be managed by dma mode or polling mode.

Parameters
buf | pointer to the buffer that will contain the received data.
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
nblks | number of blocks to be read.
Return values
sd_error_status_type sd card error code.

Definition at line 1269 of file sd_mmc_card/src/at32_sdio.c.

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 273 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c.

◆ mmc_stream_read()

sd_error_status_type mmc_stream_read | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint32_t | len
 | ) |  |

read mmc card data stream.

Parameters
buf | buffer of saving data from mmc card
addr | start address of data from mmc card
len | data size
Return values
sd_error_status_type sd card error code.

Definition at line 1646 of file sd_mmc_card/src/at32_sdio.c.

◆ mmc_stream_test()

static error_status mmc_stream_test ( void )
static

mmc card data stream read/write test.

Parameters
none
Return values
ERROR fail. SUCCESS: success.

Definition at line 157 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

Referenced by main().

◆ mmc_stream_write()

sd_error_status_type mmc_stream_write | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint32_t | len
 | ) |  |

write mmc card data stream.

Parameters
buf | data that writing to mmc card
addr | start address mmc card
len | data size
Return values
sd_error_status_type sd card error code.

Definition at line 1693 of file sd_mmc_card/src/at32_sdio.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c.

◆ nvic_configuration()

static void nvic_configuration ( void )
static

configures sdio1 irq channel.

Parameters
none
Return values
none

Definition at line 238 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

Referenced by main().

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c.

◆ sd_block_read()

sd_error_status_type sd_block_read | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size
 | ) |  |

allows to read one block from a specified address in a card. the data transfer can be managed by dma mode or polling mode.

Parameters
buf | pointer to the buffer that will contain the received data
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
Return values
sd_error_status_type sd card error code.

Definition at line 1180 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_block_write()

sd_error_status_type sd_block_write | ( | const uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size
 | ) |  |

allows to write one block starting from a specified address in a card. the data transfer can be managed by dma mode or polling mode.

Parameters
buf | pointer to the buffer that contain the data to be transferred.
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
Return values
sd_error_status_type sd card error code.

Definition at line 1360 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_blocks_erase()

sd_error_status_type sd_blocks_erase | ( | long long | addr,
 |  | uint32_t | nblks
 | ) |  |

erase continuous data block

Parameters
addr | starting address
nblks | amount of erasing data block
Return values
sd_error_status_type sd card error code.

Definition at line 1022 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_card_info_get()

sd_error_status_type sd_card_info_get ( sd_card_info_struct_type * card_info )

returns information about specific card.

Parameters
card_info pointer to a sd_card_info_struct_type structure that contains all sd card information.
Return values
sd_error_status_type sd card error code.

Definition at line 524 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_card_init()

sd_error_status_type sd_card_init ( void )

intialises all cards or single card as the case may be card(s) come into standby state.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 409 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_deselect_select()

sd_error_status_type sd_deselect_select ( uint32_t addr )

selects od deselects the corresponding card.

Parameters
addr address of the card to be selected.
Return values
sd_error_status_type sd card error code.

Definition at line 799 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_device_mode_set()

sd_error_status_type sd_device_mode_set ( uint32_t mode )

set sdio work mode.

Parameters
mode parameter as following values:
  • SD_TRANSFER_POLLING_MODE: dma mode.
  • SD_TRANSFER_POLLING_MODE: polling mode.
Return values
sd_error_status_type sd card error code.

Definition at line 778 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_dma_config()

void sd_dma_config | ( | uint32_t * | mbuf,
 |  | uint32_t | buf_size,
 |  | dma_dir_type | dir
 | ) |  |

set dma configuation for sdio

Parameters
mbuf | buffer address
buf_size | transmission data size
dir | dma direction, it is DMA_DIR_MEMORY_TO_PERIPHERAL(writing data) or DMA_DIR_PERIPHERAL_TO_MEMORY(read data)
Return values
none

Definition at line 2699 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sdio_command_data_send().

◆ sd_init()

sd_error_status_type sd_init ( void )

initializes the sd card and put it into standby state (ready for data transfer).

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 71 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sdio_command_data_send().

◆ sd_irq_service()

sd_error_status_type sd_irq_service ( void )

allows to process all the interrupts that are high.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 1782 of file sd_mmc_card/src/at32_sdio.c.

Referenced by SDIO1_IRQHandler(), and SDIO2_IRQHandler().

◆ sd_mult_blocks_write()

sd_error_status_type sd_mult_blocks_write | ( | const uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size,
 |  | uint32_t | nblks
 | ) |  |

allows to write blocks starting from a specified address in a card. the data transfer can be managed by dma mode only.

Parameters
buf | pointer to the buffer that contain the data to be transferred.
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
nblks | number of blocks to be written.
Return values
sd_error_status_type sd card error code.

Definition at line 1482 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_multiple_blocks_test()

static error_status sd_multiple_blocks_test ( void )
static

sd card multiple blocks read/write test.

Parameters
none
Return values
ERROR fail. SUCCESS: success.

Definition at line 109 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

Referenced by main().

◆ sd_power_off()

sd_error_status_type sd_power_off ( void )

turns the sdio output signals off.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 395 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_power_on()

sd_error_status_type sd_power_on ( void )

enquires cards about their operating voltage and configures clock controls.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 189 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_single_block_test()

static error_status sd_single_block_test ( void )
static

sd card single block read/write test.

Parameters
none
Return values
ERROR fail. SUCCESS: success.

Definition at line 62 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

Referenced by main().

◆ sd_state_get()

sd_card_state_type sd_state_get ( void )

returns information about sd card.

Parameters
none.
Return values
sd_card_state_type sd card state code.

Definition at line 2482 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_status_send()

sd_error_status_type sd_status_send ( uint32_t * p_card_status )

read current card status.

Parameters
p_card_status card status.
Return values
sd_error_status_type sd card error code.

Definition at line 2445 of file sd_mmc_card/src/at32_sdio.c.

Referenced by mmc_switch(), sd_block_write(), sd_mult_blocks_write(), and sd_state_get().

◆ sd_test_error()

static void sd_test_error ( void )
static

LED2 on off every 300ms for sd test failed.

Parameters
none
Return values
none

Definition at line 225 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

Referenced by main().

◆ sd_wide_bus_operation_config()

sd_error_status_type sd_wide_bus_operation_config ( sdio_bus_width_type mode )

enable wide bus opeartion for the requeseted card if supported by card.

Parameters
mode specifies the sd card wide bus mode. this parameter can be one of the following values:
  • SDIO_BUS_WIDTH_D8: 8-bit data transfer (only for mmc)
  • SDIO_BUS_WIDTH_D4: 4-bit data transfer
  • SDIO_BUS_WIDTH_D1: 1-bit data transfer
Return values
sd_error_status_type sd card error code.

Definition at line 735 of file sd_mmc_card/src/at32_sdio.c.

◆ SDIO1_IRQHandler()

void SDIO1_IRQHandler ( void )

sdio1 isr.

Parameters
none.
Return values
none.

Definition at line 1762 of file sd_mmc_card/src/at32_sdio.c.

◆ SDIO2_IRQHandler()

void SDIO2_IRQHandler ( void )

sdio2 isr.

Parameters
none.
Return values
none.

Definition at line 1772 of file sd_mmc_card/src/at32_sdio.c.

◆ sdio_clock_set()

void sdio_clock_set ( uint32_t clk_div )

set sdio clock devision factor.

Parameters
clkdiv sdio_ck = ahbclk / (clkdiv+2)
Return values
none

Definition at line 174 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_init().

◆ sdio_command_data_send()

sd_error_status_type sdio_command_data_send | ( | sdio_command_struct_type * | sdio_cmd_init_t,
 |  | sdio_data_struct_type * | sdio_data_init_t,
 |  | uint32_t * | buf
 | ) |  |

read data from or write data to sd card.

Parameters
sdio_cmd_init_struct | pointer to sdio_command_struct_type structure.
sdio_data_init_struct | pointer to sdio_data_struct_type structure.
buf | pointer to data buffer read or write.
Return values
sd_error_status_type sd card error code.

Definition at line 822 of file sd_mmc_card/src/at32_sdio.c.

Referenced by __align(), mmc_stream_read(), mmc_stream_write(), sd_block_read(), sd_block_write(), sd_mult_blocks_write(), and sd_switch().

◆ show_card_info()

void show_card_info ( void )

show sd/mmc card info.

Parameters
none
Return values
none

Definition at line 249 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

Referenced by main().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c.

Variable Documentation

◆ card_type

sd_memory_card_type card_type = SDIO_STD_CAPACITY_SD_CARD_V1_1
static

Definition at line 41 of file sd_mmc_card/src/at32_sdio.c.

Referenced by __align(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_card_info_get(), sd_card_init(), sd_init(), sd_mult_blocks_write(), sd_power_on(), sd_wide_bus_operation_config(), and speed_change().

◆ cid_table

uint32_t cid_table[4]
static

Definition at line 42 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_card_info_get(), and sd_card_init().

◆ csd_table

uint32_t csd_table[4]
static

Definition at line 42 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_card_info_get(), and sd_card_init().

◆ device_mode

sd_data_transfer_mode_type device_mode = SD_TRANSFER_POLLING_MODE
static

Definition at line 43 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_device_mode_set(), and sdio_command_data_send().

◆ mblock_rbuffer

uint8_t mblock_rbuffer[((512) *(8))]
static

Definition at line 47 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

Referenced by sd_multiple_blocks_test().

◆ mblock_tbuffer

uint8_t mblock_tbuffer[((512) *(8))]
static

Definition at line 47 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

Referenced by sd_multiple_blocks_test().

◆ rca

uint32_t rca = 0
static

Definition at line 42 of file sd_mmc_card/src/at32_sdio.c.

Referenced by check_card_programming(), sd_card_info_get(), sd_card_init(), sd_mult_blocks_write(), and sd_status_send().

◆ sblock_rbuffer

uint8_t sblock_rbuffer[(512)]
static

Definition at line 46 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

Referenced by sd_single_block_test().

◆ sblock_tbuffer

uint8_t sblock_tbuffer[(512)]
static

Definition at line 46 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

Referenced by sd_single_block_test().

◆ sd_card_info [1/2]

sd_card_info_struct_type sd_card_info
extern

Definition at line 47 of file sd_mmc_card/src/at32_sdio.c.

Referenced by disk_ioctl(), main(), and show_card_info().

◆ sd_card_info [2/2]

sd_card_info_struct_type sd_card_info

Definition at line 47 of file sd_mmc_card/src/at32_sdio.c.

Referenced by scr_find(), sd_bus_wide_enable(), sd_init(), and speed_change().

◆ sdio_command_init_struct

sdio_command_struct_type sdio_command_init_struct

Definition at line 38 of file sd_mmc_card/src/at32_sdio.c.

Referenced by __align(), check_card_programming(), mmc_stream_read(), mmc_stream_write(), mmc_switch(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_bus_wide_enable(), sd_card_init(), sd_deselect_select(), sd_irq_service(), sd_mult_blocks_write(), sd_power_on(), sd_status_send(), and sd_switch().

◆ sdio_data_init_struct

sdio_data_struct_type sdio_data_init_struct

Definition at line 39 of file sd_mmc_card/src/at32_sdio.c.

Referenced by __align(), mmc_stream_read(), mmc_stream_write(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_mult_blocks_write(), and sd_switch().

◆ stop_flag

uint8_t stop_flag = 0
static

Definition at line 44 of file sd_mmc_card/src/at32_sdio.c.

Referenced by __align(), mmc_stream_read(), mmc_stream_write(), sd_block_read(), sd_block_write(), sd_irq_service(), sd_mult_blocks_write(), sd_switch(), and sdio_command_data_send().

◆ stream_rbuffer

uint8_t stream_rbuffer[(1024)]
static

Definition at line 48 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

Referenced by mmc_stream_test().

◆ stream_tbuffer

uint8_t stream_tbuffer[(1024)]
static

Definition at line 48 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.

Referenced by mmc_stream_test().

◆ transfer_end

volatile uint8_t transfer_end = 0

Definition at line 46 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_irq_service(), and sdio_command_data_send().

◆ transfer_error

volatile sd_error_status_type transfer_error = SD_OK

Definition at line 45 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_irq_service(), and sdio_command_data_send().


AT32F415 Firmwary Library: SDIO_sd_mmc_card_instance_definition

Macros
SDIO_sd_mmc_card_instance_definition
AT32F415_periph_examples » SDIO_sd_mmc_card

Macros

#define SDIOx SDIO1

Detailed Description

Macro Definition Documentation

◆ SDIOx

#define SDIOx SDIO1

Definition at line 51 of file sd_mmc_card/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sd_mmc_card_exported_types

Data Structures | Enumerations
SDIO_sd_mmc_card_exported_types
AT32F415_periph_examples » SDIO_sd_mmc_card

Data Structures

struct | sd_csd_struct_type
struct | sd_cid_struct_type
struct | sd_scr_struct_type
struct | sd_card_info_struct_type

Enumerations

enum sd_data_transfer_mode_type { SD_TRANSFER_POLLING_MODE = 0 , SD_TRANSFER_DMA_MODE = 1 , SD_TRANSFER_POLLING_MODE = 0 , SD_TRANSFER_DMA_MODE = 1 }
enum sd_error_status_type {
SD_CMD_FAIL = 1 , SD_DATA_FAIL = 2 , SD_CMD_RSP_TIMEOUT = 3 , SD_DATA_TIMEOUT = 4 ,
SD_TX_UNDERRUN = 5 , SD_RX_OVERRUN = 6 , SD_START_BIT_ERR = 7 , SD_CMD_OUT_OF_RANGE = 8 ,
SD_ADDR_MISALIGNED = 9 , SD_BLK_LEN_ERR = 10 , SD_ERASE_SEQ_ERR = 11 , SD_INVALID_ERASE_PARAM = 12 ,
SD_WR_PROTECT_VIOLATION = 13 , SD_LOCK_UNLOCK_FAILED = 14 , SD_CMD_CRC_FAILED = 15 , SD_ILLEGAL_CMD = 16 ,
SD_CARD_ECC_FAILED = 17 , SD_CARD_CONTROLLER_ERR = 18 , SD_GENERAL_UNKNOWN_ERROR = 19 , SD_STREAM_RD_UNDERRUN = 20 ,
SD_STREAM_WR_OVERRUN = 21 , SD_CID_CSD_OVERWRITE = 22 , SD_WP_ERASE_SKIP = 23 , SD_CARD_ECC_DISABLED = 24 ,
SD_ERASE_RESET = 25 , SD_AKE_SEQ_ERROR = 26 , SD_INVALID_VOLTRANGE = 27 , SD_ADDR_OUT_OF_RANGE = 28 ,
SD_SWITCH_ERROR = 29 , SD_SDIO_DISABLED = 30 , SD_SDIO_FUNC_BUSY = 31 , SD_SDIO_FUNC_FAILED = 32 ,
SD_SDIO_UNKNOWN_FUNC = 33 , SD_INTERNAL_ERROR , SD_NOT_CONFIGURED , SD_REQ_PENDING ,
SD_REQ_NOT_APPLICABLE , SD_INVALID_PARAMETER , SD_UNSUPPORTED_FEATURE , SD_UNSUPPORTED_HW ,
SD_ERROR , SD_OK = 0 , SD_CMD_FAIL = 1 , SD_DATA_FAIL = 2 ,
SD_CMD_RSP_TIMEOUT = 3 , SD_DATA_TIMEOUT = 4 , SD_TX_UNDERRUN = 5 , SD_RX_OVERRUN = 6 ,
SD_START_BIT_ERR = 7 , SD_CMD_OUT_OF_RANGE = 8 , SD_ADDR_MISALIGNED = 9 , SD_BLK_LEN_ERR = 10 ,
SD_ERASE_SEQ_ERR = 11 , SD_INVALID_ERASE_PARAM = 12 , SD_WR_PROTECT_VIOLATION = 13 , SD_LOCK_UNLOCK_FAILED = 14 ,
SD_CMD_CRC_FAILED = 15 , SD_ILLEGAL_CMD = 16 , SD_CARD_ECC_FAILED = 17 , SD_CARD_CONTROLLER_ERR = 18 ,
SD_GENERAL_UNKNOWN_ERROR = 19 , SD_STREAM_RD_UNDERRUN = 20 , SD_STREAM_WR_OVERRUN = 21 , SD_CID_CSD_OVERWRITE = 22 ,
SD_WP_ERASE_SKIP = 23 , SD_CARD_ECC_DISABLED = 24 , SD_ERASE_RESET = 25 , SD_AKE_SEQ_ERROR = 26 ,
SD_INVALID_VOLTRANGE = 27 , SD_ADDR_OUT_OF_RANGE = 28 , SD_SWITCH_ERROR = 29 , SD_SDIO_DISABLED = 30 ,
SD_SDIO_FUNC_BUSY = 31 , SD_SDIO_FUNC_FAILED = 32 , SD_SDIO_UNKNOWN_FUNC = 33 , SD_INTERNAL_ERROR ,
SD_NOT_CONFIGURED , SD_REQ_PENDING , SD_REQ_NOT_APPLICABLE , SD_INVALID_PARAMETER ,
SD_UNSUPPORTED_FEATURE , SD_UNSUPPORTED_HW , SD_ERROR , SD_OK = 0
}
enum sd_card_state_type {
SD_CARD_READY = ((uint32_t)0x00000001) , SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002) , SD_CARD_STANDBY = ((uint32_t)0x00000003) , SD_CARD_TRANSFER = ((uint32_t)0x00000004) ,
SD_CARD_SENDING = ((uint32_t)0x00000005) , SD_CARD_RECEIVING = ((uint32_t)0x00000006) , SD_CARD_PROGRAMMING = ((uint32_t)0x00000007) , SD_CARD_DISCONNECTED = ((uint32_t)0x00000008) ,
SD_CARD_ERROR = ((uint32_t)0x000000FF) , SD_CARD_READY = ((uint32_t)0x00000001) , SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002) , SD_CARD_STANDBY = ((uint32_t)0x00000003) ,
SD_CARD_TRANSFER = ((uint32_t)0x00000004) , SD_CARD_SENDING = ((uint32_t)0x00000005) , SD_CARD_RECEIVING = ((uint32_t)0x00000006) , SD_CARD_PROGRAMMING = ((uint32_t)0x00000007) ,
SD_CARD_DISCONNECTED = ((uint32_t)0x00000008) , SD_CARD_ERROR = ((uint32_t)0x000000FF)
}
enum sd_memory_card_type {
SDIO_STD_CAPACITY_SD_CARD_V1_1 = 0 , SDIO_STD_CAPACITY_SD_CARD_V2_0 = 1 , SDIO_HIGH_CAPACITY_SD_CARD = 2 , SDIO_MULTIMEDIA_CARD = 3 ,
SDIO_SECURE_DIGITAL_IO_CARD = 4 , SDIO_HIGH_SPEED_MULTIMEDIA_CARD = 5 , SDIO_SECURE_DIGITAL_IO_COMBO_CARD = 6 , SDIO_HIGH_CAPACITY_MMC_CARD = 7 ,
SDIO_SDIO_CARD = 8 , SDIO_STD_CAPACITY_SD_CARD_V1_1 = 0 , SDIO_STD_CAPACITY_SD_CARD_V2_0 = 1 , SDIO_HIGH_CAPACITY_SD_CARD = 2 ,
SDIO_MULTIMEDIA_CARD = 3 , SDIO_SECURE_DIGITAL_IO_CARD = 4 , SDIO_HIGH_SPEED_MULTIMEDIA_CARD = 5 , SDIO_SECURE_DIGITAL_IO_COMBO_CARD = 6 ,
SDIO_HIGH_CAPACITY_MMC_CARD = 7 , SDIO_SDIO_CARD = 8
}

Detailed Description

Enumeration Type Documentation

◆ sd_card_state_type

enum sd_card_state_type

sd card status

Enumerator
SD_CARD_READY
SD_CARD_IDENTIFICATION
SD_CARD_STANDBY
SD_CARD_TRANSFER
SD_CARD_SENDING
SD_CARD_RECEIVING
SD_CARD_PROGRAMMING
SD_CARD_DISCONNECTED
SD_CARD_ERROR
SD_CARD_READY
SD_CARD_IDENTIFICATION
SD_CARD_STANDBY
SD_CARD_TRANSFER
SD_CARD_SENDING
SD_CARD_RECEIVING
SD_CARD_PROGRAMMING
SD_CARD_DISCONNECTED
SD_CARD_ERROR

Definition at line 186 of file sd_mmc_card/inc/at32_sdio.h.

◆ sd_data_transfer_mode_type

enum sd_data_transfer_mode_type

sdio data transfer mode

Enumerator
SD_TRANSFER_POLLING_MODE
SD_TRANSFER_DMA_MODE
SD_TRANSFER_POLLING_MODE
SD_TRANSFER_DMA_MODE

Definition at line 64 of file sd_mmc_card/inc/at32_sdio.h.

◆ sd_error_status_type

enum sd_error_status_type

sdio error defines

Enumerator
SD_CMD_FAIL | command response received (but crc check failed)
SD_DATA_FAIL | data bock sent/received (crc check failed)
SD_CMD_RSP_TIMEOUT | command response timeout
SD_DATA_TIMEOUT | data time out
SD_TX_UNDERRUN | transmit fifo under-run
SD_RX_OVERRUN | receive fifo over-run
SD_START_BIT_ERR | start bit not detected on all data signals in wide bus mode
SD_CMD_OUT_OF_RANGE | cmd's argument was out of range.
SD_ADDR_MISALIGNED | misaligned address
SD_BLK_LEN_ERR | transferred block length is not allowed for the card or the number of transferred bytes does not match the block length
SD_ERASE_SEQ_ERR | an error in the sequence of erase command occurs.
SD_INVALID_ERASE_PARAM | an invalid selection for erase groups
SD_WR_PROTECT_VIOLATION | attempt to program a write protect block
SD_LOCK_UNLOCK_FAILED | sequence or password error has been detected in unlock command or if there was an attempt to access a locked card
SD_CMD_CRC_FAILED | crc check of the previous command failed
SD_ILLEGAL_CMD | command is not legal for the card state
SD_CARD_ECC_FAILED | card internal ecc was applied but failed to correct the data
SD_CARD_CONTROLLER_ERR | internal card controller error
SD_GENERAL_UNKNOWN_ERROR | general or unknown error
SD_STREAM_RD_UNDERRUN | the card could not sustain data transfer in stream read operation.
SD_STREAM_WR_OVERRUN | the card could not sustain data programming in stream mode
SD_CID_CSD_OVERWRITE | cid/csd overwrite error
SD_WP_ERASE_SKIP | only partial address space was erased
SD_CARD_ECC_DISABLED | command has been executed without using internal ecc
SD_ERASE_RESET | erase sequence was cleared before executing because an out of erase sequence command was received
SD_AKE_SEQ_ERROR | error in sequence of authentication.
SD_INVALID_VOLTRANGE | invalid voltage range
SD_ADDR_OUT_OF_RANGE | address out of range
SD_SWITCH_ERROR | switch error
SD_SDIO_DISABLED | sdio disabled
SD_SDIO_FUNC_BUSY | function busy
SD_SDIO_FUNC_FAILED | function failed
SD_SDIO_UNKNOWN_FUNC | unknown function
SD_INTERNAL_ERROR | internal error
SD_NOT_CONFIGURED | sdio doesn't configuration
SD_REQ_PENDING | request pending
SD_REQ_NOT_APPLICABLE | request isn't applicable
SD_INVALID_PARAMETER | invalid parameter
SD_UNSUPPORTED_FEATURE | unsupported feature
SD_UNSUPPORTED_HW | unsupported hardware
SD_ERROR | error
SD_OK | pass
SD_CMD_FAIL | command response received (but crc check failed)
SD_DATA_FAIL | data bock sent/received (crc check failed)
SD_CMD_RSP_TIMEOUT | command response timeout
SD_DATA_TIMEOUT | data time out
SD_TX_UNDERRUN | transmit fifo under-run
SD_RX_OVERRUN | receive fifo over-run
SD_START_BIT_ERR | start bit not detected on all data signals in wide bus mode
SD_CMD_OUT_OF_RANGE | cmd's argument was out of range.
SD_ADDR_MISALIGNED | misaligned address
SD_BLK_LEN_ERR | transferred block length is not allowed for the card or the number of transferred bytes does not match the block length
SD_ERASE_SEQ_ERR | an error in the sequence of erase command occurs.
SD_INVALID_ERASE_PARAM | an invalid selection for erase groups
SD_WR_PROTECT_VIOLATION | attempt to program a write protect block
SD_LOCK_UNLOCK_FAILED | sequence or password error has been detected in unlock command or if there was an attempt to access a locked card
SD_CMD_CRC_FAILED | crc check of the previous command failed
SD_ILLEGAL_CMD | command is not legal for the card state
SD_CARD_ECC_FAILED | card internal ecc was applied but failed to correct the data
SD_CARD_CONTROLLER_ERR | internal card controller error
SD_GENERAL_UNKNOWN_ERROR | general or unknown error
SD_STREAM_RD_UNDERRUN | the card could not sustain data transfer in stream read operation.
SD_STREAM_WR_OVERRUN | the card could not sustain data programming in stream mode
SD_CID_CSD_OVERWRITE | cid/csd overwrite error
SD_WP_ERASE_SKIP | only partial address space was erased
SD_CARD_ECC_DISABLED | command has been executed without using internal ecc
SD_ERASE_RESET | erase sequence was cleared before executing because an out of erase sequence command was received
SD_AKE_SEQ_ERROR | error in sequence of authentication.
SD_INVALID_VOLTRANGE | invalid voltage range
SD_ADDR_OUT_OF_RANGE | address out of range
SD_SWITCH_ERROR | switch error
SD_SDIO_DISABLED | sdio disabled
SD_SDIO_FUNC_BUSY | function busy
SD_SDIO_FUNC_FAILED | function failed
SD_SDIO_UNKNOWN_FUNC | unknown function
SD_INTERNAL_ERROR | internal error
SD_NOT_CONFIGURED | sdio doesn't configuration
SD_REQ_PENDING | request pending
SD_REQ_NOT_APPLICABLE | request isn't applicable
SD_INVALID_PARAMETER | invalid parameter
SD_UNSUPPORTED_FEATURE | unsupported feature
SD_UNSUPPORTED_HW | unsupported hardware
SD_ERROR | error
SD_OK | pass

Definition at line 73 of file sd_mmc_card/inc/at32_sdio.h.

◆ sd_memory_card_type

enum sd_memory_card_type

supported sd memory cards

Enumerator
SDIO_STD_CAPACITY_SD_CARD_V1_1
SDIO_STD_CAPACITY_SD_CARD_V2_0
SDIO_HIGH_CAPACITY_SD_CARD
SDIO_MULTIMEDIA_CARD
SDIO_SECURE_DIGITAL_IO_CARD
SDIO_HIGH_SPEED_MULTIMEDIA_CARD
SDIO_SECURE_DIGITAL_IO_COMBO_CARD
SDIO_HIGH_CAPACITY_MMC_CARD
SDIO_SDIO_CARD
SDIO_STD_CAPACITY_SD_CARD_V1_1
SDIO_STD_CAPACITY_SD_CARD_V2_0
SDIO_HIGH_CAPACITY_SD_CARD
SDIO_MULTIMEDIA_CARD
SDIO_SECURE_DIGITAL_IO_CARD
SDIO_HIGH_SPEED_MULTIMEDIA_CARD
SDIO_SECURE_DIGITAL_IO_COMBO_CARD
SDIO_HIGH_CAPACITY_MMC_CARD
SDIO_SDIO_CARD

Definition at line 202 of file sd_mmc_card/inc/at32_sdio.h.


AT32F415 Firmwary Library: sd_csd_struct_type Struct Reference

Data Fields
sd_csd_struct_type Struct Reference
AT32F415_periph_examples » SDIO_sd_mmc_card » SDIO_sd_mmc_card_exported_types | AT32F415_periph_examples » SDIO_sdio_fatfs » SDIO_sdio_fatfs_exported_types

#include <at32_sdio.h>

Data Fields

uint8_t | csd_struct
uint8_t | spec_version
uint8_t | reserved1
uint8_t | taac
uint8_t | nsac
uint8_t | max_bus_clk_freq
uint16_t | card_cmd_classes
uint8_t | max_read_blk_length
uint8_t | part_blk_read
uint8_t | write_blk_misalign
uint8_t | read_blk_misalign
uint8_t | dsr_implemented
uint8_t | reserved2
uint32_t | device_size
uint8_t | max_read_current_vdd_min
uint8_t | max_read_current_vdd_max
uint8_t | max_write_current_vdd_min
uint8_t | max_write_current_vdd_max
uint8_t | device_size_mult
uint8_t | erase_group_size
uint8_t | erase_group_size_mult
uint8_t | write_protect_group_size
uint8_t | write_protect_group_enable
uint8_t | manufacturer_default_ecc
uint8_t | write_speed_factor
uint8_t | max_write_blk_length
uint8_t | part_blk_write
uint8_t | reserved3
uint8_t | content_protect_app
uint8_t | file_format_group
uint8_t | copy_flag
uint8_t | permanent_write_protect
uint8_t | temp_write_protect
uint8_t | file_formart
uint8_t | ecc_code
uint8_t | csd_crc
uint8_t | reserved4

Detailed Description

card specific data: csd register

Definition at line 125 of file sd_mmc_card/inc/at32_sdio.h.

Field Documentation

◆ card_cmd_classes

uint16_t sd_csd_struct_type::card_cmd_classes

card command classes

Definition at line 133 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ content_protect_app

uint8_t sd_csd_struct_type::content_protect_app

content protection application

Definition at line 155 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ copy_flag

uint8_t sd_csd_struct_type::copy_flag

copy flag (otp)

Definition at line 157 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ csd_crc

uint8_t sd_csd_struct_type::csd_crc

csd crc

Definition at line 162 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ csd_struct

uint8_t sd_csd_struct_type::csd_struct

csd structure

Definition at line 127 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ device_size

uint32_t sd_csd_struct_type::device_size

device size

Definition at line 140 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get(), and show_card_info().

◆ device_size_mult

uint8_t sd_csd_struct_type::device_size_mult

device size multiplier

Definition at line 145 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ dsr_implemented

uint8_t sd_csd_struct_type::dsr_implemented

dsr implemented

Definition at line 138 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ ecc_code

uint8_t sd_csd_struct_type::ecc_code

ecc code

Definition at line 161 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ erase_group_size

uint8_t sd_csd_struct_type::erase_group_size

erase group size

Definition at line 146 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ erase_group_size_mult

uint8_t sd_csd_struct_type::erase_group_size_mult

erase group size multiplier

Definition at line 147 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ file_formart

uint8_t sd_csd_struct_type::file_formart

file format

Definition at line 160 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ file_format_group

uint8_t sd_csd_struct_type::file_format_group

file format group

Definition at line 156 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ manufacturer_default_ecc

uint8_t sd_csd_struct_type::manufacturer_default_ecc

manufacturer default ecc

Definition at line 150 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ max_bus_clk_freq

uint8_t sd_csd_struct_type::max_bus_clk_freq

max. bus clock frequency

Definition at line 132 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ max_read_blk_length

uint8_t sd_csd_struct_type::max_read_blk_length

max. read data block length

Definition at line 134 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ max_read_current_vdd_max

uint8_t sd_csd_struct_type::max_read_current_vdd_max

max. read current @ vdd max

Definition at line 142 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ max_read_current_vdd_min

uint8_t sd_csd_struct_type::max_read_current_vdd_min

max. read current @ vdd min

Definition at line 141 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ max_write_blk_length

uint8_t sd_csd_struct_type::max_write_blk_length

max. write data block length

Definition at line 152 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ max_write_current_vdd_max

uint8_t sd_csd_struct_type::max_write_current_vdd_max

max. write current @ vdd max

Definition at line 144 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ max_write_current_vdd_min

uint8_t sd_csd_struct_type::max_write_current_vdd_min

max. write current @ vdd min

Definition at line 143 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ nsac

uint8_t sd_csd_struct_type::nsac

data read access-time 2 in clk cycles

Definition at line 131 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ part_blk_read

uint8_t sd_csd_struct_type::part_blk_read

partial blocks for read allowed

Definition at line 135 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ part_blk_write

uint8_t sd_csd_struct_type::part_blk_write

partial blocks for write allowed

Definition at line 153 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ permanent_write_protect

uint8_t sd_csd_struct_type::permanent_write_protect

permanent write protection

Definition at line 158 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ read_blk_misalign

uint8_t sd_csd_struct_type::read_blk_misalign

read block misalignment

Definition at line 137 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ reserved1

uint8_t sd_csd_struct_type::reserved1

reserved

Definition at line 129 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ reserved2

uint8_t sd_csd_struct_type::reserved2

reserved

Definition at line 139 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ reserved3

uint8_t sd_csd_struct_type::reserved3

reserded

Definition at line 154 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ reserved4

uint8_t sd_csd_struct_type::reserved4

always

Definition at line 163 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ spec_version

uint8_t sd_csd_struct_type::spec_version

system specification version

Definition at line 128 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get(), and sd_init().

◆ taac

uint8_t sd_csd_struct_type::taac

data read access-time 1

Definition at line 130 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ temp_write_protect

uint8_t sd_csd_struct_type::temp_write_protect

temporary write protection

Definition at line 159 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ write_blk_misalign

uint8_t sd_csd_struct_type::write_blk_misalign

write block misalignment

Definition at line 136 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ write_protect_group_enable

uint8_t sd_csd_struct_type::write_protect_group_enable

write protect group enable

Definition at line 149 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ write_protect_group_size

uint8_t sd_csd_struct_type::write_protect_group_size

write protect group size

Definition at line 148 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ write_speed_factor

uint8_t sd_csd_struct_type::write_speed_factor

write speed factor

Definition at line 151 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

The documentation for this struct was generated from the following files:
  • sd_mmc_card/inc/at32_sdio.h
  • sdio_fatfs/inc/at32_sdio.h


AT32F415 Firmwary Library: sd_cid_struct_type Struct Reference

Data Fields
sd_cid_struct_type Struct Reference
AT32F415_periph_examples » SDIO_sd_mmc_card » SDIO_sd_mmc_card_exported_types | AT32F415_periph_examples » SDIO_sdio_fatfs » SDIO_sdio_fatfs_exported_types

#include <at32_sdio.h>

Data Fields

uint8_t | manufacturer_id
uint16_t | oem_app_id
uint32_t | product_name1
uint8_t | product_name2
uint8_t | product_reversion
uint32_t | product_sn
uint8_t | reserved1
uint16_t | manufact_date
uint8_t | cid_crc
uint8_t | reserved2

Detailed Description

card identification data: cid register

Definition at line 169 of file sd_mmc_card/inc/at32_sdio.h.

Field Documentation

◆ cid_crc

uint8_t sd_cid_struct_type::cid_crc

cid crc

Definition at line 179 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ manufact_date

uint16_t sd_cid_struct_type::manufact_date

manufacturing date

Definition at line 178 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ manufacturer_id

uint8_t sd_cid_struct_type::manufacturer_id

manufacturer id

Definition at line 171 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get(), and show_card_info().

◆ oem_app_id

uint16_t sd_cid_struct_type::oem_app_id

oem/application id

Definition at line 172 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ product_name1

uint32_t sd_cid_struct_type::product_name1

product name part1

Definition at line 173 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ product_name2

uint8_t sd_cid_struct_type::product_name2

product name part2

Definition at line 174 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ product_reversion

uint8_t sd_cid_struct_type::product_reversion

product revision

Definition at line 175 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ product_sn

uint32_t sd_cid_struct_type::product_sn

product serial number

Definition at line 176 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ reserved1

uint8_t sd_cid_struct_type::reserved1

reserved1

Definition at line 177 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

◆ reserved2

uint8_t sd_cid_struct_type::reserved2

always 1

Definition at line 180 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get().

The documentation for this struct was generated from the following files:
  • sd_mmc_card/inc/at32_sdio.h
  • sdio_fatfs/inc/at32_sdio.h


AT32F415 Firmwary Library: sd_scr_struct_type Struct Reference

Data Fields
sd_scr_struct_type Struct Reference
AT32F415_periph_examples » SDIO_sd_mmc_card » SDIO_sd_mmc_card_exported_types | AT32F415_periph_examples » SDIO_sdio_fatfs » SDIO_sdio_fatfs_exported_types

#include <at32_sdio.h>

Data Fields

uint32_t | sd_spec:4
uint32_t | scr_structure:4
uint32_t | sd_bus_width:4
uint32_t | sd_security:3
uint32_t | data_stat_after_erase:1
uint32_t | reserved1:7
uint32_t | sd_spec3:1
uint32_t | cmd20_support:1
uint32_t | cmd23_support:1
uint32_t | reserverd2:6
uint32_t | reserverd3

Detailed Description

sd card scr information

Definition at line 218 of file sd_mmc_card/inc/at32_sdio.h.

Field Documentation

◆ cmd20_support

uint32_t sd_scr_struct_type::cmd20_support

Definition at line 227 of file sd_mmc_card/inc/at32_sdio.h.

◆ cmd23_support

uint32_t sd_scr_struct_type::cmd23_support

Definition at line 228 of file sd_mmc_card/inc/at32_sdio.h.

◆ data_stat_after_erase

uint32_t sd_scr_struct_type::data_stat_after_erase

Definition at line 224 of file sd_mmc_card/inc/at32_sdio.h.

◆ reserved1

uint32_t sd_scr_struct_type::reserved1

Definition at line 225 of file sd_mmc_card/inc/at32_sdio.h.

◆ reserverd2

uint32_t sd_scr_struct_type::reserverd2

Definition at line 229 of file sd_mmc_card/inc/at32_sdio.h.

◆ reserverd3

uint32_t sd_scr_struct_type::reserverd3

Definition at line 230 of file sd_mmc_card/inc/at32_sdio.h.

◆ scr_structure

uint32_t sd_scr_struct_type::scr_structure

Definition at line 221 of file sd_mmc_card/inc/at32_sdio.h.

◆ sd_bus_width

uint32_t sd_scr_struct_type::sd_bus_width

Definition at line 222 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_bus_wide_enable().

◆ sd_security

uint32_t sd_scr_struct_type::sd_security

Definition at line 223 of file sd_mmc_card/inc/at32_sdio.h.

◆ sd_spec

uint32_t sd_scr_struct_type::sd_spec

Definition at line 220 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by speed_change().

◆ sd_spec3

uint32_t sd_scr_struct_type::sd_spec3

Definition at line 226 of file sd_mmc_card/inc/at32_sdio.h.

The documentation for this struct was generated from the following files:
  • sd_mmc_card/inc/at32_sdio.h
  • sdio_fatfs/inc/at32_sdio.h


AT32F415 Firmwary Library: sd_card_info_struct_type Struct Reference

Data Fields
sd_card_info_struct_type Struct Reference
AT32F415_periph_examples » SDIO_sd_mmc_card » SDIO_sd_mmc_card_exported_types | AT32F415_periph_examples » SDIO_sdio_fatfs » SDIO_sdio_fatfs_exported_types

#include <at32_sdio.h>

Data Fields

sd_csd_struct_type sd_csd_reg
sd_cid_struct_type sd_cid_reg
sd_scr_struct_type sd_scr_reg
long long | card_capacity
uint32_t | card_blk_size
uint16_t | rca
uint8_t | card_type

Detailed Description

sd card information

Definition at line 236 of file sd_mmc_card/inc/at32_sdio.h.

Field Documentation

◆ card_blk_size

uint32_t sd_card_info_struct_type::card_blk_size

Definition at line 242 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by disk_ioctl(), sd_card_info_get(), and show_card_info().

◆ card_capacity

long long sd_card_info_struct_type::card_capacity

Definition at line 241 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by disk_ioctl(), sd_card_info_get(), and show_card_info().

◆ card_type

uint8_t sd_card_info_struct_type::card_type

Definition at line 244 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by main(), sd_card_info_get(), sd_init(), and show_card_info().

◆ rca

uint16_t sd_card_info_struct_type::rca

Definition at line 243 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by scr_find(), sd_bus_wide_enable(), sd_card_info_get(), sd_init(), and show_card_info().

◆ sd_cid_reg

sd_cid_struct_type sd_card_info_struct_type::sd_cid_reg

Definition at line 239 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get(), and show_card_info().

◆ sd_csd_reg

sd_csd_struct_type sd_card_info_struct_type::sd_csd_reg

Definition at line 238 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by sd_card_info_get(), sd_init(), and show_card_info().

◆ sd_scr_reg

sd_scr_struct_type sd_card_info_struct_type::sd_scr_reg

Definition at line 240 of file sd_mmc_card/inc/at32_sdio.h.

Referenced by scr_find(), sd_bus_wide_enable(), and speed_change().

The documentation for this struct was generated from the following files:
  • sd_mmc_card/inc/at32_sdio.h
  • sdio_fatfs/inc/at32_sdio.h


AT32F415 Firmwary Library: SDIO_sdio_fatfs_exported_types

Data Structures | Enumerations
SDIO_sdio_fatfs_exported_types
AT32F415_periph_examples » SDIO_sdio_fatfs

Data Structures

struct | sd_csd_struct_type
struct | sd_cid_struct_type
struct | sd_scr_struct_type
struct | sd_card_info_struct_type

Enumerations

enum sd_data_transfer_mode_type { SD_TRANSFER_POLLING_MODE = 0 , SD_TRANSFER_DMA_MODE = 1 , SD_TRANSFER_POLLING_MODE = 0 , SD_TRANSFER_DMA_MODE = 1 }
enum sd_error_status_type {
SD_CMD_FAIL = 1 , SD_DATA_FAIL = 2 , SD_CMD_RSP_TIMEOUT = 3 , SD_DATA_TIMEOUT = 4 ,
SD_TX_UNDERRUN = 5 , SD_RX_OVERRUN = 6 , SD_START_BIT_ERR = 7 , SD_CMD_OUT_OF_RANGE = 8 ,
SD_ADDR_MISALIGNED = 9 , SD_BLK_LEN_ERR = 10 , SD_ERASE_SEQ_ERR = 11 , SD_INVALID_ERASE_PARAM = 12 ,
SD_WR_PROTECT_VIOLATION = 13 , SD_LOCK_UNLOCK_FAILED = 14 , SD_CMD_CRC_FAILED = 15 , SD_ILLEGAL_CMD = 16 ,
SD_CARD_ECC_FAILED = 17 , SD_CARD_CONTROLLER_ERR = 18 , SD_GENERAL_UNKNOWN_ERROR = 19 , SD_STREAM_RD_UNDERRUN = 20 ,
SD_STREAM_WR_OVERRUN = 21 , SD_CID_CSD_OVERWRITE = 22 , SD_WP_ERASE_SKIP = 23 , SD_CARD_ECC_DISABLED = 24 ,
SD_ERASE_RESET = 25 , SD_AKE_SEQ_ERROR = 26 , SD_INVALID_VOLTRANGE = 27 , SD_ADDR_OUT_OF_RANGE = 28 ,
SD_SWITCH_ERROR = 29 , SD_SDIO_DISABLED = 30 , SD_SDIO_FUNC_BUSY = 31 , SD_SDIO_FUNC_FAILED = 32 ,
SD_SDIO_UNKNOWN_FUNC = 33 , SD_INTERNAL_ERROR , SD_NOT_CONFIGURED , SD_REQ_PENDING ,
SD_REQ_NOT_APPLICABLE , SD_INVALID_PARAMETER , SD_UNSUPPORTED_FEATURE , SD_UNSUPPORTED_HW ,
SD_ERROR , SD_OK = 0 , SD_CMD_FAIL = 1 , SD_DATA_FAIL = 2 ,
SD_CMD_RSP_TIMEOUT = 3 , SD_DATA_TIMEOUT = 4 , SD_TX_UNDERRUN = 5 , SD_RX_OVERRUN = 6 ,
SD_START_BIT_ERR = 7 , SD_CMD_OUT_OF_RANGE = 8 , SD_ADDR_MISALIGNED = 9 , SD_BLK_LEN_ERR = 10 ,
SD_ERASE_SEQ_ERR = 11 , SD_INVALID_ERASE_PARAM = 12 , SD_WR_PROTECT_VIOLATION = 13 , SD_LOCK_UNLOCK_FAILED = 14 ,
SD_CMD_CRC_FAILED = 15 , SD_ILLEGAL_CMD = 16 , SD_CARD_ECC_FAILED = 17 , SD_CARD_CONTROLLER_ERR = 18 ,
SD_GENERAL_UNKNOWN_ERROR = 19 , SD_STREAM_RD_UNDERRUN = 20 , SD_STREAM_WR_OVERRUN = 21 , SD_CID_CSD_OVERWRITE = 22 ,
SD_WP_ERASE_SKIP = 23 , SD_CARD_ECC_DISABLED = 24 , SD_ERASE_RESET = 25 , SD_AKE_SEQ_ERROR = 26 ,
SD_INVALID_VOLTRANGE = 27 , SD_ADDR_OUT_OF_RANGE = 28 , SD_SWITCH_ERROR = 29 , SD_SDIO_DISABLED = 30 ,
SD_SDIO_FUNC_BUSY = 31 , SD_SDIO_FUNC_FAILED = 32 , SD_SDIO_UNKNOWN_FUNC = 33 , SD_INTERNAL_ERROR ,
SD_NOT_CONFIGURED , SD_REQ_PENDING , SD_REQ_NOT_APPLICABLE , SD_INVALID_PARAMETER ,
SD_UNSUPPORTED_FEATURE , SD_UNSUPPORTED_HW , SD_ERROR , SD_OK = 0
}
enum sd_card_state_type {
SD_CARD_READY = ((uint32_t)0x00000001) , SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002) , SD_CARD_STANDBY = ((uint32_t)0x00000003) , SD_CARD_TRANSFER = ((uint32_t)0x00000004) ,
SD_CARD_SENDING = ((uint32_t)0x00000005) , SD_CARD_RECEIVING = ((uint32_t)0x00000006) , SD_CARD_PROGRAMMING = ((uint32_t)0x00000007) , SD_CARD_DISCONNECTED = ((uint32_t)0x00000008) ,
SD_CARD_ERROR = ((uint32_t)0x000000FF) , SD_CARD_READY = ((uint32_t)0x00000001) , SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002) , SD_CARD_STANDBY = ((uint32_t)0x00000003) ,
SD_CARD_TRANSFER = ((uint32_t)0x00000004) , SD_CARD_SENDING = ((uint32_t)0x00000005) , SD_CARD_RECEIVING = ((uint32_t)0x00000006) , SD_CARD_PROGRAMMING = ((uint32_t)0x00000007) ,
SD_CARD_DISCONNECTED = ((uint32_t)0x00000008) , SD_CARD_ERROR = ((uint32_t)0x000000FF)
}
enum sd_memory_card_type {
SDIO_STD_CAPACITY_SD_CARD_V1_1 = 0 , SDIO_STD_CAPACITY_SD_CARD_V2_0 = 1 , SDIO_HIGH_CAPACITY_SD_CARD = 2 , SDIO_MULTIMEDIA_CARD = 3 ,
SDIO_SECURE_DIGITAL_IO_CARD = 4 , SDIO_HIGH_SPEED_MULTIMEDIA_CARD = 5 , SDIO_SECURE_DIGITAL_IO_COMBO_CARD = 6 , SDIO_HIGH_CAPACITY_MMC_CARD = 7 ,
SDIO_SDIO_CARD = 8 , SDIO_STD_CAPACITY_SD_CARD_V1_1 = 0 , SDIO_STD_CAPACITY_SD_CARD_V2_0 = 1 , SDIO_HIGH_CAPACITY_SD_CARD = 2 ,
SDIO_MULTIMEDIA_CARD = 3 , SDIO_SECURE_DIGITAL_IO_CARD = 4 , SDIO_HIGH_SPEED_MULTIMEDIA_CARD = 5 , SDIO_SECURE_DIGITAL_IO_COMBO_CARD = 6 ,
SDIO_HIGH_CAPACITY_MMC_CARD = 7 , SDIO_SDIO_CARD = 8
}

Detailed Description

Enumeration Type Documentation

◆ sd_card_state_type

enum sd_card_state_type

sd card status

Enumerator
SD_CARD_READY
SD_CARD_IDENTIFICATION
SD_CARD_STANDBY
SD_CARD_TRANSFER
SD_CARD_SENDING
SD_CARD_RECEIVING
SD_CARD_PROGRAMMING
SD_CARD_DISCONNECTED
SD_CARD_ERROR
SD_CARD_READY
SD_CARD_IDENTIFICATION
SD_CARD_STANDBY
SD_CARD_TRANSFER
SD_CARD_SENDING
SD_CARD_RECEIVING
SD_CARD_PROGRAMMING
SD_CARD_DISCONNECTED
SD_CARD_ERROR

Definition at line 186 of file sdio_fatfs/inc/at32_sdio.h.

◆ sd_data_transfer_mode_type

enum sd_data_transfer_mode_type

sdio data transfer mode

Enumerator
SD_TRANSFER_POLLING_MODE
SD_TRANSFER_DMA_MODE
SD_TRANSFER_POLLING_MODE
SD_TRANSFER_DMA_MODE

Definition at line 64 of file sdio_fatfs/inc/at32_sdio.h.

◆ sd_error_status_type

enum sd_error_status_type

sdio error defines

Enumerator
SD_CMD_FAIL | command response received (but crc check failed)
SD_DATA_FAIL | data bock sent/received (crc check failed)
SD_CMD_RSP_TIMEOUT | command response timeout
SD_DATA_TIMEOUT | data time out
SD_TX_UNDERRUN | transmit fifo under-run
SD_RX_OVERRUN | receive fifo over-run
SD_START_BIT_ERR | start bit not detected on all data signals in wide bus mode
SD_CMD_OUT_OF_RANGE | cmd's argument was out of range.
SD_ADDR_MISALIGNED | misaligned address
SD_BLK_LEN_ERR | transferred block length is not allowed for the card or the number of transferred bytes does not match the block length
SD_ERASE_SEQ_ERR | an error in the sequence of erase command occurs.
SD_INVALID_ERASE_PARAM | an invalid selection for erase groups
SD_WR_PROTECT_VIOLATION | attempt to program a write protect block
SD_LOCK_UNLOCK_FAILED | sequence or password error has been detected in unlock command or if there was an attempt to access a locked card
SD_CMD_CRC_FAILED | crc check of the previous command failed
SD_ILLEGAL_CMD | command is not legal for the card state
SD_CARD_ECC_FAILED | card internal ecc was applied but failed to correct the data
SD_CARD_CONTROLLER_ERR | internal card controller error
SD_GENERAL_UNKNOWN_ERROR | general or unknown error
SD_STREAM_RD_UNDERRUN | the card could not sustain data transfer in stream read operation.
SD_STREAM_WR_OVERRUN | the card could not sustain data programming in stream mode
SD_CID_CSD_OVERWRITE | cid/csd overwrite error
SD_WP_ERASE_SKIP | only partial address space was erased
SD_CARD_ECC_DISABLED | command has been executed without using internal ecc
SD_ERASE_RESET | erase sequence was cleared before executing because an out of erase sequence command was received
SD_AKE_SEQ_ERROR | error in sequence of authentication.
SD_INVALID_VOLTRANGE | invalid voltage range
SD_ADDR_OUT_OF_RANGE | address out of range
SD_SWITCH_ERROR | switch error
SD_SDIO_DISABLED | sdio disabled
SD_SDIO_FUNC_BUSY | function busy
SD_SDIO_FUNC_FAILED | function failed
SD_SDIO_UNKNOWN_FUNC | unknown function
SD_INTERNAL_ERROR | internal error
SD_NOT_CONFIGURED | sdio doesn't configuration
SD_REQ_PENDING | request pending
SD_REQ_NOT_APPLICABLE | request isn't applicable
SD_INVALID_PARAMETER | invalid parameter
SD_UNSUPPORTED_FEATURE | unsupported feature
SD_UNSUPPORTED_HW | unsupported hardware
SD_ERROR | error
SD_OK | pass
SD_CMD_FAIL | command response received (but crc check failed)
SD_DATA_FAIL | data bock sent/received (crc check failed)
SD_CMD_RSP_TIMEOUT | command response timeout
SD_DATA_TIMEOUT | data time out
SD_TX_UNDERRUN | transmit fifo under-run
SD_RX_OVERRUN | receive fifo over-run
SD_START_BIT_ERR | start bit not detected on all data signals in wide bus mode
SD_CMD_OUT_OF_RANGE | cmd's argument was out of range.
SD_ADDR_MISALIGNED | misaligned address
SD_BLK_LEN_ERR | transferred block length is not allowed for the card or the number of transferred bytes does not match the block length
SD_ERASE_SEQ_ERR | an error in the sequence of erase command occurs.
SD_INVALID_ERASE_PARAM | an invalid selection for erase groups
SD_WR_PROTECT_VIOLATION | attempt to program a write protect block
SD_LOCK_UNLOCK_FAILED | sequence or password error has been detected in unlock command or if there was an attempt to access a locked card
SD_CMD_CRC_FAILED | crc check of the previous command failed
SD_ILLEGAL_CMD | command is not legal for the card state
SD_CARD_ECC_FAILED | card internal ecc was applied but failed to correct the data
SD_CARD_CONTROLLER_ERR | internal card controller error
SD_GENERAL_UNKNOWN_ERROR | general or unknown error
SD_STREAM_RD_UNDERRUN | the card could not sustain data transfer in stream read operation.
SD_STREAM_WR_OVERRUN | the card could not sustain data programming in stream mode
SD_CID_CSD_OVERWRITE | cid/csd overwrite error
SD_WP_ERASE_SKIP | only partial address space was erased
SD_CARD_ECC_DISABLED | command has been executed without using internal ecc
SD_ERASE_RESET | erase sequence was cleared before executing because an out of erase sequence command was received
SD_AKE_SEQ_ERROR | error in sequence of authentication.
SD_INVALID_VOLTRANGE | invalid voltage range
SD_ADDR_OUT_OF_RANGE | address out of range
SD_SWITCH_ERROR | switch error
SD_SDIO_DISABLED | sdio disabled
SD_SDIO_FUNC_BUSY | function busy
SD_SDIO_FUNC_FAILED | function failed
SD_SDIO_UNKNOWN_FUNC | unknown function
SD_INTERNAL_ERROR | internal error
SD_NOT_CONFIGURED | sdio doesn't configuration
SD_REQ_PENDING | request pending
SD_REQ_NOT_APPLICABLE | request isn't applicable
SD_INVALID_PARAMETER | invalid parameter
SD_UNSUPPORTED_FEATURE | unsupported feature
SD_UNSUPPORTED_HW | unsupported hardware
SD_ERROR | error
SD_OK | pass

Definition at line 73 of file sdio_fatfs/inc/at32_sdio.h.

◆ sd_memory_card_type

enum sd_memory_card_type

supported sd memory cards

Enumerator
SDIO_STD_CAPACITY_SD_CARD_V1_1
SDIO_STD_CAPACITY_SD_CARD_V2_0
SDIO_HIGH_CAPACITY_SD_CARD
SDIO_MULTIMEDIA_CARD
SDIO_SECURE_DIGITAL_IO_CARD
SDIO_HIGH_SPEED_MULTIMEDIA_CARD
SDIO_SECURE_DIGITAL_IO_COMBO_CARD
SDIO_HIGH_CAPACITY_MMC_CARD
SDIO_SDIO_CARD
SDIO_STD_CAPACITY_SD_CARD_V1_1
SDIO_STD_CAPACITY_SD_CARD_V2_0
SDIO_HIGH_CAPACITY_SD_CARD
SDIO_MULTIMEDIA_CARD
SDIO_SECURE_DIGITAL_IO_CARD
SDIO_HIGH_SPEED_MULTIMEDIA_CARD
SDIO_SECURE_DIGITAL_IO_COMBO_CARD
SDIO_HIGH_CAPACITY_MMC_CARD
SDIO_SDIO_CARD

Definition at line 202 of file sdio_fatfs/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sd_mmc_card_command_index_definition

Macros
SDIO_sd_mmc_card_command_index_definition
AT32F415_periph_examples » SDIO_sd_mmc_card

Macros

#define | SD_CMD_GO_IDLE_STATE ((uint8_t)0)
#define | SD_CMD_SEND_OP_COND ((uint8_t)1)
#define | SD_CMD_ALL_SEND_CID ((uint8_t)2)
#define | SD_CMD_SET_REL_ADDR ((uint8_t)3)
#define | SD_CMD_SET_DSR ((uint8_t)4)
#define | SD_CMD_SDIO_SEN_OP_COND ((uint8_t)5)
#define | SD_CMD_HS_SWITCH ((uint8_t)6)
#define | SD_CMD_SEL_DESEL_CARD ((uint8_t)7)
#define | SD_CMD_HS_SEND_EXT_CSD ((uint8_t)8)
#define | SD_CMD_SEND_CSD ((uint8_t)9)
#define | SD_CMD_SEND_CID ((uint8_t)10)
#define | SD_CMD_READ_DAT_UNTIL_STOP ((uint8_t)11)
#define | SD_CMD_STOP_TRANSMISSION ((uint8_t)12)
#define | SD_CMD_SEND_STATUS ((uint8_t)13)
#define | SD_CMD_HS_BUSTEST_READ ((uint8_t)14)
#define | SD_CMD_GO_INACTIVE_STATE ((uint8_t)15)
#define | SD_CMD_SET_BLOCKLEN ((uint8_t)16)
#define | SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17)
#define | SD_CMD_READ_MULT_BLOCK ((uint8_t)18)
#define | SD_CMD_HS_BUSTEST_WRITE ((uint8_t)19)
#define | SD_CMD_WRITE_DAT_UNTIL_STOP ((uint8_t)20)
#define | SD_CMD_SET_BLOCK_COUNT ((uint8_t)23)
#define | SD_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24)
#define | SD_CMD_WRITE_MULT_BLOCK ((uint8_t)25)
#define | SD_CMD_PROG_CID ((uint8_t)26)
#define | SD_CMD_PROG_CSD ((uint8_t)27)
#define | SD_CMD_SET_WRITE_PROT ((uint8_t)28)
#define | SD_CMD_CLR_WRITE_PROT ((uint8_t)29)
#define | SD_CMD_SEND_WRITE_PROT ((uint8_t)30)
#define | SD_CMD_SD_ERASE_GRP_START ((uint8_t)32)
#define | SD_CMD_SD_ERASE_GRP_END ((uint8_t)33)
#define | SD_CMD_ERASE_GRP_START ((uint8_t)35)
#define | SD_CMD_ERASE_GRP_END ((uint8_t)36)
#define | SD_CMD_ERASE ((uint8_t)38)
#define | SD_CMD_FAST_IO ((uint8_t)39)
#define | SD_CMD_GO_IRQ_STATE ((uint8_t)40)
#define | SD_CMD_LOCK_UNLOCK ((uint8_t)42)
#define | SD_CMD_APP_CMD ((uint8_t)55)
#define | SD_CMD_GEN_CMD ((uint8_t)56)
#define | SD_CMD_NO_CMD ((uint8_t)64)
#define | SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6)
#define | SD_CMD_SD_APP_STAUS ((uint8_t)13)
#define | SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22)
#define | SD_CMD_SD_APP_OP_COND ((uint8_t)41)
#define | SD_CMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42)
#define | SD_CMD_SD_APP_SEND_SCR ((uint8_t)51)
#define | SD_CMD_SDIO_RW_DIRECT ((uint8_t)52)
#define | SD_CMD_SDIO_RW_EXTENDED ((uint8_t)53)
#define | SD_CMD_SD_APP_GET_MKB ((uint8_t)43)
#define | SD_CMD_SD_APP_GET_MID ((uint8_t)44)
#define | SD_CMD_SD_APP_SET_CER_RN1 ((uint8_t)45)
#define | SD_CMD_SD_APP_GET_CER_RN2 ((uint8_t)46)
#define | SD_CMD_SD_APP_SET_CER_RES2 ((uint8_t)47)
#define | SD_CMD_SD_APP_GET_CER_RES1 ((uint8_t)48)
#define | SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK ((uint8_t)18)
#define | SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK ((uint8_t)25)
#define | SD_CMD_SD_APP_SECURE_ERASE ((uint8_t)38)
#define | SD_CMD_SD_APP_CHANGE_SECURE_AREA ((uint8_t)49)
#define | SD_CMD_SD_APP_SECURE_WRITE_MKB ((uint8_t)48)

Detailed Description

Macro Definition Documentation

◆ SD_CMD_ALL_SEND_CID

#define SD_CMD_ALL_SEND_CID ((uint8_t)2)

Definition at line 260 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_APP_CMD

#define SD_CMD_APP_CMD ((uint8_t)55)

Definition at line 295 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_APP_SD_SET_BUSWIDTH

#define SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6)

following commands are sd card specific commands. should be sent before sending these commands.

Definition at line 303 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_CLR_WRITE_PROT

#define SD_CMD_CLR_WRITE_PROT ((uint8_t)29)

Definition at line 285 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_ERASE

#define SD_CMD_ERASE ((uint8_t)38)

Definition at line 291 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_ERASE_GRP_END

#define SD_CMD_ERASE_GRP_END ((uint8_t)36)

Definition at line 290 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_ERASE_GRP_START

#define SD_CMD_ERASE_GRP_START ((uint8_t)35)

Definition at line 289 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_FAST_IO

#define SD_CMD_FAST_IO ((uint8_t)39)

Definition at line 292 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_GEN_CMD

#define SD_CMD_GEN_CMD ((uint8_t)56)

Definition at line 296 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_GO_IDLE_STATE

#define SD_CMD_GO_IDLE_STATE ((uint8_t)0)

sdio commands index

Definition at line 258 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_GO_INACTIVE_STATE

#define SD_CMD_GO_INACTIVE_STATE ((uint8_t)15)

Definition at line 273 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_GO_IRQ_STATE

#define SD_CMD_GO_IRQ_STATE ((uint8_t)40)

Definition at line 293 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_HS_BUSTEST_READ

#define SD_CMD_HS_BUSTEST_READ ((uint8_t)14)

Definition at line 272 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_HS_BUSTEST_WRITE

#define SD_CMD_HS_BUSTEST_WRITE ((uint8_t)19)

Definition at line 277 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_HS_SEND_EXT_CSD

#define SD_CMD_HS_SEND_EXT_CSD ((uint8_t)8)

Definition at line 266 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_HS_SWITCH

#define SD_CMD_HS_SWITCH ((uint8_t)6)

Definition at line 264 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_LOCK_UNLOCK

#define SD_CMD_LOCK_UNLOCK ((uint8_t)42)

Definition at line 294 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_NO_CMD

#define SD_CMD_NO_CMD ((uint8_t)64)

Definition at line 297 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_PROG_CID

#define SD_CMD_PROG_CID ((uint8_t)26)

Definition at line 282 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_PROG_CSD

#define SD_CMD_PROG_CSD ((uint8_t)27)

Definition at line 283 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_READ_DAT_UNTIL_STOP

#define SD_CMD_READ_DAT_UNTIL_STOP ((uint8_t)11)

Definition at line 269 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_READ_MULT_BLOCK

#define SD_CMD_READ_MULT_BLOCK ((uint8_t)18)

Definition at line 276 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_READ_SINGLE_BLOCK

#define SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17)

Definition at line 275 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_CHANGE_SECURE_AREA

#define SD_CMD_SD_APP_CHANGE_SECURE_AREA ((uint8_t)49)

Definition at line 325 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_GET_CER_RES1

#define SD_CMD_SD_APP_GET_CER_RES1 ((uint8_t)48)

Definition at line 321 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_GET_CER_RN2

#define SD_CMD_SD_APP_GET_CER_RN2 ((uint8_t)46)

Definition at line 319 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_GET_MID

#define SD_CMD_SD_APP_GET_MID ((uint8_t)44)

Definition at line 317 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_GET_MKB

#define SD_CMD_SD_APP_GET_MKB ((uint8_t)43)

following commands are sd card specific security commands. sdio_app_cmd should be sent before sending these commands.

Definition at line 316 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_OP_COND

#define SD_CMD_SD_APP_OP_COND ((uint8_t)41)

Definition at line 306 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SECURE_ERASE

#define SD_CMD_SD_APP_SECURE_ERASE ((uint8_t)38)

Definition at line 324 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK

#define SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK ((uint8_t)18)

Definition at line 322 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SECURE_WRITE_MKB

#define SD_CMD_SD_APP_SECURE_WRITE_MKB ((uint8_t)48)

Definition at line 326 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK

#define SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK ((uint8_t)25)

Definition at line 323 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS

#define SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22)

Definition at line 305 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SEND_SCR

#define SD_CMD_SD_APP_SEND_SCR ((uint8_t)51)

Definition at line 308 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SET_CER_RES2

#define SD_CMD_SD_APP_SET_CER_RES2 ((uint8_t)47)

Definition at line 320 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SET_CER_RN1

#define SD_CMD_SD_APP_SET_CER_RN1 ((uint8_t)45)

Definition at line 318 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SET_CLR_CARD_DETECT

#define SD_CMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42)

Definition at line 307 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_STAUS

#define SD_CMD_SD_APP_STAUS ((uint8_t)13)

Definition at line 304 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_ERASE_GRP_END

#define SD_CMD_SD_ERASE_GRP_END ((uint8_t)33)

Definition at line 288 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SD_ERASE_GRP_START

#define SD_CMD_SD_ERASE_GRP_START ((uint8_t)32)

Definition at line 287 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SDIO_RW_DIRECT

#define SD_CMD_SDIO_RW_DIRECT ((uint8_t)52)

Definition at line 309 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SDIO_RW_EXTENDED

#define SD_CMD_SDIO_RW_EXTENDED ((uint8_t)53)

Definition at line 310 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SDIO_SEN_OP_COND

#define SD_CMD_SDIO_SEN_OP_COND ((uint8_t)5)

Definition at line 263 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SEL_DESEL_CARD

#define SD_CMD_SEL_DESEL_CARD ((uint8_t)7)

Definition at line 265 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SEND_CID

#define SD_CMD_SEND_CID ((uint8_t)10)

Definition at line 268 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SEND_CSD

#define SD_CMD_SEND_CSD ((uint8_t)9)

Definition at line 267 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SEND_OP_COND

#define SD_CMD_SEND_OP_COND ((uint8_t)1)

Definition at line 259 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SEND_STATUS

#define SD_CMD_SEND_STATUS ((uint8_t)13)

Definition at line 271 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SEND_WRITE_PROT

#define SD_CMD_SEND_WRITE_PROT ((uint8_t)30)

Definition at line 286 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SET_BLOCK_COUNT

#define SD_CMD_SET_BLOCK_COUNT ((uint8_t)23)

Definition at line 279 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SET_BLOCKLEN

#define SD_CMD_SET_BLOCKLEN ((uint8_t)16)

Definition at line 274 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SET_DSR

#define SD_CMD_SET_DSR ((uint8_t)4)

Definition at line 262 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SET_REL_ADDR

#define SD_CMD_SET_REL_ADDR ((uint8_t)3)

Definition at line 261 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_SET_WRITE_PROT

#define SD_CMD_SET_WRITE_PROT ((uint8_t)28)

Definition at line 284 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_STOP_TRANSMISSION

#define SD_CMD_STOP_TRANSMISSION ((uint8_t)12)

Definition at line 270 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_WRITE_DAT_UNTIL_STOP

#define SD_CMD_WRITE_DAT_UNTIL_STOP ((uint8_t)20)

Definition at line 278 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_WRITE_MULT_BLOCK

#define SD_CMD_WRITE_MULT_BLOCK ((uint8_t)25)

Definition at line 281 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CMD_WRITE_SINGLE_BLOCK

#define SD_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24)

Definition at line 280 of file sd_mmc_card/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sd_mmc_card_paremeters_definition

Macros
SDIO_sd_mmc_card_paremeters_definition
AT32F415_periph_examples » SDIO_sd_mmc_card

Macros

#define | NULL 0
#define | SDIO_STATIC_FLAGS ((uint32_t)0x000005FF)
#define | SDIO_CMD0TIMEOUT ((uint32_t)0x00010000)
#define | SDIO_DATATIMEOUT ((uint32_t)0xFFFFFFFF)
#define | SDIO_FIFO_Address ((uint32_t)0x40018080)

Detailed Description

Macro Definition Documentation

◆ NULL

#define NULL 0

sdio paremeters

Definition at line 339 of file sd_mmc_card/inc/at32_sdio.h.

◆ SDIO_CMD0TIMEOUT

#define SDIO_CMD0TIMEOUT ((uint32_t)0x00010000)

Definition at line 341 of file sd_mmc_card/inc/at32_sdio.h.

◆ SDIO_DATATIMEOUT

#define SDIO_DATATIMEOUT ((uint32_t)0xFFFFFFFF)

Definition at line 342 of file sd_mmc_card/inc/at32_sdio.h.

◆ SDIO_FIFO_Address

#define SDIO_FIFO_Address ((uint32_t)0x40018080)

Definition at line 343 of file sd_mmc_card/inc/at32_sdio.h.

◆ SDIO_STATIC_FLAGS

#define SDIO_STATIC_FLAGS ((uint32_t)0x000005FF)

Definition at line 340 of file sd_mmc_card/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sd_mmc_card_response_definition

Macros
SDIO_sd_mmc_card_response_definition
AT32F415_periph_examples » SDIO_sd_mmc_card

Macros

#define | SD_OCR_ADDR_OUT_OF_RANGE ((uint32_t)0x80000000)
#define | SD_OCR_ADDR_MISALIGNED ((uint32_t)0x40000000)
#define | SD_OCR_BLK_LEN_ERR ((uint32_t)0x20000000)
#define | SD_OCR_ERASE_SEQ_ERR ((uint32_t)0x10000000)
#define | SD_OCR_INVALID_ERASE_PARAM ((uint32_t)0x08000000)
#define | SD_OCR_WR_PROTECT_VIOLATION ((uint32_t)0x04000000)
#define | SD_OCR_LOCK_UNLOCK_FAILED ((uint32_t)0x01000000)
#define | SD_OCR_CMD_CRC_FAILED ((uint32_t)0x00800000)
#define | SD_OCR_ILLEGAL_CMD ((uint32_t)0x00400000)
#define | SD_OCR_CARD_ECC_FAILED ((uint32_t)0x00200000)
#define | SD_OCR_CARD_CONTROLLER_ERR ((uint32_t)0x00100000)
#define | SD_OCR_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00080000)
#define | SD_OCR_STREAM_RD_UNDERRUN ((uint32_t)0x00040000)
#define | SD_OCR_STREAM_WR_OVERRUN ((uint32_t)0x00020000)
#define | SD_OCR_CID_CSD_OVERWRIETE ((uint32_t)0x00010000)
#define | SD_OCR_WP_ERASE_SKIP ((uint32_t)0x00008000)
#define | SD_OCR_CARD_ECC_DISABLED ((uint32_t)0x00004000)
#define | SD_OCR_ERASE_RESET ((uint32_t)0x00002000)
#define | MMC_SWITCH_ERROR ((uint32_t)0x00000080)
#define | SD_OCR_AKE_SEQ_ERROR ((uint32_t)0x00000008)
#define | SD_OCR_ERRORBITS ((uint32_t)0xFDFFE008)
#define | SD_R5_OUT_OF_RANGE ((uint32_t)0x00000100)
#define | SD_R5_FUNCTION_NUMBER ((uint32_t)0x00000200)
#define | SD_R5_ERROR ((uint32_t)0x00000800)
#define | SD_R6_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00002000)
#define | SD_R6_ILLEGAL_CMD ((uint32_t)0x00004000)
#define | SD_R6_CMD_CRC_FAILED ((uint32_t)0x00008000)
#define | SD_VOLTAGE_WINDOW_SD ((uint32_t)0x80100000)
#define | SD_HIGH_CAPACITY ((uint32_t)0x40000000)
#define | SD_STD_CAPACITY ((uint32_t)0x00000000)
#define | SD_CHECK_PATTERN ((uint32_t)0x000001AA)
#define | SD_VOLTAGE_WINDOW_MMC ((uint32_t)0x80FF8000)
#define | SD_MAX_VOLT_TRIAL ((uint32_t)0x0000FFFF)
#define | SD_ALLZERO ((uint32_t)0x00000000)
#define | SD_WIDE_BUS_SUPPORT ((uint32_t)0x00040000)
#define | SD_SINGLE_BUS_SUPPORT ((uint32_t)0x00010000)
#define | SD_CARD_LOCKED ((uint32_t)0x02000000)
#define | SD_CARD_PROGRAMMING ((uint32_t)0x00000007)
#define | SD_CARD_RECEIVING ((uint32_t)0x00000006)
#define | SD_DATATIMEOUT ((uint32_t)0xFFFFFFFF)
#define | SD_0TO7BITS ((uint32_t)0x000000FF)
#define | SD_8TO15BITS ((uint32_t)0x0000FF00)
#define | SD_16TO23BITS ((uint32_t)0x00FF0000)
#define | SD_24TO31BITS ((uint32_t)0xFF000000)
#define | SD_MAX_DATA_LENGTH ((uint32_t)0x01FFFFFF)
#define | SD_HALFFIFO ((uint32_t)0x00000008)
#define | SD_HALFFIFOBYTES ((uint32_t)0x00000020)

Detailed Description

Macro Definition Documentation

◆ MMC_SWITCH_ERROR

#define MMC_SWITCH_ERROR ((uint32_t)0x00000080)

Definition at line 374 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_0TO7BITS

#define SD_0TO7BITS ((uint32_t)0x000000FF)

Definition at line 404 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_16TO23BITS

#define SD_16TO23BITS ((uint32_t)0x00FF0000)

Definition at line 406 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_24TO31BITS

#define SD_24TO31BITS ((uint32_t)0xFF000000)

Definition at line 407 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_8TO15BITS

#define SD_8TO15BITS ((uint32_t)0x0000FF00)

Definition at line 405 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_ALLZERO

#define SD_ALLZERO ((uint32_t)0x00000000)

Definition at line 397 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CARD_LOCKED

#define SD_CARD_LOCKED ((uint32_t)0x02000000)

Definition at line 400 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CARD_PROGRAMMING

#define SD_CARD_PROGRAMMING ((uint32_t)0x00000007)

Definition at line 401 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CARD_RECEIVING

#define SD_CARD_RECEIVING ((uint32_t)0x00000006)

Definition at line 402 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CHECK_PATTERN

#define SD_CHECK_PATTERN ((uint32_t)0x000001AA)

Definition at line 394 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_DATATIMEOUT

#define SD_DATATIMEOUT ((uint32_t)0xFFFFFFFF)

Definition at line 403 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_HALFFIFO

#define SD_HALFFIFO ((uint32_t)0x00000008)

Definition at line 409 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_HALFFIFOBYTES

#define SD_HALFFIFOBYTES ((uint32_t)0x00000020)

Definition at line 410 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_HIGH_CAPACITY

#define SD_HIGH_CAPACITY ((uint32_t)0x40000000)

Definition at line 392 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_MAX_DATA_LENGTH

#define SD_MAX_DATA_LENGTH ((uint32_t)0x01FFFFFF)

Definition at line 408 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_MAX_VOLT_TRIAL

#define SD_MAX_VOLT_TRIAL ((uint32_t)0x0000FFFF)

Definition at line 396 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_ADDR_MISALIGNED

#define SD_OCR_ADDR_MISALIGNED ((uint32_t)0x40000000)

Definition at line 357 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_ADDR_OUT_OF_RANGE

#define SD_OCR_ADDR_OUT_OF_RANGE ((uint32_t)0x80000000)

mask for errors card status r1 (ocr register)

Definition at line 356 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_AKE_SEQ_ERROR

#define SD_OCR_AKE_SEQ_ERROR ((uint32_t)0x00000008)

Definition at line 375 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_BLK_LEN_ERR

#define SD_OCR_BLK_LEN_ERR ((uint32_t)0x20000000)

Definition at line 358 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_CARD_CONTROLLER_ERR

#define SD_OCR_CARD_CONTROLLER_ERR ((uint32_t)0x00100000)

Definition at line 366 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_CARD_ECC_DISABLED

#define SD_OCR_CARD_ECC_DISABLED ((uint32_t)0x00004000)

Definition at line 372 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_CARD_ECC_FAILED

#define SD_OCR_CARD_ECC_FAILED ((uint32_t)0x00200000)

Definition at line 365 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_CID_CSD_OVERWRIETE

#define SD_OCR_CID_CSD_OVERWRIETE ((uint32_t)0x00010000)

Definition at line 370 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_CMD_CRC_FAILED

#define SD_OCR_CMD_CRC_FAILED ((uint32_t)0x00800000)

Definition at line 363 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_ERASE_RESET

#define SD_OCR_ERASE_RESET ((uint32_t)0x00002000)

Definition at line 373 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_ERASE_SEQ_ERR

#define SD_OCR_ERASE_SEQ_ERR ((uint32_t)0x10000000)

Definition at line 359 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_ERRORBITS

#define SD_OCR_ERRORBITS ((uint32_t)0xFDFFE008)

Definition at line 376 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_GENERAL_UNKNOWN_ERROR

#define SD_OCR_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00080000)

Definition at line 367 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_ILLEGAL_CMD

#define SD_OCR_ILLEGAL_CMD ((uint32_t)0x00400000)

Definition at line 364 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_INVALID_ERASE_PARAM

#define SD_OCR_INVALID_ERASE_PARAM ((uint32_t)0x08000000)

Definition at line 360 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_LOCK_UNLOCK_FAILED

#define SD_OCR_LOCK_UNLOCK_FAILED ((uint32_t)0x01000000)

Definition at line 362 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_STREAM_RD_UNDERRUN

#define SD_OCR_STREAM_RD_UNDERRUN ((uint32_t)0x00040000)

Definition at line 368 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_STREAM_WR_OVERRUN

#define SD_OCR_STREAM_WR_OVERRUN ((uint32_t)0x00020000)

Definition at line 369 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_WP_ERASE_SKIP

#define SD_OCR_WP_ERASE_SKIP ((uint32_t)0x00008000)

Definition at line 371 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_OCR_WR_PROTECT_VIOLATION

#define SD_OCR_WR_PROTECT_VIOLATION ((uint32_t)0x04000000)

Definition at line 361 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_R5_ERROR

#define SD_R5_ERROR ((uint32_t)0x00000800)

Definition at line 383 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_R5_FUNCTION_NUMBER

#define SD_R5_FUNCTION_NUMBER ((uint32_t)0x00000200)

Definition at line 382 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_R5_OUT_OF_RANGE

#define SD_R5_OUT_OF_RANGE ((uint32_t)0x00000100)

masks for r5 response

Definition at line 381 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_R6_CMD_CRC_FAILED

#define SD_R6_CMD_CRC_FAILED ((uint32_t)0x00008000)

Definition at line 390 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_R6_GENERAL_UNKNOWN_ERROR

#define SD_R6_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00002000)

masks for r6 response

Definition at line 388 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_R6_ILLEGAL_CMD

#define SD_R6_ILLEGAL_CMD ((uint32_t)0x00004000)

Definition at line 389 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_SINGLE_BUS_SUPPORT

#define SD_SINGLE_BUS_SUPPORT ((uint32_t)0x00010000)

Definition at line 399 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_STD_CAPACITY

#define SD_STD_CAPACITY ((uint32_t)0x00000000)

Definition at line 393 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_VOLTAGE_WINDOW_MMC

#define SD_VOLTAGE_WINDOW_MMC ((uint32_t)0x80FF8000)

Definition at line 395 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_VOLTAGE_WINDOW_SD

#define SD_VOLTAGE_WINDOW_SD ((uint32_t)0x80100000)

Definition at line 391 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_WIDE_BUS_SUPPORT

#define SD_WIDE_BUS_SUPPORT ((uint32_t)0x00040000)

Definition at line 398 of file sd_mmc_card/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sd_mmc_card_command_class_definition

Macros
SDIO_sd_mmc_card_command_class_definition
AT32F415_periph_examples » SDIO_sd_mmc_card

Macros

#define | SD_CCCC_LOCK_UNLOCK ((uint32_t)0x00000080)
#define | SD_CCCC_WRITE_PROT ((uint32_t)0x00000040)
#define | SD_CCCC_ERASE ((uint32_t)0x00000020)

Detailed Description

Macro Definition Documentation

◆ SD_CCCC_ERASE

#define SD_CCCC_ERASE ((uint32_t)0x00000020)

Definition at line 425 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CCCC_LOCK_UNLOCK

#define SD_CCCC_LOCK_UNLOCK ((uint32_t)0x00000080)

command class supported

Definition at line 423 of file sd_mmc_card/inc/at32_sdio.h.

◆ SD_CCCC_WRITE_PROT

#define SD_CCCC_WRITE_PROT ((uint32_t)0x00000040)

Definition at line 424 of file sd_mmc_card/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sd_mmc_card_cmd8_definition

Macros
SDIO_sd_mmc_card_cmd8_definition
AT32F415_periph_examples » SDIO_sd_mmc_card

Macros

#define SDIO_SEND_IF_COND ((uint32_t)0x00000008)

Detailed Description

Macro Definition Documentation

◆ SDIO_SEND_IF_COND

#define SDIO_SEND_IF_COND ((uint32_t)0x00000008)

cmd8

Definition at line 438 of file sd_mmc_card/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sd_mmc_card_mmc_extend_definition

Macros
SDIO_sd_mmc_card_mmc_extend_definition
AT32F415_periph_examples » SDIO_sd_mmc_card

Macros

#define | EXT_CSD_Command_set 0x0
#define | EXT_CSD_Set_bit 0x1
#define | EXT_CSD_Clear_byte 0x2
#define | EXT_CSD_Write_byte 0x3
#define | EXT_CSD_CMD_SET_NORMAL (1<<0)
#define | EXT_CSD_CMD_SET_SECURE (1<<1)
#define | EXT_CSD_CMD_SET_CPSECURE (1<<2)
#define | EXT_CSD_BUS_WIDTH 183
#define | EXT_CSD_HS_TIMING 185

Detailed Description

Macro Definition Documentation

◆ EXT_CSD_BUS_WIDTH

#define EXT_CSD_BUS_WIDTH 183

mmc ext_csd offset

Definition at line 463 of file sd_mmc_card/inc/at32_sdio.h.

◆ EXT_CSD_Clear_byte

#define EXT_CSD_Clear_byte 0x2

Definition at line 453 of file sd_mmc_card/inc/at32_sdio.h.

◆ EXT_CSD_CMD_SET_CPSECURE

#define EXT_CSD_CMD_SET_CPSECURE (1<<2)

Definition at line 458 of file sd_mmc_card/inc/at32_sdio.h.

◆ EXT_CSD_CMD_SET_NORMAL

#define EXT_CSD_CMD_SET_NORMAL (1<<0)

Definition at line 456 of file sd_mmc_card/inc/at32_sdio.h.

◆ EXT_CSD_CMD_SET_SECURE

#define EXT_CSD_CMD_SET_SECURE (1<<1)

Definition at line 457 of file sd_mmc_card/inc/at32_sdio.h.

◆ EXT_CSD_Command_set

#define EXT_CSD_Command_set 0x0

mmc ext_csd operation

Definition at line 451 of file sd_mmc_card/inc/at32_sdio.h.

◆ EXT_CSD_HS_TIMING

#define EXT_CSD_HS_TIMING 185

Definition at line 464 of file sd_mmc_card/inc/at32_sdio.h.

◆ EXT_CSD_Set_bit

#define EXT_CSD_Set_bit 0x1

Definition at line 452 of file sd_mmc_card/inc/at32_sdio.h.

◆ EXT_CSD_Write_byte

#define EXT_CSD_Write_byte 0x3

Definition at line 454 of file sd_mmc_card/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sd_mmc_card_interrupt_flags_definition

Macros
SDIO_sd_mmc_card_interrupt_flags_definition
AT32F415_periph_examples » SDIO_sd_mmc_card

Macros

#define | SDIO_INTR_STS_WRITE_MASK
#define | SDIO_INTR_STS_READ_MASK

Detailed Description

Macro Definition Documentation

◆ SDIO_INTR_STS_READ_MASK

#define SDIO_INTR_STS_READ_MASK
Value:
(SDIO_DTFAIL_FLAG | SDIO_DTTIMEOUT_FLAG | SDIO_RXERRO_FLAG | \
SDIO_DTCMPL_FLAG | SDIO_SBITERR_FLAG)
SDIO_DTFAIL_FLAG
#define SDIO_DTFAIL_FLAG
Definition: at32f415_sdio.h:86
SDIO_RXERRO_FLAG
#define SDIO_RXERRO_FLAG
Definition: at32f415_sdio.h:90
SDIO_DTTIMEOUT_FLAG
#define SDIO_DTTIMEOUT_FLAG
Definition: at32f415_sdio.h:88
SDIO_SBITERR_FLAG
#define SDIO_SBITERR_FLAG
Definition: at32f415_sdio.h:94

Definition at line 476 of file sd_mmc_card/inc/at32_sdio.h.

◆ SDIO_INTR_STS_WRITE_MASK

#define SDIO_INTR_STS_WRITE_MASK
Value:
(SDIO_DTFAIL_FLAG | SDIO_DTTIMEOUT_FLAG | SDIO_TXERRU_FLAG | \
SDIO_DTCMPL_FLAG | SDIO_SBITERR_FLAG)
SDIO_TXERRU_FLAG
#define SDIO_TXERRU_FLAG
Definition: at32f415_sdio.h:89

Definition at line 474 of file sd_mmc_card/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sd_mmc_card_exported_functions

Functions
SDIO_sd_mmc_card_exported_functions
AT32F415_periph_examples » SDIO_sd_mmc_card

Functions

sd_error_status_type | sd_init (void)
initializes the sd card and put it into standby state (ready for data transfer). More...
void | sdio_clock_set (uint32_t clkdiv)
set sdio clock devision factor. More...
sd_error_status_type | sd_power_on (void)
enquires cards about their operating voltage and configures clock controls. More...
sd_error_status_type | sd_power_off (void)
turns the sdio output signals off. More...
sd_error_status_type | sd_card_init (void)
intialises all cards or single card as the case may be card(s) come into standby state. More...
sd_error_status_type | sd_card_info_get (sd_card_info_struct_type *card_info)
returns information about specific card. More...
sd_error_status_type | sd_wide_bus_operation_config (sdio_bus_width_type mode)
enable wide bus opeartion for the requeseted card if supported by card. More...
sd_error_status_type | sd_device_mode_set (uint32_t mode)
set sdio work mode. More...
sd_error_status_type | sd_deselect_select (uint32_t addr)
selects od deselects the corresponding card. More...
sd_error_status_type | sd_status_send (uint32_t *p_card_status)
read current card status. More...
sd_card_state_type | sd_state_get (void)
returns information about sd card. More...
sd_error_status_type | sd_blocks_erase (long long addr, uint32_t nblks)
erase continuous data block More...
sd_error_status_type | sd_block_read (uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_read (uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_block_write (const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_write (const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed by dma mode only. More...
sd_error_status_type | mmc_stream_read (uint8_t *buf, long long addr, uint32_t len)
read mmc card data stream. More...
sd_error_status_type | mmc_stream_write (uint8_t *buf, long long addr, uint32_t len)
write mmc card data stream. More...
sd_error_status_type | sd_irq_service (void)
allows to process all the interrupts that are high. More...
void | sd_dma_config (uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
set dma configuation for sdio More...

Detailed Description

Function Documentation

◆ mmc_stream_read()

sd_error_status_type mmc_stream_read | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint32_t | len
 | ) |  |

read mmc card data stream.

Parameters
buf | buffer of saving data from mmc card
addr | start address of data from mmc card
len | data size
Return values
sd_error_status_type sd card error code.

Definition at line 1646 of file sd_mmc_card/src/at32_sdio.c.

Referenced by mmc_stream_test().

◆ mmc_stream_write()

sd_error_status_type mmc_stream_write | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint32_t | len
 | ) |  |

write mmc card data stream.

Parameters
buf | data that writing to mmc card
addr | start address mmc card
len | data size
Return values
sd_error_status_type sd card error code.

Definition at line 1693 of file sd_mmc_card/src/at32_sdio.c.

Referenced by mmc_stream_test().

◆ sd_block_read()

sd_error_status_type sd_block_read | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size
 | ) |  |

allows to read one block from a specified address in a card. the data transfer can be managed by dma mode or polling mode.

Parameters
buf | pointer to the buffer that will contain the received data
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
Return values
sd_error_status_type sd card error code.

Definition at line 1180 of file sd_mmc_card/src/at32_sdio.c.

Referenced by __align(), and sd_single_block_test().

◆ sd_block_write()

sd_error_status_type sd_block_write | ( | const uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size
 | ) |  |

allows to write one block starting from a specified address in a card. the data transfer can be managed by dma mode or polling mode.

Parameters
buf | pointer to the buffer that contain the data to be transferred.
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
Return values
sd_error_status_type sd card error code.

Definition at line 1360 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_single_block_test(), and sd_write_disk().

◆ sd_blocks_erase()

sd_error_status_type sd_blocks_erase | ( | long long | addr,
 |  | uint32_t | nblks
 | ) |  |

erase continuous data block

Parameters
addr | starting address
nblks | amount of erasing data block
Return values
sd_error_status_type sd card error code.

Definition at line 1022 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_card_info_get()

sd_error_status_type sd_card_info_get ( sd_card_info_struct_type * card_info )

returns information about specific card.

Parameters
card_info pointer to a sd_card_info_struct_type structure that contains all sd card information.
Return values
sd_error_status_type sd card error code.

Definition at line 524 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_card_init()

sd_error_status_type sd_card_init ( void )

intialises all cards or single card as the case may be card(s) come into standby state.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 409 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_deselect_select()

sd_error_status_type sd_deselect_select ( uint32_t addr )

selects od deselects the corresponding card.

Parameters
addr address of the card to be selected.
Return values
sd_error_status_type sd card error code.

Definition at line 799 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_device_mode_set()

sd_error_status_type sd_device_mode_set ( uint32_t mode )

set sdio work mode.

Parameters
mode parameter as following values:
  • SD_TRANSFER_POLLING_MODE: dma mode.
  • SD_TRANSFER_POLLING_MODE: polling mode.
Return values
sd_error_status_type sd card error code.

Definition at line 778 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_dma_config()

void sd_dma_config | ( | uint32_t * | mbuf,
 |  | uint32_t | buf_size,
 |  | dma_dir_type | dir
 | ) |  |

set dma configuation for sdio

Parameters
mbuf | buffer address
buf_size | transmission data size
dir | dma direction, it is DMA_DIR_MEMORY_TO_PERIPHERAL(writing data) or DMA_DIR_PERIPHERAL_TO_MEMORY(read data)
Return values
none

Definition at line 2699 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_init()

sd_error_status_type sd_init ( void )

initializes the sd card and put it into standby state (ready for data transfer).

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 71 of file sd_mmc_card/src/at32_sdio.c.

Referenced by disk_initialize(), and main().

◆ sd_irq_service()

sd_error_status_type sd_irq_service ( void )

allows to process all the interrupts that are high.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 1782 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_mult_blocks_read()

sd_error_status_type sd_mult_blocks_read | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size,
 |  | uint32_t | nblks
 | ) |  |

allows to read blocks from a specified address in a card. the data transfer can be managed by dma mode or polling mode.

Parameters
buf | pointer to the buffer that will contain the received data.
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
nblks | number of blocks to be read.
Return values
sd_error_status_type sd card error code.

Definition at line 1276 of file sdio_fatfs/src/at32_sdio.c.

Referenced by __align(), and sd_multiple_blocks_test().

◆ sd_mult_blocks_write()

sd_error_status_type sd_mult_blocks_write | ( | const uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size,
 |  | uint32_t | nblks
 | ) |  |

allows to write blocks starting from a specified address in a card. the data transfer can be managed by dma mode only.

Parameters
buf | pointer to the buffer that contain the data to be transferred.
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
nblks | number of blocks to be written.
Return values
sd_error_status_type sd card error code.

Definition at line 1482 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_multiple_blocks_test(), and sd_write_disk().

◆ sd_power_off()

sd_error_status_type sd_power_off ( void )

turns the sdio output signals off.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 395 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_power_on()

sd_error_status_type sd_power_on ( void )

enquires cards about their operating voltage and configures clock controls.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 189 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_state_get()

sd_card_state_type sd_state_get ( void )

returns information about sd card.

Parameters
none.
Return values
sd_card_state_type sd card state code.

Definition at line 2482 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_status_send()

sd_error_status_type sd_status_send ( uint32_t * p_card_status )

read current card status.

Parameters
p_card_status card status.
Return values
sd_error_status_type sd card error code.

Definition at line 2445 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_wide_bus_operation_config()

sd_error_status_type sd_wide_bus_operation_config ( sdio_bus_width_type mode )

enable wide bus opeartion for the requeseted card if supported by card.

Parameters
mode specifies the sd card wide bus mode. this parameter can be one of the following values:
  • SDIO_BUS_WIDTH_D8: 8-bit data transfer (only for mmc)
  • SDIO_BUS_WIDTH_D4: 4-bit data transfer
  • SDIO_BUS_WIDTH_D1: 1-bit data transfer
Return values
sd_error_status_type sd card error code.

Definition at line 735 of file sd_mmc_card/src/at32_sdio.c.

Referenced by mmc_stream_test(), sd_multiple_blocks_test(), and sd_single_block_test().

◆ sdio_clock_set()

void sdio_clock_set ( uint32_t clk_div )

set sdio clock devision factor.

Parameters
clkdiv sdio_ck = ahbclk / (clkdiv+2)
Return values
none

Definition at line 174 of file sd_mmc_card/src/at32_sdio.c.


AT32F415 Firmwary Library: SDIO_sdio_fatfs

Modules | Functions | Variables
SDIO_sdio_fatfs
AT32F415_periph_examples

Modules

SDIO_sdio_fatfs_instance_definition
SDIO_sdio_fatfs_exported_types
SDIO_sdio_fatfs_command_index_definition
SDIO_sdio_fatfs_paremeters_definition
SDIO_sdio_fatfs_response_definition
SDIO_sdio_fatfs_command_class_definition
SDIO_sdio_fatfs_cmd8_definition
SDIO_sdio_fatfs_mmc_extend_definition
SDIO_sdio_fatfs_interrupt_flags_definition
SDIO_sdio_fatfs_exported_functions

Functions

sd_error_status_type | command_error (void)
checks for error conditions for cmd0. More...
sd_error_status_type | command_rsp1_error (uint8_t cmd)
checks for error conditions for R1 response. More...
sd_error_status_type | command_rsp2_error (void)
checks for error conditions for R2 (cid or csd) response. More...
sd_error_status_type | command_rsp3_error (void)
checks for error conditions for R3 (ocr) response. More...
sd_error_status_type | command_rsp4_error (uint8_t cmd)
checks for error conditions for r4 response. More...
sd_error_status_type | command_rsp5_error (uint8_t cmd)
checks for error conditions for r5 response. More...
sd_error_status_type | command_rsp6_error (uint8_t cmd, uint16_t *prca)
checks for error conditions for r6 (rca) response. More...
sd_error_status_type | command_rsp7_error (void)
checks for error conditions for R7 response. More...
sd_error_status_type | sd_bus_wide_enable (confirm_state new_state)
enable or disable the sdio wide bus mode. More...
sd_error_status_type | mmc_switch (uint8_t set, uint8_t index, uint8_t value)
switch mmc card speed to high speed More...
sd_error_status_type | sd_switch (uint32_t mode, uint32_t group, uint8_t value, uint8_t *rsp)
switch sd card speed to high speed More...
sd_error_status_type | check_card_programming (uint8_t *p_status)
checks if the sd card is in programming state. More...
sd_error_status_type | speed_change (uint8_t speed)
set bus speed More...
sd_error_status_type | scr_find (void)
find the sd card scr register value. More...
uint8_t | convert_from_bytes_to_power_of_two (uint16_t number_of_bytes)
converts the number of bytes in power of two and returns the power. More...
sd_error_status_type | sd_init (void)
initializes the sd card and put it into standby state (ready for data transfer). More...
void | sdio_clock_set (uint32_t clk_div)
set sdio clock devision factor. More...
sd_error_status_type | sd_power_on (void)
enquires cards about their operating voltage and configures clock controls. More...
sd_error_status_type | sd_power_off (void)
turns the sdio output signals off. More...
sd_error_status_type | sd_card_init (void)
intialises all cards or single card as the case may be card(s) come into standby state. More...
sd_error_status_type | sd_card_info_get (sd_card_info_struct_type *card_info)
returns information about specific card. More...
sd_error_status_type | sd_wide_bus_operation_config (sdio_bus_width_type mode)
enable wide bus opeartion for the requeseted card if supported by card. More...
sd_error_status_type | sd_device_mode_set (uint32_t mode)
set sdio work mode. More...
sd_error_status_type | sd_deselect_select (uint32_t addr)
selects od deselects the corresponding card. More...
sd_error_status_type | sdio_command_data_send (sdio_command_struct_type *sdio_cmd_init_t, sdio_data_struct_type *sdio_data_init_t, uint32_t *buf)
read data from or write data to sd card. More...
sd_error_status_type | sd_blocks_erase (long long addr, uint32_t nblks)
erase continuous data block More...
sd_error_status_type | sd_block_read (uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_read (uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_block_write (const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_write (const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed by dma mode only. More...
sd_error_status_type | mmc_stream_read (uint8_t *buf, long long addr, uint32_t len)
read mmc card data stream. More...
sd_error_status_type | mmc_stream_write (uint8_t *buf, long long addr, uint32_t len)
write mmc card data stream. More...
void | SDIO1_IRQHandler (void)
sdio1 isr. More...
void | SDIO2_IRQHandler (void)
sdio2 isr. More...
sd_error_status_type | sd_irq_service (void)
allows to process all the interrupts that are high. More...
sd_error_status_type | sd_status_send (uint32_t *p_card_status)
read current card status. More...
sd_card_state_type | sd_state_get (void)
returns information about sd card. More...
void | sd_dma_config (uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
set dma configuation for sdio More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
static void | sd_test_error (void)
led2 on off every 300ms for sd test failed. More...
static void | nvic_configuration (void)
configures sdio1 irq channel. More...
static error_status | fatfs_test (void)
fatfs file read/write test. More...
int | main (void)
main function. More...

Variables

sd_card_info_struct_type sd_card_info
sdio_command_struct_type sdio_command_init_struct
sdio_data_struct_type sdio_data_init_struct
static sd_memory_card_type | card_type = SDIO_STD_CAPACITY_SD_CARD_V1_1
static uint32_t | csd_table [4]
static uint32_t | cid_table [4]
static uint32_t | rca = 0
static sd_data_transfer_mode_type | device_mode = SD_TRANSFER_POLLING_MODE
static uint8_t | stop_flag = 0
volatile sd_error_status_type | transfer_error = SD_OK
volatile uint8_t | transfer_end = 0
sd_card_info_struct_type sd_card_info
FATFS | fs
FIL | file
BYTE | work [FF_MAX_SS]

Detailed Description

Function Documentation

◆ buffer_compare()

uint8_t buffer_compare | ( | uint8_t * | pbuffer1,
 |  | uint8_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

compares two buffers.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
1 pbuffer1 identical to pbuffer2 0: pbuffer1 differs from pbuffer2

Definition at line 57 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c.

Referenced by fatfs_test().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c.

◆ check_card_programming()

sd_error_status_type check_card_programming ( uint8_t * p_status )

checks if the sd card is in programming state.

Parameters
p_status pointer to the variable that will contain the sd card state.
Return values
sd_error_status_type sd card error code.

Definition at line 2397 of file sdio_fatfs/src/at32_sdio.c.

Referenced by mmc_stream_write(), sd_block_write(), sd_blocks_erase(), and sd_mult_blocks_write().

◆ command_error()

sd_error_status_type command_error ( void )

checks for error conditions for cmd0.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 1872 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_power_on().

◆ command_rsp1_error()

sd_error_status_type command_rsp1_error ( uint8_t cmd )

checks for error conditions for R1 response.

Parameters
cmd the sent command index.
Return values
sd_error_status_type sd card error code.

Definition at line 1936 of file sdio_fatfs/src/at32_sdio.c.

Referenced by mmc_switch(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_bus_wide_enable(), sd_deselect_select(), sd_irq_service(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_power_on(), sd_status_send(), sd_switch(), and sdio_command_data_send().

◆ command_rsp2_error()

sd_error_status_type command_rsp2_error ( void )

checks for error conditions for R2 (cid or csd) response.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 2009 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_card_init().

◆ command_rsp3_error()

sd_error_status_type command_rsp3_error ( void )

checks for error conditions for R3 (ocr) response.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 1979 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_power_on().

◆ command_rsp4_error()

sd_error_status_type command_rsp4_error ( uint8_t cmd )

checks for error conditions for r4 response.

Parameters
cmd the sent command index.
Return values
sd_error_status_type sd card error code.

Definition at line 2049 of file sdio_fatfs/src/at32_sdio.c.

◆ command_rsp5_error()

sd_error_status_type command_rsp5_error ( uint8_t cmd )

checks for error conditions for r5 response.

Parameters
cmd the sent command index.
Return values
sd_error_status_type sd card error code.

Definition at line 2092 of file sdio_fatfs/src/at32_sdio.c.

◆ command_rsp6_error()

sd_error_status_type command_rsp6_error | ( | uint8_t | cmd,
 |  | uint16_t * | prca
 | ) |  |

checks for error conditions for r6 (rca) response.

Parameters
cmd | the sent command index.
prca | pointer to the variable that will contain the sd card relative address rca.
Return values
sd_error_status_type sd card error code.

Definition at line 2155 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_card_init().

◆ command_rsp7_error()

sd_error_status_type command_rsp7_error ( void )

checks for error conditions for R7 response.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 1899 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_power_on().

◆ convert_from_bytes_to_power_of_two()

uint8_t convert_from_bytes_to_power_of_two ( uint16_t number_of_bytes )

converts the number of bytes in power of two and returns the power.

Parameters
number_of_bytes number of bytes.
Return values
none

Definition at line 2684 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_block_read(), sd_block_write(), sd_mult_blocks_read(), sd_mult_blocks_write(), and sd_switch().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c.

◆ fatfs_test()

static error_status fatfs_test ( void )
static

fatfs file read/write test.

Parameters
none
Return values
ERROR fail. SUCCESS: success.

Definition at line 101 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 205 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c.

◆ mmc_stream_read()

sd_error_status_type mmc_stream_read | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint32_t | len
 | ) |  |

read mmc card data stream.

Parameters
buf | buffer of saving data from mmc card
addr | start address of data from mmc card
len | data size
Return values
sd_error_status_type sd card error code.

Definition at line 1652 of file sdio_fatfs/src/at32_sdio.c.

Referenced by mmc_stream_test().

◆ mmc_stream_write()

sd_error_status_type mmc_stream_write | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint32_t | len
 | ) |  |

write mmc card data stream.

Parameters
buf | data that writing to mmc card
addr | start address mmc card
len | data size
Return values
sd_error_status_type sd card error code.

Definition at line 1699 of file sdio_fatfs/src/at32_sdio.c.

Referenced by mmc_stream_test().

◆ mmc_switch()

sd_error_status_type mmc_switch | ( | uint8_t | set,
 |  | uint8_t | index,
 |  | uint8_t | value
 | ) |  |

switch mmc card speed to high speed

Parameters
set | new state of the sdio wide bus mode.
index | offset.
value | expect speed.
Return values
sd_error_status_type sd card error code.

Definition at line 2290 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_wide_bus_operation_config(), and speed_change().

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c.

◆ nvic_configuration()

static void nvic_configuration ( void )
static

configures sdio1 irq channel.

Parameters
none
Return values
none

Definition at line 89 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c.

Referenced by main().

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c.

◆ scr_find()

sd_error_status_type scr_find ( void )

find the sd card scr register value.

Return values
sd_error_status_type sd card error code.

Definition at line 2506 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_block_read()

sd_error_status_type sd_block_read | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size
 | ) |  |

allows to read one block from a specified address in a card. the data transfer can be managed by dma mode or polling mode.

Parameters
buf | pointer to the buffer that will contain the received data
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
Return values
sd_error_status_type sd card error code.

Definition at line 1187 of file sdio_fatfs/src/at32_sdio.c.

Referenced by __align(), and sd_single_block_test().

◆ sd_block_write()

sd_error_status_type sd_block_write | ( | const uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size
 | ) |  |

allows to write one block starting from a specified address in a card. the data transfer can be managed by dma mode or polling mode.

Parameters
buf | pointer to the buffer that contain the data to be transferred.
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
Return values
sd_error_status_type sd card error code.

Definition at line 1366 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_single_block_test(), and sd_write_disk().

◆ sd_blocks_erase()

sd_error_status_type sd_blocks_erase | ( | long long | addr,
 |  | uint32_t | nblks
 | ) |  |

erase continuous data block

Parameters
addr | starting address
nblks | amount of erasing data block
Return values
sd_error_status_type sd card error code.

Definition at line 1029 of file sdio_fatfs/src/at32_sdio.c.

◆ sd_bus_wide_enable()

sd_error_status_type sd_bus_wide_enable ( confirm_state new_state )

enable or disable the sdio wide bus mode.

Parameters
new_state new state of the sdio wide bus mode. (true or false)
Return values
sd_error_status_type sd card error code.

Definition at line 2221 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_wide_bus_operation_config().

◆ sd_card_info_get()

sd_error_status_type sd_card_info_get ( sd_card_info_struct_type * card_info )

returns information about specific card.

Parameters
card_info pointer to a sd_card_info_struct_type structure that contains all sd card information.
Return values
sd_error_status_type sd card error code.

Definition at line 531 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_card_init()

sd_error_status_type sd_card_init ( void )

intialises all cards or single card as the case may be card(s) come into standby state.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 416 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_deselect_select()

sd_error_status_type sd_deselect_select ( uint32_t addr )

selects od deselects the corresponding card.

Parameters
addr address of the card to be selected.
Return values
sd_error_status_type sd card error code.

Definition at line 806 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_device_mode_set()

sd_error_status_type sd_device_mode_set ( uint32_t mode )

set sdio work mode.

Parameters
mode parameter as following values:
  • SD_TRANSFER_POLLING_MODE: dma mode.
  • SD_TRANSFER_POLLING_MODE: polling mode.
Return values
sd_error_status_type sd card error code.

Definition at line 785 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_dma_config()

void sd_dma_config | ( | uint32_t * | mbuf,
 |  | uint32_t | buf_size,
 |  | dma_dir_type | dir
 | ) |  |

set dma configuation for sdio

Parameters
mbuf | buffer address
buf_size | transmission data size
dir | dma direction, it is DMA_DIR_MEMORY_TO_PERIPHERAL(writing data) or DMA_DIR_PERIPHERAL_TO_MEMORY(read data)
Return values
none

Definition at line 2705 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sdio_command_data_send().

◆ sd_init()

sd_error_status_type sd_init ( void )

initializes the sd card and put it into standby state (ready for data transfer).

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 72 of file sdio_fatfs/src/at32_sdio.c.

Referenced by disk_initialize(), main(), and sdio_command_data_send().

◆ sd_irq_service()

sd_error_status_type sd_irq_service ( void )

allows to process all the interrupts that are high.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 1788 of file sdio_fatfs/src/at32_sdio.c.

Referenced by SDIO1_IRQHandler(), and SDIO2_IRQHandler().

◆ sd_mult_blocks_read()

sd_error_status_type sd_mult_blocks_read | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size,
 |  | uint32_t | nblks
 | ) |  |

allows to read blocks from a specified address in a card. the data transfer can be managed by dma mode or polling mode.

Parameters
buf | pointer to the buffer that will contain the received data.
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
nblks | number of blocks to be read.
Return values
sd_error_status_type sd card error code.

Definition at line 1276 of file sdio_fatfs/src/at32_sdio.c.

Referenced by __align(), and sd_multiple_blocks_test().

◆ sd_mult_blocks_write()

sd_error_status_type sd_mult_blocks_write | ( | const uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size,
 |  | uint32_t | nblks
 | ) |  |

allows to write blocks starting from a specified address in a card. the data transfer can be managed by dma mode only.

Parameters
buf | pointer to the buffer that contain the data to be transferred.
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
nblks | number of blocks to be written.
Return values
sd_error_status_type sd card error code.

Definition at line 1488 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_multiple_blocks_test(), and sd_write_disk().

◆ sd_power_off()

sd_error_status_type sd_power_off ( void )

turns the sdio output signals off.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 402 of file sdio_fatfs/src/at32_sdio.c.

◆ sd_power_on()

sd_error_status_type sd_power_on ( void )

enquires cards about their operating voltage and configures clock controls.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 196 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_state_get()

sd_card_state_type sd_state_get ( void )

returns information about sd card.

Parameters
none.
Return values
sd_card_state_type sd card state code.

Definition at line 2488 of file sdio_fatfs/src/at32_sdio.c.

◆ sd_status_send()

sd_error_status_type sd_status_send ( uint32_t * p_card_status )

read current card status.

Parameters
p_card_status card status.
Return values
sd_error_status_type sd card error code.

Definition at line 2451 of file sdio_fatfs/src/at32_sdio.c.

Referenced by mmc_switch(), sd_block_write(), sd_mult_blocks_write(), and sd_state_get().

◆ sd_switch()

sd_error_status_type sd_switch | ( | uint32_t | mode,
 |  | uint32_t | group,
 |  | uint8_t | value,
 |  | uint8_t * | rsp
 | ) |  |

switch sd card speed to high speed

Parameters
mode | polling mode or dma mode
group | selected group
value | wanted speed
rsp | switch status
Return values
sd_error_status_type sd card error code.

Definition at line 2341 of file sdio_fatfs/src/at32_sdio.c.

Referenced by speed_change().

◆ sd_test_error()

static void sd_test_error ( void )
static

led2 on off every 300ms for sd test failed.

Parameters
none
Return values
none

Definition at line 76 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c.

Referenced by main().

◆ sd_wide_bus_operation_config()

sd_error_status_type sd_wide_bus_operation_config ( sdio_bus_width_type mode )

enable wide bus opeartion for the requeseted card if supported by card.

Parameters
mode specifies the sd card wide bus mode. this parameter can be one of the following values:
  • SDIO_BUS_WIDTH_D8: 8-bit data transfer (only for mmc)
  • SDIO_BUS_WIDTH_D4: 4-bit data transfer
  • SDIO_BUS_WIDTH_D1: 1-bit data transfer
Return values
sd_error_status_type sd card error code.

Definition at line 742 of file sdio_fatfs/src/at32_sdio.c.

Referenced by mmc_stream_test(), sd_init(), sd_multiple_blocks_test(), and sd_single_block_test().

◆ SDIO1_IRQHandler()

void SDIO1_IRQHandler ( void )

sdio1 isr.

Parameters
none.
Return values
none.

Definition at line 1768 of file sdio_fatfs/src/at32_sdio.c.

◆ SDIO2_IRQHandler()

void SDIO2_IRQHandler ( void )

sdio2 isr.

Parameters
none.
Return values
none.

Definition at line 1778 of file sdio_fatfs/src/at32_sdio.c.

◆ sdio_clock_set()

void sdio_clock_set ( uint32_t clk_div )

set sdio clock devision factor.

Parameters
clkdiv sdio_ck = ahbclk / (clkdiv+2)
Return values
none

Definition at line 181 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_init().

◆ sdio_command_data_send()

sd_error_status_type sdio_command_data_send | ( | sdio_command_struct_type * | sdio_cmd_init_t,
 |  | sdio_data_struct_type * | sdio_data_init_t,
 |  | uint32_t * | buf
 | ) |  |

read data from or write data to sd card.

Parameters
sdio_cmd_init_struct | pointer to sdio_command_struct_type structure.
sdio_data_init_struct | pointer to sdio_data_struct_type structure.
buf | pointer to data buffer read or write.
Return values
sd_error_status_type sd card error code.

Definition at line 829 of file sdio_fatfs/src/at32_sdio.c.

Referenced by mmc_stream_read(), mmc_stream_write(), sd_block_read(), sd_block_write(), sd_mult_blocks_read(), sd_mult_blocks_write(), and sd_switch().

◆ speed_change()

sd_error_status_type speed_change ( uint8_t speed )

set bus speed

Parameters
speed 0,normal speed; 1,high speed.
Return values
sd_error_status_type sd card error code.

Definition at line 2620 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_init().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c.

Variable Documentation

◆ card_type

sd_memory_card_type card_type = SDIO_STD_CAPACITY_SD_CARD_V1_1
static

Definition at line 42 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_card_info_get(), sd_card_init(), sd_init(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_power_on(), sd_wide_bus_operation_config(), and speed_change().

◆ cid_table

uint32_t cid_table[4]
static

Definition at line 43 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_card_info_get(), and sd_card_init().

◆ csd_table

uint32_t csd_table[4]
static

Definition at line 43 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_card_info_get(), and sd_card_init().

◆ device_mode

sd_data_transfer_mode_type device_mode = SD_TRANSFER_POLLING_MODE
static

Definition at line 44 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_device_mode_set(), and sdio_command_data_send().

◆ file

FIL file

Definition at line 43 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c.

Referenced by fatfs_test().

◆ fs

FATFS fs

Definition at line 42 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c.

Referenced by fatfs_test().

◆ rca

uint32_t rca = 0
static

Definition at line 43 of file sdio_fatfs/src/at32_sdio.c.

Referenced by check_card_programming(), sd_card_info_get(), sd_card_init(), sd_mult_blocks_write(), and sd_status_send().

◆ sd_card_info [1/2]

sd_card_info_struct_type sd_card_info
extern

Definition at line 47 of file sd_mmc_card/src/at32_sdio.c.

Referenced by scr_find(), sd_bus_wide_enable(), sd_init(), and speed_change().

◆ sd_card_info [2/2]

sd_card_info_struct_type sd_card_info

Definition at line 48 of file sdio_fatfs/src/at32_sdio.c.

Referenced by disk_ioctl(), main(), scr_find(), sd_bus_wide_enable(), sd_init(), show_card_info(), and speed_change().

◆ sdio_command_init_struct

sdio_command_struct_type sdio_command_init_struct

Definition at line 39 of file sdio_fatfs/src/at32_sdio.c.

Referenced by check_card_programming(), mmc_stream_read(), mmc_stream_write(), mmc_switch(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_bus_wide_enable(), sd_card_init(), sd_deselect_select(), sd_irq_service(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_power_on(), sd_status_send(), and sd_switch().

◆ sdio_data_init_struct

sdio_data_struct_type sdio_data_init_struct

Definition at line 40 of file sdio_fatfs/src/at32_sdio.c.

Referenced by mmc_stream_read(), mmc_stream_write(), scr_find(), sd_block_read(), sd_block_write(), sd_blocks_erase(), sd_mult_blocks_read(), sd_mult_blocks_write(), and sd_switch().

◆ stop_flag

uint8_t stop_flag = 0
static

Definition at line 45 of file sdio_fatfs/src/at32_sdio.c.

Referenced by mmc_stream_read(), mmc_stream_write(), sd_block_read(), sd_block_write(), sd_irq_service(), sd_mult_blocks_read(), sd_mult_blocks_write(), sd_switch(), and sdio_command_data_send().

◆ transfer_end

volatile uint8_t transfer_end = 0

Definition at line 47 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_irq_service(), and sdio_command_data_send().

◆ transfer_error

volatile sd_error_status_type transfer_error = SD_OK

Definition at line 46 of file sdio_fatfs/src/at32_sdio.c.

Referenced by sd_irq_service(), and sdio_command_data_send().

◆ work

BYTE work[FF_MAX_SS]

Definition at line 44 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c.

Referenced by fatfs_test().


AT32F415 Firmwary Library: SDIO_sdio_fatfs_instance_definition

Macros
SDIO_sdio_fatfs_instance_definition
AT32F415_periph_examples » SDIO_sdio_fatfs

Macros

#define SDIOx SDIO1

Detailed Description

Macro Definition Documentation

◆ SDIOx

#define SDIOx SDIO1

Definition at line 51 of file sdio_fatfs/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sdio_fatfs_command_index_definition

Macros
SDIO_sdio_fatfs_command_index_definition
AT32F415_periph_examples » SDIO_sdio_fatfs

Macros

#define | SD_CMD_GO_IDLE_STATE ((uint8_t)0)
#define | SD_CMD_SEND_OP_COND ((uint8_t)1)
#define | SD_CMD_ALL_SEND_CID ((uint8_t)2)
#define | SD_CMD_SET_REL_ADDR ((uint8_t)3)
#define | SD_CMD_SET_DSR ((uint8_t)4)
#define | SD_CMD_SDIO_SEN_OP_COND ((uint8_t)5)
#define | SD_CMD_HS_SWITCH ((uint8_t)6)
#define | SD_CMD_SEL_DESEL_CARD ((uint8_t)7)
#define | SD_CMD_HS_SEND_EXT_CSD ((uint8_t)8)
#define | SD_CMD_SEND_CSD ((uint8_t)9)
#define | SD_CMD_SEND_CID ((uint8_t)10)
#define | SD_CMD_READ_DAT_UNTIL_STOP ((uint8_t)11)
#define | SD_CMD_STOP_TRANSMISSION ((uint8_t)12)
#define | SD_CMD_SEND_STATUS ((uint8_t)13)
#define | SD_CMD_HS_BUSTEST_READ ((uint8_t)14)
#define | SD_CMD_GO_INACTIVE_STATE ((uint8_t)15)
#define | SD_CMD_SET_BLOCKLEN ((uint8_t)16)
#define | SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17)
#define | SD_CMD_READ_MULT_BLOCK ((uint8_t)18)
#define | SD_CMD_HS_BUSTEST_WRITE ((uint8_t)19)
#define | SD_CMD_WRITE_DAT_UNTIL_STOP ((uint8_t)20)
#define | SD_CMD_SET_BLOCK_COUNT ((uint8_t)23)
#define | SD_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24)
#define | SD_CMD_WRITE_MULT_BLOCK ((uint8_t)25)
#define | SD_CMD_PROG_CID ((uint8_t)26)
#define | SD_CMD_PROG_CSD ((uint8_t)27)
#define | SD_CMD_SET_WRITE_PROT ((uint8_t)28)
#define | SD_CMD_CLR_WRITE_PROT ((uint8_t)29)
#define | SD_CMD_SEND_WRITE_PROT ((uint8_t)30)
#define | SD_CMD_SD_ERASE_GRP_START ((uint8_t)32)
#define | SD_CMD_SD_ERASE_GRP_END ((uint8_t)33)
#define | SD_CMD_ERASE_GRP_START ((uint8_t)35)
#define | SD_CMD_ERASE_GRP_END ((uint8_t)36)
#define | SD_CMD_ERASE ((uint8_t)38)
#define | SD_CMD_FAST_IO ((uint8_t)39)
#define | SD_CMD_GO_IRQ_STATE ((uint8_t)40)
#define | SD_CMD_LOCK_UNLOCK ((uint8_t)42)
#define | SD_CMD_APP_CMD ((uint8_t)55)
#define | SD_CMD_GEN_CMD ((uint8_t)56)
#define | SD_CMD_NO_CMD ((uint8_t)64)
#define | SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6)
#define | SD_CMD_SD_APP_STAUS ((uint8_t)13)
#define | SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22)
#define | SD_CMD_SD_APP_OP_COND ((uint8_t)41)
#define | SD_CMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42)
#define | SD_CMD_SD_APP_SEND_SCR ((uint8_t)51)
#define | SD_CMD_SDIO_RW_DIRECT ((uint8_t)52)
#define | SD_CMD_SDIO_RW_EXTENDED ((uint8_t)53)
#define | SD_CMD_SD_APP_GET_MKB ((uint8_t)43)
#define | SD_CMD_SD_APP_GET_MID ((uint8_t)44)
#define | SD_CMD_SD_APP_SET_CER_RN1 ((uint8_t)45)
#define | SD_CMD_SD_APP_GET_CER_RN2 ((uint8_t)46)
#define | SD_CMD_SD_APP_SET_CER_RES2 ((uint8_t)47)
#define | SD_CMD_SD_APP_GET_CER_RES1 ((uint8_t)48)
#define | SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK ((uint8_t)18)
#define | SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK ((uint8_t)25)
#define | SD_CMD_SD_APP_SECURE_ERASE ((uint8_t)38)
#define | SD_CMD_SD_APP_CHANGE_SECURE_AREA ((uint8_t)49)
#define | SD_CMD_SD_APP_SECURE_WRITE_MKB ((uint8_t)48)

Detailed Description

Macro Definition Documentation

◆ SD_CMD_ALL_SEND_CID

#define SD_CMD_ALL_SEND_CID ((uint8_t)2)

Definition at line 260 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_APP_CMD

#define SD_CMD_APP_CMD ((uint8_t)55)

Definition at line 295 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_APP_SD_SET_BUSWIDTH

#define SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6)

following commands are sd card specific commands. should be sent before sending these commands.

Definition at line 303 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_CLR_WRITE_PROT

#define SD_CMD_CLR_WRITE_PROT ((uint8_t)29)

Definition at line 285 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_ERASE

#define SD_CMD_ERASE ((uint8_t)38)

Definition at line 291 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_ERASE_GRP_END

#define SD_CMD_ERASE_GRP_END ((uint8_t)36)

Definition at line 290 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_ERASE_GRP_START

#define SD_CMD_ERASE_GRP_START ((uint8_t)35)

Definition at line 289 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_FAST_IO

#define SD_CMD_FAST_IO ((uint8_t)39)

Definition at line 292 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_GEN_CMD

#define SD_CMD_GEN_CMD ((uint8_t)56)

Definition at line 296 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_GO_IDLE_STATE

#define SD_CMD_GO_IDLE_STATE ((uint8_t)0)

sdio commands index

Definition at line 258 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_GO_INACTIVE_STATE

#define SD_CMD_GO_INACTIVE_STATE ((uint8_t)15)

Definition at line 273 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_GO_IRQ_STATE

#define SD_CMD_GO_IRQ_STATE ((uint8_t)40)

Definition at line 293 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_HS_BUSTEST_READ

#define SD_CMD_HS_BUSTEST_READ ((uint8_t)14)

Definition at line 272 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_HS_BUSTEST_WRITE

#define SD_CMD_HS_BUSTEST_WRITE ((uint8_t)19)

Definition at line 277 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_HS_SEND_EXT_CSD

#define SD_CMD_HS_SEND_EXT_CSD ((uint8_t)8)

Definition at line 266 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_HS_SWITCH

#define SD_CMD_HS_SWITCH ((uint8_t)6)

Definition at line 264 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_LOCK_UNLOCK

#define SD_CMD_LOCK_UNLOCK ((uint8_t)42)

Definition at line 294 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_NO_CMD

#define SD_CMD_NO_CMD ((uint8_t)64)

Definition at line 297 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_PROG_CID

#define SD_CMD_PROG_CID ((uint8_t)26)

Definition at line 282 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_PROG_CSD

#define SD_CMD_PROG_CSD ((uint8_t)27)

Definition at line 283 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_READ_DAT_UNTIL_STOP

#define SD_CMD_READ_DAT_UNTIL_STOP ((uint8_t)11)

Definition at line 269 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_READ_MULT_BLOCK

#define SD_CMD_READ_MULT_BLOCK ((uint8_t)18)

Definition at line 276 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_READ_SINGLE_BLOCK

#define SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17)

Definition at line 275 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_CHANGE_SECURE_AREA

#define SD_CMD_SD_APP_CHANGE_SECURE_AREA ((uint8_t)49)

Definition at line 325 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_GET_CER_RES1

#define SD_CMD_SD_APP_GET_CER_RES1 ((uint8_t)48)

Definition at line 321 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_GET_CER_RN2

#define SD_CMD_SD_APP_GET_CER_RN2 ((uint8_t)46)

Definition at line 319 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_GET_MID

#define SD_CMD_SD_APP_GET_MID ((uint8_t)44)

Definition at line 317 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_GET_MKB

#define SD_CMD_SD_APP_GET_MKB ((uint8_t)43)

following commands are sd card specific security commands. sdio_app_cmd should be sent before sending these commands.

Definition at line 316 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_OP_COND

#define SD_CMD_SD_APP_OP_COND ((uint8_t)41)

Definition at line 306 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SECURE_ERASE

#define SD_CMD_SD_APP_SECURE_ERASE ((uint8_t)38)

Definition at line 324 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK

#define SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK ((uint8_t)18)

Definition at line 322 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SECURE_WRITE_MKB

#define SD_CMD_SD_APP_SECURE_WRITE_MKB ((uint8_t)48)

Definition at line 326 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK

#define SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK ((uint8_t)25)

Definition at line 323 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS

#define SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22)

Definition at line 305 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SEND_SCR

#define SD_CMD_SD_APP_SEND_SCR ((uint8_t)51)

Definition at line 308 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SET_CER_RES2

#define SD_CMD_SD_APP_SET_CER_RES2 ((uint8_t)47)

Definition at line 320 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SET_CER_RN1

#define SD_CMD_SD_APP_SET_CER_RN1 ((uint8_t)45)

Definition at line 318 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_SET_CLR_CARD_DETECT

#define SD_CMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42)

Definition at line 307 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_APP_STAUS

#define SD_CMD_SD_APP_STAUS ((uint8_t)13)

Definition at line 304 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_ERASE_GRP_END

#define SD_CMD_SD_ERASE_GRP_END ((uint8_t)33)

Definition at line 288 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SD_ERASE_GRP_START

#define SD_CMD_SD_ERASE_GRP_START ((uint8_t)32)

Definition at line 287 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SDIO_RW_DIRECT

#define SD_CMD_SDIO_RW_DIRECT ((uint8_t)52)

Definition at line 309 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SDIO_RW_EXTENDED

#define SD_CMD_SDIO_RW_EXTENDED ((uint8_t)53)

Definition at line 310 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SDIO_SEN_OP_COND

#define SD_CMD_SDIO_SEN_OP_COND ((uint8_t)5)

Definition at line 263 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SEL_DESEL_CARD

#define SD_CMD_SEL_DESEL_CARD ((uint8_t)7)

Definition at line 265 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SEND_CID

#define SD_CMD_SEND_CID ((uint8_t)10)

Definition at line 268 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SEND_CSD

#define SD_CMD_SEND_CSD ((uint8_t)9)

Definition at line 267 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SEND_OP_COND

#define SD_CMD_SEND_OP_COND ((uint8_t)1)

Definition at line 259 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SEND_STATUS

#define SD_CMD_SEND_STATUS ((uint8_t)13)

Definition at line 271 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SEND_WRITE_PROT

#define SD_CMD_SEND_WRITE_PROT ((uint8_t)30)

Definition at line 286 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SET_BLOCK_COUNT

#define SD_CMD_SET_BLOCK_COUNT ((uint8_t)23)

Definition at line 279 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SET_BLOCKLEN

#define SD_CMD_SET_BLOCKLEN ((uint8_t)16)

Definition at line 274 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SET_DSR

#define SD_CMD_SET_DSR ((uint8_t)4)

Definition at line 262 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SET_REL_ADDR

#define SD_CMD_SET_REL_ADDR ((uint8_t)3)

Definition at line 261 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_SET_WRITE_PROT

#define SD_CMD_SET_WRITE_PROT ((uint8_t)28)

Definition at line 284 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_STOP_TRANSMISSION

#define SD_CMD_STOP_TRANSMISSION ((uint8_t)12)

Definition at line 270 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_WRITE_DAT_UNTIL_STOP

#define SD_CMD_WRITE_DAT_UNTIL_STOP ((uint8_t)20)

Definition at line 278 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_WRITE_MULT_BLOCK

#define SD_CMD_WRITE_MULT_BLOCK ((uint8_t)25)

Definition at line 281 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CMD_WRITE_SINGLE_BLOCK

#define SD_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24)

Definition at line 280 of file sdio_fatfs/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sdio_fatfs_paremeters_definition

Macros
SDIO_sdio_fatfs_paremeters_definition
AT32F415_periph_examples » SDIO_sdio_fatfs

Macros

#define | NULL 0
#define | SDIO_STATIC_FLAGS ((uint32_t)0x000005FF)
#define | SDIO_CMD0TIMEOUT ((uint32_t)0x00010000)
#define | SDIO_DATATIMEOUT ((uint32_t)0xFFFFFFFF)
#define | SDIO_FIFO_Address ((uint32_t)0x40018080)

Detailed Description

Macro Definition Documentation

◆ NULL

#define NULL 0

sdio paremeters

Definition at line 339 of file sdio_fatfs/inc/at32_sdio.h.

◆ SDIO_CMD0TIMEOUT

#define SDIO_CMD0TIMEOUT ((uint32_t)0x00010000)

Definition at line 341 of file sdio_fatfs/inc/at32_sdio.h.

◆ SDIO_DATATIMEOUT

#define SDIO_DATATIMEOUT ((uint32_t)0xFFFFFFFF)

Definition at line 342 of file sdio_fatfs/inc/at32_sdio.h.

◆ SDIO_FIFO_Address

#define SDIO_FIFO_Address ((uint32_t)0x40018080)

Definition at line 343 of file sdio_fatfs/inc/at32_sdio.h.

◆ SDIO_STATIC_FLAGS

#define SDIO_STATIC_FLAGS ((uint32_t)0x000005FF)

Definition at line 340 of file sdio_fatfs/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sdio_fatfs_response_definition

Macros
SDIO_sdio_fatfs_response_definition
AT32F415_periph_examples » SDIO_sdio_fatfs

Macros

#define | SD_OCR_ADDR_OUT_OF_RANGE ((uint32_t)0x80000000)
#define | SD_OCR_ADDR_MISALIGNED ((uint32_t)0x40000000)
#define | SD_OCR_BLK_LEN_ERR ((uint32_t)0x20000000)
#define | SD_OCR_ERASE_SEQ_ERR ((uint32_t)0x10000000)
#define | SD_OCR_INVALID_ERASE_PARAM ((uint32_t)0x08000000)
#define | SD_OCR_WR_PROTECT_VIOLATION ((uint32_t)0x04000000)
#define | SD_OCR_LOCK_UNLOCK_FAILED ((uint32_t)0x01000000)
#define | SD_OCR_CMD_CRC_FAILED ((uint32_t)0x00800000)
#define | SD_OCR_ILLEGAL_CMD ((uint32_t)0x00400000)
#define | SD_OCR_CARD_ECC_FAILED ((uint32_t)0x00200000)
#define | SD_OCR_CARD_CONTROLLER_ERR ((uint32_t)0x00100000)
#define | SD_OCR_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00080000)
#define | SD_OCR_STREAM_RD_UNDERRUN ((uint32_t)0x00040000)
#define | SD_OCR_STREAM_WR_OVERRUN ((uint32_t)0x00020000)
#define | SD_OCR_CID_CSD_OVERWRIETE ((uint32_t)0x00010000)
#define | SD_OCR_WP_ERASE_SKIP ((uint32_t)0x00008000)
#define | SD_OCR_CARD_ECC_DISABLED ((uint32_t)0x00004000)
#define | SD_OCR_ERASE_RESET ((uint32_t)0x00002000)
#define | MMC_SWITCH_ERROR ((uint32_t)0x00000080)
#define | SD_OCR_AKE_SEQ_ERROR ((uint32_t)0x00000008)
#define | SD_OCR_ERRORBITS ((uint32_t)0xFDFFE008)
#define | SD_R5_OUT_OF_RANGE ((uint32_t)0x00000100)
#define | SD_R5_FUNCTION_NUMBER ((uint32_t)0x00000200)
#define | SD_R5_ERROR ((uint32_t)0x00000800)
#define | SD_R6_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00002000)
#define | SD_R6_ILLEGAL_CMD ((uint32_t)0x00004000)
#define | SD_R6_CMD_CRC_FAILED ((uint32_t)0x00008000)
#define | SD_VOLTAGE_WINDOW_SD ((uint32_t)0x80100000)
#define | SD_HIGH_CAPACITY ((uint32_t)0x40000000)
#define | SD_STD_CAPACITY ((uint32_t)0x00000000)
#define | SD_CHECK_PATTERN ((uint32_t)0x000001AA)
#define | SD_VOLTAGE_WINDOW_MMC ((uint32_t)0x80FF8000)
#define | SD_MAX_VOLT_TRIAL ((uint32_t)0x0000FFFF)
#define | SD_ALLZERO ((uint32_t)0x00000000)
#define | SD_WIDE_BUS_SUPPORT ((uint32_t)0x00040000)
#define | SD_SINGLE_BUS_SUPPORT ((uint32_t)0x00010000)
#define | SD_CARD_LOCKED ((uint32_t)0x02000000)
#define | SD_CARD_PROGRAMMING ((uint32_t)0x00000007)
#define | SD_CARD_RECEIVING ((uint32_t)0x00000006)
#define | SD_DATATIMEOUT ((uint32_t)0xFFFFFFFF)
#define | SD_0TO7BITS ((uint32_t)0x000000FF)
#define | SD_8TO15BITS ((uint32_t)0x0000FF00)
#define | SD_16TO23BITS ((uint32_t)0x00FF0000)
#define | SD_24TO31BITS ((uint32_t)0xFF000000)
#define | SD_MAX_DATA_LENGTH ((uint32_t)0x01FFFFFF)
#define | SD_HALFFIFO ((uint32_t)0x00000008)
#define | SD_HALFFIFOBYTES ((uint32_t)0x00000020)

Detailed Description

Macro Definition Documentation

◆ MMC_SWITCH_ERROR

#define MMC_SWITCH_ERROR ((uint32_t)0x00000080)

Definition at line 374 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_0TO7BITS

#define SD_0TO7BITS ((uint32_t)0x000000FF)

Definition at line 404 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_16TO23BITS

#define SD_16TO23BITS ((uint32_t)0x00FF0000)

Definition at line 406 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_24TO31BITS

#define SD_24TO31BITS ((uint32_t)0xFF000000)

Definition at line 407 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_8TO15BITS

#define SD_8TO15BITS ((uint32_t)0x0000FF00)

Definition at line 405 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_ALLZERO

#define SD_ALLZERO ((uint32_t)0x00000000)

Definition at line 397 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CARD_LOCKED

#define SD_CARD_LOCKED ((uint32_t)0x02000000)

Definition at line 400 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CARD_PROGRAMMING

#define SD_CARD_PROGRAMMING ((uint32_t)0x00000007)

Definition at line 401 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CARD_RECEIVING

#define SD_CARD_RECEIVING ((uint32_t)0x00000006)

Definition at line 402 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CHECK_PATTERN

#define SD_CHECK_PATTERN ((uint32_t)0x000001AA)

Definition at line 394 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_DATATIMEOUT

#define SD_DATATIMEOUT ((uint32_t)0xFFFFFFFF)

Definition at line 403 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_HALFFIFO

#define SD_HALFFIFO ((uint32_t)0x00000008)

Definition at line 409 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_HALFFIFOBYTES

#define SD_HALFFIFOBYTES ((uint32_t)0x00000020)

Definition at line 410 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_HIGH_CAPACITY

#define SD_HIGH_CAPACITY ((uint32_t)0x40000000)

Definition at line 392 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_MAX_DATA_LENGTH

#define SD_MAX_DATA_LENGTH ((uint32_t)0x01FFFFFF)

Definition at line 408 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_MAX_VOLT_TRIAL

#define SD_MAX_VOLT_TRIAL ((uint32_t)0x0000FFFF)

Definition at line 396 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_ADDR_MISALIGNED

#define SD_OCR_ADDR_MISALIGNED ((uint32_t)0x40000000)

Definition at line 357 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_ADDR_OUT_OF_RANGE

#define SD_OCR_ADDR_OUT_OF_RANGE ((uint32_t)0x80000000)

mask for errors card status r1 (ocr register)

Definition at line 356 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_AKE_SEQ_ERROR

#define SD_OCR_AKE_SEQ_ERROR ((uint32_t)0x00000008)

Definition at line 375 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_BLK_LEN_ERR

#define SD_OCR_BLK_LEN_ERR ((uint32_t)0x20000000)

Definition at line 358 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_CARD_CONTROLLER_ERR

#define SD_OCR_CARD_CONTROLLER_ERR ((uint32_t)0x00100000)

Definition at line 366 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_CARD_ECC_DISABLED

#define SD_OCR_CARD_ECC_DISABLED ((uint32_t)0x00004000)

Definition at line 372 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_CARD_ECC_FAILED

#define SD_OCR_CARD_ECC_FAILED ((uint32_t)0x00200000)

Definition at line 365 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_CID_CSD_OVERWRIETE

#define SD_OCR_CID_CSD_OVERWRIETE ((uint32_t)0x00010000)

Definition at line 370 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_CMD_CRC_FAILED

#define SD_OCR_CMD_CRC_FAILED ((uint32_t)0x00800000)

Definition at line 363 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_ERASE_RESET

#define SD_OCR_ERASE_RESET ((uint32_t)0x00002000)

Definition at line 373 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_ERASE_SEQ_ERR

#define SD_OCR_ERASE_SEQ_ERR ((uint32_t)0x10000000)

Definition at line 359 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_ERRORBITS

#define SD_OCR_ERRORBITS ((uint32_t)0xFDFFE008)

Definition at line 376 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_GENERAL_UNKNOWN_ERROR

#define SD_OCR_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00080000)

Definition at line 367 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_ILLEGAL_CMD

#define SD_OCR_ILLEGAL_CMD ((uint32_t)0x00400000)

Definition at line 364 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_INVALID_ERASE_PARAM

#define SD_OCR_INVALID_ERASE_PARAM ((uint32_t)0x08000000)

Definition at line 360 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_LOCK_UNLOCK_FAILED

#define SD_OCR_LOCK_UNLOCK_FAILED ((uint32_t)0x01000000)

Definition at line 362 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_STREAM_RD_UNDERRUN

#define SD_OCR_STREAM_RD_UNDERRUN ((uint32_t)0x00040000)

Definition at line 368 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_STREAM_WR_OVERRUN

#define SD_OCR_STREAM_WR_OVERRUN ((uint32_t)0x00020000)

Definition at line 369 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_WP_ERASE_SKIP

#define SD_OCR_WP_ERASE_SKIP ((uint32_t)0x00008000)

Definition at line 371 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_OCR_WR_PROTECT_VIOLATION

#define SD_OCR_WR_PROTECT_VIOLATION ((uint32_t)0x04000000)

Definition at line 361 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_R5_ERROR

#define SD_R5_ERROR ((uint32_t)0x00000800)

Definition at line 383 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_R5_FUNCTION_NUMBER

#define SD_R5_FUNCTION_NUMBER ((uint32_t)0x00000200)

Definition at line 382 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_R5_OUT_OF_RANGE

#define SD_R5_OUT_OF_RANGE ((uint32_t)0x00000100)

masks for r5 response

Definition at line 381 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_R6_CMD_CRC_FAILED

#define SD_R6_CMD_CRC_FAILED ((uint32_t)0x00008000)

Definition at line 390 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_R6_GENERAL_UNKNOWN_ERROR

#define SD_R6_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00002000)

masks for r6 response

Definition at line 388 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_R6_ILLEGAL_CMD

#define SD_R6_ILLEGAL_CMD ((uint32_t)0x00004000)

Definition at line 389 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_SINGLE_BUS_SUPPORT

#define SD_SINGLE_BUS_SUPPORT ((uint32_t)0x00010000)

Definition at line 399 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_STD_CAPACITY

#define SD_STD_CAPACITY ((uint32_t)0x00000000)

Definition at line 393 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_VOLTAGE_WINDOW_MMC

#define SD_VOLTAGE_WINDOW_MMC ((uint32_t)0x80FF8000)

Definition at line 395 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_VOLTAGE_WINDOW_SD

#define SD_VOLTAGE_WINDOW_SD ((uint32_t)0x80100000)

Definition at line 391 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_WIDE_BUS_SUPPORT

#define SD_WIDE_BUS_SUPPORT ((uint32_t)0x00040000)

Definition at line 398 of file sdio_fatfs/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sdio_fatfs_command_class_definition

Macros
SDIO_sdio_fatfs_command_class_definition
AT32F415_periph_examples » SDIO_sdio_fatfs

Macros

#define | SD_CCCC_LOCK_UNLOCK ((uint32_t)0x00000080)
#define | SD_CCCC_WRITE_PROT ((uint32_t)0x00000040)
#define | SD_CCCC_ERASE ((uint32_t)0x00000020)

Detailed Description

Macro Definition Documentation

◆ SD_CCCC_ERASE

#define SD_CCCC_ERASE ((uint32_t)0x00000020)

Definition at line 425 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CCCC_LOCK_UNLOCK

#define SD_CCCC_LOCK_UNLOCK ((uint32_t)0x00000080)

command class supported

Definition at line 423 of file sdio_fatfs/inc/at32_sdio.h.

◆ SD_CCCC_WRITE_PROT

#define SD_CCCC_WRITE_PROT ((uint32_t)0x00000040)

Definition at line 424 of file sdio_fatfs/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sdio_fatfs_cmd8_definition

Macros
SDIO_sdio_fatfs_cmd8_definition
AT32F415_periph_examples » SDIO_sdio_fatfs

Macros

#define SDIO_SEND_IF_COND ((uint32_t)0x00000008)

Detailed Description

Macro Definition Documentation

◆ SDIO_SEND_IF_COND

#define SDIO_SEND_IF_COND ((uint32_t)0x00000008)

cmd8

Definition at line 438 of file sdio_fatfs/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sdio_fatfs_mmc_extend_definition

Macros
SDIO_sdio_fatfs_mmc_extend_definition
AT32F415_periph_examples » SDIO_sdio_fatfs

Macros

#define | EXT_CSD_Command_set 0x0
#define | EXT_CSD_Set_bit 0x1
#define | EXT_CSD_Clear_byte 0x2
#define | EXT_CSD_Write_byte 0x3
#define | EXT_CSD_CMD_SET_NORMAL (1<<0)
#define | EXT_CSD_CMD_SET_SECURE (1<<1)
#define | EXT_CSD_CMD_SET_CPSECURE (1<<2)
#define | EXT_CSD_BUS_WIDTH 183
#define | EXT_CSD_HS_TIMING 185

Detailed Description

Macro Definition Documentation

◆ EXT_CSD_BUS_WIDTH

#define EXT_CSD_BUS_WIDTH 183

mmc ext_csd offset

Definition at line 463 of file sdio_fatfs/inc/at32_sdio.h.

◆ EXT_CSD_Clear_byte

#define EXT_CSD_Clear_byte 0x2

Definition at line 453 of file sdio_fatfs/inc/at32_sdio.h.

◆ EXT_CSD_CMD_SET_CPSECURE

#define EXT_CSD_CMD_SET_CPSECURE (1<<2)

Definition at line 458 of file sdio_fatfs/inc/at32_sdio.h.

◆ EXT_CSD_CMD_SET_NORMAL

#define EXT_CSD_CMD_SET_NORMAL (1<<0)

Definition at line 456 of file sdio_fatfs/inc/at32_sdio.h.

◆ EXT_CSD_CMD_SET_SECURE

#define EXT_CSD_CMD_SET_SECURE (1<<1)

Definition at line 457 of file sdio_fatfs/inc/at32_sdio.h.

◆ EXT_CSD_Command_set

#define EXT_CSD_Command_set 0x0

mmc ext_csd operation

Definition at line 451 of file sdio_fatfs/inc/at32_sdio.h.

◆ EXT_CSD_HS_TIMING

#define EXT_CSD_HS_TIMING 185

Definition at line 464 of file sdio_fatfs/inc/at32_sdio.h.

◆ EXT_CSD_Set_bit

#define EXT_CSD_Set_bit 0x1

Definition at line 452 of file sdio_fatfs/inc/at32_sdio.h.

◆ EXT_CSD_Write_byte

#define EXT_CSD_Write_byte 0x3

Definition at line 454 of file sdio_fatfs/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sdio_fatfs_interrupt_flags_definition

Macros
SDIO_sdio_fatfs_interrupt_flags_definition
AT32F415_periph_examples » SDIO_sdio_fatfs

Macros

#define | SDIO_INTR_STS_WRITE_MASK
#define | SDIO_INTR_STS_READ_MASK

Detailed Description

Macro Definition Documentation

◆ SDIO_INTR_STS_READ_MASK

#define SDIO_INTR_STS_READ_MASK
Value:
(SDIO_DTFAIL_FLAG | SDIO_DTTIMEOUT_FLAG | SDIO_RXERRO_FLAG | \
SDIO_DTCMPL_FLAG | SDIO_SBITERR_FLAG)
SDIO_DTFAIL_FLAG
#define SDIO_DTFAIL_FLAG
Definition: at32f415_sdio.h:86
SDIO_RXERRO_FLAG
#define SDIO_RXERRO_FLAG
Definition: at32f415_sdio.h:90
SDIO_DTTIMEOUT_FLAG
#define SDIO_DTTIMEOUT_FLAG
Definition: at32f415_sdio.h:88
SDIO_SBITERR_FLAG
#define SDIO_SBITERR_FLAG
Definition: at32f415_sdio.h:94

Definition at line 476 of file sdio_fatfs/inc/at32_sdio.h.

◆ SDIO_INTR_STS_WRITE_MASK

#define SDIO_INTR_STS_WRITE_MASK
Value:
(SDIO_DTFAIL_FLAG | SDIO_DTTIMEOUT_FLAG | SDIO_TXERRU_FLAG | \
SDIO_DTCMPL_FLAG | SDIO_SBITERR_FLAG)
SDIO_TXERRU_FLAG
#define SDIO_TXERRU_FLAG
Definition: at32f415_sdio.h:89

Definition at line 474 of file sdio_fatfs/inc/at32_sdio.h.


AT32F415 Firmwary Library: SDIO_sdio_fatfs_exported_functions

Functions
SDIO_sdio_fatfs_exported_functions
AT32F415_periph_examples » SDIO_sdio_fatfs

Functions

sd_error_status_type | sd_init (void)
initializes the sd card and put it into standby state (ready for data transfer). More...
void | sdio_clock_set (uint32_t clkdiv)
set sdio clock devision factor. More...
sd_error_status_type | sd_power_on (void)
enquires cards about their operating voltage and configures clock controls. More...
sd_error_status_type | sd_power_off (void)
turns the sdio output signals off. More...
sd_error_status_type | sd_card_init (void)
intialises all cards or single card as the case may be card(s) come into standby state. More...
sd_error_status_type | sd_card_info_get (sd_card_info_struct_type *card_info)
returns information about specific card. More...
sd_error_status_type | sd_wide_bus_operation_config (sdio_bus_width_type mode)
enable wide bus opeartion for the requeseted card if supported by card. More...
sd_error_status_type | sd_device_mode_set (uint32_t mode)
set sdio work mode. More...
sd_error_status_type | sd_deselect_select (uint32_t addr)
selects od deselects the corresponding card. More...
sd_error_status_type | sd_status_send (uint32_t *p_card_status)
read current card status. More...
sd_card_state_type | sd_state_get (void)
returns information about sd card. More...
sd_error_status_type | sd_blocks_erase (long long addr, uint32_t nblks)
erase continuous data block More...
sd_error_status_type | sd_block_read (uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_read (uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_block_write (const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_write (const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed by dma mode only. More...
sd_error_status_type | mmc_stream_read (uint8_t *buf, long long addr, uint32_t len)
read mmc card data stream. More...
sd_error_status_type | mmc_stream_write (uint8_t *buf, long long addr, uint32_t len)
write mmc card data stream. More...
sd_error_status_type | sd_irq_service (void)
allows to process all the interrupts that are high. More...
void | sd_dma_config (uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
set dma configuation for sdio More...

Detailed Description

Function Documentation

◆ mmc_stream_read()

sd_error_status_type mmc_stream_read | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint32_t | len
 | ) |  |

read mmc card data stream.

Parameters
buf | buffer of saving data from mmc card
addr | start address of data from mmc card
len | data size
Return values
sd_error_status_type sd card error code.

Definition at line 1646 of file sd_mmc_card/src/at32_sdio.c.

◆ mmc_stream_write()

sd_error_status_type mmc_stream_write | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint32_t | len
 | ) |  |

write mmc card data stream.

Parameters
buf | data that writing to mmc card
addr | start address mmc card
len | data size
Return values
sd_error_status_type sd card error code.

Definition at line 1693 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_block_read()

sd_error_status_type sd_block_read | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size
 | ) |  |

allows to read one block from a specified address in a card. the data transfer can be managed by dma mode or polling mode.

Parameters
buf | pointer to the buffer that will contain the received data
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
Return values
sd_error_status_type sd card error code.

Definition at line 1180 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_block_write()

sd_error_status_type sd_block_write | ( | const uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size
 | ) |  |

allows to write one block starting from a specified address in a card. the data transfer can be managed by dma mode or polling mode.

Parameters
buf | pointer to the buffer that contain the data to be transferred.
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
Return values
sd_error_status_type sd card error code.

Definition at line 1360 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_blocks_erase()

sd_error_status_type sd_blocks_erase | ( | long long | addr,
 |  | uint32_t | nblks
 | ) |  |

erase continuous data block

Parameters
addr | starting address
nblks | amount of erasing data block
Return values
sd_error_status_type sd card error code.

Definition at line 1022 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_card_info_get()

sd_error_status_type sd_card_info_get ( sd_card_info_struct_type * card_info )

returns information about specific card.

Parameters
card_info pointer to a sd_card_info_struct_type structure that contains all sd card information.
Return values
sd_error_status_type sd card error code.

Definition at line 524 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_card_init()

sd_error_status_type sd_card_init ( void )

intialises all cards or single card as the case may be card(s) come into standby state.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 409 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_deselect_select()

sd_error_status_type sd_deselect_select ( uint32_t addr )

selects od deselects the corresponding card.

Parameters
addr address of the card to be selected.
Return values
sd_error_status_type sd card error code.

Definition at line 799 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_device_mode_set()

sd_error_status_type sd_device_mode_set ( uint32_t mode )

set sdio work mode.

Parameters
mode parameter as following values:
  • SD_TRANSFER_POLLING_MODE: dma mode.
  • SD_TRANSFER_POLLING_MODE: polling mode.
Return values
sd_error_status_type sd card error code.

Definition at line 778 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_dma_config()

void sd_dma_config | ( | uint32_t * | mbuf,
 |  | uint32_t | buf_size,
 |  | dma_dir_type | dir
 | ) |  |

set dma configuation for sdio

Parameters
mbuf | buffer address
buf_size | transmission data size
dir | dma direction, it is DMA_DIR_MEMORY_TO_PERIPHERAL(writing data) or DMA_DIR_PERIPHERAL_TO_MEMORY(read data)
Return values
none

Definition at line 2699 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sdio_command_data_send().

◆ sd_init()

sd_error_status_type sd_init ( void )

initializes the sd card and put it into standby state (ready for data transfer).

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 71 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sdio_command_data_send().

◆ sd_irq_service()

sd_error_status_type sd_irq_service ( void )

allows to process all the interrupts that are high.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 1782 of file sd_mmc_card/src/at32_sdio.c.

Referenced by SDIO1_IRQHandler(), and SDIO2_IRQHandler().

◆ sd_mult_blocks_read()

sd_error_status_type sd_mult_blocks_read | ( | uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size,
 |  | uint32_t | nblks
 | ) |  |

allows to read blocks from a specified address in a card. the data transfer can be managed by dma mode or polling mode.

Parameters
buf | pointer to the buffer that will contain the received data.
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
nblks | number of blocks to be read.
Return values
sd_error_status_type sd card error code.

Definition at line 1276 of file sdio_fatfs/src/at32_sdio.c.

◆ sd_mult_blocks_write()

sd_error_status_type sd_mult_blocks_write | ( | const uint8_t * | buf,
 |  | long long | addr,
 |  | uint16_t | blk_size,
 |  | uint32_t | nblks
 | ) |  |

allows to write blocks starting from a specified address in a card. the data transfer can be managed by dma mode only.

Parameters
buf | pointer to the buffer that contain the data to be transferred.
addr | address from where data are to be read.
blk_size | the sd card data block size. the block size should be 512.
nblks | number of blocks to be written.
Return values
sd_error_status_type sd card error code.

Definition at line 1482 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_power_off()

sd_error_status_type sd_power_off ( void )

turns the sdio output signals off.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 395 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_power_on()

sd_error_status_type sd_power_on ( void )

enquires cards about their operating voltage and configures clock controls.

Parameters
none
Return values
sd_error_status_type sd card error code.

Definition at line 189 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_init().

◆ sd_state_get()

sd_card_state_type sd_state_get ( void )

returns information about sd card.

Parameters
none.
Return values
sd_card_state_type sd card state code.

Definition at line 2482 of file sd_mmc_card/src/at32_sdio.c.

◆ sd_status_send()

sd_error_status_type sd_status_send ( uint32_t * p_card_status )

read current card status.

Parameters
p_card_status card status.
Return values
sd_error_status_type sd card error code.

Definition at line 2445 of file sd_mmc_card/src/at32_sdio.c.

Referenced by mmc_switch(), sd_block_write(), sd_mult_blocks_write(), and sd_state_get().

◆ sd_wide_bus_operation_config()

sd_error_status_type sd_wide_bus_operation_config ( sdio_bus_width_type mode )

enable wide bus opeartion for the requeseted card if supported by card.

Parameters
mode specifies the sd card wide bus mode. this parameter can be one of the following values:
  • SDIO_BUS_WIDTH_D8: 8-bit data transfer (only for mmc)
  • SDIO_BUS_WIDTH_D4: 4-bit data transfer
  • SDIO_BUS_WIDTH_D1: 1-bit data transfer
Return values
sd_error_status_type sd card error code.

Definition at line 735 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_init().

◆ sdio_clock_set()

void sdio_clock_set ( uint32_t clk_div )

set sdio clock devision factor.

Parameters
clkdiv sdio_ck = ahbclk / (clkdiv+2)
Return values
none

Definition at line 174 of file sd_mmc_card/src/at32_sdio.c.

Referenced by sd_init().


AT32F415 Firmwary Library: SPI_crc_transfer_polling

Macros | Functions | Variables
SPI_crc_transfer_polling
AT32F415_periph_examples

Macros

#define BUFFER_SIZE 32

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static void | gpio_config (void)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
error_status | buffer_compare (uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer compare function. More...
int | main (void)
main function. More...

Variables

uint16_t | spi1_tx_buffer [32]
uint16_t | spi2_tx_buffer [32]
uint16_t | spi1_rx_buffer [32]
uint16_t | spi2_rx_buffer [32]
uint32_t | tx_index = 0
uint32_t | rx_index = 0
__IO uint16_t | crc1_value = 0
__IO uint16_t | crc2_value = 0
volatile error_status | transfer_status1 = ERROR
volatile error_status | transfer_status2 = ERROR

Detailed Description

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE 32

Definition at line 38 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Function Documentation

◆ buffer_compare()

error_status buffer_compare | ( | uint16_t * | pbuffer1,
 |  | uint16_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

buffer compare function.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
the result of compare

Definition at line 63 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c.

◆ gpio_config()

static void gpio_config ( void )
static

gpio configuration.

Parameters
none
Return values
none

< gpio pins number 5

< gpio pins number 6

< gpio pins number 7

< gpio pins number 13

< gpio pins number 14

< gpio pins number 15

Definition at line 114 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< spi or i2s transmit data buffer empty flag

< spi or i2s receive data buffer full flag

< spi or i2s receive data buffer full flag

< spi or i2s transmit data buffer empty flag

< spi or i2s transmit data buffer empty flag

< spi or i2s receive data buffer full flag

< spi or i2s receive data buffer full flag

< spi or i2s receive data buffer full flag

< spi or i2s receive data buffer full flag

< spi crc calculation error flag

< spi crc calculation error flag

< spi crc calculation error flag

< spi crc calculation error flag

Definition at line 168 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c.

◆ spi_config()

static void spi_config ( void )
static

spi configuration.

Parameters
none
Return values
none

Definition at line 82 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Referenced by main().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c.

Variable Documentation

◆ crc1_value

__IO uint16_t crc1_value = 0

Definition at line 50 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Referenced by main().

◆ crc2_value

__IO uint16_t crc2_value = 0

Definition at line 50 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Referenced by main().

◆ rx_index

uint32_t rx_index = 0

Definition at line 49 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Referenced by main().

◆ spi1_rx_buffer

uint16_t spi1_rx_buffer[32]

Definition at line 48 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Referenced by main().

◆ spi1_tx_buffer

uint16_t spi1_tx_buffer[32]
Initial value:
= {0x0102, 0x0304, 0x0506, 0x0708, 0x090A, 0x0B0C, 0x0D0E, 0x0F10,
0x1112, 0x1314, 0x1516, 0x1718, 0x191A, 0x1B1C, 0x1D1E, 0x1F20,
0x2122, 0x2324, 0x2526, 0x2728, 0x292A, 0x2B2C, 0x2D2E, 0x2F30,
0x3132, 0x3334, 0x3536, 0x3738, 0x393A, 0x3B3C, 0x3D3E, 0x3F40}

Definition at line 40 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Referenced by main().

◆ spi2_rx_buffer

uint16_t spi2_rx_buffer[32]

Definition at line 48 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Referenced by main().

◆ spi2_tx_buffer

uint16_t spi2_tx_buffer[32]
Initial value:
= {0x5152, 0x5354, 0x5556, 0x5758, 0x595A, 0x5B5C, 0x5D5E, 0x5F60,
0x6162, 0x6364, 0x6566, 0x6768, 0x696A, 0x6B6C, 0x6D6E, 0x6F70,
0x7172, 0x7374, 0x7576, 0x7778, 0x797A, 0x7B7C, 0x7D7E, 0x7F80,
0x8182, 0x8384, 0x8586, 0x8788, 0x898A, 0x8B8C, 0x8D8E, 0x8F90}

Definition at line 44 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Referenced by main().

◆ transfer_status1

volatile error_status transfer_status1 = ERROR

Definition at line 51 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Referenced by main().

◆ transfer_status2

volatile error_status transfer_status2 = ERROR

Definition at line 51 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Referenced by main().

◆ tx_index

uint32_t tx_index = 0

Definition at line 49 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: SPI_fullduplex_polling

Macros | Functions | Variables
SPI_fullduplex_polling
AT32F415_periph_examples

Macros

#define BUFFER_SIZE 32

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static void | gpio_config (uint16_t spi1_mode, uint16_t spi2_mode)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
error_status | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t bufferlength)
buffer compare function. More...
int | main (void)
main function. More...

Variables

spi_init_type spi_init_struct
uint8_t | spi1_tx_buffer [32]
uint8_t | spi2_tx_buffer [32]
uint8_t | spi1_rx_buffer [32]
uint8_t | spi2_rx_buffer [32]
uint32_t | tx_index = 0
uint32_t | rx_index = 0
volatile error_status | transfer_status1 = ERROR
volatile error_status | transfer_status2 = ERROR
volatile error_status | transfer_status3 = ERROR
volatile error_status | transfer_status4 = ERROR

Detailed Description

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE 32

Definition at line 38 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Function Documentation

◆ buffer_compare()

error_status buffer_compare | ( | uint8_t * | pbuffer1,
 |  | uint8_t * | pbuffer2,
 |  | uint16_t | bufferlength
 | ) |  |

buffer compare function.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
the result of compare

Definition at line 64 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c.

◆ gpio_config()

static void gpio_config | ( | uint16_t | spi1_mode,
 |  | uint16_t | spi2_mode
 | ) |  |
static

gpio configuration.

Parameters
none
Return values
none

< gpio pins number 5

< gpio pins number 6

< gpio pins number 7

< gpio pins number 13

< gpio pins number 14

< gpio pins number 15

Definition at line 111 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< spi or i2s transmit data buffer empty flag

< spi or i2s receive data buffer full flag

< spi or i2s receive data buffer full flag

< spi or i2s transmit data buffer empty flag

< spi or i2s receive data buffer full flag

< spi or i2s receive data buffer full flag

Definition at line 203 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c.

◆ spi_config()

static void spi_config ( void )
static

spi configuration.

Parameters
none
Return values
none

Definition at line 84 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c.

Variable Documentation

◆ rx_index

uint32_t rx_index = 0

Definition at line 50 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main().

◆ spi1_rx_buffer

uint8_t spi1_rx_buffer[32]

Definition at line 49 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main().

◆ spi1_tx_buffer

uint8_t spi1_tx_buffer[32]
Initial value:
= {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20}

Definition at line 41 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main().

◆ spi2_rx_buffer

uint8_t spi2_rx_buffer[32]

Definition at line 49 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main().

◆ spi2_tx_buffer

uint8_t spi2_tx_buffer[32]
Initial value:
= {0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60,
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70}

Definition at line 45 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main().

◆ spi_init_struct

spi_init_type spi_init_struct

Definition at line 40 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main(), spi_config(), spi_default_para_init(), spi_init(), spiflash_init(), and usart_spi_configuration().

◆ transfer_status1

volatile error_status transfer_status1 = ERROR

Definition at line 51 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main().

◆ transfer_status2

volatile error_status transfer_status2 = ERROR

Definition at line 51 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main().

◆ transfer_status3

volatile error_status transfer_status3 = ERROR

Definition at line 52 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main().

◆ transfer_status4

volatile error_status transfer_status4 = ERROR

Definition at line 52 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main().

◆ tx_index

uint32_t tx_index = 0

Definition at line 50 of file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: SPI_halfduplex_interrupt

Macros | Functions | Variables
SPI_halfduplex_interrupt
AT32F415_periph_examples

Macros

#define | BUFFERSIZE 32
#define | BUFFER_SIZE 32

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | SPI1_IRQHandler (void)
This function handles the spi1 interrupt request. More...
void | SPI2_IRQHandler (void)
This function handles the spi2 interrupt request. More...
static void | gpio_config (void)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
error_status | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function. More...
int | main (void)
main function. More...

Variables

spi_init_type spi_init_struct
uint8_t | spi1_tx_buffer [32]
uint8_t | spi2_rx_buffer [32]
volatile uint32_t | tx_index = 0
volatile uint32_t | rx_index = 0
volatile error_status | transfer_status = ERROR

Detailed Description

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE 32

Definition at line 38 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c.

◆ BUFFERSIZE

#define BUFFERSIZE 32

Definition at line 44 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c.

Function Documentation

◆ buffer_compare()

error_status buffer_compare | ( | uint8_t * | pbuffer1,
 |  | uint8_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

buffer compare function.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
the result of compare

Definition at line 60 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 86 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 121 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c.

◆ gpio_config()

static void gpio_config ( void )
static

gpio configuration.

Parameters
none
Return values
none

< gpio pins number 5

< gpio pins number 7

< gpio pins number 13

< gpio pins number 14

< gpio pins number 13

Definition at line 113 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 60 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 154 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 73 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 51 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 130 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c.

◆ SPI1_IRQHandler()

void SPI1_IRQHandler ( void )

This function handles the spi1 interrupt request.

Parameters
None
Return values
None

< spi or i2s transmit data buffer empty flag

< transmit data buffer empty interrupt

Definition at line 148 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c.

◆ SPI2_IRQHandler()

void SPI2_IRQHandler ( void )

This function handles the spi2 interrupt request.

Parameters
None
Return values
None

< spi or i2s receive data buffer full flag

Definition at line 165 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c.

◆ spi_config()

static void spi_config ( void )
static

spi configuration.

Parameters
none
Return values
none

< transmit data buffer empty interrupt

< receive data buffer full interrupt

Definition at line 80 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 112 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 139 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 99 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c.

Variable Documentation

◆ rx_index

volatile uint32_t rx_index = 0

Definition at line 47 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ spi1_tx_buffer

uint8_t spi1_tx_buffer[32]
Initial value:
= {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20}

Definition at line 42 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ spi2_rx_buffer

uint8_t spi2_rx_buffer[32]

Definition at line 46 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ spi_init_struct

spi_init_type spi_init_struct

Definition at line 40 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c.

Referenced by spi_config().

◆ transfer_status

volatile error_status transfer_status = ERROR

Definition at line 48 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c.

Referenced by main().

◆ tx_index

volatile uint32_t tx_index = 0

Definition at line 47 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c.


AT32F415 Firmwary Library: SPI_halfduplex_transceiver_switch

Macros | Functions | Variables
SPI_halfduplex_transceiver_switch
AT32F415_periph_examples

Macros

#define | BUFFERSIZE 32
#define | BUFFER_SIZE 32

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | SPI1_IRQHandler (void)
This function handles the spi1 interrupt request. More...
void | SPI2_IRQHandler (void)
This function handles the spi2 interrupt request. More...
static void | gpio_config (void)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
error_status | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function. More...
int | main (void)
main function. More...

Variables

spi_init_type spi_init_struct
uint8_t | spi1_tx_buffer [32]
uint8_t | spi2_tx_buffer [32]
uint8_t | spi1_rx_buffer [32]
uint8_t | spi2_rx_buffer [32]
volatile uint32_t | tx_index = 0
volatile uint32_t | rx_index = 0
volatile error_status | transfer_status1 = ERROR
volatile error_status | transfer_status2 = ERROR

Detailed Description

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE 32

Definition at line 38 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

◆ BUFFERSIZE

#define BUFFERSIZE 32

Definition at line 46 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c.

Function Documentation

◆ buffer_compare()

error_status buffer_compare | ( | uint8_t * | pbuffer1,
 |  | uint8_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

buffer compare function.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
the result of compare

Definition at line 64 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 88 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c.

◆ gpio_config()

static void gpio_config ( void )
static

gpio configuration.

Parameters
none
Return values
none

< gpio pins number 5

< gpio pins number 7

< gpio pins number 13

< gpio pins number 14

< gpio pins number 13

Definition at line 117 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 62 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< transmit data buffer empty interrupt

< receive data buffer full interrupt

< receive data buffer full interrupt

< transmit data buffer empty interrupt

Definition at line 158 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 75 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c.

◆ SPI1_IRQHandler()

void SPI1_IRQHandler ( void )

This function handles the spi1 interrupt request.

Parameters
None
Return values
None

< spi or i2s transmit data buffer empty flag

< transmit data buffer empty interrupt

< spi or i2s receive data buffer full flag

< spi or i2s receive data buffer full flag

Definition at line 150 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c.

◆ SPI2_IRQHandler()

void SPI2_IRQHandler ( void )

This function handles the spi2 interrupt request.

Parameters
None
Return values
None

< spi or i2s transmit data buffer empty flag

< transmit data buffer empty interrupt

< spi or i2s receive data buffer full flag

Definition at line 183 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c.

◆ spi_config()

static void spi_config ( void )
static

spi configuration.

Parameters
none
Return values
none

< transmit data buffer empty interrupt

< receive data buffer full interrupt

Definition at line 84 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

Referenced by main().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 141 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 101 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c.

Variable Documentation

◆ rx_index

volatile uint32_t rx_index = 0

Definition at line 51 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

Referenced by main().

◆ spi1_rx_buffer

uint8_t spi1_rx_buffer[32]

Definition at line 50 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

Referenced by main(), and SPI1_IRQHandler().

◆ spi1_tx_buffer

uint8_t spi1_tx_buffer[32]
Initial value:
= {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20}

Definition at line 42 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

Referenced by main().

◆ spi2_rx_buffer

uint8_t spi2_rx_buffer[32]

Definition at line 50 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

Referenced by main().

◆ spi2_tx_buffer

uint8_t spi2_tx_buffer[32]
Initial value:
= {0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60,
0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70}

Definition at line 46 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

Referenced by main().

◆ spi_init_struct

spi_init_type spi_init_struct

Definition at line 41 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

Referenced by main(), and spi_config().

◆ transfer_status1

volatile error_status transfer_status1 = ERROR

Definition at line 52 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

Referenced by main().

◆ transfer_status2

volatile error_status transfer_status2 = ERROR

Definition at line 52 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

Referenced by main().

◆ tx_index

volatile uint32_t tx_index = 0

Definition at line 51 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: SPI_only_receive_mode_polling

Macros | Functions | Variables
SPI_only_receive_mode_polling
AT32F415_periph_examples

Macros

#define BUFFER_SIZE 32

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static void | gpio_config (void)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
error_status | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function. More...
int | main (void)
main function. More...

Variables

spi_init_type spi_init_struct
uint8_t | spi1_tx_buffer [32]
uint8_t | spi2_rx_buffer [32]
uint32_t | tx_index = 0
uint32_t | rx_index = 0
volatile error_status | transfer_status = ERROR

Detailed Description

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE 32

Definition at line 38 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c.

Function Documentation

◆ buffer_compare()

error_status buffer_compare | ( | uint8_t * | pbuffer1,
 |  | uint8_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

buffer compare function.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
the result of compare

Definition at line 59 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c.

◆ gpio_config()

static void gpio_config ( void )
static

gpio configuration.

Parameters
none
Return values
none

< gpio pins number 5

< gpio pins number 7

< gpio pins number 13

< gpio pins number 15

< gpio pins number 13

Definition at line 107 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< spi or i2s transmit data buffer empty flag

< spi or i2s receive data buffer full flag

Definition at line 148 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c.

◆ spi_config()

static void spi_config ( void )
static

spi configuration.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c.

Referenced by main().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c.

Variable Documentation

◆ rx_index

uint32_t rx_index = 0

Definition at line 46 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c.

Referenced by main(), SPI1_IRQHandler(), and SPI2_IRQHandler().

◆ spi1_tx_buffer

uint8_t spi1_tx_buffer[32]
Initial value:
= {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20}

Definition at line 41 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c.

Referenced by main().

◆ spi2_rx_buffer

uint8_t spi2_rx_buffer[32]

Definition at line 45 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c.

Referenced by main().

◆ spi_init_struct

spi_init_type spi_init_struct

Definition at line 40 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c.

Referenced by spi_config().

◆ transfer_status

volatile error_status transfer_status = ERROR

Definition at line 47 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c.

Referenced by main().

◆ tx_index

uint32_t tx_index = 0

Definition at line 46 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: SPI_use_jtagpin_hardwarecs_dma

Macros | Functions | Variables
SPI_use_jtagpin_hardwarecs_dma
AT32F415_periph_examples

Macros

#define BUFFER_SIZE 32

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
static void | gpio_config (void)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
error_status | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function. More...
int | main (void)
main function. More...

Variables

uint8_t | spi1_tx_buffer [32]
uint8_t | spi2_rx_buffer [32]
__IO uint8_t | tx_index = 0
volatile error_status | transfer_status = ERROR

Detailed Description

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE 32

Definition at line 38 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c.

Function Documentation

◆ buffer_compare()

error_status buffer_compare | ( | uint8_t * | pbuffer1,
 |  | uint8_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

buffer compare function.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
the result of compare

Definition at line 58 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c.

◆ gpio_config()

static void gpio_config ( void )
static

gpio configuration.

Parameters
none
Return values
none

< jtag-dp disabled and sw-dp enabled

< spi1_cs/i2s1_ws(pa15), spi1_sck/i2s1_ck(pb3), spi1_miso(pb4), spi1_mosi/i2s1_sd(pb5), i2s1_mck(pb6)

< spi1_cs/i2s1_ws(pa15), spi1_sck/i2s1_ck(pb3), spi1_miso(pb4), spi1_mosi/i2s1_sd(pb5), i2s1_mck(pb6)

< gpio pins number 3

< gpio pins number 4

< gpio pins number 5

< gpio pins number 15

< gpio pins number 13

< gpio pins number 14

< gpio pins number 15

< gpio pins number 12

Definition at line 126 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< spi or i2s transmit data buffer empty flag

< dma1 channel4 full data transfer flag

Definition at line 191 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c.

◆ spi_config()

static void spi_config ( void )
static

spi configuration.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c.

Referenced by main().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c.

Variable Documentation

◆ spi1_tx_buffer

uint8_t spi1_tx_buffer[32]
Initial value:
= {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20}

Definition at line 40 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c.

Referenced by main(), and SPI1_IRQHandler().

◆ spi2_rx_buffer

uint8_t spi2_rx_buffer[32]

Definition at line 44 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c.

Referenced by main(), and spi_config().

◆ transfer_status

volatile error_status transfer_status = ERROR

Definition at line 46 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c.

Referenced by main().

◆ tx_index

__IO uint8_t tx_index = 0

Definition at line 45 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c.

Referenced by main(), SPI1_IRQHandler(), and SPI2_IRQHandler().


AT32F415 Firmwary Library: SPI_w25q_flash

Modules | Macros | Functions | Variables
SPI_w25q_flash
AT32F415_periph_examples

Modules

SPI_flash_cs_pin_definition
SPI_flash_id_definition
SPI_flash_operation_definition
SPI_flash_exported_functions

Macros

#define | FLASH_TEST_ADDR 0x1000
#define | BUF_SIZE 0x256

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | tx_data_fill (void)
transfer data fill. More...
error_status | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function. More...
int | main (void)
main function. More...
void | spiflash_init (void)
spi configuration. More...
void | spiflash_write (uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write data to flash More...
void | spiflash_read (uint8_t *pbuffer, uint32_t read_addr, uint32_t length)
read data from flash More...
void | spiflash_sector_erase (uint32_t erase_addr)
erase a sector data More...
void | spiflash_write_nocheck (uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write data without check More...
void | spiflash_page_write (uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write a page data More...
void | spi_bytes_write (uint8_t *pbuffer, uint32_t length)
write data continuously More...
void | spi_bytes_read (uint8_t *pbuffer, uint32_t length)
read data continuously More...
void | spiflash_wait_busy (void)
wait program done More...
uint8_t | spiflash_read_sr1 (void)
read sr1 register More...
void | spiflash_write_enable (void)
enable write operation More...
uint16_t | spiflash_read_id (void)
read device id More...
uint8_t | spi_byte_write (uint8_t data)
write a byte to flash More...
uint8_t | spi_byte_read (void)
read a byte to flash More...

Variables

uint8_t | tx_buffer [0x256]
uint8_t | rx_buffer [0x256]
volatile error_status | transfer_status = ERROR
uint8_t | spiflash_sector_buf [SPIF_SECTOR_SIZE]

Detailed Description

Macro Definition Documentation

◆ BUF_SIZE

#define BUF_SIZE 0x256

Definition at line 40 of file project/at_start_f415/examples/spi/w25q_flash/src/main.c.

◆ FLASH_TEST_ADDR

#define FLASH_TEST_ADDR 0x1000

Definition at line 39 of file project/at_start_f415/examples/spi/w25q_flash/src/main.c.

Function Documentation

◆ buffer_compare()

error_status buffer_compare | ( | uint8_t * | pbuffer1,
 |  | uint8_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

buffer compare function.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
the result of compare

Definition at line 69 of file project/at_start_f415/examples/spi/w25q_flash/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 89 of file project/at_start_f415/examples/spi/w25q_flash/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c.

◆ spi_byte_read()

uint8_t spi_byte_read ( void )

read a byte to flash

Parameters
none
Return values
flash return data

Definition at line 504 of file spi_flash.c.

Referenced by spiflash_read_id(), and spiflash_read_sr1().

◆ spi_byte_write()

uint8_t spi_byte_write ( uint8_t data )

write a byte to flash

Parameters
data data to write
Return values
flash return data

Definition at line 487 of file spi_flash.c.

Referenced by spi_byte_read(), spiflash_page_write(), spiflash_read(), spiflash_read_id(), spiflash_read_sr1(), spiflash_sector_erase(), and spiflash_write_enable().

◆ spi_bytes_read()

void spi_bytes_read | ( | uint8_t * | pbuffer,
 |  | uint32_t | length
 | ) |  |

read data continuously

Parameters
pbuffer | buffer to save data
length | buffer length
Return values
none

Definition at line 368 of file spi_flash.c.

Referenced by spiflash_read().

◆ spi_bytes_write()

void spi_bytes_write | ( | uint8_t * | pbuffer,
 |  | uint32_t | length
 | ) |  |

write data continuously

Parameters
pbuffer | the pointer for data buffer
length | buffer length
Return values
none

Definition at line 303 of file spi_flash.c.

Referenced by spiflash_page_write().

◆ spiflash_init()

void spiflash_init ( void )

spi configuration.

Parameters
none
Return values
none

Definition at line 44 of file spi_flash.c.

Referenced by main().

◆ spiflash_page_write()

void spiflash_page_write | ( | uint8_t * | pbuffer,
 |  | uint32_t | write_addr,
 |  | uint32_t | length
 | ) |  |

write a page data

Parameters
pbuffer | the pointer for data buffer
write_addr | the address where the data is written
length | buffer length
Return values
none

Definition at line 272 of file spi_flash.c.

Referenced by spiflash_write_nocheck().

◆ spiflash_read()

void spiflash_read | ( | uint8_t * | pbuffer,
 |  | uint32_t | read_addr,
 |  | uint32_t | length
 | ) |  |

read data from flash

Parameters
pbuffer | the pointer for data buffer
read_addr | the address where the data is read
length | buffer length
Return values
none

Definition at line 187 of file spi_flash.c.

Referenced by main(), and spiflash_write().

◆ spiflash_read_id()

uint16_t spiflash_read_id ( void )

read device id

Parameters
none
Return values
device id

Definition at line 468 of file spi_flash.c.

Referenced by main().

◆ spiflash_read_sr1()

uint8_t spiflash_read_sr1 ( void )

read sr1 register

Parameters
none
Return values
none

Definition at line 441 of file spi_flash.c.

Referenced by spiflash_wait_busy().

◆ spiflash_sector_erase()

void spiflash_sector_erase ( uint32_t erase_addr )

erase a sector data

Parameters
erase_addr sector address to erase
Return values
none

Definition at line 203 of file spi_flash.c.

Referenced by main(), and spiflash_write().

◆ spiflash_wait_busy()

void spiflash_wait_busy ( void )

wait program done

Parameters
none
Return values
none

Definition at line 431 of file spi_flash.c.

Referenced by spiflash_page_write(), and spiflash_sector_erase().

◆ spiflash_write()

void spiflash_write | ( | uint8_t * | pbuffer,
 |  | uint32_t | write_addr,
 |  | uint32_t | length
 | ) |  |

write data to flash

Parameters
pbuffer | the pointer for data buffer
write_addr | the address where the data is written
length | buffer length
Return values
none

Definition at line 99 of file spi_flash.c.

Referenced by main().

◆ spiflash_write_enable()

void spiflash_write_enable ( void )

enable write operation

Parameters
none
Return values
none

Definition at line 456 of file spi_flash.c.

Referenced by spiflash_page_write(), and spiflash_sector_erase().

◆ spiflash_write_nocheck()

void spiflash_write_nocheck | ( | uint8_t * | pbuffer,
 |  | uint32_t | write_addr,
 |  | uint32_t | length
 | ) |  |

write data without check

Parameters
pbuffer | the pointer for data buffer
write_addr | the address where the data is written
length | buffer length
Return values
none

Definition at line 224 of file spi_flash.c.

Referenced by spiflash_write().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c.

◆ tx_data_fill()

void tx_data_fill ( void )

transfer data fill.

Parameters
none
Return values
none

Definition at line 54 of file project/at_start_f415/examples/spi/w25q_flash/src/main.c.

Referenced by main().

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c.

Variable Documentation

◆ rx_buffer

uint8_t rx_buffer[0x256]

Definition at line 43 of file project/at_start_f415/examples/spi/w25q_flash/src/main.c.

Referenced by main().

◆ spiflash_sector_buf

uint8_t spiflash_sector_buf[SPIF_SECTOR_SIZE]

Definition at line 37 of file spi_flash.c.

Referenced by spiflash_write().

◆ transfer_status

volatile error_status transfer_status = ERROR

Definition at line 44 of file project/at_start_f415/examples/spi/w25q_flash/src/main.c.

Referenced by main().

◆ tx_buffer

uint8_t tx_buffer[0x256]

Definition at line 42 of file project/at_start_f415/examples/spi/w25q_flash/src/main.c.

Referenced by main(), and tx_data_fill().


AT32F415 Firmwary Library: SPI_flash_cs_pin_definition

Macros
SPI_flash_cs_pin_definition
AT32F415_periph_examples » SPI_w25q_flash

Macros

#define | FLASH_CS_HIGH() gpio_bits_set(GPIOA, GPIO_PINS_4)
#define | FLASH_CS_LOW() gpio_bits_reset(GPIOA, GPIO_PINS_4)

Detailed Description

Macro Definition Documentation

◆ FLASH_CS_HIGH

#define FLASH_CS_HIGH ( ) gpio_bits_set(GPIOA, GPIO_PINS_4)

Definition at line 52 of file spi_flash.h.

◆ FLASH_CS_LOW

#define FLASH_CS_LOW ( ) gpio_bits_reset(GPIOA, GPIO_PINS_4)

Definition at line 53 of file spi_flash.h.


AT32F415 Firmwary Library: SPI_flash_id_definition

Macros
SPI_flash_id_definition
AT32F415_periph_examples » SPI_w25q_flash

Macros

#define | W25Q80 0xEF13
#define | W25Q16 0xEF14
#define | W25Q32 0xEF15
#define | W25Q64 0xEF16
#define | W25Q128 0xEF17

Detailed Description

Macro Definition Documentation

◆ W25Q128

#define W25Q128 0xEF17

Definition at line 71 of file spi_flash.h.

◆ W25Q16

#define W25Q16 0xEF14

Definition at line 67 of file spi_flash.h.

◆ W25Q32

#define W25Q32 0xEF15

Definition at line 68 of file spi_flash.h.

◆ W25Q64

#define W25Q64 0xEF16

Definition at line 69 of file spi_flash.h.

◆ W25Q80

#define W25Q80 0xEF13

Definition at line 66 of file spi_flash.h.


AT32F415 Firmwary Library: SPI_flash_operation_definition

Macros
SPI_flash_operation_definition
AT32F415_periph_examples » SPI_w25q_flash

Macros

#define | SPIF_CHIP_SIZE 0x1000000
#define | SPIF_SECTOR_SIZE 4096
#define | SPIF_PAGE_SIZE 256
#define | SPIF_WRITEENABLE 0x06
#define | SPIF_WRITEDISABLE 0x04
#define | SPIF_READSTATUSREG1 0x05
#define | SPIF_WRITESTATUSREG1 0x01
#define | SPIF_READSTATUSREG2 0x35
#define | SPIF_WRITESTATUSREG2 0x31
#define | SPIF_READSTATUSREG3 0x15
#define | SPIF_WRITESTATUSREG3 0x11
#define | SPIF_READDATA 0x03
#define | SPIF_FASTREADDATA 0x0B
#define | SPIF_FASTREADDUAL 0x3B
#define | SPIF_PAGEPROGRAM 0x02
#define | SPIF_BLOCKERASE 0xD8
#define | SPIF_SECTORERASE 0x20
#define | SPIF_CHIPERASE 0xC7
#define | SPIF_POWERDOWN 0xB9
#define | SPIF_RELEASEPOWERDOWN 0xAB
#define | SPIF_DEVICEID 0xAB
#define | SPIF_MANUFACTDEVICEID 0x90
#define | SPIF_JEDECDEVICEID 0x9F
#define | FLASH_SPI_DUMMY_BYTE 0xA5

Detailed Description

Macro Definition Documentation

◆ FLASH_SPI_DUMMY_BYTE

#define FLASH_SPI_DUMMY_BYTE 0xA5

Definition at line 109 of file spi_flash.h.

◆ SPIF_BLOCKERASE

#define SPIF_BLOCKERASE 0xD8

Definition at line 101 of file spi_flash.h.

◆ SPIF_CHIP_SIZE

#define SPIF_CHIP_SIZE 0x1000000

Definition at line 81 of file spi_flash.h.

◆ SPIF_CHIPERASE

#define SPIF_CHIPERASE 0xC7

Definition at line 103 of file spi_flash.h.

◆ SPIF_DEVICEID

#define SPIF_DEVICEID 0xAB

Definition at line 106 of file spi_flash.h.

◆ SPIF_FASTREADDATA

#define SPIF_FASTREADDATA 0x0B

Definition at line 97 of file spi_flash.h.

◆ SPIF_FASTREADDUAL

#define SPIF_FASTREADDUAL 0x3B

Definition at line 98 of file spi_flash.h.

◆ SPIF_JEDECDEVICEID

#define SPIF_JEDECDEVICEID 0x9F

Definition at line 108 of file spi_flash.h.

◆ SPIF_MANUFACTDEVICEID

#define SPIF_MANUFACTDEVICEID 0x90

Definition at line 107 of file spi_flash.h.

◆ SPIF_PAGE_SIZE

#define SPIF_PAGE_SIZE 256

Definition at line 83 of file spi_flash.h.

◆ SPIF_PAGEPROGRAM

#define SPIF_PAGEPROGRAM 0x02

Definition at line 99 of file spi_flash.h.

◆ SPIF_POWERDOWN

#define SPIF_POWERDOWN 0xB9

Definition at line 104 of file spi_flash.h.

◆ SPIF_READDATA

#define SPIF_READDATA 0x03

Definition at line 96 of file spi_flash.h.

◆ SPIF_READSTATUSREG1

#define SPIF_READSTATUSREG1 0x05

Definition at line 88 of file spi_flash.h.

◆ SPIF_READSTATUSREG2

#define SPIF_READSTATUSREG2 0x35

Definition at line 91 of file spi_flash.h.

◆ SPIF_READSTATUSREG3

#define SPIF_READSTATUSREG3 0x15

Definition at line 94 of file spi_flash.h.

◆ SPIF_RELEASEPOWERDOWN

#define SPIF_RELEASEPOWERDOWN 0xAB

Definition at line 105 of file spi_flash.h.

◆ SPIF_SECTOR_SIZE

#define SPIF_SECTOR_SIZE 4096

Definition at line 82 of file spi_flash.h.

◆ SPIF_SECTORERASE

#define SPIF_SECTORERASE 0x20

Definition at line 102 of file spi_flash.h.

◆ SPIF_WRITEDISABLE

#define SPIF_WRITEDISABLE 0x04

Definition at line 86 of file spi_flash.h.

◆ SPIF_WRITEENABLE

#define SPIF_WRITEENABLE 0x06

Definition at line 85 of file spi_flash.h.

◆ SPIF_WRITESTATUSREG1

#define SPIF_WRITESTATUSREG1 0x01

Definition at line 89 of file spi_flash.h.

◆ SPIF_WRITESTATUSREG2

#define SPIF_WRITESTATUSREG2 0x31

Definition at line 92 of file spi_flash.h.

◆ SPIF_WRITESTATUSREG3

#define SPIF_WRITESTATUSREG3 0x11

Definition at line 95 of file spi_flash.h.


AT32F415 Firmwary Library: SPI_flash_exported_functions

Functions
SPI_flash_exported_functions
AT32F415_periph_examples » SPI_w25q_flash

Functions

void | spiflash_init (void)
spi configuration. More...
void | spiflash_write (uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write data to flash More...
void | spiflash_read (uint8_t *pbuffer, uint32_t read_addr, uint32_t length)
read data from flash More...
void | spiflash_sector_erase (uint32_t erase_addr)
erase a sector data More...
void | spiflash_write_nocheck (uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write data without check More...
void | spiflash_page_write (uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write a page data More...
void | spi_bytes_write (uint8_t *pbuffer, uint32_t length)
write data continuously More...
void | spi_bytes_read (uint8_t *pbuffer, uint32_t length)
read data continuously More...
void | spiflash_wait_busy (void)
wait program done More...
uint8_t | spiflash_read_sr1 (void)
read sr1 register More...
void | spiflash_write_enable (void)
enable write operation More...
uint16_t | spiflash_read_id (void)
read device id More...
uint8_t | spi_byte_write (uint8_t data)
write a byte to flash More...
uint8_t | spi_byte_read (void)
read a byte to flash More...

Detailed Description

Function Documentation

◆ spi_byte_read()

uint8_t spi_byte_read ( void )

read a byte to flash

Parameters
none
Return values
flash return data

Definition at line 504 of file spi_flash.c.

Referenced by spiflash_read_id(), and spiflash_read_sr1().

◆ spi_byte_write()

uint8_t spi_byte_write ( uint8_t data )

write a byte to flash

Parameters
data data to write
Return values
flash return data

Definition at line 487 of file spi_flash.c.

Referenced by spi_byte_read(), spiflash_page_write(), spiflash_read(), spiflash_read_id(), spiflash_read_sr1(), spiflash_sector_erase(), and spiflash_write_enable().

◆ spi_bytes_read()

void spi_bytes_read | ( | uint8_t * | pbuffer,
 |  | uint32_t | length
 | ) |  |

read data continuously

Parameters
pbuffer | buffer to save data
length | buffer length
Return values
none

Definition at line 368 of file spi_flash.c.

Referenced by spiflash_read().

◆ spi_bytes_write()

void spi_bytes_write | ( | uint8_t * | pbuffer,
 |  | uint32_t | length
 | ) |  |

write data continuously

Parameters
pbuffer | the pointer for data buffer
length | buffer length
Return values
none

Definition at line 303 of file spi_flash.c.

Referenced by spiflash_page_write().

◆ spiflash_init()

void spiflash_init ( void )

spi configuration.

Parameters
none
Return values
none

Definition at line 44 of file spi_flash.c.

Referenced by main().

◆ spiflash_page_write()

void spiflash_page_write | ( | uint8_t * | pbuffer,
 |  | uint32_t | write_addr,
 |  | uint32_t | length
 | ) |  |

write a page data

Parameters
pbuffer | the pointer for data buffer
write_addr | the address where the data is written
length | buffer length
Return values
none

Definition at line 272 of file spi_flash.c.

Referenced by spiflash_write_nocheck().

◆ spiflash_read()

void spiflash_read | ( | uint8_t * | pbuffer,
 |  | uint32_t | read_addr,
 |  | uint32_t | length
 | ) |  |

read data from flash

Parameters
pbuffer | the pointer for data buffer
read_addr | the address where the data is read
length | buffer length
Return values
none

Definition at line 187 of file spi_flash.c.

Referenced by main(), and spiflash_write().

◆ spiflash_read_id()

uint16_t spiflash_read_id ( void )

read device id

Parameters
none
Return values
device id

Definition at line 468 of file spi_flash.c.

Referenced by main().

◆ spiflash_read_sr1()

uint8_t spiflash_read_sr1 ( void )

read sr1 register

Parameters
none
Return values
none

Definition at line 441 of file spi_flash.c.

Referenced by spiflash_wait_busy().

◆ spiflash_sector_erase()

void spiflash_sector_erase ( uint32_t erase_addr )

erase a sector data

Parameters
erase_addr sector address to erase
Return values
none

Definition at line 203 of file spi_flash.c.

Referenced by main(), and spiflash_write().

◆ spiflash_wait_busy()

void spiflash_wait_busy ( void )

wait program done

Parameters
none
Return values
none

Definition at line 431 of file spi_flash.c.

Referenced by spiflash_page_write(), and spiflash_sector_erase().

◆ spiflash_write()

void spiflash_write | ( | uint8_t * | pbuffer,
 |  | uint32_t | write_addr,
 |  | uint32_t | length
 | ) |  |

write data to flash

Parameters
pbuffer | the pointer for data buffer
write_addr | the address where the data is written
length | buffer length
Return values
none

Definition at line 99 of file spi_flash.c.

Referenced by main().

◆ spiflash_write_enable()

void spiflash_write_enable ( void )

enable write operation

Parameters
none
Return values
none

Definition at line 456 of file spi_flash.c.

Referenced by spiflash_page_write(), and spiflash_sector_erase().

◆ spiflash_write_nocheck()

void spiflash_write_nocheck | ( | uint8_t * | pbuffer,
 |  | uint32_t | write_addr,
 |  | uint32_t | length
 | ) |  |

write data without check

Parameters
pbuffer | the pointer for data buffer
write_addr | the address where the data is written
length | buffer length
Return values
none

Definition at line 224 of file spi_flash.c.

Referenced by spiflash_write().


AT32F415 Firmwary Library: TMR_6_steps

Functions | Variables
TMR_6_steps
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | systick_configuration (void)
configures the systick. More...
int | main (void)
main function. More...
void | TMR1_TRG_HALL_TMR11_IRQHandler (void)
this function handles tmr1 trigger and hall interrupts requests. More...

Variables

gpio_init_type | gpio_init_struct = {0}
tmr_output_config_type tmr_output_struct
tmr_brkdt_config_type | tmr_brkdt_config_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
__IO uint32_t | step = 1

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< gpio pins number 8

< gpio pins number 9

< gpio pins number 10

< gpio pins number 13

< gpio pins number 14

< gpio pins number 15

< gpio pins number 12

< tmr interrupt hall

Definition at line 53 of file project/at_start_f415/examples/tmr/6_steps/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c.

◆ systick_configuration()

void systick_configuration ( void )

configures the systick.

Parameters
none
Return values
none

Definition at line 185 of file project/at_start_f415/examples/tmr/6_steps/src/main.c.

Referenced by main().

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c.

◆ TMR1_TRG_HALL_TMR11_IRQHandler()

void TMR1_TRG_HALL_TMR11_IRQHandler ( void )

this function handles tmr1 trigger and hall interrupts requests.

Parameters
none
Return values
none

< tmr flag hall

Definition at line 202 of file project/at_start_f415/examples/tmr/6_steps/src/main.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c.

Variable Documentation

◆ crm_clocks_freq_struct

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Definition at line 41 of file project/at_start_f415/examples/tmr/6_steps/src/main.c.

Referenced by main(), and systick_configuration().

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/tmr/6_steps/src/main.c.

Referenced by main().

◆ step

__IO uint32_t step = 1

Definition at line 43 of file project/at_start_f415/examples/tmr/6_steps/src/main.c.

Referenced by TMR1_TRG_HALL_TMR11_IRQHandler().

◆ tmr_brkdt_config_struct

tmr_brkdt_config_type tmr_brkdt_config_struct = {0}

Definition at line 40 of file project/at_start_f415/examples/tmr/6_steps/src/main.c.

Referenced by main().

◆ tmr_output_struct

tmr_output_config_type tmr_output_struct

Definition at line 39 of file project/at_start_f415/examples/tmr/6_steps/src/main.c.

Referenced by main(), tmr_output_channel_config(), and tmr_output_default_para_init().


AT32F415 Firmwary Library: TMR_7_pwm_output

Functions | Variables
TMR_7_pwm_output
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
tmr_output_config_type tmr_output_struct
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
uint16_t | timer_period = 0
uint16_t | channel1_pulse = 0
uint16_t | channel2_pulse = 0
uint16_t | channel3_pulse = 0
uint16_t | channel4_pulse = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< gpio pins number 8

< gpio pins number 9

< gpio pins number 10

< gpio pins number 11

< gpio pins number 13

< gpio pins number 14

< gpio pins number 15

< gpio pins number 12

Definition at line 50 of file project/at_start_f415/examples/tmr/7_pwm_output/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c.

Variable Documentation

◆ channel1_pulse

uint16_t channel1_pulse = 0

Definition at line 43 of file project/at_start_f415/examples/tmr/7_pwm_output/src/main.c.

Referenced by main().

◆ channel2_pulse

uint16_t channel2_pulse = 0

Definition at line 43 of file project/at_start_f415/examples/tmr/7_pwm_output/src/main.c.

Referenced by main().

◆ channel3_pulse

uint16_t channel3_pulse = 0

Definition at line 43 of file project/at_start_f415/examples/tmr/7_pwm_output/src/main.c.

Referenced by main().

◆ channel4_pulse

uint16_t channel4_pulse = 0

Definition at line 43 of file project/at_start_f415/examples/tmr/7_pwm_output/src/main.c.

Referenced by main().

◆ crm_clocks_freq_struct

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Definition at line 40 of file project/at_start_f415/examples/tmr/7_pwm_output/src/main.c.

Referenced by main().

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/tmr/7_pwm_output/src/main.c.

Referenced by main().

◆ timer_period

uint16_t timer_period = 0

Definition at line 42 of file project/at_start_f415/examples/tmr/7_pwm_output/src/main.c.

Referenced by main().

◆ tmr_output_struct

tmr_output_config_type tmr_output_struct

Definition at line 39 of file project/at_start_f415/examples/tmr/7_pwm_output/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_cascade_synchro

Functions | Variables
TMR_cascade_synchro
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Variables

gpio_init_type gpio_init_struct = {0}
tmr_output_config_type tmr_output_struct

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 0

< gpio pins number 6

Definition at line 46 of file project/at_start_f415/examples/tmr/cascade_synchro/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c.

Variable Documentation

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/tmr/cascade_synchro/src/main.c.

Referenced by main().

◆ tmr_output_struct

tmr_output_config_type tmr_output_struct

Definition at line 39 of file project/at_start_f415/examples/tmr/cascade_synchro/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_complementary_signals

Functions | Variables
TMR_complementary_signals
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
tmr_output_config_type tmr_output_struct
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
tmr_brkdt_config_type | tmr_brkdt_config_struct = {0}
uint16_t | timer_period = 0
uint16_t | channel1_pulse = 0
uint16_t | channel2_pulse = 0
uint16_t | channel3_pulse = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< gpio pins number 8

< gpio pins number 9

< gpio pins number 10

< gpio pins number 13

< gpio pins number 14

< gpio pins number 15

< gpio pins number 12

Definition at line 51 of file project/at_start_f415/examples/tmr/complementary_signals/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c.

Variable Documentation

◆ channel1_pulse

uint16_t channel1_pulse = 0

Definition at line 44 of file project/at_start_f415/examples/tmr/complementary_signals/src/main.c.

Referenced by main().

◆ channel2_pulse

uint16_t channel2_pulse = 0

Definition at line 44 of file project/at_start_f415/examples/tmr/complementary_signals/src/main.c.

Referenced by main().

◆ channel3_pulse

uint16_t channel3_pulse = 0

Definition at line 44 of file project/at_start_f415/examples/tmr/complementary_signals/src/main.c.

Referenced by main().

◆ crm_clocks_freq_struct

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Definition at line 40 of file project/at_start_f415/examples/tmr/complementary_signals/src/main.c.

Referenced by main().

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/tmr/complementary_signals/src/main.c.

Referenced by main().

◆ timer_period

uint16_t timer_period = 0

Definition at line 43 of file project/at_start_f415/examples/tmr/complementary_signals/src/main.c.

Referenced by main().

◆ tmr_brkdt_config_struct

tmr_brkdt_config_type tmr_brkdt_config_struct = {0}

Definition at line 41 of file project/at_start_f415/examples/tmr/complementary_signals/src/main.c.

Referenced by main().

◆ tmr_output_struct

tmr_output_config_type tmr_output_struct

Definition at line 39 of file project/at_start_f415/examples/tmr/complementary_signals/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_dma

Functions | Variables
TMR_dma
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
tmr_output_config_type tmr_output_struct
dma_init_type | dma_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
uint16_t | timer_period = 0
uint16_t | src_buffer [3] = {0, 0, 0}

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/dma/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/dma/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/dma/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< gpio pins number 10

< gpio pins number 15

Definition at line 51 of file project/at_start_f415/examples/tmr/dma/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/dma/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/dma/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/dma/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/dma/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/dma/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/dma/src/at32f415_int.c.

Variable Documentation

◆ crm_clocks_freq_struct

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Definition at line 41 of file project/at_start_f415/examples/tmr/dma/src/main.c.

Referenced by main().

◆ dma_init_struct

dma_init_type dma_init_struct = {0}

Definition at line 40 of file project/at_start_f415/examples/tmr/dma/src/main.c.

Referenced by main().

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/tmr/dma/src/main.c.

Referenced by main().

◆ src_buffer

uint16_t src_buffer[3] = {0, 0, 0}

Definition at line 44 of file project/at_start_f415/examples/tmr/dma/src/main.c.

Referenced by main().

◆ timer_period

uint16_t timer_period = 0

Definition at line 43 of file project/at_start_f415/examples/tmr/dma/src/main.c.

Referenced by main().

◆ tmr_output_struct

tmr_output_config_type tmr_output_struct

Definition at line 39 of file project/at_start_f415/examples/tmr/dma/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_dma_burst

Functions | Variables
TMR_dma_burst
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
tmr_output_config_type tmr_output_struct
dma_init_type | dma_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
uint16_t | timer_period = 0
uint16_t | src_buffer [3] = {0x0FFF, 0x0000, 0x0555}

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< gpio pins number 8

Definition at line 51 of file project/at_start_f415/examples/tmr/dma_burst/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c.

Variable Documentation

◆ crm_clocks_freq_struct

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Definition at line 41 of file project/at_start_f415/examples/tmr/dma_burst/src/main.c.

Referenced by main().

◆ dma_init_struct

dma_init_type dma_init_struct = {0}

Definition at line 40 of file project/at_start_f415/examples/tmr/dma_burst/src/main.c.

Referenced by main().

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/tmr/dma_burst/src/main.c.

Referenced by main().

◆ src_buffer

uint16_t src_buffer[3] = {0x0FFF, 0x0000, 0x0555}

Definition at line 44 of file project/at_start_f415/examples/tmr/dma_burst/src/main.c.

Referenced by main().

◆ timer_period

uint16_t timer_period = 0

Definition at line 43 of file project/at_start_f415/examples/tmr/dma_burst/src/main.c.

◆ tmr_output_struct

tmr_output_config_type tmr_output_struct

Definition at line 39 of file project/at_start_f415/examples/tmr/dma_burst/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_encoder_tmr2

Functions | Variables
TMR_encoder_tmr2
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | delay (uint32_t time)
delay function More...
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
uint32_t | counter

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c.

◆ delay()

void delay ( uint32_t time )

delay function

Parameters
time number of time to delay
Return values
none

Definition at line 120 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< gpio pins number 0

< gpio pins number 1

< gpio pins number 2

< gpio pins number 3

< gpio pins number 2

< gpio pins number 3

< gpio pins number 2

< gpio pins number 3

Definition at line 49 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c.

Variable Documentation

◆ counter

uint32_t counter

Definition at line 42 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c.

Referenced by main().

◆ crm_clocks_freq_struct

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Definition at line 39 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c.

Referenced by main().

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_external_clock

Functions | Variables
TMR_external_clock
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
tmr_output_config_type tmr_output_struct
tmr_input_config_type tmr_input_config_struct

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< gpio pins number 0

< gpio pins number 7

Definition at line 48 of file project/at_start_f415/examples/tmr/external_clock/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c.

Variable Documentation

◆ crm_clocks_freq_struct

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Definition at line 39 of file project/at_start_f415/examples/tmr/external_clock/src/main.c.

Referenced by main().

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/tmr/external_clock/src/main.c.

Referenced by main().

◆ tmr_input_config_struct

tmr_input_config_type tmr_input_config_struct

Definition at line 41 of file project/at_start_f415/examples/tmr/external_clock/src/main.c.

Referenced by lick_frequency_get(), and main().

◆ tmr_output_struct

tmr_output_config_type tmr_output_struct

Definition at line 40 of file project/at_start_f415/examples/tmr/external_clock/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_hall_xor_tmr2

Functions | Variables
TMR_hall_xor_tmr2
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...
void | TMR2_GLOBAL_IRQHandler (void)
this function handles TMR2 trigger exception. More...

Variables

gpio_init_type | gpio_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
tmr_output_config_type tmr_output_struct
tmr_input_config_type tmr_input_config_struct

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< gpio pins number 0

< gpio pins number 1

< gpio pins number 2

< gpio pins number 3

< gpio pins number 6

< gpio pins number 7

< gpio pins number 8

< tmr interrupt trigger

< gpio pins number 3

< gpio pins number 6

< gpio pins number 7

< gpio pins number 3

< gpio pins number 6

< gpio pins number 7

Definition at line 48 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c.

◆ TMR2_GLOBAL_IRQHandler()

void TMR2_GLOBAL_IRQHandler ( void )

this function handles TMR2 trigger exception.

Parameters
none
Return values
none

< tmr flag trigger

< gpio pins number 8

< tmr flag trigger

Definition at line 139 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c.

Variable Documentation

◆ crm_clocks_freq_struct

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Definition at line 39 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c.

Referenced by main().

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c.

Referenced by main().

◆ tmr_input_config_struct

tmr_input_config_type tmr_input_config_struct

Definition at line 41 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c.

Referenced by main().

◆ tmr_output_struct

tmr_output_config_type tmr_output_struct

Definition at line 40 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c.


AT32F415 Firmwary Library: TMR_hang_mode

Functions | Variables
TMR_hang_mode
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
tmr_output_config_type tmr_output_struct
tmr_input_config_type tmr_input_config_struct

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< gpio pins number 8

< gpio pins number 9

Definition at line 48 of file project/at_start_f415/examples/tmr/hang_mode/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c.

Variable Documentation

◆ crm_clocks_freq_struct

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Definition at line 39 of file project/at_start_f415/examples/tmr/hang_mode/src/main.c.

Referenced by main().

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/tmr/hang_mode/src/main.c.

Referenced by main().

◆ tmr_input_config_struct

tmr_input_config_type tmr_input_config_struct

Definition at line 41 of file project/at_start_f415/examples/tmr/hang_mode/src/main.c.

Referenced by main().

◆ tmr_output_struct

tmr_output_config_type tmr_output_struct

Definition at line 40 of file project/at_start_f415/examples/tmr/hang_mode/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_input_capture

Functions | Variables
TMR_input_capture
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | uart_init (uint32_t baudrate)
init usart. More...
void | TMR3_GLOBAL_IRQHandler (void)
this function handles tmr3 trigger exception. More...
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
tmr_input_config_type tmr_input_config_struct
__IO uint32_t | tmr3freq = 0
__IO uint32_t | sys_counter = 0
__IO uint16_t | capturenumber = 0
__IO uint16_t | ch3readvalue1 = 0
__IO uint16_t | ch3readvalue2 = 0
__IO uint32_t | capture = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< gpio pins number 7

< tmr interrupt channel 2

Definition at line 91 of file project/at_start_f415/examples/tmr/input_capture/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c.

◆ TMR3_GLOBAL_IRQHandler()

void TMR3_GLOBAL_IRQHandler ( void )

this function handles tmr3 trigger exception.

Parameters
none
Return values
none

< tmr flag channel 2

< tmr flag channel 2

Definition at line 53 of file project/at_start_f415/examples/tmr/input_capture/src/main.c.

◆ uart_init()

void uart_init ( uint32_t baudrate )

init usart.

Parameters
none
Return values
none

Definition at line 45 of file app_led3_toggle/src/usart.c.

Referenced by main().

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c.

Variable Documentation

◆ capture

__IO uint32_t capture = 0

Definition at line 46 of file project/at_start_f415/examples/tmr/input_capture/src/main.c.

Referenced by TMR3_GLOBAL_IRQHandler().

◆ capturenumber

__IO uint16_t capturenumber = 0

Definition at line 44 of file project/at_start_f415/examples/tmr/input_capture/src/main.c.

Referenced by main(), and TMR3_GLOBAL_IRQHandler().

◆ ch3readvalue1

__IO uint16_t ch3readvalue1 = 0

Definition at line 45 of file project/at_start_f415/examples/tmr/input_capture/src/main.c.

Referenced by TMR3_GLOBAL_IRQHandler().

◆ ch3readvalue2

__IO uint16_t ch3readvalue2 = 0

Definition at line 45 of file project/at_start_f415/examples/tmr/input_capture/src/main.c.

Referenced by TMR3_GLOBAL_IRQHandler().

◆ crm_clocks_freq_struct

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Definition at line 39 of file project/at_start_f415/examples/tmr/input_capture/src/main.c.

Referenced by main(), and TMR3_GLOBAL_IRQHandler().

◆ gpio_init_struct

gpio_init_type gpio_init_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/tmr/input_capture/src/main.c.

Referenced by main().

◆ sys_counter

__IO uint32_t sys_counter = 0

Definition at line 43 of file project/at_start_f415/examples/tmr/input_capture/src/main.c.

◆ tmr3freq

__IO uint32_t tmr3freq = 0

Definition at line 42 of file project/at_start_f415/examples/tmr/input_capture/src/main.c.

Referenced by main(), and TMR3_GLOBAL_IRQHandler().

◆ tmr_input_config_struct

tmr_input_config_type tmr_input_config_struct

Definition at line 40 of file project/at_start_f415/examples/tmr/input_capture/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_oc_high

Functions | Variables
TMR_oc_high
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR2_GLOBAL_IRQHandler (void)
this function handles tmr2 global interrupt request. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
uint16_t | ch1_val = 1000
uint16_t | ch2_val = 500
uint16_t | ch3_val = 250
uint16_t | ch4_val = 125
uint16_t | div_value = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< tmr interrupt channel 1

< tmr interrupt channel 2

< tmr interrupt channel 3

< tmr interrupt channel 4

< gpio pins number 6

< gpio pins number 7

< gpio pins number 8

< gpio pins number 9

Definition at line 74 of file project/at_start_f415/examples/tmr/oc_high/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c.

◆ TMR2_GLOBAL_IRQHandler()

void TMR2_GLOBAL_IRQHandler ( void )

this function handles tmr2 global interrupt request.

Parameters
none
Return values
none

< tmr flag channel 1

< tmr flag channel 1

< gpio pins number 6

< tmr flag channel 2

< tmr flag channel 2

< gpio pins number 7

< tmr flag channel 3

< tmr flag channel 3

< gpio pins number 8

< tmr flag channel 4

< gpio pins number 9

Definition at line 140 of file project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c.

Variable Documentation

◆ ch1_val

uint16_t ch1_val = 1000

Definition at line 40 of file project/at_start_f415/examples/tmr/oc_high/src/main.c.

Referenced by main().

◆ ch2_val

uint16_t ch2_val = 500

Definition at line 41 of file project/at_start_f415/examples/tmr/oc_high/src/main.c.

Referenced by main().

◆ ch3_val

uint16_t ch3_val = 250

Definition at line 42 of file project/at_start_f415/examples/tmr/oc_high/src/main.c.

Referenced by main().

◆ ch4_val

uint16_t ch4_val = 125

Definition at line 43 of file project/at_start_f415/examples/tmr/oc_high/src/main.c.

Referenced by main().

◆ crm_clocks_freq_struct

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Definition at line 39 of file project/at_start_f415/examples/tmr/oc_high/src/main.c.

Referenced by main().

◆ div_value

uint16_t div_value = 0

Definition at line 44 of file project/at_start_f415/examples/tmr/oc_high/src/main.c.

Referenced by crm_adc_clock_div_set(), crm_clocks_freq_get(), crm_usb_clock_div_set(), main(), and system_core_clock_update().

◆ tmr_oc_init_structure

tmr_output_config_type tmr_oc_init_structure

Definition at line 38 of file project/at_start_f415/examples/tmr/oc_high/src/main.c.

Referenced by main(), mclk_tmr1_init(), and tmr1_config().


AT32F415 Firmwary Library: TMR_oc_low

Functions | Variables
TMR_oc_low
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR2_GLOBAL_IRQHandler (void)
this function handles tmr2 global interrupt request. More...
void | gpio_configuration (void)
configure the gpioc pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
uint16_t | ch1_val = 1000
uint16_t | ch2_val = 500
uint16_t | ch3_val = 250
uint16_t | ch4_val = 125
uint16_t | div_value = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c.

◆ gpio_configuration()

void gpio_configuration ( void )

configure the gpioc pins.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 7

< gpio pins number 8

< gpio pins number 9

Definition at line 52 of file project/at_start_f415/examples/tmr/oc_low/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< tmr interrupt channel 1

< tmr interrupt channel 2

< tmr interrupt channel 3

< tmr interrupt channel 4

< gpio pins number 6

< gpio pins number 7

< gpio pins number 8

< gpio pins number 9

Definition at line 72 of file project/at_start_f415/examples/tmr/oc_low/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c.

◆ TMR2_GLOBAL_IRQHandler()

void TMR2_GLOBAL_IRQHandler ( void )

this function handles tmr2 global interrupt request.

Parameters
none
Return values
none

< tmr flag channel 1

< tmr flag channel 1

< gpio pins number 6

< tmr flag channel 2

< tmr flag channel 2

< gpio pins number 7

< tmr flag channel 3

< tmr flag channel 3

< gpio pins number 8

< tmr flag channel 4

< gpio pins number 9

Definition at line 140 of file project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c.

Variable Documentation

◆ ch1_val

uint16_t ch1_val = 1000

Definition at line 39 of file project/at_start_f415/examples/tmr/oc_low/src/main.c.

Referenced by main().

◆ ch2_val

uint16_t ch2_val = 500

Definition at line 40 of file project/at_start_f415/examples/tmr/oc_low/src/main.c.

Referenced by main().

◆ ch3_val

uint16_t ch3_val = 250

Definition at line 41 of file project/at_start_f415/examples/tmr/oc_low/src/main.c.

Referenced by main().

◆ ch4_val

uint16_t ch4_val = 125

Definition at line 42 of file project/at_start_f415/examples/tmr/oc_low/src/main.c.

Referenced by main().

◆ div_value

uint16_t div_value = 0

Definition at line 43 of file project/at_start_f415/examples/tmr/oc_low/src/main.c.

Referenced by main().

◆ tmr_oc_init_structure

tmr_output_config_type tmr_oc_init_structure

Definition at line 38 of file project/at_start_f415/examples/tmr/oc_low/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_oc_toggle_tmr3

Functions | Variables
TMR_oc_toggle_tmr3
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR3_GLOBAL_IRQHandler (void)
this function handles tmr3 global interrupt request. More...
void | gpio_configuration (void)
configure the tmr3 pins. More...
void | nvic_configuration (void)
int | main (void)
main function. More...

Variables

uint32_t | capture = 0
tmr_output_config_type tmr_oc_init_structure
__IO uint16_t | ch1_val = 32768
__IO uint16_t | ch2_val = 16384
__IO uint16_t | ch3_val = 8192
__IO uint16_t | ch4_val = 4096
uint16_t | div_value = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 85 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 120 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c.

◆ gpio_configuration()

void gpio_configuration ( void )

configure the tmr3 pins.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 7

< gpio pins number 0

< gpio pins number 1

Definition at line 54 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 59 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< tmr interrupt channel 1

< tmr interrupt channel 2

< tmr interrupt channel 3

< tmr interrupt channel 4

Definition at line 93 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 72 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 50 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c.

◆ nvic_configuration()

void nvic_configuration ( void )

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 129 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 111 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 138 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c.

◆ TMR3_GLOBAL_IRQHandler()

void TMR3_GLOBAL_IRQHandler ( void )

this function handles tmr3 global interrupt request.

Parameters
none
Return values
none

< tmr flag channel 1

< tmr flag channel 1

< tmr flag channel 2

< tmr flag channel 2

< tmr flag channel 3

< tmr flag channel 3

< tmr flag channel 4

< tmr flag channel 4

Definition at line 147 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 98 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c.

Variable Documentation

◆ capture

uint32_t capture = 0

Definition at line 43 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c.

Referenced by TMR3_GLOBAL_IRQHandler().

◆ ch1_val

__IO uint16_t ch1_val = 32768

Definition at line 39 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c.

Referenced by main().

◆ ch2_val

__IO uint16_t ch2_val = 16384

Definition at line 40 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c.

Referenced by main().

◆ ch3_val

__IO uint16_t ch3_val = 8192

Definition at line 41 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c.

Referenced by main().

◆ ch4_val

__IO uint16_t ch4_val = 4096

Definition at line 42 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c.

Referenced by main().

◆ div_value

uint16_t div_value = 0

Definition at line 43 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c.

Referenced by main().

◆ tmr_oc_init_structure

tmr_output_config_type tmr_oc_init_structure

Definition at line 38 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_oc_toggle_tmr9

Functions | Variables
TMR_oc_toggle_tmr9
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR1_BRK_TMR9_IRQHandler (void)
this function handles TMR9 global interrupt request. More...
void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr9 pins. More...
void | nvic_configuration (void)
int | main (void)
main function. More...

Variables

uint16_t | capture = 0
tmr_output_config_type tmr_oc_init_structure
__IO uint16_t | ch1_val = 32768
__IO uint16_t | ch2_val = 16384
uint16_t | div_value = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 83 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c.

◆ crm_configuration()

void crm_configuration ( void )

configures the different peripheral clocks.

Parameters
none
Return values
none

Definition at line 72 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 118 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c.

◆ gpio_configuration()

void gpio_configuration ( void )

configure the tmr9 pins.

Parameters
none
Return values
none

< gpio pins number 2

< gpio pins number 3

Definition at line 52 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 57 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< tmr interrupt channel 1

< tmr interrupt channel 2

Definition at line 86 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 70 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 48 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c.

◆ nvic_configuration()

void nvic_configuration ( void )

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 127 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 109 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 136 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c.

◆ TMR1_BRK_TMR9_IRQHandler()

void TMR1_BRK_TMR9_IRQHandler ( void )

this function handles TMR9 global interrupt request.

Parameters
none
Return values
none

< tmr flag channel 1

< tmr flag channel 1

< tmr flag channel 2

< tmr flag channel 2

Definition at line 145 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 96 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c.

Variable Documentation

◆ capture

uint16_t capture = 0

Definition at line 41 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c.

Referenced by TMR1_BRK_TMR9_IRQHandler().

◆ ch1_val

__IO uint16_t ch1_val = 32768

Definition at line 39 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c.

Referenced by main().

◆ ch2_val

__IO uint16_t ch2_val = 16384

Definition at line 40 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c.

Referenced by main().

◆ div_value

uint16_t div_value = 0

Definition at line 41 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c.

Referenced by main().

◆ tmr_oc_init_structure

tmr_output_config_type tmr_oc_init_structure

Definition at line 38 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_one_cycle

Functions | Variables
TMR_one_cycle
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr3 pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
tmr_input_config_type tmr_ic_init_structure
uint16_t div_value = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c.

◆ crm_configuration()

void crm_configuration ( void )

configures the different peripheral clocks.

Parameters
none
Return values
none

Definition at line 75 of file project/at_start_f415/examples/tmr/one_cycle/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c.

◆ gpio_configuration()

void gpio_configuration ( void )

configure the tmr3 pins.

Parameters
none
Return values
none

< gpio pins number 7

< gpio pins number 6

Definition at line 50 of file project/at_start_f415/examples/tmr/one_cycle/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 89 of file project/at_start_f415/examples/tmr/one_cycle/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c.

Variable Documentation

◆ div_value

uint16_t div_value = 0

Definition at line 40 of file project/at_start_f415/examples/tmr/one_cycle/src/main.c.

Referenced by main().

◆ tmr_ic_init_structure

tmr_input_config_type tmr_ic_init_structure

Definition at line 39 of file project/at_start_f415/examples/tmr/one_cycle/src/main.c.

Referenced by main(), and tmr1_init().

◆ tmr_oc_init_structure

tmr_output_config_type tmr_oc_init_structure

Definition at line 38 of file project/at_start_f415/examples/tmr/one_cycle/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_parallel_synchro

Functions | Variables
TMR_parallel_synchro
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr3 pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c.

◆ crm_configuration()

void crm_configuration ( void )

configures the different peripheral clocks.

Parameters
none
Return values
none

Definition at line 71 of file project/at_start_f415/examples/tmr/parallel_synchro/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c.

◆ gpio_configuration()

void gpio_configuration ( void )

configure the tmr3 pins.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 0

< gpio pins number 6

Definition at line 48 of file project/at_start_f415/examples/tmr/parallel_synchro/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 90 of file project/at_start_f415/examples/tmr/parallel_synchro/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c.

Variable Documentation

◆ tmr_oc_init_structure

tmr_output_config_type tmr_oc_init_structure

Definition at line 38 of file project/at_start_f415/examples/tmr/parallel_synchro/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_pwm_input

Functions | Variables
TMR_pwm_input
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR3_GLOBAL_IRQHandler (void)
this function handles tmr3 global interrupt request. More...
void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr3 pins. More...
int | main (void)
main function. More...

Variables

__IO uint16_t | ic2value = 0
tmr_input_config_type tmr_ic_init_structure
__IO uint16_t | duty_cycle = 0
__IO uint32_t | frequency = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 83 of file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c.

◆ crm_configuration()

void crm_configuration ( void )

configures the different peripheral clocks.

Parameters
none
Return values
none

Definition at line 70 of file project/at_start_f415/examples/tmr/pwm_input/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 118 of file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c.

◆ gpio_configuration()

void gpio_configuration ( void )

configure the tmr3 pins.

Parameters
none
Return values
none

< gpio pins number 7

Definition at line 51 of file project/at_start_f415/examples/tmr/pwm_input/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 57 of file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< tmr interrupt channel 2

Definition at line 84 of file project/at_start_f415/examples/tmr/pwm_input/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 70 of file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 48 of file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 127 of file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 109 of file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 136 of file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c.

◆ TMR3_GLOBAL_IRQHandler()

void TMR3_GLOBAL_IRQHandler ( void )

this function handles tmr3 global interrupt request.

Parameters
none
Return values
none

< tmr flag channel 2

Definition at line 145 of file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 96 of file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c.

Variable Documentation

◆ duty_cycle

__IO uint16_t duty_cycle = 0

Definition at line 40 of file project/at_start_f415/examples/tmr/pwm_input/src/main.c.

Referenced by main().

◆ frequency

__IO uint32_t frequency = 0

Definition at line 41 of file project/at_start_f415/examples/tmr/pwm_input/src/main.c.

Referenced by main().

◆ ic2value

__IO uint16_t ic2value = 0

Definition at line 41 of file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c.

Referenced by TMR3_GLOBAL_IRQHandler().

◆ tmr_ic_init_structure

tmr_input_config_type tmr_ic_init_structure

Definition at line 38 of file project/at_start_f415/examples/tmr/pwm_input/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_pwm_input_dma

Macros | Functions | Variables
TMR_pwm_input_dma
AT32F415_periph_examples

Macros

#define | TMR1_C1DT_ADDRESS 0x40012C34
#define | TMR1_C2DT_ADDRESS 0x40012C38
#define | SAMPLING_NUM 1000

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr1 pins. More...
void | DMA1_Channel2_IRQHandler (void)
int | main (void)
main function. More...

Variables

tmr_input_config_type tmr_ic_init_structure
dma_init_type dma_init_structure
__IO uint16_t | buffer_ch1 [1000]
__IO uint16_t | buffer_ch2 [1000]
__IO uint32_t | frequency = 0
__IO float | duty_cycle = 0
uint32_t | freq_result
float | duty_result

Detailed Description

Macro Definition Documentation

◆ SAMPLING_NUM

#define SAMPLING_NUM 1000

Definition at line 41 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

◆ TMR1_C1DT_ADDRESS

#define TMR1_C1DT_ADDRESS 0x40012C34

Definition at line 38 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

◆ TMR1_C2DT_ADDRESS

#define TMR1_C2DT_ADDRESS 0x40012C38

Definition at line 39 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c.

◆ crm_configuration()

void crm_configuration ( void )

configures the different peripheral clocks.

Parameters
none
Return values
none

Definition at line 102 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c.

◆ DMA1_Channel2_IRQHandler()

void DMA1_Channel2_IRQHandler ( void )

< dma1 channel2 full data transfer flag

Definition at line 58 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

◆ gpio_configuration()

void gpio_configuration ( void )

configure the tmr1 pins.

Parameters
none
Return values
none

< gpio pins number 8

Definition at line 83 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< dma full data transfer interrupt

Definition at line 119 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c.

Variable Documentation

◆ buffer_ch1

__IO uint16_t buffer_ch1[1000]

Definition at line 46 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

Referenced by DMA1_Channel2_IRQHandler(), and main().

◆ buffer_ch2

__IO uint16_t buffer_ch2[1000]

Definition at line 47 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

Referenced by DMA1_Channel2_IRQHandler(), and main().

◆ dma_init_structure

dma_init_type dma_init_structure

Definition at line 44 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

Referenced by main().

◆ duty_cycle

__IO float duty_cycle = 0

Definition at line 50 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

Referenced by DMA1_Channel2_IRQHandler(), and TMR3_GLOBAL_IRQHandler().

◆ duty_result

float duty_result

Definition at line 53 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

Referenced by DMA1_Channel2_IRQHandler().

◆ freq_result

uint32_t freq_result

Definition at line 52 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

Referenced by DMA1_Channel2_IRQHandler().

◆ frequency

__IO uint32_t frequency = 0

Definition at line 49 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

Referenced by DMA1_Channel2_IRQHandler(), and TMR3_GLOBAL_IRQHandler().

◆ tmr_ic_init_structure

tmr_input_config_type tmr_ic_init_structure

Definition at line 43 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_pwm_output_simulate

Functions | Variables
TMR_pwm_output_simulate
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR2_GLOBAL_IRQHandler (void)
void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr1 pins. More...
int | main (void)
main function. More...

Variables

uint16_t | capture = 0
tmr_output_config_type tmr_oc_init_structure
uint16_t | ch1_val = 40961
uint16_t | ch2_val = 27309
uint16_t | ch3_val = 13654
uint16_t | ch4_val = 6826
uint16_t | div_value = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 85 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c.

◆ crm_configuration()

void crm_configuration ( void )

configures the different peripheral clocks.

Parameters
none
Return values
none

Definition at line 73 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 120 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c.

◆ gpio_configuration()

void gpio_configuration ( void )

configure the tmr1 pins.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 7

< gpio pins number 8

< gpio pins number 9

Definition at line 54 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 59 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< tmr interrupt channel 1

< tmr interrupt channel 2

< tmr interrupt channel 3

< tmr interrupt channel 4

Definition at line 87 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 72 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 50 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 129 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 111 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 138 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c.

◆ TMR2_GLOBAL_IRQHandler()

void TMR2_GLOBAL_IRQHandler ( void )

< tmr flag channel 1

< tmr flag channel 1

< gpio pins number 6

< gpio pins number 6

< tmr flag channel 2

< tmr flag channel 2

< gpio pins number 7

< gpio pins number 7

< tmr flag channel 3

< tmr flag channel 3

< gpio pins number 8

< gpio pins number 8

< tmr flag channel 4

< gpio pins number 9

< gpio pins number 9

Definition at line 142 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 98 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c.

Variable Documentation

◆ capture

uint16_t capture = 0

Definition at line 43 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c.

Referenced by TMR2_GLOBAL_IRQHandler().

◆ ch1_val

uint16_t ch1_val = 40961

Definition at line 40 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c.

Referenced by main().

◆ ch2_val

uint16_t ch2_val = 27309

Definition at line 41 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c.

Referenced by main().

◆ ch3_val

uint16_t ch3_val = 13654

Definition at line 42 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c.

Referenced by main().

◆ ch4_val

uint16_t ch4_val = 6826

Definition at line 43 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c.

Referenced by main().

◆ div_value

uint16_t div_value = 0

Definition at line 44 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c.

Referenced by main().

◆ tmr_oc_init_structure

tmr_output_config_type tmr_oc_init_structure

Definition at line 38 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_pwm_output_tmr10

Functions | Variables
TMR_pwm_output_tmr10
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr1 pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
uint16_t | ch1_val = 250
uint16_t | div_value = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c.

◆ crm_configuration()

void crm_configuration ( void )

configures the different peripheral clocks.

Parameters
none
Return values
none

Definition at line 70 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c.

◆ gpio_configuration()

void gpio_configuration ( void )

configure the tmr1 pins.

Parameters
none
Return values
none

< gpio pins number 8

Definition at line 51 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 84 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c.

Variable Documentation

◆ ch1_val

uint16_t ch1_val = 250

Definition at line 40 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c.

Referenced by main().

◆ div_value

uint16_t div_value = 0

Definition at line 41 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c.

Referenced by main().

◆ tmr_oc_init_structure

tmr_output_config_type tmr_oc_init_structure

Definition at line 38 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_pwm_output_tmr3

Functions | Variables
TMR_pwm_output_tmr3
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr3 pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
uint16_t | ch1_val = 333
uint16_t | ch2_val = 249
uint16_t | ch3_val = 166
uint16_t | ch4_val = 83
uint16_t | div_value = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c.

◆ crm_configuration()

void crm_configuration ( void )

configures the different peripheral clocks.

Parameters
none
Return values
none

Definition at line 76 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c.

◆ gpio_configuration()

void gpio_configuration ( void )

configure the tmr3 pins.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 7

< gpio pins number 0

< gpio pins number 1

Definition at line 54 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c.

Variable Documentation

◆ ch1_val

uint16_t ch1_val = 333

Definition at line 40 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c.

Referenced by main().

◆ ch2_val

uint16_t ch2_val = 249

Definition at line 41 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c.

Referenced by main().

◆ ch3_val

uint16_t ch3_val = 166

Definition at line 42 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c.

Referenced by main().

◆ ch4_val

uint16_t ch4_val = 83

Definition at line 43 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c.

Referenced by main().

◆ div_value

uint16_t div_value = 0

Definition at line 44 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c.

Referenced by main().

◆ tmr_oc_init_structure

tmr_output_config_type tmr_oc_init_structure

Definition at line 38 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_timer_base

Functions | Variables
TMR_timer_base
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | clkout_config (void)
clkout configuration. More...
void | TMR1_OVF_TMR10_IRQHandler (void)
this function handles timer1 overflow handler. More...
int | main (void)
main function. More...

Variables

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c.

◆ clkout_config()

void clkout_config ( void )

clkout configuration.

Parameters
none
Return values
none

< gpio pins number 8

Definition at line 40 of file project/at_start_f415/examples/tmr/timer_base/src/main.c.

Referenced by main(), sclk_64m_hick_config(), and sclk_96m_hext_config().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< tmr interrupt overflow

Definition at line 85 of file project/at_start_f415/examples/tmr/timer_base/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c.

◆ TMR1_OVF_TMR10_IRQHandler()

void TMR1_OVF_TMR10_IRQHandler ( void )

this function handles timer1 overflow handler.

Parameters
none
Return values
none

< tmr flag overflow

< tmr flag overflow

Definition at line 70 of file project/at_start_f415/examples/tmr/timer_base/src/main.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c.

Variable Documentation

◆ crm_clocks_freq_struct

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Definition at line 38 of file project/at_start_f415/examples/tmr/timer_base/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_tmr1_synchro

Functions | Variables
TMR_tmr1_synchro
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr1 pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c.

◆ crm_configuration()

void crm_configuration ( void )

configures the different peripheral clocks.

Parameters
none
Return values
none

Definition at line 70 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c.

◆ gpio_configuration()

void gpio_configuration ( void )

configure the tmr1 pins.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 8

< gpio pins number 6

Definition at line 48 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 87 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c.

Variable Documentation

◆ tmr_oc_init_structure

tmr_output_config_type tmr_oc_init_structure

Definition at line 38 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: TMR_tmr2_32bit

Functions | Variables
TMR_tmr2_32bit
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr1 pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
uint32_t | ch1_val = 0x7FFFF
uint32_t | ch2_val = 0x3FFFF
uint32_t | ch3_val = 0x1FFFF
uint32_t | ch4_val = 0xFFFF

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c.

◆ crm_configuration()

void crm_configuration ( void )

configures the different peripheral clocks.

Parameters
none
Return values
none

Definition at line 72 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c.

◆ gpio_configuration()

void gpio_configuration ( void )

configure the tmr1 pins.

Parameters
none
Return values
none

< gpio pins number 0

< gpio pins number 1

< gpio pins number 2

< gpio pins number 3

Definition at line 53 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 86 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c.

Variable Documentation

◆ ch1_val

uint32_t ch1_val = 0x7FFFF

Definition at line 40 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c.

Referenced by main(), TMR1_BRK_TMR9_IRQHandler(), TMR2_GLOBAL_IRQHandler(), and TMR3_GLOBAL_IRQHandler().

◆ ch2_val

uint32_t ch2_val = 0x3FFFF

Definition at line 41 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c.

Referenced by main(), TMR1_BRK_TMR9_IRQHandler(), TMR2_GLOBAL_IRQHandler(), and TMR3_GLOBAL_IRQHandler().

◆ ch3_val

uint32_t ch3_val = 0x1FFFF

Definition at line 42 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c.

Referenced by main(), TMR2_GLOBAL_IRQHandler(), and TMR3_GLOBAL_IRQHandler().

◆ ch4_val

uint32_t ch4_val = 0xFFFF

Definition at line 43 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c.

Referenced by main(), TMR2_GLOBAL_IRQHandler(), and TMR3_GLOBAL_IRQHandler().

◆ tmr_oc_init_structure

tmr_output_config_type tmr_oc_init_structure

Definition at line 38 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: USART_half_duplex

Macros | Functions | Variables
USART_half_duplex
AT32F415_periph_examples

Macros

#define | COUNTOF(a) (sizeof(a) / sizeof(*(a)))
#define | USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
#define | USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | usart_configuration (void)
config usart
More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [] = "usart half-duplex transfer: usart2 -> usart3"
uint8_t | usart3_tx_buffer [] = "usart half-duplex transfer: usart3 -> usart2"
uint8_t | usart2_rx_buffer [((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
uint8_t | usart3_rx_buffer [((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
uint8_t | data_count

Detailed Description

Macro Definition Documentation

◆ COUNTOF

#define COUNTOF ( a ) (sizeof(a) / sizeof(*(a)))

Definition at line 38 of file project/at_start_f415/examples/usart/half_duplex/src/main.c.

◆ USART2_TX_BUFFER_SIZE

#define USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)

Definition at line 39 of file project/at_start_f415/examples/usart/half_duplex/src/main.c.

◆ USART3_TX_BUFFER_SIZE

#define USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Definition at line 40 of file project/at_start_f415/examples/usart/half_duplex/src/main.c.

Function Documentation

◆ buffer_compare()

uint8_t buffer_compare | ( | uint8_t * | pbuffer1,
 |  | uint8_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

compares two buffers.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
1 pbuffer1 identical to pbuffer2 0: pbuffer1 differs from pbuffer2

Definition at line 101 of file project/at_start_f415/examples/usart/half_duplex/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< usart transmit data buffer empty flag

< usart receive data buffer full flag

< usart transmit data buffer empty flag

< usart receive data buffer full flag

Definition at line 120 of file project/at_start_f415/examples/usart/half_duplex/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c.

◆ usart_configuration()

void usart_configuration ( void )

config usart

Parameters
none
Return values
none

< gpio pins number 2

< gpio pins number 10

Definition at line 53 of file project/at_start_f415/examples/usart/half_duplex/src/main.c.

Referenced by main().

Variable Documentation

◆ data_count

uint8_t data_count

Definition at line 46 of file project/at_start_f415/examples/usart/half_duplex/src/main.c.

Referenced by main().

◆ usart2_rx_buffer

uint8_t usart2_rx_buffer[((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]

Definition at line 44 of file project/at_start_f415/examples/usart/half_duplex/src/main.c.

Referenced by main().

◆ usart2_tx_buffer

uint8_t usart2_tx_buffer[] = "usart half-duplex transfer: usart2 -> usart3"

Definition at line 42 of file project/at_start_f415/examples/usart/half_duplex/src/main.c.

Referenced by main().

◆ usart3_rx_buffer

uint8_t usart3_rx_buffer[((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]

Definition at line 45 of file project/at_start_f415/examples/usart/half_duplex/src/main.c.

Referenced by main().

◆ usart3_tx_buffer

uint8_t usart3_tx_buffer[] = "usart half-duplex transfer: usart3 -> usart2"

Definition at line 43 of file project/at_start_f415/examples/usart/half_duplex/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: USART_hw_flow_control

Macros | Functions | Variables
USART_hw_flow_control
AT32F415_periph_examples

Macros

#define BUFFER_SIZE 16

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | usart_configuration (void)
config usart
More...
int | main (void)
main function. More...

Variables

uint8_t | rx_buffer [16]
uint8_t | data_count

Detailed Description

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE 16

Definition at line 38 of file project/at_start_f415/examples/usart/hw_flow_control/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< usart receive data buffer full flag

< usart transmit data buffer empty flag

Definition at line 87 of file project/at_start_f415/examples/usart/hw_flow_control/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c.

◆ usart_configuration()

void usart_configuration ( void )

config usart

Parameters
none
Return values
none

< gpio pins number 1

< gpio pins number 2

< gpio pins number 0

< gpio pins number 3

Definition at line 48 of file project/at_start_f415/examples/usart/hw_flow_control/src/main.c.

Referenced by main().

Variable Documentation

◆ data_count

uint8_t data_count

Definition at line 41 of file project/at_start_f415/examples/usart/hw_flow_control/src/main.c.

Referenced by main().

◆ rx_buffer

uint8_t rx_buffer[16]

Definition at line 40 of file project/at_start_f415/examples/usart/hw_flow_control/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: USART_idle_detection

Functions
USART_idle_detection
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | USART2_IRQHandler (void)
this function handles usart2 handler. More...
void | usart_configuration (void)
config usart
More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< usart transmit data buffer empty flag

< usart receive data buffer full flag

Definition at line 86 of file project/at_start_f415/examples/usart/idle_detection/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c.

◆ USART2_IRQHandler()

void USART2_IRQHandler ( void )

this function handles usart2 handler.

Parameters
none
Return values
none

< usart idle flag

Definition at line 141 of file project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c.

◆ usart_configuration()

void usart_configuration ( void )

config usart

Parameters
none
Return values
none

< gpio pins number 2

< gpio pins number 3

< usart idle interrupt

Definition at line 43 of file project/at_start_f415/examples/usart/idle_detection/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: USART_interrupt

Macros | Functions | Variables
USART_interrupt
AT32F415_periph_examples

Macros

#define | COUNTOF(a) (sizeof(a) / sizeof(*(a)))
#define | USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
#define | USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | USART2_IRQHandler (void)
this function handles usart2 handler. More...
void | USART3_IRQHandler (void)
this function handles usart3 handler. More...
void | usart_configuration (void)
config usart
More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [] = "usart transfer by interrupt: usart2 -> usart3 using interrupt"
uint8_t | usart3_tx_buffer [] = "usart transfer by interrupt: usart3 -> usart2 using interrupt"
uint8_t | usart2_rx_buffer [((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
uint8_t | usart3_rx_buffer [((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
volatile uint8_t | usart2_tx_counter = 0x00
volatile uint8_t | usart3_tx_counter = 0x00
volatile uint8_t | usart2_rx_counter = 0x00
volatile uint8_t | usart3_rx_counter = 0x00
uint8_t | usart2_tx_buffer_size = ((sizeof( usart2_tx_buffer ) / sizeof(*( usart2_tx_buffer ))) - 1)
uint8_t | usart3_tx_buffer_size = ((sizeof( usart3_tx_buffer ) / sizeof(*( usart3_tx_buffer ))) - 1)

Detailed Description

Macro Definition Documentation

◆ COUNTOF

#define COUNTOF ( a ) (sizeof(a) / sizeof(*(a)))

Definition at line 38 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

◆ USART2_TX_BUFFER_SIZE

#define USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)

Definition at line 39 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

◆ USART3_TX_BUFFER_SIZE

#define USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Definition at line 40 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

Function Documentation

◆ buffer_compare()

uint8_t buffer_compare | ( | uint8_t * | pbuffer1,
 |  | uint8_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

compares two buffers.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
1 pbuffer1 identical to pbuffer2 0: pbuffer1 differs from pbuffer2

Definition at line 129 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 89 of file project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 124 of file project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 63 of file project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 148 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 76 of file project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 54 of file project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 133 of file project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 115 of file project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 142 of file project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 102 of file project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c.

◆ USART2_IRQHandler()

void USART2_IRQHandler ( void )

this function handles usart2 handler.

Parameters
none
Return values
none

< usart receive data buffer full flag

< usart receive data buffer full interrupt

< usart transmit data buffer empty flag

< usart transmit data buffer empty interrupt

Definition at line 151 of file project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c.

◆ USART3_IRQHandler()

void USART3_IRQHandler ( void )

this function handles usart3 handler.

Parameters
none
Return values
none

< usart receive data buffer full flag

< usart receive data buffer full interrupt

< usart transmit data buffer empty flag

< usart transmit data buffer empty interrupt

Definition at line 183 of file project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c.

◆ usart_configuration()

void usart_configuration ( void )

config usart

Parameters
none
Return values
none

< gpio pins number 2

< gpio pins number 10

< gpio pins number 3

< gpio pins number 11

< usart receive data buffer full interrupt

< usart receive data buffer full interrupt

< usart transmit data buffer empty interrupt

< usart transmit data buffer empty interrupt

Definition at line 58 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

Referenced by main().

Variable Documentation

◆ usart2_rx_buffer

uint8_t usart2_rx_buffer[((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]

Definition at line 44 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

Referenced by main().

◆ usart2_rx_counter

volatile uint8_t usart2_rx_counter = 0x00

Definition at line 48 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

Referenced by main().

◆ usart2_tx_buffer

uint8_t usart2_tx_buffer[] = "usart transfer by interrupt: usart2 -> usart3 using interrupt"

Definition at line 42 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

Referenced by main().

◆ usart2_tx_buffer_size

uint8_t usart2_tx_buffer_size = ((sizeof( usart2_tx_buffer ) / sizeof(*( usart2_tx_buffer ))) - 1)

Definition at line 50 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

Referenced by main().

◆ usart2_tx_counter

volatile uint8_t usart2_tx_counter = 0x00

Definition at line 46 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

◆ usart3_rx_buffer

uint8_t usart3_rx_buffer[((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]

Definition at line 45 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

Referenced by main().

◆ usart3_rx_counter

volatile uint8_t usart3_rx_counter = 0x00

Definition at line 49 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

Referenced by main().

◆ usart3_tx_buffer

uint8_t usart3_tx_buffer[] = "usart transfer by interrupt: usart3 -> usart2 using interrupt"

Definition at line 43 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

Referenced by main().

◆ usart3_tx_buffer_size

uint8_t usart3_tx_buffer_size = ((sizeof( usart3_tx_buffer ) / sizeof(*( usart3_tx_buffer ))) - 1)

Definition at line 51 of file project/at_start_f415/examples/usart/interrupt/src/main.c.

Referenced by main().

◆ usart3_tx_counter

volatile uint8_t usart3_tx_counter = 0x00

Definition at line 47 of file project/at_start_f415/examples/usart/interrupt/src/main.c.


AT32F415 Firmwary Library: USART_irda

Functions
USART_irda
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | usart_configuration (void)
config usart
More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usart/irda/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usart/irda/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usart/irda/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 83 of file project/at_start_f415/examples/usart/irda/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usart/irda/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usart/irda/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usart/irda/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usart/irda/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usart/irda/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usart/irda/src/at32f415_int.c.

◆ usart_configuration()

void usart_configuration ( void )

config usart

Parameters
none
Return values
none

< gpio pins number 2

< gpio pins number 3

Definition at line 43 of file project/at_start_f415/examples/usart/irda/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: USART_polling

Macros | Functions | Variables
USART_polling
AT32F415_periph_examples

Macros

#define | COUNTOF(a) (sizeof(a) / sizeof(*(a)))
#define | USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
#define | USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | usart_configuration (void)
config usart
More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [] = "usart transfer by interrupt: usart2 -> usart3 using interrupt"
uint8_t | usart3_tx_buffer [] = "usart transfer by interrupt: usart3 -> usart2 using interrupt"
uint8_t | usart2_rx_buffer [((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
uint8_t | usart3_rx_buffer [((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
uint8_t | usart2_tx_counter = 0x00
uint8_t | usart3_tx_counter = 0x00
uint8_t | usart2_rx_counter = 0x00
uint8_t | usart3_rx_counter = 0x00
uint8_t | usart2_tx_buffer_size = ((sizeof( usart2_tx_buffer ) / sizeof(*( usart2_tx_buffer ))) - 1)
uint8_t | usart3_tx_buffer_size = ((sizeof( usart3_tx_buffer ) / sizeof(*( usart3_tx_buffer ))) - 1)

Detailed Description

Macro Definition Documentation

◆ COUNTOF

#define COUNTOF ( a ) (sizeof(a) / sizeof(*(a)))

Definition at line 38 of file project/at_start_f415/examples/usart/polling/src/main.c.

◆ USART2_TX_BUFFER_SIZE

#define USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)

Definition at line 39 of file project/at_start_f415/examples/usart/polling/src/main.c.

◆ USART3_TX_BUFFER_SIZE

#define USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Definition at line 40 of file project/at_start_f415/examples/usart/polling/src/main.c.

Function Documentation

◆ buffer_compare()

uint8_t buffer_compare | ( | uint8_t * | pbuffer1,
 |  | uint8_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

compares two buffers.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
1 pbuffer1 identical to pbuffer2 0: pbuffer1 differs from pbuffer2

Definition at line 118 of file project/at_start_f415/examples/usart/polling/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usart/polling/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usart/polling/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usart/polling/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< usart transmit data buffer empty flag

< usart receive data buffer full flag

< usart transmit data buffer empty flag

< usart receive data buffer full flag

Definition at line 137 of file project/at_start_f415/examples/usart/polling/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usart/polling/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usart/polling/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usart/polling/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usart/polling/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usart/polling/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usart/polling/src/at32f415_int.c.

◆ usart_configuration()

void usart_configuration ( void )

config usart

Parameters
none
Return values
none

< gpio pins number 2

< gpio pins number 10

< gpio pins number 3

< gpio pins number 11

Definition at line 58 of file project/at_start_f415/examples/usart/polling/src/main.c.

Referenced by main().

Variable Documentation

◆ usart2_rx_buffer

uint8_t usart2_rx_buffer[((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]

Definition at line 44 of file project/at_start_f415/examples/usart/polling/src/main.c.

Referenced by main().

◆ usart2_rx_counter

uint8_t usart2_rx_counter = 0x00

Definition at line 48 of file project/at_start_f415/examples/usart/polling/src/main.c.

Referenced by main().

◆ usart2_tx_buffer

uint8_t usart2_tx_buffer[] = "usart transfer by interrupt: usart2 -> usart3 using interrupt"

Definition at line 42 of file project/at_start_f415/examples/usart/polling/src/main.c.

Referenced by main().

◆ usart2_tx_buffer_size

uint8_t usart2_tx_buffer_size = ((sizeof( usart2_tx_buffer ) / sizeof(*( usart2_tx_buffer ))) - 1)

Definition at line 50 of file project/at_start_f415/examples/usart/polling/src/main.c.

Referenced by main().

◆ usart2_tx_counter

uint8_t usart2_tx_counter = 0x00

Definition at line 46 of file project/at_start_f415/examples/usart/polling/src/main.c.

Referenced by main().

◆ usart3_rx_buffer

uint8_t usart3_rx_buffer[((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]

Definition at line 45 of file project/at_start_f415/examples/usart/polling/src/main.c.

Referenced by main().

◆ usart3_rx_counter

uint8_t usart3_rx_counter = 0x00

Definition at line 49 of file project/at_start_f415/examples/usart/polling/src/main.c.

Referenced by main(), and USART3_IRQHandler().

◆ usart3_tx_buffer

uint8_t usart3_tx_buffer[] = "usart transfer by interrupt: usart3 -> usart2 using interrupt"

Definition at line 43 of file project/at_start_f415/examples/usart/polling/src/main.c.

Referenced by main().

◆ usart3_tx_buffer_size

uint8_t usart3_tx_buffer_size = ((sizeof( usart3_tx_buffer ) / sizeof(*( usart3_tx_buffer ))) - 1)

Definition at line 51 of file project/at_start_f415/examples/usart/polling/src/main.c.

Referenced by main(), USART2_IRQHandler(), and USART3_IRQHandler().

◆ usart3_tx_counter

uint8_t usart3_tx_counter = 0x00

Definition at line 47 of file project/at_start_f415/examples/usart/polling/src/main.c.

Referenced by main(), and USART3_IRQHandler().


AT32F415 Firmwary Library: USART_printf

Functions | Variables
USART_printf
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Variables

__IO uint32_t time_cnt = 0

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usart/printf/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usart/printf/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usart/printf/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 45 of file project/at_start_f415/examples/usart/printf/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usart/printf/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usart/printf/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usart/printf/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usart/printf/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usart/printf/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usart/printf/src/at32f415_int.c.

Variable Documentation

◆ time_cnt

__IO uint32_t time_cnt = 0

Definition at line 38 of file project/at_start_f415/examples/usart/printf/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: USART_receiver_mute

Macros | Functions | Variables
USART_receiver_mute
AT32F415_periph_examples

Macros

#define | BUFFER_SIZE 7
#define | MATCH_ID_VAL 0x81
#define | ERROR_ID_VAL 0x82
#define | DATA1_VAL 0x7F
#define | DATA2_VAL 0x7A
#define | DATA3_VAL 0x7B
#define | DATA4_VAL 0x7C

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | USART3_IRQHandler (void)
this function handles usart3 handler. More...
void | usart_configuration (void)
config usart
More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [7] = { 0x7F , 0x81 , 0x7A , 0x82 , 0x7B , 0x81 , 0x7C }
uint8_t | usart3_rx_buffer [7]
uint8_t | tx_counter = 0
uint8_t | rx_counter = 0

Detailed Description

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE 7

Definition at line 38 of file project/at_start_f415/examples/usart/receiver_mute/src/main.c.

◆ DATA1_VAL

#define DATA1_VAL 0x7F

Definition at line 41 of file project/at_start_f415/examples/usart/receiver_mute/src/main.c.

◆ DATA2_VAL

#define DATA2_VAL 0x7A

Definition at line 42 of file project/at_start_f415/examples/usart/receiver_mute/src/main.c.

◆ DATA3_VAL

#define DATA3_VAL 0x7B

Definition at line 43 of file project/at_start_f415/examples/usart/receiver_mute/src/main.c.

◆ DATA4_VAL

#define DATA4_VAL 0x7C

Definition at line 44 of file project/at_start_f415/examples/usart/receiver_mute/src/main.c.

◆ ERROR_ID_VAL

#define ERROR_ID_VAL 0x82

Definition at line 40 of file project/at_start_f415/examples/usart/receiver_mute/src/main.c.

◆ MATCH_ID_VAL

#define MATCH_ID_VAL 0x81

Definition at line 39 of file project/at_start_f415/examples/usart/receiver_mute/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 81 of file project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 116 of file project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< usart transmit data buffer empty flag

< usart transmit data complete flag

Definition at line 110 of file project/at_start_f415/examples/usart/receiver_mute/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 68 of file project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 46 of file project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 125 of file project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 107 of file project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 134 of file project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 94 of file project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c.

◆ USART3_IRQHandler()

void USART3_IRQHandler ( void )

this function handles usart3 handler.

Parameters
none
Return values
none

< usart receive data buffer full flag

Definition at line 143 of file project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c.

◆ usart_configuration()

void usart_configuration ( void )

config usart

Parameters
none
Return values
none

< gpio pins number 2

< gpio pins number 11

< usart receive data buffer full interrupt

Definition at line 56 of file project/at_start_f415/examples/usart/receiver_mute/src/main.c.

Referenced by main().

Variable Documentation

◆ rx_counter

uint8_t rx_counter = 0

Definition at line 49 of file project/at_start_f415/examples/usart/receiver_mute/src/main.c.

Referenced by USART3_IRQHandler().

◆ tx_counter

uint8_t tx_counter = 0

Definition at line 48 of file project/at_start_f415/examples/usart/receiver_mute/src/main.c.

Referenced by main().

◆ usart2_tx_buffer

uint8_t usart2_tx_buffer[7] = { 0x7F , 0x81 , 0x7A , 0x82 , 0x7B , 0x81 , 0x7C }

Definition at line 46 of file project/at_start_f415/examples/usart/receiver_mute/src/main.c.

Referenced by main().

◆ usart3_rx_buffer

uint8_t usart3_rx_buffer[7]

Definition at line 47 of file project/at_start_f415/examples/usart/receiver_mute/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: USART_smartcard

Data Structures | Macros | Functions | Variables
USART_smartcard
AT32F415_periph_examples

Data Structures

struct sc_atr_type

Macros

#define | T0_PROTOCOL 0x00 /* t0 protocol */
#define | SETUP_LENGTH 20
#define | HIST_LENGTH 20
#define | SC_RECEIVE_TIMEOUT 0x4000 /* direction to reader */

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | EXINT9_5_IRQHandler (void)
this function handles external lines 9 to 5 interrupt request. More...
void | SC_USART_IRQHandler (void)
this function handles sc_usart global interrupt request. More...
void | usart_configuration (void)
config usart More...
uint8_t | sc_response_decode (__IO uint8_t *card)
decode the card atr response. More...
int | main (void)
main function. More...

Variables

sc_atr_type sc_a2r_struct
uint32_t | counter = 0
error_status atr_decode_status = ERROR
uint32_t | card_inserted = 0
uint32_t | card_protocol = 1
uint8_t | dst_buffer [50]

Detailed Description

Macro Definition Documentation

◆ HIST_LENGTH

#define HIST_LENGTH 20

Definition at line 41 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

◆ SC_RECEIVE_TIMEOUT

#define SC_RECEIVE_TIMEOUT 0x4000 /* direction to reader */

Definition at line 42 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

◆ SETUP_LENGTH

#define SETUP_LENGTH 20

Definition at line 40 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

◆ T0_PROTOCOL

#define T0_PROTOCOL 0x00 /* t0 protocol */

Definition at line 39 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 81 of file project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 116 of file project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c.

◆ EXINT9_5_IRQHandler()

void EXINT9_5_IRQHandler ( void )

this function handles external lines 9 to 5 interrupt request.

Parameters
none
Return values
none

Definition at line 143 of file project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< usart receive data buffer full flag

Definition at line 270 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 68 of file project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 46 of file project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 125 of file project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c.

◆ sc_response_decode()

uint8_t sc_response_decode ( __IO uint8_t * card )

decode the card atr response.

Parameters
card pointer to the buffer containing the card atr.
Return values
card protocol

Definition at line 194 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by main().

◆ SC_USART_IRQHandler()

void SC_USART_IRQHandler ( void )

this function handles sc_usart global interrupt request.

Parameters
none
Return values
none

< usart parity error flag

< usart receive data buffer full interrupt

< usart receive data buffer full flag

< usart receive data buffer full interrupt

Definition at line 166 of file project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 107 of file project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 134 of file project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 94 of file project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c.

◆ usart_configuration()

void usart_configuration ( void )

config usart

Parameters
none
Return values
none

< usart parity error interrupt

Definition at line 70 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by main().

Variable Documentation

◆ atr_decode_status

error_status atr_decode_status = ERROR

Definition at line 57 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by main().

◆ card_inserted

uint32_t card_inserted = 0

Definition at line 58 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by EXINT9_5_IRQHandler(), and main().

◆ card_protocol

uint32_t card_protocol = 1

Definition at line 58 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by main().

◆ counter

uint32_t counter = 0

Definition at line 56 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by main().

◆ dst_buffer

uint8_t dst_buffer[50]
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}

Definition at line 59 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by main().

◆ sc_a2r_struct

sc_atr_type sc_a2r_struct

Definition at line 55 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by sc_response_decode().


AT32F415 Firmwary Library: sc_atr_type Struct Reference

Data Fields
sc_atr_type Struct Reference
AT32F415_periph_examples » USART_smartcard

Data Fields

uint8_t | ts
uint8_t | t0
uint8_t | t [20]
uint8_t | h [20]
uint8_t | tlength
uint8_t | hlength

Detailed Description

Definition at line 45 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Field Documentation

◆ h

uint8_t sc_atr_type::h[20]

Definition at line 50 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by sc_response_decode().

◆ hlength

uint8_t sc_atr_type::hlength

Definition at line 52 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by sc_response_decode().

◆ t

uint8_t sc_atr_type::t[20]

Definition at line 49 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by sc_response_decode().

◆ t0

uint8_t sc_atr_type::t0

Definition at line 48 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by sc_response_decode().

◆ tlength

uint8_t sc_atr_type::tlength

Definition at line 51 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by sc_response_decode().

◆ ts

uint8_t sc_atr_type::ts

Definition at line 47 of file project/at_start_f415/examples/usart/smartcard/src/main.c.

Referenced by sc_response_decode().

The documentation for this struct was generated from the following file:
  • project/at_start_f415/examples/usart/smartcard/src/main.c


AT32F415 Firmwary Library: USART_synchronous

Macros | Functions | Variables
USART_synchronous
AT32F415_periph_examples

Macros

#define | COUNTOF(a) (sizeof(a) / sizeof(*(a)))
#define | USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
#define | SPI2_TX_BUFFER_SIZE (COUNTOF(spi2_tx_buffer) - 1)
#define | DYMMY_BYTE 0x00

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | usart_spi_configuration (void)
config usart and spi
More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [] = "usart synchronous example: usart2 -> spi2"
uint8_t | spi2_tx_buffer [] = "usart synchronous example: spi2 -> usart2"
uint8_t | usart2_rx_buffer [((sizeof(spi2_tx_buffer)/sizeof(*(spi2_tx_buffer))) - 1)]
uint8_t | spi2_rx_buffer [((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
uint8_t | usart2_tx_counter = 0x00
uint8_t | spi2_tx_counter = 0x00
uint8_t | usart2_rx_counter = 0x00
uint8_t | spi2_rx_counter = 0x00
uint8_t | usart2_tx_buffer_size = ((sizeof( usart2_tx_buffer ) / sizeof(*( usart2_tx_buffer ))) - 1)
uint8_t | spi2_tx_buffer_size = ((sizeof( spi2_tx_buffer ) / sizeof(*( spi2_tx_buffer ))) - 1)

Detailed Description

Macro Definition Documentation

◆ COUNTOF

#define COUNTOF ( a ) (sizeof(a) / sizeof(*(a)))

Definition at line 38 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

◆ DYMMY_BYTE

#define DYMMY_BYTE 0x00

Definition at line 41 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

◆ SPI2_TX_BUFFER_SIZE

#define SPI2_TX_BUFFER_SIZE (COUNTOF(spi2_tx_buffer) - 1)

Definition at line 40 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

◆ USART2_TX_BUFFER_SIZE

#define USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)

Definition at line 39 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

Function Documentation

◆ buffer_compare()

uint8_t buffer_compare | ( | uint8_t * | pbuffer1,
 |  | uint8_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

compares two buffers.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
1 pbuffer1 identical to pbuffer2 0: pbuffer1 differs from pbuffer2

Definition at line 134 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< usart transmit data buffer empty flag

< spi or i2s receive data buffer full flag

< usart receive data buffer full flag

< spi or i2s transmit data buffer empty flag

< usart transmit data buffer empty flag

< usart receive data buffer full flag

Definition at line 153 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c.

◆ usart_spi_configuration()

void usart_spi_configuration ( void )

config usart and spi

Parameters
none
Return values
none

< gpio pins number 2

< gpio pins number 4

< gpio pins number 3

< gpio pins number 15

< gpio pins number 13

< gpio pins number 14

Definition at line 59 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

Referenced by main().

Variable Documentation

◆ spi2_rx_buffer

uint8_t spi2_rx_buffer[((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]

Definition at line 46 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

Referenced by main(), and SPI2_IRQHandler().

◆ spi2_rx_counter

uint8_t spi2_rx_counter = 0x00

Definition at line 50 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

Referenced by main().

◆ spi2_tx_buffer

uint8_t spi2_tx_buffer[] = "usart synchronous example: spi2 -> usart2"

Definition at line 44 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

Referenced by main(), and SPI2_IRQHandler().

◆ spi2_tx_buffer_size

uint8_t spi2_tx_buffer_size = ((sizeof( spi2_tx_buffer ) / sizeof(*( spi2_tx_buffer ))) - 1)

Definition at line 52 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

Referenced by main().

◆ spi2_tx_counter

uint8_t spi2_tx_counter = 0x00

Definition at line 48 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

Referenced by main().

◆ usart2_rx_buffer

uint8_t usart2_rx_buffer[((sizeof(spi2_tx_buffer)/sizeof(*(spi2_tx_buffer))) - 1)]

Definition at line 45 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

Referenced by main().

◆ usart2_rx_counter

uint8_t usart2_rx_counter = 0x00

Definition at line 49 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

Referenced by main(), and USART2_IRQHandler().

◆ usart2_tx_buffer

uint8_t usart2_tx_buffer[] = "usart synchronous example: usart2 -> spi2"

Definition at line 43 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

Referenced by main().

◆ usart2_tx_buffer_size

uint8_t usart2_tx_buffer_size = ((sizeof( usart2_tx_buffer ) / sizeof(*( usart2_tx_buffer ))) - 1)

Definition at line 51 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

Referenced by main(), USART2_IRQHandler(), and USART3_IRQHandler().

◆ usart2_tx_counter

uint8_t usart2_tx_counter = 0x00

Definition at line 47 of file project/at_start_f415/examples/usart/synchronous/src/main.c.

Referenced by main(), and USART2_IRQHandler().


AT32F415 Firmwary Library: USART_transfer_by_dma_interrupt

Macros | Functions | Variables
USART_transfer_by_dma_interrupt
AT32F415_periph_examples

Macros

#define | COUNTOF(a) (sizeof(a) / sizeof(*(a)))
#define | USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
#define | USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | DMA1_Channel1_IRQHandler (void)
this function handles dma1 channel1 handler. More...
void | DMA1_Channel2_IRQHandler (void)
this function handles dma1 channel2 handler. More...
void | DMA1_Channel3_IRQHandler (void)
this function handles dma1 channel3 handler. More...
void | DMA1_Channel4_IRQHandler (void)
this function handles dma1 channel4 handler. More...
void | usart_configuration (void)
config usart
More...
void | dma_configuration (void)
config dma for usart2 and usart3
More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [] = "usart transfer by dma interrupt: usart2 -> usart3 using dma"
uint8_t | usart3_tx_buffer [] = "usart transfer by dma interrupt: usart3 -> usart2 using dma"
uint8_t | usart2_rx_buffer [((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
uint8_t | usart3_rx_buffer [((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
volatile uint8_t | usart2_tx_dma_status = 0
volatile uint8_t | usart2_rx_dma_status = 0
volatile uint8_t | usart3_tx_dma_status = 0
volatile uint8_t | usart3_rx_dma_status = 0

Detailed Description

Macro Definition Documentation

◆ COUNTOF

#define COUNTOF ( a ) (sizeof(a) / sizeof(*(a)))

Definition at line 38 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

◆ USART2_TX_BUFFER_SIZE

#define USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)

Definition at line 39 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

◆ USART3_TX_BUFFER_SIZE

#define USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Definition at line 40 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

Function Documentation

◆ buffer_compare()

uint8_t buffer_compare | ( | uint8_t * | pbuffer1,
 |  | uint8_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

compares two buffers.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
1 pbuffer1 identical to pbuffer2 0: pbuffer1 differs from pbuffer2

Definition at line 231 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 83 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 118 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.

◆ DMA1_Channel1_IRQHandler()

void DMA1_Channel1_IRQHandler ( void )

this function handles dma1 channel1 handler.

Parameters
none
Return values
none

< dma1 channel1 full data transfer flag

< dma1 channel1 full data transfer flag

Definition at line 145 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.

◆ DMA1_Channel2_IRQHandler()

void DMA1_Channel2_IRQHandler ( void )

this function handles dma1 channel2 handler.

Parameters
none
Return values
none

< dma1 channel2 full data transfer flag

< dma1 channel2 full data transfer flag

Definition at line 160 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.

◆ DMA1_Channel3_IRQHandler()

void DMA1_Channel3_IRQHandler ( void )

this function handles dma1 channel3 handler.

Parameters
none
Return values
none

< dma1 channel3 full data transfer flag

< dma1 channel3 full data transfer flag

Definition at line 175 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.

◆ DMA1_Channel4_IRQHandler()

void DMA1_Channel4_IRQHandler ( void )

this function handles dma1 channel4 handler.

Parameters
none
Return values
none

< dma1 channel4 full data transfer flag

< dma1 channel4 full data transfer flag

Definition at line 190 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.

◆ dma_configuration()

void dma_configuration ( void )

config dma for usart2 and usart3

Parameters
none
Return values
none

< dma full data transfer interrupt

< dma flexible channel1

< dma full data transfer interrupt

< dma flexible channel2

< dma full data transfer interrupt

< dma flexible channel3

< dma full data transfer interrupt

< dma flexible channel4

Definition at line 115 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 57 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 250 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 70 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 48 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 127 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 109 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 136 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 96 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.

◆ usart_configuration()

void usart_configuration ( void )

config usart

Parameters
none
Return values
none

< gpio pins number 2

< gpio pins number 10

< gpio pins number 3

< gpio pins number 11

Definition at line 56 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

Referenced by main().

Variable Documentation

◆ usart2_rx_buffer

uint8_t usart2_rx_buffer[((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]

Definition at line 44 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

Referenced by dma_configuration(), and main().

◆ usart2_rx_dma_status

volatile uint8_t usart2_rx_dma_status = 0

Definition at line 47 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

Referenced by DMA1_Channel2_IRQHandler(), and main().

◆ usart2_tx_buffer

uint8_t usart2_tx_buffer[] = "usart transfer by dma interrupt: usart2 -> usart3 using dma"

Definition at line 42 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

Referenced by dma_configuration(), and main().

◆ usart2_tx_dma_status

volatile uint8_t usart2_tx_dma_status = 0

Definition at line 46 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

Referenced by DMA1_Channel1_IRQHandler(), and main().

◆ usart3_rx_buffer

uint8_t usart3_rx_buffer[((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]

Definition at line 45 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

Referenced by dma_configuration(), and main().

◆ usart3_rx_dma_status

volatile uint8_t usart3_rx_dma_status = 0

Definition at line 49 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

Referenced by DMA1_Channel4_IRQHandler(), and main().

◆ usart3_tx_buffer

uint8_t usart3_tx_buffer[] = "usart transfer by dma interrupt: usart3 -> usart2 using dma"

Definition at line 43 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

Referenced by dma_configuration(), and main().

◆ usart3_tx_dma_status

volatile uint8_t usart3_tx_dma_status = 0

Definition at line 48 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.

Referenced by DMA1_Channel3_IRQHandler(), and main().


AT32F415 Firmwary Library: USART_transfer_by_dma_polling

Macros | Functions | Variables
USART_transfer_by_dma_polling
AT32F415_periph_examples

Macros

#define | COUNTOF(a) (sizeof(a) / sizeof(*(a)))
#define | USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
#define | USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | usart_configuration (void)
config usart
More...
void | dma_configuration (void)
config dma for usart2 and usart3
More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [] = "usart transfer by dma interrupt: usart2 -> usart3 using dma"
uint8_t | usart3_tx_buffer [] = "usart transfer by dma interrupt: usart3 -> usart2 using dma"
uint8_t | usart2_rx_buffer [((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
uint8_t | usart3_rx_buffer [((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]

Detailed Description

Macro Definition Documentation

◆ COUNTOF

#define COUNTOF ( a ) (sizeof(a) / sizeof(*(a)))

Definition at line 38 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c.

◆ USART2_TX_BUFFER_SIZE

#define USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)

Definition at line 39 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c.

◆ USART3_TX_BUFFER_SIZE

#define USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Definition at line 40 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c.

Function Documentation

◆ buffer_compare()

uint8_t buffer_compare | ( | uint8_t * | pbuffer1,
 |  | uint8_t * | pbuffer2,
 |  | uint16_t | buffer_length
 | ) |  |

compares two buffers.

Parameters
pbuffer1,pbuffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
1 pbuffer1 identical to pbuffer2 0: pbuffer1 differs from pbuffer2

Definition at line 203 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c.

◆ dma_configuration()

void dma_configuration ( void )

config dma for usart2 and usart3

Parameters
none
Return values
none

< dma flexible channel1

< dma flexible channel2

< dma flexible channel3

< dma flexible channel4

Definition at line 111 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< dma1 channel1 full data transfer flag

< dma1 channel2 full data transfer flag

< dma1 channel3 full data transfer flag

< dma1 channel4 full data transfer flag

Definition at line 222 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c.

◆ usart_configuration()

void usart_configuration ( void )

config usart

Parameters
none
Return values
none

< gpio pins number 2

< gpio pins number 10

< gpio pins number 3

< gpio pins number 11

Definition at line 52 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c.

Referenced by main().

Variable Documentation

◆ usart2_rx_buffer

uint8_t usart2_rx_buffer[((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]

Definition at line 44 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c.

Referenced by dma_configuration(), main(), and USART2_IRQHandler().

◆ usart2_tx_buffer

uint8_t usart2_tx_buffer[] = "usart transfer by dma interrupt: usart2 -> usart3 using dma"

Definition at line 42 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c.

Referenced by dma_configuration(), main(), and USART2_IRQHandler().

◆ usart3_rx_buffer

uint8_t usart3_rx_buffer[((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]

Definition at line 45 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c.

Referenced by dma_configuration(), main(), and USART3_IRQHandler().

◆ usart3_tx_buffer

uint8_t usart3_tx_buffer[] = "usart transfer by dma interrupt: usart3 -> usart2 using dma"

Definition at line 43 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c.

Referenced by dma_configuration(), main(), and USART3_IRQHandler().


AT32F415 Firmwary Library: USB_device_audio

Modules | Macros | Functions | Variables
USB_device_audio
AT32F415_periph_examples

Modules

USB_device_audio_codec_reg_definition
USB_device_audio_codec_pin_definition
USB_device_audio_codec_exported_functions

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 64
#define | USBD_EP2_TX_SIZE 16
#define | USBD_EP3_TX_SIZE 16
#define | I2C_TIMEOUT 0xFFFFFFFF
#define | I2Cx_SPEED 100000
#define | I2Cx_ADDRESS 0x00
#define | I2Cx_PORT I2C1
#define | I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
#define | I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SCL_GPIO_PIN GPIO_PINS_8
#define | I2Cx_SCL_GPIO_PORT GPIOB
#define | I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SDA_GPIO_PIN GPIO_PINS_9
#define | I2Cx_SDA_GPIO_PORT GPIOB
#define | WM8988_REG_FREQ48K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0081)
wm8988 freq More...
#define | WM8988_REG_FREQ16K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0095)
#define | WM8988_REG_BITW16 ((WM8988_R7_AUDIO_INTERFACE << 9) | 0x0042)
wm8988 bit width More...

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | audio_codec_set_mic_freq (uint32_t freq)
audio codec set microphone freq More...
void | audio_codec_set_spk_freq (uint32_t freq)
audio codec set speaker freq More...
void | audio_codec_spk_alt_setting (uint32_t alt_seting)
audio codec speaker alt setting config More...
void | audio_codec_mic_alt_setting (uint32_t alt_seting)
audio codec microphone alt setting config More...
void | audio_codec_set_mic_mute (uint8_t mute)
audio codec set microphone mute More...
void | audio_codec_set_spk_mute (uint8_t mute)
audio codec set speaker mute More...
void | audio_codec_set_mic_volume (uint16_t volume)
audio codec set microphone volume More...
void | audio_codec_set_spk_volume (uint16_t volume)
audio codec set speaker volume More...
uint8_t | audio_codec_spk_feedback (uint8_t *feedback)
codec speaker feedback More...
void | audio_codec_spk_fifo_write (uint8_t *data, uint32_t len)
codec speaker write fifo More...
uint32_t | audio_codec_mic_get_data (uint8_t *buffer)
codec microphone get data More...
void | audio_codec_modify_freq (uint32_t freq)
audio codec modify freq More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
void | DMA1_Channel3_IRQHandler (void)
this function handles dma1 channel3 interrupt. More...
void | DMA1_Channel4_IRQHandler (void)
this function handles dma1 channel4 interrupt. More...
error_status | audio_codec_init (void)
audio codec init More...
error_status | audio_codec_loop (void)
audio codec loop More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...

Variables

uint16_t | reg_addr_data []
wm8988 register default value More...
i2c_handle_type hi2cx
audio_codec_type audio_codec
uint16_t | spk_dma_buffer [DMA_BUFFER_SIZE]
uint16_t | mic_dma_buffer [DMA_BUFFER_SIZE]
otg_core_type otg_core_struct

Detailed Description

Macro Definition Documentation

◆ I2C_TIMEOUT

#define I2C_TIMEOUT 0xFFFFFFFF

Definition at line 41 of file audio/src/audio_codec.c.

◆ I2Cx_ADDRESS

#define I2Cx_ADDRESS 0x00

Definition at line 44 of file audio/src/audio_codec.c.

◆ I2Cx_CLK

#define I2Cx_CLK CRM_I2C1_PERIPH_CLOCK

Definition at line 47 of file audio/src/audio_codec.c.

◆ I2Cx_PORT

#define I2Cx_PORT I2C1

Definition at line 46 of file audio/src/audio_codec.c.

◆ I2Cx_SCL_GPIO_CLK

#define I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 49 of file audio/src/audio_codec.c.

◆ I2Cx_SCL_GPIO_PIN

#define I2Cx_SCL_GPIO_PIN GPIO_PINS_8

Definition at line 50 of file audio/src/audio_codec.c.

◆ I2Cx_SCL_GPIO_PORT

#define I2Cx_SCL_GPIO_PORT GPIOB

Definition at line 51 of file audio/src/audio_codec.c.

◆ I2Cx_SDA_GPIO_CLK

#define I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 53 of file audio/src/audio_codec.c.

◆ I2Cx_SDA_GPIO_PIN

#define I2Cx_SDA_GPIO_PIN GPIO_PINS_9

Definition at line 54 of file audio/src/audio_codec.c.

◆ I2Cx_SDA_GPIO_PORT

#define I2Cx_SDA_GPIO_PORT GPIOB

Definition at line 55 of file audio/src/audio_codec.c.

◆ I2Cx_SPEED

#define I2Cx_SPEED 100000

Definition at line 43 of file audio/src/audio_codec.c.

◆ OTG_CLOCK

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 59 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ OTG_IRQ

#define OTG_IRQ OTGFS1_IRQn

Definition at line 60 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 61 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ OTG_PIN_GPIO

#define OTG_PIN_GPIO GPIOA

Definition at line 66 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 67 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ OTG_PIN_ID

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 69 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ OTG_PIN_SOF

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 73 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 71 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 72 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ OTG_PIN_VBUS

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 68 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 64 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 63 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ OTG_WKUP_IRQ

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 62 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ USB_ID

#define USB_ID 0

enable usb host mode

Definition at line 58 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ USBD_EP0_TX_SIZE

#define USBD_EP0_TX_SIZE 24

Definition at line 84 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ USBD_EP1_TX_SIZE

#define USBD_EP1_TX_SIZE 64

Definition at line 85 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ USBD_EP2_TX_SIZE

#define USBD_EP2_TX_SIZE 16

Definition at line 86 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ USBD_EP3_TX_SIZE

#define USBD_EP3_TX_SIZE 16

Definition at line 87 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ USBD_RX_SIZE

#define USBD_RX_SIZE 128

usb device mode config

usb device mode fifo

Definition at line 83 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ USE_OTG_DEVICE_MODE

#define USE_OTG_DEVICE_MODE

enable usb device mode

Definition at line 51 of file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.

◆ WM8988_REG_BITW16

#define WM8988_REG_BITW16 ((WM8988_R7_AUDIO_INTERFACE << 9) | 0x0042)

wm8988 bit width

Definition at line 66 of file audio/src/audio_codec.c.

◆ WM8988_REG_FREQ16K

#define WM8988_REG_FREQ16K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0095)

Definition at line 61 of file audio/src/audio_codec.c.

◆ WM8988_REG_FREQ48K

#define WM8988_REG_FREQ48K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0081)

wm8988 freq

Definition at line 60 of file audio/src/audio_codec.c.

Function Documentation

◆ audio_codec_init()

error_status audio_codec_init ( void )

audio codec init

Parameters
none
Return values
error status

Definition at line 796 of file audio/src/audio_codec.c.

◆ audio_codec_loop()

error_status audio_codec_loop ( void )

audio codec loop

Parameters
none
Return values
none

Definition at line 855 of file audio/src/audio_codec.c.

◆ audio_codec_mic_alt_setting()

void audio_codec_mic_alt_setting ( uint32_t alt_seting )

audio codec microphone alt setting config

Parameters
none
Return values
none

Definition at line 169 of file audio/src/audio_codec.c.

◆ audio_codec_mic_get_data()

uint32_t audio_codec_mic_get_data ( uint8_t * buffer )

codec microphone get data

Parameters
data data buffer
Return values
data len

Definition at line 282 of file audio/src/audio_codec.c.

◆ audio_codec_modify_freq()

void audio_codec_modify_freq ( uint32_t freq )

audio codec modify freq

Parameters
freq freq (wm8988 microphone and speaker must as same freq)
Return values
none

Definition at line 342 of file audio/src/audio_codec.c.

Referenced by audio_codec_set_mic_freq(), and audio_codec_set_spk_freq().

◆ audio_codec_set_mic_freq()

void audio_codec_set_mic_freq ( uint32_t freq )

audio codec set microphone freq

Parameters
freq freq (wm8988 microphone and speaker must same freq)
Return values
none

Definition at line 121 of file audio/src/audio_codec.c.

◆ audio_codec_set_mic_mute()

void audio_codec_set_mic_mute ( uint8_t mute )

audio codec set microphone mute

Parameters
mute mute state
Return values
none

Definition at line 184 of file audio/src/audio_codec.c.

◆ audio_codec_set_mic_volume()

void audio_codec_set_mic_volume ( uint16_t volume )

audio codec set microphone volume

Parameters
volume the new volume
Return values
none

Definition at line 206 of file audio/src/audio_codec.c.

◆ audio_codec_set_spk_freq()

void audio_codec_set_spk_freq ( uint32_t freq )

audio codec set speaker freq

Parameters
freq freq(wm8988 microphone and speaker must same freq)
Return values
none

Definition at line 137 of file audio/src/audio_codec.c.

◆ audio_codec_set_spk_mute()

void audio_codec_set_spk_mute ( uint8_t mute )

audio codec set speaker mute

Parameters
mute mute state
Return values
none

Definition at line 195 of file audio/src/audio_codec.c.

◆ audio_codec_set_spk_volume()

void audio_codec_set_spk_volume ( uint16_t volume )

audio codec set speaker volume

Parameters
volume the new volume
Return values
none

Definition at line 217 of file audio/src/audio_codec.c.

◆ audio_codec_spk_alt_setting()

void audio_codec_spk_alt_setting ( uint32_t alt_seting )

audio codec speaker alt setting config

Parameters
none
Return values
none

Definition at line 154 of file audio/src/audio_codec.c.

◆ audio_codec_spk_feedback()

uint8_t audio_codec_spk_feedback ( uint8_t * feedback )

codec speaker feedback

Parameters
feedback data buffer
Return values
feedback len

Definition at line 228 of file audio/src/audio_codec.c.

◆ audio_codec_spk_fifo_write()

void audio_codec_spk_fifo_write | ( | uint8_t * | data,
 |  | uint32_t | len
 | ) |  |

codec speaker write fifo

audio codec interface

Parameters
data | data buffer
len | data length
Return values
none

Definition at line 244 of file audio/src/audio_codec.c.

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 76 of file project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 111 of file project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c.

◆ DMA1_Channel3_IRQHandler()

void DMA1_Channel3_IRQHandler ( void )

this function handles dma1 channel3 interrupt.

Parameters
none
Return values
none

Definition at line 651 of file audio/src/audio_codec.c.

◆ DMA1_Channel4_IRQHandler()

void DMA1_Channel4_IRQHandler ( void )

this function handles dma1 channel4 interrupt.

Parameters
none
Return values
none

Definition at line 726 of file audio/src/audio_codec.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 50 of file project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c.

◆ i2c_lowlevel_init()

void i2c_lowlevel_init ( i2c_handle_type * hi2c )

initializes peripherals used by the i2c.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 7

< gpio pins number 6

< gpio pins number 7

< gpio pins number 6

< gpio pins number 7

< gpio pins number 6

< gpio pins number 7

< gpio pins number 6

< gpio pins number 7

Definition at line 399 of file audio/src/audio_codec.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/usb_device/audio/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 63 of file project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 41 of file project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 209 of file project/at_start_f415/examples/usb_device/audio/src/main.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 120 of file project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 102 of file project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 129 of file project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 89 of file project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c.

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb endpoint max num define

usb delay millisecond function.

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Parameters
ms number of millisecond delay
Return values
none

Definition at line 219 of file project/at_start_f415/examples/usb_device/audio/src/main.c.

Referenced by usbd_remote_wakeup(), usbh_loop_handler(), usbh_reset_port(), usbh_resume(), and usbh_suspend().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

Variable Documentation

◆ audio_codec

audio_codec_type audio_codec

Definition at line 106 of file audio/src/audio_codec.c.

Referenced by audio_codec_init(), audio_codec_loop(), audio_codec_mic_get_data(), audio_codec_set_mic_freq(), audio_codec_set_mic_mute(), audio_codec_set_mic_volume(), audio_codec_set_spk_freq(), audio_codec_set_spk_mute(), audio_codec_set_spk_volume(), audio_codec_spk_feedback(), audio_codec_spk_fifo_write(), DMA1_Channel3_IRQHandler(), and DMA1_Channel4_IRQHandler().

◆ hi2cx

i2c_handle_type hi2cx

Definition at line 104 of file audio/src/audio_codec.c.

Referenced by audio_codec_init(), audio_codec_loop(), and audio_codec_modify_freq().

◆ mic_dma_buffer

uint16_t mic_dma_buffer[DMA_BUFFER_SIZE]

Definition at line 108 of file audio/src/audio_codec.c.

Referenced by codec_i2s_init(), and DMA1_Channel4_IRQHandler().

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 45 of file project/at_start_f415/examples/usb_device/audio/src/main.c.

Referenced by main(), and OTG_IRQ_HANDLER().

◆ reg_addr_data

uint16_t reg_addr_data[]

wm8988 register default value

Definition at line 71 of file audio/src/audio_codec.c.

Referenced by audio_codec_init().

◆ spk_dma_buffer

uint16_t spk_dma_buffer[DMA_BUFFER_SIZE]

Definition at line 107 of file audio/src/audio_codec.c.

Referenced by codec_i2s_init(), and DMA1_Channel3_IRQHandler().


AT32F415 Firmwary Library: USB_device_audio_codec_reg_definition

Macros
USB_device_audio_codec_reg_definition
AT32F415_periph_examples » USB_device_audio

Macros

#define | WM8988_R0_LEFT_INPUT_VOLUME 0x00 /*Left channel PGA control*/
#define | WM8988_R1_RIGHT_INPUT_VOLUME 0x01 /*Right channel PGA control*/
#define | WM8988_R2_LOUT1_VOLUME 0x02
#define | WM8988_R3_ROUT1_VOLUME 0x03
#define | WM8988_R4_RESERVED 0x04
#define | WM8988_R5_ADC_DAC_CONTROL 0x05
#define | WM8988_R6_RESERVED 0x06
#define | WM8988_R7_AUDIO_INTERFACE 0x07
#define | WM8988_R8_SAMPLE_RATE 0x08
#define | WM8988_R9_RESERVED 0x09
#define | WM8988_R10_LEFT_DAC_VOLUME 0x0A
#define | WM8988_R11_RIGHT_DAC_VOLUME 0x0B
#define | WM8988_R12_BASS_CONTROL 0x0C
#define | WM8988_R13_TREBLE_CONTROL 0x0D
#define | WM8988_R14_
#define | WM8988_R15_RESET 0x0F
#define | WM8988_R16_3D_CONTROL 0x10
#define | WM8988_R17_ALC1 0x11
#define | WM8988_R18_ALC2 0x12
#define | WM8988_R19_ALC3 0x13
#define | WM8988_R20_NOISE_GATE 0x14
#define | WM8988_R21_LEFT_ADC_VOLUME 0x15
#define | WM8988_R22_RIGHT_ADC_VOLUME 0x16
#define | WM8988_R23_ADDITIONAL_1_CONTROL 0x17
#define | WM8988_R24_ADDITIONAL_2_CONTROL 0x18
#define | WM8988_R25_PWR_1_MGMT 0x19
#define | WM8988_R26_PWR_2_MGMT 0x1A
#define | WM8988_R27_ADDITIONAL_3_CONTROL 0x1B
#define | WM8988_R31_ADC_INPUT_MODE 0x1F
#define | WM8988_R32_ADC_L_SIGNAL_PATH 0x20
#define | WM8988_R33_ADC_R_SIGNAL_PATH 0x21
#define | WM8988_R34_LEFT_OUT_MIX_1 0x22
#define | WM8988_R35_LEFT_OUT_MIX_2 0x23
#define | WM8988_R36_RIGHT_OUT_MIX_1 0x24
#define | WM8988_R37_RIGHT_OUT_MIX_2 0x25
#define | WM8988_R38_RESERVED
#define | WM8988_R39_RESERVED
#define | WM8988_R40_LOUT2_VOLUME 0x28
#define | WM8988_R41_ROUT2_VOLUME 0x29
#define | WM8988_R42_RESERVED
#define | WM8988_R43_LOW_POWER_PALYBACK 0x43
#define | WM8988_I2C_ADDR_CSB_LOW 0x34
#define | WM8988_I2C_ADDR_CSB_HIGH 0x36

Detailed Description

Macro Definition Documentation

◆ WM8988_I2C_ADDR_CSB_HIGH

#define WM8988_I2C_ADDR_CSB_HIGH 0x36

Definition at line 94 of file audio/inc/audio_codec.h.

◆ WM8988_I2C_ADDR_CSB_LOW

#define WM8988_I2C_ADDR_CSB_LOW 0x34

Definition at line 93 of file audio/inc/audio_codec.h.

◆ WM8988_R0_LEFT_INPUT_VOLUME

#define WM8988_R0_LEFT_INPUT_VOLUME 0x00 /*Left channel PGA control*/

Definition at line 50 of file audio/inc/audio_codec.h.

◆ WM8988_R10_LEFT_DAC_VOLUME

#define WM8988_R10_LEFT_DAC_VOLUME 0x0A

Definition at line 60 of file audio/inc/audio_codec.h.

◆ WM8988_R11_RIGHT_DAC_VOLUME

#define WM8988_R11_RIGHT_DAC_VOLUME 0x0B

Definition at line 61 of file audio/inc/audio_codec.h.

◆ WM8988_R12_BASS_CONTROL

#define WM8988_R12_BASS_CONTROL 0x0C

Definition at line 62 of file audio/inc/audio_codec.h.

◆ WM8988_R13_TREBLE_CONTROL

#define WM8988_R13_TREBLE_CONTROL 0x0D

Definition at line 63 of file audio/inc/audio_codec.h.

◆ WM8988_R14_

#define WM8988_R14_

Definition at line 64 of file audio/inc/audio_codec.h.

◆ WM8988_R15_RESET

#define WM8988_R15_RESET 0x0F

Definition at line 65 of file audio/inc/audio_codec.h.

◆ WM8988_R16_3D_CONTROL

#define WM8988_R16_3D_CONTROL 0x10

Definition at line 66 of file audio/inc/audio_codec.h.

◆ WM8988_R17_ALC1

#define WM8988_R17_ALC1 0x11

Definition at line 67 of file audio/inc/audio_codec.h.

◆ WM8988_R18_ALC2

#define WM8988_R18_ALC2 0x12

Definition at line 68 of file audio/inc/audio_codec.h.

◆ WM8988_R19_ALC3

#define WM8988_R19_ALC3 0x13

Definition at line 69 of file audio/inc/audio_codec.h.

◆ WM8988_R1_RIGHT_INPUT_VOLUME

#define WM8988_R1_RIGHT_INPUT_VOLUME 0x01 /*Right channel PGA control*/

Definition at line 51 of file audio/inc/audio_codec.h.

◆ WM8988_R20_NOISE_GATE

#define WM8988_R20_NOISE_GATE 0x14

Definition at line 70 of file audio/inc/audio_codec.h.

◆ WM8988_R21_LEFT_ADC_VOLUME

#define WM8988_R21_LEFT_ADC_VOLUME 0x15

Definition at line 71 of file audio/inc/audio_codec.h.

◆ WM8988_R22_RIGHT_ADC_VOLUME

#define WM8988_R22_RIGHT_ADC_VOLUME 0x16

Definition at line 72 of file audio/inc/audio_codec.h.

◆ WM8988_R23_ADDITIONAL_1_CONTROL

#define WM8988_R23_ADDITIONAL_1_CONTROL 0x17

Definition at line 73 of file audio/inc/audio_codec.h.

◆ WM8988_R24_ADDITIONAL_2_CONTROL

#define WM8988_R24_ADDITIONAL_2_CONTROL 0x18

Definition at line 74 of file audio/inc/audio_codec.h.

◆ WM8988_R25_PWR_1_MGMT

#define WM8988_R25_PWR_1_MGMT 0x19

Definition at line 75 of file audio/inc/audio_codec.h.

◆ WM8988_R26_PWR_2_MGMT

#define WM8988_R26_PWR_2_MGMT 0x1A

Definition at line 76 of file audio/inc/audio_codec.h.

◆ WM8988_R27_ADDITIONAL_3_CONTROL

#define WM8988_R27_ADDITIONAL_3_CONTROL 0x1B

Definition at line 77 of file audio/inc/audio_codec.h.

◆ WM8988_R2_LOUT1_VOLUME

#define WM8988_R2_LOUT1_VOLUME 0x02

Definition at line 52 of file audio/inc/audio_codec.h.

◆ WM8988_R31_ADC_INPUT_MODE

#define WM8988_R31_ADC_INPUT_MODE 0x1F

Definition at line 79 of file audio/inc/audio_codec.h.

◆ WM8988_R32_ADC_L_SIGNAL_PATH

#define WM8988_R32_ADC_L_SIGNAL_PATH 0x20

Definition at line 80 of file audio/inc/audio_codec.h.

◆ WM8988_R33_ADC_R_SIGNAL_PATH

#define WM8988_R33_ADC_R_SIGNAL_PATH 0x21

Definition at line 81 of file audio/inc/audio_codec.h.

◆ WM8988_R34_LEFT_OUT_MIX_1

#define WM8988_R34_LEFT_OUT_MIX_1 0x22

Definition at line 82 of file audio/inc/audio_codec.h.

◆ WM8988_R35_LEFT_OUT_MIX_2

#define WM8988_R35_LEFT_OUT_MIX_2 0x23

Definition at line 83 of file audio/inc/audio_codec.h.

◆ WM8988_R36_RIGHT_OUT_MIX_1

#define WM8988_R36_RIGHT_OUT_MIX_1 0x24

Definition at line 84 of file audio/inc/audio_codec.h.

◆ WM8988_R37_RIGHT_OUT_MIX_2

#define WM8988_R37_RIGHT_OUT_MIX_2 0x25

Definition at line 85 of file audio/inc/audio_codec.h.

◆ WM8988_R38_RESERVED

#define WM8988_R38_RESERVED

Definition at line 86 of file audio/inc/audio_codec.h.

◆ WM8988_R39_RESERVED

#define WM8988_R39_RESERVED

Definition at line 87 of file audio/inc/audio_codec.h.

◆ WM8988_R3_ROUT1_VOLUME

#define WM8988_R3_ROUT1_VOLUME 0x03

Definition at line 53 of file audio/inc/audio_codec.h.

◆ WM8988_R40_LOUT2_VOLUME

#define WM8988_R40_LOUT2_VOLUME 0x28

Definition at line 88 of file audio/inc/audio_codec.h.

◆ WM8988_R41_ROUT2_VOLUME

#define WM8988_R41_ROUT2_VOLUME 0x29

Definition at line 89 of file audio/inc/audio_codec.h.

◆ WM8988_R42_RESERVED

#define WM8988_R42_RESERVED

Definition at line 90 of file audio/inc/audio_codec.h.

◆ WM8988_R43_LOW_POWER_PALYBACK

#define WM8988_R43_LOW_POWER_PALYBACK 0x43

Definition at line 91 of file audio/inc/audio_codec.h.

◆ WM8988_R4_RESERVED

#define WM8988_R4_RESERVED 0x04

Definition at line 54 of file audio/inc/audio_codec.h.

◆ WM8988_R5_ADC_DAC_CONTROL

#define WM8988_R5_ADC_DAC_CONTROL 0x05

Definition at line 55 of file audio/inc/audio_codec.h.

◆ WM8988_R6_RESERVED

#define WM8988_R6_RESERVED 0x06

Definition at line 56 of file audio/inc/audio_codec.h.

◆ WM8988_R7_AUDIO_INTERFACE

#define WM8988_R7_AUDIO_INTERFACE 0x07

Definition at line 57 of file audio/inc/audio_codec.h.

◆ WM8988_R8_SAMPLE_RATE

#define WM8988_R8_SAMPLE_RATE 0x08

Definition at line 58 of file audio/inc/audio_codec.h.

◆ WM8988_R9_RESERVED

#define WM8988_R9_RESERVED 0x09

Definition at line 59 of file audio/inc/audio_codec.h.


AT32F415 Firmwary Library: USB_device_audio_codec_pin_definition

Macros
USB_device_audio_codec_pin_definition
AT32F415_periph_examples » USB_device_audio

Macros

#define | I2S1_WS_PIN GPIO_PINS_4
#define | I2S1_CK_PIN GPIO_PINS_5
#define | I2S1_SD_PIN GPIO_PINS_7
#define | I2S1_GPIO GPIOA
#define | I2S1_GPIO_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
#define | I2S1_DT_ADDRESS (&(SPI1->dt))
#define | I2S2_WS_PIN GPIO_PINS_12
#define | I2S2_CK_PIN GPIO_PINS_13
#define | I2S2_SD_PIN GPIO_PINS_15
#define | I2S2_GPIO GPIOB
#define | I2S2_GPIO_CRM_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2S2_DT_ADDRESS (&(SPI2->dt))
#define | SPK_TX_FIFO_SIZE (1024 * 4)

Detailed Description

Macro Definition Documentation

◆ I2S1_CK_PIN

#define I2S1_CK_PIN GPIO_PINS_5

Definition at line 104 of file audio/inc/audio_codec.h.

◆ I2S1_DT_ADDRESS

#define I2S1_DT_ADDRESS (&(SPI1->dt))

Definition at line 109 of file audio/inc/audio_codec.h.

◆ I2S1_GPIO

#define I2S1_GPIO GPIOA

Definition at line 107 of file audio/inc/audio_codec.h.

◆ I2S1_GPIO_CRM_CLK

#define I2S1_GPIO_CRM_CLK CRM_GPIOA_PERIPH_CLOCK

Definition at line 108 of file audio/inc/audio_codec.h.

◆ I2S1_SD_PIN

#define I2S1_SD_PIN GPIO_PINS_7

Definition at line 105 of file audio/inc/audio_codec.h.

◆ I2S1_WS_PIN

#define I2S1_WS_PIN GPIO_PINS_4

Definition at line 103 of file audio/inc/audio_codec.h.

◆ I2S2_CK_PIN

#define I2S2_CK_PIN GPIO_PINS_13

Definition at line 113 of file audio/inc/audio_codec.h.

◆ I2S2_DT_ADDRESS

#define I2S2_DT_ADDRESS (&(SPI2->dt))

Definition at line 119 of file audio/inc/audio_codec.h.

◆ I2S2_GPIO

#define I2S2_GPIO GPIOB

Definition at line 117 of file audio/inc/audio_codec.h.

◆ I2S2_GPIO_CRM_CLK

#define I2S2_GPIO_CRM_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 118 of file audio/inc/audio_codec.h.

◆ I2S2_SD_PIN

#define I2S2_SD_PIN GPIO_PINS_15

Definition at line 114 of file audio/inc/audio_codec.h.

◆ I2S2_WS_PIN

#define I2S2_WS_PIN GPIO_PINS_12

Definition at line 112 of file audio/inc/audio_codec.h.

◆ SPK_TX_FIFO_SIZE

#define SPK_TX_FIFO_SIZE (1024 * 4)

Definition at line 121 of file audio/inc/audio_codec.h.


AT32F415 Firmwary Library: USB_device_audio_codec_exported_functions

Data Structures | Macros | Functions
USB_device_audio_codec_exported_functions
AT32F415_periph_examples » USB_device_audio

Data Structures

struct audio_codec_type

Macros

#define | MIC_BUFFER_SIZE 1024
#define | SPK_BUFFER_SIZE 4096
#define | DMA_BUFFER_SIZE 288

Functions

error_status | audio_codec_init (void)
audio codec init More...
error_status | audio_codec_loop (void)
audio codec loop More...
void | audio_codec_modify_freq (uint32_t freq)
audio codec modify freq More...
void | audio_codec_spk_fifo_write (uint8_t *data, uint32_t len)
audio codec interface More...
uint32_t | audio_codec_mic_get_data (uint8_t *buffer)
codec microphone get data More...
uint8_t | audio_codec_spk_feedback (uint8_t *feedback)
codec speaker feedback More...
void | audio_codec_spk_alt_setting (uint32_t alt_seting)
audio codec speaker alt setting config More...
void | audio_codec_mic_alt_setting (uint32_t alt_seting)
audio codec microphone alt setting config More...
void | audio_codec_set_mic_mute (uint8_t mute)
audio codec set microphone mute More...
void | audio_codec_set_spk_mute (uint8_t mute)
audio codec set speaker mute More...
void | audio_codec_set_mic_volume (uint16_t volume)
audio codec set microphone volume More...
void | audio_codec_set_spk_volume (uint16_t volume)
audio codec set speaker volume More...
void | audio_codec_set_mic_freq (uint32_t freq)
audio codec set microphone freq More...
void | audio_codec_set_spk_freq (uint32_t freq)
audio codec set speaker freq More...

Detailed Description

Macro Definition Documentation

◆ DMA_BUFFER_SIZE

#define DMA_BUFFER_SIZE 288

Definition at line 132 of file audio/inc/audio_codec.h.

◆ MIC_BUFFER_SIZE

#define MIC_BUFFER_SIZE 1024

Definition at line 130 of file audio/inc/audio_codec.h.

◆ SPK_BUFFER_SIZE

#define SPK_BUFFER_SIZE 4096

Definition at line 131 of file audio/inc/audio_codec.h.

Function Documentation

◆ audio_codec_init()

error_status audio_codec_init ( void )

audio codec init

Parameters
none
Return values
error status

Definition at line 796 of file audio/src/audio_codec.c.

Referenced by main().

◆ audio_codec_loop()

error_status audio_codec_loop ( void )

audio codec loop

Parameters
none
Return values
none

Definition at line 855 of file audio/src/audio_codec.c.

Referenced by main().

◆ audio_codec_mic_alt_setting()

void audio_codec_mic_alt_setting ( uint32_t alt_seting )

audio codec microphone alt setting config

Parameters
none
Return values
none

Definition at line 169 of file audio/src/audio_codec.c.

Referenced by audio_set_interface(), and class_event_handler().

◆ audio_codec_mic_get_data()

uint32_t audio_codec_mic_get_data ( uint8_t * buffer )

codec microphone get data

Parameters
data data buffer
Return values
data len

Definition at line 282 of file audio/src/audio_codec.c.

Referenced by audio_inisoincom_event(), audio_set_interface(), and class_in_handler().

◆ audio_codec_modify_freq()

void audio_codec_modify_freq ( uint32_t freq )

audio codec modify freq

Parameters
freq freq (wm8988 microphone and speaker must as same freq)
Return values
none

Definition at line 342 of file audio/src/audio_codec.c.

◆ audio_codec_set_mic_freq()

void audio_codec_set_mic_freq ( uint32_t freq )

audio codec set microphone freq

Parameters
freq freq (wm8988 microphone and speaker must same freq)
Return values
none

Definition at line 121 of file audio/src/audio_codec.c.

Referenced by class_ept0_rx_handler().

◆ audio_codec_set_mic_mute()

void audio_codec_set_mic_mute ( uint8_t mute )

audio codec set microphone mute

Parameters
mute mute state
Return values
none

Definition at line 184 of file audio/src/audio_codec.c.

Referenced by class_ept0_rx_handler().

◆ audio_codec_set_mic_volume()

void audio_codec_set_mic_volume ( uint16_t volume )

audio codec set microphone volume

Parameters
volume the new volume
Return values
none

Definition at line 206 of file audio/src/audio_codec.c.

Referenced by class_ept0_rx_handler().

◆ audio_codec_set_spk_freq()

void audio_codec_set_spk_freq ( uint32_t freq )

audio codec set speaker freq

Parameters
freq freq(wm8988 microphone and speaker must same freq)
Return values
none

Definition at line 137 of file audio/src/audio_codec.c.

Referenced by class_ept0_rx_handler().

◆ audio_codec_set_spk_mute()

void audio_codec_set_spk_mute ( uint8_t mute )

audio codec set speaker mute

Parameters
mute mute state
Return values
none

Definition at line 195 of file audio/src/audio_codec.c.

Referenced by class_ept0_rx_handler().

◆ audio_codec_set_spk_volume()

void audio_codec_set_spk_volume ( uint16_t volume )

audio codec set speaker volume

Parameters
volume the new volume
Return values
none

Definition at line 217 of file audio/src/audio_codec.c.

Referenced by class_ept0_rx_handler().

◆ audio_codec_spk_alt_setting()

void audio_codec_spk_alt_setting ( uint32_t alt_seting )

audio codec speaker alt setting config

Parameters
none
Return values
none

Definition at line 154 of file audio/src/audio_codec.c.

Referenced by audio_set_interface(), and class_event_handler().

◆ audio_codec_spk_feedback()

uint8_t audio_codec_spk_feedback ( uint8_t * feedback )

codec speaker feedback

Parameters
feedback data buffer
Return values
feedback len

Definition at line 228 of file audio/src/audio_codec.c.

Referenced by class_sof_handler().

◆ audio_codec_spk_fifo_write()

void audio_codec_spk_fifo_write | ( | uint8_t * | data,
 |  | uint32_t | len
 | ) |  |

audio codec interface

audio codec interface

Parameters
data | data buffer
len | data length
Return values
none

Definition at line 244 of file audio/src/audio_codec.c.

Referenced by class_out_handler().


AT32F415 Firmwary Library: audio_codec_type Struct Reference

Data Fields
audio_codec_type Struct Reference
AT32F415_periph_examples » USB_device_audio » USB_device_audio_codec_exported_functions | AT32F415_periph_examples » USB_device_audio_hid » USB_device_audio_hid_codec_exported_functions

#include <audio_codec.h>

Data Fields

uint32_t | audio_freq
uint32_t | audio_bitw
uint16_t | spk_buffer [4096]
uint16_t * | spk_roff
uint16_t * | spk_woff
uint16_t * | spk_rend
uint32_t | spk_freq
uint32_t | spk_wtotal
uint32_t | spk_rtotal
uint16_t | spk_threshold
uint16_t | spk_calc
uint8_t | spk_stage
uint16_t | mic_buffer [1024]
uint16_t * | mic_roff
uint16_t * | mic_woff
uint16_t * | mic_wend
uint32_t | mic_wtotal
uint32_t | mic_rtotal
uint32_t | mic_delta
uint16_t | mic_calc
uint16_t | mic_adj_count
uint8_t | mic_adj_stage
uint8_t | mic_stage
uint8_t | mic_mute
uint8_t | spk_mute
uint16_t | mic_volume
uint16_t | spk_volume
uint32_t | spk_tx_size
uint32_t | mic_rx_size
uint32_t | spk_enable
uint32_t | mic_enable

Detailed Description

Definition at line 134 of file audio/inc/audio_codec.h.

Field Documentation

◆ audio_bitw

uint32_t audio_codec_type::audio_bitw

Definition at line 137 of file audio/inc/audio_codec.h.

Referenced by audio_codec_init(), and codec_i2s_init().

◆ audio_freq

uint32_t audio_codec_type::audio_freq

Definition at line 136 of file audio/inc/audio_codec.h.

Referenced by audio_codec_init(), audio_codec_set_mic_freq(), audio_codec_set_spk_freq(), codec_i2s_init(), and DMA1_Channel3_IRQHandler().

◆ mic_adj_count

uint16_t audio_codec_type::mic_adj_count

Definition at line 159 of file audio/inc/audio_codec.h.

Referenced by audio_codec_mic_get_data(), and DMA1_Channel4_IRQHandler().

◆ mic_adj_stage

uint8_t audio_codec_type::mic_adj_stage

Definition at line 160 of file audio/inc/audio_codec.h.

Referenced by audio_codec_mic_get_data(), and DMA1_Channel4_IRQHandler().

◆ mic_buffer

uint16_t audio_codec_type::mic_buffer

Definition at line 151 of file audio/inc/audio_codec.h.

Referenced by audio_codec_mic_get_data(), codec_i2s_init(), and DMA1_Channel4_IRQHandler().

◆ mic_calc

uint16_t audio_codec_type::mic_calc

Definition at line 158 of file audio/inc/audio_codec.h.

Referenced by DMA1_Channel4_IRQHandler().

◆ mic_delta

uint32_t audio_codec_type::mic_delta

Definition at line 157 of file audio/inc/audio_codec.h.

Referenced by audio_codec_mic_get_data(), and DMA1_Channel4_IRQHandler().

◆ mic_enable

uint32_t audio_codec_type::mic_enable

Definition at line 173 of file audio/inc/audio_codec.h.

◆ mic_mute

uint8_t audio_codec_type::mic_mute

Definition at line 163 of file audio/inc/audio_codec.h.

Referenced by audio_codec_loop(), and audio_codec_set_mic_mute().

◆ mic_roff

uint16_t * audio_codec_type::mic_roff

Definition at line 152 of file audio/inc/audio_codec.h.

Referenced by audio_codec_mic_get_data(), codec_i2s_init(), and DMA1_Channel4_IRQHandler().

◆ mic_rtotal

uint32_t audio_codec_type::mic_rtotal

Definition at line 156 of file audio/inc/audio_codec.h.

Referenced by audio_codec_mic_get_data(), and DMA1_Channel4_IRQHandler().

◆ mic_rx_size

uint32_t audio_codec_type::mic_rx_size

Definition at line 170 of file audio/inc/audio_codec.h.

Referenced by audio_codec_mic_get_data(), codec_i2s_init(), and DMA1_Channel4_IRQHandler().

◆ mic_stage

uint8_t audio_codec_type::mic_stage

Definition at line 161 of file audio/inc/audio_codec.h.

Referenced by audio_codec_mic_get_data(), and DMA1_Channel4_IRQHandler().

◆ mic_volume

uint16_t audio_codec_type::mic_volume

Definition at line 166 of file audio/inc/audio_codec.h.

Referenced by audio_codec_loop(), and audio_codec_set_mic_volume().

◆ mic_wend

uint16_t * audio_codec_type::mic_wend

Definition at line 154 of file audio/inc/audio_codec.h.

Referenced by audio_codec_mic_get_data(), codec_i2s_init(), and DMA1_Channel4_IRQHandler().

◆ mic_woff

uint16_t * audio_codec_type::mic_woff

Definition at line 153 of file audio/inc/audio_codec.h.

Referenced by codec_i2s_init(), and DMA1_Channel4_IRQHandler().

◆ mic_wtotal

uint32_t audio_codec_type::mic_wtotal

Definition at line 155 of file audio/inc/audio_codec.h.

Referenced by audio_codec_mic_get_data(), and DMA1_Channel4_IRQHandler().

◆ spk_buffer

uint16_t audio_codec_type::spk_buffer

Definition at line 139 of file audio/inc/audio_codec.h.

Referenced by audio_codec_spk_fifo_write(), codec_i2s_init(), and DMA1_Channel3_IRQHandler().

◆ spk_calc

uint16_t audio_codec_type::spk_calc

Definition at line 147 of file audio/inc/audio_codec.h.

Referenced by DMA1_Channel3_IRQHandler().

◆ spk_enable

uint32_t audio_codec_type::spk_enable

Definition at line 172 of file audio/inc/audio_codec.h.

◆ spk_freq

uint32_t audio_codec_type::spk_freq

Definition at line 143 of file audio/inc/audio_codec.h.

Referenced by audio_codec_spk_feedback(), codec_i2s_init(), and DMA1_Channel3_IRQHandler().

◆ spk_mute

uint8_t audio_codec_type::spk_mute

Definition at line 164 of file audio/inc/audio_codec.h.

Referenced by audio_codec_loop(), and audio_codec_set_spk_mute().

◆ spk_rend

uint16_t * audio_codec_type::spk_rend

Definition at line 142 of file audio/inc/audio_codec.h.

Referenced by audio_codec_spk_fifo_write(), codec_i2s_init(), and DMA1_Channel3_IRQHandler().

◆ spk_roff

uint16_t * audio_codec_type::spk_roff

Definition at line 140 of file audio/inc/audio_codec.h.

Referenced by audio_codec_spk_fifo_write(), codec_i2s_init(), and DMA1_Channel3_IRQHandler().

◆ spk_rtotal

uint32_t audio_codec_type::spk_rtotal

Definition at line 145 of file audio/inc/audio_codec.h.

Referenced by audio_codec_spk_fifo_write(), and DMA1_Channel3_IRQHandler().

◆ spk_stage

uint8_t audio_codec_type::spk_stage

Definition at line 148 of file audio/inc/audio_codec.h.

Referenced by audio_codec_spk_fifo_write(), and DMA1_Channel3_IRQHandler().

◆ spk_threshold

uint16_t audio_codec_type::spk_threshold

Definition at line 146 of file audio/inc/audio_codec.h.

Referenced by audio_codec_spk_fifo_write(), and DMA1_Channel3_IRQHandler().

◆ spk_tx_size

uint32_t audio_codec_type::spk_tx_size

Definition at line 169 of file audio/inc/audio_codec.h.

Referenced by codec_i2s_init(), and DMA1_Channel3_IRQHandler().

◆ spk_volume

uint16_t audio_codec_type::spk_volume

Definition at line 167 of file audio/inc/audio_codec.h.

Referenced by audio_codec_loop(), and audio_codec_set_spk_volume().

◆ spk_woff

uint16_t * audio_codec_type::spk_woff

Definition at line 141 of file audio/inc/audio_codec.h.

Referenced by audio_codec_spk_fifo_write(), codec_i2s_init(), and DMA1_Channel3_IRQHandler().

◆ spk_wtotal

uint32_t audio_codec_type::spk_wtotal

Definition at line 144 of file audio/inc/audio_codec.h.

Referenced by audio_codec_spk_fifo_write(), and DMA1_Channel3_IRQHandler().

The documentation for this struct was generated from the following files:
  • audio/inc/audio_codec.h
  • composite_audio_hid/inc/audio_codec.h


AT32F415 Firmwary Library: USB_device_audio_hid

Modules | Macros | Functions | Variables
USB_device_audio_hid
AT32F415_periph_examples

Modules

USB_device_audio_hid_codec_reg_definition
USB_device_audio_hid_codec_pin_definition
USB_device_audio_hid_codec_exported_functions

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 64
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 16
#define | I2C_TIMEOUT 0xFFFFFFFF
#define | I2Cx_SPEED 100000
#define | I2Cx_ADDRESS 0x00
#define | I2Cx_PORT I2C1
#define | I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
#define | I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SCL_GPIO_PIN GPIO_PINS_8
#define | I2Cx_SCL_GPIO_PORT GPIOB
#define | I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SDA_GPIO_PIN GPIO_PINS_9
#define | I2Cx_SDA_GPIO_PORT GPIOB
#define | WM8988_REG_FREQ48K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0081)
wm8988 freq More...
#define | WM8988_REG_FREQ16K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0095)
#define | WM8988_REG_BITW16 ((WM8988_R7_AUDIO_INTERFACE << 9) | 0x0042)
wm8988 bit width More...

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | memset16_buffer (uint16_t *buffer, uint32_t set, uint32_t len)
buffer memset More...
void | codec_i2s_reset (void)
audio codec i2s reset More...
void | codec_i2s_init (audio_codec_type *param)
audio codec i2s init More...
void | mclk_tmr1_init (void)
mclk clock conifg More...
void | copy_buff (uint16_t *dest, uint16_t *src, uint32_t len)
copy buffer More...
void | audio_codec_set_mic_freq (uint32_t freq)
audio codec set microphone freq More...
void | audio_codec_set_spk_freq (uint32_t freq)
audio codec set speaker freq More...
void | audio_codec_spk_alt_setting (uint32_t alt_seting)
audio codec speaker alt setting config More...
void | audio_codec_mic_alt_setting (uint32_t alt_seting)
audio codec microphone alt setting config More...
void | audio_codec_set_mic_mute (uint8_t mute)
audio codec set microphone mute More...
void | audio_codec_set_spk_mute (uint8_t mute)
audio codec set speaker mute More...
void | audio_codec_set_mic_volume (uint16_t volume)
audio codec set microphone volume More...
void | audio_codec_set_spk_volume (uint16_t volume)
audio codec set speaker volume More...
uint8_t | audio_codec_spk_feedback (uint8_t *feedback)
codec speaker feedback More...
void | audio_codec_spk_fifo_write (uint8_t *data, uint32_t len)
codec speaker write fifo More...
uint32_t | audio_codec_mic_get_data (uint8_t *buffer)
codec microphone get data More...
void | audio_codec_modify_freq (uint32_t freq)
audio codec modify freq More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
void | DMA1_Channel3_IRQHandler (void)
this function handles dma1 channel3 interrupt. More...
void | DMA1_Channel4_IRQHandler (void)
this function handles dma1 channel4 interrupt. More...
error_status | audio_codec_init (void)
audio codec init More...
error_status | audio_codec_loop (void)
audio codec loop More...
void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...

Variables

uint16_t | reg_addr_data []
wm8988 register default value More...
i2c_handle_type hi2cx
audio_codec_type audio_codec
uint16_t | spk_dma_buffer [DMA_BUFFER_SIZE]
uint16_t | mic_dma_buffer [DMA_BUFFER_SIZE]
otg_core_type otg_core_struct
uint8_t | report_buf [USBD_IN_MAXPACKET_SIZE]

Detailed Description

Macro Definition Documentation

◆ I2C_TIMEOUT

#define I2C_TIMEOUT 0xFFFFFFFF

Definition at line 41 of file composite_audio_hid/src/audio_codec.c.

◆ I2Cx_ADDRESS

#define I2Cx_ADDRESS 0x00

Definition at line 44 of file composite_audio_hid/src/audio_codec.c.

◆ I2Cx_CLK

#define I2Cx_CLK CRM_I2C1_PERIPH_CLOCK

Definition at line 47 of file composite_audio_hid/src/audio_codec.c.

◆ I2Cx_PORT

#define I2Cx_PORT I2C1

Definition at line 46 of file composite_audio_hid/src/audio_codec.c.

◆ I2Cx_SCL_GPIO_CLK

#define I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 49 of file composite_audio_hid/src/audio_codec.c.

◆ I2Cx_SCL_GPIO_PIN

#define I2Cx_SCL_GPIO_PIN GPIO_PINS_8

Definition at line 50 of file composite_audio_hid/src/audio_codec.c.

◆ I2Cx_SCL_GPIO_PORT

#define I2Cx_SCL_GPIO_PORT GPIOB

Definition at line 51 of file composite_audio_hid/src/audio_codec.c.

◆ I2Cx_SDA_GPIO_CLK

#define I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 53 of file composite_audio_hid/src/audio_codec.c.

◆ I2Cx_SDA_GPIO_PIN

#define I2Cx_SDA_GPIO_PIN GPIO_PINS_9

Definition at line 54 of file composite_audio_hid/src/audio_codec.c.

◆ I2Cx_SDA_GPIO_PORT

#define I2Cx_SDA_GPIO_PORT GPIOB

Definition at line 55 of file composite_audio_hid/src/audio_codec.c.

◆ I2Cx_SPEED

#define I2Cx_SPEED 100000

Definition at line 43 of file composite_audio_hid/src/audio_codec.c.

◆ OTG_CLOCK

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 59 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ OTG_IRQ

#define OTG_IRQ OTGFS1_IRQn

Definition at line 60 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 61 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ OTG_PIN_GPIO

#define OTG_PIN_GPIO GPIOA

Definition at line 66 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 67 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ OTG_PIN_ID

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 69 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ OTG_PIN_SOF

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 73 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 71 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 72 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ OTG_PIN_VBUS

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 68 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 64 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 63 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ OTG_WKUP_IRQ

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 62 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ USB_ID

#define USB_ID 0

enable usb host mode

Definition at line 58 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ USBD_EP0_TX_SIZE

#define USBD_EP0_TX_SIZE 24

Definition at line 84 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ USBD_EP1_TX_SIZE

#define USBD_EP1_TX_SIZE 64

Definition at line 85 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ USBD_EP2_TX_SIZE

#define USBD_EP2_TX_SIZE 20

Definition at line 86 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ USBD_EP3_TX_SIZE

#define USBD_EP3_TX_SIZE 16

Definition at line 87 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ USBD_RX_SIZE

#define USBD_RX_SIZE 128

usb device mode config

usb device mode fifo

Definition at line 83 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ USE_OTG_DEVICE_MODE

#define USE_OTG_DEVICE_MODE

enable usb device mode

Definition at line 51 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.

◆ WM8988_REG_BITW16

#define WM8988_REG_BITW16 ((WM8988_R7_AUDIO_INTERFACE << 9) | 0x0042)

wm8988 bit width

Definition at line 66 of file composite_audio_hid/src/audio_codec.c.

◆ WM8988_REG_FREQ16K

#define WM8988_REG_FREQ16K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0095)

Definition at line 61 of file composite_audio_hid/src/audio_codec.c.

◆ WM8988_REG_FREQ48K

#define WM8988_REG_FREQ48K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0081)

wm8988 freq

Definition at line 60 of file composite_audio_hid/src/audio_codec.c.

Function Documentation

◆ audio_codec_init()

error_status audio_codec_init ( void )

audio codec init

Parameters
none
Return values
error status

Definition at line 796 of file composite_audio_hid/src/audio_codec.c.

Referenced by main().

◆ audio_codec_loop()

error_status audio_codec_loop ( void )

audio codec loop

Parameters
none
Return values
none

Definition at line 855 of file composite_audio_hid/src/audio_codec.c.

Referenced by main().

◆ audio_codec_mic_alt_setting()

void audio_codec_mic_alt_setting ( uint32_t alt_seting )

audio codec microphone alt setting config

Parameters
none
Return values
none

Definition at line 169 of file composite_audio_hid/src/audio_codec.c.

Referenced by audio_set_interface(), and class_event_handler().

◆ audio_codec_mic_get_data()

uint32_t audio_codec_mic_get_data ( uint8_t * buffer )

codec microphone get data

Parameters
data data buffer
Return values
data len

Definition at line 282 of file composite_audio_hid/src/audio_codec.c.

Referenced by audio_inisoincom_event(), audio_set_interface(), and class_in_handler().

◆ audio_codec_modify_freq()

void audio_codec_modify_freq ( uint32_t freq )

audio codec modify freq

Parameters
freq freq (wm8988 microphone and speaker must as same freq)
Return values
none

Definition at line 342 of file composite_audio_hid/src/audio_codec.c.

Referenced by audio_codec_set_mic_freq(), and audio_codec_set_spk_freq().

◆ audio_codec_set_mic_freq()

void audio_codec_set_mic_freq ( uint32_t freq )

audio codec set microphone freq

Parameters
freq freq (wm8988 microphone and speaker must same freq)
Return values
none

Definition at line 121 of file composite_audio_hid/src/audio_codec.c.

Referenced by class_ept0_rx_handler().

◆ audio_codec_set_mic_mute()

void audio_codec_set_mic_mute ( uint8_t mute )

audio codec set microphone mute

Parameters
mute mute state
Return values
none

Definition at line 184 of file composite_audio_hid/src/audio_codec.c.

Referenced by class_ept0_rx_handler().

◆ audio_codec_set_mic_volume()

void audio_codec_set_mic_volume ( uint16_t volume )

audio codec set microphone volume

Parameters
volume the new volume
Return values
none

Definition at line 206 of file composite_audio_hid/src/audio_codec.c.

Referenced by class_ept0_rx_handler().

◆ audio_codec_set_spk_freq()

void audio_codec_set_spk_freq ( uint32_t freq )

audio codec set speaker freq

Parameters
freq freq(wm8988 microphone and speaker must same freq)
Return values
none

Definition at line 137 of file composite_audio_hid/src/audio_codec.c.

Referenced by class_ept0_rx_handler().

◆ audio_codec_set_spk_mute()

void audio_codec_set_spk_mute ( uint8_t mute )

audio codec set speaker mute

Parameters
mute mute state
Return values
none

Definition at line 195 of file composite_audio_hid/src/audio_codec.c.

Referenced by class_ept0_rx_handler().

◆ audio_codec_set_spk_volume()

void audio_codec_set_spk_volume ( uint16_t volume )

audio codec set speaker volume

Parameters
volume the new volume
Return values
none

Definition at line 217 of file composite_audio_hid/src/audio_codec.c.

Referenced by class_ept0_rx_handler().

◆ audio_codec_spk_alt_setting()

void audio_codec_spk_alt_setting ( uint32_t alt_seting )

audio codec speaker alt setting config

Parameters
none
Return values
none

Definition at line 154 of file composite_audio_hid/src/audio_codec.c.

Referenced by audio_set_interface(), and class_event_handler().

◆ audio_codec_spk_feedback()

uint8_t audio_codec_spk_feedback ( uint8_t * feedback )

codec speaker feedback

Parameters
feedback data buffer
Return values
feedback len

Definition at line 228 of file composite_audio_hid/src/audio_codec.c.

Referenced by class_sof_handler().

◆ audio_codec_spk_fifo_write()

void audio_codec_spk_fifo_write | ( | uint8_t * | data,
 |  | uint32_t | len
 | ) |  |

codec speaker write fifo

audio codec interface

Parameters
data | data buffer
len | data length
Return values
none

Definition at line 244 of file composite_audio_hid/src/audio_codec.c.

Referenced by class_out_handler().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 76 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c.

◆ codec_i2s_init()

void codec_i2s_init ( audio_codec_type * param )

audio codec i2s init

Parameters
freq | audio sampling freq
bitw_format | bit width
Return values
error status

Definition at line 493 of file composite_audio_hid/src/audio_codec.c.

Referenced by audio_codec_init(), audio_codec_set_mic_freq(), and audio_codec_set_spk_freq().

◆ codec_i2s_reset()

void codec_i2s_reset ( void )

audio codec i2s reset

Parameters
none
Return values
none

Definition at line 479 of file composite_audio_hid/src/audio_codec.c.

Referenced by audio_codec_set_mic_freq(), and audio_codec_set_spk_freq().

◆ copy_buff()

void copy_buff | ( | uint16_t * | dest,
 |  | uint16_t * | src,
 |  | uint32_t | len
 | ) |  |

copy buffer

Parameters
dest | dest data buffer
src | src data buffer
len | data length
Return values
none

Definition at line 385 of file composite_audio_hid/src/audio_codec.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 111 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c.

◆ DMA1_Channel3_IRQHandler()

void DMA1_Channel3_IRQHandler ( void )

this function handles dma1 channel3 interrupt.

Parameters
none
Return values
none

Definition at line 651 of file composite_audio_hid/src/audio_codec.c.

◆ DMA1_Channel4_IRQHandler()

void DMA1_Channel4_IRQHandler ( void )

this function handles dma1 channel4 interrupt.

Parameters
none
Return values
none

Definition at line 726 of file composite_audio_hid/src/audio_codec.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 50 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c.

◆ i2c_lowlevel_init()

void i2c_lowlevel_init ( i2c_handle_type * hi2c )

initializes peripherals used by the i2c.

Parameters
none
Return values
none

< gpio pins number 6

< gpio pins number 7

< gpio pins number 6

< gpio pins number 7

< gpio pins number 6

< gpio pins number 7

< gpio pins number 6

< gpio pins number 7

< gpio pins number 6

< gpio pins number 7

Definition at line 399 of file composite_audio_hid/src/audio_codec.c.

Referenced by i2c_config().

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 56 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c.

◆ mclk_tmr1_init()

void mclk_tmr1_init ( void )

mclk clock conifg

Parameters
none
Return values
none

Definition at line 437 of file composite_audio_hid/src/audio_codec.c.

Referenced by audio_codec_init().

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 63 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c.

◆ memset16_buffer()

void memset16_buffer | ( | uint16_t * | buffer,
 |  | uint32_t | set,
 |  | uint32_t | len
 | ) |  |

buffer memset

Parameters
buffer | buffer
set | memset data
len | data length
Return values
none

Definition at line 369 of file composite_audio_hid/src/audio_codec.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 41 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 216 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 120 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 102 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 129 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 89 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 108 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb endpoint max num define

usb delay millisecond function.

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Parameters
ms number of millisecond delay
Return values
none

Definition at line 226 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 237 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 148 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

Variable Documentation

◆ audio_codec

audio_codec_type audio_codec

Definition at line 106 of file composite_audio_hid/src/audio_codec.c.

Referenced by audio_codec_init(), audio_codec_loop(), audio_codec_mic_get_data(), audio_codec_set_mic_freq(), audio_codec_set_mic_mute(), audio_codec_set_mic_volume(), audio_codec_set_spk_freq(), audio_codec_set_spk_mute(), audio_codec_set_spk_volume(), audio_codec_spk_feedback(), audio_codec_spk_fifo_write(), DMA1_Channel3_IRQHandler(), and DMA1_Channel4_IRQHandler().

◆ hi2cx

i2c_handle_type hi2cx

Definition at line 104 of file composite_audio_hid/src/audio_codec.c.

Referenced by audio_codec_init(), audio_codec_loop(), audio_codec_modify_freq(), DMA1_Channel6_IRQHandler(), DMA1_Channel7_IRQHandler(), I2C1_ERR_IRQHandler(), and I2C1_EVT_IRQHandler().

◆ mic_dma_buffer

uint16_t mic_dma_buffer[DMA_BUFFER_SIZE]

Definition at line 108 of file composite_audio_hid/src/audio_codec.c.

Referenced by codec_i2s_init(), and DMA1_Channel4_IRQHandler().

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 45 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c.

Referenced by main(), and OTG_IRQ_HANDLER().

◆ reg_addr_data

uint16_t reg_addr_data[]

wm8988 register default value

Definition at line 71 of file composite_audio_hid/src/audio_codec.c.

Referenced by audio_codec_init().

◆ report_buf

uint8_t report_buf[USBD_IN_MAXPACKET_SIZE]

Definition at line 49 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c.

Referenced by main().

◆ spk_dma_buffer

uint16_t spk_dma_buffer[DMA_BUFFER_SIZE]

Definition at line 107 of file composite_audio_hid/src/audio_codec.c.

Referenced by codec_i2s_init(), and DMA1_Channel3_IRQHandler().


AT32F415 Firmwary Library: USB_device_audio_hid_codec_reg_definition

Macros
USB_device_audio_hid_codec_reg_definition
AT32F415_periph_examples » USB_device_audio_hid

Macros

#define | WM8988_R0_LEFT_INPUT_VOLUME 0x00 /*Left channel PGA control*/
#define | WM8988_R1_RIGHT_INPUT_VOLUME 0x01 /*Right channel PGA control*/
#define | WM8988_R2_LOUT1_VOLUME 0x02
#define | WM8988_R3_ROUT1_VOLUME 0x03
#define | WM8988_R4_RESERVED 0x04
#define | WM8988_R5_ADC_DAC_CONTROL 0x05
#define | WM8988_R6_RESERVED 0x06
#define | WM8988_R7_AUDIO_INTERFACE 0x07
#define | WM8988_R8_SAMPLE_RATE 0x08
#define | WM8988_R9_RESERVED 0x09
#define | WM8988_R10_LEFT_DAC_VOLUME 0x0A
#define | WM8988_R11_RIGHT_DAC_VOLUME 0x0B
#define | WM8988_R12_BASS_CONTROL 0x0C
#define | WM8988_R13_TREBLE_CONTROL 0x0D
#define | WM8988_R14_
#define | WM8988_R15_RESET 0x0F
#define | WM8988_R16_3D_CONTROL 0x10
#define | WM8988_R17_ALC1 0x11
#define | WM8988_R18_ALC2 0x12
#define | WM8988_R19_ALC3 0x13
#define | WM8988_R20_NOISE_GATE 0x14
#define | WM8988_R21_LEFT_ADC_VOLUME 0x15
#define | WM8988_R22_RIGHT_ADC_VOLUME 0x16
#define | WM8988_R23_ADDITIONAL_1_CONTROL 0x17
#define | WM8988_R24_ADDITIONAL_2_CONTROL 0x18
#define | WM8988_R25_PWR_1_MGMT 0x19
#define | WM8988_R26_PWR_2_MGMT 0x1A
#define | WM8988_R27_ADDITIONAL_3_CONTROL 0x1B
#define | WM8988_R31_ADC_INPUT_MODE 0x1F
#define | WM8988_R32_ADC_L_SIGNAL_PATH 0x20
#define | WM8988_R33_ADC_R_SIGNAL_PATH 0x21
#define | WM8988_R34_LEFT_OUT_MIX_1 0x22
#define | WM8988_R35_LEFT_OUT_MIX_2 0x23
#define | WM8988_R36_RIGHT_OUT_MIX_1 0x24
#define | WM8988_R37_RIGHT_OUT_MIX_2 0x25
#define | WM8988_R38_RESERVED
#define | WM8988_R39_RESERVED
#define | WM8988_R40_LOUT2_VOLUME 0x28
#define | WM8988_R41_ROUT2_VOLUME 0x29
#define | WM8988_R42_RESERVED
#define | WM8988_R43_LOW_POWER_PALYBACK 0x43
#define | WM8988_I2C_ADDR_CSB_LOW 0x34
#define | WM8988_I2C_ADDR_CSB_HIGH 0x36

Detailed Description

Macro Definition Documentation

◆ WM8988_I2C_ADDR_CSB_HIGH

#define WM8988_I2C_ADDR_CSB_HIGH 0x36

Definition at line 94 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_I2C_ADDR_CSB_LOW

#define WM8988_I2C_ADDR_CSB_LOW 0x34

Definition at line 93 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R0_LEFT_INPUT_VOLUME

#define WM8988_R0_LEFT_INPUT_VOLUME 0x00 /*Left channel PGA control*/

Definition at line 50 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R10_LEFT_DAC_VOLUME

#define WM8988_R10_LEFT_DAC_VOLUME 0x0A

Definition at line 60 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R11_RIGHT_DAC_VOLUME

#define WM8988_R11_RIGHT_DAC_VOLUME 0x0B

Definition at line 61 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R12_BASS_CONTROL

#define WM8988_R12_BASS_CONTROL 0x0C

Definition at line 62 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R13_TREBLE_CONTROL

#define WM8988_R13_TREBLE_CONTROL 0x0D

Definition at line 63 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R14_

#define WM8988_R14_

Definition at line 64 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R15_RESET

#define WM8988_R15_RESET 0x0F

Definition at line 65 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R16_3D_CONTROL

#define WM8988_R16_3D_CONTROL 0x10

Definition at line 66 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R17_ALC1

#define WM8988_R17_ALC1 0x11

Definition at line 67 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R18_ALC2

#define WM8988_R18_ALC2 0x12

Definition at line 68 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R19_ALC3

#define WM8988_R19_ALC3 0x13

Definition at line 69 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R1_RIGHT_INPUT_VOLUME

#define WM8988_R1_RIGHT_INPUT_VOLUME 0x01 /*Right channel PGA control*/

Definition at line 51 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R20_NOISE_GATE

#define WM8988_R20_NOISE_GATE 0x14

Definition at line 70 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R21_LEFT_ADC_VOLUME

#define WM8988_R21_LEFT_ADC_VOLUME 0x15

Definition at line 71 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R22_RIGHT_ADC_VOLUME

#define WM8988_R22_RIGHT_ADC_VOLUME 0x16

Definition at line 72 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R23_ADDITIONAL_1_CONTROL

#define WM8988_R23_ADDITIONAL_1_CONTROL 0x17

Definition at line 73 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R24_ADDITIONAL_2_CONTROL

#define WM8988_R24_ADDITIONAL_2_CONTROL 0x18

Definition at line 74 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R25_PWR_1_MGMT

#define WM8988_R25_PWR_1_MGMT 0x19

Definition at line 75 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R26_PWR_2_MGMT

#define WM8988_R26_PWR_2_MGMT 0x1A

Definition at line 76 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R27_ADDITIONAL_3_CONTROL

#define WM8988_R27_ADDITIONAL_3_CONTROL 0x1B

Definition at line 77 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R2_LOUT1_VOLUME

#define WM8988_R2_LOUT1_VOLUME 0x02

Definition at line 52 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R31_ADC_INPUT_MODE

#define WM8988_R31_ADC_INPUT_MODE 0x1F

Definition at line 79 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R32_ADC_L_SIGNAL_PATH

#define WM8988_R32_ADC_L_SIGNAL_PATH 0x20

Definition at line 80 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R33_ADC_R_SIGNAL_PATH

#define WM8988_R33_ADC_R_SIGNAL_PATH 0x21

Definition at line 81 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R34_LEFT_OUT_MIX_1

#define WM8988_R34_LEFT_OUT_MIX_1 0x22

Definition at line 82 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R35_LEFT_OUT_MIX_2

#define WM8988_R35_LEFT_OUT_MIX_2 0x23

Definition at line 83 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R36_RIGHT_OUT_MIX_1

#define WM8988_R36_RIGHT_OUT_MIX_1 0x24

Definition at line 84 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R37_RIGHT_OUT_MIX_2

#define WM8988_R37_RIGHT_OUT_MIX_2 0x25

Definition at line 85 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R38_RESERVED

#define WM8988_R38_RESERVED

Definition at line 86 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R39_RESERVED

#define WM8988_R39_RESERVED

Definition at line 87 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R3_ROUT1_VOLUME

#define WM8988_R3_ROUT1_VOLUME 0x03

Definition at line 53 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R40_LOUT2_VOLUME

#define WM8988_R40_LOUT2_VOLUME 0x28

Definition at line 88 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R41_ROUT2_VOLUME

#define WM8988_R41_ROUT2_VOLUME 0x29

Definition at line 89 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R42_RESERVED

#define WM8988_R42_RESERVED

Definition at line 90 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R43_LOW_POWER_PALYBACK

#define WM8988_R43_LOW_POWER_PALYBACK 0x43

Definition at line 91 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R4_RESERVED

#define WM8988_R4_RESERVED 0x04

Definition at line 54 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R5_ADC_DAC_CONTROL

#define WM8988_R5_ADC_DAC_CONTROL 0x05

Definition at line 55 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R6_RESERVED

#define WM8988_R6_RESERVED 0x06

Definition at line 56 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R7_AUDIO_INTERFACE

#define WM8988_R7_AUDIO_INTERFACE 0x07

Definition at line 57 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R8_SAMPLE_RATE

#define WM8988_R8_SAMPLE_RATE 0x08

Definition at line 58 of file composite_audio_hid/inc/audio_codec.h.

◆ WM8988_R9_RESERVED

#define WM8988_R9_RESERVED 0x09

Definition at line 59 of file composite_audio_hid/inc/audio_codec.h.


AT32F415 Firmwary Library: USB_device_audio_hid_codec_pin_definition

Macros
USB_device_audio_hid_codec_pin_definition
AT32F415_periph_examples » USB_device_audio_hid

Macros

#define | I2S1_WS_PIN GPIO_PINS_4
#define | I2S1_CK_PIN GPIO_PINS_5
#define | I2S1_SD_PIN GPIO_PINS_7
#define | I2S1_GPIO GPIOA
#define | I2S1_GPIO_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
#define | I2S1_DT_ADDRESS (&(SPI1->dt))
#define | I2S2_WS_PIN GPIO_PINS_12
#define | I2S2_CK_PIN GPIO_PINS_13
#define | I2S2_SD_PIN GPIO_PINS_15
#define | I2S2_GPIO GPIOB
#define | I2S2_GPIO_CRM_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2S2_DT_ADDRESS (&(SPI2->dt))
#define | SPK_TX_FIFO_SIZE (1024 * 4)

Detailed Description

Macro Definition Documentation

◆ I2S1_CK_PIN

#define I2S1_CK_PIN GPIO_PINS_5

Definition at line 104 of file composite_audio_hid/inc/audio_codec.h.

◆ I2S1_DT_ADDRESS

#define I2S1_DT_ADDRESS (&(SPI1->dt))

Definition at line 109 of file composite_audio_hid/inc/audio_codec.h.

◆ I2S1_GPIO

#define I2S1_GPIO GPIOA

Definition at line 107 of file composite_audio_hid/inc/audio_codec.h.

◆ I2S1_GPIO_CRM_CLK

#define I2S1_GPIO_CRM_CLK CRM_GPIOA_PERIPH_CLOCK

Definition at line 108 of file composite_audio_hid/inc/audio_codec.h.

◆ I2S1_SD_PIN

#define I2S1_SD_PIN GPIO_PINS_7

Definition at line 105 of file composite_audio_hid/inc/audio_codec.h.

◆ I2S1_WS_PIN

#define I2S1_WS_PIN GPIO_PINS_4

Definition at line 103 of file composite_audio_hid/inc/audio_codec.h.

◆ I2S2_CK_PIN

#define I2S2_CK_PIN GPIO_PINS_13

Definition at line 113 of file composite_audio_hid/inc/audio_codec.h.

◆ I2S2_DT_ADDRESS

#define I2S2_DT_ADDRESS (&(SPI2->dt))

Definition at line 119 of file composite_audio_hid/inc/audio_codec.h.

◆ I2S2_GPIO

#define I2S2_GPIO GPIOB

Definition at line 117 of file composite_audio_hid/inc/audio_codec.h.

◆ I2S2_GPIO_CRM_CLK

#define I2S2_GPIO_CRM_CLK CRM_GPIOB_PERIPH_CLOCK

Definition at line 118 of file composite_audio_hid/inc/audio_codec.h.

◆ I2S2_SD_PIN

#define I2S2_SD_PIN GPIO_PINS_15

Definition at line 114 of file composite_audio_hid/inc/audio_codec.h.

◆ I2S2_WS_PIN

#define I2S2_WS_PIN GPIO_PINS_12

Definition at line 112 of file composite_audio_hid/inc/audio_codec.h.

◆ SPK_TX_FIFO_SIZE

#define SPK_TX_FIFO_SIZE (1024 * 4)

Definition at line 121 of file composite_audio_hid/inc/audio_codec.h.


AT32F415 Firmwary Library: USB_device_audio_hid_codec_exported_functions

Data Structures | Macros | Functions
USB_device_audio_hid_codec_exported_functions
AT32F415_periph_examples » USB_device_audio_hid

Data Structures

struct audio_codec_type

Macros

#define | MIC_BUFFER_SIZE 1024
#define | SPK_BUFFER_SIZE 4096
#define | DMA_BUFFER_SIZE 288

Functions

error_status | audio_codec_init (void)
audio codec init More...
error_status | audio_codec_loop (void)
audio codec loop More...
void | audio_codec_modify_freq (uint32_t freq)
audio codec modify freq More...
void | audio_codec_spk_fifo_write (uint8_t *data, uint32_t len)
audio codec interface More...
uint32_t | audio_codec_mic_get_data (uint8_t *buffer)
codec microphone get data More...
uint8_t | audio_codec_spk_feedback (uint8_t *feedback)
codec speaker feedback More...
void | audio_codec_spk_alt_setting (uint32_t alt_seting)
audio codec speaker alt setting config More...
void | audio_codec_mic_alt_setting (uint32_t alt_seting)
audio codec microphone alt setting config More...
void | audio_codec_set_mic_mute (uint8_t mute)
audio codec set microphone mute More...
void | audio_codec_set_spk_mute (uint8_t mute)
audio codec set speaker mute More...
void | audio_codec_set_mic_volume (uint16_t volume)
audio codec set microphone volume More...
void | audio_codec_set_spk_volume (uint16_t volume)
audio codec set speaker volume More...
void | audio_codec_set_mic_freq (uint32_t freq)
audio codec set microphone freq More...
void | audio_codec_set_spk_freq (uint32_t freq)
audio codec set speaker freq More...

Detailed Description

Macro Definition Documentation

◆ DMA_BUFFER_SIZE

#define DMA_BUFFER_SIZE 288

Definition at line 132 of file composite_audio_hid/inc/audio_codec.h.

◆ MIC_BUFFER_SIZE

#define MIC_BUFFER_SIZE 1024

Definition at line 130 of file composite_audio_hid/inc/audio_codec.h.

◆ SPK_BUFFER_SIZE

#define SPK_BUFFER_SIZE 4096

Definition at line 131 of file composite_audio_hid/inc/audio_codec.h.

Function Documentation

◆ audio_codec_init()

error_status audio_codec_init ( void )

audio codec init

Parameters
none
Return values
error status

Definition at line 796 of file audio/src/audio_codec.c.

◆ audio_codec_loop()

error_status audio_codec_loop ( void )

audio codec loop

Parameters
none
Return values
none

Definition at line 855 of file audio/src/audio_codec.c.

◆ audio_codec_mic_alt_setting()

void audio_codec_mic_alt_setting ( uint32_t alt_seting )

audio codec microphone alt setting config

Parameters
none
Return values
none

Definition at line 169 of file audio/src/audio_codec.c.

◆ audio_codec_mic_get_data()

uint32_t audio_codec_mic_get_data ( uint8_t * buffer )

codec microphone get data

Parameters
data data buffer
Return values
data len

Definition at line 282 of file audio/src/audio_codec.c.

◆ audio_codec_modify_freq()

void audio_codec_modify_freq ( uint32_t freq )

audio codec modify freq

Parameters
freq freq (wm8988 microphone and speaker must as same freq)
Return values
none

Definition at line 342 of file audio/src/audio_codec.c.

Referenced by audio_codec_set_mic_freq(), and audio_codec_set_spk_freq().

◆ audio_codec_set_mic_freq()

void audio_codec_set_mic_freq ( uint32_t freq )

audio codec set microphone freq

Parameters
freq freq (wm8988 microphone and speaker must same freq)
Return values
none

Definition at line 121 of file audio/src/audio_codec.c.

◆ audio_codec_set_mic_mute()

void audio_codec_set_mic_mute ( uint8_t mute )

audio codec set microphone mute

Parameters
mute mute state
Return values
none

Definition at line 184 of file audio/src/audio_codec.c.

◆ audio_codec_set_mic_volume()

void audio_codec_set_mic_volume ( uint16_t volume )

audio codec set microphone volume

Parameters
volume the new volume
Return values
none

Definition at line 206 of file audio/src/audio_codec.c.

◆ audio_codec_set_spk_freq()

void audio_codec_set_spk_freq ( uint32_t freq )

audio codec set speaker freq

Parameters
freq freq(wm8988 microphone and speaker must same freq)
Return values
none

Definition at line 137 of file audio/src/audio_codec.c.

◆ audio_codec_set_spk_mute()

void audio_codec_set_spk_mute ( uint8_t mute )

audio codec set speaker mute

Parameters
mute mute state
Return values
none

Definition at line 195 of file audio/src/audio_codec.c.

◆ audio_codec_set_spk_volume()

void audio_codec_set_spk_volume ( uint16_t volume )

audio codec set speaker volume

Parameters
volume the new volume
Return values
none

Definition at line 217 of file audio/src/audio_codec.c.

◆ audio_codec_spk_alt_setting()

void audio_codec_spk_alt_setting ( uint32_t alt_seting )

audio codec speaker alt setting config

Parameters
none
Return values
none

Definition at line 154 of file audio/src/audio_codec.c.

◆ audio_codec_spk_feedback()

uint8_t audio_codec_spk_feedback ( uint8_t * feedback )

codec speaker feedback

Parameters
feedback data buffer
Return values
feedback len

Definition at line 228 of file audio/src/audio_codec.c.

◆ audio_codec_spk_fifo_write()

void audio_codec_spk_fifo_write | ( | uint8_t * | data,
 |  | uint32_t | len
 | ) |  |

audio codec interface

audio codec interface

Parameters
data | data buffer
len | data length
Return values
none

Definition at line 244 of file audio/src/audio_codec.c.


AT32F415 Firmwary Library: USB_device_composite_vcp_keyboard

Macros | Functions | Variables
USB_device_composite_vcp_keyboard
AT32F415_periph_examples

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20
#define | USB_LOW_POWER_WAKUP
usb endpoint max num define More...

Functions

void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
void | EXINT0_IRQHandler (void)
exint0 interrupt handler More...
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...

Variables

otg_core_type otg_core_struct
__IO uint8_t | keyboard_send_flag
uint8_t | usb_buffer [256]

Detailed Description

Macro Definition Documentation

◆ OTG_CLOCK

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 60 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ OTG_IRQ

#define OTG_IRQ OTGFS1_IRQn

Definition at line 61 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 62 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ OTG_PIN_GPIO

#define OTG_PIN_GPIO GPIOA

Definition at line 67 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 68 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ OTG_PIN_ID

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 70 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ OTG_PIN_SOF

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 74 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 72 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 73 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ OTG_PIN_VBUS

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 69 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 65 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 64 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ OTG_WKUP_IRQ

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 63 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ USB_ID

#define USB_ID 0

enable usb host mode

Definition at line 59 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ USB_LOW_POWER_WAKUP

#define USB_LOW_POWER_WAKUP

usb endpoint max num define

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Definition at line 137 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ USBD_EP0_TX_SIZE

#define USBD_EP0_TX_SIZE 24

Definition at line 87 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ USBD_EP1_TX_SIZE

#define USBD_EP1_TX_SIZE 20

Definition at line 88 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ USBD_EP2_TX_SIZE

#define USBD_EP2_TX_SIZE 20

Definition at line 89 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ USBD_EP3_TX_SIZE

#define USBD_EP3_TX_SIZE 20

Definition at line 90 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ USBD_RX_SIZE

#define USBD_RX_SIZE 128

usb device mode config

usb device mode fifo

Definition at line 86 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

◆ USE_OTG_DEVICE_MODE

#define USE_OTG_DEVICE_MODE

enable usb device mode

Definition at line 52 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c.

◆ EXINT0_IRQHandler()

void EXINT0_IRQHandler ( void )

exint0 interrupt handler

Parameters
none
Return values
none

Definition at line 101 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 146 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 334 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 226 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb delay millisecond function.

usb endpoint max num define

Parameters
ms number of millisecond delay
Return values
none

Definition at line 344 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 355 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 268 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

Variable Documentation

◆ keyboard_send_flag

__IO uint8_t keyboard_send_flag

Definition at line 46 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

Referenced by button_isr(), and main().

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 45 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

Referenced by keyboard_send_string(), main(), and OTG_IRQ_HANDLER().

◆ usb_buffer

uint8_t usb_buffer[256]

Definition at line 47 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: USB_device_custom_hid

Macros | Functions | Variables
USB_device_custom_hid
AT32F415_periph_examples

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...

Variables

otg_core_type otg_core_struct
uint8_t report_buf [USBD_IN_MAXPACKET_SIZE]

Detailed Description

Macro Definition Documentation

◆ OTG_CLOCK

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 59 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ OTG_IRQ

#define OTG_IRQ OTGFS1_IRQn

Definition at line 60 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 61 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ OTG_PIN_GPIO

#define OTG_PIN_GPIO GPIOA

Definition at line 66 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 67 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ OTG_PIN_ID

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 69 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ OTG_PIN_SOF

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 73 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 71 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 72 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ OTG_PIN_VBUS

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 68 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 64 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 63 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ OTG_WKUP_IRQ

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 62 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ USB_ID

#define USB_ID 0

enable usb host mode

Definition at line 58 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ USBD_EP0_TX_SIZE

#define USBD_EP0_TX_SIZE 24

Definition at line 84 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ USBD_EP1_TX_SIZE

#define USBD_EP1_TX_SIZE 20

Definition at line 85 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ USBD_EP2_TX_SIZE

#define USBD_EP2_TX_SIZE 20

Definition at line 86 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ USBD_EP3_TX_SIZE

#define USBD_EP3_TX_SIZE 20

Definition at line 87 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ USBD_RX_SIZE

#define USBD_RX_SIZE 128

usb device mode config

usb device mode fifo

Definition at line 83 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

◆ USE_OTG_DEVICE_MODE

#define USE_OTG_DEVICE_MODE

enable usb device mode

Definition at line 51 of file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/usb_device/custom_hid/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 208 of file project/at_start_f415/examples/usb_device/custom_hid/src/main.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 102 of file project/at_start_f415/examples/usb_device/custom_hid/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb endpoint max num define

usb delay millisecond function.

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Parameters
ms number of millisecond delay
Return values
none

Definition at line 218 of file project/at_start_f415/examples/usb_device/custom_hid/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 229 of file project/at_start_f415/examples/usb_device/custom_hid/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 142 of file project/at_start_f415/examples/usb_device/custom_hid/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

Variable Documentation

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 44 of file project/at_start_f415/examples/usb_device/custom_hid/src/main.c.

Referenced by main(), and OTG_IRQ_HANDLER().

◆ report_buf

uint8_t report_buf[USBD_IN_MAXPACKET_SIZE]

Definition at line 45 of file project/at_start_f415/examples/usb_device/custom_hid/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: USB_device_keyboard

Macros | Functions | Variables
USB_device_keyboard
AT32F415_periph_examples

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20
#define | USB_LOW_POWER_WAKUP
usb endpoint max num define More...

Functions

void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | keyboard_send_string (uint8_t *string, uint8_t len)
keyboard send string More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
void | system_clock_recover (void)
systemclock recover. More...
void | button_exint_init (void)
configure button exint More...
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...

Variables

otg_core_type otg_core_struct
__IO uint8_t hid_suspend_flag

Detailed Description

Macro Definition Documentation

◆ OTG_CLOCK

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 60 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ OTG_IRQ

#define OTG_IRQ OTGFS1_IRQn

Definition at line 61 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 62 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ OTG_PIN_GPIO

#define OTG_PIN_GPIO GPIOA

Definition at line 67 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 68 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ OTG_PIN_ID

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 70 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ OTG_PIN_SOF

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 74 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 72 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 73 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ OTG_PIN_VBUS

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 69 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 65 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 64 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ OTG_WKUP_IRQ

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 63 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ USB_ID

#define USB_ID 0

enable usb host mode

Definition at line 59 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ USB_LOW_POWER_WAKUP

#define USB_LOW_POWER_WAKUP

usb endpoint max num define

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Definition at line 135 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ USBD_EP0_TX_SIZE

#define USBD_EP0_TX_SIZE 24

Definition at line 85 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ USBD_EP1_TX_SIZE

#define USBD_EP1_TX_SIZE 20

Definition at line 86 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ USBD_EP2_TX_SIZE

#define USBD_EP2_TX_SIZE 20

Definition at line 87 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ USBD_EP3_TX_SIZE

#define USBD_EP3_TX_SIZE 20

Definition at line 88 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ USBD_RX_SIZE

#define USBD_RX_SIZE 128

usb device mode config

usb device mode fifo

Definition at line 84 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

◆ USE_OTG_DEVICE_MODE

#define USE_OTG_DEVICE_MODE

enable usb device mode

Definition at line 52 of file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c.

◆ button_exint_init()

void button_exint_init ( void )

configure button exint

Parameters
none
Return values
none

< external interrupt line 0

< external interrupt line 0

< external interrupt line 0

Definition at line 62 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c.

◆ keyboard_send_string()

void keyboard_send_string | ( | uint8_t * | string,
 |  | uint8_t | len
 | ) |  |

keyboard send string

Parameters
string | send string
len | send string length
Return values
none

Definition at line 60 of file project/at_start_f415/examples/usb_device/keyboard/src/main.c.

Referenced by main().

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 94 of file project/at_start_f415/examples/usb_device/keyboard/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 348 of file project/at_start_f415/examples/usb_device/keyboard/src/main.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c.

◆ system_clock_recover()

void system_clock_recover ( void )

systemclock recover.

Parameters
none
Return values
none

< phase locking loop stable flag

< phase locking loop stable flag

Definition at line 140 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c.

Referenced by main().

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 180 of file project/at_start_f415/examples/usb_device/keyboard/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb delay millisecond function.

usb endpoint max num define

Parameters
ms number of millisecond delay
Return values
none

Definition at line 358 of file project/at_start_f415/examples/usb_device/keyboard/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 369 of file project/at_start_f415/examples/usb_device/keyboard/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 220 of file project/at_start_f415/examples/usb_device/keyboard/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

Variable Documentation

◆ hid_suspend_flag

__IO uint8_t hid_suspend_flag
extern

Definition at line 59 of file keyboard_class.c.

Referenced by main().

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 45 of file project/at_start_f415/examples/usb_device/keyboard/src/main.c.

Referenced by keyboard_send_string(), main(), and OTG_IRQ_HANDLER().


AT32F415 Firmwary Library: USB_device_mouse

Macros | Functions | Variables
USB_device_mouse
AT32F415_periph_examples

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_DP GPIO_PINS_12
#define | OTG_PIN_DM GPIO_PINS_11
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20
#define | USB_LOW_POWER_WAKUP
usb endpoint max num define More...

Functions

void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | keyboard_send_string (uint8_t *string, uint8_t len)
keyboard send string More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
void | system_clock_recover (void)
systemclock recover. More...
void | button_exint_init (void)
configure button exint More...
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...

Variables

otg_core_type otg_core_struct
__IO uint8_t | press_mouse = 0
__IO uint8_t | hid_suspend_flag

Detailed Description

Macro Definition Documentation

◆ OTG_CLOCK

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 63 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_IRQ

#define OTG_IRQ OTGFS1_IRQn

Definition at line 64 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 65 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_PIN_DM

#define OTG_PIN_DM GPIO_PINS_11

Definition at line 74 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_PIN_DP

#define OTG_PIN_DP GPIO_PINS_12

Definition at line 73 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_PIN_GPIO

#define OTG_PIN_GPIO GPIOA

Definition at line 70 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 71 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_PIN_ID

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 76 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_PIN_SOF

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 80 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 78 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 79 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_PIN_VBUS

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 75 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 68 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 67 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ OTG_WKUP_IRQ

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 66 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ USB_ID

#define USB_ID 0

enable usb host mode

select otgfs1 or otgfs2 define

Definition at line 62 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ USB_LOW_POWER_WAKUP

#define USB_LOW_POWER_WAKUP

usb endpoint max num define

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Definition at line 142 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ USBD_EP0_TX_SIZE

#define USBD_EP0_TX_SIZE 24

Definition at line 92 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ USBD_EP1_TX_SIZE

#define USBD_EP1_TX_SIZE 20

Definition at line 93 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ USBD_EP2_TX_SIZE

#define USBD_EP2_TX_SIZE 20

Definition at line 94 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ USBD_EP3_TX_SIZE

#define USBD_EP3_TX_SIZE 20

Definition at line 95 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ USBD_RX_SIZE

#define USBD_RX_SIZE 128

usb device mode config

usb device mode fifo

Definition at line 91 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

◆ USE_OTG_DEVICE_MODE

#define USE_OTG_DEVICE_MODE

enable usb device mode

Definition at line 52 of file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c.

◆ button_exint_init()

void button_exint_init ( void )

configure button exint

Parameters
none
Return values
none

< external interrupt line 0

< external interrupt line 0

< external interrupt line 0

Definition at line 62 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c.

◆ keyboard_send_string()

void keyboard_send_string | ( | uint8_t * | string,
 |  | uint8_t | len
 | ) |  |

keyboard send string

Parameters
string | send string
len | send string length
Return values
none

Definition at line 112 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

Referenced by main().

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 59 of file project/at_start_f415/examples/usb_device/mouse/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 319 of file project/at_start_f415/examples/usb_device/mouse/src/main.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c.

◆ system_clock_recover()

void system_clock_recover ( void )

systemclock recover.

Parameters
none
Return values
none

< phase locking loop stable flag

< phase locking loop stable flag

Definition at line 140 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c.

Referenced by main().

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 152 of file project/at_start_f415/examples/usb_device/mouse/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb delay millisecond function.

usb endpoint max num define

Parameters
ms number of millisecond delay
Return values
none

Definition at line 329 of file project/at_start_f415/examples/usb_device/mouse/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 340 of file project/at_start_f415/examples/usb_device/mouse/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 192 of file project/at_start_f415/examples/usb_device/mouse/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

Variable Documentation

◆ hid_suspend_flag

__IO uint8_t hid_suspend_flag
extern

Definition at line 59 of file keyboard_class.c.

Referenced by class_event_handler(), and main().

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 44 of file project/at_start_f415/examples/usb_device/mouse/src/main.c.

Referenced by main(), and OTG_IRQ_HANDLER().

◆ press_mouse

__IO uint8_t press_mouse = 0

Definition at line 45 of file project/at_start_f415/examples/usb_device/mouse/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: USB_device_msc

Macros | Functions | Variables
USB_device_msc
AT32F415_periph_examples

Macros

#define | INTERNAL_FLASH_LUN 0
#define | SPI_FLASH_LUN 1
#define | SD_LUN 2
#define | USB_FLASH_ADDR_OFFSET 0x08005000
#define | SECTOR_SIZE_1K 1024
#define | SECTOR_SIZE_2K 2048
#define | SECTOR_SIZE_4K 4096
#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...

Variables

otg_core_type otg_core_struct
uint32_t | sector_size = 2048
uint32_t | msc_flash_size
uint8_t | scsi_inquiry [MSC_SUPPORT_MAX_LUN][SCSI_INQUIRY_DATA_LENGTH]

Detailed Description

Macro Definition Documentation

◆ INTERNAL_FLASH_LUN

#define INTERNAL_FLASH_LUN 0

Definition at line 45 of file msc/inc/msc_diskio.h.

◆ OTG_CLOCK

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 60 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ OTG_IRQ

#define OTG_IRQ OTGFS1_IRQn

Definition at line 61 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 62 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ OTG_PIN_GPIO

#define OTG_PIN_GPIO GPIOA

Definition at line 67 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 68 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ OTG_PIN_ID

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 70 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ OTG_PIN_SOF

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 74 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 72 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 73 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ OTG_PIN_VBUS

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 69 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 65 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 64 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ OTG_WKUP_IRQ

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 63 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ SD_LUN

#define SD_LUN 2

Definition at line 47 of file msc/inc/msc_diskio.h.

◆ SECTOR_SIZE_1K

#define SECTOR_SIZE_1K 1024

Definition at line 51 of file msc/inc/msc_diskio.h.

◆ SECTOR_SIZE_2K

#define SECTOR_SIZE_2K 2048

Definition at line 52 of file msc/inc/msc_diskio.h.

◆ SECTOR_SIZE_4K

#define SECTOR_SIZE_4K 4096

Definition at line 53 of file msc/inc/msc_diskio.h.

◆ SPI_FLASH_LUN

#define SPI_FLASH_LUN 1

Definition at line 46 of file msc/inc/msc_diskio.h.

◆ USB_FLASH_ADDR_OFFSET

#define USB_FLASH_ADDR_OFFSET 0x08005000

Definition at line 49 of file msc/inc/msc_diskio.h.

◆ USB_ID

#define USB_ID 0

enable usb host mode

Definition at line 59 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ USBD_EP0_TX_SIZE

#define USBD_EP0_TX_SIZE 24

Definition at line 85 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ USBD_EP1_TX_SIZE

#define USBD_EP1_TX_SIZE 20

Definition at line 86 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ USBD_EP2_TX_SIZE

#define USBD_EP2_TX_SIZE 20

Definition at line 87 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ USBD_EP3_TX_SIZE

#define USBD_EP3_TX_SIZE 20

Definition at line 88 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ USBD_RX_SIZE

#define USBD_RX_SIZE 128

usb device mode config

usb device mode fifo

Definition at line 84 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

◆ USE_OTG_DEVICE_MODE

#define USE_OTG_DEVICE_MODE

enable usb device mode

Definition at line 52 of file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 56 of file project/at_start_f415/examples/usb_device/msc/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 204 of file project/at_start_f415/examples/usb_device/msc/src/main.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 98 of file project/at_start_f415/examples/usb_device/msc/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb endpoint max num define

usb delay millisecond function.

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Parameters
ms number of millisecond delay
Return values
none

Definition at line 214 of file project/at_start_f415/examples/usb_device/msc/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 225 of file project/at_start_f415/examples/usb_device/msc/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 138 of file project/at_start_f415/examples/usb_device/msc/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

Variable Documentation

◆ msc_flash_size

uint32_t msc_flash_size

Definition at line 37 of file msc/src/msc_diskio.c.

Referenced by msc_disk_capacity().

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 46 of file project/at_start_f415/examples/usb_device/msc/src/main.c.

Referenced by main(), and OTG_IRQ_HANDLER().

◆ scsi_inquiry

uint8_t scsi_inquiry[MSC_SUPPORT_MAX_LUN][SCSI_INQUIRY_DATA_LENGTH]
Initial value:
=
{
{
0x00,
0x80,
0x00,
0x01,
SCSI_INQUIRY_DATA_LENGTH - 5,
0x00, 0x00, 0x00,
'A', 'T', '3', '2', ' ', ' ', ' ', ' ',
'D', 'i', 's', 'k', '0', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
'2', '.', '0', '0'
}
}
SCSI_INQUIRY_DATA_LENGTH
#define SCSI_INQUIRY_DATA_LENGTH
Definition: msc_bot_scsi.h:123

Definition at line 38 of file msc/src/msc_diskio.c.

Referenced by get_inquiry().

◆ sector_size

uint32_t sector_size = 2048

Definition at line 36 of file msc/src/msc_diskio.c.

Referenced by msc_disk_capacity(), and msc_disk_write().


AT32F415 Firmwary Library: USB_device_printer

Macros | Functions | Variables
USB_device_printer
AT32F415_periph_examples

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...

Variables

otg_core_type otg_core_struct

Detailed Description

Macro Definition Documentation

◆ OTG_CLOCK

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 59 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ OTG_IRQ

#define OTG_IRQ OTGFS1_IRQn

Definition at line 60 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 61 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ OTG_PIN_GPIO

#define OTG_PIN_GPIO GPIOA

Definition at line 66 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 67 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ OTG_PIN_ID

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 69 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ OTG_PIN_SOF

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 74 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 72 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 73 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ OTG_PIN_VBUS

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 68 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 64 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 63 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ OTG_WKUP_IRQ

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 62 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ USB_ID

#define USB_ID 0

enable usb host mode

Definition at line 58 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ USBD_EP0_TX_SIZE

#define USBD_EP0_TX_SIZE 24

Definition at line 86 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ USBD_EP1_TX_SIZE

#define USBD_EP1_TX_SIZE 20

Definition at line 87 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ USBD_EP2_TX_SIZE

#define USBD_EP2_TX_SIZE 20

Definition at line 88 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ USBD_EP3_TX_SIZE

#define USBD_EP3_TX_SIZE 20

Definition at line 89 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ USBD_RX_SIZE

#define USBD_RX_SIZE 128

usb device mode config

usb device mode fifo

Definition at line 85 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

◆ USE_OTG_DEVICE_MODE

#define USE_OTG_DEVICE_MODE

enable usb device mode

Definition at line 51 of file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/usb_device/printer/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 207 of file project/at_start_f415/examples/usb_device/printer/src/main.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 100 of file project/at_start_f415/examples/usb_device/printer/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb endpoint max num define

usb delay millisecond function.

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Parameters
ms number of millisecond delay
Return values
none

Definition at line 217 of file project/at_start_f415/examples/usb_device/printer/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 228 of file project/at_start_f415/examples/usb_device/printer/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 140 of file project/at_start_f415/examples/usb_device/printer/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

Variable Documentation

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 45 of file project/at_start_f415/examples/usb_device/printer/src/main.c.

Referenced by main(), and OTG_IRQ_HANDLER().


AT32F415 Firmwary Library: USB_device_vcp_loopback

Macros | Functions | Variables
USB_device_vcp_loopback
AT32F415_periph_examples

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...
void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...

Variables

otg_core_type otg_core_struct
uint8_t usb_buffer [256]

Detailed Description

Macro Definition Documentation

◆ OTG_CLOCK

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 58 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ OTG_IRQ

#define OTG_IRQ OTGFS1_IRQn

Definition at line 59 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 60 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ OTG_PIN_GPIO

#define OTG_PIN_GPIO GPIOA

Definition at line 66 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 67 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ OTG_PIN_ID

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 69 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ OTG_PIN_SOF

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 73 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 71 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 72 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ OTG_PIN_VBUS

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 68 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 64 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 63 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ OTG_WKUP_IRQ

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 61 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ USB_ID

#define USB_ID 0

enable usb host mode

Definition at line 57 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ USBD_EP0_TX_SIZE

#define USBD_EP0_TX_SIZE 24

Definition at line 84 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ USBD_EP1_TX_SIZE

#define USBD_EP1_TX_SIZE 20

Definition at line 85 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ USBD_EP2_TX_SIZE

#define USBD_EP2_TX_SIZE 20

Definition at line 86 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ USBD_EP3_TX_SIZE

#define USBD_EP3_TX_SIZE 20

Definition at line 87 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ USBD_RX_SIZE

#define USBD_RX_SIZE 128

usb device mode config

usb device mode fifo

Definition at line 83 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

◆ USE_OTG_DEVICE_MODE

#define USE_OTG_DEVICE_MODE

enable usb device mode

Definition at line 50 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.

Function Documentation

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 232 of file project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 127 of file project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb endpoint max num define

usb delay millisecond function.

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Parameters
ms number of millisecond delay
Return values
none

Definition at line 242 of file project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 253 of file project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 166 of file project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

Variable Documentation

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 44 of file project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c.

Referenced by main(), and OTG_IRQ_HANDLER().

◆ usb_buffer

uint8_t usb_buffer[256]

Definition at line 45 of file project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: USB_device_virtual_msc_iap

Modules | Macros | Functions | Variables
USB_device_virtual_msc_iap
AT32F415_periph_examples

Modules

USB_device_virtual_msc_iap_definition

Macros

#define | INTERNAL_FLASH_LUN 0
#define | SPI_FLASH_LUN 1
#define | SD_LUN 2
#define | USB_FLASH_ADDR_OFFSET 0x08004000
#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20
#define | FAT16_SECTOR_SIZE 62

Functions

uint8_t * | get_inquiry (uint8_t lun)
get disk inquiry More...
usb_sts_type | msc_disk_read (uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len)
disk read More...
usb_sts_type | msc_disk_write (uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len)
disk write More...
usb_sts_type | msc_disk_capacity (uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size)
disk capacity More...
void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
uint32_t | flash_fat16_boot_dir_write (uint32_t fat_lbk, uint8_t *data, uint32_t len)
boot dir write More...
uint32_t | flash_fat16_sector_write (uint32_t fat_lbk, uint8_t *data, uint32_t len)
write sector More...
uint32_t | fat16_memory_copy (uint8_t *dst, const uint8_t *src, uint32_t len)
memory copy function More...
uint32_t | fat16_memory_memset (uint8_t *dst, uint32_t set, uint32_t len)
memset function More...
uint32_t | flash_write_data (uint32_t address, uint8_t *data, uint32_t len)
write data to flash More...
uint32_t | flash_read_data (uint32_t address, uint8_t *data, uint32_t len)
read data from flash More...
uint32_t | fat16_memory_cmp (uint8_t *dst, uint8_t *src, uint32_t len)
memory compare function More...
uint32_t | flash_crc_check (uint32_t address, uint8_t *data, uint32_t len)
crc check More...
void | flash_fat16_clear_upgrade_flag (void)
clear iap upgrade flag More...
void | flash_fat16_set_upgrade_flag (void)
set iap upgrade complete flag More...
uint8_t | flash_fat16_get_upgrade_flag (void)
get iap upgrade complete flag More...
uint32_t | flash_fat16_read (uint32_t fat_lbk, uint8_t *data, uint32_t len)
read a logical block address More...
uint32_t | flash_fat16_write (uint32_t fat_lbk, uint8_t *data, uint32_t len)
write a logical block address More...
uint32_t | flash_fat16_set_name (const uint8_t *file_name, uint8_t len)
set file name More...
uint32_t | flash_fat16_addr_offset (uint8_t *file_name)
get offset address More...
void | flash_fat16_init (void)
flash fat16 iap init More...
void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
void | button_exint_init (button_type button)
void | button_isr (void)
button handler function More...
void | jump_to_app (uint32_t address)
jump to app More...
void | usb_re_connect ()
usb re-connect More...
int | main (void)
main function. More...
void | flash_fat16_loop_status (void)
loop status More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...

Variables

static uint8_t | fat16_sector [62]
const uint8_t | fat16_root_dir_sector [FAT16_DIR_SIZE]
const uint8_t | fat16_table_sector0 [FAT16_TABLE_SIZE]
uint8_t | fat16_file_name [FAT16_FILENAME_SIZE]
fat_dir_type g_file_attr
flash_iap_type flash_iap
uint32_t | file_write_nr = 0
uint32_t | flash_fat16_boot_sector_addr = 0x00
uint32_t | flash_fat16_1_addr = 0x1000
uint32_t | flash_fat16_2_addr = 0x7800
uint32_t | flash_fat16_root_addr = 0xE000
uint32_t | flash_fat16_file_start_addr = 0x12000
otg_core_type otg_core_struct
void(* | pftarget )(void)
uint8_t | scsi_inquiry [MSC_SUPPORT_MAX_LUN][SCSI_INQUIRY_DATA_LENGTH]
iapfun jump_to_app
jump to app More...

Detailed Description

Macro Definition Documentation

◆ FAT16_SECTOR_SIZE

#define FAT16_SECTOR_SIZE 62

Definition at line 36 of file flash_fat16.c.

◆ INTERNAL_FLASH_LUN

#define INTERNAL_FLASH_LUN 0

Definition at line 45 of file virtual_msc_iap/inc/msc_diskio.h.

◆ OTG_CLOCK

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 60 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ OTG_IRQ

#define OTG_IRQ OTGFS1_IRQn

Definition at line 61 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 62 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ OTG_PIN_GPIO

#define OTG_PIN_GPIO GPIOA

Definition at line 67 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 68 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ OTG_PIN_ID

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 70 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ OTG_PIN_SOF

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 74 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 72 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 73 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ OTG_PIN_VBUS

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 69 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 65 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 64 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ OTG_WKUP_IRQ

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 63 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ SD_LUN

#define SD_LUN 2

Definition at line 47 of file virtual_msc_iap/inc/msc_diskio.h.

◆ SPI_FLASH_LUN

#define SPI_FLASH_LUN 1

Definition at line 46 of file virtual_msc_iap/inc/msc_diskio.h.

◆ USB_FLASH_ADDR_OFFSET

#define USB_FLASH_ADDR_OFFSET 0x08004000

Definition at line 49 of file virtual_msc_iap/inc/msc_diskio.h.

◆ USB_ID

#define USB_ID 0

enable usb host mode

Definition at line 59 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ USBD_EP0_TX_SIZE

#define USBD_EP0_TX_SIZE 24

Definition at line 85 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ USBD_EP1_TX_SIZE

#define USBD_EP1_TX_SIZE 20

Definition at line 86 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ USBD_EP2_TX_SIZE

#define USBD_EP2_TX_SIZE 20

Definition at line 87 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ USBD_EP3_TX_SIZE

#define USBD_EP3_TX_SIZE 20

Definition at line 88 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ USBD_RX_SIZE

#define USBD_RX_SIZE 128

usb device mode config

usb device mode fifo

Definition at line 84 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

◆ USE_OTG_DEVICE_MODE

#define USE_OTG_DEVICE_MODE

enable usb device mode

Definition at line 52 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c.

◆ button_exint_init()

void button_exint_init ( button_type button )

◆ button_isr()

void button_isr ( void )

button handler function

Parameters
none
Return values
none

< external interrupt line 0

< external interrupt line 0

Definition at line 85 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c.

◆ fat16_memory_cmp()

uint32_t fat16_memory_cmp | ( | uint8_t * | dst,
 |  | uint8_t * | src,
 |  | uint32_t | len
 | ) |  |

memory compare function

Parameters
dst | dest buffer pointer
src | src buffer pointer
len | compare length
Return values
compare result

Definition at line 207 of file flash_fat16.c.

Referenced by flash_fat16_sector_write().

◆ fat16_memory_copy()

uint32_t fat16_memory_copy | ( | uint8_t * | dst,
 |  | const uint8_t * | src,
 |  | uint32_t | len
 | ) |  |

memory copy function

Parameters
dst | dest buffer pointer
src | src buffer pointer
len | copy length
Return values
nubmer of data copy

Definition at line 173 of file flash_fat16.c.

Referenced by flash_fat16_boot_dir_write(), and flash_fat16_read().

◆ fat16_memory_memset()

uint32_t fat16_memory_memset | ( | uint8_t * | dst,
 |  | uint32_t | set,
 |  | uint32_t | len
 | ) |  |

memset function

Parameters
dst | dest buffer pointer
set | set value
len | set length
Return values
nubmer of data set

Definition at line 190 of file flash_fat16.c.

Referenced by flash_fat16_boot_dir_write(), and flash_fat16_read().

◆ flash_crc_check()

uint32_t flash_crc_check | ( | uint32_t | address,
 |  | uint8_t * | data,
 |  | uint32_t | len
 | ) |  |

crc check

Parameters
address | flash address
data | pointer to array to store data
len | data length
Return values
crc result

Definition at line 540 of file flash_fat16.c.

Referenced by flash_write_data().

◆ flash_fat16_addr_offset()

uint32_t flash_fat16_addr_offset ( uint8_t * file_name )

get offset address

Parameters
file_name file name
Return values
offset address

Definition at line 394 of file flash_fat16.c.

Referenced by flash_fat16_sector_write().

◆ flash_fat16_boot_dir_write()

uint32_t flash_fat16_boot_dir_write | ( | uint32_t | fat_lbk,
 |  | uint8_t * | data,
 |  | uint32_t | len
 | ) |  |

boot dir write

Parameters
fat_lbk | logical block address
data | pointer to array to store data
len | data length
Return values
nubmer of data

Definition at line 353 of file flash_fat16.c.

Referenced by flash_fat16_write().

◆ flash_fat16_clear_upgrade_flag()

void flash_fat16_clear_upgrade_flag ( void )

clear iap upgrade flag

Parameters
none
Return values
none

Definition at line 223 of file flash_fat16.c.

Referenced by flash_fat16_sector_write().

◆ flash_fat16_get_upgrade_flag()

uint8_t flash_fat16_get_upgrade_flag ( void )

get iap upgrade complete flag

Parameters
none
Return values
the iap flag

Definition at line 248 of file flash_fat16.c.

Referenced by main().

◆ flash_fat16_init()

void flash_fat16_init ( void )

flash fat16 iap init

Parameters
none
Return values
none

Definition at line 659 of file flash_fat16.c.

Referenced by main().

◆ flash_fat16_loop_status()

void flash_fat16_loop_status ( void )

loop status

Parameters
none
Return values
none

Definition at line 233 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.

Referenced by main().

◆ flash_fat16_read()

uint32_t flash_fat16_read | ( | uint32_t | fat_lbk,
 |  | uint8_t * | data,
 |  | uint32_t | len
 | ) |  |

read a logical block address

Parameters
fat_lbk logical block address to read
data pointer to array to store data read
len data length
Return values
read length

Definition at line 269 of file flash_fat16.c.

Referenced by msc_disk_read().

◆ flash_fat16_sector_write()

uint32_t flash_fat16_sector_write | ( | uint32_t | fat_lbk,
 |  | uint8_t * | data,
 |  | uint32_t | len
 | ) |  |

write sector

Parameters
fat_lbk | logical block address
data | pointer to array to store data
len | data length
Return values
nubmer of data

Definition at line 443 of file flash_fat16.c.

Referenced by flash_fat16_write().

◆ flash_fat16_set_name()

uint32_t flash_fat16_set_name | ( | const uint8_t * | file_name,
 |  | uint8_t | len
 | ) |  |

set file name

Parameters
file_name | file name
len | filename length
Return values
filename length

Definition at line 331 of file flash_fat16.c.

Referenced by flash_fat16_loop_status().

◆ flash_fat16_set_upgrade_flag()

void flash_fat16_set_upgrade_flag ( void )

set iap upgrade complete flag

Parameters
none
Return values
none

Definition at line 235 of file flash_fat16.c.

Referenced by flash_fat16_sector_write().

◆ flash_fat16_write()

uint32_t flash_fat16_write | ( | uint32_t | fat_lbk,
 |  | uint8_t * | data,
 |  | uint32_t | len
 | ) |  |

write a logical block address

Parameters
fat_lbk logical block address to read
data pointer to array to store data read
len data length
Return values
read length

Definition at line 308 of file flash_fat16.c.

Referenced by msc_disk_write().

◆ flash_read_data()

uint32_t flash_read_data | ( | uint32_t | address,
 |  | uint8_t * | data,
 |  | uint32_t | len
 | ) |  |

read data from flash

Parameters
address | flash address
data | pointer to array to store data
len | data length
Return values
read length

Definition at line 591 of file flash_fat16.c.

◆ flash_write_data()

uint32_t flash_write_data | ( | uint32_t | address,
 |  | uint8_t * | data,
 |  | uint32_t | len
 | ) |  |

write data to flash

Parameters
address | flash address
data | pointer to array to store data
len | data length
Return values
write status

Definition at line 610 of file flash_fat16.c.

Referenced by flash_fat16_sector_write().

◆ get_inquiry()

uint8_t * get_inquiry ( uint8_t lun )

get disk inquiry

Parameters
lun logical units number
Return values
inquiry string

Definition at line 59 of file virtual_msc_iap/src/msc_diskio.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c.

◆ jump_to_app()

void jump_to_app ( uint32_t address )

jump to app

Parameters
none
Return values
none

Definition at line 290 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.

Referenced by flash_fat16_loop_status(), and main().

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 63 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c.

◆ msc_disk_capacity()

usb_sts_type msc_disk_capacity | ( | uint8_t | lun,
 |  | uint32_t * | blk_nbr,
 |  | uint32_t * | blk_size
 | ) |  |

disk capacity

Parameters
lun | logical units number
blk_nbr | pointer to number of block
blk_size | pointer to block size
Return values
status of usb_sts_type

Definition at line 117 of file virtual_msc_iap/src/msc_diskio.c.

◆ msc_disk_read()

usb_sts_type msc_disk_read | ( | uint8_t | lun,
 |  | uint32_t | addr,
 |  | uint8_t * | read_buf,
 |  | uint32_t | len
 | ) |  |

disk read

Parameters
lun | logical units number
addr | logical address
read_buf | pointer to read buffer
len | read length
Return values
status of usb_sts_type

Definition at line 75 of file virtual_msc_iap/src/msc_diskio.c.

◆ msc_disk_write()

usb_sts_type msc_disk_write | ( | uint8_t | lun,
 |  | uint32_t | addr,
 |  | uint8_t * | buf,
 |  | uint32_t | len
 | ) |  |

disk write

Parameters
lun | logical units number
addr | logical address
buf | pointer to write buffer
len | write length
Return values
status of usb_sts_type

Definition at line 97 of file virtual_msc_iap/src/msc_diskio.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 316 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 113 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb endpoint max num define

usb delay millisecond function.

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Parameters
ms number of millisecond delay
Return values
none

Definition at line 326 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 337 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 153 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

◆ usb_re_connect()

void usb_re_connect ( void )

usb re-connect

Parameters
none
Return values
none

Definition at line 220 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.

Referenced by flash_fat16_loop_status().

Variable Documentation

◆ fat16_file_name

uint8_t fat16_file_name[FAT16_FILENAME_SIZE]
Initial value:
=
{
'R',
'e',
'a',
'd',
'y',
' ',
' ',
' ',
'T',
'X',
'T'
}

Definition at line 129 of file flash_fat16.c.

Referenced by flash_fat16_read(), and flash_fat16_set_name().

◆ fat16_root_dir_sector

const uint8_t fat16_root_dir_sector[FAT16_DIR_SIZE]

Definition at line 80 of file flash_fat16.c.

Referenced by flash_fat16_read().

◆ fat16_sector

uint8_t fat16_sector[62]
static

Definition at line 37 of file flash_fat16.c.

Referenced by flash_fat16_init(), and flash_fat16_read().

◆ fat16_table_sector0

const uint8_t fat16_table_sector0[FAT16_TABLE_SIZE]
Initial value:
=
{
0xF8,
0xFF,
0xFF,
0xFF
}

Definition at line 121 of file flash_fat16.c.

Referenced by flash_fat16_read().

◆ file_write_nr

uint32_t file_write_nr = 0

Definition at line 146 of file flash_fat16.c.

◆ flash_fat16_1_addr

uint32_t flash_fat16_1_addr = 0x1000

Definition at line 150 of file flash_fat16.c.

Referenced by flash_fat16_init(), and flash_fat16_read().

◆ flash_fat16_2_addr

uint32_t flash_fat16_2_addr = 0x7800

Definition at line 151 of file flash_fat16.c.

Referenced by flash_fat16_init(), and flash_fat16_read().

◆ flash_fat16_boot_sector_addr

uint32_t flash_fat16_boot_sector_addr = 0x00

Definition at line 149 of file flash_fat16.c.

Referenced by flash_fat16_read().

◆ flash_fat16_file_start_addr

uint32_t flash_fat16_file_start_addr = 0x12000

Definition at line 153 of file flash_fat16.c.

Referenced by flash_fat16_init(), and flash_fat16_write().

◆ flash_fat16_root_addr

uint32_t flash_fat16_root_addr = 0xE000

Definition at line 152 of file flash_fat16.c.

Referenced by flash_fat16_init(), flash_fat16_read(), and flash_fat16_write().

◆ flash_iap

flash_iap_type flash_iap

Definition at line 145 of file flash_fat16.c.

Referenced by flash_fat16_addr_offset(), flash_fat16_boot_dir_write(), flash_fat16_clear_upgrade_flag(), flash_fat16_get_upgrade_flag(), flash_fat16_init(), flash_fat16_loop_status(), flash_fat16_sector_write(), flash_fat16_set_upgrade_flag(), flash_write_data(), main(), and msc_disk_capacity().

◆ g_file_attr

fat_dir_type g_file_attr

Definition at line 144 of file flash_fat16.c.

Referenced by flash_fat16_boot_dir_write(), and flash_fat16_sector_write().

◆ jump_to_app

void jump_to_app

jump to app

Parameters
none
Return values
none

Definition at line 46 of file bootloader/src/iap.c.

Referenced by app_load(), and main().

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 47 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.

Referenced by main(), OTG_IRQ_HANDLER(), and usb_re_connect().

◆ pftarget

void(* pftarget) (void) ( void )

Definition at line 48 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.

Referenced by jump_to_app().

◆ scsi_inquiry

uint8_t scsi_inquiry[MSC_SUPPORT_MAX_LUN][SCSI_INQUIRY_DATA_LENGTH]
Initial value:
=
{
{
0x00,
0x80,
0x00,
0x01,
SCSI_INQUIRY_DATA_LENGTH - 5,
0x00, 0x00, 0x00,
'A', 'T', '3', '2', ' ', ' ', ' ', ' ',
'M', 's', 'c', ' ', 'i', 'a', 'p', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
'2', '.', '0', '0'
},
}
SCSI_INQUIRY_DATA_LENGTH
#define SCSI_INQUIRY_DATA_LENGTH
Definition: msc_bot_scsi.h:123

Definition at line 38 of file virtual_msc_iap/src/msc_diskio.c.

Referenced by get_inquiry().


AT32F415 Firmwary Library: USB_device_virtual_msc_iap_definition

Data Structures | Macros | Enumerations | Functions | Variables
USB_device_virtual_msc_iap_definition
AT32F415_periph_examples » USB_device_virtual_msc_iap

Data Structures

struct | fat_dir_type
struct | flash_iap_type

Macros

#define | FAT16_SECTOR_SIZE 62
#define | FAT16_TABLE_SIZE 4
#define | FAT16_BYTE_PER_SIZE 2048
#define | FAT16_FILENAME_SIZE 11
#define | FAT16_DIR_SIZE 47
#define | FLASH_FAT16_BOOT_SECTOR_ADDR 0x00
#define | FLASH_FAT16_1_ADDR 0x1000
#define | FLASH_FAT16_2_ADDR 0x7800
#define | FLASH_FAT16_ROOT_ADDR 0xE000
#define | FLASH_FAT16_FILE_START_ADDR 0x12000
#define | FLASH_APP_START_ADDR 0x08006000
#define | FLASH_SECTOR_1K_SIZE 0x400
#define | FLASH_SECTOR_2K_SIZE 0x800
#define | FLASH_SECTOR_4K_SIZE 0x1000
#define | FLASH_SECTOR_1K_ALLGNED 0x3FF
#define | FLASH_SECTOR_2K_ALLGNED 0x7FF
#define | FLASH_SECTOR_4K_ALLGNED 0xFFF
#define | FILE_SUFFIX1_LEN 3
#define | FILE_SUFFIX2_LEN 3
#define | FILE_SUFFIX1_NAME "BIN"
#define | FILE_SUFFIX2_NAME "bin"
#define | INVAILD_OFFSET_ADDR 0xFFFFFFFF
#define | IAP_UPGRADE_COMPLETE_FLAG 0x41544B38
#define | IAP_SUCCESS 0
#define | IAP_ERROR 1

Enumerations

enum upgrade_status_type {
UPGRADE_READY = 0 , UPGRAGE_ONGOING , UPGRADE_SUCCESS , UPGRADE_ERROR ,
UPGRADE_LARGE , UPGRADE_UNKNOWN , UPGRADE_DONE , UPGRADE_JUMP
}

Functions

uint32_t | flash_fat16_write (uint32_t fat_lbk, uint8_t *data, uint32_t len)
write a logical block address More...
uint32_t | flash_fat16_read (uint32_t fat_lbk, uint8_t *data, uint32_t len)
read a logical block address More...
void | flash_fat16_init (void)
flash fat16 iap init More...
void | flash_fat16_loop_status (void)
loop status More...
uint32_t | flash_fat16_set_name (const uint8_t *file_name, uint8_t len)
set file name More...
uint8_t | flash_fat16_get_upgrade_flag (void)
get iap upgrade complete flag More...

Variables

flash_iap_type flash_iap

Detailed Description

Macro Definition Documentation

◆ FAT16_BYTE_PER_SIZE

#define FAT16_BYTE_PER_SIZE 2048

Definition at line 50 of file flash_fat16.h.

◆ FAT16_DIR_SIZE

#define FAT16_DIR_SIZE 47

Definition at line 52 of file flash_fat16.h.

◆ FAT16_FILENAME_SIZE

#define FAT16_FILENAME_SIZE 11

Definition at line 51 of file flash_fat16.h.

◆ FAT16_SECTOR_SIZE

#define FAT16_SECTOR_SIZE 62

Definition at line 48 of file flash_fat16.h.

◆ FAT16_TABLE_SIZE

#define FAT16_TABLE_SIZE 4

Definition at line 49 of file flash_fat16.h.

◆ FILE_SUFFIX1_LEN

#define FILE_SUFFIX1_LEN 3

Definition at line 70 of file flash_fat16.h.

◆ FILE_SUFFIX1_NAME

#define FILE_SUFFIX1_NAME "BIN"

Definition at line 72 of file flash_fat16.h.

◆ FILE_SUFFIX2_LEN

#define FILE_SUFFIX2_LEN 3

Definition at line 71 of file flash_fat16.h.

◆ FILE_SUFFIX2_NAME

#define FILE_SUFFIX2_NAME "bin"

Definition at line 73 of file flash_fat16.h.

◆ FLASH_APP_START_ADDR

#define FLASH_APP_START_ADDR 0x08006000

Definition at line 60 of file flash_fat16.h.

◆ FLASH_FAT16_1_ADDR

#define FLASH_FAT16_1_ADDR 0x1000

Definition at line 55 of file flash_fat16.h.

◆ FLASH_FAT16_2_ADDR

#define FLASH_FAT16_2_ADDR 0x7800

Definition at line 56 of file flash_fat16.h.

◆ FLASH_FAT16_BOOT_SECTOR_ADDR

#define FLASH_FAT16_BOOT_SECTOR_ADDR 0x00

Definition at line 54 of file flash_fat16.h.

◆ FLASH_FAT16_FILE_START_ADDR

#define FLASH_FAT16_FILE_START_ADDR 0x12000

Definition at line 58 of file flash_fat16.h.

◆ FLASH_FAT16_ROOT_ADDR

#define FLASH_FAT16_ROOT_ADDR 0xE000

Definition at line 57 of file flash_fat16.h.

◆ FLASH_SECTOR_1K_ALLGNED

#define FLASH_SECTOR_1K_ALLGNED 0x3FF

Definition at line 66 of file flash_fat16.h.

◆ FLASH_SECTOR_1K_SIZE

#define FLASH_SECTOR_1K_SIZE 0x400

Definition at line 62 of file flash_fat16.h.

◆ FLASH_SECTOR_2K_ALLGNED

#define FLASH_SECTOR_2K_ALLGNED 0x7FF

Definition at line 67 of file flash_fat16.h.

◆ FLASH_SECTOR_2K_SIZE

#define FLASH_SECTOR_2K_SIZE 0x800

Definition at line 63 of file flash_fat16.h.

◆ FLASH_SECTOR_4K_ALLGNED

#define FLASH_SECTOR_4K_ALLGNED 0xFFF

Definition at line 68 of file flash_fat16.h.

◆ FLASH_SECTOR_4K_SIZE

#define FLASH_SECTOR_4K_SIZE 0x1000

Definition at line 64 of file flash_fat16.h.

◆ IAP_ERROR

#define IAP_ERROR 1

Definition at line 78 of file flash_fat16.h.

◆ IAP_SUCCESS

#define IAP_SUCCESS 0

Definition at line 77 of file flash_fat16.h.

◆ IAP_UPGRADE_COMPLETE_FLAG

#define IAP_UPGRADE_COMPLETE_FLAG 0x41544B38

Definition at line 76 of file flash_fat16.h.

◆ INVAILD_OFFSET_ADDR

#define INVAILD_OFFSET_ADDR 0xFFFFFFFF

Definition at line 75 of file flash_fat16.h.

Enumeration Type Documentation

◆ upgrade_status_type

enum upgrade_status_type
Enumerator
UPGRADE_READY
UPGRAGE_ONGOING
UPGRADE_SUCCESS
UPGRADE_ERROR
UPGRADE_LARGE
UPGRADE_UNKNOWN
UPGRADE_DONE
UPGRADE_JUMP

Definition at line 80 of file flash_fat16.h.

Function Documentation

◆ flash_fat16_get_upgrade_flag()

uint8_t flash_fat16_get_upgrade_flag ( void )

get iap upgrade complete flag

Parameters
none
Return values
the iap flag

Definition at line 248 of file flash_fat16.c.

Referenced by main().

◆ flash_fat16_init()

void flash_fat16_init ( void )

flash fat16 iap init

Parameters
none
Return values
none

Definition at line 659 of file flash_fat16.c.

Referenced by main().

◆ flash_fat16_loop_status()

void flash_fat16_loop_status ( void )

loop status

Parameters
none
Return values
none

Definition at line 233 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.

Referenced by main().

◆ flash_fat16_read()

uint32_t flash_fat16_read | ( | uint32_t | fat_lbk,
 |  | uint8_t * | data,
 |  | uint32_t | len
 | ) |  |

read a logical block address

Parameters
fat_lbk logical block address to read
data pointer to array to store data read
len data length
Return values
read length

Definition at line 269 of file flash_fat16.c.

Referenced by msc_disk_read().

◆ flash_fat16_set_name()

uint32_t flash_fat16_set_name | ( | const uint8_t * | file_name,
 |  | uint8_t | len
 | ) |  |

set file name

Parameters
file_name | file name
len | filename length
Return values
filename length

Definition at line 331 of file flash_fat16.c.

Referenced by flash_fat16_loop_status().

◆ flash_fat16_write()

uint32_t flash_fat16_write | ( | uint32_t | fat_lbk,
 |  | uint8_t * | data,
 |  | uint32_t | len
 | ) |  |

write a logical block address

Parameters
fat_lbk logical block address to read
data pointer to array to store data read
len data length
Return values
read length

Definition at line 308 of file flash_fat16.c.

Referenced by msc_disk_write().

Variable Documentation

◆ flash_iap

flash_iap_type flash_iap
extern

Definition at line 145 of file flash_fat16.c.

Referenced by flash_fat16_addr_offset(), flash_fat16_boot_dir_write(), flash_fat16_clear_upgrade_flag(), flash_fat16_get_upgrade_flag(), flash_fat16_init(), flash_fat16_loop_status(), flash_fat16_sector_write(), flash_fat16_set_upgrade_flag(), flash_write_data(), main(), and msc_disk_capacity().


AT32F415 Firmwary Library: fat_dir_type Struct Reference

Data Fields
fat_dir_type Struct Reference
AT32F415_periph_examples » USB_device_virtual_msc_iap » USB_device_virtual_msc_iap_definition

#include <flash_fat16.h>

Data Fields

uint8_t | file_name [11]
uint8_t | attr
uint8_t | res
uint8_t | create_time_tenth
uint16_t | create_time
uint16_t | create_data
uint16_t | last_access_data
uint16_t | clus_high
uint16_t | write_time
uint16_t | write_data
uint16_t | clus_low
uint32_t | file_size

Detailed Description

Definition at line 92 of file flash_fat16.h.

Field Documentation

◆ attr

uint8_t fat_dir_type::attr

Definition at line 95 of file flash_fat16.h.

Referenced by flash_fat16_boot_dir_write().

◆ clus_high

uint16_t fat_dir_type::clus_high

Definition at line 101 of file flash_fat16.h.

◆ clus_low

uint16_t fat_dir_type::clus_low

Definition at line 104 of file flash_fat16.h.

◆ create_data

uint16_t fat_dir_type::create_data

Definition at line 99 of file flash_fat16.h.

◆ create_time

uint16_t fat_dir_type::create_time

Definition at line 98 of file flash_fat16.h.

◆ create_time_tenth

uint8_t fat_dir_type::create_time_tenth

Definition at line 97 of file flash_fat16.h.

◆ file_name

uint8_t fat_dir_type::file_name[11]

Definition at line 94 of file flash_fat16.h.

Referenced by flash_fat16_sector_write().

◆ file_size

uint32_t fat_dir_type::file_size

Definition at line 105 of file flash_fat16.h.

Referenced by flash_fat16_sector_write().

◆ last_access_data

uint16_t fat_dir_type::last_access_data

Definition at line 100 of file flash_fat16.h.

◆ res

uint8_t fat_dir_type::res

Definition at line 96 of file flash_fat16.h.

◆ write_data

uint16_t fat_dir_type::write_data

Definition at line 103 of file flash_fat16.h.

Referenced by flash_fat16_boot_dir_write().

◆ write_time

uint16_t fat_dir_type::write_time

Definition at line 102 of file flash_fat16.h.

Referenced by flash_fat16_boot_dir_write().

The documentation for this struct was generated from the following file:
  • flash_fat16.h


AT32F415 Firmwary Library: flash_iap_type Struct Reference

Data Fields
flash_iap_type Struct Reference
AT32F415_periph_examples » USB_device_virtual_msc_iap » USB_device_virtual_msc_iap_definition

#include <flash_fat16.h>

Data Fields

uint32_t | flash_base_addr
uint32_t | flash_app_addr
uint32_t | flash_size
uint32_t | flash_app_size
uint32_t | sector_size
uint32_t | sector_mask
uint32_t | firmware_length
uint32_t | write_crc
uint32_t | read_crc
uint32_t | write_addr
uint32_t | file_write_nr
upgrade_status_type msc_up_status

Detailed Description

Definition at line 108 of file flash_fat16.h.

Field Documentation

◆ file_write_nr

uint32_t flash_iap_type::file_write_nr

Definition at line 121 of file flash_fat16.h.

Referenced by flash_fat16_boot_dir_write(), and flash_fat16_sector_write().

◆ firmware_length

uint32_t flash_iap_type::firmware_length

Definition at line 116 of file flash_fat16.h.

◆ flash_app_addr

uint32_t flash_iap_type::flash_app_addr

Definition at line 111 of file flash_fat16.h.

Referenced by flash_fat16_addr_offset(), flash_fat16_clear_upgrade_flag(), flash_fat16_get_upgrade_flag(), flash_fat16_init(), flash_fat16_set_upgrade_flag(), and main().

◆ flash_app_size

uint32_t flash_iap_type::flash_app_size

Definition at line 113 of file flash_fat16.h.

Referenced by flash_fat16_init(), and flash_fat16_sector_write().

◆ flash_base_addr

uint32_t flash_iap_type::flash_base_addr

Definition at line 110 of file flash_fat16.h.

Referenced by flash_fat16_addr_offset(), flash_fat16_init(), flash_fat16_sector_write(), and flash_write_data().

◆ flash_size

uint32_t flash_iap_type::flash_size

Definition at line 112 of file flash_fat16.h.

Referenced by flash_fat16_addr_offset(), flash_fat16_init(), and flash_write_data().

◆ msc_up_status

upgrade_status_type flash_iap_type::msc_up_status

Definition at line 122 of file flash_fat16.h.

Referenced by flash_fat16_loop_status(), and flash_fat16_sector_write().

◆ read_crc

uint32_t flash_iap_type::read_crc

Definition at line 118 of file flash_fat16.h.

◆ sector_mask

uint32_t flash_iap_type::sector_mask

Definition at line 115 of file flash_fat16.h.

Referenced by flash_fat16_init(), and flash_write_data().

◆ sector_size

uint32_t flash_iap_type::sector_size

Definition at line 114 of file flash_fat16.h.

Referenced by flash_fat16_clear_upgrade_flag(), flash_fat16_get_upgrade_flag(), flash_fat16_init(), flash_fat16_set_upgrade_flag(), flash_write_data(), and msc_disk_capacity().

◆ write_addr

uint32_t flash_iap_type::write_addr

Definition at line 120 of file flash_fat16.h.

Referenced by flash_fat16_init(), flash_fat16_loop_status(), and flash_fat16_sector_write().

◆ write_crc

uint32_t flash_iap_type::write_crc

Definition at line 117 of file flash_fat16.h.

The documentation for this struct was generated from the following file:
  • flash_fat16.h


AT32F415 Firmwary Library: USB_host_hid

Macros | Functions | Variables
USB_host_hid
AT32F415_periph_examples

Macros

#define | USE_OTG_HOST_MODE
enable usb device mode More...
#define | USB_ID 0
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | OTG_PIN_POWER_SWITCH_GPIO GPIOB
#define | OTG_PIN_POWER_SWITCH_CLOCK CRM_GPIOH_PERIPH_CLOCK
#define | OTG_PIN_POWER_SWITCH GPIO_PINS_3
#define | USBH_RX_FIFO_SIZE 128
usb device mode config More...
#define | USBH_NP_TX_FIFO_SIZE 96
#define | USBH_P_TX_FIFO_SIZE 96
#define | USBH_DEBUG_ENABLE
usb sof output enable More...
#define | USBH_DEBUG(...)
#define | USE_OTG_HOST_MODE
enable usb device mode More...
#define | USB_ID 0
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | OTG_PIN_POWER_SWITCH_GPIO GPIOB
#define | OTG_PIN_POWER_SWITCH_CLOCK CRM_GPIOH_PERIPH_CLOCK
#define | OTG_PIN_POWER_SWITCH GPIO_PINS_3
#define | USBH_RX_FIFO_SIZE 128
usb device mode config More...
#define | USBH_NP_TX_FIFO_SIZE 96
#define | USBH_P_TX_FIFO_SIZE 96
#define | USBH_DEBUG_ENABLE
usb sof output enable More...
#define | USBH_DEBUG(...)

Functions

void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...
void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
void | button_exint_init (void)
configure button exint More...
void | button_isr (void)
button handler function More...
void | EXINT0_IRQHandler (void)
exint0 interrupt handler More...
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
static usb_sts_type | usbh_user_init (void)
usb host init user handler More...
static usb_sts_type | usbh_user_reset (void)
usb host reset user handler More...
static usb_sts_type | usbh_user_attached (void)
usb host check device attached More...
static usb_sts_type | usbh_user_disconnect (void)
usb host discconet user handler More...
static usb_sts_type | usbh_user_speed (uint8_t speed)
usb host speed user handler More...
static usb_sts_type | usbh_user_mfc_string (void *string)
usb host manufacturer string user handler More...
static usb_sts_type | usbh_user_product_string (void *string)
usb host product string user handler More...
static usb_sts_type | usbh_user_serial_string (void *string)
usb host serial string user handler More...
static usb_sts_type | usbh_user_enumeration_done (void)
usb host enumeration done user handler More...
static usb_sts_type | usbh_user_application (void)
usb host application user handler More...
static usb_sts_type | usbh_user_active_vbus (void *uhost, confirm_state state)
usb host active vbus user handler More...
static usb_sts_type | usbh_user_not_support (void)
usb host not support user handler More...

Variables

otg_core_type otg_core_struct
usbh_user_handler_type usbh_user_handle

Detailed Description

Macro Definition Documentation

◆ OTG_CLOCK [1/2]

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 60 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_CLOCK [2/2]

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 60 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_IRQ [1/2]

#define OTG_IRQ OTGFS1_IRQn

Definition at line 61 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_IRQ [2/2]

#define OTG_IRQ OTGFS1_IRQn

Definition at line 61 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER [1/2]

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 62 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER [2/2]

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 62 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_PIN_GPIO [1/2]

#define OTG_PIN_GPIO GPIOA

Definition at line 67 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_PIN_GPIO [2/2]

#define OTG_PIN_GPIO GPIOA

Definition at line 67 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK [1/2]

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 68 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK [2/2]

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 68 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_PIN_ID [1/2]

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 70 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_PIN_ID [2/2]

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 70 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_PIN_POWER_SWITCH [1/2]

#define OTG_PIN_POWER_SWITCH GPIO_PINS_3

Definition at line 80 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_PIN_POWER_SWITCH [2/2]

#define OTG_PIN_POWER_SWITCH GPIO_PINS_3

Definition at line 80 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_PIN_POWER_SWITCH_CLOCK [1/2]

#define OTG_PIN_POWER_SWITCH_CLOCK CRM_GPIOH_PERIPH_CLOCK

Definition at line 79 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_PIN_POWER_SWITCH_CLOCK [2/2]

#define OTG_PIN_POWER_SWITCH_CLOCK CRM_GPIOH_PERIPH_CLOCK

Definition at line 79 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_PIN_POWER_SWITCH_GPIO [1/2]

#define OTG_PIN_POWER_SWITCH_GPIO GPIOB

Definition at line 78 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_PIN_POWER_SWITCH_GPIO [2/2]

#define OTG_PIN_POWER_SWITCH_GPIO GPIOB

Definition at line 78 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_PIN_SOF [1/2]

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 75 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_PIN_SOF [2/2]

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 75 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO [1/2]

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 73 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO [2/2]

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 73 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK [1/2]

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 74 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK [2/2]

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 74 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_PIN_VBUS [1/2]

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 69 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_PIN_VBUS [2/2]

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 69 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE [1/2]

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 65 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE [2/2]

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 65 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER [1/2]

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 64 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER [2/2]

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 64 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ OTG_WKUP_IRQ [1/2]

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 63 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ OTG_WKUP_IRQ [2/2]

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 63 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ USB_ID [1/2]

#define USB_ID 0

Definition at line 59 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ USB_ID [2/2]

#define USB_ID 0

Definition at line 59 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ USBH_DEBUG [1/2]

#define USBH_DEBUG ( ... )
Value:
printf(__VA_ARGS__);\
printf("\r\n");

Definition at line 152 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ USBH_DEBUG [2/2]

#define USBH_DEBUG ( ... )
Value:
printf(__VA_ARGS__);\
printf("\r\n");

Definition at line 152 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ USBH_DEBUG_ENABLE [1/2]

#define USBH_DEBUG_ENABLE

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Definition at line 149 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ USBH_DEBUG_ENABLE [2/2]

#define USBH_DEBUG_ENABLE

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Definition at line 149 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ USBH_NP_TX_FIFO_SIZE [1/2]

#define USBH_NP_TX_FIFO_SIZE 96

Definition at line 119 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ USBH_NP_TX_FIFO_SIZE [2/2]

#define USBH_NP_TX_FIFO_SIZE 96

Definition at line 119 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ USBH_P_TX_FIFO_SIZE [1/2]

#define USBH_P_TX_FIFO_SIZE 96

Definition at line 120 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ USBH_P_TX_FIFO_SIZE [2/2]

#define USBH_P_TX_FIFO_SIZE 96

Definition at line 120 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ USBH_RX_FIFO_SIZE [1/2]

#define USBH_RX_FIFO_SIZE 128

usb device mode config

usb host mode config

usb host mode fifo

Definition at line 118 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ USBH_RX_FIFO_SIZE [2/2]

#define USBH_RX_FIFO_SIZE 128

usb device mode config

usb host mode config

usb host mode fifo

Definition at line 118 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

◆ USE_OTG_HOST_MODE [1/2]

#define USE_OTG_HOST_MODE

enable usb device mode

enable usb host mode

Definition at line 55 of file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.

◆ USE_OTG_HOST_MODE [2/2]

#define USE_OTG_HOST_MODE

enable usb device mode

enable usb host mode

Definition at line 55 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.

Function Documentation

◆ button_exint_init()

void button_exint_init ( void )

configure button exint

Parameters
none
Return values
none

< external interrupt line 0

Definition at line 56 of file project/at_start_f415/examples/usb_host/hid_demo/src/main.c.

Referenced by main().

◆ button_isr()

void button_isr ( void )

button handler function

Parameters
none
Return values
none

< external interrupt line 0

< external interrupt line 0

Definition at line 85 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.

Referenced by EXINT0_IRQHandler().

◆ EXINT0_IRQHandler()

void EXINT0_IRQHandler ( void )

exint0 interrupt handler

Parameters
none
Return values
none

< external interrupt line 0

Definition at line 78 of file project/at_start_f415/examples/usb_host/hid_demo/src/main.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 100 of file project/at_start_f415/examples/usb_host/hid_demo/src/main.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 264 of file project/at_start_f415/examples/usb_host/hid_demo/src/main.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 145 of file project/at_start_f415/examples/usb_host/hid_demo/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb delay millisecond function.

usb endpoint max num define

Parameters
ms number of millisecond delay
Return values
none

Definition at line 274 of file project/at_start_f415/examples/usb_host/hid_demo/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 285 of file project/at_start_f415/examples/usb_host/hid_demo/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 185 of file project/at_start_f415/examples/usb_host/hid_demo/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

◆ usbh_user_active_vbus()

static usb_sts_type usbh_user_active_vbus | ( | void * | uhost,
 |  | confirm_state | state
 | ) |  |
static

usb host active vbus user handler

Parameters
uhost | to the structure of usbh_core_type
state | vbus state TRUE: active vbus FALSE: deactive vbus
Return values
usb_sts_type

Definition at line 202 of file hid_demo/src/usbh_user.c.

◆ usbh_user_application()

static usb_sts_type usbh_user_application ( void )
static

usb host application user handler

Parameters
none
Return values
usb_sts_type

Definition at line 186 of file hid_demo/src/usbh_user.c.

◆ usbh_user_attached()

static usb_sts_type usbh_user_attached ( void )
static

usb host check device attached

Parameters
none
Return values
usb_sts_type

Definition at line 95 of file hid_demo/src/usbh_user.c.

◆ usbh_user_disconnect()

static usb_sts_type usbh_user_disconnect ( void )
static

usb host discconet user handler

Parameters
none
Return values
usb_sts_type

Definition at line 107 of file hid_demo/src/usbh_user.c.

◆ usbh_user_enumeration_done()

static usb_sts_type usbh_user_enumeration_done ( void )
static

usb host enumeration done user handler

Parameters
none
Return values
usb_sts_type

Definition at line 174 of file hid_demo/src/usbh_user.c.

◆ usbh_user_init()

static usb_sts_type usbh_user_init ( void )
static

usb host init user handler

Parameters
none
Return values
usb_sts_type

Definition at line 71 of file hid_demo/src/usbh_user.c.

◆ usbh_user_mfc_string()

static usb_sts_type usbh_user_mfc_string ( void * string )
static

usb host manufacturer string user handler

Parameters
none
Return values
usb_sts_type

Definition at line 138 of file hid_demo/src/usbh_user.c.

◆ usbh_user_not_support()

static usb_sts_type usbh_user_not_support ( void )
static

usb host not support user handler

Parameters
none
Return values
usb_sts_type

Definition at line 225 of file hid_demo/src/usbh_user.c.

◆ usbh_user_product_string()

static usb_sts_type usbh_user_product_string ( void * string )
static

usb host product string user handler

Parameters
none
Return values
usb_sts_type

Definition at line 150 of file hid_demo/src/usbh_user.c.

◆ usbh_user_reset()

static usb_sts_type usbh_user_reset ( void )
static

usb host reset user handler

Parameters
none
Return values
usb_sts_type

Definition at line 83 of file hid_demo/src/usbh_user.c.

◆ usbh_user_serial_string()

static usb_sts_type usbh_user_serial_string ( void * string )
static

usb host serial string user handler

Parameters
none
Return values
usb_sts_type

Definition at line 162 of file hid_demo/src/usbh_user.c.

◆ usbh_user_speed()

static usb_sts_type usbh_user_speed ( uint8_t speed )
static

usb host speed user handler

Parameters
none
Return values
usb_sts_type

Definition at line 119 of file hid_demo/src/usbh_user.c.

Variable Documentation

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 44 of file project/at_start_f415/examples/usb_host/hid_demo/src/main.c.

Referenced by EXINT0_IRQHandler(), main(), and OTG_IRQ_HANDLER().

◆ usbh_user_handle

usbh_user_handler_type usbh_user_handle
Initial value:
=
{
usbh_user_init,
usbh_user_reset,
usbh_user_attached,
usbh_user_disconnect,
usbh_user_speed,
usbh_user_mfc_string,
usbh_user_product_string,
usbh_user_serial_string,
usbh_user_enumeration_done,
usbh_user_application,
usbh_user_active_vbus,
usbh_user_not_support,
}
usbh_user_init
static usb_sts_type usbh_user_init(void)
usb host init user handler
Definition: hid_demo/src/usbh_user.c:71
usbh_user_disconnect
static usb_sts_type usbh_user_disconnect(void)
usb host discconet user handler
Definition: hid_demo/src/usbh_user.c:107
usbh_user_not_support
static usb_sts_type usbh_user_not_support(void)
usb host not support user handler
Definition: hid_demo/src/usbh_user.c:225
usbh_user_application
static usb_sts_type usbh_user_application(void)
usb host application user handler
Definition: hid_demo/src/usbh_user.c:186
usbh_user_speed
static usb_sts_type usbh_user_speed(uint8_t speed)
usb host speed user handler
Definition: hid_demo/src/usbh_user.c:119
usbh_user_active_vbus
static usb_sts_type usbh_user_active_vbus(void *uhost, confirm_state state)
usb host active vbus user handler
Definition: hid_demo/src/usbh_user.c:202
usbh_user_serial_string
static usb_sts_type usbh_user_serial_string(void *string)
usb host serial string user handler
Definition: hid_demo/src/usbh_user.c:162
usbh_user_reset
static usb_sts_type usbh_user_reset(void)
usb host reset user handler
Definition: hid_demo/src/usbh_user.c:83
usbh_user_mfc_string
static usb_sts_type usbh_user_mfc_string(void *string)
usb host manufacturer string user handler
Definition: hid_demo/src/usbh_user.c:138
usbh_user_enumeration_done
static usb_sts_type usbh_user_enumeration_done(void)
usb host enumeration done user handler
Definition: hid_demo/src/usbh_user.c:174
usbh_user_attached
static usb_sts_type usbh_user_attached(void)
usb host check device attached
Definition: hid_demo/src/usbh_user.c:95
usbh_user_product_string
static usb_sts_type usbh_user_product_string(void *string)
usb host product string user handler
Definition: hid_demo/src/usbh_user.c:150

Definition at line 50 of file hid_demo/src/usbh_user.c.


AT32F415 Firmwary Library: USB_host_msc

Macros | Functions | Variables
USB_host_msc
AT32F415_periph_examples

Macros

#define | DEV_RAM 0 /* Example: Map Ramdisk to physical drive 0 */
#define | DEV_MMC 1 /* Example: Map MMC/SD card to physical drive 1 */
#define | DEV_USB 2 /* Example: Map USB MSD to physical drive 2 */

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...
DSTATUS | disk_status (BYTE pdrv)
DSTATUS | disk_initialize (BYTE pdrv)
DRESULT | disk_read (BYTE pdrv, BYTE *buff, LBA_t sector, UINT count)
DRESULT | disk_write (BYTE pdrv, const BYTE *buff, LBA_t sector, UINT count)
DRESULT | disk_ioctl (BYTE pdrv, BYTE cmd, void *buff)
DWORD | get_fattime (void)
static usb_sts_type | usbh_user_init (void)
usb host init user handler More...
static usb_sts_type | usbh_user_reset (void)
usb host reset user handler More...
static usb_sts_type | usbh_user_attached (void)
usb host check device attached More...
static usb_sts_type | usbh_user_disconnect (void)
usb host discconet user handler More...
static usb_sts_type | usbh_user_speed (uint8_t speed)
usb host speed user handler More...
static usb_sts_type | usbh_user_mfc_string (void *string)
usb host manufacturer string user handler More...
static usb_sts_type | usbh_user_product_string (void *string)
usb host product string user handler More...
static usb_sts_type | usbh_user_serial_string (void *string)
usb host serial string user handler More...
static usb_sts_type | usbh_user_enumeration_done (void)
usb host enumeration done user handler More...
static usb_sts_type | usbh_user_application (void)
static usb_sts_type | usbh_user_active_vbus (void *uhost, confirm_state state)
usb host active vbus user handler More...
static usb_sts_type | usbh_user_not_support (void)
usb host not support user handler More...

Variables

otg_core_type otg_core_struct
otg_core_type otg_core_struct
usbh_user_handler_type | usbh_user_handle
FIL | file
usb host application user handler More...
FATFS | fs

Detailed Description

Macro Definition Documentation

◆ DEV_MMC

#define DEV_MMC 1 /* Example: Map MMC/SD card to physical drive 1 */

Definition at line 42 of file usbh_msc_diskio.c.

◆ DEV_RAM

#define DEV_RAM 0 /* Example: Map Ramdisk to physical drive 0 */

Definition at line 41 of file usbh_msc_diskio.c.

◆ DEV_USB

#define DEV_USB 2 /* Example: Map USB MSD to physical drive 2 */

Definition at line 43 of file usbh_msc_diskio.c.

Function Documentation

◆ disk_initialize()

DSTATUS disk_initialize ( BYTE pdrv )

Definition at line 68 of file usbh_msc_diskio.c.

◆ disk_ioctl()

DRESULT disk_ioctl | ( | BYTE | pdrv,
 |  | BYTE | cmd,
 |  | void * | buff
 | ) |  |

Definition at line 131 of file usbh_msc_diskio.c.

◆ disk_read()

DRESULT disk_read | ( | BYTE | pdrv,
 |  | BYTE * | buff,
 |  | LBA_t | sector,
 |  | UINT | count
 | ) |  |

Definition at line 80 of file usbh_msc_diskio.c.

◆ disk_status()

DSTATUS disk_status ( BYTE pdrv )

Definition at line 50 of file usbh_msc_diskio.c.

◆ disk_write()

DRESULT disk_write | ( | BYTE | pdrv,
 |  | const BYTE * | buff,
 |  | LBA_t | sector,
 |  | UINT | count
 | ) |  |

Definition at line 105 of file usbh_msc_diskio.c.

◆ get_fattime()

DWORD get_fattime ( void )

Definition at line 163 of file usbh_msc_diskio.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 55 of file project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 217 of file project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 98 of file project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb delay millisecond function.

usb endpoint max num define

Parameters
ms number of millisecond delay
Return values
none

Definition at line 227 of file project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 238 of file project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 138 of file project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

◆ usbh_user_active_vbus()

static usb_sts_type usbh_user_active_vbus | ( | void * | uhost,
 |  | confirm_state | state
 | ) |  |
static

usb host active vbus user handler

Parameters
uhost | to the structure of usbh_core_type
state | vbus state TRUE: active vbus FALSE: deactive vbus
Return values
usb_sts_type

Definition at line 258 of file msc_only_fat32/src/usbh_user.c.

◆ usbh_user_application()

static usb_sts_type usbh_user_application ( void )
static

Definition at line 189 of file msc_only_fat32/src/usbh_user.c.

◆ usbh_user_attached()

static usb_sts_type usbh_user_attached ( void )
static

usb host check device attached

Parameters
none
Return values
usb_sts_type

Definition at line 96 of file msc_only_fat32/src/usbh_user.c.

◆ usbh_user_disconnect()

static usb_sts_type usbh_user_disconnect ( void )
static

usb host discconet user handler

Parameters
none
Return values
usb_sts_type

Definition at line 108 of file msc_only_fat32/src/usbh_user.c.

◆ usbh_user_enumeration_done()

static usb_sts_type usbh_user_enumeration_done ( void )
static

usb host enumeration done user handler

Parameters
none
Return values
usb_sts_type

Definition at line 175 of file msc_only_fat32/src/usbh_user.c.

◆ usbh_user_init()

static usb_sts_type usbh_user_init ( void )
static

usb host init user handler

Parameters
none
Return values
usb_sts_type

Definition at line 72 of file msc_only_fat32/src/usbh_user.c.

◆ usbh_user_mfc_string()

static usb_sts_type usbh_user_mfc_string ( void * string )
static

usb host manufacturer string user handler

Parameters
none
Return values
usb_sts_type

Definition at line 139 of file msc_only_fat32/src/usbh_user.c.

◆ usbh_user_not_support()

static usb_sts_type usbh_user_not_support ( void )
static

usb host not support user handler

Parameters
none
Return values
usb_sts_type

Definition at line 281 of file msc_only_fat32/src/usbh_user.c.

◆ usbh_user_product_string()

static usb_sts_type usbh_user_product_string ( void * string )
static

usb host product string user handler

Parameters
none
Return values
usb_sts_type

Definition at line 151 of file msc_only_fat32/src/usbh_user.c.

◆ usbh_user_reset()

static usb_sts_type usbh_user_reset ( void )
static

usb host reset user handler

Parameters
none
Return values
usb_sts_type

Definition at line 84 of file msc_only_fat32/src/usbh_user.c.

◆ usbh_user_serial_string()

static usb_sts_type usbh_user_serial_string ( void * string )
static

usb host serial string user handler

Parameters
none
Return values
usb_sts_type

Definition at line 163 of file msc_only_fat32/src/usbh_user.c.

◆ usbh_user_speed()

static usb_sts_type usbh_user_speed ( uint8_t speed )
static

usb host speed user handler

Parameters
none
Return values
usb_sts_type

Definition at line 120 of file msc_only_fat32/src/usbh_user.c.

Variable Documentation

◆ file

FIL file

usb host application user handler

Parameters
none
Return values
usb_sts_type

Definition at line 187 of file msc_only_fat32/src/usbh_user.c.

Referenced by usbh_user_application().

◆ fs

FATFS fs

Definition at line 188 of file msc_only_fat32/src/usbh_user.c.

Referenced by usbh_user_application().

◆ otg_core_struct [1/2]

otg_core_type otg_core_struct

Definition at line 45 of file project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c.

Referenced by main(), and OTG_IRQ_HANDLER().

◆ otg_core_struct [2/2]

otg_core_type otg_core_struct
extern

Definition at line 45 of file project/at_start_f415/examples/usb_device/audio/src/main.c.

Referenced by disk_ioctl(), disk_read(), disk_status(), disk_write(), EXINT0_IRQHandler(), keyboard_send_string(), main(), OTG_IRQ_HANDLER(), and usb_re_connect().

◆ usbh_user_handle

usbh_user_handler_type usbh_user_handle
Initial value:
=
{
usbh_user_init,
usbh_user_reset,
usbh_user_attached,
usbh_user_disconnect,
usbh_user_speed,
usbh_user_mfc_string,
usbh_user_product_string,
usbh_user_serial_string,
usbh_user_enumeration_done,
usbh_user_application,
usbh_user_active_vbus,
usbh_user_not_support,
}
usbh_user_init
static usb_sts_type usbh_user_init(void)
usb host init user handler
Definition: msc_only_fat32/src/usbh_user.c:72
usbh_user_disconnect
static usb_sts_type usbh_user_disconnect(void)
usb host discconet user handler
Definition: msc_only_fat32/src/usbh_user.c:108
usbh_user_not_support
static usb_sts_type usbh_user_not_support(void)
usb host not support user handler
Definition: msc_only_fat32/src/usbh_user.c:281
usbh_user_application
static usb_sts_type usbh_user_application(void)
Definition: msc_only_fat32/src/usbh_user.c:189
usbh_user_speed
static usb_sts_type usbh_user_speed(uint8_t speed)
usb host speed user handler
Definition: msc_only_fat32/src/usbh_user.c:120
usbh_user_active_vbus
static usb_sts_type usbh_user_active_vbus(void *uhost, confirm_state state)
usb host active vbus user handler
Definition: msc_only_fat32/src/usbh_user.c:258
usbh_user_serial_string
static usb_sts_type usbh_user_serial_string(void *string)
usb host serial string user handler
Definition: msc_only_fat32/src/usbh_user.c:163
usbh_user_reset
static usb_sts_type usbh_user_reset(void)
usb host reset user handler
Definition: msc_only_fat32/src/usbh_user.c:84
usbh_user_mfc_string
static usb_sts_type usbh_user_mfc_string(void *string)
usb host manufacturer string user handler
Definition: msc_only_fat32/src/usbh_user.c:139
usbh_user_enumeration_done
static usb_sts_type usbh_user_enumeration_done(void)
usb host enumeration done user handler
Definition: msc_only_fat32/src/usbh_user.c:175
usbh_user_attached
static usb_sts_type usbh_user_attached(void)
usb host check device attached
Definition: msc_only_fat32/src/usbh_user.c:96
usbh_user_product_string
static usb_sts_type usbh_user_product_string(void *string)
usb host product string user handler
Definition: msc_only_fat32/src/usbh_user.c:151

Definition at line 51 of file msc_only_fat32/src/usbh_user.c.

Referenced by main().


AT32F415 Firmwary Library: WDT_reset

Functions
WDT_reset
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< watchdog timer reset flag

< watchdog timer reset flag

Definition at line 44 of file project/at_start_f415/examples/wdt/wdt_reset/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c.


AT32F415 Firmwary Library: WWDT_reset

Functions
WWDT_reset
AT32F415_periph_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< window watchdog timer reset flag

< window watchdog timer reset flag

Definition at line 43 of file project/at_start_f415/examples/wwdt/wwdt_reset/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c.


AT32F415 Firmwary Library: _USB_device_hid_app_led3

Macros | Functions
_USB_device_hid_app_led3
AT32F415_periph_examples

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

Macro Definition Documentation

◆ OTG_CLOCK

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 59 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ OTG_IRQ

#define OTG_IRQ OTGFS1_IRQn

Definition at line 60 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 61 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ OTG_PIN_GPIO

#define OTG_PIN_GPIO GPIOA

Definition at line 66 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 67 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ OTG_PIN_ID

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 69 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ OTG_PIN_SOF

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 73 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 71 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 72 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ OTG_PIN_VBUS

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 68 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 64 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 63 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ OTG_WKUP_IRQ

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 62 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ USB_ID

#define USB_ID 0

enable usb host mode

Definition at line 58 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ USBD_EP0_TX_SIZE

#define USBD_EP0_TX_SIZE 24

Definition at line 85 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ USBD_EP1_TX_SIZE

#define USBD_EP1_TX_SIZE 20

Definition at line 86 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ USBD_EP2_TX_SIZE

#define USBD_EP2_TX_SIZE 20

Definition at line 87 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ USBD_EP3_TX_SIZE

#define USBD_EP3_TX_SIZE 20

Definition at line 88 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ USBD_RX_SIZE

#define USBD_RX_SIZE 128

usb device mode config

usb device mode fifo

Definition at line 84 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

◆ USE_OTG_DEVICE_MODE

#define USE_OTG_DEVICE_MODE

enable usb device mode

Definition at line 51 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.

Function Documentation

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb endpoint max num define

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

usb delay millisecond function.

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Parameters
ms number of millisecond delay
Return values
none

usb endpoint max num define

Parameters
ms number of millisecond delay
Return values
none

Definition at line 219 of file project/at_start_f415/examples/usb_device/audio/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 230 of file project/at_start_f415/examples/usb_device/audio/src/main.c.


AT32F415 Firmwary Library: _USB_device_hid_app_led4

Macros | Functions
_USB_device_hid_app_led4
AT32F415_periph_examples

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

Macro Definition Documentation

◆ OTG_CLOCK

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 59 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ OTG_IRQ

#define OTG_IRQ OTGFS1_IRQn

Definition at line 60 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 61 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ OTG_PIN_GPIO

#define OTG_PIN_GPIO GPIOA

Definition at line 66 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 67 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ OTG_PIN_ID

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 69 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ OTG_PIN_SOF

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 73 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 71 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 72 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ OTG_PIN_VBUS

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 68 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 64 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 63 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ OTG_WKUP_IRQ

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 62 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ USB_ID

#define USB_ID 0

enable usb host mode

Definition at line 58 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ USBD_EP0_TX_SIZE

#define USBD_EP0_TX_SIZE 24

Definition at line 85 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ USBD_EP1_TX_SIZE

#define USBD_EP1_TX_SIZE 20

Definition at line 86 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ USBD_EP2_TX_SIZE

#define USBD_EP2_TX_SIZE 20

Definition at line 87 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ USBD_EP3_TX_SIZE

#define USBD_EP3_TX_SIZE 20

Definition at line 88 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ USBD_RX_SIZE

#define USBD_RX_SIZE 128

usb device mode config

usb device mode fifo

Definition at line 84 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

◆ USE_OTG_DEVICE_MODE

#define USE_OTG_DEVICE_MODE

enable usb device mode

Definition at line 51 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.

Function Documentation

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb endpoint max num define

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

usb delay millisecond function.

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Parameters
ms number of millisecond delay
Return values
none

usb endpoint max num define

Parameters
ms number of millisecond delay
Return values
none

Definition at line 219 of file project/at_start_f415/examples/usb_device/audio/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 230 of file project/at_start_f415/examples/usb_device/audio/src/main.c.


AT32F415 Firmwary Library: _USB_device_hid_iap

Macros | Functions
_USB_device_hid_iap
AT32F415_periph_examples

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

Macro Definition Documentation

◆ OTG_CLOCK

#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK

Definition at line 59 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ OTG_IRQ

#define OTG_IRQ OTGFS1_IRQn

Definition at line 60 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ OTG_IRQ_HANDLER

#define OTG_IRQ_HANDLER ( void ) OTGFS1_IRQHandler

Definition at line 61 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ OTG_PIN_GPIO

#define OTG_PIN_GPIO GPIOA

Definition at line 66 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ OTG_PIN_GPIO_CLOCK

#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 67 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ OTG_PIN_ID

#define OTG_PIN_ID GPIO_PINS_10

Definition at line 69 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ OTG_PIN_SOF

#define OTG_PIN_SOF GPIO_PINS_8

Definition at line 73 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO

#define OTG_PIN_SOF_GPIO GPIOA

Definition at line 71 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ OTG_PIN_SOF_GPIO_CLOCK

#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK

Definition at line 72 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ OTG_PIN_VBUS

#define OTG_PIN_VBUS GPIO_PINS_9

Definition at line 68 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ OTG_WKUP_EXINT_LINE

#define OTG_WKUP_EXINT_LINE EXINT_LINE_18

Definition at line 64 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ OTG_WKUP_HANDLER

#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler

Definition at line 63 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ OTG_WKUP_IRQ

#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn

Definition at line 62 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ USB_ID

#define USB_ID 0

enable usb host mode

Definition at line 58 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ USBD_EP0_TX_SIZE

#define USBD_EP0_TX_SIZE 24

Definition at line 86 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ USBD_EP1_TX_SIZE

#define USBD_EP1_TX_SIZE 20

Definition at line 87 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ USBD_EP2_TX_SIZE

#define USBD_EP2_TX_SIZE 20

Definition at line 88 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ USBD_EP3_TX_SIZE

#define USBD_EP3_TX_SIZE 20

Definition at line 89 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ USBD_RX_SIZE

#define USBD_RX_SIZE 128

usb device mode config

usb device mode fifo

Definition at line 85 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

◆ USE_OTG_DEVICE_MODE

#define USE_OTG_DEVICE_MODE

enable usb device mode

Definition at line 51 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.

Function Documentation

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb endpoint max num define

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

usb delay millisecond function.

usb host mode config

usb sof output enable

ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) the vbus detection pin (pa9) can not be used for other functionality. vbus pin must kept at VBUS or VDD.

at32f415xx revision C: (support) ignore vbus detection, the internal vbus is always valid. the vbus pin (pa9) can be used for other functionality.

usb low power wakeup handler enable

Parameters
ms number of millisecond delay
Return values
none

usb endpoint max num define

Parameters
ms number of millisecond delay
Return values
none

Definition at line 219 of file project/at_start_f415/examples/usb_device/audio/src/main.c.

Referenced by usbd_remote_wakeup(), usbh_loop_handler(), usbh_reset_port(), usbh_resume(), and usbh_suspend().

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 230 of file project/at_start_f415/examples/usb_device/audio/src/main.c.


AT32F415 Firmwary Library: AT32F415_periph_template

Modules
AT32F415_periph_template

Modules

Library_configuration
System_clock_configuration
LED_toggle

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: Library_configuration

Macros
Library_configuration
AT32F415_periph_template

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 75 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 78 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 74 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 57 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 50 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 58 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 81 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 79 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 80 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 77 of file project/at_start_f415/templates/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 76 of file project/at_start_f415/templates/inc/at32f415_conf.h.


AT32F415 Firmwary Library: System_clock_configuration

Functions
System_clock_configuration
AT32F415_periph_template

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 56 of file project/at_start_f415/templates/src/at32f415_clock.c.


AT32F415 Firmwary Library: LED_toggle

Macros | Functions | Variables
LED_toggle
AT32F415_periph_template

Macros

#define | DELAY 100
#define | FAST 1
#define | SLOW 4

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | button_exint_init (void)
configure button exint More...
void | button_isr (void)
button handler function More...
void | EXINT0_IRQHandler (void)
exint0 interrupt handler More...
int | main (void)
main function. More...

Variables

uint8_t g_speed = 1

Detailed Description

Macro Definition Documentation

◆ DELAY

#define DELAY 100

Definition at line 38 of file project/at_start_f415/templates/src/main.c.

◆ FAST

#define FAST 1

Definition at line 39 of file project/at_start_f415/templates/src/main.c.

◆ SLOW

#define SLOW 4

Definition at line 40 of file project/at_start_f415/templates/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file project/at_start_f415/templates/src/at32f415_int.c.

◆ button_exint_init()

void button_exint_init ( void )

configure button exint

Parameters
none
Return values
none

< external interrupt line 0

Definition at line 52 of file project/at_start_f415/templates/src/main.c.

Referenced by main().

◆ button_isr()

void button_isr ( void )

button handler function

Parameters
none
Return values
none

< external interrupt line 0

Definition at line 75 of file project/at_start_f415/templates/src/main.c.

Referenced by EXINT0_IRQHandler().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file project/at_start_f415/templates/src/at32f415_int.c.

◆ EXINT0_IRQHandler()

void EXINT0_IRQHandler ( void )

exint0 interrupt handler

Parameters
none
Return values
none

Definition at line 98 of file project/at_start_f415/templates/src/main.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file project/at_start_f415/templates/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 108 of file project/at_start_f415/templates/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file project/at_start_f415/templates/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file project/at_start_f415/templates/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file project/at_start_f415/templates/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file project/at_start_f415/templates/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file project/at_start_f415/templates/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file project/at_start_f415/templates/src/at32f415_int.c.

Variable Documentation

◆ g_speed

uint8_t g_speed = 1

Definition at line 42 of file project/at_start_f415/templates/src/main.c.

Referenced by button_isr(), and main().


AT32F415 Firmwary Library: UTILITIES_examples

Modules
UTILITIES_examples

Modules

AP_read_write_boot_memory
AP_run_in_boot_memory
FreeRTOS_demo
GEN_random_number_demo
SLIB_project_l0
SLIB_project_l1
USART_IAP_app_led3_toggle
USART_IAP_app_led4_toggle
USART_IAP_bootloader
USB_IAP_app_led3_toggle
USB_IAP_app_led4_toggle
USB_IAP_bootloader

Detailed Description

Generated by doxygen 1.9.2


AT32F415 Firmwary Library: AP_read_write_boot_memory

Macros | Functions | Variables
AP_read_write_boot_memory
UTILITIES_examples

Macros

#define | TEST_BUFEER_SIZE 0x400
#define | TEST_FLASH_ADDRESS_START 0x1FFFAC00

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
error_status | buffer_compare (uint16_t *p_buffer1, uint16_t *p_buffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint16_t | buffer_write [0x400]
uint16_t | buffer_read [0x400]

Detailed Description

Macro Definition Documentation

◆ TEST_BUFEER_SIZE

#define TEST_BUFEER_SIZE 0x400

Definition at line 38 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c.

◆ TEST_FLASH_ADDRESS_START

#define TEST_FLASH_ADDRESS_START 0x1FFFAC00

Definition at line 39 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c.

Function Documentation

◆ buffer_compare()

error_status buffer_compare | ( | uint16_t * | p_buffer1,
 |  | uint16_t * | p_buffer2,
 |  | uint16_t | buffer_length
 | ) |  |

compares two buffers.

Parameters
p_buffer1,p_buffer2 | buffers to be compared.
buffer_length | buffer's length
Return values
SUCCESS p_buffer1 identical to p_buffer2 failed: p_buffer1 differs from p_buffer2

Definition at line 53 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 71 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c.

Variable Documentation

◆ buffer_read

uint16_t buffer_read[0x400]

Definition at line 42 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c.

Referenced by main().

◆ buffer_write

uint16_t buffer_write[0x400]

Definition at line 41 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: AP_run_in_boot_memory

Modules | Functions
AP_run_in_boot_memory
UTILITIES_examples

Modules

RUN_in_boot_memory_demo_exported_functions

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...
void | run_in_boot_memory_test (void)

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 44 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c.

◆ run_in_boot_memory_test()

void run_in_boot_memory_test ( void )

Definition at line 41 of file run_in_boot_memory.c.

Referenced by main().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c.


AT32F415 Firmwary Library: RUN_in_boot_memory_demo_exported_functions

Functions
RUN_in_boot_memory_demo_exported_functions
UTILITIES_examples » AP_run_in_boot_memory

Functions

void run_in_boot_memory_test (void)

Detailed Description

Function Documentation

◆ run_in_boot_memory_test()

void run_in_boot_memory_test ( void )

Definition at line 41 of file run_in_boot_memory.c.

Referenced by main().


AT32F415 Firmwary Library: FreeRTOS_demo

Functions | Variables
FreeRTOS_demo
UTILITIES_examples

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | DebugMon_Handler (void)
this function handles svcall exception. More...
void | led2_task_function (void *pvParameters)
void | led3_task_function (void *pvParameters)
int | main (void)
main function. More...

Variables

TaskHandle_t | led2_handler
TaskHandle_t | led3_handler

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file utilities/at32f415_freertos_demo/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles svcall exception.

this function handles debug monitor exception.

Parameters
none
Return values
none

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file utilities/at32f415_freertos_demo/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file utilities/at32f415_freertos_demo/src/at32f415_int.c.

◆ led2_task_function()

void led2_task_function ( void * pvParameters )

Definition at line 105 of file utilities/at32f415_freertos_demo/src/main.c.

Referenced by main().

◆ led3_task_function()

void led3_task_function ( void * pvParameters )

Definition at line 115 of file utilities/at32f415_freertos_demo/src/main.c.

Referenced by main().

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 52 of file utilities/at32f415_freertos_demo/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file utilities/at32f415_freertos_demo/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file utilities/at32f415_freertos_demo/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file utilities/at32f415_freertos_demo/src/at32f415_int.c.

Variable Documentation

◆ led2_handler

TaskHandle_t led2_handler

Definition at line 39 of file utilities/at32f415_freertos_demo/src/main.c.

Referenced by main().

◆ led3_handler

TaskHandle_t led3_handler

Definition at line 40 of file utilities/at32f415_freertos_demo/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: GEN_random_number_demo

Modules | Macros | Functions | Variables
GEN_random_number_demo
UTILITIES_examples

Modules

ERTC_asseed_definition
GEN_random_number_demo_exported_functions

Macros

#define DEVICE_ID_ADDR1 0x1FFFF7E8

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
int | main (void)
main function. More...
int | get_uid_for_seed (void)
get uid value as seed More...
void | randnum_test (void)
enable ertc as seed More...

Variables

ertc_time_type * time
uint16_t | ertc_clk_div_a = 0
uint16_t | ertc_clk_div_b = 0

Detailed Description

Macro Definition Documentation

◆ DEVICE_ID_ADDR1

#define DEVICE_ID_ADDR1 0x1FFFF7E8

Definition at line 41 of file random.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file utilities/at32f415_gen_random_number_demo/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file utilities/at32f415_gen_random_number_demo/src/at32f415_int.c.

◆ get_uid_for_seed()

int get_uid_for_seed ( void )

get uid value as seed

Parameters
none
Return values
uid_one_word

Definition at line 52 of file random.c.

Referenced by randnum_test().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file utilities/at32f415_gen_random_number_demo/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 44 of file utilities/at32f415_gen_random_number_demo/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file utilities/at32f415_gen_random_number_demo/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file utilities/at32f415_gen_random_number_demo/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file utilities/at32f415_gen_random_number_demo/src/at32f415_int.c.

◆ randnum_test()

void randnum_test ( void )

enable ertc as seed

Parameters
none
Return values
none

random number test

Parameters
none
Return values
none

Definition at line 143 of file random.c.

Referenced by main().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file utilities/at32f415_gen_random_number_demo/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file utilities/at32f415_gen_random_number_demo/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file utilities/at32f415_gen_random_number_demo/src/at32f415_int.c.

Variable Documentation

◆ ertc_clk_div_a

uint16_t ertc_clk_div_a = 0

Definition at line 44 of file random.c.

◆ ertc_clk_div_b

uint16_t ertc_clk_div_b = 0

Definition at line 45 of file random.c.

◆ time

ertc_time_type* time

Definition at line 42 of file random.c.

Referenced by delay(), ertc_calendar_get(), ertc_time_show(), ertc_timestamp_get(), ertc_timestamp_show(), main(), and randnum_test().


AT32F415 Firmwary Library: ERTC_asseed_definition

Macros
ERTC_asseed_definition
UTILITIES_examples » GEN_random_number_demo

Macros

#define ENABLE_ERTC_ASSEED (1)

Detailed Description

Macro Definition Documentation

◆ ENABLE_ERTC_ASSEED

#define ENABLE_ERTC_ASSEED (1)

Definition at line 49 of file random.h.


AT32F415 Firmwary Library: GEN_random_number_demo_exported_functions

Functions
GEN_random_number_demo_exported_functions
UTILITIES_examples » GEN_random_number_demo

Functions

void randnum_test (void)
enable ertc as seed More...

Detailed Description

Function Documentation

◆ randnum_test()

void randnum_test ( void )

enable ertc as seed

Parameters
none
Return values
none

random number test

Parameters
none
Return values
none

Definition at line 143 of file random.c.

Referenced by main().


AT32F415 Firmwary Library: SLIB_project_l0

Macros | Functions | Variables
SLIB_project_l0
UTILITIES_examples

Macros

#define | USE_SLIB_FUNCTION /* define it when user want to activate slib in this project */
#define | FLASH_START_ADDR 0x08000000
#define | TEST_SLIB_PSW 0x55665566
#define | SLIB_START_ADDR 0x08001000
#define | SLIB_DATA_ADDR 0x08002000
#define | SLIB_END_ADDR 0x08002800
#define | FLASH_SECTOR_SIZE 0x800
#define | SECTOR_NUM(dwAddr) ((dwAddr & (FLASH_START_ADDR - 1)) / FLASH_SECTOR_SIZE)
#define | SECTOR_WORD_CNT (FLASH_SECTOR_SIZE >> 2) /* words per sector */
#define | SNR_THRESHOLD_F32 140.0f
#define | TEST_LENGTH_SAMPLES 320

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | FLASH_IRQHandler (void)
flash handler. More...
flash_status_type | slib_enable (void)
config slib enable and program slib area. More...
int | main (void)
main function. More...

Variables

uint32_t | dw_start_sector
uint32_t | dw_data_start_sector
uint32_t | dw_end_sector
uint32_t | temp_buf [512]
static float32_t | testOutput [320]

Detailed Description

Macro Definition Documentation

◆ FLASH_SECTOR_SIZE

#define FLASH_SECTOR_SIZE 0x800

Definition at line 52 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

◆ FLASH_START_ADDR

#define FLASH_START_ADDR 0x08000000

Definition at line 47 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

◆ SECTOR_NUM

#define SECTOR_NUM ( dwAddr ) ((dwAddr & (FLASH_START_ADDR - 1)) / FLASH_SECTOR_SIZE)

Definition at line 53 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

◆ SECTOR_WORD_CNT

#define SECTOR_WORD_CNT (FLASH_SECTOR_SIZE >> 2) /* words per sector */

Definition at line 54 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

◆ SLIB_DATA_ADDR

#define SLIB_DATA_ADDR 0x08002000

Definition at line 50 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

◆ SLIB_END_ADDR

#define SLIB_END_ADDR 0x08002800

Definition at line 51 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

◆ SLIB_START_ADDR

#define SLIB_START_ADDR 0x08001000

Definition at line 49 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

◆ SNR_THRESHOLD_F32

#define SNR_THRESHOLD_F32 140.0f

Definition at line 56 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

◆ TEST_LENGTH_SAMPLES

#define TEST_LENGTH_SAMPLES 320

Definition at line 57 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

◆ TEST_SLIB_PSW

#define TEST_SLIB_PSW 0x55665566

Definition at line 48 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

◆ USE_SLIB_FUNCTION

#define USE_SLIB_FUNCTION /* define it when user want to activate slib in this project */

Definition at line 44 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c.

◆ FLASH_IRQHandler()

void FLASH_IRQHandler ( void )

flash handler.

Parameters
none
Return values
none

< flash erase/program protection error flag

< flash erase/program protection error flag

Definition at line 141 of file utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 129 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c.

◆ slib_enable()

flash_status_type slib_enable ( void )

config slib enable and program slib area.

Parameters
none
Return values
flash status

Definition at line 93 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

Referenced by main().

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c.

Variable Documentation

◆ dw_data_start_sector

uint32_t dw_data_start_sector

Definition at line 60 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

Referenced by slib_enable().

◆ dw_end_sector

uint32_t dw_end_sector

Definition at line 60 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

Referenced by slib_enable().

◆ dw_start_sector

uint32_t dw_start_sector

Definition at line 60 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

Referenced by slib_enable().

◆ temp_buf

uint32_t temp_buf[512]

Definition at line 61 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

Referenced by slib_enable().

◆ testOutput

float32_t testOutput[320]
static

Definition at line 64 of file utilities/at32f415_slib_demo/project_l0/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: SLIB_project_l1

Macros | Functions | Variables
SLIB_project_l1
UTILITIES_examples

Macros

#define | SNR_THRESHOLD_F32 140.0f
#define | TEST_LENGTH_SAMPLES 320

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | FLASH_IRQHandler (void)
flash handler. More...
void | config_flash_interrupt (void)
config flash error interrupt. More...
int | main (void)
main function. More...

Variables

static float32_t testOutput [320]

Detailed Description

Macro Definition Documentation

◆ SNR_THRESHOLD_F32

#define SNR_THRESHOLD_F32 140.0f

Definition at line 44 of file utilities/at32f415_slib_demo/project_l1/src/main.c.

◆ TEST_LENGTH_SAMPLES

#define TEST_LENGTH_SAMPLES 320

Definition at line 45 of file utilities/at32f415_slib_demo/project_l1/src/main.c.

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 79 of file utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c.

◆ config_flash_interrupt()

void config_flash_interrupt ( void )

config flash error interrupt.

Parameters
none
Return values
flash status

< flash error interrupt

Definition at line 56 of file utilities/at32f415_slib_demo/project_l1/src/main.c.

Referenced by main().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 114 of file utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c.

◆ FLASH_IRQHandler()

void FLASH_IRQHandler ( void )

flash handler.

Parameters
none
Return values
none

< flash erase/program protection error flag

< flash erase/program protection error flag

Definition at line 141 of file utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 53 of file utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 72 of file utilities/at32f415_slib_demo/project_l1/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 66 of file utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 44 of file utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 123 of file utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 105 of file utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 132 of file utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 92 of file utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c.

Variable Documentation

◆ testOutput

float32_t testOutput[320]
static

Definition at line 47 of file utilities/at32f415_slib_demo/project_l1/src/main.c.

Referenced by main().


AT32F415 Firmwary Library: USART_IAP_app_led3_toggle

Modules | Functions | Variables
USART_IAP_app_led3_toggle
UTILITIES_examples

Modules

App_led3_definition
App_led3_exported_functions

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | iap_command_handle (void)
iap command handle handle. More...
void | iap_init (void)
iap init. More...
int | main (void)
main function. More...
void | tmr_init (void)
init tmr. More...
void | TMR3_GLOBAL_IRQHandler (void)
tmr3 global interrupt handler. More...
void | uart_init (uint32_t baudrate)
init usart. More...
void | USART1_IRQHandler (void)
usart1 interrupt handler. More...
void | back_ok (void)
command response ok. More...
void | back_err (void)
command response error. More...

Variables

uint8_t iap_flag = IAP_REV_FLAG_NO

Detailed Description

Function Documentation

◆ back_err()

void back_err ( void )

command response error.

Parameters
none
Return values
none

Definition at line 120 of file app_led3_toggle/src/usart.c.

◆ back_ok()

void back_ok ( void )

command response ok.

Parameters
none
Return values
none

Definition at line 107 of file app_led3_toggle/src/usart.c.

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ iap_command_handle()

void iap_command_handle ( void )

iap command handle handle.

Parameters
none
Return values
none

Definition at line 44 of file app_led3_toggle/src/iap.c.

◆ iap_init()

void iap_init ( void )

iap init.

Parameters
none
Return values
none

Definition at line 61 of file app_led3_toggle/src/iap.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< nvic vector table based flash address

Definition at line 46 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ TMR3_GLOBAL_IRQHandler()

void TMR3_GLOBAL_IRQHandler ( void )

tmr3 global interrupt handler.

Parameters
none
Return values
none

Definition at line 72 of file app_led3_toggle/src/tmr.c.

◆ tmr_init()

void tmr_init ( void )

init tmr.

Parameters
none
Return values
none

Definition at line 44 of file app_led3_toggle/src/tmr.c.

◆ uart_init()

void uart_init ( uint32_t baudrate )

init usart.

Parameters
none
Return values
none

Definition at line 45 of file app_led3_toggle/src/usart.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ USART1_IRQHandler()

void USART1_IRQHandler ( void )

usart1 interrupt handler.

Parameters
none
Return values
none

Definition at line 87 of file app_led3_toggle/src/usart.c.

Variable Documentation

◆ iap_flag

uint8_t iap_flag = IAP_REV_FLAG_NO

Definition at line 38 of file app_led3_toggle/src/usart.c.

Referenced by USART1_IRQHandler().


AT32F415 Firmwary Library: App_led3_definition

Macros
App_led3_definition
UTILITIES_examples » USART_IAP_app_led3_toggle

Macros

#define | APP_START_ADDR 0x08004000
#define | IAP_UPGRADE_FLAG_ADDR (APP_START_ADDR - 0x800)
#define | IAP_UPGRADE_FLAG 0x41544B38
#define | IAP_REV_FLAG_NO 0
#define | IAP_REV_FLAG_5A 1
#define | IAP_REV_FLAG_DONE 2
#define | IAP_REV_FLAG_ERROR 3

Detailed Description

Macro Definition Documentation

◆ APP_START_ADDR

#define APP_START_ADDR 0x08004000

Definition at line 49 of file app_led3_toggle/inc/iap.h.

◆ IAP_REV_FLAG_5A

#define IAP_REV_FLAG_5A 1

Definition at line 51 of file app_led3_toggle/inc/usart.h.

◆ IAP_REV_FLAG_DONE

#define IAP_REV_FLAG_DONE 2

Definition at line 52 of file app_led3_toggle/inc/usart.h.

◆ IAP_REV_FLAG_ERROR

#define IAP_REV_FLAG_ERROR 3

Definition at line 53 of file app_led3_toggle/inc/usart.h.

◆ IAP_REV_FLAG_NO

#define IAP_REV_FLAG_NO 0

Definition at line 50 of file app_led3_toggle/inc/usart.h.

◆ IAP_UPGRADE_FLAG

#define IAP_UPGRADE_FLAG 0x41544B38

Definition at line 56 of file app_led3_toggle/inc/iap.h.

◆ IAP_UPGRADE_FLAG_ADDR

#define IAP_UPGRADE_FLAG_ADDR (APP_START_ADDR - 0x800)

Definition at line 52 of file app_led3_toggle/inc/iap.h.


AT32F415 Firmwary Library: App_led3_exported_functions

Functions
App_led3_exported_functions
UTILITIES_examples » USART_IAP_app_led3_toggle

Functions

void | iap_command_handle (void)
iap command handle handle. More...
void | iap_init (void)
iap init. More...
void | tmr_init (void)
init tmr. More...
void | uart_init (uint32_t baudrate)
init usart. More...
void | back_ok (void)
command response ok. More...
void | back_err (void)
command response error. More...

Detailed Description

Function Documentation

◆ back_err()

void back_err ( void )

command response error.

Parameters
none
Return values
none

Definition at line 120 of file app_led3_toggle/src/usart.c.

Referenced by TMR3_GLOBAL_IRQHandler().

◆ back_ok()

void back_ok ( void )

command response ok.

Parameters
none
Return values
none

Definition at line 107 of file app_led3_toggle/src/usart.c.

Referenced by main().

◆ iap_command_handle()

void iap_command_handle ( void )

iap command handle handle.

Parameters
none
Return values
none

Definition at line 44 of file app_led3_toggle/src/iap.c.

Referenced by main().

◆ iap_init()

void iap_init ( void )

iap init.

Parameters
none
Return values
none

iap init.

Parameters
none
Return values
none

Definition at line 61 of file app_led3_toggle/src/iap.c.

Referenced by main().

◆ tmr_init()

void tmr_init ( void )

init tmr.

Parameters
none
Return values
none

Definition at line 44 of file app_led3_toggle/src/tmr.c.

Referenced by main().

◆ uart_init()

void uart_init ( uint32_t baudrate )

init usart.

Parameters
none
Return values
none

Definition at line 45 of file app_led3_toggle/src/usart.c.


AT32F415 Firmwary Library: USART_IAP_app_led4_toggle

Modules | Functions | Variables
USART_IAP_app_led4_toggle
UTILITIES_examples

Modules

App_led4_definition
App_led4_exported_functions

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | iap_command_handle (void)
iap command handle handle. More...
void | iap_init (void)
iap init. More...
int | main (void)
main function. More...
void | tmr_init (void)
init tmr. More...
void | TMR3_GLOBAL_IRQHandler (void)
tmr3 global interrupt handler. More...
void | uart_init (uint32_t baudrate)
init usart. More...
void | USART1_IRQHandler (void)
usart1 interrupt handler. More...
void | back_ok (void)
command response ok. More...
void | back_err (void)
command response error. More...

Variables

uint8_t iap_flag = IAP_REV_FLAG_NO

Detailed Description

Function Documentation

◆ back_err()

void back_err ( void )

command response error.

Parameters
none
Return values
none

Definition at line 120 of file app_led4_toggle/src/usart.c.

◆ back_ok()

void back_ok ( void )

command response ok.

Parameters
none
Return values
none

Definition at line 107 of file app_led4_toggle/src/usart.c.

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ iap_command_handle()

void iap_command_handle ( void )

iap command handle handle.

Parameters
none
Return values
none

Definition at line 44 of file app_led4_toggle/src/iap.c.

Referenced by main().

◆ iap_init()

void iap_init ( void )

iap init.

Parameters
none
Return values
none

Definition at line 61 of file app_led4_toggle/src/iap.c.

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< nvic vector table based flash address

Definition at line 46 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ TMR3_GLOBAL_IRQHandler()

void TMR3_GLOBAL_IRQHandler ( void )

tmr3 global interrupt handler.

Parameters
none
Return values
none

Definition at line 72 of file app_led4_toggle/src/tmr.c.

◆ tmr_init()

void tmr_init ( void )

init tmr.

Parameters
none
Return values
none

Definition at line 44 of file app_led4_toggle/src/tmr.c.

◆ uart_init()

void uart_init ( uint32_t baudrate )

init usart.

Parameters
none
Return values
none

Definition at line 45 of file app_led4_toggle/src/usart.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ USART1_IRQHandler()

void USART1_IRQHandler ( void )

usart1 interrupt handler.

Parameters
none
Return values
none

Definition at line 87 of file app_led4_toggle/src/usart.c.

Variable Documentation

◆ iap_flag

uint8_t iap_flag = IAP_REV_FLAG_NO

Definition at line 38 of file app_led4_toggle/src/usart.c.

Referenced by iap_command_handle(), and USART1_IRQHandler().


AT32F415 Firmwary Library: App_led4_definition

Macros
App_led4_definition
UTILITIES_examples » USART_IAP_app_led4_toggle

Macros

#define | APP_START_ADDR 0x08004000
#define | IAP_UPGRADE_FLAG_ADDR (APP_START_ADDR - 0x800)
#define | IAP_UPGRADE_FLAG 0x41544B38
#define | IAP_REV_FLAG_NO 0
#define | IAP_REV_FLAG_5A 1
#define | IAP_REV_FLAG_DONE 2
#define | IAP_REV_FLAG_ERROR 3

Detailed Description

Macro Definition Documentation

◆ APP_START_ADDR

#define APP_START_ADDR 0x08004000

Definition at line 49 of file app_led4_toggle/inc/iap.h.

◆ IAP_REV_FLAG_5A

#define IAP_REV_FLAG_5A 1

Definition at line 51 of file app_led4_toggle/inc/usart.h.

◆ IAP_REV_FLAG_DONE

#define IAP_REV_FLAG_DONE 2

Definition at line 52 of file app_led4_toggle/inc/usart.h.

◆ IAP_REV_FLAG_ERROR

#define IAP_REV_FLAG_ERROR 3

Definition at line 53 of file app_led4_toggle/inc/usart.h.

◆ IAP_REV_FLAG_NO

#define IAP_REV_FLAG_NO 0

Definition at line 50 of file app_led4_toggle/inc/usart.h.

◆ IAP_UPGRADE_FLAG

#define IAP_UPGRADE_FLAG 0x41544B38

Definition at line 56 of file app_led4_toggle/inc/iap.h.

◆ IAP_UPGRADE_FLAG_ADDR

#define IAP_UPGRADE_FLAG_ADDR (APP_START_ADDR - 0x800)

Definition at line 52 of file app_led4_toggle/inc/iap.h.


AT32F415 Firmwary Library: App_led4_exported_functions

Functions
App_led4_exported_functions
UTILITIES_examples » USART_IAP_app_led4_toggle

Functions

void | iap_command_handle (void)
iap command handle handle. More...
void | iap_init (void)
iap init. More...
void | tmr_init (void)
init tmr. More...
void | uart_init (uint32_t baudrate)
init usart. More...
void | back_ok (void)
command response ok. More...
void | back_err (void)
command response error. More...

Detailed Description

Function Documentation

◆ back_err()

void back_err ( void )

command response error.

Parameters
none
Return values
none

Definition at line 120 of file app_led3_toggle/src/usart.c.

◆ back_ok()

void back_ok ( void )

command response ok.

Parameters
none
Return values
none

Definition at line 107 of file app_led3_toggle/src/usart.c.

◆ iap_command_handle()

void iap_command_handle ( void )

iap command handle handle.

Parameters
none
Return values
none

Definition at line 44 of file app_led3_toggle/src/iap.c.

◆ iap_init()

void iap_init ( void )

iap init.

Parameters
none
Return values
none

iap init.

Parameters
none
Return values
none

Definition at line 61 of file app_led3_toggle/src/iap.c.

◆ tmr_init()

void tmr_init ( void )

init tmr.

Parameters
none
Return values
none

Definition at line 44 of file app_led3_toggle/src/tmr.c.

◆ uart_init()

void uart_init ( uint32_t baudrate )

init usart.

Parameters
none
Return values
none

Definition at line 45 of file app_led3_toggle/src/usart.c.


AT32F415 Firmwary Library: USART_IAP_bootloader

Modules | Functions | Variables
USART_IAP_bootloader
UTILITIES_examples

Modules

Bootloader_definition
Bootloader_exported_functions
Bootloader_exported_types

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | flash_2kb_write (uint32_t write_addr, uint8_t *pbuffer)
flash erase/program operation. More...
flag_status | flash_upgrade_flag_read (void)
check flash upgrade flag. More...
void | app_load (uint32_t app_addr)
app load. More...
uint8_t | data_take (void)
take data from usart buf. More...
void | command_handle (void)
command analysis handle. More...
void | back_ok (void)
command response ok. More...
void | back_err (void)
command response error. More...
void | app_update_handle (void)
app update flow handle. More...
void | iap_upgrade_app_handle (void)
iap upgrade app handle. More...
int | main (void)
main function. More...
void | tmr_init (void)
init tmr. More...
void | TMR3_GLOBAL_IRQHandler (void)
tmr3 global interrupt handler. More...
void | uart_init (uint32_t baudrate)
init usart. More...
void | USART1_IRQHandler (void)
usart1 interrupt handler. More...

Variables

cmd_data_group_type cmd_data_group_type_struct
cmd_data_step_type cmd_data_step
cmd_ctr_step_type cmd_ctr_step
update_status_type update_status
usart_group_type usart_group_struct
cmd_data_step_type cmd_data_step = CMD_DATA_IDLE
cmd_ctr_step_type cmd_ctr_step = CMD_CTR_IDLE
cmd_data_group_type cmd_data_group_struct
update_status_type update_status = UPDATE_PRE
static uint8_t | cmd_addr_cnt = 0
static uint32_t | cmd_data_cnt = 0
uint8_t | time_ira_cnt =0
uint8_t | get_data_from_usart_flag = 0
usart_group_type usart_group_struct

Detailed Description

Function Documentation

◆ app_load()

void app_load ( uint32_t app_addr )

app load.

Parameters
app_addr app code starting address
Return values
none

Definition at line 60 of file bootloader/src/iap.c.

Referenced by app_update_handle(), and main().

◆ app_update_handle()

void app_update_handle ( void )

app update flow handle.

Parameters
none
Return values
none

Definition at line 262 of file bootloader/src/iap.c.

Referenced by iap_upgrade_app_handle().

◆ back_err()

void back_err ( void )

command response error.

Parameters
none
Return values
none

Definition at line 241 of file bootloader/src/iap.c.

Referenced by app_update_handle(), and TMR3_GLOBAL_IRQHandler().

◆ back_ok()

void back_ok ( void )

command response ok.

Parameters
none
Return values
none

Definition at line 228 of file bootloader/src/iap.c.

Referenced by app_update_handle(), and main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ command_handle()

void command_handle ( void )

command analysis handle.

Parameters
none
Return values
none

Definition at line 106 of file bootloader/src/iap.c.

Referenced by iap_upgrade_app_handle().

◆ data_take()

uint8_t data_take ( void )

take data from usart buf.

Parameters
app_addr app code starting address
Return values
val took data

Definition at line 89 of file bootloader/src/iap.c.

Referenced by command_handle().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ flash_2kb_write()

void flash_2kb_write | ( | uint32_t | write_addr,
 |  | uint8_t * | pbuffer
 | ) |  |

flash erase/program operation.

Note
follow 2kb operation of ont time
Parameters
none
Return values
none

Definition at line 45 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c.

Referenced by app_update_handle().

◆ flash_upgrade_flag_read()

flag_status flash_upgrade_flag_read ( void )

check flash upgrade flag.

Parameters
none
Return values
none

Definition at line 66 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c.

Referenced by main().

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ iap_upgrade_app_handle()

void iap_upgrade_app_handle ( void )

iap upgrade app handle.

Parameters
none
Return values
none

Definition at line 344 of file bootloader/src/iap.c.

Referenced by main().

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 47 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ TMR3_GLOBAL_IRQHandler()

void TMR3_GLOBAL_IRQHandler ( void )

tmr3 global interrupt handler.

Parameters
none
Return values
none

Definition at line 75 of file bootloader/src/tmr.c.

◆ tmr_init()

void tmr_init ( void )

init tmr.

Parameters
none
Return values
none

Definition at line 47 of file bootloader/src/tmr.c.

Referenced by main().

◆ uart_init()

void uart_init ( uint32_t baudrate )

init usart.

Parameters
none
Return values
none

Definition at line 45 of file bootloader/src/usart.c.

Referenced by main().

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ USART1_IRQHandler()

void USART1_IRQHandler ( void )

usart1 interrupt handler.

Parameters
none
Return values
none

Definition at line 87 of file bootloader/src/usart.c.

Variable Documentation

◆ cmd_addr_cnt

uint8_t cmd_addr_cnt = 0
static

Definition at line 44 of file bootloader/src/iap.c.

Referenced by back_err(), and command_handle().

◆ cmd_ctr_step [1/2]

cmd_ctr_step_type cmd_ctr_step
extern

Definition at line 41 of file bootloader/src/iap.c.

Referenced by app_update_handle(), back_err(), and command_handle().

◆ cmd_ctr_step [2/2]

cmd_ctr_step_type cmd_ctr_step = CMD_CTR_IDLE

Definition at line 41 of file bootloader/src/iap.c.

Referenced by app_update_handle(), back_err(), and command_handle().

◆ cmd_data_cnt

uint32_t cmd_data_cnt = 0
static

Definition at line 45 of file bootloader/src/iap.c.

Referenced by back_err(), and command_handle().

◆ cmd_data_group_struct

cmd_data_group_type cmd_data_group_struct

Definition at line 42 of file bootloader/src/iap.c.

Referenced by app_update_handle(), and command_handle().

◆ cmd_data_group_type_struct

cmd_data_group_type cmd_data_group_type_struct
extern

◆ cmd_data_step [1/2]

cmd_data_step_type cmd_data_step
extern

Definition at line 40 of file bootloader/src/iap.c.

Referenced by app_update_handle(), back_err(), and command_handle().

◆ cmd_data_step [2/2]

cmd_data_step_type cmd_data_step = CMD_DATA_IDLE

Definition at line 40 of file bootloader/src/iap.c.

Referenced by app_update_handle(), back_err(), and command_handle().

◆ get_data_from_usart_flag

uint8_t get_data_from_usart_flag = 0

Definition at line 40 of file bootloader/src/tmr.c.

Referenced by app_update_handle(), back_err(), and TMR3_GLOBAL_IRQHandler().

◆ time_ira_cnt

uint8_t time_ira_cnt =0

Definition at line 39 of file bootloader/src/tmr.c.

Referenced by back_err(), TMR3_GLOBAL_IRQHandler(), and USART1_IRQHandler().

◆ update_status [1/2]

update_status_type update_status
extern

Definition at line 43 of file bootloader/src/iap.c.

Referenced by app_update_handle(), back_err(), and command_handle().

◆ update_status [2/2]

update_status_type update_status = UPDATE_PRE

Definition at line 43 of file bootloader/src/iap.c.

Referenced by app_update_handle(), back_err(), and command_handle().

◆ usart_group_struct [1/2]

usart_group_type usart_group_struct
extern

Definition at line 38 of file bootloader/src/usart.c.

Referenced by command_handle(), data_take(), and USART1_IRQHandler().

◆ usart_group_struct [2/2]

usart_group_type usart_group_struct

Definition at line 38 of file bootloader/src/usart.c.

Referenced by command_handle(), data_take(), and USART1_IRQHandler().


AT32F415 Firmwary Library: Bootloader_definition

Macros
Bootloader_definition
UTILITIES_examples » USART_IAP_bootloader | UTILITIES_examples » USB_IAP_bootloader

Macros

#define | FLASH_SIZE (*((uint32_t*)0x1FFFF7E0)) /* read from at32 flash capacity register(unit:kbyte) */
#define | SRAM_SIZE 224 /* sram size, unit:kbyte */
#define | APP_START_ADDR 0x08004000
#define | IAP_UPGRADE_FLAG_ADDR (APP_START_ADDR - 0x800)
#define | IAP_UPGRADE_FLAG 0x41544B38
#define | USART_REC_LEN 1024
#define | FLASH_APP_ADDRESS 0x08005000

Detailed Description

Macro Definition Documentation

◆ APP_START_ADDR

#define APP_START_ADDR 0x08004000

Definition at line 49 of file bootloader/inc/iap.h.

◆ FLASH_APP_ADDRESS

#define FLASH_APP_ADDRESS 0x08005000

Definition at line 49 of file bootloader/inc/hid_iap_user.h.

◆ FLASH_SIZE

#define FLASH_SIZE (*((uint32_t*)0x1FFFF7E0)) /* read from at32 flash capacity register(unit:kbyte) */

Definition at line 48 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h.

◆ IAP_UPGRADE_FLAG

#define IAP_UPGRADE_FLAG 0x41544B38

Definition at line 56 of file bootloader/inc/iap.h.

◆ IAP_UPGRADE_FLAG_ADDR

#define IAP_UPGRADE_FLAG_ADDR (APP_START_ADDR - 0x800)

Definition at line 52 of file bootloader/inc/iap.h.

◆ SRAM_SIZE

#define SRAM_SIZE 224 /* sram size, unit:kbyte */

Definition at line 49 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h.

◆ USART_REC_LEN

#define USART_REC_LEN 1024

Definition at line 48 of file bootloader/inc/usart.h.


AT32F415 Firmwary Library: Bootloader_exported_functions

Functions
Bootloader_exported_functions
UTILITIES_examples » USART_IAP_bootloader | UTILITIES_examples » USB_IAP_bootloader

Functions

void | flash_2kb_write (uint32_t write_addr, uint8_t *pbuffer)
flash erase/program operation. More...
flag_status | flash_upgrade_flag_read (void)
check flash upgrade flag. More...
void | command_handle (void)
command analysis handle. More...
void | back_err (void)
command response error. More...
void | back_ok (void)
command response ok. More...
void | iap_upgrade_app_handle (void)
iap upgrade app handle. More...
void | app_load (uint32_t appxaddr)
app load. More...
void | tmr_init (void)
init tmr. More...
void | uart_init (uint32_t baudrate)
init usart. More...
void | iap_init (void)
iap init. More...
iap_result_type | iap_get_upgrade_flag (void)
get iap upgrade complete flag More...
void | iap_loop (void)
iap loop More...
void | jump_to_app (uint32_t address)
jump to app More...

Detailed Description

Function Documentation

◆ app_load()

void app_load ( uint32_t app_addr )

app load.

Parameters
app_addr app code starting address
Return values
none

Definition at line 60 of file bootloader/src/iap.c.

Referenced by app_update_handle(), and main().

◆ back_err()

void back_err ( void )

command response error.

Parameters
none
Return values
none

Definition at line 120 of file app_led3_toggle/src/usart.c.

Referenced by app_update_handle().

◆ back_ok()

void back_ok ( void )

command response ok.

Parameters
none
Return values
none

Definition at line 107 of file app_led3_toggle/src/usart.c.

Referenced by app_update_handle().

◆ command_handle()

void command_handle ( void )

command analysis handle.

Parameters
none
Return values
none

Definition at line 106 of file bootloader/src/iap.c.

Referenced by iap_upgrade_app_handle().

◆ flash_2kb_write()

void flash_2kb_write | ( | uint32_t | write_addr,
 |  | uint8_t * | pbuffer
 | ) |  |

flash erase/program operation.

Note
follow 2kb operation of ont time
Parameters
none
Return values
none

Definition at line 45 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c.

Referenced by app_update_handle().

◆ flash_upgrade_flag_read()

flag_status flash_upgrade_flag_read ( void )

check flash upgrade flag.

Parameters
none
Return values
none

Definition at line 66 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c.

Referenced by main().

◆ iap_get_upgrade_flag()

iap_result_type iap_get_upgrade_flag ( void )

get iap upgrade complete flag

Parameters
none
Return values
the status of the iap flag

Definition at line 79 of file app_led3_toggle/src/hid_iap_user.c.

◆ iap_init()

void iap_init ( void )

iap init.

Parameters
none
Return values
none

iap init.

Parameters
none
Return values
none

Definition at line 61 of file app_led3_toggle/src/iap.c.

Referenced by iap_idle(), and iap_start().

◆ iap_loop()

void iap_loop ( void )

iap loop

Parameters
none
Return values
none

Definition at line 476 of file bootloader/src/hid_iap_user.c.

Referenced by main().

◆ iap_upgrade_app_handle()

void iap_upgrade_app_handle ( void )

iap upgrade app handle.

Parameters
none
Return values
none

Definition at line 344 of file bootloader/src/iap.c.

Referenced by main().

◆ jump_to_app()

void jump_to_app ( uint32_t address )

jump to app

Parameters
none
Return values
none
Parameters
none
Return values
none

Definition at line 290 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.

Referenced by flash_fat16_loop_status(), iap_loop(), and main().

◆ tmr_init()

void tmr_init ( void )

init tmr.

Parameters
none
Return values
none

Definition at line 44 of file app_led3_toggle/src/tmr.c.

◆ uart_init()

void uart_init ( uint32_t baudrate )

init usart.

Parameters
none
Return values
none

Definition at line 45 of file app_led3_toggle/src/usart.c.


AT32F415 Firmwary Library: Bootloader_exported_types

Data Structures | Typedefs | Enumerations
Bootloader_exported_types
UTILITIES_examples » USART_IAP_bootloader

Data Structures

struct | cmd_data_group_type
cmd data group type More...
struct | usart_group_type
usart group type More...

Typedefs

typedef void(* iapfun) (void)

Enumerations

enum cmd_data_step_type {
CMD_DATA_IDLE , CMD_DATA_ADDR , CMD_DATA_BUF , CMD_DATA_CHACK ,
CMD_DATA_DONE , CMD_DATA_ERR
}
cmd data step type More...
enum cmd_ctr_step_type {
CMD_CTR_IDLE , CMD_CTR_INIT , CMD_CTR_DONE , CMD_CTR_ERR ,
CMD_CTR_APP
}
cmd ctr step type More...
enum update_status_type { UPDATE_PRE , UPDATE_CLEAR_FLAG , UPDATE_ING , UPDATE_DONE }
update status type More...

Detailed Description

Typedef Documentation

◆ iapfun

typedef void(* iapfun) (void)

Definition at line 113 of file bootloader/inc/iap.h.

Enumeration Type Documentation

◆ cmd_ctr_step_type

enum cmd_ctr_step_type

cmd ctr step type

Enumerator
CMD_CTR_IDLE
CMD_CTR_INIT
CMD_CTR_DONE
CMD_CTR_ERR
CMD_CTR_APP

Definition at line 93 of file bootloader/inc/iap.h.

◆ cmd_data_step_type

enum cmd_data_step_type

cmd data step type

Enumerator
CMD_DATA_IDLE
CMD_DATA_ADDR
CMD_DATA_BUF
CMD_DATA_CHACK
CMD_DATA_DONE
CMD_DATA_ERR

Definition at line 80 of file bootloader/inc/iap.h.

◆ update_status_type

enum update_status_type

update status type

Enumerator
UPDATE_PRE
UPDATE_CLEAR_FLAG
UPDATE_ING
UPDATE_DONE

Definition at line 105 of file bootloader/inc/iap.h.


AT32F415 Firmwary Library: cmd_data_group_type Struct Reference

Data Fields
cmd_data_group_type Struct Reference
UTILITIES_examples » USART_IAP_bootloader » Bootloader_exported_types

cmd data group type More...

#include <iap.h>

Data Fields

uint8_t | cmd_head
uint8_t | cmd_addr [4]
uint8_t | cmd_buf [0x800]
uint8_t | cmd_check

Detailed Description

cmd data group type

Definition at line 69 of file bootloader/inc/iap.h.

Field Documentation

◆ cmd_addr

uint8_t cmd_data_group_type::cmd_addr[4]

Definition at line 72 of file bootloader/inc/iap.h.

Referenced by app_update_handle(), and command_handle().

◆ cmd_buf

uint8_t cmd_data_group_type::cmd_buf[0x800]

Definition at line 73 of file bootloader/inc/iap.h.

Referenced by app_update_handle(), and command_handle().

◆ cmd_check

uint8_t cmd_data_group_type::cmd_check

Definition at line 74 of file bootloader/inc/iap.h.

◆ cmd_head

uint8_t cmd_data_group_type::cmd_head

Definition at line 71 of file bootloader/inc/iap.h.

The documentation for this struct was generated from the following file:
  • bootloader/inc/iap.h


AT32F415 Firmwary Library: usart_group_type Struct Reference

Data Fields
usart_group_type Struct Reference
UTILITIES_examples » USART_IAP_bootloader » Bootloader_exported_types

usart group type More...

#include <usart.h>

Data Fields

uint16_t | buf [1024]
uint16_t | head
uint16_t | tail
uint16_t | count

Detailed Description

usart group type

Definition at line 61 of file bootloader/inc/usart.h.

Field Documentation

◆ buf

uint16_t usart_group_type::buf[1024]

Definition at line 63 of file bootloader/inc/usart.h.

Referenced by data_take(), and USART1_IRQHandler().

◆ count

uint16_t usart_group_type::count

Definition at line 66 of file bootloader/inc/usart.h.

Referenced by command_handle(), data_take(), and USART1_IRQHandler().

◆ head

uint16_t usart_group_type::head

Definition at line 64 of file bootloader/inc/usart.h.

Referenced by USART1_IRQHandler().

◆ tail

uint16_t usart_group_type::tail

Definition at line 65 of file bootloader/inc/usart.h.

Referenced by data_take(), and USART1_IRQHandler().

The documentation for this struct was generated from the following file:
  • bootloader/inc/usart.h


AT32F415 Firmwary Library: USB_IAP_app_led3_toggle

Modules | Functions | Variables
USB_IAP_app_led3_toggle
UTILITIES_examples

Modules

App_led3_toggle_definition
App_led3_toggle_exported_functions

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | iap_finish (void)
void | iap_jump (void)
void | iap_respond (uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
iap_result_type | iap_get_upgrade_flag (void)
get iap upgrade complete flag More...
void | iap_init (void)
iap init More...
void | iap_get ()
iap_result_type | usbd_hid_iap_process (void *udev, uint8_t *pdata, uint16_t len)
usb device iap function More...
void | usbd_hid_iap_in_complete (void *udev)
usb device in transfer complete function More...
void | app_loop (void)
iap loop More...
void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

void(* pftarget )(void)
otg_core_type otg_core_struct

Detailed Description

Function Documentation

◆ app_loop()

void app_loop ( void )

iap loop

Parameters
none
Return values
none

Definition at line 253 of file app_led3_toggle/src/hid_iap_user.c.

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ iap_finish()

void iap_finish ( void )

Definition at line 318 of file bootloader/src/hid_iap_user.c.

◆ iap_get()

void iap_get ( )

Definition at line 159 of file app_led3_toggle/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ iap_get_upgrade_flag()

iap_result_type iap_get_upgrade_flag ( void )

get iap upgrade complete flag

Parameters
none
Return values
the status of the iap flag

Definition at line 79 of file app_led3_toggle/src/hid_iap_user.c.

◆ iap_init()

void iap_init ( void )

iap init

iap init.

Parameters
none
Return values
none

Definition at line 97 of file app_led3_toggle/src/hid_iap_user.c.

Referenced by iap_idle(), and iap_start().

◆ iap_jump()

void iap_jump ( void )

Definition at line 148 of file app_led3_toggle/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ iap_respond()

void iap_respond | ( | uint8_t * | res_buf,
 |  | uint16_t | iap_cmd,
 |  | uint16_t | result
 | ) |  |

Definition at line 177 of file app_led3_toggle/src/hid_iap_user.c.

Referenced by iap_get(), iap_idle(), iap_jump(), and iap_start().

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< nvic vector table based flash address

Definition at line 55 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 211 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 104 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb delay millisecond function.

usb endpoint max num define

Parameters
ms number of millisecond delay
Return values
none

Definition at line 221 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 232 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 144 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

◆ usbd_hid_iap_in_complete()

void usbd_hid_iap_in_complete ( void * udev )

usb device in transfer complete function

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 240 of file app_led3_toggle/src/hid_iap_user.c.

◆ usbd_hid_iap_process()

iap_result_type usbd_hid_iap_process | ( | void * | udev,
 |  | uint8_t * | pdata,
 |  | uint16_t | len
 | ) |  |

usb device iap function

Parameters
udev | to the structure of usbd_core_type
pdata | data buffer point
len | data length
Return values
iap_result_type

Definition at line 194 of file app_led3_toggle/src/hid_iap_user.c.

Variable Documentation

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 45 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c.

Referenced by main(), and OTG_IRQ_HANDLER().

◆ pftarget

void(* pftarget) (void) ( void )

Definition at line 39 of file app_led3_toggle/src/hid_iap_user.c.


AT32F415 Firmwary Library: App_led3_toggle_definition

Macros
App_led3_toggle_definition
UTILITIES_examples » USB_IAP_app_led3_toggle

Macros

#define FLASH_APP_ADDRESS 0x08005000

Detailed Description

Macro Definition Documentation

◆ FLASH_APP_ADDRESS

#define FLASH_APP_ADDRESS 0x08005000

Definition at line 49 of file app_led3_toggle/inc/hid_iap_user.h.


AT32F415 Firmwary Library: App_led3_toggle_exported_functions

Functions
App_led3_toggle_exported_functions
UTILITIES_examples » USB_IAP_app_led3_toggle

Functions

void | iap_init (void)
iap init. More...
iap_result_type | iap_get_upgrade_flag (void)
get iap upgrade complete flag More...
void | app_loop (void)
iap loop More...

Detailed Description

Function Documentation

◆ app_loop()

void app_loop ( void )

iap loop

Parameters
none
Return values
none

Definition at line 253 of file app_led3_toggle/src/hid_iap_user.c.

Referenced by main().

◆ iap_get_upgrade_flag()

iap_result_type iap_get_upgrade_flag ( void )

get iap upgrade complete flag

Parameters
none
Return values
the status of the iap flag

Definition at line 79 of file app_led3_toggle/src/hid_iap_user.c.

Referenced by main().

◆ iap_init()

void iap_init ( void )

iap init.

Parameters
none
Return values
none

iap init.

Parameters
none
Return values
none

Definition at line 61 of file app_led3_toggle/src/iap.c.


AT32F415 Firmwary Library: USB_IAP_app_led4_toggle

Modules | Functions | Variables
USB_IAP_app_led4_toggle
UTILITIES_examples

Modules

App_led4_toggle_definition
App_led4_toggle_exported_functions

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | iap_clear_upgrade_flag (void)
clear iap upgrade flag More...
void | iap_set_upgrade_flag (void)
set iap upgrade complete flag More...
uint32_t | crc_cal (uint32_t addr, uint16_t nk)
crc cal More...
void | iap_idle (void)
iap idle function More...
void | iap_start (void)
iap start function More...
void | iap_finish (void)
void | iap_jump (void)
void | iap_respond (uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
iap_result_type | iap_get_upgrade_flag (void)
get iap upgrade complete flag More...
void | iap_init (void)
iap init More...
void | iap_get ()
iap_result_type | usbd_hid_iap_process (void *udev, uint8_t *pdata, uint16_t len)
usb device iap function More...
void | usbd_hid_iap_in_complete (void *udev)
usb device in transfer complete function More...
void | app_loop (void)
iap loop More...
void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

void(* pftarget )(void)
otg_core_type otg_core_struct

Detailed Description

Function Documentation

◆ app_loop()

void app_loop ( void )

iap loop

Parameters
none
Return values
none

Definition at line 253 of file app_led4_toggle/src/hid_iap_user.c.

Referenced by main().

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ crc_cal()

uint32_t crc_cal | ( | uint32_t | addr,
 |  | uint16_t | nk
 | ) |  |

crc cal

Parameters
addr | start address
nk | nk byte
Return values
crc value

Definition at line 157 of file bootloader/src/hid_iap_user.c.

Referenced by iap_crc().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ iap_clear_upgrade_flag()

void iap_clear_upgrade_flag ( void )

clear iap upgrade flag

Parameters
none
Return values
none

Definition at line 55 of file app_led4_toggle/src/hid_iap_user.c.

Referenced by app_loop().

◆ iap_finish()

void iap_finish ( void )

Definition at line 318 of file bootloader/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ iap_get()

void iap_get ( )

Definition at line 159 of file app_led4_toggle/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ iap_get_upgrade_flag()

iap_result_type iap_get_upgrade_flag ( void )

get iap upgrade complete flag

Parameters
none
Return values
the status of the iap flag

Definition at line 79 of file app_led4_toggle/src/hid_iap_user.c.

◆ iap_idle()

void iap_idle ( void )

iap idle function

Parameters
none
Return values
none

Definition at line 124 of file app_led4_toggle/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ iap_init()

void iap_init ( void )

iap init

iap init.

Parameters
none
Return values
none

Definition at line 97 of file app_led4_toggle/src/hid_iap_user.c.

Referenced by iap_idle(), and iap_start().

◆ iap_jump()

void iap_jump ( void )

Definition at line 148 of file app_led4_toggle/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ iap_respond()

void iap_respond | ( | uint8_t * | res_buf,
 |  | uint16_t | iap_cmd,
 |  | uint16_t | result
 | ) |  |

Definition at line 177 of file app_led4_toggle/src/hid_iap_user.c.

Referenced by iap_get(), iap_idle(), iap_jump(), and iap_start().

◆ iap_set_upgrade_flag()

void iap_set_upgrade_flag ( void )

set iap upgrade complete flag

Parameters
none
Return values
none

Definition at line 67 of file app_led4_toggle/src/hid_iap_user.c.

◆ iap_start()

void iap_start ( void )

iap start function

Parameters
none
Return values
none

Definition at line 136 of file app_led4_toggle/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

< nvic vector table based flash address

Definition at line 55 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 210 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 104 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb delay millisecond function.

usb endpoint max num define

Parameters
ms number of millisecond delay
Return values
none

Definition at line 220 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 231 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 144 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

◆ usbd_hid_iap_in_complete()

void usbd_hid_iap_in_complete ( void * udev )

usb device in transfer complete function

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 240 of file app_led4_toggle/src/hid_iap_user.c.

◆ usbd_hid_iap_process()

iap_result_type usbd_hid_iap_process | ( | void * | udev,
 |  | uint8_t * | pdata,
 |  | uint16_t | len
 | ) |  |

usb device iap function

Parameters
udev | to the structure of usbd_core_type
pdata | data buffer point
len | data length
Return values
iap_result_type

Definition at line 194 of file app_led4_toggle/src/hid_iap_user.c.

Variable Documentation

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 45 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c.

Referenced by main(), and OTG_IRQ_HANDLER().

◆ pftarget

void(* pftarget) (void) ( void )

Definition at line 39 of file app_led4_toggle/src/hid_iap_user.c.


AT32F415 Firmwary Library: App_led4_toggle_definition

Macros
App_led4_toggle_definition
UTILITIES_examples » USB_IAP_app_led4_toggle

Macros

#define FLASH_APP_ADDRESS 0x08005000

Detailed Description

Macro Definition Documentation

◆ FLASH_APP_ADDRESS

#define FLASH_APP_ADDRESS 0x08005000

Definition at line 49 of file app_led4_toggle/inc/hid_iap_user.h.


AT32F415 Firmwary Library: App_led4_toggle_exported_functions

Functions
App_led4_toggle_exported_functions
UTILITIES_examples » USB_IAP_app_led4_toggle

Functions

void | iap_init (void)
iap init. More...
iap_result_type | iap_get_upgrade_flag (void)
get iap upgrade complete flag More...
void | app_loop (void)
iap loop More...

Detailed Description

Function Documentation

◆ app_loop()

void app_loop ( void )

iap loop

Parameters
none
Return values
none

Definition at line 253 of file app_led3_toggle/src/hid_iap_user.c.

◆ iap_get_upgrade_flag()

iap_result_type iap_get_upgrade_flag ( void )

get iap upgrade complete flag

Parameters
none
Return values
the status of the iap flag

Definition at line 79 of file app_led3_toggle/src/hid_iap_user.c.

◆ iap_init()

void iap_init ( void )

iap init.

Parameters
none
Return values
none

iap init.

Parameters
none
Return values
none

Definition at line 61 of file app_led3_toggle/src/iap.c.


AT32F415 Firmwary Library: USB_IAP_bootloader

Modules | Functions | Variables
USB_IAP_bootloader
UTILITIES_examples

Modules

Bootloader_definition
Bootloader_exported_functions

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | iap_clear_upgrade_flag (void)
clear iap upgrade flag More...
void | iap_set_upgrade_flag (void)
set iap upgrade complete flag More...
uint32_t | crc_cal (uint32_t addr, uint16_t nk)
crc cal More...
void | iap_idle (void)
iap idle function More...
void | iap_start (void)
iap start function More...
iap_result_type | iap_address (uint8_t *pdata, uint32_t len)
iap parse address More...
void | iap_finish (void)
iap_result_type | iap_data_write (uint8_t *pdata, uint32_t len)
void | iap_jump (void)
void | iap_respond (uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
void | jump_to_app (uint32_t address)
jump to app More...
iap_result_type | iap_get_upgrade_flag (void)
get iap upgrade complete flag More...
void | iap_erase_sector (uint32_t address)
set iap upgrade complete flag More...
void | iap_init (void)
iap init More...
void | iap_crc (uint8_t *pdata, uint32_t len)
void | iap_get ()
iap_result_type | usbd_hid_iap_process (void *udev, uint8_t *pdata, uint16_t len)
usb device iap function More...
void | usbd_hid_iap_in_complete (void *udev)
usb device in transfer complete function More...
void | iap_loop (void)
iap loop More...
void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

void(* pftarget )(void)
otg_core_type otg_core_struct

Detailed Description

Function Documentation

◆ BusFault_Handler()

void BusFault_Handler ( void )

this function handles bus fault exception.

Parameters
none
Return values
none

Definition at line 78 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ crc_cal()

uint32_t crc_cal | ( | uint32_t | addr,
 |  | uint16_t | nk
 | ) |  |

crc cal

Parameters
addr | start address
nk | nk byte
Return values
crc value

Definition at line 157 of file bootloader/src/hid_iap_user.c.

Referenced by iap_crc().

◆ DebugMon_Handler()

void DebugMon_Handler ( void )

this function handles debug monitor exception.

Parameters
none
Return values
none

Definition at line 113 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ HardFault_Handler()

void HardFault_Handler ( void )

this function handles hard fault exception.

Parameters
none
Return values
none

Definition at line 52 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ iap_address()

iap_result_type iap_address | ( | uint8_t * | pdata,
 |  | uint32_t | len
 | ) |  |

iap parse address

Parameters
pdata | data buffer pointer.
len | data length
Return values
the result of the address parse

Definition at line 232 of file bootloader/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ iap_clear_upgrade_flag()

void iap_clear_upgrade_flag ( void )

clear iap upgrade flag

Parameters
none
Return values
none

Definition at line 84 of file bootloader/src/hid_iap_user.c.

Referenced by iap_address().

◆ iap_crc()

void iap_crc | ( | uint8_t * | pdata,
 |  | uint32_t | len
 | ) |  |

Definition at line 331 of file bootloader/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ iap_data_write()

iap_result_type iap_data_write | ( | uint8_t * | pdata,
 |  | uint32_t | len
 | ) |  |

Definition at line 273 of file bootloader/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ iap_erase_sector()

void iap_erase_sector ( uint32_t address )

set iap upgrade complete flag

Parameters
none
Return values
none

Definition at line 126 of file bootloader/src/hid_iap_user.c.

Referenced by iap_address().

◆ iap_finish()

void iap_finish ( void )

Definition at line 318 of file bootloader/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ iap_get()

void iap_get ( )

Definition at line 370 of file bootloader/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ iap_get_upgrade_flag()

iap_result_type iap_get_upgrade_flag ( void )

get iap upgrade complete flag

Parameters
none
Return values
the status of the iap flag

Definition at line 108 of file bootloader/src/hid_iap_user.c.

Referenced by main().

◆ iap_idle()

void iap_idle ( void )

iap idle function

Parameters
none
Return values
none

Definition at line 207 of file bootloader/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ iap_init()

void iap_init ( void )

iap init

iap init.

Parameters
none
Return values
none

Definition at line 180 of file bootloader/src/hid_iap_user.c.

Referenced by iap_idle(), iap_start(), and main().

◆ iap_jump()

void iap_jump ( void )

Definition at line 359 of file bootloader/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ iap_loop()

void iap_loop ( void )

iap loop

Parameters
none
Return values
none

Definition at line 476 of file bootloader/src/hid_iap_user.c.

Referenced by main().

◆ iap_respond()

void iap_respond | ( | uint8_t * | res_buf,
 |  | uint16_t | iap_cmd,
 |  | uint16_t | result
 | ) |  |

Definition at line 388 of file bootloader/src/hid_iap_user.c.

Referenced by iap_address(), iap_crc(), iap_data_write(), iap_finish(), iap_get(), iap_idle(), iap_jump(), and iap_start().

◆ iap_set_upgrade_flag()

void iap_set_upgrade_flag ( void )

set iap upgrade complete flag

Parameters
none
Return values
none

Definition at line 96 of file bootloader/src/hid_iap_user.c.

Referenced by iap_finish().

◆ iap_start()

void iap_start ( void )

iap start function

Parameters
none
Return values
none

Definition at line 219 of file bootloader/src/hid_iap_user.c.

Referenced by usbd_hid_iap_process().

◆ jump_to_app()

void jump_to_app ( uint32_t address )

jump to app

Parameters
none
Return values
none

Definition at line 57 of file bootloader/src/hid_iap_user.c.

Referenced by iap_loop().

◆ main()

int main ( void )

main function.

Parameters
none
Return values
none

Definition at line 55 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c.

◆ MemManage_Handler()

void MemManage_Handler ( void )

this function handles memory manage exception.

Parameters
none
Return values
none

Definition at line 65 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ NMI_Handler()

void NMI_Handler ( void )

this function handles nmi exception.

Parameters
none
Return values
none

Definition at line 43 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ OTG_IRQ_HANDLER()

void OTG_IRQ_HANDLER ( void )

this function handles otgfs interrupt.

Parameters
none
Return values
none

Definition at line 214 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c.

◆ PendSV_Handler()

void PendSV_Handler ( void )

this function handles pendsv_handler exception.

Parameters
none
Return values
none

Definition at line 122 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ SVC_Handler()

void SVC_Handler ( void )

this function handles svcall exception.

Parameters
none
Return values
none

Definition at line 104 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ SysTick_Handler()

void SysTick_Handler ( void )

this function handles systick handler.

Parameters
none
Return values
none

Definition at line 131 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ UsageFault_Handler()

void UsageFault_Handler ( void )

this function handles usage fault exception.

Parameters
none
Return values
none

Definition at line 91 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c.

◆ usb_clock48m_select()

void usb_clock48m_select ( usb_clk48_s clk_s )

usb 48M clock select

Parameters
clk_s:USB_CLK_HICK,USB_CLK_HEXT
Return values
none

Definition at line 106 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c.

Referenced by main().

◆ usb_delay_ms()

void usb_delay_ms ( uint32_t ms )

usb delay millisecond function.

usb endpoint max num define

Parameters
ms number of millisecond delay
Return values
none

Definition at line 224 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c.

◆ usb_delay_us()

void usb_delay_us ( uint32_t us )

usb delay microsecond function.

Parameters
us number of microsecond delay
Return values
none

Definition at line 235 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c.

◆ usb_gpio_config()

void usb_gpio_config ( void )

this function config gpio.

Parameters
none
Return values
none

Definition at line 146 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c.

Referenced by main().

◆ usb_low_power_wakeup_config()

void usb_low_power_wakeup_config ( void )

Referenced by main().

◆ usbd_hid_iap_in_complete()

void usbd_hid_iap_in_complete ( void * udev )

usb device in transfer complete function

Parameters
udev to the structure of usbd_core_type
Return values
none

Definition at line 463 of file bootloader/src/hid_iap_user.c.

Referenced by class_in_handler().

◆ usbd_hid_iap_process()

iap_result_type usbd_hid_iap_process | ( | void * | udev,
 |  | uint8_t * | pdata,
 |  | uint16_t | len
 | ) |  |

usb device iap function

Parameters
udev | to the structure of usbd_core_type
pdata | data buffer point
len | data length
Return values
iap_result_type

Definition at line 405 of file bootloader/src/hid_iap_user.c.

Referenced by class_out_handler().

Variable Documentation

◆ otg_core_struct

otg_core_type otg_core_struct

Definition at line 45 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c.

Referenced by disk_ioctl(), disk_read(), disk_status(), disk_write(), main(), and OTG_IRQ_HANDLER().

◆ pftarget

void(* pftarget) (void) ( void )

Definition at line 39 of file bootloader/src/hid_iap_user.c.

Referenced by jump_to_app().


AT32F415 Firmwary Library: Data Structures

Data Structures
Here are the data structures with brief descriptions:
C adc_base_config_type | Adc base config type
C adc_type | Type define adc register all
C audio_codec_type |
C can_base_type | Can init structure definition
C can_baudrate_type | Can baudrate structure definition
C can_fifo_mailbox_type | Can controller area network fifo mailbox
C can_filter_init_type | Can filter init structure definition
C can_filter_register_type | Can controller area network filter bit register
C can_rx_message_type | Can rx message structure definition
C can_tx_mailbox_type | Can controller area network tx mailbox
C can_tx_message_type | Can tx message structure definition
C can_type | Type define can register all
C cbd_extended_type | Extended command block description
C cbd_typical_type | Typical command block description
C cbw_type | Command block wrapper
C cmd_data_group_type | Cmd data group type
C cmp_init_type | Cmp init type
C cmp_type | Type define cmp register all
C crc_type | Type define crc register all
C crm_clocks_freq_type | Crm clocks freqency structure
C crm_type | Type define crm register all
C csw_type | Command block wrapper
C debug_type | Type define debug register all
C dma_channel_type | Type define dma channel register all
C dma_init_type | Dma init type
C dma_type | Type define dma register
C ertc_alarm_value_type | Ertc alarm
C ertc_reg_alarm_type | Ertc alarm reg union
C ertc_reg_date_type | Ertc date reg union
C ertc_reg_scal_type | Ertc scal reg union
C ertc_reg_tadj_type | Ertc tadj reg union
C ertc_reg_time_type | Ertc time reg union
C ertc_reg_tsdt_type | Ertc tsdt register, offset:0x34
C ertc_reg_tstm_type | Ertc tstm reg union
C ertc_time_type | Ertc time
C ertc_type | Type define ertc register all
C exint_init_type | Exint init type
C exint_type | Type define exint register all
C fat_dir_type |
C flash_iap_type |
C flash_type | Type define flash register all
C gpio_init_type | Gpio init type
C gpio_type | Type define gpio register all
C i2c_handle_type |
C i2c_type | Type define i2c register all
C i2s_init_type | I2s init type
C iap_info_type |
C iomux_type | Type define iomux register all
C linecoding_type | Usb cdc class set line coding struct
C msc_bot_cbw_type | Usb msc bulk-only command block wrapper type
C msc_bot_csw_type | Usb msc bulk-only command status wrapper type
C msc_bot_trans_type | Usb msc bulk-only transfer control type
C msc_scsi_data_capacity | Usb msc capacity data type
C msc_scsi_data_inquiry | Usb msc inquiry data type
C msc_type |
C otg_core_type | Usb otg core struct type
C otg_device_type |
C otg_eptin_type |
C otg_eptout_type |
C otg_global_type |
C otg_hchannel_type |
C otg_host_type |
C otg_pcgcctl_type |
C pwc_type | Type define pwc register all
C sc_atr_type |
C sd_card_info_struct_type |
C sd_cid_struct_type |
C sd_csd_struct_type |
C sd_scr_struct_type |
C sdio_command_struct_type | Sdio command structure
C sdio_data_struct_type | Sdio data structure
C sdio_type | Type define sdio register all
C sense_type | Request sense standard data
C spi_init_type | Spi init type
C spi_type | Type define spi register all
C tmr_brkdt_config_type | Tmr brkdt config type
C tmr_input_config_type | Tmr input capture config type
C tmr_output_config_type | Tmr output config type
C tmr_type | Type define tmr register all
C usart_group_type | Usart group type
C usart_type | Type define usart register all
C usb_audio_type | Usb audio control struct
C usb_configuration_desc_type | Format of standard configuration descriptor
C usb_core_cfg | Usb core cofig struct
C usb_device_desc_type | Format of standard device descriptor
C usb_endpoint_desc_type | Format of standard endpoint descriptor
C usb_ept_info | Usb endpoint infomation structure definition
C usb_hch_type | Usb host channel infomation structure definition
C usb_header_desc_type | Format of header
C usb_hid_desc_type | Usb hid descriptor type
C usb_hid_mouse_type | Usb hid mouse type
C usb_interface_desc_type | Format of standard interface descriptor
C usb_setup_type | Format of usb setup data
C usbh_hid_type | Usb hid struct
C usbh_msc_type | Usb msc struct
C usbh_msc_unit_type | Usb msc bank type
C usd_type | User system data
C wdt_type | Type define wdt register all
C wwdt_type | Type define wwdt register all


AT32F415 Firmwary Library: Data Structure Index

Data Structure Index
A | C | D | E | F | G | I | L | M | O | P | S | T | U | W
A
adc_base_config_type
adc_type
audio_codec_type
C
can_base_type
can_baudrate_type
can_fifo_mailbox_type
can_filter_init_type
can_filter_register_type
can_rx_message_type
can_tx_mailbox_type
can_tx_message_type
can_type
cbd_extended_type
cbd_typical_type
cbw_type
cmd_data_group_type
cmp_init_type
cmp_type
crc_type
crm_clocks_freq_type
crm_type
csw_type
D
debug_type
dma_channel_type
dma_init_type
dma_type
E
ertc_alarm_value_type
ertc_reg_alarm_type
ertc_reg_date_type
ertc_reg_scal_type
ertc_reg_tadj_type
ertc_reg_time_type
ertc_reg_tsdt_type
ertc_reg_tstm_type
ertc_time_type
ertc_type
exint_init_type
exint_type
F
fat_dir_type
flash_iap_type
flash_type
G
gpio_init_type
gpio_type
I
i2c_handle_type
i2c_type
i2s_init_type
iap_info_type
iomux_type
L
linecoding_type
M
msc_bot_cbw_type
msc_bot_csw_type
msc_bot_trans_type
msc_scsi_data_capacity
msc_scsi_data_inquiry
msc_type
O
otg_core_type
otg_device_type
otg_eptin_type
otg_eptout_type
otg_global_type
otg_hchannel_type
otg_host_type
otg_pcgcctl_type
P
pwc_type
S
sc_atr_type
sd_card_info_struct_type
sd_cid_struct_type
sd_csd_struct_type
sd_scr_struct_type
sdio_command_struct_type
sdio_data_struct_type
sdio_type
sense_type
spi_init_type
spi_type
T
tmr_brkdt_config_type
tmr_input_config_type
tmr_output_config_type
tmr_type
U
usart_group_type
usart_type
usb_audio_type
usb_configuration_desc_type
usb_core_cfg
usb_device_desc_type
usb_endpoint_desc_type
usb_ept_info
usb_hch_type
usb_header_desc_type
usb_hid_desc_type
usb_hid_mouse_type
usb_interface_desc_type
usb_setup_type
usbh_hid_type
usbh_msc_type
usbh_msc_unit_type
usd_type
W
wdt_type
wwdt_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- a -

  • ack : otg_hchannel_type
  • acken : i2c_type
  • ackfail : i2c_type
  • ackmsk : otg_hchannel_type
  • acs : spi_type
  • adc1_eto_gmux : iomux_type
  • adc1_etp_gmux : iomux_type
  • adc1_extrgord_mux : iomux_type
  • adc1_extrgpre_mux : iomux_type
  • adc1en : crm_type
  • adc1rst : crm_type
  • adc_freq : crm_clocks_freq_type
  • adcal : adc_type
  • adcalinit : adc_type
  • adcdiv_h : crm_type
  • adcdiv_l : crm_type
  • adcen : adc_type
  • add : ertc_reg_scal_type, ertc_type
  • add1h : ertc_type
  • add1s : ertc_reg_tadj_type, ertc_type
  • addr : flash_type, tmr_type
  • addr1 : i2c_type
  • addr1mode : i2c_type
  • addr2 : i2c_type
  • addr2en : i2c_type
  • addr7f : i2c_type
  • addr_bit : flash_type
  • address : cbd_extended_type, cbd_typical_type, usb_hch_type
  • addrhf : i2c_type
  • aebo_enable : can_base_type
  • aeboen : can_type
  • aed_enable : can_base_type
  • aeden : can_type
  • ahb_freq : crm_clocks_freq_type
  • ahbdiv : crm_type
  • ahben : crm_type
  • ahben_bit : crm_type
  • ahbidle : otg_global_type
  • ahbrst : crm_type
  • ahbrst_bit : crm_type
  • ala : ertc_reg_alarm_type, ertc_type
  • ala_bit : ertc_reg_alarm_type, ertc_type
  • alaen : ertc_type
  • alaf : ertc_type
  • alaien : ertc_type
  • alasbs : ertc_type
  • alasbs_bit : ertc_type
  • alawf : ertc_type
  • alb : ertc_type
  • alb_bit : ertc_type
  • alben : ertc_type
  • albf : ertc_type
  • albien : ertc_type
  • albsbs : ertc_type
  • albsbs_bit : ertc_type
  • albwf : ertc_type
  • alertf : i2c_type
  • alloc_length : cbd_extended_type, cbd_typical_type
  • ampm : ertc_alarm_value_type, ertc_reg_alarm_type, ertc_reg_time_type, ertc_reg_tstm_type, ertc_time_type, ertc_type
  • aoen : tmr_type
  • apb1_freq : crm_clocks_freq_type
  • apb1div : crm_type
  • apb1en : crm_type
  • apb1en_bit : crm_type
  • apb1rst : crm_type
  • apb1rst_bit : crm_type
  • apb2_freq : crm_clocks_freq_type
  • apb2div : crm_type
  • apb2en : crm_type
  • apb2en_bit : crm_type
  • apb2rst : crm_type
  • apb2rst_bit : crm_type
  • app_address : iap_info_type
  • argu : sdio_type
  • argu_bit : sdio_type
  • argument : sdio_command_struct_type
  • arlost : i2c_type
  • arpen : i2c_type
  • as_length : sense_type
  • asc : sense_type
  • ascq : sense_type
  • attr : fat_dir_type
  • audio_bitw : audio_codec_type
  • audio_cmd : usb_audio_type
  • audio_cmd_len : usb_audio_type
  • audio_feed_back : usb_audio_type
  • audio_freq : audio_codec_type
  • audio_mic_data : usb_audio_type
  • audio_protocol : i2s_init_type
  • audio_sampling_freq : i2s_init_type
  • audio_spk_data : usb_audio_type
  • auto_output_enable : tmr_brkdt_config_type
  • auto_step_en : crm_type
  • avalidsesen : otg_global_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- b -

  • b2bsetupmsk : otg_device_type
  • b2pstup : otg_eptout_type
  • bAlternateSetting : usb_interface_desc_type
  • bankers : flash_type
  • baudr : usart_type
  • baudr_bit : usart_type
  • baudrate_div : can_baudrate_type
  • bblerr : otg_hchannel_type
  • bblerrmsk : otg_hchannel_type
  • bCBWCBLength : cbw_type, msc_bot_cbw_type
  • bCBWLUN : cbw_type, msc_bot_cbw_type
  • bcdDevice : usb_device_desc_type
  • bcdHID : usb_hid_desc_type
  • bcdUSB : usb_device_desc_type
  • bcnt : otg_global_type
  • bConfigurationValue : usb_configuration_desc_type
  • bCountryCode : usb_hid_desc_type
  • bCSWStatus : csw_type, msc_bot_csw_type
  • bDescriptorType : usb_configuration_desc_type, usb_device_desc_type, usb_endpoint_desc_type, usb_header_desc_type, usb_hid_desc_type, usb_interface_desc_type
  • bDeviceClass : usb_device_desc_type
  • bDeviceProtocol : usb_device_desc_type
  • bDeviceSubClass : usb_device_desc_type
  • bEndpointAddress : usb_endpoint_desc_type
  • bf : spi_type
  • bfbn : usart_type
  • bff : usart_type
  • bfien : usart_type
  • bInterfaceClass : usb_interface_desc_type
  • bInterfaceNumber : usb_interface_desc_type
  • bInterfaceProtocol : usb_interface_desc_type
  • bInterfaceSubClass : usb_interface_desc_type
  • bInterval : usb_endpoint_desc_type
  • bitrate : linecoding_type
  • bLength : usb_configuration_desc_type, usb_device_desc_type, usb_endpoint_desc_type, usb_header_desc_type, usb_hid_desc_type, usb_interface_desc_type
  • blk_addr : msc_type
  • blk_len : msc_type
  • blk_nbr : msc_scsi_data_capacity, msc_type
  • blk_size : msc_scsi_data_capacity, msc_type
  • blksize : sdio_type
  • block_size : sdio_data_struct_type
  • bmAttributes : usb_configuration_desc_type, usb_endpoint_desc_type
  • bMaxPacketSize0 : usb_device_desc_type
  • bMaxPower : usb_configuration_desc_type
  • bmCBWFlags : cbw_type, msc_bot_cbw_type
  • bmRequestType : usb_setup_type
  • bnainmsk : otg_device_type
  • bnaoutmsk : otg_device_type
  • bNumConfigurations : usb_device_desc_type
  • bNumDescriptors : usb_hid_desc_type
  • bNumEndpoints : usb_interface_desc_type
  • bNumInterfaces : usb_configuration_desc_type
  • bof : can_type
  • boien : can_type
  • bot_state : msc_bot_trans_type
  • bot_status : msc_type
  • bot_trans : usbh_msc_type
  • bpdc : crm_type
  • bpdc_bit : crm_type
  • bpdrst : crm_type
  • bpr : ertc_type
  • bpren : crm_type
  • bpwen : pwc_type
  • brdiv : can_type
  • bReportDescriptorType : usb_hid_desc_type
  • bRequest : usb_setup_type
  • brk : tmr_type
  • brk_bit : tmr_type
  • brk_enable : tmr_brkdt_config_type
  • brk_polarity : tmr_brkdt_config_type
  • brken : tmr_type
  • brkie : tmr_type
  • brkif : tmr_type
  • brkswtr : tmr_type
  • brkv : tmr_type
  • btm_ap_enf : flash_type
  • btm_mode_set : flash_type
  • btm_mode_set_bit : flash_type
  • btmg : can_type
  • btmg_bit : can_type
  • bts1 : can_type
  • bts1_size : can_baudrate_type
  • bts2 : can_type
  • bts2_size : can_baudrate_type
  • buf : sdio_type, usart_group_type
  • buf_bit : sdio_type
  • bufcnt : sdio_type
  • bufcnt_bit : sdio_type
  • buffer : msc_bot_trans_type, usbh_hid_type, usbh_msc_type
  • buffer_size : dma_init_type
  • buserr : i2c_type
  • busws : sdio_type
  • busyf : i2c_type
  • button : usb_hid_mouse_type
  • bvalidsesen : otg_global_type
  • bypsen : sdio_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- c -

  • c1c : tmr_type
  • c1cen : tmr_type
  • c1cios : tmr_type
  • c1cp : tmr_type
  • c1den : tmr_type
  • c1df : tmr_type
  • c1dt : tmr_type
  • c1dt_bit : tmr_type
  • c1en : tmr_type
  • c1idiv : tmr_type
  • c1ien : tmr_type
  • c1if : tmr_type
  • c1insel : tmr_type
  • c1ios : tmr_type
  • c1oben : tmr_type
  • c1octrl : tmr_type
  • c1oien : tmr_type
  • c1osen : tmr_type
  • c1p : tmr_type
  • c1rf : tmr_type
  • c1swtr : tmr_type
  • c2c : tmr_type
  • c2cen : tmr_type
  • c2cios : tmr_type
  • c2cp : tmr_type
  • c2den : tmr_type
  • c2df : tmr_type
  • c2dt : tmr_type
  • c2dt_bit : tmr_type
  • c2en : tmr_type
  • c2idiv : tmr_type
  • c2ien : tmr_type
  • c2if : tmr_type
  • c2ios : tmr_type
  • c2oben : tmr_type
  • c2octrl : tmr_type
  • c2oien : tmr_type
  • c2osen : tmr_type
  • c2p : tmr_type
  • c2rf : tmr_type
  • c2swtr : tmr_type
  • c3c : tmr_type
  • c3cen : tmr_type
  • c3cios : tmr_type
  • c3cp : tmr_type
  • c3den : tmr_type
  • c3df : tmr_type
  • c3dt : tmr_type
  • c3dt_bit : tmr_type
  • c3en : tmr_type
  • c3idiv : tmr_type
  • c3ien : tmr_type
  • c3if : tmr_type
  • c3ios : tmr_type
  • c3oben : tmr_type
  • c3octrl : tmr_type
  • c3oien : tmr_type
  • c3osen : tmr_type
  • c3p : tmr_type
  • c3rf : tmr_type
  • c3swtr : tmr_type
  • c4c : tmr_type
  • c4den : tmr_type
  • c4df : tmr_type
  • c4dt : tmr_type
  • c4dt_bit : tmr_type
  • c4en : tmr_type
  • c4idiv : tmr_type
  • c4ien : tmr_type
  • c4if : tmr_type
  • c4ios : tmr_type
  • c4oben : tmr_type
  • c4octrl : tmr_type
  • c4oien : tmr_type
  • c4osen : tmr_type
  • c4p : tmr_type
  • c4rf : tmr_type
  • c4swtr : tmr_type
  • cal16 : ertc_reg_scal_type, ertc_type
  • cal8 : ertc_reg_scal_type, ertc_type
  • caldir : ertc_type
  • caloen : ertc_type
  • calosel : ertc_type
  • calupdf : ertc_type
  • calval : ertc_type
  • can1_gmux : iomux_type
  • can1_pause : debug_type
  • can1en : crm_type
  • can1rst : crm_type
  • can2_pause : debug_type
  • can_mux : iomux_type
  • capacity : usbh_msc_unit_type
  • card_blk_size : sd_card_info_struct_type
  • card_capacity : sd_card_info_struct_type
  • card_cmd_classes : sd_csd_struct_type
  • card_type : sd_card_info_struct_type
  • cardsts1 : sdio_type
  • cardsts2 : sdio_type
  • cardsts3 : sdio_type
  • cardsts4 : sdio_type
  • cbctrl : tmr_type
  • cbw : msc_bot_trans_type
  • CBWCB : cbw_type, msc_bot_cbw_type
  • ccal : ertc_type
  • ccal_bit : ertc_type
  • ccalen : ertc_type
  • cce : adc_type
  • cceien : adc_type
  • ccen : spi_type
  • ccerr : spi_type
  • ccfs : tmr_type
  • ccsmen : sdio_type
  • cctrl : tmr_type
  • cctrl_bit : tmr_type
  • cdt : crc_type
  • cdt_bit : crc_type
  • cfden : crm_type
  • cfdf : crm_type
  • cfdfc : crm_type
  • cfg : crm_type, otg_core_type, wwdt_type
  • cfg_bit : crm_type, wwdt_type
  • cfghr : gpio_type
  • cfghr_bit : gpio_type
  • cfglr : gpio_type
  • cfglr_bit : gpio_type
  • cgnpinak : otg_device_type
  • cgoutnak : otg_device_type
  • ch1_src : dma_type
  • ch2_src : dma_type
  • ch3_src : dma_type
  • ch4_src : dma_type
  • ch5_src : dma_type
  • ch6_src : dma_type
  • ch7_src : dma_type
  • ch_num : usb_hch_type
  • change : usbh_msc_unit_type
  • chdis : otg_hchannel_type
  • chen : dma_channel_type
  • chena : otg_hchannel_type
  • chhltd : otg_hchannel_type
  • chhltdmsk : otg_hchannel_type
  • chin : usbh_hid_type, usbh_msc_type
  • chnum : otg_global_type
  • chout : usbh_hid_type, usbh_msc_type
  • chpl : dma_channel_type
  • cid_crc : sd_cid_struct_type
  • cidsts : otg_global_type
  • clkctrl : i2c_type, sdio_type
  • clkctrl_bit : i2c_type, sdio_type
  • clkdiv : tmr_type
  • clkdiv_h : sdio_type
  • clkdiv_l : sdio_type
  • clkegs : sdio_type
  • clken : usart_type
  • clkfreq : i2c_type
  • clkint : crm_type
  • clkint_bit : crm_type
  • clkoen : sdio_type
  • clkout_sel : crm_type
  • clkoutdiv : crm_type
  • clkpha : spi_type, usart_type
  • clkpol : spi_type, usart_type
  • clock_phase : spi_init_type
  • clock_polarity : i2s_init_type, spi_init_type
  • clr : dma_type, gpio_type
  • clr_bit : dma_type, gpio_type
  • clsef : pwc_type
  • clswef : pwc_type
  • clus_high : fat_dir_type
  • clus_low : fat_dir_type
  • cm1 : tmr_type
  • cm1_input_bit : tmr_type
  • cm1_output_bit : tmr_type
  • cm2 : tmr_type
  • cm2_input_bit : tmr_type
  • cm2_output_bit : tmr_type
  • cmd : ertc_type, wdt_type
  • cmd20_support : sd_scr_struct_type
  • cmd23_support : sd_scr_struct_type
  • cmd_addr : cmd_data_group_type
  • cmd_bit : wdt_type
  • cmd_buf : cmd_data_group_type
  • cmd_check : cmd_data_group_type
  • cmd_head : cmd_data_group_type
  • cmd_index : sdio_command_struct_type
  • cmd_state : msc_bot_trans_type
  • cmdcmpl : sdio_type
  • cmdcmplien : sdio_type
  • cmdctrl : sdio_type
  • cmdctrl_bit : sdio_type
  • cmdfail : sdio_type
  • cmdfailien : sdio_type
  • cmdidx : sdio_type
  • cmdrspcmpl : sdio_type
  • cmdrspcmplien : sdio_type
  • cmdtimeout : sdio_type
  • cmdtimeoutien : sdio_type
  • cmp1en : cmp_type
  • cmp1hyst : cmp_type
  • cmp1invsel : cmp_type
  • cmp1is : cmp_type
  • cmp1ninvsel : cmp_type
  • cmp1p : cmp_type
  • cmp1ssel : cmp_type
  • cmp1tag : cmp_type
  • cmp1value : cmp_type
  • cmp1wp : cmp_type
  • cmp2en : cmp_type
  • cmp2hyst : cmp_type
  • cmp2invsel : cmp_type
  • cmp2ninvsel : cmp_type
  • cmp2p : cmp_type
  • cmp2ssel : cmp_type
  • cmp2tag : cmp_type
  • cmp2value : cmp_type
  • cmp2wp : cmp_type
  • cmp_hysteresis : cmp_init_type
  • cmp_inverting : cmp_init_type
  • cmp_mux : iomux_type
  • cmp_non_inverting : cmp_init_type
  • cmp_output : cmp_init_type
  • cmp_polarity : cmp_init_type
  • cmp_speed : cmp_init_type
  • cmpen : crm_type
  • cmprst : crm_type
  • cnak : otg_eptin_type, otg_eptout_type
  • cnt : dma_channel_type, sdio_type, wwdt_type
  • cnt_dir : tmr_type
  • compsplt : otg_hchannel_type
  • conidschg : otg_global_type
  • conidschgmsk : otg_global_type
  • content_protect_app : sd_csd_struct_type
  • copy_flag : sd_csd_struct_type
  • core_id : usb_core_cfg
  • cotxpkt : otg_global_type
  • count : usart_group_type
  • cpoly : spi_type
  • cpoly_bit : spi_type
  • crc_addr : flash_type
  • crc_addr_bit : flash_type
  • crc_chkr : flash_type
  • crc_chkr_bit : flash_type
  • crc_ctrl : flash_type
  • crc_ctrl_bit : flash_type
  • crc_sn : flash_type
  • crc_strt : flash_type
  • crcen : crm_type
  • create_data : fat_dir_type
  • create_time : fat_dir_type
  • create_time_tenth : fat_dir_type
  • cs_mode_selection : spi_init_type
  • csd_crc : sd_csd_struct_type
  • csd_struct : sd_csd_struct_type
  • csftrst : otg_global_type
  • cspt0 : adc_type
  • cspt1 : adc_type
  • cspt10 : adc_type
  • cspt11 : adc_type
  • cspt12 : adc_type
  • cspt13 : adc_type
  • cspt14 : adc_type
  • cspt15 : adc_type
  • cspt16 : adc_type
  • cspt17 : adc_type
  • cspt2 : adc_type
  • cspt3 : adc_type
  • cspt4 : adc_type
  • cspt5 : adc_type
  • cspt6 : adc_type
  • cspt7 : adc_type
  • cspt8 : adc_type
  • cspt9 : adc_type
  • csw : msc_bot_trans_type
  • ctrl : crc_type, crm_type, debug_type, dma_channel_type, ertc_type, flash_type, pwc_type, wwdt_type
  • ctrl1 : adc_type, i2c_type, spi_type, tmr_type, usart_type
  • ctrl1_bit : adc_type, i2c_type, spi_type, tmr_type, usart_type
  • ctrl2 : adc_type, i2c_type, spi_type, tmr_type, usart_type
  • ctrl2_bit : adc_type, i2c_type, spi_type, tmr_type, usart_type
  • ctrl3 : usart_type
  • ctrl3_bit : usart_type
  • ctrl_bit : crc_type, crm_type, debug_type, dma_channel_type, ertc_type, flash_type, pwc_type, wwdt_type
  • ctrl_state : usbh_hid_type, usbh_msc_type
  • ctrlsts : crm_type, pwc_type
  • ctrlsts1 : cmp_type
  • ctrlsts1_bit : cmp_type
  • ctrlsts2 : cmp_type
  • ctrlsts2_bit : cmp_type
  • ctrlsts_bit : crm_type, pwc_type
  • ctscf : usart_type
  • ctscfien : usart_type
  • ctsen : usart_type
  • cur_lun : usbh_msc_type
  • curmod : otg_global_type
  • curmode : otg_global_type
  • curs : can_type
  • cuss : can_type
  • cval : tmr_type
  • cval_bit : tmr_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- d -

  • d : ertc_reg_alarm_type, ertc_reg_date_type, ertc_reg_tsdt_type, ertc_type
  • daint : otg_device_type
  • daint_bit : otg_device_type
  • daintmsk : otg_device_type
  • daintmsk_bit : otg_device_type
  • data : can_rx_message_type, can_tx_message_type, linecoding_type, msc_bot_trans_type, msc_type
  • data0 : usd_type
  • data1 : usd_type
  • data_align : adc_base_config_type
  • data_channel_format : i2s_init_type
  • data_format : msc_scsi_data_inquiry
  • data_len : msc_type
  • data_length : sdio_data_struct_type
  • data_pid : usb_hch_type
  • data_stat_after_erase : sd_scr_struct_type
  • dataien : i2c_type
  • date : ertc_reg_date_type, ertc_type
  • date_bit : ertc_reg_date_type, ertc_type
  • day : ertc_alarm_value_type, ertc_time_type
  • dbn : usart_type
  • dCBWDataTransferLength : cbw_type, msc_bot_cbw_type
  • dCBWSignature : cbw_type, msc_bot_cbw_type, msc_bot_csw_type
  • dCBWTag : msc_bot_cbw_type, msc_bot_csw_type
  • dCBWTage : cbw_type
  • dcfg : otg_device_type
  • dcfg_bit : otg_device_type
  • dcmpen : cmp_type
  • dCSWDataResidue : csw_type, msc_bot_csw_type
  • dCSWSignature : csw_type
  • dCSWTag : csw_type
  • dctl : otg_device_type
  • dctl_bit : otg_device_type
  • deadtime : tmr_brkdt_config_type
  • dec : ertc_reg_scal_type, ertc_type
  • dec1h : ertc_type
  • decsbs : ertc_reg_tadj_type, ertc_type
  • deepsleep_debug : debug_type
  • depslp_rst : flash_type
  • devaddr : otg_device_type, otg_hchannel_type
  • devaddrf : i2c_type
  • device_size : sd_csd_struct_type
  • device_size_mult : sd_csd_struct_type
  • devspd : otg_device_type
  • diepctl : otg_eptin_type
  • diepctl_bit : otg_eptin_type
  • diepempmsk : otg_device_type
  • diepempmsk_bit : otg_device_type
  • diepint : otg_eptin_type
  • diepint_bit : otg_eptin_type
  • diepmsk : otg_device_type
  • diepmsk_bit : otg_device_type
  • dieptsiz : otg_eptin_type
  • dieptsiz_bit : otg_eptin_type
  • dieptxfn : otg_global_type
  • dieptxfn_bit : otg_global_type
  • dir : usb_hch_type
  • direction : dma_init_type
  • dirf : i2c_type
  • disconint : otg_global_type
  • disconintmsk : otg_global_type
  • div : ertc_type, tmr_type, usart_type, wdt_type, wwdt_type
  • div_bit : ertc_type, tmr_type, wdt_type
  • diva : ertc_type
  • divb : ertc_type
  • divf : wdt_type
  • dlc : can_rx_message_type, can_tx_message_type
  • dma1en : crm_type
  • dma2en : crm_type
  • dma_en : usb_core_cfg
  • dma_flex_en : dma_type
  • dma_init_struct : i2c_handle_type
  • dma_rx_channel : i2c_handle_type
  • dma_tx_channel : i2c_handle_type
  • dmactrl : tmr_type
  • dmactrl_bit : tmr_type
  • dmadt : tmr_type
  • dmadt_bit : tmr_type
  • dmaen : i2c_type, sdio_type
  • dmaend : i2c_type
  • dmaren : spi_type, usart_type
  • dmaten : spi_type, usart_type
  • docmd : sdio_type
  • docmdien : sdio_type
  • doepctl : otg_eptout_type
  • doepctl_bit : otg_eptout_type
  • doepint : otg_eptout_type
  • doepint_bit : otg_eptout_type
  • doepmsk : otg_device_type
  • doepmsk_bit : otg_device_type
  • doeptsiz : otg_eptout_type
  • doeptsiz_bit : otg_eptout_type
  • dorx : sdio_type
  • dorxien : sdio_type
  • dotx : sdio_type
  • dotxien : sdio_type
  • dpid : otg_eptin_type, otg_eptout_type, otg_global_type
  • dren : ertc_type
  • drs : tmr_type
  • dsr_implemented : sd_csd_struct_type
  • dsts : otg_device_type
  • dsts_bit : otg_device_type
  • dt : crc_type, ertc_type, i2c_type, sdio_type, spi_type, usart_type
  • dt1 : ertc_type
  • dt10 : ertc_type
  • dt10_bit : ertc_type
  • dt11 : ertc_type
  • dt11_bit : ertc_type
  • dt12 : ertc_type
  • dt12_bit : ertc_type
  • dt13 : ertc_type
  • dt13_bit : ertc_type
  • dt14 : ertc_type
  • dt14_bit : ertc_type
  • dt15 : ertc_type
  • dt15_bit : ertc_type
  • dt16 : ertc_type
  • dt16_bit : ertc_type
  • dt17 : ertc_type
  • dt17_bit : ertc_type
  • dt18 : ertc_type
  • dt18_bit : ertc_type
  • dt19 : ertc_type
  • dt19_bit : ertc_type
  • dt1_bit : ertc_type
  • dt2 : ertc_type
  • dt20 : ertc_type
  • dt20_bit : ertc_type
  • dt2_bit : ertc_type
  • dt3 : ertc_type
  • dt3_bit : ertc_type
  • dt4 : ertc_type
  • dt4_bit : ertc_type
  • dt5 : ertc_type
  • dt5_bit : ertc_type
  • dt6 : ertc_type
  • dt6_bit : ertc_type
  • dt7 : ertc_type
  • dt7_bit : ertc_type
  • dt8 : ertc_type
  • dt8_bit : ertc_type
  • dt9 : ertc_type
  • dt9_bit : ertc_type
  • dt_bit : crc_type, i2c_type, spi_type, usart_type
  • dtalign : adc_type
  • dtb : tmr_type
  • dtblkcmpl : sdio_type
  • dtblkcmplien : sdio_type
  • dtc : tmr_type
  • dtcmpl : sdio_type
  • dtcmplien : sdio_type
  • dtcnt : dma_channel_type, sdio_type
  • dtcnt_bit : dma_channel_type, sdio_type
  • dtctrl : sdio_type
  • dtctrl_bit : sdio_type
  • dtd : dma_channel_type
  • dterrf1 : dma_type
  • dterrf2 : dma_type
  • dterrf3 : dma_type
  • dterrf4 : dma_type
  • dterrf5 : dma_type
  • dterrf6 : dma_type
  • dterrf7 : dma_type
  • dterrfc1 : dma_type
  • dterrfc2 : dma_type
  • dterrfc3 : dma_type
  • dterrfc4 : dma_type
  • dterrfc5 : dma_type
  • dterrfc6 : dma_type
  • dterrfc7 : dma_type
  • dterrien : dma_channel_type
  • dtfail : sdio_type
  • dtfailien : sdio_type
  • dtglerr : otg_hchannel_type
  • dtglerrmsk : otg_hchannel_type
  • dtlen : sdio_type
  • dtlen_bit : sdio_type
  • dttimeout : sdio_type
  • dttimeoutien : sdio_type
  • dttmr : sdio_type
  • dttmr_bit : sdio_type
  • dtxfsts : otg_eptin_type
  • dtxfsts_bit : otg_eptin_type
  • dutymode : i2c_type
  • dzc : can_type
  • dzen : can_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- e -

  • eaf : can_type
  • eaien : can_type
  • ecc_code : sd_csd_struct_type
  • ecmben : tmr_type
  • edzien : can_type
  • edzif : can_type
  • em_slib_dat_ss : flash_type
  • em_slib_enf : flash_type
  • em_slib_iss_set : flash_type
  • em_slib_set : flash_type
  • em_slib_set_bit : flash_type
  • enpd : usb_audio_type
  • enumdone : otg_global_type
  • enumdonemsk : otg_global_type
  • enumspd : otg_device_type
  • eoien : can_type
  • eoif : can_type
  • eopf : otg_global_type
  • eopfmsk : otg_global_type
  • ep3_rmpen : crm_type
  • epdisd : otg_eptin_type, otg_eptout_type
  • epf : can_type
  • epien : can_type
  • epp0 : usd_type
  • epp1 : usd_type
  • epp2 : usd_type
  • epp3 : usd_type
  • epperr : flash_type
  • epps : flash_type
  • epps_bit : flash_type
  • ept0_slen : usb_ept_info
  • ept_address : usb_ept_info
  • ept_num : usb_core_cfg, usb_hch_type
  • ept_type : usb_hch_type
  • eptdir : otg_hchannel_type
  • eptdis : otg_eptin_type, otg_eptout_type
  • eptdismsk : otg_device_type
  • eptena : otg_eptin_type, otg_eptout_type
  • eptin : usbh_hid_type, usbh_msc_type
  • eptn : usb_ept_info
  • eptnum : otg_global_type, otg_hchannel_type
  • eptout : usbh_hid_type, usbh_msc_type
  • eptype : otg_eptin_type, otg_eptout_type, otg_hchannel_type
  • erase_group_size : sd_csd_struct_type
  • erase_group_size_mult : sd_csd_struct_type
  • erlysusp : otg_global_type
  • erlysuspmsk : otg_global_type
  • err_code : sense_type
  • errie : flash_type, spi_type
  • errien : i2c_type, usart_type
  • error : usbh_msc_type
  • error_code : i2c_handle_type
  • erstr : flash_type
  • ertcen : crm_type
  • ertcsel : crm_type
  • esdiv : tmr_type
  • esf : tmr_type
  • esp : tmr_type
  • ests : can_type
  • ests_bit : can_type
  • eticerr : otg_device_type
  • etr : can_type
  • etrien : can_type
  • evoen : iomux_type
  • evten : exint_type
  • evten_bit : exint_type
  • evtenx : exint_type
  • evtien : i2c_type
  • evtout : iomux_type
  • evtout_bit : iomux_type
  • exint0 : iomux_type
  • exint1 : iomux_type
  • exint10 : iomux_type
  • exint11 : iomux_type
  • exint12 : iomux_type
  • exint13 : iomux_type
  • exint14 : iomux_type
  • exint15 : iomux_type
  • exint2 : iomux_type
  • exint3 : iomux_type
  • exint4 : iomux_type
  • exint5 : iomux_type
  • exint6 : iomux_type
  • exint7 : iomux_type
  • exint8 : iomux_type
  • exint9 : iomux_type
  • exintc1 : iomux_type
  • exintc1_bit : iomux_type
  • exintc2 : iomux_type
  • exintc2_bit : iomux_type
  • exintc3 : iomux_type
  • exintc3_bit : iomux_type
  • exintc4 : iomux_type
  • exintc4_bit : iomux_type
  • exintrst : crm_type
  • extended_id : can_rx_message_type, can_tx_message_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- f -

  • fa : flash_type
  • facfg : can_type
  • facfg_bit : can_type
  • faen0 : can_type
  • faen1 : can_type
  • faen10 : can_type
  • faen11 : can_type
  • faen12 : can_type
  • faen13 : can_type
  • faen2 : can_type
  • faen3 : can_type
  • faen4 : can_type
  • faen5 : can_type
  • faen6 : can_type
  • faen7 : can_type
  • faen8 : can_type
  • faen9 : can_type
  • fap : flash_type, usd_type
  • fap_hl : flash_type
  • fap_hl_dis : flash_type
  • fbn : spi_type
  • fbwcfg : can_type
  • fbwcfg_bit : can_type
  • fbwsel0 : can_type
  • fbwsel1 : can_type
  • fbwsel10 : can_type
  • fbwsel11 : can_type
  • fbwsel12 : can_type
  • fbwsel13 : can_type
  • fbwsel2 : can_type
  • fbwsel3 : can_type
  • fbwsel4 : can_type
  • fbwsel5 : can_type
  • fbwsel6 : can_type
  • fbwsel7 : can_type
  • fbwsel8 : can_type
  • fbwsel9 : can_type
  • fcs : can_type
  • fcsodis : tmr_type
  • fcsodis_state : tmr_brkdt_config_type
  • fcsoen : tmr_type
  • fcsoen_state : tmr_brkdt_config_type
  • fctrl : can_type
  • fctrl_bit : can_type
  • fdevmode : otg_global_type
  • fdtf1 : dma_type
  • fdtf2 : dma_type
  • fdtf3 : dma_type
  • fdtf4 : dma_type
  • fdtf5 : dma_type
  • fdtf6 : dma_type
  • fdtf7 : dma_type
  • fdtfc1 : dma_type
  • fdtfc2 : dma_type
  • fdtfc3 : dma_type
  • fdtfc4 : dma_type
  • fdtfc5 : dma_type
  • fdtfc6 : dma_type
  • fdtfc7 : dma_type
  • fdtien : dma_channel_type
  • ferr : usart_type
  • ffb : can_type
  • ffdb1 : can_filter_register_type
  • ffdb2 : can_filter_register_type
  • fhstmode : otg_global_type
  • fifo_length : iap_info_type
  • fifo_mailbox : can_type
  • fifo_size : usb_core_cfg
  • file_formart : sd_csd_struct_type
  • file_format_group : sd_csd_struct_type
  • file_name : fat_dir_type
  • file_size : fat_dir_type
  • file_write_nr : flash_iap_type
  • filter_activate_enable : can_filter_init_type
  • filter_bit : can_filter_init_type
  • filter_fifo : can_filter_init_type
  • filter_id_high : can_filter_init_type
  • filter_id_low : can_filter_init_type
  • filter_index : can_rx_message_type
  • filter_mask_high : can_filter_init_type
  • filter_mask_low : can_filter_init_type
  • filter_mode : can_filter_init_type
  • filter_number : can_filter_init_type
  • firmware_length : flash_iap_type
  • first_bit_transmission : spi_init_type
  • flag_address : iap_info_type
  • flash_app_addr : flash_iap_type
  • flash_app_size : flash_iap_type
  • flash_base_addr : flash_iap_type
  • flash_end_address : iap_info_type
  • flash_size : flash_iap_type, iap_info_type
  • flash_start_address : iap_info_type
  • flashen : crm_type
  • fmcfg : can_type
  • fmcfg_bit : can_type
  • fmsel0 : can_type
  • fmsel1 : can_type
  • fmsel10 : can_type
  • fmsel11 : can_type
  • fmsel12 : can_type
  • fmsel13 : can_type
  • fmsel2 : can_type
  • fmsel3 : can_type
  • fmsel4 : can_type
  • fmsel5 : can_type
  • fmsel6 : can_type
  • fmsel7 : can_type
  • fmsel8 : can_type
  • fmsel9 : can_type
  • fn : otg_global_type
  • format : linecoding_type
  • fprgm : flash_type
  • fpx : exint_type
  • frame_bit_num : spi_init_type
  • frame_type : can_rx_message_type, can_tx_message_type
  • frf : can_type
  • frf_bit : can_type
  • frfsel0 : can_type
  • frfsel1 : can_type
  • frfsel10 : can_type
  • frfsel11 : can_type
  • frfsel12 : can_type
  • frfsel13 : can_type
  • frfsel2 : can_type
  • frfsel3 : can_type
  • frfsel4 : can_type
  • frfsel5 : can_type
  • frfsel6 : can_type
  • frfsel7 : can_type
  • frfsel8 : can_type
  • frfsel9 : can_type
  • frint : otg_host_type
  • frmcntrst : otg_global_type
  • frmovrun : otg_hchannel_type
  • frmovrunmsk : otg_hchannel_type
  • frnum : otg_host_type
  • fslspclksel : otg_host_type
  • fslssupp : otg_host_type
  • ftrem : otg_host_type
  • fzc : can_type
  • fzen : can_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- g -

  • g_audio_cur : usb_audio_type
  • gahbcfg : otg_global_type
  • gahbcfg_bit : otg_global_type
  • gcaddrf : i2c_type
  • gcaen : i2c_type
  • gccfg : otg_global_type
  • gccfg_bit : otg_global_type
  • gdiv : usart_type
  • gdiv_bit : usart_type
  • genstart : i2c_type
  • genstop : i2c_type
  • gf1 : dma_type
  • gf2 : dma_type
  • gf3 : dma_type
  • gf4 : dma_type
  • gf5 : dma_type
  • gf6 : dma_type
  • gf7 : dma_type
  • gfc1 : dma_type
  • gfc2 : dma_type
  • gfc3 : dma_type
  • gfc4 : dma_type
  • gfc5 : dma_type
  • gfc6 : dma_type
  • gfc7 : dma_type
  • ginnakeff : otg_global_type
  • ginnakeffmsk : otg_global_type
  • gintmsk : otg_global_type
  • gintmsk_bit : otg_global_type
  • gintsts : otg_global_type
  • gintsts_bit : otg_global_type
  • glbintmsk : otg_global_type
  • gnpinnaksts : otg_device_type
  • gnptxfsiz_ept0tx : otg_global_type
  • gnptxfsiz_ept0tx_bit : otg_global_type
  • gnptxsts : otg_global_type
  • gnptxsts_bit : otg_global_type
  • gotgctrl : otg_global_type
  • gotgctrl_bit : otg_global_type
  • gotgint : otg_global_type
  • gotgint_bit : otg_global_type
  • goutnakeff : otg_global_type
  • goutnakeffmsk : otg_global_type
  • goutnaksts : otg_device_type
  • gpio_drive_strength : gpio_init_type
  • gpio_mode : gpio_init_type
  • gpio_out_type : gpio_init_type
  • gpio_pins : gpio_init_type
  • gpio_pull : gpio_init_type
  • gpioaen : crm_type
  • gpioarst : crm_type
  • gpioben : crm_type
  • gpiobrst : crm_type
  • gpiocen : crm_type
  • gpiocrst : crm_type
  • gpioden : crm_type
  • gpiodrst : crm_type
  • gpiofen : crm_type
  • gpiofrst : crm_type
  • grstctl : otg_global_type
  • grstctl_bit : otg_global_type
  • grxfsiz : otg_global_type
  • grxfsiz_bit : otg_global_type
  • grxstsp : otg_global_type
  • grxstsp_bit : otg_global_type
  • grxstsr : otg_global_type
  • grxstsr_bit : otg_global_type
  • guid : otg_global_type
  • guid_bit : otg_global_type
  • gusbcfg : otg_global_type
  • gusbcfg_bit : otg_global_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- h -

  • h : ertc_reg_alarm_type, ertc_reg_time_type, ertc_reg_tstm_type, ertc_type, sc_atr_type
  • haint : otg_host_type
  • haint_bit : otg_host_type
  • haintmsk : otg_host_type
  • haintmsk_bit : otg_host_type
  • hallde : tmr_type
  • hallien : tmr_type
  • hallif : tmr_type
  • hallswtr : tmr_type
  • hc_num : usb_core_cfg
  • hcchar : otg_hchannel_type
  • hcchar_bit : otg_hchannel_type
  • hcfg : otg_host_type
  • hcfg_bit : otg_host_type
  • hchint : otg_global_type
  • hchintmsk : otg_global_type
  • hcint : otg_hchannel_type
  • hcint_bit : otg_hchannel_type
  • hcintmsk : otg_hchannel_type
  • hcintmsk_bit : otg_hchannel_type
  • hcsplt : otg_hchannel_type
  • hcsplt_bit : otg_hchannel_type
  • hctsiz : otg_hchannel_type
  • hctsiz_bit : otg_hchannel_type
  • hdtf1 : dma_type
  • hdtf2 : dma_type
  • hdtf3 : dma_type
  • hdtf4 : dma_type
  • hdtf5 : dma_type
  • hdtf6 : dma_type
  • hdtf7 : dma_type
  • hdtfc1 : dma_type
  • hdtfc2 : dma_type
  • hdtfc3 : dma_type
  • hdtfc4 : dma_type
  • hdtfc5 : dma_type
  • hdtfc6 : dma_type
  • hdtfc7 : dma_type
  • hdtien : dma_channel_type
  • head : usart_group_type
  • hextbyps : crm_type
  • hexten : crm_type
  • hextstbl : crm_type
  • hextstblf : crm_type
  • hextstblfc : crm_type
  • hextstblien : crm_type
  • hfcen : sdio_type
  • hfcyc_en : flash_type
  • hfir : otg_host_type
  • hfir_bit : otg_host_type
  • hfnum : otg_host_type
  • hfnum_bit : otg_host_type
  • hick_to_sclk : crm_type
  • hick_to_usb : crm_type
  • hickcal : crm_type
  • hickcal_key : crm_type
  • hickdiv : crm_type
  • hicken : crm_type
  • hickstbl : crm_type
  • hickstblf : crm_type
  • hickstblfc : crm_type
  • hickstblien : crm_type
  • hicktrim : crm_type
  • hid_desc : usbh_hid_type
  • hlength : sc_atr_type
  • hm : ertc_type
  • hostaddrf : i2c_type
  • hour : ertc_alarm_value_type, ertc_time_type
  • hprt : otg_host_type
  • hprt_bit : otg_host_type
  • hptxfsiz : otg_global_type
  • hptxfsiz_bit : otg_global_type
  • hptxsts : otg_host_type
  • hptxsts_bit : otg_host_type
  • hubaddr : otg_hchannel_type
  • hwcsoe : spi_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- i -

  • i2c1_gmux : iomux_type
  • i2c1_mux : iomux_type
  • i2c1_smbus_timeout : debug_type
  • i2c1en : crm_type
  • i2c1rst : crm_type
  • i2c2_gmux : iomux_type
  • i2c2_smbus_timeout : debug_type
  • i2c2en : crm_type
  • i2c2rst : crm_type
  • i2c3_smbus_timeout : debug_type
  • i2cen : i2c_type
  • i2cx : i2c_handle_type
  • i2scbn : spi_type
  • i2sclk : spi_type
  • i2sclk_bit : spi_type
  • i2sclkpol : spi_type
  • i2sctrl : spi_type
  • i2sctrl_bit : spi_type
  • i2sdbn : spi_type
  • i2sdiv_h : spi_type
  • i2sdiv_l : spi_type
  • i2sen : spi_type
  • i2smclkoe : spi_type
  • i2smsel : spi_type
  • i2sodd : spi_type
  • iap_address : iap_info_type
  • iap_fifo : iap_info_type
  • iap_rx : iap_info_type
  • iap_tx : iap_info_type
  • iConfiguration : usb_configuration_desc_type
  • id : usart_type
  • id_type : can_rx_message_type, can_tx_message_type
  • idcode_bit : debug_type
  • iden : tmr_type
  • iden_bit : tmr_type
  • idlef : usart_type
  • idleien : usart_type
  • idProduct : usb_device_desc_type
  • idt : crc_type, gpio_type
  • idt0 : gpio_type
  • idt1 : gpio_type
  • idt10 : gpio_type
  • idt11 : gpio_type
  • idt12 : gpio_type
  • idt13 : gpio_type
  • idt14 : gpio_type
  • idt15 : gpio_type
  • idt2 : gpio_type
  • idt3 : gpio_type
  • idt4 : gpio_type
  • idt5 : gpio_type
  • idt6 : gpio_type
  • idt7 : gpio_type
  • idt8 : gpio_type
  • idt9 : gpio_type
  • idt_bit : crc_type, gpio_type
  • idVendor : usb_device_desc_type
  • ieptint : otg_global_type
  • ieptintmsk : otg_global_type
  • iInterface : usb_interface_desc_type
  • iManufacturer : usb_device_desc_type
  • imen : ertc_type
  • imf : ertc_type
  • in_maxpacket : usbh_hid_type, usbh_msc_type
  • in_poll : usbh_hid_type, usbh_msc_type
  • incompip_incompisoout : otg_global_type
  • incompip_incompisooutmsk : otg_global_type
  • incompisoin : otg_global_type
  • incompisoinmsk : otg_global_type
  • ineptint : otg_device_type
  • ineptmsk : otg_device_type
  • ineptnak : otg_eptin_type
  • ineptnakmsk : otg_device_type
  • ineptxfdep : otg_global_type
  • ineptxfemsk : otg_device_type
  • ineptxfsav : otg_eptin_type
  • ineptxfstaddr : otg_global_type
  • information : sense_type
  • initf : ertc_type
  • inout : usb_ept_info
  • input_channel_select : tmr_input_config_type
  • input_filter_value : tmr_input_config_type
  • input_mapped_select : tmr_input_config_type
  • input_polarity_select : tmr_input_config_type
  • inquiry : usbh_msc_unit_type
  • intclr : sdio_type
  • intclr_bit : sdio_type
  • inten : can_type, exint_type, sdio_type
  • inten_bit : can_type, exint_type, sdio_type
  • intenx : exint_type
  • interface : usb_audio_type
  • intkneptmismsk : otg_device_type
  • intkntxfemp : otg_eptin_type
  • intkntxfempmsk : otg_device_type
  • intsts : exint_type
  • intsts_bit : exint_type
  • intwt : sdio_type
  • iocb0 : gpio_type
  • iocb1 : gpio_type
  • iocb10 : gpio_type
  • iocb11 : gpio_type
  • iocb12 : gpio_type
  • iocb13 : gpio_type
  • iocb14 : gpio_type
  • iocb15 : gpio_type
  • iocb2 : gpio_type
  • iocb3 : gpio_type
  • iocb4 : gpio_type
  • iocb5 : gpio_type
  • iocb6 : gpio_type
  • iocb7 : gpio_type
  • iocb8 : gpio_type
  • iocb9 : gpio_type
  • ioen : sdio_type
  • iofc0 : gpio_type
  • iofc1 : gpio_type
  • iofc10 : gpio_type
  • iofc11 : gpio_type
  • iofc12 : gpio_type
  • iofc13 : gpio_type
  • iofc14 : gpio_type
  • iofc15 : gpio_type
  • iofc2 : gpio_type
  • iofc3 : gpio_type
  • iofc4 : gpio_type
  • iofc5 : gpio_type
  • iofc6 : gpio_type
  • iofc7 : gpio_type
  • iofc8 : gpio_type
  • iofc9 : gpio_type
  • ioif : sdio_type
  • ioifien : sdio_type
  • iomc0 : gpio_type
  • iomc1 : gpio_type
  • iomc10 : gpio_type
  • iomc11 : gpio_type
  • iomc12 : gpio_type
  • iomc13 : gpio_type
  • iomc14 : gpio_type
  • iomc15 : gpio_type
  • iomc2 : gpio_type
  • iomc3 : gpio_type
  • iomc4 : gpio_type
  • iomc5 : gpio_type
  • iomc6 : gpio_type
  • iomc7 : gpio_type
  • iomc8 : gpio_type
  • iomc9 : gpio_type
  • iomuxen : crm_type
  • iomuxrst : crm_type
  • iosb0 : gpio_type
  • iosb1 : gpio_type
  • iosb10 : gpio_type
  • iosb11 : gpio_type
  • iosb12 : gpio_type
  • iosb13 : gpio_type
  • iosb14 : gpio_type
  • iosb15 : gpio_type
  • iosb2 : gpio_type
  • iosb3 : gpio_type
  • iosb4 : gpio_type
  • iosb5 : gpio_type
  • iosb6 : gpio_type
  • iosb7 : gpio_type
  • iosb8 : gpio_type
  • iosb9 : gpio_type
  • iosusp : sdio_type
  • iProduct : usb_device_desc_type
  • irdaen : usart_type
  • irdalp : usart_type
  • is_double_buffer : usb_ept_info
  • isdiv : usart_type
  • iSerialNumber : usb_device_desc_type
  • isooutdrop : otg_global_type
  • isooutdropmsk : otg_global_type
  • ists : tmr_type
  • ists_bit : tmr_type
  • itsrven : adc_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- l -

  • l_unit_n : usbh_msc_type
  • last_access_data : fat_dir_type
  • last_len : usb_ept_info
  • lbcp : usart_type
  • lben : can_type
  • length : msc_scsi_data_inquiry
  • lextbyps : crm_type
  • lexten : crm_type
  • lextstbl : crm_type
  • lextstblf : crm_type
  • lextstblfc : crm_type
  • lextstblien : crm_type
  • licken : crm_type
  • lickstbl : crm_type
  • lickstblf : crm_type
  • lickstblfc : crm_type
  • lickstblien : crm_type
  • line_enable : exint_init_type
  • line_mode : exint_init_type
  • line_polarity : exint_init_type
  • line_select : exint_init_type
  • linen : usart_type
  • linex : exint_type
  • lm : dma_channel_type
  • loen : can_type
  • loop_mode_enable : dma_init_type
  • low_power : usb_core_cfg
  • lprstf : crm_type
  • lpsel : pwc_type
  • lsamprx : can_type
  • lspddev : otg_hchannel_type
  • ltf : spi_type
  • lun : cbd_extended_type, cbd_typical_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- m -

  • m : ertc_reg_alarm_type, ertc_reg_date_type, ertc_reg_time_type, ertc_reg_tsdt_type, ertc_reg_tstm_type, ertc_type
  • m2m : dma_channel_type
  • mackctrl : i2c_type
  • maddr : dma_channel_type
  • maddr_bit : dma_channel_type
  • manufact_date : sd_cid_struct_type
  • manufacturer_default_ecc : sd_csd_struct_type
  • manufacturer_id : sd_cid_struct_type
  • mask : ertc_alarm_value_type
  • mask1 : ertc_reg_alarm_type, ertc_type
  • mask2 : ertc_reg_alarm_type, ertc_type
  • mask3 : ertc_reg_alarm_type, ertc_type
  • mask4 : ertc_reg_alarm_type, ertc_type
  • master_slave_mode : spi_init_type
  • max_bus_clk_freq : sd_csd_struct_type
  • max_lun : msc_type, usbh_msc_type
  • max_read_blk_length : sd_csd_struct_type
  • max_read_current_vdd_max : sd_csd_struct_type
  • max_read_current_vdd_min : sd_csd_struct_type
  • max_size : usb_core_cfg
  • max_write_blk_length : sd_csd_struct_type
  • max_write_current_vdd_max : sd_csd_struct_type
  • max_write_current_vdd_min : sd_csd_struct_type
  • maxpacket : usb_ept_info, usb_hch_type
  • mc : otg_eptin_type, otg_hchannel_type
  • mclk_freq_division : spi_init_type
  • mclk_output_enable : i2s_init_type
  • mctrl : can_type
  • mctrl_bit : can_type
  • mdiv_h : spi_type
  • mdiv_l : spi_type
  • mdrsel : can_type
  • mdrsel_selection : can_base_type
  • memory_base_addr : dma_init_type
  • memory_data_width : dma_init_type
  • memory_inc_enable : dma_init_type
  • mic_adj_count : audio_codec_type
  • mic_adj_stage : audio_codec_type
  • mic_alt_setting : usb_audio_type
  • mic_buffer : audio_codec_type
  • mic_calc : audio_codec_type
  • mic_delta : audio_codec_type
  • mic_enable : audio_codec_type
  • mic_freq : usb_audio_type
  • mic_mute : audio_codec_type, usb_audio_type
  • mic_roff : audio_codec_type
  • mic_rtotal : audio_codec_type
  • mic_rx_size : audio_codec_type
  • mic_stage : audio_codec_type
  • mic_volume : audio_codec_type, usb_audio_type
  • mic_volume_limits : usb_audio_type
  • mic_wend : audio_codec_type
  • mic_woff : audio_codec_type
  • mic_wtotal : audio_codec_type
  • min : ertc_alarm_value_type, ertc_time_type
  • mincm : dma_channel_type
  • misc1 : crm_type
  • misc1_bit : crm_type
  • misc2 : crm_type
  • misc2_bit : crm_type
  • mmerr : spi_type
  • mmssr : can_type
  • mmssr_selection : can_base_type
  • mode : i2c_handle_type
  • mode_selection : can_base_type
  • modemis : otg_global_type
  • modemismsk : otg_global_type
  • month : ertc_time_type
  • mps : otg_eptin_type, otg_eptout_type, otg_hchannel_type
  • msc_state : msc_type
  • msc_struct : msc_bot_trans_type
  • msc_up_status : flash_iap_type
  • mssel : adc_type
  • msten : spi_type
  • msts : can_type
  • msts_bit : can_type
  • mwidth : dma_channel_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- n -

  • nak : otg_hchannel_type
  • nakmsk : otg_hchannel_type
  • naksts : otg_eptin_type, otg_eptout_type
  • nerr : usart_type
  • nptxfdep : otg_global_type
  • nptxfemp : otg_global_type
  • nptxfemplvl : otg_global_type
  • nptxfempmsk : otg_global_type
  • nptxfspcavail : otg_global_type
  • nptxfstaddr : otg_global_type
  • nptxqspcavail : otg_global_type
  • nptxqtop : otg_global_type
  • nrstf : crm_type
  • nsac : sd_csd_struct_type
  • ntc : spi_type
  • nzstsouthshk : otg_device_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- o -

  • oaddr1 : i2c_type
  • oaddr1_bit : i2c_type
  • oaddr2 : i2c_type
  • oaddr2_bit : i2c_type
  • obf : flash_type
  • oc_idle_state : tmr_output_config_type
  • oc_mode : tmr_output_config_type
  • oc_output_state : tmr_output_config_type
  • oc_polarity : tmr_output_config_type
  • occ_idle_state : tmr_output_config_type
  • occ_output_state : tmr_output_config_type
  • occ_polarity : tmr_output_config_type
  • occs : adc_type
  • ocdmaen : adc_type
  • oclen : adc_type
  • ocmen : tmr_type
  • ocpcnt : adc_type
  • ocpen : adc_type
  • ocswtrg : adc_type
  • octen : adc_type
  • octesel_h : adc_type
  • octesel_l : adc_type
  • ocvmen : adc_type
  • oddfrm : otg_hchannel_type
  • odf : flash_type
  • odfie : flash_type
  • odt : adc_type, gpio_type
  • odt0 : gpio_type
  • odt1 : gpio_type
  • odt10 : gpio_type
  • odt11 : gpio_type
  • odt12 : gpio_type
  • odt13 : gpio_type
  • odt14 : gpio_type
  • odt15 : gpio_type
  • odt2 : gpio_type
  • odt3 : gpio_type
  • odt4 : gpio_type
  • odt5 : gpio_type
  • odt6 : gpio_type
  • odt7 : gpio_type
  • odt8 : gpio_type
  • odt9 : gpio_type
  • odt_bit : adc_type, gpio_type
  • oem_app_id : sd_cid_struct_type
  • oen : tmr_type
  • oeptint : otg_global_type
  • oeptintmsk : otg_global_type
  • opcode : cbd_extended_type, cbd_typical_type
  • operation_mode : i2s_init_type
  • opersel : spi_type
  • oplk : flash_type
  • ora : spi_type
  • ordinary_channel_length : adc_base_config_type
  • osn1 : adc_type
  • osn10 : adc_type
  • osn11 : adc_type
  • osn12 : adc_type
  • osn13 : adc_type
  • osn14 : adc_type
  • osn15 : adc_type
  • osn16 : adc_type
  • osn2 : adc_type
  • osn3 : adc_type
  • osn4 : adc_type
  • osn5 : adc_type
  • osn6 : adc_type
  • osn7 : adc_type
  • osn8 : adc_type
  • osn9 : adc_type
  • osq1 : adc_type
  • osq1_bit : adc_type
  • osq2 : adc_type
  • osq2_bit : adc_type
  • osq3 : adc_type
  • osq3_bit : adc_type
  • otg_extctrl : crm_type
  • otg_extctrl_bit : crm_type
  • otgint : otg_global_type
  • otgintmsk : otg_global_type
  • ouf : i2c_type
  • out_maxpacket : usbh_hid_type, usbh_msc_type
  • out_poll : usbh_hid_type, usbh_msc_type
  • outeptint : otg_device_type
  • outeptmsk : otg_device_type
  • outp : ertc_type
  • outperrmsk : otg_device_type
  • outsel : ertc_type
  • outtepd : otg_eptout_type
  • outtepdmsk : otg_device_type
  • outtype : ertc_type
  • ovfden : tmr_type
  • ovfen : tmr_type
  • ovfien : tmr_type
  • ovfif : tmr_type
  • ovfs : tmr_type
  • ovfswtr : tmr_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- p -

  • paddr : dma_channel_type
  • paddr_bit : dma_channel_type
  • parity : linecoding_type
  • part_blk_read : sd_csd_struct_type
  • part_blk_write : sd_csd_struct_type
  • pbuff : i2c_handle_type
  • pcautoen : adc_type
  • pcce : adc_type
  • pcceien : adc_type
  • pccs : adc_type
  • pcdto1 : adc_type
  • pcdto1_bit : adc_type
  • pcdto2 : adc_type
  • pcdto2_bit : adc_type
  • pcdto3 : adc_type
  • pcdto3_bit : adc_type
  • pcdto4 : adc_type
  • pcdto4_bit : adc_type
  • pcgcctl : otg_pcgcctl_type
  • pcgcctl_bit : otg_pcgcctl_type
  • pclen : adc_type
  • pcmfssel : spi_type
  • pcount : i2c_handle_type
  • pcpen : adc_type
  • pcswtrg : adc_type
  • pcten : adc_type
  • pctesel_h : adc_type
  • pctesel_l : adc_type
  • pcvmen : adc_type
  • pd01_gmux : iomux_type
  • pd01_mux : iomux_type
  • pdev_type : msc_scsi_data_inquiry
  • pdt1 : adc_type
  • pdt1_bit : adc_type
  • pdt2 : adc_type
  • pdt2_bit : adc_type
  • pdt3 : adc_type
  • pdt3_bit : adc_type
  • pdt4 : adc_type
  • pdt4_bit : adc_type
  • pecen : i2c_type
  • pecerr : i2c_type
  • pecten : i2c_type
  • pecval : i2c_type
  • pen : usart_type
  • perfrint : otg_device_type
  • peripheral_base_addr : dma_init_type
  • peripheral_data_width : dma_init_type
  • peripheral_inc_enable : dma_init_type
  • permanent_write_protect : sd_csd_struct_type
  • permode : i2c_type
  • perr : usart_type
  • perrien : usart_type
  • pft_en : flash_type
  • pft_enf : flash_type
  • phy_itface : usb_core_cfg
  • pid : debug_type, otg_hchannel_type
  • pincm : dma_channel_type
  • piusftrst : otg_global_type
  • pktcnt : otg_eptin_type, otg_eptout_type, otg_hchannel_type
  • pktsts : otg_global_type
  • pll : crm_type
  • pll_bit : crm_type
  • pllcfgen : crm_type
  • pllen : crm_type
  • pllfr : crm_type
  • pllfref : crm_type
  • pllhextdiv : crm_type
  • pllms : crm_type
  • pllmult_h : crm_type
  • pllmult_l : crm_type
  • pllns : crm_type
  • pllrcs : crm_type
  • pllstbl : crm_type
  • pllstblf : crm_type
  • pllstblfc : crm_type
  • pllstblien : crm_type
  • pmen : tmr_type
  • pndwt : sdio_type
  • polcfg1 : exint_type
  • polcfg1_bit : exint_type
  • polcfg2 : exint_type
  • polcfg2_bit : exint_type
  • poll_timer : usbh_hid_type, usbh_msc_type
  • porrstf : crm_type
  • pr : tmr_type
  • pr_bit : tmr_type
  • prben : tmr_type
  • pre_state : usbh_msc_unit_type
  • prgmerr : flash_type
  • priority : dma_init_type
  • product : msc_scsi_data_inquiry
  • product_name1 : sd_cid_struct_type
  • product_name2 : sd_cid_struct_type
  • product_reversion : sd_cid_struct_type
  • product_sn : sd_cid_struct_type
  • protocol : usbh_hid_type, usbh_msc_type
  • prsf_enable : can_base_type
  • prsfen : can_type
  • prtaddr : otg_hchannel_type
  • prtcondet : otg_host_type
  • prtconsts : otg_host_type
  • prtena : otg_host_type
  • prtenchng : otg_host_type
  • prtint : otg_global_type
  • prtintmsk : otg_global_type
  • prtlnsts : otg_host_type
  • prtovrcact : otg_host_type
  • prtovrcchng : otg_host_type
  • prtpwr : otg_host_type
  • prtres : otg_host_type
  • prtrst : otg_host_type
  • prtspd : otg_host_type
  • prtsusp : otg_host_type
  • prttsctl : otg_host_type
  • ps : sdio_type
  • psel : usart_type
  • psize : i2c_handle_type
  • psn1 : adc_type
  • psn2 : adc_type
  • psn3 : adc_type
  • psn4 : adc_type
  • psq : adc_type
  • psq_bit : adc_type
  • psr : flash_type
  • psr_bit : flash_type
  • ptd : can_type
  • ptos : tmr_type
  • ptxfemp : otg_global_type
  • ptxfemplvl : otg_global_type
  • ptxfempmsk : otg_global_type
  • ptxfsize : otg_global_type
  • ptxfspcavil : otg_host_type
  • ptxfstaddr : otg_global_type
  • ptxqspcavil : otg_host_type
  • ptxqtop : otg_host_type
  • pvmen : pwc_type
  • pvmof : pwc_type
  • pvmsel : pwc_type
  • pwcen : crm_type
  • pwcrst : crm_type
  • pwidth : dma_channel_type
  • pwrctrl : sdio_type
  • pwrctrl_bit : sdio_type
  • pwrdown : otg_global_type
  • pwroprgdne : otg_device_type
  • pwrsven : sdio_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- q -

  • qdzien : can_type
  • qdzif : can_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- r -

  • rca : sd_card_info_struct_type
  • rcden : ertc_type
  • rcrc : spi_type
  • rcrc_bit : spi_type
  • rdbf : i2c_type, spi_type, usart_type
  • rdbfie : spi_type
  • rdbfien : usart_type
  • rdwtmode : sdio_type
  • rdwtstart : sdio_type
  • rdwtstop : sdio_type
  • read_blk_misalign : sd_csd_struct_type
  • read_crc : flash_iap_type
  • ready : usbh_msc_unit_type
  • realrx : can_type
  • rec : can_type
  • remap : iomux_type
  • remap2 : iomux_type
  • remap2_bit : iomux_type
  • remap3 : iomux_type
  • remap3_bit : iomux_type
  • remap4 : iomux_type
  • remap4_bit : iomux_type
  • remap5 : iomux_type
  • remap5_bit : iomux_type
  • remap6 : iomux_type
  • remap6_bit : iomux_type
  • remap7 : iomux_type
  • remap7_bit : iomux_type
  • remap8 : iomux_type
  • remap8_bit : iomux_type
  • remap_bit : iomux_type
  • ren : usart_type
  • repeat_mode : adc_base_config_type
  • request_no : usb_audio_type
  • res : fat_dir_type
  • reserved : msc_scsi_data_inquiry, tmr_type
  • reserved1 : adc_type, can_fifo_mailbox_type, can_tx_mailbox_type, can_type, cbd_extended_type, cbd_typical_type, cmp_type, crc_type, crm_type, debug_type, dma_channel_type, dma_type, ertc_reg_date_type, ertc_reg_scal_type, ertc_reg_tadj_type, ertc_reg_time_type, ertc_reg_tsdt_type, ertc_reg_tstm_type, ertc_type, exint_type, flash_type, gpio_type, i2c_type, iomux_type, otg_device_type, otg_eptin_type, otg_eptout_type, otg_global_type, otg_hchannel_type, otg_host_type, otg_pcgcctl_type, pwc_type, sd_cid_struct_type, sd_csd_struct_type, sd_scr_struct_type, sdio_type, sense_type, spi_type, tmr_type, usart_type, wdt_type, wwdt_type
  • reserved2 : adc_type, can_tx_mailbox_type, can_type, cbd_extended_type, cbd_typical_type, cmp_type, crc_type, crm_type, debug_type, ertc_reg_date_type, ertc_reg_scal_type, ertc_reg_time_type, ertc_reg_tsdt_type, ertc_reg_tstm_type, ertc_type, flash_type, i2c_type, iomux_type, otg_device_type, otg_eptin_type, otg_eptout_type, otg_global_type, otg_hchannel_type, otg_host_type, otg_pcgcctl_type, pwc_type, sd_cid_struct_type, sd_csd_struct_type, sdio_type, sense_type, spi_type, tmr_type, usart_type
  • reserved3 : adc_type, can_type, cmp_type, crm_type, ertc_reg_time_type, ertc_reg_tstm_type, ertc_type, flash_type, i2c_type, iomux_type, otg_device_type, otg_eptin_type, otg_eptout_type, otg_global_type, otg_hchannel_type, sd_csd_struct_type, sense_type, usart_type
  • reserved4 : adc_type, can_type, cmp_type, crm_type, ertc_type, flash_type, iomux_type, otg_device_type, otg_global_type, sd_csd_struct_type
  • reserved5 : can_type, crm_type, ertc_type, flash_type, otg_global_type
  • reserved6 : can_type, crm_type, ertc_type, otg_global_type
  • reserved7 : crm_type
  • reserverd2 : sd_scr_struct_type
  • reserverd3 : sd_scr_struct_type
  • reset : i2c_type
  • respond_flag : iap_info_type
  • revid : crc_type
  • revision : msc_scsi_data_inquiry
  • revod : crc_type
  • rf0 : can_type
  • rf0_bit : can_type
  • rf0ff : can_type
  • rf0fien : can_type
  • rf0mien : can_type
  • rf0mn : can_type
  • rf0of : can_type
  • rf0oien : can_type
  • rf0r : can_type
  • rf1 : can_type
  • rf1_bit : can_type
  • rf1ff : can_type
  • rf1fien : can_type
  • rf1mien : can_type
  • rf1mn : can_type
  • rf1of : can_type
  • rf1oien : can_type
  • rf1r : can_type
  • rfc : can_fifo_mailbox_type
  • rfc_bit : can_fifo_mailbox_type
  • rfdt0 : can_fifo_mailbox_type
  • rfdt1 : can_fifo_mailbox_type
  • rfdt2 : can_fifo_mailbox_type
  • rfdt3 : can_fifo_mailbox_type
  • rfdt4 : can_fifo_mailbox_type
  • rfdt5 : can_fifo_mailbox_type
  • rfdt6 : can_fifo_mailbox_type
  • rfdt7 : can_fifo_mailbox_type
  • rfdth : can_fifo_mailbox_type
  • rfdth_bit : can_fifo_mailbox_type
  • rfdtl : can_fifo_mailbox_type
  • rfdtl_bit : can_fifo_mailbox_type
  • rfeid : can_fifo_mailbox_type
  • rffmn : can_fifo_mailbox_type
  • rffri : can_fifo_mailbox_type
  • rfi : can_fifo_mailbox_type
  • rfi_bit : can_fifo_mailbox_type
  • rfidi : can_fifo_mailbox_type
  • rfsid : can_fifo_mailbox_type
  • rfts : can_fifo_mailbox_type
  • risetime : i2c_type
  • rld : wdt_type
  • rld_bit : wdt_type
  • rldf : wdt_type, wwdt_type
  • rldien : wwdt_type
  • rm : usart_type
  • rmb : msc_scsi_data_inquiry
  • roerr : spi_type, usart_type
  • rpen : adc_type
  • rpr : tmr_type
  • rpr_bit : tmr_type
  • rpx : exint_type
  • rsaw : can_type
  • rsaw_size : can_baudrate_type
  • rsp1 : sdio_type
  • rsp1_bit : sdio_type
  • rsp2 : sdio_type
  • rsp2_bit : sdio_type
  • rsp3 : sdio_type
  • rsp3_bit : sdio_type
  • rsp4 : sdio_type
  • rsp4_bit : sdio_type
  • rsp_type : sdio_command_struct_type
  • rspcmd : sdio_type
  • rspcmd_bit : sdio_type
  • rspwt : sdio_type
  • rst : crc_type
  • rstfc : crm_type
  • rtsen : usart_type
  • rwkupsig : otg_device_type
  • rx_addr : usb_ept_info
  • rxbuf : sdio_type
  • rxbufe : sdio_type
  • rxbufeien : sdio_type
  • rxbuff : sdio_type
  • rxbuffien : sdio_type
  • rxbufh : sdio_type
  • rxbufhien : sdio_type
  • rxbufien : sdio_type
  • rxdpid_setupcnt : otg_eptout_type
  • rxerro : sdio_type
  • rxerroien : sdio_type
  • rxfdep : otg_global_type
  • rxfflsh : otg_global_type
  • rxflvl : otg_global_type
  • rxflvlmsk : otg_global_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- s -

  • s : ertc_reg_alarm_type, ertc_reg_time_type, ertc_reg_tstm_type, ertc_type
  • sbf : usart_type
  • sbiterr : sdio_type
  • sbiterrien : sdio_type
  • sbs : ertc_type
  • sbs_bit : ertc_type
  • sbsmsk : ertc_type
  • scal : ertc_reg_scal_type, ertc_type
  • scal_bit : ertc_reg_scal_type, ertc_type
  • scgt : usart_type
  • sclk_freq : crm_clocks_freq_type
  • sclksel : crm_type
  • sclksts : crm_type
  • scmen : usart_type
  • scnacken : usart_type
  • scr : gpio_type
  • scr_bit : gpio_type
  • scr_structure : sd_scr_struct_type
  • sd_bus_width : sd_scr_struct_type
  • sd_cid_reg : sd_card_info_struct_type
  • sd_csd_reg : sd_card_info_struct_type
  • sd_scr_reg : sd_card_info_struct_type
  • sd_security : sd_scr_struct_type
  • sd_spec : sd_scr_struct_type
  • sd_spec3 : sd_scr_struct_type
  • sdio1_gmux : iomux_type
  • sdio1en : crm_type
  • sec : ertc_alarm_value_type, ertc_time_type
  • secers : flash_type
  • sector_mask : flash_iap_type
  • sector_size : flash_iap_type, iap_info_type
  • sef : pwc_type
  • selpin : iomux_type
  • selport : iomux_type
  • sense_key : sense_type
  • sequence_mode : adc_base_config_type
  • sesenddet : otg_global_type
  • setd0pid : otg_eptin_type, otg_eptout_type
  • setd1pid : otg_eptin_type, otg_eptout_type
  • setup : otg_eptout_type
  • setupmsk : otg_device_type
  • sftdiscon : otg_device_type
  • sgnpinak : otg_device_type
  • sgoutnak : otg_device_type
  • slben : spi_type, usart_type
  • slbtd : spi_type
  • sleep_debug : debug_type
  • slib_dat_ss : flash_type
  • slib_dss_set : flash_type
  • slib_enf : flash_type
  • slib_es : flash_type
  • slib_es_set : flash_type
  • slib_misc_sts : flash_type
  • slib_misc_sts_bit : flash_type
  • slib_pclr_val : flash_type
  • slib_pset_val : flash_type
  • slib_pwd_clr : flash_type
  • slib_pwd_clr_bit : flash_type
  • slib_pwd_err : flash_type
  • slib_pwd_ok : flash_type
  • slib_set_pwd : flash_type
  • slib_set_pwd_bit : flash_type
  • slib_set_range : flash_type
  • slib_set_range_bit : flash_type
  • slib_ss : flash_type
  • slib_ss_set : flash_type
  • slib_sts0 : flash_type
  • slib_sts0_bit : flash_type
  • slib_sts1 : flash_type
  • slib_sts1_bit : flash_type
  • slib_ukval : flash_type
  • slib_ulkf : flash_type
  • slib_unlock : flash_type
  • slib_unlock_bit : flash_type
  • smbalert : i2c_type
  • smbmode : i2c_type
  • smsel : tmr_type
  • snak : otg_eptin_type, otg_eptout_type
  • snpm : otg_eptout_type
  • sof : otg_global_type
  • sof_out : usb_core_cfg
  • soffn : otg_device_type
  • sofmsk : otg_global_type
  • sofouten : otg_global_type
  • spec_version : sd_csd_struct_type
  • speed : i2c_type, usb_core_cfg, usb_hch_type
  • speedmode : i2c_type
  • spi1_gmux : iomux_type
  • spi1_mux_h : iomux_type
  • spi1_mux_l : iomux_type
  • spi1en : crm_type
  • spi1rst : crm_type
  • spi2_gmux : iomux_type
  • spi2en : crm_type
  • spi2rst : crm_type
  • spien : spi_type
  • spk_alt_setting : usb_audio_type
  • spk_buffer : audio_codec_type
  • spk_calc : audio_codec_type
  • spk_enable : audio_codec_type
  • spk_freq : audio_codec_type, usb_audio_type
  • spk_mute : audio_codec_type, usb_audio_type
  • spk_rend : audio_codec_type
  • spk_roff : audio_codec_type
  • spk_rtotal : audio_codec_type
  • spk_stage : audio_codec_type
  • spk_threshold : audio_codec_type
  • spk_tx_size : audio_codec_type
  • spk_volume : audio_codec_type, usb_audio_type
  • spk_volume_limits : usb_audio_type
  • spk_woff : audio_codec_type
  • spk_wtotal : audio_codec_type
  • spltena : otg_hchannel_type
  • sprst : can_type
  • spt1 : adc_type
  • spt1_bit : adc_type
  • spt2 : adc_type
  • spt2_bit : adc_type
  • sqen : adc_type
  • sramen : crm_type
  • src_sel0 : dma_type
  • src_sel0_bit : dma_type
  • src_sel1 : dma_type
  • src_sel1_bit : dma_type
  • ssb : usd_type
  • stall : otg_eptin_type, otg_eptout_type, otg_hchannel_type, usb_ept_info, usb_hch_type
  • stallmsk : otg_hchannel_type
  • standard_id : can_rx_message_type, can_tx_message_type
  • standby_debug : debug_type
  • startf : i2c_type
  • state : iap_info_type, usb_hch_type, usbh_hid_type, usbh_msc_type, usbh_msc_unit_type
  • status : i2c_handle_type, usb_ept_info, usb_hch_type
  • stctrl : tmr_type
  • stctrl_bit : tmr_type
  • stdby_rst : flash_type
  • stdsel : spi_type
  • stis : tmr_type
  • stopbn : usart_type
  • stopf : i2c_type
  • stoppclk : otg_pcgcctl_type
  • stretch : i2c_type
  • sts : adc_type, dma_type, ertc_type, flash_type, sdio_type, spi_type, tmr_type, usart_type, wdt_type, wwdt_type
  • sts1 : i2c_type
  • sts1_bit : i2c_type
  • sts2 : i2c_type
  • sts2_bit : i2c_type
  • sts_bit : adc_type, dma_type, ertc_type, flash_type, sdio_type, spi_type, usart_type, wdt_type, wwdt_type
  • suspendm : otg_pcgcctl_type
  • suspsts : otg_device_type
  • swcsen : spi_type
  • swcsil : spi_type
  • swef : pwc_type
  • swevt : tmr_type
  • swevt_bit : tmr_type
  • swjtag_conf : iomux_type
  • swjtag_gmux : iomux_type
  • swpen : pwc_type
  • swrstf : crm_type
  • swtrg : exint_type
  • swtrg_bit : exint_type
  • swtx : exint_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- t -

  • t : sc_atr_type
  • t0 : sc_atr_type
  • taac : sd_csd_struct_type
  • tadj : ertc_reg_tadj_type, ertc_type
  • tadj_bit : ertc_reg_tadj_type, ertc_type
  • tadjf : ertc_type
  • tail : usart_group_type
  • tamp : ertc_type
  • tamp_bit : ertc_type
  • tcien : can_type
  • tcrc : spi_type
  • tcrc_bit : spi_type
  • tdbe : i2c_type, spi_type, usart_type
  • tdbeie : spi_type
  • tdbeien : usart_type
  • tdc : i2c_type, usart_type
  • tdcien : usart_type
  • tden : tmr_type
  • tec : can_type
  • temp_write_protect : sd_csd_struct_type
  • ten : usart_type
  • tfrdir : sdio_type
  • tfren : sdio_type
  • tfrmode : sdio_type
  • tien : tmr_type
  • tim10_pause : debug_type
  • tim11_pause : debug_type
  • tim12_pause : debug_type
  • tim13_pause : debug_type
  • tim14_pause : debug_type
  • tim5_pause : debug_type
  • tim6_pause : debug_type
  • tim7_pause : debug_type
  • tim8_pause : debug_type
  • tim9_pause : debug_type
  • time : ertc_reg_time_type, ertc_type
  • time_bit : ertc_reg_time_type, ertc_type
  • timeout : i2c_handle_type, otg_eptin_type, sdio_data_struct_type, sdio_type
  • timeoutmsk : otg_device_type
  • tlength : sc_atr_type
  • tm0alf : can_type
  • tm0ct : can_type
  • tm0ef : can_type
  • tm0lpf : can_type
  • tm0tcf : can_type
  • tm0tef : can_type
  • tm0tsf : can_type
  • tm1alf : can_type
  • tm1ct : can_type
  • tm1ef : can_type
  • tm1lpf : can_type
  • tm1tcf : can_type
  • tm1tef : can_type
  • tm1tsf : can_type
  • tm2alf : can_type
  • tm2ct : can_type
  • tm2ef : can_type
  • tm2lpf : can_type
  • tm2tcf : can_type
  • tm2tef : can_type
  • tm2tsf : can_type
  • tmc : can_tx_mailbox_type
  • tmc_bit : can_tx_mailbox_type
  • tmdt0 : can_tx_mailbox_type
  • tmdt1 : can_tx_mailbox_type
  • tmdt2 : can_tx_mailbox_type
  • tmdt3 : can_tx_mailbox_type
  • tmdt4 : can_tx_mailbox_type
  • tmdt5 : can_tx_mailbox_type
  • tmdt6 : can_tx_mailbox_type
  • tmdt7 : can_tx_mailbox_type
  • tmdtbl : can_tx_mailbox_type
  • tmdth : can_tx_mailbox_type
  • tmdth_bit : can_tx_mailbox_type
  • tmdtl : can_tx_mailbox_type
  • tmdtl_bit : can_tx_mailbox_type
  • tmeid : can_tx_mailbox_type
  • tmfrsel : can_tx_mailbox_type
  • tmi : can_tx_mailbox_type
  • tmi_bit : can_tx_mailbox_type
  • tmidsel : can_tx_mailbox_type
  • tmnr : can_type
  • tmout : i2c_type
  • tmr10_gmux : iomux_type
  • tmr10en : crm_type
  • tmr10rst : crm_type
  • tmr11_gmux : iomux_type
  • tmr11en : crm_type
  • tmr11rst : crm_type
  • tmr1_bk1_cmp_gmux : iomux_type
  • tmr1_ch1_cmp_gmux : iomux_type
  • tmr1_gmux : iomux_type
  • tmr1_mux : iomux_type
  • tmr1_pause : debug_type
  • tmr1en : crm_type
  • tmr1rst : crm_type
  • tmr2_ch4_cmp_gmux : iomux_type
  • tmr2_gmux : iomux_type
  • tmr2_mux : iomux_type
  • tmr2_pause : debug_type
  • tmr2en : crm_type
  • tmr2rst : crm_type
  • tmr3_ch1_cmp_gmux : iomux_type
  • tmr3_gmux : iomux_type
  • tmr3_mux : iomux_type
  • tmr3_pause : debug_type
  • tmr3en : crm_type
  • tmr3rst : crm_type
  • tmr4_pause : debug_type
  • tmr4en : crm_type
  • tmr4rst : crm_type
  • tmr5_gmux : iomux_type
  • tmr5ch4_gmux : iomux_type
  • tmr5ch4_mux : iomux_type
  • tmr5en : crm_type
  • tmr5rst : crm_type
  • tmr9_gmux : iomux_type
  • tmr9en : crm_type
  • tmr9rst : crm_type
  • tmren : tmr_type
  • tmrise : i2c_type
  • tmrise_bit : i2c_type
  • tmsid : can_tx_mailbox_type
  • tmsr : can_tx_mailbox_type
  • tmts : can_tx_mailbox_type
  • tmtsten : can_tx_mailbox_type
  • toggle_in : usb_hch_type
  • toggle_out : usb_hch_type
  • total_len : usb_ept_info
  • toutcal : otg_global_type
  • tp1edg : ertc_type
  • tp1en : ertc_type
  • tp1f : ertc_type
  • tpflt : ertc_type
  • tpfreq : ertc_type
  • tpien : ertc_type
  • tppr : ertc_type
  • tppu : ertc_type
  • tptsen : ertc_type
  • trace_ioen : debug_type
  • trace_mode : debug_type
  • trans_buf : usb_ept_info, usb_hch_type
  • trans_count : usb_hch_type
  • trans_len : usb_ept_info, usb_hch_type
  • trans_type : usb_ept_info
  • transfer_direction : sdio_data_struct_type
  • transfer_mode : sdio_data_struct_type
  • transmission_mode : spi_init_type
  • trgif : tmr_type
  • trgswtr : tmr_type
  • trmode : i2c_type
  • ts : sc_atr_type
  • tsdt : ertc_reg_tsdt_type, ertc_type
  • tsdt_bit : ertc_reg_tsdt_type, ertc_type
  • tsedg : ertc_type
  • tsen : ertc_type
  • tsf : ertc_type
  • tsien : ertc_type
  • tsof : ertc_type
  • tssbs : ertc_type
  • tssbs_bit : ertc_type
  • tstctl : otg_device_type
  • tstm : ertc_reg_tstm_type, ertc_type
  • tstm_bit : ertc_reg_tstm_type, ertc_type
  • tsts : can_type
  • tsts_bit : can_type
  • ttc_enable : can_base_type
  • ttcen : can_type
  • tuerr : spi_type
  • tx_addr : usb_ept_info
  • tx_length : iap_info_type
  • tx_mailbox : can_type
  • txbuf : sdio_type
  • txbufe : sdio_type
  • txbufeien : sdio_type
  • txbuff : sdio_type
  • txbuffien : sdio_type
  • txbufh : sdio_type
  • txbufhien : sdio_type
  • txbufien : sdio_type
  • txerru : sdio_type
  • txerruien : sdio_type
  • txfemp : otg_eptin_type
  • txfflsh : otg_global_type
  • txfifoudrmsk : otg_device_type
  • txfnum : otg_eptin_type, otg_global_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- u -

  • uart4_gmux : iomux_type
  • uart4en : crm_type
  • uart4rst : crm_type
  • uart5en : crm_type
  • uart5rst : crm_type
  • uen : usart_type
  • ukval : flash_type
  • unlock : flash_type
  • unlock_bit : flash_type
  • updf : ertc_type
  • urb_sts : usb_hch_type
  • usart1_gmux : iomux_type
  • usart1_mux : iomux_type
  • usart1en : crm_type
  • usart1rst : crm_type
  • usart2en : crm_type
  • usart2rst : crm_type
  • usart3_gmux : iomux_type
  • usart3_mux : iomux_type
  • usart3en : crm_type
  • usart3rst : crm_type
  • usb_id : usb_core_cfg
  • usb_reg : otg_core_type
  • usbacept : otg_eptin_type, otg_eptout_type
  • usbbufs : crm_type
  • usbdiv_h : crm_type
  • usbdiv_l : crm_type
  • usbdivrst : crm_type
  • usben : crm_type
  • usbrst : crm_type, otg_global_type
  • usbrstmsk : otg_global_type
  • usbsusp : otg_global_type
  • usbsuspmsk : otg_global_type
  • usbtrdtim : otg_global_type
  • usd : flash_type
  • usd_bit : flash_type
  • usd_ukval : flash_type
  • usd_unlock : flash_type
  • usd_unlock_bit : flash_type
  • usderr : flash_type
  • usders : flash_type
  • usdprgm : flash_type
  • usdulks : flash_type
  • use_lun : usbh_msc_type
  • user_d0 : flash_type
  • user_d1 : flash_type
  • userid : otg_global_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- v -

  • val : ertc_type
  • vbusig : otg_global_type, usb_core_cfg
  • vendor : msc_scsi_data_inquiry
  • version : msc_scsi_data_inquiry
  • vmcsel : adc_type
  • vmhb : adc_type
  • vmhb_bit : adc_type
  • vmlb : adc_type
  • vmlb_bit : adc_type
  • vmor : adc_type
  • vmorien : adc_type
  • vmsgen : adc_type
  • vrsel : pwc_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- w -

  • wait_type : sdio_command_struct_type
  • wat : ertc_type
  • wat_bit : ertc_type
  • watclk : ertc_type
  • waten : ertc_type
  • watf : ertc_type
  • watien : ertc_type
  • watwf : ertc_type
  • wdt_ato_en : flash_type
  • wdt_pause : debug_type
  • wdtrstf : crm_type
  • week : ertc_alarm_value_type, ertc_time_type
  • week_date_sel : ertc_alarm_value_type
  • win : wwdt_type
  • wIndex : usb_setup_type
  • wItemLength : usb_hid_desc_type
  • wk : ertc_reg_date_type, ertc_reg_tsdt_type, ertc_type
  • wksel : ertc_reg_alarm_type, ertc_type
  • wkupint : otg_global_type
  • wkupintmsk : otg_global_type
  • wLength : usb_setup_type
  • wMaxPacketSize : usb_endpoint_desc_type
  • wp : ertc_type
  • wp_bit : ertc_type
  • wp_level : tmr_brkdt_config_type
  • wpc : tmr_type
  • wpen0 : gpio_type
  • wpen1 : gpio_type
  • wpen10 : gpio_type
  • wpen11 : gpio_type
  • wpen12 : gpio_type
  • wpen13 : gpio_type
  • wpen14 : gpio_type
  • wpen15 : gpio_type
  • wpen2 : gpio_type
  • wpen3 : gpio_type
  • wpen4 : gpio_type
  • wpen5 : gpio_type
  • wpen6 : gpio_type
  • wpen7 : gpio_type
  • wpen8 : gpio_type
  • wpen9 : gpio_type
  • wpr : gpio_type
  • wpr_bit : gpio_type
  • wpseq : gpio_type
  • write_addr : flash_iap_type
  • write_blk_misalign : sd_csd_struct_type
  • write_crc : flash_iap_type
  • write_data : fat_dir_type
  • write_protect_group_enable : sd_csd_struct_type
  • write_protect_group_size : sd_csd_struct_type
  • write_speed_factor : sd_csd_struct_type
  • write_time : fat_dir_type
  • wtcyc : flash_type
  • wTotalLength : usb_configuration_desc_type
  • wum : usart_type
  • wValue : usb_setup_type
  • wwdt_pause : debug_type
  • wwdten : crm_type, wwdt_type
  • wwdtrst : crm_type
  • wwdtrstf : crm_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- x -

  • x : usb_hid_mouse_type
  • xacterr : otg_hchannel_type
  • xacterrmsk : otg_hchannel_type
  • xactpos : otg_hchannel_type
  • xferc : otg_eptin_type, otg_eptout_type, otg_hchannel_type
  • xfercmsk : otg_device_type, otg_hchannel_type
  • xfersize : otg_eptin_type, otg_eptout_type, otg_hchannel_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- y -

  • y : ertc_reg_date_type, ertc_type, usb_hid_mouse_type
  • year : ertc_time_type


AT32F415 Firmwary Library: Data Fields

Here is a list of all struct and union fields with links to the structures/unions they belong to:

- z -

  • z : usb_hid_mouse_type


AT32F415 Firmwary Library: Data Fields - Variables

- a -

  • ack : otg_hchannel_type
  • acken : i2c_type
  • ackfail : i2c_type
  • ackmsk : otg_hchannel_type
  • acs : spi_type
  • adc1_eto_gmux : iomux_type
  • adc1_etp_gmux : iomux_type
  • adc1_extrgord_mux : iomux_type
  • adc1_extrgpre_mux : iomux_type
  • adc1en : crm_type
  • adc1rst : crm_type
  • adc_freq : crm_clocks_freq_type
  • adcal : adc_type
  • adcalinit : adc_type
  • adcdiv_h : crm_type
  • adcdiv_l : crm_type
  • adcen : adc_type
  • add : ertc_reg_scal_type, ertc_type
  • add1h : ertc_type
  • add1s : ertc_reg_tadj_type, ertc_type
  • addr : flash_type, tmr_type
  • addr1 : i2c_type
  • addr1mode : i2c_type
  • addr2 : i2c_type
  • addr2en : i2c_type
  • addr7f : i2c_type
  • addr_bit : flash_type
  • address : cbd_extended_type, cbd_typical_type, usb_hch_type
  • addrhf : i2c_type
  • aebo_enable : can_base_type
  • aeboen : can_type
  • aed_enable : can_base_type
  • aeden : can_type
  • ahb_freq : crm_clocks_freq_type
  • ahbdiv : crm_type
  • ahben : crm_type
  • ahben_bit : crm_type
  • ahbidle : otg_global_type
  • ahbrst : crm_type
  • ahbrst_bit : crm_type
  • ala : ertc_reg_alarm_type, ertc_type
  • ala_bit : ertc_reg_alarm_type, ertc_type
  • alaen : ertc_type
  • alaf : ertc_type
  • alaien : ertc_type
  • alasbs : ertc_type
  • alasbs_bit : ertc_type
  • alawf : ertc_type
  • alb : ertc_type
  • alb_bit : ertc_type
  • alben : ertc_type
  • albf : ertc_type
  • albien : ertc_type
  • albsbs : ertc_type
  • albsbs_bit : ertc_type
  • albwf : ertc_type
  • alertf : i2c_type
  • alloc_length : cbd_extended_type, cbd_typical_type
  • ampm : ertc_alarm_value_type, ertc_reg_alarm_type, ertc_reg_time_type, ertc_reg_tstm_type, ertc_time_type, ertc_type
  • aoen : tmr_type
  • apb1_freq : crm_clocks_freq_type
  • apb1div : crm_type
  • apb1en : crm_type
  • apb1en_bit : crm_type
  • apb1rst : crm_type
  • apb1rst_bit : crm_type
  • apb2_freq : crm_clocks_freq_type
  • apb2div : crm_type
  • apb2en : crm_type
  • apb2en_bit : crm_type
  • apb2rst : crm_type
  • apb2rst_bit : crm_type
  • app_address : iap_info_type
  • argu : sdio_type
  • argu_bit : sdio_type
  • argument : sdio_command_struct_type
  • arlost : i2c_type
  • arpen : i2c_type
  • as_length : sense_type
  • asc : sense_type
  • ascq : sense_type
  • attr : fat_dir_type
  • audio_bitw : audio_codec_type
  • audio_cmd : usb_audio_type
  • audio_cmd_len : usb_audio_type
  • audio_feed_back : usb_audio_type
  • audio_freq : audio_codec_type
  • audio_mic_data : usb_audio_type
  • audio_protocol : i2s_init_type
  • audio_sampling_freq : i2s_init_type
  • audio_spk_data : usb_audio_type
  • auto_output_enable : tmr_brkdt_config_type
  • auto_step_en : crm_type
  • avalidsesen : otg_global_type


AT32F415 Firmwary Library: Data Fields - Variables

- b -

  • b2bsetupmsk : otg_device_type
  • b2pstup : otg_eptout_type
  • bAlternateSetting : usb_interface_desc_type
  • bankers : flash_type
  • baudr : usart_type
  • baudr_bit : usart_type
  • baudrate_div : can_baudrate_type
  • bblerr : otg_hchannel_type
  • bblerrmsk : otg_hchannel_type
  • bCBWCBLength : cbw_type, msc_bot_cbw_type
  • bCBWLUN : cbw_type, msc_bot_cbw_type
  • bcdDevice : usb_device_desc_type
  • bcdHID : usb_hid_desc_type
  • bcdUSB : usb_device_desc_type
  • bcnt : otg_global_type
  • bConfigurationValue : usb_configuration_desc_type
  • bCountryCode : usb_hid_desc_type
  • bCSWStatus : csw_type, msc_bot_csw_type
  • bDescriptorType : usb_configuration_desc_type, usb_device_desc_type, usb_endpoint_desc_type, usb_header_desc_type, usb_hid_desc_type, usb_interface_desc_type
  • bDeviceClass : usb_device_desc_type
  • bDeviceProtocol : usb_device_desc_type
  • bDeviceSubClass : usb_device_desc_type
  • bEndpointAddress : usb_endpoint_desc_type
  • bf : spi_type
  • bfbn : usart_type
  • bff : usart_type
  • bfien : usart_type
  • bInterfaceClass : usb_interface_desc_type
  • bInterfaceNumber : usb_interface_desc_type
  • bInterfaceProtocol : usb_interface_desc_type
  • bInterfaceSubClass : usb_interface_desc_type
  • bInterval : usb_endpoint_desc_type
  • bitrate : linecoding_type
  • bLength : usb_configuration_desc_type, usb_device_desc_type, usb_endpoint_desc_type, usb_header_desc_type, usb_hid_desc_type, usb_interface_desc_type
  • blk_addr : msc_type
  • blk_len : msc_type
  • blk_nbr : msc_scsi_data_capacity, msc_type
  • blk_size : msc_scsi_data_capacity, msc_type
  • blksize : sdio_type
  • block_size : sdio_data_struct_type
  • bmAttributes : usb_configuration_desc_type, usb_endpoint_desc_type
  • bMaxPacketSize0 : usb_device_desc_type
  • bMaxPower : usb_configuration_desc_type
  • bmCBWFlags : cbw_type, msc_bot_cbw_type
  • bmRequestType : usb_setup_type
  • bnainmsk : otg_device_type
  • bnaoutmsk : otg_device_type
  • bNumConfigurations : usb_device_desc_type
  • bNumDescriptors : usb_hid_desc_type
  • bNumEndpoints : usb_interface_desc_type
  • bNumInterfaces : usb_configuration_desc_type
  • bof : can_type
  • boien : can_type
  • bot_state : msc_bot_trans_type
  • bot_status : msc_type
  • bot_trans : usbh_msc_type
  • bpdc : crm_type
  • bpdc_bit : crm_type
  • bpdrst : crm_type
  • bpr : ertc_type
  • bpren : crm_type
  • bpwen : pwc_type
  • brdiv : can_type
  • bReportDescriptorType : usb_hid_desc_type
  • bRequest : usb_setup_type
  • brk : tmr_type
  • brk_bit : tmr_type
  • brk_enable : tmr_brkdt_config_type
  • brk_polarity : tmr_brkdt_config_type
  • brken : tmr_type
  • brkie : tmr_type
  • brkif : tmr_type
  • brkswtr : tmr_type
  • brkv : tmr_type
  • btm_ap_enf : flash_type
  • btm_mode_set : flash_type
  • btm_mode_set_bit : flash_type
  • btmg : can_type
  • btmg_bit : can_type
  • bts1 : can_type
  • bts1_size : can_baudrate_type
  • bts2 : can_type
  • bts2_size : can_baudrate_type
  • buf : sdio_type, usart_group_type
  • buf_bit : sdio_type
  • bufcnt : sdio_type
  • bufcnt_bit : sdio_type
  • buffer : msc_bot_trans_type, usbh_hid_type, usbh_msc_type
  • buffer_size : dma_init_type
  • buserr : i2c_type
  • busws : sdio_type
  • busyf : i2c_type
  • button : usb_hid_mouse_type
  • bvalidsesen : otg_global_type
  • bypsen : sdio_type


AT32F415 Firmwary Library: Data Fields - Variables

- c -

  • c1c : tmr_type
  • c1cen : tmr_type
  • c1cios : tmr_type
  • c1cp : tmr_type
  • c1den : tmr_type
  • c1df : tmr_type
  • c1dt : tmr_type
  • c1dt_bit : tmr_type
  • c1en : tmr_type
  • c1idiv : tmr_type
  • c1ien : tmr_type
  • c1if : tmr_type
  • c1insel : tmr_type
  • c1ios : tmr_type
  • c1oben : tmr_type
  • c1octrl : tmr_type
  • c1oien : tmr_type
  • c1osen : tmr_type
  • c1p : tmr_type
  • c1rf : tmr_type
  • c1swtr : tmr_type
  • c2c : tmr_type
  • c2cen : tmr_type
  • c2cios : tmr_type
  • c2cp : tmr_type
  • c2den : tmr_type
  • c2df : tmr_type
  • c2dt : tmr_type
  • c2dt_bit : tmr_type
  • c2en : tmr_type
  • c2idiv : tmr_type
  • c2ien : tmr_type
  • c2if : tmr_type
  • c2ios : tmr_type
  • c2oben : tmr_type
  • c2octrl : tmr_type
  • c2oien : tmr_type
  • c2osen : tmr_type
  • c2p : tmr_type
  • c2rf : tmr_type
  • c2swtr : tmr_type
  • c3c : tmr_type
  • c3cen : tmr_type
  • c3cios : tmr_type
  • c3cp : tmr_type
  • c3den : tmr_type
  • c3df : tmr_type
  • c3dt : tmr_type
  • c3dt_bit : tmr_type
  • c3en : tmr_type
  • c3idiv : tmr_type
  • c3ien : tmr_type
  • c3if : tmr_type
  • c3ios : tmr_type
  • c3oben : tmr_type
  • c3octrl : tmr_type
  • c3oien : tmr_type
  • c3osen : tmr_type
  • c3p : tmr_type
  • c3rf : tmr_type
  • c3swtr : tmr_type
  • c4c : tmr_type
  • c4den : tmr_type
  • c4df : tmr_type
  • c4dt : tmr_type
  • c4dt_bit : tmr_type
  • c4en : tmr_type
  • c4idiv : tmr_type
  • c4ien : tmr_type
  • c4if : tmr_type
  • c4ios : tmr_type
  • c4oben : tmr_type
  • c4octrl : tmr_type
  • c4oien : tmr_type
  • c4osen : tmr_type
  • c4p : tmr_type
  • c4rf : tmr_type
  • c4swtr : tmr_type
  • cal16 : ertc_reg_scal_type, ertc_type
  • cal8 : ertc_reg_scal_type, ertc_type
  • caldir : ertc_type
  • caloen : ertc_type
  • calosel : ertc_type
  • calupdf : ertc_type
  • calval : ertc_type
  • can1_gmux : iomux_type
  • can1_pause : debug_type
  • can1en : crm_type
  • can1rst : crm_type
  • can2_pause : debug_type
  • can_mux : iomux_type
  • capacity : usbh_msc_unit_type
  • card_blk_size : sd_card_info_struct_type
  • card_capacity : sd_card_info_struct_type
  • card_cmd_classes : sd_csd_struct_type
  • card_type : sd_card_info_struct_type
  • cardsts1 : sdio_type
  • cardsts2 : sdio_type
  • cardsts3 : sdio_type
  • cardsts4 : sdio_type
  • cbctrl : tmr_type
  • cbw : msc_bot_trans_type
  • CBWCB : cbw_type, msc_bot_cbw_type
  • ccal : ertc_type
  • ccal_bit : ertc_type
  • ccalen : ertc_type
  • cce : adc_type
  • cceien : adc_type
  • ccen : spi_type
  • ccerr : spi_type
  • ccfs : tmr_type
  • ccsmen : sdio_type
  • cctrl : tmr_type
  • cctrl_bit : tmr_type
  • cdt : crc_type
  • cdt_bit : crc_type
  • cfden : crm_type
  • cfdf : crm_type
  • cfdfc : crm_type
  • cfg : crm_type, otg_core_type, wwdt_type
  • cfg_bit : crm_type, wwdt_type
  • cfghr : gpio_type
  • cfghr_bit : gpio_type
  • cfglr : gpio_type
  • cfglr_bit : gpio_type
  • cgnpinak : otg_device_type
  • cgoutnak : otg_device_type
  • ch1_src : dma_type
  • ch2_src : dma_type
  • ch3_src : dma_type
  • ch4_src : dma_type
  • ch5_src : dma_type
  • ch6_src : dma_type
  • ch7_src : dma_type
  • ch_num : usb_hch_type
  • change : usbh_msc_unit_type
  • chdis : otg_hchannel_type
  • chen : dma_channel_type
  • chena : otg_hchannel_type
  • chhltd : otg_hchannel_type
  • chhltdmsk : otg_hchannel_type
  • chin : usbh_hid_type, usbh_msc_type
  • chnum : otg_global_type
  • chout : usbh_hid_type, usbh_msc_type
  • chpl : dma_channel_type
  • cid_crc : sd_cid_struct_type
  • cidsts : otg_global_type
  • clkctrl : i2c_type, sdio_type
  • clkctrl_bit : i2c_type, sdio_type
  • clkdiv : tmr_type
  • clkdiv_h : sdio_type
  • clkdiv_l : sdio_type
  • clkegs : sdio_type
  • clken : usart_type
  • clkfreq : i2c_type
  • clkint : crm_type
  • clkint_bit : crm_type
  • clkoen : sdio_type
  • clkout_sel : crm_type
  • clkoutdiv : crm_type
  • clkpha : spi_type, usart_type
  • clkpol : spi_type, usart_type
  • clock_phase : spi_init_type
  • clock_polarity : i2s_init_type, spi_init_type
  • clr : dma_type, gpio_type
  • clr_bit : dma_type, gpio_type
  • clsef : pwc_type
  • clswef : pwc_type
  • clus_high : fat_dir_type
  • clus_low : fat_dir_type
  • cm1 : tmr_type
  • cm1_input_bit : tmr_type
  • cm1_output_bit : tmr_type
  • cm2 : tmr_type
  • cm2_input_bit : tmr_type
  • cm2_output_bit : tmr_type
  • cmd : ertc_type, wdt_type
  • cmd20_support : sd_scr_struct_type
  • cmd23_support : sd_scr_struct_type
  • cmd_addr : cmd_data_group_type
  • cmd_bit : wdt_type
  • cmd_buf : cmd_data_group_type
  • cmd_check : cmd_data_group_type
  • cmd_head : cmd_data_group_type
  • cmd_index : sdio_command_struct_type
  • cmd_state : msc_bot_trans_type
  • cmdcmpl : sdio_type
  • cmdcmplien : sdio_type
  • cmdctrl : sdio_type
  • cmdctrl_bit : sdio_type
  • cmdfail : sdio_type
  • cmdfailien : sdio_type
  • cmdidx : sdio_type
  • cmdrspcmpl : sdio_type
  • cmdrspcmplien : sdio_type
  • cmdtimeout : sdio_type
  • cmdtimeoutien : sdio_type
  • cmp1en : cmp_type
  • cmp1hyst : cmp_type
  • cmp1invsel : cmp_type
  • cmp1is : cmp_type
  • cmp1ninvsel : cmp_type
  • cmp1p : cmp_type
  • cmp1ssel : cmp_type
  • cmp1tag : cmp_type
  • cmp1value : cmp_type
  • cmp1wp : cmp_type
  • cmp2en : cmp_type
  • cmp2hyst : cmp_type
  • cmp2invsel : cmp_type
  • cmp2ninvsel : cmp_type
  • cmp2p : cmp_type
  • cmp2ssel : cmp_type
  • cmp2tag : cmp_type
  • cmp2value : cmp_type
  • cmp2wp : cmp_type
  • cmp_hysteresis : cmp_init_type
  • cmp_inverting : cmp_init_type
  • cmp_mux : iomux_type
  • cmp_non_inverting : cmp_init_type
  • cmp_output : cmp_init_type
  • cmp_polarity : cmp_init_type
  • cmp_speed : cmp_init_type
  • cmpen : crm_type
  • cmprst : crm_type
  • cnak : otg_eptin_type, otg_eptout_type
  • cnt : dma_channel_type, sdio_type, wwdt_type
  • cnt_dir : tmr_type
  • compsplt : otg_hchannel_type
  • conidschg : otg_global_type
  • conidschgmsk : otg_global_type
  • content_protect_app : sd_csd_struct_type
  • copy_flag : sd_csd_struct_type
  • core_id : usb_core_cfg
  • cotxpkt : otg_global_type
  • count : usart_group_type
  • cpoly : spi_type
  • cpoly_bit : spi_type
  • crc_addr : flash_type
  • crc_addr_bit : flash_type
  • crc_chkr : flash_type
  • crc_chkr_bit : flash_type
  • crc_ctrl : flash_type
  • crc_ctrl_bit : flash_type
  • crc_sn : flash_type
  • crc_strt : flash_type
  • crcen : crm_type
  • create_data : fat_dir_type
  • create_time : fat_dir_type
  • create_time_tenth : fat_dir_type
  • cs_mode_selection : spi_init_type
  • csd_crc : sd_csd_struct_type
  • csd_struct : sd_csd_struct_type
  • csftrst : otg_global_type
  • cspt0 : adc_type
  • cspt1 : adc_type
  • cspt10 : adc_type
  • cspt11 : adc_type
  • cspt12 : adc_type
  • cspt13 : adc_type
  • cspt14 : adc_type
  • cspt15 : adc_type
  • cspt16 : adc_type
  • cspt17 : adc_type
  • cspt2 : adc_type
  • cspt3 : adc_type
  • cspt4 : adc_type
  • cspt5 : adc_type
  • cspt6 : adc_type
  • cspt7 : adc_type
  • cspt8 : adc_type
  • cspt9 : adc_type
  • csw : msc_bot_trans_type
  • ctrl : crc_type, crm_type, debug_type, dma_channel_type, ertc_type, flash_type, pwc_type, wwdt_type
  • ctrl1 : adc_type, i2c_type, spi_type, tmr_type, usart_type
  • ctrl1_bit : adc_type, i2c_type, spi_type, tmr_type, usart_type
  • ctrl2 : adc_type, i2c_type, spi_type, tmr_type, usart_type
  • ctrl2_bit : adc_type, i2c_type, spi_type, tmr_type, usart_type
  • ctrl3 : usart_type
  • ctrl3_bit : usart_type
  • ctrl_bit : crc_type, crm_type, debug_type, dma_channel_type, ertc_type, flash_type, pwc_type, wwdt_type
  • ctrl_state : usbh_hid_type, usbh_msc_type
  • ctrlsts : crm_type, pwc_type
  • ctrlsts1 : cmp_type
  • ctrlsts1_bit : cmp_type
  • ctrlsts2 : cmp_type
  • ctrlsts2_bit : cmp_type
  • ctrlsts_bit : crm_type, pwc_type
  • ctscf : usart_type
  • ctscfien : usart_type
  • ctsen : usart_type
  • cur_lun : usbh_msc_type
  • curmod : otg_global_type
  • curmode : otg_global_type
  • curs : can_type
  • cuss : can_type
  • cval : tmr_type
  • cval_bit : tmr_type


AT32F415 Firmwary Library: Data Fields - Variables

- d -

  • d : ertc_reg_alarm_type, ertc_reg_date_type, ertc_reg_tsdt_type, ertc_type
  • daint : otg_device_type
  • daint_bit : otg_device_type
  • daintmsk : otg_device_type
  • daintmsk_bit : otg_device_type
  • data : can_rx_message_type, can_tx_message_type, linecoding_type, msc_bot_trans_type, msc_type
  • data0 : usd_type
  • data1 : usd_type
  • data_align : adc_base_config_type
  • data_channel_format : i2s_init_type
  • data_format : msc_scsi_data_inquiry
  • data_len : msc_type
  • data_length : sdio_data_struct_type
  • data_pid : usb_hch_type
  • data_stat_after_erase : sd_scr_struct_type
  • dataien : i2c_type
  • date : ertc_reg_date_type, ertc_type
  • date_bit : ertc_reg_date_type, ertc_type
  • day : ertc_alarm_value_type, ertc_time_type
  • dbn : usart_type
  • dCBWDataTransferLength : cbw_type, msc_bot_cbw_type
  • dCBWSignature : cbw_type, msc_bot_cbw_type, msc_bot_csw_type
  • dCBWTag : msc_bot_cbw_type, msc_bot_csw_type
  • dCBWTage : cbw_type
  • dcfg : otg_device_type
  • dcfg_bit : otg_device_type
  • dcmpen : cmp_type
  • dCSWDataResidue : csw_type, msc_bot_csw_type
  • dCSWSignature : csw_type
  • dCSWTag : csw_type
  • dctl : otg_device_type
  • dctl_bit : otg_device_type
  • deadtime : tmr_brkdt_config_type
  • dec : ertc_reg_scal_type, ertc_type
  • dec1h : ertc_type
  • decsbs : ertc_reg_tadj_type, ertc_type
  • deepsleep_debug : debug_type
  • depslp_rst : flash_type
  • devaddr : otg_device_type, otg_hchannel_type
  • devaddrf : i2c_type
  • device_size : sd_csd_struct_type
  • device_size_mult : sd_csd_struct_type
  • devspd : otg_device_type
  • diepctl : otg_eptin_type
  • diepctl_bit : otg_eptin_type
  • diepempmsk : otg_device_type
  • diepempmsk_bit : otg_device_type
  • diepint : otg_eptin_type
  • diepint_bit : otg_eptin_type
  • diepmsk : otg_device_type
  • diepmsk_bit : otg_device_type
  • dieptsiz : otg_eptin_type
  • dieptsiz_bit : otg_eptin_type
  • dieptxfn : otg_global_type
  • dieptxfn_bit : otg_global_type
  • dir : usb_hch_type
  • direction : dma_init_type
  • dirf : i2c_type
  • disconint : otg_global_type
  • disconintmsk : otg_global_type
  • div : ertc_type, tmr_type, usart_type, wdt_type, wwdt_type
  • div_bit : ertc_type, tmr_type, wdt_type
  • diva : ertc_type
  • divb : ertc_type
  • divf : wdt_type
  • dlc : can_rx_message_type, can_tx_message_type
  • dma1en : crm_type
  • dma2en : crm_type
  • dma_en : usb_core_cfg
  • dma_flex_en : dma_type
  • dma_init_struct : i2c_handle_type
  • dma_rx_channel : i2c_handle_type
  • dma_tx_channel : i2c_handle_type
  • dmactrl : tmr_type
  • dmactrl_bit : tmr_type
  • dmadt : tmr_type
  • dmadt_bit : tmr_type
  • dmaen : i2c_type, sdio_type
  • dmaend : i2c_type
  • dmaren : spi_type, usart_type
  • dmaten : spi_type, usart_type
  • docmd : sdio_type
  • docmdien : sdio_type
  • doepctl : otg_eptout_type
  • doepctl_bit : otg_eptout_type
  • doepint : otg_eptout_type
  • doepint_bit : otg_eptout_type
  • doepmsk : otg_device_type
  • doepmsk_bit : otg_device_type
  • doeptsiz : otg_eptout_type
  • doeptsiz_bit : otg_eptout_type
  • dorx : sdio_type
  • dorxien : sdio_type
  • dotx : sdio_type
  • dotxien : sdio_type
  • dpid : otg_eptin_type, otg_eptout_type, otg_global_type
  • dren : ertc_type
  • drs : tmr_type
  • dsr_implemented : sd_csd_struct_type
  • dsts : otg_device_type
  • dsts_bit : otg_device_type
  • dt : crc_type, ertc_type, i2c_type, sdio_type, spi_type, usart_type
  • dt1 : ertc_type
  • dt10 : ertc_type
  • dt10_bit : ertc_type
  • dt11 : ertc_type
  • dt11_bit : ertc_type
  • dt12 : ertc_type
  • dt12_bit : ertc_type
  • dt13 : ertc_type
  • dt13_bit : ertc_type
  • dt14 : ertc_type
  • dt14_bit : ertc_type
  • dt15 : ertc_type
  • dt15_bit : ertc_type
  • dt16 : ertc_type
  • dt16_bit : ertc_type
  • dt17 : ertc_type
  • dt17_bit : ertc_type
  • dt18 : ertc_type
  • dt18_bit : ertc_type
  • dt19 : ertc_type
  • dt19_bit : ertc_type
  • dt1_bit : ertc_type
  • dt2 : ertc_type
  • dt20 : ertc_type
  • dt20_bit : ertc_type
  • dt2_bit : ertc_type
  • dt3 : ertc_type
  • dt3_bit : ertc_type
  • dt4 : ertc_type
  • dt4_bit : ertc_type
  • dt5 : ertc_type
  • dt5_bit : ertc_type
  • dt6 : ertc_type
  • dt6_bit : ertc_type
  • dt7 : ertc_type
  • dt7_bit : ertc_type
  • dt8 : ertc_type
  • dt8_bit : ertc_type
  • dt9 : ertc_type
  • dt9_bit : ertc_type
  • dt_bit : crc_type, i2c_type, spi_type, usart_type
  • dtalign : adc_type
  • dtb : tmr_type
  • dtblkcmpl : sdio_type
  • dtblkcmplien : sdio_type
  • dtc : tmr_type
  • dtcmpl : sdio_type
  • dtcmplien : sdio_type
  • dtcnt : dma_channel_type, sdio_type
  • dtcnt_bit : dma_channel_type, sdio_type
  • dtctrl : sdio_type
  • dtctrl_bit : sdio_type
  • dtd : dma_channel_type
  • dterrf1 : dma_type
  • dterrf2 : dma_type
  • dterrf3 : dma_type
  • dterrf4 : dma_type
  • dterrf5 : dma_type
  • dterrf6 : dma_type
  • dterrf7 : dma_type
  • dterrfc1 : dma_type
  • dterrfc2 : dma_type
  • dterrfc3 : dma_type
  • dterrfc4 : dma_type
  • dterrfc5 : dma_type
  • dterrfc6 : dma_type
  • dterrfc7 : dma_type
  • dterrien : dma_channel_type
  • dtfail : sdio_type
  • dtfailien : sdio_type
  • dtglerr : otg_hchannel_type
  • dtglerrmsk : otg_hchannel_type
  • dtlen : sdio_type
  • dtlen_bit : sdio_type
  • dttimeout : sdio_type
  • dttimeoutien : sdio_type
  • dttmr : sdio_type
  • dttmr_bit : sdio_type
  • dtxfsts : otg_eptin_type
  • dtxfsts_bit : otg_eptin_type
  • dutymode : i2c_type
  • dzc : can_type
  • dzen : can_type


AT32F415 Firmwary Library: Data Fields - Variables

- e -

  • eaf : can_type
  • eaien : can_type
  • ecc_code : sd_csd_struct_type
  • ecmben : tmr_type
  • edzien : can_type
  • edzif : can_type
  • em_slib_dat_ss : flash_type
  • em_slib_enf : flash_type
  • em_slib_iss_set : flash_type
  • em_slib_set : flash_type
  • em_slib_set_bit : flash_type
  • enpd : usb_audio_type
  • enumdone : otg_global_type
  • enumdonemsk : otg_global_type
  • enumspd : otg_device_type
  • eoien : can_type
  • eoif : can_type
  • eopf : otg_global_type
  • eopfmsk : otg_global_type
  • ep3_rmpen : crm_type
  • epdisd : otg_eptin_type, otg_eptout_type
  • epf : can_type
  • epien : can_type
  • epp0 : usd_type
  • epp1 : usd_type
  • epp2 : usd_type
  • epp3 : usd_type
  • epperr : flash_type
  • epps : flash_type
  • epps_bit : flash_type
  • ept0_slen : usb_ept_info
  • ept_address : usb_ept_info
  • ept_num : usb_core_cfg, usb_hch_type
  • ept_type : usb_hch_type
  • eptdir : otg_hchannel_type
  • eptdis : otg_eptin_type, otg_eptout_type
  • eptdismsk : otg_device_type
  • eptena : otg_eptin_type, otg_eptout_type
  • eptin : usbh_hid_type, usbh_msc_type
  • eptn : usb_ept_info
  • eptnum : otg_global_type, otg_hchannel_type
  • eptout : usbh_hid_type, usbh_msc_type
  • eptype : otg_eptin_type, otg_eptout_type, otg_hchannel_type
  • erase_group_size : sd_csd_struct_type
  • erase_group_size_mult : sd_csd_struct_type
  • erlysusp : otg_global_type
  • erlysuspmsk : otg_global_type
  • err_code : sense_type
  • errie : flash_type, spi_type
  • errien : i2c_type, usart_type
  • error : usbh_msc_type
  • error_code : i2c_handle_type
  • erstr : flash_type
  • ertcen : crm_type
  • ertcsel : crm_type
  • esdiv : tmr_type
  • esf : tmr_type
  • esp : tmr_type
  • ests : can_type
  • ests_bit : can_type
  • eticerr : otg_device_type
  • etr : can_type
  • etrien : can_type
  • evoen : iomux_type
  • evten : exint_type
  • evten_bit : exint_type
  • evtenx : exint_type
  • evtien : i2c_type
  • evtout : iomux_type
  • evtout_bit : iomux_type
  • exint0 : iomux_type
  • exint1 : iomux_type
  • exint10 : iomux_type
  • exint11 : iomux_type
  • exint12 : iomux_type
  • exint13 : iomux_type
  • exint14 : iomux_type
  • exint15 : iomux_type
  • exint2 : iomux_type
  • exint3 : iomux_type
  • exint4 : iomux_type
  • exint5 : iomux_type
  • exint6 : iomux_type
  • exint7 : iomux_type
  • exint8 : iomux_type
  • exint9 : iomux_type
  • exintc1 : iomux_type
  • exintc1_bit : iomux_type
  • exintc2 : iomux_type
  • exintc2_bit : iomux_type
  • exintc3 : iomux_type
  • exintc3_bit : iomux_type
  • exintc4 : iomux_type
  • exintc4_bit : iomux_type
  • exintrst : crm_type
  • extended_id : can_rx_message_type, can_tx_message_type


AT32F415 Firmwary Library: Data Fields - Variables

- f -

  • fa : flash_type
  • facfg : can_type
  • facfg_bit : can_type
  • faen0 : can_type
  • faen1 : can_type
  • faen10 : can_type
  • faen11 : can_type
  • faen12 : can_type
  • faen13 : can_type
  • faen2 : can_type
  • faen3 : can_type
  • faen4 : can_type
  • faen5 : can_type
  • faen6 : can_type
  • faen7 : can_type
  • faen8 : can_type
  • faen9 : can_type
  • fap : flash_type, usd_type
  • fap_hl : flash_type
  • fap_hl_dis : flash_type
  • fbn : spi_type
  • fbwcfg : can_type
  • fbwcfg_bit : can_type
  • fbwsel0 : can_type
  • fbwsel1 : can_type
  • fbwsel10 : can_type
  • fbwsel11 : can_type
  • fbwsel12 : can_type
  • fbwsel13 : can_type
  • fbwsel2 : can_type
  • fbwsel3 : can_type
  • fbwsel4 : can_type
  • fbwsel5 : can_type
  • fbwsel6 : can_type
  • fbwsel7 : can_type
  • fbwsel8 : can_type
  • fbwsel9 : can_type
  • fcs : can_type
  • fcsodis : tmr_type
  • fcsodis_state : tmr_brkdt_config_type
  • fcsoen : tmr_type
  • fcsoen_state : tmr_brkdt_config_type
  • fctrl : can_type
  • fctrl_bit : can_type
  • fdevmode : otg_global_type
  • fdtf1 : dma_type
  • fdtf2 : dma_type
  • fdtf3 : dma_type
  • fdtf4 : dma_type
  • fdtf5 : dma_type
  • fdtf6 : dma_type
  • fdtf7 : dma_type
  • fdtfc1 : dma_type
  • fdtfc2 : dma_type
  • fdtfc3 : dma_type
  • fdtfc4 : dma_type
  • fdtfc5 : dma_type
  • fdtfc6 : dma_type
  • fdtfc7 : dma_type
  • fdtien : dma_channel_type
  • ferr : usart_type
  • ffb : can_type
  • ffdb1 : can_filter_register_type
  • ffdb2 : can_filter_register_type
  • fhstmode : otg_global_type
  • fifo_length : iap_info_type
  • fifo_mailbox : can_type
  • fifo_size : usb_core_cfg
  • file_formart : sd_csd_struct_type
  • file_format_group : sd_csd_struct_type
  • file_name : fat_dir_type
  • file_size : fat_dir_type
  • file_write_nr : flash_iap_type
  • filter_activate_enable : can_filter_init_type
  • filter_bit : can_filter_init_type
  • filter_fifo : can_filter_init_type
  • filter_id_high : can_filter_init_type
  • filter_id_low : can_filter_init_type
  • filter_index : can_rx_message_type
  • filter_mask_high : can_filter_init_type
  • filter_mask_low : can_filter_init_type
  • filter_mode : can_filter_init_type
  • filter_number : can_filter_init_type
  • firmware_length : flash_iap_type
  • first_bit_transmission : spi_init_type
  • flag_address : iap_info_type
  • flash_app_addr : flash_iap_type
  • flash_app_size : flash_iap_type
  • flash_base_addr : flash_iap_type
  • flash_end_address : iap_info_type
  • flash_size : flash_iap_type, iap_info_type
  • flash_start_address : iap_info_type
  • flashen : crm_type
  • fmcfg : can_type
  • fmcfg_bit : can_type
  • fmsel0 : can_type
  • fmsel1 : can_type
  • fmsel10 : can_type
  • fmsel11 : can_type
  • fmsel12 : can_type
  • fmsel13 : can_type
  • fmsel2 : can_type
  • fmsel3 : can_type
  • fmsel4 : can_type
  • fmsel5 : can_type
  • fmsel6 : can_type
  • fmsel7 : can_type
  • fmsel8 : can_type
  • fmsel9 : can_type
  • fn : otg_global_type
  • format : linecoding_type
  • fprgm : flash_type
  • fpx : exint_type
  • frame_bit_num : spi_init_type
  • frame_type : can_rx_message_type, can_tx_message_type
  • frf : can_type
  • frf_bit : can_type
  • frfsel0 : can_type
  • frfsel1 : can_type
  • frfsel10 : can_type
  • frfsel11 : can_type
  • frfsel12 : can_type
  • frfsel13 : can_type
  • frfsel2 : can_type
  • frfsel3 : can_type
  • frfsel4 : can_type
  • frfsel5 : can_type
  • frfsel6 : can_type
  • frfsel7 : can_type
  • frfsel8 : can_type
  • frfsel9 : can_type
  • frint : otg_host_type
  • frmcntrst : otg_global_type
  • frmovrun : otg_hchannel_type
  • frmovrunmsk : otg_hchannel_type
  • frnum : otg_host_type
  • fslspclksel : otg_host_type
  • fslssupp : otg_host_type
  • ftrem : otg_host_type
  • fzc : can_type
  • fzen : can_type


AT32F415 Firmwary Library: Data Fields - Variables

- g -

  • g_audio_cur : usb_audio_type
  • gahbcfg : otg_global_type
  • gahbcfg_bit : otg_global_type
  • gcaddrf : i2c_type
  • gcaen : i2c_type
  • gccfg : otg_global_type
  • gccfg_bit : otg_global_type
  • gdiv : usart_type
  • gdiv_bit : usart_type
  • genstart : i2c_type
  • genstop : i2c_type
  • gf1 : dma_type
  • gf2 : dma_type
  • gf3 : dma_type
  • gf4 : dma_type
  • gf5 : dma_type
  • gf6 : dma_type
  • gf7 : dma_type
  • gfc1 : dma_type
  • gfc2 : dma_type
  • gfc3 : dma_type
  • gfc4 : dma_type
  • gfc5 : dma_type
  • gfc6 : dma_type
  • gfc7 : dma_type
  • ginnakeff : otg_global_type
  • ginnakeffmsk : otg_global_type
  • gintmsk : otg_global_type
  • gintmsk_bit : otg_global_type
  • gintsts : otg_global_type
  • gintsts_bit : otg_global_type
  • glbintmsk : otg_global_type
  • gnpinnaksts : otg_device_type
  • gnptxfsiz_ept0tx : otg_global_type
  • gnptxfsiz_ept0tx_bit : otg_global_type
  • gnptxsts : otg_global_type
  • gnptxsts_bit : otg_global_type
  • gotgctrl : otg_global_type
  • gotgctrl_bit : otg_global_type
  • gotgint : otg_global_type
  • gotgint_bit : otg_global_type
  • goutnakeff : otg_global_type
  • goutnakeffmsk : otg_global_type
  • goutnaksts : otg_device_type
  • gpio_drive_strength : gpio_init_type
  • gpio_mode : gpio_init_type
  • gpio_out_type : gpio_init_type
  • gpio_pins : gpio_init_type
  • gpio_pull : gpio_init_type
  • gpioaen : crm_type
  • gpioarst : crm_type
  • gpioben : crm_type
  • gpiobrst : crm_type
  • gpiocen : crm_type
  • gpiocrst : crm_type
  • gpioden : crm_type
  • gpiodrst : crm_type
  • gpiofen : crm_type
  • gpiofrst : crm_type
  • grstctl : otg_global_type
  • grstctl_bit : otg_global_type
  • grxfsiz : otg_global_type
  • grxfsiz_bit : otg_global_type
  • grxstsp : otg_global_type
  • grxstsp_bit : otg_global_type
  • grxstsr : otg_global_type
  • grxstsr_bit : otg_global_type
  • guid : otg_global_type
  • guid_bit : otg_global_type
  • gusbcfg : otg_global_type
  • gusbcfg_bit : otg_global_type


AT32F415 Firmwary Library: Data Fields - Variables

- h -

  • h : ertc_reg_alarm_type, ertc_reg_time_type, ertc_reg_tstm_type, ertc_type, sc_atr_type
  • haint : otg_host_type
  • haint_bit : otg_host_type
  • haintmsk : otg_host_type
  • haintmsk_bit : otg_host_type
  • hallde : tmr_type
  • hallien : tmr_type
  • hallif : tmr_type
  • hallswtr : tmr_type
  • hc_num : usb_core_cfg
  • hcchar : otg_hchannel_type
  • hcchar_bit : otg_hchannel_type
  • hcfg : otg_host_type
  • hcfg_bit : otg_host_type
  • hchint : otg_global_type
  • hchintmsk : otg_global_type
  • hcint : otg_hchannel_type
  • hcint_bit : otg_hchannel_type
  • hcintmsk : otg_hchannel_type
  • hcintmsk_bit : otg_hchannel_type
  • hcsplt : otg_hchannel_type
  • hcsplt_bit : otg_hchannel_type
  • hctsiz : otg_hchannel_type
  • hctsiz_bit : otg_hchannel_type
  • hdtf1 : dma_type
  • hdtf2 : dma_type
  • hdtf3 : dma_type
  • hdtf4 : dma_type
  • hdtf5 : dma_type
  • hdtf6 : dma_type
  • hdtf7 : dma_type
  • hdtfc1 : dma_type
  • hdtfc2 : dma_type
  • hdtfc3 : dma_type
  • hdtfc4 : dma_type
  • hdtfc5 : dma_type
  • hdtfc6 : dma_type
  • hdtfc7 : dma_type
  • hdtien : dma_channel_type
  • head : usart_group_type
  • hextbyps : crm_type
  • hexten : crm_type
  • hextstbl : crm_type
  • hextstblf : crm_type
  • hextstblfc : crm_type
  • hextstblien : crm_type
  • hfcen : sdio_type
  • hfcyc_en : flash_type
  • hfir : otg_host_type
  • hfir_bit : otg_host_type
  • hfnum : otg_host_type
  • hfnum_bit : otg_host_type
  • hick_to_sclk : crm_type
  • hick_to_usb : crm_type
  • hickcal : crm_type
  • hickcal_key : crm_type
  • hickdiv : crm_type
  • hicken : crm_type
  • hickstbl : crm_type
  • hickstblf : crm_type
  • hickstblfc : crm_type
  • hickstblien : crm_type
  • hicktrim : crm_type
  • hid_desc : usbh_hid_type
  • hlength : sc_atr_type
  • hm : ertc_type
  • hostaddrf : i2c_type
  • hour : ertc_alarm_value_type, ertc_time_type
  • hprt : otg_host_type
  • hprt_bit : otg_host_type
  • hptxfsiz : otg_global_type
  • hptxfsiz_bit : otg_global_type
  • hptxsts : otg_host_type
  • hptxsts_bit : otg_host_type
  • hubaddr : otg_hchannel_type
  • hwcsoe : spi_type


AT32F415 Firmwary Library: Data Fields - Variables

- i -

  • i2c1_gmux : iomux_type
  • i2c1_mux : iomux_type
  • i2c1_smbus_timeout : debug_type
  • i2c1en : crm_type
  • i2c1rst : crm_type
  • i2c2_gmux : iomux_type
  • i2c2_smbus_timeout : debug_type
  • i2c2en : crm_type
  • i2c2rst : crm_type
  • i2c3_smbus_timeout : debug_type
  • i2cen : i2c_type
  • i2cx : i2c_handle_type
  • i2scbn : spi_type
  • i2sclk : spi_type
  • i2sclk_bit : spi_type
  • i2sclkpol : spi_type
  • i2sctrl : spi_type
  • i2sctrl_bit : spi_type
  • i2sdbn : spi_type
  • i2sdiv_h : spi_type
  • i2sdiv_l : spi_type
  • i2sen : spi_type
  • i2smclkoe : spi_type
  • i2smsel : spi_type
  • i2sodd : spi_type
  • iap_address : iap_info_type
  • iap_fifo : iap_info_type
  • iap_rx : iap_info_type
  • iap_tx : iap_info_type
  • iConfiguration : usb_configuration_desc_type
  • id : usart_type
  • id_type : can_rx_message_type, can_tx_message_type
  • idcode_bit : debug_type
  • iden : tmr_type
  • iden_bit : tmr_type
  • idlef : usart_type
  • idleien : usart_type
  • idProduct : usb_device_desc_type
  • idt : crc_type, gpio_type
  • idt0 : gpio_type
  • idt1 : gpio_type
  • idt10 : gpio_type
  • idt11 : gpio_type
  • idt12 : gpio_type
  • idt13 : gpio_type
  • idt14 : gpio_type
  • idt15 : gpio_type
  • idt2 : gpio_type
  • idt3 : gpio_type
  • idt4 : gpio_type
  • idt5 : gpio_type
  • idt6 : gpio_type
  • idt7 : gpio_type
  • idt8 : gpio_type
  • idt9 : gpio_type
  • idt_bit : crc_type, gpio_type
  • idVendor : usb_device_desc_type
  • ieptint : otg_global_type
  • ieptintmsk : otg_global_type
  • iInterface : usb_interface_desc_type
  • iManufacturer : usb_device_desc_type
  • imen : ertc_type
  • imf : ertc_type
  • in_maxpacket : usbh_hid_type, usbh_msc_type
  • in_poll : usbh_hid_type, usbh_msc_type
  • incompip_incompisoout : otg_global_type
  • incompip_incompisooutmsk : otg_global_type
  • incompisoin : otg_global_type
  • incompisoinmsk : otg_global_type
  • ineptint : otg_device_type
  • ineptmsk : otg_device_type
  • ineptnak : otg_eptin_type
  • ineptnakmsk : otg_device_type
  • ineptxfdep : otg_global_type
  • ineptxfemsk : otg_device_type
  • ineptxfsav : otg_eptin_type
  • ineptxfstaddr : otg_global_type
  • information : sense_type
  • initf : ertc_type
  • inout : usb_ept_info
  • input_channel_select : tmr_input_config_type
  • input_filter_value : tmr_input_config_type
  • input_mapped_select : tmr_input_config_type
  • input_polarity_select : tmr_input_config_type
  • inquiry : usbh_msc_unit_type
  • intclr : sdio_type
  • intclr_bit : sdio_type
  • inten : can_type, exint_type, sdio_type
  • inten_bit : can_type, exint_type, sdio_type
  • intenx : exint_type
  • interface : usb_audio_type
  • intkneptmismsk : otg_device_type
  • intkntxfemp : otg_eptin_type
  • intkntxfempmsk : otg_device_type
  • intsts : exint_type
  • intsts_bit : exint_type
  • intwt : sdio_type
  • iocb0 : gpio_type
  • iocb1 : gpio_type
  • iocb10 : gpio_type
  • iocb11 : gpio_type
  • iocb12 : gpio_type
  • iocb13 : gpio_type
  • iocb14 : gpio_type
  • iocb15 : gpio_type
  • iocb2 : gpio_type
  • iocb3 : gpio_type
  • iocb4 : gpio_type
  • iocb5 : gpio_type
  • iocb6 : gpio_type
  • iocb7 : gpio_type
  • iocb8 : gpio_type
  • iocb9 : gpio_type
  • ioen : sdio_type
  • iofc0 : gpio_type
  • iofc1 : gpio_type
  • iofc10 : gpio_type
  • iofc11 : gpio_type
  • iofc12 : gpio_type
  • iofc13 : gpio_type
  • iofc14 : gpio_type
  • iofc15 : gpio_type
  • iofc2 : gpio_type
  • iofc3 : gpio_type
  • iofc4 : gpio_type
  • iofc5 : gpio_type
  • iofc6 : gpio_type
  • iofc7 : gpio_type
  • iofc8 : gpio_type
  • iofc9 : gpio_type
  • ioif : sdio_type
  • ioifien : sdio_type
  • iomc0 : gpio_type
  • iomc1 : gpio_type
  • iomc10 : gpio_type
  • iomc11 : gpio_type
  • iomc12 : gpio_type
  • iomc13 : gpio_type
  • iomc14 : gpio_type
  • iomc15 : gpio_type
  • iomc2 : gpio_type
  • iomc3 : gpio_type
  • iomc4 : gpio_type
  • iomc5 : gpio_type
  • iomc6 : gpio_type
  • iomc7 : gpio_type
  • iomc8 : gpio_type
  • iomc9 : gpio_type
  • iomuxen : crm_type
  • iomuxrst : crm_type
  • iosb0 : gpio_type
  • iosb1 : gpio_type
  • iosb10 : gpio_type
  • iosb11 : gpio_type
  • iosb12 : gpio_type
  • iosb13 : gpio_type
  • iosb14 : gpio_type
  • iosb15 : gpio_type
  • iosb2 : gpio_type
  • iosb3 : gpio_type
  • iosb4 : gpio_type
  • iosb5 : gpio_type
  • iosb6 : gpio_type
  • iosb7 : gpio_type
  • iosb8 : gpio_type
  • iosb9 : gpio_type
  • iosusp : sdio_type
  • iProduct : usb_device_desc_type
  • irdaen : usart_type
  • irdalp : usart_type
  • is_double_buffer : usb_ept_info
  • isdiv : usart_type
  • iSerialNumber : usb_device_desc_type
  • isooutdrop : otg_global_type
  • isooutdropmsk : otg_global_type
  • ists : tmr_type
  • ists_bit : tmr_type
  • itsrven : adc_type


AT32F415 Firmwary Library: Data Fields - Variables

- l -

  • l_unit_n : usbh_msc_type
  • last_access_data : fat_dir_type
  • last_len : usb_ept_info
  • lbcp : usart_type
  • lben : can_type
  • length : msc_scsi_data_inquiry
  • lextbyps : crm_type
  • lexten : crm_type
  • lextstbl : crm_type
  • lextstblf : crm_type
  • lextstblfc : crm_type
  • lextstblien : crm_type
  • licken : crm_type
  • lickstbl : crm_type
  • lickstblf : crm_type
  • lickstblfc : crm_type
  • lickstblien : crm_type
  • line_enable : exint_init_type
  • line_mode : exint_init_type
  • line_polarity : exint_init_type
  • line_select : exint_init_type
  • linen : usart_type
  • linex : exint_type
  • lm : dma_channel_type
  • loen : can_type
  • loop_mode_enable : dma_init_type
  • low_power : usb_core_cfg
  • lprstf : crm_type
  • lpsel : pwc_type
  • lsamprx : can_type
  • lspddev : otg_hchannel_type
  • ltf : spi_type
  • lun : cbd_extended_type, cbd_typical_type


AT32F415 Firmwary Library: Data Fields - Variables

- m -

  • m : ertc_reg_alarm_type, ertc_reg_date_type, ertc_reg_time_type, ertc_reg_tsdt_type, ertc_reg_tstm_type, ertc_type
  • m2m : dma_channel_type
  • mackctrl : i2c_type
  • maddr : dma_channel_type
  • maddr_bit : dma_channel_type
  • manufact_date : sd_cid_struct_type
  • manufacturer_default_ecc : sd_csd_struct_type
  • manufacturer_id : sd_cid_struct_type
  • mask : ertc_alarm_value_type
  • mask1 : ertc_reg_alarm_type, ertc_type
  • mask2 : ertc_reg_alarm_type, ertc_type
  • mask3 : ertc_reg_alarm_type, ertc_type
  • mask4 : ertc_reg_alarm_type, ertc_type
  • master_slave_mode : spi_init_type
  • max_bus_clk_freq : sd_csd_struct_type
  • max_lun : msc_type, usbh_msc_type
  • max_read_blk_length : sd_csd_struct_type
  • max_read_current_vdd_max : sd_csd_struct_type
  • max_read_current_vdd_min : sd_csd_struct_type
  • max_size : usb_core_cfg
  • max_write_blk_length : sd_csd_struct_type
  • max_write_current_vdd_max : sd_csd_struct_type
  • max_write_current_vdd_min : sd_csd_struct_type
  • maxpacket : usb_ept_info, usb_hch_type
  • mc : otg_eptin_type, otg_hchannel_type
  • mclk_freq_division : spi_init_type
  • mclk_output_enable : i2s_init_type
  • mctrl : can_type
  • mctrl_bit : can_type
  • mdiv_h : spi_type
  • mdiv_l : spi_type
  • mdrsel : can_type
  • mdrsel_selection : can_base_type
  • memory_base_addr : dma_init_type
  • memory_data_width : dma_init_type
  • memory_inc_enable : dma_init_type
  • mic_adj_count : audio_codec_type
  • mic_adj_stage : audio_codec_type
  • mic_alt_setting : usb_audio_type
  • mic_buffer : audio_codec_type
  • mic_calc : audio_codec_type
  • mic_delta : audio_codec_type
  • mic_enable : audio_codec_type
  • mic_freq : usb_audio_type
  • mic_mute : audio_codec_type, usb_audio_type
  • mic_roff : audio_codec_type
  • mic_rtotal : audio_codec_type
  • mic_rx_size : audio_codec_type
  • mic_stage : audio_codec_type
  • mic_volume : audio_codec_type, usb_audio_type
  • mic_volume_limits : usb_audio_type
  • mic_wend : audio_codec_type
  • mic_woff : audio_codec_type
  • mic_wtotal : audio_codec_type
  • min : ertc_alarm_value_type, ertc_time_type
  • mincm : dma_channel_type
  • misc1 : crm_type
  • misc1_bit : crm_type
  • misc2 : crm_type
  • misc2_bit : crm_type
  • mmerr : spi_type
  • mmssr : can_type
  • mmssr_selection : can_base_type
  • mode : i2c_handle_type
  • mode_selection : can_base_type
  • modemis : otg_global_type
  • modemismsk : otg_global_type
  • month : ertc_time_type
  • mps : otg_eptin_type, otg_eptout_type, otg_hchannel_type
  • msc_state : msc_type
  • msc_struct : msc_bot_trans_type
  • msc_up_status : flash_iap_type
  • mssel : adc_type
  • msten : spi_type
  • msts : can_type
  • msts_bit : can_type
  • mwidth : dma_channel_type


AT32F415 Firmwary Library: Data Fields - Variables

- n -

  • nak : otg_hchannel_type
  • nakmsk : otg_hchannel_type
  • naksts : otg_eptin_type, otg_eptout_type
  • nerr : usart_type
  • nptxfdep : otg_global_type
  • nptxfemp : otg_global_type
  • nptxfemplvl : otg_global_type
  • nptxfempmsk : otg_global_type
  • nptxfspcavail : otg_global_type
  • nptxfstaddr : otg_global_type
  • nptxqspcavail : otg_global_type
  • nptxqtop : otg_global_type
  • nrstf : crm_type
  • nsac : sd_csd_struct_type
  • ntc : spi_type
  • nzstsouthshk : otg_device_type


AT32F415 Firmwary Library: Data Fields - Variables

- o -

  • oaddr1 : i2c_type
  • oaddr1_bit : i2c_type
  • oaddr2 : i2c_type
  • oaddr2_bit : i2c_type
  • obf : flash_type
  • oc_idle_state : tmr_output_config_type
  • oc_mode : tmr_output_config_type
  • oc_output_state : tmr_output_config_type
  • oc_polarity : tmr_output_config_type
  • occ_idle_state : tmr_output_config_type
  • occ_output_state : tmr_output_config_type
  • occ_polarity : tmr_output_config_type
  • occs : adc_type
  • ocdmaen : adc_type
  • oclen : adc_type
  • ocmen : tmr_type
  • ocpcnt : adc_type
  • ocpen : adc_type
  • ocswtrg : adc_type
  • octen : adc_type
  • octesel_h : adc_type
  • octesel_l : adc_type
  • ocvmen : adc_type
  • oddfrm : otg_hchannel_type
  • odf : flash_type
  • odfie : flash_type
  • odt : adc_type, gpio_type
  • odt0 : gpio_type
  • odt1 : gpio_type
  • odt10 : gpio_type
  • odt11 : gpio_type
  • odt12 : gpio_type
  • odt13 : gpio_type
  • odt14 : gpio_type
  • odt15 : gpio_type
  • odt2 : gpio_type
  • odt3 : gpio_type
  • odt4 : gpio_type
  • odt5 : gpio_type
  • odt6 : gpio_type
  • odt7 : gpio_type
  • odt8 : gpio_type
  • odt9 : gpio_type
  • odt_bit : adc_type, gpio_type
  • oem_app_id : sd_cid_struct_type
  • oen : tmr_type
  • oeptint : otg_global_type
  • oeptintmsk : otg_global_type
  • opcode : cbd_extended_type, cbd_typical_type
  • operation_mode : i2s_init_type
  • opersel : spi_type
  • oplk : flash_type
  • ora : spi_type
  • ordinary_channel_length : adc_base_config_type
  • osn1 : adc_type
  • osn10 : adc_type
  • osn11 : adc_type
  • osn12 : adc_type
  • osn13 : adc_type
  • osn14 : adc_type
  • osn15 : adc_type
  • osn16 : adc_type
  • osn2 : adc_type
  • osn3 : adc_type
  • osn4 : adc_type
  • osn5 : adc_type
  • osn6 : adc_type
  • osn7 : adc_type
  • osn8 : adc_type
  • osn9 : adc_type
  • osq1 : adc_type
  • osq1_bit : adc_type
  • osq2 : adc_type
  • osq2_bit : adc_type
  • osq3 : adc_type
  • osq3_bit : adc_type
  • otg_extctrl : crm_type
  • otg_extctrl_bit : crm_type
  • otgint : otg_global_type
  • otgintmsk : otg_global_type
  • ouf : i2c_type
  • out_maxpacket : usbh_hid_type, usbh_msc_type
  • out_poll : usbh_hid_type, usbh_msc_type
  • outeptint : otg_device_type
  • outeptmsk : otg_device_type
  • outp : ertc_type
  • outperrmsk : otg_device_type
  • outsel : ertc_type
  • outtepd : otg_eptout_type
  • outtepdmsk : otg_device_type
  • outtype : ertc_type
  • ovfden : tmr_type
  • ovfen : tmr_type
  • ovfien : tmr_type
  • ovfif : tmr_type
  • ovfs : tmr_type
  • ovfswtr : tmr_type


AT32F415 Firmwary Library: Data Fields - Variables

- p -

  • paddr : dma_channel_type
  • paddr_bit : dma_channel_type
  • parity : linecoding_type
  • part_blk_read : sd_csd_struct_type
  • part_blk_write : sd_csd_struct_type
  • pbuff : i2c_handle_type
  • pcautoen : adc_type
  • pcce : adc_type
  • pcceien : adc_type
  • pccs : adc_type
  • pcdto1 : adc_type
  • pcdto1_bit : adc_type
  • pcdto2 : adc_type
  • pcdto2_bit : adc_type
  • pcdto3 : adc_type
  • pcdto3_bit : adc_type
  • pcdto4 : adc_type
  • pcdto4_bit : adc_type
  • pcgcctl : otg_pcgcctl_type
  • pcgcctl_bit : otg_pcgcctl_type
  • pclen : adc_type
  • pcmfssel : spi_type
  • pcount : i2c_handle_type
  • pcpen : adc_type
  • pcswtrg : adc_type
  • pcten : adc_type
  • pctesel_h : adc_type
  • pctesel_l : adc_type
  • pcvmen : adc_type
  • pd01_gmux : iomux_type
  • pd01_mux : iomux_type
  • pdev_type : msc_scsi_data_inquiry
  • pdt1 : adc_type
  • pdt1_bit : adc_type
  • pdt2 : adc_type
  • pdt2_bit : adc_type
  • pdt3 : adc_type
  • pdt3_bit : adc_type
  • pdt4 : adc_type
  • pdt4_bit : adc_type
  • pecen : i2c_type
  • pecerr : i2c_type
  • pecten : i2c_type
  • pecval : i2c_type
  • pen : usart_type
  • perfrint : otg_device_type
  • peripheral_base_addr : dma_init_type
  • peripheral_data_width : dma_init_type
  • peripheral_inc_enable : dma_init_type
  • permanent_write_protect : sd_csd_struct_type
  • permode : i2c_type
  • perr : usart_type
  • perrien : usart_type
  • pft_en : flash_type
  • pft_enf : flash_type
  • phy_itface : usb_core_cfg
  • pid : debug_type, otg_hchannel_type
  • pincm : dma_channel_type
  • piusftrst : otg_global_type
  • pktcnt : otg_eptin_type, otg_eptout_type, otg_hchannel_type
  • pktsts : otg_global_type
  • pll : crm_type
  • pll_bit : crm_type
  • pllcfgen : crm_type
  • pllen : crm_type
  • pllfr : crm_type
  • pllfref : crm_type
  • pllhextdiv : crm_type
  • pllms : crm_type
  • pllmult_h : crm_type
  • pllmult_l : crm_type
  • pllns : crm_type
  • pllrcs : crm_type
  • pllstbl : crm_type
  • pllstblf : crm_type
  • pllstblfc : crm_type
  • pllstblien : crm_type
  • pmen : tmr_type
  • pndwt : sdio_type
  • polcfg1 : exint_type
  • polcfg1_bit : exint_type
  • polcfg2 : exint_type
  • polcfg2_bit : exint_type
  • poll_timer : usbh_hid_type, usbh_msc_type
  • porrstf : crm_type
  • pr : tmr_type
  • pr_bit : tmr_type
  • prben : tmr_type
  • pre_state : usbh_msc_unit_type
  • prgmerr : flash_type
  • priority : dma_init_type
  • product : msc_scsi_data_inquiry
  • product_name1 : sd_cid_struct_type
  • product_name2 : sd_cid_struct_type
  • product_reversion : sd_cid_struct_type
  • product_sn : sd_cid_struct_type
  • protocol : usbh_hid_type, usbh_msc_type
  • prsf_enable : can_base_type
  • prsfen : can_type
  • prtaddr : otg_hchannel_type
  • prtcondet : otg_host_type
  • prtconsts : otg_host_type
  • prtena : otg_host_type
  • prtenchng : otg_host_type
  • prtint : otg_global_type
  • prtintmsk : otg_global_type
  • prtlnsts : otg_host_type
  • prtovrcact : otg_host_type
  • prtovrcchng : otg_host_type
  • prtpwr : otg_host_type
  • prtres : otg_host_type
  • prtrst : otg_host_type
  • prtspd : otg_host_type
  • prtsusp : otg_host_type
  • prttsctl : otg_host_type
  • ps : sdio_type
  • psel : usart_type
  • psize : i2c_handle_type
  • psn1 : adc_type
  • psn2 : adc_type
  • psn3 : adc_type
  • psn4 : adc_type
  • psq : adc_type
  • psq_bit : adc_type
  • psr : flash_type
  • psr_bit : flash_type
  • ptd : can_type
  • ptos : tmr_type
  • ptxfemp : otg_global_type
  • ptxfemplvl : otg_global_type
  • ptxfempmsk : otg_global_type
  • ptxfsize : otg_global_type
  • ptxfspcavil : otg_host_type
  • ptxfstaddr : otg_global_type
  • ptxqspcavil : otg_host_type
  • ptxqtop : otg_host_type
  • pvmen : pwc_type
  • pvmof : pwc_type
  • pvmsel : pwc_type
  • pwcen : crm_type
  • pwcrst : crm_type
  • pwidth : dma_channel_type
  • pwrctrl : sdio_type
  • pwrctrl_bit : sdio_type
  • pwrdown : otg_global_type
  • pwroprgdne : otg_device_type
  • pwrsven : sdio_type


AT32F415 Firmwary Library: Data Fields - Variables

- q -

  • qdzien : can_type
  • qdzif : can_type


AT32F415 Firmwary Library: Data Fields - Variables

- r -

  • rca : sd_card_info_struct_type
  • rcden : ertc_type
  • rcrc : spi_type
  • rcrc_bit : spi_type
  • rdbf : i2c_type, spi_type, usart_type
  • rdbfie : spi_type
  • rdbfien : usart_type
  • rdwtmode : sdio_type
  • rdwtstart : sdio_type
  • rdwtstop : sdio_type
  • read_blk_misalign : sd_csd_struct_type
  • read_crc : flash_iap_type
  • ready : usbh_msc_unit_type
  • realrx : can_type
  • rec : can_type
  • remap : iomux_type
  • remap2 : iomux_type
  • remap2_bit : iomux_type
  • remap3 : iomux_type
  • remap3_bit : iomux_type
  • remap4 : iomux_type
  • remap4_bit : iomux_type
  • remap5 : iomux_type
  • remap5_bit : iomux_type
  • remap6 : iomux_type
  • remap6_bit : iomux_type
  • remap7 : iomux_type
  • remap7_bit : iomux_type
  • remap8 : iomux_type
  • remap8_bit : iomux_type
  • remap_bit : iomux_type
  • ren : usart_type
  • repeat_mode : adc_base_config_type
  • request_no : usb_audio_type
  • res : fat_dir_type
  • reserved : msc_scsi_data_inquiry, tmr_type
  • reserved1 : adc_type, can_fifo_mailbox_type, can_tx_mailbox_type, can_type, cbd_extended_type, cbd_typical_type, cmp_type, crc_type, crm_type, debug_type, dma_channel_type, dma_type, ertc_reg_date_type, ertc_reg_scal_type, ertc_reg_tadj_type, ertc_reg_time_type, ertc_reg_tsdt_type, ertc_reg_tstm_type, ertc_type, exint_type, flash_type, gpio_type, i2c_type, iomux_type, otg_device_type, otg_eptin_type, otg_eptout_type, otg_global_type, otg_hchannel_type, otg_host_type, otg_pcgcctl_type, pwc_type, sd_cid_struct_type, sd_csd_struct_type, sd_scr_struct_type, sdio_type, sense_type, spi_type, tmr_type, usart_type, wdt_type, wwdt_type
  • reserved2 : adc_type, can_tx_mailbox_type, can_type, cbd_extended_type, cbd_typical_type, cmp_type, crc_type, crm_type, debug_type, ertc_reg_date_type, ertc_reg_scal_type, ertc_reg_time_type, ertc_reg_tsdt_type, ertc_reg_tstm_type, ertc_type, flash_type, i2c_type, iomux_type, otg_device_type, otg_eptin_type, otg_eptout_type, otg_global_type, otg_hchannel_type, otg_host_type, otg_pcgcctl_type, pwc_type, sd_cid_struct_type, sd_csd_struct_type, sdio_type, sense_type, spi_type, tmr_type, usart_type
  • reserved3 : adc_type, can_type, cmp_type, crm_type, ertc_reg_time_type, ertc_reg_tstm_type, ertc_type, flash_type, i2c_type, iomux_type, otg_device_type, otg_eptin_type, otg_eptout_type, otg_global_type, otg_hchannel_type, sd_csd_struct_type, sense_type, usart_type
  • reserved4 : adc_type, can_type, cmp_type, crm_type, ertc_type, flash_type, iomux_type, otg_device_type, otg_global_type, sd_csd_struct_type
  • reserved5 : can_type, crm_type, ertc_type, flash_type, otg_global_type
  • reserved6 : can_type, crm_type, ertc_type, otg_global_type
  • reserved7 : crm_type
  • reserverd2 : sd_scr_struct_type
  • reserverd3 : sd_scr_struct_type
  • reset : i2c_type
  • respond_flag : iap_info_type
  • revid : crc_type
  • revision : msc_scsi_data_inquiry
  • revod : crc_type
  • rf0 : can_type
  • rf0_bit : can_type
  • rf0ff : can_type
  • rf0fien : can_type
  • rf0mien : can_type
  • rf0mn : can_type
  • rf0of : can_type
  • rf0oien : can_type
  • rf0r : can_type
  • rf1 : can_type
  • rf1_bit : can_type
  • rf1ff : can_type
  • rf1fien : can_type
  • rf1mien : can_type
  • rf1mn : can_type
  • rf1of : can_type
  • rf1oien : can_type
  • rf1r : can_type
  • rfc : can_fifo_mailbox_type
  • rfc_bit : can_fifo_mailbox_type
  • rfdt0 : can_fifo_mailbox_type
  • rfdt1 : can_fifo_mailbox_type
  • rfdt2 : can_fifo_mailbox_type
  • rfdt3 : can_fifo_mailbox_type
  • rfdt4 : can_fifo_mailbox_type
  • rfdt5 : can_fifo_mailbox_type
  • rfdt6 : can_fifo_mailbox_type
  • rfdt7 : can_fifo_mailbox_type
  • rfdth : can_fifo_mailbox_type
  • rfdth_bit : can_fifo_mailbox_type
  • rfdtl : can_fifo_mailbox_type
  • rfdtl_bit : can_fifo_mailbox_type
  • rfeid : can_fifo_mailbox_type
  • rffmn : can_fifo_mailbox_type
  • rffri : can_fifo_mailbox_type
  • rfi : can_fifo_mailbox_type
  • rfi_bit : can_fifo_mailbox_type
  • rfidi : can_fifo_mailbox_type
  • rfsid : can_fifo_mailbox_type
  • rfts : can_fifo_mailbox_type
  • risetime : i2c_type
  • rld : wdt_type
  • rld_bit : wdt_type
  • rldf : wdt_type, wwdt_type
  • rldien : wwdt_type
  • rm : usart_type
  • rmb : msc_scsi_data_inquiry
  • roerr : spi_type, usart_type
  • rpen : adc_type
  • rpr : tmr_type
  • rpr_bit : tmr_type
  • rpx : exint_type
  • rsaw : can_type
  • rsaw_size : can_baudrate_type
  • rsp1 : sdio_type
  • rsp1_bit : sdio_type
  • rsp2 : sdio_type
  • rsp2_bit : sdio_type
  • rsp3 : sdio_type
  • rsp3_bit : sdio_type
  • rsp4 : sdio_type
  • rsp4_bit : sdio_type
  • rsp_type : sdio_command_struct_type
  • rspcmd : sdio_type
  • rspcmd_bit : sdio_type
  • rspwt : sdio_type
  • rst : crc_type
  • rstfc : crm_type
  • rtsen : usart_type
  • rwkupsig : otg_device_type
  • rx_addr : usb_ept_info
  • rxbuf : sdio_type
  • rxbufe : sdio_type
  • rxbufeien : sdio_type
  • rxbuff : sdio_type
  • rxbuffien : sdio_type
  • rxbufh : sdio_type
  • rxbufhien : sdio_type
  • rxbufien : sdio_type
  • rxdpid_setupcnt : otg_eptout_type
  • rxerro : sdio_type
  • rxerroien : sdio_type
  • rxfdep : otg_global_type
  • rxfflsh : otg_global_type
  • rxflvl : otg_global_type
  • rxflvlmsk : otg_global_type


AT32F415 Firmwary Library: Data Fields - Variables

- s -

  • s : ertc_reg_alarm_type, ertc_reg_time_type, ertc_reg_tstm_type, ertc_type
  • sbf : usart_type
  • sbiterr : sdio_type
  • sbiterrien : sdio_type
  • sbs : ertc_type
  • sbs_bit : ertc_type
  • sbsmsk : ertc_type
  • scal : ertc_reg_scal_type, ertc_type
  • scal_bit : ertc_reg_scal_type, ertc_type
  • scgt : usart_type
  • sclk_freq : crm_clocks_freq_type
  • sclksel : crm_type
  • sclksts : crm_type
  • scmen : usart_type
  • scnacken : usart_type
  • scr : gpio_type
  • scr_bit : gpio_type
  • scr_structure : sd_scr_struct_type
  • sd_bus_width : sd_scr_struct_type
  • sd_cid_reg : sd_card_info_struct_type
  • sd_csd_reg : sd_card_info_struct_type
  • sd_scr_reg : sd_card_info_struct_type
  • sd_security : sd_scr_struct_type
  • sd_spec : sd_scr_struct_type
  • sd_spec3 : sd_scr_struct_type
  • sdio1_gmux : iomux_type
  • sdio1en : crm_type
  • sec : ertc_alarm_value_type, ertc_time_type
  • secers : flash_type
  • sector_mask : flash_iap_type
  • sector_size : flash_iap_type, iap_info_type
  • sef : pwc_type
  • selpin : iomux_type
  • selport : iomux_type
  • sense_key : sense_type
  • sequence_mode : adc_base_config_type
  • sesenddet : otg_global_type
  • setd0pid : otg_eptin_type, otg_eptout_type
  • setd1pid : otg_eptin_type, otg_eptout_type
  • setup : otg_eptout_type
  • setupmsk : otg_device_type
  • sftdiscon : otg_device_type
  • sgnpinak : otg_device_type
  • sgoutnak : otg_device_type
  • slben : spi_type, usart_type
  • slbtd : spi_type
  • sleep_debug : debug_type
  • slib_dat_ss : flash_type
  • slib_dss_set : flash_type
  • slib_enf : flash_type
  • slib_es : flash_type
  • slib_es_set : flash_type
  • slib_misc_sts : flash_type
  • slib_misc_sts_bit : flash_type
  • slib_pclr_val : flash_type
  • slib_pset_val : flash_type
  • slib_pwd_clr : flash_type
  • slib_pwd_clr_bit : flash_type
  • slib_pwd_err : flash_type
  • slib_pwd_ok : flash_type
  • slib_set_pwd : flash_type
  • slib_set_pwd_bit : flash_type
  • slib_set_range : flash_type
  • slib_set_range_bit : flash_type
  • slib_ss : flash_type
  • slib_ss_set : flash_type
  • slib_sts0 : flash_type
  • slib_sts0_bit : flash_type
  • slib_sts1 : flash_type
  • slib_sts1_bit : flash_type
  • slib_ukval : flash_type
  • slib_ulkf : flash_type
  • slib_unlock : flash_type
  • slib_unlock_bit : flash_type
  • smbalert : i2c_type
  • smbmode : i2c_type
  • smsel : tmr_type
  • snak : otg_eptin_type, otg_eptout_type
  • snpm : otg_eptout_type
  • sof : otg_global_type
  • sof_out : usb_core_cfg
  • soffn : otg_device_type
  • sofmsk : otg_global_type
  • sofouten : otg_global_type
  • spec_version : sd_csd_struct_type
  • speed : i2c_type, usb_core_cfg, usb_hch_type
  • speedmode : i2c_type
  • spi1_gmux : iomux_type
  • spi1_mux_h : iomux_type
  • spi1_mux_l : iomux_type
  • spi1en : crm_type
  • spi1rst : crm_type
  • spi2_gmux : iomux_type
  • spi2en : crm_type
  • spi2rst : crm_type
  • spien : spi_type
  • spk_alt_setting : usb_audio_type
  • spk_buffer : audio_codec_type
  • spk_calc : audio_codec_type
  • spk_enable : audio_codec_type
  • spk_freq : audio_codec_type, usb_audio_type
  • spk_mute : audio_codec_type, usb_audio_type
  • spk_rend : audio_codec_type
  • spk_roff : audio_codec_type
  • spk_rtotal : audio_codec_type
  • spk_stage : audio_codec_type
  • spk_threshold : audio_codec_type
  • spk_tx_size : audio_codec_type
  • spk_volume : audio_codec_type, usb_audio_type
  • spk_volume_limits : usb_audio_type
  • spk_woff : audio_codec_type
  • spk_wtotal : audio_codec_type
  • spltena : otg_hchannel_type
  • sprst : can_type
  • spt1 : adc_type
  • spt1_bit : adc_type
  • spt2 : adc_type
  • spt2_bit : adc_type
  • sqen : adc_type
  • sramen : crm_type
  • src_sel0 : dma_type
  • src_sel0_bit : dma_type
  • src_sel1 : dma_type
  • src_sel1_bit : dma_type
  • ssb : usd_type
  • stall : otg_eptin_type, otg_eptout_type, otg_hchannel_type, usb_ept_info, usb_hch_type
  • stallmsk : otg_hchannel_type
  • standard_id : can_rx_message_type, can_tx_message_type
  • standby_debug : debug_type
  • startf : i2c_type
  • state : iap_info_type, usb_hch_type, usbh_hid_type, usbh_msc_type, usbh_msc_unit_type
  • status : i2c_handle_type, usb_ept_info, usb_hch_type
  • stctrl : tmr_type
  • stctrl_bit : tmr_type
  • stdby_rst : flash_type
  • stdsel : spi_type
  • stis : tmr_type
  • stopbn : usart_type
  • stopf : i2c_type
  • stoppclk : otg_pcgcctl_type
  • stretch : i2c_type
  • sts : adc_type, dma_type, ertc_type, flash_type, sdio_type, spi_type, tmr_type, usart_type, wdt_type, wwdt_type
  • sts1 : i2c_type
  • sts1_bit : i2c_type
  • sts2 : i2c_type
  • sts2_bit : i2c_type
  • sts_bit : adc_type, dma_type, ertc_type, flash_type, sdio_type, spi_type, usart_type, wdt_type, wwdt_type
  • suspendm : otg_pcgcctl_type
  • suspsts : otg_device_type
  • swcsen : spi_type
  • swcsil : spi_type
  • swef : pwc_type
  • swevt : tmr_type
  • swevt_bit : tmr_type
  • swjtag_conf : iomux_type
  • swjtag_gmux : iomux_type
  • swpen : pwc_type
  • swrstf : crm_type
  • swtrg : exint_type
  • swtrg_bit : exint_type
  • swtx : exint_type


AT32F415 Firmwary Library: Data Fields - Variables

- t -

  • t : sc_atr_type
  • t0 : sc_atr_type
  • taac : sd_csd_struct_type
  • tadj : ertc_reg_tadj_type, ertc_type
  • tadj_bit : ertc_reg_tadj_type, ertc_type
  • tadjf : ertc_type
  • tail : usart_group_type
  • tamp : ertc_type
  • tamp_bit : ertc_type
  • tcien : can_type
  • tcrc : spi_type
  • tcrc_bit : spi_type
  • tdbe : i2c_type, spi_type, usart_type
  • tdbeie : spi_type
  • tdbeien : usart_type
  • tdc : i2c_type, usart_type
  • tdcien : usart_type
  • tden : tmr_type
  • tec : can_type
  • temp_write_protect : sd_csd_struct_type
  • ten : usart_type
  • tfrdir : sdio_type
  • tfren : sdio_type
  • tfrmode : sdio_type
  • tien : tmr_type
  • tim10_pause : debug_type
  • tim11_pause : debug_type
  • tim12_pause : debug_type
  • tim13_pause : debug_type
  • tim14_pause : debug_type
  • tim5_pause : debug_type
  • tim6_pause : debug_type
  • tim7_pause : debug_type
  • tim8_pause : debug_type
  • tim9_pause : debug_type
  • time : ertc_reg_time_type, ertc_type
  • time_bit : ertc_reg_time_type, ertc_type
  • timeout : i2c_handle_type, otg_eptin_type, sdio_data_struct_type, sdio_type
  • timeoutmsk : otg_device_type
  • tlength : sc_atr_type
  • tm0alf : can_type
  • tm0ct : can_type
  • tm0ef : can_type
  • tm0lpf : can_type
  • tm0tcf : can_type
  • tm0tef : can_type
  • tm0tsf : can_type
  • tm1alf : can_type
  • tm1ct : can_type
  • tm1ef : can_type
  • tm1lpf : can_type
  • tm1tcf : can_type
  • tm1tef : can_type
  • tm1tsf : can_type
  • tm2alf : can_type
  • tm2ct : can_type
  • tm2ef : can_type
  • tm2lpf : can_type
  • tm2tcf : can_type
  • tm2tef : can_type
  • tm2tsf : can_type
  • tmc : can_tx_mailbox_type
  • tmc_bit : can_tx_mailbox_type
  • tmdt0 : can_tx_mailbox_type
  • tmdt1 : can_tx_mailbox_type
  • tmdt2 : can_tx_mailbox_type
  • tmdt3 : can_tx_mailbox_type
  • tmdt4 : can_tx_mailbox_type
  • tmdt5 : can_tx_mailbox_type
  • tmdt6 : can_tx_mailbox_type
  • tmdt7 : can_tx_mailbox_type
  • tmdtbl : can_tx_mailbox_type
  • tmdth : can_tx_mailbox_type
  • tmdth_bit : can_tx_mailbox_type
  • tmdtl : can_tx_mailbox_type
  • tmdtl_bit : can_tx_mailbox_type
  • tmeid : can_tx_mailbox_type
  • tmfrsel : can_tx_mailbox_type
  • tmi : can_tx_mailbox_type
  • tmi_bit : can_tx_mailbox_type
  • tmidsel : can_tx_mailbox_type
  • tmnr : can_type
  • tmout : i2c_type
  • tmr10_gmux : iomux_type
  • tmr10en : crm_type
  • tmr10rst : crm_type
  • tmr11_gmux : iomux_type
  • tmr11en : crm_type
  • tmr11rst : crm_type
  • tmr1_bk1_cmp_gmux : iomux_type
  • tmr1_ch1_cmp_gmux : iomux_type
  • tmr1_gmux : iomux_type
  • tmr1_mux : iomux_type
  • tmr1_pause : debug_type
  • tmr1en : crm_type
  • tmr1rst : crm_type
  • tmr2_ch4_cmp_gmux : iomux_type
  • tmr2_gmux : iomux_type
  • tmr2_mux : iomux_type
  • tmr2_pause : debug_type
  • tmr2en : crm_type
  • tmr2rst : crm_type
  • tmr3_ch1_cmp_gmux : iomux_type
  • tmr3_gmux : iomux_type
  • tmr3_mux : iomux_type
  • tmr3_pause : debug_type
  • tmr3en : crm_type
  • tmr3rst : crm_type
  • tmr4_pause : debug_type
  • tmr4en : crm_type
  • tmr4rst : crm_type
  • tmr5_gmux : iomux_type
  • tmr5ch4_gmux : iomux_type
  • tmr5ch4_mux : iomux_type
  • tmr5en : crm_type
  • tmr5rst : crm_type
  • tmr9_gmux : iomux_type
  • tmr9en : crm_type
  • tmr9rst : crm_type
  • tmren : tmr_type
  • tmrise : i2c_type
  • tmrise_bit : i2c_type
  • tmsid : can_tx_mailbox_type
  • tmsr : can_tx_mailbox_type
  • tmts : can_tx_mailbox_type
  • tmtsten : can_tx_mailbox_type
  • toggle_in : usb_hch_type
  • toggle_out : usb_hch_type
  • total_len : usb_ept_info
  • toutcal : otg_global_type
  • tp1edg : ertc_type
  • tp1en : ertc_type
  • tp1f : ertc_type
  • tpflt : ertc_type
  • tpfreq : ertc_type
  • tpien : ertc_type
  • tppr : ertc_type
  • tppu : ertc_type
  • tptsen : ertc_type
  • trace_ioen : debug_type
  • trace_mode : debug_type
  • trans_buf : usb_ept_info, usb_hch_type
  • trans_count : usb_hch_type
  • trans_len : usb_ept_info, usb_hch_type
  • trans_type : usb_ept_info
  • transfer_direction : sdio_data_struct_type
  • transfer_mode : sdio_data_struct_type
  • transmission_mode : spi_init_type
  • trgif : tmr_type
  • trgswtr : tmr_type
  • trmode : i2c_type
  • ts : sc_atr_type
  • tsdt : ertc_reg_tsdt_type, ertc_type
  • tsdt_bit : ertc_reg_tsdt_type, ertc_type
  • tsedg : ertc_type
  • tsen : ertc_type
  • tsf : ertc_type
  • tsien : ertc_type
  • tsof : ertc_type
  • tssbs : ertc_type
  • tssbs_bit : ertc_type
  • tstctl : otg_device_type
  • tstm : ertc_reg_tstm_type, ertc_type
  • tstm_bit : ertc_reg_tstm_type, ertc_type
  • tsts : can_type
  • tsts_bit : can_type
  • ttc_enable : can_base_type
  • ttcen : can_type
  • tuerr : spi_type
  • tx_addr : usb_ept_info
  • tx_length : iap_info_type
  • tx_mailbox : can_type
  • txbuf : sdio_type
  • txbufe : sdio_type
  • txbufeien : sdio_type
  • txbuff : sdio_type
  • txbuffien : sdio_type
  • txbufh : sdio_type
  • txbufhien : sdio_type
  • txbufien : sdio_type
  • txerru : sdio_type
  • txerruien : sdio_type
  • txfemp : otg_eptin_type
  • txfflsh : otg_global_type
  • txfifoudrmsk : otg_device_type
  • txfnum : otg_eptin_type, otg_global_type


AT32F415 Firmwary Library: Data Fields - Variables

- u -

  • uart4_gmux : iomux_type
  • uart4en : crm_type
  • uart4rst : crm_type
  • uart5en : crm_type
  • uart5rst : crm_type
  • uen : usart_type
  • ukval : flash_type
  • unlock : flash_type
  • unlock_bit : flash_type
  • updf : ertc_type
  • urb_sts : usb_hch_type
  • usart1_gmux : iomux_type
  • usart1_mux : iomux_type
  • usart1en : crm_type
  • usart1rst : crm_type
  • usart2en : crm_type
  • usart2rst : crm_type
  • usart3_gmux : iomux_type
  • usart3_mux : iomux_type
  • usart3en : crm_type
  • usart3rst : crm_type
  • usb_id : usb_core_cfg
  • usb_reg : otg_core_type
  • usbacept : otg_eptin_type, otg_eptout_type
  • usbbufs : crm_type
  • usbdiv_h : crm_type
  • usbdiv_l : crm_type
  • usbdivrst : crm_type
  • usben : crm_type
  • usbrst : crm_type, otg_global_type
  • usbrstmsk : otg_global_type
  • usbsusp : otg_global_type
  • usbsuspmsk : otg_global_type
  • usbtrdtim : otg_global_type
  • usd : flash_type
  • usd_bit : flash_type
  • usd_ukval : flash_type
  • usd_unlock : flash_type
  • usd_unlock_bit : flash_type
  • usderr : flash_type
  • usders : flash_type
  • usdprgm : flash_type
  • usdulks : flash_type
  • use_lun : usbh_msc_type
  • user_d0 : flash_type
  • user_d1 : flash_type
  • userid : otg_global_type


AT32F415 Firmwary Library: Data Fields - Variables

- v -

  • val : ertc_type
  • vbusig : otg_global_type, usb_core_cfg
  • vendor : msc_scsi_data_inquiry
  • version : msc_scsi_data_inquiry
  • vmcsel : adc_type
  • vmhb : adc_type
  • vmhb_bit : adc_type
  • vmlb : adc_type
  • vmlb_bit : adc_type
  • vmor : adc_type
  • vmorien : adc_type
  • vmsgen : adc_type
  • vrsel : pwc_type


AT32F415 Firmwary Library: Data Fields - Variables

- w -

  • wait_type : sdio_command_struct_type
  • wat : ertc_type
  • wat_bit : ertc_type
  • watclk : ertc_type
  • waten : ertc_type
  • watf : ertc_type
  • watien : ertc_type
  • watwf : ertc_type
  • wdt_ato_en : flash_type
  • wdt_pause : debug_type
  • wdtrstf : crm_type
  • week : ertc_alarm_value_type, ertc_time_type
  • week_date_sel : ertc_alarm_value_type
  • win : wwdt_type
  • wIndex : usb_setup_type
  • wItemLength : usb_hid_desc_type
  • wk : ertc_reg_date_type, ertc_reg_tsdt_type, ertc_type
  • wksel : ertc_reg_alarm_type, ertc_type
  • wkupint : otg_global_type
  • wkupintmsk : otg_global_type
  • wLength : usb_setup_type
  • wMaxPacketSize : usb_endpoint_desc_type
  • wp : ertc_type
  • wp_bit : ertc_type
  • wp_level : tmr_brkdt_config_type
  • wpc : tmr_type
  • wpen0 : gpio_type
  • wpen1 : gpio_type
  • wpen10 : gpio_type
  • wpen11 : gpio_type
  • wpen12 : gpio_type
  • wpen13 : gpio_type
  • wpen14 : gpio_type
  • wpen15 : gpio_type
  • wpen2 : gpio_type
  • wpen3 : gpio_type
  • wpen4 : gpio_type
  • wpen5 : gpio_type
  • wpen6 : gpio_type
  • wpen7 : gpio_type
  • wpen8 : gpio_type
  • wpen9 : gpio_type
  • wpr : gpio_type
  • wpr_bit : gpio_type
  • wpseq : gpio_type
  • write_addr : flash_iap_type
  • write_blk_misalign : sd_csd_struct_type
  • write_crc : flash_iap_type
  • write_data : fat_dir_type
  • write_protect_group_enable : sd_csd_struct_type
  • write_protect_group_size : sd_csd_struct_type
  • write_speed_factor : sd_csd_struct_type
  • write_time : fat_dir_type
  • wtcyc : flash_type
  • wTotalLength : usb_configuration_desc_type
  • wum : usart_type
  • wValue : usb_setup_type
  • wwdt_pause : debug_type
  • wwdten : crm_type, wwdt_type
  • wwdtrst : crm_type
  • wwdtrstf : crm_type


AT32F415 Firmwary Library: Data Fields - Variables

- x -

  • x : usb_hid_mouse_type
  • xacterr : otg_hchannel_type
  • xacterrmsk : otg_hchannel_type
  • xactpos : otg_hchannel_type
  • xferc : otg_eptin_type, otg_eptout_type, otg_hchannel_type
  • xfercmsk : otg_device_type, otg_hchannel_type
  • xfersize : otg_eptin_type, otg_eptout_type, otg_hchannel_type


AT32F415 Firmwary Library: Data Fields - Variables

- y -

  • y : ertc_reg_date_type, ertc_type, usb_hid_mouse_type
  • year : ertc_time_type


AT32F415 Firmwary Library: Data Fields - Variables

- z -

  • z : usb_hid_mouse_type


AT32F415 Firmwary Library: File List

File List
Here is a list of all files with brief descriptions:
at32f415.h | At32f415 header file
system_at32f415.c | All the functions for cmsis cortex-m4 system source file
system_at32f415.h | Cmsis cortex-m4 system header file
at32f415_adc.h | At32f415 adc header file
at32f415_can.h | At32f415 can header file
at32f415_cmp.h | At32f415 cmp header file
at32f415_crc.h | At32f415 crc header file
at32f415_crm.h | At32f415 crm header file
at32f415_debug.h | At32f415 debug header file
at32f415_def.h | At32f415 macros header file
at32f415_dma.h | At32f415 dma header file
at32f415_ertc.h | At32f415 ertc header file
at32f415_exint.h | At32f415 exint header file
at32f415_flash.h | At32f415 flash header file
at32f415_gpio.h | At32f415 gpio header file
at32f415_i2c.h | At32f415 i2c header file
at32f415_misc.h | At32f415 misc header file
at32f415_pwc.h | At32f415 pwc header file
at32f415_sdio.h | At32f415 sdio header file
at32f415_spi.h | At32f415 spi header file
at32f415_tmr.h | At32f415 tmr header file
at32f415_usart.h | At32f415 usart header file
at32f415_usb.h | At32f415 usb header file
at32f415_wdt.h | At32f415 wdt header file
at32f415_wwdt.h | At32f415 wwdt header file
at32f415_adc.c | All the functions for the adc firmware library
at32f415_can.c | All the functions for the can firmware library
at32f415_cmp.c | All the functions for the gpio firmware library
at32f415_crc.c | All the functions for the crc firmware library
at32f415_crm.c | All the functions for the crm firmware library
at32f415_debug.c | All the functions for the debug firmware library
at32f415_dma.c | All the functions for the dma firmware library
at32f415_ertc.c | All the functions for the ertc firmware library
at32f415_exint.c | All the functions for the exint firmware library
at32f415_flash.c | All the functions for the flash firmware library
at32f415_gpio.c | All the functions for the gpio firmware library
at32f415_i2c.c | All the functions for the i2c firmware library
at32f415_misc.c | All the functions for the misc firmware library
at32f415_pwc.c | All the functions for the pwc firmware library
at32f415_sdio.c | All the functions for the sdio firmware library
at32f415_spi.c | All the functions for the spi firmware library
at32f415_tmr.c | All the functions for the tmr firmware library
at32f415_usart.c | All the functions for the usart firmware library
at32f415_usb.c | All the functions for the usb firmware library
at32f415_wdt.c | All the functions for the wdt firmware library
at32f415_wwdt.c | All the functions for the wwdt firmware library
main_page.h |
i2c_application.c | Driver library of the i2c peripheral
i2c_application.h | I2c application libray header file
usb_core.h | Usb core header file
usb_std.h | Usb standard header file
usbd_core.h | Usb device core header file
usbd_int.h | Usb interrupt header file
usbd_sdr.h |
usbh_core.h | Usb host core header file
usbh_ctrl.h | Usb header file
usbh_int.h | Usb header file
usb_core.c | Usb driver
usbd_core.c | Usb device driver
usbd_int.c | Usb interrupt request
usbd_sdr.c | Usb standard device request
usbh_core.c | Usb host driver
usbh_ctrl.c | Usb host control request
usbh_int.c | Usb host interrupt request
audio_class.c | Usb audio class type
audio_class.h | Usb audio class file
audio/audio_conf.h | Usb audio config
audio_hid/audio_conf.h | Usb audio config
audio_desc.c | Usb audio device descriptor
audio_desc.h | Usb audio descriptor header file
audio_hid_class.c |
audio_hid_class.h |
audio_hid_desc.c |
audio_hid_desc.h |
cdc_class.c | Usb cdc class type
cdc_class.h | Usb cdc class file
cdc_desc.c | Usb cdc device descriptor
cdc_desc.h | Usb cdc descriptor header file
cdc_keyboard_class.c | Usb cdc and keyboard class type
cdc_keyboard_class.h | Usb cdc and keyboard class file
cdc_keyboard_desc.c | Usb cdc and keyboard device descriptor
cdc_keyboard_desc.h | Usb cdc and keyboard descriptor header file
custom_hid_class.c | Usb custom hid class type
custom_hid_class.h | Usb hid header file
custom_hid_desc.c | Usb hid device descriptor
custom_hid_desc.h | Usb custom hid descriptor header file
hid_iap_class.c | Usb hid iap class type
hid_iap_class.h | Usb hid iap header file
hid_iap_desc.c | Usb hid iap device descriptor
hid_iap_desc.h | Usb hid iap descriptor header file
keyboard_class.c | Usb hid keyboard class type
keyboard_class.h | Usb hid keyboard header file
keyboard_desc.c | Usb hid keyboard device descriptor
keyboard_desc.h | Usb keyboard descriptor header file
mouse_class.c | Usb hid mouse class type
mouse_class.h | Usb hid mouse header file
mouse_desc.c | Usb hid mouse device descriptor
mouse_desc.h | Usb mouse descriptor header file
msc_bot_scsi.c | Usb mass storage bulk-only transport and scsi command
msc_bot_scsi.h | Usb mass storage bulk-only transport and scsi command header file
msc_class.c | Usb msc class type
msc_class.h | Usb msc class file
msc_desc.c | Usb msc device descriptor
msc_desc.h | Usb msc descriptor header file
printer_class.c | Usb printer class type
printer_class.h | Usb cdc class file
printer_desc.c | Usb printer device descriptor
printer_desc.h | Usb printer descriptor header file
usbh_hid_class.c | Usb host hid class type
usbh_hid_class.h | Usb host hid class header file
usbh_hid_keyboard.c | Usb host hid keyboard type
usbh_hid_keyboard.h | Usb host hid keyboard header file
usbh_hid_mouse.c | Usb host hid mouse type
usbh_hid_mouse.h | Usb host hid mouse header file
usbh_msc_bot_scsi.c | Usb host msc bulk-only transfer and scsi type
usbh_msc_bot_scsi.h | Usb host msc bulk-only transfer and scsi header file
usbh_msc_class.c | Usb host msc class type
usbh_msc_class.h | Usb host msc class header file
at32f415_board.c | Set of firmware functions to manage leds and push-button. initialize delay function
at32f415_board.h | Header file for at-start board. set of firmware functions to manage leds and push-button. initialize delay function
project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/can/communication_mode/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/can/filter/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/can/loopback_mode/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/cmp/output/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/crc/calculation/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/crm/pll_config2/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/debug/tmr1/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/ertc/calendar/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/ertc/tamper/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/exint/exint_config/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/i2c/communication_int/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/i2c/eeprom/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/6_steps/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/dma/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/external_clock/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/input_capture/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/oc_high/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/oc_low/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/timer_base/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usart/half_duplex/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usart/idle_detection/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usart/interrupt/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usart/irda/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usart/polling/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usart/printf/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usart/smartcard/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usart/synchronous/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usb_device/audio/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usb_device/mouse/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usb_device/msc/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usb_device/printer/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/templates/inc/at32f415_clock.h | Header file of clock program
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_clock.h | Header file of clock program
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_clock.h | Header file of clock program
utilities/at32f415_freertos_demo/inc/at32f415_clock.h | Header file of clock program
utilities/at32f415_gen_random_number_demo/inc/at32f415_clock.h | Header file of clock program
utilities/at32f415_slib_demo/project_l0/inc/at32f415_clock.h | Header file of clock program
utilities/at32f415_slib_demo/project_l1/inc/at32f415_clock.h | Header file of clock program
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h | Header file of clock program
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h | Header file of clock program
utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_clock.h | Header file of clock program
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h | Header file of clock program
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h | Header file of clock program
utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_clock.h | Header file of clock program
project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/can/filter/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/templates/inc/at32f415_conf.h | At32f415 config header file
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h | At32f415 config header file
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h | At32f415 config header file
utilities/at32f415_freertos_demo/inc/at32f415_conf.h | At32f415 config header file
utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h | At32f415 config header file
utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h | At32f415 config header file
utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h | At32f415 config header file
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h | At32f415 config header file
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h | At32f415 config header file
utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h | At32f415 config header file
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h | At32f415 config header file
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h | At32f415 config header file
utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h | At32f415 config header file
project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/can/filter/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/cmp/output/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usart/irda/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usart/polling/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usart/printf/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/templates/inc/at32f415_int.h | Header file of main interrupt service routines
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h | Header file of main interrupt service routines
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h | Header file of main interrupt service routines
utilities/at32f415_freertos_demo/inc/at32f415_int.h | Header file of main interrupt service routines
utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h | Header file of main interrupt service routines
utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h | Header file of main interrupt service routines
utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h | Header file of main interrupt service routines
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h | Header file of main interrupt service routines
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h | Header file of main interrupt service routines
utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h | Header file of main interrupt service routines
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h | Header file of main interrupt service routines
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h | Header file of main interrupt service routines
utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h | Header file of main interrupt service routines
project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/can/communication_mode/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/can/filter/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/can/loopback_mode/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/cmp/output/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/crc/calculation/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/crm/pll_config2/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/debug/tmr1/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/ertc/calendar/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/ertc/tamper/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/ertc/time_stamp/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/exint/exint_config/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/flash/flash_write_read/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/gpio/led_toggle/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/i2c/communication_dma/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/i2c/communication_int/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/i2c/communication_poll/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/i2c/eeprom/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/spi/w25q_flash/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/6_steps/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/dma/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/dma_burst/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/external_clock/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/hang_mode/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/input_capture/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/oc_high/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/oc_low/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/one_cycle/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/pwm_input/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/timer_base/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usart/half_duplex/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usart/idle_detection/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usart/interrupt/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usart/irda/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usart/polling/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usart/printf/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usart/receiver_mute/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usart/smartcard/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usart/synchronous/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usb_device/audio/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usb_device/keyboard/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usb_device/mouse/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usb_device/msc/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usb_device/printer/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_clock.c | System clock config program
project/at_start_f415/templates/src/at32f415_clock.c | System clock config program
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_clock.c | System clock config program
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_clock.c | System clock config program
utilities/at32f415_freertos_demo/src/at32f415_clock.c | System clock config program
utilities/at32f415_gen_random_number_demo/src/at32f415_clock.c | System clock config program
utilities/at32f415_slib_demo/project_l0/src/at32f415_clock.c | System clock config program
utilities/at32f415_slib_demo/project_l1/src/at32f415_clock.c | System clock config program
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c | System clock config program
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c | System clock config program
utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_clock.c | System clock config program
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c | System clock config program
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c | System clock config program
utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_clock.c | System clock config program
project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/can/filter/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/cmp/output/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/crc/calculation/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/dma/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usart/irda/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usart/polling/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usart/printf/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/templates/src/at32f415_int.c | Main interrupt service routines
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c | Main interrupt service routines
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c | Main interrupt service routines
utilities/at32f415_freertos_demo/src/at32f415_int.c | Main interrupt service routines
utilities/at32f415_gen_random_number_demo/src/at32f415_int.c | Main interrupt service routines
utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c | Main interrupt service routines
utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c | Main interrupt service routines
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c | Main interrupt service routines
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c | Main interrupt service routines
utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c | Main interrupt service routines
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c | Main interrupt service routines
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c | Main interrupt service routines
utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c | Main interrupt service routines
project/at_start_f415/examples/adc/current_vref_value_check/src/main.c | Main program
project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c | Main program
project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c | Main program
project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c | Main program
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c | Main program
project/at_start_f415/examples/adc/voltage_monitoring/src/main.c | Main program
project/at_start_f415/examples/can/communication_mode/src/main.c | Main program
project/at_start_f415/examples/can/filter/src/main.c | Main program
project/at_start_f415/examples/can/loopback_mode/src/main.c | Main program
project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c | Main program
project/at_start_f415/examples/cmp/output/src/main.c | Main program
project/at_start_f415/examples/cortex_m4/bit_band/src/main.c | Main program
project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c | Main program
project/at_start_f415/examples/crc/calculation/src/main.c | Main program
project/at_start_f415/examples/crm/clock_failure_detection/src/main.c | Main program
project/at_start_f415/examples/crm/pll_config2/src/main.c | Main program
project/at_start_f415/examples/crm/sysclk_switch/src/main.c | Main program
project/at_start_f415/examples/debug/tmr1/src/main.c | Main program
project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c | Main program
project/at_start_f415/examples/dma/flash_to_sram/src/main.c | Main program
project/at_start_f415/examples/ertc/bpr_domain/src/main.c | Main program
project/at_start_f415/examples/ertc/calendar/src/main.c | Main program
project/at_start_f415/examples/ertc/lick_calibration/src/main.c | Main program
project/at_start_f415/examples/ertc/tamper/src/main.c | Main program
project/at_start_f415/examples/ertc/time_stamp/src/main.c | Main program
project/at_start_f415/examples/ertc/wakeup_timer/src/main.c | Main program
project/at_start_f415/examples/exint/exint_config/src/main.c | Main program
project/at_start_f415/examples/exint/exint_software_trigger/src/main.c | Main program
project/at_start_f415/examples/flash/flash_write_read/src/main.c | Main program
project/at_start_f415/examples/gpio/led_toggle/src/main.c | Main program
project/at_start_f415/examples/gpio/swjtag_remap/src/main.c | Main program
project/at_start_f415/examples/i2c/communication_dma/src/main.c | Main program
project/at_start_f415/examples/i2c/communication_int/src/main.c | Main program
project/at_start_f415/examples/i2c/communication_poll/src/main.c | Main program
project/at_start_f415/examples/i2c/eeprom/src/main.c | Main program
project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c | Main program
project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c | Main program
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c | Main program
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c | Main program
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c | Main program
project/at_start_f415/examples/pwc/power_voltage_monitor/src/main.c | Main program
project/at_start_f415/examples/pwc/sleep_tmr2/src/main.c | Main program
project/at_start_f415/examples/pwc/sleep_usart1/src/main.c | Main program
project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c | Main program
project/at_start_f415/examples/pwc/standby_wakeup_pin/src/main.c | Main program
project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c | Main program
project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c | Main program
project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c | Main program
project/at_start_f415/examples/spi/fullduplex_polling/src/main.c | Main program
project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c | Main program
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c | Main program
project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c | Main program
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c | Main program
project/at_start_f415/examples/spi/w25q_flash/src/main.c | Main program
project/at_start_f415/examples/tmr/6_steps/src/main.c | Main program
project/at_start_f415/examples/tmr/7_pwm_output/src/main.c | Main program
project/at_start_f415/examples/tmr/cascade_synchro/src/main.c | Main program
project/at_start_f415/examples/tmr/complementary_signals/src/main.c | Main program
project/at_start_f415/examples/tmr/dma/src/main.c | Main program
project/at_start_f415/examples/tmr/dma_burst/src/main.c | Main program
project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c | Main program
project/at_start_f415/examples/tmr/external_clock/src/main.c | Main program
project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c | Main program
project/at_start_f415/examples/tmr/hang_mode/src/main.c | Main program
project/at_start_f415/examples/tmr/input_capture/src/main.c | Main program
project/at_start_f415/examples/tmr/oc_high/src/main.c | Main program
project/at_start_f415/examples/tmr/oc_low/src/main.c | Main program
project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c | Main program
project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c | Main program
project/at_start_f415/examples/tmr/one_cycle/src/main.c | Main program
project/at_start_f415/examples/tmr/parallel_synchro/src/main.c | Main program
project/at_start_f415/examples/tmr/pwm_input/src/main.c | Main program
project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c | Main program
project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c | Main program
project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c | Main program
project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c | Main program
project/at_start_f415/examples/tmr/timer_base/src/main.c | Main program
project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c | Main program
project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c | Main program
project/at_start_f415/examples/usart/half_duplex/src/main.c | Main program
project/at_start_f415/examples/usart/hw_flow_control/src/main.c | Main program
project/at_start_f415/examples/usart/idle_detection/src/main.c | Main program
project/at_start_f415/examples/usart/interrupt/src/main.c | Main program
project/at_start_f415/examples/usart/irda/src/main.c | Main program
project/at_start_f415/examples/usart/polling/src/main.c | Main program
project/at_start_f415/examples/usart/printf/src/main.c | Main program
project/at_start_f415/examples/usart/receiver_mute/src/main.c | Main program
project/at_start_f415/examples/usart/smartcard/src/main.c | Main program
project/at_start_f415/examples/usart/synchronous/src/main.c | Main program
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c | Main program
project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c | Main program
project/at_start_f415/examples/usb_device/audio/src/main.c | Main program
project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c | Main program
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c | Main program
project/at_start_f415/examples/usb_device/custom_hid/src/main.c | Main program
project/at_start_f415/examples/usb_device/keyboard/src/main.c | Main program
project/at_start_f415/examples/usb_device/mouse/src/main.c | Main program
project/at_start_f415/examples/usb_device/msc/src/main.c | Main program
project/at_start_f415/examples/usb_device/printer/src/main.c | Main program
project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c | Main program
project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c | Main program
project/at_start_f415/examples/usb_host/hid_demo/src/main.c | Main program
project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c | Main program
project/at_start_f415/examples/wdt/wdt_reset/src/main.c | Main program
project/at_start_f415/examples/wwdt/wwdt_reset/src/main.c | Main program
project/at_start_f415/templates/src/main.c | Main program
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c | Main program
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/main.c | Main program
utilities/at32f415_freertos_demo/src/main.c | Main program
utilities/at32f415_gen_random_number_demo/src/main.c | Main program
utilities/at32f415_slib_demo/project_l0/src/main.c | Main program
utilities/at32f415_slib_demo/project_l1/src/main.c | Main program
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/main.c | Main program
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/main.c | Main program
utilities/at32f415_usart_iap_demo/source_code/bootloader/src/main.c | Main program
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c | Main program
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c | Main program
utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c | Main program
project/at_start_f415/examples/flash/flash_write_read/inc/flash.h | Flash header file
utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h | Flash header file
project/at_start_f415/examples/flash/flash_write_read/src/flash.c | Flash program
utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c | Flash program
sd_mmc_card/inc/at32_sdio.h | This file contains all the functions prototypes for the sd/mmc card at32_sdio driver firmware library
sdio_fatfs/inc/at32_sdio.h | This file contains all the functions prototypes for the sd/mmc card at32_sdio driver firmware library
sdio/sdio_fatfs/inc/ffconf.h |
usb_host/msc_only_fat32/inc/ffconf.h |
sd_mmc_card/src/at32_sdio.c | This file provides a set of functions needed to manage the sdio/mmc card memory
sdio_fatfs/src/at32_sdio.c | This file provides a set of functions needed to manage the sdio/mmc card memory
diskio.c |
spi_flash.h | Header file of spi_flash
spi_flash.c | Spi_flash source code
smartcard_config.h | Header file of clock program
audio/inc/audio_codec.h | Audio codec header file
composite_audio_hid/inc/audio_codec.h | Audio codec header file
project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h | Usb config header file
project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h | Usb config header file
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h | Usb config header file
project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h | Usb config header file
project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h | Usb config header file
project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h | Usb config header file
project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h | Usb config header file
project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h | Usb config header file
project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h | Usb config header file
project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h | Usb config header file
project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h | Usb config header file
project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h | Usb config header file
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h | Usb config header file
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h | Usb config header file
utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h | Usb config header file
audio/src/audio_codec.c | Audio codec function
composite_audio_hid/src/audio_codec.c | Audio codec function
msc/inc/msc_diskio.h | Usb mass storage disk interface header file
virtual_msc_iap/inc/msc_diskio.h | Usb mass storage disk interface header file
msc/src/msc_diskio.c | Usb mass storage disk function
virtual_msc_iap/src/msc_diskio.c | Usb mass storage disk function
flash_fat16.h | Fat16 file system header file
flash_fat16.c | Fat16 file system
hid_demo/inc/usbh_user.h | Usb host user header file
msc_only_fat32/inc/usbh_user.h | Usb host user header file
hid_demo/src/usbh_user.c | Usb user function
msc_only_fat32/src/usbh_user.c | Usb user function
usbh_msc_diskio.c | Usb mass storage disk io
run_in_boot_memory.h | Run in boot memory file
run_in_boot_memory.c | Code for run in boot memory
FreeRTOSConfig.h |
random.h | At32f415 random header file
random.c | Set of firmware functions to random function
project_l0/inc/fir_filter.h |
project_l1/inc/fir_filter.h |
project_l0/inc/math_helper.h |
project_l1/inc/math_helper.h |
project_l0/src/arm_fir_data.c |
project_l1/src/arm_fir_data.c |
arm_fir_init_f32.c |
fir_coefficient.c |
fir_filter.c |
project_l0/src/math_helper.c |
project_l1/src/math_helper.c |
app_led3_toggle/inc/iap.h | Iap header file
app_led4_toggle/inc/iap.h | Iap header file
bootloader/inc/iap.h | Iap header file
app_led3_toggle/inc/tmr.h | Tmr header file
app_led4_toggle/inc/tmr.h | Tmr header file
bootloader/inc/tmr.h | Tmr header file
app_led3_toggle/inc/usart.h | Usart header file
app_led4_toggle/inc/usart.h | Usart header file
bootloader/inc/usart.h | Usart header file
app_led3_toggle/src/iap.c | Iap program
app_led4_toggle/src/iap.c | Iap program
bootloader/src/iap.c | Iap program
app_led3_toggle/src/tmr.c | Tmr program
app_led4_toggle/src/tmr.c | Tmr program
bootloader/src/tmr.c | Tmr program
app_led3_toggle/src/usart.c | Usart program
app_led4_toggle/src/usart.c | Usart program
bootloader/src/usart.c | Usart program
app_led3_toggle/inc/hid_iap_user.h | Usb config header file
app_led4_toggle/inc/hid_iap_user.h | Usb config header file
bootloader/inc/hid_iap_user.h | Usb config header file
app_led3_toggle/src/hid_iap_user.c | Usb hid iap user file
app_led4_toggle/src/hid_iap_user.c | Usb hid iap user file
bootloader/src/hid_iap_user.c | Usb hid iap user file


AT32F415 Firmwary Library: at32f415.h File Reference

  • AT32F415_Firmware_Library
  • libraries
  • cmsis
  • cm4
  • device_support
Macros | Typedefs | Enumerations
at32f415.h File Reference

at32f415 header file More...

#include "core_cm4.h"
#include "system_at32f415.h"
#include <stdint.h>
#include "at32f415_def.h"
#include "at32f415_conf.h"

Go to the source code of this file.

Macros

#define | __AT32F415_LIBRARY_VERSION_MAJOR (0x02)
at32f415 standard peripheral library version number More...
#define | __AT32F415_LIBRARY_VERSION_MIDDLE (0x00)
#define | __AT32F415_LIBRARY_VERSION_MINOR (0x02)
#define | __AT32F415_LIBRARY_VERSION_RC (0x00)
#define | __AT32F415_LIBRARY_VERSION
#define | __CM4_REV 0x0001U
configuration of the cortex-m4 processor and core peripherals More...
#define | __MPU_PRESENT 1
#define | __NVIC_PRIO_BITS 4
#define | __Vendor_SysTickConfig 0
#define | __FPU_PRESENT 0U
#define | REG8(addr) *(volatile uint8_t *)(addr)
#define | REG16(addr) *(volatile uint16_t *)(addr)
#define | REG32(addr) *(volatile uint32_t *)(addr)
#define | MAKE_VALUE(reg_offset, bit_num) (uint32_t)(((reg_offset) << 16) | (bit_num & 0x1F))
#define | PERIPH_REG(periph_base, value) REG32((periph_base + (value >> 16)))
#define | PERIPH_REG_BIT(value) (0x1U << (value & 0x1F))
#define | FLASH_BASE ((uint32_t)0x08000000)
#define | SPIM_FLASH_BASE ((uint32_t)0x08400000)
#define | USD_BASE ((uint32_t)0x1FFFF800)
#define | SRAM_BASE ((uint32_t)0x20000000)
#define | PERIPH_BASE ((uint32_t)0x40000000)
#define | DEBUG_BASE ((uint32_t)0xE0042000)
#define | APB1PERIPH_BASE (PERIPH_BASE + 0x00000)
#define | APB2PERIPH_BASE (PERIPH_BASE + 0x10000)
#define | AHBPERIPH_BASE (PERIPH_BASE + 0x20000)
#define | TMR2_BASE (APB1PERIPH_BASE + 0x0000)
#define | TMR3_BASE (APB1PERIPH_BASE + 0x0400)
#define | TMR4_BASE (APB1PERIPH_BASE + 0x0800)
#define | TMR5_BASE (APB1PERIPH_BASE + 0x0C00)
#define | CMP_BASE (APB1PERIPH_BASE + 0x2400)
#define | ERTC_BASE (APB1PERIPH_BASE + 0x2800)
#define | WWDT_BASE (APB1PERIPH_BASE + 0x2C00)
#define | WDT_BASE (APB1PERIPH_BASE + 0x3000)
#define | SPI2_BASE (APB1PERIPH_BASE + 0x3800)
#define | USART2_BASE (APB1PERIPH_BASE + 0x4400)
#define | USART3_BASE (APB1PERIPH_BASE + 0x4800)
#define | UART4_BASE (APB1PERIPH_BASE + 0x4C00)
#define | UART5_BASE (APB1PERIPH_BASE + 0x5000)
#define | I2C1_BASE (APB1PERIPH_BASE + 0x5400)
#define | I2C2_BASE (APB1PERIPH_BASE + 0x5800)
#define | CAN1_BASE (APB1PERIPH_BASE + 0x6400)
#define | PWC_BASE (APB1PERIPH_BASE + 0x7000)
#define | IOMUX_BASE (APB2PERIPH_BASE + 0x0000)
#define | EXINT_BASE (APB2PERIPH_BASE + 0x0400)
#define | GPIOA_BASE (APB2PERIPH_BASE + 0x0800)
#define | GPIOB_BASE (APB2PERIPH_BASE + 0x0C00)
#define | GPIOC_BASE (APB2PERIPH_BASE + 0x1000)
#define | GPIOD_BASE (APB2PERIPH_BASE + 0x1400)
#define | GPIOF_BASE (APB2PERIPH_BASE + 0x1C00)
#define | ADC1_BASE (APB2PERIPH_BASE + 0x2400)
#define | TMR1_BASE (APB2PERIPH_BASE + 0x2C00)
#define | SPI1_BASE (APB2PERIPH_BASE + 0x3000)
#define | USART1_BASE (APB2PERIPH_BASE + 0x3800)
#define | TMR9_BASE (APB2PERIPH_BASE + 0x4C00)
#define | TMR10_BASE (APB2PERIPH_BASE + 0x5000)
#define | TMR11_BASE (APB2PERIPH_BASE + 0x5400)
#define | SDIO1_BASE (APB2PERIPH_BASE + 0x8000)
#define | DMA1_BASE (AHBPERIPH_BASE + 0x0000)
#define | DMA1_CHANNEL1_BASE (AHBPERIPH_BASE + 0x0008)
#define | DMA1_CHANNEL2_BASE (AHBPERIPH_BASE + 0x001C)
#define | DMA1_CHANNEL3_BASE (AHBPERIPH_BASE + 0x0030)
#define | DMA1_CHANNEL4_BASE (AHBPERIPH_BASE + 0x0044)
#define | DMA1_CHANNEL5_BASE (AHBPERIPH_BASE + 0x0058)
#define | DMA1_CHANNEL6_BASE (AHBPERIPH_BASE + 0x006C)
#define | DMA1_CHANNEL7_BASE (AHBPERIPH_BASE + 0x0080)
#define | DMA2_BASE (AHBPERIPH_BASE + 0x0400)
#define | DMA2_CHANNEL1_BASE (AHBPERIPH_BASE + 0x0408)
#define | DMA2_CHANNEL2_BASE (AHBPERIPH_BASE + 0x041C)
#define | DMA2_CHANNEL3_BASE (AHBPERIPH_BASE + 0x0430)
#define | DMA2_CHANNEL4_BASE (AHBPERIPH_BASE + 0x0444)
#define | DMA2_CHANNEL5_BASE (AHBPERIPH_BASE + 0x0458)
#define | DMA2_CHANNEL6_BASE (AHBPERIPH_BASE + 0x046C)
#define | DMA2_CHANNEL7_BASE (AHBPERIPH_BASE + 0x0480)
#define | CRM_BASE (AHBPERIPH_BASE + 0x1000)
#define | FLASH_REG_BASE (AHBPERIPH_BASE + 0x2000)
#define | CRC_BASE (AHBPERIPH_BASE + 0x3000)
#define | OTGFS1_BASE (PERIPH_BASE + 0x10000000)

Typedefs

typedef enum IRQn | IRQn_Type
at32f415 interrupt number definition, according to the selected device in Library_configuration_section More...
typedef int32_t | INT32
typedef int16_t | INT16
typedef int8_t | INT8
typedef uint32_t | UINT32
typedef uint16_t | UINT16
typedef uint8_t | UINT8
typedef int32_t | s32
typedef int16_t | s16
typedef int8_t | s8
typedef const int32_t | sc32
typedef const int16_t | sc16
typedef const int8_t | sc8
typedef __IO int32_t | vs32
typedef __IO int16_t | vs16
typedef __IO int8_t | vs8
typedef __I int32_t | vsc32
typedef __I int16_t | vsc16
typedef __I int8_t | vsc8
typedef uint32_t | u32
typedef uint16_t | u16
typedef uint8_t | u8
typedef const uint32_t | uc32
typedef const uint16_t | uc16
typedef const uint8_t | uc8
typedef __IO uint32_t | vu32
typedef __IO uint16_t | vu16
typedef __IO uint8_t | vu8
typedef __I uint32_t | vuc32
typedef __I uint16_t | vuc16
typedef __I uint8_t | vuc8

Enumerations

enum IRQn {
Reset_IRQn = -15 , NonMaskableInt_IRQn = -14 , HardFault_IRQn = -13 , MemoryManagement_IRQn = -12 ,
BusFault_IRQn = -11 , UsageFault_IRQn = -10 , SVCall_IRQn = -5 , DebugMonitor_IRQn = -4 ,
PendSV_IRQn = -2 , SysTick_IRQn = -1 , WWDT_IRQn = 0 , PVM_IRQn = 1 ,
TAMP_STAMP_IRQn = 2 , ERTC_WKUP_IRQn = 3 , FLASH_IRQn = 4 , CRM_IRQn = 5 ,
EXINT0_IRQn = 6 , EXINT1_IRQn = 7 , EXINT2_IRQn = 8 , EXINT3_IRQn = 9 ,
EXINT4_IRQn = 10 , DMA1_Channel1_IRQn = 11 , DMA1_Channel2_IRQn = 12 , DMA1_Channel3_IRQn = 13 ,
DMA1_Channel4_IRQn = 14 , DMA1_Channel5_IRQn = 15 , DMA1_Channel6_IRQn = 16 , DMA1_Channel7_IRQn = 17 ,
ADC1_IRQn = 18 , CAN1_TX_IRQn = 19 , CAN1_RX0_IRQn = 20 , CAN1_RX1_IRQn = 21 ,
CAN1_SE_IRQn = 22 , EXINT9_5_IRQn = 23 , TMR1_BRK_TMR9_IRQn = 24 , TMR1_OVF_TMR10_IRQn = 25 ,
TMR1_TRG_HALL_TMR11_IRQn = 26 , TMR1_CH_IRQn = 27 , TMR2_GLOBAL_IRQn = 28 , TMR3_GLOBAL_IRQn = 29 ,
TMR4_GLOBAL_IRQn = 30 , I2C1_EVT_IRQn = 31 , I2C1_ERR_IRQn = 32 , I2C2_EVT_IRQn = 33 ,
I2C2_ERR_IRQn = 34 , SPI1_IRQn = 35 , SPI2_IRQn = 36 , USART1_IRQn = 37 ,
USART2_IRQn = 38 , USART3_IRQn = 39 , EXINT15_10_IRQn = 40 , ERTCAlarm_IRQn = 41 ,
OTGFS1_WKUP_IRQn = 42 , SDIO1_IRQn = 49 , TMR5_GLOBAL_IRQn = 50 , UART4_IRQn = 52 ,
UART5_IRQn = 53 , DMA2_Channel1_IRQn = 56 , DMA2_Channel2_IRQn = 57 , DMA2_Channel3_IRQn = 58 ,
DMA2_Channel4_5_IRQn = 59 , OTGFS1_IRQn = 67 , CMP1_IRQn = 70 , CMP2_IRQn = 71 ,
DMA2_Channel6_7_IRQn = 75
}
at32f415 interrupt number definition, according to the selected device in Library_configuration_section More...
enum | flag_status { RESET = 0 , SET = !RESET }
flag status More...
enum | confirm_state { FALSE = 0 , TRUE = !FALSE }
confirm state More...
enum | error_status { ERROR = 0 , SUCCESS = !ERROR }
error status More...

Detailed Description

at32f415 header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415.h.


AT32F415 Firmwary Library: system_at32f415.c File Reference

  • libraries
  • cmsis
  • cm4
  • device_support
Macros | Functions | Variables
system_at32f415.c File Reference

contains all the functions for cmsis cortex-m4 system source file More...

#include "at32f415.h"

Go to the source code of this file.

Macros

#define VECT_TAB_OFFSET 0x0

Functions

void | SystemInit (void)
setup the microcontroller system initialize the flash interface. More...
void | system_core_clock_update (void)
update system_core_clock variable according to clock register values. the system_core_clock variable contains the core clock (hclk), it can be used by the user application to setup the systick timer or configure other parameters. More...

Variables

unsigned int system_core_clock = ((uint32_t)8000000)

Detailed Description

contains all the functions for cmsis cortex-m4 system source file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file system_at32f415.c.


AT32F415 Firmwary Library: system_at32f415.h File Reference

  • libraries
  • cmsis
  • cm4
  • device_support
Macros | Functions | Variables
system_at32f415.h File Reference

cmsis cortex-m4 system header file. More...

Go to the source code of this file.

Macros

#define | HEXT_STABLE_DELAY (5000u)
#define | PLL_STABLE_DELAY (500u)

Functions

void | SystemInit (void)
setup the microcontroller system initialize the flash interface. More...
void | system_core_clock_update (void)
update system_core_clock variable according to clock register values. the system_core_clock variable contains the core clock (hclk), it can be used by the user application to setup the systick timer or configure other parameters. More...

Variables

unsigned int system_core_clock

Detailed Description

cmsis cortex-m4 system header file.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file system_at32f415.h.


AT32F415 Firmwary Library: at32f415_adc.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_adc.h File Reference

at32f415 adc header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | adc_base_config_type
adc base config type More...
struct | adc_type
type define adc register all More...

Macros

#define | ADC_CCE_INT ((uint32_t)0x00000020)
#define | ADC_VMOR_INT ((uint32_t)0x00000040)
#define | ADC_PCCE_INT ((uint32_t)0x00000080)
#define | ADC_VMOR_FLAG ((uint8_t)0x01)
#define | ADC_CCE_FLAG ((uint8_t)0x02)
#define | ADC_PCCE_FLAG ((uint8_t)0x04)
#define | ADC_PCCS_FLAG ((uint8_t)0x08)
#define | ADC_OCCS_FLAG ((uint8_t)0x10)
#define | ADC1 ((adc_type *) ADC1_BASE)

Enumerations

enum adc_combine_mode_type {
ADC_INDEPENDENT_MODE = 0x00 , ADC_ORDINARY_SMLT_PREEMPT_SMLT_MODE = 0x01 , ADC_ORDINARY_SMLT_PREEMPT_INTERLTRIG_MODE = 0x02 , ADC_ORDINARY_SHORTSHIFT_PREEMPT_SMLT_MODE = 0x03 ,
ADC_ORDINARY_LONGSHIFT_PREEMPT_SMLT_MODE = 0x04 , ADC_PREEMPT_SMLT_ONLY_MODE = 0x05 , ADC_ORDINARY_SMLT_ONLY_MODE = 0x06 , ADC_ORDINARY_SHORTSHIFT_ONLY_MODE = 0x07 ,
ADC_ORDINARY_LONGSHIFT_ONLY_MODE = 0x08 , ADC_PREEMPT_INTERLTRIG_ONLY_MODE = 0x09
}
adc combine mode type More...
enum | adc_data_align_type { ADC_RIGHT_ALIGNMENT = 0x00 , ADC_LEFT_ALIGNMENT = 0x01 }
adc data align type More...
enum adc_channel_select_type {
ADC_CHANNEL_0 = 0x00 , ADC_CHANNEL_1 = 0x01 , ADC_CHANNEL_2 = 0x02 , ADC_CHANNEL_3 = 0x03 ,
ADC_CHANNEL_4 = 0x04 , ADC_CHANNEL_5 = 0x05 , ADC_CHANNEL_6 = 0x06 , ADC_CHANNEL_7 = 0x07 ,
ADC_CHANNEL_8 = 0x08 , ADC_CHANNEL_9 = 0x09 , ADC_CHANNEL_10 = 0x0A , ADC_CHANNEL_11 = 0x0B ,
ADC_CHANNEL_12 = 0x0C , ADC_CHANNEL_13 = 0x0D , ADC_CHANNEL_14 = 0x0E , ADC_CHANNEL_15 = 0x0F ,
ADC_CHANNEL_16 = 0x10 , ADC_CHANNEL_17 = 0x11
}
adc channel select type More...
enum adc_sampletime_select_type {
ADC_SAMPLETIME_1_5 = 0x00 , ADC_SAMPLETIME_7_5 = 0x01 , ADC_SAMPLETIME_13_5 = 0x02 , ADC_SAMPLETIME_28_5 = 0x03 ,
ADC_SAMPLETIME_41_5 = 0x04 , ADC_SAMPLETIME_55_5 = 0x05 , ADC_SAMPLETIME_71_5 = 0x06 , ADC_SAMPLETIME_239_5 = 0x07
}
adc sampletime select type More...
enum adc_ordinary_trig_select_type {
ADC12_ORDINARY_TRIG_TMR1CH1 = 0x00 , ADC12_ORDINARY_TRIG_TMR1CH2 = 0x01 , ADC12_ORDINARY_TRIG_TMR1CH3 = 0x02 , ADC12_ORDINARY_TRIG_TMR2CH2 = 0x03 ,
ADC12_ORDINARY_TRIG_TMR3TRGOUT = 0x04 , ADC12_ORDINARY_TRIG_TMR4CH4 = 0x05 , ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT = 0x06 , ADC12_ORDINARY_TRIG_SOFTWARE = 0x07 ,
ADC12_ORDINARY_TRIG_TMR1TRGOUT = 0x0D
}
adc ordinary group trigger event select type More...
enum adc_preempt_trig_select_type {
ADC12_PREEMPT_TRIG_TMR1TRGOUT = 0x00 , ADC12_PREEMPT_TRIG_TMR1CH4 = 0x01 , ADC12_PREEMPT_TRIG_TMR2TRGOUT = 0x02 , ADC12_PREEMPT_TRIG_TMR2CH1 = 0x03 ,
ADC12_PREEMPT_TRIG_TMR3CH4 = 0x04 , ADC12_PREEMPT_TRIG_TMR4TRGOUT = 0x05 , ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4 = 0x06 , ADC12_PREEMPT_TRIG_SOFTWARE = 0x07 ,
ADC12_PREEMPT_TRIG_TMR1CH1 = 0x0D
}
adc preempt group trigger event select type More...
enum | adc_preempt_channel_type { ADC_PREEMPT_CHANNEL_1 = 0x00 , ADC_PREEMPT_CHANNEL_2 = 0x01 , ADC_PREEMPT_CHANNEL_3 = 0x02 , ADC_PREEMPT_CHANNEL_4 = 0x03 }
adc preempt channel type More...
enum adc_voltage_monitoring_type {
ADC_VMONITOR_SINGLE_ORDINARY = 0x00800200 , ADC_VMONITOR_SINGLE_PREEMPT = 0x00400200 , ADC_VMONITOR_SINGLE_ORDINARY_PREEMPT = 0x00C00200 , ADC_VMONITOR_ALL_ORDINARY = 0x00800000 ,
ADC_VMONITOR_ALL_PREEMPT = 0x00400000 , ADC_VMONITOR_ALL_ORDINARY_PREEMPT = 0x00C00000 , ADC_VMONITOR_NONE = 0x00000000
}
adc voltage_monitoring type More...

Functions

void | adc_reset (adc_type *adc_x)
deinitialize the adc peripheral registers to their default reset values. More...
void | adc_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the specified adc peripheral. More...
void | adc_combine_mode_select (adc_combine_mode_type combine_mode)
select combine mode of the specified adc peripheral. More...
void | adc_base_default_para_init (adc_base_config_type *adc_base_struct)
adc base default para init. More...
void | adc_base_config (adc_type *adc_x, adc_base_config_type *adc_base_struct)
initialize the adc peripheral according to the specified parameters. More...
void | adc_dma_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the adc dma transfer. More...
void | adc_interrupt_enable (adc_type *adc_x, uint32_t adc_int, confirm_state new_state)
enable or disable the specified adc interrupts. More...
void | adc_calibration_init (adc_type *adc_x)
initialize calibration register of the specified adc peripheral. More...
flag_status | adc_calibration_init_status_get (adc_type *adc_x)
get calibration register's initialize status of the specified adc peripheral. More...
void | adc_calibration_start (adc_type *adc_x)
start calibration process of the specified adc peripheral. More...
flag_status | adc_calibration_status_get (adc_type *adc_x)
get calibration status of the specified adc peripheral. More...
void | adc_voltage_monitor_enable (adc_type *adc_x, adc_voltage_monitoring_type adc_voltage_monitoring)
enable or disable the voltage monitoring on single/all ordinary or preempt channels of the specified adc peripheral. More...
void | adc_voltage_monitor_threshold_value_set (adc_type *adc_x, uint16_t adc_high_threshold, uint16_t adc_low_threshold)
set voltage monitoring's high and low thresholds value of the specified adc peripheral. More...
void | adc_voltage_monitor_single_channel_select (adc_type *adc_x, adc_channel_select_type adc_channel)
select the voltage monitoring's channel of the specified adc peripheral. More...
void | adc_ordinary_channel_set (adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc peripheral. More...
void | adc_preempt_channel_length_set (adc_type *adc_x, uint8_t adc_channel_lenght)
set preempt channel lenghth of the specified adc peripheral. More...
void | adc_preempt_channel_set (adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
configure preempt channel's corresponding rank in the sequencer and sample time of the specified adc peripheral. More...
void | adc_ordinary_conversion_trigger_set (adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state)
enable or disable the ordinary channel's external trigger and set external trigger event of the specified adc peripheral. More...
void | adc_preempt_conversion_trigger_set (adc_type *adc_x, adc_preempt_trig_select_type adc_preempt_trig, confirm_state new_state)
enable or disable the preempt channel's external trigger and set external trigger event of the specified adc peripheral. More...
void | adc_preempt_offset_value_set (adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel, uint16_t adc_offset_value)
set preempt channel's conversion value offset of the specified adc peripheral. More...
void | adc_ordinary_part_count_set (adc_type *adc_x, uint8_t adc_channel_count)
set partitioned mode channel count of the specified adc peripheral. More...
void | adc_ordinary_part_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the partitioned mode on ordinary channel of the specified adc peripheral. More...
void | adc_preempt_part_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the partitioned mode on preempt channel of the specified adc peripheral. More...
void | adc_preempt_auto_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable automatic preempt group conversion of the specified adc peripheral. More...
void | adc_tempersensor_vintrv_enable (confirm_state new_state)
enable or disable the temperature sensor and vintrv channel. More...
void | adc_ordinary_software_trigger_enable (adc_type *adc_x, confirm_state new_state)
enable or disable ordinary software start conversion of the specified adc peripheral. More...
flag_status | adc_ordinary_software_trigger_status_get (adc_type *adc_x)
get ordinary software start conversion status of the specified adc peripheral. More...
void | adc_preempt_software_trigger_enable (adc_type *adc_x, confirm_state new_state)
enable or disable preempt software start conversion of the specified adc peripheral. More...
flag_status | adc_preempt_software_trigger_status_get (adc_type *adc_x)
get preempt software start conversion status of the specified adc peripheral. More...
uint16_t | adc_ordinary_conversion_data_get (adc_type *adc_x)
return the last conversion data for ordinary channel of the specified adc peripheral. More...
uint32_t | adc_combine_ordinary_conversion_data_get (void)
return the last conversion data for ordinary channel of combine adc. More...
uint16_t | adc_preempt_conversion_data_get (adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel)
return the conversion data for selection preempt channel of the specified adc peripheral. More...
flag_status | adc_flag_get (adc_type *adc_x, uint8_t adc_flag)
get flag of the specified adc peripheral. More...
void | adc_flag_clear (adc_type *adc_x, uint32_t adc_flag)
clear flag of the specified adc peripheral. More...

Detailed Description

at32f415 adc header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_adc.h.


AT32F415 Firmwary Library: at32f415_can.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_can.h File Reference

at32f415 can header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | can_base_type
can init structure definition More...
struct | can_baudrate_type
can baudrate structure definition More...
struct | can_filter_init_type
can filter init structure definition More...
struct | can_tx_message_type
can tx message structure definition More...
struct | can_rx_message_type
can rx message structure definition More...
struct | can_tx_mailbox_type
can controller area network tx mailbox More...
struct | can_fifo_mailbox_type
can controller area network fifo mailbox More...
struct | can_filter_register_type
can controller area network filter bit register More...
struct | can_type
type define can register all More...

Macros

#define | FZC_TIMEOUT ((uint32_t)0x0000FFFF)
#define | DZC_TIMEOUT ((uint32_t)0x0000FFFF)
#define | CAN_EAF_FLAG ((uint32_t)0x01)
#define | CAN_EPF_FLAG ((uint32_t)0x02)
#define | CAN_BOF_FLAG ((uint32_t)0x03)
#define | CAN_ETR_FLAG ((uint32_t)0x04)
#define | CAN_EOIF_FLAG ((uint32_t)0x05)
#define | CAN_TM0TCF_FLAG ((uint32_t)0x06)
#define | CAN_TM1TCF_FLAG ((uint32_t)0x07)
#define | CAN_TM2TCF_FLAG ((uint32_t)0x08)
#define | CAN_RF0MN_FLAG ((uint32_t)0x09)
#define | CAN_RF0FF_FLAG ((uint32_t)0x0A)
#define | CAN_RF0OF_FLAG ((uint32_t)0x0B)
#define | CAN_RF1MN_FLAG ((uint32_t)0x0C)
#define | CAN_RF1FF_FLAG ((uint32_t)0x0D)
#define | CAN_RF1OF_FLAG ((uint32_t)0x0E)
#define | CAN_QDZIF_FLAG ((uint32_t)0x0F)
#define | CAN_EDZC_FLAG ((uint32_t)0x10)
#define | CAN_TMEF_FLAG ((uint32_t)0x11)
#define | CAN_TCIEN_INT ((uint32_t)0x00000001)
#define | CAN_RF0MIEN_INT ((uint32_t)0x00000002)
#define | CAN_RF0FIEN_INT ((uint32_t)0x00000004)
#define | CAN_RF0OIEN_INT ((uint32_t)0x00000008)
#define | CAN_RF1MIEN_INT ((uint32_t)0x00000010)
#define | CAN_RF1FIEN_INT ((uint32_t)0x00000020)
#define | CAN_RF1OIEN_INT ((uint32_t)0x00000040)
#define | CAN_EAIEN_INT ((uint32_t)0x00000100)
#define | CAN_EPIEN_INT ((uint32_t)0x00000200)
#define | CAN_BOIEN_INT ((uint32_t)0x00000400)
#define | CAN_ETRIEN_INT ((uint32_t)0x00000800)
#define | CAN_EOIEN_INT ((uint32_t)0x00008000)
#define | CAN_QDZIEN_INT ((uint32_t)0x00010000)
#define | CAN_EDZIEN_INT ((uint32_t)0x00020000)
#define | CAN_MSTS_EOIF_VAL ((uint32_t)0x00000004)
can flag clear operation macro definition val More...
#define | CAN_MSTS_QDZIF_VAL ((uint32_t)0x00000008)
#define | CAN_MSTS_EDZIF_VAL ((uint32_t)0x00000010)
#define | CAN_TSTS_TM0TCF_VAL ((uint32_t)0x00000001)
#define | CAN_TSTS_TM1TCF_VAL ((uint32_t)0x00000100)
#define | CAN_TSTS_TM2TCF_VAL ((uint32_t)0x00010000)
#define | CAN_TSTS_TM0CT_VAL ((uint32_t)0x00000080)
#define | CAN_TSTS_TM1CT_VAL ((uint32_t)0x00008000)
#define | CAN_TSTS_TM2CT_VAL ((uint32_t)0x00800000)
#define | CAN_RF0_RF0FF_VAL ((uint32_t)0x00000008)
#define | CAN_RF0_RF0OF_VAL ((uint32_t)0x00000010)
#define | CAN_RF0_RF0R_VAL ((uint32_t)0x00000020)
#define | CAN_RF1_RF1FF_VAL ((uint32_t)0x00000008)
#define | CAN_RF1_RF1OF_VAL ((uint32_t)0x00000010)
#define | CAN_RF1_RF1R_VAL ((uint32_t)0x00000020)
#define | CAN1 ((can_type *) CAN1_BASE)

Enumerations

enum | can_filter_fifo_type { CAN_FILTER_FIFO0 = 0x00 , CAN_FILTER_FIFO1 = 0x01 }
can filter fifo More...
enum | can_filter_mode_type { CAN_FILTER_MODE_ID_MASK = 0x00 , CAN_FILTER_MODE_ID_LIST = 0x01 }
can filter mode More...
enum | can_filter_bit_width_type { CAN_FILTER_16BIT = 0x00 , CAN_FILTER_32BIT = 0x01 }
can filter bit width select More...
enum | can_mode_type { CAN_MODE_COMMUNICATE = 0x00 , CAN_MODE_LOOPBACK = 0x01 , CAN_MODE_LISTENONLY = 0x02 , CAN_MODE_LISTENONLY_LOOPBACK = 0x03 }
can mode More...
enum | can_operating_mode_type { CAN_OPERATINGMODE_FREEZE = 0x00 , CAN_OPERATINGMODE_DOZE = 0x01 , CAN_OPERATINGMODE_COMMUNICATE = 0x02 }
can operating mode More...
enum | can_rsaw_type { CAN_RSAW_1TQ = 0x00 , CAN_RSAW_2TQ = 0x01 , CAN_RSAW_3TQ = 0x02 , CAN_RSAW_4TQ = 0x03 }
can resynchronization adjust width More...
enum can_bts1_type {
CAN_BTS1_1TQ = 0x00 , CAN_BTS1_2TQ = 0x01 , CAN_BTS1_3TQ = 0x02 , CAN_BTS1_4TQ = 0x03 ,
CAN_BTS1_5TQ = 0x04 , CAN_BTS1_6TQ = 0x05 , CAN_BTS1_7TQ = 0x06 , CAN_BTS1_8TQ = 0x07 ,
CAN_BTS1_9TQ = 0x08 , CAN_BTS1_10TQ = 0x09 , CAN_BTS1_11TQ = 0x0A , CAN_BTS1_12TQ = 0x0B ,
CAN_BTS1_13TQ = 0x0C , CAN_BTS1_14TQ = 0x0D , CAN_BTS1_15TQ = 0x0E , CAN_BTS1_16TQ = 0x0F
}
can bit time segment 1 More...
enum can_bts2_type {
CAN_BTS2_1TQ = 0x00 , CAN_BTS2_2TQ = 0x01 , CAN_BTS2_3TQ = 0x02 , CAN_BTS2_4TQ = 0x03 ,
CAN_BTS2_5TQ = 0x04 , CAN_BTS2_6TQ = 0x05 , CAN_BTS2_7TQ = 0x06 , CAN_BTS2_8TQ = 0x07
}
can bit time segment 2 More...
enum | can_identifier_type { CAN_ID_STANDARD = 0x00 , CAN_ID_EXTENDED = 0x01 }
can identifier type More...
enum | can_trans_frame_type { CAN_TFT_DATA = 0x00 , CAN_TFT_REMOTE = 0x01 }
can transmission frame type More...
enum | can_tx_mailbox_num_type { CAN_TX_MAILBOX0 = 0x00 , CAN_TX_MAILBOX1 = 0x01 , CAN_TX_MAILBOX2 = 0x02 }
can tx mailboxes More...
enum | can_rx_fifo_num_type { CAN_RX_FIFO0 = 0x00 , CAN_RX_FIFO1 = 0x01 }
can receive fifo More...
enum | can_transmit_status_type { CAN_TX_STATUS_FAILED = 0x00 , CAN_TX_STATUS_SUCCESSFUL = 0x01 , CAN_TX_STATUS_PENDING = 0x02 , CAN_TX_STATUS_NO_EMPTY = 0x04 }
can transmit status More...
enum | can_enter_doze_status_type { CAN_ENTER_DOZE_FAILED = 0x00 , CAN_ENTER_DOZE_SUCCESSFUL = 0x01 }
can enter doze mode status More...
enum | can_quit_doze_status_type { CAN_QUIT_DOZE_FAILED = 0x00 , CAN_QUIT_DOZE_SUCCESSFUL = 0x01 }
can quit doze mode status More...
enum | can_msg_discarding_rule_type { CAN_DISCARDING_FIRST_RECEIVED = 0x00 , CAN_DISCARDING_LAST_RECEIVED = 0x01 }
can message discarding rule select when overflow More...
enum | can_msg_sending_rule_type { CAN_SENDING_BY_ID = 0x00 , CAN_SENDING_BY_REQUEST = 0x01 }
can multiple message sending sequence rule More...
enum can_error_record_type {
CAN_ERRORRECORD_NOERR = 0x00 , CAN_ERRORRECORD_STUFFERR = 0x01 , CAN_ERRORRECORD_FORMERR = 0x02 , CAN_ERRORRECORD_ACKERR = 0x03 ,
CAN_ERRORRECORD_BITRECESSIVEERR = 0x04 , CAN_ERRORRECORD_BITDOMINANTERR = 0x05 , CAN_ERRORRECORD_CRCERR = 0x06 , CAN_ERRORRECORD_SOFTWARESETERR = 0x07
}
can error type record More...

Functions

void | can_reset (can_type *can_x)
deinitialize the can peripheral registers to their default reset values. More...
void | can_baudrate_default_para_init (can_baudrate_type *can_baudrate_struct)
fill each can_baudrate_struct member with its default value. More...
error_status | can_baudrate_set (can_type *can_x, can_baudrate_type *can_baudrate_struct)
set the baudrate of the can peripheral More...
void | can_default_para_init (can_base_type *can_base_struct)
fill each can_init_struct member with its default value. More...
error_status | can_base_init (can_type *can_x, can_base_type *can_base_struct)
initialize the can peripheral according to the specified parameters in the can_init_struct. More...
void | can_filter_default_para_init (can_filter_init_type *can_filter_init_struct)
fill each can_filter_init_struct member with its default value. More...
void | can_filter_init (can_type *can_x, can_filter_init_type *can_filter_init_struct)
initialize the can peripheral according to the specified parameters in the can_filter_init_struct. More...
void | can_debug_transmission_prohibit (can_type *can_x, confirm_state new_state)
enable or disable the debug transmission prohibit of the specified can peripheral. More...
void | can_ttc_mode_enable (can_type *can_x, confirm_state new_state)
enable or disable time trigger operation communication mode of the specified can peripheral. More...
uint8_t | can_message_transmit (can_type *can_x, can_tx_message_type *tx_message_struct)
fill the transmission message and transmit of the specified can peripheral. More...
can_transmit_status_type | can_transmit_status_get (can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
check the transmission state of the specified can peripheral. More...
void | can_transmit_cancel (can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
cancel a transmit request of the specified can peripheral. More...
void | can_message_receive (can_type *can_x, can_rx_fifo_num_type fifo_number, can_rx_message_type *rx_message_struct)
receive message of the specified can peripheral. More...
void | can_receive_fifo_release (can_type *can_x, can_rx_fifo_num_type fifo_number)
release the specified fifo of the specified can peripheral. More...
uint8_t | can_receive_message_pending_get (can_type *can_x, can_rx_fifo_num_type fifo_number)
return the number of pending messages of the specified can peripheral. More...
error_status | can_operating_mode_set (can_type *can_x, can_operating_mode_type can_operating_mode)
set the operation mode of the specified can peripheral. More...
can_enter_doze_status_type | can_doze_mode_enter (can_type *can_x)
enter the low power mode of the specified can peripheral. More...
can_quit_doze_status_type | can_doze_mode_exit (can_type *can_x)
exit the doze mode of the specified can peripheral. More...
can_error_record_type | can_error_type_record_get (can_type *can_x)
return the error type record (etr) of the specified can peripheral. More...
uint8_t | can_receive_error_counter_get (can_type *can_x)
return the receive error counter (rec) of the specified can peripheral. More...
uint8_t | can_transmit_error_counter_get (can_type *can_x)
return the transmit error counter of the specified can peripheral. More...
void | can_interrupt_enable (can_type *can_x, uint32_t can_int, confirm_state new_state)
enable or disable the interrupt of the specified can peripheral. More...
flag_status | can_flag_get (can_type *can_x, uint32_t can_flag)
get flag of the specified can peripheral. More...
void | can_flag_clear (can_type *can_x, uint32_t can_flag)
clear flag of the specified can peripheral. More...

Detailed Description

at32f415 can header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_can.h.


AT32F415 Firmwary Library: at32f415_cmp.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_cmp.h File Reference

at32f415 cmp header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | cmp_init_type
cmp init type More...
struct | cmp_type
type define cmp register all More...

Macros

#define CMP ((cmp_type *) (CMP_BASE))

Enumerations

enum | cmp_non_inverting_type { CMP_NON_INVERTING_PA5 = 0x00 , CMP_NON_INVERTING_PA1 = 0x01 , CMP_NON_INVERTING_PA0 = 0x02 , CMP_NON_INVERTING_VSSA = 0x03 }
cmp non-inverting type More...
enum cmp_inverting_type {
CMP_INVERTING_1_4VREFINT = 0x00 , CMP_INVERTING_1_2VREFINT = 0x01 , CMP_INVERTING_3_4VREFINT = 0x02 , CMP_INVERTING_VREFINT = 0x03 ,
CMP_INVERTING_PA4 = 0x04 , CMP_INVERTING_PA5 = 0x05 , CMP_INVERTING_PA0 = 0x06 , CMP_INVERTING_PA2 = 0x07
}
cmp inverting type More...
enum | cmp_speed_type { CMP_SPEED_FAST = 0x00 , CMP_SPEED_MEDIUM = 0x01 , CMP_SPEED_SLOW = 0x02 , CMP_SPEED_ULTRALOW = 0x03 }
cmp speed type More...
enum cmp_output_type {
CMP_OUTPUT_NONE = 0x00 , CMP_OUTPUT_TMR1BRK = 0x01 , CMP_OUTPUT_TMR1CH1 = 0x02 , CMP_OUTPUT_TMR1CHCLR = 0x03 ,
CMP_OUTPUT_TMR2CH4 = 0x04 , CMP_OUTPUT_TMR2CHCLR = 0x05 , CMP_OUTPUT_TMR3CH1 = 0x06 , CMP_OUTPUT_TMR3CHCLR = 0x07
}
cmp output type More...
enum | cmp_polarity_type { CMP_POL_NON_INVERTING = 0x00 , CMP_POL_INVERTING = 0x01 }
cmp polarity type More...
enum | cmp_hysteresis_type { CMP_HYSTERESIS_NONE = 0x00 , CMP_HYSTERESIS_LOW = 0x01 , CMP_HYSTERESIS_MEDIUM = 0x02 , CMP_HYSTERESIS_HIGH = 0x03 }
cmp hysteresis type More...
enum | cmp_sel_type { CMP1_SELECTION = 0x00 , CMP2_SELECTION = 0x01 }
cmp selection type More...

Functions

void | cmp_reset (void)
reset the cmp register More...
void | cmp_init (cmp_sel_type cmp_sel, cmp_init_type *cmp_init_struct)
initialize the cmp peripheral More...
void | cmp_default_para_init (cmp_init_type *cmp_init_struct)
fill each cmp_init_type member with its default value. More...
void | cmp_enable (cmp_sel_type cmp_sel, confirm_state new_state)
enable or disable cmp More...
void | cmp_input_shift_enable (confirm_state new_state)
enable or disable cmp input shift More...
uint32_t | cmp_output_value_get (cmp_sel_type cmp_sel)
get cmp output value More...
void | cmp_write_protect_enable (cmp_sel_type cmp_sel)
enable cmp write protect More...

Detailed Description

at32f415 cmp header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_cmp.h.


AT32F415 Firmwary Library: at32f415_crc.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_crc.h File Reference

at32f415 crc header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct crc_type
type define crc register all More...

Macros

#define CRC ((crc_type *) CRC_BASE)

Enumerations

enum | crc_reverse_input_type { CRC_REVERSE_INPUT_NO_AFFECTE = 0x00 , CRC_REVERSE_INPUT_BY_BYTE = 0x01 , CRC_REVERSE_INPUT_BY_HALFWORD = 0x02 , CRC_REVERSE_INPUT_BY_WORD = 0x03 }
crc reverse input data More...
enum | crc_reverse_output_type { CRC_REVERSE_OUTPUT_NO_AFFECTE = 0x00 , CRC_REVERSE_OUTPUT_DATA = 0x01 }
crc reverse output data More...

Functions

void | crc_data_reset (void)
reset the crc data register. More...
uint32_t | crc_one_word_calculate (uint32_t data)
compute the 32-bit crc of a given data word(32-bit). More...
uint32_t | crc_block_calculate (uint32_t *pbuffer, uint32_t length)
compute the 32-bit crc of a given buffer of data word(32-bit). More...
uint32_t | crc_data_get (void)
return the current crc value. More...
void | crc_common_data_set (uint8_t cdt_value)
store a 8-bit data in the common data register. More...
uint8_t | crc_common_date_get (void)
return the 8-bit data stored in the common data register More...
void | crc_init_data_set (uint32_t value)
set the 32-bit initial data of crc More...
void | crc_reverse_input_data_set (crc_reverse_input_type value)
control the reversal of the bit order in the input data More...
void | crc_reverse_output_data_set (crc_reverse_output_type value)
control the reversal of the bit order in the output data More...

Detailed Description

at32f415 crc header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_crc.h.


AT32F415 Firmwary Library: at32f415_crm.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_crm.h File Reference

at32f415 crm header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | crm_clocks_freq_type
crm clocks freqency structure More...
struct | crm_type
type define crm register all More...

Macros

#define | CRM_REG(value) PERIPH_REG(CRM_BASE, value)
#define | CRM_REG_BIT(value) PERIPH_REG_BIT(value)
#define | CRM_HICK_STABLE_FLAG MAKE_VALUE(0x00, 1)
#define | CRM_HEXT_STABLE_FLAG MAKE_VALUE(0x00, 17)
#define | CRM_PLL_STABLE_FLAG MAKE_VALUE(0x00, 25)
#define | CRM_LEXT_STABLE_FLAG MAKE_VALUE(0x20, 1)
#define | CRM_LICK_STABLE_FLAG MAKE_VALUE(0x24, 1)
#define | CRM_NRST_RESET_FLAG MAKE_VALUE(0x24, 26)
#define | CRM_POR_RESET_FLAG MAKE_VALUE(0x24, 27)
#define | CRM_SW_RESET_FLAG MAKE_VALUE(0x24, 28)
#define | CRM_WDT_RESET_FLAG MAKE_VALUE(0x24, 29)
#define | CRM_WWDT_RESET_FLAG MAKE_VALUE(0x24, 30)
#define | CRM_LOWPOWER_RESET_FLAG MAKE_VALUE(0x24, 31)
#define | CRM_LICK_READY_INT_FLAG MAKE_VALUE(0x08, 0)
#define | CRM_LEXT_READY_INT_FLAG MAKE_VALUE(0x08, 1)
#define | CRM_HICK_READY_INT_FLAG MAKE_VALUE(0x08, 2)
#define | CRM_HEXT_READY_INT_FLAG MAKE_VALUE(0x08, 3)
#define | CRM_PLL_READY_INT_FLAG MAKE_VALUE(0x08, 4)
#define | CRM_CLOCK_FAILURE_INT_FLAG MAKE_VALUE(0x08, 7)
#define | CRM_LICK_STABLE_INT ((uint32_t)0x00000100)
#define | CRM_LEXT_STABLE_INT ((uint32_t)0x00000200)
#define | CRM_HICK_STABLE_INT ((uint32_t)0x00000400)
#define | CRM_HEXT_STABLE_INT ((uint32_t)0x00000800)
#define | CRM_PLL_STABLE_INT ((uint32_t)0x00001000)
#define | CRM_CLOCK_FAILURE_INT ((uint32_t)0x00800000)
#define | CRM ((crm_type *) CRM_BASE)

Enumerations

enum crm_periph_clock_type {
CRM_DMA1_PERIPH_CLOCK = (uint32_t)((( 0x14 ) << 16) | ( 0 & 0x1F)) , CRM_DMA2_PERIPH_CLOCK = (uint32_t)((( 0x14 ) << 16) | ( 1 & 0x1F)) , CRM_CRC_PERIPH_CLOCK = (uint32_t)((( 0x14 ) << 16) | ( 6 & 0x1F)) , CRM_SDIO1_PERIPH_CLOCK = (uint32_t)((( 0x14 ) << 16) | ( 10 & 0x1F)) ,
CRM_OTGFS1_PERIPH_CLOCK = (uint32_t)((( 0x14 ) << 16) | ( 12 & 0x1F)) , CRM_IOMUX_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 0 & 0x1F)) , CRM_GPIOA_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 2 & 0x1F)) , CRM_GPIOB_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 3 & 0x1F)) ,
CRM_GPIOC_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 4 & 0x1F)) , CRM_GPIOD_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 5 & 0x1F)) , CRM_GPIOF_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 7 & 0x1F)) , CRM_ADC1_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 9 & 0x1F)) ,
CRM_TMR1_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 11 & 0x1F)) , CRM_SPI1_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 12 & 0x1F)) , CRM_USART1_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 14 & 0x1F)) , CRM_TMR9_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 19 & 0x1F)) ,
CRM_TMR10_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 20 & 0x1F)) , CRM_TMR11_PERIPH_CLOCK = (uint32_t)((( 0x18 ) << 16) | ( 21 & 0x1F)) , CRM_TMR2_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 0 & 0x1F)) , CRM_TMR3_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 1 & 0x1F)) ,
CRM_TMR4_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 2 & 0x1F)) , CRM_TMR5_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 3 & 0x1F)) , CRM_CMP_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 9 & 0x1F)) , CRM_WWDT_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 11 & 0x1F)) ,
CRM_SPI2_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 14 & 0x1F)) , CRM_USART2_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 17 & 0x1F)) , CRM_USART3_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 18 & 0x1F)) , CRM_UART4_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 19 & 0x1F)) ,
CRM_UART5_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 20 & 0x1F)) , CRM_I2C1_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 21 & 0x1F)) , CRM_I2C2_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 22 & 0x1F)) , CRM_CAN1_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 25 & 0x1F)) ,
CRM_PWC_PERIPH_CLOCK = (uint32_t)((( 0x1C ) << 16) | ( 28 & 0x1F))
}
crm periph clock More...
enum crm_periph_reset_type {
CRM_OTGFS1_PERIPH_RESET = (uint32_t)((( 0x28 ) << 16) | ( 12 & 0x1F)) , CRM_IOMUX_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 0 & 0x1F)) , CRM_EXINT_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 1 & 0x1F)) , CRM_GPIOA_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 2 & 0x1F)) ,
CRM_GPIOB_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 3 & 0x1F)) , CRM_GPIOC_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 4 & 0x1F)) , CRM_GPIOD_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 5 & 0x1F)) , CRM_GPIOF_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 7 & 0x1F)) ,
CRM_ADC1_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 9 & 0x1F)) , CRM_TMR1_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 11 & 0x1F)) , CRM_SPI1_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 12 & 0x1F)) , CRM_USART1_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 14 & 0x1F)) ,
CRM_TMR9_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 19 & 0x1F)) , CRM_TMR10_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 20 & 0x1F)) , CRM_TMR11_PERIPH_RESET = (uint32_t)((( 0x0C ) << 16) | ( 21 & 0x1F)) , CRM_TMR2_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 0 & 0x1F)) ,
CRM_TMR3_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 1 & 0x1F)) , CRM_TMR4_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 2 & 0x1F)) , CRM_TMR5_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 3 & 0x1F)) , CRM_CMP_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 9 & 0x1F)) ,
CRM_WWDT_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 11 & 0x1F)) , CRM_SPI2_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 14 & 0x1F)) , CRM_USART2_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 17 & 0x1F)) , CRM_USART3_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 18 & 0x1F)) ,
CRM_UART4_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 19 & 0x1F)) , CRM_UART5_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 20 & 0x1F)) , CRM_I2C1_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 21 & 0x1F)) , CRM_I2C2_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 22 & 0x1F)) ,
CRM_CAN1_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 25 & 0x1F)) , CRM_PWC_PERIPH_RESET = (uint32_t)((( 0x10 ) << 16) | ( 28 & 0x1F))
}
crm periph reset More...
enum | crm_periph_clock_sleepmd_type { CRM_SRAM_PERIPH_CLOCK_SLEEP_MODE = (uint32_t)((( 0x14 ) << 16) | ( 2 & 0x1F)) , CRM_FLASH_PERIPH_CLOCK_SLEEP_MODE = (uint32_t)((( 0x14 ) << 16) | ( 4 & 0x1F)) }
crm periph clock in sleep mode More...
enum crm_pll_mult_type {
CRM_PLL_MULT_2 = 0 , CRM_PLL_MULT_3 = 1 , CRM_PLL_MULT_4 = 2 , CRM_PLL_MULT_5 = 3 ,
CRM_PLL_MULT_6 = 4 , CRM_PLL_MULT_7 = 5 , CRM_PLL_MULT_8 = 6 , CRM_PLL_MULT_9 = 7 ,
CRM_PLL_MULT_10 = 8 , CRM_PLL_MULT_11 = 9 , CRM_PLL_MULT_12 = 10 , CRM_PLL_MULT_13 = 11 ,
CRM_PLL_MULT_14 = 12 , CRM_PLL_MULT_15 = 13 , CRM_PLL_MULT_16 = 15 , CRM_PLL_MULT_17 = 16 ,
CRM_PLL_MULT_18 = 17 , CRM_PLL_MULT_19 = 18 , CRM_PLL_MULT_20 = 19 , CRM_PLL_MULT_21 = 20 ,
CRM_PLL_MULT_22 = 21 , CRM_PLL_MULT_23 = 22 , CRM_PLL_MULT_24 = 23 , CRM_PLL_MULT_25 = 24 ,
CRM_PLL_MULT_26 = 25 , CRM_PLL_MULT_27 = 26 , CRM_PLL_MULT_28 = 27 , CRM_PLL_MULT_29 = 28 ,
CRM_PLL_MULT_30 = 29 , CRM_PLL_MULT_31 = 30 , CRM_PLL_MULT_32 = 31 , CRM_PLL_MULT_33 = 32 ,
CRM_PLL_MULT_34 = 33 , CRM_PLL_MULT_35 = 34 , CRM_PLL_MULT_36 = 35 , CRM_PLL_MULT_37 = 36 ,
CRM_PLL_MULT_38 = 37 , CRM_PLL_MULT_39 = 38 , CRM_PLL_MULT_40 = 39 , CRM_PLL_MULT_41 = 40 ,
CRM_PLL_MULT_42 = 41 , CRM_PLL_MULT_43 = 42 , CRM_PLL_MULT_44 = 43 , CRM_PLL_MULT_45 = 44 ,
CRM_PLL_MULT_46 = 45 , CRM_PLL_MULT_47 = 46 , CRM_PLL_MULT_48 = 47 , CRM_PLL_MULT_49 = 48 ,
CRM_PLL_MULT_50 = 49 , CRM_PLL_MULT_51 = 50 , CRM_PLL_MULT_52 = 51 , CRM_PLL_MULT_53 = 52 ,
CRM_PLL_MULT_54 = 53 , CRM_PLL_MULT_55 = 54 , CRM_PLL_MULT_56 = 55 , CRM_PLL_MULT_57 = 56 ,
CRM_PLL_MULT_58 = 57 , CRM_PLL_MULT_59 = 58 , CRM_PLL_MULT_60 = 59 , CRM_PLL_MULT_61 = 60 ,
CRM_PLL_MULT_62 = 61 , CRM_PLL_MULT_63 = 62 , CRM_PLL_MULT_64 = 63
}
crm pll mult_x More...
enum crm_pll_fref_type {
CRM_PLL_FREF_4M = 0 , CRM_PLL_FREF_6M = 1 , CRM_PLL_FREF_8M = 2 , CRM_PLL_FREF_12M = 3 ,
CRM_PLL_FREF_16M = 4 , CRM_PLL_FREF_25M = 5
}
crm pll fref_x More...
enum | crm_pll_clock_source_type { CRM_PLL_SOURCE_HICK = 0x00 , CRM_PLL_SOURCE_HEXT = 0x01 , CRM_PLL_SOURCE_HEXT_DIV = 0x02 }
crm pll clock source More...
enum crm_pll_fr_type {
CRM_PLL_FR_1 = 0x00 , CRM_PLL_FR_2 = 0x01 , CRM_PLL_FR_4 = 0x02 , CRM_PLL_FR_8 = 0x03 ,
CRM_PLL_FR_16 = 0x04 , CRM_PLL_FR_32 = 0x05
}
crm pll fr More...
enum crm_clock_source_type {
CRM_CLOCK_SOURCE_HICK = 0x00 , CRM_CLOCK_SOURCE_HEXT = 0x01 , CRM_CLOCK_SOURCE_PLL = 0x02 , CRM_CLOCK_SOURCE_LEXT = 0x03 ,
CRM_CLOCK_SOURCE_LICK = 0x04
}
crm clock source More...
enum crm_ahb_div_type {
CRM_AHB_DIV_1 = 0x00 , CRM_AHB_DIV_2 = 0x08 , CRM_AHB_DIV_4 = 0x09 , CRM_AHB_DIV_8 = 0x0A ,
CRM_AHB_DIV_16 = 0x0B , CRM_AHB_DIV_64 = 0x0C , CRM_AHB_DIV_128 = 0x0D , CRM_AHB_DIV_256 = 0x0E ,
CRM_AHB_DIV_512 = 0x0F
}
crm ahb division More...
enum crm_apb1_div_type {
CRM_APB1_DIV_1 = 0x00 , CRM_APB1_DIV_2 = 0x04 , CRM_APB1_DIV_4 = 0x05 , CRM_APB1_DIV_8 = 0x06 ,
CRM_APB1_DIV_16 = 0x07
}
crm apb1 division More...
enum crm_apb2_div_type {
CRM_APB2_DIV_1 = 0x00 , CRM_APB2_DIV_2 = 0x04 , CRM_APB2_DIV_4 = 0x05 , CRM_APB2_DIV_8 = 0x06 ,
CRM_APB2_DIV_16 = 0x07
}
crm apb2 division More...
enum crm_adc_div_type {
CRM_ADC_DIV_2 = 0x00 , CRM_ADC_DIV_4 = 0x01 , CRM_ADC_DIV_6 = 0x02 , CRM_ADC_DIV_8 = 0x03 ,
CRM_ADC_DIV_12 = 0x05 , CRM_ADC_DIV_16 = 0x07
}
crm adc division More...
enum crm_usb_div_type {
CRM_USB_DIV_1_5 = 0x00 , CRM_USB_DIV_1 = 0x01 , CRM_USB_DIV_2_5 = 0x02 , CRM_USB_DIV_2 = 0x03 ,
CRM_USB_DIV_3_5 = 0x04 , CRM_USB_DIV_3 = 0x05 , CRM_USB_DIV_4 = 0x06
}
crm usb division More...
enum | crm_ertc_clock_type { CRM_ERTC_CLOCK_NOCLK = 0x00 , CRM_ERTC_CLOCK_LEXT = 0x01 , CRM_ERTC_CLOCK_LICK = 0x02 , CRM_ERTC_CLOCK_HEXT_DIV = 0x03 }
crm ertc clock More...
enum | crm_hick_div_6_type { CRM_HICK48_DIV6 = 0x00 , CRM_HICK48_NODIV = 0x01 }
crm hick 48mhz division More...
enum | crm_sclk_type { CRM_SCLK_HICK = 0x00 , CRM_SCLK_HEXT = 0x01 , CRM_SCLK_PLL = 0x02 }
crm sclk select More...
enum crm_clkout_select_type {
CRM_CLKOUT_NOCLK = 0x00 , CRM_CLKOUT_LICK = 0x02 , CRM_CLKOUT_LEXT = 0x03 , CRM_CLKOUT_SCLK = 0x04 ,
CRM_CLKOUT_HICK = 0x05 , CRM_CLKOUT_HEXT = 0x06 , CRM_CLKOUT_PLL_DIV_2 = 0x07 , CRM_CLKOUT_PLL_DIV_4 = 0x0C ,
CRM_CLKOUT_USB = 0x0D , CRM_CLKOUT_ADC = 0x0E
}
crm clkout select More...
enum crm_clkout_div_type {
CRM_CLKOUT_DIV_1 = 0x00 , CRM_CLKOUT_DIV_2 = 0x08 , CRM_CLKOUT_DIV_4 = 0x09 , CRM_CLKOUT_DIV_8 = 0x0A ,
CRM_CLKOUT_DIV_16 = 0x0B , CRM_CLKOUT_DIV_64 = 0x0C , CRM_CLKOUT_DIV_128 = 0x0D , CRM_CLKOUT_DIV_256 = 0x0E ,
CRM_CLKOUT_DIV_512 = 0x0F
}
crm clkout division More...
enum | crm_auto_step_mode_type { CRM_AUTO_STEP_MODE_DISABLE = 0x00 , CRM_AUTO_STEP_MODE_ENABLE = 0x03 }
crm auto step mode More...
enum | crm_usb_clock_source_type { CRM_USB_CLOCK_SOURCE_PLL = 0x00 , CRM_USB_CLOCK_SOURCE_HICK = 0x01 }
crm usb 48 mhz clock source select More...
enum | crm_hick_sclk_frequency_type { CRM_HICK_SCLK_8MHZ = 0x00 , CRM_HICK_SCLK_48MHZ = 0x01 }
crm hick as system clock frequency select More...

Functions

void | crm_reset (void)
reset the crm register More...
void | crm_lext_bypass (confirm_state new_state)
enable or disable crm low speed external crystal bypass More...
void | crm_hext_bypass (confirm_state new_state)
enable or disable crm high speed external crystal bypass More...
flag_status | crm_flag_get (uint32_t flag)
get crm flag status More...
error_status | crm_hext_stable_wait (void)
wait for hext stable More...
void | crm_hick_clock_trimming_set (uint8_t trim_value)
set the hick trimming value More...
void | crm_hick_clock_calibration_set (uint8_t cali_value)
set the crm calibration value More...
void | crm_periph_clock_enable (crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock More...
void | crm_periph_reset (crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset More...
void | crm_periph_sleep_mode_clock_enable (crm_periph_clock_sleepmd_type value, confirm_state new_state)
enable or disable the peripheral clock in sleep mode More...
void | crm_clock_source_enable (crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source More...
void | crm_flag_clear (uint32_t flag)
clear the crm reset flags More...
void | crm_ertc_clock_select (crm_ertc_clock_type value)
select ertc clock More...
void | crm_ertc_clock_enable (confirm_state new_state)
enable or disable ertc More...
void | crm_ahb_div_set (crm_ahb_div_type value)
set crm ahb division More...
void | crm_apb1_div_set (crm_apb1_div_type value)
set crm apb1 division More...
void | crm_apb2_div_set (crm_apb2_div_type value)
set crm apb2 division More...
void | crm_adc_clock_div_set (crm_adc_div_type div_value)
set crm adc division More...
void | crm_usb_clock_div_set (crm_usb_div_type div_value)
set crm usb division More...
void | crm_clock_failure_detection_enable (confirm_state new_state)
enable or disable clock failure detection More...
void | crm_battery_powered_domain_reset (confirm_state new_state)
battery powered domain software reset More...
void | crm_pll_config (crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll More...
void | crm_pll_config2 (crm_pll_clock_source_type clock_source, uint16_t pll_ns, uint16_t pll_ms, crm_pll_fr_type pll_fr)
config crm pll function2, another method. pll_rcs_freq * pll_ns pll clock = -----------------------------— pll_ms * pll_fr_n attemtion: 31 <= pll_ns <= 500 1 <= pll_ms <= 15 More...
void | crm_sysclk_switch (crm_sclk_type value)
select system clock source More...
crm_sclk_type | crm_sysclk_switch_status_get (void)
indicate which clock source is used as system clock More...
void | crm_clocks_freq_get (crm_clocks_freq_type *clocks_struct)
get crm clocks freqency More...
void | crm_clock_out_set (crm_clkout_select_type clkout)
set crm clkout More...
void | crm_interrupt_enable (uint32_t crm_int, confirm_state new_state)
config crm interrupt More...
void | crm_auto_step_mode_enable (confirm_state new_state)
auto step clock switch enable More...
void | crm_hick_divider_select (crm_hick_div_6_type value)
config hick divider select More...
void | crm_hick_sclk_frequency_select (crm_hick_sclk_frequency_type value)
hick as system clock frequency select More...
void | crm_usb_clock_source_select (crm_usb_clock_source_type value)
usb 48 mhz clock source select More...
void | crm_clkout_div_set (crm_clkout_div_type clkout_div)
set crm clkout division More...
void | crm_otgfs_ep3_remap_enable (confirm_state new_state)
enable or disable otgfs end-point3 remap, only available in at32f415xx revision C. at32f415xx revision B: (not support) do not support configuration ep3 remap. More...
void | crm_usbdiv_reset (confirm_state new_state)
usb divider reset, only available in at32f415xx revision C. at32f415xx revision B: (not support) usb divider(CRM_CFG[usbdiv]) do not support to be reset. More...

Detailed Description

at32f415 crm header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_crm.h.


AT32F415 Firmwary Library: at32f415_debug.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Functions
at32f415_debug.h File Reference

at32f415 debug header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct debug_type
type define debug register all More...

Macros

#define | DEBUG_SLEEP ((uint32_t)0x00000001)
#define | DEBUG_STOP ((uint32_t)0x00000002)
#define | DEBUG_STANDBY ((uint32_t)0x00000004)
#define | DEBUG_WDT_PAUSE ((uint32_t)0x00000100)
#define | DEBUG_WWDT_PAUSE ((uint32_t)0x00000200)
#define | DEBUG_TMR1_PAUSE ((uint32_t)0x00000400)
#define | DEBUG_TMR3_PAUSE ((uint32_t)0x00001000)
#define | DEBUG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00008000)
#define | DEBUG_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00010000)
#define | DEBUG_TMR2_PAUSE ((uint32_t)0x00000800)
#define | DEBUG_TMR4_PAUSE ((uint32_t)0x00002000)
#define | DEBUG_CAN1_PAUSE ((uint32_t)0x00004000)
#define | DEBUG_TMR5_PAUSE ((uint32_t)0x00040000)
#define | DEBUG_TMR9_PAUSE ((uint32_t)0x10000000)
#define | DEBUG_TMR10_PAUSE ((uint32_t)0x20000000)
#define | DEBUG_TMR11_PAUSE ((uint32_t)0x40000000)
#define | DEBUGMCU ((debug_type *) DEBUG_BASE)

Functions

uint32_t | debug_device_id_get (void)
get debug device id More...
void | debug_periph_mode_set (uint32_t periph_debug_mode, confirm_state new_state)
set periph debug mode
More...

Detailed Description

at32f415 debug header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_debug.h.


AT32F415 Firmwary Library: at32f415_def.h File Reference

  • libraries
  • drivers
  • inc
at32f415_def.h File Reference

at32f415 macros header file More...

Go to the source code of this file.

Detailed Description

at32f415 macros header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_def.h.


AT32F415 Firmwary Library: at32f415_dma.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_dma.h File Reference

at32f415 dma header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | dma_init_type
dma init type More...
struct | dma_type
type define dma register More...
struct | dma_channel_type
type define dma channel register all More...

Macros

#define | DMA_FDT_INT ((uint32_t)0x00000002)
#define | DMA_HDT_INT ((uint32_t)0x00000004)
#define | DMA_DTERR_INT ((uint32_t)0x00000008)
#define | FLEX_CHANNEL1 ((uint8_t)0x01)
#define | FLEX_CHANNEL2 ((uint8_t)0x02)
#define | FLEX_CHANNEL3 ((uint8_t)0x03)
#define | FLEX_CHANNEL4 ((uint8_t)0x04)
#define | FLEX_CHANNEL5 ((uint8_t)0x05)
#define | FLEX_CHANNEL6 ((uint8_t)0x06)
#define | FLEX_CHANNEL7 ((uint8_t)0x07)
#define | DMA1_GL1_FLAG ((uint32_t)0x00000001)
#define | DMA1_FDT1_FLAG ((uint32_t)0x00000002)
#define | DMA1_HDT1_FLAG ((uint32_t)0x00000004)
#define | DMA1_DTERR1_FLAG ((uint32_t)0x00000008)
#define | DMA1_GL2_FLAG ((uint32_t)0x00000010)
#define | DMA1_FDT2_FLAG ((uint32_t)0x00000020)
#define | DMA1_HDT2_FLAG ((uint32_t)0x00000040)
#define | DMA1_DTERR2_FLAG ((uint32_t)0x00000080)
#define | DMA1_GL3_FLAG ((uint32_t)0x00000100)
#define | DMA1_FDT3_FLAG ((uint32_t)0x00000200)
#define | DMA1_HDT3_FLAG ((uint32_t)0x00000400)
#define | DMA1_DTERR3_FLAG ((uint32_t)0x00000800)
#define | DMA1_GL4_FLAG ((uint32_t)0x00001000)
#define | DMA1_FDT4_FLAG ((uint32_t)0x00002000)
#define | DMA1_HDT4_FLAG ((uint32_t)0x00004000)
#define | DMA1_DTERR4_FLAG ((uint32_t)0x00008000)
#define | DMA1_GL5_FLAG ((uint32_t)0x00010000)
#define | DMA1_FDT5_FLAG ((uint32_t)0x00020000)
#define | DMA1_HDT5_FLAG ((uint32_t)0x00040000)
#define | DMA1_DTERR5_FLAG ((uint32_t)0x00080000)
#define | DMA1_GL6_FLAG ((uint32_t)0x00100000)
#define | DMA1_FDT6_FLAG ((uint32_t)0x00200000)
#define | DMA1_HDT6_FLAG ((uint32_t)0x00400000)
#define | DMA1_DTERR6_FLAG ((uint32_t)0x00800000)
#define | DMA1_GL7_FLAG ((uint32_t)0x01000000)
#define | DMA1_FDT7_FLAG ((uint32_t)0x02000000)
#define | DMA1_HDT7_FLAG ((uint32_t)0x04000000)
#define | DMA1_DTERR7_FLAG ((uint32_t)0x08000000)
#define | DMA2_GL1_FLAG ((uint32_t)0x10000001)
#define | DMA2_FDT1_FLAG ((uint32_t)0x10000002)
#define | DMA2_HDT1_FLAG ((uint32_t)0x10000004)
#define | DMA2_DTERR1_FLAG ((uint32_t)0x10000008)
#define | DMA2_GL2_FLAG ((uint32_t)0x10000010)
#define | DMA2_FDT2_FLAG ((uint32_t)0x10000020)
#define | DMA2_HDT2_FLAG ((uint32_t)0x10000040)
#define | DMA2_DTERR2_FLAG ((uint32_t)0x10000080)
#define | DMA2_GL3_FLAG ((uint32_t)0x10000100)
#define | DMA2_FDT3_FLAG ((uint32_t)0x10000200)
#define | DMA2_HDT3_FLAG ((uint32_t)0x10000400)
#define | DMA2_DTERR3_FLAG ((uint32_t)0x10000800)
#define | DMA2_GL4_FLAG ((uint32_t)0x10001000)
#define | DMA2_FDT4_FLAG ((uint32_t)0x10002000)
#define | DMA2_HDT4_FLAG ((uint32_t)0x10004000)
#define | DMA2_DTERR4_FLAG ((uint32_t)0x10008000)
#define | DMA2_GL5_FLAG ((uint32_t)0x10010000)
#define | DMA2_FDT5_FLAG ((uint32_t)0x10020000)
#define | DMA2_HDT5_FLAG ((uint32_t)0x10040000)
#define | DMA2_DTERR5_FLAG ((uint32_t)0x10080000)
#define | DMA2_GL6_FLAG ((uint32_t)0x10100000)
#define | DMA2_FDT6_FLAG ((uint32_t)0x10200000)
#define | DMA2_HDT6_FLAG ((uint32_t)0x10400000)
#define | DMA2_DTERR6_FLAG ((uint32_t)0x10800000)
#define | DMA2_GL7_FLAG ((uint32_t)0x11000000)
#define | DMA2_FDT7_FLAG ((uint32_t)0x12000000)
#define | DMA2_HDT7_FLAG ((uint32_t)0x14000000)
#define | DMA2_DTERR7_FLAG ((uint32_t)0x18000000)
#define | DMA1 ((dma_type *) DMA1_BASE)
#define | DMA1_CHANNEL1 ((dma_channel_type *) DMA1_CHANNEL1_BASE)
#define | DMA1_CHANNEL2 ((dma_channel_type *) DMA1_CHANNEL2_BASE)
#define | DMA1_CHANNEL3 ((dma_channel_type *) DMA1_CHANNEL3_BASE)
#define | DMA1_CHANNEL4 ((dma_channel_type *) DMA1_CHANNEL4_BASE)
#define | DMA1_CHANNEL5 ((dma_channel_type *) DMA1_CHANNEL5_BASE)
#define | DMA1_CHANNEL6 ((dma_channel_type *) DMA1_CHANNEL6_BASE)
#define | DMA1_CHANNEL7 ((dma_channel_type *) DMA1_CHANNEL7_BASE)
#define | DMA2 ((dma_type *) DMA2_BASE)
#define | DMA2_CHANNEL1 ((dma_channel_type *) DMA2_CHANNEL1_BASE)
#define | DMA2_CHANNEL2 ((dma_channel_type *) DMA2_CHANNEL2_BASE)
#define | DMA2_CHANNEL3 ((dma_channel_type *) DMA2_CHANNEL3_BASE)
#define | DMA2_CHANNEL4 ((dma_channel_type *) DMA2_CHANNEL4_BASE)
#define | DMA2_CHANNEL5 ((dma_channel_type *) DMA2_CHANNEL5_BASE)
#define | DMA2_CHANNEL6 ((dma_channel_type *) DMA2_CHANNEL6_BASE)
#define | DMA2_CHANNEL7 ((dma_channel_type *) DMA2_CHANNEL7_BASE)

Enumerations

enum dma_flexible_request_type {
DMA_FLEXIBLE_ADC1 = 0x01 , DMA_FLEXIBLE_SPI1_RX = 0x09 , DMA_FLEXIBLE_SPI1_TX = 0x0A , DMA_FLEXIBLE_SPI2_RX = 0x0B ,
DMA_FLEXIBLE_SPI2_TX = 0x0C , DMA_FLEXIBLE_UART1_RX = 0x19 , DMA_FLEXIBLE_UART1_TX = 0x1A , DMA_FLEXIBLE_UART2_RX = 0x1B ,
DMA_FLEXIBLE_UART2_TX = 0x1C , DMA_FLEXIBLE_UART3_RX = 0x1D , DMA_FLEXIBLE_UART3_TX = 0x1E , DMA_FLEXIBLE_UART4_RX = 0x1F ,
DMA_FLEXIBLE_UART4_TX = 0x20 , DMA_FLEXIBLE_UART5_RX = 0x21 , DMA_FLEXIBLE_UART5_TX = 0x22 , DMA_FLEXIBLE_I2C1_RX = 0x29 ,
DMA_FLEXIBLE_I2C1_TX = 0x2A , DMA_FLEXIBLE_I2C2_RX = 0x2B , DMA_FLEXIBLE_I2C2_TX = 0x2C , DMA_FLEXIBLE_SDIO1 = 0x31 ,
DMA_FLEXIBLE_TMR1_TRIG = 0x35 , DMA_FLEXIBLE_TMR1_HALL = 0x36 , DMA_FLEXIBLE_TMR1_OVERFLOW = 0x37 , DMA_FLEXIBLE_TMR1_CH1 = 0x38 ,
DMA_FLEXIBLE_TMR1_CH2 = 0x39 , DMA_FLEXIBLE_TMR1_CH3 = 0x3A , DMA_FLEXIBLE_TMR1_CH4 = 0x3B , DMA_FLEXIBLE_TMR2_TRIG = 0x3D ,
DMA_FLEXIBLE_TMR2_OVERFLOW = 0x3F , DMA_FLEXIBLE_TMR2_CH1 = 0x40 , DMA_FLEXIBLE_TMR2_CH2 = 0x41 , DMA_FLEXIBLE_TMR2_CH3 = 0x42 ,
DMA_FLEXIBLE_TMR2_CH4 = 0x43 , DMA_FLEXIBLE_TMR3_TRIG = 0x45 , DMA_FLEXIBLE_TMR3_OVERFLOW = 0x47 , DMA_FLEXIBLE_TMR3_CH1 = 0x48 ,
DMA_FLEXIBLE_TMR3_CH2 = 0x49 , DMA_FLEXIBLE_TMR3_CH3 = 0x4A , DMA_FLEXIBLE_TMR3_CH4 = 0x4B , DMA_FLEXIBLE_TMR4_TRIG = 0x4D ,
DMA_FLEXIBLE_TMR4_OVERFLOW = 0x4F , DMA_FLEXIBLE_TMR4_CH1 = 0x50 , DMA_FLEXIBLE_TMR4_CH2 = 0x51 , DMA_FLEXIBLE_TMR4_CH3 = 0x52 ,
DMA_FLEXIBLE_TMR4_CH4 = 0x53 , DMA_FLEXIBLE_TMR5_TRIG = 0x55 , DMA_FLEXIBLE_TMR5_OVERFLOW = 0x57 , DMA_FLEXIBLE_TMR5_CH1 = 0x58 ,
DMA_FLEXIBLE_TMR5_CH2 = 0x59 , DMA_FLEXIBLE_TMR5_CH3 = 0x5A , DMA_FLEXIBLE_TMR5_CH4 = 0x5B
}
dma flexible request type More...
enum | dma_dir_type { DMA_DIR_PERIPHERAL_TO_MEMORY = 0x0000 , DMA_DIR_MEMORY_TO_PERIPHERAL = 0x0010 , DMA_DIR_MEMORY_TO_MEMORY = 0x4000 }
dma direction type More...
enum | dma_peripheral_inc_type { DMA_PERIPHERAL_INC_DISABLE = 0x00 , DMA_PERIPHERAL_INC_ENABLE = 0x01 }
dma peripheral incremented type More...
enum | dma_memory_inc_type { DMA_MEMORY_INC_DISABLE = 0x00 , DMA_MEMORY_INC_ENABLE = 0x01 }
dma memory incremented type More...
enum | dma_peripheral_data_size_type { DMA_PERIPHERAL_DATA_WIDTH_BYTE = 0x00 , DMA_PERIPHERAL_DATA_WIDTH_HALFWORD = 0x01 , DMA_PERIPHERAL_DATA_WIDTH_WORD = 0x02 }
dma peripheral data size type More...
enum | dma_memory_data_size_type { DMA_MEMORY_DATA_WIDTH_BYTE = 0x00 , DMA_MEMORY_DATA_WIDTH_HALFWORD = 0x01 , DMA_MEMORY_DATA_WIDTH_WORD = 0x02 }
dma memory data size type More...
enum | dma_priority_level_type { DMA_PRIORITY_LOW = 0x00 , DMA_PRIORITY_MEDIUM = 0x01 , DMA_PRIORITY_HIGH = 0x02 , DMA_PRIORITY_VERY_HIGH = 0x03 }
dma priority level type More...

Functions

void | dma_reset (dma_channel_type *dmax_channely)
reset the dmax channely registers. More...
void | dma_default_para_init (dma_init_type *dma_init_struct)
dma init config with its default value. More...
void | dma_init (dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init More...
void | dma_channel_enable (dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely More...
void | dma_flexible_config (dma_type *dma_x, uint8_t flex_channelx, dma_flexible_request_type flexible_request)
initialize the dma_x flexible function according to the specified parameters. More...
void | dma_data_number_set (dma_channel_type *dmax_channely, uint16_t data_number)
set the number of data to be transferred More...
uint16_t | dma_data_number_get (dma_channel_type *dmax_channely)
get number of data from dtcnt register More...
void | dma_interrupt_enable (dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt More...
flag_status | dma_flag_get (uint32_t dmax_flag)
get dma flag More...
void | dma_flag_clear (uint32_t dmax_flag)
clear dma flag
More...

Detailed Description

at32f415 dma header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_dma.h.


AT32F415 Firmwary Library: at32f415_ertc.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_ertc.h File Reference

at32f415 ertc header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | ertc_time_type
ertc time More...
struct | ertc_alarm_value_type
ertc alarm More...
union | ertc_reg_time_type
ertc time reg union More...
union | ertc_reg_date_type
ertc date reg union More...
union | ertc_reg_alarm_type
ertc alarm reg union More...
union | ertc_reg_scal_type
ertc scal reg union More...
union | ertc_reg_tadj_type
ertc tadj reg union More...
union | ertc_reg_tstm_type
ertc tstm reg union More...
union | ertc_reg_tsdt_type
ertc tsdt register, offset:0x34 More...
struct | ertc_type
type define ertc register all More...

Macros

#define | ERTC_TP_INT ((uint32_t)0x00000004)
#define | ERTC_ALA_INT ((uint32_t)0x00001000)
#define | ERTC_ALB_INT ((uint32_t)0x00002000)
#define | ERTC_WAT_INT ((uint32_t)0x00004000)
#define | ERTC_TS_INT ((uint32_t)0x00008000)
#define | ERTC_ALAWF_FLAG ((uint32_t)0x00000001)
#define | ERTC_ALBWF_FLAG ((uint32_t)0x00000002)
#define | ERTC_WATWF_FLAG ((uint32_t)0x00000004)
#define | ERTC_TADJF_FLAG ((uint32_t)0x00000008)
#define | ERTC_INITF_FLAG ((uint32_t)0x00000010)
#define | ERTC_UPDF_FLAG ((uint32_t)0x00000020)
#define | ERTC_IMF_FLAG ((uint32_t)0x00000040)
#define | ERTC_ALAF_FLAG ((uint32_t)0x00000100)
#define | ERTC_ALBF_FLAG ((uint32_t)0x00000200)
#define | ERTC_WATF_FLAG ((uint32_t)0x00000400)
#define | ERTC_TSF_FLAG ((uint32_t)0x00000800)
#define | ERTC_TSOF_FLAG ((uint32_t)0x00001000)
#define | ERTC_TP1F_FLAG ((uint32_t)0x00002000)
#define | ERTC_CALUPDF_FLAG ((uint32_t)0x00010000)
#define | ERTC_ALARM_MASK_NONE ((uint32_t)0x00000000)
ertc alarm mask More...
#define | ERTC_ALARM_MASK_SEC ((uint32_t)0x00000080)
#define | ERTC_ALARM_MASK_MIN ((uint32_t)0x00008000)
#define | ERTC_ALARM_MASK_HOUR ((uint32_t)0x00800000)
#define | ERTC_ALARM_MASK_DATE_WEEK ((uint32_t)0x80000000)
#define | ERTC_ALARM_MASK_ALL ((uint32_t)0x80808080)
#define | ERTC ((ertc_type *) ERTC_BASE)

Enumerations

enum | ertc_hour_mode_set_type { ERTC_HOUR_MODE_24 = 0x00 , ERTC_HOUR_MODE_12 = 0x01 }
ertc hour mode More...
enum | ertc_am_pm_type { ERTC_24H = 0x00 , ERTC_AM = 0x00 , ERTC_PM = 0x01 }
ertc 12-hour format am/pm More...
enum | ertc_week_date_select_type { ERTC_SLECT_DATE = 0x00 , ERTC_SLECT_WEEK = 0x01 }
ertc week or date select More...
enum | ertc_alarm_type { ERTC_ALA = 0x00 , ERTC_ALB = 0x01 }
ertc alarm x select More...
enum ertc_alarm_sbs_mask_type {
ERTC_ALARM_SBS_MASK_ALL = 0x00 , ERTC_ALARM_SBS_MASK_14_1 = 0x01 , ERTC_ALARM_SBS_MASK_14_2 = 0x02 , ERTC_ALARM_SBS_MASK_14_3 = 0x03 ,
ERTC_ALARM_SBS_MASK_14_4 = 0x04 , ERTC_ALARM_SBS_MASK_14_5 = 0x05 , ERTC_ALARM_SBS_MASK_14_6 = 0x06 , ERTC_ALARM_SBS_MASK_14_7 = 0x07 ,
ERTC_ALARM_SBS_MASK_14_8 = 0x08 , ERTC_ALARM_SBS_MASK_14_9 = 0x09 , ERTC_ALARM_SBS_MASK_14_10 = 0x0A , ERTC_ALARM_SBS_MASK_14_11 = 0x0B ,
ERTC_ALARM_SBS_MASK_14_12 = 0x0C , ERTC_ALARM_SBS_MASK_14_13 = 0x0D , ERTC_ALARM_SBS_MASK_14 = 0x0E , ERTC_ALARM_SBS_MASK_NONE = 0x0F
}
ertc alarm sub second mask More...
enum ertc_wakeup_clock_type {
ERTC_WAT_CLK_ERTCCLK_DIV16 = 0x00 , ERTC_WAT_CLK_ERTCCLK_DIV8 = 0x01 , ERTC_WAT_CLK_ERTCCLK_DIV4 = 0x02 , ERTC_WAT_CLK_ERTCCLK_DIV2 = 0x03 ,
ERTC_WAT_CLK_CK_A_16BITS = 0x04 , ERTC_WAT_CLK_CK_A_17BITS = 0x06
}
ertc wakeup timer clock select More...
enum | ertc_smooth_cal_period_type { ERTC_SMOOTH_CAL_PERIOD_32 = 0x00 , ERTC_SMOOTH_CAL_PERIOD_16 = 0x01 , ERTC_SMOOTH_CAL_PERIOD_8 = 0x02 }
ertc smooth calibration period More...
enum | ertc_smooth_cal_clk_add_type { ERTC_SMOOTH_CAL_CLK_ADD_0 = 0x00 , ERTC_SMOOTH_CAL_CLK_ADD_512 = 0x01 }
ertc smooth calibration clock add mode More...
enum | ertc_cal_direction_type { ERTC_CAL_DIR_POSITIVE = 0x00 , ERTC_CAL_DIR_NEGATIVE = 0x01 }
ertc calibration direction mode More...
enum | ertc_cal_output_select_type { ERTC_CAL_OUTPUT_512HZ = 0x00 , ERTC_CAL_OUTPUT_1HZ = 0x01 }
ertc calibration output mode More...
enum | ertc_time_adjust_type { ERTC_TIME_ADD_NONE = 0x00 , ERTC_TIME_ADD_1S = 0x01 }
time adjust add mode More...
enum | ertc_dst_operation_type { ERTC_DST_ADD_1H = 0x00 , ERTC_DST_DEC_1H = 0x01 }
ertc daylight saving time hour adjustment mode More...
enum | ertc_dst_save_type { ERTC_DST_SAVE_0 = 0x00 , ERTC_DST_SAVE_1 = 0x01 }
ertc daylight saving time store operation mode More...
enum | ertc_output_source_type { ERTC_OUTPUT_DISABLE = 0x00 , ERTC_OUTPUT_ALARM_A = 0x01 , ERTC_OUTPUT_ALARM_B = 0x02 , ERTC_OUTPUT_WAKEUP = 0x03 }
output source More...
enum | ertc_output_polarity_type { ERTC_OUTPUT_POLARITY_HIGH = 0x00 , ERTC_OUTPUT_POLARITY_LOW = 0x01 }
output polarity More...
enum | ertc_output_type { ERTC_OUTPUT_TYPE_OPEN_DRAIN = 0x00 , ERTC_OUTPUT_TYPE_PUSH_PULL = 0x01 }
output type More...
enum | ertc_pin_select_type { ERTC_PIN_PC13 = 0x00 , ERTC_PIN_PA0 = 0x01 }
timestamp/ tamper detection pin selection More...
enum | ertc_timestamp_valid_edge_type { ERTC_TIMESTAMP_EDGE_RISING = 0x00 , ERTC_TIMESTAMP_EDGE_FALLING = 0x01 }
ertc timestamp valid edge More...
enum | ertc_tamper_select_type { ERTC_TAMPER_1 = 0x00 }
ertc tamper x select More...
enum | ertc_tamper_precharge_type { ERTC_TAMPER_PR_1_ERTCCLK = 0x00 , ERTC_TAMPER_PR_2_ERTCCLK = 0x01 , ERTC_TAMPER_PR_4_ERTCCLK = 0x02 , ERTC_TAMPER_PR_8_ERTCCLK = 0x03 }
tamper detection pre-charge time More...
enum | ertc_tamper_filter_type { ERTC_TAMPER_FILTER_DISABLE = 0x00 , ERTC_TAMPER_FILTER_2 = 0x01 , ERTC_TAMPER_FILTER_4 = 0x02 , ERTC_TAMPER_FILTER_8 = 0x03 }
ertc tamper filter More...
enum ertc_tamper_detect_freq_type {
ERTC_TAMPER_FREQ_DIV_32768 = 0x00 , ERTC_TAMPER_FREQ_DIV_16384 = 0x01 , ERTC_TAMPER_FREQ_DIV_8192 = 0x02 , ERTC_TAMPER_FREQ_DIV_4096 = 0x03 ,
ERTC_TAMPER_FREQ_DIV_2048 = 0x04 , ERTC_TAMPER_FREQ_DIV_1024 = 0x05 , ERTC_TAMPER_FREQ_DIV_512 = 0x06 , ERTC_TAMPER_FREQ_DIV_256 = 0x07
}
ertc tamper detection frequency More...
enum | ertc_tamper_valid_edge_type { ERTC_TAMPER_EDGE_RISING = 0x00 , ERTC_TAMPER_EDGE_FALLING = 0x01 , ERTC_TAMPER_EDGE_LOW = 0x00 , ERTC_TAMPER_EDGE_HIGH = 0x01 }
ertc tamper valid edge More...
enum ertc_dt_type {
ERTC_DT1 = 0 , ERTC_DT2 = 1 , ERTC_DT3 = 2 , ERTC_DT4 = 3 ,
ERTC_DT5 = 4 , ERTC_DT6 = 5 , ERTC_DT7 = 6 , ERTC_DT8 = 7 ,
ERTC_DT9 = 8 , ERTC_DT10 = 9 , ERTC_DT11 = 10 , ERTC_DT12 = 11 ,
ERTC_DT13 = 12 , ERTC_DT14 = 13 , ERTC_DT15 = 14 , ERTC_DT16 = 15 ,
ERTC_DT17 = 16 , ERTC_DT18 = 17 , ERTC_DT19 = 18 , ERTC_DT20 = 19
}
ertc bpr register More...

Functions

uint8_t | ertc_num_to_bcd (uint8_t num)
number conversion to bcd code. More...
uint8_t | ertc_bcd_to_num (uint8_t bcd)
bcd code conversion to number. More...
void | ertc_write_protect_enable (void)
enable write protection. More...
void | ertc_write_protect_disable (void)
disable write protection. More...
error_status | ertc_wait_update (void)
ertc wait register update finish. More...
error_status | ertc_wait_flag (uint32_t flag, flag_status status)
ertc wait flag status. More...
error_status | ertc_init_mode_enter (void)
ertc enter init mode. More...
void | ertc_init_mode_exit (void)
ertc exit init mode. More...
error_status | ertc_reset (void)
ertc reset all register. More...
error_status | ertc_divider_set (uint16_t div_a, uint16_t div_b)
ertc division set. More...
error_status | ertc_hour_mode_set (ertc_hour_mode_set_type mode)
ertc hour mode set. More...
error_status | ertc_date_set (uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date. More...
error_status | ertc_time_set (uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time. More...
void | ertc_calendar_get (ertc_time_type *time)
get calendar More...
uint32_t | ertc_sub_second_get (void)
get current sub second. More...
void | ertc_alarm_mask_set (ertc_alarm_type alarm_x, uint32_t mask)
set which bits are irrelevant to the alarm match. More...
void | ertc_alarm_week_date_select (ertc_alarm_type alarm_x, ertc_week_date_select_type wk)
alarm week or date mode select. More...
void | ertc_alarm_set (ertc_alarm_type alarm_x, uint8_t week_date, uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set alarm. More...
void | ertc_alarm_sub_second_set (ertc_alarm_type alarm_x, uint32_t value, ertc_alarm_sbs_mask_type mask)
set alarm sub second. More...
error_status | ertc_alarm_enable (ertc_alarm_type alarm_x, confirm_state new_state)
enable or disable alarm clock. More...
void | ertc_alarm_get (ertc_alarm_type alarm_x, ertc_alarm_value_type *alarm)
get alarm value. More...
uint32_t | ertc_alarm_sub_second_get (ertc_alarm_type alarm_x)
get alarm sub second. More...
void | ertc_wakeup_clock_set (ertc_wakeup_clock_type clock)
set wakeup timer clock. More...
void | ertc_wakeup_counter_set (uint32_t counter)
set wakeup counter. More...
uint16_t | ertc_wakeup_counter_get (void)
get wakeup counter. More...
error_status | ertc_wakeup_enable (confirm_state new_state)
enable or disable wakeup timer. More...
error_status | ertc_smooth_calibration_config (ertc_smooth_cal_period_type period, ertc_smooth_cal_clk_add_type clk_add, uint32_t clk_dec)
config the smooth calibration. More...
error_status | ertc_coarse_calibration_set (ertc_cal_direction_type dir, uint32_t value)
set the coarse digital calibration. More...
error_status | ertc_coarse_calibration_enable (confirm_state new_state)
enable or disable coarse calibration. More...
void | ertc_cal_output_select (ertc_cal_output_select_type output)
calibration output source select. More...
void | ertc_cal_output_enable (confirm_state new_state)
enable or disable calibration output. More...
error_status | ertc_time_adjust (ertc_time_adjust_type add1s, uint32_t decsbs)
adjust the time. More...
void | ertc_daylight_set (ertc_dst_operation_type operation, ertc_dst_save_type save)
config the daylight saving time. More...
uint8_t | ertc_daylight_bpr_get (void)
get the bpr value. More...
error_status | ertc_refer_clock_detect_enable (confirm_state new_state)
enable or disable refer clock detect. More...
void | ertc_direct_read_enable (confirm_state new_state)
enable or disable direct read mode. More...
void | ertc_output_set (ertc_output_source_type source, ertc_output_polarity_type polarity, ertc_output_type type)
set the output mode. More...
void | ertc_timestamp_valid_edge_set (ertc_timestamp_valid_edge_type edge)
set the timestamp valid edge. More...
void | ertc_timestamp_enable (confirm_state new_state)
enable or disable timestamp. More...
void | ertc_timestamp_get (ertc_time_type *time)
get the timestamp. More...
uint32_t | ertc_timestamp_sub_second_get (void)
get the timestamp sub second. More...
void | ertc_tamper_pull_up_enable (confirm_state new_state)
enable or disable tamper pin pull up. More...
void | ertc_tamper_precharge_set (ertc_tamper_precharge_type precharge)
set the tamper pin pre-charge time. More...
void | ertc_tamper_filter_set (ertc_tamper_filter_type filter)
set the tamper filter time. More...
void | ertc_tamper_detect_freq_set (ertc_tamper_detect_freq_type freq)
set the tamper detection frequency. More...
void | ertc_tamper_valid_edge_set (ertc_tamper_select_type tamper_x, ertc_tamper_valid_edge_type trigger)
set the tamper trigger. More...
void | ertc_tamper_timestamp_enable (confirm_state new_state)
enable or disable trigger timestamp when tamper event occurs. More...
void | ertc_tamper_enable (ertc_tamper_select_type tamper_x, confirm_state new_state)
enable or disable tamper. More...
void | ertc_interrupt_enable (uint32_t source, confirm_state new_state)
enable or disable interrupt. More...
flag_status | ertc_interrupt_get (uint32_t source)
get interrupt status More...
flag_status | ertc_flag_get (uint32_t flag)
get flag status. More...
void | ertc_flag_clear (uint32_t flag)
clear flag status More...
void | ertc_bpr_data_write (ertc_dt_type dt, uint32_t data)
write data to the bpr register. More...
uint32_t | ertc_bpr_data_read (ertc_dt_type dt)
read data from bpr register. More...

Detailed Description

at32f415 ertc header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_ertc.h.


AT32F415 Firmwary Library: at32f415_exint.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_exint.h File Reference

at32f415 exint header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | exint_init_type
exint init type More...
struct | exint_type
type define exint register all More...

Macros

#define | EXINT_LINE_NONE ((uint32_t)0x000000)
#define | EXINT_LINE_0 ((uint32_t)0x000001)
#define | EXINT_LINE_1 ((uint32_t)0x000002)
#define | EXINT_LINE_2 ((uint32_t)0x000004)
#define | EXINT_LINE_3 ((uint32_t)0x000008)
#define | EXINT_LINE_4 ((uint32_t)0x000010)
#define | EXINT_LINE_5 ((uint32_t)0x000020)
#define | EXINT_LINE_6 ((uint32_t)0x000040)
#define | EXINT_LINE_7 ((uint32_t)0x000080)
#define | EXINT_LINE_8 ((uint32_t)0x000100)
#define | EXINT_LINE_9 ((uint32_t)0x000200)
#define | EXINT_LINE_10 ((uint32_t)0x000400)
#define | EXINT_LINE_11 ((uint32_t)0x000800)
#define | EXINT_LINE_12 ((uint32_t)0x001000)
#define | EXINT_LINE_13 ((uint32_t)0x002000)
#define | EXINT_LINE_14 ((uint32_t)0x004000)
#define | EXINT_LINE_15 ((uint32_t)0x008000)
#define | EXINT_LINE_16 ((uint32_t)0x010000)
#define | EXINT_LINE_17 ((uint32_t)0x020000)
#define | EXINT_LINE_18 ((uint32_t)0x040000)
#define | EXINT_LINE_19 ((uint32_t)0x080000)
#define | EXINT_LINE_20 ((uint32_t)0x100000)
#define | EXINT_LINE_21 ((uint32_t)0x200000)
#define | EXINT_LINE_22 ((uint32_t)0x400000)
#define | EXINT ((exint_type *) EXINT_BASE)

Enumerations

enum | exint_line_mode_type { EXINT_LINE_INTERRUPUT = 0x00 , EXINT_LINE_EVENT = 0x01 }
exint line mode type More...
enum | exint_polarity_config_type { EXINT_TRIGGER_RISING_EDGE = 0x00 , EXINT_TRIGGER_FALLING_EDGE = 0x01 , EXINT_TRIGGER_BOTH_EDGE = 0x02 }
exint polarity configuration type More...

Functions

void | exint_reset (void)
exint reset More...
void | exint_default_para_init (exint_init_type *exint_struct)
exint default para init More...
void | exint_init (exint_init_type *exint_struct)
exint init More...
void | exint_flag_clear (uint32_t exint_line)
clear exint flag More...
flag_status | exint_flag_get (uint32_t exint_line)
get exint flag More...
void | exint_software_interrupt_event_generate (uint32_t exint_line)
generate exint software interrupt event More...
void | exint_interrupt_enable (uint32_t exint_line, confirm_state new_state)
enable or disable exint interrupt More...
void | exint_event_enable (uint32_t exint_line, confirm_state new_state)
enable or disable exint event More...

Detailed Description

at32f415 exint header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_exint.h.


AT32F415 Firmwary Library: at32f415_flash.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_flash.h File Reference

at32f415 flash header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | flash_type
type define flash register all More...
struct | usd_type
user system data More...

Macros

#define | FLASH_UNLOCK_KEY1 ((uint32_t)0x45670123)
#define | FLASH_UNLOCK_KEY2 ((uint32_t)0xCDEF89AB)
#define | FAP_RELIEVE_KEY ((uint16_t)0x00A5)
#define | FAP_HIGH_LEVEL_KEY ((uint16_t)0x00CC)
#define | SLIB_UNLOCK_KEY ((uint32_t)0xA35F6D24)
#define | FLASH_OBF_FLAG ((uint32_t)0x00000001)
#define | FLASH_ODF_FLAG ((uint32_t)0x00000020)
#define | FLASH_PRGMERR_FLAG ((uint32_t)0x00000004)
#define | FLASH_EPPERR_FLAG ((uint32_t)0x00000010)
#define | FLASH_USDERR_FLAG ((uint32_t)0x40000001)
#define | FLASH_ERR_INT ((uint32_t)0x00000001)
#define | FLASH_ODF_INT ((uint32_t)0x00000002)
#define | FLASH_SLIB_START_SECTOR ((uint32_t)0x000007FF)
#define | FLASH_SLIB_DATA_START_SECTOR ((uint32_t)0x003FF800)
#define | FLASH_SLIB_END_SECTOR ((uint32_t)0xFFC00000)
#define | USD_WDT_ATO_DISABLE ((uint16_t)0x0001)
#define | USD_WDT_ATO_ENABLE ((uint16_t)0x0000)
#define | USD_DEPSLP_NO_RST ((uint16_t)0x0002)
#define | USD_DEPSLP_RST ((uint16_t)0x0000)
#define | USD_STDBY_NO_RST ((uint16_t)0x0004)
#define | USD_STDBY_RST ((uint16_t)0x0000)
#define | ERASE_TIMEOUT ((uint32_t)0x40000000)
#define | PROGRAMMING_TIMEOUT ((uint32_t)0x00100000)
#define | OPERATION_TIMEOUT ((uint32_t)0x10000000)
#define | flash_psr_set(wtcyc) (FLASH->psr |= (uint32_t)(0x150 | wtcyc))
set the flash psr register More...
#define | FLASH ((flash_type *) FLASH_REG_BASE)
#define | USD ((usd_type *) USD_BASE)

Enumerations

enum flash_status_type {
FLASH_OPERATE_BUSY = 0x00 , FLASH_PROGRAM_ERROR = 0x01 , FLASH_EPP_ERROR = 0x02 , FLASH_OPERATE_DONE = 0x03 ,
FLASH_OPERATE_TIMEOUT = 0x04
}
flash status type More...
enum flash_wait_cycle_type {
FLASH_WAIT_CYCLE_0 = 0x00 , FLASH_WAIT_CYCLE_1 = 0x01 , FLASH_WAIT_CYCLE_2 = 0x02 , FLASH_WAIT_CYCLE_3 = 0x03 ,
FLASH_WAIT_CYCLE_4 = 0x04
}
flash wait cycle type More...

Functions

flag_status | flash_flag_get (uint32_t flash_flag)
check whether the specified flash flag is set or not. More...
void | flash_flag_clear (uint32_t flash_flag)
clear the flash flag. More...
flash_status_type | flash_operation_status_get (void)
return the flash operation status. More...
flash_status_type | flash_operation_wait_for (uint32_t time_out)
wait for flash operation complete or timeout. More...
void | flash_unlock (void)
unlock the flash controller. More...
void | flash_lock (void)
lock the flash controller. More...
flash_status_type | flash_sector_erase (uint32_t sector_address)
erase a specified flash sector. More...
flash_status_type | flash_internal_all_erase (void)
erase flash all internal sectors. More...
flash_status_type | flash_user_system_data_erase (void)
erase the flash user system data. More...
flash_status_type | flash_word_program (uint32_t address, uint32_t data)
program a word at a specified address. More...
flash_status_type | flash_halfword_program (uint32_t address, uint16_t data)
program a halfword at a specified address. More...
flash_status_type | flash_byte_program (uint32_t address, uint8_t data)
program a byte at a specified address. More...
flash_status_type | flash_user_system_data_program (uint32_t address, uint8_t data)
program a halfword at a specified user system data address. More...
flash_status_type | flash_epp_set (uint32_t *sector_bits)
config erase/program protection for the desired sectors. More...
void | flash_epp_status_get (uint32_t *sector_bits)
return the flash erase/program protection status. More...
flash_status_type | flash_fap_enable (confirm_state new_state)
enable or disable the flash access protection. More...
flag_status | flash_fap_status_get (void)
check the flash access protection status. More...
flash_status_type | flash_fap_high_level_enable (confirm_state new_state)
enable or disable the flash access protection high level. More...
flag_status | flash_fap_high_level_status_get (void)
check the flash access protection high level status. More...
flash_status_type | flash_ssb_set (uint8_t usd_ssb)
program the flash system setting byte in usd: wdt_ato_en / depslp_rst / stdby_rst . More...
uint8_t | flash_ssb_status_get (void)
return the flash system setting byte status. More...
void | flash_interrupt_enable (uint32_t flash_int, confirm_state new_state)
enable or disable the specified flash interrupts. More...
flash_status_type | flash_slib_enable (uint32_t pwd, uint16_t start_sector, uint16_t data_start_sector, uint16_t end_sector)
enable main block security library function. More...
error_status | flash_slib_disable (uint32_t pwd)
disable main block slib when slib enabled. More...
flag_status | flash_slib_state_get (void)
get the main block slib state. More...
uint16_t | flash_slib_start_sector_get (void)
get the main block start sector of slib. More...
uint16_t | flash_slib_datastart_sector_get (void)
get the main block data start sector of slib. More...
uint16_t | flash_slib_end_sector_get (void)
get the main block end sector of slib. More...
uint32_t | flash_crc_calibrate (uint32_t start_addr, uint32_t sector_cnt)
flash crc calibration. More...
void | flash_boot_memory_extension_mode_enable (void)
enable boot memory as extension mode. More...
flash_status_type | flash_extension_memory_slib_enable (uint32_t pwd, uint16_t data_start_sector)
enable extension memory security library function. More...
flag_status | flash_extension_memory_slib_state_get (void)
get the extension memory slib state. More...
uint16_t | flash_em_slib_datastart_sector_get (void)
get the extension memory data start sector of slib. More...

Detailed Description

at32f415 flash header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_flash.h.


AT32F415 Firmwary Library: at32f415_gpio.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_gpio.h File Reference

at32f415 gpio header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | gpio_init_type
gpio init type More...
struct | gpio_type
type define gpio register all More...
struct | iomux_type
type define iomux register all More...

Macros

#define | GPIO_PINS_0 0x0001
#define | GPIO_PINS_1 0x0002
#define | GPIO_PINS_2 0x0004
#define | GPIO_PINS_3 0x0008
#define | GPIO_PINS_4 0x0010
#define | GPIO_PINS_5 0x0020
#define | GPIO_PINS_6 0x0040
#define | GPIO_PINS_7 0x0080
#define | GPIO_PINS_8 0x0100
#define | GPIO_PINS_9 0x0200
#define | GPIO_PINS_10 0x0400
#define | GPIO_PINS_11 0x0800
#define | GPIO_PINS_12 0x1000
#define | GPIO_PINS_13 0x2000
#define | GPIO_PINS_14 0x4000
#define | GPIO_PINS_15 0x8000
#define | GPIO_PINS_ALL 0xFFFF
#define | IOMUX_MAKE_VALUE(reg_offset, bit_addr, bit_num, bit_val) (uint32_t)(((reg_offset) << 24) | ((bit_addr) << 16) | ((bit_num) << 8) | (bit_val))
#define | SPI1_MUX_01 SPI1_GMUX_0001
#define | I2C1_MUX I2C1_GMUX_0001
#define | USART1_MUX USART1_GMUX_0001
#define | USART3_MUX_01 USART3_GMUX_0001
#define | USART3_MUX_10 USART3_GMUX_0010
#define | TMR1_MUX_01 TMR1_GMUX_0001
#define | TMR2_MUX_01 TMR2_GMUX_001
#define | TMR2_MUX_10 TMR2_GMUX_010
#define | TMR2_MUX_11 TMR2_GMUX_011
#define | TMR3_MUX_10 TMR3_GMUX_0010
#define | TMR3_MUX_11 TMR3_GMUX_0011
#define | CAN_MUX_10 CAN1_GMUX_0010
#define | PD01_MUX PD01_GMUX
#define | TMR5CH4_MUX TMR5CH4_GMUX
#define | ADC1_ETP_MUX ADC1_ETP_GMUX
#define | ADC1_ETO_MUX ADC1_ETO_GMUX
#define | SWJTAG_MUX_001 SWJTAG_GMUX_001
#define | SWJTAG_MUX_010 SWJTAG_GMUX_010
#define | SWJTAG_MUX_100 SWJTAG_GMUX_100
#define | CMP_MUX_01 IOMUX_MAKE_VALUE(0x1C, 26, 2, 0x01)
#define | CMP_MUX_10 IOMUX_MAKE_VALUE(0x1C, 26, 2, 0x02)
#define | TMR9_GMUX IOMUX_MAKE_VALUE(0x20, 0, 4, 0x02)
#define | TMR10_GMUX IOMUX_MAKE_VALUE(0x20, 4, 4, 0x02)
#define | TMR11_GMUX IOMUX_MAKE_VALUE(0x20, 8, 4, 0x02)
#define | TMR1_GMUX_0001 IOMUX_MAKE_VALUE(0x24, 0, 4, 0x01)
#define | TMR1_GMUX_0010 IOMUX_MAKE_VALUE(0x24, 0, 4, 0x02)
#define | TMR2_GMUX_001 IOMUX_MAKE_VALUE(0x24, 4, 3, 0x01)
#define | TMR2_GMUX_010 IOMUX_MAKE_VALUE(0x24, 4, 3, 0x02)
#define | TMR2_GMUX_011 IOMUX_MAKE_VALUE(0x24, 4, 3, 0x03)
#define | TMR3_GMUX_0010 IOMUX_MAKE_VALUE(0x24, 8, 4, 0x02)
#define | TMR3_GMUX_0011 IOMUX_MAKE_VALUE(0x24, 8, 4, 0x03)
#define | TMR5_GMUX_001 IOMUX_MAKE_VALUE(0x24, 16, 3, 0x01)
#define | TMR5CH4_GMUX IOMUX_MAKE_VALUE(0x24, 19, 1, 0x01)
#define | I2C1_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 4, 4, 0x01)
#define | I2C1_GMUX_0010 IOMUX_MAKE_VALUE(0x28, 4, 4, 0x02)
#define | I2C2_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 8, 4, 0x01)
#define | I2C2_GMUX_0010 IOMUX_MAKE_VALUE(0x28, 8, 4, 0x02)
#define | I2C2_GMUX_0011 IOMUX_MAKE_VALUE(0x28, 8, 4, 0x03)
#define | SPI1_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 16, 4, 0x01)
#define | SPI2_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 20, 4, 0x01)
#define | CAN1_GMUX_0010 IOMUX_MAKE_VALUE(0x2C, 0, 4, 0x02)
#define | SDIO1_GMUX_0100 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x04)
#define | SDIO1_GMUX_0101 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x05)
#define | SDIO1_GMUX_0110 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x06)
#define | SDIO1_GMUX_0111 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x07)
#define | USART1_GMUX_0001 IOMUX_MAKE_VALUE(0x2C, 16, 4, 0x01)
#define | USART3_GMUX_0001 IOMUX_MAKE_VALUE(0x2C, 24, 4, 0x01)
#define | USART3_GMUX_0010 IOMUX_MAKE_VALUE(0x2C, 24, 4, 0x02)
#define | UART4_GMUX_0001 IOMUX_MAKE_VALUE(0x2C, 28, 4, 0x01)
#define | ADC1_ETP_GMUX IOMUX_MAKE_VALUE(0x30, 4, 1, 0x01)
#define | ADC1_ETO_GMUX IOMUX_MAKE_VALUE(0x30, 5, 1, 0x01)
#define | SWJTAG_GMUX_001 IOMUX_MAKE_VALUE(0x30, 16, 3, 0x01)
#define | SWJTAG_GMUX_010 IOMUX_MAKE_VALUE(0x30, 16, 3, 0x02)
#define | SWJTAG_GMUX_100 IOMUX_MAKE_VALUE(0x30, 16, 3, 0x04)
#define | PD01_GMUX IOMUX_MAKE_VALUE(0x30, 20, 1, 0x01)
#define | TMR1_BK1_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 0, 2, 0x02)
#define | TMR1_BK1_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 0, 2, 0x03)
#define | TMR1_CH1_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 2, 2, 0x02)
#define | TMR1_CH1_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 2, 2, 0x03)
#define | TMR2_CH4_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 4, 2, 0x02)
#define | TMR2_CH4_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 4, 2, 0x03)
#define | TMR3_CH1_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 6, 2, 0x02)
#define | TMR3_CH1_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 6, 2, 0x03)
#define | GPIOA ((gpio_type *) GPIOA_BASE)
#define | GPIOB ((gpio_type *) GPIOB_BASE)
#define | GPIOC ((gpio_type *) GPIOC_BASE)
#define | GPIOD ((gpio_type *) GPIOD_BASE)
#define | GPIOF ((gpio_type *) GPIOF_BASE)
#define | IOMUX ((iomux_type *) IOMUX_BASE)

Enumerations

enum | gpio_mode_type { GPIO_MODE_INPUT = 0x00 , GPIO_MODE_OUTPUT = 0x10 , GPIO_MODE_MUX = 0x08 , GPIO_MODE_ANALOG = 0x03 }
gpio mode select More...
enum | gpio_drive_type { GPIO_DRIVE_STRENGTH_STRONGER = 0x01 , GPIO_DRIVE_STRENGTH_MODERATE = 0x02 , GPIO_DRIVE_STRENGTH_MAXIMUM = 0x03 }
gpio output drive strength select More...
enum | gpio_output_type { GPIO_OUTPUT_PUSH_PULL = 0x00 , GPIO_OUTPUT_OPEN_DRAIN = 0x04 }
gpio output type More...
enum | gpio_pull_type { GPIO_PULL_NONE = 0x0004 , GPIO_PULL_UP = 0x0018 , GPIO_PULL_DOWN = 0x0028 }
gpio pull type More...
enum gpio_pins_source_type {
GPIO_PINS_SOURCE0 = 0x00 , GPIO_PINS_SOURCE1 = 0x01 , GPIO_PINS_SOURCE2 = 0x02 , GPIO_PINS_SOURCE3 = 0x03 ,
GPIO_PINS_SOURCE4 = 0x04 , GPIO_PINS_SOURCE5 = 0x05 , GPIO_PINS_SOURCE6 = 0x06 , GPIO_PINS_SOURCE7 = 0x07 ,
GPIO_PINS_SOURCE8 = 0x08 , GPIO_PINS_SOURCE9 = 0x09 , GPIO_PINS_SOURCE10 = 0x0A , GPIO_PINS_SOURCE11 = 0x0B ,
GPIO_PINS_SOURCE12 = 0x0C , GPIO_PINS_SOURCE13 = 0x0D , GPIO_PINS_SOURCE14 = 0x0E , GPIO_PINS_SOURCE15 = 0x0F
}
gpio pins source type More...
enum gpio_port_source_type {
GPIO_PORT_SOURCE_GPIOA = 0x00 , GPIO_PORT_SOURCE_GPIOB = 0x01 , GPIO_PORT_SOURCE_GPIOC = 0x02 , GPIO_PORT_SOURCE_GPIOD = 0x03 ,
GPIO_PORT_SOURCE_GPIOF = 0x05
}
gpio port source type More...

Functions

void | gpio_reset (gpio_type *gpio_x)
reset the gpio register More...
void | gpio_iomux_reset (void)
reset the mux functions (remap, event control and exint configuration) registers to their default values. More...
void | gpio_init (gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral. More...
void | gpio_default_para_init (gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value. More...
flag_status | gpio_input_data_bit_read (gpio_type *gpio_x, uint16_t pins)
read the specified input port pin. More...
uint16_t | gpio_input_data_read (gpio_type *gpio_x)
read the specified gpio input data port. More...
flag_status | gpio_output_data_bit_read (gpio_type *gpio_x, uint16_t pins)
read the specified output port pin. More...
uint16_t | gpio_output_data_read (gpio_type *gpio_x)
read the specified gpio ouput data port. More...
void | gpio_bits_set (gpio_type *gpio_x, uint16_t pins)
set the selected data port bits. More...
void | gpio_bits_reset (gpio_type *gpio_x, uint16_t pins)
clear the selected data port bits. More...
void | gpio_bits_write (gpio_type *gpio_x, uint16_t pins, confirm_state bit_state)
set or clear the selected data port bit. More...
void | gpio_port_wirte (gpio_type *gpio_x, uint16_t port_value)
write data to the specified gpio data port. More...
void | gpio_pin_wp_config (gpio_type *gpio_x, uint16_t pins)
write protect gpio pins configuration registers. More...
void | gpio_event_output_config (gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as event output. More...
void | gpio_event_output_enable (confirm_state new_state)
enable or disable the event output. More...
void | gpio_pin_remap_config (uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration. More...
void | gpio_exint_line_config (gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line. More...

Detailed Description

at32f415 gpio header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_gpio.h.


AT32F415 Firmwary Library: at32f415_i2c.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_i2c.h File Reference

at32f415 i2c header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct i2c_type
type define i2c register all More...

Macros

#define | I2C_STARTF_FLAG ((uint32_t)0x00000001)
#define | I2C_ADDR7F_FLAG ((uint32_t)0x00000002)
#define | I2C_TDC_FLAG ((uint32_t)0x00000004)
#define | I2C_ADDRHF_FLAG ((uint32_t)0x00000008)
#define | I2C_STOPF_FLAG ((uint32_t)0x00000010)
#define | I2C_RDBF_FLAG ((uint32_t)0x00000040)
#define | I2C_TDBE_FLAG ((uint32_t)0x00000080)
#define | I2C_BUSERR_FLAG ((uint32_t)0x00000100)
#define | I2C_ARLOST_FLAG ((uint32_t)0x00000200)
#define | I2C_ACKFAIL_FLAG ((uint32_t)0x00000400)
#define | I2C_OUF_FLAG ((uint32_t)0x00000800)
#define | I2C_PECERR_FLAG ((uint32_t)0x00001000)
#define | I2C_TMOUT_FLAG ((uint32_t)0x00004000)
#define | I2C_ALERTF_FLAG ((uint32_t)0x00008000)
#define | I2C_TRMODE_FLAG ((uint32_t)0x10010000)
#define | I2C_BUSYF_FLAG ((uint32_t)0x10020000)
#define | I2C_DIRF_FLAG ((uint32_t)0x10040000)
#define | I2C_GCADDRF_FLAG ((uint32_t)0x10100000)
#define | I2C_DEVADDRF_FLAG ((uint32_t)0x10200000)
#define | I2C_HOSTADDRF_FLAG ((uint32_t)0x10400000)
#define | I2C_ADDR2_FLAG ((uint32_t)0x10800000)
#define | I2C_DATA_INT ((uint16_t)0x0400)
#define | I2C_EVT_INT ((uint16_t)0x0200)
#define | I2C_ERR_INT ((uint16_t)0x0100)
#define | I2C1 ((i2c_type *) I2C1_BASE)
#define | I2C2 ((i2c_type *) I2C2_BASE)

Enumerations

enum | i2c_master_ack_type { I2C_MASTER_ACK_CURRENT = 0x00 , I2C_MASTER_ACK_NEXT = 0x01 }
i2c master receiving mode acknowledge control More...
enum | i2c_pec_position_type { I2C_PEC_POSITION_CURRENT = 0x00 , I2C_PEC_POSITION_NEXT = 0x01 }
i2c pec position set More...
enum | i2c_smbus_alert_set_type { I2C_SMBUS_ALERT_HIGH = 0x00 , I2C_SMBUS_ALERT_LOW = 0x01 }
i2c smbus alert pin set More...
enum | i2c_smbus_mode_set_type { I2C_SMBUS_MODE_DEVICE = 0x00 , I2C_SMBUS_MODE_HOST = 0x01 }
i2c smbus mode set More...
enum | i2c_fsmode_duty_cycle_type { I2C_FSMODE_DUTY_2_1 = 0x00 , I2C_FSMODE_DUTY_16_9 = 0x01 }
i2c fast mode duty cycle More...
enum | i2c_address_mode_type { I2C_ADDRESS_MODE_7BIT = 0x00 , I2C_ADDRESS_MODE_10BIT = 0x01 }
i2c address mode More...
enum | i2c_direction_type { I2C_DIRECTION_TRANSMIT = 0x00 , I2C_DIRECTION_RECEIVE = 0x01 }
i2c address direction More...

Functions

void | i2c_reset (i2c_type *i2c_x)
reset the i2c register More...
void | i2c_software_reset (i2c_type *i2c_x, confirm_state new_state)
software reset. More...
void | i2c_init (i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed)
init i2c speed and duty cycle. More...
void | i2c_own_address1_set (i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address)
config own address1. More...
void | i2c_own_address2_set (i2c_type *i2c_x, uint8_t address)
config own address2. More...
void | i2c_own_address2_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable own address2. More...
void | i2c_smbus_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable the smbus mode More...
void | i2c_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable i2c periph More...
void | i2c_fast_mode_duty_set (i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty)
config fast mode duty cycle More...
void | i2c_clock_stretch_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable clock stretch. More...
void | i2c_ack_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable acknowledge. More...
void | i2c_master_receive_ack_set (i2c_type *i2c_x, i2c_master_ack_type pos)
master receiving mode acknowledge control. More...
void | i2c_pec_position_set (i2c_type *i2c_x, i2c_pec_position_type pos)
pec position set. More...
void | i2c_general_call_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable general call. More...
void | i2c_arp_mode_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable arp mode. More...
void | i2c_smbus_mode_set (i2c_type *i2c_x, i2c_smbus_mode_set_type mode)
config smbus host or device. More...
void | i2c_smbus_alert_set (i2c_type *i2c_x, i2c_smbus_alert_set_type level)
drive the smbus alert pin high or low. More...
void | i2c_pec_transmit_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable pec transfer. More...
void | i2c_pec_calculate_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable pec calcultetion. More...
uint8_t | i2c_pec_value_get (i2c_type *i2c_x)
get pec value. More...
void | i2c_dma_end_transfer_set (i2c_type *i2c_x, confirm_state new_state)
enable or disable if the next dma transfer will be the last one. More...
void | i2c_dma_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable dma requests. More...
void | i2c_interrupt_enable (i2c_type *i2c_x, uint16_t source, confirm_state new_state)
enable or disable interrupt More...
void | i2c_start_generate (i2c_type *i2c_x)
generate start condition. More...
void | i2c_stop_generate (i2c_type *i2c_x)
generate stop condition. More...
void | i2c_7bit_address_send (i2c_type *i2c_x, uint8_t address, i2c_direction_type direction)
transmit the slave address. More...
void | i2c_data_send (i2c_type *i2c_x, uint8_t data)
send a byte through the i2c periph. More...
uint8_t | i2c_data_receive (i2c_type *i2c_x)
receive a byte through the i2c periph. More...
flag_status | i2c_flag_get (i2c_type *i2c_x, uint32_t flag)
get flag status More...
void | i2c_flag_clear (i2c_type *i2c_x, uint32_t flag)
clear flag status More...

Detailed Description

at32f415 i2c header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_i2c.h.


AT32F415 Firmwary Library: at32f415_misc.h File Reference

  • libraries
  • drivers
  • inc
Macros | Enumerations | Functions
at32f415_misc.h File Reference

at32f415 misc header file More...

#include "at32f415.h"

Go to the source code of this file.

Macros

#define | NVIC_VECTTAB_RAM ((uint32_t)0x20000000)
#define | NVIC_VECTTAB_FLASH ((uint32_t)0x08000000)

Enumerations

enum nvic_priority_group_type {
NVIC_PRIORITY_GROUP_0 = ((uint32_t)0x7) , NVIC_PRIORITY_GROUP_1 = ((uint32_t)0x6) , NVIC_PRIORITY_GROUP_2 = ((uint32_t)0x5) , NVIC_PRIORITY_GROUP_3 = ((uint32_t)0x4) ,
NVIC_PRIORITY_GROUP_4 = ((uint32_t)0x3)
}
nvic interrupt priority group More...
enum | nvic_lowpower_mode_type { NVIC_LP_SLEEPONEXIT = 0x02 , NVIC_LP_SLEEPDEEP = 0x04 , NVIC_LP_SEVONPEND = 0x10 }
nvic low power mode More...
enum | systick_clock_source_type { SYSTICK_CLOCK_SOURCE_AHBCLK_DIV8 = ((uint32_t)0x00000000) , SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV = ((uint32_t)0x00000004) }
systick clock source More...

Functions

void | nvic_system_reset (void)
system reset More...
void | nvic_irq_enable (uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq More...
void | nvic_irq_disable (uint32_t irqn)
disable nvic irq number More...
void | nvic_priority_group_config (nvic_priority_group_type priority_group)
config nvic priority group More...
void | nvic_vector_table_set (uint32_t base, uint32_t offset)
set the vector table location and offset. More...
void | nvic_lowpower_mode_config (nvic_lowpower_mode_type lp_mode, confirm_state new_state)
config nvic lowpower mode More...
void | systick_clock_source_config (systick_clock_source_type source)
config systick clock source More...

Detailed Description

at32f415 misc header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_misc.h.


AT32F415 Firmwary Library: at32f415_pwc.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_pwc.h File Reference

at32f415 pwc header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct pwc_type
type define pwc register all More...

Macros

#define | PWC_WAKEUP_FLAG ((uint32_t)0x00000001)
#define | PWC_STANDBY_FLAG ((uint32_t)0x00000002)
#define | PWC_PVM_OUTPUT_FLAG ((uint32_t)0x00000004)
#define | PWC_WAKEUP_PIN_1 ((uint32_t)0x00000100)
pwc wakeup pin num definition More...
#define | PWC ((pwc_type *) PWC_BASE)

Enumerations

enum pwc_pvm_voltage_type {
PWC_PVM_VOLTAGE_2V3 = 0x01 , PWC_PVM_VOLTAGE_2V4 = 0x02 , PWC_PVM_VOLTAGE_2V5 = 0x03 , PWC_PVM_VOLTAGE_2V6 = 0x04 ,
PWC_PVM_VOLTAGE_2V7 = 0x05 , PWC_PVM_VOLTAGE_2V8 = 0x06 , PWC_PVM_VOLTAGE_2V9 = 0x07
}
pwc pvm voltage type More...
enum | pwc_sleep_enter_type { PWC_SLEEP_ENTER_WFI = 0x00 , PWC_SLEEP_ENTER_WFE = 0x01 }
pwc sleep enter type More...
enum | pwc_deep_sleep_enter_type { PWC_DEEP_SLEEP_ENTER_WFI = 0x00 , PWC_DEEP_SLEEP_ENTER_WFE = 0x01 }
pwc deep sleep enter type More...
enum | pwc_regulator_type { PWC_REGULATOR_ON = 0x00 , PWC_REGULATOR_LOW_POWER = 0x01 }
pwc regulator type More...

Functions

void | pwc_reset (void)
deinitialize the pwc peripheral registers to their default reset values. More...
void | pwc_battery_powered_domain_access (confirm_state new_state)
enable or disable access to the battery powered domain. More...
void | pwc_pvm_level_select (pwc_pvm_voltage_type pvm_voltage)
select the voltage threshold detected by the power voltage detector. More...
void | pwc_power_voltage_monitor_enable (confirm_state new_state)
enable or disable pwc power voltage monitor (pvm)
More...
void | pwc_wakeup_pin_enable (uint32_t pin_num, confirm_state new_state)
enable or disable pwc standby wakeup pin
More...
void | pwc_flag_clear (uint32_t pwc_flag)
clear flag of pwc More...
flag_status | pwc_flag_get (uint32_t pwc_flag)
get flag of pwc More...
void | pwc_sleep_mode_enter (pwc_sleep_enter_type pwc_sleep_enter)
enter pwc sleep mode
More...
void | pwc_deep_sleep_mode_enter (pwc_deep_sleep_enter_type pwc_deep_sleep_enter)
enter pwc deep-sleep mode
More...
void | pwc_voltage_regulate_set (pwc_regulator_type pwc_regulator)
regulate low power consumption in the deep sleep mode More...
void | pwc_standby_mode_enter (void)
enter pwc standby mode
More...

Detailed Description

at32f415 pwc header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_pwc.h.


AT32F415 Firmwary Library: at32f415_sdio.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_sdio.h File Reference

at32f415 sdio header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | sdio_command_struct_type
sdio command structure More...
struct | sdio_data_struct_type
sdio data structure More...
struct | sdio_type
type define sdio register all More...

Macros

#define | SDIO_CMDFAIL_INT ((uint32_t)0x00000001)
#define | SDIO_DTFAIL_INT ((uint32_t)0x00000002)
#define | SDIO_CMDTIMEOUT_INT ((uint32_t)0x00000004)
#define | SDIO_DTTIMEOUT_INT ((uint32_t)0x00000008)
#define | SDIO_TXERRU_INT ((uint32_t)0x00000010)
#define | SDIO_RXERRO_INT ((uint32_t)0x00000020)
#define | SDIO_CMDRSPCMPL_INT ((uint32_t)0x00000040)
#define | SDIO_CMDCMPL_INT ((uint32_t)0x00000080)
#define | SDIO_DTCMP_INT ((uint32_t)0x00000100)
#define | SDIO_SBITERR_INT ((uint32_t)0x00000200)
#define | SDIO_DTBLKCMPL_INT ((uint32_t)0x00000400)
#define | SDIO_DOCMD_INT ((uint32_t)0x00000800)
#define | SDIO_DOTX_INT ((uint32_t)0x00001000)
#define | SDIO_DORX_INT ((uint32_t)0x00002000)
#define | SDIO_TXBUFH_INT ((uint32_t)0x00004000)
#define | SDIO_RXBUFH_INT ((uint32_t)0x00008000)
#define | SDIO_TXBUFF_INT ((uint32_t)0x00010000)
#define | SDIO_RXBUFF_INT ((uint32_t)0x00020000)
#define | SDIO_TXBUFE_INT ((uint32_t)0x00040000)
#define | SDIO_RXBUFE_INT ((uint32_t)0x00080000)
#define | SDIO_TXBUF_INT ((uint32_t)0x00100000)
#define | SDIO_RXBUF_INT ((uint32_t)0x00200000)
#define | SDIO_SDIOIF_INT ((uint32_t)0x00400000)
#define | SDIO_CMDFAIL_FLAG ((uint32_t)0x00000001)
#define | SDIO_DTFAIL_FLAG ((uint32_t)0x00000002)
#define | SDIO_CMDTIMEOUT_FLAG ((uint32_t)0x00000004)
#define | SDIO_DTTIMEOUT_FLAG ((uint32_t)0x00000008)
#define | SDIO_TXERRU_FLAG ((uint32_t)0x00000010)
#define | SDIO_RXERRO_FLAG ((uint32_t)0x00000020)
#define | SDIO_CMDRSPCMPL_FLAG ((uint32_t)0x00000040)
#define | SDIO_CMDCMPL_FLAG ((uint32_t)0x00000080)
#define | SDIO_DTCMPL_FLAG ((uint32_t)0x00000100)
#define | SDIO_SBITERR_FLAG ((uint32_t)0x00000200)
#define | SDIO_DTBLKCMPL_FLAG ((uint32_t)0x00000400)
#define | SDIO_DOCMD_FLAG ((uint32_t)0x00000800)
#define | SDIO_DOTX_FLAG ((uint32_t)0x00001000)
#define | SDIO_DORX_FLAG ((uint32_t)0x00002000)
#define | SDIO_TXBUFH_FLAG ((uint32_t)0x00004000)
#define | SDIO_RXBUFH_FLAG ((uint32_t)0x00008000)
#define | SDIO_TXBUFF_FLAG ((uint32_t)0x00010000)
#define | SDIO_RXBUFF_FLAG ((uint32_t)0x00020000)
#define | SDIO_TXBUFE_FLAG ((uint32_t)0x00040000)
#define | SDIO_RXBUFE_FLAG ((uint32_t)0x00080000)
#define | SDIO_TXBUF_FLAG ((uint32_t)0x00100000)
#define | SDIO_RXBUF_FLAG ((uint32_t)0x00200000)
#define | SDIO_SDIOIF_FLAG ((uint32_t)0x00400000)
#define | SDIO1 ((sdio_type *) SDIO1_BASE)

Enumerations

enum | sdio_power_state_type { SDIO_POWER_OFF = 0x00 , SDIO_POWER_ON = 0x03 }
sdio power state More...
enum | sdio_edge_phase_type { SDIO_CLOCK_EDGE_RISING = 0x00 , SDIO_CLOCK_EDGE_FALLING = 0x01 }
sdio edge phase More...
enum | sdio_bus_width_type { SDIO_BUS_WIDTH_D1 = 0x00 , SDIO_BUS_WIDTH_D4 = 0x01 , SDIO_BUS_WIDTH_D8 = 0x02 }
sdio bus width More...
enum | sdio_reponse_type { SDIO_RESPONSE_NO = 0x00 , SDIO_RESPONSE_SHORT = 0x01 , SDIO_RESPONSE_LONG = 0x03 }
sdio response type More...
enum | sdio_wait_type { SDIO_WAIT_FOR_NO = 0x00 , SDIO_WAIT_FOR_INT = 0x01 , SDIO_WAIT_FOR_PEND = 0x02 }
sdio wait type More...
enum | sdio_rsp_index_type { SDIO_RSP1_INDEX = 0x00 , SDIO_RSP2_INDEX = 0x01 , SDIO_RSP3_INDEX = 0x02 , SDIO_RSP4_INDEX = 0x03 }
sdio response register index More...
enum sdio_block_size_type {
SDIO_DATA_BLOCK_SIZE_1B = 0x00 , SDIO_DATA_BLOCK_SIZE_2B = 0x01 , SDIO_DATA_BLOCK_SIZE_4B = 0x02 , SDIO_DATA_BLOCK_SIZE_8B = 0x03 ,
SDIO_DATA_BLOCK_SIZE_16B = 0x04 , SDIO_DATA_BLOCK_SIZE_32B = 0x05 , SDIO_DATA_BLOCK_SIZE_64B = 0x06 , SDIO_DATA_BLOCK_SIZE_128B = 0x07 ,
SDIO_DATA_BLOCK_SIZE_256B = 0x08 , SDIO_DATA_BLOCK_SIZE_512B = 0x09 , SDIO_DATA_BLOCK_SIZE_1024B = 0x0A , SDIO_DATA_BLOCK_SIZE_2048B = 0x0B ,
SDIO_DATA_BLOCK_SIZE_4096B = 0x0C , SDIO_DATA_BLOCK_SIZE_8192B = 0x0D , SDIO_DATA_BLOCK_SIZE_16384B = 0x0E
}
sdio data block size More...
enum | sdio_transfer_mode_type { SDIO_DATA_BLOCK_TRANSFER = 0x00 , SDIO_DATA_STREAM_TRANSFER = 0x01 }
sdio data transfer mode More...
enum | sdio_transfer_direction_type { SDIO_DATA_TRANSFER_TO_CARD = 0x00 , SDIO_DATA_TRANSFER_TO_CONTROLLER = 0x01 }
sdio data transfer direction More...
enum | sdio_read_wait_mode_type { SDIO_READ_WAIT_CONTROLLED_BY_D2 = 0x00 , SDIO_READ_WAIT_CONTROLLED_BY_CK = 0x01 }
sdio read wait mode More...

Functions

void | sdio_reset (sdio_type *sdio_x)
reset the sdio register More...
void | sdio_power_set (sdio_type *sdio_x, sdio_power_state_type power_state)
set the power status of the controller More...
flag_status | sdio_power_status_get (sdio_type *sdio_x)
get power status. More...
void | sdio_clock_config (sdio_type *sdio_x, uint16_t clk_div, sdio_edge_phase_type clk_edg)
config sdio clock More...
void | sdio_bus_width_config (sdio_type *sdio_x, sdio_bus_width_type width)
config sdio bus width More...
void | sdio_clock_bypass (sdio_type *sdio_x, confirm_state new_state)
enable or disable clock divider bypss More...
void | sdio_power_saving_mode_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable power saving mode, config sdio_ck clock output when the bus is idle. More...
void | sdio_flow_control_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable hardware flow control. More...
void | sdio_clock_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable sdio_ck output. More...
void | sdio_dma_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable dma. More...
void | sdio_interrupt_enable (sdio_type *sdio_x, uint32_t int_opt, confirm_state new_state)
config corresponding interrupt. More...
flag_status | sdio_flag_get (sdio_type *sdio_x, uint32_t flag)
get sdio flag. More...
void | sdio_flag_clear (sdio_type *sdio_x, uint32_t flag)
clear sdio flag. More...
void | sdio_command_config (sdio_type *sdio_x, sdio_command_struct_type *command_struct)
config sdio command. More...
void | sdio_command_state_machine_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable command path state machine(CPSM). More...
uint8_t | sdio_command_response_get (sdio_type *sdio_x)
get command index of last command for which response received. More...
uint32_t | sdio_response_get (sdio_type *sdio_x, sdio_rsp_index_type reg_index)
get response received from the card for the last command. More...
void | sdio_data_config (sdio_type *sdio_x, sdio_data_struct_type *data_struct)
config sdio data. More...
void | sdio_data_state_machine_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable data path state machine(DPSM). More...
uint32_t | sdio_data_counter_get (sdio_type *sdio_x)
get the number of remaining data bytes to be transferred. More...
uint32_t | sdio_data_read (sdio_type *sdio_x)
read a word data from sdio fifo. More...
uint32_t | sdio_buffer_counter_get (sdio_type *sdio_x)
get the number of words left to be written to or read from fifo.. More...
void | sdio_data_write (sdio_type *sdio_x, uint32_t data)
write one word data to fifo. More...
void | sdio_read_wait_mode_set (sdio_type *sdio_x, sdio_read_wait_mode_type mode)
set the read wait mode. More...
void | sdio_read_wait_start (sdio_type *sdio_x, confirm_state new_state)
enable or disable to start sd i/o read wait operation. More...
void | sdio_read_wait_stop (sdio_type *sdio_x, confirm_state new_state)
enable or disable to stop sd i/o read wait operation. More...
void | sdio_io_function_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable the sd i/o function. More...
void | sdio_io_suspend_command_set (sdio_type *sdio_x, confirm_state new_state)
enable or disable sd i/o suspend command sending. More...

Detailed Description

at32f415 sdio header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_sdio.h.


AT32F415 Firmwary Library: at32f415_spi.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_spi.h File Reference

at32f415 spi header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | spi_init_type
spi init type More...
struct | i2s_init_type
i2s init type More...
struct | spi_type
type define spi register all More...

Macros

#define | SPI_I2S_RDBF_FLAG 0x0001
#define | SPI_I2S_TDBE_FLAG 0x0002
#define | I2S_ACS_FLAG 0x0004
#define | I2S_TUERR_FLAG 0x0008
#define | SPI_CCERR_FLAG 0x0010
#define | SPI_MMERR_FLAG 0x0020
#define | SPI_I2S_ROERR_FLAG 0x0040
#define | SPI_I2S_BF_FLAG 0x0080
#define | SPI_I2S_ERROR_INT 0x0020
#define | SPI_I2S_RDBF_INT 0x0040
#define | SPI_I2S_TDBE_INT 0x0080
#define | SPI1 ((spi_type *) SPI1_BASE)
#define | SPI2 ((spi_type *) SPI2_BASE)

Enumerations

enum | spi_frame_bit_num_type { SPI_FRAME_8BIT = 0x00 , SPI_FRAME_16BIT = 0x01 }
spi frame bit num type More...
enum | spi_master_slave_mode_type { SPI_MODE_SLAVE = 0x00 , SPI_MODE_MASTER = 0x01 }
spi master/slave mode type More...
enum | spi_clock_polarity_type { SPI_CLOCK_POLARITY_LOW = 0x00 , SPI_CLOCK_POLARITY_HIGH = 0x01 }
spi clock polarity (clkpol) type More...
enum | spi_clock_phase_type { SPI_CLOCK_PHASE_1EDGE = 0x00 , SPI_CLOCK_PHASE_2EDGE = 0x01 }
spi clock phase (clkpha) type More...
enum | spi_cs_mode_type { SPI_CS_HARDWARE_MODE = 0x00 , SPI_CS_SOFTWARE_MODE = 0x01 }
spi cs mode type More...
enum spi_mclk_freq_div_type {
SPI_MCLK_DIV_2 = 0x00 , SPI_MCLK_DIV_4 = 0x01 , SPI_MCLK_DIV_8 = 0x02 , SPI_MCLK_DIV_16 = 0x03 ,
SPI_MCLK_DIV_32 = 0x04 , SPI_MCLK_DIV_64 = 0x05 , SPI_MCLK_DIV_128 = 0x06 , SPI_MCLK_DIV_256 = 0x07 ,
SPI_MCLK_DIV_512 = 0x08 , SPI_MCLK_DIV_1024 = 0x09
}
spi master clock frequency division type More...
enum | spi_first_bit_type { SPI_FIRST_BIT_MSB = 0x00 , SPI_FIRST_BIT_LSB = 0x01 }
spi transmit first bit (lsb/msb) type More...
enum | spi_transmission_mode_type { SPI_TRANSMIT_FULL_DUPLEX = 0x00 , SPI_TRANSMIT_SIMPLEX_RX = 0x01 , SPI_TRANSMIT_HALF_DUPLEX_RX = 0x02 , SPI_TRANSMIT_HALF_DUPLEX_TX = 0x03 }
spi transmission mode type More...
enum | spi_crc_direction_type { SPI_CRC_RX = 0x0014 , SPI_CRC_TX = 0x0018 }
spi crc direction type More...
enum | spi_half_duplex_direction_type { SPI_HALF_DUPLEX_DIRECTION_RX = 0x00 , SPI_HALF_DUPLEX_DIRECTION_TX = 0x01 }
spi single line bidirectional direction type More...
enum | spi_software_cs_level_type { SPI_SWCS_INTERNAL_LEVEL_LOW = 0x00 , SPI_SWCS_INTERNAL_LEVEL_HIGHT = 0x01 }
spi software cs internal level type More...
enum i2s_audio_protocol_type {
I2S_AUDIO_PROTOCOL_PHILLIPS = 0x00 , I2S_AUDIO_PROTOCOL_MSB = 0x01 , I2S_AUDIO_PROTOCOL_LSB = 0x02 , I2S_AUDIO_PROTOCOL_PCM_SHORT = 0x03 ,
I2S_AUDIO_PROTOCOL_PCM_LONG = 0x04
}
i2s audio protocol type More...
enum i2s_audio_sampling_freq_type {
I2S_AUDIO_FREQUENCY_DEFAULT = 2 , I2S_AUDIO_FREQUENCY_8K = 8000 , I2S_AUDIO_FREQUENCY_11_025K = 11025 , I2S_AUDIO_FREQUENCY_16K = 16000 ,
I2S_AUDIO_FREQUENCY_22_05K = 22050 , I2S_AUDIO_FREQUENCY_32K = 32000 , I2S_AUDIO_FREQUENCY_44_1K = 44100 , I2S_AUDIO_FREQUENCY_48K = 48000 ,
I2S_AUDIO_FREQUENCY_96K = 96000 , I2S_AUDIO_FREQUENCY_192K = 192000
}
i2s audio frequency type More...
enum | i2s_data_channel_format_type { I2S_DATA_16BIT_CHANNEL_16BIT = 0x01 , I2S_DATA_16BIT_CHANNEL_32BIT = 0x02 , I2S_DATA_24BIT_CHANNEL_32BIT = 0x03 , I2S_DATA_32BIT_CHANNEL_32BIT = 0x04 }
i2s data bit num and channel bit num type More...
enum | i2s_operation_mode_type { I2S_MODE_SLAVE_TX = 0x00 , I2S_MODE_SLAVE_RX = 0x01 , I2S_MODE_MASTER_TX = 0x02 , I2S_MODE_MASTER_RX = 0x03 }
i2s operation mode type More...
enum | i2s_clock_polarity_type { I2S_CLOCK_POLARITY_LOW = 0x00 , I2S_CLOCK_POLARITY_HIGH = 0x01 }
i2s clock polarity type More...

Functions

void | spi_i2s_reset (spi_type *spi_x)
spi reset by crm reset register More...
void | spi_default_para_init (spi_init_type *spi_init_struct)
spi init config with its default value. More...
void | spi_init (spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value. More...
void | spi_crc_next_transmit (spi_type *spi_x)
spi next transmit crc for the spi peripheral. More...
void | spi_crc_polynomial_set (spi_type *spi_x, uint16_t crc_poly)
set the crc polynomial value for the spi peripheral. More...
uint16_t | spi_crc_polynomial_get (spi_type *spi_x)
return the crc polynomial register value for the spi peripheral. More...
void | spi_crc_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the hardware crc calculation for the spi peripheral. More...
uint16_t | spi_crc_value_get (spi_type *spi_x, spi_crc_direction_type crc_direction)
return the transmit or the receive crc value for the spi peripheral. More...
void | spi_hardware_cs_output_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the hardware cs output for the spi peripheral. More...
void | spi_software_cs_internal_level_set (spi_type *spi_x, spi_software_cs_level_type level)
set the software cs internal level for the spi peripheral. More...
void | spi_frame_bit_num_set (spi_type *spi_x, spi_frame_bit_num_type bit_num)
set the data frame bit num for the spi peripheral. More...
void | spi_half_duplex_direction_set (spi_type *spi_x, spi_half_duplex_direction_type direction)
set the data transmission direction in single line bidirectiona half duplex mode of the spi peripheral. More...
void | spi_enable (spi_type *spi_x, confirm_state new_state)
enable or disable spi. More...
void | i2s_default_para_init (i2s_init_type *i2s_init_struct)
i2s init config with its default value. More...
void | i2s_init (spi_type *spi_x, i2s_init_type *i2s_init_struct)
i2s init config with its setting value. More...
void | i2s_enable (spi_type *spi_x, confirm_state new_state)
enable or disable i2s. More...
void | spi_i2s_interrupt_enable (spi_type *spi_x, uint32_t spi_i2s_int, confirm_state new_state)
enable or disable the specified spi/i2s interrupts. More...
void | spi_i2s_dma_transmitter_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma transmitter mode. More...
void | spi_i2s_dma_receiver_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma receiver mode. More...
void | spi_i2s_data_transmit (spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit More...
uint16_t | spi_i2s_data_receive (spi_type *spi_x)
spi/i2s data receive More...
flag_status | spi_i2s_flag_get (spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral. More...
void | spi_i2s_flag_clear (spi_type *spi_x, uint32_t spi_i2s_flag)
clear flag of the specified spi/i2s peripheral. More...

Detailed Description

at32f415 spi header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_spi.h.


AT32F415 Firmwary Library: at32f415_tmr.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_tmr.h File Reference

at32f415 tmr header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | tmr_output_config_type
tmr output config type More...
struct | tmr_input_config_type
tmr input capture config type More...
struct | tmr_brkdt_config_type
tmr brkdt config type More...
struct | tmr_type
type define tmr register all More...

Macros

#define | TMR_OVF_FLAG ((uint32_t)0x000001)
#define | TMR_C1_FLAG ((uint32_t)0x000002)
#define | TMR_C2_FLAG ((uint32_t)0x000004)
#define | TMR_C3_FLAG ((uint32_t)0x000008)
#define | TMR_C4_FLAG ((uint32_t)0x000010)
#define | TMR_HALL_FLAG ((uint32_t)0x000020)
#define | TMR_TRIGGER_FLAG ((uint32_t)0x000040)
#define | TMR_BRK_FLAG ((uint32_t)0x000080)
#define | TMR_C1_RECAPTURE_FLAG ((uint32_t)0x000200)
#define | TMR_C2_RECAPTURE_FLAG ((uint32_t)0x000400)
#define | TMR_C3_RECAPTURE_FLAG ((uint32_t)0x000800)
#define | TMR_C4_RECAPTURE_FLAG ((uint32_t)0x001000)
#define | TMR_OVF_INT ((uint32_t)0x000001)
#define | TMR_C1_INT ((uint32_t)0x000002)
#define | TMR_C2_INT ((uint32_t)0x000004)
#define | TMR_C3_INT ((uint32_t)0x000008)
#define | TMR_C4_INT ((uint32_t)0x000010)
#define | TMR_HALL_INT ((uint32_t)0x000020)
#define | TMR_TRIGGER_INT ((uint32_t)0x000040)
#define | TMR_BRK_INT ((uint32_t)0x000080)
#define | TMR1 ((tmr_type *) TMR1_BASE)
#define | TMR2 ((tmr_type *) TMR2_BASE)
#define | TMR3 ((tmr_type *) TMR3_BASE)
#define | TMR4 ((tmr_type *) TMR4_BASE)
#define | TMR5 ((tmr_type *) TMR5_BASE)
#define | TMR6 ((tmr_type *) TMR6_BASE)
#define | TMR7 ((tmr_type *) TMR7_BASE)
#define | TMR8 ((tmr_type *) TMR8_BASE)
#define | TMR9 ((tmr_type *) TMR9_BASE)
#define | TMR10 ((tmr_type *) TMR10_BASE)
#define | TMR11 ((tmr_type *) TMR11_BASE)
#define | TMR12 ((tmr_type *) TMR12_BASE)
#define | TMR13 ((tmr_type *) TMR13_BASE)
#define | TMR14 ((tmr_type *) TMR14_BASE)

Enumerations

enum | tmr_clock_division_type { TMR_CLOCK_DIV1 = 0x00 , TMR_CLOCK_DIV2 = 0x01 , TMR_CLOCK_DIV4 = 0x02 }
tmr clock division type More...
enum tmr_count_mode_type {
TMR_COUNT_UP = 0x00 , TMR_COUNT_DOWN = 0x01 , TMR_COUNT_TWO_WAY_1 = 0x02 , TMR_COUNT_TWO_WAY_2 = 0x04 ,
TMR_COUNT_TWO_WAY_3 = 0x06
}
tmr counter mode type More...
enum tmr_primary_select_type {
TMR_PRIMARY_SEL_RESET = 0x00 , TMR_PRIMARY_SEL_ENABLE = 0x01 , TMR_PRIMARY_SEL_OVERFLOW = 0x02 , TMR_PRIMARY_SEL_COMPARE = 0x03 ,
TMR_PRIMARY_SEL_C1ORAW = 0x04 , TMR_PRIMARY_SEL_C2ORAW = 0x05 , TMR_PRIMARY_SEL_C3ORAW = 0x06 , TMR_PRIMARY_SEL_C4ORAW = 0x07
}
tmr primary mode select type
More...
enum sub_tmr_input_sel_type {
TMR_SUB_INPUT_SEL_IS0 = 0x00 , TMR_SUB_INPUT_SEL_IS1 = 0x01 , TMR_SUB_INPUT_SEL_IS2 = 0x02 , TMR_SUB_INPUT_SEL_IS3 = 0x03 ,
TMR_SUB_INPUT_SEL_C1INC = 0x04 , TMR_SUB_INPUT_SEL_C1DF1 = 0x05 , TMR_SUB_INPUT_SEL_C2DF2 = 0x06 , TMR_SUB_INPUT_SEL_EXTIN = 0x07
}
tmr subordinate mode input select type More...
enum tmr_sub_mode_select_type {
TMR_SUB_MODE_DIABLE = 0x00 , TMR_SUB_ENCODER_MODE_A = 0x01 , TMR_SUB_ENCODER_MODE_B = 0x02 , TMR_SUB_ENCODER_MODE_C = 0x03 ,
TMR_SUB_RESET_MODE = 0x04 , TMR_SUB_HANG_MODE = 0x05 , TMR_SUB_TRIGGER_MODE = 0x06 , TMR_SUB_EXTERNAL_CLOCK_MODE_A = 0x07
}
tmr subordinate mode select type More...
enum | tmr_encoder_mode_type { TMR_ENCODER_MODE_A = TMR_SUB_ENCODER_MODE_A , TMR_ENCODER_MODE_B = TMR_SUB_ENCODER_MODE_B , TMR_ENCODER_MODE_C = TMR_SUB_ENCODER_MODE_C }
tmr encoder mode type More...
enum tmr_output_control_mode_type {
TMR_OUTPUT_CONTROL_OFF = 0x00 , TMR_OUTPUT_CONTROL_HIGH = 0x01 , TMR_OUTPUT_CONTROL_LOW = 0x02 , TMR_OUTPUT_CONTROL_SWITCH = 0x03 ,
TMR_OUTPUT_CONTROL_FORCE_HIGH = 0x04 , TMR_OUTPUT_CONTROL_FORCE_LOW = 0x05 , TMR_OUTPUT_CONTROL_PWM_MODE_A = 0x06 , TMR_OUTPUT_CONTROL_PWM_MODE_B = 0x07
}
tmr output control mode type More...
enum | tmr_force_output_type { TMR_FORCE_OUTPUT_HIGH = TMR_OUTPUT_CONTROL_FORCE_HIGH , TMR_FORCE_OUTPUT_LOW = TMR_OUTPUT_CONTROL_FORCE_LOW }
tmr force output type More...
enum | tmr_output_polarity_type { TMR_OUTPUT_ACTIVE_HIGH = 0x00 , TMR_OUTPUT_ACTIVE_LOW = 0x01 }
tmr output channel polarity type More...
enum | tmr_input_polarity_type { TMR_INPUT_RISING_EDGE = 0x00 , TMR_INPUT_FALLING_EDGE = 0x01 , TMR_INPUT_BOTH_EDGE = 0x03 }
tmr input channel polarity type More...
enum tmr_channel_select_type {
TMR_SELECT_CHANNEL_1 = 0x00 , TMR_SELECT_CHANNEL_1C = 0x01 , TMR_SELECT_CHANNEL_2 = 0x02 , TMR_SELECT_CHANNEL_2C = 0x03 ,
TMR_SELECT_CHANNEL_3 = 0x04 , TMR_SELECT_CHANNEL_3C = 0x05 , TMR_SELECT_CHANNEL_4 = 0x06
}
tmr channel select type More...
enum | tmr_channel1_input_connected_type { TMR_CHANEL1_CONNECTED_C1IRAW = 0x00 , TMR_CHANEL1_2_3_CONNECTED_C1IRAW_XOR = 0x01 }
tmr channel1 input connected type More...
enum | tmr_input_direction_mapped_type { TMR_CC_CHANNEL_MAPPED_DIRECT = 0x01 , TMR_CC_CHANNEL_MAPPED_INDIRECT = 0x02 , TMR_CC_CHANNEL_MAPPED_STI = 0x03 }
tmr input channel mapped type channel direction More...
enum | tmr_channel_input_divider_type { TMR_CHANNEL_INPUT_DIV_1 = 0x00 , TMR_CHANNEL_INPUT_DIV_2 = 0x01 , TMR_CHANNEL_INPUT_DIV_4 = 0x02 , TMR_CHANNEL_INPUT_DIV_8 = 0x03 }
tmr input divider type More...
enum | tmr_dma_request_source_type { TMR_DMA_REQUEST_BY_CHANNEL = 0x00 , TMR_DMA_REQUEST_BY_OVERFLOW = 0x01 }
tmr dma request source select type More...
enum tmr_dma_request_type {
TMR_OVERFLOW_DMA_REQUEST = 0x00000100 , TMR_C1_DMA_REQUEST = 0x00000200 , TMR_C2_DMA_REQUEST = 0x00000400 , TMR_C3_DMA_REQUEST = 0x00000800 ,
TMR_C4_DMA_REQUEST = 0x00001000 , TMR_HALL_DMA_REQUEST = 0x00002000 , TMR_TRIGGER_DMA_REQUEST = 0x00004000
}
tmr dma request type More...
enum tmr_event_trigger_type {
TMR_OVERFLOW_SWTRIG = 0x00000001 , TMR_C1_SWTRIG = 0x00000002 , TMR_C2_SWTRIG = 0x00000004 , TMR_C3_SWTRIG = 0x00000008 ,
TMR_C4_SWTRIG = 0x00000010 , TMR_HALL_SWTRIG = 0x00000020 , TMR_TRIGGER_SWTRIG = 0x00000040 , TMR_BRK_SWTRIG = 0x00000080
}
tmr event triggered by software type
More...
enum | tmr_polarity_active_type { TMR_POLARITY_ACTIVE_HIGH = 0x00 , TMR_POLARITY_ACTIVE_LOW = 0x01 , TMR_POLARITY_ACTIVE_BOTH = 0x02 }
tmr polarity active type More...
enum | tmr_external_signal_divider_type { TMR_ES_FREQUENCY_DIV_1 = 0x00 , TMR_ES_FREQUENCY_DIV_2 = 0x01 , TMR_ES_FREQUENCY_DIV_4 = 0x02 , TMR_ES_FREQUENCY_DIV_8 = 0x03 }
tmr external signal divider type More...
enum | tmr_external_signal_polarity_type { TMR_ES_POLARITY_NON_INVERTED = 0x00 , TMR_ES_POLARITY_INVERTED = 0x01 }
tmr external signal polarity type More...
enum tmr_dma_transfer_length_type {
TMR_DMA_TRANSFER_1BYTE = 0x00 , TMR_DMA_TRANSFER_2BYTES = 0x01 , TMR_DMA_TRANSFER_3BYTES = 0x02 , TMR_DMA_TRANSFER_4BYTES = 0x03 ,
TMR_DMA_TRANSFER_5BYTES = 0x04 , TMR_DMA_TRANSFER_6BYTES = 0x05 , TMR_DMA_TRANSFER_7BYTES = 0x06 , TMR_DMA_TRANSFER_8BYTES = 0x07 ,
TMR_DMA_TRANSFER_9BYTES = 0x08 , TMR_DMA_TRANSFER_10BYTES = 0x09 , TMR_DMA_TRANSFER_11BYTES = 0x0A , TMR_DMA_TRANSFER_12BYTES = 0x0B ,
TMR_DMA_TRANSFER_13BYTES = 0x0C , TMR_DMA_TRANSFER_14BYTES = 0x0D , TMR_DMA_TRANSFER_15BYTES = 0x0E , TMR_DMA_TRANSFER_16BYTES = 0x0F ,
TMR_DMA_TRANSFER_17BYTES = 0x10 , TMR_DMA_TRANSFER_18BYTES = 0x11
}
tmr dma transfer length type More...
enum tmr_dma_address_type {
TMR_CTRL1_ADDRESS = 0x0000 , TMR_CTRL2_ADDRESS = 0x0001 , TMR_STCTRL_ADDRESS = 0x0002 , TMR_IDEN_ADDRESS = 0x0003 ,
TMR_ISTS_ADDRESS = 0x0004 , TMR_SWEVT_ADDRESS = 0x0005 , TMR_CM1_ADDRESS = 0x0006 , TMR_CM2_ADDRESS = 0x0007 ,
TMR_CCTRL_ADDRESS = 0x0008 , TMR_CVAL_ADDRESS = 0x0009 , TMR_DIV_ADDRESS = 0x000A , TMR_PR_ADDRESS = 0x000B ,
TMR_RPR_ADDRESS = 0x000C , TMR_C1DT_ADDRESS = 0x000D , TMR_C2DT_ADDRESS = 0x000E , TMR_C3DT_ADDRESS = 0x000F ,
TMR_C4DT_ADDRESS = 0x0010 , TMR_BRK_ADDRESS = 0x0011 , TMR_DMACTRL_ADDRESS = 0x0012
}
tmr dma base address type More...
enum | tmr_brk_polarity_type { TMR_BRK_INPUT_ACTIVE_LOW = 0x00 , TMR_BRK_INPUT_ACTIVE_HIGH = 0x01 }
tmr brk polarity type More...
enum | tmr_wp_level_type { TMR_WP_OFF = 0x00 , TMR_WP_LEVEL_3 = 0x01 , TMR_WP_LEVEL_2 = 0x02 , TMR_WP_LEVEL_1 = 0x03 }
tmr write protect level type More...

Functions

void | tmr_reset (tmr_type *tmr_x)
tmr reset by crm reset register More...
void | tmr_counter_enable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter More...
void | tmr_output_default_para_init (tmr_output_config_type *tmr_output_struct)
init tmr output default para More...
void | tmr_input_default_para_init (tmr_input_config_type *tmr_input_struct)
init tmr input default para More...
void | tmr_brkdt_default_para_init (tmr_brkdt_config_type *tmr_brkdt_struct)
init tmr brkdt default para More...
void | tmr_base_init (tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base More...
void | tmr_clock_source_div_set (tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division More...
void | tmr_cnt_dir_set (tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction More...
void | tmr_repetition_counter_set (tmr_type *tmr_x, uint8_t tmr_rpr_value)
set the repetition counter register(rpr) value More...
void | tmr_counter_value_set (tmr_type *tmr_x, uint32_t tmr_cnt_value)
set tmr counter value More...
uint32_t | tmr_counter_value_get (tmr_type *tmr_x)
get tmr counter value More...
void | tmr_div_value_set (tmr_type *tmr_x, uint32_t tmr_div_value)
set tmr div value More...
uint32_t | tmr_div_value_get (tmr_type *tmr_x)
get tmr div value More...
void | tmr_output_channel_config (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel More...
void | tmr_output_channel_mode_select (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_control_mode_type oc_mode)
select tmr output channel mode More...
void | tmr_period_value_set (tmr_type *tmr_x, uint32_t tmr_pr_value)
set tmr period value More...
uint32_t | tmr_period_value_get (tmr_type *tmr_x)
get tmr period value More...
void | tmr_channel_value_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value More...
uint32_t | tmr_channel_value_get (tmr_type *tmr_x, tmr_channel_select_type tmr_channel)
get tmr channel value More...
void | tmr_period_buffer_enable (tmr_type *tmr_x, confirm_state new_state)
enable tmr period buffer More...
void | tmr_output_channel_buffer_enable (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
enable tmr output channel buffer More...
void | tmr_output_channel_immediately_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
set tmr output channel immediately More...
void | tmr_output_channel_switch_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
set tmr output channel switch More...
void | tmr_one_cycle_mode_enable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr one cycle mode More...
void | tmr_32_bit_function_enable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr 32 bit function(plus mode) More...
void | tmr_overflow_request_source_set (tmr_type *tmr_x, confirm_state new_state)
select tmr the overflow event sources More...
void | tmr_overflow_event_disable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr overflow event generation More...
void | tmr_input_channel_init (tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
init tmr input channel More...
void | tmr_channel_enable (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
tmr channel enable More...
void | tmr_input_channel_filter_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint16_t filter_value)
set tmr input channel filter More...
void | tmr_pwm_input_config (tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
config tmr pwm input More...
void | tmr_channel1_input_select (tmr_type *tmr_x, tmr_channel1_input_connected_type ti1_connect)
select tmr channel1 input More...
void | tmr_input_channel_divider_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_channel_input_divider_type divider_factor)
set tmr input channel divider More...
void | tmr_primary_mode_select (tmr_type *tmr_x, tmr_primary_select_type primary_mode)
select tmr primary mode More...
void | tmr_sub_mode_select (tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode More...
void | tmr_channel_dma_select (tmr_type *tmr_x, tmr_dma_request_source_type cc_dma_select)
select tmr channel dma More...
void | tmr_hall_select (tmr_type *tmr_x, confirm_state new_state)
select tmr hall More...
void | tmr_channel_buffer_enable (tmr_type *tmr_x, confirm_state new_state)
enable tmr channel buffer More...
void | tmr_trigger_input_select (tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger More...
void | tmr_sub_sync_mode_set (tmr_type *tmr_x, confirm_state new_state)
set tmr subordinate synchronization mode More...
void | tmr_dma_request_enable (tmr_type *tmr_x, tmr_dma_request_type dma_request, confirm_state new_state)
enable or disable tmr dma request More...
void | tmr_interrupt_enable (tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt More...
flag_status | tmr_flag_get (tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag More...
void | tmr_flag_clear (tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag More...
void | tmr_event_sw_trigger (tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event More...
void | tmr_output_enable (tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable More...
void | tmr_internal_clock_set (tmr_type *tmr_x)
set tmr select internal clock More...
void | tmr_output_channel_polarity_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_polarity_active_type oc_polarity)
set tmr output channel polarity More...
void | tmr_external_clock_config (tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock More...
void | tmr_external_clock_mode1_config (tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock mode1 More...
void | tmr_external_clock_mode2_config (tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock mode2 More...
void | tmr_encoder_mode_config (tmr_type *tmr_x, tmr_encoder_mode_type encoder_mode, tmr_input_polarity_type ic1_polarity, tmr_input_polarity_type ic2_polarity)
config tmr encoder mode More...
void | tmr_force_output_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_force_output_type force_output)
set tmr force output More...
void | tmr_dma_control_config (tmr_type *tmr_x, tmr_dma_transfer_length_type dma_length, tmr_dma_address_type dma_base_address)
config tmr dma control More...
void | tmr_brkdt_config (tmr_type *tmr_x, tmr_brkdt_config_type *brkdt_struct)
config tmr break mode and dead-time More...

Detailed Description

at32f415 tmr header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_tmr.h.


AT32F415 Firmwary Library: at32f415_usart.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_usart.h File Reference

at32f415 usart header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct usart_type
type define usart register all More...

Macros

#define | USART_PERR_FLAG ((uint32_t)0x00000001)
#define | USART_FERR_FLAG ((uint32_t)0x00000002)
#define | USART_NERR_FLAG ((uint32_t)0x00000004)
#define | USART_ROERR_FLAG ((uint32_t)0x00000008)
#define | USART_IDLEF_FLAG ((uint32_t)0x00000010)
#define | USART_RDBF_FLAG ((uint32_t)0x00000020)
#define | USART_TDC_FLAG ((uint32_t)0x00000040)
#define | USART_TDBE_FLAG ((uint32_t)0x00000080)
#define | USART_BFF_FLAG ((uint32_t)0x00000100)
#define | USART_CTSCF_FLAG ((uint32_t)0x00000200)
#define | USART_IDLE_INT MAKE_VALUE(0x0C,0x04)
#define | USART_RDBF_INT MAKE_VALUE(0x0C,0x05)
#define | USART_TDC_INT MAKE_VALUE(0x0C,0x06)
#define | USART_TDBE_INT MAKE_VALUE(0x0C,0x07)
#define | USART_PERR_INT MAKE_VALUE(0x0C,0x08)
#define | USART_BF_INT MAKE_VALUE(0x10,0x06)
#define | USART_ERR_INT MAKE_VALUE(0x14,0x00)
#define | USART_CTSCF_INT MAKE_VALUE(0x14,0x0A)
#define | USART1 ((usart_type *) USART1_BASE)
#define | USART2 ((usart_type *) USART2_BASE)
#define | USART3 ((usart_type *) USART3_BASE)
#define | UART4 ((usart_type *) UART4_BASE)
#define | UART5 ((usart_type *) UART5_BASE)

Enumerations

enum | usart_parity_selection_type { USART_PARITY_NONE = 0x00 , USART_PARITY_EVEN = 0x01 , USART_PARITY_ODD = 0x02 }
usart parity selection type More...
enum | usart_wakeup_mode_type { USART_WAKEUP_BY_IDLE_FRAME = 0x00 , USART_WAKEUP_BY_MATCHING_ID = 0x01 }
usart wakeup mode type More...
enum | usart_data_bit_num_type { USART_DATA_8BITS = 0x00 , USART_DATA_9BITS = 0x01 }
usart data bit num type More...
enum | usart_break_bit_num_type { USART_BREAK_10BITS = 0x00 , USART_BREAK_11BITS = 0x01 }
usart break frame bit num type More...
enum | usart_clock_phase_type { USART_CLOCK_PHASE_1EDGE = 0x00 , USART_CLOCK_PHASE_2EDGE = 0x01 }
usart phase of the clock type More...
enum | usart_clock_polarity_type { USART_CLOCK_POLARITY_LOW = 0x00 , USART_CLOCK_POLARITY_HIGH = 0x01 }
usart polarity of the clock type More...
enum | usart_lbcp_type { USART_CLOCK_LAST_BIT_NONE = 0x00 , USART_CLOCK_LAST_BIT_OUTPUT = 0x01 }
usart last bit clock pulse type More...
enum | usart_stop_bit_num_type { USART_STOP_1_BIT = 0x00 , USART_STOP_0_5_BIT = 0x01 , USART_STOP_2_BIT = 0x02 , USART_STOP_1_5_BIT = 0x03 }
usart stop bit num type More...
enum | usart_hardware_flow_control_type { USART_HARDWARE_FLOW_NONE = 0x00 , USART_HARDWARE_FLOW_RTS = 0x01 , USART_HARDWARE_FLOW_CTS = 0x02 , USART_HARDWARE_FLOW_RTS_CTS = 0x03 }
usart hardware flow control type More...

Functions

void | usart_reset (usart_type *usart_x)
deinitialize the usart peripheral registers to their default reset values. More...
void | usart_init (usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters. More...
void | usart_parity_selection_config (usart_type *usart_x, usart_parity_selection_type parity)
usart parity selection config. More...
void | usart_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral. More...
void | usart_transmitter_enable (usart_type *usart_x, confirm_state new_state)
usart transmitter enable. More...
void | usart_receiver_enable (usart_type *usart_x, confirm_state new_state)
usart receiver enable. More...
void | usart_clock_config (usart_type *usart_x, usart_clock_polarity_type clk_pol, usart_clock_phase_type clk_pha, usart_lbcp_type clk_lb)
usart clock config. More...
void | usart_clock_enable (usart_type *usart_x, confirm_state new_state)
usart enable the ck pin. More...
void | usart_interrupt_enable (usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts. More...
void | usart_dma_transmitter_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma transmitter interface. More...
void | usart_dma_receiver_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma receiver interface. More...
void | usart_wakeup_id_set (usart_type *usart_x, uint8_t usart_id)
set the wakeup id of the usart. More...
void | usart_wakeup_mode_set (usart_type *usart_x, usart_wakeup_mode_type wakeup_mode)
select the usart wakeup method in multi-processor communication. More...
void | usart_receiver_mute_enable (usart_type *usart_x, confirm_state new_state)
config the usart in mute mode in multi-processor communication. More...
void | usart_break_bit_num_set (usart_type *usart_x, usart_break_bit_num_type break_bit)
set the usart break frame bit num. More...
void | usart_lin_mode_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart lin mode. More...
void | usart_data_transmit (usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral. More...
uint16_t | usart_data_receive (usart_type *usart_x)
return the most recent received data by the usart peripheral. More...
void | usart_break_send (usart_type *usart_x)
transmit break characters. More...
void | usart_smartcard_guard_time_set (usart_type *usart_x, uint8_t guard_time_val)
config the specified usart smartcard guard time. More...
void | usart_irda_smartcard_division_set (usart_type *usart_x, uint8_t div_val)
config the irda/smartcard division. More...
void | usart_smartcard_mode_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart smart card mode. More...
void | usart_smartcard_nack_set (usart_type *usart_x, confirm_state new_state)
enable or disable nack transmission in smartcard mode. More...
void | usart_single_line_halfduplex_select (usart_type *usart_x, confirm_state new_state)
enable or disable the usart single line bidirectional half-duplex communication. More...
void | usart_irda_mode_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart's irda interface. More...
void | usart_irda_low_power_enable (usart_type *usart_x, confirm_state new_state)
configure the usart's irda low power. More...
void | usart_hardware_flow_control_set (usart_type *usart_x, usart_hardware_flow_control_type flow_state)
configure the usart's hardware flow control. More...
flag_status | usart_flag_get (usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not. More...
void | usart_flag_clear (usart_type *usart_x, uint32_t flag)
clear the usart's pending flags. More...

Detailed Description

at32f415 usart header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_usart.h.


AT32F415 Firmwary Library: at32f415_usb.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Typedefs | Enumerations | Functions
at32f415_usb.h File Reference

at32f415 usb header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | usb_ept_info
usb endpoint infomation structure definition More...
struct | usb_hch_type
usb host channel infomation structure definition More...
struct | otg_global_type
struct | otg_host_type
struct | otg_hchannel_type
struct | otg_device_type
struct | otg_eptin_type
struct | otg_eptout_type
struct | otg_pcgcctl_type

Macros

#define | USB_OTG_MODEMIS_INT ((uint32_t)0x00000002)
#define | USB_OTG_OTGINT_INT ((uint32_t)0x00000004)
#define | USB_OTG_SOF_INT ((uint32_t)0x00000008)
#define | USB_OTG_RXFLVL_INT ((uint32_t)0x00000010)
#define | USB_OTG_NPTXFEMP_INT ((uint32_t)0x00000020)
#define | USB_OTG_GINNAKEFF_INT ((uint32_t)0x00000040)
#define | USB_OTG_GOUTNAKEFF_INT ((uint32_t)0x00000080)
#define | USB_OTG_ERLYSUSP_INT ((uint32_t)0x00000400)
#define | USB_OTG_USBSUSP_INT ((uint32_t)0x00000800)
#define | USB_OTG_USBRST_INT ((uint32_t)0x00001000)
#define | USB_OTG_ENUMDONE_INT ((uint32_t)0x00002000)
#define | USB_OTG_ISOOUTDROP_INT ((uint32_t)0x00004000)
#define | USB_OTG_EOPF_INT ((uint32_t)0x00008000)
#define | USB_OTG_IEPT_INT ((uint32_t)0x00040000)
#define | USB_OTG_OEPT_INT ((uint32_t)0x00080000)
#define | USB_OTG_INCOMISOIN_INT ((uint32_t)0x00100000)
#define | USB_OTG_INCOMPIP_INCOMPISOOUT_INT ((uint32_t)0x00200000)
#define | USB_OTG_PRT_INT ((uint32_t)0x01000000)
#define | USB_OTG_HCH_INT ((uint32_t)0x02000000)
#define | USB_OTG_PTXFEMP_INT ((uint32_t)0x04000000)
#define | USB_OTG_CONIDSCHG_INT ((uint32_t)0x10000000)
#define | USB_OTG_DISCON_INT ((uint32_t)0x20000000)
#define | USB_OTG_WKUP_INT ((uint32_t)0x80000000)
#define | USB_OTG_CURMODE ((uint32_t)0x00000001)
#define | USB_OTG_MODEMIS_FLAG ((uint32_t)0x00000002)
#define | USB_OTG_OTGINT_FLAG ((uint32_t)0x00000004)
#define | USB_OTG_SOF_FLAG ((uint32_t)0x00000008)
#define | USB_OTG_RXFLVL_FLAG ((uint32_t)0x00000010)
#define | USB_OTG_NPTXFEMP_FLAG ((uint32_t)0x00000020)
#define | USB_OTG_GINNAKEFF_FLAG ((uint32_t)0x00000040)
#define | USB_OTG_GOUTNAKEFF_FLAG ((uint32_t)0x00000080)
#define | USB_OTG_ERLYSUSP_FLAG ((uint32_t)0x00000400)
#define | USB_OTG_USBSUSP_FLAG ((uint32_t)0x00000800)
#define | USB_OTG_USBRST_FLAG ((uint32_t)0x00001000)
#define | USB_OTG_ENUMDONE_FLAG ((uint32_t)0x00002000)
#define | USB_OTG_ISOOUTDROP_FLAG ((uint32_t)0x00004000)
#define | USB_OTG_EOPF_FLAG ((uint32_t)0x00008000)
#define | USB_OTG_IEPT_FLAG ((uint32_t)0x00040000)
#define | USB_OTG_OEPT_FLAG ((uint32_t)0x00080000)
#define | USB_OTG_INCOMISOIN_FLAG ((uint32_t)0x00100000)
#define | USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG ((uint32_t)0x00200000)
#define | USB_OTG_PRT_FLAG ((uint32_t)0x01000000)
#define | USB_OTG_HCH_FLAG ((uint32_t)0x02000000)
#define | USB_OTG_PTXFEMP_FLAG ((uint32_t)0x04000000)
#define | USB_OTG_CONIDSCHG_FLAG ((uint32_t)0x10000000)
#define | USB_OTG_DISCON_FLAG ((uint32_t)0x20000000)
#define | USB_OTG_WKUP_FLAG ((uint32_t)0x80000000)
#define | USB_TRDTIM_8 0x9
usb turnaround time More...
#define | USB_TRDTIM_16 0x5
#define | USB_OTG_GRXSTSP_EPTNUM ((uint32_t)0x0000000F)
usb receive status More...
#define | USB_OTG_GRXSTSP_CHNUM ((uint32_t)0x0000000F)
#define | USB_OTG_GRXSTSP_BCNT ((uint32_t)0x00007FF0)
#define | USB_OTG_GRXSTSP_DPID ((uint32_t)0x00018000)
#define | USB_OTG_GRXSTSP_PKTSTS ((uint32_t)0x001E0000)
#define | PKTSTS_IN_DATA_PACKET_RECV 0x2
usb host packet status More...
#define | PKTSTS_IN_TRANSFER_COMPLETE 0x3
#define | PKTSTS_DATA_BIT_ERROR 0x5
#define | PKTSTS_CHANNEL_STOP 0x7
#define | USB_OUT_STS_NAK 0x1
usb device packet status More...
#define | USB_OUT_STS_DATA 0x2
#define | USB_OUT_STS_COMP 0x3
#define | USB_SETUP_STS_COMP 0x4
#define | USB_SETUP_STS_DATA 0x6
#define | USB_HCFG_CLK_60M 0
usb host phy clock More...
#define | USB_HCFG_CLK_48M 1
#define | USB_HCFG_CLK_6M 2
#define | USB_OTG_HPRT_PRTCONSTS ((uint32_t)0x00000001)
usb host port status More...
#define | USB_OTG_HPRT_PRTCONDET ((uint32_t)0x00000002)
#define | USB_OTG_HPRT_PRTENA ((uint32_t)0x00000004)
#define | USB_OTG_HPRT_PRTENCHNG ((uint32_t)0x00000008)
#define | USB_OTG_HPRT_PRTOVRCACT ((uint32_t)0x00000010)
#define | USB_OTG_HPRT_PRTOVRCCHNG ((uint32_t)0x00000020)
#define | USB_OTG_HPRT_PRTRES ((uint32_t)0x00000040)
#define | USB_OTG_HPRT_PRTSUSP ((uint32_t)0x00000080)
#define | USB_OTG_HPRT_PRTRST ((uint32_t)0x00000100)
#define | USB_OTG_HPRT_PRTLNSTS ((uint32_t)0x00000C00)
#define | USB_OTG_HPRT_PRTPWR ((uint32_t)0x00001000)
#define | USB_OTG_HPRT_PRTSPD ((uint32_t)0x00060000)
#define | USB_PRTSPD_HIGH_SPEED 0
usb port speed More...
#define | USB_PRTSPD_FULL_SPEED 1
#define | USB_PRTSPD_LOW_SPEED 2
#define | USB_OTG_HCCHAR_MPS ((uint32_t)0x000007FF)
usb host register hcchar bit define More...
#define | USB_OTG_HCCHAR_EPTNUM ((uint32_t)0x00007800)
#define | USB_OTG_HCCHAR_EPTDIR ((uint32_t)0x00008000)
#define | USB_OTG_HCCHAR_LSPDDEV ((uint32_t)0x00020000)
#define | USB_OTG_HCCHAR_EPTYPE ((uint32_t)0x000C0000)
#define | USB_OTG_HCCHAR_MC ((uint32_t)0x00300000)
#define | USB_OTG_HCCHAR_DEVADDR ((uint32_t)0x1FC00000)
#define | USB_OTG_HCCHAR_ODDFRM ((uint32_t)0x20000000)
#define | USB_OTG_HCCHAR_CHDIS ((uint32_t)0x40000000)
#define | USB_OTG_HCCHAR_CHENA ((uint32_t)0x80000000)
#define | USB_OTG_HCTSIZ_XFERSIZE ((uint32_t)0x0007FFFF)
usb host register hctsiz bit define More...
#define | USB_OTG_HCTSIZ_PKTCNT ((uint32_t)0x1FF80000)
#define | USB_OTG_HCTSIZ_PID ((uint32_t)0x60000000)
#define | USB_OTG_HC_XFERCM_INT ((uint32_t)0x00000001)
usb host channel interrupt mask More...
#define | USB_OTG_HC_CHHLTDM_INT ((uint32_t)0x00000002)
#define | USB_OTG_HC_STALLM_INT ((uint32_t)0x00000008)
#define | USB_OTG_HC_NAKM_INT ((uint32_t)0x00000010)
#define | USB_OTG_HC_ACKM_INT ((uint32_t)0x00000020)
#define | USB_OTG_HC_NYETM_INT ((uint32_t)0x00000040)
#define | USB_OTG_HC_XACTERRM_INT ((uint32_t)0x00000080)
#define | USB_OTG_HC_BBLERRM_INT ((uint32_t)0x00000100)
#define | USB_OTG_HC_FRMOVRRUN_INT ((uint32_t)0x00000200)
#define | USB_OTG_HC_DTGLERRM_INT ((uint32_t)0x00000400)
#define | USB_OTG_HC_XFERC_FLAG ((uint32_t)0x00000001)
usb host channel interrupt flag More...
#define | USB_OTG_HC_CHHLTD_FLAG ((uint32_t)0x00000002)
#define | USB_OTG_HC_STALL_FLAG ((uint32_t)0x00000008)
#define | USB_OTG_HC_NAK_FLAG ((uint32_t)0x00000010)
#define | USB_OTG_HC_ACK_FLAG ((uint32_t)0x00000020)
#define | USB_OTG_HC_NYET_FLAG ((uint32_t)0x00000040)
#define | USB_OTG_HC_XACTERR_FLAG ((uint32_t)0x00000080)
#define | USB_OTG_HC_BBLERR_FLAG ((uint32_t)0x00000100)
#define | USB_OTG_HC_FRMOVRRUN_FLAG ((uint32_t)0x00000200)
#define | USB_OTG_HC_DTGLERR_FLAG ((uint32_t)0x00000400)
#define | USB_DCFG_FULL_SPEED 3
usb device full speed More...
#define | USB_OTG_DCTL_RWKUPSIG ((uint32_t)0x00000001)
usb device ctrl define More...
#define | USB_OTG_DCTL_SFTDISCON ((uint32_t)0x00000002)
#define | USB_OTG_DCTL_GNPINNAKSTS ((uint32_t)0x00000004)
#define | USB_OTG_DCTL_GOUTNAKSTS ((uint32_t)0x00000008)
#define | USB_OTG_DCTL_SGNPINNAK ((uint32_t)0x00000080)
#define | USB_OTG_DCTL_CGNPINNAK ((uint32_t)0x00000100)
#define | USB_OTG_DCTL_SGOUTNAK ((uint32_t)0x00000200)
#define | USB_OTG_DCTL_CGOUTNAK ((uint32_t)0x00000400)
#define | USB_OTG_DCTL_PWROPRGDNE ((uint32_t)0x00000800)
#define | USB_OTG_DIEPINT_XFERC_FLAG ((uint32_t)0x00000001)
usb device in endpoint flag More...
#define | USB_OTG_DIEPINT_EPTDISD_FLAG ((uint32_t)0x00000002)
#define | USB_OTG_DIEPINT_TIMEOUT_FLAG ((uint32_t)0x00000008)
#define | USB_OTG_DIEPINT_INTKNTXFEMP_FLAG ((uint32_t)0x00000010)
#define | USB_OTG_DIEPINT_INEPTNAK_FLAG ((uint32_t)0x00000040)
#define | USB_OTG_DIEPINT_TXFEMP_FLAG ((uint32_t)0x00000080)
#define | USB_OTG_DOEPINT_XFERC_FLAG ((uint32_t)0x00000001)
usb device out endpoint flag More...
#define | USB_OTG_DOEPINT_EPTDISD_FLAG ((uint32_t)0x00000002)
#define | USB_OTG_DOEPINT_SETUP_FLAG ((uint32_t)0x00000008)
#define | USB_OTG_DOEPINT_OUTTEPD_FLAG ((uint32_t)0x00000010)
#define | USB_OTG_DOEPINT_B2BSTUP_FLAG ((uint32_t)0x00000040)
#define | USB_OTG_DTXFSTS_INEPTFSAV ((uint32_t)0x0000FFFF)
usb device in endpoint fifo space mask More...
#define | USB_EPT0_MPS_64 0
endpoint0 maximum packet size More...
#define | USB_EPT0_MPS_32 1
#define | USB_EPT0_MPS_16 2
#define | USB_EPT0_MPS_8 3
#define | OTG_FIFO_SIZE 320
otg fifo size (word) More...
#define | USB_MAX_DATA_LENGTH 0x200
otg host max buffer length (byte) More...
#define | OTGFS_USB_GLOBAL
#define | OTGFS_USB_DEVICE
#define | OTGFS_USB_HOST
#define | OTG_HOST_ADDR_OFFSET 0x400
usb host and device offset address More...
#define | OTG_HOST_CHANNEL_ADDR_OFFSET 0x500
#define | OTG_DEVICE_ADDR_OFFSET 0x800
#define | OTG_DEVICE_EPTIN_ADDR_OFFSET 0x900
#define | OTG_DEVICE_EPTOUT_ADDR_OFFSET 0xB00
#define | OTG_PCGCCTL_ADDR_OFFSET 0xE00
#define | OTG_FIFO_ADDR_OFFSET 0x1000
#define | OTG1_GLOBAL ((otg_global_type *)(OTGFS1_BASE))
usb host and device register define More...
#define | OTG_PCGCCTL(usbx) ((otg_pcgcctl_type *)((uint32_t)usbx + OTG_PCGCCTL_ADDR_OFFSET))
#define | OTG_DEVICE(usbx) ((otg_device_type *)((uint32_t)usbx + OTG_DEVICE_ADDR_OFFSET))
#define | OTG_HOST(usbx) ((otg_host_type *)((uint32_t)usbx + OTG_HOST_ADDR_OFFSET))
#define | USB_CHL(usbx, n) ((otg_hchannel_type *)((uint32_t)usbx + OTG_HOST_CHANNEL_ADDR_OFFSET + n * 0x20))
#define | USB_INEPT(usbx, eptn) ((otg_eptin_type *)((uint32_t)usbx + OTG_DEVICE_EPTIN_ADDR_OFFSET + eptn * 0x20))
#define | USB_OUTEPT(usbx, eptn) ((otg_eptout_type *)((uint32_t)usbx + OTG_DEVICE_EPTOUT_ADDR_OFFSET + eptn * 0x20))
#define | USB_FIFO(usbx, eptn) *(__IO uint32_t *)((uint32_t)usbx + OTG_FIFO_ADDR_OFFSET + eptn * 0x1000)

Typedefs

typedef otg_global_type usb_reg_type

Enumerations

enum | dcfg_perfrint_type { DCFG_PERFRINT_80 = 0x00 , DCFG_PERFRINT_85 = 0x01 , DCFG_PERFRINT_90 = 0x02 , DCFG_PERFRINT_95 = 0x03 }
usb device periodic frame interval More...
enum | otg_mode_type { OTG_DEVICE_MODE , OTG_HOST_MODE , OTG_DRD_MODE }
usb mode define(device, host, drd) More...
enum | endpoint_trans_type { EPT_CONTROL_TYPE = 0x00 , EPT_ISO_TYPE = 0x01 , EPT_BULK_TYPE = 0x02 , EPT_INT_TYPE = 0x03 }
endpoint type define More...
enum usb_endpoint_number_type {
USB_EPT0 = 0x00 , USB_EPT1 = 0x01 , USB_EPT2 = 0x02 , USB_EPT3 = 0x03 ,
USB_EPT4 = 0x04 , USB_EPT5 = 0x05 , USB_EPT6 = 0x06 , USB_EPT7 = 0x07
}
usb endpoint number define type More...
enum | endpoint_dir_type { EPT_DIR_IN = 0x00 , EPT_DIR_OUT = 0x01 }
usb endpoint max num define More...
enum | otg_id_type { USB_OTG1_ID , USB_OTG2_ID }
otgfs1 and otgfs2 select type More...
enum | usb_clk48_s { USB_CLK_HICK , USB_CLK_HEXT }
usb clock select More...

Functions

error_status | usb_global_reset (otg_global_type *usbx)
usb global core soft reset More...
void | usb_global_init (otg_global_type *usbx)
usb global initialization More...
otg_global_type * | usb_global_select_core (uint8_t usb_id)
usb global select usb core (otg1 or otg2). More...
void | usb_flush_tx_fifo (otg_global_type *usbx, uint32_t fifo_num)
flush tx fifo More...
void | usb_flush_rx_fifo (otg_global_type *usbx)
flush rx fifo More...
void | usb_global_interrupt_enable (otg_global_type *usbx, uint16_t interrupt, confirm_state new_state)
usb interrupt mask enable More...
uint32_t | usb_global_get_all_interrupt (otg_global_type *usbx)
get all global core interrupt flag More...
void | usb_global_clear_interrupt (otg_global_type *usbx, uint32_t flag)
clear the global interrupt flag More...
void | usb_interrupt_enable (otg_global_type *usbx)
usb global interrupt enable More...
void | usb_interrupt_disable (otg_global_type *usbx)
usb global interrupt disable More...
void | usb_set_rx_fifo (otg_global_type *usbx, uint16_t size)
usb set rx fifo size More...
void | usb_set_tx_fifo (otg_global_type *usbx, uint8_t txfifo, uint16_t size)
usb set tx fifo size More...
void | usb_global_set_mode (otg_global_type *usbx, uint32_t mode)
set otg mode(device or host mode) More...
void | usb_global_power_on (otg_global_type *usbx)
disable the transceiver power down mode More...
void | usb_write_packet (otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
write data from user memory to usb buffer More...
void | usb_read_packet (otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
read data from usb buffer to user buffer More...
void | usb_stop_phy_clk (otg_global_type *usbx)
usb stop phy clock More...
void | usb_open_phy_clk (otg_global_type *usbx)
usb open phy clock More...
void | usb_ept_open (otg_global_type *usbx, usb_ept_info *ept_info)
open usb endpoint More...
void | usb_ept_close (otg_global_type *usbx, usb_ept_info *ept_info)
close usb endpoint More...
void | usb_ept_stall (otg_global_type *usbx, usb_ept_info *ept_info)
set endpoint tx or rx status to stall More...
void | usb_ept_clear_stall (otg_global_type *usbx, usb_ept_info *ept_info)
clear endpoint tx or rx status to stall More...
uint32_t | usb_get_all_out_interrupt (otg_global_type *usbx)
get all out endpoint interrupt bits More...
uint32_t | usb_get_all_in_interrupt (otg_global_type *usbx)
get all in endpoint interrupt bits More...
uint32_t | usb_ept_out_interrupt (otg_global_type *usbx, uint32_t eptn)
get out endpoint interrupt flag More...
uint32_t | usb_ept_in_interrupt (otg_global_type *usbx, uint32_t eptn)
get in endpoint interrupt flag More...
void | usb_ept_out_clear (otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear out endpoint interrupt flag More...
void | usb_ept_in_clear (otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear in endpoint interrupt flag More...
void | usb_set_address (otg_global_type *usbx, uint8_t address)
set the host assignment address More...
void | usb_ept0_start (otg_global_type *usbx)
enable endpoint 0 out More...
void | usb_ept0_setup (otg_global_type *usbx)
endpoint 0 start setup More...
void | usb_connect (otg_global_type *usbx)
connect usb device by enable pull-up More...
void | usb_disconnect (otg_global_type *usbx)
disconnect usb device by disable pull-up More...
void | usb_remote_wkup_set (otg_global_type *usbx)
usb remote wakeup set More...
void | usb_remote_wkup_clear (otg_global_type *usbx)
usb remote wakeup clear More...
uint8_t | usb_suspend_status_get (otg_global_type *usbx)
usb suspend status get More...
void | usb_port_power_on (otg_global_type *usbx, confirm_state state)
usb port power on More...
uint32_t | usbh_get_frame (otg_global_type *usbx)
get current frame number More...
void | usb_hc_enable (otg_global_type *usbx, uint8_t chn, uint8_t ept_num, uint8_t dev_address, uint8_t type, uint8_t maxpacket, uint8_t speed)
enable one host channel More...
uint32_t | usb_hch_read_interrupt (otg_global_type *usbx)
host read channel interrupt More...
void | usb_host_disable (otg_global_type *usbx)
disable host More...
void | usb_hch_halt (otg_global_type *usbx, uint8_t chn)
halt channel More...
void | usbh_fsls_clksel (otg_global_type *usbx, uint8_t clk)
select full or low speed clock More...

Detailed Description

at32f415 usb header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_usb.h.


AT32F415 Firmwary Library: at32f415_wdt.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_wdt.h File Reference

at32f415 wdt header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct wdt_type
type define wdt register all More...

Macros

#define | WDT_DIVF_UPDATE_FLAG ((uint16_t)0x0001)
#define | WDT_RLDF_UPDATE_FLAG ((uint16_t)0x0002)
#define | WDT ((wdt_type *) WDT_BASE)

Enumerations

enum wdt_division_type {
WDT_CLK_DIV_4 = 0x00 , WDT_CLK_DIV_8 = 0x01 , WDT_CLK_DIV_16 = 0x02 , WDT_CLK_DIV_32 = 0x03 ,
WDT_CLK_DIV_64 = 0x04 , WDT_CLK_DIV_128 = 0x05 , WDT_CLK_DIV_256 = 0x06
}
wdt division value type
More...
enum wdt_cmd_value_type { WDT_CMD_LOCK = 0x0000 , WDT_CMD_UNLOCK = 0x5555 , WDT_CMD_ENABLE = 0xCCCC , WDT_CMD_RELOAD = 0xAAAA }
wdt cmd value type
More...

Functions

void | wdt_enable (void)
wdt enable ,the reload value will be sent to the counter More...
void | wdt_counter_reload (void)
reload wdt counter More...
void | wdt_reload_value_set (uint16_t reload_value)
set wdt counter reload value More...
void | wdt_divider_set (wdt_division_type division)
set wdt division divider
More...
void | wdt_register_write_enable (confirm_state new_state)
enable or disable wdt cmd register write More...
flag_status | wdt_flag_get (uint16_t wdt_flag)
get wdt flag More...

Detailed Description

at32f415 wdt header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_wdt.h.


AT32F415 Firmwary Library: at32f415_wwdt.h File Reference

  • libraries
  • drivers
  • inc
Data Structures | Macros | Enumerations | Functions
at32f415_wwdt.h File Reference

at32f415 wwdt header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct wwdt_type
type define wwdt register all More...

Macros

#define | WWDT_EN_BIT ((uint32_t)0x00000080)
#define | WWDT ((wwdt_type *) WWDT_BASE)

Enumerations

enum wwdt_division_type { WWDT_PCLK1_DIV_4096 = 0x00 , WWDT_PCLK1_DIV_8192 = 0x01 , WWDT_PCLK1_DIV_16384 = 0x02 , WWDT_PCLK1_DIV_32768 = 0x03 }
wwdt division type More...

Functions

void | wwdt_reset (void)
wwdt reset by crm reset register More...
void | wwdt_divider_set (wwdt_division_type division)
wwdt division set More...
void | wwdt_flag_clear (void)
wwdt reload counter interrupt flag clear More...
void | wwdt_enable (uint8_t wwdt_cnt)
wwdt enable and the counter value load More...
void | wwdt_interrupt_enable (void)
wwdt reload counter interrupt enable More...
flag_status | wwdt_flag_get (void)
wwdt reload counter interrupt flag get More...
void | wwdt_counter_set (uint8_t wwdt_cnt)
wwdt counter value set More...
void | wwdt_window_counter_set (uint8_t window_cnt)
wwdt window counter value set More...

Detailed Description

at32f415 wwdt header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_wwdt.h.


AT32F415 Firmwary Library: at32f415_adc.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_adc.c File Reference

contains all the functions for the adc firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | adc_reset (adc_type *adc_x)
deinitialize the adc peripheral registers to their default reset values. More...
void | adc_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the specified adc peripheral. More...
void | adc_combine_mode_select (adc_combine_mode_type combine_mode)
select combine mode of the specified adc peripheral. More...
void | adc_base_default_para_init (adc_base_config_type *adc_base_struct)
adc base default para init. More...
void | adc_base_config (adc_type *adc_x, adc_base_config_type *adc_base_struct)
initialize the adc peripheral according to the specified parameters. More...
void | adc_dma_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the adc dma transfer. More...
void | adc_interrupt_enable (adc_type *adc_x, uint32_t adc_int, confirm_state new_state)
enable or disable the specified adc interrupts. More...
void | adc_calibration_init (adc_type *adc_x)
initialize calibration register of the specified adc peripheral. More...
flag_status | adc_calibration_init_status_get (adc_type *adc_x)
get calibration register's initialize status of the specified adc peripheral. More...
void | adc_calibration_start (adc_type *adc_x)
start calibration process of the specified adc peripheral. More...
flag_status | adc_calibration_status_get (adc_type *adc_x)
get calibration status of the specified adc peripheral. More...
void | adc_voltage_monitor_enable (adc_type *adc_x, adc_voltage_monitoring_type adc_voltage_monitoring)
enable or disable the voltage monitoring on single/all ordinary or preempt channels of the specified adc peripheral. More...
void | adc_voltage_monitor_threshold_value_set (adc_type *adc_x, uint16_t adc_high_threshold, uint16_t adc_low_threshold)
set voltage monitoring's high and low thresholds value of the specified adc peripheral. More...
void | adc_voltage_monitor_single_channel_select (adc_type *adc_x, adc_channel_select_type adc_channel)
select the voltage monitoring's channel of the specified adc peripheral. More...
void | adc_ordinary_channel_set (adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc peripheral. More...
void | adc_preempt_channel_length_set (adc_type *adc_x, uint8_t adc_channel_lenght)
set preempt channel lenghth of the specified adc peripheral. More...
void | adc_preempt_channel_set (adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
configure preempt channel's corresponding rank in the sequencer and sample time of the specified adc peripheral. More...
void | adc_ordinary_conversion_trigger_set (adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state)
enable or disable the ordinary channel's external trigger and set external trigger event of the specified adc peripheral. More...
void | adc_preempt_conversion_trigger_set (adc_type *adc_x, adc_preempt_trig_select_type adc_preempt_trig, confirm_state new_state)
enable or disable the preempt channel's external trigger and set external trigger event of the specified adc peripheral. More...
void | adc_preempt_offset_value_set (adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel, uint16_t adc_offset_value)
set preempt channel's conversion value offset of the specified adc peripheral. More...
void | adc_ordinary_part_count_set (adc_type *adc_x, uint8_t adc_channel_count)
set partitioned mode channel count of the specified adc peripheral. More...
void | adc_ordinary_part_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the partitioned mode on ordinary channel of the specified adc peripheral. More...
void | adc_preempt_part_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable the partitioned mode on preempt channel of the specified adc peripheral. More...
void | adc_preempt_auto_mode_enable (adc_type *adc_x, confirm_state new_state)
enable or disable automatic preempt group conversion of the specified adc peripheral. More...
void | adc_tempersensor_vintrv_enable (confirm_state new_state)
enable or disable the temperature sensor and vintrv channel. More...
void | adc_ordinary_software_trigger_enable (adc_type *adc_x, confirm_state new_state)
enable or disable ordinary software start conversion of the specified adc peripheral. More...
flag_status | adc_ordinary_software_trigger_status_get (adc_type *adc_x)
get ordinary software start conversion status of the specified adc peripheral. More...
void | adc_preempt_software_trigger_enable (adc_type *adc_x, confirm_state new_state)
enable or disable preempt software start conversion of the specified adc peripheral. More...
flag_status | adc_preempt_software_trigger_status_get (adc_type *adc_x)
get preempt software start conversion status of the specified adc peripheral. More...
uint16_t | adc_ordinary_conversion_data_get (adc_type *adc_x)
return the last conversion data for ordinary channel of the specified adc peripheral. More...
uint32_t | adc_combine_ordinary_conversion_data_get (void)
return the last conversion data for ordinary channel of combine adc. More...
uint16_t | adc_preempt_conversion_data_get (adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel)
return the conversion data for selection preempt channel of the specified adc peripheral. More...
flag_status | adc_flag_get (adc_type *adc_x, uint8_t adc_flag)
get flag of the specified adc peripheral. More...
void | adc_flag_clear (adc_type *adc_x, uint32_t adc_flag)
clear flag of the specified adc peripheral. More...

Detailed Description

contains all the functions for the adc firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_adc.c.


AT32F415 Firmwary Library: at32f415_can.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_can.c File Reference

contains all the functions for the can firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | can_reset (can_type *can_x)
deinitialize the can peripheral registers to their default reset values. More...
void | can_baudrate_default_para_init (can_baudrate_type *can_baudrate_struct)
fill each can_baudrate_struct member with its default value. More...
error_status | can_baudrate_set (can_type *can_x, can_baudrate_type *can_baudrate_struct)
set the baudrate of the can peripheral More...
void | can_default_para_init (can_base_type *can_base_struct)
fill each can_init_struct member with its default value. More...
error_status | can_base_init (can_type *can_x, can_base_type *can_base_struct)
initialize the can peripheral according to the specified parameters in the can_init_struct. More...
void | can_filter_default_para_init (can_filter_init_type *can_filter_init_struct)
fill each can_filter_init_struct member with its default value. More...
void | can_filter_init (can_type *can_x, can_filter_init_type *can_filter_init_struct)
initialize the can peripheral according to the specified parameters in the can_filter_init_struct. More...
void | can_debug_transmission_prohibit (can_type *can_x, confirm_state new_state)
enable or disable the debug transmission prohibit of the specified can peripheral. More...
void | can_ttc_mode_enable (can_type *can_x, confirm_state new_state)
enable or disable time trigger operation communication mode of the specified can peripheral. More...
uint8_t | can_message_transmit (can_type *can_x, can_tx_message_type *tx_message_struct)
fill the transmission message and transmit of the specified can peripheral. More...
can_transmit_status_type | can_transmit_status_get (can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
check the transmission state of the specified can peripheral. More...
void | can_transmit_cancel (can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
cancel a transmit request of the specified can peripheral. More...
void | can_message_receive (can_type *can_x, can_rx_fifo_num_type fifo_number, can_rx_message_type *rx_message_struct)
receive message of the specified can peripheral. More...
void | can_receive_fifo_release (can_type *can_x, can_rx_fifo_num_type fifo_number)
release the specified fifo of the specified can peripheral. More...
uint8_t | can_receive_message_pending_get (can_type *can_x, can_rx_fifo_num_type fifo_number)
return the number of pending messages of the specified can peripheral. More...
error_status | can_operating_mode_set (can_type *can_x, can_operating_mode_type can_operating_mode)
set the operation mode of the specified can peripheral. More...
can_enter_doze_status_type | can_doze_mode_enter (can_type *can_x)
enter the low power mode of the specified can peripheral. More...
can_quit_doze_status_type | can_doze_mode_exit (can_type *can_x)
exit the doze mode of the specified can peripheral. More...
can_error_record_type | can_error_type_record_get (can_type *can_x)
return the error type record (etr) of the specified can peripheral. More...
uint8_t | can_receive_error_counter_get (can_type *can_x)
return the receive error counter (rec) of the specified can peripheral. More...
uint8_t | can_transmit_error_counter_get (can_type *can_x)
return the transmit error counter of the specified can peripheral. More...
void | can_interrupt_enable (can_type *can_x, uint32_t can_int, confirm_state new_state)
enable or disable the interrupt of the specified can peripheral. More...
flag_status | can_flag_get (can_type *can_x, uint32_t can_flag)
get flag of the specified can peripheral. More...
void | can_flag_clear (can_type *can_x, uint32_t can_flag)
clear flag of the specified can peripheral. More...

Detailed Description

contains all the functions for the can firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_can.c.


AT32F415 Firmwary Library: at32f415_cmp.c File Reference

  • libraries
  • drivers
  • src
Macros | Functions
at32f415_cmp.c File Reference

contains all the functions for the gpio firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Macros

#define | CMP_CTRLSTS1_CLEAR_MASK ((uint32_t)0x00039C7C)
#define | CMP_INPINPUT_CLEAR_MASK ((uint32_t)0x00000180)
#define | CMP_HIGH_PULSE_CLEAR_MASK ((uint16_t)0x003F)
#define | CMP_LOW_PULSE_CLEAR_MASK ((uint16_t)0x003F)

Functions

void | cmp_reset (void)
reset the cmp register More...
void | cmp_init (cmp_sel_type cmp_sel, cmp_init_type *cmp_init_struct)
initialize the cmp peripheral More...
void | cmp_default_para_init (cmp_init_type *cmp_init_struct)
fill each cmp_init_type member with its default value. More...
void | cmp_enable (cmp_sel_type cmp_sel, confirm_state new_state)
enable or disable cmp More...
void | cmp_input_shift_enable (confirm_state new_state)
enable or disable cmp input shift More...
uint32_t | cmp_output_value_get (cmp_sel_type cmp_sel)
get cmp output value More...
void | cmp_write_protect_enable (cmp_sel_type cmp_sel)
enable cmp write protect More...

Detailed Description

contains all the functions for the gpio firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_cmp.c.


AT32F415 Firmwary Library: at32f415_crc.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_crc.c File Reference

contains all the functions for the crc firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | crc_data_reset (void)
reset the crc data register. More...
uint32_t | crc_one_word_calculate (uint32_t data)
compute the 32-bit crc of a given data word(32-bit). More...
uint32_t | crc_block_calculate (uint32_t *pbuffer, uint32_t length)
compute the 32-bit crc of a given buffer of data word(32-bit). More...
uint32_t | crc_data_get (void)
return the current crc value. More...
void | crc_common_data_set (uint8_t cdt_value)
store a 8-bit data in the common data register. More...
uint8_t | crc_common_date_get (void)
return the 8-bit data stored in the common data register More...
void | crc_init_data_set (uint32_t value)
set the 32-bit initial data of crc More...
void | crc_reverse_input_data_set (crc_reverse_input_type value)
control the reversal of the bit order in the input data More...
void | crc_reverse_output_data_set (crc_reverse_output_type value)
control the reversal of the bit order in the output data More...

Detailed Description

contains all the functions for the crc firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_crc.c.


AT32F415 Firmwary Library: at32f415_crm.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_crm.c File Reference

contains all the functions for the crm firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | crm_reset (void)
reset the crm register More...
void | crm_lext_bypass (confirm_state new_state)
enable or disable crm low speed external crystal bypass More...
void | crm_hext_bypass (confirm_state new_state)
enable or disable crm high speed external crystal bypass More...
flag_status | crm_flag_get (uint32_t flag)
get crm flag status More...
error_status | crm_hext_stable_wait (void)
wait for hext stable More...
void | crm_hick_clock_trimming_set (uint8_t trim_value)
set the hick trimming value More...
void | crm_hick_clock_calibration_set (uint8_t cali_value)
set the crm calibration value More...
void | crm_periph_clock_enable (crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock More...
void | crm_periph_reset (crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset More...
void | crm_periph_sleep_mode_clock_enable (crm_periph_clock_sleepmd_type value, confirm_state new_state)
enable or disable the peripheral clock in sleep mode More...
void | crm_clock_source_enable (crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source More...
void | crm_flag_clear (uint32_t flag)
clear the crm reset flags More...
void | crm_ertc_clock_select (crm_ertc_clock_type value)
select ertc clock More...
void | crm_ertc_clock_enable (confirm_state new_state)
enable or disable ertc More...
void | crm_ahb_div_set (crm_ahb_div_type value)
set crm ahb division More...
void | crm_apb1_div_set (crm_apb1_div_type value)
set crm apb1 division More...
void | crm_apb2_div_set (crm_apb2_div_type value)
set crm apb2 division More...
void | crm_adc_clock_div_set (crm_adc_div_type div_value)
set crm adc division More...
void | crm_usb_clock_div_set (crm_usb_div_type div_value)
set crm usb division More...
void | crm_clock_failure_detection_enable (confirm_state new_state)
enable or disable clock failure detection More...
void | crm_battery_powered_domain_reset (confirm_state new_state)
battery powered domain software reset More...
void | crm_pll_config (crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll More...
void | crm_pll_config2 (crm_pll_clock_source_type clock_source, uint16_t pll_ns, uint16_t pll_ms, crm_pll_fr_type pll_fr)
config crm pll function2, another method. pll_rcs_freq * pll_ns pll clock = -----------------------------— pll_ms * pll_fr_n attemtion: 31 <= pll_ns <= 500 1 <= pll_ms <= 15 More...
void | crm_sysclk_switch (crm_sclk_type value)
select system clock source More...
crm_sclk_type | crm_sysclk_switch_status_get (void)
indicate which clock source is used as system clock More...
void | crm_clocks_freq_get (crm_clocks_freq_type *clocks_struct)
get crm clocks freqency More...
void | crm_clock_out_set (crm_clkout_select_type clkout)
set crm clkout More...
void | crm_interrupt_enable (uint32_t crm_int, confirm_state new_state)
config crm interrupt More...
void | crm_auto_step_mode_enable (confirm_state new_state)
auto step clock switch enable More...
void | crm_hick_divider_select (crm_hick_div_6_type value)
config hick divider select More...
void | crm_hick_sclk_frequency_select (crm_hick_sclk_frequency_type value)
hick as system clock frequency select More...
void | crm_usb_clock_source_select (crm_usb_clock_source_type value)
usb 48 mhz clock source select More...
void | crm_clkout_div_set (crm_clkout_div_type clkout_div)
set crm clkout division More...
void | crm_otgfs_ep3_remap_enable (confirm_state new_state)
enable or disable otgfs end-point3 remap, only available in at32f415xx revision C. at32f415xx revision B: (not support) do not support configuration ep3 remap. More...
void | crm_usbdiv_reset (confirm_state new_state)
usb divider reset, only available in at32f415xx revision C. at32f415xx revision B: (not support) usb divider(CRM_CFG[usbdiv]) do not support to be reset. More...

Detailed Description

contains all the functions for the crm firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_crm.c.


AT32F415 Firmwary Library: at32f415_debug.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_debug.c File Reference

contains all the functions for the debug firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

uint32_t | debug_device_id_get (void)
get debug device id More...
void | debug_periph_mode_set (uint32_t periph_debug_mode, confirm_state new_state)
set periph debug mode
More...

Detailed Description

contains all the functions for the debug firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_debug.c.


AT32F415 Firmwary Library: at32f415_dma.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_dma.c File Reference

contains all the functions for the dma firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | dma_reset (dma_channel_type *dmax_channely)
reset the dmax channely registers. More...
void | dma_data_number_set (dma_channel_type *dmax_channely, uint16_t data_number)
set the number of data to be transferred More...
uint16_t | dma_data_number_get (dma_channel_type *dmax_channely)
get number of data from dtcnt register More...
void | dma_interrupt_enable (dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt More...
void | dma_channel_enable (dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely More...
void | dma_flexible_config (dma_type *dma_x, uint8_t flex_channelx, dma_flexible_request_type flexible_request)
initialize the dma_x flexible function according to the specified parameters. More...
flag_status | dma_flag_get (uint32_t dmax_flag)
get dma flag More...
void | dma_flag_clear (uint32_t dmax_flag)
clear dma flag
More...
void | dma_default_para_init (dma_init_type *dma_init_struct)
dma init config with its default value. More...
void | dma_init (dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init More...

Detailed Description

contains all the functions for the dma firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_dma.c.


AT32F415 Firmwary Library: at32f415_ertc.c File Reference

  • libraries
  • drivers
  • src
Macros | Functions
at32f415_ertc.c File Reference

contains all the functions for the ertc firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Macros

#define ERTC_TIMEOUT ((uint32_t) 0x00360000)

Functions

uint8_t | ertc_num_to_bcd (uint8_t num)
number conversion to bcd code. More...
uint8_t | ertc_bcd_to_num (uint8_t bcd)
bcd code conversion to number. More...
void | ertc_write_protect_enable (void)
enable write protection. More...
void | ertc_write_protect_disable (void)
disable write protection. More...
error_status | ertc_wait_update (void)
ertc wait register update finish. More...
error_status | ertc_wait_flag (uint32_t flag, flag_status status)
ertc wait flag status. More...
error_status | ertc_init_mode_enter (void)
ertc enter init mode. More...
void | ertc_init_mode_exit (void)
ertc exit init mode. More...
error_status | ertc_reset (void)
ertc reset all register. More...
error_status | ertc_divider_set (uint16_t div_a, uint16_t div_b)
ertc division set. More...
error_status | ertc_hour_mode_set (ertc_hour_mode_set_type mode)
ertc hour mode set. More...
error_status | ertc_date_set (uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date. More...
error_status | ertc_time_set (uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time. More...
void | ertc_calendar_get (ertc_time_type *time)
get calendar More...
uint32_t | ertc_sub_second_get (void)
get current sub second. More...
void | ertc_alarm_mask_set (ertc_alarm_type alarm_x, uint32_t mask)
set which bits are irrelevant to the alarm match. More...
void | ertc_alarm_week_date_select (ertc_alarm_type alarm_x, ertc_week_date_select_type wk)
alarm week or date mode select. More...
void | ertc_alarm_set (ertc_alarm_type alarm_x, uint8_t week_date, uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set alarm. More...
void | ertc_alarm_sub_second_set (ertc_alarm_type alarm_x, uint32_t value, ertc_alarm_sbs_mask_type mask)
set alarm sub second. More...
error_status | ertc_alarm_enable (ertc_alarm_type alarm_x, confirm_state new_state)
enable or disable alarm clock. More...
void | ertc_alarm_get (ertc_alarm_type alarm_x, ertc_alarm_value_type *alarm)
get alarm value. More...
uint32_t | ertc_alarm_sub_second_get (ertc_alarm_type alarm_x)
get alarm sub second. More...
void | ertc_wakeup_clock_set (ertc_wakeup_clock_type clock)
set wakeup timer clock. More...
void | ertc_wakeup_counter_set (uint32_t counter)
set wakeup counter. More...
uint16_t | ertc_wakeup_counter_get (void)
get wakeup counter. More...
error_status | ertc_wakeup_enable (confirm_state new_state)
enable or disable wakeup timer. More...
error_status | ertc_smooth_calibration_config (ertc_smooth_cal_period_type period, ertc_smooth_cal_clk_add_type clk_add, uint32_t clk_dec)
config the smooth calibration. More...
error_status | ertc_coarse_calibration_set (ertc_cal_direction_type dir, uint32_t value)
set the coarse digital calibration. More...
error_status | ertc_coarse_calibration_enable (confirm_state new_state)
enable or disable coarse calibration. More...
void | ertc_cal_output_select (ertc_cal_output_select_type output)
calibration output source select. More...
void | ertc_cal_output_enable (confirm_state new_state)
enable or disable calibration output. More...
error_status | ertc_time_adjust (ertc_time_adjust_type add1s, uint32_t decsbs)
adjust the time. More...
void | ertc_daylight_set (ertc_dst_operation_type operation, ertc_dst_save_type save)
config the daylight saving time. More...
uint8_t | ertc_daylight_bpr_get (void)
get the bpr value. More...
error_status | ertc_refer_clock_detect_enable (confirm_state new_state)
enable or disable refer clock detect. More...
void | ertc_direct_read_enable (confirm_state new_state)
enable or disable direct read mode. More...
void | ertc_output_set (ertc_output_source_type source, ertc_output_polarity_type polarity, ertc_output_type type)
set the output mode. More...
void | ertc_timestamp_valid_edge_set (ertc_timestamp_valid_edge_type edge)
set the timestamp valid edge. More...
void | ertc_timestamp_enable (confirm_state new_state)
enable or disable timestamp. More...
void | ertc_timestamp_get (ertc_time_type *time)
get the timestamp. More...
uint32_t | ertc_timestamp_sub_second_get (void)
get the timestamp sub second. More...
void | ertc_tamper_pull_up_enable (confirm_state new_state)
enable or disable tamper pin pull up. More...
void | ertc_tamper_precharge_set (ertc_tamper_precharge_type precharge)
set the tamper pin pre-charge time. More...
void | ertc_tamper_filter_set (ertc_tamper_filter_type filter)
set the tamper filter time. More...
void | ertc_tamper_detect_freq_set (ertc_tamper_detect_freq_type freq)
set the tamper detection frequency. More...
void | ertc_tamper_valid_edge_set (ertc_tamper_select_type tamper_x, ertc_tamper_valid_edge_type trigger)
set the tamper trigger. More...
void | ertc_tamper_timestamp_enable (confirm_state new_state)
enable or disable trigger timestamp when tamper event occurs. More...
void | ertc_tamper_enable (ertc_tamper_select_type tamper_x, confirm_state new_state)
enable or disable tamper. More...
void | ertc_interrupt_enable (uint32_t source, confirm_state new_state)
enable or disable interrupt. More...
flag_status | ertc_interrupt_get (uint32_t source)
get interrupt status More...
flag_status | ertc_flag_get (uint32_t flag)
get flag status. More...
void | ertc_flag_clear (uint32_t flag)
clear flag status More...
void | ertc_bpr_data_write (ertc_dt_type dt, uint32_t data)
write data to the bpr register. More...
uint32_t | ertc_bpr_data_read (ertc_dt_type dt)
read data from bpr register. More...

Detailed Description

contains all the functions for the ertc firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_ertc.c.


AT32F415 Firmwary Library: at32f415_exint.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_exint.c File Reference

contains all the functions for the exint firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | exint_reset (void)
exint reset More...
void | exint_default_para_init (exint_init_type *exint_struct)
exint default para init More...
void | exint_init (exint_init_type *exint_struct)
exint init More...
void | exint_flag_clear (uint32_t exint_line)
clear exint flag More...
flag_status | exint_flag_get (uint32_t exint_line)
get exint flag More...
void | exint_software_interrupt_event_generate (uint32_t exint_line)
generate exint software interrupt event More...
void | exint_interrupt_enable (uint32_t exint_line, confirm_state new_state)
enable or disable exint interrupt More...
void | exint_event_enable (uint32_t exint_line, confirm_state new_state)
enable or disable exint event More...

Detailed Description

contains all the functions for the exint firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_exint.c.


AT32F415 Firmwary Library: at32f415_flash.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_flash.c File Reference

contains all the functions for the flash firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

flag_status | flash_flag_get (uint32_t flash_flag)
check whether the specified flash flag is set or not. More...
void | flash_flag_clear (uint32_t flash_flag)
clear the flash flag. More...
flash_status_type | flash_operation_status_get (void)
return the flash operation status. More...
flash_status_type | flash_operation_wait_for (uint32_t time_out)
wait for flash operation complete or timeout. More...
void | flash_unlock (void)
unlock the flash controller. More...
void | flash_lock (void)
lock the flash controller. More...
flash_status_type | flash_sector_erase (uint32_t sector_address)
erase a specified flash sector. More...
flash_status_type | flash_internal_all_erase (void)
erase flash all internal sectors. More...
flash_status_type | flash_user_system_data_erase (void)
erase the flash user system data. More...
flash_status_type | flash_word_program (uint32_t address, uint32_t data)
program a word at a specified address. More...
flash_status_type | flash_halfword_program (uint32_t address, uint16_t data)
program a halfword at a specified address. More...
flash_status_type | flash_byte_program (uint32_t address, uint8_t data)
program a byte at a specified address. More...
flash_status_type | flash_user_system_data_program (uint32_t address, uint8_t data)
program a halfword at a specified user system data address. More...
flash_status_type | flash_epp_set (uint32_t *sector_bits)
config erase/program protection for the desired sectors. More...
void | flash_epp_status_get (uint32_t *sector_bits)
return the flash erase/program protection status. More...
flash_status_type | flash_fap_enable (confirm_state new_state)
enable or disable the flash access protection. More...
flag_status | flash_fap_status_get (void)
check the flash access protection status. More...
flash_status_type | flash_fap_high_level_enable (confirm_state new_state)
enable or disable the flash access protection high level. More...
flag_status | flash_fap_high_level_status_get (void)
check the flash access protection high level status. More...
flash_status_type | flash_ssb_set (uint8_t usd_ssb)
program the flash system setting byte in usd: wdt_ato_en / depslp_rst / stdby_rst . More...
uint8_t | flash_ssb_status_get (void)
return the flash system setting byte status. More...
void | flash_interrupt_enable (uint32_t flash_int, confirm_state new_state)
enable or disable the specified flash interrupts. More...
flash_status_type | flash_slib_enable (uint32_t pwd, uint16_t start_sector, uint16_t data_start_sector, uint16_t end_sector)
enable main block security library function. More...
error_status | flash_slib_disable (uint32_t pwd)
disable main block slib when slib enabled. More...
flag_status | flash_slib_state_get (void)
get the main block slib state. More...
uint16_t | flash_slib_start_sector_get (void)
get the main block start sector of slib. More...
uint16_t | flash_slib_datastart_sector_get (void)
get the main block data start sector of slib. More...
uint16_t | flash_slib_end_sector_get (void)
get the main block end sector of slib. More...
uint32_t | flash_crc_calibrate (uint32_t start_addr, uint32_t sector_cnt)
flash crc calibration. More...
void | flash_boot_memory_extension_mode_enable (void)
enable boot memory as extension mode. More...
flash_status_type | flash_extension_memory_slib_enable (uint32_t pwd, uint16_t data_start_sector)
enable extension memory security library function. More...
flag_status | flash_extension_memory_slib_state_get (void)
get the extension memory slib state. More...
uint16_t | flash_em_slib_datastart_sector_get (void)
get the extension memory data start sector of slib. More...

Detailed Description

contains all the functions for the flash firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_flash.c.


AT32F415 Firmwary Library: at32f415_gpio.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_gpio.c File Reference

contains all the functions for the gpio firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | gpio_reset (gpio_type *gpio_x)
reset the gpio register More...
void | gpio_iomux_reset (void)
reset the mux functions (remap, event control and exint configuration) registers to their default values. More...
void | gpio_init (gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral. More...
void | gpio_default_para_init (gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value. More...
flag_status | gpio_input_data_bit_read (gpio_type *gpio_x, uint16_t pins)
read the specified input port pin. More...
uint16_t | gpio_input_data_read (gpio_type *gpio_x)
read the specified gpio input data port. More...
flag_status | gpio_output_data_bit_read (gpio_type *gpio_x, uint16_t pins)
read the specified output port pin. More...
uint16_t | gpio_output_data_read (gpio_type *gpio_x)
read the specified gpio ouput data port. More...
void | gpio_bits_set (gpio_type *gpio_x, uint16_t pins)
set the selected data port bits. More...
void | gpio_bits_reset (gpio_type *gpio_x, uint16_t pins)
clear the selected data port bits. More...
void | gpio_bits_write (gpio_type *gpio_x, uint16_t pins, confirm_state bit_state)
set or clear the selected data port bit. More...
void | gpio_port_wirte (gpio_type *gpio_x, uint16_t port_value)
write data to the specified gpio data port. More...
void | gpio_pin_wp_config (gpio_type *gpio_x, uint16_t pins)
write protect gpio pins configuration registers. More...
void | gpio_event_output_config (gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as event output. More...
void | gpio_event_output_enable (confirm_state new_state)
enable or disable the event output. More...
void | gpio_pin_remap_config (uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration. More...
void | gpio_exint_line_config (gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line. More...

Detailed Description

contains all the functions for the gpio firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_gpio.c.


AT32F415 Firmwary Library: at32f415_i2c.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_i2c.c File Reference

contains all the functions for the i2c firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | i2c_reset (i2c_type *i2c_x)
reset the i2c register More...
void | i2c_software_reset (i2c_type *i2c_x, confirm_state new_state)
software reset. More...
void | i2c_init (i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed)
init i2c speed and duty cycle. More...
void | i2c_own_address1_set (i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address)
config own address1. More...
void | i2c_own_address2_set (i2c_type *i2c_x, uint8_t address)
config own address2. More...
void | i2c_own_address2_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable own address2. More...
void | i2c_smbus_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable the smbus mode More...
void | i2c_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable i2c periph More...
void | i2c_fast_mode_duty_set (i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty)
config fast mode duty cycle More...
void | i2c_clock_stretch_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable clock stretch. More...
void | i2c_ack_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable acknowledge. More...
void | i2c_master_receive_ack_set (i2c_type *i2c_x, i2c_master_ack_type pos)
master receiving mode acknowledge control. More...
void | i2c_pec_position_set (i2c_type *i2c_x, i2c_pec_position_type pos)
pec position set. More...
void | i2c_general_call_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable general call. More...
void | i2c_arp_mode_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable arp mode. More...
void | i2c_smbus_mode_set (i2c_type *i2c_x, i2c_smbus_mode_set_type mode)
config smbus host or device. More...
void | i2c_smbus_alert_set (i2c_type *i2c_x, i2c_smbus_alert_set_type level)
drive the smbus alert pin high or low. More...
void | i2c_pec_transmit_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable pec transfer. More...
void | i2c_pec_calculate_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable pec calcultetion. More...
uint8_t | i2c_pec_value_get (i2c_type *i2c_x)
get pec value. More...
void | i2c_dma_end_transfer_set (i2c_type *i2c_x, confirm_state new_state)
enable or disable if the next dma transfer will be the last one. More...
void | i2c_dma_enable (i2c_type *i2c_x, confirm_state new_state)
enable or disable dma requests. More...
void | i2c_interrupt_enable (i2c_type *i2c_x, uint16_t source, confirm_state new_state)
enable or disable interrupt More...
void | i2c_start_generate (i2c_type *i2c_x)
generate start condition. More...
void | i2c_stop_generate (i2c_type *i2c_x)
generate stop condition. More...
void | i2c_7bit_address_send (i2c_type *i2c_x, uint8_t address, i2c_direction_type direction)
transmit the slave address. More...
void | i2c_data_send (i2c_type *i2c_x, uint8_t data)
send a byte through the i2c periph. More...
uint8_t | i2c_data_receive (i2c_type *i2c_x)
receive a byte through the i2c periph. More...
flag_status | i2c_flag_get (i2c_type *i2c_x, uint32_t flag)
get flag status More...
void | i2c_flag_clear (i2c_type *i2c_x, uint32_t flag)
clear flag status More...

Detailed Description

contains all the functions for the i2c firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_i2c.c.


AT32F415 Firmwary Library: at32f415_misc.c File Reference

  • libraries
  • drivers
  • src
Macros | Functions
at32f415_misc.c File Reference

contains all the functions for the misc firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Macros

#define AIRCR_VECTKEY_MASK ((uint32_t)0x05FA0000)

Functions

void | nvic_system_reset (void)
system reset More...
void | nvic_irq_enable (uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq More...
void | nvic_irq_disable (uint32_t irqn)
disable nvic irq number More...
void | nvic_priority_group_config (nvic_priority_group_type priority_group)
config nvic priority group More...
void | nvic_vector_table_set (uint32_t base, uint32_t offset)
set the vector table location and offset. More...
void | nvic_lowpower_mode_config (nvic_lowpower_mode_type lp_mode, confirm_state new_state)
config nvic lowpower mode More...
void | systick_clock_source_config (systick_clock_source_type source)
config systick clock source More...

Detailed Description

contains all the functions for the misc firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_misc.c.


AT32F415 Firmwary Library: at32f415_pwc.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_pwc.c File Reference

contains all the functions for the pwc firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | pwc_reset (void)
deinitialize the pwc peripheral registers to their default reset values. More...
void | pwc_battery_powered_domain_access (confirm_state new_state)
enable or disable access to the battery powered domain. More...
void | pwc_pvm_level_select (pwc_pvm_voltage_type pvm_voltage)
select the voltage threshold detected by the power voltage detector. More...
void | pwc_power_voltage_monitor_enable (confirm_state new_state)
enable or disable pwc power voltage monitor (pvm)
More...
void | pwc_wakeup_pin_enable (uint32_t pin_num, confirm_state new_state)
enable or disable pwc standby wakeup pin
More...
void | pwc_flag_clear (uint32_t pwc_flag)
clear flag of pwc More...
flag_status | pwc_flag_get (uint32_t pwc_flag)
get flag of pwc More...
void | pwc_sleep_mode_enter (pwc_sleep_enter_type pwc_sleep_enter)
enter pwc sleep mode
More...
void | pwc_deep_sleep_mode_enter (pwc_deep_sleep_enter_type pwc_deep_sleep_enter)
enter pwc deep-sleep mode
More...
void | pwc_voltage_regulate_set (pwc_regulator_type pwc_regulator)
regulate low power consumption in the deep sleep mode More...
void | pwc_standby_mode_enter (void)
enter pwc standby mode
More...

Detailed Description

contains all the functions for the pwc firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_pwc.c.


AT32F415 Firmwary Library: at32f415_sdio.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_sdio.c File Reference

contains all the functions for the sdio firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | sdio_reset (sdio_type *sdio_x)
reset the sdio register More...
void | sdio_power_set (sdio_type *sdio_x, sdio_power_state_type power_state)
set the power status of the controller More...
flag_status | sdio_power_status_get (sdio_type *sdio_x)
get power status. More...
void | sdio_clock_config (sdio_type *sdio_x, uint16_t clk_div, sdio_edge_phase_type clk_edg)
config sdio clock More...
void | sdio_bus_width_config (sdio_type *sdio_x, sdio_bus_width_type width)
config sdio bus width More...
void | sdio_clock_bypass (sdio_type *sdio_x, confirm_state new_state)
enable or disable clock divider bypss More...
void | sdio_power_saving_mode_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable power saving mode, config sdio_ck clock output when the bus is idle. More...
void | sdio_flow_control_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable hardware flow control. More...
void | sdio_clock_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable sdio_ck output. More...
void | sdio_dma_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable dma. More...
void | sdio_interrupt_enable (sdio_type *sdio_x, uint32_t int_opt, confirm_state new_state)
config corresponding interrupt. More...
flag_status | sdio_flag_get (sdio_type *sdio_x, uint32_t flag)
get sdio flag. More...
void | sdio_flag_clear (sdio_type *sdio_x, uint32_t flag)
clear sdio flag. More...
void | sdio_command_config (sdio_type *sdio_x, sdio_command_struct_type *command_struct)
config sdio command. More...
void | sdio_command_state_machine_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable command path state machine(CPSM). More...
uint8_t | sdio_command_response_get (sdio_type *sdio_x)
get command index of last command for which response received. More...
uint32_t | sdio_response_get (sdio_type *sdio_x, sdio_rsp_index_type reg_index)
get response received from the card for the last command. More...
void | sdio_data_config (sdio_type *sdio_x, sdio_data_struct_type *data_struct)
config sdio data. More...
void | sdio_data_state_machine_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable data path state machine(DPSM). More...
uint32_t | sdio_data_counter_get (sdio_type *sdio_x)
get the number of remaining data bytes to be transferred. More...
uint32_t | sdio_data_read (sdio_type *sdio_x)
read a word data from sdio fifo. More...
uint32_t | sdio_buffer_counter_get (sdio_type *sdio_x)
get the number of words left to be written to or read from fifo.. More...
void | sdio_data_write (sdio_type *sdio_x, uint32_t data)
write one word data to fifo. More...
void | sdio_read_wait_mode_set (sdio_type *sdio_x, sdio_read_wait_mode_type mode)
set the read wait mode. More...
void | sdio_read_wait_start (sdio_type *sdio_x, confirm_state new_state)
enable or disable to start sd i/o read wait operation. More...
void | sdio_read_wait_stop (sdio_type *sdio_x, confirm_state new_state)
enable or disable to stop sd i/o read wait operation. More...
void | sdio_io_function_enable (sdio_type *sdio_x, confirm_state new_state)
enable or disable the sd i/o function. More...
void | sdio_io_suspend_command_set (sdio_type *sdio_x, confirm_state new_state)
enable or disable sd i/o suspend command sending. More...

Detailed Description

contains all the functions for the sdio firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_sdio.c.


AT32F415 Firmwary Library: at32f415_spi.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_spi.c File Reference

contains all the functions for the spi firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | spi_i2s_reset (spi_type *spi_x)
spi reset by crm reset register More...
void | spi_default_para_init (spi_init_type *spi_init_struct)
spi init config with its default value. More...
void | spi_init (spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value. More...
void | spi_crc_next_transmit (spi_type *spi_x)
spi next transmit crc for the spi peripheral. More...
void | spi_crc_polynomial_set (spi_type *spi_x, uint16_t crc_poly)
set the crc polynomial value for the spi peripheral. More...
uint16_t | spi_crc_polynomial_get (spi_type *spi_x)
return the crc polynomial register value for the spi peripheral. More...
void | spi_crc_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the hardware crc calculation for the spi peripheral. More...
uint16_t | spi_crc_value_get (spi_type *spi_x, spi_crc_direction_type crc_direction)
return the transmit or the receive crc value for the spi peripheral. More...
void | spi_hardware_cs_output_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the hardware cs output for the spi peripheral. More...
void | spi_software_cs_internal_level_set (spi_type *spi_x, spi_software_cs_level_type level)
set the software cs internal level for the spi peripheral. More...
void | spi_frame_bit_num_set (spi_type *spi_x, spi_frame_bit_num_type bit_num)
set the data frame bit num for the spi peripheral. More...
void | spi_half_duplex_direction_set (spi_type *spi_x, spi_half_duplex_direction_type direction)
set the data transmission direction in single line bidirectiona half duplex mode of the spi peripheral. More...
void | spi_enable (spi_type *spi_x, confirm_state new_state)
enable or disable spi. More...
void | i2s_default_para_init (i2s_init_type *i2s_init_struct)
i2s init config with its default value. More...
void | i2s_init (spi_type *spi_x, i2s_init_type *i2s_init_struct)
i2s init config with its setting value. More...
void | i2s_enable (spi_type *spi_x, confirm_state new_state)
enable or disable i2s. More...
void | spi_i2s_interrupt_enable (spi_type *spi_x, uint32_t spi_i2s_int, confirm_state new_state)
enable or disable the specified spi/i2s interrupts. More...
void | spi_i2s_dma_transmitter_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma transmitter mode. More...
void | spi_i2s_dma_receiver_enable (spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma receiver mode. More...
void | spi_i2s_data_transmit (spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit More...
uint16_t | spi_i2s_data_receive (spi_type *spi_x)
spi/i2s data receive More...
flag_status | spi_i2s_flag_get (spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral. More...
void | spi_i2s_flag_clear (spi_type *spi_x, uint32_t spi_i2s_flag)
clear flag of the specified spi/i2s peripheral. More...

Detailed Description

contains all the functions for the spi firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_spi.c.


AT32F415 Firmwary Library: at32f415_tmr.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_tmr.c File Reference

contains all the functions for the tmr firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | tmr_reset (tmr_type *tmr_x)
tmr reset by crm reset register More...
void | tmr_counter_enable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter More...
void | tmr_output_default_para_init (tmr_output_config_type *tmr_output_struct)
init tmr output default para More...
void | tmr_input_default_para_init (tmr_input_config_type *tmr_input_struct)
init tmr input default para More...
void | tmr_brkdt_default_para_init (tmr_brkdt_config_type *tmr_brkdt_struct)
init tmr brkdt default para More...
void | tmr_base_init (tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base More...
void | tmr_clock_source_div_set (tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division More...
void | tmr_cnt_dir_set (tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction More...
void | tmr_repetition_counter_set (tmr_type *tmr_x, uint8_t tmr_rpr_value)
set the repetition counter register(rpr) value More...
void | tmr_counter_value_set (tmr_type *tmr_x, uint32_t tmr_cnt_value)
set tmr counter value More...
uint32_t | tmr_counter_value_get (tmr_type *tmr_x)
get tmr counter value More...
void | tmr_div_value_set (tmr_type *tmr_x, uint32_t tmr_div_value)
set tmr div value More...
uint32_t | tmr_div_value_get (tmr_type *tmr_x)
get tmr div value More...
void | tmr_output_channel_config (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel More...
void | tmr_output_channel_mode_select (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_control_mode_type oc_mode)
select tmr output channel mode More...
void | tmr_period_value_set (tmr_type *tmr_x, uint32_t tmr_pr_value)
set tmr period value More...
uint32_t | tmr_period_value_get (tmr_type *tmr_x)
get tmr period value More...
void | tmr_channel_value_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value More...
uint32_t | tmr_channel_value_get (tmr_type *tmr_x, tmr_channel_select_type tmr_channel)
get tmr channel value More...
void | tmr_period_buffer_enable (tmr_type *tmr_x, confirm_state new_state)
enable tmr period buffer More...
void | tmr_output_channel_buffer_enable (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
enable tmr output channel buffer More...
void | tmr_output_channel_immediately_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
set tmr output channel immediately More...
void | tmr_output_channel_switch_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
set tmr output channel switch More...
void | tmr_one_cycle_mode_enable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr one cycle mode More...
void | tmr_32_bit_function_enable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr 32 bit function(plus mode) More...
void | tmr_overflow_request_source_set (tmr_type *tmr_x, confirm_state new_state)
select tmr the overflow event sources More...
void | tmr_overflow_event_disable (tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr overflow event generation More...
void | tmr_input_channel_init (tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
init tmr input channel More...
void | tmr_channel_enable (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
tmr channel enable More...
void | tmr_input_channel_filter_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint16_t filter_value)
set tmr input channel filter More...
void | tmr_pwm_input_config (tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
config tmr pwm input More...
void | tmr_channel1_input_select (tmr_type *tmr_x, tmr_channel1_input_connected_type ti1_connect)
select tmr channel1 input More...
void | tmr_input_channel_divider_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_channel_input_divider_type divider_factor)
set tmr input channel divider More...
void | tmr_primary_mode_select (tmr_type *tmr_x, tmr_primary_select_type primary_mode)
select tmr primary mode More...
void | tmr_sub_mode_select (tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode More...
void | tmr_channel_dma_select (tmr_type *tmr_x, tmr_dma_request_source_type cc_dma_select)
select tmr channel dma More...
void | tmr_hall_select (tmr_type *tmr_x, confirm_state new_state)
select tmr hall More...
void | tmr_channel_buffer_enable (tmr_type *tmr_x, confirm_state new_state)
enable tmr channel buffer More...
void | tmr_trigger_input_select (tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger More...
void | tmr_sub_sync_mode_set (tmr_type *tmr_x, confirm_state new_state)
set tmr subordinate synchronization mode More...
void | tmr_dma_request_enable (tmr_type *tmr_x, tmr_dma_request_type dma_request, confirm_state new_state)
enable or disable tmr dma request More...
void | tmr_interrupt_enable (tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt More...
flag_status | tmr_flag_get (tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag More...
void | tmr_flag_clear (tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag More...
void | tmr_event_sw_trigger (tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event More...
void | tmr_output_enable (tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable More...
void | tmr_internal_clock_set (tmr_type *tmr_x)
set tmr select internal clock More...
void | tmr_output_channel_polarity_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_polarity_active_type oc_polarity)
set tmr output channel polarity More...
void | tmr_external_clock_config (tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock More...
void | tmr_external_clock_mode1_config (tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock mode1 More...
void | tmr_external_clock_mode2_config (tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock mode2 More...
void | tmr_encoder_mode_config (tmr_type *tmr_x, tmr_encoder_mode_type encoder_mode, tmr_input_polarity_type ic1_polarity, tmr_input_polarity_type ic2_polarity)
config tmr encoder mode More...
void | tmr_force_output_set (tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_force_output_type force_output)
set tmr force output More...
void | tmr_dma_control_config (tmr_type *tmr_x, tmr_dma_transfer_length_type dma_length, tmr_dma_address_type dma_base_address)
config tmr dma control More...
void | tmr_brkdt_config (tmr_type *tmr_x, tmr_brkdt_config_type *brkdt_struct)
config tmr break mode and dead-time More...

Detailed Description

contains all the functions for the tmr firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_tmr.c.


AT32F415 Firmwary Library: at32f415_usart.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_usart.c File Reference

contains all the functions for the usart firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | usart_reset (usart_type *usart_x)
deinitialize the usart peripheral registers to their default reset values. More...
void | usart_init (usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters. More...
void | usart_parity_selection_config (usart_type *usart_x, usart_parity_selection_type parity)
usart parity selection config. More...
void | usart_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral. More...
void | usart_transmitter_enable (usart_type *usart_x, confirm_state new_state)
usart transmitter enable. More...
void | usart_receiver_enable (usart_type *usart_x, confirm_state new_state)
usart receiver enable. More...
void | usart_clock_config (usart_type *usart_x, usart_clock_polarity_type clk_pol, usart_clock_phase_type clk_pha, usart_lbcp_type clk_lb)
usart clock config. More...
void | usart_clock_enable (usart_type *usart_x, confirm_state new_state)
usart enable the ck pin. More...
void | usart_interrupt_enable (usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts. More...
void | usart_dma_transmitter_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma transmitter interface. More...
void | usart_dma_receiver_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma receiver interface. More...
void | usart_wakeup_id_set (usart_type *usart_x, uint8_t usart_id)
set the wakeup id of the usart. More...
void | usart_wakeup_mode_set (usart_type *usart_x, usart_wakeup_mode_type wakeup_mode)
select the usart wakeup method in multi-processor communication. More...
void | usart_receiver_mute_enable (usart_type *usart_x, confirm_state new_state)
config the usart in mute mode in multi-processor communication. More...
void | usart_break_bit_num_set (usart_type *usart_x, usart_break_bit_num_type break_bit)
set the usart break frame bit num. More...
void | usart_lin_mode_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart lin mode. More...
void | usart_data_transmit (usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral. More...
uint16_t | usart_data_receive (usart_type *usart_x)
return the most recent received data by the usart peripheral. More...
void | usart_break_send (usart_type *usart_x)
transmit break characters. More...
void | usart_smartcard_guard_time_set (usart_type *usart_x, uint8_t guard_time_val)
config the specified usart smartcard guard time. More...
void | usart_irda_smartcard_division_set (usart_type *usart_x, uint8_t div_val)
config the irda/smartcard division. More...
void | usart_smartcard_mode_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart smart card mode. More...
void | usart_smartcard_nack_set (usart_type *usart_x, confirm_state new_state)
enable or disable nack transmission in smartcard mode. More...
void | usart_single_line_halfduplex_select (usart_type *usart_x, confirm_state new_state)
enable or disable the usart single line bidirectional half-duplex communication. More...
void | usart_irda_mode_enable (usart_type *usart_x, confirm_state new_state)
enable or disable the usart's irda interface. More...
void | usart_irda_low_power_enable (usart_type *usart_x, confirm_state new_state)
configure the usart's irda low power. More...
void | usart_hardware_flow_control_set (usart_type *usart_x, usart_hardware_flow_control_type flow_state)
configure the usart's hardware flow control. More...
flag_status | usart_flag_get (usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not. More...
void | usart_flag_clear (usart_type *usart_x, uint32_t flag)
clear the usart's pending flags. More...

Detailed Description

contains all the functions for the usart firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_usart.c.


AT32F415 Firmwary Library: at32f415_usb.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_usb.c File Reference

contains all the functions for the usb firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

error_status | usb_global_reset (otg_global_type *usbx)
usb global core soft reset More...
void | usb_global_init (otg_global_type *usbx)
usb global initialization More...
otg_global_type * | usb_global_select_core (uint8_t usb_id)
usb global select usb core (otg1 or otg2). More...
void | usb_flush_tx_fifo (otg_global_type *usbx, uint32_t fifo_num)
flush tx fifo More...
void | usb_flush_rx_fifo (otg_global_type *usbx)
flush rx fifo More...
void | usb_global_interrupt_enable (otg_global_type *usbx, uint16_t interrupt, confirm_state new_state)
usb interrupt mask enable More...
uint32_t | usb_global_get_all_interrupt (otg_global_type *usbx)
get all global core interrupt flag More...
void | usb_global_clear_interrupt (otg_global_type *usbx, uint32_t flag)
clear the global interrupt flag More...
void | usb_interrupt_enable (otg_global_type *usbx)
usb global interrupt enable More...
void | usb_interrupt_disable (otg_global_type *usbx)
usb global interrupt disable More...
void | usb_set_rx_fifo (otg_global_type *usbx, uint16_t size)
usb set rx fifo size More...
void | usb_set_tx_fifo (otg_global_type *usbx, uint8_t txfifo, uint16_t size)
usb set tx fifo size More...
void | usb_global_set_mode (otg_global_type *usbx, uint32_t mode)
set otg mode(device or host mode) More...
void | usb_global_power_on (otg_global_type *usbx)
disable the transceiver power down mode More...
void | usb_stop_phy_clk (otg_global_type *usbx)
usb stop phy clock More...
void | usb_open_phy_clk (otg_global_type *usbx)
usb open phy clock More...
void | usb_write_packet (otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
write data from user memory to usb buffer More...
void | usb_read_packet (otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
read data from usb buffer to user buffer More...
void | usb_ept_open (otg_global_type *usbx, usb_ept_info *ept_info)
open usb endpoint More...
void | usb_ept_close (otg_global_type *usbx, usb_ept_info *ept_info)
close usb endpoint More...
void | usb_ept_stall (otg_global_type *usbx, usb_ept_info *ept_info)
set endpoint tx or rx status to stall More...
void | usb_ept_clear_stall (otg_global_type *usbx, usb_ept_info *ept_info)
clear endpoint tx or rx status to stall More...
uint32_t | usb_get_all_out_interrupt (otg_global_type *usbx)
get all out endpoint interrupt bits More...
uint32_t | usb_get_all_in_interrupt (otg_global_type *usbx)
get all in endpoint interrupt bits More...
uint32_t | usb_ept_out_interrupt (otg_global_type *usbx, uint32_t eptn)
get out endpoint interrupt flag More...
uint32_t | usb_ept_in_interrupt (otg_global_type *usbx, uint32_t eptn)
get in endpoint interrupt flag More...
void | usb_ept_out_clear (otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear out endpoint interrupt flag More...
void | usb_ept_in_clear (otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear in endpoint interrupt flag More...
void | usb_set_address (otg_global_type *usbx, uint8_t address)
set the host assignment address More...
void | usb_ept0_start (otg_global_type *usbx)
enable endpoint 0 out More...
void | usb_ept0_setup (otg_global_type *usbx)
endpoint 0 start setup More...
void | usb_connect (otg_global_type *usbx)
connect usb device by enable pull-up More...
void | usb_disconnect (otg_global_type *usbx)
disconnect usb device by disable pull-up More...
void | usb_remote_wkup_set (otg_global_type *usbx)
usb remote wakeup set More...
void | usb_remote_wkup_clear (otg_global_type *usbx)
usb remote wakeup clear More...
uint8_t | usb_suspend_status_get (otg_global_type *usbx)
usb suspend status get More...
void | usb_port_power_on (otg_global_type *usbx, confirm_state state)
usb port power on More...
uint32_t | usbh_get_frame (otg_global_type *usbx)
get current frame number More...
void | usb_hc_enable (otg_global_type *usbx, uint8_t chn, uint8_t ept_num, uint8_t dev_address, uint8_t type, uint8_t maxpacket, uint8_t speed)
enable one host channel More...
uint32_t | usb_hch_read_interrupt (otg_global_type *usbx)
host read channel interrupt More...
void | usb_host_disable (otg_global_type *usbx)
disable host More...
void | usb_hch_halt (otg_global_type *usbx, uint8_t chn)
halt channel More...
void | usbh_fsls_clksel (otg_global_type *usbx, uint8_t clk)
select full or low speed clock More...

Detailed Description

contains all the functions for the usb firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_usb.c.


AT32F415 Firmwary Library: at32f415_wdt.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_wdt.c File Reference

contains all the functions for the wdt firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | wdt_enable (void)
wdt enable ,the reload value will be sent to the counter More...
void | wdt_counter_reload (void)
reload wdt counter More...
void | wdt_reload_value_set (uint16_t reload_value)
set wdt counter reload value More...
void | wdt_divider_set (wdt_division_type division)
set wdt division divider
More...
void | wdt_register_write_enable (confirm_state new_state)
enable or disable wdt cmd register write More...
flag_status | wdt_flag_get (uint16_t wdt_flag)
get wdt flag More...

Detailed Description

contains all the functions for the wdt firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_wdt.c.


AT32F415 Firmwary Library: at32f415_wwdt.c File Reference

  • libraries
  • drivers
  • src
Functions
at32f415_wwdt.c File Reference

contains all the functions for the wwdt firmware library More...

#include "at32f415_conf.h"

Go to the source code of this file.

Functions

void | wwdt_reset (void)
wwdt reset by crm reset register More...
void | wwdt_divider_set (wwdt_division_type division)
wwdt division set More...
void | wwdt_flag_clear (void)
wwdt reload counter interrupt flag clear More...
void | wwdt_enable (uint8_t wwdt_cnt)
wwdt enable and the counter value load More...
void | wwdt_interrupt_enable (void)
wwdt reload counter interrupt enable More...
flag_status | wwdt_flag_get (void)
wwdt reload counter interrupt flag get More...
void | wwdt_counter_set (uint8_t wwdt_cnt)
wwdt counter value set More...
void | wwdt_window_counter_set (uint8_t window_cnt)
wwdt window counter value set More...

Detailed Description

contains all the functions for the wwdt firmware library

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file at32f415_wwdt.c.


AT32F415 Firmwary Library: main_page.h File Reference

  • main_page
main_page.h File Reference

Go to the source code of this file.


AT32F415 Firmwary Library: i2c_application.c File Reference

  • middlewares
  • i2c_application_library
Macros | Functions
i2c_application.c File Reference

the driver library of the i2c peripheral More...

#include "i2c_application.h"

Go to the source code of this file.

Macros

#define | DMA_GET_TC_FLAG(DMA_CHANNEL)
get the dma transfer complete flag through the channel More...
#define | DMA_GET_HT_FLAG(DMA_CHANNEL)
get the dma half transfer flag through the channel More...
#define | DMA_GET_TERR_FLAG(DMA_CHANNEL)
get the dma transfer error flag through the channel More...
#define | I2C_START 0
i2c transmission status More...
#define | I2C_END 1

Functions

void | i2c_config (i2c_handle_type *hi2c)
i2c peripheral initialization. More...
void | i2c_addr_flag_clear (i2c_handle_type *hi2c)
clear the addr flag. More...
void | i2c_stop_flag_clear (i2c_handle_type *hi2c)
clear the stop flag. More...
i2c_status_type | i2c_wait_end (i2c_handle_type *hi2c, uint32_t timeout)
wait for the transfer to end. More...
i2c_status_type | i2c_wait_flag (i2c_handle_type *hi2c, uint32_t flag, flag_status status, uint32_t event_check, uint32_t timeout)
wait for the flag. More...
void | i2c_dma_config (i2c_handle_type *hi2c, dma_channel_type *dma_channelx, uint8_t *pdata, uint16_t size)
dma transfer cofiguration. More...
i2c_status_type | i2c_master_write_addr (i2c_handle_type *hi2c, uint16_t address, uint32_t timeout)
send address in master transmits mode. More...
i2c_status_type | i2c_master_read_addr (i2c_handle_type *hi2c, uint16_t address, uint32_t timeout)
send address in master receive mode. More...
i2c_status_type | i2c_master_transmit (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through polling mode. More...
i2c_status_type | i2c_slave_receive (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through polling mode. More...
i2c_status_type | i2c_master_receive (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through polling mode. More...
i2c_status_type | i2c_slave_transmit (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through polling mode. More...
i2c_status_type | i2c_master_transmit_int (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through interrupt mode. More...
i2c_status_type | i2c_slave_receive_int (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through interrupt mode. More...
i2c_status_type | i2c_master_receive_int (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through interrupt mode. More...
i2c_status_type | i2c_slave_transmit_int (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through interrupt mode. More...
i2c_status_type | i2c_master_transmit_dma (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through dma mode. More...
i2c_status_type | i2c_slave_receive_dma (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through dma mode. More...
i2c_status_type | i2c_master_receive_dma (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through dma mode. More...
i2c_status_type | i2c_slave_transmit_dma (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through dma mode. More...
i2c_status_type | i2c_memory_write (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through polling mode. More...
i2c_status_type | i2c_memory_read (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode. More...
i2c_status_type | i2c_memory_write_int (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through interrupt mode. More...
i2c_status_type | i2c_memory_read_int (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through interrupt mode. More...
i2c_status_type | i2c_memory_write_dma (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through dma mode. More...
i2c_status_type | i2c_memory_read_dma (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode. More...
void | i2c_master_tx_isr_int (i2c_handle_type *hi2c)
master transfer mode interrupt procession function More...
void | i2c_master_rx_isr_int (i2c_handle_type *hi2c)
master receive mode interrupt procession function More...
void | i2c_slave_tx_isr_int (i2c_handle_type *hi2c)
slave transfer mode interrupt procession function More...
void | i2c_slave_rx_isr_int (i2c_handle_type *hi2c)
slave receive mode interrupt procession function More...
void | i2c_evt_irq_handler (i2c_handle_type *hi2c)
interrupt procession function. More...
void | i2c_dma_tx_irq_handler (i2c_handle_type *hi2c)
dma transmission complete interrupt function. More...
void | i2c_dma_rx_irq_handler (i2c_handle_type *hi2c)
dma reveive complete interrupt function. More...
void | i2c_err_irq_handler (i2c_handle_type *hi2c)
i2c error interrupt function. More...

Detailed Description

the driver library of the i2c peripheral

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file i2c_application.c.


AT32F415 Firmwary Library: i2c_application.h File Reference

  • middlewares
  • i2c_application_library
Data Structures | Macros | Enumerations | Functions
i2c_application.h File Reference

i2c application libray header file More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct i2c_handle_type

Macros

#define | I2C_EVENT_CHECK_NONE ((uint32_t)0x00000000)
#define | I2C_EVENT_CHECK_ACKFAIL ((uint32_t)0x00000001)
#define | I2C_EVENT_CHECK_STOP ((uint32_t)0x00000002)

Enumerations

enum i2c_mode_type {
I2C_INT_MA_TX = 0 , I2C_INT_MA_RX , I2C_INT_SLA_TX , I2C_INT_SLA_RX ,
I2C_DMA_MA_TX , I2C_DMA_MA_RX , I2C_DMA_SLA_TX , I2C_DMA_SLA_RX
}
enum i2c_status_type {
I2C_OK = 0 , I2C_ERR_STEP_1 , I2C_ERR_STEP_2 , I2C_ERR_STEP_3 ,
I2C_ERR_STEP_4 , I2C_ERR_STEP_5 , I2C_ERR_STEP_6 , I2C_ERR_STEP_7 ,
I2C_ERR_STEP_8 , I2C_ERR_STEP_9 , I2C_ERR_STEP_10 , I2C_ERR_STEP_11 ,
I2C_ERR_STEP_12 , I2C_ERR_START , I2C_ERR_ADDR10 , I2C_ERR_ADDR ,
I2C_ERR_STOP , I2C_ERR_ACKFAIL , I2C_ERR_TIMEOUT , I2C_ERR_INTERRUPT
}

Functions

void | i2c_config (i2c_handle_type *hi2c)
i2c peripheral initialization. More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
i2c_status_type | i2c_wait_end (i2c_handle_type *hi2c, uint32_t timeout)
wait for the transfer to end. More...
i2c_status_type | i2c_master_transmit (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through polling mode. More...
i2c_status_type | i2c_master_receive (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through polling mode. More...
i2c_status_type | i2c_slave_transmit (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through polling mode. More...
i2c_status_type | i2c_slave_receive (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through polling mode. More...
i2c_status_type | i2c_master_transmit_int (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through interrupt mode. More...
i2c_status_type | i2c_master_receive_int (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through interrupt mode. More...
i2c_status_type | i2c_slave_transmit_int (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through interrupt mode. More...
i2c_status_type | i2c_slave_receive_int (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through interrupt mode. More...
i2c_status_type | i2c_master_transmit_dma (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through dma mode. More...
i2c_status_type | i2c_master_receive_dma (i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through dma mode. More...
i2c_status_type | i2c_slave_transmit_dma (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through dma mode. More...
i2c_status_type | i2c_slave_receive_dma (i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through dma mode. More...
i2c_status_type | i2c_memory_write (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through polling mode. More...
i2c_status_type | i2c_memory_write_int (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through interrupt mode. More...
i2c_status_type | i2c_memory_write_dma (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through dma mode. More...
i2c_status_type | i2c_memory_read (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode. More...
i2c_status_type | i2c_memory_read_int (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through interrupt mode. More...
i2c_status_type | i2c_memory_read_dma (i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode. More...
void | i2c_evt_irq_handler (i2c_handle_type *hi2c)
interrupt procession function. More...
void | i2c_err_irq_handler (i2c_handle_type *hi2c)
i2c error interrupt function. More...
void | i2c_dma_tx_irq_handler (i2c_handle_type *hi2c)
dma transmission complete interrupt function. More...
void | i2c_dma_rx_irq_handler (i2c_handle_type *hi2c)
dma reveive complete interrupt function. More...

Detailed Description

i2c application libray header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file i2c_application.h.


AT32F415 Firmwary Library: usb_core.h File Reference

  • middlewares
  • usb_drivers
  • inc
Data Structures | Enumerations | Functions
usb_core.h File Reference

usb core header file More...

#include "usb_std.h"
#include "usb_conf.h"

Go to the source code of this file.

Data Structures

struct | usb_core_cfg
usb core cofig struct More...
struct | otg_core_type
usb otg core struct type More...

Enumerations

enum usb_speed_type { USB_LOW_SPEED_CORE_ID , USB_FULL_SPEED_CORE_ID , USB_HIGH_SPEED_CORE_ID }
usb core speed select More...

Functions

usb_sts_type usb_core_config (otg_core_type *otgdev, uint8_t core_id)
usb core config More...

Detailed Description

usb core header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usb_core.h.


AT32F415 Firmwary Library: usb_std.h File Reference

  • middlewares
  • usb_drivers
  • inc
Data Structures | Macros | Enumerations
usb_std.h File Reference

usb standard header file More...

#include "usb_conf.h"

Go to the source code of this file.

Data Structures

struct | usb_setup_type
format of usb setup data More...
struct | usb_device_desc_type
format of standard device descriptor More...
struct | usb_configuration_desc_type
format of standard configuration descriptor More...
struct | usb_interface_desc_type
format of standard interface descriptor More...
struct | usb_endpoint_desc_type
format of standard endpoint descriptor More...
struct | usb_header_desc_type
format of header More...

Macros

#define | USB_REQ_RECIPIENT_DEVICE 0x00
usb request recipient More...
#define | USB_REQ_RECIPIENT_INTERFACE 0x01
#define | USB_REQ_RECIPIENT_ENDPOINT 0x02
#define | USB_REQ_RECIPIENT_OTHER 0x03
#define | USB_REQ_RECIPIENT_MASK 0x1F
#define | USB_REQ_TYPE_STANDARD 0x00
usb request type More...
#define | USB_REQ_TYPE_CLASS 0x20
#define | USB_REQ_TYPE_VENDOR 0x40
#define | USB_REQ_TYPE_RESERVED 0x60
#define | USB_REQ_DIR_HTD 0x00
usb request data transfer direction More...
#define | USB_REQ_DIR_DTH 0x80
#define | USB_STD_REQ_GET_STATUS 0
usb standard device requests codes More...
#define | USB_STD_REQ_CLEAR_FEATURE 1
#define | USB_STD_REQ_SET_FEATURE 3
#define | USB_STD_REQ_SET_ADDRESS 5
#define | USB_STD_REQ_GET_DESCRIPTOR 6
#define | USB_STD_REQ_SET_DESCRIPTOR 7
#define | USB_STD_REQ_GET_CONFIGURATION 8
#define | USB_STD_REQ_SET_CONFIGURATION 9
#define | USB_STD_REQ_GET_INTERFACE 10
#define | USB_STD_REQ_SET_INTERFACE 11
#define | USB_STD_REQ_SYNCH_FRAME 12
#define | USB_DESCIPTOR_TYPE_DEVICE 1
usb standard device type More...
#define | USB_DESCIPTOR_TYPE_CONFIGURATION 2
#define | USB_DESCIPTOR_TYPE_STRING 3
#define | USB_DESCIPTOR_TYPE_INTERFACE 4
#define | USB_DESCIPTOR_TYPE_ENDPOINT 5
#define | USB_DESCIPTOR_TYPE_DEVICE_QUALIFIER 6
#define | USB_DESCIPTOR_TYPE_OTHER_SPEED 7
#define | USB_DESCIPTOR_TYPE_INTERFACE_POWER 8
#define | USB_LANGID_STRING 0
usb standard string type More...
#define | USB_MFC_STRING 1
#define | USB_PRODUCT_STRING 2
#define | USB_SERIAL_STRING 3
#define | USB_CONFIG_STRING 4
#define | USB_INTERFACE_STRING 5
#define | USB_CONF_REMOTE_WAKEUP 2
usb configuration attributes More...
#define | USB_CONF_SELF_POWERED 1
#define | USB_FEATURE_EPT_HALT 0
usb standard feature selectors More...
#define | USB_FEATURE_REMOTE_WAKEUP 1
#define | USB_FEATURE_TEST_MODE 2
#define | USB_EPT0_IDLE 0
endpoint 0 state More...
#define | USB_EPT0_SETUP 1
#define | USB_EPT0_DATA_IN 2
#define | USB_EPT0_DATA_OUT 3
#define | USB_EPT0_STATUS_IN 4
#define | USB_EPT0_STATUS_OUT 5
#define | USB_EPT0_STALL 6
#define | USB_DEVICE_QUALIFIER_DESC_LEN 0x0A
usb descriptor length More...
#define | USB_DEVICE_DESC_LEN 0x12
#define | USB_DEVICE_CFG_DESC_LEN 0x09
#define | USB_DEVICE_IF_DESC_LEN 0x09
#define | USB_DEVICE_EPT_LEN 0x07
#define | USB_DEVICE_OTG_DESC_LEN 0x03
#define | USB_DEVICE_LANGID_STR_DESC_LEN 0x04
#define | USB_DEVICE_OTHER_SPEED_DESC_SIZ_LEN 0x09
#define | USB_CLASS_CODE_AUDIO 0x01
usb class code More...
#define | USB_CLASS_CODE_CDC 0x02
#define | USB_CLASS_CODE_HID 0x03
#define | USB_CLASS_CODE_PRINTER 0x07
#define | USB_CLASS_CODE_MSC 0x08
#define | USB_CLASS_CODE_HUB 0x09
#define | USB_CLASS_CODE_CDCDATA 0x0A
#define | USB_CLASS_CODE_CCID 0x0B
#define | USB_CLASS_CODE_VIDEO 0x0E
#define | USB_CLASS_CODE_VENDOR 0xFF
#define | USB_EPT_DESC_CONTROL 0x00
usb endpoint type More...
#define | USB_EPT_DESC_ISO 0x01
#define | USB_EPT_DESC_BULK 0x02
#define | USB_EPT_DESC_INTERRUPT 0x03
#define | USB_EPT_DESC_NSYNC 0x00
#define | USB_ETP_DESC_ASYNC 0x04
#define | USB_ETP_DESC_ADAPTIVE 0x08
#define | USB_ETP_DESC_SYNC 0x0C
#define | USB_EPT_DESC_DATA_EPT 0x00
#define | USB_EPT_DESC_FD_EPT 0x10
#define | USB_EPT_DESC_FDDATA_EPT 0x20
#define | USB_MAX_EP0_SIZE 64
endpoint 0 max size More...
#define | SWAPBYTE(addr)
usb swap address More...
#define | MIN(a, b) (uint16_t)(((a) < (b)) ? (a) : (b))
min and max define More...
#define | MAX(a, b) (uint16_t)(((a) > (b)) ? (a) : (b))
#define | LBYTE(x) ((uint8_t)(x & 0x00FF))
low byte and high byte define More...
#define | HBYTE(x) ((uint8_t)((x & 0xFF00) >>8))

Enumerations

enum usbd_conn_state { USB_CONN_STATE_DEFAULT =1 , USB_CONN_STATE_ADDRESSED , USB_CONN_STATE_CONFIGURED , USB_CONN_STATE_SUSPENDED }
usb device connect state More...
enum usb_sts_type {
USB_OK , USB_FAIL , USB_WAIT , USB_NOT_SUPPORT ,
USB_ERROR
}
usb return status More...

Detailed Description

usb standard header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usb_std.h.


AT32F415 Firmwary Library: usbd_core.h File Reference

  • middlewares
  • usb_drivers
  • inc
usbd_core.h File Reference

usb device core header file More...

#include "usb_conf.h"
#include "usb_std.h"

Go to the source code of this file.

Detailed Description

usb device core header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbd_core.h.


AT32F415 Firmwary Library: usbd_int.h File Reference

  • middlewares
  • usb_drivers
  • inc
Functions
usbd_int.h File Reference

usb interrupt header file More...

#include "usbd_core.h"
#include "usb_core.h"

Go to the source code of this file.

Functions

void | usbd_irq_handler (otg_core_type *udev)
usb device interrput request handler. More...
void | usbd_ept_handler (usbd_core_type *udev)
void | usbd_reset_handler (usbd_core_type *udev)
usb device reset interrupt request handler. More...
void | usbd_sof_handler (usbd_core_type *udev)
usb device sof interrupt request handler. More...
void | usbd_suspend_handler (usbd_core_type *udev)
usb device suspend interrupt request handler. More...
void | usbd_wakeup_handler (usbd_core_type *udev)
usb device wakup interrupt request handler. More...
void | usbd_inept_handler (usbd_core_type *udev)
usb in endpoint handler More...
void | usbd_outept_handler (usbd_core_type *udev)
usb out endpoint handler More...
void | usbd_enumdone_handler (usbd_core_type *udev)
usb enumeration done handler More...
void | usbd_rxflvl_handler (usbd_core_type *udev)
usb rx non-empty handler More...
void | usbd_incomisioin_handler (usbd_core_type *udev)
usb incomplete in handler More...
void | usbd_discon_handler (usbd_core_type *udev)
usb disconnect handler More...
void | usbd_incomisoout_handler (usbd_core_type *udev)
usb incomplete out handler More...
void | usb_write_empty_txfifo (usbd_core_type *udev, uint32_t ept_num)
usb write tx fifo. More...

Detailed Description

usb interrupt header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbd_int.h.


AT32F415 Firmwary Library: usbd_sdr.h File Reference

  • middlewares
  • usb_drivers
  • inc
Functions
usbd_sdr.h File Reference
#include "usb_conf.h"
#include "usb_core.h"

Go to the source code of this file.

Functions

void | usbd_setup_request_parse (usb_setup_type *setup, uint8_t *buf)
usb parse standard setup request More...
usb_sts_type | usbd_device_request (usbd_core_type *udev)
standard usb device requests More...
usb_sts_type | usbd_interface_request (usbd_core_type *udev)
standard usb interface requests More...
usb_sts_type | usbd_endpoint_request (usbd_core_type *udev)
standard usb endpoint requests More...


AT32F415 Firmwary Library: usbh_core.h File Reference

  • middlewares
  • usb_drivers
  • inc
usbh_core.h File Reference

usb host core header file More...

#include "usb_conf.h"
#include "usb_std.h"

Go to the source code of this file.

Detailed Description

usb host core header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_core.h.


AT32F415 Firmwary Library: usbh_ctrl.h File Reference

  • middlewares
  • usb_drivers
  • inc
Functions
usbh_ctrl.h File Reference

usb header file More...

#include "usb_conf.h"
#include "usbh_core.h"

Go to the source code of this file.

Functions

usb_sts_type | usbh_ctrl_send_setup (usbh_core_type *uhost, uint8_t *buffer, uint8_t hc_num)
usb host control send setup packet More...
usb_sts_type | usbh_ctrl_recv_data (usbh_core_type *uhost, uint8_t *buffer, uint8_t length, uint16_t hc_num)
usb host control receive data from device More...
usb_sts_type | usbh_ctrl_send_data (usbh_core_type *uhost, uint8_t *buffer, uint8_t length, uint16_t hc_num)
usb host control send data packet More...
usb_sts_type | usbh_ctrl_setup_handler (usbh_core_type *uhost)
usb host control setup request handler More...
usb_sts_type | usbh_ctrl_setup_wait_handler (usbh_core_type *uhost, uint32_t *timeout)
usb host control setup request wait handler More...
usb_sts_type | usbh_ctrl_data_in_handler (usbh_core_type *uhost)
usb host control data in request handler More...
usb_sts_type | usbh_ctrl_data_in_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control data in wait handler More...
usb_sts_type | usbh_ctrl_data_out_handler (usbh_core_type *uhost)
usb host control data out request handler More...
usb_sts_type | usbh_ctrl_data_out_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control data out wait handler More...
usb_sts_type | usbh_ctrl_status_in_handler (usbh_core_type *uhost)
usb host control status data in handler More...
usb_sts_type | usbh_ctrl_status_in_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control status data in wait handler More...
usb_sts_type | usbh_ctrl_status_out_handler (usbh_core_type *uhost)
usb host control status data out wait handler More...
usb_sts_type | usbh_ctrl_status_out_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control status data out wait handler More...
usb_sts_type | usbh_ctrl_error_handler (usbh_core_type *uhost)
usb host control error handler More...
usb_sts_type | usbh_ctrl_stall_handler (usbh_core_type *uhost)
usb host control stall handler More...
usb_sts_type | usbh_ctrl_complete_handler (usbh_core_type *uhost)
usb host control complete handler More...
usb_sts_type | usbh_ctrl_transfer_loop (usbh_core_type *uhost)
usb host control transfer loop function More...
usb_sts_type | usbh_ctrl_request (usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host control request More...
usb_sts_type | usbh_get_descriptor (usbh_core_type *uhost, uint16_t length, uint8_t req_type, uint16_t wvalue, uint8_t *buffer)
usb host get device descriptor More...
void | usbh_parse_dev_desc (usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse device descriptor More...
usb_header_desc_type * | usbh_get_next_header (uint8_t *buf, uint16_t *index_len)
usb host get next header More...
void | usbh_parse_interface_desc (usb_interface_desc_type *intf, uint8_t *buf)
usb host parse interface descriptor More...
void | usbh_parse_endpoint_desc (usb_endpoint_desc_type *ept_desc, uint8_t *buf)
usb host parse endpoint descriptor More...
usb_sts_type | usbh_parse_configure_desc (usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse configure descriptor More...
uint8_t | usbh_find_interface (usbh_core_type *uhost, uint8_t class_code, uint8_t sub_class, uint8_t protocol)
usb host find interface More...
void | usbh_parse_string_desc (uint8_t *src, uint8_t *dest, uint16_t length)
usbh parse string descriptor More...
usb_sts_type | usbh_get_device_descriptor (usbh_core_type *uhost, uint16_t length)
usb host get device descriptor More...
usb_sts_type | usbh_get_configure_descriptor (usbh_core_type *uhost, uint16_t length)
usb host get configure descriptor More...
usb_sts_type | usbh_get_sting_descriptor (usbh_core_type *uhost, uint8_t string_id, uint8_t *buffer, uint16_t length)
usb host get string descriptor More...
usb_sts_type | usbh_set_configuration (usbh_core_type *uhost, uint16_t config)
usb host set configurtion More...
usb_sts_type | usbh_set_address (usbh_core_type *uhost, uint8_t address)
usb host set device address More...
usb_sts_type | usbh_set_interface (usbh_core_type *uhost, uint8_t ept_num, uint8_t altsetting)
usb host set interface More...
usb_sts_type | usbh_set_feature (usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host set feature More...
usb_sts_type | usbh_clear_dev_feature (usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host clear device feature More...
usb_sts_type | usbh_clear_ept_feature (usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num)
usb host clear endpoint feature More...

Detailed Description

usb header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_ctrl.h.


AT32F415 Firmwary Library: usbh_int.h File Reference

  • middlewares
  • usb_drivers
  • inc
Functions
usbh_int.h File Reference

usb header file More...

#include "usbh_core.h"
#include "usb_core.h"

Go to the source code of this file.

Functions

void | usbh_irq_handler (otg_core_type *hdev)
usb host interrupt handler More...
void | usbh_hch_handler (usbh_core_type *uhost)
usb host channel request handler More...
void | usbh_port_handler (usbh_core_type *uhost)
usb host port request handler More...
void | usbh_disconnect_handler (usbh_core_type *uhost)
usb host disconnect handler More...
void | usbh_hch_in_handler (usbh_core_type *uhost, uint8_t chn)
usb host in transfer request handler More...
void | usbh_hch_out_handler (usbh_core_type *uhost, uint8_t chn)
usb host out transfer request handler More...
void | usbh_rx_qlvl_handler (usbh_core_type *uhost)
usb host rx buffer not empty request handler More...
void | usbh_wakeup_handler (usbh_core_type *uhost)
usb host wakeup handler More...
void | usbh_sof_handler (usbh_core_type *uhost)
usb host sof handler More...

Detailed Description

usb header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_int.h.


AT32F415 Firmwary Library: usb_core.c File Reference

  • middlewares
  • usb_drivers
  • src
Functions
usb_core.c File Reference

usb driver More...

#include "usb_core.h"

Go to the source code of this file.

Functions

usb_sts_type usb_core_config (otg_core_type *otgdev, uint8_t core_id)
usb core config More...

Detailed Description

usb driver

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usb_core.c.


AT32F415 Firmwary Library: usbd_core.c File Reference

  • middlewares
  • usb_drivers
  • src
Functions
usbd_core.c File Reference

usb device driver More...

#include "usb_core.h"
#include "usbd_core.h"
#include "usbd_sdr.h"

Go to the source code of this file.

Functions

void | usbd_core_in_handler (usbd_core_type *udev, uint8_t ept_addr)
usb core in transfer complete handler More...
void | usbd_core_out_handler (usbd_core_type *udev, uint8_t ept_addr)
usb core out transfer complete handler More...
void | usbd_core_setup_handler (usbd_core_type *udev, uint8_t ept_num)
usb core setup transfer complete handler More...
void | usbd_ctrl_send (usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data More...
void | usbd_ctrl_recv (usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint recv data More...
void | usbd_ctrl_send_status (usbd_core_type *udev)
usb control endpoint send in status More...
void | usbd_ctrl_recv_status (usbd_core_type *udev)
usb control endpoint send out status More...
void | usbd_clear_stall (usbd_core_type *udev, uint8_t ept_addr)
clear endpoint stall More...
void | usbd_set_stall (usbd_core_type *udev, uint8_t ept_addr)
usb set endpoint to stall status More...
void | usbd_ctrl_unsupport (usbd_core_type *udev)
un-support device request More...
uint32_t | usbd_get_recv_len (usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length More...
void | usbd_ept_open (usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint More...
void | usbd_ept_close (usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint More...
void | usbd_connect (usbd_core_type *udev)
usb device connect to host More...
void | usbd_disconnect (usbd_core_type *udev)
usb device disconnect to host More...
void | usbd_set_device_addr (usbd_core_type *udev, uint8_t address)
usb device set device address. More...
void | usb_ept_default_init (usbd_core_type *udev)
usb endpoint structure initialization More...
void | usbd_ept_send (usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data More...
void | usbd_ept_recv (usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint receive data More...
usbd_conn_state | usbd_connect_state_get (usbd_core_type *udev)
get usb connect state More...
void | usbd_remote_wakeup (usbd_core_type *udev)
usb device remote wakeup More...
void | usbd_enter_suspend (usbd_core_type *udev)
usb device enter suspend mode More...
void | usbd_flush_tx_fifo (usbd_core_type *udev, uint8_t ept_num)
usb device flush in endpoint fifo More...
void | usbd_fifo_alloc (usbd_core_type *udev)
usb device endpoint fifo alloc More...
usb_sts_type | usbd_core_init (usbd_core_type *udev, usb_reg_type *usb_reg, usbd_class_handler *class_handler, usbd_desc_handler *desc_handler, uint8_t core_id)
usb device core initialization More...

Detailed Description

usb device driver

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbd_core.c.


AT32F415 Firmwary Library: usbd_int.c File Reference

  • middlewares
  • usb_drivers
  • src
Functions
usbd_int.c File Reference

usb interrupt request More...

#include "usbd_int.h"

Go to the source code of this file.

Functions

void | usbd_irq_handler (otg_core_type *otgdev)
usb device interrput request handler. More...
void | usb_write_empty_txfifo (usbd_core_type *udev, uint32_t ept_num)
usb write tx fifo. More...
void | usbd_inept_handler (usbd_core_type *udev)
usb in endpoint handler More...
void | usbd_outept_handler (usbd_core_type *udev)
usb out endpoint handler More...
void | usbd_enumdone_handler (usbd_core_type *udev)
usb enumeration done handler More...
void | usbd_rxflvl_handler (usbd_core_type *udev)
usb rx non-empty handler More...
void | usbd_discon_handler (usbd_core_type *udev)
usb disconnect handler More...
void | usbd_incomisoout_handler (usbd_core_type *udev)
usb incomplete out handler More...
void | usbd_incomisioin_handler (usbd_core_type *udev)
usb incomplete in handler More...
void | usbd_reset_handler (usbd_core_type *udev)
usb device reset interrupt request handler. More...
void | usbd_sof_handler (usbd_core_type *udev)
usb device sof interrupt request handler. More...
void | usbd_suspend_handler (usbd_core_type *udev)
usb device suspend interrupt request handler. More...
void | usbd_wakeup_handler (usbd_core_type *udev)
usb device wakup interrupt request handler. More...

Detailed Description

usb interrupt request

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbd_int.c.


AT32F415 Firmwary Library: usbd_sdr.c File Reference

  • middlewares
  • usb_drivers
  • src
Functions
usbd_sdr.c File Reference

usb standard device request More...

#include "usbd_sdr.h"

Go to the source code of this file.

Functions

static usb_sts_type | usbd_get_descriptor (usbd_core_type *udev)
get usb standard device description request More...
static usb_sts_type | usbd_set_address (usbd_core_type *udev)
this request sets the device address More...
static usb_sts_type | usbd_get_status (usbd_core_type *udev)
get usb status request More...
static usb_sts_type | usbd_clear_feature (usbd_core_type *udev)
clear usb feature request More...
static usb_sts_type | usbd_set_feature (usbd_core_type *udev)
set usb feature request More...
static usb_sts_type | usbd_get_configuration (usbd_core_type *udev)
get usb configuration request More...
static usb_sts_type | usbd_set_configuration (usbd_core_type *udev)
sets the usb device configuration request More...
void | usbd_setup_request_parse (usb_setup_type *setup, uint8_t *buf)
usb parse standard setup request More...
usb_sts_type | usbd_device_request (usbd_core_type *udev)
standard usb device requests More...
usb_sts_type | usbd_interface_request (usbd_core_type *udev)
standard usb interface requests More...
usb_sts_type | usbd_endpoint_request (usbd_core_type *udev)
standard usb endpoint requests More...

Detailed Description

usb standard device request

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbd_sdr.c.


AT32F415 Firmwary Library: usbh_core.c File Reference

  • middlewares
  • usb_drivers
  • src
Functions
usbh_core.c File Reference

usb host driver More...

#include "usbh_core.h"
#include "usb_core.h"
#include "usbh_ctrl.h"
#include "usb_conf.h"

Go to the source code of this file.

Functions

static void | usbh_attached (usbh_core_type *uhost)
usb host attached More...
static void | usbh_enumeration (usbh_core_type *uhost)
usb host enumeration More...
static void | usbh_class_request (usbh_core_type *uhost)
usb host class request More...
static void | usbh_class (usbh_core_type *uhost)
usb host class handler More...
static void | usbh_suspend (usbh_core_type *uhost)
usb host suspend More...
static void | usbh_wakeup (usbh_core_type *uhost)
usb host wakeup More...
static void | usbh_disconnect (usbh_core_type *uhost)
usb host disconnect More...
void | usbh_free_channel (usbh_core_type *uhost, uint8_t index)
usb host free channel More...
uint16_t | usbh_get_free_channel (usbh_core_type *uhost)
get usb host free channel More...
usb_sts_type | usbh_set_toggle (usbh_core_type *uhost, uint8_t hc_num, uint8_t toggle)
usb host set toggle More...
usb_sts_type | usbh_in_out_request (usbh_core_type *uhost, uint8_t hc_num)
usb host in out request More...
usb_sts_type | usbh_interrupt_recv (usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host interrupt receive request More...
usb_sts_type | usbh_interrupt_send (usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host interrupt send request More...
usb_sts_type | usbh_bulk_recv (usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host bulk receive request More...
usb_sts_type | usbh_bulk_send (usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host bulk send request More...
usb_sts_type | usbh_isoc_send (usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host iso send request More...
usb_sts_type | usbh_isoc_recv (usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host iso receive request More...
usb_sts_type | usbh_cfg_default_init (usbh_core_type *uhost)
usb host cfg default init More...
void | usbh_enter_suspend (usbh_core_type *uhost)
usb host enter suspend More...
void | usbh_resume (usbh_core_type *uhost)
usb host resume More...
usb_sts_type | usbh_core_init (usbh_core_type *uhost, usb_reg_type *usb_reg, usbh_class_handler_type *class_handler, usbh_user_handler_type *user_handler, uint8_t core_id)
usb host core initialize More...
void | usbh_hc_open (usbh_core_type *uhost, uint8_t chn, uint8_t ept_num, uint8_t dev_address, uint8_t type, uint8_t maxpacket, uint8_t speed)
usb host open channel More...
void | usbh_ch_disable (usbh_core_type *uhost, uint8_t chn)
disable host channel More...
uint16_t | usbh_alloc_channel (usbh_core_type *uhost, uint8_t ept_addr)
usb host alloc channel More...
urb_sts_type | usbh_get_urb_status (usbh_core_type *uhost, uint8_t ch_num)
usb host get urb status More...
usb_sts_type | usbh_ctrl_result_check (usbh_core_type *uhost, ctrl_ept0_sts_type next_ctrl_state, uint8_t next_enum_state)
usb wait control setup complete More...
uint8_t | usbh_alloc_address (void)
auto alloc address (1...127) More...
usb_sts_type | usbh_enum_handler (usbh_core_type *uhost)
usb host enumeration handler More...
void | usbh_active_vbus (usbh_core_type *uhost, confirm_state state)
active vbus. More...
void | usbh_reset_port (usbh_core_type *uhost)
reset usb port More...
usb_sts_type | usbh_loop_handler (usbh_core_type *uhost)
usb host enum loop handler More...

Detailed Description

usb host driver

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_core.c.


AT32F415 Firmwary Library: usbh_ctrl.c File Reference

  • middlewares
  • usb_drivers
  • src
Functions
usbh_ctrl.c File Reference

usb host control request More...

#include "usbh_ctrl.h"
#include "usbh_core.h"
#include "usb_std.h"

Go to the source code of this file.

Functions

usb_sts_type | usbh_ctrl_send_setup (usbh_core_type *uhost, uint8_t *buffer, uint8_t hc_num)
usb host control send setup packet More...
usb_sts_type | usbh_ctrl_recv_data (usbh_core_type *uhost, uint8_t *buffer, uint8_t length, uint16_t hc_num)
usb host control receive data from device More...
usb_sts_type | usbh_ctrl_send_data (usbh_core_type *uhost, uint8_t *buffer, uint8_t length, uint16_t hc_num)
usb host control send data packet More...
usb_sts_type | usbh_ctrl_setup_handler (usbh_core_type *uhost)
usb host control setup request handler More...
usb_sts_type | usbh_ctrl_setup_wait_handler (usbh_core_type *uhost, uint32_t *timeout)
usb host control setup request wait handler More...
usb_sts_type | usbh_ctrl_data_in_handler (usbh_core_type *uhost)
usb host control data in request handler More...
usb_sts_type | usbh_ctrl_data_in_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control data in wait handler More...
usb_sts_type | usbh_ctrl_data_out_handler (usbh_core_type *uhost)
usb host control data out request handler More...
usb_sts_type | usbh_ctrl_data_out_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control data out wait handler More...
usb_sts_type | usbh_ctrl_status_in_handler (usbh_core_type *uhost)
usb host control status data in handler More...
usb_sts_type | usbh_ctrl_status_in_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control status data in wait handler More...
usb_sts_type | usbh_ctrl_status_out_handler (usbh_core_type *uhost)
usb host control status data out wait handler More...
usb_sts_type | usbh_ctrl_status_out_wait_handler (usbh_core_type *uhost, uint32_t timeout)
usb host control status data out wait handler More...
usb_sts_type | usbh_ctrl_error_handler (usbh_core_type *uhost)
usb host control error handler More...
usb_sts_type | usbh_ctrl_stall_handler (usbh_core_type *uhost)
usb host control stall handler More...
usb_sts_type | usbh_ctrl_complete_handler (usbh_core_type *uhost)
usb host control complete handler More...
usb_sts_type | usbh_ctrl_transfer_loop (usbh_core_type *uhost)
usb host control transfer loop function More...
usb_sts_type | usbh_ctrl_request (usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host control request More...
usb_sts_type | usbh_get_descriptor (usbh_core_type *uhost, uint16_t length, uint8_t req_type, uint16_t wvalue, uint8_t *buffer)
usb host get device descriptor More...
void | usbh_parse_dev_desc (usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse device descriptor More...
usb_header_desc_type * | usbh_get_next_header (uint8_t *buf, uint16_t *index_len)
usb host get next header More...
void | usbh_parse_interface_desc (usb_interface_desc_type *intf, uint8_t *buf)
usb host parse interface descriptor More...
void | usbh_parse_endpoint_desc (usb_endpoint_desc_type *ept_desc, uint8_t *buf)
usb host parse endpoint descriptor More...
usb_sts_type | usbh_parse_configure_desc (usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse configure descriptor More...
uint8_t | usbh_find_interface (usbh_core_type *uhost, uint8_t class_code, uint8_t sub_class, uint8_t protocol)
usb host find interface More...
void | usbh_parse_string_desc (uint8_t *src, uint8_t *dest, uint16_t length)
usbh parse string descriptor More...
usb_sts_type | usbh_get_device_descriptor (usbh_core_type *uhost, uint16_t length)
usb host get device descriptor More...
usb_sts_type | usbh_get_configure_descriptor (usbh_core_type *uhost, uint16_t length)
usb host get configure descriptor More...
usb_sts_type | usbh_get_sting_descriptor (usbh_core_type *uhost, uint8_t string_id, uint8_t *buffer, uint16_t length)
usb host get string descriptor More...
usb_sts_type | usbh_set_configuration (usbh_core_type *uhost, uint16_t config)
usb host set configurtion More...
usb_sts_type | usbh_set_address (usbh_core_type *uhost, uint8_t address)
usb host set device address More...
usb_sts_type | usbh_set_interface (usbh_core_type *uhost, uint8_t ept_num, uint8_t altsetting)
usb host set interface More...
usb_sts_type | usbh_set_feature (usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host set feature More...
usb_sts_type | usbh_clear_dev_feature (usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host clear device feature More...
usb_sts_type | usbh_clear_ept_feature (usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num)
usb host clear endpoint feature More...

Detailed Description

usb host control request

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_ctrl.c.


AT32F415 Firmwary Library: usbh_int.c File Reference

  • middlewares
  • usb_drivers
  • src
Functions
usbh_int.c File Reference

usb host interrupt request More...

#include "usbh_int.h"

Go to the source code of this file.

Functions

void | usbh_irq_handler (otg_core_type *otgdev)
usb host interrupt handler More...
void | usbh_wakeup_handler (usbh_core_type *uhost)
usb host wakeup handler More...
void | usbh_sof_handler (usbh_core_type *uhost)
usb host sof handler More...
void | usbh_disconnect_handler (usbh_core_type *uhost)
usb host disconnect handler More...
void | usbh_hch_in_handler (usbh_core_type *uhost, uint8_t chn)
usb host in transfer request handler More...
void | usbh_hch_out_handler (usbh_core_type *uhost, uint8_t chn)
usb host out transfer request handler More...
void | usbh_hch_handler (usbh_core_type *uhost)
usb host channel request handler More...
void | usbh_rx_qlvl_handler (usbh_core_type *uhost)
usb host rx buffer not empty request handler More...
void | usbh_port_handler (usbh_core_type *uhost)
usb host port request handler More...

Detailed Description

usb host interrupt request

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_int.c.


AT32F415 Firmwary Library: audio_class.c File Reference

  • middlewares
  • usbd_class
  • audio
Functions | Variables
audio_class.c File Reference

usb audio class type More...

#include "usbd_core.h"
#include "audio_class.h"
#include "audio_desc.h"
#include "audio_codec.h"

Go to the source code of this file.

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb custom hid endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device event handler More...
void | audio_inisoincom_event (void *udev)
usb audio in iso incom event More...
void | audio_req_get_cur (void *udev, usb_setup_type *setup)
usb audio request get cur More...
void | audio_req_set_cur (void *udev, usb_setup_type *setup)
usb audio request set cur More...
void | audio_req_get_min (void *udev, usb_setup_type *setup)
usb audio request get min More...
void | audio_req_get_max (void *udev, usb_setup_type *setup)
usb audio request get max More...
void | audio_req_get_res (void *udev, usb_setup_type *setup)
usb audio request get res More...
void | audio_get_interface (void *udev, usb_setup_type *setup)
usb audio get interface More...
void | audio_set_interface (void *udev, usb_setup_type *setup)
usb audio set interface More...

Variables

usb_audio_type | audio_struct = {0, 0, 0, 0, 0, 0x1400, 0, 0, 0, {0x0000, 0x1400, 0x33}, {0x0000, 0x1400, 0x33}}
static __IO uint16_t | audio_feedback_state = 0
static __IO uint8_t | audio_spk_out_stage = 0
usbd_class_handler | audio_class_handler

Detailed Description

usb audio class type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file audio_class.c.


AT32F415 Firmwary Library: audio_class.h File Reference

  • middlewares
  • usbd_class
  • audio
Data Structures | Macros | Variables
audio_class.h File Reference

usb audio class file More...

#include "usb_std.h"
#include "usbd_core.h"
#include "audio_conf.h"

Go to the source code of this file.

Data Structures

struct usb_audio_type
usb audio control struct More...

Macros

#define | USBD_AUDIO_MIC_IN_EPT 0x81
endpoint define More...
#define | USBD_AUDIO_SPK_OUT_EPT 0x02
#define | USBD_AUDIO_FEEDBACK_EPT 0x83
#define | AUDIO_REMAIN_SIZE 40
endpoint support max size More...
#define | AUDIO_MIC_IN_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_MIC_CHANEL_NUM * (AUDIO_MIC_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)
#define | AUDIO_SPK_OUT_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_SPK_CHANEL_NUM * (AUDIO_SPK_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)
#define | AUDIO_FEEDBACK_MAXPACKET_SIZE 0x3
#define | FEEDBACK_REFRESH_TIME 0x8
#define | AUDIO_REQ_CONTROL_INTERFACE 0x01
request type define More...
#define | AUDIO_REQ_CONTROL_ENDPOINT 0x02
#define | AUDIO_REQ_CONTROL_MASK 0x03
#define | AUDIO_MUTE_CONTROL 0x01
audio set cur type define More...
#define | AUDIO_VOLUME_CONTROL 0x02
#define | AUDIO_FREQ_SET_CONTROL 0x03
#define | AUDIO_DESCRIPTOR_TYPE 0x21
audio descriptor type More...
#define | AUDIO_DESCRIPTOR_SIZE 0x09

Variables

usbd_class_handler audio_class_handler

Detailed Description

usb audio class file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file audio_class.h.


AT32F415 Firmwary Library: audio_conf.h File Reference

  • middlewares
  • usbd_class
  • audio
Macros
audio/audio_conf.h File Reference

usb audio config More...

Go to the source code of this file.

Macros

#define | AUDIO_SUPPORT_SPK 1
#define | AUDIO_SUPPORT_MIC 1
#define | AUDIO_SUPPORT_FEEDBACK 1
#define | AUDIO_SUPPORT_FREQ_16K 1
#define | AUDIO_SUPPORT_FREQ_48K 1
#define | AUDIO_SUPPORT_FREQ
#define | AUDIO_FREQ_16K 16000
#define | AUDIO_FREQ_48K 48000
#define | AUDIO_BITW_16 16
#define | AUDIO_MIC_CHANEL_NUM 2
#define | AUDIO_MIC_DEFAULT_BITW AUDIO_BITW_16
#define | AUDIO_SPK_CHANEL_NUM 2
#define | AUDIO_SPK_DEFAULT_BITW AUDIO_BITW_16
#define | AUDIO_SUPPORT_MAX_FREQ 48
#define | AUDIO_DEFAULT_FREQ AUDIO_FREQ_48K
#define | AUDIO_DEFAULT_BITW AUDIO_BITW_16

Detailed Description

usb audio config

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file audio/audio_conf.h.


AT32F415 Firmwary Library: audio_conf.h File Reference

  • middlewares
  • usbd_class
  • audio_hid
Macros
audio_hid/audio_conf.h File Reference

usb audio config More...

Go to the source code of this file.

Macros

#define | AUDIO_SUPPORT_SPK 1
#define | AUDIO_SUPPORT_MIC 1
#define | AUDIO_SUPPORT_FEEDBACK 1
#define | AUDIO_SUPPORT_FREQ_16K 0
#define | AUDIO_SUPPORT_FREQ_48K 1
#define | AUDIO_SUPPORT_FREQ
#define | AUDIO_FREQ_16K 16000
#define | AUDIO_FREQ_48K 48000
#define | AUDIO_BITW_16 16
#define | AUDIO_MIC_CHANEL_NUM 2
#define | AUDIO_MIC_DEFAULT_BITW AUDIO_BITW_16
#define | AUDIO_SPK_CHANEL_NUM 2
#define | AUDIO_SPK_DEFAULT_BITW AUDIO_BITW_16
#define | AUDIO_SUPPORT_MAX_FREQ 48
#define | AUDIO_DEFAULT_FREQ AUDIO_FREQ_48K
#define | AUDIO_DEFAULT_BITW AUDIO_BITW_16

Detailed Description

usb audio config

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file audio_hid/audio_conf.h.


AT32F415 Firmwary Library: audio_desc.c File Reference

  • middlewares
  • usbd_class
  • audio
Functions | Variables
audio_desc.c File Reference

usb audio device descriptor More...

#include "usb_std.h"
#include "usbd_sdr.h"
#include "usbd_core.h"
#include "audio_desc.h"

Go to the source code of this file.

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | audio_desc_handler
device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

usb audio device descriptor

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file audio_desc.c.


AT32F415 Firmwary Library: audio_desc.h File Reference

  • middlewares
  • usbd_class
  • audio
Macros | Variables
audio_desc.h File Reference

usb audio descriptor header file More...

#include "audio_class.h"
#include "usbd_core.h"
#include "audio_conf.h"

Go to the source code of this file.

Macros

#define | BCD_NUM 0x0100
#define | USBD_VENDOR_ID 0x2E3C
#define | USBD_PRODUCT_ID 0x5730
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
#define | USBD_DESC_PRODUCT_STRING "AT32 Audio"
#define | USBD_DESC_CONFIGURATION_STRING "Audio Config"
#define | USBD_DESC_INTERFACE_STRING "Audio Interface"
#define | AUDIO_SUBCLASS_UNDEFINED 0x00
audio interface subclass codes More...
#define | AUDIO_SUBCLASS_AUDIOCONTROL 0x01
#define | AUDIO_SUBCLASS_AUDIOSTREAMING 0x02
#define | AUDIO_SUBCLASS_MIDISTREMING 0x03
#define | AUDIO_CS_INTERFACE 0x24
audio class-specific descriptor types More...
#define | AUDIO_CS_ENDPOINT 0x25
#define | AUDIO_CS_STRING 0x23
#define | AUDIO_CS_CONFIGURATION 0x22
#define | AUDIO_CS_DEVICE 0x21
#define | AUDIO_CS_UNDEFINED 0x20
#define | AUDIO_PROTOCOL_UNDEFINED 0x00
audio interface protocol codes More...
#define | AUDIO_AC_DESCRIPTOR_UNDEFINED 0x00
audio class-specific ac interface descriptor subtypes More...
#define | AUDIO_AC_HEADER 0x01
#define | AUDIO_AC_INPUT_TERMINAL 0x02
#define | AUDIO_AC_OUTPUT_TERMINAL 0x03
#define | AUDIO_AC_MIXER_UNIT 0x04
#define | AUDIO_AC_SELECTOR_UNIT 0x05
#define | AUDIO_AC_FEATURE_UNIT 0x06
#define | AUDIO_AC_PROCESSING_UNIT 0x07
#define | AUDIO_AC_EXTENSION_UNIT 0x08
#define | AUDIO_AS_DESCRIPTOR_UNDEFINED 0x00
audio class-specific as interface descriptor subtypes More...
#define | AUDIO_AS_GENERAL 0x01
#define | AUDIO_AS_FORMAT_TYPE 0x02
#define | AUDIO_AS_FORMAT_SPECIFIC 0x03
#define | AUDIO_REQUEST_CODE_UNDEFINED 0x00
audio class-specific request codes More...
#define | AUDIO_REQ_SET_CUR 0x01
#define | AUDIO_REQ_GET_CUR 0x81
#define | AUDIO_REQ_SET_MIN 0x02
#define | AUDIO_REQ_GET_MIN 0x82
#define | AUDIO_REQ_SET_MAX 0x03
#define | AUDIO_REQ_GET_MAX 0x83
#define | AUDIO_REQ_SET_RES 0x04
#define | AUDIO_REQ_GET_RES 0x84
#define | AUDIO_REQ_SET_MEM 0x05
#define | AUDIO_REQ_GET_MEM 0x85
#define | AUDIO_REQ_GET_STAT 0xFF
#define | AUDIO_FU_CONTROL_UNDEFINED 0x00
audio feature unit control selectors More...
#define | AUDIO_FU_MUTE_CONTROL 0x01
#define | AUDIO_FU_VOLUME_CONTROL 0x02
#define | AUDIO_FU_BASS_CONTROL 0x03
#define | AUDIO_FU_MID_CONTROL 0x04
#define | AUDIO_FU_TREBLE_CONTROL 0x05
#define | AUDIO_TERMINAL_TYPE_UNDEFINED 0x0100
audio terminal type More...
#define | AUDIO_TERMINAL_TYPE_STREAMING 0x0101
#define | AUDIO_TERMINAL_TYPE_VENDOR 0x01FF
#define | AUDIO_INPUT_TERMINAL_UNDEFINED 0x0200
#define | AUDIO_INPUT_TERMINAL_MICROPHONE 0x0201
#define | AUDIO_OUTPUT_TERMINAL_UNDEFINED 0x0300
#define | AUDIO_OUTPUT_TERMINAL_SPEAKER 0x0301
#define | AUDIO_FORMAT_TYPE_I 0x01
audio format type 1 More...
#define | AUDIO_INTERFACE_NUM (AUDIO_SUPPORT_SPK + AUDIO_SUPPORT_MIC)
audio interface config More...
#define | AUDIO_INTERFACE_LEN ((0x08 + AUDIO_INTERFACE_NUM) + AUDIO_INTERFACE_NUM * 0x1E)
#define | AUDIO_MIC_INTERFACE 0x01
#define | AUDIO_SPK_INTERFACE 0x02
#define | AUDIO_INPUT_TERMINAL_SIZE 0x0C
audio interface descriptor size define More...
#define | AUDIO_OUTPUT_TERMINAL_SIZE 0x09
#define | AUDIO_FEATURE_UNIT_SIZE 0x09
#define | AUDIO_MIC_INPUT_TERMINAL_ID 0x01
audio terminal id define More...
#define | AUDIO_MIC_FEATURE_UNIT_ID 0x02
#define | AUDIO_MIC_OUTPUT_TERMINAL_ID 0x03
#define | AUDIO_SPK_INPUT_TERMINAL_ID 0x04
#define | AUDIO_SPK_FEATURE_UNIT_ID 0x05
#define | AUDIO_SPK_OUTPUT_TERMINAL_ID 0x06
#define | AUDIO_MIC_INTERFACE_NUMBER 0x01
audio interface number More...
#define | AUDIO_SPK_INTERFACE_NUMBER 0x02
#define | AT32_AUDIO_FREQ_16K 16000
audio support freq More...
#define | AT32_AUDIO_FREQ_48K 48000
#define | AUDIO_MIC_FREQ_SIZE (AUDIO_SUPPORT_FREQ)
audio microphone freq and channel config More...
#define | AUDIO_MIC_CHR AUDIO_MIC_CHANEL_NUM
#define | AUDIO_MIC_BITW (AUDIO_MIC_DEFAULT_BITW)
#define | AUDIO_SPK_FREQ_SIZE (AUDIO_SUPPORT_FREQ)
audio speaker freq and channel config More...
#define | AUDIO_SPK_CHR AUDIO_SPK_CHANEL_NUM
#define | AUDIO_SPK_BITW (AUDIO_SPK_DEFAULT_BITW)
#define | HID_BINTERVAL_TIME 0x01
#define | USBD_CONFIG_DESC_SIZE
#define | SAMPLE_FREQ(frq) (uint8_t)(frq), (uint8_t)((frq >> 8)), (uint8_t)((frq >> 16))
#define | MCU_ID1 (0x1FFFF7E8)
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor More...
usbd_desc_handler | audio_desc_handler
device descriptor handler structure More...

Detailed Description

usb audio descriptor header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file audio_desc.h.


AT32F415 Firmwary Library: audio_hid_class.c File Reference

  • middlewares
  • usbd_class
  • audio_hid
Functions | Variables
audio_hid_class.c File Reference
#include "usbd_core.h"
#include "audio_hid_class.h"
#include "audio_hid_desc.h"
#include "audio_codec.h"

Go to the source code of this file.

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb custom hid endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device event handler More...
void | audio_inisoincom_event (void *udev)
usb audio in iso incom event More...
void | audio_req_get_cur (void *udev, usb_setup_type *setup)
usb audio request get cur More...
void | audio_req_set_cur (void *udev, usb_setup_type *setup)
usb audio request set cur More...
void | audio_req_get_min (void *udev, usb_setup_type *setup)
usb audio request get min More...
void | audio_req_get_max (void *udev, usb_setup_type *setup)
usb audio request get max More...
void | audio_req_get_res (void *udev, usb_setup_type *setup)
usb audio request get res More...
void | audio_get_interface (void *udev, usb_setup_type *setup)
usb audio get interface More...
void | audio_set_interface (void *udev, usb_setup_type *setup)
usb audio set interface More...
void | usb_hid_buf_process (void *udev, uint8_t *report, uint16_t len)
usb device report function More...
usb_sts_type | class_audio_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_hid_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...

Variables

static uint8_t | g_rxhid_buff [0x40]
static uint8_t | g_txhid_buff [0x40]
usb_audio_type | audio_struct = {0, 0, 0, 0, 0, 0x1400, 0, 0, 0, {0x0000, 0x1400, 0x33}, {0x0000, 0x1400, 0x33}}
static uint32_t | hid_protocol = 0
static uint32_t | hid_set_idle = 0
static uint32_t | alt_setting = 0
static uint8_t | hid_state
uint8_t | hid_set_report [64]
static __IO uint16_t | audio_feedback_state = 0
static __IO uint8_t | audio_spk_out_stage = 0
usbd_class_handler | audio_hid_class_handler


AT32F415 Firmwary Library: audio_hid_class.h File Reference

  • middlewares
  • usbd_class
  • audio_hid
Data Structures | Macros | Functions | Variables
audio_hid_class.h File Reference
#include "usb_std.h"
#include "usbd_core.h"
#include "audio_conf.h"

Go to the source code of this file.

Data Structures

struct usb_audio_type
usb audio control struct More...

Macros

#define | USBD_AUDIO_MIC_IN_EPT 0x81
endpoint define More...
#define | USBD_AUDIO_SPK_OUT_EPT 0x02
#define | USBD_AUDIO_FEEDBACK_EPT 0x83
#define | USBD_HID_IN_EPT 0x82
usb custom hid use endpoint define More...
#define | USBD_HID_OUT_EPT 0x01
#define | USBD_IN_MAXPACKET_SIZE 0x40
usb custom hid in and out max packet size define More...
#define | USBD_OUT_MAXPACKET_SIZE 0x40
#define | AUDIO_REMAIN_SIZE 40
endpoint support max size More...
#define | AUDIO_MIC_IN_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_MIC_CHANEL_NUM * (AUDIO_MIC_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)
#define | AUDIO_SPK_OUT_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_SPK_CHANEL_NUM * (AUDIO_SPK_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)
#define | AUDIO_FEEDBACK_MAXPACKET_SIZE 0x3
#define | FEEDBACK_REFRESH_TIME 0x8
#define | AUDIO_REQ_CONTROL_INTERFACE 0x01
request type define More...
#define | AUDIO_REQ_CONTROL_ENDPOINT 0x02
#define | AUDIO_REQ_CONTROL_MASK 0x03
#define | AUDIO_MUTE_CONTROL 0x01
audio set cur type define More...
#define | AUDIO_VOLUME_CONTROL 0x02
#define | AUDIO_FREQ_SET_CONTROL 0x03
#define | AUDIO_MUTE_CONTROL 0x01
audio set cur type define More...
#define | AUDIO_VOLUME_CONTROL 0x02
#define | AUDIO_FREQ_SET_CONTROL 0x03
#define | AUDIO_DESCRIPTOR_TYPE 0x21
audio descriptor type More...
#define | AUDIO_DESCRIPTOR_SIZE 0x09
#define | HID_REQ_SET_PROTOCOL 0x0B
usb custom hid class request code define More...
#define | HID_REQ_GET_PROTOCOL 0x03
#define | HID_REQ_SET_IDLE 0x0A
#define | HID_REQ_GET_IDLE 0x02
#define | HID_REQ_SET_REPORT 0x09
#define | HID_REQ_GET_REPORT 0x01
#define | HID_DESCRIPTOR_TYPE 0x21
#define | HID_REPORT_DESC 0x22

Functions

usb_sts_type class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...

Variables

usbd_class_handler audio_hid_class_handler


AT32F415 Firmwary Library: audio_hid_desc.c File Reference

  • middlewares
  • usbd_class
  • audio_hid
Functions | Variables
audio_hid_desc.c File Reference
#include "usb_std.h"
#include "usbd_sdr.h"
#include "usbd_core.h"
#include "audio_hid_desc.h"

Go to the source code of this file.

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | audio_hid_desc_handler
device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc


AT32F415 Firmwary Library: audio_hid_desc.h File Reference

  • middlewares
  • usbd_class
  • audio_hid
Macros | Variables
audio_hid_desc.h File Reference
#include "audio_hid_class.h"
#include "usbd_core.h"
#include "audio_conf.h"

Go to the source code of this file.

Macros

#define | BCD_NUM 0x0100
#define | USBD_VENDOR_ID 0x2E3C
#define | USBD_PRODUCT_ID 0x5555
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
#define | USBD_DESC_PRODUCT_STRING "AT32 Audio"
#define | USBD_DESC_CONFIGURATION_STRING "Audio Config"
#define | USBD_DESC_INTERFACE_STRING "Audio Interface"
#define | AUDIO_SUBCLASS_UNDEFINED 0x00
audio interface subclass codes More...
#define | AUDIO_SUBCLASS_AUDIOCONTROL 0x01
#define | AUDIO_SUBCLASS_AUDIOSTREAMING 0x02
#define | AUDIO_SUBCLASS_MIDISTREMING 0x03
#define | AUDIO_CS_INTERFACE 0x24
audio class-specific descriptor types More...
#define | AUDIO_CS_ENDPOINT 0x25
#define | AUDIO_CS_STRING 0x23
#define | AUDIO_CS_CONFIGURATION 0x22
#define | AUDIO_CS_DEVICE 0x21
#define | AUDIO_CS_UNDEFINED 0x20
#define | AUDIO_PROTOCOL_UNDEFINED 0x00
audio interface protocol codes More...
#define | AUDIO_AC_DESCRIPTOR_UNDEFINED 0x00
audio class-specific ac interface descriptor subtypes More...
#define | AUDIO_AC_HEADER 0x01
#define | AUDIO_AC_INPUT_TERMINAL 0x02
#define | AUDIO_AC_OUTPUT_TERMINAL 0x03
#define | AUDIO_AC_MIXER_UNIT 0x04
#define | AUDIO_AC_SELECTOR_UNIT 0x05
#define | AUDIO_AC_FEATURE_UNIT 0x06
#define | AUDIO_AC_PROCESSING_UNIT 0x07
#define | AUDIO_AC_EXTENSION_UNIT 0x08
#define | AUDIO_AS_DESCRIPTOR_UNDEFINED 0x00
audio class-specific as interface descriptor subtypes More...
#define | AUDIO_AS_GENERAL 0x01
#define | AUDIO_AS_FORMAT_TYPE 0x02
#define | AUDIO_AS_FORMAT_SPECIFIC 0x03
#define | AUDIO_REQUEST_CODE_UNDEFINED 0x00
audio class-specific request codes More...
#define | AUDIO_REQ_SET_CUR 0x01
#define | AUDIO_REQ_GET_CUR 0x81
#define | AUDIO_REQ_SET_MIN 0x02
#define | AUDIO_REQ_GET_MIN 0x82
#define | AUDIO_REQ_SET_MAX 0x03
#define | AUDIO_REQ_GET_MAX 0x83
#define | AUDIO_REQ_SET_RES 0x04
#define | AUDIO_REQ_GET_RES 0x84
#define | AUDIO_REQ_SET_MEM 0x05
#define | AUDIO_REQ_GET_MEM 0x85
#define | AUDIO_REQ_GET_STAT 0xFF
#define | AUDIO_FU_CONTROL_UNDEFINED 0x00
audio feature unit control selectors More...
#define | AUDIO_FU_MUTE_CONTROL 0x01
#define | AUDIO_FU_VOLUME_CONTROL 0x02
#define | AUDIO_FU_BASS_CONTROL 0x03
#define | AUDIO_FU_MID_CONTROL 0x04
#define | AUDIO_FU_TREBLE_CONTROL 0x05
#define | AUDIO_TERMINAL_TYPE_UNDEFINED 0x0100
audio terminal type More...
#define | AUDIO_TERMINAL_TYPE_STREAMING 0x0101
#define | AUDIO_TERMINAL_TYPE_VENDOR 0x01FF
#define | AUDIO_INPUT_TERMINAL_UNDEFINED 0x0200
#define | AUDIO_INPUT_TERMINAL_MICROPHONE 0x0201
#define | AUDIO_OUTPUT_TERMINAL_UNDEFINED 0x0300
#define | AUDIO_OUTPUT_TERMINAL_SPEAKER 0x0301
#define | AUDIO_FORMAT_TYPE_I 0x01
audio format type 1 More...
#define | AUDIO_INTERFACE_NUM (AUDIO_SUPPORT_SPK + AUDIO_SUPPORT_MIC)
audio interface config More...
#define | AUDIO_INTERFACE_LEN ((0x08 + AUDIO_INTERFACE_NUM) + AUDIO_INTERFACE_NUM * 0x1E)
#define | AUDIO_MIC_INTERFACE 0x01
#define | AUDIO_SPK_INTERFACE 0x02
#define | AUDIO_INPUT_TERMINAL_SIZE 0x0C
audio interface descriptor size define More...
#define | AUDIO_OUTPUT_TERMINAL_SIZE 0x09
#define | AUDIO_FEATURE_UNIT_SIZE 0x09
#define | AUDIO_MIC_INPUT_TERMINAL_ID 0x01
audio terminal id define More...
#define | AUDIO_MIC_FEATURE_UNIT_ID 0x02
#define | AUDIO_MIC_OUTPUT_TERMINAL_ID 0x03
#define | AUDIO_SPK_INPUT_TERMINAL_ID 0x04
#define | AUDIO_SPK_FEATURE_UNIT_ID 0x05
#define | AUDIO_SPK_OUTPUT_TERMINAL_ID 0x06
#define | AUDIO_MIC_INTERFACE_NUMBER 0x01
audio interface number More...
#define | AUDIO_SPK_INTERFACE_NUMBER 0x02
#define | HID_INTERFACE_NUMBER 0x03
#define | AT32_AUDIO_FREQ_16K 16000
audio support freq More...
#define | AT32_AUDIO_FREQ_48K 48000
#define | AUDIO_MIC_FREQ_SIZE (AUDIO_SUPPORT_FREQ)
audio microphone freq and channel config More...
#define | AUDIO_MIC_CHR AUDIO_MIC_CHANEL_NUM
#define | AUDIO_MIC_BITW (AUDIO_MIC_DEFAULT_BITW)
#define | AUDIO_SPK_FREQ_SIZE (AUDIO_SUPPORT_FREQ)
audio speaker freq and channel config More...
#define | AUDIO_SPK_CHR AUDIO_SPK_CHANEL_NUM
#define | AUDIO_SPK_BITW (AUDIO_SPK_DEFAULT_BITW)
#define | HID_BINTERVAL_TIME 0x01
#define | HID_BCD_NUM 0x0110
usb bcd number define More...
#define | HID_CLASS_DESC_HID 0x21
usb hid class descriptor define More...
#define | HID_CLASS_DESC_REPORT 0x22
#define | HID_CLASS_DESC_PHYSICAL 0x23
#define | HID_REPORT_ID_1 0x01
usb hid report id define More...
#define | HID_REPORT_ID_2 0x02
#define | HID_REPORT_ID_3 0x03
#define | HID_REPORT_ID_4 0x04
#define | HID_REPORT_ID_5 0x05
#define | HID_REPORT_ID_6 0xF0
#define | USBD_HID_DESC_SIZE 32
#define | USBD_CONFIG_DESC_SIZE
#define | USBD_HID_SIZ_REPORT_DESC 126
#define | SAMPLE_FREQ(frq) (uint8_t)(frq), (uint8_t)((frq >> 8)), (uint8_t)((frq >> 16))
#define | MCU_ID1 (0x1FFFF7E8)
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_hid_report [126]
usb hid report descriptor More...
uint8_t | g_hid_usb_desc [9]
usb hid descriptor More...
uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((0+1)) *3)+(0x31+((0+1)) *3)+(9 *1)+32)]
usbd_desc_handler | audio_hid_desc_handler
device descriptor handler structure More...


AT32F415 Firmwary Library: cdc_class.c File Reference

  • middlewares
  • usbd_class
  • cdc
Functions | Variables
cdc_class.c File Reference

usb cdc class type More...

#include "usbd_core.h"
#include "cdc_class.h"
#include "cdc_desc.h"

Go to the source code of this file.

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb custom hid endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device event handler More...
void | usb_vcp_cmd_process (void *udev, uint8_t cmd, uint8_t *buff, uint16_t len)
usb device function More...
uint16_t | usb_vcp_get_rxdata (void *udev, uint8_t *recv_data)
usb device class rx data process More...
error_status | usb_vcp_send_data (void *udev, uint8_t *send_data, uint16_t len)
usb device class send data More...

Variables

static uint32_t | alt_setting = 0
static uint8_t | g_rx_buff [0x40]
static uint8_t | g_cmd [0x08]
static uint8_t | g_req
static uint16_t | g_len
static uint16_t | g_rxlen
__IO uint8_t | g_tx_completed = 1
__IO uint8_t | g_rx_completed = 0
linecoding_type linecoding
usbd_class_handler | class_handler

Detailed Description

usb cdc class type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file cdc_class.c.


AT32F415 Firmwary Library: cdc_class.h File Reference

  • middlewares
  • usbd_class
  • cdc
Data Structures | Macros | Functions | Variables
cdc_class.h File Reference

usb cdc class file More...

#include "usb_std.h"
#include "usbd_core.h"

Go to the source code of this file.

Data Structures

struct linecoding_type
usb cdc class set line coding struct More...

Macros

#define | USBD_CDC_INT_EPT 0x82
usb cdc use endpoint define More...
#define | USBD_CDC_BULK_IN_EPT 0x81
#define | USBD_CDC_BULK_OUT_EPT 0x01
#define | USBD_IN_MAXPACKET_SIZE 0x40
usb cdc in and out max packet size define More...
#define | USBD_OUT_MAXPACKET_SIZE 0x40
#define | USBD_CMD_MAXPACKET_SIZE 0x08
#define | SET_LINE_CODING 0x20
usb cdc class request code define More...
#define | GET_LINE_CODING 0x21

Functions

uint16_t | usb_vcp_get_rxdata (void *udev, uint8_t *recv_data)
usb device class rx data process More...
error_status | usb_vcp_send_data (void *udev, uint8_t *send_data, uint16_t len)
usb device class send data More...

Variables

usbd_class_handler class_handler

Detailed Description

usb cdc class file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file cdc_class.h.


AT32F415 Firmwary Library: cdc_desc.c File Reference

  • middlewares
  • usbd_class
  • cdc
Functions | Variables
cdc_desc.c File Reference

usb cdc device descriptor More...

#include "stdio.h"
#include "usb_std.h"
#include "usbd_sdr.h"
#include "usbd_core.h"
#include "cdc_desc.h"

Go to the source code of this file.

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | desc_handler
device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

usb cdc device descriptor

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file cdc_desc.c.


AT32F415 Firmwary Library: cdc_desc.h File Reference

  • middlewares
  • usbd_class
  • cdc
Macros | Variables
cdc_desc.h File Reference

usb cdc descriptor header file More...

#include "cdc_class.h"
#include "usbd_core.h"

Go to the source code of this file.

Macros

#define | BCD_NUM 0x0110
usb bcd number define More...
#define | USBD_VENDOR_ID 0x2E3C
usb vendor id and product id define More...
#define | USBD_PRODUCT_ID 0x5740
#define | USBD_CONFIG_DESC_SIZE 67
usb descriptor size define More...
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
usb string define(vendor, product configuration, interface) More...
#define | USBD_DESC_PRODUCT_STRING "AT32 Virtual Com Port "
#define | USBD_DESC_CONFIGURATION_STRING "Virtual ComPort Config"
#define | USBD_DESC_INTERFACE_STRING "Virtual ComPort Interface"
#define | HID_BINTERVAL_TIME 0xFF
usb endpoint interval define More...
#define | USBD_CDC_CS_INTERFACE 0x24
usb hid class descriptor define More...
#define | USBD_CDC_CS_ENDPOINT 0x25
#define | USBD_CDC_SUBTYPE_HEADER 0x00
usb hid class sub-type define More...
#define | USBD_CDC_SUBTYPE_CMF 0x01
#define | USBD_CDC_SUBTYPE_ACM 0x02
#define | USBD_CDC_SUBTYPE_UFD 0x06
#define | MCU_ID1 (0x1FFFF7E8)
usb mcu id address deine More...
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [67]
usbd_desc_handler | desc_handler
device descriptor handler structure More...

Detailed Description

usb cdc descriptor header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file cdc_desc.h.


AT32F415 Firmwary Library: cdc_keyboard_class.c File Reference

  • middlewares
  • usbd_class
  • composite_cdc_keyboard
Macros | Functions | Variables
cdc_keyboard_class.c File Reference

usb cdc and keyboard class type More...

#include "usbd_core.h"
#include "cdc_keyboard_class.h"
#include "cdc_keyboard_desc.h"

Go to the source code of this file.

Macros

#define SHIFT 0x80

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device class endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device class endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device class transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device class endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device class sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device class event handler More...
usb_sts_type | cdc_class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | keyboard_class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
void | usb_vcp_cmd_process (void *udev, uint8_t cmd, uint8_t *buff, uint16_t len)
usb device class request function More...
uint16_t | usb_vcp_get_rxdata (void *udev, uint8_t *recv_data)
usb device class rx data process More...
error_status | usb_vcp_send_data (void *udev, uint8_t *send_data, uint16_t len)
usb device class send data More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...
void | usb_hid_keyboard_send_char (void *udev, uint8_t ascii_code)
usb keyoard send char More...

Variables

static uint32_t | alt_setting = 0
static uint32_t | hid_protocol = 0
static uint32_t | hid_set_idle = 0
static uint8_t | hid_state
uint8_t | hid_set_report [64]
static uint8_t | g_rx_buff [0x40]
static uint8_t | g_cmd [0x08]
static uint8_t | g_req
static uint16_t | g_len
static uint16_t | g_rxlen
__IO uint8_t | g_tx_completed = 1
__IO uint8_t | g_rx_completed = 0
__IO uint8_t | g_keyboard_tx_completed = 0
const unsigned char | _asciimap [128]
linecoding_type linecoding
usbd_class_handler | cdc_keyboard_class_handler

Detailed Description

usb cdc and keyboard class type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file cdc_keyboard_class.c.


AT32F415 Firmwary Library: cdc_keyboard_class.h File Reference

  • middlewares
  • usbd_class
  • composite_cdc_keyboard
Data Structures | Macros | Functions | Variables
cdc_keyboard_class.h File Reference

usb cdc and keyboard class file More...

#include "usb_std.h"
#include "usbd_core.h"

Go to the source code of this file.

Data Structures

struct linecoding_type
usb cdc class set line coding struct More...

Macros

#define | USBD_CDC_INT_EPT 0x82
usb use endpoint define More...
#define | USBD_CDC_BULK_IN_EPT 0x81
#define | USBD_CDC_BULK_OUT_EPT 0x01
#define | USBD_HID_IN_EPT 0x83
#define | USBD_IN_MAXPACKET_SIZE 0x40
usb in and out max packet size define More...
#define | USBD_OUT_MAXPACKET_SIZE 0x40
#define | USBD_CMD_MAXPACKET_SIZE 0x08
#define | SET_LINE_CODING 0x20
usb cdc class request code define More...
#define | GET_LINE_CODING 0x21
#define | HID_REQ_SET_PROTOCOL 0x0B
usb hid class request code define More...
#define | HID_REQ_GET_PROTOCOL 0x03
#define | HID_REQ_SET_IDLE 0x0A
#define | HID_REQ_GET_IDLE 0x02
#define | HID_REQ_SET_REPORT 0x09
#define | HID_REQ_GET_REPORT 0x01
#define | HID_DESCRIPTOR_TYPE 0x21
#define | HID_REPORT_DESC 0x22

Functions

uint16_t | usb_vcp_get_rxdata (void *udev, uint8_t *recv_data)
usb device class rx data process More...
error_status | usb_vcp_send_data (void *udev, uint8_t *send_data, uint16_t len)
usb device class send data More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...
void | usb_hid_keyboard_send_char (void *udev, uint8_t ascii_code)
usb keyoard send char More...

Variables

usbd_class_handler | cdc_keyboard_class_handler
__IO uint8_t | g_keyboard_tx_completed

Detailed Description

usb cdc and keyboard class file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file cdc_keyboard_class.h.


AT32F415 Firmwary Library: cdc_keyboard_desc.c File Reference

  • middlewares
  • usbd_class
  • composite_cdc_keyboard
Functions | Variables
cdc_keyboard_desc.c File Reference

usb cdc and keyboard device descriptor More...

#include "usb_std.h"
#include "usbd_sdr.h"
#include "usbd_core.h"
#include "cdc_keyboard_desc.h"

Go to the source code of this file.

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | cdc_keyboard_desc_handler
device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

usb cdc and keyboard device descriptor

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file cdc_keyboard_desc.c.


AT32F415 Firmwary Library: cdc_keyboard_desc.h File Reference

  • middlewares
  • usbd_class
  • composite_cdc_keyboard
Macros | Variables
cdc_keyboard_desc.h File Reference

usb cdc and keyboard descriptor header file More...

#include "cdc_keyboard_class.h"
#include "usbd_core.h"

Go to the source code of this file.

Macros

#define | BCD_NUM 0x0110
usb bcd number define More...
#define | USBD_VENDOR_ID 0x2E3C
usb vendor id and product id define More...
#define | USBD_PRODUCT_ID 0x5750
#define | HID_BCD_NUM 0x0110
usb bcd number define More...
#define | HID_CLASS_DESC_HID 0x21
usb hid class descriptor define More...
#define | HID_CLASS_DESC_REPORT 0x22
#define | HID_CLASS_DESC_PHYSICAL 0x23
#define | USBD_CONFIG_DESC_SIZE 108
usb descriptor size define More...
#define | USBD_HID_SIZ_REPORT_DESC 63
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
usb string define(vendor, product configuration, interface) More...
#define | USBD_DESC_PRODUCT_STRING "AT32 Composite VCP and Keyboard"
#define | USBD_DESC_CONFIGURATION_STRING "Composite VCP and Keyboard Config"
#define | USBD_DESC_INTERFACE_STRING "Composite VCP and Keyboard Interface"
#define | HID_BINTERVAL_TIME 0x0A
usb endpoint interval define More...
#define | USBD_CDC_CS_INTERFACE 0x24
usb cdc class descriptor define More...
#define | USBD_CDC_CS_ENDPOINT 0x25
#define | USBD_CDC_SUBTYPE_HEADER 0x00
usb cdc class sub-type define More...
#define | USBD_CDC_SUBTYPE_CMF 0x01
#define | USBD_CDC_SUBTYPE_ACM 0x02
#define | USBD_CDC_SUBTYPE_UFD 0x06
#define | CDC_INTERFACE 0x00
usb interface define More...
#define | CDC_DATA_INTERFACE 0x01
#define | HID_KEYBOARD_INTERFACE 0x02
#define | MCU_ID1 (0x1FFFF7E8)
usb mcu id address deine More...
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [108]
uint8_t | g_usbd_hid_report [63]
uint8_t | g_hid_usb_desc [9]
usbd_desc_handler | cdc_keyboard_desc_handler
device descriptor handler structure More...

Detailed Description

usb cdc and keyboard descriptor header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file cdc_keyboard_desc.h.


AT32F415 Firmwary Library: custom_hid_class.c File Reference

  • middlewares
  • usbd_class
  • custom_hid
Functions | Variables
custom_hid_class.c File Reference

usb custom hid class type More...

#include "usbd_core.h"
#include "custom_hid_class.h"
#include "custom_hid_desc.h"

Go to the source code of this file.

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb custom hid endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device event handler More...
void | usb_hid_buf_process (void *udev, uint8_t *report, uint16_t len)
usb device report function More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...

Variables

static uint8_t | g_rxhid_buff [0x40]
static uint8_t | g_txhid_buff [0x40]
static uint32_t | hid_protocol = 0
static uint32_t | hid_set_idle = 0
static uint32_t | alt_setting = 0
static uint8_t | hid_state
uint8_t | hid_set_report [64]
usbd_class_handler | custom_hid_class_handler

Detailed Description

usb custom hid class type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file custom_hid_class.c.


AT32F415 Firmwary Library: custom_hid_class.h File Reference

  • middlewares
  • usbd_class
  • custom_hid
Macros | Functions | Variables
custom_hid_class.h File Reference

usb hid header file More...

#include "usb_std.h"
#include "usbd_core.h"

Go to the source code of this file.

Macros

#define | USBD_HID_IN_EPT 0x81
usb custom hid use endpoint define More...
#define | USBD_HID_OUT_EPT 0x01
#define | USBD_IN_MAXPACKET_SIZE 0x40
usb custom hid in and out max packet size define More...
#define | USBD_OUT_MAXPACKET_SIZE 0x40
#define | HID_REQ_SET_PROTOCOL 0x0B
usb custom hid class request code define More...
#define | HID_REQ_GET_PROTOCOL 0x03
#define | HID_REQ_SET_IDLE 0x0A
#define | HID_REQ_GET_IDLE 0x02
#define | HID_REQ_SET_REPORT 0x09
#define | HID_REQ_GET_REPORT 0x01
#define | HID_DESCRIPTOR_TYPE 0x21
#define | HID_REPORT_DESC 0x22

Functions

usb_sts_type class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...

Variables

usbd_class_handler custom_hid_class_handler

Detailed Description

usb hid header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file custom_hid_class.h.


AT32F415 Firmwary Library: custom_hid_desc.c File Reference

  • middlewares
  • usbd_class
  • custom_hid
Functions | Variables
custom_hid_desc.c File Reference

usb hid device descriptor More...

#include "usb_std.h"
#include "usbd_sdr.h"
#include "usbd_core.h"
#include "custom_hid_desc.h"

Go to the source code of this file.

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | hid_desc_handler
custom hid device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

usb hid device descriptor

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file custom_hid_desc.c.


AT32F415 Firmwary Library: custom_hid_desc.h File Reference

  • middlewares
  • usbd_class
  • custom_hid
Macros | Variables
custom_hid_desc.h File Reference

usb custom hid descriptor header file More...

#include "custom_hid_class.h"
#include "usbd_core.h"

Go to the source code of this file.

Macros

#define | HID_BCD_NUM 0x0110
usb bcd number define More...
#define | HID_CLASS_DESC_HID 0x21
usb hid class descriptor define More...
#define | HID_CLASS_DESC_REPORT 0x22
#define | HID_CLASS_DESC_PHYSICAL 0x23
#define | USBD_VENDOR_ID 0x2E3C
usb vendor id and product id define More...
#define | USBD_PRODUCT_ID 0x5745
#define | USBD_CONFIG_DESC_SIZE 41
usb descriptor size define More...
#define | USBD_HID_SIZ_REPORT_DESC 126
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
usb string define(vendor, product configuration, interface) More...
#define | USBD_DESC_PRODUCT_STRING "Custom HID"
#define | USBD_DESC_CONFIGURATION_STRING "Custom HID Config"
#define | USBD_DESC_INTERFACE_STRING "Custom HID Interface"
#define | HID_BINTERVAL_TIME 0x0A
usb hid endpoint interval define More...
#define | HID_REPORT_ID_1 0x01
usb hid report id define More...
#define | HID_REPORT_ID_2 0x02
#define | HID_REPORT_ID_3 0x03
#define | HID_REPORT_ID_4 0x04
#define | HID_REPORT_ID_5 0x05
#define | HID_REPORT_ID_6 0xF0
#define | MCU_ID1 (0x1FFFF7E8)
usb mcu id address deine More...
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [41]
uint8_t | g_usbd_hid_report [126]
uint8_t | g_hid_usb_desc [9]
usbd_desc_handler | hid_desc_handler
custom hid device descriptor handler structure More...

Detailed Description

usb custom hid descriptor header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file custom_hid_desc.h.


AT32F415 Firmwary Library: hid_iap_class.c File Reference

  • middlewares
  • usbd_class
  • hid_iap
Functions | Variables
hid_iap_class.c File Reference

usb hid iap class type More...

#include "usbd_core.h"
#include "hid_iap_class.h"
#include "hid_iap_desc.h"

Go to the source code of this file.

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb custom hid endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device event handler More...
void | usb_hid_buf_process (void *udev, uint8_t *report, uint16_t len)
usb device report function More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...

Variables

static uint8_t | g_rxhid_buff [0x40]
static uint32_t | hid_protocol = 0
static uint32_t | hid_set_idle = 0
static uint32_t | alt_setting = 0
static uint8_t | hid_state
uint8_t | hid_set_report [64]
iap_info_type iap_info
usbd_class_handler | hid_iap_class_handler

Detailed Description

usb hid iap class type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file hid_iap_class.c.


AT32F415 Firmwary Library: hid_iap_class.h File Reference

  • middlewares
  • usbd_class
  • hid_iap
Data Structures | Macros | Enumerations | Functions | Variables
hid_iap_class.h File Reference

usb hid iap header file More...

#include "usb_std.h"
#include "usbd_core.h"

Go to the source code of this file.

Data Structures

struct iap_info_type

Macros

#define | USBD_HID_IN_EPT 0x81
#define | USBD_HID_OUT_EPT 0x01
#define | USBD_IN_MAXPACKET_SIZE 0x40
#define | USBD_OUT_MAXPACKET_SIZE 0x40
#define | HID_REQ_SET_PROTOCOL 0x0B
#define | HID_REQ_GET_PROTOCOL 0x03
#define | HID_REQ_SET_IDLE 0x0A
#define | HID_REQ_GET_IDLE 0x02
#define | HID_REQ_SET_REPORT 0x09
#define | HID_REQ_GET_REPORT 0x01
#define | HID_DESCRIPTOR_TYPE 0x21
#define | HID_REPORT_DESC 0x22
#define | FLASH_SIZE_REG() ((*(uint32_t *)0x1FFFF7E0) & 0xFFFF) /*Get Flash size*/
#define | KB_TO_B(kb) ((kb) << 10)
#define | SECTOR_SIZE_1K 0x400
#define | SECTOR_SIZE_2K 0x800
#define | SECTOR_SIZE_4K 0x1000
#define | IAP_CMD_IDLE 0x5AA0
iap command More...
#define | IAP_CMD_START 0x5AA1
#define | IAP_CMD_ADDR 0x5AA2
#define | IAP_CMD_DATA 0x5AA3
#define | IAP_CMD_FINISH 0x5AA4
#define | IAP_CMD_CRC 0x5AA5
#define | IAP_CMD_JMP 0x5AA6
#define | IAP_CMD_GET 0x5AA7
#define | HID_IAP_BUFFER_LEN 1024
#define | IAP_UPGRADE_COMPLETE_FLAG 0x41544B38
#define | CONVERT_ENDIAN(dwValue)
#define | IAP_ACK 0xFF00
#define | IAP_NACK 0x00FF

Enumerations

enum iap_result_type { IAP_SUCCESS , IAP_WAIT , IAP_FAILED }
enum iap_machine_state_type {
IAP_STS_IDLE , IAP_STS_START , IAP_STS_ADDR , IAP_STS_DATA ,
IAP_STS_FINISH , IAP_STS_CRC , IAP_STS_JMP_WAIT , IAP_STS_JMP
}

Functions

usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...
iap_result_type | usbd_hid_iap_process (void *udev, uint8_t *report, uint16_t len)
usb device iap function More...
void | usbd_hid_iap_in_complete (void *udev)
usb device in transfer complete function More...

Variables

usbd_class_handler hid_iap_class_handler
iap_info_type iap_info

Detailed Description

usb hid iap header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file hid_iap_class.h.


AT32F415 Firmwary Library: hid_iap_desc.c File Reference

  • middlewares
  • usbd_class
  • hid_iap
Functions | Variables
hid_iap_desc.c File Reference

usb hid iap device descriptor More...

#include "usb_std.h"
#include "usbd_sdr.h"
#include "usbd_core.h"
#include "hid_iap_desc.h"

Go to the source code of this file.

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | hid_iap_desc_handler
hid device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

usb hid iap device descriptor

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file hid_iap_desc.c.


AT32F415 Firmwary Library: hid_iap_desc.h File Reference

  • middlewares
  • usbd_class
  • hid_iap
Macros | Variables
hid_iap_desc.h File Reference

usb hid iap descriptor header file More...

#include "hid_iap_class.h"
#include "usbd_core.h"

Go to the source code of this file.

Macros

#define | HID_BCD_NUM 0x0110
#define | HID_CLASS_DESC_HID 0x21
#define | HID_CLASS_DESC_REPORT 0x22
#define | HID_CLASS_DESC_PHYSICAL 0x23
#define | USBD_VENDOR_ID 0x2E3C
#define | USBD_PRODUCT_ID 0xAF01
#define | USBD_CONFIG_DESC_SIZE 41
#define | USBD_HID_SIZ_REPORT_DESC 32
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
#define | USBD_DESC_PRODUCT_STRING "HID IAP"
#define | USBD_DESC_CONFIGURATION_STRING "HID IAP Config"
#define | USBD_DESC_INTERFACE_STRING "HID IAP Interface"
#define | HID_BINTERVAL_TIME 0x01
#define | MCU_ID1 (0x1FFFF7E8)
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [41]
uint8_t | g_usbd_hid_report [32]
uint8_t | g_hid_usb_desc [9]
usbd_desc_handler | hid_iap_desc_handler
hid device descriptor handler structure More...

Detailed Description

usb hid iap descriptor header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file hid_iap_desc.h.


AT32F415 Firmwary Library: keyboard_class.c File Reference

  • middlewares
  • usbd_class
  • keyboard
Macros | Functions | Variables
keyboard_class.c File Reference

usb hid keyboard class type More...

#include "usbd_core.h"
#include "keyboard_class.h"
#include "keyboard_desc.h"

Go to the source code of this file.

Macros

#define SHIFT 0x80

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device class endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device class endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device class transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device class endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device class sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device class event handler More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...
void | usb_hid_keyboard_send_char (void *udev, uint8_t ascii_code)
usb device class report function More...

Variables

static uint32_t | hid_protocol = 0
static uint32_t | hid_set_idle = 0
static uint32_t | alt_setting = 0
static uint8_t | hid_state
uint8_t | hid_set_report [64]
__IO uint8_t | hid_suspend_flag = 0
__IO uint8_t | g_u8tx_completed = 0
const unsigned char | _asciimap [128]
usbd_class_handler | keyboard_class_handler

Detailed Description

usb hid keyboard class type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file keyboard_class.c.


AT32F415 Firmwary Library: keyboard_class.h File Reference

  • middlewares
  • usbd_class
  • keyboard
Macros | Functions | Variables
keyboard_class.h File Reference

usb hid keyboard header file More...

#include "usb_std.h"
#include "usbd_core.h"

Go to the source code of this file.

Macros

#define | USBD_HID_IN_EPT 0x81
usb hid use endpoint define More...
#define | USBD_IN_MAXPACKET_SIZE 0x40
usb hid in and out max packet size define More...
#define | USBD_OUT_MAXPACKET_SIZE 0x40
#define | HID_REQ_SET_PROTOCOL 0x0B
usb hid class request code define More...
#define | HID_REQ_GET_PROTOCOL 0x03
#define | HID_REQ_SET_IDLE 0x0A
#define | HID_REQ_GET_IDLE 0x02
#define | HID_REQ_SET_REPORT 0x09
#define | HID_REQ_GET_REPORT 0x01
#define | HID_DESCRIPTOR_TYPE 0x21
#define | HID_REPORT_DESC 0x22

Functions

usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...
void | usb_hid_keyboard_send_char (void *udev, uint8_t ascii_code)
usb keyoard send char More...

Variables

usbd_class_handler | keyboard_class_handler
__IO uint8_t | g_u8tx_completed

Detailed Description

usb hid keyboard header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file keyboard_class.h.


AT32F415 Firmwary Library: keyboard_desc.c File Reference

  • middlewares
  • usbd_class
  • keyboard
Functions | Variables
keyboard_desc.c File Reference

usb hid keyboard device descriptor More...

#include "usb_std.h"
#include "usbd_sdr.h"
#include "usbd_core.h"
#include "keyboard_desc.h"

Go to the source code of this file.

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | keyboard_desc_handler
keyboard device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

usb hid keyboard device descriptor

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file keyboard_desc.c.


AT32F415 Firmwary Library: keyboard_desc.h File Reference

  • middlewares
  • usbd_class
  • keyboard
Macros | Variables
keyboard_desc.h File Reference

usb keyboard descriptor header file More...

#include "keyboard_class.h"
#include "usbd_core.h"

Go to the source code of this file.

Macros

#define | HID_BCD_NUM 0x0110
usb bcd number define More...
#define | HID_CLASS_DESC_HID 0x21
usb hid class descriptor define More...
#define | HID_CLASS_DESC_REPORT 0x22
#define | HID_CLASS_DESC_PHYSICAL 0x23
#define | USBD_VENDOR_ID 0x2E3C
usb vendor id and product id define More...
#define | USBD_PRODUCT_ID 0x6040
#define | USBD_CONFIG_DESC_SIZE 34
usb descriptor size define More...
#define | USBD_HID_SIZ_REPORT_DESC 63
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
usb string define(vendor, product configuration, interface) More...
#define | USBD_DESC_PRODUCT_STRING "Keyboard"
#define | USBD_DESC_CONFIGURATION_STRING "Keyboard Config"
#define | USBD_DESC_INTERFACE_STRING "Keyboard Interface"
#define | HID_BINTERVAL_TIME 0x0A
usb hid endpoint interval define More...
#define | MCU_ID1 (0x1FFFF7E8)
usb mcu id address deine More...
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [34]
uint8_t | g_usbd_hid_report [63]
uint8_t | g_hid_usb_desc [9]
usbd_desc_handler | keyboard_desc_handler
keyboard device descriptor handler structure More...

Detailed Description

usb keyboard descriptor header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file keyboard_desc.h.


AT32F415 Firmwary Library: mouse_class.c File Reference

  • middlewares
  • usbd_class
  • mouse
Functions | Variables
mouse_class.c File Reference

usb hid mouse class type More...

#include "usbd_core.h"
#include "mouse_class.h"
#include "mouse_desc.h"

Go to the source code of this file.

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device class endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device class endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device class transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device class endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device class sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device class event handler More...
usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...
void | usb_hid_mouse_send (void *udev, uint8_t op)
usb device class report function More...

Variables

static uint32_t | hid_protocol = 0
static uint32_t | hid_set_idle = 0
static uint32_t | alt_setting = 0
static uint8_t | hid_state
__IO uint8_t | hid_suspend_flag = 0
uint8_t | hid_set_report [64]
usbd_class_handler | mouse_class_handler

Detailed Description

usb hid mouse class type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file mouse_class.c.


AT32F415 Firmwary Library: mouse_class.h File Reference

  • middlewares
  • usbd_class
  • mouse
Macros | Functions | Variables
mouse_class.h File Reference

usb hid mouse header file More...

#include "usb_std.h"
#include "usbd_core.h"

Go to the source code of this file.

Macros

#define | USBD_HID_IN_EPT 0x81
usb hid use endpoint define More...
#define | USBD_IN_MAXPACKET_SIZE 0x40
usb hid in and out max packet size define More...
#define | HID_REQ_SET_PROTOCOL 0x0B
usb hid class request code define More...
#define | HID_REQ_GET_PROTOCOL 0x03
#define | HID_REQ_SET_IDLE 0x0A
#define | HID_REQ_GET_IDLE 0x02
#define | HID_REQ_SET_REPORT 0x09
#define | HID_REQ_GET_REPORT 0x01
#define | HID_DESCRIPTOR_TYPE 0x21
#define | HID_REPORT_DESC 0x22
#define | MOVE_STEP 20
usb hid mouse operation More...
#define | BUTTON_RELEASE 0
#define | LEFT_BUTTON 1
#define | RIGHT_BUTTON 2
#define | LEFT_MOVE 3
#define | RIGHT_MOVE 4
#define | UP_MOVE 5
#define | DOWN_MOVE 6

Functions

usb_sts_type | class_send_report (void *udev, uint8_t *report, uint16_t len)
usb device class send report More...
void | usb_hid_mouse_send (void *udev, uint8_t op)
usb device class report function More...

Variables

usbd_class_handler mouse_class_handler

Detailed Description

usb hid mouse header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file mouse_class.h.


AT32F415 Firmwary Library: mouse_desc.c File Reference

  • middlewares
  • usbd_class
  • mouse
Functions | Variables
mouse_desc.c File Reference

usb hid mouse device descriptor More...

#include "usb_std.h"
#include "usbd_sdr.h"
#include "usbd_core.h"
#include "mouse_desc.h"

Go to the source code of this file.

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | mouse_desc_handler
mouse device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

usb hid mouse device descriptor

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file mouse_desc.c.


AT32F415 Firmwary Library: mouse_desc.h File Reference

  • middlewares
  • usbd_class
  • mouse
Macros | Variables
mouse_desc.h File Reference

usb mouse descriptor header file More...

#include "mouse_class.h"
#include "usbd_core.h"

Go to the source code of this file.

Macros

#define | HID_BCD_NUM 0x0110
usb bcd number define More...
#define | HID_CLASS_DESC_HID 0x21
usb hid class descriptor define More...
#define | HID_CLASS_DESC_REPORT 0x22
#define | HID_CLASS_DESC_PHYSICAL 0x23
#define | USBD_VENDOR_ID 0x2E3C
usb vendor id and product id define More...
#define | USBD_PRODUCT_ID 0x5710
#define | USBD_CONFIG_DESC_SIZE 34
usb descriptor size define More...
#define | USBD_HID_SIZ_REPORT_DESC 74
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
usb string define(vendor, product configuration, interface) More...
#define | USBD_DESC_PRODUCT_STRING "Mouse"
#define | USBD_DESC_CONFIGURATION_STRING "Mouse Config"
#define | USBD_DESC_INTERFACE_STRING "Mouse Interface"
#define | HID_BINTERVAL_TIME 0x0A
usb hid endpoint interval define More...
#define | MCU_ID1 (0x1FFFF7E8)
usb mcu id address deine More...
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [34]
uint8_t | g_usbd_hid_report [74]
uint8_t | g_hid_usb_desc [9]
usbd_desc_handler | mouse_desc_handler
mouse device descriptor handler structure More...

Detailed Description

usb mouse descriptor header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file mouse_desc.h.


AT32F415 Firmwary Library: msc_bot_scsi.c File Reference

  • middlewares
  • usbd_class
  • msc
Functions | Variables
msc_bot_scsi.c File Reference

usb mass storage bulk-only transport and scsi command More...

#include "msc_bot_scsi.h"
#include "msc_diskio.h"

Go to the source code of this file.

Functions

void | bot_scsi_init (void *udev)
initialize bulk-only transport and scsi More...
void | bot_scsi_reset (void *udev)
reset bulk-only transport and scsi More...
void | bot_scsi_datain_handler (void *udev, uint8_t ept_num)
bulk-only transport data in handler More...
void | bot_scsi_dataout_handler (void *udev, uint8_t ept_num)
bulk-only transport data out handler More...
void | bot_cbw_decode (void *udev)
bulk-only cbw decode More...
void | bot_scsi_send_data (void *udev, uint8_t *buffer, uint32_t len)
send bot data More...
void | bot_scsi_send_csw (void *udev, uint8_t status)
send command status More...
void | bot_scsi_sense_code (void *udev, uint8_t sense_key, uint8_t asc)
send scsi sense code More...
usb_sts_type | bot_scsi_check_address (void *udev, uint8_t lun, uint32_t blk_offset, uint32_t blk_count)
check address More...
void | bot_scsi_stall (void *udev)
bot endpoint stall More...
usb_sts_type | bot_scsi_test_unit (void *udev, uint8_t lun)
bulk-only transport scsi command test unit More...
usb_sts_type | bot_scsi_inquiry (void *udev, uint8_t lun)
bulk-only transport scsi command inquiry More...
usb_sts_type | bot_scsi_start_stop (void *udev, uint8_t lun)
bulk-only transport scsi command start stop More...
usb_sts_type | bot_scsi_allow_medium_removal (void *udev, uint8_t lun)
bulk-only transport scsi command meidum removal More...
usb_sts_type | bot_scsi_mode_sense6 (void *udev, uint8_t lun)
bulk-only transport scsi command mode sense6 More...
usb_sts_type | bot_scsi_mode_sense10 (void *udev, uint8_t lun)
bulk-only transport scsi command mode sense10 More...
usb_sts_type | bot_scsi_capacity (void *udev, uint8_t lun)
bulk-only transport scsi command capacity More...
usb_sts_type | bot_scsi_format_capacity (void *udev, uint8_t lun)
bulk-only transport scsi command format capacity More...
usb_sts_type | bot_scsi_request_sense (void *udev, uint8_t lun)
bulk-only transport scsi command request sense More...
usb_sts_type | bot_scsi_verify (void *udev, uint8_t lun)
bulk-only transport scsi command verify More...
usb_sts_type | bot_scsi_read10 (void *udev, uint8_t lun)
bulk-only transport scsi command read10 More...
usb_sts_type | bot_scsi_write10 (void *udev, uint8_t lun)
bulk-only transport scsi command write10 More...
void | bot_scsi_clear_feature (void *udev, uint8_t ept_num)
clear feature More...
usb_sts_type | bot_scsi_cmd_process (void *udev)
bulk-only transport scsi command process More...

Variables

msc_type msc_struct
cbw_type cbw_struct
csw_type csw_struct
ALIGNED_HEAD uint8_t page00_inquiry_data[] ALIGNED_TAIL

Detailed Description

usb mass storage bulk-only transport and scsi command

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file msc_bot_scsi.c.


AT32F415 Firmwary Library: msc_bot_scsi.h File Reference

  • middlewares
  • usbd_class
  • msc
Data Structures | Macros | Functions
msc_bot_scsi.h File Reference

usb mass storage bulk-only transport and scsi command header file More...

#include "msc_class.h"
#include "usbd_core.h"

Go to the source code of this file.

Data Structures

struct | cbd_typical_type
typical command block description More...
struct | cbd_extended_type
extended command block description More...
struct | cbw_type
command block wrapper More...
struct | csw_type
command block wrapper More...
struct | sense_type
request sense standard data More...
struct | msc_type

Macros

#define | MSC_SUPPORT_MAX_LUN 1
#define | MSC_MAX_DATA_BUF_LEN 4096
#define | MSC_CMD_FORMAT_UNIT 0x04
#define | MSC_CMD_INQUIRY 0x12
#define | MSC_CMD_START_STOP 0x1B
#define | MSC_CMD_MODE_SENSE6 0x1A
#define | MSC_CMD_MODE_SENSE10 0x5A
#define | MSC_CMD_ALLOW_MEDIUM_REMOVAL 0x1E
#define | MSC_CMD_READ_10 0x28
#define | MSC_CMD_READ_12 0xA8
#define | MSC_CMD_READ_CAPACITY 0x25
#define | MSC_CMD_READ_FORMAT_CAPACITY 0x23
#define | MSC_CMD_REQUEST_SENSE 0x03
#define | MSC_CMD_TEST_UNIT 0x00
#define | MSC_CMD_VERIFY 0x2F
#define | MSC_CMD_WRITE_10 0x2A
#define | MSC_CMD_WRITE_12 0xAA
#define | MSC_CMD_WRITE_VERIFY 0x2E
#define | MSC_REQ_GET_MAX_LUN 0xFE
#define | MSC_REQ_BO_RESET 0xFF
#define | SET_LINE_CODING 0x20
#define | GET_LINE_CODING 0x21
#define | CBW_CMD_LENGTH 31
#define | CBW_DCBWSIGNATURE 0x43425355
#define | CBW_BMCBWFLAGS_DIR_OUT 0x00
#define | CBW_BMCBWFLAGS_DIR_IN 0x80
#define | CSW_CMD_LENGTH 13
#define | CSW_DCSWSIGNATURE 0x53425355
#define | CSW_BCSWSTATUS_PASS 0x00
#define | CSW_BCSWSTATUS_FAILED 0x01
#define | CSW_BCSWSTATUS_PHASE_ERR 0x02
#define | MSC_STATE_MACHINE_CMD 0x00
#define | MSC_STATE_MACHINE_DATA_IN 0x01
#define | MSC_STATE_MACHINE_DATA_OUT 0x02
#define | MSC_STATE_MACHINE_SEND_DATA 0x03
#define | MSC_STATE_MACHINE_LAST_DATA 0x04
#define | MSC_STATE_MACHINE_STATUS 0x05
#define | MSC_STATE_MACHINE_FAILED 0x06
#define | MSC_STATE_MACHINE_IDLE 0x07
#define | MSC_BOT_STATE_IDLE 0x00
#define | MSC_BOT_STATE_RECOVERY 0x01
#define | MSC_BOT_STATE_ERROR 0x02
#define | REQ_SENSE_STANDARD_DATA_LEN 0x12
#define | SENSE_KEY_NO_SENSE 0x00
#define | SENSE_KEY_RECOVERED_ERROR 0x01
#define | SENSE_KEY_NOT_READY 0x02
#define | SENSE_KEY_MEDIUM_ERROR 0x03
#define | SENSE_KEY_HARDWARE_ERROR 0x04
#define | SENSE_KEY_ILLEGAL_REQUEST 0x05
#define | SENSE_KEY_UNIT_ATTENTION 0x06
#define | SENSE_KEY_DATA_PROTECT 0x07
#define | SENSE_KEY_BLANK_CHECK 0x08
#define | SENSE_KEY_VENDERO_SPECIFIC 0x09
#define | SENSE_KEY_ABORTED_COMMAND 0x0B
#define | SENSE_KEY_VOLUME_OVERFLOW 0x0D
#define | SENSE_KEY_MISCOMPARE 0x0E
#define | INVALID_COMMAND 0x20
#define | INVALID_FIELED_IN_COMMAND 0x24
#define | PARAMETER_LIST_LENGTH_ERROR 0x1A
#define | INVALID_FIELD_IN_PARAMETER_LIST 0x26
#define | ADDRESS_OUT_OF_RANGE 0x21
#define | MEDIUM_NOT_PRESENT 0x3A
#define | MEDIUM_HAVE_CHANGED 0x28
#define | SCSI_INQUIRY_DATA_LENGTH 36

Functions

void | bot_scsi_init (void *udev)
initialize bulk-only transport and scsi More...
void | bot_scsi_reset (void *udev)
reset bulk-only transport and scsi More...
void | bot_scsi_datain_handler (void *pudev, uint8_t ept_num)
bulk-only transport data in handler More...
void | bot_scsi_dataout_handler (void *pudev, uint8_t ept_num)
bulk-only transport data out handler More...
void | bot_cbw_decode (void *udev)
bulk-only cbw decode More...
void | bot_scsi_send_data (void *udev, uint8_t *buffer, uint32_t len)
send bot data More...
void | bot_scsi_send_csw (void *udev, uint8_t status)
send command status More...
void | bot_scsi_sense_code (void *udev, uint8_t sense_key, uint8_t asc)
send scsi sense code More...
usb_sts_type | bot_scsi_check_address (void *udev, uint8_t lun, uint32_t blk_offset, uint32_t blk_count)
check address More...
void | bot_scsi_stall (void *udev)
bot endpoint stall More...
usb_sts_type | bot_scsi_cmd_process (void *udev)
bulk-only transport scsi command process More...
usb_sts_type | bot_scsi_test_unit (void *udev, uint8_t lun)
bulk-only transport scsi command test unit More...
usb_sts_type | bot_scsi_inquiry (void *udev, uint8_t lun)
bulk-only transport scsi command inquiry More...
usb_sts_type | bot_scsi_start_stop (void *udev, uint8_t lun)
bulk-only transport scsi command start stop More...
usb_sts_type | bot_scsi_allow_medium_removal (void *udev, uint8_t lun)
bulk-only transport scsi command meidum removal More...
usb_sts_type | bot_scsi_mode_sense6 (void *udev, uint8_t lun)
bulk-only transport scsi command mode sense6 More...
usb_sts_type | bot_scsi_mode_sense10 (void *udev, uint8_t lun)
bulk-only transport scsi command mode sense10 More...
usb_sts_type | bot_scsi_read10 (void *udev, uint8_t lun)
bulk-only transport scsi command read10 More...
usb_sts_type | bot_scsi_capacity (void *udev, uint8_t lun)
bulk-only transport scsi command capacity More...
usb_sts_type | bot_scsi_format_capacity (void *udev, uint8_t lun)
bulk-only transport scsi command format capacity More...
usb_sts_type | bot_scsi_request_sense (void *udev, uint8_t lun)
bulk-only transport scsi command request sense More...
usb_sts_type | bot_scsi_verify (void *udev, uint8_t lun)
bulk-only transport scsi command verify More...
usb_sts_type | bot_scsi_write10 (void *udev, uint8_t lun)
bulk-only transport scsi command write10 More...
void | bot_scsi_clear_feature (void *udev, uint8_t ept_num)
clear feature More...

Detailed Description

usb mass storage bulk-only transport and scsi command header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file msc_bot_scsi.h.


AT32F415 Firmwary Library: msc_class.c File Reference

  • middlewares
  • usbd_class
  • msc
Functions | Variables
msc_class.c File Reference

usb msc class type More...

#include "usbd_core.h"
#include "msc_class.h"
#include "msc_desc.h"
#include "msc_bot_scsi.h"

Go to the source code of this file.

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device event handler More...

Variables

static uint32_t | alt_setting = 0
msc_type msc_struct
cbw_type cbw_struct
csw_type csw_struct
usbd_class_handler | msc_class_handler

Detailed Description

usb msc class type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file msc_class.c.


AT32F415 Firmwary Library: msc_class.h File Reference

  • middlewares
  • usbd_class
  • msc
Macros | Variables
msc_class.h File Reference

usb msc class file More...

#include "usb_std.h"
#include "usbd_core.h"

Go to the source code of this file.

Macros

#define | USBD_MSC_BULK_IN_EPT 0x81
#define | USBD_MSC_BULK_OUT_EPT 0x01
#define | USBD_IN_MAXPACKET_SIZE 0x40
#define | USBD_OUT_MAXPACKET_SIZE 0x40

Variables

usbd_class_handler msc_class_handler

Detailed Description

usb msc class file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file msc_class.h.


AT32F415 Firmwary Library: msc_desc.c File Reference

  • middlewares
  • usbd_class
  • msc
Functions | Variables
msc_desc.c File Reference

usb msc device descriptor More...

#include "stdio.h"
#include "usb_std.h"
#include "usbd_sdr.h"
#include "usbd_core.h"
#include "msc_desc.h"

Go to the source code of this file.

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | msc_desc_handler
device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

usb msc device descriptor

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file msc_desc.c.


AT32F415 Firmwary Library: msc_desc.h File Reference

  • middlewares
  • usbd_class
  • msc
Macros | Variables
msc_desc.h File Reference

usb msc descriptor header file More...

#include "msc_class.h"
#include "usbd_core.h"

Go to the source code of this file.

Macros

#define | BCD_NUM 0x0110
#define | USBD_VENDOR_ID 0x2E3C
#define | USBD_PRODUCT_ID 0x5720
#define | USBD_CONFIG_DESC_SIZE 32
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
#define | USBD_DESC_PRODUCT_STRING "AT32 Mass Storage"
#define | USBD_DESC_CONFIGURATION_STRING "Mass Storage Config"
#define | USBD_DESC_INTERFACE_STRING "Mass Storage Interface"
#define | HID_BINTERVAL_TIME 0xFF
#define | USBD_CDC_CS_INTERFACE 0x24
#define | USBD_CDC_CS_ENDPOINT 0x25
#define | USBD_CDC_SUBTYPE_HEADER 0x00
#define | USBD_CDC_SUBTYPE_CMF 0x01
#define | USBD_CDC_SUBTYPE_ACM 0x02
#define | USBD_CDC_SUBTYPE_UFD 0x06
#define | MCU_ID1 (0x1FFFF7E8)
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [32]
usbd_desc_handler | msc_desc_handler
device descriptor handler structure More...

Detailed Description

usb msc descriptor header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file msc_desc.h.


AT32F415 Firmwary Library: printer_class.c File Reference

  • middlewares
  • usbd_class
  • printer
Functions | Variables
printer_class.c File Reference

usb printer class type More...

#include "usbd_core.h"
#include "printer_class.h"
#include "printer_desc.h"

Go to the source code of this file.

Functions

usb_sts_type | class_init_handler (void *udev)
initialize usb custom hid endpoint More...
usb_sts_type | class_clear_handler (void *udev)
clear endpoint or other state More...
usb_sts_type | class_setup_handler (void *udev, usb_setup_type *setup)
usb device class setup request handler More...
usb_sts_type | class_ept0_tx_handler (void *udev)
usb device endpoint 0 in status stage complete More...
usb_sts_type | class_ept0_rx_handler (void *udev)
usb device endpoint 0 out status stage complete More...
usb_sts_type | class_in_handler (void *udev, uint8_t ept_num)
usb device transmision complete handler More...
usb_sts_type | class_out_handler (void *udev, uint8_t ept_num)
usb device endpoint receive data More...
usb_sts_type | class_sof_handler (void *udev)
usb device sof handler More...
usb_sts_type | class_event_handler (void *udev, usbd_event_type event)
usb device event handler More...
error_status | usb_printer_send_data (void *udev, uint8_t *send_data, uint16_t len)
usb device class send data More...

Variables

static uint32_t | alt_setting = 0
static uint8_t | g_rx_buff [0x40]
__IO uint8_t | g_tx_completed = 1
__IO uint8_t | g_rx_completed = 0
uint8_t | PRINTER_DEVICE_ID [24]
static uint32_t | g_printer_port_status = 0x18
uint8_t | g_printer_data [0x40]
usbd_class_handler | class_handler

Detailed Description

usb printer class type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file printer_class.c.


AT32F415 Firmwary Library: printer_class.h File Reference

  • middlewares
  • usbd_class
  • printer
Data Structures | Macros | Enumerations | Functions | Variables
printer_class.h File Reference

usb cdc class file More...

#include "usb_std.h"
#include "usbd_core.h"

Go to the source code of this file.

Data Structures

struct linecoding_type
usb cdc class set line coding struct More...

Macros

#define | USBD_PRINTER_BULK_IN_EPT 0x81
#define | USBD_PRINTER_BULK_OUT_EPT 0x01
#define | USBD_IN_MAXPACKET_SIZE 0x40
#define | USBD_OUT_MAXPACKET_SIZE 0x40
#define | PRINTER_DEVICE_ID_LEN 24
#define | SET_LINE_CODING 0x20
#define | GET_LINE_CODING 0x21

Enumerations

enum printer_req_type { PRINTER_REQ_GET_DEVICE_ID = 0x00 , PRINTER_REQ_GET_PORT_STATUS = 0x01 , PRINTER_REQ_GET_SOFT_RESET = 0x02 }

Functions

uint16_t | usb_printer_get_rxdata (void *udev, uint8_t *recv_data)
error_status | usb_printer_send_data (void *udev, uint8_t *send_data, uint16_t len)
usb device class send data More...

Variables

usbd_class_handler class_handler

Detailed Description

usb cdc class file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file printer_class.h.


AT32F415 Firmwary Library: printer_desc.c File Reference

  • middlewares
  • usbd_class
  • printer
Functions | Variables
printer_desc.c File Reference

usb printer device descriptor More...

#include "stdio.h"
#include "usb_std.h"
#include "usbd_sdr.h"
#include "usbd_core.h"
#include "printer_desc.h"

Go to the source code of this file.

Functions

usbd_desc_t * | get_device_descriptor (void)
get device descriptor More...
usbd_desc_t * | get_device_qualifier (void)
get device qualifier More...
usbd_desc_t * | get_device_configuration (void)
get config descriptor More...
usbd_desc_t * | get_device_other_speed (void)
get other speed descriptor More...
usbd_desc_t * | get_device_lang_id (void)
get lang id descriptor More...
usbd_desc_t * | get_device_manufacturer_string (void)
get manufacturer descriptor More...
usbd_desc_t * | get_device_product_string (void)
get product descriptor More...
usbd_desc_t * | get_device_serial_string (void)
get serial descriptor More...
usbd_desc_t * | get_device_interface_string (void)
get interface descriptor More...
usbd_desc_t * | get_device_config_string (void)
get device config descriptor More...
uint16_t | usbd_unicode_convert (uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert More...
static void | usbd_int_to_unicode (uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode More...
static void | get_serial_num (void)
usb get serial number More...

Variables

static uint8_t | g_usbd_desc_buffer [256]
usbd_desc_handler | desc_handler
device descriptor handler structure More...
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] | ALIGNED_TAIL
usb device standard descriptor More...
usbd_desc_t | device_descriptor
usbd_desc_t | config_descriptor
usbd_desc_t | langid_descriptor
usbd_desc_t | serial_descriptor
usbd_desc_t | vp_desc

Detailed Description

usb printer device descriptor

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file printer_desc.c.


AT32F415 Firmwary Library: printer_desc.h File Reference

  • middlewares
  • usbd_class
  • printer
Macros | Variables
printer_desc.h File Reference

usb printer descriptor header file More...

#include "printer_class.h"
#include "usbd_core.h"

Go to the source code of this file.

Macros

#define | BCD_NUM 0x0110
#define | USBD_VENDOR_ID 0x2E3C
#define | USBD_PRODUCT_ID 0x57FF
#define | USBD_CONFIG_DESC_SIZE 32
#define | USBD_SIZ_STRING_LANGID 4
#define | USBD_SIZ_STRING_SERIAL 0x1A
#define | USBD_DESC_MANUFACTURER_STRING "Artery"
#define | USBD_DESC_PRODUCT_STRING "AT32 Printer"
#define | USBD_DESC_CONFIGURATION_STRING "Printer Config"
#define | USBD_DESC_INTERFACE_STRING "Printer Interface"
#define | PRINTER_PROTOCOL_UNIDIRECTIONAL 0x01
#define | PRINTER_PROTOCOL_BI_DIRECTIONAL 0x02
#define | PRINTER_PROTOCOL_1284_4 0x03
#define | PRINTER_PROTOCOL_VENDOR_SPECIFIC 0xFF
#define | HID_BINTERVAL_TIME 0xFF
#define | MCU_ID1 (0x1FFFF7E8)
#define | MCU_ID2 (0x1FFFF7EC)
#define | MCU_ID3 (0x1FFFF7F0)

Variables

uint8_t | g_usbd_descriptor [USB_DEVICE_DESC_LEN]
uint8_t | g_usbd_configuration [32]
usbd_desc_handler | desc_handler
device descriptor handler structure More...

Detailed Description

usb printer descriptor header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file printer_desc.h.


AT32F415 Firmwary Library: usbh_hid_class.c File Reference

  • middlewares
  • usbh_class
  • usbh_hid
Functions | Variables
usbh_hid_class.c File Reference

usb host hid class type More...

#include "usbh_hid_class.h"
#include "usb_conf.h"
#include "usbh_core.h"
#include "usbh_ctrl.h"
#include "usbh_hid_mouse.h"
#include "usbh_hid_keyboard.h"

Go to the source code of this file.

Functions

usb_sts_type | uhost_init_handler (void *uhost)
usb host class init handler More...
usb_sts_type | uhost_reset_handler (void *uhost)
usb host class reset handler More...
usb_sts_type | uhost_request_handler (void *uhost)
usb host hid class request handler More...
usb_sts_type | uhost_process_handler (void *uhost)
usb host hid class process handler More...
usb_sts_type | usbh_hid_get_desc (void *uhost, uint16_t length)
usb host hid class get descriptor More...
usb_sts_type | usbh_hid_get_report (void *uhost, uint16_t length)
usb host hid class get report More...
usb_sts_type | usbh_hid_set_idle (void *uhost, uint8_t id, uint8_t dr)
usb host hid class set idle More...
usb_sts_type | usbh_hid_set_protocol (void *uhost, uint8_t protocol)
usb host hid class set protocol More...
usb_sts_type | usbh_clear_endpoint_feature (usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num)
usb host clear feature More...

Variables

usbh_hid_type usbh_hid
usbh_class_handler_type uhost_class_handler

Detailed Description

usb host hid class type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_hid_class.c.


AT32F415 Firmwary Library: usbh_hid_class.h File Reference

  • middlewares
  • usbh_class
  • usbh_hid
Data Structures | Macros | Enumerations | Variables
usbh_hid_class.h File Reference

usb host hid class header file More...

#include "usbh_core.h"
#include "usb_conf.h"

Go to the source code of this file.

Data Structures

struct | usb_hid_desc_type
usb hid descriptor type More...
struct | usbh_hid_type
usb hid struct More...

Macros

#define | USB_HID_NONE_PROTOCOL_CODE 0x00
usb hid protocol code More...
#define | USB_HID_KEYBOARD_PROTOCOL_CODE 0x01
#define | USB_HID_MOUSE_PROTOCOL_CODE 0x02
#define | USB_HID_GET_REPORT 0x01
usb hid request code More...
#define | USB_HID_GET_IDLE 0x02
#define | USB_HID_GET_PROTOCOL 0x03
#define | USB_HID_SET_REPORT 0x09
#define | USB_HID_SET_IDLE 0x0A
#define | USB_HID_SET_PROTOCOL 0x0B

Enumerations

enum usb_hid_ctrl_state_type {
USB_HID_STATE_IDLE , USB_HID_STATE_GET_DESC , USB_HID_STATE_GET_REPORT , USB_HID_STATE_SET_IDLE ,
USB_HID_STATE_SET_PROTOCOL , USB_HID_STATE_COMPLETE
}
usb hid request state More...
enum usb_hid_state_type {
USB_HID_INIT , USB_HID_GET , USB_HID_SEND , USB_HID_POLL ,
USB_HID_BUSY , USB_HID_ERROR
}
usb hid process state More...

Variables

usbh_class_handler_type uhost_class_handler

Detailed Description

usb host hid class header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_hid_class.h.


AT32F415 Firmwary Library: usbh_hid_keyboard.c File Reference

  • middlewares
  • usbh_class
  • usbh_hid
Functions | Variables
usbh_hid_keyboard.c File Reference

usb host hid keyboard type More...

#include "usbh_hid_keyboard.h"

Go to the source code of this file.

Functions

void usbh_hid_keyboard_decode (uint8_t *data)
usb host hid keyboard decode More...

Variables

static const uint8_t | hid_keyboard_codes []
static const int8_t | hid_keyboard_key []
static const int8_t | hid_keyboard_key_shift []

Detailed Description

usb host hid keyboard type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_hid_keyboard.c.


AT32F415 Firmwary Library: usbh_hid_keyboard.h File Reference

  • middlewares
  • usbh_class
  • usbh_hid
Macros | Functions
usbh_hid_keyboard.h File Reference

usb host hid keyboard header file More...

#include "usb_conf.h"

Go to the source code of this file.

Macros

#define | KEYBOARD_LEFT_CTRL 0x01
usb keyboard option code More...
#define | KEYBOARD_LEFT_SHIFT 0x02
#define | KEYBOARD_LEFT_ALT 0x04
#define | KEYBOARD_LEFT_GUI 0x08
#define | KEYBOARD_RIGHT_CTRL 0x10
#define | KEYBOARD_RIGHT_SHIFT 0x20
#define | KEYBOARD_RIGHT_ALT 0x40
#define | KEYBOARD_RIGHT_GUI 0x80
#define | KEYBOARD_MAX_NB_PRESSED 6
#define | QWERTY_KEYBOARD

Functions

void usbh_hid_keyboard_decode (uint8_t *data)
usb host hid keyboard decode More...

Detailed Description

usb host hid keyboard header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_hid_keyboard.h.


AT32F415 Firmwary Library: usbh_hid_mouse.c File Reference

  • middlewares
  • usbh_class
  • usbh_hid
Functions | Variables
usbh_hid_mouse.c File Reference

usb host hid mouse type More...

#include "usbh_hid_mouse.h"

Go to the source code of this file.

Functions

void | usbh_hid_mouse_position (uint8_t x, uint8_t y)
usb host hid position More...
void | usbh_hid_mouse_button_press (uint8_t button)
usb host hid button press More...
void | usbh_hid_mouse_button_release (uint8_t button)
usb host hid button release More...
void | usbh_hid_mouse_process (usb_hid_mouse_type *mouse)
usb host hid mouse process More...
void | usbh_hid_mouse_decode (uint8_t *mouse_data)
usb host hid mouse decode More...

Variables

usb_hid_mouse_type hid_mouse
uint16_t | x_pos = 0
uint16_t | y_pos = 0

Detailed Description

usb host hid mouse type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_hid_mouse.c.


AT32F415 Firmwary Library: usbh_hid_mouse.h File Reference

  • middlewares
  • usbh_class
  • usbh_hid
Data Structures | Macros | Functions
usbh_hid_mouse.h File Reference

usb host hid mouse header file More...

#include "usb_conf.h"

Go to the source code of this file.

Data Structures

struct usb_hid_mouse_type
usb hid mouse type More...

Macros

#define | MOUSE_WINDOW_X 100
usb hid mouse x y More...
#define | MOUSE_WINDOW_Y 220
#define | MOUSE_WINDOW_HEIGHT 90
#define | MOUSE_WINDOW_WIDTH 128
#define | MOUSE_BUTTON_LEFT 0x00
usb hid mouse button More...
#define | MOUSE_BUTTON_RIGHT 0x01
#define | MOUSE_BUTTON_MIDDLE 0x02

Functions

void usbh_hid_mouse_decode (uint8_t *mouse_data)
usb host hid mouse decode More...

Detailed Description

usb host hid mouse header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_hid_mouse.h.


AT32F415 Firmwary Library: usbh_msc_bot_scsi.c File Reference

  • middlewares
  • usbh_class
  • usbh_msc
Functions
usbh_msc_bot_scsi.c File Reference

usb host msc bulk-only transfer and scsi type More...

#include "usbh_msc_bot_scsi.h"
#include "usbh_msc_class.h"
#include "usb_conf.h"
#include "usbh_core.h"
#include "usbh_ctrl.h"

Go to the source code of this file.

Functions

static usb_sts_type | usbh_bot_cbw (msc_bot_cbw_type *cbw, uint32_t data_length, uint8_t cmd_len, uint8_t flag)
usb host bulk-only cbw More...
static usb_sts_type | usbh_cmd_inquiry (msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
usb host msc command inquiry More...
static usb_sts_type | usbh_cmd_capacity10 (msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
usb host msc command capacity10 More...
static usb_sts_type | usbh_cmd_test_unit_ready (msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
usb host msc command test unit ready More...
static usb_sts_type | usbh_cmd_requset_sense (msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
usb host msc command request sense More...
static usb_sts_type | usbh_cmd_write (msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun, uint32_t data_len, uint32_t address, uint8_t *buffer)
usb host msc command write More...
static usb_sts_type | usbh_cmd_read (msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun, uint32_t data_len, uint32_t address, uint8_t *buffer)
usb host msc command read More...
usb_sts_type | usbh_check_csw (msc_bot_cbw_type *cbw, msc_bot_csw_type *csw)
usb host csw check More...
usb_sts_type | usb_bot_request (void *uhost, msc_bot_trans_type *bot_trans)
usb host msc bulk-only request More...
usb_sts_type | usbh_msc_bot_scsi_get_inquiry (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_inquiry *inquiry)
usb host msc bulk-only get inquiry request More...
usb_sts_type | usbh_msc_bot_scsi_capacity (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_capacity *capacity)
usb host msc bulk-only capacity request More...
usb_sts_type | usbh_msc_bot_scsi_test_unit_ready (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only tet unit ready request More...
usb_sts_type | usbh_msc_bot_scsi_request_sense (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only request sense request More...
usb_sts_type | usbh_msc_bot_scsi_write (void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *write_data, uint32_t write_len, uint8_t lun)
usb host msc bulk-only write request More...
usb_sts_type | usbh_msc_bot_scsi_read (void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *read_data, uint32_t read_len, uint8_t lun)
usb host msc bulk-only read request More...
usb_sts_type msc_bot_scsi_init (usbh_msc_type *msc_struct)
usb host msc init More...

Detailed Description

usb host msc bulk-only transfer and scsi type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_msc_bot_scsi.c.


AT32F415 Firmwary Library: usbh_msc_bot_scsi.h File Reference

  • middlewares
  • usbh_class
  • usbh_msc
Data Structures | Macros | Enumerations | Functions
usbh_msc_bot_scsi.h File Reference

usb host msc bulk-only transfer and scsi header file More...

#include "usbh_core.h"
#include "usb_conf.h"

Go to the source code of this file.

Data Structures

struct | msc_scsi_data_inquiry
usb msc inquiry data type More...
struct | msc_scsi_data_capacity
usb msc capacity data type More...
struct | msc_bot_cbw_type
usb msc bulk-only command block wrapper type More...
struct | msc_bot_csw_type
usb msc bulk-only command status wrapper type More...
struct | msc_bot_trans_type
usb msc bulk-only transfer control type More...
struct | usbh_msc_unit_type
usb msc bank type More...

Macros

#define | MSC_CBW_SIGNATURE 0x43425355
#define | MSC_CSW_SIGNATURE 0x53425355
#define | MSC_CBW_TAG 0x50607080
#define | MSC_CBW_FLAG_IN 0x80
#define | MSC_CBW_FLAG_OUT 0x00
#define | MSC_CBW_LEN 31
#define | MSC_CSW_LEN 13
#define | MSC_CBW_CB_LEN 16
#define | MSC_TEST_UNIT_READY_CMD_LEN 12
#define | MSC_TEST_UNIT_READY_DATA_LEN 0
#define | MSC_INQUIRY_CMD_LEN 12
#define | MSC_INQUIRY_DATA_LEN 36
#define | MSC_CAPACITY10_CMD_LEN 12
#define | MSC_CAPACITY10_DATA_LEN 8
#define | MSC_REQUEST_SENSE_CMD_LEN 12
#define | MSC_REQUEST_SENSE_DATA_LEN 18
#define | MSC_WRITE_CMD_LEN 12
#define | MSC_READ_CMD_LEN 10
#define | MSC_OPCODE_INQUIRY 0x12
#define | MSC_OPCODE_CAPACITY 0x25
#define | MSC_OPCODE_TEST_UNIT_READY 0x00
#define | MSC_OPCODE_REQUEST_SENSE 0x03
#define | MSC_OPCODE_WRITE10 0x2A
#define | MSC_OPCODE_READ10 0x28

Enumerations

enum msc_bot_state_type {
BOT_STATE_IDLE , BOT_STATE_SEND_CBW , BOT_STATE_SEND_CBW_WAIT , BOT_STATE_DATA_IN ,
BOT_STATE_DATA_IN_WAIT , BOT_STATE_DATA_OUT , BOT_STATE_DATA_OUT_WAIT , BOT_STATE_RECV_CSW ,
BOT_STATE_RECV_CSW_WAIT , BOT_STATE_ERROR , BOT_STATE_COMPLETE
}
enum | msc_cmd_state_type { CMD_STATE_SEND , CMD_STATE_WAIT }
enum msc_state_type {
USBH_MSC_INIT , USBH_MSC_INQUIRY , USBH_MSC_TEST_UNIT_READY , USBH_MSC_READ_CAPACITY10 ,
USBH_MSC_REQUEST_SENSE , USBH_MSC_READ10 , USBH_MSC_WRITE , USBH_MSC_BUSY ,
USBH_MSC_ERROR , USBH_MSC_IDLE
}
usb msc process state More...
enum | msc_error_type { MSC_OK , MSC_NOT_READY , MSC_ERROR }

Functions

usb_sts_type | usb_bot_request (void *uhost, msc_bot_trans_type *bot_trans)
usb host msc bulk-only request More...
usb_sts_type | usbh_msc_bot_scsi_get_inquiry (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_inquiry *inquiry)
usb host msc bulk-only get inquiry request More...
usb_sts_type | usbh_msc_bot_scsi_capacity (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_capacity *capacity)
usb host msc bulk-only capacity request More...
usb_sts_type | usbh_msc_bot_scsi_test_unit_ready (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only tet unit ready request More...
usb_sts_type | usbh_msc_bot_scsi_request_sense (void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only request sense request More...
usb_sts_type | usbh_msc_bot_scsi_write (void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *write_data, uint32_t write_len, uint8_t lun)
usb host msc bulk-only write request More...
usb_sts_type | usbh_msc_bot_scsi_read (void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *read_data, uint32_t read_len, uint8_t lun)
usb host msc bulk-only read request More...

Detailed Description

usb host msc bulk-only transfer and scsi header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_msc_bot_scsi.h.


AT32F415 Firmwary Library: usbh_msc_class.c File Reference

  • middlewares
  • usbh_class
  • usbh_msc
Functions | Variables
usbh_msc_class.c File Reference

usb host msc class type More...

#include "usbh_msc_class.h"
#include "usb_conf.h"
#include "usbh_core.h"
#include "usbh_ctrl.h"

Go to the source code of this file.

Functions

usb_sts_type | uhost_init_handler (void *uhost)
usb host class init handler More...
usb_sts_type | uhost_reset_handler (void *uhost)
usb host class reset handler More...
usb_sts_type | uhost_request_handler (void *uhost)
usb host hid class request handler More...
usb_sts_type | uhost_process_handler (void *uhost)
usb host class process handler More...
usb_sts_type | usbh_msc_get_max_lun (void *uhost, uint8_t *lun)
usb host msc get max lun More...
usb_sts_type | usbh_msc_clear_feature (void *uhost, uint8_t ept_num)
usb host msc clear feature More...
msc_error_type | usbh_msc_is_ready (void *uhost, uint8_t lun)
usb host msc clear feature More...
usb_sts_type | usbh_msc_read (void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc read More...
usb_sts_type | usbh_msc_write (void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc write More...

Variables

usbh_msc_type usbh_msc
usbh_class_handler_type uhost_class_handler

Detailed Description

usb host msc class type

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_msc_class.c.


AT32F415 Firmwary Library: usbh_msc_class.h File Reference

  • middlewares
  • usbh_class
  • usbh_msc
Data Structures | Macros | Enumerations | Functions | Variables
usbh_msc_class.h File Reference

usb host msc class header file More...

#include "usbh_core.h"
#include "usb_conf.h"
#include "usbh_msc_bot_scsi.h"

Go to the source code of this file.

Data Structures

struct | usb_hid_desc_type
usb hid descriptor type More...
struct | usbh_msc_type
usb msc struct More...

Macros

#define | MSC_SUBCLASS_SCSI_TRANS 0x06
usb msc subclass code More...
#define | MSC_PROTOCOL_BBB 0x50
usb msc protocol code More...
#define | MSC_REQ_GET_MAX_LUN 0xFE
usb msc request code More...
#define | MSC_REQ_BOMSR 0xFF
#define | USB_HID_GET_REPORT 0x01
usb hid request code More...
#define | USB_HID_GET_IDLE 0x02
#define | USB_HID_GET_PROTOCOL 0x03
#define | USB_HID_SET_REPORT 0x09
#define | USB_HID_SET_IDLE 0x0A
#define | USB_HID_SET_PROTOCOL 0x0B
#define | USBH_SUPPORT_MAX_LUN 0x2

Enumerations

enum usbh_msc_ctrl_state_type { USBH_MSC_STATE_IDLE , USBH_MSC_STATE_GET_LUN , USBH_MSC_STATE_ERROR , USBH_MSC_STATE_COMPLETE }
usb msc request state More...

Functions

msc_error_type | usbh_msc_is_ready (void *uhost, uint8_t lun)
usb host msc clear feature More...
usb_sts_type | usbh_msc_write (void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc write More...
usb_sts_type | usbh_msc_read (void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc read More...
usb_sts_type msc_bot_scsi_init (usbh_msc_type *msc_struct)
usb host msc init More...

Variables

usbh_class_handler_type uhost_class_handler
usbh_msc_type usbh_msc

Detailed Description

usb host msc class header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_msc_class.h.


AT32F415 Firmwary Library: at32f415_board.c File Reference

  • project
  • at32f415_board
Macros | Functions | Variables
at32f415_board.c File Reference

set of firmware functions to manage leds and push-button. initialize delay function. More...

#include "at32f415_board.h"

Go to the source code of this file.

Macros

#define | STEP_DELAY_MS 50
#define | PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)

Functions

int | fputc (int ch, FILE *f)
retargets the c library printf function to the usart. More...
void | uart_print_init (uint32_t baudrate)
initialize uart More...
void | at32_board_init ()
board initialize interface init led and button More...
void | at32_button_init (void)
configure button gpio More...
uint8_t | at32_button_state (void)
returns the selected button state
More...
button_type at32_button_press ()
returns which button have press down More...
void | at32_led_init (led_type led)
configure led gpio
More...
void | at32_led_on (led_type led)
turns selected led on. More...
void | at32_led_off (led_type led)
turns selected led off. More...
void | at32_led_toggle (led_type led)
turns selected led tooggle. More...
void | delay_init ()
initialize delay function
More...
void | delay_us (uint32_t nus)
inserts a delay time. More...
void | delay_ms (uint16_t nms)
inserts a delay time. More...
void | delay_sec (uint16_t sec)
inserts a delay time. More...

Variables

gpio_type * | led_gpio_port [3] = {LED2_GPIO, LED3_GPIO, LED4_GPIO}
uint16_t | led_gpio_pin [3] = {LED2_PIN, LED3_PIN, LED4_PIN}
crm_periph_clock_type | led_gpio_crm_clk [3] = {LED2_GPIO_CRM_CLK, LED3_GPIO_CRM_CLK, LED4_GPIO_CRM_CLK}
static __IO uint32_t | fac_us
static __IO uint32_t | fac_ms

Detailed Description

set of firmware functions to manage leds and push-button. initialize delay function.

Version
v2.0.2
Date
2021-12-31
        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.

Definition in file at32f415_board.c.


AT32F415 Firmwary Library: at32f415_board.h File Reference

  • at32f415_board
Macros | Enumerations | Functions
at32f415_board.h File Reference

header file for at-start board. set of firmware functions to manage leds and push-button. initialize delay function. More...

#include "stdio.h"
#include "at32f415.h"

Go to the source code of this file.

Macros

#define | LED_NUM 3
#define | PRINT_UART USART1
#define | PRINT_UART_CRM_CLK CRM_USART1_PERIPH_CLOCK
#define | PRINT_UART_TX_PIN GPIO_PINS_9
#define | PRINT_UART_TX_GPIO GPIOA
#define | PRINT_UART_TX_GPIO_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
#define | USER_BUTTON_PIN GPIO_PINS_0
#define | USER_BUTTON_PORT GPIOA
#define | USER_BUTTON_CRM_CLK CRM_GPIOA_PERIPH_CLOCK

Enumerations

enum | led_type { LED2 = 0 , LED3 = 1 , LED4 = 2 }
enum | button_type { USER_BUTTON = 0 , NO_BUTTON = 1 }

Functions

void | at32_board_init (void)
board initialize interface init led and button More...
void | at32_led_init (led_type led)
configure led gpio
More...
void | at32_led_on (led_type led)
turns selected led on. More...
void | at32_led_off (led_type led)
turns selected led off. More...
void | at32_led_toggle (led_type led)
turns selected led tooggle. More...
void | at32_button_init (void)
configure button gpio More...
button_type | at32_button_press (void)
returns which button have press down More...
uint8_t | at32_button_state (void)
returns the selected button state
More...
void | delay_init (void)
initialize delay function
More...
void | delay_us (uint32_t nus)
inserts a delay time. More...
void | delay_ms (uint16_t nms)
inserts a delay time. More...
void | delay_sec (uint16_t sec)
inserts a delay time. More...
void | uart_print_init (uint32_t baudrate)
initialize uart More...

Detailed Description

header file for at-start board. set of firmware functions to manage leds and push-button. initialize delay function.

Version
v2.0.2
Date
2021-12-31
        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.

Definition in file at32f415_board.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • at_start_f415
  • examples
  • adc
  • current_vref_value_check
  • inc
Functions
project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • adc
  • exint_trigger_partitioned
  • inc
Functions
project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • adc
  • internal_temperature_sensor
  • inc
Functions
project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • adc
  • software_trigger_repeat
  • inc
Functions
project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • adc
  • tmr_trigger_automatic_preempted
  • inc
Functions
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • adc
  • voltage_monitoring
  • inc
Functions
project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • can
  • communication_mode
  • inc
Functions
project/at_start_f415/examples/can/communication_mode/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/communication_mode/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • can
  • filter
  • inc
Functions
project/at_start_f415/examples/can/filter/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/filter/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • can
  • loopback_mode
  • inc
Functions
project/at_start_f415/examples/can/loopback_mode/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • cmp
  • deep_sleep_mode
  • inc
Functions
project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • cmp
  • output
  • inc
Functions
project/at_start_f415/examples/cmp/output/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cmp/output/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • cortex_m4
  • bit_band
  • inc
Functions
project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • cortex_m4
  • systick_interrupt
  • inc
Functions
project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • crc
  • calculation
  • inc
Functions
project/at_start_f415/examples/crc/calculation/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crc/calculation/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • crm
  • clock_failure_detection
  • inc
Functions
project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • crm
  • pll_config2
  • inc
Functions
project/at_start_f415/examples/crm/pll_config2/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • crm
  • sysclk_switch
  • inc
Functions
project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • debug
  • tmr1
  • inc
Functions
project/at_start_f415/examples/debug/tmr1/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/debug/tmr1/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • dma
  • data_to_gpio_flexible
  • inc
Functions
project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • dma
  • flash_to_sram
  • inc
Functions
project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • ertc
  • bpr_domain
  • inc
Functions
project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • ertc
  • calendar
  • inc
Functions
project/at_start_f415/examples/ertc/calendar/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/calendar/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • ertc
  • lick_calibration
  • inc
Functions
project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • ertc
  • tamper
  • inc
Functions
project/at_start_f415/examples/ertc/tamper/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/tamper/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • ertc
  • time_stamp
  • inc
Functions
project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • ertc
  • wakeup_timer
  • inc
Functions
project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • exint
  • exint_config
  • inc
Functions
project/at_start_f415/examples/exint/exint_config/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/exint/exint_config/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • exint
  • exint_software_trigger
  • inc
Functions
project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • flash
  • flash_write_read
  • inc
Functions
project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • gpio
  • led_toggle
  • inc
Functions
project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • gpio
  • swjtag_remap
  • inc
Functions
project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • i2c
  • communication_dma
  • inc
Functions
project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • i2c
  • communication_int
  • inc
Functions
project/at_start_f415/examples/i2c/communication_int/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • i2c
  • communication_poll
  • inc
Functions
project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • i2c
  • eeprom
  • inc
Functions
project/at_start_f415/examples/i2c/eeprom/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • i2s
  • halfduplex_dma
  • inc
Functions
project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • i2s
  • halfduplex_interrupt
  • inc
Functions
project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • i2s
  • spii2s_switch_halfduplex_polling
  • inc
Functions
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • pwc
  • deepsleep_ertc_alarm
  • inc
Functions
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • pwc
  • deepsleep_ertc_tamper
  • inc
Functions
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • pwc
  • power_voltage_monitor
  • inc
Functions
project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • pwc
  • sleep_tmr2
  • inc
Functions
project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • pwc
  • sleep_usart1
  • inc
Functions
project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • pwc
  • standby_ertc_alarm
  • inc
Functions
project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • pwc
  • standby_wakeup_pin
  • inc
Functions
project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • sdio
  • sd_mmc_card
  • inc
Functions
project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • sdio
  • sdio_fatfs
  • inc
Functions
project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • spi
  • crc_transfer_polling
  • inc
Functions
project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • spi
  • fullduplex_polling
  • inc
Functions
project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • spi
  • halfduplex_interrupt
  • inc
Functions
project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • spi
  • halfduplex_transceiver_switch
  • inc
Functions
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • spi
  • only_receive_mode_polling
  • inc
Functions
project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • spi
  • use_jtagpin_hardwarecs_dma
  • inc
Functions
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • spi
  • w25q_flash
  • inc
Functions
project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • 6_steps
  • inc
Functions
project/at_start_f415/examples/tmr/6_steps/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • 7_pwm_output
  • inc
Functions
project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • cascade_synchro
  • inc
Functions
project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • complementary_signals
  • inc
Functions
project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • dma
  • inc
Functions
project/at_start_f415/examples/tmr/dma/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/dma/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • dma_burst
  • inc
Functions
project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • encoder_tmr2
  • inc
Functions
project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • external_clock
  • inc
Functions
project/at_start_f415/examples/tmr/external_clock/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • hall_xor_tmr2
  • inc
Functions
project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • hang_mode
  • inc
Functions
project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • input_capture
  • inc
Functions
project/at_start_f415/examples/tmr/input_capture/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • oc_high
  • inc
Functions
project/at_start_f415/examples/tmr/oc_high/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • oc_low
  • inc
Functions
project/at_start_f415/examples/tmr/oc_low/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • oc_toggle_tmr3
  • inc
Functions
project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • oc_toggle_tmr9
  • inc
Functions
project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • one_cycle
  • inc
Functions
project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • parallel_synchro
  • inc
Functions
project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • pwm_input
  • inc
Functions
project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • pwm_input_dma
  • inc
Functions
project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • pwm_output_simulate
  • inc
Functions
project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • pwm_output_tmr10
  • inc
Functions
project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • pwm_output_tmr3
  • inc
Functions
project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • timer_base
  • inc
Functions
project/at_start_f415/examples/tmr/timer_base/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • tmr1_synchro
  • inc
Functions
project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • tmr
  • tmr2_32bit
  • inc
Functions
project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usart
  • half_duplex
  • inc
Functions
project/at_start_f415/examples/usart/half_duplex/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usart
  • hw_flow_control
  • inc
Functions
project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usart
  • idle_detection
  • inc
Functions
project/at_start_f415/examples/usart/idle_detection/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usart
  • interrupt
  • inc
Functions
project/at_start_f415/examples/usart/interrupt/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/interrupt/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usart
  • irda
  • inc
Functions
project/at_start_f415/examples/usart/irda/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/irda/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usart
  • polling
  • inc
Functions
project/at_start_f415/examples/usart/polling/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/polling/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usart
  • printf
  • inc
Functions
project/at_start_f415/examples/usart/printf/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/printf/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usart
  • receiver_mute
  • inc
Functions
project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usart
  • smartcard
  • inc
Functions
project/at_start_f415/examples/usart/smartcard/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/smartcard/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usart
  • synchronous
  • inc
Functions
project/at_start_f415/examples/usart/synchronous/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/synchronous/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usart
  • transfer_by_dma_interrupt
  • inc
Functions
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usart
  • transfer_by_dma_polling
  • inc
Functions
project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usb_device
  • audio
  • inc
Functions
project/at_start_f415/examples/usb_device/audio/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/audio/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usb_device
  • composite_audio_hid
  • inc
Functions
project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usb_device
  • composite_vcp_keyboard
  • inc
Functions
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usb_device
  • custom_hid
  • inc
Functions
project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usb_device
  • keyboard
  • inc
Functions
project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usb_device
  • mouse
  • inc
Functions
project/at_start_f415/examples/usb_device/mouse/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usb_device
  • msc
  • inc
Functions
project/at_start_f415/examples/usb_device/msc/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/msc/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usb_device
  • printer
  • inc
Functions
project/at_start_f415/examples/usb_device/printer/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/printer/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usb_device
  • vcp_loopback
  • inc
Functions
project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usb_device
  • virtual_msc_iap
  • inc
Functions
project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usb_host
  • hid_demo
  • inc
Functions
project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • usb_host
  • msc_only_fat32
  • inc
Functions
project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • wdt
  • wdt_reset
  • inc
Functions
project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • wwdt
  • wwdt_reset
  • inc
Functions
project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • templates
  • inc
Functions
project/at_start_f415/templates/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/templates/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • inc
Functions
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • inc
Functions
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • utilities
  • at32f415_freertos_demo
  • inc
Functions
utilities/at32f415_freertos_demo/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_freertos_demo/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • utilities
  • at32f415_gen_random_number_demo
  • inc
Functions
utilities/at32f415_gen_random_number_demo/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_gen_random_number_demo/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • inc
Functions
utilities/at32f415_slib_demo/project_l0/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_slib_demo/project_l0/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • utilities
  • at32f415_slib_demo
  • project_l1
  • inc
Functions
utilities/at32f415_slib_demo/project_l1/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_slib_demo/project_l1/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • inc
Functions
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • inc
Functions
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
Functions
utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • inc
Functions
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • inc
Functions
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_clock.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • inc
Functions
utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_clock.h File Reference

header file of clock program More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_clock.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • adc
  • current_vref_value_check
  • inc
Macros
project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • adc
  • exint_trigger_partitioned
  • inc
Macros
project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • adc
  • internal_temperature_sensor
  • inc
Macros
project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • adc
  • software_trigger_repeat
  • inc
Macros
project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • adc
  • tmr_trigger_automatic_preempted
  • inc
Macros
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • adc
  • voltage_monitoring
  • inc
Macros
project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • can
  • communication_mode
  • inc
Macros
project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • can
  • filter
  • inc
Macros
project/at_start_f415/examples/can/filter/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/can/filter/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • can
  • loopback_mode
  • inc
Macros
project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • cmp
  • deep_sleep_mode
  • inc
Macros
project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • cmp
  • output
  • inc
Macros
project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • cortex_m4
  • bit_band
  • inc
Macros
project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • cortex_m4
  • systick_interrupt
  • inc
Macros
project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • crc
  • calculation
  • inc
Macros
project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • crm
  • clock_failure_detection
  • inc
Macros
project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • crm
  • pll_config2
  • inc
Macros
project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • crm
  • sysclk_switch
  • inc
Macros
project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • debug
  • tmr1
  • inc
Macros
project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • dma
  • data_to_gpio_flexible
  • inc
Macros
project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • dma
  • flash_to_sram
  • inc
Macros
project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • ertc
  • bpr_domain
  • inc
Macros
project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • ertc
  • calendar
  • inc
Macros
project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • ertc
  • lick_calibration
  • inc
Macros
project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • ertc
  • tamper
  • inc
Macros
project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • ertc
  • time_stamp
  • inc
Macros
project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • ertc
  • wakeup_timer
  • inc
Macros
project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • exint
  • exint_config
  • inc
Macros
project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • exint
  • exint_software_trigger
  • inc
Macros
project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • flash
  • flash_write_read
  • inc
Macros
project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • gpio
  • led_toggle
  • inc
Macros
project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • gpio
  • swjtag_remap
  • inc
Macros
project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • i2c
  • communication_dma
  • inc
Macros
project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • i2c
  • communication_int
  • inc
Macros
project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • i2c
  • communication_poll
  • inc
Macros
project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • i2c
  • eeprom
  • inc
Macros
project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • i2s
  • halfduplex_dma
  • inc
Macros
project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • i2s
  • halfduplex_interrupt
  • inc
Macros
project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • i2s
  • spii2s_switch_halfduplex_polling
  • inc
Macros
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • pwc
  • deepsleep_ertc_alarm
  • inc
Macros
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • pwc
  • deepsleep_ertc_tamper
  • inc
Macros
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • pwc
  • power_voltage_monitor
  • inc
Macros
project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • pwc
  • sleep_tmr2
  • inc
Macros
project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • pwc
  • sleep_usart1
  • inc
Macros
project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • pwc
  • standby_ertc_alarm
  • inc
Macros
project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • pwc
  • standby_wakeup_pin
  • inc
Macros
project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • sdio
  • sd_mmc_card
  • inc
Macros
project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • sdio
  • sdio_fatfs
  • inc
Macros
project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • spi
  • crc_transfer_polling
  • inc
Macros
project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • spi
  • fullduplex_polling
  • inc
Macros
project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • spi
  • halfduplex_interrupt
  • inc
Macros
project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • spi
  • halfduplex_transceiver_switch
  • inc
Macros
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • spi
  • only_receive_mode_polling
  • inc
Macros
project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • spi
  • use_jtagpin_hardwarecs_dma
  • inc
Macros
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • spi
  • w25q_flash
  • inc
Macros
project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • 6_steps
  • inc
Macros
project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • 7_pwm_output
  • inc
Macros
project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • cascade_synchro
  • inc
Macros
project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • complementary_signals
  • inc
Macros
project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • dma
  • inc
Macros
project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • dma_burst
  • inc
Macros
project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • encoder_tmr2
  • inc
Macros
project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • external_clock
  • inc
Macros
project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • hall_xor_tmr2
  • inc
Macros
project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • hang_mode
  • inc
Macros
project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • input_capture
  • inc
Macros
project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • oc_high
  • inc
Macros
project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • oc_low
  • inc
Macros
project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • oc_toggle_tmr3
  • inc
Macros
project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • oc_toggle_tmr9
  • inc
Macros
project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • one_cycle
  • inc
Macros
project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • parallel_synchro
  • inc
Macros
project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • pwm_input
  • inc
Macros
project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • pwm_input_dma
  • inc
Macros
project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • pwm_output_simulate
  • inc
Macros
project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • pwm_output_tmr10
  • inc
Macros
project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • pwm_output_tmr3
  • inc
Macros
project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • timer_base
  • inc
Macros
project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • tmr1_synchro
  • inc
Macros
project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • tmr
  • tmr2_32bit
  • inc
Macros
project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usart
  • half_duplex
  • inc
Macros
project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usart
  • hw_flow_control
  • inc
Macros
project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usart
  • idle_detection
  • inc
Macros
project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usart
  • interrupt
  • inc
Macros
project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usart
  • irda
  • inc
Macros
project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usart
  • polling
  • inc
Macros
project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usart
  • printf
  • inc
Macros
project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usart
  • receiver_mute
  • inc
Macros
project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usart
  • smartcard
  • inc
Macros
project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usart
  • synchronous
  • inc
Macros
project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usart
  • transfer_by_dma_interrupt
  • inc
Macros
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usart
  • transfer_by_dma_polling
  • inc
Macros
project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usb_device
  • audio
  • inc
Macros
project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usb_device
  • composite_audio_hid
  • inc
Macros
project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usb_device
  • composite_vcp_keyboard
  • inc
Macros
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usb_device
  • custom_hid
  • inc
Macros
project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usb_device
  • keyboard
  • inc
Macros
project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usb_device
  • mouse
  • inc
Macros
project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usb_device
  • msc
  • inc
Macros
project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usb_device
  • printer
  • inc
Macros
project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usb_device
  • vcp_loopback
  • inc
Macros
project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usb_device
  • virtual_msc_iap
  • inc
Macros
project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usb_host
  • hid_demo
  • inc
Macros
project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • usb_host
  • msc_only_fat32
  • inc
Macros
project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • wdt
  • wdt_reset
  • inc
Macros
project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • wwdt
  • wwdt_reset
  • inc
Macros
project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • templates
  • inc
Macros
project/at_start_f415/templates/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/templates/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • inc
Macros
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • inc
Macros
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • utilities
  • at32f415_freertos_demo
  • inc
Macros
utilities/at32f415_freertos_demo/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file utilities/at32f415_freertos_demo/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • utilities
  • at32f415_gen_random_number_demo
  • inc
Macros
utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • inc
Macros
utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • utilities
  • at32f415_slib_demo
  • project_l1
  • inc
Macros
utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • inc
Macros
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • inc
Macros
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
Macros
utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • inc
Macros
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • inc
Macros
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_conf.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • inc
Macros
utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h File Reference

at32f415 config header file More...

#include "at32f415_crm.h"
#include "at32f415_cmp.h"
#include "at32f415_tmr.h"
#include "at32f415_ertc.h"
#include "at32f415_gpio.h"
#include "at32f415_i2c.h"
#include "at32f415_usart.h"
#include "at32f415_pwc.h"
#include "at32f415_can.h"
#include "at32f415_adc.h"
#include "at32f415_spi.h"
#include "at32f415_dma.h"
#include "at32f415_debug.h"
#include "at32f415_flash.h"
#include "at32f415_crc.h"
#include "at32f415_wwdt.h"
#include "at32f415_wdt.h"
#include "at32f415_exint.h"
#include "at32f415_sdio.h"
#include "at32f415_misc.h"
#include "at32f415_usb.h"

Go to the source code of this file.

Macros

#define | HEXT_VALUE ((uint32_t)8000000)
in the following line adjust the value of high speed exernal 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. More...
#define | HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
in the following line adjust the high speed exernal crystal (hext) startup timeout value More...
#define | HICK_VALUE ((uint32_t)8000000)
#define | CRM_MODULE_ENABLED
#define | CMP_MODULE_ENABLED
#define | TMR_MODULE_ENABLED
#define | ERTC_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 | 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 | USB_MODULE_ENABLED
#define | MISC_MODULE_ENABLED

Detailed Description

at32f415 config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

Macro Definition Documentation

◆ ADC_MODULE_ENABLED

#define ADC_MODULE_ENABLED

Definition at line 62 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ CAN_MODULE_ENABLED

#define CAN_MODULE_ENABLED

Definition at line 61 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ CMP_MODULE_ENABLED

#define CMP_MODULE_ENABLED

Definition at line 54 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ CRC_MODULE_ENABLED

#define CRC_MODULE_ENABLED

Definition at line 67 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ CRM_MODULE_ENABLED

#define CRM_MODULE_ENABLED

Definition at line 53 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ DEBUG_MODULE_ENABLED

#define DEBUG_MODULE_ENABLED

Definition at line 65 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ DMA_MODULE_ENABLED

#define DMA_MODULE_ENABLED

Definition at line 64 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ ERTC_MODULE_ENABLED

#define ERTC_MODULE_ENABLED

Definition at line 56 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ EXINT_MODULE_ENABLED

#define EXINT_MODULE_ENABLED

Definition at line 70 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ FLASH_MODULE_ENABLED

#define FLASH_MODULE_ENABLED

Definition at line 66 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ GPIO_MODULE_ENABLED

#define GPIO_MODULE_ENABLED

Definition at line 57 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ HEXT_STARTUP_TIMEOUT

#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)

in the following line adjust the high speed exernal crystal (hext) startup timeout value

time out for hext start up

Definition at line 49 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ HEXT_VALUE

#define HEXT_VALUE ((uint32_t)8000000)

in the following line adjust the value of high speed exernal 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.

value of the high speed exernal crystal in hz

Definition at line 42 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ HICK_VALUE

#define HICK_VALUE ((uint32_t)8000000)

value of the high speed internal clock in hz

Definition at line 50 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ I2C_MODULE_ENABLED

#define I2C_MODULE_ENABLED

Definition at line 58 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ MISC_MODULE_ENABLED

#define MISC_MODULE_ENABLED

Definition at line 73 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ PWC_MODULE_ENABLED

#define PWC_MODULE_ENABLED

Definition at line 60 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ SDIO_MODULE_ENABLED

#define SDIO_MODULE_ENABLED

Definition at line 71 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ SPI_MODULE_ENABLED

#define SPI_MODULE_ENABLED

Definition at line 63 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ TMR_MODULE_ENABLED

#define TMR_MODULE_ENABLED

Definition at line 55 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ USART_MODULE_ENABLED

#define USART_MODULE_ENABLED

Definition at line 59 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ USB_MODULE_ENABLED

#define USB_MODULE_ENABLED

Definition at line 72 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ WDT_MODULE_ENABLED

#define WDT_MODULE_ENABLED

Definition at line 69 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.

◆ WWDT_MODULE_ENABLED

#define WWDT_MODULE_ENABLED

Definition at line 68 of file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • adc
  • current_vref_value_check
  • inc
Functions
project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • adc
  • exint_trigger_partitioned
  • inc
Functions
project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • adc
  • internal_temperature_sensor
  • inc
Functions
project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • adc
  • software_trigger_repeat
  • inc
Functions
project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • adc
  • tmr_trigger_automatic_preempted
  • inc
Functions
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • adc
  • voltage_monitoring
  • inc
Functions
project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • can
  • communication_mode
  • inc
Functions
project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • can
  • filter
  • inc
Functions
project/at_start_f415/examples/can/filter/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/filter/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • can
  • loopback_mode
  • inc
Functions
project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • cmp
  • deep_sleep_mode
  • inc
Functions
project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • cmp
  • output
  • inc
Functions
project/at_start_f415/examples/cmp/output/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cmp/output/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • cortex_m4
  • bit_band
  • inc
Functions
project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • cortex_m4
  • systick_interrupt
  • inc
Functions
project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • crc
  • calculation
  • inc
Functions
project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • crm
  • clock_failure_detection
  • inc
Functions
project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • crm
  • pll_config2
  • inc
Functions
project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • crm
  • sysclk_switch
  • inc
Functions
project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • debug
  • tmr1
  • inc
Functions
project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • dma
  • data_to_gpio_flexible
  • inc
Functions
project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • dma
  • flash_to_sram
  • inc
Functions
project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • ertc
  • bpr_domain
  • inc
Functions
project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • ertc
  • calendar
  • inc
Functions
project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • ertc
  • lick_calibration
  • inc
Functions
project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • ertc
  • tamper
  • inc
Functions
project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • ertc
  • time_stamp
  • inc
Functions
project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • ertc
  • wakeup_timer
  • inc
Functions
project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • exint
  • exint_config
  • inc
Functions
project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • exint
  • exint_software_trigger
  • inc
Functions
project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • flash
  • flash_write_read
  • inc
Functions
project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • gpio
  • led_toggle
  • inc
Functions
project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • gpio
  • swjtag_remap
  • inc
Functions
project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • i2c
  • communication_dma
  • inc
Functions
project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • i2c
  • communication_int
  • inc
Functions
project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • i2c
  • communication_poll
  • inc
Functions
project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • i2c
  • eeprom
  • inc
Functions
project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • i2s
  • halfduplex_dma
  • inc
Functions
project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • i2s
  • halfduplex_interrupt
  • inc
Functions
project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • i2s
  • spii2s_switch_halfduplex_polling
  • inc
Functions
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • pwc
  • deepsleep_ertc_alarm
  • inc
Functions
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • pwc
  • deepsleep_ertc_tamper
  • inc
Functions
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • pwc
  • power_voltage_monitor
  • inc
Functions
project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • pwc
  • sleep_tmr2
  • inc
Functions
project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • pwc
  • sleep_usart1
  • inc
Functions
project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • pwc
  • standby_ertc_alarm
  • inc
Functions
project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • pwc
  • standby_wakeup_pin
  • inc
Functions
project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • sdio
  • sd_mmc_card
  • inc
Functions
project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • sdio
  • sdio_fatfs
  • inc
Functions
project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • spi
  • crc_transfer_polling
  • inc
Functions
project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • spi
  • fullduplex_polling
  • inc
Functions
project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • spi
  • halfduplex_interrupt
  • inc
Functions
project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • spi
  • halfduplex_transceiver_switch
  • inc
Functions
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • spi
  • only_receive_mode_polling
  • inc
Functions
project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • spi
  • use_jtagpin_hardwarecs_dma
  • inc
Functions
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • spi
  • w25q_flash
  • inc
Functions
project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • 6_steps
  • inc
Functions
project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • 7_pwm_output
  • inc
Functions
project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • cascade_synchro
  • inc
Functions
project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • complementary_signals
  • inc
Functions
project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • dma
  • inc
Functions
project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • dma_burst
  • inc
Functions
project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • encoder_tmr2
  • inc
Functions
project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • external_clock
  • inc
Functions
project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • hall_xor_tmr2
  • inc
Functions
project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • hang_mode
  • inc
Functions
project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • input_capture
  • inc
Functions
project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • oc_high
  • inc
Functions
project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • oc_low
  • inc
Functions
project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • oc_toggle_tmr3
  • inc
Functions
project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • oc_toggle_tmr9
  • inc
Functions
project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • one_cycle
  • inc
Functions
project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • parallel_synchro
  • inc
Functions
project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • pwm_input
  • inc
Functions
project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • pwm_input_dma
  • inc
Functions
project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • pwm_output_simulate
  • inc
Functions
project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • pwm_output_tmr10
  • inc
Functions
project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • pwm_output_tmr3
  • inc
Functions
project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • timer_base
  • inc
Functions
project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • tmr1_synchro
  • inc
Functions
project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • tmr
  • tmr2_32bit
  • inc
Functions
project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usart
  • half_duplex
  • inc
Functions
project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usart
  • hw_flow_control
  • inc
Functions
project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usart
  • idle_detection
  • inc
Functions
project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usart
  • interrupt
  • inc
Functions
project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usart
  • irda
  • inc
Functions
project/at_start_f415/examples/usart/irda/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/irda/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usart
  • polling
  • inc
Functions
project/at_start_f415/examples/usart/polling/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/polling/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usart
  • printf
  • inc
Functions
project/at_start_f415/examples/usart/printf/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/printf/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usart
  • receiver_mute
  • inc
Functions
project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usart
  • smartcard
  • inc
Functions
project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usart
  • synchronous
  • inc
Functions
project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usart
  • transfer_by_dma_interrupt
  • inc
Functions
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usart
  • transfer_by_dma_polling
  • inc
Functions
project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usb_device
  • audio
  • inc
Functions
project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usb_device
  • composite_audio_hid
  • inc
Functions
project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usb_device
  • composite_vcp_keyboard
  • inc
Functions
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usb_device
  • custom_hid
  • inc
Functions
project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usb_device
  • keyboard
  • inc
Functions
project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usb_device
  • mouse
  • inc
Functions
project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usb_device
  • msc
  • inc
Functions
project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usb_device
  • printer
  • inc
Functions
project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usb_device
  • vcp_loopback
  • inc
Functions
project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usb_device
  • virtual_msc_iap
  • inc
Functions
project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usb_host
  • hid_demo
  • inc
Functions
project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • usb_host
  • msc_only_fat32
  • inc
Functions
project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • wdt
  • wdt_reset
  • inc
Functions
project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • wwdt
  • wwdt_reset
  • inc
Functions
project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • templates
  • inc
Functions
project/at_start_f415/templates/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/templates/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • inc
Functions
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • inc
Functions
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • utilities
  • at32f415_freertos_demo
  • inc
Functions
utilities/at32f415_freertos_demo/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_freertos_demo/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • utilities
  • at32f415_gen_random_number_demo
  • inc
Functions
utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • inc
Functions
utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • utilities
  • at32f415_slib_demo
  • project_l1
  • inc
Functions
utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • inc
Functions
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • inc
Functions
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
Functions
utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • inc
Functions
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • inc
Functions
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_int.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • inc
Functions
utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h File Reference

header file of main interrupt service routines. More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

header file of main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • adc
  • current_vref_value_check
  • src
Functions
project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • adc
  • exint_trigger_partitioned
  • src
Functions
project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • adc
  • internal_temperature_sensor
  • src
Functions
project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • adc
  • software_trigger_repeat
  • src
Functions
project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • adc
  • tmr_trigger_automatic_preempted
  • src
Functions
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • adc
  • voltage_monitoring
  • src
Functions
project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • can
  • communication_mode
  • src
Functions
project/at_start_f415/examples/can/communication_mode/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/communication_mode/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/can/communication_mode/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • can
  • filter
  • src
Functions
project/at_start_f415/examples/can/filter/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/filter/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/can/filter/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • can
  • loopback_mode
  • src
Functions
project/at_start_f415/examples/can/loopback_mode/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/loopback_mode/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/can/loopback_mode/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • cmp
  • deep_sleep_mode
  • src
Functions
project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • cmp
  • output
  • src
Functions
project/at_start_f415/examples/cmp/output/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cmp/output/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/cmp/output/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • cortex_m4
  • bit_band
  • src
Functions
project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • cortex_m4
  • systick_interrupt
  • src
Functions
project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • crc
  • calculation
  • src
Functions
project/at_start_f415/examples/crc/calculation/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crc/calculation/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/crc/calculation/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • crm
  • clock_failure_detection
  • src
Functions
project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • crm
  • pll_config2
  • src
Functions
project/at_start_f415/examples/crm/pll_config2/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/pll_config2/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 150000000
  • ahbdiv = 1
  • ahbclk = 150000000
  • apb2div = 2
  • apb2clk = 75000000
  • apb1div = 2
  • apb1clk = 75000000
  • pll_ns = 75
  • pll_ms = 1
  • pll_fr = 4
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 50 of file project/at_start_f415/examples/crm/pll_config2/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • crm
  • sysclk_switch
  • src
Functions
project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • debug
  • tmr1
  • src
Functions
project/at_start_f415/examples/debug/tmr1/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/debug/tmr1/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/debug/tmr1/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • dma
  • data_to_gpio_flexible
  • src
Functions
project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • dma
  • flash_to_sram
  • src
Functions
project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • ertc
  • bpr_domain
  • src
Functions
project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • ertc
  • calendar
  • src
Functions
project/at_start_f415/examples/ertc/calendar/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/calendar/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/ertc/calendar/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • ertc
  • lick_calibration
  • src
Functions
project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • ertc
  • tamper
  • src
Functions
project/at_start_f415/examples/ertc/tamper/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/tamper/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/ertc/tamper/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • ertc
  • time_stamp
  • src
Functions
project/at_start_f415/examples/ertc/time_stamp/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/time_stamp/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/ertc/time_stamp/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • ertc
  • wakeup_timer
  • src
Functions
project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • exint
  • exint_config
  • src
Functions
project/at_start_f415/examples/exint/exint_config/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/exint/exint_config/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/exint/exint_config/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • exint
  • exint_software_trigger
  • src
Functions
project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • flash
  • flash_write_read
  • src
Functions
project/at_start_f415/examples/flash/flash_write_read/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/flash/flash_write_read/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/flash/flash_write_read/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • gpio
  • led_toggle
  • src
Functions
project/at_start_f415/examples/gpio/led_toggle/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/gpio/led_toggle/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/gpio/led_toggle/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • gpio
  • swjtag_remap
  • src
Functions
project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • i2c
  • communication_dma
  • src
Functions
project/at_start_f415/examples/i2c/communication_dma/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • i2c
  • communication_int
  • src
Functions
project/at_start_f415/examples/i2c/communication_int/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_int/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • i2c
  • communication_poll
  • src
Functions
project/at_start_f415/examples/i2c/communication_poll/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_poll/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/i2c/communication_poll/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • i2c
  • eeprom
  • src
Functions
project/at_start_f415/examples/i2c/eeprom/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/eeprom/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • i2s
  • halfduplex_dma
  • src
Functions
project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • i2s
  • halfduplex_interrupt
  • src
Functions
project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • i2s
  • spii2s_switch_halfduplex_polling
  • src
Functions
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • pwc
  • deepsleep_ertc_alarm
  • src
Functions
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • pwc
  • deepsleep_ertc_tamper
  • src
Functions
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • pwc
  • power_voltage_monitor
  • src
Functions
project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • pwc
  • sleep_tmr2
  • src
Functions
project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • pwc
  • sleep_usart1
  • src
Functions
project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • pwc
  • standby_ertc_alarm
  • src
Functions
project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • pwc
  • standby_wakeup_pin
  • src
Functions
project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • sdio
  • sd_mmc_card
  • src
Functions
project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • sdio
  • sdio_fatfs
  • src
Functions
project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • spi
  • crc_transfer_polling
  • src
Functions
project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • spi
  • fullduplex_polling
  • src
Functions
project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • spi
  • halfduplex_interrupt
  • src
Functions
project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • spi
  • halfduplex_transceiver_switch
  • src
Functions
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • spi
  • only_receive_mode_polling
  • src
Functions
project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • spi
  • use_jtagpin_hardwarecs_dma
  • src
Functions
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • spi
  • w25q_flash
  • src
Functions
project/at_start_f415/examples/spi/w25q_flash/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/w25q_flash/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/spi/w25q_flash/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • 6_steps
  • src
Functions
project/at_start_f415/examples/tmr/6_steps/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/6_steps/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/6_steps/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • 7_pwm_output
  • src
Functions
project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • cascade_synchro
  • src
Functions
project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • complementary_signals
  • src
Functions
project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • dma
  • src
Functions
project/at_start_f415/examples/tmr/dma/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/dma/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/dma/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • dma_burst
  • src
Functions
project/at_start_f415/examples/tmr/dma_burst/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/dma_burst/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/dma_burst/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • encoder_tmr2
  • src
Functions
project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • external_clock
  • src
Functions
project/at_start_f415/examples/tmr/external_clock/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/external_clock/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/external_clock/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • hall_xor_tmr2
  • src
Functions
project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • hang_mode
  • src
Functions
project/at_start_f415/examples/tmr/hang_mode/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/hang_mode/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/hang_mode/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • input_capture
  • src
Functions
project/at_start_f415/examples/tmr/input_capture/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/input_capture/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/input_capture/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • oc_high
  • src
Functions
project/at_start_f415/examples/tmr/oc_high/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_high/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/oc_high/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • oc_low
  • src
Functions
project/at_start_f415/examples/tmr/oc_low/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_low/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/oc_low/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • oc_toggle_tmr3
  • src
Functions
project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • oc_toggle_tmr9
  • src
Functions
project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • one_cycle
  • src
Functions
project/at_start_f415/examples/tmr/one_cycle/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/one_cycle/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/one_cycle/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • parallel_synchro
  • src
Functions
project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • pwm_input
  • src
Functions
project/at_start_f415/examples/tmr/pwm_input/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • pwm_input_dma
  • src
Functions
project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • pwm_output_simulate
  • src
Functions
project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • pwm_output_tmr10
  • src
Functions
project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • pwm_output_tmr3
  • src
Functions
project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • timer_base
  • src
Functions
project/at_start_f415/examples/tmr/timer_base/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/timer_base/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/timer_base/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • tmr1_synchro
  • src
Functions
project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • tmr
  • tmr2_32bit
  • src
Functions
project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usart
  • half_duplex
  • src
Functions
project/at_start_f415/examples/usart/half_duplex/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/half_duplex/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usart/half_duplex/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usart
  • hw_flow_control
  • src
Functions
project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usart
  • idle_detection
  • src
Functions
project/at_start_f415/examples/usart/idle_detection/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/idle_detection/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usart/idle_detection/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usart
  • interrupt
  • src
Functions
project/at_start_f415/examples/usart/interrupt/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/interrupt/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usart/interrupt/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usart
  • irda
  • src
Functions
project/at_start_f415/examples/usart/irda/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/irda/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usart/irda/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usart
  • polling
  • src
Functions
project/at_start_f415/examples/usart/polling/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/polling/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usart/polling/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usart
  • printf
  • src
Functions
project/at_start_f415/examples/usart/printf/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/printf/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usart/printf/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usart
  • receiver_mute
  • src
Functions
project/at_start_f415/examples/usart/receiver_mute/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/receiver_mute/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usart/receiver_mute/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usart
  • smartcard
  • src
Functions
project/at_start_f415/examples/usart/smartcard/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/smartcard/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usart/smartcard/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usart
  • synchronous
  • src
Functions
project/at_start_f415/examples/usart/synchronous/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/synchronous/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usart/synchronous/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usart
  • transfer_by_dma_interrupt
  • src
Functions
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usart
  • transfer_by_dma_polling
  • src
Functions
project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usb_device
  • audio
  • src
Functions
project/at_start_f415/examples/usb_device/audio/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/audio/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usb_device/audio/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usb_device
  • composite_audio_hid
  • src
Functions
project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usb_device
  • composite_vcp_keyboard
  • src
Functions
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usb_device
  • custom_hid
  • src
Functions
project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usb_device
  • keyboard
  • src
Functions
project/at_start_f415/examples/usb_device/keyboard/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/keyboard/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usb_device/keyboard/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usb_device
  • mouse
  • src
Functions
project/at_start_f415/examples/usb_device/mouse/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/mouse/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usb_device/mouse/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usb_device
  • msc
  • src
Functions
project/at_start_f415/examples/usb_device/msc/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/msc/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usb_device/msc/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usb_device
  • printer
  • src
Functions
project/at_start_f415/examples/usb_device/printer/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/printer/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usb_device/printer/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usb_device
  • vcp_loopback
  • src
Functions
project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usb_device
  • virtual_msc_iap
  • src
Functions
project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usb_host
  • hid_demo
  • src
Functions
project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • usb_host
  • msc_only_fat32
  • src
Functions
project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • wdt
  • wdt_reset
  • src
Functions
project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • wwdt
  • wwdt_reset
  • src
Functions
project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_clock.c.

Function Documentation

◆ system_clock_config()

void system_clock_config ( void )

system clock config program

Note
the system clock is configured as follow:
  • system clock = hext / 2 * pll_mult
  • system clock source = pll (hext)
  • hext = 8000000
  • sclk = 144000000
  • ahbdiv = 1
  • ahbclk = 144000000
  • apb2div = 2
  • apb2clk = 72000000
  • apb1div = 2
  • apb1clk = 72000000
  • pll_mult = 36
  • flash_wtcyc = 4 cycle
Parameters
none
Return values
none

< phase locking loop stable flag

Definition at line 48 of file project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • templates
  • src
Functions
project/at_start_f415/templates/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/templates/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • src
Functions
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • src
Functions
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • utilities
  • at32f415_freertos_demo
  • src
Functions
utilities/at32f415_freertos_demo/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_freertos_demo/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • utilities
  • at32f415_gen_random_number_demo
  • src
Functions
utilities/at32f415_gen_random_number_demo/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_gen_random_number_demo/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
Functions
utilities/at32f415_slib_demo/project_l0/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_slib_demo/project_l0/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • utilities
  • at32f415_slib_demo
  • project_l1
  • src
Functions
utilities/at32f415_slib_demo/project_l1/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_slib_demo/project_l1/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • src
Functions
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • src
Functions
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
Functions
utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • src
Functions
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • src
Functions
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_clock.c File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • src
Functions
utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_clock.c File Reference

system clock config program More...

#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void system_clock_config (void)
system clock config program More...

Detailed Description

system clock config program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_clock.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • adc
  • current_vref_value_check
  • src
Functions
project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • adc
  • exint_trigger_partitioned
  • src
Functions | Variables
project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | DMA1_Channel1_IRQHandler (void)
this function handles dma1_channel1 handler. More...
void | ADC1_IRQHandler (void)
this function handles adc1_2 handler. More...

Variables

__IO uint16_t | adc1_preempt_valuetab [3][3]
__IO uint16_t | dma_trans_complete_flag
__IO uint16_t | preempt_trigger_count

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • adc
  • internal_temperature_sensor
  • src
Functions
project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • adc
  • software_trigger_repeat
  • src
Functions | Variables
project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | DMA1_Channel1_IRQHandler (void)
this function handles dma1_channel1 handler. More...

Variables

__IO uint16_t dma_trans_complete_flag

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • adc
  • tmr_trigger_automatic_preempted
  • src
Functions | Variables
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | DMA1_Channel1_IRQHandler (void)
this function handles dma1_channel1 handler. More...
void | ADC1_IRQHandler (void)
this function handles adc1_2 handler. More...

Variables

__IO uint16_t | adc1_ordinary_valuetab [5][3]
__IO uint16_t | adc1_preempt_valuetab [5][3]
__IO uint16_t | dma_trans_complete_flag
__IO uint16_t | preempt_conversion_count

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • adc
  • voltage_monitoring
  • src
Functions | Variables
project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | ADC1_IRQHandler (void)
this function handles adc1_2 handler. More...

Variables

__IO uint16_t | adc1_ordinary_valuetab [3]
__IO uint16_t | vmor_flag_index

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • can
  • communication_mode
  • src
Functions
project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • can
  • filter
  • src
Functions
project/at_start_f415/examples/can/filter/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/filter/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • can
  • loopback_mode
  • src
Functions
project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • cmp
  • deep_sleep_mode
  • src
Functions
project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | CMP1_IRQHandler (void)
this function handles cmp1 handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • cmp
  • output
  • src
Functions | Variables
project/at_start_f415/examples/cmp/output/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR1_CH_IRQHandler (void)

Variables

__IO uint16_t | capturenumber = 0
__IO uint32_t | ch1readvalue1 = 0
__IO uint32_t | ch1readvalue2 = 0

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cmp/output/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • cortex_m4
  • bit_band
  • src
Functions
project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • cortex_m4
  • systick_interrupt
  • src
Functions
project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | systick_handler (void)
systick interrupt handler. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • crc
  • calculation
  • src
Functions
project/at_start_f415/examples/crc/calculation/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crc/calculation/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • crm
  • clock_failure_detection
  • src
Functions
project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | clock_failure_detection_handler (void)
clock failure detection handler. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • crm
  • pll_config2
  • src
Functions
project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • crm
  • sysclk_switch
  • src
Functions
project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • debug
  • tmr1
  • src
Functions
project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • dma
  • data_to_gpio_flexible
  • src
Functions
project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • dma
  • flash_to_sram
  • src
Functions
project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • ertc
  • bpr_domain
  • src
Functions
project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • ertc
  • calendar
  • src
Functions
project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | ertc_alarm_show (void)
display the current alarm. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | ERTCAlarm_IRQHandler (void)
this function handles ertc alarms interrupt request. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • ertc
  • lick_calibration
  • src
Functions | Variables
project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"
#include "stdio.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR5_GLOBAL_IRQHandler (void)
this function handles tmr5 global interrupt request. More...

Variables

__IO uint32_t | period_value
__IO uint32_t | capture_number
uint16_t | tmp_c4 [2] = {0, 0}

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • ertc
  • tamper
  • src
Functions
project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"
#include "stdio.h"

Go to the source code of this file.

Functions

uint32_t | is_bpr_reg_reset (void)
checks if the ertc bpr dtx registers are reset or not. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TAMP_STAMP_IRQHandler (void)
this function handles ertc tamper and time stamp interrupts requests. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • ertc
  • time_stamp
  • src
Functions
project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"
#include "stdio.h"

Go to the source code of this file.

Functions

void | ertc_time_show (void)
display the current date. More...
void | ertc_timestamp_show (void)
display the current timestamp. More...
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TAMP_STAMP_IRQHandler (void)
this function handles external lines 15 to 10 interrupt request. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • ertc
  • wakeup_timer
  • src
Functions
project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"
#include "stdio.h"

Go to the source code of this file.

Functions

void | ertc_wakeup_show (void)
void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | ERTC_WKUP_IRQHandler (void)
this function handles ertc wakeup timer interrupt request. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • exint
  • exint_config
  • src
Functions
project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • exint
  • exint_software_trigger
  • src
Functions
project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • flash
  • flash_write_read
  • src
Functions
project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • gpio
  • led_toggle
  • src
Functions
project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • gpio
  • swjtag_remap
  • src
Functions
project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • i2c
  • communication_dma
  • src
Macros | Functions | Variables
project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "i2c_application.h"

Go to the source code of this file.

Macros

#define | I2Cx_DMA_TX_IRQHandler DMA1_Channel6_IRQHandler
#define | I2Cx_DMA_RX_IRQHandler DMA1_Channel7_IRQHandler
#define | I2Cx_EVT_IRQHandler I2C1_EVT_IRQHandler
#define | I2Cx_ERR_IRQHandler I2C1_ERR_IRQHandler

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | DMA1_Channel7_IRQHandler (void)
this function handles dma interrupt request. More...
void | DMA1_Channel6_IRQHandler (void)
this function handles dma interrupt request. More...

Variables

i2c_handle_type hi2cx

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

Macro Definition Documentation

◆ I2Cx_DMA_RX_IRQHandler

#define I2Cx_DMA_RX_IRQHandler DMA1_Channel7_IRQHandler

Definition at line 34 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

◆ I2Cx_DMA_TX_IRQHandler

#define I2Cx_DMA_TX_IRQHandler DMA1_Channel6_IRQHandler

Definition at line 33 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

◆ I2Cx_ERR_IRQHandler

#define I2Cx_ERR_IRQHandler I2C1_ERR_IRQHandler

Definition at line 36 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.

◆ I2Cx_EVT_IRQHandler

#define I2Cx_EVT_IRQHandler I2C1_EVT_IRQHandler

Definition at line 35 of file project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • i2c
  • communication_int
  • src
Macros | Functions | Variables
project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "i2c_application.h"

Go to the source code of this file.

Macros

#define | I2Cx_EVT_IRQHandler I2C1_EVT_IRQHandler
#define | I2Cx_ERR_IRQHandler I2C1_ERR_IRQHandler

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | I2C1_EVT_IRQHandler (void)
this function handles i2c event interrupt request. More...
void | I2C1_ERR_IRQHandler (void)
this function handles i2c error interrupt request. More...

Variables

i2c_handle_type hi2cx

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.

Macro Definition Documentation

◆ I2Cx_ERR_IRQHandler

#define I2Cx_ERR_IRQHandler I2C1_ERR_IRQHandler

Definition at line 34 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.

◆ I2Cx_EVT_IRQHandler

#define I2Cx_EVT_IRQHandler I2C1_EVT_IRQHandler

Definition at line 33 of file project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • i2c
  • communication_poll
  • src
Functions
project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • i2c
  • eeprom
  • src
Macros | Functions | Variables
project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "i2c_application.h"

Go to the source code of this file.

Macros

#define | I2Cx_DMA_TX_IRQHandler DMA1_Channel6_IRQHandler
#define | I2Cx_DMA_RX_IRQHandler DMA1_Channel7_IRQHandler
#define | I2Cx_EVT_IRQHandler I2C1_EVT_IRQHandler
#define | I2Cx_ERR_IRQHandler I2C1_ERR_IRQHandler

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | DMA1_Channel7_IRQHandler (void)
this function handles dma interrupt request. More...
void | DMA1_Channel6_IRQHandler (void)
this function handles dma interrupt request. More...
void | I2C1_EVT_IRQHandler (void)
this function handles i2c event interrupt request. More...
void | I2C1_ERR_IRQHandler (void)
this function handles i2c error interrupt request. More...

Variables

i2c_handle_type hi2cx

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

Macro Definition Documentation

◆ I2Cx_DMA_RX_IRQHandler

#define I2Cx_DMA_RX_IRQHandler DMA1_Channel7_IRQHandler

Definition at line 34 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ I2Cx_DMA_TX_IRQHandler

#define I2Cx_DMA_TX_IRQHandler DMA1_Channel6_IRQHandler

Definition at line 33 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ I2Cx_ERR_IRQHandler

#define I2Cx_ERR_IRQHandler I2C1_ERR_IRQHandler

Definition at line 36 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.

◆ I2Cx_EVT_IRQHandler

#define I2Cx_EVT_IRQHandler I2C1_EVT_IRQHandler

Definition at line 35 of file project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • i2s
  • halfduplex_dma
  • src
Functions
project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • i2s
  • halfduplex_interrupt
  • src
Functions | Variables
project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | SPI2_IRQHandler (void)
This function handles the spi2 interrupt request. More...
void | SPI1_IRQHandler (void)
This function handles the spi1 interrupt request. More...

Variables

uint16_t | i2s1_buffer_tx []
uint16_t | i2s2_buffer_rx []
__IO uint32_t | tx_index
__IO uint32_t | rx_index

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c.

Variable Documentation

◆ rx_index

__IO uint32_t rx_index

Definition at line 33 of file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c.

Referenced by SPI2_IRQHandler().


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • i2s
  • spii2s_switch_halfduplex_polling
  • src
Functions
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • pwc
  • deepsleep_ertc_alarm
  • src
Functions
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | ERTCAlarm_IRQHandler (void)
this function handles the rtc alarm through exint line interrupt request. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • pwc
  • deepsleep_ertc_tamper
  • src
Functions
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TAMP_STAMP_IRQHandler (void)
this function handles the rtc alarm through exint line interrupt request. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • pwc
  • power_voltage_monitor
  • src
Functions
project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | PVM_IRQHandler (void)
this function handles the power voltage monitoring output interrupt request. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • pwc
  • sleep_tmr2
  • src
Functions
project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR2_GLOBAL_IRQHandler (void)
this function handles the timer interrupt request. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • pwc
  • sleep_usart1
  • src
Functions | Variables
project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | USART1_IRQHandler (void)
this function handles the usatt interrupt request. More...

Variables

uint16_t usart1_index = 0

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • pwc
  • standby_ertc_alarm
  • src
Functions
project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • pwc
  • standby_wakeup_pin
  • src
Functions
project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • sdio
  • sd_mmc_card
  • src
Functions
project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • sdio
  • sdio_fatfs
  • src
Functions
project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • spi
  • crc_transfer_polling
  • src
Functions
project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • spi
  • fullduplex_polling
  • src
Functions
project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • spi
  • halfduplex_interrupt
  • src
Macros | Functions | Variables
project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Macros

#define BUFFERSIZE 32

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | SPI1_IRQHandler (void)
This function handles the spi1 interrupt request. More...
void | SPI2_IRQHandler (void)
This function handles the spi2 interrupt request. More...

Variables

uint8_t | spi1_tx_buffer []
uint8_t | spi2_rx_buffer []
uint32_t | tx_index
uint32_t | rx_index

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • spi
  • halfduplex_transceiver_switch
  • src
Macros | Functions | Variables
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Macros

#define BUFFERSIZE 32

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | SPI1_IRQHandler (void)
This function handles the spi1 interrupt request. More...
void | SPI2_IRQHandler (void)
This function handles the spi2 interrupt request. More...

Variables

uint8_t | spi1_tx_buffer []
uint8_t | spi2_tx_buffer []
uint8_t | spi1_rx_buffer []
uint8_t | spi2_rx_buffer []
uint32_t | tx_index
uint32_t | rx_index

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • spi
  • only_receive_mode_polling
  • src
Functions
project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • spi
  • use_jtagpin_hardwarecs_dma
  • src
Functions
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • spi
  • w25q_flash
  • src
Functions
project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • 6_steps
  • src
Functions
project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • 7_pwm_output
  • src
Functions
project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • cascade_synchro
  • src
Functions
project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • complementary_signals
  • src
Functions
project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • dma
  • src
Functions
project/at_start_f415/examples/tmr/dma/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/dma/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • dma_burst
  • src
Functions
project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • encoder_tmr2
  • src
Functions
project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • external_clock
  • src
Functions
project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • hall_xor_tmr2
  • src
Functions
project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • hang_mode
  • src
Functions
project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • input_capture
  • src
Functions
project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • oc_high
  • src
Functions
project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR2_GLOBAL_IRQHandler (void)
this function handles tmr2 global interrupt request. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • oc_low
  • src
Functions
project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR2_GLOBAL_IRQHandler (void)
this function handles tmr2 global interrupt request. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • oc_toggle_tmr3
  • src
Functions | Variables
project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR3_GLOBAL_IRQHandler (void)
this function handles tmr3 global interrupt request. More...

Variables

__IO uint16_t | ch1_val
__IO uint16_t | ch2_val
__IO uint16_t | ch3_val
__IO uint16_t | ch4_val
uint32_t | capture = 0

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • oc_toggle_tmr9
  • src
Functions | Variables
project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR1_BRK_TMR9_IRQHandler (void)
this function handles TMR9 global interrupt request. More...

Variables

__IO uint16_t | ch1_val
__IO uint16_t | ch2_val
uint16_t | capture = 0

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • one_cycle
  • src
Functions
project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • parallel_synchro
  • src
Functions
project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • pwm_input
  • src
Functions | Variables
project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR3_GLOBAL_IRQHandler (void)
this function handles tmr3 global interrupt request. More...

Variables

uint16_t | duty_cycle
uint32_t | frequency
__IO uint16_t | ic2value = 0

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • pwm_input_dma
  • src
Functions
project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • pwm_output_simulate
  • src
Functions | Variables
project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | TMR2_GLOBAL_IRQHandler (void)

Variables

__IO uint16_t | ch1_val
__IO uint16_t | ch2_val
__IO uint16_t | ch3_val
__IO uint16_t | ch4_val
uint16_t | capture = 0

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • pwm_output_tmr10
  • src
Functions
project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • pwm_output_tmr3
  • src
Functions
project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • timer_base
  • src
Functions
project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • tmr1_synchro
  • src
Functions
project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • tmr
  • tmr2_32bit
  • src
Functions
project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usart
  • half_duplex
  • src
Functions
project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usart
  • hw_flow_control
  • src
Functions
project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usart
  • idle_detection
  • src
Functions
project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | USART2_IRQHandler (void)
this function handles usart2 handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usart
  • interrupt
  • src
Functions | Variables
project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | USART2_IRQHandler (void)
this function handles usart2 handler. More...
void | USART3_IRQHandler (void)
this function handles usart3 handler. More...

Variables

uint8_t | usart2_tx_buffer []
uint8_t | usart3_tx_buffer []
uint8_t | usart2_rx_buffer []
uint8_t | usart3_rx_buffer []
uint8_t | usart2_tx_counter
uint8_t | usart3_tx_counter
uint8_t | usart2_rx_counter
uint8_t | usart3_rx_counter
uint8_t | usart2_tx_buffer_size
uint8_t | usart3_tx_buffer_size

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usart
  • irda
  • src
Functions
project/at_start_f415/examples/usart/irda/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/irda/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usart
  • polling
  • src
Functions
project/at_start_f415/examples/usart/polling/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/polling/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usart
  • printf
  • src
Functions
project/at_start_f415/examples/usart/printf/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/printf/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usart
  • receiver_mute
  • src
Functions | Variables
project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | USART3_IRQHandler (void)
this function handles usart3 handler. More...

Variables

uint8_t | usart3_rx_buffer []
uint8_t | rx_counter

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usart
  • smartcard
  • src
Functions | Variables
project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "smartcard_config.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | EXINT9_5_IRQHandler (void)
this function handles external lines 9 to 5 interrupt request. More...
void | SC_USART_IRQHandler (void)
this function handles sc_usart global interrupt request. More...

Variables

uint32_t card_inserted

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usart
  • synchronous
  • src
Functions
project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usart
  • transfer_by_dma_interrupt
  • src
Functions | Variables
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | DMA1_Channel1_IRQHandler (void)
this function handles dma1 channel1 handler. More...
void | DMA1_Channel2_IRQHandler (void)
this function handles dma1 channel2 handler. More...
void | DMA1_Channel3_IRQHandler (void)
this function handles dma1 channel3 handler. More...
void | DMA1_Channel4_IRQHandler (void)
this function handles dma1 channel4 handler. More...

Variables

uint8_t | usart2_tx_dma_status
uint8_t | usart2_rx_dma_status
uint8_t | usart3_tx_dma_status
uint8_t | usart3_rx_dma_status

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usart
  • transfer_by_dma_polling
  • src
Functions
project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usb_device
  • audio
  • src
Functions
project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usb_device
  • composite_audio_hid
  • src
Functions
project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usb_device
  • composite_vcp_keyboard
  • src
Functions
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usb_device
  • custom_hid
  • src
Functions
project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usb_device
  • keyboard
  • src
Functions
project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usb_device
  • mouse
  • src
Functions
project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usb_device
  • msc
  • src
Functions
project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usb_device
  • printer
  • src
Functions
project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usb_device
  • vcp_loopback
  • src
Functions
project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usb_device
  • virtual_msc_iap
  • src
Functions
project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usb_host
  • hid_demo
  • src
Functions
project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • usb_host
  • msc_only_fat32
  • src
Functions
project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • wdt
  • wdt_reset
  • src
Functions
project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • wwdt
  • wwdt_reset
  • src
Functions
project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • templates
  • src
Functions
project/at_start_f415/templates/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/templates/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • src
Functions
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • src
Functions
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • utilities
  • at32f415_freertos_demo
  • src
Functions
utilities/at32f415_freertos_demo/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | DebugMon_Handler (void)
this function handles svcall exception. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_freertos_demo/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • utilities
  • at32f415_gen_random_number_demo
  • src
Functions
utilities/at32f415_gen_random_number_demo/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_gen_random_number_demo/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
Functions
utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | FLASH_IRQHandler (void)
flash handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • utilities
  • at32f415_slib_demo
  • project_l1
  • src
Functions
utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"
#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...
void | FLASH_IRQHandler (void)
flash handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • src
Functions
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • src
Functions
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
Functions
utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • src
Functions
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • src
Functions
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c.


AT32F415 Firmwary Library: at32f415_int.c File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • src
Functions
utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c File Reference

main interrupt service routines. More...

#include "at32f415_int.h"

Go to the source code of this file.

Functions

void | NMI_Handler (void)
this function handles nmi exception. More...
void | HardFault_Handler (void)
this function handles hard fault exception. More...
void | MemManage_Handler (void)
this function handles memory manage exception. More...
void | BusFault_Handler (void)
this function handles bus fault exception. More...
void | UsageFault_Handler (void)
this function handles usage fault exception. More...
void | SVC_Handler (void)
this function handles svcall exception. More...
void | DebugMon_Handler (void)
this function handles debug monitor exception. More...
void | PendSV_Handler (void)
this function handles pendsv_handler exception. More...
void | SysTick_Handler (void)
this function handles systick handler. More...

Detailed Description

main interrupt service routines.

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c.


AT32F415 Firmwary Library: main.c File Reference

  • adc
  • current_vref_value_check
  • src
Functions | Variables
project/at_start_f415/examples/adc/current_vref_value_check/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

static void | dma_config (void)
dma configuration. More...
static void | adc_config (void)
adc configuration. More...
int | main (void)
main function. More...

Variables

__IO uint16_t adc1_ordinary_value = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/current_vref_value_check/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • adc
  • exint_trigger_partitioned
  • src
Functions | Variables
project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

static void | gpio_config (void)
gpio configuration. More...
static void | exint_config (void)
exint configuration. More...
static void | dma_config (void)
dma configuration. More...
static void | adc_config (void)
adc configuration. More...
int | main (void)
main function. More...

Variables

__IO uint16_t | adc1_ordinary_valuetab [3][3] = {0}
__IO uint16_t | adc1_preempt_valuetab [3][3] = {0}
__IO uint16_t | dma_trans_complete_flag = 0
__IO uint16_t | preempt_trigger_count = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • adc
  • internal_temperature_sensor
  • src
Macros | Functions | Variables
project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | ADC_VREF (3.3)
#define | ADC_TEMP_BASE (1.26)
#define | ADC_TEMP_SLOPE (-0.00423)

Functions

static void | dma_config (void)
dma configuration. More...
static void | adc_config (void)
adc configuration. More...
int | main (void)
main function. More...

Variables

__IO uint16_t adc1_ordinary_value = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • adc
  • software_trigger_repeat
  • src
Functions | Variables
project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

static void | gpio_config (void)
gpio configuration. More...
static void | dma_config (void)
dma configuration. More...
static void | adc_config (void)
adc configuration. More...
int | main (void)
main function. More...

Variables

__IO uint16_t | adc1_ordinary_valuetab [10][3] = {0}
__IO uint16_t | dma_trans_complete_flag = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • adc
  • tmr_trigger_automatic_preempted
  • src
Functions | Variables
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

static void | gpio_config (void)
gpio configuration. More...
static void | dma_config (void)
dma configuration. More...
static void | tmr1_config (void)
tmr1 configuration. More...
static void | adc_config (void)
adc configuration. More...
int | main (void)
main function. More...

Variables

__IO uint16_t | adc1_ordinary_valuetab [5][3] = {0}
__IO uint16_t | adc1_preempt_valuetab [5][3] = {0}
__IO uint16_t | dma_trans_complete_flag = 0
__IO uint16_t | preempt_conversion_count = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • adc
  • voltage_monitoring
  • src
Functions | Variables
project/at_start_f415/examples/adc/voltage_monitoring/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

static void | gpio_config (void)
gpio configuration. More...
static void | dma_config (void)
dma configuration. More...
static void | adc_config (void)
adc configuration. More...
int | main (void)
main function. More...

Variables

__IO uint16_t | adc1_ordinary_valuetab [3] = {0}
__IO uint16_t | vmor_flag_index = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/adc/voltage_monitoring/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • can
  • communication_mode
  • src
Functions
project/at_start_f415/examples/can/communication_mode/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

static void | can_gpio_config (void)
can gpio config More...
static void | can_configuration (void)
can configiguration. More...
static void | can_transmit_data (void)
can transmit data More...
void | CAN1_RX0_IRQHandler (void)
can1 interrupt function rx0 More...
void | CAN1_SE_IRQHandler (void)
can1 interrupt function se More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/communication_mode/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • can
  • filter
  • src
Macros | Functions | Variables
project/at_start_f415/examples/can/filter/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | FILTER_EXT_ID1 ((uint32_t)0x18F5F100)
#define | FILTER_EXT_ID2 ((uint32_t)0x18F5F200)
#define | FILTER_EXT_ID3 ((uint32_t)0x18F5F300)
#define | FILTER_STD_ID1 ((uint16_t)0x04F6)
#define | FILTER_STD_ID2 ((uint16_t)0x04F7)
#define | FILTER_STD_ID3 ((uint16_t)0x04F8)

Functions

static void | can_gpio_config (void)
can gpio config More...
static void | can_configuration (void)
can configiguration. More...
static void | can_transmit_data (void)
can transmit data More...
void | CAN1_RX0_IRQHandler (void)
can1 interrupt function rx0 More...
void | CAN1_SE_IRQHandler (void)
can1 interrupt function se More...
int | main (void)
main function. More...

Variables

uint8_t test_result = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/filter/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • can
  • loopback_mode
  • src
Functions
project/at_start_f415/examples/can/loopback_mode/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

static void | can_gpio_config (void)
can gpio config More...
static void | can_configuration (void)
can configiguration. More...
static void | can_transmit_data (void)
can transmit data More...
void | CAN1_RX0_IRQHandler (void)
can1 interrupt function rx0 More...
void | CAN1_SE_IRQHandler (void)
can1 interrupt function se More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/can/loopback_mode/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • cmp
  • deep_sleep_mode
  • src
Functions | Variables
project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | cmp_exint_init (void)
void | cmp_config (void)
configures cmp: pa1 to cmp inverting input and cmp output to tmr1 ch1. More...
void | sysclk_config_deep_sleep (void)
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
__IO uint32_t | capture = 0
__IO uint32_t | tmr1freq
__IO uint16_t | capturenumber
__IO uint32_t | ic1readvalue1
__IO uint32_t | ic1readvalue2

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • cmp
  • output
  • src
Functions | Variables
project/at_start_f415/examples/cmp/output/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | cmp_config (void)
configures cmp More...
void | tmr1_init (void)
configures tmr1_ch1 as input More...
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
__IO uint32_t | capture = 0
__IO uint32_t | tmr1freq
__IO uint16_t | capturenumber
__IO uint32_t | ch1readvalue1
__IO uint32_t | ch1readvalue2

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cmp/output/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • cortex_m4
  • bit_band
  • src
Macros | Functions | Variables
project/at_start_f415/examples/cortex_m4/bit_band/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | RAM_BASE 0x20000000
#define | RAM_BITBAND_BASE 0x22000000
#define | VARIABLES_RESET_BIT(variables_addr, bit_number) (*(uint32_t *)(RAM_BITBAND_BASE + ((variables_addr - RAM_BASE) * 32) + ((bit_number) * 4)) = 0)
#define | VARIABLES_SET_BIT(variables_addr, bit_number) (*(uint32_t *)(RAM_BITBAND_BASE + ((variables_addr - RAM_BASE) * 32) + ((bit_number) * 4)) = 1)
#define | VARIABLES_GET_BIT(variables_addr, bit_number) (*(uint32_t *)(RAM_BITBAND_BASE + ((variables_addr - RAM_BASE) * 32) + ((bit_number) * 4)))
#define | PERIPHERAL_BASE 0x40000000
#define | PERIPHERAL_BITBAND_BASE 0x42000000
#define | PERIPHERAL_RESET_BIT(peripheral_addr, bit_number) (*(uint32_t *)(PERIPHERAL_BITBAND_BASE + ((peripheral_addr - PERIPHERAL_BASE) * 32) + ((bit_number) * 4)) = 0)
#define | PERIPHERAL_SET_BIT(peripheral_addr, bit_number) (*(uint32_t *)(PERIPHERAL_BITBAND_BASE + ((peripheral_addr - PERIPHERAL_BASE) * 32) + ((bit_number) * 4)) = 1)

Functions

void | result_error (void)
led4 flick for error. More...
int | main (void)
main function. More...

Variables

__IO uint32_t | variables
__IO uint32_t | variables_addr = 0
__IO uint32_t | variables_bit_val = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cortex_m4/bit_band/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • cortex_m4
  • systick_interrupt
  • src
Macros | Functions
project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | MS_TICK (system_core_clock / 1000U)
#define | DELAY 200 /* 200 ms ticks */

Functions

void | systick_handler (void)
systick interrupt handler. More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • crc
  • calculation
  • src
Macros | Functions | Variables
project/at_start_f415/examples/crc/calculation/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define BUFFER_SIZE 120

Functions

int main (void)
main function. More...

Variables

static const uint32_t | data_buffer [120]
__IO uint32_t | crc_value = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crc/calculation/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • crm
  • clock_failure_detection
  • src
Functions
project/at_start_f415/examples/crm/clock_failure_detection/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

static void | clkout_config (void)
clkout configuration. More...
static void | sclk_144m_hick_config (void)
config sclk 144 mhz with hick clock source. More...
void | clock_failure_detection_handler (void)
clock failure detection handler. More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/clock_failure_detection/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • crm
  • pll_config2
  • src
Functions
project/at_start_f415/examples/crm/pll_config2/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

static void | clkout_config (void)
clkout configuration. More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/pll_config2/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • crm
  • sysclk_switch
  • src
Functions
project/at_start_f415/examples/crm/sysclk_switch/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

static void | clkout_config (void)
clkout configuration. More...
static void | sclk_64m_hick_config (void)
config sclk 64 mhz with hick clock source. More...
static void | sclk_96m_hext_config (void)
config sclk 96 mhz with hext clock source. More...
static void | switch_system_clock (void)
sclk switch function. More...
static void | clkout_config (void)
clkout configuration. More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/crm/sysclk_switch/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • debug
  • tmr1
  • src
Functions | Variables
project/at_start_f415/examples/debug/tmr1/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | TMR1_OVF_TMR10_IRQHandler (void)
this function handles tmr1 overflow handler. More...
int | main (void)
main function. More...

Variables

crm_clocks_freq_type | crm_clocks_freq_struct = {0}
uint16_t | counter = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/debug/tmr1/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • dma
  • data_to_gpio_flexible
  • src
Macros | Functions | Variables
project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define BUFFER_SIZE 16

Functions

void | DMA2_Channel1_IRQHandler (void)
this function handles DMA2 channel1 handler. More...
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
dma_init_type | dma_init_struct = {0}
uint16_t | src_buffer [16]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • dma
  • flash_to_sram
  • src
Macros | Functions | Variables
project/at_start_f415/examples/dma/flash_to_sram/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define BUFFER_SIZE 32

Functions

error_status | buffer_compare (const uint32_t *pbuffer, uint32_t *pbuffer1, uint16_t buffer_length)
compares two buffers. More...
void | DMA1_Channel1_IRQHandler (void)
this function handles dma1 channel1 handler. More...
int | main (void)
main function. More...

Variables

const uint32_t | src_const_buffer [32]
uint32_t | dst_buffer [32]
gpio_init_type | gpio_init_struct = {0}
dma_init_type | dma_init_struct = {0}
__IO uint32_t | data_counter_end = 0x01
error_status transfer_status = ERROR

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/dma/flash_to_sram/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • ertc
  • bpr_domain
  • src
Macros | Functions | Variables
project/at_start_f415/examples/ertc/bpr_domain/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define ERTC_BPR_DT_NUMBER 20

Functions

void | ertc_config (void)
configure the ertc peripheral. More...
void | bpr_reg_write (void)
write data to bpr dt register. More...
uint32_t | bpr_reg_check (void)
checks if the bpr dt register values are correct or not. More...
int | main (void)
main function. More...

Variables

ertc_dt_type bpr_addr_tab [20]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/bpr_domain/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • ertc
  • calendar
  • src
Macros | Functions | Variables
project/at_start_f415/examples/ertc/calendar/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define ERTC_CLOCK_SOURCE_LEXT /* select lext as the ertc clock */

Functions

void | ertc_config (void)
configure the ertc peripheral by selecting the clock source. More...
void | ertc_alarm_show (void)
display the current alarm. More...
void | ertc_time_show (void)
display the current time. More...
int | main (void)
main program More...

Variables

__IO uint16_t | ertc_clk_div_a = 0
__IO uint16_t | ertc_clk_div_b = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/calendar/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • ertc
  • lick_calibration
  • src
Functions | Variables
project/at_start_f415/examples/ertc/lick_calibration/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | ertc_config (void)
configures the ertc peripheral by selecting the clock source. More...
uint32_t | lick_frequency_get (void)
configures tmr5 to measure the lick oscillator frequency. More...
int | main (void)
main program More...

Variables

__IO uint32_t | lick_freq = 0
__IO uint32_t | capture_number = 0
__IO uint32_t | period_value = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/lick_calibration/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • ertc
  • tamper
  • src
Macros | Functions | Variables
project/at_start_f415/examples/ertc/tamper/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define ERTC_BPR_DT_NUMBER 20

Functions

void | ertc_config (void)
configure the ertc peripheral by selecting the clock source. More...
void | bpr_reg_write (void)
write data to bpr dt register. More...
uint32_t | bpr_reg_check (void)
checks if the bpr dt register values are correct or not. More...
uint32_t | is_bpr_reg_reset (void)
checks if the ertc bpr dtx registers are reset or not. More...
void | ertc_tamper_config (void)
configure the ertc tamper. More...
int | main (void)
main program More...

Variables

ertc_dt_type bpr_addr_tab [20]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/tamper/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • ertc
  • time_stamp
  • src
Functions
project/at_start_f415/examples/ertc/time_stamp/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | ertc_time_show (void)
display the current date. More...
void | ertc_timestamp_show (void)
display the current timestamp. More...
void | ertc_config (void)
configure the ertc peripheral by selecting the clock source. More...
void | ertc_timestamp_config (void)
configure the ertc timestamp. More...
int | main (void)
main program More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/time_stamp/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • ertc
  • wakeup_timer
  • src
Functions
project/at_start_f415/examples/ertc/wakeup_timer/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | ertc_config (void)
configure the ertc peripheral by selecting the clock source. More...
void | wakeup_timer_config (void)
configure the ertc peripheral by selecting the clock source. More...
int | main (void)
main program More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/ertc/wakeup_timer/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • exint
  • exint_config
  • src
Functions
project/at_start_f415/examples/exint/exint_config/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | exint_line0_config (void)
exint line0 config. configure pa0 in interrupt mode More...
int | main (void)
main function. More...
void | EXINT0_IRQHandler (void)
exint0 interrupt handler More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/exint/exint_config/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • exint
  • exint_software_trigger
  • src
Functions
project/at_start_f415/examples/exint/exint_software_trigger/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | exint_line4_config (void)
exint line4 config. configure pa0 in interrupt mode More...
static void | tmr1_config (void)
tmr1 configuration. More...
void | TMR1_OVF_TMR10_IRQHandler (void)
tmr1 interrupt handler More...
void | EXINT4_IRQHandler (void)
exint4 interrupt handler More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/exint/exint_software_trigger/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • flash
  • flash_write_read
  • src
Macros | Functions | Variables
project/at_start_f415/examples/flash/flash_write_read/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "flash.h"

Go to the source code of this file.

Macros

#define | TEST_BUFEER_SIZE 3000
#define | TEST_FLASH_ADDRESS_START (0x08000000 + 1024 * 10)

Functions

error_status | buffer_compare (uint16_t *p_buffer1, uint16_t *p_buffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint16_t | buffer_write [3000]
uint16_t | buffer_read [3000]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/flash/flash_write_read/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • gpio
  • led_toggle
  • src
Functions
project/at_start_f415/examples/gpio/led_toggle/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/gpio/led_toggle/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • gpio
  • swjtag_remap
  • src
Functions
project/at_start_f415/examples/gpio/swjtag_remap/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | swj_dp_config (void)
configure the gpio of swj-dp. More...
void | gpio_pins_toggle (gpio_type *gpio_x, uint16_t gpio_pin)
toggles the specified gpio pin More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/gpio/swjtag_remap/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • i2c
  • communication_dma
  • src
Macros | Functions | Variables
project/at_start_f415/examples/i2c/communication_dma/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "i2c_application.h"

Go to the source code of this file.

Macros

#define | I2C_TIMEOUT 0xFFFFFFFF
#define | I2Cx_SPEED 100000
#define | I2Cx_ADDRESS 0xA0
#define | I2Cx_PORT I2C1
#define | I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
#define | I2Cx_SCL_PIN GPIO_PINS_6
#define | I2Cx_SCL_GPIO_PORT GPIOB
#define | I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SDA_PIN GPIO_PINS_7
#define | I2Cx_SDA_GPIO_PORT GPIOB
#define | I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_DMA_CLK CRM_DMA1_PERIPH_CLOCK
#define | I2Cx_DMA_TX_CHANNEL DMA1_CHANNEL6
#define | I2Cx_DMA_TX_IRQn DMA1_Channel6_IRQn
#define | I2Cx_DMA_RX_CHANNEL DMA1_CHANNEL7
#define | I2Cx_DMA_RX_IRQn DMA1_Channel7_IRQn
#define | I2Cx_EVT_IRQn I2C1_EVT_IRQn
#define | I2Cx_ERR_IRQn I2C1_ERR_IRQn
#define | BUF_SIZE 8
#define | MASTER_BOARD

Functions

uint32_t | buffer_compare (uint8_t *buffer1, uint8_t *buffer2, uint32_t len)
compare whether the valus of buffer 1 and buffer 2 are equal. More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
void | error_handler (uint32_t error_code)
error handler program More...
int | main (void)
main function. More...

Variables

uint8_t | tx_buf [8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}
uint8_t | rx_buf [8] = {0}
i2c_handle_type hi2cx

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_dma/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • i2c
  • communication_int
  • src
Macros | Functions | Variables
project/at_start_f415/examples/i2c/communication_int/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "i2c_application.h"

Go to the source code of this file.

Macros

#define | I2C_TIMEOUT 0xFFFFFFFF
#define | I2Cx_SPEED 100000
#define | I2Cx_ADDRESS 0xA0
#define | I2Cx_PORT I2C1
#define | I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
#define | I2Cx_SCL_PIN GPIO_PINS_6
#define | I2Cx_SCL_GPIO_PORT GPIOB
#define | I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SDA_PIN GPIO_PINS_7
#define | I2Cx_SDA_GPIO_PORT GPIOB
#define | I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_EVT_IRQn I2C1_EVT_IRQn
#define | I2Cx_ERR_IRQn I2C1_ERR_IRQn
#define | BUF_SIZE 8
#define | MASTER_BOARD

Functions

uint32_t | buffer_compare (uint8_t *buffer1, uint8_t *buffer2, uint32_t len)
compare whether the valus of buffer 1 and buffer 2 are equal. More...
void | error_handler (uint32_t error_code)
error handler program More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
int | main (void)
main function. More...

Variables

uint8_t | tx_buf [8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}
uint8_t | rx_buf [8] = {0}
i2c_handle_type hi2cx

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_int/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • i2c
  • communication_poll
  • src
Macros | Functions | Variables
project/at_start_f415/examples/i2c/communication_poll/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "i2c_application.h"

Go to the source code of this file.

Macros

#define | I2C_TIMEOUT 0xFFFFFFFF
#define | I2Cx_SPEED 100000
#define | I2Cx_ADDRESS 0xA0
#define | I2Cx_PORT I2C1
#define | I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
#define | I2Cx_SCL_PIN GPIO_PINS_6
#define | I2Cx_SCL_GPIO_PORT GPIOB
#define | I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SDA_PIN GPIO_PINS_7
#define | I2Cx_SDA_GPIO_PORT GPIOB
#define | I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | BUF_SIZE 8
#define | MASTER_BOARD

Functions

void | error_handler (uint32_t error_code)
error handler program More...
uint32_t | buffer_compare (uint8_t *buffer1, uint8_t *buffer2, uint32_t len)
compare whether the valus of buffer 1 and buffer 2 are equal. More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
int | main (void)
main function. More...

Variables

uint8_t | tx_buf [8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}
uint8_t | rx_buf [8] = {0}
i2c_handle_type hi2cx

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/communication_poll/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • i2c
  • eeprom
  • src
Macros | Functions | Variables
project/at_start_f415/examples/i2c/eeprom/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "i2c_application.h"

Go to the source code of this file.

Macros

#define | I2C_TIMEOUT 0xFFFFFFFF
#define | I2Cx_SPEED 100000
#define | I2Cx_ADDRESS 0xA0
#define | I2Cx_PORT I2C1
#define | I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
#define | I2Cx_SCL_PIN GPIO_PINS_6
#define | I2Cx_SCL_GPIO_PORT GPIOB
#define | I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SDA_PIN GPIO_PINS_7
#define | I2Cx_SDA_GPIO_PORT GPIOB
#define | I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_DMA_CLK CRM_DMA1_PERIPH_CLOCK
#define | I2Cx_DMA_TX_CHANNEL DMA1_CHANNEL6
#define | I2Cx_DMA_TX_IRQn DMA1_Channel6_IRQn
#define | I2Cx_DMA_RX_CHANNEL DMA1_CHANNEL7
#define | I2Cx_DMA_RX_IRQn DMA1_Channel7_IRQn
#define | I2Cx_EVT_IRQn I2C1_EVT_IRQn
#define | I2Cx_ERR_IRQn I2C1_ERR_IRQn
#define | BUF_SIZE 8

Functions

void | error_handler (uint32_t error_code)
error handler program More...
uint32_t | buffer_compare (uint8_t *buffer1, uint8_t *buffer2, uint32_t len)
compare whether the valus of buffer 1 and buffer 2 are equal. More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
int | main (void)
main function. More...

Variables

uint8_t | tx_buf1 [8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}
uint8_t | tx_buf2 [8] = {0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80}
uint8_t | tx_buf3 [8] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}
uint8_t | rx_buf1 [8] = {0}
uint8_t | rx_buf2 [8] = {0}
uint8_t | rx_buf3 [8] = {0}
i2c_handle_type hi2cx

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2c/eeprom/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • i2s
  • halfduplex_dma
  • src
Functions | Variables
project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include <stdio.h>

Go to the source code of this file.

Functions

static void | gpio_config (void)
gpio configuration. More...
static void | i2s_config (void)
i2s configuration. More...
error_status | buffer_compare (uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer_compare function. More...
int | main (void)
main function. More...

Variables

uint16_t | i2s1_buffer_tx [32]
uint16_t | i2s2_buffer_rx [32]
volatile error_status | transfer_status = ERROR

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • i2s
  • halfduplex_interrupt
  • src
Functions | Variables
project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include <stdio.h>

Go to the source code of this file.

Functions

static void | gpio_config (void)
gpio configuration. More...
static void | i2s_config (i2s_data_channel_format_type format, i2s_audio_sampling_freq_type freq)
i2s configuration. More...
error_status | buffer_compare (uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer_compare function. More...
error_status | buffer_compare_24bits (uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer_compare_24bits function. More...
int | main (void)
main function. More...

Variables

uint16_t | i2s1_buffer_tx [32]
uint16_t | i2s2_buffer_rx [32]
__IO uint32_t | tx_index = 0
__IO uint32_t | rx_index = 0
volatile error_status | transfer_status1 = ERROR
volatile error_status | transfer_status2 = ERROR

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • i2s
  • spii2s_switch_halfduplex_polling
  • src
Functions | Variables
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include <stdio.h>

Go to the source code of this file.

Functions

static void | gpio_config (void)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
static void | i2s_config (i2s_operation_mode_type i2s1_mode, i2s_operation_mode_type i2s2_mode)
i2s configuration. More...
error_status | buffer_compare (uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer_compare function. More...
int | main (void)
main function. More...

Variables

uint16_t | i2s1_buffer_tx [32]
uint16_t | SPI1_buffer_tx [32]
uint16_t | i2s2_buffer_rx [32]
uint16_t | spi2_buffer_rx [32]
__IO uint32_t | tx_index = 0
__IO uint32_t | rx_index = 0
volatile error_status | transfer_status1 = ERROR
volatile error_status | transfer_status2 = ERROR
volatile error_status | transfer_status3 = ERROR

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • pwc
  • deepsleep_ertc_alarm
  • src
Functions
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include <stdio.h>

Go to the source code of this file.

Functions

void | ertc_config (void)
ertc configuration. More...
void | ertc_alarm_config (void)
ertc alarm configuration. More...
void | ertc_alarm_value_set (uint32_t alam_index)
ertc alarm value set. More...
void | system_clock_recover (void)
systemclock recover. More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • pwc
  • deepsleep_ertc_tamper
  • src
Functions
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include <stdio.h>

Go to the source code of this file.

Functions

void | ertc_config (void)
ertc configuration. More...
void | ertc_tamper_config (void)
ertc tamper configuration. More...
void | system_clock_recover (void)
systemclock recover. More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • pwc
  • power_voltage_monitor
  • src
Functions
project/at_start_f415/examples/pwc/power_voltage_monitor/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | pvm_exint_config (void)
power voltage monitor exint configuration. More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/power_voltage_monitor/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • pwc
  • sleep_tmr2
  • src
Functions
project/at_start_f415/examples/pwc/sleep_tmr2/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | tmr2_config (void)
tmr2 configuration. More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/sleep_tmr2/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • pwc
  • sleep_usart1
  • src
Functions
project/at_start_f415/examples/pwc/sleep_usart1/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | usart1_config (uint32_t baudrate)
usart1 configuration. More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/sleep_usart1/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • pwc
  • standby_ertc_alarm
  • src
Functions
project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include <stdio.h>

Go to the source code of this file.

Functions

void | ertc_config (void)
ertc configuration. More...
void | ertc_alarm_config (void)
ertc alarm configuration. More...
void | ertc_alarm_value_set (uint32_t alam_index)
ertc alarm value set. More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • pwc
  • standby_wakeup_pin
  • src
Functions
project/at_start_f415/examples/pwc/standby_wakeup_pin/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include <stdio.h>

Go to the source code of this file.

Functions

int main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/pwc/standby_wakeup_pin/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • sdio
  • sd_mmc_card
  • src
Macros | Functions | Variables
project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c File Reference

main program More...

#include <stdbool.h>
#include <string.h>
#include "at32_sdio.h"
#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | BLOCK_SIZE (512)
#define | BLOCKS_NUMBER (8)
#define | MULTI_BUFFER_SIZE (BLOCK_SIZE * BLOCKS_NUMBER)
#define | STREAM_BUFFER_SIZE (1024)

Functions

static error_status | sd_single_block_test (void)
sd card single block read/write test. More...
static error_status | sd_multiple_blocks_test (void)
sd card multiple blocks read/write test. More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
static void | sd_test_error (void)
LED2 on off every 300ms for sd test failed. More...
static void | nvic_configuration (void)
configures sdio1 irq channel. More...
static error_status | mmc_stream_test (void)
mmc card data stream read/write test. More...
void | show_card_info (void)
show sd/mmc card info. More...
int | main (void)
main function. More...

Variables

static uint8_t | sblock_tbuffer [(512)]
static uint8_t | sblock_rbuffer [(512)]
static uint8_t | mblock_tbuffer [((512) *(8))]
static uint8_t | mblock_rbuffer [((512) *(8))]
static uint8_t | stream_tbuffer [(1024)]
static uint8_t | stream_rbuffer [(1024)]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • sdio
  • sdio_fatfs
  • src
Functions | Variables
project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c File Reference

main program More...

#include <stdbool.h>
#include <string.h>
#include "at32_sdio.h"
#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "ff.h"

Go to the source code of this file.

Functions

uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
static void | sd_test_error (void)
led2 on off every 300ms for sd test failed. More...
static void | nvic_configuration (void)
configures sdio1 irq channel. More...
static error_status | fatfs_test (void)
fatfs file read/write test. More...
int | main (void)
main function. More...

Variables

FATFS | fs
FIL | file
BYTE | work [FF_MAX_SS]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • spi
  • crc_transfer_polling
  • src
Macros | Functions | Variables
project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define BUFFER_SIZE 32

Functions

static void | gpio_config (void)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
error_status | buffer_compare (uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer compare function. More...
int | main (void)
main function. More...

Variables

uint16_t | spi1_tx_buffer [32]
uint16_t | spi2_tx_buffer [32]
uint16_t | spi1_rx_buffer [32]
uint16_t | spi2_rx_buffer [32]
uint32_t | tx_index = 0
uint32_t | rx_index = 0
__IO uint16_t | crc1_value = 0
__IO uint16_t | crc2_value = 0
volatile error_status | transfer_status1 = ERROR
volatile error_status | transfer_status2 = ERROR

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • spi
  • fullduplex_polling
  • src
Macros | Functions | Variables
project/at_start_f415/examples/spi/fullduplex_polling/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define BUFFER_SIZE 32

Functions

static void | gpio_config (uint16_t spi1_mode, uint16_t spi2_mode)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
error_status | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t bufferlength)
buffer compare function. More...
int | main (void)
main function. More...

Variables

spi_init_type spi_init_struct
uint8_t | spi1_tx_buffer [32]
uint8_t | spi2_tx_buffer [32]
uint8_t | spi1_rx_buffer [32]
uint8_t | spi2_rx_buffer [32]
uint32_t | tx_index = 0
uint32_t | rx_index = 0
volatile error_status | transfer_status1 = ERROR
volatile error_status | transfer_status2 = ERROR
volatile error_status | transfer_status3 = ERROR
volatile error_status | transfer_status4 = ERROR

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/fullduplex_polling/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • spi
  • halfduplex_interrupt
  • src
Macros | Functions | Variables
project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define BUFFER_SIZE 32

Functions

static void | gpio_config (void)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
error_status | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function. More...
int | main (void)
main function. More...

Variables

spi_init_type spi_init_struct
uint8_t | spi1_tx_buffer [32]
uint8_t | spi2_rx_buffer [32]
volatile uint32_t | tx_index = 0
volatile uint32_t | rx_index = 0
volatile error_status | transfer_status = ERROR

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • spi
  • halfduplex_transceiver_switch
  • src
Macros | Functions | Variables
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define BUFFER_SIZE 32

Functions

static void | gpio_config (void)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
error_status | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function. More...
int | main (void)
main function. More...

Variables

spi_init_type spi_init_struct
uint8_t | spi1_tx_buffer [32]
uint8_t | spi2_tx_buffer [32]
uint8_t | spi1_rx_buffer [32]
uint8_t | spi2_rx_buffer [32]
volatile uint32_t | tx_index = 0
volatile uint32_t | rx_index = 0
volatile error_status | transfer_status1 = ERROR
volatile error_status | transfer_status2 = ERROR

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • spi
  • only_receive_mode_polling
  • src
Macros | Functions | Variables
project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define BUFFER_SIZE 32

Functions

static void | gpio_config (void)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
error_status | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function. More...
int | main (void)
main function. More...

Variables

spi_init_type spi_init_struct
uint8_t | spi1_tx_buffer [32]
uint8_t | spi2_rx_buffer [32]
uint32_t | tx_index = 0
uint32_t | rx_index = 0
volatile error_status | transfer_status = ERROR

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • spi
  • use_jtagpin_hardwarecs_dma
  • src
Macros | Functions | Variables
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define BUFFER_SIZE 32

Functions

static void | gpio_config (void)
gpio configuration. More...
static void | spi_config (void)
spi configuration. More...
error_status | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function. More...
int | main (void)
main function. More...

Variables

uint8_t | spi1_tx_buffer [32]
uint8_t | spi2_rx_buffer [32]
__IO uint8_t | tx_index = 0
volatile error_status | transfer_status = ERROR

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • spi
  • w25q_flash
  • src
Macros | Functions | Variables
project/at_start_f415/examples/spi/w25q_flash/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "spi_flash.h"

Go to the source code of this file.

Macros

#define | FLASH_TEST_ADDR 0x1000
#define | BUF_SIZE 0x256

Functions

void | tx_data_fill (void)
transfer data fill. More...
error_status | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function. More...
int | main (void)
main function. More...

Variables

uint8_t | tx_buffer [0x256]
uint8_t | rx_buffer [0x256]
volatile error_status | transfer_status = ERROR

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/spi/w25q_flash/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • 6_steps
  • src
Functions | Variables
project/at_start_f415/examples/tmr/6_steps/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | systick_configuration (void)
configures the systick. More...
int | main (void)
main function. More...
void | TMR1_TRG_HALL_TMR11_IRQHandler (void)
this function handles tmr1 trigger and hall interrupts requests. More...

Variables

gpio_init_type | gpio_init_struct = {0}
tmr_output_config_type tmr_output_struct
tmr_brkdt_config_type | tmr_brkdt_config_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
__IO uint32_t | step = 1

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/6_steps/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • 7_pwm_output
  • src
Functions | Variables
project/at_start_f415/examples/tmr/7_pwm_output/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
tmr_output_config_type tmr_output_struct
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
uint16_t | timer_period = 0
uint16_t | channel1_pulse = 0
uint16_t | channel2_pulse = 0
uint16_t | channel3_pulse = 0
uint16_t | channel4_pulse = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/7_pwm_output/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • cascade_synchro
  • src
Functions | Variables
project/at_start_f415/examples/tmr/cascade_synchro/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Variables

gpio_init_type gpio_init_struct = {0}
tmr_output_config_type tmr_output_struct

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/cascade_synchro/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • complementary_signals
  • src
Functions | Variables
project/at_start_f415/examples/tmr/complementary_signals/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
tmr_output_config_type tmr_output_struct
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
tmr_brkdt_config_type | tmr_brkdt_config_struct = {0}
uint16_t | timer_period = 0
uint16_t | channel1_pulse = 0
uint16_t | channel2_pulse = 0
uint16_t | channel3_pulse = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/complementary_signals/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • dma
  • src
Functions | Variables
project/at_start_f415/examples/tmr/dma/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
tmr_output_config_type tmr_output_struct
dma_init_type | dma_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
uint16_t | timer_period = 0
uint16_t | src_buffer [3] = {0, 0, 0}

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/dma/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • dma_burst
  • src
Functions | Variables
project/at_start_f415/examples/tmr/dma_burst/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
tmr_output_config_type tmr_output_struct
dma_init_type | dma_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
uint16_t | timer_period = 0
uint16_t | src_buffer [3] = {0x0FFF, 0x0000, 0x0555}

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/dma_burst/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • encoder_tmr2
  • src
Functions | Variables
project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | delay (uint32_t time)
delay function More...
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
uint32_t | counter

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • external_clock
  • src
Functions | Variables
project/at_start_f415/examples/tmr/external_clock/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
tmr_output_config_type tmr_output_struct
tmr_input_config_type tmr_input_config_struct

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/external_clock/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • hall_xor_tmr2
  • src
Functions | Variables
project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

int | main (void)
main function. More...
void | TMR2_GLOBAL_IRQHandler (void)
this function handles TMR2 trigger exception. More...

Variables

gpio_init_type | gpio_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
tmr_output_config_type tmr_output_struct
tmr_input_config_type tmr_input_config_struct

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • hang_mode
  • src
Functions | Variables
project/at_start_f415/examples/tmr/hang_mode/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
tmr_output_config_type tmr_output_struct
tmr_input_config_type tmr_input_config_struct

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/hang_mode/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • input_capture
  • src
Functions | Variables
project/at_start_f415/examples/tmr/input_capture/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | uart_init (uint32_t baudrate)
init usart. More...
void | TMR3_GLOBAL_IRQHandler (void)
this function handles tmr3 trigger exception. More...
int | main (void)
main function. More...

Variables

gpio_init_type | gpio_init_struct = {0}
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
tmr_input_config_type tmr_input_config_struct
__IO uint32_t | tmr3freq = 0
__IO uint32_t | sys_counter = 0
__IO uint16_t | capturenumber = 0
__IO uint16_t | ch3readvalue1 = 0
__IO uint16_t | ch3readvalue2 = 0
__IO uint32_t | capture = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/input_capture/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • oc_high
  • src
Functions | Variables
project/at_start_f415/examples/tmr/oc_high/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | gpio_configuration (void)
configure the gpioc pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
crm_clocks_freq_type | crm_clocks_freq_struct = {0}
uint16_t | ch1_val = 1000
uint16_t | ch2_val = 500
uint16_t | ch3_val = 250
uint16_t | ch4_val = 125
uint16_t | div_value = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_high/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • oc_low
  • src
Functions | Variables
project/at_start_f415/examples/tmr/oc_low/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | gpio_configuration (void)
configure the gpioc pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
uint16_t | ch1_val = 1000
uint16_t | ch2_val = 500
uint16_t | ch3_val = 250
uint16_t | ch4_val = 125
uint16_t | div_value = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_low/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • oc_toggle_tmr3
  • src
Functions | Variables
project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr3 pins. More...
void | nvic_configuration (void)
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
__IO uint16_t | ch1_val = 32768
__IO uint16_t | ch2_val = 16384
__IO uint16_t | ch3_val = 8192
__IO uint16_t | ch4_val = 4096
uint16_t | div_value = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • oc_toggle_tmr9
  • src
Functions | Variables
project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr9 pins. More...
void | nvic_configuration (void)
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
__IO uint16_t | ch1_val = 32768
__IO uint16_t | ch2_val = 16384
uint16_t | div_value = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • one_cycle
  • src
Functions | Variables
project/at_start_f415/examples/tmr/one_cycle/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr3 pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
tmr_input_config_type tmr_ic_init_structure
uint16_t div_value = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/one_cycle/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • parallel_synchro
  • src
Functions | Variables
project/at_start_f415/examples/tmr/parallel_synchro/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr3 pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/parallel_synchro/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • pwm_input
  • src
Functions | Variables
project/at_start_f415/examples/tmr/pwm_input/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr3 pins. More...
int | main (void)
main function. More...

Variables

tmr_input_config_type tmr_ic_init_structure
__IO uint16_t | duty_cycle = 0
__IO uint32_t | frequency = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_input/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • pwm_input_dma
  • src
Macros | Functions | Variables
project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | TMR1_C1DT_ADDRESS 0x40012C34
#define | TMR1_C2DT_ADDRESS 0x40012C38
#define | SAMPLING_NUM 1000

Functions

void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr1 pins. More...
void | DMA1_Channel2_IRQHandler (void)
int | main (void)
main function. More...

Variables

tmr_input_config_type tmr_ic_init_structure
dma_init_type dma_init_structure
__IO uint16_t | buffer_ch1 [1000]
__IO uint16_t | buffer_ch2 [1000]
__IO uint32_t | frequency = 0
__IO float | duty_cycle = 0
uint32_t | freq_result
float | duty_result

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • pwm_output_simulate
  • src
Functions | Variables
project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr1 pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
uint16_t | ch1_val = 40961
uint16_t | ch2_val = 27309
uint16_t | ch3_val = 13654
uint16_t | ch4_val = 6826
uint16_t | div_value = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • pwm_output_tmr10
  • src
Functions | Variables
project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr1 pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
uint16_t | ch1_val = 250
uint16_t | div_value = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • pwm_output_tmr3
  • src
Functions | Variables
project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr3 pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
uint16_t | ch1_val = 333
uint16_t | ch2_val = 249
uint16_t | ch3_val = 166
uint16_t | ch4_val = 83
uint16_t | div_value = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • timer_base
  • src
Functions | Variables
project/at_start_f415/examples/tmr/timer_base/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | clkout_config (void)
clkout configuration. More...
void | TMR1_OVF_TMR10_IRQHandler (void)
this function handles timer1 overflow handler. More...
int | main (void)
main function. More...

Variables

crm_clocks_freq_type crm_clocks_freq_struct = {0}

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/timer_base/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • tmr1_synchro
  • src
Functions | Variables
project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr1 pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • tmr
  • tmr2_32bit
  • src
Functions | Variables
project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | crm_configuration (void)
configures the different peripheral clocks. More...
void | gpio_configuration (void)
configure the tmr1 pins. More...
int | main (void)
main function. More...

Variables

tmr_output_config_type tmr_oc_init_structure
uint32_t | ch1_val = 0x7FFFF
uint32_t | ch2_val = 0x3FFFF
uint32_t | ch3_val = 0x1FFFF
uint32_t | ch4_val = 0xFFFF

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usart
  • half_duplex
  • src
Macros | Functions | Variables
project/at_start_f415/examples/usart/half_duplex/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | COUNTOF(a) (sizeof(a) / sizeof(*(a)))
#define | USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
#define | USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Functions

void | usart_configuration (void)
config usart
More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [] = "usart half-duplex transfer: usart2 -> usart3"
uint8_t | usart3_tx_buffer [] = "usart half-duplex transfer: usart3 -> usart2"
uint8_t | usart2_rx_buffer [((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
uint8_t | usart3_rx_buffer [((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
uint8_t | data_count

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/half_duplex/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usart
  • hw_flow_control
  • src
Macros | Functions | Variables
project/at_start_f415/examples/usart/hw_flow_control/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define BUFFER_SIZE 16

Functions

void | usart_configuration (void)
config usart
More...
int | main (void)
main function. More...

Variables

uint8_t | rx_buffer [16]
uint8_t | data_count

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/hw_flow_control/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usart
  • idle_detection
  • src
Functions
project/at_start_f415/examples/usart/idle_detection/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | usart_configuration (void)
config usart
More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/idle_detection/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usart
  • interrupt
  • src
Macros | Functions | Variables
project/at_start_f415/examples/usart/interrupt/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | COUNTOF(a) (sizeof(a) / sizeof(*(a)))
#define | USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
#define | USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Functions

void | usart_configuration (void)
config usart
More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [] = "usart transfer by interrupt: usart2 -> usart3 using interrupt"
uint8_t | usart3_tx_buffer [] = "usart transfer by interrupt: usart3 -> usart2 using interrupt"
uint8_t | usart2_rx_buffer [((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
uint8_t | usart3_rx_buffer [((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
volatile uint8_t | usart2_tx_counter = 0x00
volatile uint8_t | usart3_tx_counter = 0x00
volatile uint8_t | usart2_rx_counter = 0x00
volatile uint8_t | usart3_rx_counter = 0x00
uint8_t | usart2_tx_buffer_size = ((sizeof( usart2_tx_buffer ) / sizeof(*( usart2_tx_buffer ))) - 1)
uint8_t | usart3_tx_buffer_size = ((sizeof( usart3_tx_buffer ) / sizeof(*( usart3_tx_buffer ))) - 1)

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/interrupt/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usart
  • irda
  • src
Functions
project/at_start_f415/examples/usart/irda/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

void | usart_configuration (void)
config usart
More...
int | main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/irda/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usart
  • polling
  • src
Macros | Functions | Variables
project/at_start_f415/examples/usart/polling/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | COUNTOF(a) (sizeof(a) / sizeof(*(a)))
#define | USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
#define | USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Functions

void | usart_configuration (void)
config usart
More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [] = "usart transfer by interrupt: usart2 -> usart3 using interrupt"
uint8_t | usart3_tx_buffer [] = "usart transfer by interrupt: usart3 -> usart2 using interrupt"
uint8_t | usart2_rx_buffer [((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
uint8_t | usart3_rx_buffer [((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
uint8_t | usart2_tx_counter = 0x00
uint8_t | usart3_tx_counter = 0x00
uint8_t | usart2_rx_counter = 0x00
uint8_t | usart3_rx_counter = 0x00
uint8_t | usart2_tx_buffer_size = ((sizeof( usart2_tx_buffer ) / sizeof(*( usart2_tx_buffer ))) - 1)
uint8_t | usart3_tx_buffer_size = ((sizeof( usart3_tx_buffer ) / sizeof(*( usart3_tx_buffer ))) - 1)

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/polling/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usart
  • printf
  • src
Functions | Variables
project/at_start_f415/examples/usart/printf/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Variables

__IO uint32_t time_cnt = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/printf/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usart
  • receiver_mute
  • src
Macros | Functions | Variables
project/at_start_f415/examples/usart/receiver_mute/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | BUFFER_SIZE 7
#define | MATCH_ID_VAL 0x81
#define | ERROR_ID_VAL 0x82
#define | DATA1_VAL 0x7F
#define | DATA2_VAL 0x7A
#define | DATA3_VAL 0x7B
#define | DATA4_VAL 0x7C

Functions

void | usart_configuration (void)
config usart
More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [7] = { 0x7F , 0x81 , 0x7A , 0x82 , 0x7B , 0x81 , 0x7C }
uint8_t | usart3_rx_buffer [7]
uint8_t | tx_counter = 0
uint8_t | rx_counter = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/receiver_mute/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usart
  • smartcard
  • src
Data Structures | Macros | Functions | Variables
project/at_start_f415/examples/usart/smartcard/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "smartcard_config.h"

Go to the source code of this file.

Data Structures

struct sc_atr_type

Macros

#define | T0_PROTOCOL 0x00 /* t0 protocol */
#define | SETUP_LENGTH 20
#define | HIST_LENGTH 20
#define | SC_RECEIVE_TIMEOUT 0x4000 /* direction to reader */

Functions

void | usart_configuration (void)
config usart More...
uint8_t | sc_response_decode (__IO uint8_t *card)
decode the card atr response. More...
int | main (void)
main function. More...

Variables

sc_atr_type sc_a2r_struct
uint32_t | counter = 0
error_status atr_decode_status = ERROR
uint32_t | card_inserted = 0
uint32_t | card_protocol = 1
uint8_t | dst_buffer [50]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/smartcard/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usart
  • synchronous
  • src
Macros | Functions | Variables
project/at_start_f415/examples/usart/synchronous/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | COUNTOF(a) (sizeof(a) / sizeof(*(a)))
#define | USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
#define | SPI2_TX_BUFFER_SIZE (COUNTOF(spi2_tx_buffer) - 1)
#define | DYMMY_BYTE 0x00

Functions

void | usart_spi_configuration (void)
config usart and spi
More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [] = "usart synchronous example: usart2 -> spi2"
uint8_t | spi2_tx_buffer [] = "usart synchronous example: spi2 -> usart2"
uint8_t | usart2_rx_buffer [((sizeof(spi2_tx_buffer)/sizeof(*(spi2_tx_buffer))) - 1)]
uint8_t | spi2_rx_buffer [((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
uint8_t | usart2_tx_counter = 0x00
uint8_t | spi2_tx_counter = 0x00
uint8_t | usart2_rx_counter = 0x00
uint8_t | spi2_rx_counter = 0x00
uint8_t | usart2_tx_buffer_size = ((sizeof( usart2_tx_buffer ) / sizeof(*( usart2_tx_buffer ))) - 1)
uint8_t | spi2_tx_buffer_size = ((sizeof( spi2_tx_buffer ) / sizeof(*( spi2_tx_buffer ))) - 1)

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/synchronous/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usart
  • transfer_by_dma_interrupt
  • src
Macros | Functions | Variables
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | COUNTOF(a) (sizeof(a) / sizeof(*(a)))
#define | USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
#define | USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Functions

void | usart_configuration (void)
config usart
More...
void | dma_configuration (void)
config dma for usart2 and usart3
More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [] = "usart transfer by dma interrupt: usart2 -> usart3 using dma"
uint8_t | usart3_tx_buffer [] = "usart transfer by dma interrupt: usart3 -> usart2 using dma"
uint8_t | usart2_rx_buffer [((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
uint8_t | usart3_rx_buffer [((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
volatile uint8_t | usart2_tx_dma_status = 0
volatile uint8_t | usart2_rx_dma_status = 0
volatile uint8_t | usart3_tx_dma_status = 0
volatile uint8_t | usart3_rx_dma_status = 0

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usart
  • transfer_by_dma_polling
  • src
Macros | Functions | Variables
project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | COUNTOF(a) (sizeof(a) / sizeof(*(a)))
#define | USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
#define | USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)

Functions

void | usart_configuration (void)
config usart
More...
void | dma_configuration (void)
config dma for usart2 and usart3
More...
uint8_t | buffer_compare (uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint8_t | usart2_tx_buffer [] = "usart transfer by dma interrupt: usart2 -> usart3 using dma"
uint8_t | usart3_tx_buffer [] = "usart transfer by dma interrupt: usart3 -> usart2 using dma"
uint8_t | usart2_rx_buffer [((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
uint8_t | usart3_rx_buffer [((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usb_device
  • audio
  • src
Functions | Variables
project/at_start_f415/examples/usb_device/audio/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbd_int.h"
#include "audio_class.h"
#include "audio_desc.h"
#include "audio_codec.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/audio/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usb_device
  • composite_audio_hid
  • src
Functions | Variables
project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbd_int.h"
#include "audio_hid_class.h"
#include "audio_hid_desc.h"
#include "audio_codec.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct
uint8_t report_buf [USBD_IN_MAXPACKET_SIZE]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usb_device
  • composite_vcp_keyboard
  • src
Functions | Variables
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbd_int.h"
#include "cdc_keyboard_class.h"
#include "cdc_keyboard_desc.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | keyboard_send_string (uint8_t *string, uint8_t len)
keyboard send string More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
void | button_exint_init (void)
configure button exint More...
void | button_isr (void)
button handler function More...
void | EXINT0_IRQHandler (void)
exint0 interrupt handler More...
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct
__IO uint8_t | keyboard_send_flag
uint8_t | usb_buffer [256]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usb_device
  • custom_hid
  • src
Functions | Variables
project/at_start_f415/examples/usb_device/custom_hid/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbd_int.h"
#include "custom_hid_class.h"
#include "custom_hid_desc.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct
uint8_t report_buf [USBD_IN_MAXPACKET_SIZE]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/custom_hid/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usb_device
  • keyboard
  • src
Functions | Variables
project/at_start_f415/examples/usb_device/keyboard/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbd_int.h"
#include "keyboard_class.h"
#include "keyboard_desc.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | keyboard_send_string (uint8_t *string, uint8_t len)
keyboard send string More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
void | system_clock_recover (void)
systemclock recover. More...
void | button_exint_init (void)
configure button exint More...
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct
__IO uint8_t hid_suspend_flag

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/keyboard/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usb_device
  • mouse
  • src
Functions | Variables
project/at_start_f415/examples/usb_device/mouse/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbd_int.h"
#include "mouse_class.h"
#include "mouse_desc.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | keyboard_send_string (uint8_t *string, uint8_t len)
keyboard send string More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
void | system_clock_recover (void)
systemclock recover. More...
void | button_exint_init (void)
configure button exint More...
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct
__IO uint8_t | press_mouse = 0
__IO uint8_t | hid_suspend_flag

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/mouse/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usb_device
  • msc
  • src
Functions | Variables
project/at_start_f415/examples/usb_device/msc/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbd_int.h"
#include "msc_class.h"
#include "msc_desc.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/msc/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usb_device
  • printer
  • src
Functions | Variables
project/at_start_f415/examples/usb_device/printer/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbd_int.h"
#include "printer_class.h"
#include "printer_desc.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/printer/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usb_device
  • vcp_loopback
  • src
Functions | Variables
project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbd_int.h"
#include "cdc_class.h"
#include "cdc_desc.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct
uint8_t usb_buffer [256]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usb_device
  • virtual_msc_iap
  • src
Functions | Variables
project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbd_int.h"
#include "msc_class.h"
#include "msc_desc.h"
#include "flash_fat16.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
void | button_exint_init (button_type button)
void | button_isr (void)
button handler function More...
void | jump_to_app (uint32_t address)
jump to app More...
void | usb_re_connect ()
usb re-connect More...
int | main (void)
main function. More...
void | flash_fat16_loop_status (void)
loop status More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct
void(* pftarget )(void)

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usb_host
  • hid_demo
  • src
Functions | Variables
project/at_start_f415/examples/usb_host/hid_demo/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbh_int.h"
#include "usbh_hid_class.h"
#include "usbh_user.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
void | button_exint_init (void)
configure button exint More...
void | button_isr (void)
button handler function More...
void | EXINT0_IRQHandler (void)
exint0 interrupt handler More...
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/hid_demo/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • usb_host
  • msc_only_fat32
  • src
Functions | Variables
project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbh_int.h"
#include "usbh_user.h"
#include "usbh_msc_class.h"
#include "ff.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • wdt
  • wdt_reset
  • src
Functions
project/at_start_f415/examples/wdt/wdt_reset/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/wdt/wdt_reset/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • wwdt
  • wwdt_reset
  • src
Functions
project/at_start_f415/examples/wwdt/wwdt_reset/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/wwdt/wwdt_reset/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • templates
  • src
Macros | Functions | Variables
project/at_start_f415/templates/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | DELAY 100
#define | FAST 1
#define | SLOW 4

Functions

void | button_exint_init (void)
configure button exint More...
void | button_isr (void)
button handler function More...
void | EXINT0_IRQHandler (void)
exint0 interrupt handler More...
int | main (void)
main function. More...

Variables

uint8_t g_speed = 1

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/templates/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • src
Macros | Functions | Variables
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"

Go to the source code of this file.

Macros

#define | TEST_BUFEER_SIZE 0x400
#define | TEST_FLASH_ADDRESS_START 0x1FFFAC00

Functions

error_status | buffer_compare (uint16_t *p_buffer1, uint16_t *p_buffer2, uint16_t buffer_length)
compares two buffers. More...
int | main (void)
main function. More...

Variables

uint16_t | buffer_write [0x400]
uint16_t | buffer_read [0x400]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • src
Functions
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "run_in_boot_memory.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • utilities
  • at32f415_freertos_demo
  • src
Functions | Variables
utilities/at32f415_freertos_demo/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "FreeRTOS.h"
#include "task.h"

Go to the source code of this file.

Functions

void | led2_task_function (void *pvParameters)
void | led3_task_function (void *pvParameters)
int | main (void)
main function. More...

Variables

TaskHandle_t | led2_handler
TaskHandle_t | led3_handler

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_freertos_demo/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • utilities
  • at32f415_gen_random_number_demo
  • src
Functions
utilities/at32f415_gen_random_number_demo/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "random.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_gen_random_number_demo/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
Macros | Functions | Variables
utilities/at32f415_slib_demo/project_l0/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include <stdio.h>
#include "math_helper.h"
#include "fir_filter.h"

Go to the source code of this file.

Macros

#define | USE_SLIB_FUNCTION /* define it when user want to activate slib in this project */
#define | FLASH_START_ADDR 0x08000000
#define | TEST_SLIB_PSW 0x55665566
#define | SLIB_START_ADDR 0x08001000
#define | SLIB_DATA_ADDR 0x08002000
#define | SLIB_END_ADDR 0x08002800
#define | FLASH_SECTOR_SIZE 0x800
#define | SECTOR_NUM(dwAddr) ((dwAddr & (FLASH_START_ADDR - 1)) / FLASH_SECTOR_SIZE)
#define | SECTOR_WORD_CNT (FLASH_SECTOR_SIZE >> 2) /* words per sector */
#define | SNR_THRESHOLD_F32 140.0f
#define | TEST_LENGTH_SAMPLES 320

Functions

flash_status_type | slib_enable (void)
config slib enable and program slib area. More...
void | config_flash_interrupt (void)
config flash error interrupt. More...
int | main (void)
main function. More...

Variables

float32_t | testInput_f32_1kHz_15kHz []
float32_t | refOutput []
uint32_t | dw_start_sector
uint32_t | dw_data_start_sector
uint32_t | dw_end_sector
uint32_t | temp_buf [512]
static float32_t | testOutput [320]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_slib_demo/project_l0/src/main.c.

Variable Documentation

◆ refOutput

float32_t refOutput[]
extern

Definition at line 96 of file project_l0/src/arm_fir_data.c.

Referenced by main().

◆ testInput_f32_1kHz_15kHz

float32_t testInput_f32_1kHz_15kHz[]
extern

Definition at line 48 of file project_l0/src/arm_fir_data.c.

Referenced by main().


AT32F415 Firmwary Library: main.c File Reference

  • utilities
  • at32f415_slib_demo
  • project_l1
  • src
Macros | Functions | Variables
utilities/at32f415_slib_demo/project_l1/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include <stdio.h>
#include "math_helper.h"
#include "fir_filter.h"

Go to the source code of this file.

Macros

#define | SNR_THRESHOLD_F32 140.0f
#define | TEST_LENGTH_SAMPLES 320

Functions

void | config_flash_interrupt (void)
config flash error interrupt. More...
int | main (void)
main function. More...

Variables

float32_t | testInput_f32_1kHz_15kHz []
float32_t | refOutput []
static float32_t | testOutput [320]

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_slib_demo/project_l1/src/main.c.

Variable Documentation

◆ refOutput

float32_t refOutput[]
extern

Definition at line 96 of file project_l0/src/arm_fir_data.c.

Referenced by main().

◆ testInput_f32_1kHz_15kHz

float32_t testInput_f32_1kHz_15kHz[]
extern

Definition at line 48 of file project_l0/src/arm_fir_data.c.

Referenced by main().


AT32F415 Firmwary Library: main.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • src
Functions
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "tmr.h"
#include "usart.h"
#include "iap.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • src
Functions
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "tmr.h"
#include "usart.h"
#include "iap.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
Functions
utilities/at32f415_usart_iap_demo/source_code/bootloader/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "tmr.h"
#include "usart.h"
#include "flash.h"
#include "iap.h"

Go to the source code of this file.

Functions

int main (void)
main function. More...

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • src
Functions | Variables
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbd_int.h"
#include "hid_iap_class.h"
#include "hid_iap_desc.h"
#include "hid_iap_user.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • src
Functions | Variables
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbd_int.h"
#include "hid_iap_class.h"
#include "hid_iap_desc.h"
#include "hid_iap_user.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c.


AT32F415 Firmwary Library: main.c File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • src
Functions | Variables
utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c File Reference

main program More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "usb_conf.h"
#include "usb_core.h"
#include "usbd_int.h"
#include "hid_iap_class.h"
#include "hid_iap_desc.h"
#include "hid_iap_user.h"

Go to the source code of this file.

Functions

void | usb_clock48m_select (usb_clk48_s clk_s)
usb 48M clock select More...
void | usb_gpio_config (void)
this function config gpio. More...
void | usb_low_power_wakeup_config (void)
int | main (void)
main function. More...
void | OTG_IRQ_HANDLER (void)
this function handles otgfs interrupt. More...
void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Variables

otg_core_type otg_core_struct

Detailed Description

main program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c.


AT32F415 Firmwary Library: flash.h File Reference

  • flash
  • flash_write_read
  • inc
Functions
project/at_start_f415/examples/flash/flash_write_read/inc/flash.h File Reference

flash header file More...

#include "at32f415_board.h"

Go to the source code of this file.

Functions

void | flash_read (uint32_t read_addr, uint16_t *p_buffer, uint16_t num_read)
read data using halfword mode More...
void | flash_write_nocheck (uint32_t write_addr, uint16_t *p_buffer, uint16_t num_write)
write data using halfword mode without checking More...
void | flash_write (uint32_t write_addr, uint16_t *p_Buffer, uint16_t num_write)
write data using halfword mode with checking More...

Detailed Description

flash header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/flash/flash_write_read/inc/flash.h.


AT32F415 Firmwary Library: flash.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
Macros | Functions
utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h File Reference

flash header file More...

#include "at32f415_board.h"

Go to the source code of this file.

Macros

#define | FLASH_SIZE (*((uint32_t*)0x1FFFF7E0)) /* read from at32 flash capacity register(unit:kbyte) */
#define | SRAM_SIZE 224 /* sram size, unit:kbyte */

Functions

void | flash_2kb_write (uint32_t write_addr, uint8_t *pbuffer)
flash erase/program operation. More...
flag_status | flash_upgrade_flag_read (void)
check flash upgrade flag. More...

Detailed Description

flash header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h.


AT32F415 Firmwary Library: flash.c File Reference

  • flash
  • flash_write_read
  • src
Macros | Functions | Variables
project/at_start_f415/examples/flash/flash_write_read/src/flash.c File Reference

flash program More...

#include "at32f415_board.h"
#include "flash.h"

Go to the source code of this file.

Macros

#define SECTOR_SIZE 2048

Functions

void | flash_read (uint32_t read_addr, uint16_t *p_buffer, uint16_t num_read)
read data using halfword mode More...
void | flash_write_nocheck (uint32_t write_addr, uint16_t *p_buffer, uint16_t num_write)
write data using halfword mode without checking More...
void | flash_write (uint32_t write_addr, uint16_t *p_buffer, uint16_t num_write)
write data using halfword mode with checking More...

Variables

uint16_t flash_buf [2048/2]

Detailed Description

flash program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/flash/flash_write_read/src/flash.c.


AT32F415 Firmwary Library: flash.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
Functions
utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c File Reference

flash program More...

#include "flash.h"
#include "usart.h"
#include "iap.h"

Go to the source code of this file.

Functions

void | flash_2kb_write (uint32_t write_addr, uint8_t *pbuffer)
flash erase/program operation. More...
flag_status | flash_upgrade_flag_read (void)
check flash upgrade flag. More...

Detailed Description

flash program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c.


AT32F415 Firmwary Library: at32_sdio.h File Reference

  • sdio
  • sd_mmc_card
  • inc
Data Structures | Macros | Enumerations | Functions | Variables
sd_mmc_card/inc/at32_sdio.h File Reference

this file contains all the functions prototypes for the sd/mmc card at32_sdio driver firmware library. More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | sd_csd_struct_type
struct | sd_cid_struct_type
struct | sd_scr_struct_type
struct | sd_card_info_struct_type

Macros

#define | SDIOx SDIO1
#define | SD_CMD_GO_IDLE_STATE ((uint8_t)0)
#define | SD_CMD_SEND_OP_COND ((uint8_t)1)
#define | SD_CMD_ALL_SEND_CID ((uint8_t)2)
#define | SD_CMD_SET_REL_ADDR ((uint8_t)3)
#define | SD_CMD_SET_DSR ((uint8_t)4)
#define | SD_CMD_SDIO_SEN_OP_COND ((uint8_t)5)
#define | SD_CMD_HS_SWITCH ((uint8_t)6)
#define | SD_CMD_SEL_DESEL_CARD ((uint8_t)7)
#define | SD_CMD_HS_SEND_EXT_CSD ((uint8_t)8)
#define | SD_CMD_SEND_CSD ((uint8_t)9)
#define | SD_CMD_SEND_CID ((uint8_t)10)
#define | SD_CMD_READ_DAT_UNTIL_STOP ((uint8_t)11)
#define | SD_CMD_STOP_TRANSMISSION ((uint8_t)12)
#define | SD_CMD_SEND_STATUS ((uint8_t)13)
#define | SD_CMD_HS_BUSTEST_READ ((uint8_t)14)
#define | SD_CMD_GO_INACTIVE_STATE ((uint8_t)15)
#define | SD_CMD_SET_BLOCKLEN ((uint8_t)16)
#define | SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17)
#define | SD_CMD_READ_MULT_BLOCK ((uint8_t)18)
#define | SD_CMD_HS_BUSTEST_WRITE ((uint8_t)19)
#define | SD_CMD_WRITE_DAT_UNTIL_STOP ((uint8_t)20)
#define | SD_CMD_SET_BLOCK_COUNT ((uint8_t)23)
#define | SD_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24)
#define | SD_CMD_WRITE_MULT_BLOCK ((uint8_t)25)
#define | SD_CMD_PROG_CID ((uint8_t)26)
#define | SD_CMD_PROG_CSD ((uint8_t)27)
#define | SD_CMD_SET_WRITE_PROT ((uint8_t)28)
#define | SD_CMD_CLR_WRITE_PROT ((uint8_t)29)
#define | SD_CMD_SEND_WRITE_PROT ((uint8_t)30)
#define | SD_CMD_SD_ERASE_GRP_START ((uint8_t)32)
#define | SD_CMD_SD_ERASE_GRP_END ((uint8_t)33)
#define | SD_CMD_ERASE_GRP_START ((uint8_t)35)
#define | SD_CMD_ERASE_GRP_END ((uint8_t)36)
#define | SD_CMD_ERASE ((uint8_t)38)
#define | SD_CMD_FAST_IO ((uint8_t)39)
#define | SD_CMD_GO_IRQ_STATE ((uint8_t)40)
#define | SD_CMD_LOCK_UNLOCK ((uint8_t)42)
#define | SD_CMD_APP_CMD ((uint8_t)55)
#define | SD_CMD_GEN_CMD ((uint8_t)56)
#define | SD_CMD_NO_CMD ((uint8_t)64)
#define | SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6)
#define | SD_CMD_SD_APP_STAUS ((uint8_t)13)
#define | SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22)
#define | SD_CMD_SD_APP_OP_COND ((uint8_t)41)
#define | SD_CMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42)
#define | SD_CMD_SD_APP_SEND_SCR ((uint8_t)51)
#define | SD_CMD_SDIO_RW_DIRECT ((uint8_t)52)
#define | SD_CMD_SDIO_RW_EXTENDED ((uint8_t)53)
#define | SD_CMD_SD_APP_GET_MKB ((uint8_t)43)
#define | SD_CMD_SD_APP_GET_MID ((uint8_t)44)
#define | SD_CMD_SD_APP_SET_CER_RN1 ((uint8_t)45)
#define | SD_CMD_SD_APP_GET_CER_RN2 ((uint8_t)46)
#define | SD_CMD_SD_APP_SET_CER_RES2 ((uint8_t)47)
#define | SD_CMD_SD_APP_GET_CER_RES1 ((uint8_t)48)
#define | SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK ((uint8_t)18)
#define | SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK ((uint8_t)25)
#define | SD_CMD_SD_APP_SECURE_ERASE ((uint8_t)38)
#define | SD_CMD_SD_APP_CHANGE_SECURE_AREA ((uint8_t)49)
#define | SD_CMD_SD_APP_SECURE_WRITE_MKB ((uint8_t)48)
#define | NULL 0
#define | SDIO_STATIC_FLAGS ((uint32_t)0x000005FF)
#define | SDIO_CMD0TIMEOUT ((uint32_t)0x00010000)
#define | SDIO_DATATIMEOUT ((uint32_t)0xFFFFFFFF)
#define | SDIO_FIFO_Address ((uint32_t)0x40018080)
#define | SD_OCR_ADDR_OUT_OF_RANGE ((uint32_t)0x80000000)
#define | SD_OCR_ADDR_MISALIGNED ((uint32_t)0x40000000)
#define | SD_OCR_BLK_LEN_ERR ((uint32_t)0x20000000)
#define | SD_OCR_ERASE_SEQ_ERR ((uint32_t)0x10000000)
#define | SD_OCR_INVALID_ERASE_PARAM ((uint32_t)0x08000000)
#define | SD_OCR_WR_PROTECT_VIOLATION ((uint32_t)0x04000000)
#define | SD_OCR_LOCK_UNLOCK_FAILED ((uint32_t)0x01000000)
#define | SD_OCR_CMD_CRC_FAILED ((uint32_t)0x00800000)
#define | SD_OCR_ILLEGAL_CMD ((uint32_t)0x00400000)
#define | SD_OCR_CARD_ECC_FAILED ((uint32_t)0x00200000)
#define | SD_OCR_CARD_CONTROLLER_ERR ((uint32_t)0x00100000)
#define | SD_OCR_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00080000)
#define | SD_OCR_STREAM_RD_UNDERRUN ((uint32_t)0x00040000)
#define | SD_OCR_STREAM_WR_OVERRUN ((uint32_t)0x00020000)
#define | SD_OCR_CID_CSD_OVERWRIETE ((uint32_t)0x00010000)
#define | SD_OCR_WP_ERASE_SKIP ((uint32_t)0x00008000)
#define | SD_OCR_CARD_ECC_DISABLED ((uint32_t)0x00004000)
#define | SD_OCR_ERASE_RESET ((uint32_t)0x00002000)
#define | MMC_SWITCH_ERROR ((uint32_t)0x00000080)
#define | SD_OCR_AKE_SEQ_ERROR ((uint32_t)0x00000008)
#define | SD_OCR_ERRORBITS ((uint32_t)0xFDFFE008)
#define | SD_R5_OUT_OF_RANGE ((uint32_t)0x00000100)
#define | SD_R5_FUNCTION_NUMBER ((uint32_t)0x00000200)
#define | SD_R5_ERROR ((uint32_t)0x00000800)
#define | SD_R6_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00002000)
#define | SD_R6_ILLEGAL_CMD ((uint32_t)0x00004000)
#define | SD_R6_CMD_CRC_FAILED ((uint32_t)0x00008000)
#define | SD_VOLTAGE_WINDOW_SD ((uint32_t)0x80100000)
#define | SD_HIGH_CAPACITY ((uint32_t)0x40000000)
#define | SD_STD_CAPACITY ((uint32_t)0x00000000)
#define | SD_CHECK_PATTERN ((uint32_t)0x000001AA)
#define | SD_VOLTAGE_WINDOW_MMC ((uint32_t)0x80FF8000)
#define | SD_MAX_VOLT_TRIAL ((uint32_t)0x0000FFFF)
#define | SD_ALLZERO ((uint32_t)0x00000000)
#define | SD_WIDE_BUS_SUPPORT ((uint32_t)0x00040000)
#define | SD_SINGLE_BUS_SUPPORT ((uint32_t)0x00010000)
#define | SD_CARD_LOCKED ((uint32_t)0x02000000)
#define | SD_CARD_PROGRAMMING ((uint32_t)0x00000007)
#define | SD_CARD_RECEIVING ((uint32_t)0x00000006)
#define | SD_DATATIMEOUT ((uint32_t)0xFFFFFFFF)
#define | SD_0TO7BITS ((uint32_t)0x000000FF)
#define | SD_8TO15BITS ((uint32_t)0x0000FF00)
#define | SD_16TO23BITS ((uint32_t)0x00FF0000)
#define | SD_24TO31BITS ((uint32_t)0xFF000000)
#define | SD_MAX_DATA_LENGTH ((uint32_t)0x01FFFFFF)
#define | SD_HALFFIFO ((uint32_t)0x00000008)
#define | SD_HALFFIFOBYTES ((uint32_t)0x00000020)
#define | SD_CCCC_LOCK_UNLOCK ((uint32_t)0x00000080)
#define | SD_CCCC_WRITE_PROT ((uint32_t)0x00000040)
#define | SD_CCCC_ERASE ((uint32_t)0x00000020)
#define | SDIO_SEND_IF_COND ((uint32_t)0x00000008)
#define | EXT_CSD_Command_set 0x0
#define | EXT_CSD_Set_bit 0x1
#define | EXT_CSD_Clear_byte 0x2
#define | EXT_CSD_Write_byte 0x3
#define | EXT_CSD_CMD_SET_NORMAL (1<<0)
#define | EXT_CSD_CMD_SET_SECURE (1<<1)
#define | EXT_CSD_CMD_SET_CPSECURE (1<<2)
#define | EXT_CSD_BUS_WIDTH 183
#define | EXT_CSD_HS_TIMING 185
#define | SDIO_INTR_STS_WRITE_MASK
#define | SDIO_INTR_STS_READ_MASK

Enumerations

enum sd_data_transfer_mode_type { SD_TRANSFER_POLLING_MODE = 0 , SD_TRANSFER_DMA_MODE = 1 , SD_TRANSFER_POLLING_MODE = 0 , SD_TRANSFER_DMA_MODE = 1 }
enum sd_error_status_type {
SD_CMD_FAIL = 1 , SD_DATA_FAIL = 2 , SD_CMD_RSP_TIMEOUT = 3 , SD_DATA_TIMEOUT = 4 ,
SD_TX_UNDERRUN = 5 , SD_RX_OVERRUN = 6 , SD_START_BIT_ERR = 7 , SD_CMD_OUT_OF_RANGE = 8 ,
SD_ADDR_MISALIGNED = 9 , SD_BLK_LEN_ERR = 10 , SD_ERASE_SEQ_ERR = 11 , SD_INVALID_ERASE_PARAM = 12 ,
SD_WR_PROTECT_VIOLATION = 13 , SD_LOCK_UNLOCK_FAILED = 14 , SD_CMD_CRC_FAILED = 15 , SD_ILLEGAL_CMD = 16 ,
SD_CARD_ECC_FAILED = 17 , SD_CARD_CONTROLLER_ERR = 18 , SD_GENERAL_UNKNOWN_ERROR = 19 , SD_STREAM_RD_UNDERRUN = 20 ,
SD_STREAM_WR_OVERRUN = 21 , SD_CID_CSD_OVERWRITE = 22 , SD_WP_ERASE_SKIP = 23 , SD_CARD_ECC_DISABLED = 24 ,
SD_ERASE_RESET = 25 , SD_AKE_SEQ_ERROR = 26 , SD_INVALID_VOLTRANGE = 27 , SD_ADDR_OUT_OF_RANGE = 28 ,
SD_SWITCH_ERROR = 29 , SD_SDIO_DISABLED = 30 , SD_SDIO_FUNC_BUSY = 31 , SD_SDIO_FUNC_FAILED = 32 ,
SD_SDIO_UNKNOWN_FUNC = 33 , SD_INTERNAL_ERROR , SD_NOT_CONFIGURED , SD_REQ_PENDING ,
SD_REQ_NOT_APPLICABLE , SD_INVALID_PARAMETER , SD_UNSUPPORTED_FEATURE , SD_UNSUPPORTED_HW ,
SD_ERROR , SD_OK = 0 , SD_CMD_FAIL = 1 , SD_DATA_FAIL = 2 ,
SD_CMD_RSP_TIMEOUT = 3 , SD_DATA_TIMEOUT = 4 , SD_TX_UNDERRUN = 5 , SD_RX_OVERRUN = 6 ,
SD_START_BIT_ERR = 7 , SD_CMD_OUT_OF_RANGE = 8 , SD_ADDR_MISALIGNED = 9 , SD_BLK_LEN_ERR = 10 ,
SD_ERASE_SEQ_ERR = 11 , SD_INVALID_ERASE_PARAM = 12 , SD_WR_PROTECT_VIOLATION = 13 , SD_LOCK_UNLOCK_FAILED = 14 ,
SD_CMD_CRC_FAILED = 15 , SD_ILLEGAL_CMD = 16 , SD_CARD_ECC_FAILED = 17 , SD_CARD_CONTROLLER_ERR = 18 ,
SD_GENERAL_UNKNOWN_ERROR = 19 , SD_STREAM_RD_UNDERRUN = 20 , SD_STREAM_WR_OVERRUN = 21 , SD_CID_CSD_OVERWRITE = 22 ,
SD_WP_ERASE_SKIP = 23 , SD_CARD_ECC_DISABLED = 24 , SD_ERASE_RESET = 25 , SD_AKE_SEQ_ERROR = 26 ,
SD_INVALID_VOLTRANGE = 27 , SD_ADDR_OUT_OF_RANGE = 28 , SD_SWITCH_ERROR = 29 , SD_SDIO_DISABLED = 30 ,
SD_SDIO_FUNC_BUSY = 31 , SD_SDIO_FUNC_FAILED = 32 , SD_SDIO_UNKNOWN_FUNC = 33 , SD_INTERNAL_ERROR ,
SD_NOT_CONFIGURED , SD_REQ_PENDING , SD_REQ_NOT_APPLICABLE , SD_INVALID_PARAMETER ,
SD_UNSUPPORTED_FEATURE , SD_UNSUPPORTED_HW , SD_ERROR , SD_OK = 0
}
enum sd_card_state_type {
SD_CARD_READY = ((uint32_t)0x00000001) , SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002) , SD_CARD_STANDBY = ((uint32_t)0x00000003) , SD_CARD_TRANSFER = ((uint32_t)0x00000004) ,
SD_CARD_SENDING = ((uint32_t)0x00000005) , SD_CARD_RECEIVING = ((uint32_t)0x00000006) , SD_CARD_PROGRAMMING = ((uint32_t)0x00000007) , SD_CARD_DISCONNECTED = ((uint32_t)0x00000008) ,
SD_CARD_ERROR = ((uint32_t)0x000000FF) , SD_CARD_READY = ((uint32_t)0x00000001) , SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002) , SD_CARD_STANDBY = ((uint32_t)0x00000003) ,
SD_CARD_TRANSFER = ((uint32_t)0x00000004) , SD_CARD_SENDING = ((uint32_t)0x00000005) , SD_CARD_RECEIVING = ((uint32_t)0x00000006) , SD_CARD_PROGRAMMING = ((uint32_t)0x00000007) ,
SD_CARD_DISCONNECTED = ((uint32_t)0x00000008) , SD_CARD_ERROR = ((uint32_t)0x000000FF)
}
enum sd_memory_card_type {
SDIO_STD_CAPACITY_SD_CARD_V1_1 = 0 , SDIO_STD_CAPACITY_SD_CARD_V2_0 = 1 , SDIO_HIGH_CAPACITY_SD_CARD = 2 , SDIO_MULTIMEDIA_CARD = 3 ,
SDIO_SECURE_DIGITAL_IO_CARD = 4 , SDIO_HIGH_SPEED_MULTIMEDIA_CARD = 5 , SDIO_SECURE_DIGITAL_IO_COMBO_CARD = 6 , SDIO_HIGH_CAPACITY_MMC_CARD = 7 ,
SDIO_SDIO_CARD = 8 , SDIO_STD_CAPACITY_SD_CARD_V1_1 = 0 , SDIO_STD_CAPACITY_SD_CARD_V2_0 = 1 , SDIO_HIGH_CAPACITY_SD_CARD = 2 ,
SDIO_MULTIMEDIA_CARD = 3 , SDIO_SECURE_DIGITAL_IO_CARD = 4 , SDIO_HIGH_SPEED_MULTIMEDIA_CARD = 5 , SDIO_SECURE_DIGITAL_IO_COMBO_CARD = 6 ,
SDIO_HIGH_CAPACITY_MMC_CARD = 7 , SDIO_SDIO_CARD = 8
}

Functions

sd_error_status_type | sd_init (void)
initializes the sd card and put it into standby state (ready for data transfer). More...
void | sdio_clock_set (uint32_t clkdiv)
set sdio clock devision factor. More...
sd_error_status_type | sd_power_on (void)
enquires cards about their operating voltage and configures clock controls. More...
sd_error_status_type | sd_power_off (void)
turns the sdio output signals off. More...
sd_error_status_type | sd_card_init (void)
intialises all cards or single card as the case may be card(s) come into standby state. More...
sd_error_status_type | sd_card_info_get (sd_card_info_struct_type *card_info)
returns information about specific card. More...
sd_error_status_type | sd_wide_bus_operation_config (sdio_bus_width_type mode)
enable wide bus opeartion for the requeseted card if supported by card. More...
sd_error_status_type | sd_device_mode_set (uint32_t mode)
set sdio work mode. More...
sd_error_status_type | sd_deselect_select (uint32_t addr)
selects od deselects the corresponding card. More...
sd_error_status_type | sd_status_send (uint32_t *p_card_status)
read current card status. More...
sd_card_state_type | sd_state_get (void)
returns information about sd card. More...
sd_error_status_type | sd_blocks_erase (long long addr, uint32_t nblks)
erase continuous data block More...
sd_error_status_type | sd_block_read (uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_read (uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_block_write (const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_write (const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed by dma mode only. More...
sd_error_status_type | mmc_stream_read (uint8_t *buf, long long addr, uint32_t len)
read mmc card data stream. More...
sd_error_status_type | mmc_stream_write (uint8_t *buf, long long addr, uint32_t len)
write mmc card data stream. More...
sd_error_status_type | sd_irq_service (void)
allows to process all the interrupts that are high. More...
void | sd_dma_config (uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
set dma configuation for sdio More...

Variables

sd_card_info_struct_type sd_card_info

Detailed Description

this file contains all the functions prototypes for the sd/mmc card at32_sdio driver firmware library.

Version
v2.0.2
Date
2021-12-31
        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.

Definition in file sd_mmc_card/inc/at32_sdio.h.


AT32F415 Firmwary Library: at32_sdio.h File Reference

  • sdio
  • sdio_fatfs
  • inc
Data Structures | Macros | Enumerations | Functions | Variables
sdio_fatfs/inc/at32_sdio.h File Reference

this file contains all the functions prototypes for the sd/mmc card at32_sdio driver firmware library. More...

#include "at32f415.h"

Go to the source code of this file.

Data Structures

struct | sd_csd_struct_type
struct | sd_cid_struct_type
struct | sd_scr_struct_type
struct | sd_card_info_struct_type

Macros

#define | SDIOx SDIO1
#define | SD_CMD_GO_IDLE_STATE ((uint8_t)0)
#define | SD_CMD_SEND_OP_COND ((uint8_t)1)
#define | SD_CMD_ALL_SEND_CID ((uint8_t)2)
#define | SD_CMD_SET_REL_ADDR ((uint8_t)3)
#define | SD_CMD_SET_DSR ((uint8_t)4)
#define | SD_CMD_SDIO_SEN_OP_COND ((uint8_t)5)
#define | SD_CMD_HS_SWITCH ((uint8_t)6)
#define | SD_CMD_SEL_DESEL_CARD ((uint8_t)7)
#define | SD_CMD_HS_SEND_EXT_CSD ((uint8_t)8)
#define | SD_CMD_SEND_CSD ((uint8_t)9)
#define | SD_CMD_SEND_CID ((uint8_t)10)
#define | SD_CMD_READ_DAT_UNTIL_STOP ((uint8_t)11)
#define | SD_CMD_STOP_TRANSMISSION ((uint8_t)12)
#define | SD_CMD_SEND_STATUS ((uint8_t)13)
#define | SD_CMD_HS_BUSTEST_READ ((uint8_t)14)
#define | SD_CMD_GO_INACTIVE_STATE ((uint8_t)15)
#define | SD_CMD_SET_BLOCKLEN ((uint8_t)16)
#define | SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17)
#define | SD_CMD_READ_MULT_BLOCK ((uint8_t)18)
#define | SD_CMD_HS_BUSTEST_WRITE ((uint8_t)19)
#define | SD_CMD_WRITE_DAT_UNTIL_STOP ((uint8_t)20)
#define | SD_CMD_SET_BLOCK_COUNT ((uint8_t)23)
#define | SD_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24)
#define | SD_CMD_WRITE_MULT_BLOCK ((uint8_t)25)
#define | SD_CMD_PROG_CID ((uint8_t)26)
#define | SD_CMD_PROG_CSD ((uint8_t)27)
#define | SD_CMD_SET_WRITE_PROT ((uint8_t)28)
#define | SD_CMD_CLR_WRITE_PROT ((uint8_t)29)
#define | SD_CMD_SEND_WRITE_PROT ((uint8_t)30)
#define | SD_CMD_SD_ERASE_GRP_START ((uint8_t)32)
#define | SD_CMD_SD_ERASE_GRP_END ((uint8_t)33)
#define | SD_CMD_ERASE_GRP_START ((uint8_t)35)
#define | SD_CMD_ERASE_GRP_END ((uint8_t)36)
#define | SD_CMD_ERASE ((uint8_t)38)
#define | SD_CMD_FAST_IO ((uint8_t)39)
#define | SD_CMD_GO_IRQ_STATE ((uint8_t)40)
#define | SD_CMD_LOCK_UNLOCK ((uint8_t)42)
#define | SD_CMD_APP_CMD ((uint8_t)55)
#define | SD_CMD_GEN_CMD ((uint8_t)56)
#define | SD_CMD_NO_CMD ((uint8_t)64)
#define | SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6)
#define | SD_CMD_SD_APP_STAUS ((uint8_t)13)
#define | SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22)
#define | SD_CMD_SD_APP_OP_COND ((uint8_t)41)
#define | SD_CMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42)
#define | SD_CMD_SD_APP_SEND_SCR ((uint8_t)51)
#define | SD_CMD_SDIO_RW_DIRECT ((uint8_t)52)
#define | SD_CMD_SDIO_RW_EXTENDED ((uint8_t)53)
#define | SD_CMD_SD_APP_GET_MKB ((uint8_t)43)
#define | SD_CMD_SD_APP_GET_MID ((uint8_t)44)
#define | SD_CMD_SD_APP_SET_CER_RN1 ((uint8_t)45)
#define | SD_CMD_SD_APP_GET_CER_RN2 ((uint8_t)46)
#define | SD_CMD_SD_APP_SET_CER_RES2 ((uint8_t)47)
#define | SD_CMD_SD_APP_GET_CER_RES1 ((uint8_t)48)
#define | SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK ((uint8_t)18)
#define | SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK ((uint8_t)25)
#define | SD_CMD_SD_APP_SECURE_ERASE ((uint8_t)38)
#define | SD_CMD_SD_APP_CHANGE_SECURE_AREA ((uint8_t)49)
#define | SD_CMD_SD_APP_SECURE_WRITE_MKB ((uint8_t)48)
#define | NULL 0
#define | SDIO_STATIC_FLAGS ((uint32_t)0x000005FF)
#define | SDIO_CMD0TIMEOUT ((uint32_t)0x00010000)
#define | SDIO_DATATIMEOUT ((uint32_t)0xFFFFFFFF)
#define | SDIO_FIFO_Address ((uint32_t)0x40018080)
#define | SD_OCR_ADDR_OUT_OF_RANGE ((uint32_t)0x80000000)
#define | SD_OCR_ADDR_MISALIGNED ((uint32_t)0x40000000)
#define | SD_OCR_BLK_LEN_ERR ((uint32_t)0x20000000)
#define | SD_OCR_ERASE_SEQ_ERR ((uint32_t)0x10000000)
#define | SD_OCR_INVALID_ERASE_PARAM ((uint32_t)0x08000000)
#define | SD_OCR_WR_PROTECT_VIOLATION ((uint32_t)0x04000000)
#define | SD_OCR_LOCK_UNLOCK_FAILED ((uint32_t)0x01000000)
#define | SD_OCR_CMD_CRC_FAILED ((uint32_t)0x00800000)
#define | SD_OCR_ILLEGAL_CMD ((uint32_t)0x00400000)
#define | SD_OCR_CARD_ECC_FAILED ((uint32_t)0x00200000)
#define | SD_OCR_CARD_CONTROLLER_ERR ((uint32_t)0x00100000)
#define | SD_OCR_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00080000)
#define | SD_OCR_STREAM_RD_UNDERRUN ((uint32_t)0x00040000)
#define | SD_OCR_STREAM_WR_OVERRUN ((uint32_t)0x00020000)
#define | SD_OCR_CID_CSD_OVERWRIETE ((uint32_t)0x00010000)
#define | SD_OCR_WP_ERASE_SKIP ((uint32_t)0x00008000)
#define | SD_OCR_CARD_ECC_DISABLED ((uint32_t)0x00004000)
#define | SD_OCR_ERASE_RESET ((uint32_t)0x00002000)
#define | MMC_SWITCH_ERROR ((uint32_t)0x00000080)
#define | SD_OCR_AKE_SEQ_ERROR ((uint32_t)0x00000008)
#define | SD_OCR_ERRORBITS ((uint32_t)0xFDFFE008)
#define | SD_R5_OUT_OF_RANGE ((uint32_t)0x00000100)
#define | SD_R5_FUNCTION_NUMBER ((uint32_t)0x00000200)
#define | SD_R5_ERROR ((uint32_t)0x00000800)
#define | SD_R6_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00002000)
#define | SD_R6_ILLEGAL_CMD ((uint32_t)0x00004000)
#define | SD_R6_CMD_CRC_FAILED ((uint32_t)0x00008000)
#define | SD_VOLTAGE_WINDOW_SD ((uint32_t)0x80100000)
#define | SD_HIGH_CAPACITY ((uint32_t)0x40000000)
#define | SD_STD_CAPACITY ((uint32_t)0x00000000)
#define | SD_CHECK_PATTERN ((uint32_t)0x000001AA)
#define | SD_VOLTAGE_WINDOW_MMC ((uint32_t)0x80FF8000)
#define | SD_MAX_VOLT_TRIAL ((uint32_t)0x0000FFFF)
#define | SD_ALLZERO ((uint32_t)0x00000000)
#define | SD_WIDE_BUS_SUPPORT ((uint32_t)0x00040000)
#define | SD_SINGLE_BUS_SUPPORT ((uint32_t)0x00010000)
#define | SD_CARD_LOCKED ((uint32_t)0x02000000)
#define | SD_CARD_PROGRAMMING ((uint32_t)0x00000007)
#define | SD_CARD_RECEIVING ((uint32_t)0x00000006)
#define | SD_DATATIMEOUT ((uint32_t)0xFFFFFFFF)
#define | SD_0TO7BITS ((uint32_t)0x000000FF)
#define | SD_8TO15BITS ((uint32_t)0x0000FF00)
#define | SD_16TO23BITS ((uint32_t)0x00FF0000)
#define | SD_24TO31BITS ((uint32_t)0xFF000000)
#define | SD_MAX_DATA_LENGTH ((uint32_t)0x01FFFFFF)
#define | SD_HALFFIFO ((uint32_t)0x00000008)
#define | SD_HALFFIFOBYTES ((uint32_t)0x00000020)
#define | SD_CCCC_LOCK_UNLOCK ((uint32_t)0x00000080)
#define | SD_CCCC_WRITE_PROT ((uint32_t)0x00000040)
#define | SD_CCCC_ERASE ((uint32_t)0x00000020)
#define | SDIO_SEND_IF_COND ((uint32_t)0x00000008)
#define | EXT_CSD_Command_set 0x0
#define | EXT_CSD_Set_bit 0x1
#define | EXT_CSD_Clear_byte 0x2
#define | EXT_CSD_Write_byte 0x3
#define | EXT_CSD_CMD_SET_NORMAL (1<<0)
#define | EXT_CSD_CMD_SET_SECURE (1<<1)
#define | EXT_CSD_CMD_SET_CPSECURE (1<<2)
#define | EXT_CSD_BUS_WIDTH 183
#define | EXT_CSD_HS_TIMING 185
#define | SDIO_INTR_STS_WRITE_MASK
#define | SDIO_INTR_STS_READ_MASK

Enumerations

enum sd_data_transfer_mode_type { SD_TRANSFER_POLLING_MODE = 0 , SD_TRANSFER_DMA_MODE = 1 , SD_TRANSFER_POLLING_MODE = 0 , SD_TRANSFER_DMA_MODE = 1 }
enum sd_error_status_type {
SD_CMD_FAIL = 1 , SD_DATA_FAIL = 2 , SD_CMD_RSP_TIMEOUT = 3 , SD_DATA_TIMEOUT = 4 ,
SD_TX_UNDERRUN = 5 , SD_RX_OVERRUN = 6 , SD_START_BIT_ERR = 7 , SD_CMD_OUT_OF_RANGE = 8 ,
SD_ADDR_MISALIGNED = 9 , SD_BLK_LEN_ERR = 10 , SD_ERASE_SEQ_ERR = 11 , SD_INVALID_ERASE_PARAM = 12 ,
SD_WR_PROTECT_VIOLATION = 13 , SD_LOCK_UNLOCK_FAILED = 14 , SD_CMD_CRC_FAILED = 15 , SD_ILLEGAL_CMD = 16 ,
SD_CARD_ECC_FAILED = 17 , SD_CARD_CONTROLLER_ERR = 18 , SD_GENERAL_UNKNOWN_ERROR = 19 , SD_STREAM_RD_UNDERRUN = 20 ,
SD_STREAM_WR_OVERRUN = 21 , SD_CID_CSD_OVERWRITE = 22 , SD_WP_ERASE_SKIP = 23 , SD_CARD_ECC_DISABLED = 24 ,
SD_ERASE_RESET = 25 , SD_AKE_SEQ_ERROR = 26 , SD_INVALID_VOLTRANGE = 27 , SD_ADDR_OUT_OF_RANGE = 28 ,
SD_SWITCH_ERROR = 29 , SD_SDIO_DISABLED = 30 , SD_SDIO_FUNC_BUSY = 31 , SD_SDIO_FUNC_FAILED = 32 ,
SD_SDIO_UNKNOWN_FUNC = 33 , SD_INTERNAL_ERROR , SD_NOT_CONFIGURED , SD_REQ_PENDING ,
SD_REQ_NOT_APPLICABLE , SD_INVALID_PARAMETER , SD_UNSUPPORTED_FEATURE , SD_UNSUPPORTED_HW ,
SD_ERROR , SD_OK = 0 , SD_CMD_FAIL = 1 , SD_DATA_FAIL = 2 ,
SD_CMD_RSP_TIMEOUT = 3 , SD_DATA_TIMEOUT = 4 , SD_TX_UNDERRUN = 5 , SD_RX_OVERRUN = 6 ,
SD_START_BIT_ERR = 7 , SD_CMD_OUT_OF_RANGE = 8 , SD_ADDR_MISALIGNED = 9 , SD_BLK_LEN_ERR = 10 ,
SD_ERASE_SEQ_ERR = 11 , SD_INVALID_ERASE_PARAM = 12 , SD_WR_PROTECT_VIOLATION = 13 , SD_LOCK_UNLOCK_FAILED = 14 ,
SD_CMD_CRC_FAILED = 15 , SD_ILLEGAL_CMD = 16 , SD_CARD_ECC_FAILED = 17 , SD_CARD_CONTROLLER_ERR = 18 ,
SD_GENERAL_UNKNOWN_ERROR = 19 , SD_STREAM_RD_UNDERRUN = 20 , SD_STREAM_WR_OVERRUN = 21 , SD_CID_CSD_OVERWRITE = 22 ,
SD_WP_ERASE_SKIP = 23 , SD_CARD_ECC_DISABLED = 24 , SD_ERASE_RESET = 25 , SD_AKE_SEQ_ERROR = 26 ,
SD_INVALID_VOLTRANGE = 27 , SD_ADDR_OUT_OF_RANGE = 28 , SD_SWITCH_ERROR = 29 , SD_SDIO_DISABLED = 30 ,
SD_SDIO_FUNC_BUSY = 31 , SD_SDIO_FUNC_FAILED = 32 , SD_SDIO_UNKNOWN_FUNC = 33 , SD_INTERNAL_ERROR ,
SD_NOT_CONFIGURED , SD_REQ_PENDING , SD_REQ_NOT_APPLICABLE , SD_INVALID_PARAMETER ,
SD_UNSUPPORTED_FEATURE , SD_UNSUPPORTED_HW , SD_ERROR , SD_OK = 0
}
enum sd_card_state_type {
SD_CARD_READY = ((uint32_t)0x00000001) , SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002) , SD_CARD_STANDBY = ((uint32_t)0x00000003) , SD_CARD_TRANSFER = ((uint32_t)0x00000004) ,
SD_CARD_SENDING = ((uint32_t)0x00000005) , SD_CARD_RECEIVING = ((uint32_t)0x00000006) , SD_CARD_PROGRAMMING = ((uint32_t)0x00000007) , SD_CARD_DISCONNECTED = ((uint32_t)0x00000008) ,
SD_CARD_ERROR = ((uint32_t)0x000000FF) , SD_CARD_READY = ((uint32_t)0x00000001) , SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002) , SD_CARD_STANDBY = ((uint32_t)0x00000003) ,
SD_CARD_TRANSFER = ((uint32_t)0x00000004) , SD_CARD_SENDING = ((uint32_t)0x00000005) , SD_CARD_RECEIVING = ((uint32_t)0x00000006) , SD_CARD_PROGRAMMING = ((uint32_t)0x00000007) ,
SD_CARD_DISCONNECTED = ((uint32_t)0x00000008) , SD_CARD_ERROR = ((uint32_t)0x000000FF)
}
enum sd_memory_card_type {
SDIO_STD_CAPACITY_SD_CARD_V1_1 = 0 , SDIO_STD_CAPACITY_SD_CARD_V2_0 = 1 , SDIO_HIGH_CAPACITY_SD_CARD = 2 , SDIO_MULTIMEDIA_CARD = 3 ,
SDIO_SECURE_DIGITAL_IO_CARD = 4 , SDIO_HIGH_SPEED_MULTIMEDIA_CARD = 5 , SDIO_SECURE_DIGITAL_IO_COMBO_CARD = 6 , SDIO_HIGH_CAPACITY_MMC_CARD = 7 ,
SDIO_SDIO_CARD = 8 , SDIO_STD_CAPACITY_SD_CARD_V1_1 = 0 , SDIO_STD_CAPACITY_SD_CARD_V2_0 = 1 , SDIO_HIGH_CAPACITY_SD_CARD = 2 ,
SDIO_MULTIMEDIA_CARD = 3 , SDIO_SECURE_DIGITAL_IO_CARD = 4 , SDIO_HIGH_SPEED_MULTIMEDIA_CARD = 5 , SDIO_SECURE_DIGITAL_IO_COMBO_CARD = 6 ,
SDIO_HIGH_CAPACITY_MMC_CARD = 7 , SDIO_SDIO_CARD = 8
}

Functions

sd_error_status_type | sd_init (void)
initializes the sd card and put it into standby state (ready for data transfer). More...
void | sdio_clock_set (uint32_t clkdiv)
set sdio clock devision factor. More...
sd_error_status_type | sd_power_on (void)
enquires cards about their operating voltage and configures clock controls. More...
sd_error_status_type | sd_power_off (void)
turns the sdio output signals off. More...
sd_error_status_type | sd_card_init (void)
intialises all cards or single card as the case may be card(s) come into standby state. More...
sd_error_status_type | sd_card_info_get (sd_card_info_struct_type *card_info)
returns information about specific card. More...
sd_error_status_type | sd_wide_bus_operation_config (sdio_bus_width_type mode)
enable wide bus opeartion for the requeseted card if supported by card. More...
sd_error_status_type | sd_device_mode_set (uint32_t mode)
set sdio work mode. More...
sd_error_status_type | sd_deselect_select (uint32_t addr)
selects od deselects the corresponding card. More...
sd_error_status_type | sd_status_send (uint32_t *p_card_status)
read current card status. More...
sd_card_state_type | sd_state_get (void)
returns information about sd card. More...
sd_error_status_type | sd_blocks_erase (long long addr, uint32_t nblks)
erase continuous data block More...
sd_error_status_type | sd_block_read (uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_read (uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_block_write (const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_write (const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed by dma mode only. More...
sd_error_status_type | mmc_stream_read (uint8_t *buf, long long addr, uint32_t len)
read mmc card data stream. More...
sd_error_status_type | mmc_stream_write (uint8_t *buf, long long addr, uint32_t len)
write mmc card data stream. More...
sd_error_status_type | sd_irq_service (void)
allows to process all the interrupts that are high. More...
void | sd_dma_config (uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
set dma configuation for sdio More...

Variables

sd_card_info_struct_type sd_card_info

Detailed Description

this file contains all the functions prototypes for the sd/mmc card at32_sdio driver firmware library.

Version
v2.0.2
Date
2021-12-31
        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.

Definition in file sdio_fatfs/inc/at32_sdio.h.


AT32F415 Firmwary Library: ffconf.h File Reference

  • sdio
  • sdio_fatfs
  • inc
Macros
sdio/sdio_fatfs/inc/ffconf.h File Reference

Go to the source code of this file.

Macros

#define | FFCONF_DEF 86631 /* Revision ID */
#define | FF_FS_READONLY 0
#define | FF_FS_MINIMIZE 0
#define | FF_USE_FIND 0
#define | FF_USE_MKFS 1
#define | FF_USE_FASTSEEK 1
#define | FF_USE_EXPAND 0
#define | FF_USE_CHMOD 0
#define | FF_USE_LABEL 0
#define | FF_USE_FORWARD 0
#define | FF_USE_STRFUNC 0
#define | FF_PRINT_LLI 0
#define | FF_PRINT_FLOAT 0
#define | FF_STRF_ENCODE 0
#define | FF_CODE_PAGE 932
#define | FF_USE_LFN 0
#define | FF_MAX_LFN 255
#define | FF_LFN_UNICODE 0
#define | FF_LFN_BUF 255
#define | FF_SFN_BUF 12
#define | FF_FS_RPATH 0
#define | FF_VOLUMES 3
#define | FF_STR_VOLUME_ID 0
#define | FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"
#define | FF_MULTI_PARTITION 0
#define | FF_MIN_SS 512
#define | FF_MAX_SS 512
#define | FF_LBA64 0
#define | FF_MIN_GPT 0x10000000
#define | FF_USE_TRIM 0
#define | FF_FS_TINY 0
#define | FF_FS_EXFAT 0
#define | FF_FS_NORTC 1
#define | FF_NORTC_MON 1
#define | FF_NORTC_MDAY 1
#define | FF_NORTC_YEAR 2020
#define | FF_FS_NOFSINFO 0
#define | FF_FS_LOCK 0
#define | FF_FS_REENTRANT 0
#define | FF_FS_TIMEOUT 1000
#define | FF_SYNC_t HANDLE

Macro Definition Documentation

◆ FF_CODE_PAGE

#define FF_CODE_PAGE 932

Definition at line 87 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_FS_EXFAT

#define FF_FS_EXFAT 0

Definition at line 234 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_FS_LOCK

#define FF_FS_LOCK 0

Definition at line 266 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_FS_MINIMIZE

#define FF_FS_MINIMIZE 0

Definition at line 18 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_FS_NOFSINFO

#define FF_FS_NOFSINFO 0

Definition at line 254 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_FS_NORTC

#define FF_FS_NORTC 1

Definition at line 240 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_FS_READONLY

#define FF_FS_READONLY 0

Definition at line 11 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_FS_REENTRANT

#define FF_FS_REENTRANT 0

Definition at line 279 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_FS_RPATH

#define FF_FS_RPATH 0

Definition at line 156 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_FS_TIMEOUT

#define FF_FS_TIMEOUT 1000

Definition at line 280 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_FS_TINY

#define FF_FS_TINY 0

Definition at line 227 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_LBA64

#define FF_LBA64 0

Definition at line 206 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_LFN_BUF

#define FF_LFN_BUF 255

Definition at line 148 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_LFN_UNICODE

#define FF_LFN_UNICODE 0

Definition at line 136 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_MAX_LFN

#define FF_MAX_LFN 255

Definition at line 117 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_MAX_SS

#define FF_MAX_SS 512

Definition at line 197 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_MIN_GPT

#define FF_MIN_GPT 0x10000000

Definition at line 211 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_MIN_SS

#define FF_MIN_SS 512

Definition at line 196 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_MULTI_PARTITION

#define FF_MULTI_PARTITION 0

Definition at line 187 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_NORTC_MDAY

#define FF_NORTC_MDAY 1

Definition at line 242 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_NORTC_MON

#define FF_NORTC_MON 1

Definition at line 241 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_NORTC_YEAR

#define FF_NORTC_YEAR 2020

Definition at line 243 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_PRINT_FLOAT

#define FF_PRINT_FLOAT 0

Definition at line 61 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_PRINT_LLI

#define FF_PRINT_LLI 0

Definition at line 60 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_SFN_BUF

#define FF_SFN_BUF 12

Definition at line 149 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_STR_VOLUME_ID

#define FF_STR_VOLUME_ID 0

Definition at line 173 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_STRF_ENCODE

#define FF_STRF_ENCODE 0

Definition at line 62 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_SYNC_t

#define FF_SYNC_t HANDLE

Definition at line 281 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_USE_CHMOD

#define FF_USE_CHMOD 0

Definition at line 45 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_USE_EXPAND

#define FF_USE_EXPAND 0

Definition at line 41 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_USE_FASTSEEK

#define FF_USE_FASTSEEK 1

Definition at line 37 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_USE_FIND

#define FF_USE_FIND 0

Definition at line 28 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_USE_FORWARD

#define FF_USE_FORWARD 0

Definition at line 55 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_USE_LABEL

#define FF_USE_LABEL 0

Definition at line 50 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_USE_LFN

#define FF_USE_LFN 0

Definition at line 116 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_USE_MKFS

#define FF_USE_MKFS 1

Definition at line 33 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_USE_STRFUNC

#define FF_USE_STRFUNC 0

Definition at line 59 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_USE_TRIM

#define FF_USE_TRIM 0

Definition at line 216 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_VOLUME_STRS

#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"

Definition at line 174 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FF_VOLUMES

#define FF_VOLUMES 3

Definition at line 169 of file sdio/sdio_fatfs/inc/ffconf.h.

◆ FFCONF_DEF

#define FFCONF_DEF 86631 /* Revision ID */

Definition at line 5 of file sdio/sdio_fatfs/inc/ffconf.h.


AT32F415 Firmwary Library: ffconf.h File Reference

  • usb_host
  • msc_only_fat32
  • inc
Macros
usb_host/msc_only_fat32/inc/ffconf.h File Reference

Go to the source code of this file.

Macros

#define | FFCONF_DEF 86631 /* Revision ID */
#define | FF_FS_READONLY 0
#define | FF_FS_MINIMIZE 0
#define | FF_USE_FIND 0
#define | FF_USE_MKFS 0
#define | FF_USE_FASTSEEK 0
#define | FF_USE_EXPAND 0
#define | FF_USE_CHMOD 0
#define | FF_USE_LABEL 0
#define | FF_USE_FORWARD 0
#define | FF_USE_STRFUNC 0
#define | FF_PRINT_LLI 0
#define | FF_PRINT_FLOAT 0
#define | FF_STRF_ENCODE 0
#define | FF_CODE_PAGE 932
#define | FF_USE_LFN 0
#define | FF_MAX_LFN 255
#define | FF_LFN_UNICODE 0
#define | FF_LFN_BUF 255
#define | FF_SFN_BUF 12
#define | FF_FS_RPATH 0
#define | FF_VOLUMES 1
#define | FF_STR_VOLUME_ID 0
#define | FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"
#define | FF_MULTI_PARTITION 0
#define | FF_MIN_SS 512
#define | FF_MAX_SS 512
#define | FF_LBA64 0
#define | FF_MIN_GPT 0x10000000
#define | FF_USE_TRIM 0
#define | FF_FS_TINY 0
#define | FF_FS_EXFAT 0
#define | FF_FS_NORTC 0
#define | FF_NORTC_MON 1
#define | FF_NORTC_MDAY 1
#define | FF_NORTC_YEAR 2020
#define | FF_FS_NOFSINFO 0
#define | FF_FS_LOCK 0
#define | FF_FS_REENTRANT 0
#define | FF_FS_TIMEOUT 1000
#define | FF_SYNC_t HANDLE

Macro Definition Documentation

◆ FF_CODE_PAGE

#define FF_CODE_PAGE 932

Definition at line 87 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_FS_EXFAT

#define FF_FS_EXFAT 0

Definition at line 234 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_FS_LOCK

#define FF_FS_LOCK 0

Definition at line 266 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_FS_MINIMIZE

#define FF_FS_MINIMIZE 0

Definition at line 18 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_FS_NOFSINFO

#define FF_FS_NOFSINFO 0

Definition at line 254 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_FS_NORTC

#define FF_FS_NORTC 0

Definition at line 240 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_FS_READONLY

#define FF_FS_READONLY 0

Definition at line 11 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_FS_REENTRANT

#define FF_FS_REENTRANT 0

Definition at line 279 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_FS_RPATH

#define FF_FS_RPATH 0

Definition at line 156 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_FS_TIMEOUT

#define FF_FS_TIMEOUT 1000

Definition at line 280 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_FS_TINY

#define FF_FS_TINY 0

Definition at line 227 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_LBA64

#define FF_LBA64 0

Definition at line 206 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_LFN_BUF

#define FF_LFN_BUF 255

Definition at line 148 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_LFN_UNICODE

#define FF_LFN_UNICODE 0

Definition at line 136 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_MAX_LFN

#define FF_MAX_LFN 255

Definition at line 117 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_MAX_SS

#define FF_MAX_SS 512

Definition at line 197 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_MIN_GPT

#define FF_MIN_GPT 0x10000000

Definition at line 211 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_MIN_SS

#define FF_MIN_SS 512

Definition at line 196 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_MULTI_PARTITION

#define FF_MULTI_PARTITION 0

Definition at line 187 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_NORTC_MDAY

#define FF_NORTC_MDAY 1

Definition at line 242 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_NORTC_MON

#define FF_NORTC_MON 1

Definition at line 241 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_NORTC_YEAR

#define FF_NORTC_YEAR 2020

Definition at line 243 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_PRINT_FLOAT

#define FF_PRINT_FLOAT 0

Definition at line 61 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_PRINT_LLI

#define FF_PRINT_LLI 0

Definition at line 60 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_SFN_BUF

#define FF_SFN_BUF 12

Definition at line 149 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_STR_VOLUME_ID

#define FF_STR_VOLUME_ID 0

Definition at line 173 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_STRF_ENCODE

#define FF_STRF_ENCODE 0

Definition at line 62 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_SYNC_t

#define FF_SYNC_t HANDLE

Definition at line 281 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_USE_CHMOD

#define FF_USE_CHMOD 0

Definition at line 45 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_USE_EXPAND

#define FF_USE_EXPAND 0

Definition at line 41 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_USE_FASTSEEK

#define FF_USE_FASTSEEK 0

Definition at line 37 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_USE_FIND

#define FF_USE_FIND 0

Definition at line 28 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_USE_FORWARD

#define FF_USE_FORWARD 0

Definition at line 55 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_USE_LABEL

#define FF_USE_LABEL 0

Definition at line 50 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_USE_LFN

#define FF_USE_LFN 0

Definition at line 116 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_USE_MKFS

#define FF_USE_MKFS 0

Definition at line 33 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_USE_STRFUNC

#define FF_USE_STRFUNC 0

Definition at line 59 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_USE_TRIM

#define FF_USE_TRIM 0

Definition at line 216 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_VOLUME_STRS

#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"

Definition at line 174 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FF_VOLUMES

#define FF_VOLUMES 1

Definition at line 169 of file usb_host/msc_only_fat32/inc/ffconf.h.

◆ FFCONF_DEF

#define FFCONF_DEF 86631 /* Revision ID */

Definition at line 5 of file usb_host/msc_only_fat32/inc/ffconf.h.


AT32F415 Firmwary Library: at32_sdio.c File Reference

  • sdio
  • sd_mmc_card
  • src
Functions | Variables
sd_mmc_card/src/at32_sdio.c File Reference

this file provides a set of functions needed to manage the sdio/mmc card memory. More...

#include "at32_sdio.h"

Go to the source code of this file.

Functions

sd_error_status_type | command_error (void)
checks for error conditions for cmd0. More...
sd_error_status_type | command_rsp1_error (uint8_t cmd)
checks for error conditions for R1 response. More...
sd_error_status_type | command_rsp2_error (void)
checks for error conditions for R2 (cid or csd) response. More...
sd_error_status_type | command_rsp3_error (void)
checks for error conditions for R3 (ocr) response. More...
sd_error_status_type | command_rsp4_error (uint8_t cmd)
checks for error conditions for r4 response. More...
sd_error_status_type | command_rsp5_error (uint8_t cmd)
checks for error conditions for r5 response. More...
sd_error_status_type | command_rsp6_error (uint8_t cmd, uint16_t *prca)
checks for error conditions for r6 (rca) response. More...
sd_error_status_type | command_rsp7_error (void)
checks for error conditions for R7 response. More...
sd_error_status_type | sd_bus_wide_enable (confirm_state new_state)
enable or disable the sdio wide bus mode. More...
sd_error_status_type | mmc_switch (uint8_t set, uint8_t index, uint8_t value)
switch mmc card speed to high speed More...
sd_error_status_type | sd_switch (uint32_t mode, uint32_t group, uint8_t value, uint8_t *rsp)
switch sd card speed to high speed More...
sd_error_status_type | check_card_programming (uint8_t *p_status)
checks if the sd card is in programming state. More...
sd_error_status_type | speed_change (uint8_t speed)
set bus speed More...
sd_error_status_type | scr_find (void)
find the sd card scr register value. More...
uint8_t | convert_from_bytes_to_power_of_two (uint16_t number_of_bytes)
converts the number of bytes in power of two and returns the power. More...
sd_error_status_type | sd_init (void)
initializes the sd card and put it into standby state (ready for data transfer). More...
void | sdio_clock_set (uint32_t clk_div)
set sdio clock devision factor. More...
sd_error_status_type | sd_power_on (void)
enquires cards about their operating voltage and configures clock controls. More...
sd_error_status_type | sd_power_off (void)
turns the sdio output signals off. More...
sd_error_status_type | sd_card_init (void)
intialises all cards or single card as the case may be card(s) come into standby state. More...
sd_error_status_type | sd_card_info_get (sd_card_info_struct_type *card_info)
returns information about specific card. More...
sd_error_status_type | sd_wide_bus_operation_config (sdio_bus_width_type mode)
enable wide bus opeartion for the requeseted card if supported by card. More...
sd_error_status_type | sd_device_mode_set (uint32_t mode)
set sdio work mode. More...
sd_error_status_type | sd_deselect_select (uint32_t addr)
selects od deselects the corresponding card. More...
sd_error_status_type | sdio_command_data_send (sdio_command_struct_type *sdio_cmd_init_t, sdio_data_struct_type *sdio_data_init_t, uint32_t *buf)
read data from or write data to sd card. More...
sd_error_status_type | sd_blocks_erase (long long addr, uint32_t nblks)
erase continuous data block More...
sd_error_status_type | sd_block_read (uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
__align (4)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_block_write (const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_write (const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed by dma mode only. More...
sd_error_status_type | mmc_stream_read (uint8_t *buf, long long addr, uint32_t len)
read mmc card data stream. More...
sd_error_status_type | mmc_stream_write (uint8_t *buf, long long addr, uint32_t len)
write mmc card data stream. More...
void | SDIO1_IRQHandler (void)
sdio1 isr. More...
void | SDIO2_IRQHandler (void)
sdio2 isr. More...
sd_error_status_type | sd_irq_service (void)
allows to process all the interrupts that are high. More...
sd_error_status_type | sd_status_send (uint32_t *p_card_status)
read current card status. More...
sd_card_state_type | sd_state_get (void)
returns information about sd card. More...
void | sd_dma_config (uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
set dma configuation for sdio More...

Variables

sdio_command_struct_type sdio_command_init_struct
sdio_data_struct_type sdio_data_init_struct
static sd_memory_card_type | card_type = SDIO_STD_CAPACITY_SD_CARD_V1_1
static uint32_t | csd_table [4]
static uint32_t | cid_table [4]
static uint32_t | rca = 0
static sd_data_transfer_mode_type | device_mode = SD_TRANSFER_POLLING_MODE
static uint8_t | stop_flag = 0
volatile sd_error_status_type | transfer_error = SD_OK
volatile uint8_t | transfer_end = 0
sd_card_info_struct_type sd_card_info

Detailed Description

this file provides a set of functions needed to manage the sdio/mmc card memory.

Version
v2.0.2
Date
2021-12-31
        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.

Definition in file sd_mmc_card/src/at32_sdio.c.


AT32F415 Firmwary Library: at32_sdio.c File Reference

  • sdio
  • sdio_fatfs
  • src
Functions | Variables
sdio_fatfs/src/at32_sdio.c File Reference

this file provides a set of functions needed to manage the sdio/mmc card memory. More...

#include <string.h>
#include "at32_sdio.h"

Go to the source code of this file.

Functions

sd_error_status_type | command_error (void)
checks for error conditions for cmd0. More...
sd_error_status_type | command_rsp1_error (uint8_t cmd)
checks for error conditions for R1 response. More...
sd_error_status_type | command_rsp2_error (void)
checks for error conditions for R2 (cid or csd) response. More...
sd_error_status_type | command_rsp3_error (void)
checks for error conditions for R3 (ocr) response. More...
sd_error_status_type | command_rsp4_error (uint8_t cmd)
checks for error conditions for r4 response. More...
sd_error_status_type | command_rsp5_error (uint8_t cmd)
checks for error conditions for r5 response. More...
sd_error_status_type | command_rsp6_error (uint8_t cmd, uint16_t *prca)
checks for error conditions for r6 (rca) response. More...
sd_error_status_type | command_rsp7_error (void)
checks for error conditions for R7 response. More...
sd_error_status_type | sd_bus_wide_enable (confirm_state new_state)
enable or disable the sdio wide bus mode. More...
sd_error_status_type | mmc_switch (uint8_t set, uint8_t index, uint8_t value)
switch mmc card speed to high speed More...
sd_error_status_type | sd_switch (uint32_t mode, uint32_t group, uint8_t value, uint8_t *rsp)
switch sd card speed to high speed More...
sd_error_status_type | check_card_programming (uint8_t *p_status)
checks if the sd card is in programming state. More...
sd_error_status_type | speed_change (uint8_t speed)
set bus speed More...
sd_error_status_type | scr_find (void)
find the sd card scr register value. More...
uint8_t | convert_from_bytes_to_power_of_two (uint16_t number_of_bytes)
converts the number of bytes in power of two and returns the power. More...
sd_error_status_type | sd_init (void)
initializes the sd card and put it into standby state (ready for data transfer). More...
void | sdio_clock_set (uint32_t clk_div)
set sdio clock devision factor. More...
sd_error_status_type | sd_power_on (void)
enquires cards about their operating voltage and configures clock controls. More...
sd_error_status_type | sd_power_off (void)
turns the sdio output signals off. More...
sd_error_status_type | sd_card_init (void)
intialises all cards or single card as the case may be card(s) come into standby state. More...
sd_error_status_type | sd_card_info_get (sd_card_info_struct_type *card_info)
returns information about specific card. More...
sd_error_status_type | sd_wide_bus_operation_config (sdio_bus_width_type mode)
enable wide bus opeartion for the requeseted card if supported by card. More...
sd_error_status_type | sd_device_mode_set (uint32_t mode)
set sdio work mode. More...
sd_error_status_type | sd_deselect_select (uint32_t addr)
selects od deselects the corresponding card. More...
sd_error_status_type | sdio_command_data_send (sdio_command_struct_type *sdio_cmd_init_t, sdio_data_struct_type *sdio_data_init_t, uint32_t *buf)
read data from or write data to sd card. More...
sd_error_status_type | sd_blocks_erase (long long addr, uint32_t nblks)
erase continuous data block More...
sd_error_status_type | sd_block_read (uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_read (uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_block_write (const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be managed by dma mode or polling mode. More...
sd_error_status_type | sd_mult_blocks_write (const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed by dma mode only. More...
sd_error_status_type | mmc_stream_read (uint8_t *buf, long long addr, uint32_t len)
read mmc card data stream. More...
sd_error_status_type | mmc_stream_write (uint8_t *buf, long long addr, uint32_t len)
write mmc card data stream. More...
void | SDIO1_IRQHandler (void)
sdio1 isr. More...
void | SDIO2_IRQHandler (void)
sdio2 isr. More...
sd_error_status_type | sd_irq_service (void)
allows to process all the interrupts that are high. More...
sd_error_status_type | sd_status_send (uint32_t *p_card_status)
read current card status. More...
sd_card_state_type | sd_state_get (void)
returns information about sd card. More...
void | sd_dma_config (uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
set dma configuation for sdio More...

Variables

sdio_command_struct_type sdio_command_init_struct
sdio_data_struct_type sdio_data_init_struct
static sd_memory_card_type | card_type = SDIO_STD_CAPACITY_SD_CARD_V1_1
static uint32_t | csd_table [4]
static uint32_t | cid_table [4]
static uint32_t | rca = 0
static sd_data_transfer_mode_type | device_mode = SD_TRANSFER_POLLING_MODE
static uint8_t | stop_flag = 0
volatile sd_error_status_type | transfer_error = SD_OK
volatile uint8_t | transfer_end = 0
sd_card_info_struct_type sd_card_info

Detailed Description

this file provides a set of functions needed to manage the sdio/mmc card memory.

Version
v2.0.2
Date
2021-12-31
        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.

Definition in file sdio_fatfs/src/at32_sdio.c.


AT32F415 Firmwary Library: diskio.c File Reference

  • sdio
  • sdio_fatfs
  • src
Macros | Functions
diskio.c File Reference
#include "ff.h"
#include "diskio.h"
#include <string.h>
#include "at32_sdio.h"

Go to the source code of this file.

Macros

#define | DEV_RAM 0 /* Example: Map Ramdisk to physical drive 0 */
#define | DEV_MMC 1 /* Example: Map MMC/SD card to physical drive 1 */
#define | DEV_USB 2 /* Example: Map USB MSD to physical drive 2 */

Functions

__align (4)
sd_error_status_type | sd_write_disk (const uint8_t *buf, uint32_t sector, uint8_t cnt)
write sd card sector More...
DSTATUS | disk_status (BYTE pdrv)
DSTATUS | disk_initialize (BYTE pdrv)
DRESULT | disk_read (BYTE pdrv, BYTE *buff, LBA_t sector, UINT count)
DRESULT | disk_write (BYTE pdrv, const BYTE *buff, LBA_t sector, UINT count)
DRESULT | disk_ioctl (BYTE pdrv, BYTE cmd, void *buff)

Macro Definition Documentation

◆ DEV_MMC

#define DEV_MMC 1 /* Example: Map MMC/SD card to physical drive 1 */

Definition at line 19 of file diskio.c.

◆ DEV_RAM

#define DEV_RAM 0 /* Example: Map Ramdisk to physical drive 0 */

Definition at line 18 of file diskio.c.

◆ DEV_USB

#define DEV_USB 2 /* Example: Map USB MSD to physical drive 2 */

Definition at line 20 of file diskio.c.

Function Documentation

◆ __align()

__align ( 4 )

Definition at line 22 of file diskio.c.

◆ disk_initialize()

DSTATUS disk_initialize ( BYTE pdrv )

Definition at line 141 of file diskio.c.

◆ disk_ioctl()

DRESULT disk_ioctl | ( | BYTE | pdrv,
 |  | BYTE | cmd,
 |  | void * | buff
 | ) |  |

Definition at line 245 of file diskio.c.

◆ disk_read()

DRESULT disk_read | ( | BYTE | pdrv,
 |  | BYTE * | buff,
 |  | LBA_t | sector,
 |  | UINT | count
 | ) |  |

Definition at line 172 of file diskio.c.

◆ disk_status()

DSTATUS disk_status ( BYTE pdrv )

Definition at line 110 of file diskio.c.

◆ disk_write()

DRESULT disk_write | ( | BYTE | pdrv,
 |  | const BYTE * | buff,
 |  | LBA_t | sector,
 |  | UINT | count
 | ) |  |

Definition at line 209 of file diskio.c.

◆ sd_write_disk()

sd_error_status_type sd_write_disk | ( | const uint8_t * | buf,
 |  | uint32_t | sector,
 |  | uint8_t | cnt
 | ) |  |

write sd card sector

Parameters
buf | write data buf
sector | sector address
cnt | sector count
Return values
sd_error_status_type sd card error code.

Definition at line 74 of file diskio.c.

Referenced by disk_write().


AT32F415 Firmwary Library: spi_flash.h File Reference

  • spi
  • w25q_flash
  • inc
Macros | Functions
spi_flash.h File Reference

header file of spi_flash More...

#include "at32f415.h"

Go to the source code of this file.

Macros

#define | FLASH_CS_HIGH() gpio_bits_set(GPIOA, GPIO_PINS_4)
#define | FLASH_CS_LOW() gpio_bits_reset(GPIOA, GPIO_PINS_4)
#define | W25Q80 0xEF13
#define | W25Q16 0xEF14
#define | W25Q32 0xEF15
#define | W25Q64 0xEF16
#define | W25Q128 0xEF17
#define | SPIF_CHIP_SIZE 0x1000000
#define | SPIF_SECTOR_SIZE 4096
#define | SPIF_PAGE_SIZE 256
#define | SPIF_WRITEENABLE 0x06
#define | SPIF_WRITEDISABLE 0x04
#define | SPIF_READSTATUSREG1 0x05
#define | SPIF_WRITESTATUSREG1 0x01
#define | SPIF_READSTATUSREG2 0x35
#define | SPIF_WRITESTATUSREG2 0x31
#define | SPIF_READSTATUSREG3 0x15
#define | SPIF_WRITESTATUSREG3 0x11
#define | SPIF_READDATA 0x03
#define | SPIF_FASTREADDATA 0x0B
#define | SPIF_FASTREADDUAL 0x3B
#define | SPIF_PAGEPROGRAM 0x02
#define | SPIF_BLOCKERASE 0xD8
#define | SPIF_SECTORERASE 0x20
#define | SPIF_CHIPERASE 0xC7
#define | SPIF_POWERDOWN 0xB9
#define | SPIF_RELEASEPOWERDOWN 0xAB
#define | SPIF_DEVICEID 0xAB
#define | SPIF_MANUFACTDEVICEID 0x90
#define | SPIF_JEDECDEVICEID 0x9F
#define | FLASH_SPI_DUMMY_BYTE 0xA5

Functions

void | spiflash_init (void)
spi configuration. More...
void | spiflash_write (uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write data to flash More...
void | spiflash_read (uint8_t *pbuffer, uint32_t read_addr, uint32_t length)
read data from flash More...
void | spiflash_sector_erase (uint32_t erase_addr)
erase a sector data More...
void | spiflash_write_nocheck (uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write data without check More...
void | spiflash_page_write (uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write a page data More...
void | spi_bytes_write (uint8_t *pbuffer, uint32_t length)
write data continuously More...
void | spi_bytes_read (uint8_t *pbuffer, uint32_t length)
read data continuously More...
void | spiflash_wait_busy (void)
wait program done More...
uint8_t | spiflash_read_sr1 (void)
read sr1 register More...
void | spiflash_write_enable (void)
enable write operation More...
uint16_t | spiflash_read_id (void)
read device id More...
uint8_t | spi_byte_write (uint8_t data)
write a byte to flash More...
uint8_t | spi_byte_read (void)
read a byte to flash More...

Detailed Description

header file of spi_flash

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file spi_flash.h.


AT32F415 Firmwary Library: spi_flash.c File Reference

  • spi
  • w25q_flash
  • src
Functions | Variables
spi_flash.c File Reference

spi_flash source code More...

#include "spi_flash.h"

Go to the source code of this file.

Functions

void | spiflash_init (void)
spi configuration. More...
void | spiflash_write (uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write data to flash More...
void | spiflash_read (uint8_t *pbuffer, uint32_t read_addr, uint32_t length)
read data from flash More...
void | spiflash_sector_erase (uint32_t erase_addr)
erase a sector data More...
void | spiflash_write_nocheck (uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write data without check More...
void | spiflash_page_write (uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write a page data More...
void | spi_bytes_write (uint8_t *pbuffer, uint32_t length)
write data continuously More...
void | spi_bytes_read (uint8_t *pbuffer, uint32_t length)
read data continuously More...
void | spiflash_wait_busy (void)
wait program done More...
uint8_t | spiflash_read_sr1 (void)
read sr1 register More...
void | spiflash_write_enable (void)
enable write operation More...
uint16_t | spiflash_read_id (void)
read device id More...
uint8_t | spi_byte_write (uint8_t data)
write a byte to flash More...
uint8_t | spi_byte_read (void)
read a byte to flash More...

Variables

uint8_t spiflash_sector_buf [SPIF_SECTOR_SIZE]

Detailed Description

spi_flash source code

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file spi_flash.c.


AT32F415 Firmwary Library: smartcard_config.h File Reference

  • usart
  • smartcard
  • inc
Macros
smartcard_config.h File Reference

header file of clock program More...

Go to the source code of this file.

Macros

#define | SC_USART USART2
#define | SC_USART_CLK CRM_USART2_PERIPH_CLOCK
#define | SC_USART_GPIO_CLK CRM_GPIOA_PERIPH_CLOCK
#define | SC_USART_TX_PIN GPIO_PINS_2
#define | SC_USART_TX_PORT GPIOA
#define | SC_USART_CLK_PIN GPIO_PINS_4
#define | SC_USART_CLK_PORT GPIOA
#define | SC_USART_IRQn USART2_IRQn
#define | SC_USART_IRQHandler USART2_IRQHandler
#define | SC_3_5V_PIN GPIO_PINS_5
#define | SC_RESET_PIN GPIO_PINS_6
#define | SC_CMDVCC_PIN GPIO_PINS_7
#define | SC_OFF_PIN GPIO_PINS_8
#define | SC_3_5V_PORT GPIOA
#define | SC_RESET_PORT GPIOA
#define | SC_CMDVCC_PORT GPIOA
#define | SC_OFF_PORT GPIOA
#define | SC_3_5V_CLK CRM_GPIOA_PERIPH_CLOCK
#define | SC_RESET_CLK CRM_GPIOA_PERIPH_CLOCK
#define | SC_CMDVCC_CLK CRM_GPIOA_PERIPH_CLOCK
#define | SC_OFF_CLK CRM_GPIOA_PERIPH_CLOCK
#define | SC_OFF_EXINT EXINT_LINE_8
#define | SC_OFF_PORTSOURCE GPIO_PORT_SOURCE_GPIOA
#define | SC_OFF_PINSOURCE GPIO_PINS_SOURCE8
#define | SC_OFF_EXINT_IRQ EXINT9_5_IRQn

Detailed Description

header file of clock program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file smartcard_config.h.

Macro Definition Documentation

◆ SC_3_5V_CLK

#define SC_3_5V_CLK CRM_GPIOA_PERIPH_CLOCK

Definition at line 55 of file smartcard_config.h.

◆ SC_3_5V_PIN

#define SC_3_5V_PIN GPIO_PINS_5

Definition at line 47 of file smartcard_config.h.

◆ SC_3_5V_PORT

#define SC_3_5V_PORT GPIOA

Definition at line 51 of file smartcard_config.h.

◆ SC_CMDVCC_CLK

#define SC_CMDVCC_CLK CRM_GPIOA_PERIPH_CLOCK

Definition at line 57 of file smartcard_config.h.

◆ SC_CMDVCC_PIN

#define SC_CMDVCC_PIN GPIO_PINS_7

Definition at line 49 of file smartcard_config.h.

◆ SC_CMDVCC_PORT

#define SC_CMDVCC_PORT GPIOA

Definition at line 53 of file smartcard_config.h.

◆ SC_OFF_CLK

#define SC_OFF_CLK CRM_GPIOA_PERIPH_CLOCK

Definition at line 58 of file smartcard_config.h.

◆ SC_OFF_EXINT

#define SC_OFF_EXINT EXINT_LINE_8

Definition at line 59 of file smartcard_config.h.

◆ SC_OFF_EXINT_IRQ

#define SC_OFF_EXINT_IRQ EXINT9_5_IRQn

Definition at line 62 of file smartcard_config.h.

◆ SC_OFF_PIN

#define SC_OFF_PIN GPIO_PINS_8

Definition at line 50 of file smartcard_config.h.

◆ SC_OFF_PINSOURCE

#define SC_OFF_PINSOURCE GPIO_PINS_SOURCE8

Definition at line 61 of file smartcard_config.h.

◆ SC_OFF_PORT

#define SC_OFF_PORT GPIOA

Definition at line 54 of file smartcard_config.h.

◆ SC_OFF_PORTSOURCE

#define SC_OFF_PORTSOURCE GPIO_PORT_SOURCE_GPIOA

Definition at line 60 of file smartcard_config.h.

◆ SC_RESET_CLK

#define SC_RESET_CLK CRM_GPIOA_PERIPH_CLOCK

Definition at line 56 of file smartcard_config.h.

◆ SC_RESET_PIN

#define SC_RESET_PIN GPIO_PINS_6

Definition at line 48 of file smartcard_config.h.

◆ SC_RESET_PORT

#define SC_RESET_PORT GPIOA

Definition at line 52 of file smartcard_config.h.

◆ SC_USART

#define SC_USART USART2

Definition at line 36 of file smartcard_config.h.

◆ SC_USART_CLK

#define SC_USART_CLK CRM_USART2_PERIPH_CLOCK

Definition at line 37 of file smartcard_config.h.

◆ SC_USART_CLK_PIN

#define SC_USART_CLK_PIN GPIO_PINS_4

Definition at line 41 of file smartcard_config.h.

◆ SC_USART_CLK_PORT

#define SC_USART_CLK_PORT GPIOA

Definition at line 42 of file smartcard_config.h.

◆ SC_USART_GPIO_CLK

#define SC_USART_GPIO_CLK CRM_GPIOA_PERIPH_CLOCK

Definition at line 38 of file smartcard_config.h.

◆ SC_USART_IRQHandler

#define SC_USART_IRQHandler ( void ) USART2_IRQHandler

Definition at line 44 of file smartcard_config.h.

◆ SC_USART_IRQn

#define SC_USART_IRQn USART2_IRQn

Definition at line 43 of file smartcard_config.h.

◆ SC_USART_TX_PIN

#define SC_USART_TX_PIN GPIO_PINS_2

Definition at line 39 of file smartcard_config.h.

◆ SC_USART_TX_PORT

#define SC_USART_TX_PORT GPIOA

Definition at line 40 of file smartcard_config.h.


AT32F415 Firmwary Library: audio_codec.h File Reference

  • usb_device
  • audio
  • inc
Data Structures | Macros | Functions
audio/inc/audio_codec.h File Reference

audio codec header file More...

#include "usb_conf.h"

Go to the source code of this file.

Data Structures

struct audio_codec_type

Macros

#define | WM8988_R0_LEFT_INPUT_VOLUME 0x00 /*Left channel PGA control*/
#define | WM8988_R1_RIGHT_INPUT_VOLUME 0x01 /*Right channel PGA control*/
#define | WM8988_R2_LOUT1_VOLUME 0x02
#define | WM8988_R3_ROUT1_VOLUME 0x03
#define | WM8988_R4_RESERVED 0x04
#define | WM8988_R5_ADC_DAC_CONTROL 0x05
#define | WM8988_R6_RESERVED 0x06
#define | WM8988_R7_AUDIO_INTERFACE 0x07
#define | WM8988_R8_SAMPLE_RATE 0x08
#define | WM8988_R9_RESERVED 0x09
#define | WM8988_R10_LEFT_DAC_VOLUME 0x0A
#define | WM8988_R11_RIGHT_DAC_VOLUME 0x0B
#define | WM8988_R12_BASS_CONTROL 0x0C
#define | WM8988_R13_TREBLE_CONTROL 0x0D
#define | WM8988_R14_
#define | WM8988_R15_RESET 0x0F
#define | WM8988_R16_3D_CONTROL 0x10
#define | WM8988_R17_ALC1 0x11
#define | WM8988_R18_ALC2 0x12
#define | WM8988_R19_ALC3 0x13
#define | WM8988_R20_NOISE_GATE 0x14
#define | WM8988_R21_LEFT_ADC_VOLUME 0x15
#define | WM8988_R22_RIGHT_ADC_VOLUME 0x16
#define | WM8988_R23_ADDITIONAL_1_CONTROL 0x17
#define | WM8988_R24_ADDITIONAL_2_CONTROL 0x18
#define | WM8988_R25_PWR_1_MGMT 0x19
#define | WM8988_R26_PWR_2_MGMT 0x1A
#define | WM8988_R27_ADDITIONAL_3_CONTROL 0x1B
#define | WM8988_R31_ADC_INPUT_MODE 0x1F
#define | WM8988_R32_ADC_L_SIGNAL_PATH 0x20
#define | WM8988_R33_ADC_R_SIGNAL_PATH 0x21
#define | WM8988_R34_LEFT_OUT_MIX_1 0x22
#define | WM8988_R35_LEFT_OUT_MIX_2 0x23
#define | WM8988_R36_RIGHT_OUT_MIX_1 0x24
#define | WM8988_R37_RIGHT_OUT_MIX_2 0x25
#define | WM8988_R38_RESERVED
#define | WM8988_R39_RESERVED
#define | WM8988_R40_LOUT2_VOLUME 0x28
#define | WM8988_R41_ROUT2_VOLUME 0x29
#define | WM8988_R42_RESERVED
#define | WM8988_R43_LOW_POWER_PALYBACK 0x43
#define | WM8988_I2C_ADDR_CSB_LOW 0x34
#define | WM8988_I2C_ADDR_CSB_HIGH 0x36
#define | I2S1_WS_PIN GPIO_PINS_4
#define | I2S1_CK_PIN GPIO_PINS_5
#define | I2S1_SD_PIN GPIO_PINS_7
#define | I2S1_GPIO GPIOA
#define | I2S1_GPIO_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
#define | I2S1_DT_ADDRESS (&(SPI1->dt))
#define | I2S2_WS_PIN GPIO_PINS_12
#define | I2S2_CK_PIN GPIO_PINS_13
#define | I2S2_SD_PIN GPIO_PINS_15
#define | I2S2_GPIO GPIOB
#define | I2S2_GPIO_CRM_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2S2_DT_ADDRESS (&(SPI2->dt))
#define | SPK_TX_FIFO_SIZE (1024 * 4)
#define | MIC_BUFFER_SIZE 1024
#define | SPK_BUFFER_SIZE 4096
#define | DMA_BUFFER_SIZE 288

Functions

error_status | audio_codec_init (void)
audio codec init More...
error_status | audio_codec_loop (void)
audio codec loop More...
void | audio_codec_modify_freq (uint32_t freq)
audio codec modify freq More...
void | audio_codec_spk_fifo_write (uint8_t *data, uint32_t len)
audio codec interface More...
uint32_t | audio_codec_mic_get_data (uint8_t *buffer)
codec microphone get data More...
uint8_t | audio_codec_spk_feedback (uint8_t *feedback)
codec speaker feedback More...
void | audio_codec_spk_alt_setting (uint32_t alt_seting)
audio codec speaker alt setting config More...
void | audio_codec_mic_alt_setting (uint32_t alt_seting)
audio codec microphone alt setting config More...
void | audio_codec_set_mic_mute (uint8_t mute)
audio codec set microphone mute More...
void | audio_codec_set_spk_mute (uint8_t mute)
audio codec set speaker mute More...
void | audio_codec_set_mic_volume (uint16_t volume)
audio codec set microphone volume More...
void | audio_codec_set_spk_volume (uint16_t volume)
audio codec set speaker volume More...
void | audio_codec_set_mic_freq (uint32_t freq)
audio codec set microphone freq More...
void | audio_codec_set_spk_freq (uint32_t freq)
audio codec set speaker freq More...

Detailed Description

audio codec header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file audio/inc/audio_codec.h.


AT32F415 Firmwary Library: audio_codec.h File Reference

  • usb_device
  • composite_audio_hid
  • inc
Data Structures | Macros | Functions
composite_audio_hid/inc/audio_codec.h File Reference

audio codec header file More...

#include "usb_conf.h"

Go to the source code of this file.

Data Structures

struct audio_codec_type

Macros

#define | WM8988_R0_LEFT_INPUT_VOLUME 0x00 /*Left channel PGA control*/
#define | WM8988_R1_RIGHT_INPUT_VOLUME 0x01 /*Right channel PGA control*/
#define | WM8988_R2_LOUT1_VOLUME 0x02
#define | WM8988_R3_ROUT1_VOLUME 0x03
#define | WM8988_R4_RESERVED 0x04
#define | WM8988_R5_ADC_DAC_CONTROL 0x05
#define | WM8988_R6_RESERVED 0x06
#define | WM8988_R7_AUDIO_INTERFACE 0x07
#define | WM8988_R8_SAMPLE_RATE 0x08
#define | WM8988_R9_RESERVED 0x09
#define | WM8988_R10_LEFT_DAC_VOLUME 0x0A
#define | WM8988_R11_RIGHT_DAC_VOLUME 0x0B
#define | WM8988_R12_BASS_CONTROL 0x0C
#define | WM8988_R13_TREBLE_CONTROL 0x0D
#define | WM8988_R14_
#define | WM8988_R15_RESET 0x0F
#define | WM8988_R16_3D_CONTROL 0x10
#define | WM8988_R17_ALC1 0x11
#define | WM8988_R18_ALC2 0x12
#define | WM8988_R19_ALC3 0x13
#define | WM8988_R20_NOISE_GATE 0x14
#define | WM8988_R21_LEFT_ADC_VOLUME 0x15
#define | WM8988_R22_RIGHT_ADC_VOLUME 0x16
#define | WM8988_R23_ADDITIONAL_1_CONTROL 0x17
#define | WM8988_R24_ADDITIONAL_2_CONTROL 0x18
#define | WM8988_R25_PWR_1_MGMT 0x19
#define | WM8988_R26_PWR_2_MGMT 0x1A
#define | WM8988_R27_ADDITIONAL_3_CONTROL 0x1B
#define | WM8988_R31_ADC_INPUT_MODE 0x1F
#define | WM8988_R32_ADC_L_SIGNAL_PATH 0x20
#define | WM8988_R33_ADC_R_SIGNAL_PATH 0x21
#define | WM8988_R34_LEFT_OUT_MIX_1 0x22
#define | WM8988_R35_LEFT_OUT_MIX_2 0x23
#define | WM8988_R36_RIGHT_OUT_MIX_1 0x24
#define | WM8988_R37_RIGHT_OUT_MIX_2 0x25
#define | WM8988_R38_RESERVED
#define | WM8988_R39_RESERVED
#define | WM8988_R40_LOUT2_VOLUME 0x28
#define | WM8988_R41_ROUT2_VOLUME 0x29
#define | WM8988_R42_RESERVED
#define | WM8988_R43_LOW_POWER_PALYBACK 0x43
#define | WM8988_I2C_ADDR_CSB_LOW 0x34
#define | WM8988_I2C_ADDR_CSB_HIGH 0x36
#define | I2S1_WS_PIN GPIO_PINS_4
#define | I2S1_CK_PIN GPIO_PINS_5
#define | I2S1_SD_PIN GPIO_PINS_7
#define | I2S1_GPIO GPIOA
#define | I2S1_GPIO_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
#define | I2S1_DT_ADDRESS (&(SPI1->dt))
#define | I2S2_WS_PIN GPIO_PINS_12
#define | I2S2_CK_PIN GPIO_PINS_13
#define | I2S2_SD_PIN GPIO_PINS_15
#define | I2S2_GPIO GPIOB
#define | I2S2_GPIO_CRM_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2S2_DT_ADDRESS (&(SPI2->dt))
#define | SPK_TX_FIFO_SIZE (1024 * 4)
#define | MIC_BUFFER_SIZE 1024
#define | SPK_BUFFER_SIZE 4096
#define | DMA_BUFFER_SIZE 288

Functions

error_status | audio_codec_init (void)
audio codec init More...
error_status | audio_codec_loop (void)
audio codec loop More...
void | audio_codec_modify_freq (uint32_t freq)
audio codec modify freq More...
void | audio_codec_spk_fifo_write (uint8_t *data, uint32_t len)
audio codec interface More...
uint32_t | audio_codec_mic_get_data (uint8_t *buffer)
codec microphone get data More...
uint8_t | audio_codec_spk_feedback (uint8_t *feedback)
codec speaker feedback More...
void | audio_codec_spk_alt_setting (uint32_t alt_seting)
audio codec speaker alt setting config More...
void | audio_codec_mic_alt_setting (uint32_t alt_seting)
audio codec microphone alt setting config More...
void | audio_codec_set_mic_mute (uint8_t mute)
audio codec set microphone mute More...
void | audio_codec_set_spk_mute (uint8_t mute)
audio codec set speaker mute More...
void | audio_codec_set_mic_volume (uint16_t volume)
audio codec set microphone volume More...
void | audio_codec_set_spk_volume (uint16_t volume)
audio codec set speaker volume More...
void | audio_codec_set_mic_freq (uint32_t freq)
audio codec set microphone freq More...
void | audio_codec_set_spk_freq (uint32_t freq)
audio codec set speaker freq More...

Detailed Description

audio codec header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file composite_audio_hid/inc/audio_codec.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • usb_device
  • audio
  • inc
Macros | Functions
project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "at32f415_board.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 64
#define | USBD_EP2_TX_SIZE 16
#define | USBD_EP3_TX_SIZE 16

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • usb_device
  • composite_audio_hid
  • inc
Macros | Functions
project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "at32f415_board.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 64
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 16

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • usb_device
  • composite_vcp_keyboard
  • inc
Macros | Functions
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20
#define | USB_LOW_POWER_WAKUP
usb endpoint max num define More...

Functions

void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • usb_device
  • custom_hid
  • inc
Macros | Functions
project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "at32f415_board.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • usb_device
  • keyboard
  • inc
Macros | Functions
project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20
#define | USB_LOW_POWER_WAKUP
usb endpoint max num define More...

Functions

void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • usb_device
  • mouse
  • inc
Macros | Functions
project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_DP GPIO_PINS_12
#define | OTG_PIN_DM GPIO_PINS_11
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20
#define | USB_LOW_POWER_WAKUP
usb endpoint max num define More...

Functions

void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • usb_device
  • msc
  • inc
Macros | Functions
project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • usb_device
  • printer
  • inc
Macros | Functions
project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • usb_device
  • vcp_loopback
  • inc
Macros | Functions
project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • usb_device
  • virtual_msc_iap
  • inc
Macros | Functions
project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • usb_host
  • hid_demo
  • inc
Macros | Functions
project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_HOST_MODE
enable usb device mode More...
#define | USB_ID 0
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | OTG_PIN_POWER_SWITCH_GPIO GPIOB
#define | OTG_PIN_POWER_SWITCH_CLOCK CRM_GPIOH_PERIPH_CLOCK
#define | OTG_PIN_POWER_SWITCH GPIO_PINS_3
#define | USBH_RX_FIFO_SIZE 128
usb device mode config More...
#define | USBH_NP_TX_FIFO_SIZE 96
#define | USBH_P_TX_FIFO_SIZE 96
#define | USBH_DEBUG_ENABLE
usb sof output enable More...
#define | USBH_DEBUG(...)

Functions

void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • usb_host
  • msc_only_fat32
  • inc
Macros | Functions
project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_HOST_MODE
enable usb device mode More...
#define | USB_ID 0
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | OTG_PIN_POWER_SWITCH_GPIO GPIOB
#define | OTG_PIN_POWER_SWITCH_CLOCK CRM_GPIOH_PERIPH_CLOCK
#define | OTG_PIN_POWER_SWITCH GPIO_PINS_3
#define | USBH_RX_FIFO_SIZE 128
usb device mode config More...
#define | USBH_NP_TX_FIFO_SIZE 96
#define | USBH_P_TX_FIFO_SIZE 96
#define | USBH_DEBUG_ENABLE
usb sof output enable More...
#define | USBH_DEBUG(...)

Functions

void | usb_delay_ms (uint32_t ms)
usb delay millisecond function. More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • inc
Macros | Functions
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "at32f415_board.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • inc
Macros | Functions
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "at32f415_board.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h.


AT32F415 Firmwary Library: usb_conf.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • inc
Macros | Functions
utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h File Reference

usb config header file More...

#include "at32f415_usb.h"
#include "at32f415.h"
#include "at32f415_board.h"
#include "stdio.h"

Go to the source code of this file.

Macros

#define | USE_OTG_DEVICE_MODE
enable usb device mode More...
#define | USB_ID 0
enable usb host mode More...
#define | OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
#define | OTG_IRQ OTGFS1_IRQn
#define | OTG_IRQ_HANDLER OTGFS1_IRQHandler
#define | OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
#define | OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
#define | OTG_WKUP_EXINT_LINE EXINT_LINE_18
#define | OTG_PIN_GPIO GPIOA
#define | OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_VBUS GPIO_PINS_9
#define | OTG_PIN_ID GPIO_PINS_10
#define | OTG_PIN_SOF_GPIO GPIOA
#define | OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
#define | OTG_PIN_SOF GPIO_PINS_8
#define | USBD_RX_SIZE 128
usb device mode config More...
#define | USBD_EP0_TX_SIZE 24
#define | USBD_EP1_TX_SIZE 20
#define | USBD_EP2_TX_SIZE 20
#define | USBD_EP3_TX_SIZE 20

Functions

void | usb_delay_ms (uint32_t ms)
usb endpoint max num define More...
void | usb_delay_us (uint32_t us)
usb delay microsecond function. More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h.


AT32F415 Firmwary Library: audio_codec.c File Reference

  • usb_device
  • audio
  • src
Macros | Functions | Variables
audio/src/audio_codec.c File Reference

audio codec function More...

#include "audio_codec.h"
#include "i2c_application.h"
#include "audio_conf.h"
#include <string.h>

Go to the source code of this file.

Macros

#define | I2C_TIMEOUT 0xFFFFFFFF
#define | I2Cx_SPEED 100000
#define | I2Cx_ADDRESS 0x00
#define | I2Cx_PORT I2C1
#define | I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
#define | I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SCL_GPIO_PIN GPIO_PINS_8
#define | I2Cx_SCL_GPIO_PORT GPIOB
#define | I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SDA_GPIO_PIN GPIO_PINS_9
#define | I2Cx_SDA_GPIO_PORT GPIOB
#define | WM8988_REG_FREQ48K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0081)
wm8988 freq More...
#define | WM8988_REG_FREQ16K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0095)
#define | WM8988_REG_BITW16 ((WM8988_R7_AUDIO_INTERFACE << 9) | 0x0042)
wm8988 bit width More...

Functions

void | memset16_buffer (uint16_t *buffer, uint32_t set, uint32_t len)
buffer memset More...
void | codec_i2s_reset (void)
audio codec i2s reset More...
void | codec_i2s_init (audio_codec_type *param)
audio codec i2s init More...
void | mclk_tmr1_init (void)
mclk clock conifg More...
void | copy_buff (uint16_t *dest, uint16_t *src, uint32_t len)
copy buffer More...
void | audio_codec_set_mic_freq (uint32_t freq)
audio codec set microphone freq More...
void | audio_codec_set_spk_freq (uint32_t freq)
audio codec set speaker freq More...
void | audio_codec_spk_alt_setting (uint32_t alt_seting)
audio codec speaker alt setting config More...
void | audio_codec_mic_alt_setting (uint32_t alt_seting)
audio codec microphone alt setting config More...
void | audio_codec_set_mic_mute (uint8_t mute)
audio codec set microphone mute More...
void | audio_codec_set_spk_mute (uint8_t mute)
audio codec set speaker mute More...
void | audio_codec_set_mic_volume (uint16_t volume)
audio codec set microphone volume More...
void | audio_codec_set_spk_volume (uint16_t volume)
audio codec set speaker volume More...
uint8_t | audio_codec_spk_feedback (uint8_t *feedback)
codec speaker feedback More...
void | audio_codec_spk_fifo_write (uint8_t *data, uint32_t len)
codec speaker write fifo More...
uint32_t | audio_codec_mic_get_data (uint8_t *buffer)
codec microphone get data More...
void | audio_codec_modify_freq (uint32_t freq)
audio codec modify freq More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
void | DMA1_Channel3_IRQHandler (void)
this function handles dma1 channel3 interrupt. More...
void | DMA1_Channel4_IRQHandler (void)
this function handles dma1 channel4 interrupt. More...
error_status | audio_codec_init (void)
audio codec init More...
error_status | audio_codec_loop (void)
audio codec loop More...

Variables

uint16_t | reg_addr_data []
wm8988 register default value More...
i2c_handle_type hi2cx
audio_codec_type audio_codec
uint16_t | spk_dma_buffer [DMA_BUFFER_SIZE]
uint16_t | mic_dma_buffer [DMA_BUFFER_SIZE]

Detailed Description

audio codec function

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file audio/src/audio_codec.c.


AT32F415 Firmwary Library: audio_codec.c File Reference

  • usb_device
  • composite_audio_hid
  • src
Macros | Functions | Variables
composite_audio_hid/src/audio_codec.c File Reference

audio codec function More...

#include "audio_codec.h"
#include "i2c_application.h"
#include "audio_conf.h"
#include <string.h>

Go to the source code of this file.

Macros

#define | I2C_TIMEOUT 0xFFFFFFFF
#define | I2Cx_SPEED 100000
#define | I2Cx_ADDRESS 0x00
#define | I2Cx_PORT I2C1
#define | I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
#define | I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SCL_GPIO_PIN GPIO_PINS_8
#define | I2Cx_SCL_GPIO_PORT GPIOB
#define | I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
#define | I2Cx_SDA_GPIO_PIN GPIO_PINS_9
#define | I2Cx_SDA_GPIO_PORT GPIOB
#define | WM8988_REG_FREQ48K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0081)
wm8988 freq More...
#define | WM8988_REG_FREQ16K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0095)
#define | WM8988_REG_BITW16 ((WM8988_R7_AUDIO_INTERFACE << 9) | 0x0042)
wm8988 bit width More...

Functions

void | memset16_buffer (uint16_t *buffer, uint32_t set, uint32_t len)
buffer memset More...
void | codec_i2s_reset (void)
audio codec i2s reset More...
void | codec_i2s_init (audio_codec_type *param)
audio codec i2s init More...
void | mclk_tmr1_init (void)
mclk clock conifg More...
void | copy_buff (uint16_t *dest, uint16_t *src, uint32_t len)
copy buffer More...
void | audio_codec_set_mic_freq (uint32_t freq)
audio codec set microphone freq More...
void | audio_codec_set_spk_freq (uint32_t freq)
audio codec set speaker freq More...
void | audio_codec_spk_alt_setting (uint32_t alt_seting)
audio codec speaker alt setting config More...
void | audio_codec_mic_alt_setting (uint32_t alt_seting)
audio codec microphone alt setting config More...
void | audio_codec_set_mic_mute (uint8_t mute)
audio codec set microphone mute More...
void | audio_codec_set_spk_mute (uint8_t mute)
audio codec set speaker mute More...
void | audio_codec_set_mic_volume (uint16_t volume)
audio codec set microphone volume More...
void | audio_codec_set_spk_volume (uint16_t volume)
audio codec set speaker volume More...
uint8_t | audio_codec_spk_feedback (uint8_t *feedback)
codec speaker feedback More...
void | audio_codec_spk_fifo_write (uint8_t *data, uint32_t len)
codec speaker write fifo More...
uint32_t | audio_codec_mic_get_data (uint8_t *buffer)
codec microphone get data More...
void | audio_codec_modify_freq (uint32_t freq)
audio codec modify freq More...
void | i2c_lowlevel_init (i2c_handle_type *hi2c)
initializes peripherals used by the i2c. More...
void | DMA1_Channel3_IRQHandler (void)
this function handles dma1 channel3 interrupt. More...
void | DMA1_Channel4_IRQHandler (void)
this function handles dma1 channel4 interrupt. More...
error_status | audio_codec_init (void)
audio codec init More...
error_status | audio_codec_loop (void)
audio codec loop More...

Variables

uint16_t | reg_addr_data []
wm8988 register default value More...
i2c_handle_type hi2cx
audio_codec_type audio_codec
uint16_t | spk_dma_buffer [DMA_BUFFER_SIZE]
uint16_t | mic_dma_buffer [DMA_BUFFER_SIZE]

Detailed Description

audio codec function

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file composite_audio_hid/src/audio_codec.c.


AT32F415 Firmwary Library: msc_diskio.h File Reference

  • usb_device
  • msc
  • inc
Macros | Functions
msc/inc/msc_diskio.h File Reference

usb mass storage disk interface header file More...

#include "usb_conf.h"
#include "usb_std.h"

Go to the source code of this file.

Macros

#define | INTERNAL_FLASH_LUN 0
#define | SPI_FLASH_LUN 1
#define | SD_LUN 2
#define | USB_FLASH_ADDR_OFFSET 0x08005000
#define | SECTOR_SIZE_1K 1024
#define | SECTOR_SIZE_2K 2048
#define | SECTOR_SIZE_4K 4096

Functions

uint8_t * | get_inquiry (uint8_t lun)
get disk inquiry More...
usb_sts_type | msc_disk_read (uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len)
disk read More...
usb_sts_type | msc_disk_write (uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len)
disk write More...
usb_sts_type | msc_disk_capacity (uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size)
disk capacity More...

Detailed Description

usb mass storage disk interface header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file msc/inc/msc_diskio.h.


AT32F415 Firmwary Library: msc_diskio.h File Reference

  • usb_device
  • virtual_msc_iap
  • inc
Macros | Functions
virtual_msc_iap/inc/msc_diskio.h File Reference

usb mass storage disk interface header file More...

#include "usb_conf.h"
#include "usb_std.h"

Go to the source code of this file.

Macros

#define | INTERNAL_FLASH_LUN 0
#define | SPI_FLASH_LUN 1
#define | SD_LUN 2
#define | USB_FLASH_ADDR_OFFSET 0x08004000

Functions

uint8_t * | get_inquiry (uint8_t lun)
get disk inquiry More...
usb_sts_type | msc_disk_read (uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len)
disk read More...
usb_sts_type | msc_disk_write (uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len)
disk write More...
usb_sts_type | msc_disk_capacity (uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size)
disk capacity More...

Detailed Description

usb mass storage disk interface header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file virtual_msc_iap/inc/msc_diskio.h.


AT32F415 Firmwary Library: msc_diskio.c File Reference

  • usb_device
  • msc
  • src
Functions | Variables
msc/src/msc_diskio.c File Reference

usb mass storage disk function More...

#include "msc_diskio.h"
#include "msc_bot_scsi.h"

Go to the source code of this file.

Functions

uint8_t * | get_inquiry (uint8_t lun)
get disk inquiry More...
usb_sts_type | msc_disk_read (uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len)
disk read More...
usb_sts_type | msc_disk_write (uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len)
disk write More...
usb_sts_type | msc_disk_capacity (uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size)
disk capacity More...

Variables

uint32_t | sector_size = 2048
uint32_t | msc_flash_size
uint8_t | scsi_inquiry [MSC_SUPPORT_MAX_LUN][SCSI_INQUIRY_DATA_LENGTH]

Detailed Description

usb mass storage disk function

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file msc/src/msc_diskio.c.


AT32F415 Firmwary Library: msc_diskio.c File Reference

  • usb_device
  • virtual_msc_iap
  • src
Functions | Variables
virtual_msc_iap/src/msc_diskio.c File Reference

usb mass storage disk function More...

#include "msc_diskio.h"
#include "msc_bot_scsi.h"
#include "flash_fat16.h"

Go to the source code of this file.

Functions

uint8_t * | get_inquiry (uint8_t lun)
get disk inquiry More...
usb_sts_type | msc_disk_read (uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len)
disk read More...
usb_sts_type | msc_disk_write (uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len)
disk write More...
usb_sts_type | msc_disk_capacity (uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size)
disk capacity More...

Variables

uint8_t scsi_inquiry [MSC_SUPPORT_MAX_LUN][SCSI_INQUIRY_DATA_LENGTH]

Detailed Description

usb mass storage disk function

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file virtual_msc_iap/src/msc_diskio.c.


AT32F415 Firmwary Library: flash_fat16.h File Reference

  • usb_device
  • virtual_msc_iap
  • inc
Data Structures | Macros | Enumerations | Functions | Variables
flash_fat16.h File Reference

fat16 file system header file More...

#include "usb_conf.h"

Go to the source code of this file.

Data Structures

struct | fat_dir_type
struct | flash_iap_type

Macros

#define | FAT16_SECTOR_SIZE 62
#define | FAT16_TABLE_SIZE 4
#define | FAT16_BYTE_PER_SIZE 2048
#define | FAT16_FILENAME_SIZE 11
#define | FAT16_DIR_SIZE 47
#define | FLASH_FAT16_BOOT_SECTOR_ADDR 0x00
#define | FLASH_FAT16_1_ADDR 0x1000
#define | FLASH_FAT16_2_ADDR 0x7800
#define | FLASH_FAT16_ROOT_ADDR 0xE000
#define | FLASH_FAT16_FILE_START_ADDR 0x12000
#define | FLASH_APP_START_ADDR 0x08006000
#define | FLASH_SECTOR_1K_SIZE 0x400
#define | FLASH_SECTOR_2K_SIZE 0x800
#define | FLASH_SECTOR_4K_SIZE 0x1000
#define | FLASH_SECTOR_1K_ALLGNED 0x3FF
#define | FLASH_SECTOR_2K_ALLGNED 0x7FF
#define | FLASH_SECTOR_4K_ALLGNED 0xFFF
#define | FILE_SUFFIX1_LEN 3
#define | FILE_SUFFIX2_LEN 3
#define | FILE_SUFFIX1_NAME "BIN"
#define | FILE_SUFFIX2_NAME "bin"
#define | INVAILD_OFFSET_ADDR 0xFFFFFFFF
#define | IAP_UPGRADE_COMPLETE_FLAG 0x41544B38
#define | IAP_SUCCESS 0
#define | IAP_ERROR 1

Enumerations

enum upgrade_status_type {
UPGRADE_READY = 0 , UPGRAGE_ONGOING , UPGRADE_SUCCESS , UPGRADE_ERROR ,
UPGRADE_LARGE , UPGRADE_UNKNOWN , UPGRADE_DONE , UPGRADE_JUMP
}

Functions

uint32_t | flash_fat16_write (uint32_t fat_lbk, uint8_t *data, uint32_t len)
write a logical block address More...
uint32_t | flash_fat16_read (uint32_t fat_lbk, uint8_t *data, uint32_t len)
read a logical block address More...
void | flash_fat16_init (void)
flash fat16 iap init More...
void | flash_fat16_loop_status (void)
loop status More...
uint32_t | flash_fat16_set_name (const uint8_t *file_name, uint8_t len)
set file name More...
uint8_t | flash_fat16_get_upgrade_flag (void)
get iap upgrade complete flag More...

Variables

flash_iap_type flash_iap

Detailed Description

fat16 file system header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file flash_fat16.h.


AT32F415 Firmwary Library: flash_fat16.c File Reference

  • usb_device
  • virtual_msc_iap
  • src
Macros | Functions | Variables
flash_fat16.c File Reference

fat16 file system More...

#include "flash_fat16.h"
#include "usb_conf.h"

Go to the source code of this file.

Macros

#define FAT16_SECTOR_SIZE 62

Functions

uint32_t | flash_fat16_boot_dir_write (uint32_t fat_lbk, uint8_t *data, uint32_t len)
boot dir write More...
uint32_t | flash_fat16_sector_write (uint32_t fat_lbk, uint8_t *data, uint32_t len)
write sector More...
uint32_t | fat16_memory_copy (uint8_t *dst, const uint8_t *src, uint32_t len)
memory copy function More...
uint32_t | fat16_memory_memset (uint8_t *dst, uint32_t set, uint32_t len)
memset function More...
uint32_t | flash_write_data (uint32_t address, uint8_t *data, uint32_t len)
write data to flash More...
uint32_t | flash_read_data (uint32_t address, uint8_t *data, uint32_t len)
read data from flash More...
uint32_t | fat16_memory_cmp (uint8_t *dst, uint8_t *src, uint32_t len)
memory compare function More...
uint32_t | flash_crc_check (uint32_t address, uint8_t *data, uint32_t len)
crc check More...
void | flash_fat16_clear_upgrade_flag (void)
clear iap upgrade flag More...
void | flash_fat16_set_upgrade_flag (void)
set iap upgrade complete flag More...
uint8_t | flash_fat16_get_upgrade_flag (void)
get iap upgrade complete flag More...
uint32_t | flash_fat16_read (uint32_t fat_lbk, uint8_t *data, uint32_t len)
read a logical block address More...
uint32_t | flash_fat16_write (uint32_t fat_lbk, uint8_t *data, uint32_t len)
write a logical block address More...
uint32_t | flash_fat16_set_name (const uint8_t *file_name, uint8_t len)
set file name More...
uint32_t | flash_fat16_addr_offset (uint8_t *file_name)
get offset address More...
void | flash_fat16_init (void)
flash fat16 iap init More...

Variables

static uint8_t | fat16_sector [62]
const uint8_t | fat16_root_dir_sector [FAT16_DIR_SIZE]
const uint8_t | fat16_table_sector0 [FAT16_TABLE_SIZE]
uint8_t | fat16_file_name [FAT16_FILENAME_SIZE]
fat_dir_type g_file_attr
flash_iap_type flash_iap
uint32_t | file_write_nr = 0
uint32_t | flash_fat16_boot_sector_addr = 0x00
uint32_t | flash_fat16_1_addr = 0x1000
uint32_t | flash_fat16_2_addr = 0x7800
uint32_t | flash_fat16_root_addr = 0xE000
uint32_t | flash_fat16_file_start_addr = 0x12000

Detailed Description

fat16 file system

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file flash_fat16.c.


AT32F415 Firmwary Library: usbh_user.h File Reference

  • usb_host
  • hid_demo
  • inc
Variables
hid_demo/inc/usbh_user.h File Reference

usb host user header file More...

#include "usbh_core.h"

Go to the source code of this file.

Variables

usbh_user_handler_type usbh_user_handle

Detailed Description

usb host user header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file hid_demo/inc/usbh_user.h.


AT32F415 Firmwary Library: usbh_user.h File Reference

  • usb_host
  • msc_only_fat32
  • inc
Variables
msc_only_fat32/inc/usbh_user.h File Reference

usb host user header file More...

#include "usbh_core.h"

Go to the source code of this file.

Variables

usbh_user_handler_type usbh_user_handle

Detailed Description

usb host user header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file msc_only_fat32/inc/usbh_user.h.


AT32F415 Firmwary Library: usbh_user.c File Reference

  • usb_host
  • hid_demo
  • src
Functions | Variables
hid_demo/src/usbh_user.c File Reference

usb user function More...

#include "usbh_user.h"

Go to the source code of this file.

Functions

static usb_sts_type | usbh_user_init (void)
usb host init user handler More...
static usb_sts_type | usbh_user_reset (void)
usb host reset user handler More...
static usb_sts_type | usbh_user_attached (void)
usb host check device attached More...
static usb_sts_type | usbh_user_disconnect (void)
usb host discconet user handler More...
static usb_sts_type | usbh_user_speed (uint8_t speed)
usb host speed user handler More...
static usb_sts_type | usbh_user_mfc_string (void *string)
usb host manufacturer string user handler More...
static usb_sts_type | usbh_user_product_string (void *string)
usb host product string user handler More...
static usb_sts_type | usbh_user_serial_string (void *string)
usb host serial string user handler More...
static usb_sts_type | usbh_user_enumeration_done (void)
usb host enumeration done user handler More...
static usb_sts_type | usbh_user_application (void)
usb host application user handler More...
static usb_sts_type | usbh_user_active_vbus (void *uhost, confirm_state state)
usb host active vbus user handler More...
static usb_sts_type | usbh_user_not_support (void)
usb host not support user handler More...

Variables

usbh_user_handler_type usbh_user_handle

Detailed Description

usb user function

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file hid_demo/src/usbh_user.c.


AT32F415 Firmwary Library: usbh_user.c File Reference

  • usb_host
  • msc_only_fat32
  • src
Functions | Variables
msc_only_fat32/src/usbh_user.c File Reference

usb user function More...

#include "usbh_user.h"
#include "ff.h"

Go to the source code of this file.

Functions

static usb_sts_type | usbh_user_init (void)
usb host init user handler More...
static usb_sts_type | usbh_user_reset (void)
usb host reset user handler More...
static usb_sts_type | usbh_user_attached (void)
usb host check device attached More...
static usb_sts_type | usbh_user_disconnect (void)
usb host discconet user handler More...
static usb_sts_type | usbh_user_speed (uint8_t speed)
usb host speed user handler More...
static usb_sts_type | usbh_user_mfc_string (void *string)
usb host manufacturer string user handler More...
static usb_sts_type | usbh_user_product_string (void *string)
usb host product string user handler More...
static usb_sts_type | usbh_user_serial_string (void *string)
usb host serial string user handler More...
static usb_sts_type | usbh_user_enumeration_done (void)
usb host enumeration done user handler More...
static usb_sts_type | usbh_user_application (void)
static usb_sts_type | usbh_user_active_vbus (void *uhost, confirm_state state)
usb host active vbus user handler More...
static usb_sts_type | usbh_user_not_support (void)
usb host not support user handler More...

Variables

usbh_user_handler_type | usbh_user_handle
FIL | file
usb host application user handler More...
FATFS | fs

Detailed Description

usb user function

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file msc_only_fat32/src/usbh_user.c.


AT32F415 Firmwary Library: usbh_msc_diskio.c File Reference

  • usb_host
  • msc_only_fat32
  • src
Macros | Functions | Variables
usbh_msc_diskio.c File Reference

usb mass storage disk io More...

#include "ff.h"
#include "diskio.h"
#include "usb_core.h"
#include "usbh_msc_class.h"

Go to the source code of this file.

Macros

#define | DEV_RAM 0 /* Example: Map Ramdisk to physical drive 0 */
#define | DEV_MMC 1 /* Example: Map MMC/SD card to physical drive 1 */
#define | DEV_USB 2 /* Example: Map USB MSD to physical drive 2 */

Functions

DSTATUS | disk_status (BYTE pdrv)
DSTATUS | disk_initialize (BYTE pdrv)
DRESULT | disk_read (BYTE pdrv, BYTE *buff, LBA_t sector, UINT count)
DRESULT | disk_write (BYTE pdrv, const BYTE *buff, LBA_t sector, UINT count)
DRESULT | disk_ioctl (BYTE pdrv, BYTE cmd, void *buff)
DWORD | get_fattime (void)

Variables

otg_core_type otg_core_struct

Detailed Description

usb mass storage disk io

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file usbh_msc_diskio.c.


AT32F415 Firmwary Library: run_in_boot_memory.h File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • inc
Functions
run_in_boot_memory.h File Reference

run in boot memory file More...

#include "at32f415.h"

Go to the source code of this file.

Functions

void run_in_boot_memory_test (void)

Detailed Description

run in boot memory file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file run_in_boot_memory.h.


AT32F415 Firmwary Library: run_in_boot_memory.c File Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • src
Functions
run_in_boot_memory.c File Reference

code for run in boot memory More...

#include "at32f415_board.h"
#include "at32f415_clock.h"
#include "run_in_boot_memory.h"
#include "stdio.h"

Go to the source code of this file.

Functions

void run_in_boot_memory_test (void)

Detailed Description

code for run in boot memory

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file run_in_boot_memory.c.


AT32F415 Firmwary Library: FreeRTOSConfig.h File Reference

  • utilities
  • at32f415_freertos_demo
  • inc
Macros
FreeRTOSConfig.h File Reference

Go to the source code of this file.

Macros

#define | configUSE_PREEMPTION 1
#define | configUSE_IDLE_HOOK 0
#define | configUSE_TICK_HOOK 0
#define | configCPU_CLOCK_HZ ( ( unsigned long ) systemcoreclock )
#define | configTICK_RATE_HZ ( ( TickType_t ) 1000 )
#define | configMAX_PRIORITIES ( 5 )
#define | configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 )
#define | configSUPPORT_DYNAMIC_ALLOCATION 1
#define | configTOTAL_HEAP_SIZE ( ( size_t ) ( 8 * 1024 ) )
#define | configMAX_TASK_NAME_LEN ( 16 )
#define | configUSE_16_BIT_TICKS 0
#define | configIDLE_SHOULD_YIELD 1
#define | configUSE_CO_ROUTINES 0
#define | configMAX_CO_ROUTINE_PRIORITIES ( 2 )
#define | INCLUDE_vTaskPrioritySet 1
#define | INCLUDE_uxTaskPriorityGet 1
#define | INCLUDE_vTaskDelete 1
#define | INCLUDE_vTaskCleanUpResources 0
#define | INCLUDE_vTaskSuspend 1
#define | INCLUDE_vTaskDelayUntil 1
#define | INCLUDE_vTaskDelay 1
#define | INCLUDE_xTaskGetCurrentTaskHandle 1
#define | configPRIO_BITS 4 /* 15 priority levels */
#define | configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x0f
#define | configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 0x01
#define | configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
#define | configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
#define | configASSERT(x) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
#define | vPortSVCHandler SVC_Handler
#define | xPortPendSVHandler PendSV_Handler
#define | xPortSysTickHandler SysTick_Handler

Macro Definition Documentation

◆ configASSERT

#define configASSERT ( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }

Definition at line 168 of file FreeRTOSConfig.h.

◆ configCPU_CLOCK_HZ

#define configCPU_CLOCK_HZ ( ( unsigned long ) systemcoreclock )

Definition at line 115 of file FreeRTOSConfig.h.

◆ configIDLE_SHOULD_YIELD

#define configIDLE_SHOULD_YIELD 1

Definition at line 123 of file FreeRTOSConfig.h.

◆ configKERNEL_INTERRUPT_PRIORITY

#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )

Definition at line 161 of file FreeRTOSConfig.h.

◆ configLIBRARY_LOWEST_INTERRUPT_PRIORITY

#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x0f

Definition at line 151 of file FreeRTOSConfig.h.

◆ configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY

#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 0x01

Definition at line 157 of file FreeRTOSConfig.h.

◆ configMAX_CO_ROUTINE_PRIORITIES

#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )

Definition at line 128 of file FreeRTOSConfig.h.

◆ configMAX_PRIORITIES

#define configMAX_PRIORITIES ( 5 )

Definition at line 117 of file FreeRTOSConfig.h.

◆ configMAX_SYSCALL_INTERRUPT_PRIORITY

#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )

Definition at line 164 of file FreeRTOSConfig.h.

◆ configMAX_TASK_NAME_LEN

#define configMAX_TASK_NAME_LEN ( 16 )

Definition at line 121 of file FreeRTOSConfig.h.

◆ configMINIMAL_STACK_SIZE

#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 )

Definition at line 118 of file FreeRTOSConfig.h.

◆ configPRIO_BITS

#define configPRIO_BITS 4 /* 15 priority levels */

Definition at line 146 of file FreeRTOSConfig.h.

◆ configSUPPORT_DYNAMIC_ALLOCATION

#define configSUPPORT_DYNAMIC_ALLOCATION 1

Definition at line 119 of file FreeRTOSConfig.h.

◆ configTICK_RATE_HZ

#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )

Definition at line 116 of file FreeRTOSConfig.h.

◆ configTOTAL_HEAP_SIZE

#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 8 * 1024 ) )

Definition at line 120 of file FreeRTOSConfig.h.

◆ configUSE_16_BIT_TICKS

#define configUSE_16_BIT_TICKS 0

Definition at line 122 of file FreeRTOSConfig.h.

◆ configUSE_CO_ROUTINES

#define configUSE_CO_ROUTINES 0

Definition at line 127 of file FreeRTOSConfig.h.

◆ configUSE_IDLE_HOOK

#define configUSE_IDLE_HOOK 0

Definition at line 113 of file FreeRTOSConfig.h.

◆ configUSE_PREEMPTION

#define configUSE_PREEMPTION 1

Definition at line 112 of file FreeRTOSConfig.h.

◆ configUSE_TICK_HOOK

#define configUSE_TICK_HOOK 0

Definition at line 114 of file FreeRTOSConfig.h.

◆ INCLUDE_uxTaskPriorityGet

#define INCLUDE_uxTaskPriorityGet 1

Definition at line 134 of file FreeRTOSConfig.h.

◆ INCLUDE_vTaskCleanUpResources

#define INCLUDE_vTaskCleanUpResources 0

Definition at line 136 of file FreeRTOSConfig.h.

◆ INCLUDE_vTaskDelay

#define INCLUDE_vTaskDelay 1

Definition at line 139 of file FreeRTOSConfig.h.

◆ INCLUDE_vTaskDelayUntil

#define INCLUDE_vTaskDelayUntil 1

Definition at line 138 of file FreeRTOSConfig.h.

◆ INCLUDE_vTaskDelete

#define INCLUDE_vTaskDelete 1

Definition at line 135 of file FreeRTOSConfig.h.

◆ INCLUDE_vTaskPrioritySet

#define INCLUDE_vTaskPrioritySet 1

Definition at line 133 of file FreeRTOSConfig.h.

◆ INCLUDE_vTaskSuspend

#define INCLUDE_vTaskSuspend 1

Definition at line 137 of file FreeRTOSConfig.h.

◆ INCLUDE_xTaskGetCurrentTaskHandle

#define INCLUDE_xTaskGetCurrentTaskHandle 1

Definition at line 140 of file FreeRTOSConfig.h.

◆ vPortSVCHandler

#define vPortSVCHandler SVC_Handler

Definition at line 172 of file FreeRTOSConfig.h.

◆ xPortPendSVHandler

#define xPortPendSVHandler PendSV_Handler

Definition at line 173 of file FreeRTOSConfig.h.

◆ xPortSysTickHandler

#define xPortSysTickHandler SysTick_Handler

Definition at line 174 of file FreeRTOSConfig.h.


AT32F415 Firmwary Library: random.h File Reference

  • utilities
  • at32f415_gen_random_number_demo
  • inc
Macros | Functions
random.h File Reference

at32f415 random header file More...

#include "at32f415.h"

Go to the source code of this file.

Macros

#define ENABLE_ERTC_ASSEED (1)

Functions

void randnum_test (void)
enable ertc as seed More...

Detailed Description

at32f415 random header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file random.h.


AT32F415 Firmwary Library: random.c File Reference

  • utilities
  • at32f415_gen_random_number_demo
  • src
Macros | Functions | Variables
random.c File Reference

set of firmware functions to random function More...

#include "at32f415_board.h"
#include "random.h"
#include "stdio.h"
#include <stdlib.h>

Go to the source code of this file.

Macros

#define DEVICE_ID_ADDR1 0x1FFFF7E8

Functions

int | get_uid_for_seed (void)
get uid value as seed More...
void | randnum_test (void)
enable ertc as seed More...

Variables

ertc_time_type * time
uint16_t | ertc_clk_div_a = 0
uint16_t | ertc_clk_div_b = 0

Detailed Description

set of firmware functions to random function

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file random.c.


AT32F415 Firmwary Library: fir_filter.h File Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • inc
Functions
project_l0/inc/fir_filter.h File Reference
#include "arm_math.h"

Go to the source code of this file.

Functions

void | arm_fir_init_f32 (arm_fir_instance_f32 *S, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR filter. More...
void | arm_fir_f32 (const arm_fir_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
void | FIR_lowpass_filter (float32_t *pSrc, float32_t *pDst, uint32_t testlengthsamples)

Function Documentation

◆ arm_fir_f32()

void arm_fir_f32 | ( | const arm_fir_instance_f32 * | S,
 |  | const float32_t * | pSrc,
 |  | float32_t * | pDst,
 |  | uint32_t | blockSize
 | ) |  |

Referenced by FIR_lowpass_filter().

◆ arm_fir_init_f32()

void arm_fir_init_f32 | ( | arm_fir_instance_f32 * | S,
 |  | uint16_t | numTaps,
 |  | const float32_t * | pCoeffs,
 |  | float32_t * | pState,
 |  | uint32_t | blockSize
 | ) |  |

Initialization function for the floating-point FIR filter.

File : Step1-ST_Customer_level_n/Inc/fir_filter.h Version: V1.3.0 Date : 2021-03-18 Brief : This file contains the headers of FIR filter IP-Code.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. may be used to endorse or promote products derived from this software without specific prior written permission.

AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Parameters
[in,out] | S | points to an instance of the floating-point FIR filter structure
[in] | numTaps | number of filter coefficients in the filter
[in] | pCoeffs | points to the filter coefficients buffer
[in] | pState | points to the state buffer
[in] | blockSize | number of samples processed per call
Returns
none
Details
pCoeffs points to the array of filter coefficients stored in time reversed order:
    {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]}
pState points to the array of state variables. pState is of length numTaps+blockSize-1 samples, where blockSize is the number of input samples processed by each call to arm_fir_f32().
Initialization of Helium version
For Helium version the array of coefficients must be a multiple of 16 even if less then 16 coefficients are used. The additional coefficients must be set to 0. It does not mean that all the coefficients will be used in the filter (numTaps is still set to its right value in the init function.) It just means that the implementation may require to read more coefficients due to the vectorization and to avoid having to manage too many different cases in the code.

Definition at line 57 of file arm_fir_init_f32.c.

Referenced by FIR_lowpass_filter().

◆ FIR_lowpass_filter()

void FIR_lowpass_filter | ( | float32_t * | pSrc,
 |  | float32_t * | pDst,
 |  | uint32_t | testlengthsamples
 | ) |  |

Definition at line 76 of file fir_filter.c.

Referenced by main().


AT32F415 Firmwary Library: fir_filter.h File Reference

  • utilities
  • at32f415_slib_demo
  • project_l1
  • inc
Functions
project_l1/inc/fir_filter.h File Reference
#include "arm_math.h"

Go to the source code of this file.

Functions

void | arm_fir_init_f32 (arm_fir_instance_f32 *S, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR filter. More...
void | arm_fir_f32 (const arm_fir_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
void | FIR_lowpass_filter (float32_t *pSrc, float32_t *pDst, uint32_t testlengthsamples)

Function Documentation

◆ arm_fir_f32()

void arm_fir_f32 | ( | const arm_fir_instance_f32 * | S,
 |  | const float32_t * | pSrc,
 |  | float32_t * | pDst,
 |  | uint32_t | blockSize
 | ) |  |

◆ arm_fir_init_f32()

void arm_fir_init_f32 | ( | arm_fir_instance_f32 * | S,
 |  | uint16_t | numTaps,
 |  | const float32_t * | pCoeffs,
 |  | float32_t * | pState,
 |  | uint32_t | blockSize
 | ) |  |

Initialization function for the floating-point FIR filter.

File : Step1-ST_Customer_level_n/Inc/fir_filter.h Version: V1.3.0 Date : 2021-03-18 Brief : This file contains the headers of FIR filter IP-Code.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. may be used to endorse or promote products derived from this software without specific prior written permission.

AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Parameters
[in,out] | S | points to an instance of the floating-point FIR filter structure
[in] | numTaps | number of filter coefficients in the filter
[in] | pCoeffs | points to the filter coefficients buffer
[in] | pState | points to the state buffer
[in] | blockSize | number of samples processed per call
Returns
none
Details
pCoeffs points to the array of filter coefficients stored in time reversed order:
    {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]}
pState points to the array of state variables. pState is of length numTaps+blockSize-1 samples, where blockSize is the number of input samples processed by each call to arm_fir_f32().
Initialization of Helium version
For Helium version the array of coefficients must be a multiple of 16 even if less then 16 coefficients are used. The additional coefficients must be set to 0. It does not mean that all the coefficients will be used in the filter (numTaps is still set to its right value in the init function.) It just means that the implementation may require to read more coefficients due to the vectorization and to avoid having to manage too many different cases in the code.

Definition at line 57 of file arm_fir_init_f32.c.

◆ FIR_lowpass_filter()

void FIR_lowpass_filter | ( | float32_t * | pSrc,
 |  | float32_t * | pDst,
 |  | uint32_t | testlengthsamples
 | ) |  |

Definition at line 76 of file fir_filter.c.


AT32F415 Firmwary Library: math_helper.h File Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • inc
Functions
project_l0/inc/math_helper.h File Reference
#include "arm_math.h"

Go to the source code of this file.

Functions

float | arm_snr_f32 (float *pRef, float *pTest, uint32_t buffSize)
Caluclation of SNR. More...
void | arm_float_to_q12_20 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed in q12.20 format. More...
void | arm_provide_guard_bits_q15 (q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer. More...
void | arm_provide_guard_bits_q31 (q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer. More...
void | arm_float_to_q14 (float *pIn, q15_t *pOut, uint32_t numSamples)
Converts float to fixed q14. More...
void | arm_float_to_q29 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format. More...
void | arm_float_to_q28 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q28 format. More...
void | arm_float_to_q30 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format. More...
void | arm_clip_f32 (float *pIn, uint32_t numSamples)
Clip the float values to +/- 1. More...
uint32_t | arm_calc_guard_bits (uint32_t num_adds)
Caluclates number of guard bits. More...
void | arm_apply_guard_bits (float32_t *pIn, uint32_t numSamples, uint32_t guard_bits)
Apply guard bits to buffer. More...
uint32_t | arm_compare_fixed_q15 (q15_t *pIn, q15_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output. More...
uint32_t | arm_compare_fixed_q31 (q31_t *pIn, q31_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output. More...
uint32_t | arm_calc_2pow (uint32_t guard_bits)
Calculates pow(2, numShifts) More...

Function Documentation

◆ arm_apply_guard_bits()

void arm_apply_guard_bits | ( | float32_t * | pIn,
 |  | uint32_t | numSamples,
 |  | uint32_t | guard_bits
 | ) |  |

Apply guard bits to buffer.

Parameters
[in,out] | pIn | pointer to input buffer
[in] | numSamples | number of samples in the input buffer
[in] | guard_bits | guard bits
Returns
none

Definition at line 293 of file project_l0/src/math_helper.c.

◆ arm_calc_2pow()

uint32_t arm_calc_2pow ( uint32_t numShifts )

Calculates pow(2, numShifts)

Parameters
[in] numShifts number of shifts
Returns
pow(2, numShifts)

Definition at line 310 of file project_l0/src/math_helper.c.

◆ arm_calc_guard_bits()

uint32_t arm_calc_guard_bits ( uint32_t num_adds )

Caluclates number of guard bits.

Parameters
[in] num_adds number of additions
Returns
guard bits The function Caluclates the number of guard bits depending on the numtaps

Definition at line 267 of file project_l0/src/math_helper.c.

◆ arm_clip_f32()

void arm_clip_f32 | ( | float * | pIn,
 |  | uint32_t | numSamples
 | ) |  |

Clip the float values to +/- 1.

Parameters
[in,out] | pIn | input buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 445 of file project_l0/src/math_helper.c.

◆ arm_compare_fixed_q15()

uint32_t arm_compare_fixed_q15 | ( | q15_t * | pIn,
 |  | q15_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Compare MATLAB Reference Output and ARM Test output.

Parameters
[in] | pIn | Pointer to Ref buffer
[in] | pOut | Pointer to Test buffer
[in] | numSamples | number of samples in the buffer
Returns
maximum difference

Definition at line 165 of file project_l0/src/math_helper.c.

◆ arm_compare_fixed_q31()

uint32_t arm_compare_fixed_q31 | ( | q31_t * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Compare MATLAB Reference Output and ARM Test output.

Parameters
[in] | pIn | Pointer to Ref buffer
[in] | pOut | Pointer to Test buffer
[in] | numSamples | number of samples in the buffer
Returns
maximum difference

Definition at line 193 of file project_l0/src/math_helper.c.

◆ arm_float_to_q12_20()

void arm_float_to_q12_20 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed in q12.20 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to outputbuffer
[in] | numSamples | number of samples in the input buffer
Returns
none The function converts floating point values to fixed point(q12.20) values

Definition at line 139 of file project_l0/src/math_helper.c.

◆ arm_float_to_q14()

void arm_float_to_q14 | ( | float * | pIn,
 |  | q15_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q14.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 334 of file project_l0/src/math_helper.c.

◆ arm_float_to_q28()

void arm_float_to_q28 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q28 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 419 of file project_l0/src/math_helper.c.

◆ arm_float_to_q29()

void arm_float_to_q29 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q30 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 391 of file project_l0/src/math_helper.c.

◆ arm_float_to_q30()

void arm_float_to_q30 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q30 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 364 of file project_l0/src/math_helper.c.

◆ arm_provide_guard_bits_q15()

void arm_provide_guard_bits_q15 | ( | q15_t * | input_buf,
 |  | uint32_t | blockSize,
 |  | uint32_t | guard_bits
 | ) |  |

Provide guard bits for Input buffer.

Parameters
[in,out] | input_buf | Pointer to input buffer
[in] | blockSize | block Size
[in] | guard_bits | guard bits
Returns
none The function Provides the guard bits for the buffer to avoid overflow

Definition at line 119 of file project_l0/src/math_helper.c.

◆ arm_provide_guard_bits_q31()

void arm_provide_guard_bits_q31 | ( | q31_t * | input_buf,
 |  | uint32_t | blockSize,
 |  | uint32_t | guard_bits
 | ) |  |

Provide guard bits for Input buffer.

Parameters
[in,out] | input_buf | Pointer to input buffer
[in] | blockSize | block Size
[in] | guard_bits | guard bits
Returns
none The function Provides the guard bits for the buffer to avoid overflow

Definition at line 223 of file project_l0/src/math_helper.c.

◆ arm_snr_f32()

float arm_snr_f32 | ( | float * | pRef,
 |  | float * | pTest,
 |  | uint32_t | buffSize
 | ) |  |

Caluclation of SNR.

Parameters
[in] | pRef | Pointer to the reference buffer
[in] | pTest | Pointer to the test buffer
[in] | buffSize | total number of samples
Returns
SNR The function Caluclates signal to noise ratio for the reference output and test output

Definition at line 61 of file project_l0/src/math_helper.c.

Referenced by main().


AT32F415 Firmwary Library: math_helper.h File Reference

  • utilities
  • at32f415_slib_demo
  • project_l1
  • inc
Functions
project_l1/inc/math_helper.h File Reference
#include "arm_math.h"

Go to the source code of this file.

Functions

float | arm_snr_f32 (float *pRef, float *pTest, uint32_t buffSize)
Caluclation of SNR. More...
void | arm_float_to_q12_20 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed in q12.20 format. More...
void | arm_provide_guard_bits_q15 (q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer. More...
void | arm_provide_guard_bits_q31 (q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer. More...
void | arm_float_to_q14 (float *pIn, q15_t *pOut, uint32_t numSamples)
Converts float to fixed q14. More...
void | arm_float_to_q29 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format. More...
void | arm_float_to_q28 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q28 format. More...
void | arm_float_to_q30 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format. More...
void | arm_clip_f32 (float *pIn, uint32_t numSamples)
Clip the float values to +/- 1. More...
uint32_t | arm_calc_guard_bits (uint32_t num_adds)
Caluclates number of guard bits. More...
void | arm_apply_guard_bits (float32_t *pIn, uint32_t numSamples, uint32_t guard_bits)
Apply guard bits to buffer. More...
uint32_t | arm_compare_fixed_q15 (q15_t *pIn, q15_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output. More...
uint32_t | arm_compare_fixed_q31 (q31_t *pIn, q31_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output. More...
uint32_t | arm_calc_2pow (uint32_t guard_bits)
Calculates pow(2, numShifts) More...

Function Documentation

◆ arm_apply_guard_bits()

void arm_apply_guard_bits | ( | float32_t * | pIn,
 |  | uint32_t | numSamples,
 |  | uint32_t | guard_bits
 | ) |  |

Apply guard bits to buffer.

Parameters
[in,out] | pIn | pointer to input buffer
[in] | numSamples | number of samples in the input buffer
[in] | guard_bits | guard bits
Returns
none

Definition at line 293 of file project_l0/src/math_helper.c.

◆ arm_calc_2pow()

uint32_t arm_calc_2pow ( uint32_t numShifts )

Calculates pow(2, numShifts)

Parameters
[in] numShifts number of shifts
Returns
pow(2, numShifts)

Definition at line 310 of file project_l0/src/math_helper.c.

Referenced by arm_apply_guard_bits().

◆ arm_calc_guard_bits()

uint32_t arm_calc_guard_bits ( uint32_t num_adds )

Caluclates number of guard bits.

Parameters
[in] num_adds number of additions
Returns
guard bits The function Caluclates the number of guard bits depending on the numtaps

Definition at line 267 of file project_l0/src/math_helper.c.

◆ arm_clip_f32()

void arm_clip_f32 | ( | float * | pIn,
 |  | uint32_t | numSamples
 | ) |  |

Clip the float values to +/- 1.

Parameters
[in,out] | pIn | input buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 445 of file project_l0/src/math_helper.c.

◆ arm_compare_fixed_q15()

uint32_t arm_compare_fixed_q15 | ( | q15_t * | pIn,
 |  | q15_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Compare MATLAB Reference Output and ARM Test output.

Parameters
[in] | pIn | Pointer to Ref buffer
[in] | pOut | Pointer to Test buffer
[in] | numSamples | number of samples in the buffer
Returns
maximum difference

Definition at line 165 of file project_l0/src/math_helper.c.

◆ arm_compare_fixed_q31()

uint32_t arm_compare_fixed_q31 | ( | q31_t * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Compare MATLAB Reference Output and ARM Test output.

Parameters
[in] | pIn | Pointer to Ref buffer
[in] | pOut | Pointer to Test buffer
[in] | numSamples | number of samples in the buffer
Returns
maximum difference

Definition at line 193 of file project_l0/src/math_helper.c.

◆ arm_float_to_q12_20()

void arm_float_to_q12_20 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed in q12.20 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to outputbuffer
[in] | numSamples | number of samples in the input buffer
Returns
none The function converts floating point values to fixed point(q12.20) values

Definition at line 139 of file project_l0/src/math_helper.c.

◆ arm_float_to_q14()

void arm_float_to_q14 | ( | float * | pIn,
 |  | q15_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q14.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 334 of file project_l0/src/math_helper.c.

◆ arm_float_to_q28()

void arm_float_to_q28 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q28 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 419 of file project_l0/src/math_helper.c.

◆ arm_float_to_q29()

void arm_float_to_q29 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q30 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 391 of file project_l0/src/math_helper.c.

◆ arm_float_to_q30()

void arm_float_to_q30 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q30 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 364 of file project_l0/src/math_helper.c.

◆ arm_provide_guard_bits_q15()

void arm_provide_guard_bits_q15 | ( | q15_t * | input_buf,
 |  | uint32_t | blockSize,
 |  | uint32_t | guard_bits
 | ) |  |

Provide guard bits for Input buffer.

Parameters
[in,out] | input_buf | Pointer to input buffer
[in] | blockSize | block Size
[in] | guard_bits | guard bits
Returns
none The function Provides the guard bits for the buffer to avoid overflow

Definition at line 119 of file project_l0/src/math_helper.c.

◆ arm_provide_guard_bits_q31()

void arm_provide_guard_bits_q31 | ( | q31_t * | input_buf,
 |  | uint32_t | blockSize,
 |  | uint32_t | guard_bits
 | ) |  |

Provide guard bits for Input buffer.

Parameters
[in,out] | input_buf | Pointer to input buffer
[in] | blockSize | block Size
[in] | guard_bits | guard bits
Returns
none The function Provides the guard bits for the buffer to avoid overflow

Definition at line 223 of file project_l0/src/math_helper.c.

◆ arm_snr_f32()

float arm_snr_f32 | ( | float * | pRef,
 |  | float * | pTest,
 |  | uint32_t | buffSize
 | ) |  |

Caluclation of SNR.

Parameters
[in] | pRef | Pointer to the reference buffer
[in] | pTest | Pointer to the test buffer
[in] | buffSize | total number of samples
Returns
SNR The function Caluclates signal to noise ratio for the reference output and test output

Definition at line 61 of file project_l0/src/math_helper.c.


AT32F415 Firmwary Library: arm_fir_data.c File Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
Variables
project_l0/src/arm_fir_data.c File Reference
#include "at32f415.h"
#include "arm_math.h"

Go to the source code of this file.

Variables

float32_t | testInput_f32_1kHz_15kHz [320]
float32_t | refOutput [320]

Variable Documentation

◆ refOutput

float32_t refOutput[320]

Definition at line 96 of file project_l0/src/arm_fir_data.c.

◆ testInput_f32_1kHz_15kHz

float32_t testInput_f32_1kHz_15kHz[320]

Definition at line 48 of file project_l0/src/arm_fir_data.c.


AT32F415 Firmwary Library: arm_fir_data.c File Reference

  • utilities
  • at32f415_slib_demo
  • project_l1
  • src
Variables
project_l1/src/arm_fir_data.c File Reference
#include "at32f415.h"
#include "arm_math.h"

Go to the source code of this file.

Variables

float32_t | testInput_f32_1kHz_15kHz [320]
float32_t | refOutput [320]

Variable Documentation

◆ refOutput

float32_t refOutput[320]

Definition at line 96 of file project_l1/src/arm_fir_data.c.

Referenced by main().

◆ testInput_f32_1kHz_15kHz

float32_t testInput_f32_1kHz_15kHz[320]

Definition at line 48 of file project_l1/src/arm_fir_data.c.

Referenced by main().


AT32F415 Firmwary Library: arm_fir_init_f32.c File Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
Functions
arm_fir_init_f32.c File Reference
#include "arm_math.h"

Go to the source code of this file.

Functions

void arm_fir_init_f32 (arm_fir_instance_f32 *S, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR filter. More...

Function Documentation

◆ arm_fir_init_f32()

void arm_fir_init_f32 | ( | arm_fir_instance_f32 * | S,
 |  | uint16_t | numTaps,
 |  | const float32_t * | pCoeffs,
 |  | float32_t * | pState,
 |  | uint32_t | blockSize
 | ) |  |

Initialization function for the floating-point FIR filter.

Parameters
[in,out] | S | points to an instance of the floating-point FIR filter structure
[in] | numTaps | number of filter coefficients in the filter
[in] | pCoeffs | points to the filter coefficients buffer
[in] | pState | points to the state buffer
[in] | blockSize | number of samples processed per call
Returns
none
Details
pCoeffs points to the array of filter coefficients stored in time reversed order:
    {b[numTaps-1], b[numTaps-2], b[N-2], ..., b[1], b[0]}
pState points to the array of state variables. pState is of length numTaps+blockSize-1 samples, where blockSize is the number of input samples processed by each call to arm_fir_f32().
Initialization of Helium version
For Helium version the array of coefficients must be a multiple of 16 even if less then 16 coefficients are used. The additional coefficients must be set to 0. It does not mean that all the coefficients will be used in the filter (numTaps is still set to its right value in the init function.) It just means that the implementation may require to read more coefficients due to the vectorization and to avoid having to manage too many different cases in the code.

Definition at line 57 of file arm_fir_init_f32.c.

Referenced by FIR_lowpass_filter().


AT32F415 Firmwary Library: fir_coefficient.c File Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
Macros | Variables
fir_coefficient.c File Reference
#include "at32f415.h"
#include "arm_math.h"
#include "fir_filter.h"

Go to the source code of this file.

Macros

#define NUM_TAPS 29

Variables

const float32_t firCoeffs32 [29]

Macro Definition Documentation

◆ NUM_TAPS

#define NUM_TAPS 29

Definition at line 51 of file fir_coefficient.c.

Variable Documentation

◆ firCoeffs32

const float32_t firCoeffs32[29]
Initial value:
= {
-0.0018225230f, -0.0015879294f, +0.0000000000f, +0.0036977508f, +0.0080754303f, +0.0085302217f, -0.0000000000f, -0.0173976984f,
-0.0341458607f, -0.0333591565f, +0.0000000000f, +0.0676308395f, +0.1522061835f, +0.2229246956f, +0.2504960933f, +0.2229246956f,
+0.1522061835f, +0.0676308395f, +0.0000000000f, -0.0333591565f, -0.0341458607f, -0.0173976984f, -0.0000000000f, +0.0085302217f,
+0.0080754303f, +0.0036977508f, +0.0000000000f, -0.0015879294f, -0.0018225230f
}

Definition at line 62 of file fir_coefficient.c.

Referenced by FIR_lowpass_filter().


AT32F415 Firmwary Library: fir_filter.c File Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
Macros | Functions | Variables
fir_filter.c File Reference
#include "at32f415.h"
#include "arm_math.h"
#include "fir_filter.h"

Go to the source code of this file.

Macros

#define | BLOCK_SIZE 32
#define | NUM_TAPS 29

Functions

void FIR_lowpass_filter (float32_t *pSrc, float32_t *pDst, uint32_t testlengthsamples)

Variables

const float32_t | firCoeffs32 []
static float32_t | firStateF32 [32+29 - 1]

Macro Definition Documentation

◆ BLOCK_SIZE

#define BLOCK_SIZE 32

Definition at line 53 of file fir_filter.c.

◆ NUM_TAPS

#define NUM_TAPS 29

Definition at line 54 of file fir_filter.c.

Function Documentation

◆ FIR_lowpass_filter()

void FIR_lowpass_filter | ( | float32_t * | pSrc,
 |  | float32_t * | pDst,
 |  | uint32_t | testlengthsamples
 | ) |  |

Definition at line 76 of file fir_filter.c.

Referenced by main().

Variable Documentation

◆ firCoeffs32

const float32_t firCoeffs32[]
extern

Definition at line 62 of file fir_coefficient.c.

Referenced by FIR_lowpass_filter().

◆ firStateF32

float32_t firStateF32[32+ 29 - 1]
static

Definition at line 66 of file fir_filter.c.

Referenced by FIR_lowpass_filter().


AT32F415 Firmwary Library: math_helper.c File Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
Functions
project_l0/src/math_helper.c File Reference
#include <math.h>
#include "math_helper.h"

Go to the source code of this file.

Functions

float | arm_snr_f32 (float *pRef, float *pTest, uint32_t buffSize)
Caluclation of SNR. More...
void | arm_provide_guard_bits_q15 (q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer. More...
void | arm_float_to_q12_20 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed in q12.20 format. More...
uint32_t | arm_compare_fixed_q15 (q15_t *pIn, q15_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output. More...
uint32_t | arm_compare_fixed_q31 (q31_t *pIn, q31_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output. More...
void | arm_provide_guard_bits_q31 (q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer. More...
void | arm_provide_guard_bits_q7 (q7_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer. More...
uint32_t | arm_calc_guard_bits (uint32_t num_adds)
Caluclates number of guard bits. More...
void | arm_apply_guard_bits (float32_t *pIn, uint32_t numSamples, uint32_t guard_bits)
Apply guard bits to buffer. More...
uint32_t | arm_calc_2pow (uint32_t numShifts)
Calculates pow(2, numShifts) More...
void | arm_float_to_q14 (float *pIn, q15_t *pOut, uint32_t numSamples)
Converts float to fixed q14. More...
void | arm_float_to_q30 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format. More...
void | arm_float_to_q29 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format. More...
void | arm_float_to_q28 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q28 format. More...
void | arm_clip_f32 (float *pIn, uint32_t numSamples)
Clip the float values to +/- 1. More...

Function Documentation

◆ arm_apply_guard_bits()

void arm_apply_guard_bits | ( | float32_t * | pIn,
 |  | uint32_t | numSamples,
 |  | uint32_t | guard_bits
 | ) |  |

Apply guard bits to buffer.

Parameters
[in,out] | pIn | pointer to input buffer
[in] | numSamples | number of samples in the input buffer
[in] | guard_bits | guard bits
Returns
none

Definition at line 293 of file project_l0/src/math_helper.c.

◆ arm_calc_2pow()

uint32_t arm_calc_2pow ( uint32_t numShifts )

Calculates pow(2, numShifts)

Parameters
[in] numShifts number of shifts
Returns
pow(2, numShifts)

Definition at line 310 of file project_l0/src/math_helper.c.

Referenced by arm_apply_guard_bits().

◆ arm_calc_guard_bits()

uint32_t arm_calc_guard_bits ( uint32_t num_adds )

Caluclates number of guard bits.

Parameters
[in] num_adds number of additions
Returns
guard bits The function Caluclates the number of guard bits depending on the numtaps

Definition at line 267 of file project_l0/src/math_helper.c.

◆ arm_clip_f32()

void arm_clip_f32 | ( | float * | pIn,
 |  | uint32_t | numSamples
 | ) |  |

Clip the float values to +/- 1.

Parameters
[in,out] | pIn | input buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 445 of file project_l0/src/math_helper.c.

◆ arm_compare_fixed_q15()

uint32_t arm_compare_fixed_q15 | ( | q15_t * | pIn,
 |  | q15_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Compare MATLAB Reference Output and ARM Test output.

Parameters
[in] | pIn | Pointer to Ref buffer
[in] | pOut | Pointer to Test buffer
[in] | numSamples | number of samples in the buffer
Returns
maximum difference

Definition at line 165 of file project_l0/src/math_helper.c.

◆ arm_compare_fixed_q31()

uint32_t arm_compare_fixed_q31 | ( | q31_t * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Compare MATLAB Reference Output and ARM Test output.

Parameters
[in] | pIn | Pointer to Ref buffer
[in] | pOut | Pointer to Test buffer
[in] | numSamples | number of samples in the buffer
Returns
maximum difference

Definition at line 193 of file project_l0/src/math_helper.c.

◆ arm_float_to_q12_20()

void arm_float_to_q12_20 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed in q12.20 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to outputbuffer
[in] | numSamples | number of samples in the input buffer
Returns
none The function converts floating point values to fixed point(q12.20) values

Definition at line 139 of file project_l0/src/math_helper.c.

◆ arm_float_to_q14()

void arm_float_to_q14 | ( | float * | pIn,
 |  | q15_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q14.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 334 of file project_l0/src/math_helper.c.

◆ arm_float_to_q28()

void arm_float_to_q28 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q28 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 419 of file project_l0/src/math_helper.c.

◆ arm_float_to_q29()

void arm_float_to_q29 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q30 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 391 of file project_l0/src/math_helper.c.

◆ arm_float_to_q30()

void arm_float_to_q30 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q30 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 364 of file project_l0/src/math_helper.c.

◆ arm_provide_guard_bits_q15()

void arm_provide_guard_bits_q15 | ( | q15_t * | input_buf,
 |  | uint32_t | blockSize,
 |  | uint32_t | guard_bits
 | ) |  |

Provide guard bits for Input buffer.

Parameters
[in,out] | input_buf | Pointer to input buffer
[in] | blockSize | block Size
[in] | guard_bits | guard bits
Returns
none The function Provides the guard bits for the buffer to avoid overflow

Definition at line 119 of file project_l0/src/math_helper.c.

◆ arm_provide_guard_bits_q31()

void arm_provide_guard_bits_q31 | ( | q31_t * | input_buf,
 |  | uint32_t | blockSize,
 |  | uint32_t | guard_bits
 | ) |  |

Provide guard bits for Input buffer.

Parameters
[in,out] | input_buf | Pointer to input buffer
[in] | blockSize | block Size
[in] | guard_bits | guard bits
Returns
none The function Provides the guard bits for the buffer to avoid overflow

Definition at line 223 of file project_l0/src/math_helper.c.

◆ arm_provide_guard_bits_q7()

void arm_provide_guard_bits_q7 | ( | q7_t * | input_buf,
 |  | uint32_t | blockSize,
 |  | uint32_t | guard_bits
 | ) |  |

Provide guard bits for Input buffer.

Parameters
[in,out] | input_buf | Pointer to input buffer
[in] | blockSize | block Size
[in] | guard_bits | guard bits
Returns
none The function Provides the guard bits for the buffer to avoid overflow

Definition at line 245 of file project_l0/src/math_helper.c.

◆ arm_snr_f32()

float arm_snr_f32 | ( | float * | pRef,
 |  | float * | pTest,
 |  | uint32_t | buffSize
 | ) |  |

Caluclation of SNR.

Parameters
[in] | pRef | Pointer to the reference buffer
[in] | pTest | Pointer to the test buffer
[in] | buffSize | total number of samples
Returns
SNR The function Caluclates signal to noise ratio for the reference output and test output

Definition at line 61 of file project_l0/src/math_helper.c.


AT32F415 Firmwary Library: math_helper.c File Reference

  • utilities
  • at32f415_slib_demo
  • project_l1
  • src
Functions
project_l1/src/math_helper.c File Reference
#include <math.h>
#include "math_helper.h"

Go to the source code of this file.

Functions

float | arm_snr_f32 (float *pRef, float *pTest, uint32_t buffSize)
Caluclation of SNR. More...
void | arm_provide_guard_bits_q15 (q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer. More...
void | arm_float_to_q12_20 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed in q12.20 format. More...
uint32_t | arm_compare_fixed_q15 (q15_t *pIn, q15_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output. More...
uint32_t | arm_compare_fixed_q31 (q31_t *pIn, q31_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output. More...
void | arm_provide_guard_bits_q31 (q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer. More...
void | arm_provide_guard_bits_q7 (q7_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer. More...
uint32_t | arm_calc_guard_bits (uint32_t num_adds)
Caluclates number of guard bits. More...
void | arm_apply_guard_bits (float32_t *pIn, uint32_t numSamples, uint32_t guard_bits)
Apply guard bits to buffer. More...
uint32_t | arm_calc_2pow (uint32_t numShifts)
Calculates pow(2, numShifts) More...
void | arm_float_to_q14 (float *pIn, q15_t *pOut, uint32_t numSamples)
Converts float to fixed q14. More...
void | arm_float_to_q30 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format. More...
void | arm_float_to_q29 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format. More...
void | arm_float_to_q28 (float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q28 format. More...
void | arm_clip_f32 (float *pIn, uint32_t numSamples)
Clip the float values to +/- 1. More...

Function Documentation

◆ arm_apply_guard_bits()

void arm_apply_guard_bits | ( | float32_t * | pIn,
 |  | uint32_t | numSamples,
 |  | uint32_t | guard_bits
 | ) |  |

Apply guard bits to buffer.

Parameters
[in,out] | pIn | pointer to input buffer
[in] | numSamples | number of samples in the input buffer
[in] | guard_bits | guard bits
Returns
none

Definition at line 293 of file project_l1/src/math_helper.c.

◆ arm_calc_2pow()

uint32_t arm_calc_2pow ( uint32_t numShifts )

Calculates pow(2, numShifts)

Parameters
[in] numShifts number of shifts
Returns
pow(2, numShifts)

Definition at line 310 of file project_l1/src/math_helper.c.

Referenced by arm_apply_guard_bits().

◆ arm_calc_guard_bits()

uint32_t arm_calc_guard_bits ( uint32_t num_adds )

Caluclates number of guard bits.

Parameters
[in] num_adds number of additions
Returns
guard bits The function Caluclates the number of guard bits depending on the numtaps

Definition at line 267 of file project_l1/src/math_helper.c.

◆ arm_clip_f32()

void arm_clip_f32 | ( | float * | pIn,
 |  | uint32_t | numSamples
 | ) |  |

Clip the float values to +/- 1.

Parameters
[in,out] | pIn | input buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 445 of file project_l1/src/math_helper.c.

◆ arm_compare_fixed_q15()

uint32_t arm_compare_fixed_q15 | ( | q15_t * | pIn,
 |  | q15_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Compare MATLAB Reference Output and ARM Test output.

Parameters
[in] | pIn | Pointer to Ref buffer
[in] | pOut | Pointer to Test buffer
[in] | numSamples | number of samples in the buffer
Returns
maximum difference

Definition at line 165 of file project_l1/src/math_helper.c.

◆ arm_compare_fixed_q31()

uint32_t arm_compare_fixed_q31 | ( | q31_t * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Compare MATLAB Reference Output and ARM Test output.

Parameters
[in] | pIn | Pointer to Ref buffer
[in] | pOut | Pointer to Test buffer
[in] | numSamples | number of samples in the buffer
Returns
maximum difference

Definition at line 193 of file project_l1/src/math_helper.c.

◆ arm_float_to_q12_20()

void arm_float_to_q12_20 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed in q12.20 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to outputbuffer
[in] | numSamples | number of samples in the input buffer
Returns
none The function converts floating point values to fixed point(q12.20) values

Definition at line 139 of file project_l1/src/math_helper.c.

◆ arm_float_to_q14()

void arm_float_to_q14 | ( | float * | pIn,
 |  | q15_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q14.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 334 of file project_l1/src/math_helper.c.

◆ arm_float_to_q28()

void arm_float_to_q28 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q28 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 419 of file project_l1/src/math_helper.c.

◆ arm_float_to_q29()

void arm_float_to_q29 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q30 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 391 of file project_l1/src/math_helper.c.

◆ arm_float_to_q30()

void arm_float_to_q30 | ( | float * | pIn,
 |  | q31_t * | pOut,
 |  | uint32_t | numSamples
 | ) |  |

Converts float to fixed q30 format.

Parameters
[in] | pIn | pointer to input buffer
[out] | pOut | pointer to output buffer
[in] | numSamples | number of samples in the buffer
Returns
none The function converts floating point values to fixed point values

Definition at line 364 of file project_l1/src/math_helper.c.

◆ arm_provide_guard_bits_q15()

void arm_provide_guard_bits_q15 | ( | q15_t * | input_buf,
 |  | uint32_t | blockSize,
 |  | uint32_t | guard_bits
 | ) |  |

Provide guard bits for Input buffer.

Parameters
[in,out] | input_buf | Pointer to input buffer
[in] | blockSize | block Size
[in] | guard_bits | guard bits
Returns
none The function Provides the guard bits for the buffer to avoid overflow

Definition at line 119 of file project_l1/src/math_helper.c.

◆ arm_provide_guard_bits_q31()

void arm_provide_guard_bits_q31 | ( | q31_t * | input_buf,
 |  | uint32_t | blockSize,
 |  | uint32_t | guard_bits
 | ) |  |

Provide guard bits for Input buffer.

Parameters
[in,out] | input_buf | Pointer to input buffer
[in] | blockSize | block Size
[in] | guard_bits | guard bits
Returns
none The function Provides the guard bits for the buffer to avoid overflow

Definition at line 223 of file project_l1/src/math_helper.c.

◆ arm_provide_guard_bits_q7()

void arm_provide_guard_bits_q7 | ( | q7_t * | input_buf,
 |  | uint32_t | blockSize,
 |  | uint32_t | guard_bits
 | ) |  |

Provide guard bits for Input buffer.

Parameters
[in,out] | input_buf | Pointer to input buffer
[in] | blockSize | block Size
[in] | guard_bits | guard bits
Returns
none The function Provides the guard bits for the buffer to avoid overflow

Definition at line 245 of file project_l1/src/math_helper.c.

◆ arm_snr_f32()

float arm_snr_f32 | ( | float * | pRef,
 |  | float * | pTest,
 |  | uint32_t | buffSize
 | ) |  |

Caluclation of SNR.

Parameters
[in] | pRef | Pointer to the reference buffer
[in] | pTest | Pointer to the test buffer
[in] | buffSize | total number of samples
Returns
SNR The function Caluclates signal to noise ratio for the reference output and test output

Definition at line 61 of file project_l1/src/math_helper.c.

Referenced by main().


AT32F415 Firmwary Library: iap.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • inc
Macros | Functions
app_led3_toggle/inc/iap.h File Reference

iap header file More...

#include "at32f415_board.h"

Go to the source code of this file.

Macros

#define | APP_START_ADDR 0x08004000
#define | IAP_UPGRADE_FLAG_ADDR (APP_START_ADDR - 0x800)
#define | IAP_UPGRADE_FLAG 0x41544B38

Functions

void | iap_command_handle (void)
iap command handle handle. More...
void | iap_init (void)
iap init. More...

Detailed Description

iap header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led3_toggle/inc/iap.h.


AT32F415 Firmwary Library: iap.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • inc
Macros | Functions
app_led4_toggle/inc/iap.h File Reference

iap header file More...

#include "at32f415_board.h"

Go to the source code of this file.

Macros

#define | APP_START_ADDR 0x08004000
#define | IAP_UPGRADE_FLAG_ADDR (APP_START_ADDR - 0x800)
#define | IAP_UPGRADE_FLAG 0x41544B38

Functions

void | iap_command_handle (void)
iap command handle handle. More...
void | iap_init (void)
iap init. More...

Detailed Description

iap header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led4_toggle/inc/iap.h.


AT32F415 Firmwary Library: iap.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
bootloader/inc/iap.h File Reference

iap header file More...

#include "at32f415_board.h"

Go to the source code of this file.

Data Structures

struct cmd_data_group_type
cmd data group type More...

Macros

#define | APP_START_ADDR 0x08004000
#define | IAP_UPGRADE_FLAG_ADDR (APP_START_ADDR - 0x800)
#define | IAP_UPGRADE_FLAG 0x41544B38

Typedefs

typedef void(* iapfun) (void)

Enumerations

enum cmd_data_step_type {
CMD_DATA_IDLE , CMD_DATA_ADDR , CMD_DATA_BUF , CMD_DATA_CHACK ,
CMD_DATA_DONE , CMD_DATA_ERR
}
cmd data step type More...
enum cmd_ctr_step_type {
CMD_CTR_IDLE , CMD_CTR_INIT , CMD_CTR_DONE , CMD_CTR_ERR ,
CMD_CTR_APP
}
cmd ctr step type More...
enum update_status_type { UPDATE_PRE , UPDATE_CLEAR_FLAG , UPDATE_ING , UPDATE_DONE }
update status type More...

Functions

void | command_handle (void)
command analysis handle. More...
void | back_err (void)
command response error. More...
void | back_ok (void)
command response ok. More...
void | iap_upgrade_app_handle (void)
iap upgrade app handle. More...
void | app_load (uint32_t appxaddr)
app load. More...

Variables

cmd_data_group_type cmd_data_group_type_struct
cmd_data_step_type cmd_data_step
cmd_ctr_step_type cmd_ctr_step
update_status_type update_status

Detailed Description

iap header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file bootloader/inc/iap.h.


AT32F415 Firmwary Library: tmr.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • inc
Functions
app_led3_toggle/inc/tmr.h File Reference

tmr header file More...

#include "at32f415_board.h"

Go to the source code of this file.

Functions

void tmr_init (void)
init tmr. More...

Detailed Description

tmr header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led3_toggle/inc/tmr.h.


AT32F415 Firmwary Library: tmr.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • inc
Functions
app_led4_toggle/inc/tmr.h File Reference

tmr header file More...

#include "at32f415_board.h"

Go to the source code of this file.

Functions

void tmr_init (void)
init tmr. More...

Detailed Description

tmr header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led4_toggle/inc/tmr.h.


AT32F415 Firmwary Library: tmr.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
Functions | Variables
bootloader/inc/tmr.h File Reference

tmr header file More...

#include "at32f415_board.h"

Go to the source code of this file.

Functions

void tmr_init (void)
init tmr. More...

Variables

uint8_t | time_ira_cnt
uint8_t | get_data_from_usart_flag

Detailed Description

tmr header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file bootloader/inc/tmr.h.


AT32F415 Firmwary Library: usart.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • inc
Macros | Functions | Variables
app_led3_toggle/inc/usart.h File Reference

usart header file More...

#include "at32f415_board.h"

Go to the source code of this file.

Macros

#define | IAP_REV_FLAG_NO 0
#define | IAP_REV_FLAG_5A 1
#define | IAP_REV_FLAG_DONE 2
#define | IAP_REV_FLAG_ERROR 3

Functions

void | uart_init (uint32_t baudrate)
init usart. More...
void | back_ok (void)
command response ok. More...
void | back_err (void)
command response error. More...

Variables

uint8_t iap_flag

Detailed Description

usart header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led3_toggle/inc/usart.h.


AT32F415 Firmwary Library: usart.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • inc
Macros | Functions | Variables
app_led4_toggle/inc/usart.h File Reference

usart header file More...

#include "at32f415_board.h"

Go to the source code of this file.

Macros

#define | IAP_REV_FLAG_NO 0
#define | IAP_REV_FLAG_5A 1
#define | IAP_REV_FLAG_DONE 2
#define | IAP_REV_FLAG_ERROR 3

Functions

void | uart_init (uint32_t baudrate)
init usart. More...
void | back_ok (void)
command response ok. More...
void | back_err (void)
command response error. More...

Variables

uint8_t iap_flag

Detailed Description

usart header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led4_toggle/inc/usart.h.


AT32F415 Firmwary Library: usart.h File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
Data Structures | Macros | Functions | Variables
bootloader/inc/usart.h File Reference

usart header file More...

#include "at32f415_board.h"

Go to the source code of this file.

Data Structures

struct usart_group_type
usart group type More...

Macros

#define USART_REC_LEN 1024

Functions

void uart_init (uint32_t baudrate)
init usart. More...

Variables

usart_group_type usart_group_struct

Detailed Description

usart header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file bootloader/inc/usart.h.


AT32F415 Firmwary Library: iap.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • src
Functions
app_led3_toggle/src/iap.c File Reference

iap program More...

#include "iap.h"
#include "usart.h"
#include "tmr.h"

Go to the source code of this file.

Functions

void | iap_command_handle (void)
iap command handle handle. More...
void | iap_init (void)
iap init. More...

Detailed Description

iap program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led3_toggle/src/iap.c.


AT32F415 Firmwary Library: iap.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • src
Functions
app_led4_toggle/src/iap.c File Reference

iap program More...

#include "iap.h"
#include "usart.h"
#include "tmr.h"

Go to the source code of this file.

Functions

void | iap_command_handle (void)
iap command handle handle. More...
void | iap_init (void)
iap init. More...

Detailed Description

iap program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led4_toggle/src/iap.c.


AT32F415 Firmwary Library: iap.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
Functions | Variables
bootloader/src/iap.c File Reference

iap program More...

#include "iap.h"
#include "usart.h"
#include "flash.h"
#include "tmr.h"

Go to the source code of this file.

Functions

void | app_load (uint32_t app_addr)
app load. More...
uint8_t | data_take (void)
take data from usart buf. More...
void | command_handle (void)
command analysis handle. More...
void | back_ok (void)
command response ok. More...
void | back_err (void)
command response error. More...
void | app_update_handle (void)
app update flow handle. More...
void | iap_upgrade_app_handle (void)
iap upgrade app handle. More...

Variables

cmd_data_step_type cmd_data_step = CMD_DATA_IDLE
cmd_ctr_step_type cmd_ctr_step = CMD_CTR_IDLE
cmd_data_group_type cmd_data_group_struct
update_status_type update_status = UPDATE_PRE
static uint8_t | cmd_addr_cnt = 0
static uint32_t | cmd_data_cnt = 0
iapfun jump_to_app
jump to app More...

Detailed Description

iap program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file bootloader/src/iap.c.


AT32F415 Firmwary Library: tmr.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • src
Functions
app_led3_toggle/src/tmr.c File Reference

tmr program More...

#include "at32f415_board.h"
#include "tmr.h"
#include "iap.h"

Go to the source code of this file.

Functions

void | tmr_init (void)
init tmr. More...
void | TMR3_GLOBAL_IRQHandler (void)
tmr3 global interrupt handler. More...

Detailed Description

tmr program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led3_toggle/src/tmr.c.


AT32F415 Firmwary Library: tmr.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • src
Functions
app_led4_toggle/src/tmr.c File Reference

tmr program More...

#include "at32f415_board.h"
#include "tmr.h"
#include "iap.h"

Go to the source code of this file.

Functions

void | tmr_init (void)
init tmr. More...
void | TMR3_GLOBAL_IRQHandler (void)
tmr3 global interrupt handler. More...

Detailed Description

tmr program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led4_toggle/src/tmr.c.


AT32F415 Firmwary Library: tmr.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
Functions | Variables
bootloader/src/tmr.c File Reference

tmr program More...

#include "at32f415_board.h"
#include "tmr.h"
#include "iap.h"

Go to the source code of this file.

Functions

void | tmr_init (void)
init tmr. More...
void | TMR3_GLOBAL_IRQHandler (void)
tmr3 global interrupt handler. More...

Variables

uint8_t | time_ira_cnt =0
uint8_t | get_data_from_usart_flag = 0

Detailed Description

tmr program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file bootloader/src/tmr.c.


AT32F415 Firmwary Library: usart.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • src
Functions | Variables
app_led3_toggle/src/usart.c File Reference

usart program More...

#include "usart.h"
#include "tmr.h"

Go to the source code of this file.

Functions

void | uart_init (uint32_t baudrate)
init usart. More...
void | USART1_IRQHandler (void)
usart1 interrupt handler. More...
void | back_ok (void)
command response ok. More...
void | back_err (void)
command response error. More...

Variables

uint8_t iap_flag = IAP_REV_FLAG_NO

Detailed Description

usart program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led3_toggle/src/usart.c.


AT32F415 Firmwary Library: usart.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • src
Functions | Variables
app_led4_toggle/src/usart.c File Reference

usart program More...

#include "usart.h"
#include "tmr.h"

Go to the source code of this file.

Functions

void | uart_init (uint32_t baudrate)
init usart. More...
void | USART1_IRQHandler (void)
usart1 interrupt handler. More...
void | back_ok (void)
command response ok. More...
void | back_err (void)
command response error. More...

Variables

uint8_t iap_flag = IAP_REV_FLAG_NO

Detailed Description

usart program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led4_toggle/src/usart.c.


AT32F415 Firmwary Library: usart.c File Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
Functions | Variables
bootloader/src/usart.c File Reference

usart program More...

#include "usart.h"
#include "tmr.h"

Go to the source code of this file.

Functions

void | uart_init (uint32_t baudrate)
init usart. More...
void | USART1_IRQHandler (void)
usart1 interrupt handler. More...

Variables

usart_group_type usart_group_struct

Detailed Description

usart program

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file bootloader/src/usart.c.


AT32F415 Firmwary Library: hid_iap_user.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • inc
Macros | Functions
app_led3_toggle/inc/hid_iap_user.h File Reference

usb config header file More...

#include "hid_iap_class.h"

Go to the source code of this file.

Macros

#define FLASH_APP_ADDRESS 0x08005000

Functions

void | iap_init (void)
iap init. More...
iap_result_type | iap_get_upgrade_flag (void)
get iap upgrade complete flag More...
void | app_loop (void)
iap loop More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led3_toggle/inc/hid_iap_user.h.


AT32F415 Firmwary Library: hid_iap_user.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • inc
Macros | Functions
app_led4_toggle/inc/hid_iap_user.h File Reference

usb config header file More...

#include "hid_iap_class.h"

Go to the source code of this file.

Macros

#define FLASH_APP_ADDRESS 0x08005000

Functions

void | iap_init (void)
iap init. More...
iap_result_type | iap_get_upgrade_flag (void)
get iap upgrade complete flag More...
void | app_loop (void)
iap loop More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led4_toggle/inc/hid_iap_user.h.


AT32F415 Firmwary Library: hid_iap_user.h File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • inc
Macros | Functions
bootloader/inc/hid_iap_user.h File Reference

usb config header file More...

#include "hid_iap_class.h"

Go to the source code of this file.

Macros

#define FLASH_APP_ADDRESS 0x08005000

Functions

void | iap_init (void)
iap init. More...
iap_result_type | iap_get_upgrade_flag (void)
get iap upgrade complete flag More...
void | iap_loop (void)
iap loop More...
void | jump_to_app (uint32_t address)
jump to app More...

Detailed Description

usb config header file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file bootloader/inc/hid_iap_user.h.


AT32F415 Firmwary Library: hid_iap_user.c File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • src
Functions | Variables
app_led3_toggle/src/hid_iap_user.c File Reference

usb hid iap user file More...

#include "hid_iap_user.h"
#include "hid_iap_class.h"
#include "string.h"

Go to the source code of this file.

Functions

void | iap_clear_upgrade_flag (void)
clear iap upgrade flag More...
void | iap_set_upgrade_flag (void)
set iap upgrade complete flag More...
uint32_t | crc_cal (uint32_t addr, uint16_t nk)
crc cal More...
void | iap_idle (void)
iap idle function More...
void | iap_start (void)
iap start function More...
void | iap_finish (void)
void | iap_jump (void)
void | iap_respond (uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
iap_result_type | iap_get_upgrade_flag (void)
get iap upgrade complete flag More...
void | iap_init (void)
iap init More...
void | iap_get ()
iap_result_type | usbd_hid_iap_process (void *udev, uint8_t *pdata, uint16_t len)
usb device iap function More...
void | usbd_hid_iap_in_complete (void *udev)
usb device in transfer complete function More...
void | app_loop (void)
iap loop More...

Variables

void(* pftarget )(void)

Detailed Description

usb hid iap user file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led3_toggle/src/hid_iap_user.c.


AT32F415 Firmwary Library: hid_iap_user.c File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • src
Functions | Variables
app_led4_toggle/src/hid_iap_user.c File Reference

usb hid iap user file More...

#include "hid_iap_user.h"
#include "hid_iap_class.h"
#include "string.h"

Go to the source code of this file.

Functions

void | iap_clear_upgrade_flag (void)
clear iap upgrade flag More...
void | iap_set_upgrade_flag (void)
set iap upgrade complete flag More...
uint32_t | crc_cal (uint32_t addr, uint16_t nk)
crc cal More...
void | iap_idle (void)
iap idle function More...
void | iap_start (void)
iap start function More...
void | iap_finish (void)
void | iap_jump (void)
void | iap_respond (uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
iap_result_type | iap_get_upgrade_flag (void)
get iap upgrade complete flag More...
void | iap_init (void)
iap init More...
void | iap_get ()
iap_result_type | usbd_hid_iap_process (void *udev, uint8_t *pdata, uint16_t len)
usb device iap function More...
void | usbd_hid_iap_in_complete (void *udev)
usb device in transfer complete function More...
void | app_loop (void)
iap loop More...

Variables

void(* pftarget )(void)

Detailed Description

usb hid iap user file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file app_led4_toggle/src/hid_iap_user.c.


AT32F415 Firmwary Library: hid_iap_user.c File Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • src
Functions | Variables
bootloader/src/hid_iap_user.c File Reference

usb hid iap user file More...

#include "hid_iap_user.h"
#include "hid_iap_class.h"
#include "string.h"

Go to the source code of this file.

Functions

void | iap_clear_upgrade_flag (void)
clear iap upgrade flag More...
void | iap_set_upgrade_flag (void)
set iap upgrade complete flag More...
uint32_t | crc_cal (uint32_t addr, uint16_t nk)
crc cal More...
void | iap_idle (void)
iap idle function More...
void | iap_start (void)
iap start function More...
iap_result_type | iap_address (uint8_t *pdata, uint32_t len)
iap parse address More...
void | iap_finish (void)
iap_result_type | iap_data_write (uint8_t *pdata, uint32_t len)
void | iap_jump (void)
void | iap_respond (uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
void | jump_to_app (uint32_t address)
jump to app More...
iap_result_type | iap_get_upgrade_flag (void)
get iap upgrade complete flag More...
void | iap_erase_sector (uint32_t address)
set iap upgrade complete flag More...
void | iap_init (void)
iap init More...
void | iap_crc (uint8_t *pdata, uint32_t len)
void | iap_get ()
iap_result_type | usbd_hid_iap_process (void *udev, uint8_t *pdata, uint16_t len)
usb device iap function More...
void | usbd_hid_iap_in_complete (void *udev)
usb device in transfer complete function More...
void | iap_loop (void)
iap loop More...

Variables

void(* pftarget )(void)

Detailed Description

usb hid iap user file

Version
v2.0.2
Date
2021-12-31
                  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.

Definition in file bootloader/src/hid_iap_user.c.


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- _ -

  • __align() : sd_mmc_card/src/at32_sdio.c, diskio.c
  • __AT32F415_LIBRARY_VERSION : at32f415.h
  • __AT32F415_LIBRARY_VERSION_MAJOR : at32f415.h
  • __AT32F415_LIBRARY_VERSION_MIDDLE : at32f415.h
  • __AT32F415_LIBRARY_VERSION_MINOR : at32f415.h
  • __AT32F415_LIBRARY_VERSION_RC : at32f415.h
  • __CM4_REV : at32f415.h
  • __FPU_PRESENT : at32f415.h
  • __MPU_PRESENT : at32f415.h
  • __NVIC_PRIO_BITS : at32f415.h
  • __Vendor_SysTickConfig : at32f415.h
  • _asciimap : cdc_keyboard_class.c, keyboard_class.c


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- a -

  • ADC1 : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_SOFTWARE : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR1CH1 : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR1CH2 : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR1CH3 : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR1TRGOUT : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR2CH2 : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR3TRGOUT : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR4CH4 : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4 : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_SOFTWARE : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR1CH1 : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR1CH4 : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR1TRGOUT : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR2CH1 : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR2TRGOUT : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR3CH4 : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR4TRGOUT : at32f415_adc.h
  • ADC1_BASE : at32f415.h
  • ADC1_ETO_GMUX : at32f415_gpio.h
  • ADC1_ETO_MUX : at32f415_gpio.h
  • ADC1_ETP_GMUX : at32f415_gpio.h
  • ADC1_ETP_MUX : at32f415_gpio.h
  • ADC1_IRQHandler() : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c
  • ADC1_IRQn : at32f415.h
  • adc1_ordinary_value : project/at_start_f415/examples/adc/current_vref_value_check/src/main.c, project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c
  • adc1_ordinary_valuetab : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/src/main.c
  • adc1_preempt_valuetab : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c
  • adc_base_config() : at32f415_adc.h, at32f415_adc.c
  • adc_base_default_para_init() : at32f415_adc.h, at32f415_adc.c
  • adc_calibration_init() : at32f415_adc.h, at32f415_adc.c
  • adc_calibration_init_status_get() : at32f415_adc.h, at32f415_adc.c
  • adc_calibration_start() : at32f415_adc.h, at32f415_adc.c
  • adc_calibration_status_get() : at32f415_adc.h, at32f415_adc.c
  • ADC_CCE_FLAG : at32f415_adc.h
  • ADC_CCE_INT : at32f415_adc.h
  • ADC_CHANNEL_0 : at32f415_adc.h
  • ADC_CHANNEL_1 : at32f415_adc.h
  • ADC_CHANNEL_10 : at32f415_adc.h
  • ADC_CHANNEL_11 : at32f415_adc.h
  • ADC_CHANNEL_12 : at32f415_adc.h
  • ADC_CHANNEL_13 : at32f415_adc.h
  • ADC_CHANNEL_14 : at32f415_adc.h
  • ADC_CHANNEL_15 : at32f415_adc.h
  • ADC_CHANNEL_16 : at32f415_adc.h
  • ADC_CHANNEL_17 : at32f415_adc.h
  • ADC_CHANNEL_2 : at32f415_adc.h
  • ADC_CHANNEL_3 : at32f415_adc.h
  • ADC_CHANNEL_4 : at32f415_adc.h
  • ADC_CHANNEL_5 : at32f415_adc.h
  • ADC_CHANNEL_6 : at32f415_adc.h
  • ADC_CHANNEL_7 : at32f415_adc.h
  • ADC_CHANNEL_8 : at32f415_adc.h
  • ADC_CHANNEL_9 : at32f415_adc.h
  • adc_channel_select_type : at32f415_adc.h
  • adc_combine_mode_select() : at32f415_adc.h, at32f415_adc.c
  • adc_combine_mode_type : at32f415_adc.h
  • adc_combine_ordinary_conversion_data_get() : at32f415_adc.h, at32f415_adc.c
  • adc_config() : project/at_start_f415/examples/adc/current_vref_value_check/src/main.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c, project/at_start_f415/examples/adc/voltage_monitoring/src/main.c
  • adc_data_align_type : at32f415_adc.h
  • adc_dma_mode_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_flag_clear() : at32f415_adc.h, at32f415_adc.c
  • adc_flag_get() : at32f415_adc.h, at32f415_adc.c
  • ADC_INDEPENDENT_MODE : at32f415_adc.h
  • adc_interrupt_enable() : at32f415_adc.h, at32f415_adc.c
  • ADC_LEFT_ALIGNMENT : at32f415_adc.h
  • ADC_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • ADC_OCCS_FLAG : at32f415_adc.h
  • adc_ordinary_channel_set() : at32f415_adc.h, at32f415_adc.c
  • adc_ordinary_conversion_data_get() : at32f415_adc.h, at32f415_adc.c
  • adc_ordinary_conversion_trigger_set() : at32f415_adc.h, at32f415_adc.c
  • ADC_ORDINARY_LONGSHIFT_ONLY_MODE : at32f415_adc.h
  • ADC_ORDINARY_LONGSHIFT_PREEMPT_SMLT_MODE : at32f415_adc.h
  • adc_ordinary_part_count_set() : at32f415_adc.h, at32f415_adc.c
  • adc_ordinary_part_mode_enable() : at32f415_adc.h, at32f415_adc.c
  • ADC_ORDINARY_SHORTSHIFT_ONLY_MODE : at32f415_adc.h
  • ADC_ORDINARY_SHORTSHIFT_PREEMPT_SMLT_MODE : at32f415_adc.h
  • ADC_ORDINARY_SMLT_ONLY_MODE : at32f415_adc.h
  • ADC_ORDINARY_SMLT_PREEMPT_INTERLTRIG_MODE : at32f415_adc.h
  • ADC_ORDINARY_SMLT_PREEMPT_SMLT_MODE : at32f415_adc.h
  • adc_ordinary_software_trigger_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_ordinary_software_trigger_status_get() : at32f415_adc.h, at32f415_adc.c
  • adc_ordinary_trig_select_type : at32f415_adc.h
  • ADC_PCCE_FLAG : at32f415_adc.h
  • ADC_PCCE_INT : at32f415_adc.h
  • ADC_PCCS_FLAG : at32f415_adc.h
  • adc_preempt_auto_mode_enable() : at32f415_adc.h, at32f415_adc.c
  • ADC_PREEMPT_CHANNEL_1 : at32f415_adc.h
  • ADC_PREEMPT_CHANNEL_2 : at32f415_adc.h
  • ADC_PREEMPT_CHANNEL_3 : at32f415_adc.h
  • ADC_PREEMPT_CHANNEL_4 : at32f415_adc.h
  • adc_preempt_channel_length_set() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_channel_set() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_channel_type : at32f415_adc.h
  • adc_preempt_conversion_data_get() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_conversion_trigger_set() : at32f415_adc.h, at32f415_adc.c
  • ADC_PREEMPT_INTERLTRIG_ONLY_MODE : at32f415_adc.h
  • adc_preempt_offset_value_set() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_part_mode_enable() : at32f415_adc.h, at32f415_adc.c
  • ADC_PREEMPT_SMLT_ONLY_MODE : at32f415_adc.h
  • adc_preempt_software_trigger_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_software_trigger_status_get() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_trig_select_type : at32f415_adc.h
  • adc_reset() : at32f415_adc.h, at32f415_adc.c
  • ADC_RIGHT_ALIGNMENT : at32f415_adc.h
  • ADC_SAMPLETIME_13_5 : at32f415_adc.h
  • ADC_SAMPLETIME_1_5 : at32f415_adc.h
  • ADC_SAMPLETIME_239_5 : at32f415_adc.h
  • ADC_SAMPLETIME_28_5 : at32f415_adc.h
  • ADC_SAMPLETIME_41_5 : at32f415_adc.h
  • ADC_SAMPLETIME_55_5 : at32f415_adc.h
  • ADC_SAMPLETIME_71_5 : at32f415_adc.h
  • ADC_SAMPLETIME_7_5 : at32f415_adc.h
  • adc_sampletime_select_type : at32f415_adc.h
  • ADC_TEMP_BASE : project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c
  • ADC_TEMP_SLOPE : project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c
  • adc_tempersensor_vintrv_enable() : at32f415_adc.h, at32f415_adc.c
  • ADC_VMONITOR_ALL_ORDINARY : at32f415_adc.h
  • ADC_VMONITOR_ALL_ORDINARY_PREEMPT : at32f415_adc.h
  • ADC_VMONITOR_ALL_PREEMPT : at32f415_adc.h
  • ADC_VMONITOR_NONE : at32f415_adc.h
  • ADC_VMONITOR_SINGLE_ORDINARY : at32f415_adc.h
  • ADC_VMONITOR_SINGLE_ORDINARY_PREEMPT : at32f415_adc.h
  • ADC_VMONITOR_SINGLE_PREEMPT : at32f415_adc.h
  • ADC_VMOR_FLAG : at32f415_adc.h
  • ADC_VMOR_INT : at32f415_adc.h
  • adc_voltage_monitor_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_voltage_monitor_single_channel_select() : at32f415_adc.h, at32f415_adc.c
  • adc_voltage_monitor_threshold_value_set() : at32f415_adc.h, at32f415_adc.c
  • adc_voltage_monitoring_type : at32f415_adc.h
  • ADC_VREF : project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c
  • ADDRESS_OUT_OF_RANGE : msc_bot_scsi.h
  • AHBPERIPH_BASE : at32f415.h
  • AIRCR_VECTKEY_MASK : at32f415_misc.c
  • ALIGNED_TAIL : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_bot_scsi.c, msc_desc.c, printer_desc.c
  • alt_setting : audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • APB1PERIPH_BASE : at32f415.h
  • APB2PERIPH_BASE : at32f415.h
  • app_load() : bootloader/inc/iap.h, bootloader/src/iap.c
  • app_loop() : app_led3_toggle/inc/hid_iap_user.h, app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/inc/hid_iap_user.h, app_led4_toggle/src/hid_iap_user.c
  • APP_START_ADDR : app_led3_toggle/inc/iap.h, app_led4_toggle/inc/iap.h, bootloader/inc/iap.h
  • app_update_handle() : bootloader/src/iap.c
  • arm_apply_guard_bits() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_calc_2pow() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_calc_guard_bits() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_clip_f32() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_compare_fixed_q15() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_compare_fixed_q31() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_fir_f32() : project_l0/inc/fir_filter.h, project_l1/inc/fir_filter.h
  • arm_fir_init_f32() : project_l0/inc/fir_filter.h, arm_fir_init_f32.c, project_l1/inc/fir_filter.h
  • arm_float_to_q12_20() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_float_to_q14() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_float_to_q28() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_float_to_q29() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_float_to_q30() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_provide_guard_bits_q15() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_provide_guard_bits_q31() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_provide_guard_bits_q7() : project_l0/src/math_helper.c, project_l1/src/math_helper.c
  • arm_snr_f32() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • AT32_AUDIO_FREQ_16K : audio_desc.h, audio_hid_desc.h
  • AT32_AUDIO_FREQ_48K : audio_desc.h, audio_hid_desc.h
  • at32_board_init() : at32f415_board.c, at32f415_board.h
  • at32_button_init() : at32f415_board.c, at32f415_board.h
  • at32_button_press() : at32f415_board.c, at32f415_board.h
  • at32_button_state() : at32f415_board.c, at32f415_board.h
  • at32_led_init() : at32f415_board.c, at32f415_board.h
  • at32_led_off() : at32f415_board.c, at32f415_board.h
  • at32_led_on() : at32f415_board.c, at32f415_board.h
  • at32_led_toggle() : at32f415_board.c, at32f415_board.h
  • atr_decode_status : project/at_start_f415/examples/usart/smartcard/src/main.c
  • AUDIO_AC_DESCRIPTOR_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_EXTENSION_UNIT : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_FEATURE_UNIT : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_HEADER : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_INPUT_TERMINAL : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_MIXER_UNIT : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_OUTPUT_TERMINAL : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_PROCESSING_UNIT : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_SELECTOR_UNIT : audio_desc.h, audio_hid_desc.h
  • AUDIO_AS_DESCRIPTOR_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_AS_FORMAT_SPECIFIC : audio_desc.h, audio_hid_desc.h
  • AUDIO_AS_FORMAT_TYPE : audio_desc.h, audio_hid_desc.h
  • AUDIO_AS_GENERAL : audio_desc.h, audio_hid_desc.h
  • AUDIO_BITW_16 : audio/audio_conf.h, audio_hid/audio_conf.h
  • audio_class_handler : audio_class.c, audio_class.h
  • audio_codec : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • audio_codec_init() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_loop() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_mic_alt_setting() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_mic_get_data() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_modify_freq() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_set_mic_freq() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_set_mic_mute() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_set_mic_volume() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_set_spk_freq() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_set_spk_mute() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_set_spk_volume() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_spk_alt_setting() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_spk_feedback() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_spk_fifo_write() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • AUDIO_CS_CONFIGURATION : audio_desc.h, audio_hid_desc.h
  • AUDIO_CS_DEVICE : audio_desc.h, audio_hid_desc.h
  • AUDIO_CS_ENDPOINT : audio_desc.h, audio_hid_desc.h
  • AUDIO_CS_INTERFACE : audio_desc.h, audio_hid_desc.h
  • AUDIO_CS_STRING : audio_desc.h, audio_hid_desc.h
  • AUDIO_CS_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_DEFAULT_BITW : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_DEFAULT_FREQ : audio/audio_conf.h, audio_hid/audio_conf.h
  • audio_desc_handler : audio_desc.c, audio_desc.h
  • AUDIO_DESCRIPTOR_SIZE : audio_class.h, audio_hid_class.h
  • AUDIO_DESCRIPTOR_TYPE : audio_class.h, audio_hid_class.h
  • AUDIO_FEATURE_UNIT_SIZE : audio_desc.h, audio_hid_desc.h
  • AUDIO_FEEDBACK_MAXPACKET_SIZE : audio_class.h, audio_hid_class.h
  • audio_feedback_state : audio_class.c, audio_hid_class.c
  • AUDIO_FORMAT_TYPE_I : audio_desc.h, audio_hid_desc.h
  • AUDIO_FREQ_16K : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_FREQ_48K : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_FREQ_SET_CONTROL : audio_class.h, audio_hid_class.h
  • AUDIO_FU_BASS_CONTROL : audio_desc.h, audio_hid_desc.h
  • AUDIO_FU_CONTROL_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_FU_MID_CONTROL : audio_desc.h, audio_hid_desc.h
  • AUDIO_FU_MUTE_CONTROL : audio_desc.h, audio_hid_desc.h
  • AUDIO_FU_TREBLE_CONTROL : audio_desc.h, audio_hid_desc.h
  • AUDIO_FU_VOLUME_CONTROL : audio_desc.h, audio_hid_desc.h
  • audio_get_interface() : audio_class.c, audio_hid_class.c
  • audio_hid_class_handler : audio_hid_class.c, audio_hid_class.h
  • audio_hid_desc_handler : audio_hid_desc.c, audio_hid_desc.h
  • audio_inisoincom_event() : audio_class.c, audio_hid_class.c
  • AUDIO_INPUT_TERMINAL_MICROPHONE : audio_desc.h, audio_hid_desc.h
  • AUDIO_INPUT_TERMINAL_SIZE : audio_desc.h, audio_hid_desc.h
  • AUDIO_INPUT_TERMINAL_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_INTERFACE_LEN : audio_desc.h, audio_hid_desc.h
  • AUDIO_INTERFACE_NUM : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_BITW : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_CHANEL_NUM : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_MIC_CHR : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_DEFAULT_BITW : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_MIC_FEATURE_UNIT_ID : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_FREQ_SIZE : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_IN_MAXPACKET_SIZE : audio_class.h, audio_hid_class.h
  • AUDIO_MIC_INPUT_TERMINAL_ID : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_INTERFACE : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_INTERFACE_NUMBER : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_OUTPUT_TERMINAL_ID : audio_desc.h, audio_hid_desc.h
  • AUDIO_MUTE_CONTROL : audio_class.h, audio_hid_class.h
  • AUDIO_OUTPUT_TERMINAL_SIZE : audio_desc.h, audio_hid_desc.h
  • AUDIO_OUTPUT_TERMINAL_SPEAKER : audio_desc.h, audio_hid_desc.h
  • AUDIO_OUTPUT_TERMINAL_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_PROTOCOL_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_REMAIN_SIZE : audio_class.h, audio_hid_class.h
  • AUDIO_REQ_CONTROL_ENDPOINT : audio_class.h, audio_hid_class.h
  • AUDIO_REQ_CONTROL_INTERFACE : audio_class.h, audio_hid_class.h
  • AUDIO_REQ_CONTROL_MASK : audio_class.h, audio_hid_class.h
  • AUDIO_REQ_GET_CUR : audio_desc.h, audio_hid_desc.h
  • audio_req_get_cur() : audio_class.c, audio_hid_class.c
  • AUDIO_REQ_GET_MAX : audio_desc.h, audio_hid_desc.h
  • audio_req_get_max() : audio_class.c, audio_hid_class.c
  • AUDIO_REQ_GET_MEM : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_GET_MIN : audio_desc.h, audio_hid_desc.h
  • audio_req_get_min() : audio_class.c, audio_hid_class.c
  • audio_req_get_res() : audio_class.c, audio_hid_class.c
  • AUDIO_REQ_GET_RES : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_GET_STAT : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_SET_CUR : audio_desc.h, audio_hid_desc.h
  • audio_req_set_cur() : audio_class.c, audio_hid_class.c
  • AUDIO_REQ_SET_MAX : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_SET_MEM : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_SET_MIN : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_SET_RES : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQUEST_CODE_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • audio_set_interface() : audio_class.c, audio_hid_class.c
  • AUDIO_SPK_BITW : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_CHANEL_NUM : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SPK_CHR : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_DEFAULT_BITW : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SPK_FEATURE_UNIT_ID : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_FREQ_SIZE : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_INPUT_TERMINAL_ID : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_INTERFACE : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_INTERFACE_NUMBER : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_OUT_MAXPACKET_SIZE : audio_class.h, audio_hid_class.h
  • audio_spk_out_stage : audio_class.c, audio_hid_class.c
  • AUDIO_SPK_OUTPUT_TERMINAL_ID : audio_desc.h, audio_hid_desc.h
  • audio_struct : audio_class.c, audio_hid_class.c
  • AUDIO_SUBCLASS_AUDIOCONTROL : audio_desc.h, audio_hid_desc.h
  • AUDIO_SUBCLASS_AUDIOSTREAMING : audio_desc.h, audio_hid_desc.h
  • AUDIO_SUBCLASS_MIDISTREMING : audio_desc.h, audio_hid_desc.h
  • AUDIO_SUBCLASS_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_SUPPORT_FEEDBACK : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SUPPORT_FREQ : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SUPPORT_FREQ_16K : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SUPPORT_FREQ_48K : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SUPPORT_MAX_FREQ : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SUPPORT_MIC : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SUPPORT_SPK : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_TERMINAL_TYPE_STREAMING : audio_desc.h, audio_hid_desc.h
  • AUDIO_TERMINAL_TYPE_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_TERMINAL_TYPE_VENDOR : audio_desc.h, audio_hid_desc.h
  • AUDIO_VOLUME_CONTROL : audio_class.h, audio_hid_class.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- b -

  • back_err() : app_led3_toggle/inc/usart.h, app_led3_toggle/src/usart.c, app_led4_toggle/inc/usart.h, app_led4_toggle/src/usart.c, bootloader/inc/iap.h, bootloader/src/iap.c
  • back_ok() : app_led3_toggle/inc/usart.h, app_led3_toggle/src/usart.c, app_led4_toggle/inc/usart.h, app_led4_toggle/src/usart.c, bootloader/inc/iap.h, bootloader/src/iap.c
  • BCD_NUM : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h, printer_desc.h
  • BLOCK_SIZE : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c, fir_filter.c
  • BLOCKS_NUMBER : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • bot_cbw_decode() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_allow_medium_removal() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_capacity() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_check_address() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_clear_feature() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_cmd_process() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_datain_handler() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_dataout_handler() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_format_capacity() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_init() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_inquiry() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_mode_sense10() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_mode_sense6() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_read10() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_request_sense() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_reset() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_send_csw() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_send_data() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_sense_code() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_stall() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_start_stop() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_test_unit() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_verify() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_write10() : msc_bot_scsi.c, msc_bot_scsi.h
  • BOT_STATE_COMPLETE : usbh_msc_bot_scsi.h
  • BOT_STATE_DATA_IN : usbh_msc_bot_scsi.h
  • BOT_STATE_DATA_IN_WAIT : usbh_msc_bot_scsi.h
  • BOT_STATE_DATA_OUT : usbh_msc_bot_scsi.h
  • BOT_STATE_DATA_OUT_WAIT : usbh_msc_bot_scsi.h
  • BOT_STATE_ERROR : usbh_msc_bot_scsi.h
  • BOT_STATE_IDLE : usbh_msc_bot_scsi.h
  • BOT_STATE_RECV_CSW : usbh_msc_bot_scsi.h
  • BOT_STATE_RECV_CSW_WAIT : usbh_msc_bot_scsi.h
  • BOT_STATE_SEND_CBW : usbh_msc_bot_scsi.h
  • BOT_STATE_SEND_CBW_WAIT : usbh_msc_bot_scsi.h
  • bpr_addr_tab : project/at_start_f415/examples/ertc/bpr_domain/src/main.c, project/at_start_f415/examples/ertc/tamper/src/main.c
  • bpr_reg_check() : project/at_start_f415/examples/ertc/bpr_domain/src/main.c, project/at_start_f415/examples/ertc/tamper/src/main.c
  • bpr_reg_write() : project/at_start_f415/examples/ertc/bpr_domain/src/main.c, project/at_start_f415/examples/ertc/tamper/src/main.c
  • BUF_SIZE : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, project/at_start_f415/examples/spi/w25q_flash/src/main.c
  • buffer_ch1 : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • buffer_ch2 : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • buffer_compare() : project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/flash/flash_write_read/src/main.c, project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c, project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c, project/at_start_f415/examples/spi/w25q_flash/src/main.c, project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c
  • buffer_compare_24bits() : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c
  • buffer_read : project/at_start_f415/examples/flash/flash_write_read/src/main.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c
  • BUFFER_SIZE : project/at_start_f415/examples/crc/calculation/src/main.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c, project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c, project/at_start_f415/examples/usart/hw_flow_control/src/main.c, project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • buffer_write : project/at_start_f415/examples/flash/flash_write_read/src/main.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c
  • BUFFERSIZE : project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c
  • BusFault_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_freertos_demo/src/at32f415_int.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • BusFault_IRQn : at32f415.h
  • button_exint_init() : project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/templates/src/main.c
  • button_isr() : project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/templates/src/main.c
  • BUTTON_RELEASE : mouse_class.h
  • button_type : at32f415_board.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- c -

  • CAN1 : at32f415_can.h
  • CAN1_BASE : at32f415.h
  • CAN1_GMUX_0010 : at32f415_gpio.h
  • CAN1_RX0_IRQHandler() : project/at_start_f415/examples/can/communication_mode/src/main.c, project/at_start_f415/examples/can/filter/src/main.c, project/at_start_f415/examples/can/loopback_mode/src/main.c
  • CAN1_RX0_IRQn : at32f415.h
  • CAN1_RX1_IRQn : at32f415.h
  • CAN1_SE_IRQHandler() : project/at_start_f415/examples/can/communication_mode/src/main.c, project/at_start_f415/examples/can/filter/src/main.c, project/at_start_f415/examples/can/loopback_mode/src/main.c
  • CAN1_SE_IRQn : at32f415.h
  • CAN1_TX_IRQn : at32f415.h
  • can_base_init() : at32f415_can.h, at32f415_can.c
  • can_baudrate_default_para_init() : at32f415_can.h, at32f415_can.c
  • can_baudrate_set() : at32f415_can.h, at32f415_can.c
  • CAN_BOF_FLAG : at32f415_can.h
  • CAN_BOIEN_INT : at32f415_can.h
  • CAN_BTS1_10TQ : at32f415_can.h
  • CAN_BTS1_11TQ : at32f415_can.h
  • CAN_BTS1_12TQ : at32f415_can.h
  • CAN_BTS1_13TQ : at32f415_can.h
  • CAN_BTS1_14TQ : at32f415_can.h
  • CAN_BTS1_15TQ : at32f415_can.h
  • CAN_BTS1_16TQ : at32f415_can.h
  • CAN_BTS1_1TQ : at32f415_can.h
  • CAN_BTS1_2TQ : at32f415_can.h
  • CAN_BTS1_3TQ : at32f415_can.h
  • CAN_BTS1_4TQ : at32f415_can.h
  • CAN_BTS1_5TQ : at32f415_can.h
  • CAN_BTS1_6TQ : at32f415_can.h
  • CAN_BTS1_7TQ : at32f415_can.h
  • CAN_BTS1_8TQ : at32f415_can.h
  • CAN_BTS1_9TQ : at32f415_can.h
  • can_bts1_type : at32f415_can.h
  • CAN_BTS2_1TQ : at32f415_can.h
  • CAN_BTS2_2TQ : at32f415_can.h
  • CAN_BTS2_3TQ : at32f415_can.h
  • CAN_BTS2_4TQ : at32f415_can.h
  • CAN_BTS2_5TQ : at32f415_can.h
  • CAN_BTS2_6TQ : at32f415_can.h
  • CAN_BTS2_7TQ : at32f415_can.h
  • CAN_BTS2_8TQ : at32f415_can.h
  • can_bts2_type : at32f415_can.h
  • can_configuration() : project/at_start_f415/examples/can/communication_mode/src/main.c, project/at_start_f415/examples/can/filter/src/main.c, project/at_start_f415/examples/can/loopback_mode/src/main.c
  • can_debug_transmission_prohibit() : at32f415_can.h, at32f415_can.c
  • can_default_para_init() : at32f415_can.h, at32f415_can.c
  • CAN_DISCARDING_FIRST_RECEIVED : at32f415_can.h
  • CAN_DISCARDING_LAST_RECEIVED : at32f415_can.h
  • can_doze_mode_enter() : at32f415_can.h, at32f415_can.c
  • can_doze_mode_exit() : at32f415_can.h, at32f415_can.c
  • CAN_EAF_FLAG : at32f415_can.h
  • CAN_EAIEN_INT : at32f415_can.h
  • CAN_EDZC_FLAG : at32f415_can.h
  • CAN_EDZIEN_INT : at32f415_can.h
  • CAN_ENTER_DOZE_FAILED : at32f415_can.h
  • can_enter_doze_status_type : at32f415_can.h
  • CAN_ENTER_DOZE_SUCCESSFUL : at32f415_can.h
  • CAN_EOIEN_INT : at32f415_can.h
  • CAN_EOIF_FLAG : at32f415_can.h
  • CAN_EPF_FLAG : at32f415_can.h
  • CAN_EPIEN_INT : at32f415_can.h
  • can_error_record_type : at32f415_can.h
  • can_error_type_record_get() : at32f415_can.h, at32f415_can.c
  • CAN_ERRORRECORD_ACKERR : at32f415_can.h
  • CAN_ERRORRECORD_BITDOMINANTERR : at32f415_can.h
  • CAN_ERRORRECORD_BITRECESSIVEERR : at32f415_can.h
  • CAN_ERRORRECORD_CRCERR : at32f415_can.h
  • CAN_ERRORRECORD_FORMERR : at32f415_can.h
  • CAN_ERRORRECORD_NOERR : at32f415_can.h
  • CAN_ERRORRECORD_SOFTWARESETERR : at32f415_can.h
  • CAN_ERRORRECORD_STUFFERR : at32f415_can.h
  • CAN_ETR_FLAG : at32f415_can.h
  • CAN_ETRIEN_INT : at32f415_can.h
  • CAN_FILTER_16BIT : at32f415_can.h
  • CAN_FILTER_32BIT : at32f415_can.h
  • can_filter_bit_width_type : at32f415_can.h
  • can_filter_default_para_init() : at32f415_can.h, at32f415_can.c
  • CAN_FILTER_FIFO0 : at32f415_can.h
  • CAN_FILTER_FIFO1 : at32f415_can.h
  • can_filter_fifo_type : at32f415_can.h
  • can_filter_init() : at32f415_can.h, at32f415_can.c
  • CAN_FILTER_MODE_ID_LIST : at32f415_can.h
  • CAN_FILTER_MODE_ID_MASK : at32f415_can.h
  • can_filter_mode_type : at32f415_can.h
  • can_flag_clear() : at32f415_can.h, at32f415_can.c
  • can_flag_get() : at32f415_can.h, at32f415_can.c
  • can_gpio_config() : project/at_start_f415/examples/can/communication_mode/src/main.c, project/at_start_f415/examples/can/filter/src/main.c, project/at_start_f415/examples/can/loopback_mode/src/main.c
  • CAN_ID_EXTENDED : at32f415_can.h
  • CAN_ID_STANDARD : at32f415_can.h
  • can_identifier_type : at32f415_can.h
  • can_interrupt_enable() : at32f415_can.h, at32f415_can.c
  • can_message_receive() : at32f415_can.h, at32f415_can.c
  • can_message_transmit() : at32f415_can.h, at32f415_can.c
  • CAN_MODE_COMMUNICATE : at32f415_can.h
  • CAN_MODE_LISTENONLY : at32f415_can.h
  • CAN_MODE_LISTENONLY_LOOPBACK : at32f415_can.h
  • CAN_MODE_LOOPBACK : at32f415_can.h
  • can_mode_type : at32f415_can.h
  • CAN_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • can_msg_discarding_rule_type : at32f415_can.h
  • can_msg_sending_rule_type : at32f415_can.h
  • CAN_MSTS_EDZIF_VAL : at32f415_can.h
  • CAN_MSTS_EOIF_VAL : at32f415_can.h
  • CAN_MSTS_QDZIF_VAL : at32f415_can.h
  • CAN_MUX_10 : at32f415_gpio.h
  • can_operating_mode_set() : at32f415_can.h, at32f415_can.c
  • can_operating_mode_type : at32f415_can.h
  • CAN_OPERATINGMODE_COMMUNICATE : at32f415_can.h
  • CAN_OPERATINGMODE_DOZE : at32f415_can.h
  • CAN_OPERATINGMODE_FREEZE : at32f415_can.h
  • CAN_QDZIEN_INT : at32f415_can.h
  • CAN_QDZIF_FLAG : at32f415_can.h
  • CAN_QUIT_DOZE_FAILED : at32f415_can.h
  • can_quit_doze_status_type : at32f415_can.h
  • CAN_QUIT_DOZE_SUCCESSFUL : at32f415_can.h
  • can_receive_error_counter_get() : at32f415_can.h, at32f415_can.c
  • can_receive_fifo_release() : at32f415_can.h, at32f415_can.c
  • can_receive_message_pending_get() : at32f415_can.h, at32f415_can.c
  • can_reset() : at32f415_can.h, at32f415_can.c
  • CAN_RF0_RF0FF_VAL : at32f415_can.h
  • CAN_RF0_RF0OF_VAL : at32f415_can.h
  • CAN_RF0_RF0R_VAL : at32f415_can.h
  • CAN_RF0FF_FLAG : at32f415_can.h
  • CAN_RF0FIEN_INT : at32f415_can.h
  • CAN_RF0MIEN_INT : at32f415_can.h
  • CAN_RF0MN_FLAG : at32f415_can.h
  • CAN_RF0OF_FLAG : at32f415_can.h
  • CAN_RF0OIEN_INT : at32f415_can.h
  • CAN_RF1_RF1FF_VAL : at32f415_can.h
  • CAN_RF1_RF1OF_VAL : at32f415_can.h
  • CAN_RF1_RF1R_VAL : at32f415_can.h
  • CAN_RF1FF_FLAG : at32f415_can.h
  • CAN_RF1FIEN_INT : at32f415_can.h
  • CAN_RF1MIEN_INT : at32f415_can.h
  • CAN_RF1MN_FLAG : at32f415_can.h
  • CAN_RF1OF_FLAG : at32f415_can.h
  • CAN_RF1OIEN_INT : at32f415_can.h
  • CAN_RSAW_1TQ : at32f415_can.h
  • CAN_RSAW_2TQ : at32f415_can.h
  • CAN_RSAW_3TQ : at32f415_can.h
  • CAN_RSAW_4TQ : at32f415_can.h
  • can_rsaw_type : at32f415_can.h
  • CAN_RX_FIFO0 : at32f415_can.h
  • CAN_RX_FIFO1 : at32f415_can.h
  • can_rx_fifo_num_type : at32f415_can.h
  • CAN_SENDING_BY_ID : at32f415_can.h
  • CAN_SENDING_BY_REQUEST : at32f415_can.h
  • CAN_TCIEN_INT : at32f415_can.h
  • CAN_TFT_DATA : at32f415_can.h
  • CAN_TFT_REMOTE : at32f415_can.h
  • CAN_TM0TCF_FLAG : at32f415_can.h
  • CAN_TM1TCF_FLAG : at32f415_can.h
  • CAN_TM2TCF_FLAG : at32f415_can.h
  • CAN_TMEF_FLAG : at32f415_can.h
  • can_trans_frame_type : at32f415_can.h
  • can_transmit_cancel() : at32f415_can.h, at32f415_can.c
  • can_transmit_data() : project/at_start_f415/examples/can/communication_mode/src/main.c, project/at_start_f415/examples/can/filter/src/main.c, project/at_start_f415/examples/can/loopback_mode/src/main.c
  • can_transmit_error_counter_get() : at32f415_can.h, at32f415_can.c
  • can_transmit_status_get() : at32f415_can.h, at32f415_can.c
  • can_transmit_status_type : at32f415_can.h
  • CAN_TSTS_TM0CT_VAL : at32f415_can.h
  • CAN_TSTS_TM0TCF_VAL : at32f415_can.h
  • CAN_TSTS_TM1CT_VAL : at32f415_can.h
  • CAN_TSTS_TM1TCF_VAL : at32f415_can.h
  • CAN_TSTS_TM2CT_VAL : at32f415_can.h
  • CAN_TSTS_TM2TCF_VAL : at32f415_can.h
  • can_ttc_mode_enable() : at32f415_can.h, at32f415_can.c
  • CAN_TX_MAILBOX0 : at32f415_can.h
  • CAN_TX_MAILBOX1 : at32f415_can.h
  • CAN_TX_MAILBOX2 : at32f415_can.h
  • can_tx_mailbox_num_type : at32f415_can.h
  • CAN_TX_STATUS_FAILED : at32f415_can.h
  • CAN_TX_STATUS_NO_EMPTY : at32f415_can.h
  • CAN_TX_STATUS_PENDING : at32f415_can.h
  • CAN_TX_STATUS_SUCCESSFUL : at32f415_can.h
  • capture : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c, project/at_start_f415/examples/cmp/output/src/main.c, project/at_start_f415/examples/tmr/input_capture/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c
  • capture_number : project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/src/main.c
  • capturenumber : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/src/main.c, project/at_start_f415/examples/tmr/input_capture/src/main.c
  • card_inserted : project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/src/main.c
  • card_protocol : project/at_start_f415/examples/usart/smartcard/src/main.c
  • card_type : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • CBW_BMCBWFLAGS_DIR_IN : msc_bot_scsi.h
  • CBW_BMCBWFLAGS_DIR_OUT : msc_bot_scsi.h
  • CBW_CMD_LENGTH : msc_bot_scsi.h
  • CBW_DCBWSIGNATURE : msc_bot_scsi.h
  • cbw_struct : msc_bot_scsi.c, msc_class.c
  • cdc_class_setup_handler() : cdc_keyboard_class.c
  • CDC_DATA_INTERFACE : cdc_keyboard_desc.h
  • CDC_INTERFACE : cdc_keyboard_desc.h
  • cdc_keyboard_class_handler : cdc_keyboard_class.c, cdc_keyboard_class.h
  • cdc_keyboard_desc_handler : cdc_keyboard_desc.c, cdc_keyboard_desc.h
  • ch1_val : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • ch1readvalue1 : project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/src/main.c
  • ch1readvalue2 : project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/src/main.c
  • ch2_val : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • ch3_val : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • ch3readvalue1 : project/at_start_f415/examples/tmr/input_capture/src/main.c
  • ch3readvalue2 : project/at_start_f415/examples/tmr/input_capture/src/main.c
  • ch4_val : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • channel1_pulse : project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c
  • channel2_pulse : project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c
  • channel3_pulse : project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c
  • channel4_pulse : project/at_start_f415/examples/tmr/7_pwm_output/src/main.c
  • check_card_programming() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • cid_table : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • class_audio_setup_handler() : audio_hid_class.c
  • class_clear_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_ept0_rx_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_ept0_tx_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_event_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_handler : cdc_class.c, cdc_class.h, printer_class.c, printer_class.h
  • class_hid_setup_handler() : audio_hid_class.c
  • class_in_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_init_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_out_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_send_report() : audio_hid_class.c, audio_hid_class.h, cdc_keyboard_class.c, cdc_keyboard_class.h, custom_hid_class.c, custom_hid_class.h, hid_iap_class.c, hid_iap_class.h, keyboard_class.c, keyboard_class.h, mouse_class.c
  • class_setup_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_sof_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • clkout_config() : project/at_start_f415/examples/crm/clock_failure_detection/src/main.c, project/at_start_f415/examples/crm/pll_config2/src/main.c, project/at_start_f415/examples/crm/sysclk_switch/src/main.c, project/at_start_f415/examples/tmr/timer_base/src/main.c
  • clock_failure_detection_handler() : project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/src/main.c
  • cmd_addr_cnt : bootloader/src/iap.c
  • CMD_CTR_APP : bootloader/inc/iap.h
  • CMD_CTR_DONE : bootloader/inc/iap.h
  • CMD_CTR_ERR : bootloader/inc/iap.h
  • CMD_CTR_IDLE : bootloader/inc/iap.h
  • CMD_CTR_INIT : bootloader/inc/iap.h
  • cmd_ctr_step : bootloader/inc/iap.h, bootloader/src/iap.c
  • cmd_ctr_step_type : bootloader/inc/iap.h
  • CMD_DATA_ADDR : bootloader/inc/iap.h
  • CMD_DATA_BUF : bootloader/inc/iap.h
  • CMD_DATA_CHACK : bootloader/inc/iap.h
  • cmd_data_cnt : bootloader/src/iap.c
  • CMD_DATA_DONE : bootloader/inc/iap.h
  • CMD_DATA_ERR : bootloader/inc/iap.h
  • cmd_data_group_struct : bootloader/src/iap.c
  • cmd_data_group_type_struct : bootloader/inc/iap.h
  • CMD_DATA_IDLE : bootloader/inc/iap.h
  • cmd_data_step : bootloader/inc/iap.h, bootloader/src/iap.c
  • cmd_data_step_type : bootloader/inc/iap.h
  • CMD_STATE_SEND : usbh_msc_bot_scsi.h
  • CMD_STATE_WAIT : usbh_msc_bot_scsi.h
  • CMP : at32f415_cmp.h
  • CMP1_IRQHandler() : project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c
  • CMP1_IRQn : at32f415.h
  • CMP1_SELECTION : at32f415_cmp.h
  • CMP2_IRQn : at32f415.h
  • CMP2_SELECTION : at32f415_cmp.h
  • CMP_BASE : at32f415.h
  • cmp_config() : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c, project/at_start_f415/examples/cmp/output/src/main.c
  • CMP_CTRLSTS1_CLEAR_MASK : at32f415_cmp.c
  • cmp_default_para_init() : at32f415_cmp.h, at32f415_cmp.c
  • cmp_enable() : at32f415_cmp.h, at32f415_cmp.c
  • cmp_exint_init() : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c
  • CMP_HIGH_PULSE_CLEAR_MASK : at32f415_cmp.c
  • CMP_HYSTERESIS_HIGH : at32f415_cmp.h
  • CMP_HYSTERESIS_LOW : at32f415_cmp.h
  • CMP_HYSTERESIS_MEDIUM : at32f415_cmp.h
  • CMP_HYSTERESIS_NONE : at32f415_cmp.h
  • cmp_hysteresis_type : at32f415_cmp.h
  • cmp_init() : at32f415_cmp.h, at32f415_cmp.c
  • CMP_INPINPUT_CLEAR_MASK : at32f415_cmp.c
  • cmp_input_shift_enable() : at32f415_cmp.h, at32f415_cmp.c
  • CMP_INVERTING_1_2VREFINT : at32f415_cmp.h
  • CMP_INVERTING_1_4VREFINT : at32f415_cmp.h
  • CMP_INVERTING_3_4VREFINT : at32f415_cmp.h
  • CMP_INVERTING_PA0 : at32f415_cmp.h
  • CMP_INVERTING_PA2 : at32f415_cmp.h
  • CMP_INVERTING_PA4 : at32f415_cmp.h
  • CMP_INVERTING_PA5 : at32f415_cmp.h
  • cmp_inverting_type : at32f415_cmp.h
  • CMP_INVERTING_VREFINT : at32f415_cmp.h
  • CMP_LOW_PULSE_CLEAR_MASK : at32f415_cmp.c
  • CMP_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • CMP_MUX_01 : at32f415_gpio.h
  • CMP_MUX_10 : at32f415_gpio.h
  • CMP_NON_INVERTING_PA0 : at32f415_cmp.h
  • CMP_NON_INVERTING_PA1 : at32f415_cmp.h
  • CMP_NON_INVERTING_PA5 : at32f415_cmp.h
  • cmp_non_inverting_type : at32f415_cmp.h
  • CMP_NON_INVERTING_VSSA : at32f415_cmp.h
  • CMP_OUTPUT_NONE : at32f415_cmp.h
  • CMP_OUTPUT_TMR1BRK : at32f415_cmp.h
  • CMP_OUTPUT_TMR1CH1 : at32f415_cmp.h
  • CMP_OUTPUT_TMR1CHCLR : at32f415_cmp.h
  • CMP_OUTPUT_TMR2CH4 : at32f415_cmp.h
  • CMP_OUTPUT_TMR2CHCLR : at32f415_cmp.h
  • CMP_OUTPUT_TMR3CH1 : at32f415_cmp.h
  • CMP_OUTPUT_TMR3CHCLR : at32f415_cmp.h
  • cmp_output_type : at32f415_cmp.h
  • cmp_output_value_get() : at32f415_cmp.h, at32f415_cmp.c
  • CMP_POL_INVERTING : at32f415_cmp.h
  • CMP_POL_NON_INVERTING : at32f415_cmp.h
  • cmp_polarity_type : at32f415_cmp.h
  • cmp_reset() : at32f415_cmp.h, at32f415_cmp.c
  • cmp_sel_type : at32f415_cmp.h
  • CMP_SPEED_FAST : at32f415_cmp.h
  • CMP_SPEED_MEDIUM : at32f415_cmp.h
  • CMP_SPEED_SLOW : at32f415_cmp.h
  • cmp_speed_type : at32f415_cmp.h
  • CMP_SPEED_ULTRALOW : at32f415_cmp.h
  • cmp_write_protect_enable() : at32f415_cmp.h, at32f415_cmp.c
  • codec_i2s_init() : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • codec_i2s_reset() : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • command_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_handle() : bootloader/inc/iap.h, bootloader/src/iap.c
  • command_rsp1_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_rsp2_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_rsp3_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_rsp4_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_rsp5_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_rsp6_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_rsp7_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • config_descriptor : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • config_flash_interrupt() : utilities/at32f415_slib_demo/project_l0/src/main.c, utilities/at32f415_slib_demo/project_l1/src/main.c
  • configASSERT : FreeRTOSConfig.h
  • configCPU_CLOCK_HZ : FreeRTOSConfig.h
  • configIDLE_SHOULD_YIELD : FreeRTOSConfig.h
  • configKERNEL_INTERRUPT_PRIORITY : FreeRTOSConfig.h
  • configLIBRARY_LOWEST_INTERRUPT_PRIORITY : FreeRTOSConfig.h
  • configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY : FreeRTOSConfig.h
  • configMAX_CO_ROUTINE_PRIORITIES : FreeRTOSConfig.h
  • configMAX_PRIORITIES : FreeRTOSConfig.h
  • configMAX_SYSCALL_INTERRUPT_PRIORITY : FreeRTOSConfig.h
  • configMAX_TASK_NAME_LEN : FreeRTOSConfig.h
  • configMINIMAL_STACK_SIZE : FreeRTOSConfig.h
  • configPRIO_BITS : FreeRTOSConfig.h
  • configSUPPORT_DYNAMIC_ALLOCATION : FreeRTOSConfig.h
  • configTICK_RATE_HZ : FreeRTOSConfig.h
  • configTOTAL_HEAP_SIZE : FreeRTOSConfig.h
  • configUSE_16_BIT_TICKS : FreeRTOSConfig.h
  • configUSE_CO_ROUTINES : FreeRTOSConfig.h
  • configUSE_IDLE_HOOK : FreeRTOSConfig.h
  • configUSE_PREEMPTION : FreeRTOSConfig.h
  • configUSE_TICK_HOOK : FreeRTOSConfig.h
  • confirm_state : at32f415.h
  • CONVERT_ENDIAN : hid_iap_class.h
  • convert_from_bytes_to_power_of_two() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • copy_buff() : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • counter : project/at_start_f415/examples/debug/tmr1/src/main.c, project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c, project/at_start_f415/examples/usart/smartcard/src/main.c
  • COUNTOF : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • CRC : at32f415_crc.h
  • crc1_value : project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c
  • crc2_value : project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c
  • CRC_BASE : at32f415.h
  • crc_block_calculate() : at32f415_crc.h, at32f415_crc.c
  • crc_cal() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • crc_common_data_set() : at32f415_crc.h, at32f415_crc.c
  • crc_common_date_get() : at32f415_crc.h, at32f415_crc.c
  • crc_data_get() : at32f415_crc.h, at32f415_crc.c
  • crc_data_reset() : at32f415_crc.h, at32f415_crc.c
  • crc_init_data_set() : at32f415_crc.h, at32f415_crc.c
  • CRC_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • crc_one_word_calculate() : at32f415_crc.h, at32f415_crc.c
  • CRC_REVERSE_INPUT_BY_BYTE : at32f415_crc.h
  • CRC_REVERSE_INPUT_BY_HALFWORD : at32f415_crc.h
  • CRC_REVERSE_INPUT_BY_WORD : at32f415_crc.h
  • crc_reverse_input_data_set() : at32f415_crc.h, at32f415_crc.c
  • CRC_REVERSE_INPUT_NO_AFFECTE : at32f415_crc.h
  • crc_reverse_input_type : at32f415_crc.h
  • CRC_REVERSE_OUTPUT_DATA : at32f415_crc.h
  • crc_reverse_output_data_set() : at32f415_crc.h, at32f415_crc.c
  • CRC_REVERSE_OUTPUT_NO_AFFECTE : at32f415_crc.h
  • crc_reverse_output_type : at32f415_crc.h
  • crc_value : project/at_start_f415/examples/crc/calculation/src/main.c
  • CRM : at32f415_crm.h
  • CRM_ADC1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_ADC1_PERIPH_RESET : at32f415_crm.h
  • crm_adc_clock_div_set() : at32f415_crm.h, at32f415_crm.c
  • CRM_ADC_DIV_12 : at32f415_crm.h
  • CRM_ADC_DIV_16 : at32f415_crm.h
  • CRM_ADC_DIV_2 : at32f415_crm.h
  • CRM_ADC_DIV_4 : at32f415_crm.h
  • CRM_ADC_DIV_6 : at32f415_crm.h
  • CRM_ADC_DIV_8 : at32f415_crm.h
  • crm_adc_div_type : at32f415_crm.h
  • CRM_AHB_DIV_1 : at32f415_crm.h
  • CRM_AHB_DIV_128 : at32f415_crm.h
  • CRM_AHB_DIV_16 : at32f415_crm.h
  • CRM_AHB_DIV_2 : at32f415_crm.h
  • CRM_AHB_DIV_256 : at32f415_crm.h
  • CRM_AHB_DIV_4 : at32f415_crm.h
  • CRM_AHB_DIV_512 : at32f415_crm.h
  • CRM_AHB_DIV_64 : at32f415_crm.h
  • CRM_AHB_DIV_8 : at32f415_crm.h
  • crm_ahb_div_set() : at32f415_crm.h, at32f415_crm.c
  • crm_ahb_div_type : at32f415_crm.h
  • CRM_APB1_DIV_1 : at32f415_crm.h
  • CRM_APB1_DIV_16 : at32f415_crm.h
  • CRM_APB1_DIV_2 : at32f415_crm.h
  • CRM_APB1_DIV_4 : at32f415_crm.h
  • CRM_APB1_DIV_8 : at32f415_crm.h
  • crm_apb1_div_set() : at32f415_crm.h, at32f415_crm.c
  • crm_apb1_div_type : at32f415_crm.h
  • CRM_APB2_DIV_1 : at32f415_crm.h
  • CRM_APB2_DIV_16 : at32f415_crm.h
  • CRM_APB2_DIV_2 : at32f415_crm.h
  • CRM_APB2_DIV_4 : at32f415_crm.h
  • CRM_APB2_DIV_8 : at32f415_crm.h
  • crm_apb2_div_set() : at32f415_crm.h, at32f415_crm.c
  • crm_apb2_div_type : at32f415_crm.h
  • CRM_AUTO_STEP_MODE_DISABLE : at32f415_crm.h
  • CRM_AUTO_STEP_MODE_ENABLE : at32f415_crm.h
  • crm_auto_step_mode_enable() : at32f415_crm.h, at32f415_crm.c
  • crm_auto_step_mode_type : at32f415_crm.h
  • CRM_BASE : at32f415.h
  • crm_battery_powered_domain_reset() : at32f415_crm.h, at32f415_crm.c
  • CRM_CAN1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_CAN1_PERIPH_RESET : at32f415_crm.h
  • CRM_CLKOUT_ADC : at32f415_crm.h
  • CRM_CLKOUT_DIV_1 : at32f415_crm.h
  • CRM_CLKOUT_DIV_128 : at32f415_crm.h
  • CRM_CLKOUT_DIV_16 : at32f415_crm.h
  • CRM_CLKOUT_DIV_2 : at32f415_crm.h
  • CRM_CLKOUT_DIV_256 : at32f415_crm.h
  • CRM_CLKOUT_DIV_4 : at32f415_crm.h
  • CRM_CLKOUT_DIV_512 : at32f415_crm.h
  • CRM_CLKOUT_DIV_64 : at32f415_crm.h
  • CRM_CLKOUT_DIV_8 : at32f415_crm.h
  • crm_clkout_div_set() : at32f415_crm.h, at32f415_crm.c
  • crm_clkout_div_type : at32f415_crm.h
  • CRM_CLKOUT_HEXT : at32f415_crm.h
  • CRM_CLKOUT_HICK : at32f415_crm.h
  • CRM_CLKOUT_LEXT : at32f415_crm.h
  • CRM_CLKOUT_LICK : at32f415_crm.h
  • CRM_CLKOUT_NOCLK : at32f415_crm.h
  • CRM_CLKOUT_PLL_DIV_2 : at32f415_crm.h
  • CRM_CLKOUT_PLL_DIV_4 : at32f415_crm.h
  • CRM_CLKOUT_SCLK : at32f415_crm.h
  • crm_clkout_select_type : at32f415_crm.h
  • CRM_CLKOUT_USB : at32f415_crm.h
  • crm_clock_failure_detection_enable() : at32f415_crm.h, at32f415_crm.c
  • CRM_CLOCK_FAILURE_INT : at32f415_crm.h
  • CRM_CLOCK_FAILURE_INT_FLAG : at32f415_crm.h
  • crm_clock_out_set() : at32f415_crm.h, at32f415_crm.c
  • crm_clock_source_enable() : at32f415_crm.h, at32f415_crm.c
  • CRM_CLOCK_SOURCE_HEXT : at32f415_crm.h
  • CRM_CLOCK_SOURCE_HICK : at32f415_crm.h
  • CRM_CLOCK_SOURCE_LEXT : at32f415_crm.h
  • CRM_CLOCK_SOURCE_LICK : at32f415_crm.h
  • CRM_CLOCK_SOURCE_PLL : at32f415_crm.h
  • crm_clock_source_type : at32f415_crm.h
  • crm_clocks_freq_get() : at32f415_crm.h, at32f415_crm.c
  • crm_clocks_freq_struct : project/at_start_f415/examples/debug/tmr1/src/main.c, project/at_start_f415/examples/tmr/6_steps/src/main.c, project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c, project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c, project/at_start_f415/examples/tmr/external_clock/src/main.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c, project/at_start_f415/examples/tmr/hang_mode/src/main.c, project/at_start_f415/examples/tmr/input_capture/src/main.c, project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/timer_base/src/main.c
  • CRM_CMP_PERIPH_CLOCK : at32f415_crm.h
  • CRM_CMP_PERIPH_RESET : at32f415_crm.h
  • crm_configuration() : project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/one_cycle/src/main.c, project/at_start_f415/examples/tmr/parallel_synchro/src/main.c, project/at_start_f415/examples/tmr/pwm_input/src/main.c, project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • CRM_CRC_PERIPH_CLOCK : at32f415_crm.h
  • CRM_DMA1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_DMA2_PERIPH_CLOCK : at32f415_crm.h
  • crm_ertc_clock_enable() : at32f415_crm.h, at32f415_crm.c
  • CRM_ERTC_CLOCK_HEXT_DIV : at32f415_crm.h
  • CRM_ERTC_CLOCK_LEXT : at32f415_crm.h
  • CRM_ERTC_CLOCK_LICK : at32f415_crm.h
  • CRM_ERTC_CLOCK_NOCLK : at32f415_crm.h
  • crm_ertc_clock_select() : at32f415_crm.h, at32f415_crm.c
  • crm_ertc_clock_type : at32f415_crm.h
  • CRM_EXINT_PERIPH_RESET : at32f415_crm.h
  • crm_flag_clear() : at32f415_crm.h, at32f415_crm.c
  • crm_flag_get() : at32f415_crm.h, at32f415_crm.c
  • CRM_FLASH_PERIPH_CLOCK_SLEEP_MODE : at32f415_crm.h
  • CRM_GPIOA_PERIPH_CLOCK : at32f415_crm.h
  • CRM_GPIOA_PERIPH_RESET : at32f415_crm.h
  • CRM_GPIOB_PERIPH_CLOCK : at32f415_crm.h
  • CRM_GPIOB_PERIPH_RESET : at32f415_crm.h
  • CRM_GPIOC_PERIPH_CLOCK : at32f415_crm.h
  • CRM_GPIOC_PERIPH_RESET : at32f415_crm.h
  • CRM_GPIOD_PERIPH_CLOCK : at32f415_crm.h
  • CRM_GPIOD_PERIPH_RESET : at32f415_crm.h
  • CRM_GPIOF_PERIPH_CLOCK : at32f415_crm.h
  • CRM_GPIOF_PERIPH_RESET : at32f415_crm.h
  • crm_hext_bypass() : at32f415_crm.h, at32f415_crm.c
  • CRM_HEXT_READY_INT_FLAG : at32f415_crm.h
  • CRM_HEXT_STABLE_FLAG : at32f415_crm.h
  • CRM_HEXT_STABLE_INT : at32f415_crm.h
  • crm_hext_stable_wait() : at32f415_crm.h, at32f415_crm.c
  • CRM_HICK48_DIV6 : at32f415_crm.h
  • CRM_HICK48_NODIV : at32f415_crm.h
  • crm_hick_clock_calibration_set() : at32f415_crm.h, at32f415_crm.c
  • crm_hick_clock_trimming_set() : at32f415_crm.h, at32f415_crm.c
  • crm_hick_div_6_type : at32f415_crm.h
  • crm_hick_divider_select() : at32f415_crm.h, at32f415_crm.c
  • CRM_HICK_READY_INT_FLAG : at32f415_crm.h
  • CRM_HICK_SCLK_48MHZ : at32f415_crm.h
  • CRM_HICK_SCLK_8MHZ : at32f415_crm.h
  • crm_hick_sclk_frequency_select() : at32f415_crm.h, at32f415_crm.c
  • crm_hick_sclk_frequency_type : at32f415_crm.h
  • CRM_HICK_STABLE_FLAG : at32f415_crm.h
  • CRM_HICK_STABLE_INT : at32f415_crm.h
  • CRM_I2C1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_I2C1_PERIPH_RESET : at32f415_crm.h
  • CRM_I2C2_PERIPH_CLOCK : at32f415_crm.h
  • CRM_I2C2_PERIPH_RESET : at32f415_crm.h
  • crm_interrupt_enable() : at32f415_crm.h, at32f415_crm.c
  • CRM_IOMUX_PERIPH_CLOCK : at32f415_crm.h
  • CRM_IOMUX_PERIPH_RESET : at32f415_crm.h
  • CRM_IRQn : at32f415.h
  • crm_lext_bypass() : at32f415_crm.h, at32f415_crm.c
  • CRM_LEXT_READY_INT_FLAG : at32f415_crm.h
  • CRM_LEXT_STABLE_FLAG : at32f415_crm.h
  • CRM_LEXT_STABLE_INT : at32f415_crm.h
  • CRM_LICK_READY_INT_FLAG : at32f415_crm.h
  • CRM_LICK_STABLE_FLAG : at32f415_crm.h
  • CRM_LICK_STABLE_INT : at32f415_crm.h
  • CRM_LOWPOWER_RESET_FLAG : at32f415_crm.h
  • CRM_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • CRM_NRST_RESET_FLAG : at32f415_crm.h
  • CRM_OTGFS1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_OTGFS1_PERIPH_RESET : at32f415_crm.h
  • crm_otgfs_ep3_remap_enable() : at32f415_crm.h, at32f415_crm.c
  • crm_periph_clock_enable() : at32f415_crm.h, at32f415_crm.c
  • crm_periph_clock_sleepmd_type : at32f415_crm.h
  • crm_periph_clock_type : at32f415_crm.h
  • crm_periph_reset() : at32f415_crm.h, at32f415_crm.c
  • crm_periph_reset_type : at32f415_crm.h
  • crm_periph_sleep_mode_clock_enable() : at32f415_crm.h, at32f415_crm.c
  • crm_pll_clock_source_type : at32f415_crm.h
  • crm_pll_config() : at32f415_crm.h, at32f415_crm.c
  • crm_pll_config2() : at32f415_crm.h, at32f415_crm.c
  • CRM_PLL_FR_1 : at32f415_crm.h
  • CRM_PLL_FR_16 : at32f415_crm.h
  • CRM_PLL_FR_2 : at32f415_crm.h
  • CRM_PLL_FR_32 : at32f415_crm.h
  • CRM_PLL_FR_4 : at32f415_crm.h
  • CRM_PLL_FR_8 : at32f415_crm.h
  • crm_pll_fr_type : at32f415_crm.h
  • CRM_PLL_FREF_12M : at32f415_crm.h
  • CRM_PLL_FREF_16M : at32f415_crm.h
  • CRM_PLL_FREF_25M : at32f415_crm.h
  • CRM_PLL_FREF_4M : at32f415_crm.h
  • CRM_PLL_FREF_6M : at32f415_crm.h
  • CRM_PLL_FREF_8M : at32f415_crm.h
  • crm_pll_fref_type : at32f415_crm.h
  • CRM_PLL_MULT_10 : at32f415_crm.h
  • CRM_PLL_MULT_11 : at32f415_crm.h
  • CRM_PLL_MULT_12 : at32f415_crm.h
  • CRM_PLL_MULT_13 : at32f415_crm.h
  • CRM_PLL_MULT_14 : at32f415_crm.h
  • CRM_PLL_MULT_15 : at32f415_crm.h
  • CRM_PLL_MULT_16 : at32f415_crm.h
  • CRM_PLL_MULT_17 : at32f415_crm.h
  • CRM_PLL_MULT_18 : at32f415_crm.h
  • CRM_PLL_MULT_19 : at32f415_crm.h
  • CRM_PLL_MULT_2 : at32f415_crm.h
  • CRM_PLL_MULT_20 : at32f415_crm.h
  • CRM_PLL_MULT_21 : at32f415_crm.h
  • CRM_PLL_MULT_22 : at32f415_crm.h
  • CRM_PLL_MULT_23 : at32f415_crm.h
  • CRM_PLL_MULT_24 : at32f415_crm.h
  • CRM_PLL_MULT_25 : at32f415_crm.h
  • CRM_PLL_MULT_26 : at32f415_crm.h
  • CRM_PLL_MULT_27 : at32f415_crm.h
  • CRM_PLL_MULT_28 : at32f415_crm.h
  • CRM_PLL_MULT_29 : at32f415_crm.h
  • CRM_PLL_MULT_3 : at32f415_crm.h
  • CRM_PLL_MULT_30 : at32f415_crm.h
  • CRM_PLL_MULT_31 : at32f415_crm.h
  • CRM_PLL_MULT_32 : at32f415_crm.h
  • CRM_PLL_MULT_33 : at32f415_crm.h
  • CRM_PLL_MULT_34 : at32f415_crm.h
  • CRM_PLL_MULT_35 : at32f415_crm.h
  • CRM_PLL_MULT_36 : at32f415_crm.h
  • CRM_PLL_MULT_37 : at32f415_crm.h
  • CRM_PLL_MULT_38 : at32f415_crm.h
  • CRM_PLL_MULT_39 : at32f415_crm.h
  • CRM_PLL_MULT_4 : at32f415_crm.h
  • CRM_PLL_MULT_40 : at32f415_crm.h
  • CRM_PLL_MULT_41 : at32f415_crm.h
  • CRM_PLL_MULT_42 : at32f415_crm.h
  • CRM_PLL_MULT_43 : at32f415_crm.h
  • CRM_PLL_MULT_44 : at32f415_crm.h
  • CRM_PLL_MULT_45 : at32f415_crm.h
  • CRM_PLL_MULT_46 : at32f415_crm.h
  • CRM_PLL_MULT_47 : at32f415_crm.h
  • CRM_PLL_MULT_48 : at32f415_crm.h
  • CRM_PLL_MULT_49 : at32f415_crm.h
  • CRM_PLL_MULT_5 : at32f415_crm.h
  • CRM_PLL_MULT_50 : at32f415_crm.h
  • CRM_PLL_MULT_51 : at32f415_crm.h
  • CRM_PLL_MULT_52 : at32f415_crm.h
  • CRM_PLL_MULT_53 : at32f415_crm.h
  • CRM_PLL_MULT_54 : at32f415_crm.h
  • CRM_PLL_MULT_55 : at32f415_crm.h
  • CRM_PLL_MULT_56 : at32f415_crm.h
  • CRM_PLL_MULT_57 : at32f415_crm.h
  • CRM_PLL_MULT_58 : at32f415_crm.h
  • CRM_PLL_MULT_59 : at32f415_crm.h
  • CRM_PLL_MULT_6 : at32f415_crm.h
  • CRM_PLL_MULT_60 : at32f415_crm.h
  • CRM_PLL_MULT_61 : at32f415_crm.h
  • CRM_PLL_MULT_62 : at32f415_crm.h
  • CRM_PLL_MULT_63 : at32f415_crm.h
  • CRM_PLL_MULT_64 : at32f415_crm.h
  • CRM_PLL_MULT_7 : at32f415_crm.h
  • CRM_PLL_MULT_8 : at32f415_crm.h
  • CRM_PLL_MULT_9 : at32f415_crm.h
  • crm_pll_mult_type : at32f415_crm.h
  • CRM_PLL_READY_INT_FLAG : at32f415_crm.h
  • CRM_PLL_SOURCE_HEXT : at32f415_crm.h
  • CRM_PLL_SOURCE_HEXT_DIV : at32f415_crm.h
  • CRM_PLL_SOURCE_HICK : at32f415_crm.h
  • CRM_PLL_STABLE_FLAG : at32f415_crm.h
  • CRM_PLL_STABLE_INT : at32f415_crm.h
  • CRM_POR_RESET_FLAG : at32f415_crm.h
  • CRM_PWC_PERIPH_CLOCK : at32f415_crm.h
  • CRM_PWC_PERIPH_RESET : at32f415_crm.h
  • CRM_REG : at32f415_crm.h
  • CRM_REG_BIT : at32f415_crm.h
  • crm_reset() : at32f415_crm.h, at32f415_crm.c
  • CRM_SCLK_HEXT : at32f415_crm.h
  • CRM_SCLK_HICK : at32f415_crm.h
  • CRM_SCLK_PLL : at32f415_crm.h
  • crm_sclk_type : at32f415_crm.h
  • CRM_SDIO1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_SPI1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_SPI1_PERIPH_RESET : at32f415_crm.h
  • CRM_SPI2_PERIPH_CLOCK : at32f415_crm.h
  • CRM_SPI2_PERIPH_RESET : at32f415_crm.h
  • CRM_SRAM_PERIPH_CLOCK_SLEEP_MODE : at32f415_crm.h
  • CRM_SW_RESET_FLAG : at32f415_crm.h
  • crm_sysclk_switch() : at32f415_crm.h, at32f415_crm.c
  • crm_sysclk_switch_status_get() : at32f415_crm.h, at32f415_crm.c
  • CRM_TMR10_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR10_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR11_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR11_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR1_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR2_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR2_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR3_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR3_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR4_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR4_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR5_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR5_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR9_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR9_PERIPH_RESET : at32f415_crm.h
  • CRM_UART4_PERIPH_CLOCK : at32f415_crm.h
  • CRM_UART4_PERIPH_RESET : at32f415_crm.h
  • CRM_UART5_PERIPH_CLOCK : at32f415_crm.h
  • CRM_UART5_PERIPH_RESET : at32f415_crm.h
  • CRM_USART1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_USART1_PERIPH_RESET : at32f415_crm.h
  • CRM_USART2_PERIPH_CLOCK : at32f415_crm.h
  • CRM_USART2_PERIPH_RESET : at32f415_crm.h
  • CRM_USART3_PERIPH_CLOCK : at32f415_crm.h
  • CRM_USART3_PERIPH_RESET : at32f415_crm.h
  • crm_usb_clock_div_set() : at32f415_crm.h, at32f415_crm.c
  • CRM_USB_CLOCK_SOURCE_HICK : at32f415_crm.h
  • CRM_USB_CLOCK_SOURCE_PLL : at32f415_crm.h
  • crm_usb_clock_source_select() : at32f415_crm.h, at32f415_crm.c
  • crm_usb_clock_source_type : at32f415_crm.h
  • CRM_USB_DIV_1 : at32f415_crm.h
  • CRM_USB_DIV_1_5 : at32f415_crm.h
  • CRM_USB_DIV_2 : at32f415_crm.h
  • CRM_USB_DIV_2_5 : at32f415_crm.h
  • CRM_USB_DIV_3 : at32f415_crm.h
  • CRM_USB_DIV_3_5 : at32f415_crm.h
  • CRM_USB_DIV_4 : at32f415_crm.h
  • crm_usb_div_type : at32f415_crm.h
  • crm_usbdiv_reset() : at32f415_crm.h, at32f415_crm.c
  • CRM_WDT_RESET_FLAG : at32f415_crm.h
  • CRM_WWDT_PERIPH_CLOCK : at32f415_crm.h
  • CRM_WWDT_PERIPH_RESET : at32f415_crm.h
  • CRM_WWDT_RESET_FLAG : at32f415_crm.h
  • csd_table : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • CSW_BCSWSTATUS_FAILED : msc_bot_scsi.h
  • CSW_BCSWSTATUS_PASS : msc_bot_scsi.h
  • CSW_BCSWSTATUS_PHASE_ERR : msc_bot_scsi.h
  • CSW_CMD_LENGTH : msc_bot_scsi.h
  • CSW_DCSWSIGNATURE : msc_bot_scsi.h
  • csw_struct : msc_bot_scsi.c, msc_class.c
  • custom_hid_class_handler : custom_hid_class.c, custom_hid_class.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- d -

  • DATA1_VAL : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • DATA2_VAL : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • DATA3_VAL : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • DATA4_VAL : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • data_buffer : project/at_start_f415/examples/crc/calculation/src/main.c
  • data_count : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/hw_flow_control/src/main.c
  • data_counter_end : project/at_start_f415/examples/dma/flash_to_sram/src/main.c
  • data_take() : bootloader/src/iap.c
  • DCFG_PERFRINT_80 : at32f415_usb.h
  • DCFG_PERFRINT_85 : at32f415_usb.h
  • DCFG_PERFRINT_90 : at32f415_usb.h
  • DCFG_PERFRINT_95 : at32f415_usb.h
  • dcfg_perfrint_type : at32f415_usb.h
  • DEBUG_BASE : at32f415.h
  • DEBUG_CAN1_PAUSE : at32f415_debug.h
  • debug_device_id_get() : at32f415_debug.h, at32f415_debug.c
  • DEBUG_I2C1_SMBUS_TIMEOUT : at32f415_debug.h
  • DEBUG_I2C2_SMBUS_TIMEOUT : at32f415_debug.h
  • DEBUG_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • debug_periph_mode_set() : at32f415_debug.h, at32f415_debug.c
  • DEBUG_SLEEP : at32f415_debug.h
  • DEBUG_STANDBY : at32f415_debug.h
  • DEBUG_STOP : at32f415_debug.h
  • DEBUG_TMR10_PAUSE : at32f415_debug.h
  • DEBUG_TMR11_PAUSE : at32f415_debug.h
  • DEBUG_TMR1_PAUSE : at32f415_debug.h
  • DEBUG_TMR2_PAUSE : at32f415_debug.h
  • DEBUG_TMR3_PAUSE : at32f415_debug.h
  • DEBUG_TMR4_PAUSE : at32f415_debug.h
  • DEBUG_TMR5_PAUSE : at32f415_debug.h
  • DEBUG_TMR9_PAUSE : at32f415_debug.h
  • DEBUG_WDT_PAUSE : at32f415_debug.h
  • DEBUG_WWDT_PAUSE : at32f415_debug.h
  • DEBUGMCU : at32f415_debug.h
  • DebugMon_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_freertos_demo/src/at32f415_int.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • DebugMonitor_IRQn : at32f415.h
  • delay() : project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c
  • DELAY : project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c, project/at_start_f415/templates/src/main.c
  • delay_init() : at32f415_board.c, at32f415_board.h
  • delay_ms() : at32f415_board.c, at32f415_board.h
  • delay_sec() : at32f415_board.c, at32f415_board.h
  • delay_us() : at32f415_board.c, at32f415_board.h
  • desc_handler : cdc_desc.c, cdc_desc.h, printer_desc.c, printer_desc.h
  • DEV_MMC : diskio.c, usbh_msc_diskio.c
  • DEV_RAM : diskio.c, usbh_msc_diskio.c
  • DEV_USB : diskio.c, usbh_msc_diskio.c
  • device_descriptor : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • DEVICE_ID_ADDR1 : random.c
  • device_mode : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • disk_initialize() : diskio.c, usbh_msc_diskio.c
  • disk_ioctl() : diskio.c, usbh_msc_diskio.c
  • disk_read() : diskio.c, usbh_msc_diskio.c
  • disk_status() : diskio.c, usbh_msc_diskio.c
  • disk_write() : diskio.c, usbh_msc_diskio.c
  • div_value : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/one_cycle/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c
  • DMA1 : at32f415_dma.h
  • DMA1_BASE : at32f415.h
  • DMA1_CHANNEL1 : at32f415_dma.h
  • DMA1_CHANNEL1_BASE : at32f415.h
  • DMA1_Channel1_IRQHandler() : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c
  • DMA1_Channel1_IRQn : at32f415.h
  • DMA1_CHANNEL2 : at32f415_dma.h
  • DMA1_CHANNEL2_BASE : at32f415.h
  • DMA1_Channel2_IRQHandler() : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c
  • DMA1_Channel2_IRQn : at32f415.h
  • DMA1_CHANNEL3 : at32f415_dma.h
  • DMA1_CHANNEL3_BASE : at32f415.h
  • DMA1_Channel3_IRQHandler() : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • DMA1_Channel3_IRQn : at32f415.h
  • DMA1_CHANNEL4 : at32f415_dma.h
  • DMA1_CHANNEL4_BASE : at32f415.h
  • DMA1_Channel4_IRQHandler() : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • DMA1_Channel4_IRQn : at32f415.h
  • DMA1_CHANNEL5 : at32f415_dma.h
  • DMA1_CHANNEL5_BASE : at32f415.h
  • DMA1_Channel5_IRQn : at32f415.h
  • DMA1_CHANNEL6 : at32f415_dma.h
  • DMA1_CHANNEL6_BASE : at32f415.h
  • DMA1_Channel6_IRQHandler() : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • DMA1_Channel6_IRQn : at32f415.h
  • DMA1_CHANNEL7 : at32f415_dma.h
  • DMA1_CHANNEL7_BASE : at32f415.h
  • DMA1_Channel7_IRQHandler() : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • DMA1_Channel7_IRQn : at32f415.h
  • DMA1_DTERR1_FLAG : at32f415_dma.h
  • DMA1_DTERR2_FLAG : at32f415_dma.h
  • DMA1_DTERR3_FLAG : at32f415_dma.h
  • DMA1_DTERR4_FLAG : at32f415_dma.h
  • DMA1_DTERR5_FLAG : at32f415_dma.h
  • DMA1_DTERR6_FLAG : at32f415_dma.h
  • DMA1_DTERR7_FLAG : at32f415_dma.h
  • DMA1_FDT1_FLAG : at32f415_dma.h
  • DMA1_FDT2_FLAG : at32f415_dma.h
  • DMA1_FDT3_FLAG : at32f415_dma.h
  • DMA1_FDT4_FLAG : at32f415_dma.h
  • DMA1_FDT5_FLAG : at32f415_dma.h
  • DMA1_FDT6_FLAG : at32f415_dma.h
  • DMA1_FDT7_FLAG : at32f415_dma.h
  • DMA1_GL1_FLAG : at32f415_dma.h
  • DMA1_GL2_FLAG : at32f415_dma.h
  • DMA1_GL3_FLAG : at32f415_dma.h
  • DMA1_GL4_FLAG : at32f415_dma.h
  • DMA1_GL5_FLAG : at32f415_dma.h
  • DMA1_GL6_FLAG : at32f415_dma.h
  • DMA1_GL7_FLAG : at32f415_dma.h
  • DMA1_HDT1_FLAG : at32f415_dma.h
  • DMA1_HDT2_FLAG : at32f415_dma.h
  • DMA1_HDT3_FLAG : at32f415_dma.h
  • DMA1_HDT4_FLAG : at32f415_dma.h
  • DMA1_HDT5_FLAG : at32f415_dma.h
  • DMA1_HDT6_FLAG : at32f415_dma.h
  • DMA1_HDT7_FLAG : at32f415_dma.h
  • DMA2 : at32f415_dma.h
  • DMA2_BASE : at32f415.h
  • DMA2_CHANNEL1 : at32f415_dma.h
  • DMA2_CHANNEL1_BASE : at32f415.h
  • DMA2_Channel1_IRQHandler() : project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c
  • DMA2_Channel1_IRQn : at32f415.h
  • DMA2_CHANNEL2 : at32f415_dma.h
  • DMA2_CHANNEL2_BASE : at32f415.h
  • DMA2_Channel2_IRQn : at32f415.h
  • DMA2_CHANNEL3 : at32f415_dma.h
  • DMA2_CHANNEL3_BASE : at32f415.h
  • DMA2_Channel3_IRQn : at32f415.h
  • DMA2_CHANNEL4 : at32f415_dma.h
  • DMA2_Channel4_5_IRQn : at32f415.h
  • DMA2_CHANNEL4_BASE : at32f415.h
  • DMA2_CHANNEL5 : at32f415_dma.h
  • DMA2_CHANNEL5_BASE : at32f415.h
  • DMA2_CHANNEL6 : at32f415_dma.h
  • DMA2_Channel6_7_IRQn : at32f415.h
  • DMA2_CHANNEL6_BASE : at32f415.h
  • DMA2_CHANNEL7 : at32f415_dma.h
  • DMA2_CHANNEL7_BASE : at32f415.h
  • DMA2_DTERR1_FLAG : at32f415_dma.h
  • DMA2_DTERR2_FLAG : at32f415_dma.h
  • DMA2_DTERR3_FLAG : at32f415_dma.h
  • DMA2_DTERR4_FLAG : at32f415_dma.h
  • DMA2_DTERR5_FLAG : at32f415_dma.h
  • DMA2_DTERR6_FLAG : at32f415_dma.h
  • DMA2_DTERR7_FLAG : at32f415_dma.h
  • DMA2_FDT1_FLAG : at32f415_dma.h
  • DMA2_FDT2_FLAG : at32f415_dma.h
  • DMA2_FDT3_FLAG : at32f415_dma.h
  • DMA2_FDT4_FLAG : at32f415_dma.h
  • DMA2_FDT5_FLAG : at32f415_dma.h
  • DMA2_FDT6_FLAG : at32f415_dma.h
  • DMA2_FDT7_FLAG : at32f415_dma.h
  • DMA2_GL1_FLAG : at32f415_dma.h
  • DMA2_GL2_FLAG : at32f415_dma.h
  • DMA2_GL3_FLAG : at32f415_dma.h
  • DMA2_GL4_FLAG : at32f415_dma.h
  • DMA2_GL5_FLAG : at32f415_dma.h
  • DMA2_GL6_FLAG : at32f415_dma.h
  • DMA2_GL7_FLAG : at32f415_dma.h
  • DMA2_HDT1_FLAG : at32f415_dma.h
  • DMA2_HDT2_FLAG : at32f415_dma.h
  • DMA2_HDT3_FLAG : at32f415_dma.h
  • DMA2_HDT4_FLAG : at32f415_dma.h
  • DMA2_HDT5_FLAG : at32f415_dma.h
  • DMA2_HDT6_FLAG : at32f415_dma.h
  • DMA2_HDT7_FLAG : at32f415_dma.h
  • DMA_BUFFER_SIZE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • dma_channel_enable() : at32f415_dma.h, at32f415_dma.c
  • dma_config() : project/at_start_f415/examples/adc/current_vref_value_check/src/main.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c, project/at_start_f415/examples/adc/voltage_monitoring/src/main.c
  • dma_configuration() : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • dma_data_number_get() : at32f415_dma.h, at32f415_dma.c
  • dma_data_number_set() : at32f415_dma.h, at32f415_dma.c
  • dma_default_para_init() : at32f415_dma.h, at32f415_dma.c
  • DMA_DIR_MEMORY_TO_MEMORY : at32f415_dma.h
  • DMA_DIR_MEMORY_TO_PERIPHERAL : at32f415_dma.h
  • DMA_DIR_PERIPHERAL_TO_MEMORY : at32f415_dma.h
  • dma_dir_type : at32f415_dma.h
  • DMA_DTERR_INT : at32f415_dma.h
  • DMA_FDT_INT : at32f415_dma.h
  • dma_flag_clear() : at32f415_dma.h, at32f415_dma.c
  • dma_flag_get() : at32f415_dma.h, at32f415_dma.c
  • DMA_FLEXIBLE_ADC1 : at32f415_dma.h
  • dma_flexible_config() : at32f415_dma.h, at32f415_dma.c
  • DMA_FLEXIBLE_I2C1_RX : at32f415_dma.h
  • DMA_FLEXIBLE_I2C1_TX : at32f415_dma.h
  • DMA_FLEXIBLE_I2C2_RX : at32f415_dma.h
  • DMA_FLEXIBLE_I2C2_TX : at32f415_dma.h
  • dma_flexible_request_type : at32f415_dma.h
  • DMA_FLEXIBLE_SDIO1 : at32f415_dma.h
  • DMA_FLEXIBLE_SPI1_RX : at32f415_dma.h
  • DMA_FLEXIBLE_SPI1_TX : at32f415_dma.h
  • DMA_FLEXIBLE_SPI2_RX : at32f415_dma.h
  • DMA_FLEXIBLE_SPI2_TX : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_CH1 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_CH2 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_CH3 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_CH4 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_HALL : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_OVERFLOW : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_TRIG : at32f415_dma.h
  • DMA_FLEXIBLE_TMR2_CH1 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR2_CH2 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR2_CH3 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR2_CH4 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR2_OVERFLOW : at32f415_dma.h
  • DMA_FLEXIBLE_TMR2_TRIG : at32f415_dma.h
  • DMA_FLEXIBLE_TMR3_CH1 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR3_CH2 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR3_CH3 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR3_CH4 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR3_OVERFLOW : at32f415_dma.h
  • DMA_FLEXIBLE_TMR3_TRIG : at32f415_dma.h
  • DMA_FLEXIBLE_TMR4_CH1 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR4_CH2 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR4_CH3 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR4_CH4 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR4_OVERFLOW : at32f415_dma.h
  • DMA_FLEXIBLE_TMR4_TRIG : at32f415_dma.h
  • DMA_FLEXIBLE_TMR5_CH1 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR5_CH2 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR5_CH3 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR5_CH4 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR5_OVERFLOW : at32f415_dma.h
  • DMA_FLEXIBLE_TMR5_TRIG : at32f415_dma.h
  • DMA_FLEXIBLE_UART1_RX : at32f415_dma.h
  • DMA_FLEXIBLE_UART1_TX : at32f415_dma.h
  • DMA_FLEXIBLE_UART2_RX : at32f415_dma.h
  • DMA_FLEXIBLE_UART2_TX : at32f415_dma.h
  • DMA_FLEXIBLE_UART3_RX : at32f415_dma.h
  • DMA_FLEXIBLE_UART3_TX : at32f415_dma.h
  • DMA_FLEXIBLE_UART4_RX : at32f415_dma.h
  • DMA_FLEXIBLE_UART4_TX : at32f415_dma.h
  • DMA_FLEXIBLE_UART5_RX : at32f415_dma.h
  • DMA_FLEXIBLE_UART5_TX : at32f415_dma.h
  • DMA_GET_HT_FLAG : i2c_application.c
  • DMA_GET_TC_FLAG : i2c_application.c
  • DMA_GET_TERR_FLAG : i2c_application.c
  • DMA_HDT_INT : at32f415_dma.h
  • dma_init() : at32f415_dma.h, at32f415_dma.c
  • dma_init_struct : project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c, project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c
  • dma_init_structure : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • dma_interrupt_enable() : at32f415_dma.h, at32f415_dma.c
  • dma_memory_data_size_type : at32f415_dma.h
  • DMA_MEMORY_DATA_WIDTH_BYTE : at32f415_dma.h
  • DMA_MEMORY_DATA_WIDTH_HALFWORD : at32f415_dma.h
  • DMA_MEMORY_DATA_WIDTH_WORD : at32f415_dma.h
  • DMA_MEMORY_INC_DISABLE : at32f415_dma.h
  • DMA_MEMORY_INC_ENABLE : at32f415_dma.h
  • dma_memory_inc_type : at32f415_dma.h
  • DMA_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • dma_peripheral_data_size_type : at32f415_dma.h
  • DMA_PERIPHERAL_DATA_WIDTH_BYTE : at32f415_dma.h
  • DMA_PERIPHERAL_DATA_WIDTH_HALFWORD : at32f415_dma.h
  • DMA_PERIPHERAL_DATA_WIDTH_WORD : at32f415_dma.h
  • DMA_PERIPHERAL_INC_DISABLE : at32f415_dma.h
  • DMA_PERIPHERAL_INC_ENABLE : at32f415_dma.h
  • dma_peripheral_inc_type : at32f415_dma.h
  • DMA_PRIORITY_HIGH : at32f415_dma.h
  • dma_priority_level_type : at32f415_dma.h
  • DMA_PRIORITY_LOW : at32f415_dma.h
  • DMA_PRIORITY_MEDIUM : at32f415_dma.h
  • DMA_PRIORITY_VERY_HIGH : at32f415_dma.h
  • dma_reset() : at32f415_dma.h, at32f415_dma.c
  • dma_trans_complete_flag : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c
  • DOWN_MOVE : mouse_class.h
  • dst_buffer : project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/usart/smartcard/src/main.c
  • duty_cycle : project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/src/main.c, project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • duty_result : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • dw_data_start_sector : utilities/at32f415_slib_demo/project_l0/src/main.c
  • dw_end_sector : utilities/at32f415_slib_demo/project_l0/src/main.c
  • dw_start_sector : utilities/at32f415_slib_demo/project_l0/src/main.c
  • DYMMY_BYTE : project/at_start_f415/examples/usart/synchronous/src/main.c
  • DZC_TIMEOUT : at32f415_can.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- e -

  • ENABLE_ERTC_ASSEED : random.h
  • endpoint_dir_type : at32f415_usb.h
  • endpoint_trans_type : at32f415_usb.h
  • EPT_BULK_TYPE : at32f415_usb.h
  • EPT_CONTROL_TYPE : at32f415_usb.h
  • EPT_DIR_IN : at32f415_usb.h
  • EPT_DIR_OUT : at32f415_usb.h
  • EPT_INT_TYPE : at32f415_usb.h
  • EPT_ISO_TYPE : at32f415_usb.h
  • ERASE_TIMEOUT : at32f415_flash.h
  • ERROR : at32f415.h
  • error_handler() : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • ERROR_ID_VAL : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • error_status : at32f415.h
  • ERTC : at32f415_ertc.h
  • ERTC_24H : at32f415_ertc.h
  • ERTC_ALA : at32f415_ertc.h
  • ERTC_ALA_INT : at32f415_ertc.h
  • ERTC_ALAF_FLAG : at32f415_ertc.h
  • ertc_alarm_config() : project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c
  • ertc_alarm_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_alarm_get() : at32f415_ertc.h, at32f415_ertc.c
  • ERTC_ALARM_MASK_ALL : at32f415_ertc.h
  • ERTC_ALARM_MASK_DATE_WEEK : at32f415_ertc.h
  • ERTC_ALARM_MASK_HOUR : at32f415_ertc.h
  • ERTC_ALARM_MASK_MIN : at32f415_ertc.h
  • ERTC_ALARM_MASK_NONE : at32f415_ertc.h
  • ERTC_ALARM_MASK_SEC : at32f415_ertc.h
  • ertc_alarm_mask_set() : at32f415_ertc.h, at32f415_ertc.c
  • ERTC_ALARM_SBS_MASK_14 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_1 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_10 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_11 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_12 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_13 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_2 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_3 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_4 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_5 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_6 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_7 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_8 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_9 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_ALL : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_NONE : at32f415_ertc.h
  • ertc_alarm_sbs_mask_type : at32f415_ertc.h
  • ertc_alarm_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_alarm_show() : project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c
  • ertc_alarm_sub_second_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_alarm_sub_second_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_alarm_type : at32f415_ertc.h
  • ertc_alarm_value_set() : project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c
  • ertc_alarm_week_date_select() : at32f415_ertc.h, at32f415_ertc.c
  • ERTC_ALAWF_FLAG : at32f415_ertc.h
  • ERTC_ALB : at32f415_ertc.h
  • ERTC_ALB_INT : at32f415_ertc.h
  • ERTC_ALBF_FLAG : at32f415_ertc.h
  • ERTC_ALBWF_FLAG : at32f415_ertc.h
  • ERTC_AM : at32f415_ertc.h
  • ertc_am_pm_type : at32f415_ertc.h
  • ERTC_BASE : at32f415.h
  • ertc_bcd_to_num() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_bpr_data_read() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_bpr_data_write() : at32f415_ertc.h, at32f415_ertc.c
  • ERTC_BPR_DT_NUMBER : project/at_start_f415/examples/ertc/bpr_domain/src/main.c, project/at_start_f415/examples/ertc/tamper/src/main.c
  • ERTC_CAL_DIR_NEGATIVE : at32f415_ertc.h
  • ERTC_CAL_DIR_POSITIVE : at32f415_ertc.h
  • ertc_cal_direction_type : at32f415_ertc.h
  • ERTC_CAL_OUTPUT_1HZ : at32f415_ertc.h
  • ERTC_CAL_OUTPUT_512HZ : at32f415_ertc.h
  • ertc_cal_output_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_cal_output_select() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_cal_output_select_type : at32f415_ertc.h
  • ertc_calendar_get() : at32f415_ertc.h, at32f415_ertc.c
  • ERTC_CALUPDF_FLAG : at32f415_ertc.h
  • ertc_clk_div_a : project/at_start_f415/examples/ertc/calendar/src/main.c, random.c
  • ertc_clk_div_b : project/at_start_f415/examples/ertc/calendar/src/main.c, random.c
  • ERTC_CLOCK_SOURCE_LEXT : project/at_start_f415/examples/ertc/calendar/src/main.c
  • ertc_coarse_calibration_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_coarse_calibration_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_config() : project/at_start_f415/examples/ertc/bpr_domain/src/main.c, project/at_start_f415/examples/ertc/calendar/src/main.c, project/at_start_f415/examples/ertc/lick_calibration/src/main.c, project/at_start_f415/examples/ertc/tamper/src/main.c, project/at_start_f415/examples/ertc/time_stamp/src/main.c, project/at_start_f415/examples/ertc/wakeup_timer/src/main.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c
  • ertc_date_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_daylight_bpr_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_daylight_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_direct_read_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_divider_set() : at32f415_ertc.h, at32f415_ertc.c
  • ERTC_DST_ADD_1H : at32f415_ertc.h
  • ERTC_DST_DEC_1H : at32f415_ertc.h
  • ertc_dst_operation_type : at32f415_ertc.h
  • ERTC_DST_SAVE_0 : at32f415_ertc.h
  • ERTC_DST_SAVE_1 : at32f415_ertc.h
  • ertc_dst_save_type : at32f415_ertc.h
  • ERTC_DT1 : at32f415_ertc.h
  • ERTC_DT10 : at32f415_ertc.h
  • ERTC_DT11 : at32f415_ertc.h
  • ERTC_DT12 : at32f415_ertc.h
  • ERTC_DT13 : at32f415_ertc.h
  • ERTC_DT14 : at32f415_ertc.h
  • ERTC_DT15 : at32f415_ertc.h
  • ERTC_DT16 : at32f415_ertc.h
  • ERTC_DT17 : at32f415_ertc.h
  • ERTC_DT18 : at32f415_ertc.h
  • ERTC_DT19 : at32f415_ertc.h
  • ERTC_DT2 : at32f415_ertc.h
  • ERTC_DT20 : at32f415_ertc.h
  • ERTC_DT3 : at32f415_ertc.h
  • ERTC_DT4 : at32f415_ertc.h
  • ERTC_DT5 : at32f415_ertc.h
  • ERTC_DT6 : at32f415_ertc.h
  • ERTC_DT7 : at32f415_ertc.h
  • ERTC_DT8 : at32f415_ertc.h
  • ERTC_DT9 : at32f415_ertc.h
  • ertc_dt_type : at32f415_ertc.h
  • ertc_flag_clear() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_flag_get() : at32f415_ertc.h, at32f415_ertc.c
  • ERTC_HOUR_MODE_12 : at32f415_ertc.h
  • ERTC_HOUR_MODE_24 : at32f415_ertc.h
  • ertc_hour_mode_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_hour_mode_set_type : at32f415_ertc.h
  • ERTC_IMF_FLAG : at32f415_ertc.h
  • ertc_init_mode_enter() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_init_mode_exit() : at32f415_ertc.h, at32f415_ertc.c
  • ERTC_INITF_FLAG : at32f415_ertc.h
  • ertc_interrupt_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_interrupt_get() : at32f415_ertc.h, at32f415_ertc.c
  • ERTC_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • ertc_num_to_bcd() : at32f415_ertc.h, at32f415_ertc.c
  • ERTC_OUTPUT_ALARM_A : at32f415_ertc.h
  • ERTC_OUTPUT_ALARM_B : at32f415_ertc.h
  • ERTC_OUTPUT_DISABLE : at32f415_ertc.h
  • ERTC_OUTPUT_POLARITY_HIGH : at32f415_ertc.h
  • ERTC_OUTPUT_POLARITY_LOW : at32f415_ertc.h
  • ertc_output_polarity_type : at32f415_ertc.h
  • ertc_output_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_output_source_type : at32f415_ertc.h
  • ertc_output_type : at32f415_ertc.h
  • ERTC_OUTPUT_TYPE_OPEN_DRAIN : at32f415_ertc.h
  • ERTC_OUTPUT_TYPE_PUSH_PULL : at32f415_ertc.h
  • ERTC_OUTPUT_WAKEUP : at32f415_ertc.h
  • ERTC_PIN_PA0 : at32f415_ertc.h
  • ERTC_PIN_PC13 : at32f415_ertc.h
  • ertc_pin_select_type : at32f415_ertc.h
  • ERTC_PM : at32f415_ertc.h
  • ertc_refer_clock_detect_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_reset() : at32f415_ertc.h, at32f415_ertc.c
  • ERTC_SLECT_DATE : at32f415_ertc.h
  • ERTC_SLECT_WEEK : at32f415_ertc.h
  • ERTC_SMOOTH_CAL_CLK_ADD_0 : at32f415_ertc.h
  • ERTC_SMOOTH_CAL_CLK_ADD_512 : at32f415_ertc.h
  • ertc_smooth_cal_clk_add_type : at32f415_ertc.h
  • ERTC_SMOOTH_CAL_PERIOD_16 : at32f415_ertc.h
  • ERTC_SMOOTH_CAL_PERIOD_32 : at32f415_ertc.h
  • ERTC_SMOOTH_CAL_PERIOD_8 : at32f415_ertc.h
  • ertc_smooth_cal_period_type : at32f415_ertc.h
  • ertc_smooth_calibration_config() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_sub_second_get() : at32f415_ertc.h, at32f415_ertc.c
  • ERTC_TADJF_FLAG : at32f415_ertc.h
  • ERTC_TAMPER_1 : at32f415_ertc.h
  • ertc_tamper_config() : project/at_start_f415/examples/ertc/tamper/src/main.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c
  • ertc_tamper_detect_freq_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_tamper_detect_freq_type : at32f415_ertc.h
  • ERTC_TAMPER_EDGE_FALLING : at32f415_ertc.h
  • ERTC_TAMPER_EDGE_HIGH : at32f415_ertc.h
  • ERTC_TAMPER_EDGE_LOW : at32f415_ertc.h
  • ERTC_TAMPER_EDGE_RISING : at32f415_ertc.h
  • ertc_tamper_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ERTC_TAMPER_FILTER_2 : at32f415_ertc.h
  • ERTC_TAMPER_FILTER_4 : at32f415_ertc.h
  • ERTC_TAMPER_FILTER_8 : at32f415_ertc.h
  • ERTC_TAMPER_FILTER_DISABLE : at32f415_ertc.h
  • ertc_tamper_filter_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_tamper_filter_type : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_1024 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_16384 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_2048 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_256 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_32768 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_4096 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_512 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_8192 : at32f415_ertc.h
  • ERTC_TAMPER_PR_1_ERTCCLK : at32f415_ertc.h
  • ERTC_TAMPER_PR_2_ERTCCLK : at32f415_ertc.h
  • ERTC_TAMPER_PR_4_ERTCCLK : at32f415_ertc.h
  • ERTC_TAMPER_PR_8_ERTCCLK : at32f415_ertc.h
  • ertc_tamper_precharge_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_tamper_precharge_type : at32f415_ertc.h
  • ertc_tamper_pull_up_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_tamper_select_type : at32f415_ertc.h
  • ertc_tamper_timestamp_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_tamper_valid_edge_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_tamper_valid_edge_type : at32f415_ertc.h
  • ERTC_TIME_ADD_1S : at32f415_ertc.h
  • ERTC_TIME_ADD_NONE : at32f415_ertc.h
  • ertc_time_adjust() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_time_adjust_type : at32f415_ertc.h
  • ertc_time_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_time_show() : project/at_start_f415/examples/ertc/calendar/src/main.c, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c
  • ERTC_TIMEOUT : at32f415_ertc.c
  • ertc_timestamp_config() : project/at_start_f415/examples/ertc/time_stamp/src/main.c
  • ERTC_TIMESTAMP_EDGE_FALLING : at32f415_ertc.h
  • ERTC_TIMESTAMP_EDGE_RISING : at32f415_ertc.h
  • ertc_timestamp_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_timestamp_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_timestamp_show() : project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c
  • ertc_timestamp_sub_second_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_timestamp_valid_edge_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_timestamp_valid_edge_type : at32f415_ertc.h
  • ERTC_TP1F_FLAG : at32f415_ertc.h
  • ERTC_TP_INT : at32f415_ertc.h
  • ERTC_TS_INT : at32f415_ertc.h
  • ERTC_TSF_FLAG : at32f415_ertc.h
  • ERTC_TSOF_FLAG : at32f415_ertc.h
  • ERTC_UPDF_FLAG : at32f415_ertc.h
  • ertc_wait_flag() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_wait_update() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_wakeup_clock_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_wakeup_clock_type : at32f415_ertc.h
  • ertc_wakeup_counter_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_wakeup_counter_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_wakeup_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_wakeup_show() : project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c
  • ERTC_WAT_CLK_CK_A_16BITS : at32f415_ertc.h
  • ERTC_WAT_CLK_CK_A_17BITS : at32f415_ertc.h
  • ERTC_WAT_CLK_ERTCCLK_DIV16 : at32f415_ertc.h
  • ERTC_WAT_CLK_ERTCCLK_DIV2 : at32f415_ertc.h
  • ERTC_WAT_CLK_ERTCCLK_DIV4 : at32f415_ertc.h
  • ERTC_WAT_CLK_ERTCCLK_DIV8 : at32f415_ertc.h
  • ERTC_WAT_INT : at32f415_ertc.h
  • ERTC_WATF_FLAG : at32f415_ertc.h
  • ERTC_WATWF_FLAG : at32f415_ertc.h
  • ertc_week_date_select_type : at32f415_ertc.h
  • ERTC_WKUP_IRQHandler() : project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c
  • ERTC_WKUP_IRQn : at32f415.h
  • ertc_write_protect_disable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_write_protect_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ERTCAlarm_IRQHandler() : project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c
  • ERTCAlarm_IRQn : at32f415.h
  • EXINT : at32f415_exint.h
  • EXINT0_IRQHandler() : project/at_start_f415/examples/exint/exint_config/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/templates/src/main.c
  • EXINT0_IRQn : at32f415.h
  • EXINT15_10_IRQn : at32f415.h
  • EXINT1_IRQn : at32f415.h
  • EXINT2_IRQn : at32f415.h
  • EXINT3_IRQn : at32f415.h
  • EXINT4_IRQHandler() : project/at_start_f415/examples/exint/exint_software_trigger/src/main.c
  • EXINT4_IRQn : at32f415.h
  • EXINT9_5_IRQHandler() : project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c
  • EXINT9_5_IRQn : at32f415.h
  • EXINT_BASE : at32f415.h
  • exint_config() : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c
  • exint_default_para_init() : at32f415_exint.h, at32f415_exint.c
  • exint_event_enable() : at32f415_exint.h, at32f415_exint.c
  • exint_flag_clear() : at32f415_exint.h, at32f415_exint.c
  • exint_flag_get() : at32f415_exint.h, at32f415_exint.c
  • exint_init() : at32f415_exint.h, at32f415_exint.c
  • exint_interrupt_enable() : at32f415_exint.h, at32f415_exint.c
  • exint_line0_config() : project/at_start_f415/examples/exint/exint_config/src/main.c
  • exint_line4_config() : project/at_start_f415/examples/exint/exint_software_trigger/src/main.c
  • EXINT_LINE_0 : at32f415_exint.h
  • EXINT_LINE_1 : at32f415_exint.h
  • EXINT_LINE_10 : at32f415_exint.h
  • EXINT_LINE_11 : at32f415_exint.h
  • EXINT_LINE_12 : at32f415_exint.h
  • EXINT_LINE_13 : at32f415_exint.h
  • EXINT_LINE_14 : at32f415_exint.h
  • EXINT_LINE_15 : at32f415_exint.h
  • EXINT_LINE_16 : at32f415_exint.h
  • EXINT_LINE_17 : at32f415_exint.h
  • EXINT_LINE_18 : at32f415_exint.h
  • EXINT_LINE_19 : at32f415_exint.h
  • EXINT_LINE_2 : at32f415_exint.h
  • EXINT_LINE_20 : at32f415_exint.h
  • EXINT_LINE_21 : at32f415_exint.h
  • EXINT_LINE_22 : at32f415_exint.h
  • EXINT_LINE_3 : at32f415_exint.h
  • EXINT_LINE_4 : at32f415_exint.h
  • EXINT_LINE_5 : at32f415_exint.h
  • EXINT_LINE_6 : at32f415_exint.h
  • EXINT_LINE_7 : at32f415_exint.h
  • EXINT_LINE_8 : at32f415_exint.h
  • EXINT_LINE_9 : at32f415_exint.h
  • EXINT_LINE_EVENT : at32f415_exint.h
  • EXINT_LINE_INTERRUPUT : at32f415_exint.h
  • exint_line_mode_type : at32f415_exint.h
  • EXINT_LINE_NONE : at32f415_exint.h
  • EXINT_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • exint_polarity_config_type : at32f415_exint.h
  • exint_reset() : at32f415_exint.h, at32f415_exint.c
  • exint_software_interrupt_event_generate() : at32f415_exint.h, at32f415_exint.c
  • EXINT_TRIGGER_BOTH_EDGE : at32f415_exint.h
  • EXINT_TRIGGER_FALLING_EDGE : at32f415_exint.h
  • EXINT_TRIGGER_RISING_EDGE : at32f415_exint.h
  • EXT_CSD_BUS_WIDTH : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_Clear_byte : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_CMD_SET_CPSECURE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_CMD_SET_NORMAL : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_CMD_SET_SECURE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_Command_set : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_HS_TIMING : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_Set_bit : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_Write_byte : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- f -

  • fac_ms : at32f415_board.c
  • fac_us : at32f415_board.c
  • FALSE : at32f415.h
  • FAP_HIGH_LEVEL_KEY : at32f415_flash.h
  • FAP_RELIEVE_KEY : at32f415_flash.h
  • FAST : project/at_start_f415/templates/src/main.c
  • FAT16_BYTE_PER_SIZE : flash_fat16.h
  • FAT16_DIR_SIZE : flash_fat16.h
  • fat16_file_name : flash_fat16.c
  • FAT16_FILENAME_SIZE : flash_fat16.h
  • fat16_memory_cmp() : flash_fat16.c
  • fat16_memory_copy() : flash_fat16.c
  • fat16_memory_memset() : flash_fat16.c
  • fat16_root_dir_sector : flash_fat16.c
  • fat16_sector : flash_fat16.c
  • FAT16_SECTOR_SIZE : flash_fat16.h, flash_fat16.c
  • fat16_table_sector0 : flash_fat16.c
  • FAT16_TABLE_SIZE : flash_fat16.h
  • fatfs_test() : project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c
  • FEEDBACK_REFRESH_TIME : audio_class.h, audio_hid_class.h
  • FF_CODE_PAGE : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_EXFAT : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_LOCK : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_MINIMIZE : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_NOFSINFO : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_NORTC : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_READONLY : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_REENTRANT : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_RPATH : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_TIMEOUT : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_TINY : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_LBA64 : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_LFN_BUF : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_LFN_UNICODE : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_MAX_LFN : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_MAX_SS : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_MIN_GPT : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_MIN_SS : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_MULTI_PARTITION : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_NORTC_MDAY : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_NORTC_MON : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_NORTC_YEAR : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_PRINT_FLOAT : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_PRINT_LLI : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_SFN_BUF : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_STR_VOLUME_ID : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_STRF_ENCODE : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_SYNC_t : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_CHMOD : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_EXPAND : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_FASTSEEK : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_FIND : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_FORWARD : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_LABEL : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_LFN : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_MKFS : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_STRFUNC : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_TRIM : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_VOLUME_STRS : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_VOLUMES : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FFCONF_DEF : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • file : project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c, msc_only_fat32/src/usbh_user.c
  • FILE_SUFFIX1_LEN : flash_fat16.h
  • FILE_SUFFIX1_NAME : flash_fat16.h
  • FILE_SUFFIX2_LEN : flash_fat16.h
  • FILE_SUFFIX2_NAME : flash_fat16.h
  • file_write_nr : flash_fat16.c
  • FILTER_EXT_ID1 : project/at_start_f415/examples/can/filter/src/main.c
  • FILTER_EXT_ID2 : project/at_start_f415/examples/can/filter/src/main.c
  • FILTER_EXT_ID3 : project/at_start_f415/examples/can/filter/src/main.c
  • FILTER_STD_ID1 : project/at_start_f415/examples/can/filter/src/main.c
  • FILTER_STD_ID2 : project/at_start_f415/examples/can/filter/src/main.c
  • FILTER_STD_ID3 : project/at_start_f415/examples/can/filter/src/main.c
  • FIR_lowpass_filter() : project_l0/inc/fir_filter.h, fir_filter.c, project_l1/inc/fir_filter.h
  • firCoeffs32 : fir_coefficient.c, fir_filter.c
  • firStateF32 : fir_filter.c
  • flag_status : at32f415.h
  • FLASH : at32f415_flash.h
  • flash_2kb_write() : utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c
  • FLASH_APP_ADDRESS : app_led3_toggle/inc/hid_iap_user.h, app_led4_toggle/inc/hid_iap_user.h, bootloader/inc/hid_iap_user.h
  • FLASH_APP_START_ADDR : flash_fat16.h
  • FLASH_BASE : at32f415.h
  • flash_boot_memory_extension_mode_enable() : at32f415_flash.h, at32f415_flash.c
  • flash_buf : project/at_start_f415/examples/flash/flash_write_read/src/flash.c
  • flash_byte_program() : at32f415_flash.h, at32f415_flash.c
  • flash_crc_calibrate() : at32f415_flash.h, at32f415_flash.c
  • flash_crc_check() : flash_fat16.c
  • FLASH_CS_HIGH : spi_flash.h
  • FLASH_CS_LOW : spi_flash.h
  • flash_em_slib_datastart_sector_get() : at32f415_flash.h, at32f415_flash.c
  • FLASH_EPP_ERROR : at32f415_flash.h
  • flash_epp_set() : at32f415_flash.h, at32f415_flash.c
  • flash_epp_status_get() : at32f415_flash.h, at32f415_flash.c
  • FLASH_EPPERR_FLAG : at32f415_flash.h
  • FLASH_ERR_INT : at32f415_flash.h
  • flash_extension_memory_slib_enable() : at32f415_flash.h, at32f415_flash.c
  • flash_extension_memory_slib_state_get() : at32f415_flash.h, at32f415_flash.c
  • flash_fap_enable() : at32f415_flash.h, at32f415_flash.c
  • flash_fap_high_level_enable() : at32f415_flash.h, at32f415_flash.c
  • flash_fap_high_level_status_get() : at32f415_flash.h, at32f415_flash.c
  • flash_fap_status_get() : at32f415_flash.h, at32f415_flash.c
  • FLASH_FAT16_1_ADDR : flash_fat16.h
  • flash_fat16_1_addr : flash_fat16.c
  • flash_fat16_2_addr : flash_fat16.c
  • FLASH_FAT16_2_ADDR : flash_fat16.h
  • flash_fat16_addr_offset() : flash_fat16.c
  • flash_fat16_boot_dir_write() : flash_fat16.c
  • flash_fat16_boot_sector_addr : flash_fat16.c
  • FLASH_FAT16_BOOT_SECTOR_ADDR : flash_fat16.h
  • flash_fat16_clear_upgrade_flag() : flash_fat16.c
  • flash_fat16_file_start_addr : flash_fat16.c
  • FLASH_FAT16_FILE_START_ADDR : flash_fat16.h
  • flash_fat16_get_upgrade_flag() : flash_fat16.h, flash_fat16.c
  • flash_fat16_init() : flash_fat16.h, flash_fat16.c
  • flash_fat16_loop_status() : flash_fat16.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c
  • flash_fat16_read() : flash_fat16.h, flash_fat16.c
  • FLASH_FAT16_ROOT_ADDR : flash_fat16.h
  • flash_fat16_root_addr : flash_fat16.c
  • flash_fat16_sector_write() : flash_fat16.c
  • flash_fat16_set_name() : flash_fat16.h, flash_fat16.c
  • flash_fat16_set_upgrade_flag() : flash_fat16.c
  • flash_fat16_write() : flash_fat16.h, flash_fat16.c
  • flash_flag_clear() : at32f415_flash.h, at32f415_flash.c
  • flash_flag_get() : at32f415_flash.h, at32f415_flash.c
  • flash_halfword_program() : at32f415_flash.h, at32f415_flash.c
  • flash_iap : flash_fat16.h, flash_fat16.c
  • flash_internal_all_erase() : at32f415_flash.h, at32f415_flash.c
  • flash_interrupt_enable() : at32f415_flash.h, at32f415_flash.c
  • FLASH_IRQHandler() : utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c
  • FLASH_IRQn : at32f415.h
  • flash_lock() : at32f415_flash.h, at32f415_flash.c
  • FLASH_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • FLASH_OBF_FLAG : at32f415_flash.h
  • FLASH_ODF_FLAG : at32f415_flash.h
  • FLASH_ODF_INT : at32f415_flash.h
  • FLASH_OPERATE_BUSY : at32f415_flash.h
  • FLASH_OPERATE_DONE : at32f415_flash.h
  • FLASH_OPERATE_TIMEOUT : at32f415_flash.h
  • flash_operation_status_get() : at32f415_flash.h, at32f415_flash.c
  • flash_operation_wait_for() : at32f415_flash.h, at32f415_flash.c
  • FLASH_PRGMERR_FLAG : at32f415_flash.h
  • FLASH_PROGRAM_ERROR : at32f415_flash.h
  • flash_psr_set : at32f415_flash.h
  • flash_read() : project/at_start_f415/examples/flash/flash_write_read/inc/flash.h, project/at_start_f415/examples/flash/flash_write_read/src/flash.c
  • flash_read_data() : flash_fat16.c
  • FLASH_REG_BASE : at32f415.h
  • FLASH_SECTOR_1K_ALLGNED : flash_fat16.h
  • FLASH_SECTOR_1K_SIZE : flash_fat16.h
  • FLASH_SECTOR_2K_ALLGNED : flash_fat16.h
  • FLASH_SECTOR_2K_SIZE : flash_fat16.h
  • FLASH_SECTOR_4K_ALLGNED : flash_fat16.h
  • FLASH_SECTOR_4K_SIZE : flash_fat16.h
  • flash_sector_erase() : at32f415_flash.h, at32f415_flash.c
  • FLASH_SECTOR_SIZE : utilities/at32f415_slib_demo/project_l0/src/main.c
  • FLASH_SIZE : utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h
  • FLASH_SIZE_REG : hid_iap_class.h
  • FLASH_SLIB_DATA_START_SECTOR : at32f415_flash.h
  • flash_slib_datastart_sector_get() : at32f415_flash.h, at32f415_flash.c
  • flash_slib_disable() : at32f415_flash.h, at32f415_flash.c
  • flash_slib_enable() : at32f415_flash.h, at32f415_flash.c
  • FLASH_SLIB_END_SECTOR : at32f415_flash.h
  • flash_slib_end_sector_get() : at32f415_flash.h, at32f415_flash.c
  • FLASH_SLIB_START_SECTOR : at32f415_flash.h
  • flash_slib_start_sector_get() : at32f415_flash.h, at32f415_flash.c
  • flash_slib_state_get() : at32f415_flash.h, at32f415_flash.c
  • FLASH_SPI_DUMMY_BYTE : spi_flash.h
  • flash_ssb_set() : at32f415_flash.h, at32f415_flash.c
  • flash_ssb_status_get() : at32f415_flash.h, at32f415_flash.c
  • FLASH_START_ADDR : utilities/at32f415_slib_demo/project_l0/src/main.c
  • flash_status_type : at32f415_flash.h
  • FLASH_TEST_ADDR : project/at_start_f415/examples/spi/w25q_flash/src/main.c
  • flash_unlock() : at32f415_flash.h, at32f415_flash.c
  • FLASH_UNLOCK_KEY1 : at32f415_flash.h
  • FLASH_UNLOCK_KEY2 : at32f415_flash.h
  • flash_upgrade_flag_read() : utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c
  • FLASH_USDERR_FLAG : at32f415_flash.h
  • flash_user_system_data_erase() : at32f415_flash.h, at32f415_flash.c
  • flash_user_system_data_program() : at32f415_flash.h, at32f415_flash.c
  • FLASH_WAIT_CYCLE_0 : at32f415_flash.h
  • FLASH_WAIT_CYCLE_1 : at32f415_flash.h
  • FLASH_WAIT_CYCLE_2 : at32f415_flash.h
  • FLASH_WAIT_CYCLE_3 : at32f415_flash.h
  • FLASH_WAIT_CYCLE_4 : at32f415_flash.h
  • flash_wait_cycle_type : at32f415_flash.h
  • flash_word_program() : at32f415_flash.h, at32f415_flash.c
  • flash_write() : project/at_start_f415/examples/flash/flash_write_read/inc/flash.h, project/at_start_f415/examples/flash/flash_write_read/src/flash.c
  • flash_write_data() : flash_fat16.c
  • flash_write_nocheck() : project/at_start_f415/examples/flash/flash_write_read/inc/flash.h, project/at_start_f415/examples/flash/flash_write_read/src/flash.c
  • FLEX_CHANNEL1 : at32f415_dma.h
  • FLEX_CHANNEL2 : at32f415_dma.h
  • FLEX_CHANNEL3 : at32f415_dma.h
  • FLEX_CHANNEL4 : at32f415_dma.h
  • FLEX_CHANNEL5 : at32f415_dma.h
  • FLEX_CHANNEL6 : at32f415_dma.h
  • FLEX_CHANNEL7 : at32f415_dma.h
  • fputc() : at32f415_board.c
  • freq_result : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • frequency : project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/src/main.c, project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • fs : project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c, msc_only_fat32/src/usbh_user.c
  • FZC_TIMEOUT : at32f415_can.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- g -

  • g_cmd : cdc_class.c, cdc_keyboard_class.c
  • g_file_attr : flash_fat16.c
  • g_hid_usb_desc : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • g_keyboard_tx_completed : cdc_keyboard_class.c, cdc_keyboard_class.h
  • g_len : cdc_class.c, cdc_keyboard_class.c
  • g_printer_data : printer_class.c
  • g_printer_port_status : printer_class.c
  • g_req : cdc_class.c, cdc_keyboard_class.c
  • g_rx_buff : cdc_class.c, cdc_keyboard_class.c, printer_class.c
  • g_rx_completed : cdc_class.c, cdc_keyboard_class.c, printer_class.c
  • g_rxhid_buff : audio_hid_class.c, custom_hid_class.c, hid_iap_class.c
  • g_rxlen : cdc_class.c, cdc_keyboard_class.c
  • g_speed : project/at_start_f415/templates/src/main.c
  • g_tx_completed : cdc_class.c, cdc_keyboard_class.c, printer_class.c
  • g_txhid_buff : audio_hid_class.c, custom_hid_class.c
  • g_u8tx_completed : keyboard_class.c, keyboard_class.h
  • g_usbd_configuration : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • g_usbd_desc_buffer : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • g_usbd_descriptor : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • g_usbd_hid_report : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • get_data_from_usart_flag : bootloader/inc/tmr.h, bootloader/src/tmr.c
  • get_device_config_string() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_configuration() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_descriptor() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_interface_string() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_lang_id() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_manufacturer_string() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_other_speed() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_product_string() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_qualifier() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_serial_string() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_fattime() : usbh_msc_diskio.c
  • get_inquiry() : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • GET_LINE_CODING : cdc_class.h, cdc_keyboard_class.h, msc_bot_scsi.h, printer_class.h
  • get_serial_num() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_uid_for_seed() : random.c
  • gpio_bits_reset() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_bits_set() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_bits_write() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_config() : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c, project/at_start_f415/examples/adc/voltage_monitoring/src/main.c, project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c
  • gpio_configuration() : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/one_cycle/src/main.c, project/at_start_f415/examples/tmr/parallel_synchro/src/main.c, project/at_start_f415/examples/tmr/pwm_input/src/main.c, project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • gpio_default_para_init() : at32f415_gpio.h, at32f415_gpio.c
  • GPIO_DRIVE_STRENGTH_MAXIMUM : at32f415_gpio.h
  • GPIO_DRIVE_STRENGTH_MODERATE : at32f415_gpio.h
  • GPIO_DRIVE_STRENGTH_STRONGER : at32f415_gpio.h
  • gpio_drive_type : at32f415_gpio.h
  • gpio_event_output_config() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_event_output_enable() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_exint_line_config() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_init() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_init_struct : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c, project/at_start_f415/examples/cmp/output/src/main.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c, project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/tmr/6_steps/src/main.c, project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/cascade_synchro/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c, project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c, project/at_start_f415/examples/tmr/external_clock/src/main.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c, project/at_start_f415/examples/tmr/hang_mode/src/main.c, project/at_start_f415/examples/tmr/input_capture/src/main.c
  • gpio_input_data_bit_read() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_input_data_read() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_iomux_reset() : at32f415_gpio.h, at32f415_gpio.c
  • GPIO_MODE_ANALOG : at32f415_gpio.h
  • GPIO_MODE_INPUT : at32f415_gpio.h
  • GPIO_MODE_MUX : at32f415_gpio.h
  • GPIO_MODE_OUTPUT : at32f415_gpio.h
  • gpio_mode_type : at32f415_gpio.h
  • GPIO_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • gpio_output_data_bit_read() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_output_data_read() : at32f415_gpio.h, at32f415_gpio.c
  • GPIO_OUTPUT_OPEN_DRAIN : at32f415_gpio.h
  • GPIO_OUTPUT_PUSH_PULL : at32f415_gpio.h
  • gpio_output_type : at32f415_gpio.h
  • gpio_pin_remap_config() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_pin_wp_config() : at32f415_gpio.h, at32f415_gpio.c
  • GPIO_PINS_0 : at32f415_gpio.h
  • GPIO_PINS_1 : at32f415_gpio.h
  • GPIO_PINS_10 : at32f415_gpio.h
  • GPIO_PINS_11 : at32f415_gpio.h
  • GPIO_PINS_12 : at32f415_gpio.h
  • GPIO_PINS_13 : at32f415_gpio.h
  • GPIO_PINS_14 : at32f415_gpio.h
  • GPIO_PINS_15 : at32f415_gpio.h
  • GPIO_PINS_2 : at32f415_gpio.h
  • GPIO_PINS_3 : at32f415_gpio.h
  • GPIO_PINS_4 : at32f415_gpio.h
  • GPIO_PINS_5 : at32f415_gpio.h
  • GPIO_PINS_6 : at32f415_gpio.h
  • GPIO_PINS_7 : at32f415_gpio.h
  • GPIO_PINS_8 : at32f415_gpio.h
  • GPIO_PINS_9 : at32f415_gpio.h
  • GPIO_PINS_ALL : at32f415_gpio.h
  • GPIO_PINS_SOURCE0 : at32f415_gpio.h
  • GPIO_PINS_SOURCE1 : at32f415_gpio.h
  • GPIO_PINS_SOURCE10 : at32f415_gpio.h
  • GPIO_PINS_SOURCE11 : at32f415_gpio.h
  • GPIO_PINS_SOURCE12 : at32f415_gpio.h
  • GPIO_PINS_SOURCE13 : at32f415_gpio.h
  • GPIO_PINS_SOURCE14 : at32f415_gpio.h
  • GPIO_PINS_SOURCE15 : at32f415_gpio.h
  • GPIO_PINS_SOURCE2 : at32f415_gpio.h
  • GPIO_PINS_SOURCE3 : at32f415_gpio.h
  • GPIO_PINS_SOURCE4 : at32f415_gpio.h
  • GPIO_PINS_SOURCE5 : at32f415_gpio.h
  • GPIO_PINS_SOURCE6 : at32f415_gpio.h
  • GPIO_PINS_SOURCE7 : at32f415_gpio.h
  • GPIO_PINS_SOURCE8 : at32f415_gpio.h
  • GPIO_PINS_SOURCE9 : at32f415_gpio.h
  • gpio_pins_source_type : at32f415_gpio.h
  • gpio_pins_toggle() : project/at_start_f415/examples/gpio/swjtag_remap/src/main.c
  • GPIO_PORT_SOURCE_GPIOA : at32f415_gpio.h
  • GPIO_PORT_SOURCE_GPIOB : at32f415_gpio.h
  • GPIO_PORT_SOURCE_GPIOC : at32f415_gpio.h
  • GPIO_PORT_SOURCE_GPIOD : at32f415_gpio.h
  • GPIO_PORT_SOURCE_GPIOF : at32f415_gpio.h
  • gpio_port_source_type : at32f415_gpio.h
  • gpio_port_wirte() : at32f415_gpio.h, at32f415_gpio.c
  • GPIO_PULL_DOWN : at32f415_gpio.h
  • GPIO_PULL_NONE : at32f415_gpio.h
  • gpio_pull_type : at32f415_gpio.h
  • GPIO_PULL_UP : at32f415_gpio.h
  • gpio_reset() : at32f415_gpio.h, at32f415_gpio.c
  • GPIOA : at32f415_gpio.h
  • GPIOA_BASE : at32f415.h
  • GPIOB : at32f415_gpio.h
  • GPIOB_BASE : at32f415.h
  • GPIOC : at32f415_gpio.h
  • GPIOC_BASE : at32f415.h
  • GPIOD : at32f415_gpio.h
  • GPIOD_BASE : at32f415.h
  • GPIOF : at32f415_gpio.h
  • GPIOF_BASE : at32f415.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- h -

  • HardFault_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_freertos_demo/src/at32f415_int.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • HardFault_IRQn : at32f415.h
  • HBYTE : usb_std.h
  • HEXT_STABLE_DELAY : system_at32f415.h
  • HEXT_STARTUP_TIMEOUT : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • HEXT_VALUE : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • hi2cx : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • HICK_VALUE : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • HID_BCD_NUM : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • HID_BINTERVAL_TIME : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • HID_CLASS_DESC_HID : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • HID_CLASS_DESC_PHYSICAL : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • HID_CLASS_DESC_REPORT : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • hid_desc_handler : custom_hid_desc.c, custom_hid_desc.h
  • HID_DESCRIPTOR_TYPE : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_IAP_BUFFER_LEN : hid_iap_class.h
  • hid_iap_class_handler : hid_iap_class.c, hid_iap_class.h
  • hid_iap_desc_handler : hid_iap_desc.c, hid_iap_desc.h
  • HID_INTERFACE_NUMBER : audio_hid_desc.h
  • hid_keyboard_codes : usbh_hid_keyboard.c
  • HID_KEYBOARD_INTERFACE : cdc_keyboard_desc.h
  • hid_keyboard_key : usbh_hid_keyboard.c
  • hid_keyboard_key_shift : usbh_hid_keyboard.c
  • hid_mouse : usbh_hid_mouse.c
  • hid_protocol : audio_hid_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c
  • HID_REPORT_DESC : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_REPORT_ID_1 : audio_hid_desc.h, custom_hid_desc.h
  • HID_REPORT_ID_2 : audio_hid_desc.h, custom_hid_desc.h
  • HID_REPORT_ID_3 : audio_hid_desc.h, custom_hid_desc.h
  • HID_REPORT_ID_4 : audio_hid_desc.h, custom_hid_desc.h
  • HID_REPORT_ID_5 : audio_hid_desc.h, custom_hid_desc.h
  • HID_REPORT_ID_6 : audio_hid_desc.h, custom_hid_desc.h
  • HID_REQ_GET_IDLE : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_REQ_GET_PROTOCOL : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_REQ_GET_REPORT : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_REQ_SET_IDLE : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_REQ_SET_PROTOCOL : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_REQ_SET_REPORT : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • hid_set_idle : audio_hid_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c
  • hid_set_report : audio_hid_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c
  • hid_state : audio_hid_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c
  • hid_suspend_flag : keyboard_class.c, mouse_class.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c
  • HIST_LENGTH : project/at_start_f415/examples/usart/smartcard/src/main.c


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- i -

  • I2C1 : at32f415_i2c.h
  • I2C1_BASE : at32f415.h
  • I2C1_ERR_IRQHandler() : project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • I2C1_ERR_IRQn : at32f415.h
  • I2C1_EVT_IRQHandler() : project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • I2C1_EVT_IRQn : at32f415.h
  • I2C1_GMUX_0001 : at32f415_gpio.h
  • I2C1_GMUX_0010 : at32f415_gpio.h
  • I2C1_MUX : at32f415_gpio.h
  • I2C2 : at32f415_i2c.h
  • I2C2_BASE : at32f415.h
  • I2C2_ERR_IRQn : at32f415.h
  • I2C2_EVT_IRQn : at32f415.h
  • I2C2_GMUX_0001 : at32f415_gpio.h
  • I2C2_GMUX_0010 : at32f415_gpio.h
  • I2C2_GMUX_0011 : at32f415_gpio.h
  • i2c_7bit_address_send() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_ack_enable() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_ACKFAIL_FLAG : at32f415_i2c.h
  • I2C_ADDR2_FLAG : at32f415_i2c.h
  • I2C_ADDR7F_FLAG : at32f415_i2c.h
  • i2c_addr_flag_clear() : i2c_application.c
  • I2C_ADDRESS_MODE_10BIT : at32f415_i2c.h
  • I2C_ADDRESS_MODE_7BIT : at32f415_i2c.h
  • i2c_address_mode_type : at32f415_i2c.h
  • I2C_ADDRHF_FLAG : at32f415_i2c.h
  • I2C_ALERTF_FLAG : at32f415_i2c.h
  • I2C_ARLOST_FLAG : at32f415_i2c.h
  • i2c_arp_mode_enable() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_BUSERR_FLAG : at32f415_i2c.h
  • I2C_BUSYF_FLAG : at32f415_i2c.h
  • i2c_clock_stretch_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_config() : i2c_application.c, i2c_application.h
  • I2C_DATA_INT : at32f415_i2c.h
  • i2c_data_receive() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_data_send() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_DEVADDRF_FLAG : at32f415_i2c.h
  • I2C_DIRECTION_RECEIVE : at32f415_i2c.h
  • I2C_DIRECTION_TRANSMIT : at32f415_i2c.h
  • i2c_direction_type : at32f415_i2c.h
  • I2C_DIRF_FLAG : at32f415_i2c.h
  • i2c_dma_config() : i2c_application.c
  • i2c_dma_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_dma_end_transfer_set() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_DMA_MA_RX : i2c_application.h
  • I2C_DMA_MA_TX : i2c_application.h
  • i2c_dma_rx_irq_handler() : i2c_application.c, i2c_application.h
  • I2C_DMA_SLA_RX : i2c_application.h
  • I2C_DMA_SLA_TX : i2c_application.h
  • i2c_dma_tx_irq_handler() : i2c_application.c, i2c_application.h
  • i2c_enable() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_END : i2c_application.c
  • I2C_ERR_ACKFAIL : i2c_application.h
  • I2C_ERR_ADDR : i2c_application.h
  • I2C_ERR_ADDR10 : i2c_application.h
  • I2C_ERR_INT : at32f415_i2c.h
  • I2C_ERR_INTERRUPT : i2c_application.h
  • i2c_err_irq_handler() : i2c_application.c, i2c_application.h
  • I2C_ERR_START : i2c_application.h
  • I2C_ERR_STEP_1 : i2c_application.h
  • I2C_ERR_STEP_10 : i2c_application.h
  • I2C_ERR_STEP_11 : i2c_application.h
  • I2C_ERR_STEP_12 : i2c_application.h
  • I2C_ERR_STEP_2 : i2c_application.h
  • I2C_ERR_STEP_3 : i2c_application.h
  • I2C_ERR_STEP_4 : i2c_application.h
  • I2C_ERR_STEP_5 : i2c_application.h
  • I2C_ERR_STEP_6 : i2c_application.h
  • I2C_ERR_STEP_7 : i2c_application.h
  • I2C_ERR_STEP_8 : i2c_application.h
  • I2C_ERR_STEP_9 : i2c_application.h
  • I2C_ERR_STOP : i2c_application.h
  • I2C_ERR_TIMEOUT : i2c_application.h
  • I2C_EVENT_CHECK_ACKFAIL : i2c_application.h
  • I2C_EVENT_CHECK_NONE : i2c_application.h
  • I2C_EVENT_CHECK_STOP : i2c_application.h
  • I2C_EVT_INT : at32f415_i2c.h
  • i2c_evt_irq_handler() : i2c_application.c, i2c_application.h
  • i2c_fast_mode_duty_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_flag_clear() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_flag_get() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_FSMODE_DUTY_16_9 : at32f415_i2c.h
  • I2C_FSMODE_DUTY_2_1 : at32f415_i2c.h
  • i2c_fsmode_duty_cycle_type : at32f415_i2c.h
  • I2C_GCADDRF_FLAG : at32f415_i2c.h
  • i2c_general_call_enable() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_HOSTADDRF_FLAG : at32f415_i2c.h
  • i2c_init() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_INT_MA_RX : i2c_application.h
  • I2C_INT_MA_TX : i2c_application.h
  • I2C_INT_SLA_RX : i2c_application.h
  • I2C_INT_SLA_TX : i2c_application.h
  • i2c_interrupt_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_lowlevel_init() : i2c_application.h, project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2C_MASTER_ACK_CURRENT : at32f415_i2c.h
  • I2C_MASTER_ACK_NEXT : at32f415_i2c.h
  • i2c_master_ack_type : at32f415_i2c.h
  • i2c_master_read_addr() : i2c_application.c
  • i2c_master_receive() : i2c_application.c, i2c_application.h
  • i2c_master_receive_ack_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_master_receive_dma() : i2c_application.c, i2c_application.h
  • i2c_master_receive_int() : i2c_application.c, i2c_application.h
  • i2c_master_rx_isr_int() : i2c_application.c
  • i2c_master_transmit() : i2c_application.c, i2c_application.h
  • i2c_master_transmit_dma() : i2c_application.c, i2c_application.h
  • i2c_master_transmit_int() : i2c_application.c, i2c_application.h
  • i2c_master_tx_isr_int() : i2c_application.c
  • i2c_master_write_addr() : i2c_application.c
  • i2c_memory_read() : i2c_application.c, i2c_application.h
  • i2c_memory_read_dma() : i2c_application.c, i2c_application.h
  • i2c_memory_read_int() : i2c_application.c, i2c_application.h
  • i2c_memory_write() : i2c_application.c, i2c_application.h
  • i2c_memory_write_dma() : i2c_application.c, i2c_application.h
  • i2c_memory_write_int() : i2c_application.c, i2c_application.h
  • i2c_mode_type : i2c_application.h
  • I2C_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • I2C_OK : i2c_application.h
  • I2C_OUF_FLAG : at32f415_i2c.h
  • i2c_own_address1_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_own_address2_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_own_address2_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_pec_calculate_enable() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_PEC_POSITION_CURRENT : at32f415_i2c.h
  • I2C_PEC_POSITION_NEXT : at32f415_i2c.h
  • i2c_pec_position_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_pec_position_type : at32f415_i2c.h
  • i2c_pec_transmit_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_pec_value_get() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_PECERR_FLAG : at32f415_i2c.h
  • I2C_RDBF_FLAG : at32f415_i2c.h
  • i2c_reset() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_slave_receive() : i2c_application.c, i2c_application.h
  • i2c_slave_receive_dma() : i2c_application.c, i2c_application.h
  • i2c_slave_receive_int() : i2c_application.c, i2c_application.h
  • i2c_slave_rx_isr_int() : i2c_application.c
  • i2c_slave_transmit() : i2c_application.c, i2c_application.h
  • i2c_slave_transmit_dma() : i2c_application.c, i2c_application.h
  • i2c_slave_transmit_int() : i2c_application.c, i2c_application.h
  • i2c_slave_tx_isr_int() : i2c_application.c
  • I2C_SMBUS_ALERT_HIGH : at32f415_i2c.h
  • I2C_SMBUS_ALERT_LOW : at32f415_i2c.h
  • i2c_smbus_alert_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_smbus_alert_set_type : at32f415_i2c.h
  • i2c_smbus_enable() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_SMBUS_MODE_DEVICE : at32f415_i2c.h
  • I2C_SMBUS_MODE_HOST : at32f415_i2c.h
  • i2c_smbus_mode_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_smbus_mode_set_type : at32f415_i2c.h
  • i2c_software_reset() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_START : i2c_application.c
  • i2c_start_generate() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_STARTF_FLAG : at32f415_i2c.h
  • i2c_status_type : i2c_application.h
  • i2c_stop_flag_clear() : i2c_application.c
  • i2c_stop_generate() : at32f415_i2c.h, at32f415_i2c.c
  • I2C_STOPF_FLAG : at32f415_i2c.h
  • I2C_TDBE_FLAG : at32f415_i2c.h
  • I2C_TDC_FLAG : at32f415_i2c.h
  • I2C_TIMEOUT : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2C_TMOUT_FLAG : at32f415_i2c.h
  • I2C_TRMODE_FLAG : at32f415_i2c.h
  • i2c_wait_end() : i2c_application.c, i2c_application.h
  • i2c_wait_flag() : i2c_application.c
  • I2Cx_ADDRESS : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_CLK : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_DMA_CLK : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_DMA_RX_CHANNEL : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_DMA_RX_IRQHandler : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • I2Cx_DMA_RX_IRQn : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_DMA_TX_CHANNEL : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_DMA_TX_IRQHandler : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • I2Cx_DMA_TX_IRQn : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_ERR_IRQHandler : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • I2Cx_ERR_IRQn : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_EVT_IRQHandler : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • I2Cx_EVT_IRQn : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_PORT : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SCL_GPIO_CLK : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SCL_GPIO_PIN : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SCL_GPIO_PORT : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SCL_PIN : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_SDA_GPIO_CLK : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SDA_GPIO_PIN : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SDA_GPIO_PORT : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SDA_PIN : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_SPEED : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • i2s1_buffer_tx : project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c
  • I2S1_CK_PIN : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S1_DT_ADDRESS : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S1_GPIO : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S1_GPIO_CRM_CLK : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S1_SD_PIN : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S1_WS_PIN : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • i2s2_buffer_rx : project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c
  • I2S2_CK_PIN : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S2_DT_ADDRESS : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S2_GPIO : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S2_GPIO_CRM_CLK : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S2_SD_PIN : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S2_WS_PIN : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S_ACS_FLAG : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_11_025K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_16K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_192K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_22_05K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_32K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_44_1K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_48K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_8K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_96K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_DEFAULT : at32f415_spi.h
  • I2S_AUDIO_PROTOCOL_LSB : at32f415_spi.h
  • I2S_AUDIO_PROTOCOL_MSB : at32f415_spi.h
  • I2S_AUDIO_PROTOCOL_PCM_LONG : at32f415_spi.h
  • I2S_AUDIO_PROTOCOL_PCM_SHORT : at32f415_spi.h
  • I2S_AUDIO_PROTOCOL_PHILLIPS : at32f415_spi.h
  • i2s_audio_protocol_type : at32f415_spi.h
  • i2s_audio_sampling_freq_type : at32f415_spi.h
  • I2S_CLOCK_POLARITY_HIGH : at32f415_spi.h
  • I2S_CLOCK_POLARITY_LOW : at32f415_spi.h
  • i2s_clock_polarity_type : at32f415_spi.h
  • i2s_config() : project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c
  • I2S_DATA_16BIT_CHANNEL_16BIT : at32f415_spi.h
  • I2S_DATA_16BIT_CHANNEL_32BIT : at32f415_spi.h
  • I2S_DATA_24BIT_CHANNEL_32BIT : at32f415_spi.h
  • I2S_DATA_32BIT_CHANNEL_32BIT : at32f415_spi.h
  • i2s_data_channel_format_type : at32f415_spi.h
  • i2s_default_para_init() : at32f415_spi.h, at32f415_spi.c
  • i2s_enable() : at32f415_spi.h, at32f415_spi.c
  • i2s_init() : at32f415_spi.h, at32f415_spi.c
  • I2S_MODE_MASTER_RX : at32f415_spi.h
  • I2S_MODE_MASTER_TX : at32f415_spi.h
  • I2S_MODE_SLAVE_RX : at32f415_spi.h
  • I2S_MODE_SLAVE_TX : at32f415_spi.h
  • i2s_operation_mode_type : at32f415_spi.h
  • I2S_TUERR_FLAG : at32f415_spi.h
  • IAP_ACK : hid_iap_class.h
  • iap_address() : bootloader/src/hid_iap_user.c
  • iap_clear_upgrade_flag() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • IAP_CMD_ADDR : hid_iap_class.h
  • IAP_CMD_CRC : hid_iap_class.h
  • IAP_CMD_DATA : hid_iap_class.h
  • IAP_CMD_FINISH : hid_iap_class.h
  • IAP_CMD_GET : hid_iap_class.h
  • IAP_CMD_IDLE : hid_iap_class.h
  • IAP_CMD_JMP : hid_iap_class.h
  • IAP_CMD_START : hid_iap_class.h
  • iap_command_handle() : app_led3_toggle/inc/iap.h, app_led3_toggle/src/iap.c, app_led4_toggle/inc/iap.h, app_led4_toggle/src/iap.c
  • iap_crc() : bootloader/src/hid_iap_user.c
  • iap_data_write() : bootloader/src/hid_iap_user.c
  • iap_erase_sector() : bootloader/src/hid_iap_user.c
  • IAP_ERROR : flash_fat16.h
  • IAP_FAILED : hid_iap_class.h
  • iap_finish() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_flag : app_led3_toggle/inc/usart.h, app_led3_toggle/src/usart.c, app_led4_toggle/inc/usart.h, app_led4_toggle/src/usart.c
  • iap_get() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_get_upgrade_flag() : app_led3_toggle/inc/hid_iap_user.h, app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/inc/hid_iap_user.h, app_led4_toggle/src/hid_iap_user.c, bootloader/inc/hid_iap_user.h, bootloader/src/hid_iap_user.c
  • iap_idle() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_info : hid_iap_class.c, hid_iap_class.h
  • iap_init() : app_led3_toggle/inc/iap.h, app_led3_toggle/src/iap.c, app_led4_toggle/inc/iap.h, app_led4_toggle/src/iap.c, app_led3_toggle/inc/hid_iap_user.h, app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/inc/hid_iap_user.h, app_led4_toggle/src/hid_iap_user.c, bootloader/inc/hid_iap_user.h, bootloader/src/hid_iap_user.c
  • iap_jump() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_loop() : bootloader/inc/hid_iap_user.h, bootloader/src/hid_iap_user.c
  • iap_machine_state_type : hid_iap_class.h
  • IAP_NACK : hid_iap_class.h
  • iap_respond() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_result_type : hid_iap_class.h
  • IAP_REV_FLAG_5A : app_led3_toggle/inc/usart.h, app_led4_toggle/inc/usart.h
  • IAP_REV_FLAG_DONE : app_led3_toggle/inc/usart.h, app_led4_toggle/inc/usart.h
  • IAP_REV_FLAG_ERROR : app_led3_toggle/inc/usart.h, app_led4_toggle/inc/usart.h
  • IAP_REV_FLAG_NO : app_led3_toggle/inc/usart.h, app_led4_toggle/inc/usart.h
  • iap_set_upgrade_flag() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_start() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • IAP_STS_ADDR : hid_iap_class.h
  • IAP_STS_CRC : hid_iap_class.h
  • IAP_STS_DATA : hid_iap_class.h
  • IAP_STS_FINISH : hid_iap_class.h
  • IAP_STS_IDLE : hid_iap_class.h
  • IAP_STS_JMP : hid_iap_class.h
  • IAP_STS_JMP_WAIT : hid_iap_class.h
  • IAP_STS_START : hid_iap_class.h
  • IAP_SUCCESS : flash_fat16.h, hid_iap_class.h
  • iap_upgrade_app_handle() : bootloader/inc/iap.h, bootloader/src/iap.c
  • IAP_UPGRADE_COMPLETE_FLAG : hid_iap_class.h, flash_fat16.h
  • IAP_UPGRADE_FLAG : app_led3_toggle/inc/iap.h, app_led4_toggle/inc/iap.h, bootloader/inc/iap.h
  • IAP_UPGRADE_FLAG_ADDR : app_led3_toggle/inc/iap.h, app_led4_toggle/inc/iap.h, bootloader/inc/iap.h
  • IAP_WAIT : hid_iap_class.h
  • iapfun : bootloader/inc/iap.h
  • ic1readvalue1 : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c
  • ic1readvalue2 : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c
  • ic2value : project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c
  • INCLUDE_uxTaskPriorityGet : FreeRTOSConfig.h
  • INCLUDE_vTaskCleanUpResources : FreeRTOSConfig.h
  • INCLUDE_vTaskDelay : FreeRTOSConfig.h
  • INCLUDE_vTaskDelayUntil : FreeRTOSConfig.h
  • INCLUDE_vTaskDelete : FreeRTOSConfig.h
  • INCLUDE_vTaskPrioritySet : FreeRTOSConfig.h
  • INCLUDE_vTaskSuspend : FreeRTOSConfig.h
  • INCLUDE_xTaskGetCurrentTaskHandle : FreeRTOSConfig.h
  • INT16 : at32f415.h
  • INT32 : at32f415.h
  • INT8 : at32f415.h
  • INTERNAL_FLASH_LUN : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • INVAILD_OFFSET_ADDR : flash_fat16.h
  • INVALID_COMMAND : msc_bot_scsi.h
  • INVALID_FIELD_IN_PARAMETER_LIST : msc_bot_scsi.h
  • INVALID_FIELED_IN_COMMAND : msc_bot_scsi.h
  • IOMUX : at32f415_gpio.h
  • IOMUX_BASE : at32f415.h
  • IOMUX_MAKE_VALUE : at32f415_gpio.h
  • IRQn : at32f415.h
  • IRQn_Type : at32f415.h
  • is_bpr_reg_reset() : project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- j -

  • jump_to_app : bootloader/src/iap.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, bootloader/inc/hid_iap_user.h, bootloader/src/hid_iap_user.c


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- k -

  • KB_TO_B : hid_iap_class.h
  • keyboard_class_handler : keyboard_class.c, keyboard_class.h
  • keyboard_class_setup_handler() : cdc_keyboard_class.c
  • keyboard_desc_handler : keyboard_desc.c, keyboard_desc.h
  • KEYBOARD_LEFT_ALT : usbh_hid_keyboard.h
  • KEYBOARD_LEFT_CTRL : usbh_hid_keyboard.h
  • KEYBOARD_LEFT_GUI : usbh_hid_keyboard.h
  • KEYBOARD_LEFT_SHIFT : usbh_hid_keyboard.h
  • KEYBOARD_MAX_NB_PRESSED : usbh_hid_keyboard.h
  • KEYBOARD_RIGHT_ALT : usbh_hid_keyboard.h
  • KEYBOARD_RIGHT_CTRL : usbh_hid_keyboard.h
  • KEYBOARD_RIGHT_GUI : usbh_hid_keyboard.h
  • KEYBOARD_RIGHT_SHIFT : usbh_hid_keyboard.h
  • keyboard_send_flag : project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c
  • keyboard_send_string() : project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- l -

  • langid_descriptor : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • LBYTE : usb_std.h
  • LED2 : at32f415_board.h
  • led2_handler : utilities/at32f415_freertos_demo/src/main.c
  • led2_task_function() : utilities/at32f415_freertos_demo/src/main.c
  • LED3 : at32f415_board.h
  • led3_handler : utilities/at32f415_freertos_demo/src/main.c
  • led3_task_function() : utilities/at32f415_freertos_demo/src/main.c
  • LED4 : at32f415_board.h
  • led_gpio_crm_clk : at32f415_board.c
  • led_gpio_pin : at32f415_board.c
  • led_gpio_port : at32f415_board.c
  • LED_NUM : at32f415_board.h
  • led_type : at32f415_board.h
  • LEFT_BUTTON : mouse_class.h
  • LEFT_MOVE : mouse_class.h
  • lick_freq : project/at_start_f415/examples/ertc/lick_calibration/src/main.c
  • lick_frequency_get() : project/at_start_f415/examples/ertc/lick_calibration/src/main.c
  • linecoding : cdc_class.c, cdc_keyboard_class.c


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- m -

  • main() : project/at_start_f415/examples/adc/current_vref_value_check/src/main.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c, project/at_start_f415/examples/adc/voltage_monitoring/src/main.c, project/at_start_f415/examples/can/communication_mode/src/main.c, project/at_start_f415/examples/can/filter/src/main.c, project/at_start_f415/examples/can/loopback_mode/src/main.c, project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c, project/at_start_f415/examples/cmp/output/src/main.c, project/at_start_f415/examples/cortex_m4/bit_band/src/main.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c, project/at_start_f415/examples/crc/calculation/src/main.c, project/at_start_f415/examples/crm/clock_failure_detection/src/main.c, project/at_start_f415/examples/crm/pll_config2/src/main.c, project/at_start_f415/examples/debug/tmr1/src/main.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c, project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/ertc/bpr_domain/src/main.c, project/at_start_f415/examples/ertc/calendar/src/main.c, project/at_start_f415/examples/ertc/lick_calibration/src/main.c, project/at_start_f415/examples/ertc/tamper/src/main.c, project/at_start_f415/examples/ertc/time_stamp/src/main.c, project/at_start_f415/examples/ertc/wakeup_timer/src/main.c, project/at_start_f415/examples/exint/exint_config/src/main.c, project/at_start_f415/examples/exint/exint_software_trigger/src/main.c, project/at_start_f415/examples/flash/flash_write_read/src/main.c, project/at_start_f415/examples/gpio/led_toggle/src/main.c, project/at_start_f415/examples/gpio/swjtag_remap/src/main.c, project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c, project/at_start_f415/examples/pwc/power_voltage_monitor/src/main.c, project/at_start_f415/examples/pwc/sleep_tmr2/src/main.c, project/at_start_f415/examples/pwc/sleep_usart1/src/main.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/main.c, project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c, project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c, project/at_start_f415/examples/spi/w25q_flash/src/main.c, project/at_start_f415/examples/tmr/6_steps/src/main.c, project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/cascade_synchro/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c, project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c, project/at_start_f415/examples/tmr/external_clock/src/main.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c, project/at_start_f415/examples/tmr/hang_mode/src/main.c, project/at_start_f415/examples/tmr/input_capture/src/main.c, project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/one_cycle/src/main.c, project/at_start_f415/examples/tmr/parallel_synchro/src/main.c, project/at_start_f415/examples/tmr/pwm_input/src/main.c, project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/timer_base/src/main.c, project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c, project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/hw_flow_control/src/main.c, project/at_start_f415/examples/usart/idle_detection/src/main.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/irda/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/printf/src/main.c, project/at_start_f415/examples/usart/receiver_mute/src/main.c, project/at_start_f415/examples/usart/smartcard/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c, project/at_start_f415/examples/usb_device/audio/src/main.c, project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/msc/src/main.c, project/at_start_f415/examples/usb_device/printer/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, project/at_start_f415/examples/wdt/wdt_reset/src/main.c, project/at_start_f415/examples/wwdt/wwdt_reset/src/main.c, project/at_start_f415/templates/src/main.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/main.c, utilities/at32f415_freertos_demo/src/main.c, utilities/at32f415_gen_random_number_demo/src/main.c, utilities/at32f415_slib_demo/project_l0/src/main.c, utilities/at32f415_slib_demo/project_l1/src/main.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • MAKE_VALUE : at32f415.h
  • MASTER_BOARD : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c
  • MATCH_ID_VAL : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • MAX : usb_std.h
  • mblock_rbuffer : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • mblock_tbuffer : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • mclk_tmr1_init() : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • MCU_ID1 : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • MCU_ID2 : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • MCU_ID3 : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • MEDIUM_HAVE_CHANGED : msc_bot_scsi.h
  • MEDIUM_NOT_PRESENT : msc_bot_scsi.h
  • MemManage_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_freertos_demo/src/at32f415_int.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • MemoryManagement_IRQn : at32f415.h
  • memset16_buffer() : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • MIC_BUFFER_SIZE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • mic_dma_buffer : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • MIN : usb_std.h
  • MISC_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • mmc_stream_read() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • mmc_stream_test() : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • mmc_stream_write() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • mmc_switch() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • MMC_SWITCH_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • MOUSE_BUTTON_LEFT : usbh_hid_mouse.h
  • MOUSE_BUTTON_MIDDLE : usbh_hid_mouse.h
  • MOUSE_BUTTON_RIGHT : usbh_hid_mouse.h
  • mouse_class_handler : mouse_class.c, mouse_class.h
  • mouse_desc_handler : mouse_desc.c, mouse_desc.h
  • MOUSE_WINDOW_HEIGHT : usbh_hid_mouse.h
  • MOUSE_WINDOW_WIDTH : usbh_hid_mouse.h
  • MOUSE_WINDOW_X : usbh_hid_mouse.h
  • MOUSE_WINDOW_Y : usbh_hid_mouse.h
  • MOVE_STEP : mouse_class.h
  • MS_TICK : project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c
  • msc_bot_scsi_init() : usbh_msc_bot_scsi.c, usbh_msc_class.h
  • MSC_BOT_STATE_ERROR : msc_bot_scsi.h
  • MSC_BOT_STATE_IDLE : msc_bot_scsi.h
  • MSC_BOT_STATE_RECOVERY : msc_bot_scsi.h
  • msc_bot_state_type : usbh_msc_bot_scsi.h
  • MSC_CAPACITY10_CMD_LEN : usbh_msc_bot_scsi.h
  • MSC_CAPACITY10_DATA_LEN : usbh_msc_bot_scsi.h
  • MSC_CBW_CB_LEN : usbh_msc_bot_scsi.h
  • MSC_CBW_FLAG_IN : usbh_msc_bot_scsi.h
  • MSC_CBW_FLAG_OUT : usbh_msc_bot_scsi.h
  • MSC_CBW_LEN : usbh_msc_bot_scsi.h
  • MSC_CBW_SIGNATURE : usbh_msc_bot_scsi.h
  • MSC_CBW_TAG : usbh_msc_bot_scsi.h
  • msc_class_handler : msc_class.c, msc_class.h
  • MSC_CMD_ALLOW_MEDIUM_REMOVAL : msc_bot_scsi.h
  • MSC_CMD_FORMAT_UNIT : msc_bot_scsi.h
  • MSC_CMD_INQUIRY : msc_bot_scsi.h
  • MSC_CMD_MODE_SENSE10 : msc_bot_scsi.h
  • MSC_CMD_MODE_SENSE6 : msc_bot_scsi.h
  • MSC_CMD_READ_10 : msc_bot_scsi.h
  • MSC_CMD_READ_12 : msc_bot_scsi.h
  • MSC_CMD_READ_CAPACITY : msc_bot_scsi.h
  • MSC_CMD_READ_FORMAT_CAPACITY : msc_bot_scsi.h
  • MSC_CMD_REQUEST_SENSE : msc_bot_scsi.h
  • MSC_CMD_START_STOP : msc_bot_scsi.h
  • msc_cmd_state_type : usbh_msc_bot_scsi.h
  • MSC_CMD_TEST_UNIT : msc_bot_scsi.h
  • MSC_CMD_VERIFY : msc_bot_scsi.h
  • MSC_CMD_WRITE_10 : msc_bot_scsi.h
  • MSC_CMD_WRITE_12 : msc_bot_scsi.h
  • MSC_CMD_WRITE_VERIFY : msc_bot_scsi.h
  • MSC_CSW_LEN : usbh_msc_bot_scsi.h
  • MSC_CSW_SIGNATURE : usbh_msc_bot_scsi.h
  • msc_desc_handler : msc_desc.c, msc_desc.h
  • msc_disk_capacity() : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • msc_disk_read() : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • msc_disk_write() : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • MSC_ERROR : usbh_msc_bot_scsi.h
  • msc_error_type : usbh_msc_bot_scsi.h
  • msc_flash_size : msc/src/msc_diskio.c
  • MSC_INQUIRY_CMD_LEN : usbh_msc_bot_scsi.h
  • MSC_INQUIRY_DATA_LEN : usbh_msc_bot_scsi.h
  • MSC_MAX_DATA_BUF_LEN : msc_bot_scsi.h
  • MSC_NOT_READY : usbh_msc_bot_scsi.h
  • MSC_OK : usbh_msc_bot_scsi.h
  • MSC_OPCODE_CAPACITY : usbh_msc_bot_scsi.h
  • MSC_OPCODE_INQUIRY : usbh_msc_bot_scsi.h
  • MSC_OPCODE_READ10 : usbh_msc_bot_scsi.h
  • MSC_OPCODE_REQUEST_SENSE : usbh_msc_bot_scsi.h
  • MSC_OPCODE_TEST_UNIT_READY : usbh_msc_bot_scsi.h
  • MSC_OPCODE_WRITE10 : usbh_msc_bot_scsi.h
  • MSC_PROTOCOL_BBB : usbh_msc_class.h
  • MSC_READ_CMD_LEN : usbh_msc_bot_scsi.h
  • MSC_REQ_BO_RESET : msc_bot_scsi.h
  • MSC_REQ_BOMSR : usbh_msc_class.h
  • MSC_REQ_GET_MAX_LUN : msc_bot_scsi.h, usbh_msc_class.h
  • MSC_REQUEST_SENSE_CMD_LEN : usbh_msc_bot_scsi.h
  • MSC_REQUEST_SENSE_DATA_LEN : usbh_msc_bot_scsi.h
  • MSC_STATE_MACHINE_CMD : msc_bot_scsi.h
  • MSC_STATE_MACHINE_DATA_IN : msc_bot_scsi.h
  • MSC_STATE_MACHINE_DATA_OUT : msc_bot_scsi.h
  • MSC_STATE_MACHINE_FAILED : msc_bot_scsi.h
  • MSC_STATE_MACHINE_IDLE : msc_bot_scsi.h
  • MSC_STATE_MACHINE_LAST_DATA : msc_bot_scsi.h
  • MSC_STATE_MACHINE_SEND_DATA : msc_bot_scsi.h
  • MSC_STATE_MACHINE_STATUS : msc_bot_scsi.h
  • msc_state_type : usbh_msc_bot_scsi.h
  • msc_struct : msc_bot_scsi.c, msc_class.c
  • MSC_SUBCLASS_SCSI_TRANS : usbh_msc_class.h
  • MSC_SUPPORT_MAX_LUN : msc_bot_scsi.h
  • MSC_TEST_UNIT_READY_CMD_LEN : usbh_msc_bot_scsi.h
  • MSC_TEST_UNIT_READY_DATA_LEN : usbh_msc_bot_scsi.h
  • MSC_WRITE_CMD_LEN : usbh_msc_bot_scsi.h
  • MULTI_BUFFER_SIZE : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- n -

  • NMI_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_freertos_demo/src/at32f415_int.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • NO_BUTTON : at32f415_board.h
  • NonMaskableInt_IRQn : at32f415.h
  • NULL : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • NUM_TAPS : fir_coefficient.c, fir_filter.c
  • nvic_configuration() : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c, project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c
  • nvic_irq_disable() : at32f415_misc.h, at32f415_misc.c
  • nvic_irq_enable() : at32f415_misc.h, at32f415_misc.c
  • nvic_lowpower_mode_config() : at32f415_misc.h, at32f415_misc.c
  • nvic_lowpower_mode_type : at32f415_misc.h
  • NVIC_LP_SEVONPEND : at32f415_misc.h
  • NVIC_LP_SLEEPDEEP : at32f415_misc.h
  • NVIC_LP_SLEEPONEXIT : at32f415_misc.h
  • NVIC_PRIORITY_GROUP_0 : at32f415_misc.h
  • NVIC_PRIORITY_GROUP_1 : at32f415_misc.h
  • NVIC_PRIORITY_GROUP_2 : at32f415_misc.h
  • NVIC_PRIORITY_GROUP_3 : at32f415_misc.h
  • NVIC_PRIORITY_GROUP_4 : at32f415_misc.h
  • nvic_priority_group_config() : at32f415_misc.h, at32f415_misc.c
  • nvic_priority_group_type : at32f415_misc.h
  • nvic_system_reset() : at32f415_misc.h, at32f415_misc.c
  • nvic_vector_table_set() : at32f415_misc.h, at32f415_misc.c
  • NVIC_VECTTAB_FLASH : at32f415_misc.h
  • NVIC_VECTTAB_RAM : at32f415_misc.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- o -

  • OPERATION_TIMEOUT : at32f415_flash.h
  • OTG1_GLOBAL : at32f415_usb.h
  • OTG_CLOCK : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • otg_core_struct : project/at_start_f415/examples/usb_device/audio/src/main.c, project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/msc/src/main.c, project/at_start_f415/examples/usb_device/printer/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, usbh_msc_diskio.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • OTG_DEVICE : at32f415_usb.h
  • OTG_DEVICE_ADDR_OFFSET : at32f415_usb.h
  • OTG_DEVICE_EPTIN_ADDR_OFFSET : at32f415_usb.h
  • OTG_DEVICE_EPTOUT_ADDR_OFFSET : at32f415_usb.h
  • OTG_DEVICE_MODE : at32f415_usb.h
  • OTG_DRD_MODE : at32f415_usb.h
  • OTG_FIFO_ADDR_OFFSET : at32f415_usb.h
  • OTG_FIFO_SIZE : at32f415_usb.h
  • OTG_HOST : at32f415_usb.h
  • OTG_HOST_ADDR_OFFSET : at32f415_usb.h
  • OTG_HOST_CHANNEL_ADDR_OFFSET : at32f415_usb.h
  • OTG_HOST_MODE : at32f415_usb.h
  • otg_id_type : at32f415_usb.h
  • OTG_IRQ : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_IRQ_HANDLER : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h, project/at_start_f415/examples/usb_device/audio/src/main.c, project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/msc/src/main.c, project/at_start_f415/examples/usb_device/printer/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • otg_mode_type : at32f415_usb.h
  • OTG_PCGCCTL : at32f415_usb.h
  • OTG_PCGCCTL_ADDR_OFFSET : at32f415_usb.h
  • OTG_PIN_DM : project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h
  • OTG_PIN_DP : project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h
  • OTG_PIN_GPIO : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_PIN_GPIO_CLOCK : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_PIN_ID : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_PIN_POWER_SWITCH : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • OTG_PIN_POWER_SWITCH_CLOCK : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • OTG_PIN_POWER_SWITCH_GPIO : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • OTG_PIN_SOF : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_PIN_SOF_GPIO : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_PIN_SOF_GPIO_CLOCK : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_PIN_VBUS : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_WKUP_EXINT_LINE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_WKUP_HANDLER : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_WKUP_IRQ : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTGFS1_BASE : at32f415.h
  • OTGFS1_IRQn : at32f415.h
  • OTGFS1_WKUP_IRQn : at32f415.h
  • OTGFS_USB_DEVICE : at32f415_usb.h
  • OTGFS_USB_GLOBAL : at32f415_usb.h
  • OTGFS_USB_HOST : at32f415_usb.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- p -

  • PARAMETER_LIST_LENGTH_ERROR : msc_bot_scsi.h
  • PD01_GMUX : at32f415_gpio.h
  • PD01_MUX : at32f415_gpio.h
  • PendSV_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • PendSV_IRQn : at32f415.h
  • period_value : project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/src/main.c
  • PERIPH_BASE : at32f415.h
  • PERIPH_REG : at32f415.h
  • PERIPH_REG_BIT : at32f415.h
  • PERIPHERAL_BASE : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • PERIPHERAL_BITBAND_BASE : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • PERIPHERAL_RESET_BIT : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • PERIPHERAL_SET_BIT : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • pftarget : project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • PKTSTS_CHANNEL_STOP : at32f415_usb.h
  • PKTSTS_DATA_BIT_ERROR : at32f415_usb.h
  • PKTSTS_IN_DATA_PACKET_RECV : at32f415_usb.h
  • PKTSTS_IN_TRANSFER_COMPLETE : at32f415_usb.h
  • PLL_STABLE_DELAY : system_at32f415.h
  • preempt_conversion_count : project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c
  • preempt_trigger_count : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c
  • press_mouse : project/at_start_f415/examples/usb_device/mouse/src/main.c
  • PRINT_UART : at32f415_board.h
  • PRINT_UART_CRM_CLK : at32f415_board.h
  • PRINT_UART_TX_GPIO : at32f415_board.h
  • PRINT_UART_TX_GPIO_CRM_CLK : at32f415_board.h
  • PRINT_UART_TX_PIN : at32f415_board.h
  • PRINTER_DEVICE_ID : printer_class.c
  • PRINTER_DEVICE_ID_LEN : printer_class.h
  • PRINTER_PROTOCOL_1284_4 : printer_desc.h
  • PRINTER_PROTOCOL_BI_DIRECTIONAL : printer_desc.h
  • PRINTER_PROTOCOL_UNIDIRECTIONAL : printer_desc.h
  • PRINTER_PROTOCOL_VENDOR_SPECIFIC : printer_desc.h
  • PRINTER_REQ_GET_DEVICE_ID : printer_class.h
  • PRINTER_REQ_GET_PORT_STATUS : printer_class.h
  • PRINTER_REQ_GET_SOFT_RESET : printer_class.h
  • printer_req_type : printer_class.h
  • PROGRAMMING_TIMEOUT : at32f415_flash.h
  • PUTCHAR_PROTOTYPE : at32f415_board.c
  • pvm_exint_config() : project/at_start_f415/examples/pwc/power_voltage_monitor/src/main.c
  • PVM_IRQHandler() : project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c
  • PVM_IRQn : at32f415.h
  • PWC : at32f415_pwc.h
  • PWC_BASE : at32f415.h
  • pwc_battery_powered_domain_access() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_deep_sleep_enter_type : at32f415_pwc.h
  • PWC_DEEP_SLEEP_ENTER_WFE : at32f415_pwc.h
  • PWC_DEEP_SLEEP_ENTER_WFI : at32f415_pwc.h
  • pwc_deep_sleep_mode_enter() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_flag_clear() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_flag_get() : at32f415_pwc.h, at32f415_pwc.c
  • PWC_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • pwc_power_voltage_monitor_enable() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_pvm_level_select() : at32f415_pwc.h, at32f415_pwc.c
  • PWC_PVM_OUTPUT_FLAG : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V3 : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V4 : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V5 : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V6 : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V7 : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V8 : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V9 : at32f415_pwc.h
  • pwc_pvm_voltage_type : at32f415_pwc.h
  • PWC_REGULATOR_LOW_POWER : at32f415_pwc.h
  • PWC_REGULATOR_ON : at32f415_pwc.h
  • pwc_regulator_type : at32f415_pwc.h
  • pwc_reset() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_sleep_enter_type : at32f415_pwc.h
  • PWC_SLEEP_ENTER_WFE : at32f415_pwc.h
  • PWC_SLEEP_ENTER_WFI : at32f415_pwc.h
  • pwc_sleep_mode_enter() : at32f415_pwc.h, at32f415_pwc.c
  • PWC_STANDBY_FLAG : at32f415_pwc.h
  • pwc_standby_mode_enter() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_voltage_regulate_set() : at32f415_pwc.h, at32f415_pwc.c
  • PWC_WAKEUP_FLAG : at32f415_pwc.h
  • PWC_WAKEUP_PIN_1 : at32f415_pwc.h
  • pwc_wakeup_pin_enable() : at32f415_pwc.h, at32f415_pwc.c


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- q -

  • QWERTY_KEYBOARD : usbh_hid_keyboard.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- r -

  • RAM_BASE : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • RAM_BITBAND_BASE : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • randnum_test() : random.h, random.c
  • rca : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • refOutput : project_l0/src/arm_fir_data.c, utilities/at32f415_slib_demo/project_l0/src/main.c, project_l1/src/arm_fir_data.c, utilities/at32f415_slib_demo/project_l1/src/main.c
  • REG16 : at32f415.h
  • REG32 : at32f415.h
  • REG8 : at32f415.h
  • reg_addr_data : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • report_buf : project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c
  • REQ_SENSE_STANDARD_DATA_LEN : msc_bot_scsi.h
  • RESET : at32f415.h
  • Reset_IRQn : at32f415.h
  • result_error() : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • RIGHT_BUTTON : mouse_class.h
  • RIGHT_MOVE : mouse_class.h
  • run_in_boot_memory_test() : run_in_boot_memory.h, run_in_boot_memory.c
  • rx_buf : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c
  • rx_buf1 : project/at_start_f415/examples/i2c/eeprom/src/main.c
  • rx_buf2 : project/at_start_f415/examples/i2c/eeprom/src/main.c
  • rx_buf3 : project/at_start_f415/examples/i2c/eeprom/src/main.c
  • rx_buffer : project/at_start_f415/examples/spi/w25q_flash/src/main.c, project/at_start_f415/examples/usart/hw_flow_control/src/main.c
  • rx_counter : project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • rx_index : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- s -

  • s16 : at32f415.h
  • s32 : at32f415.h
  • s8 : at32f415.h
  • SAMPLE_FREQ : audio_desc.h, audio_hid_desc.h
  • SAMPLING_NUM : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • sblock_rbuffer : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • sblock_tbuffer : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • sc16 : at32f415.h
  • sc32 : at32f415.h
  • sc8 : at32f415.h
  • SC_3_5V_CLK : smartcard_config.h
  • SC_3_5V_PIN : smartcard_config.h
  • SC_3_5V_PORT : smartcard_config.h
  • sc_a2r_struct : project/at_start_f415/examples/usart/smartcard/src/main.c
  • SC_CMDVCC_CLK : smartcard_config.h
  • SC_CMDVCC_PIN : smartcard_config.h
  • SC_CMDVCC_PORT : smartcard_config.h
  • SC_OFF_CLK : smartcard_config.h
  • SC_OFF_EXINT : smartcard_config.h
  • SC_OFF_EXINT_IRQ : smartcard_config.h
  • SC_OFF_PIN : smartcard_config.h
  • SC_OFF_PINSOURCE : smartcard_config.h
  • SC_OFF_PORT : smartcard_config.h
  • SC_OFF_PORTSOURCE : smartcard_config.h
  • SC_RECEIVE_TIMEOUT : project/at_start_f415/examples/usart/smartcard/src/main.c
  • SC_RESET_CLK : smartcard_config.h
  • SC_RESET_PIN : smartcard_config.h
  • SC_RESET_PORT : smartcard_config.h
  • sc_response_decode() : project/at_start_f415/examples/usart/smartcard/src/main.c
  • SC_USART : smartcard_config.h
  • SC_USART_CLK : smartcard_config.h
  • SC_USART_CLK_PIN : smartcard_config.h
  • SC_USART_CLK_PORT : smartcard_config.h
  • SC_USART_GPIO_CLK : smartcard_config.h
  • SC_USART_IRQHandler : smartcard_config.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c
  • SC_USART_IRQn : smartcard_config.h
  • SC_USART_TX_PIN : smartcard_config.h
  • SC_USART_TX_PORT : smartcard_config.h
  • sclk_144m_hick_config() : project/at_start_f415/examples/crm/clock_failure_detection/src/main.c
  • sclk_64m_hick_config() : project/at_start_f415/examples/crm/sysclk_switch/src/main.c
  • sclk_96m_hext_config() : project/at_start_f415/examples/crm/sysclk_switch/src/main.c
  • scr_find() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • scsi_inquiry : msc/src/msc_diskio.c, virtual_msc_iap/src/msc_diskio.c
  • SCSI_INQUIRY_DATA_LENGTH : msc_bot_scsi.h
  • SD_0TO7BITS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_16TO23BITS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_24TO31BITS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_8TO15BITS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_ADDR_MISALIGNED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_ADDR_OUT_OF_RANGE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_AKE_SEQ_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_ALLZERO : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_BLK_LEN_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_block_read() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_block_write() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_blocks_erase() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_bus_wide_enable() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • SD_CARD_CONTROLLER_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_DISCONNECTED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_ECC_DISABLED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_ECC_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_IDENTIFICATION : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_card_info : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_card_info_get() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_card_init() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • SD_CARD_LOCKED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_PROGRAMMING : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h, sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_READY : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_RECEIVING : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h, sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_SENDING : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_STANDBY : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_card_state_type : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_TRANSFER : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CCCC_ERASE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CCCC_LOCK_UNLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CCCC_WRITE_PROT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CHECK_PATTERN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CID_CSD_OVERWRITE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_ALL_SEND_CID : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_APP_CMD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_APP_SD_SET_BUSWIDTH : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_CLR_WRITE_PROT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_CRC_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_ERASE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_ERASE_GRP_END : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_ERASE_GRP_START : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_FAIL : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_FAST_IO : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_GEN_CMD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_GO_IDLE_STATE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_GO_INACTIVE_STATE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_GO_IRQ_STATE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_HS_BUSTEST_READ : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_HS_BUSTEST_WRITE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_HS_SEND_EXT_CSD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_HS_SWITCH : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_LOCK_UNLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_NO_CMD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_OUT_OF_RANGE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_PROG_CID : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_PROG_CSD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_READ_DAT_UNTIL_STOP : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_READ_MULT_BLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_READ_SINGLE_BLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_RSP_TIMEOUT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_CHANGE_SECURE_AREA : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_GET_CER_RES1 : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_GET_CER_RN2 : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_GET_MID : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_GET_MKB : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_OP_COND : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SECURE_ERASE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SECURE_WRITE_MKB : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SEND_SCR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SET_CER_RES2 : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SET_CER_RN1 : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SET_CLR_CARD_DETECT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_STAUS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_ERASE_GRP_END : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_ERASE_GRP_START : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SDIO_RW_DIRECT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SDIO_RW_EXTENDED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SDIO_SEN_OP_COND : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SEL_DESEL_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SEND_CID : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SEND_CSD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SEND_OP_COND : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SEND_STATUS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SEND_WRITE_PROT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SET_BLOCK_COUNT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SET_BLOCKLEN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SET_DSR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SET_REL_ADDR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SET_WRITE_PROT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_STOP_TRANSMISSION : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_WRITE_DAT_UNTIL_STOP : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_WRITE_MULT_BLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_WRITE_SINGLE_BLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_DATA_FAIL : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_DATA_TIMEOUT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_data_transfer_mode_type : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_DATATIMEOUT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_deselect_select() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_device_mode_set() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_dma_config() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • SD_ERASE_RESET : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_ERASE_SEQ_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_error_status_type : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_GENERAL_UNKNOWN_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_HALFFIFO : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_HALFFIFOBYTES : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_HIGH_CAPACITY : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_ILLEGAL_CMD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_init() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • SD_INTERNAL_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_INVALID_ERASE_PARAM : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_INVALID_PARAMETER : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_INVALID_VOLTRANGE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_irq_service() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • SD_LOCK_UNLOCK_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_LUN : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • SD_MAX_DATA_LENGTH : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_MAX_VOLT_TRIAL : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_memory_card_type : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_mult_blocks_read() : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_mult_blocks_write() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_multiple_blocks_test() : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • SD_NOT_CONFIGURED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_ADDR_MISALIGNED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_ADDR_OUT_OF_RANGE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_AKE_SEQ_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_BLK_LEN_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_CARD_CONTROLLER_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_CARD_ECC_DISABLED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_CARD_ECC_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_CID_CSD_OVERWRIETE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_CMD_CRC_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_ERASE_RESET : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_ERASE_SEQ_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_ERRORBITS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_GENERAL_UNKNOWN_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_ILLEGAL_CMD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_INVALID_ERASE_PARAM : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_LOCK_UNLOCK_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_STREAM_RD_UNDERRUN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_STREAM_WR_OVERRUN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_WP_ERASE_SKIP : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_WR_PROTECT_VIOLATION : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_power_off() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_power_on() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • SD_R5_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_R5_FUNCTION_NUMBER : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_R5_OUT_OF_RANGE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_R6_CMD_CRC_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_R6_GENERAL_UNKNOWN_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_R6_ILLEGAL_CMD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_REQ_NOT_APPLICABLE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_REQ_PENDING : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_RX_OVERRUN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_SDIO_DISABLED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_SDIO_FUNC_BUSY : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_SDIO_FUNC_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_SDIO_UNKNOWN_FUNC : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_single_block_test() : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • SD_SINGLE_BUS_SUPPORT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_START_BIT_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_state_get() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_status_send() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • SD_STD_CAPACITY : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_STREAM_RD_UNDERRUN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_STREAM_WR_OVERRUN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_switch() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • SD_SWITCH_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_test_error() : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c, project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c
  • SD_TRANSFER_DMA_MODE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_TRANSFER_POLLING_MODE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_TX_UNDERRUN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_UNSUPPORTED_FEATURE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_UNSUPPORTED_HW : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_VOLTAGE_WINDOW_MMC : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_VOLTAGE_WINDOW_SD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_wide_bus_operation_config() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • SD_WIDE_BUS_SUPPORT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_WP_ERASE_SKIP : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_WR_PROTECT_VIOLATION : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_write_disk() : diskio.c
  • SDIO1 : at32f415_sdio.h
  • SDIO1_BASE : at32f415.h
  • SDIO1_GMUX_0100 : at32f415_gpio.h
  • SDIO1_GMUX_0101 : at32f415_gpio.h
  • SDIO1_GMUX_0110 : at32f415_gpio.h
  • SDIO1_GMUX_0111 : at32f415_gpio.h
  • SDIO1_IRQHandler() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • SDIO1_IRQn : at32f415.h
  • SDIO2_IRQHandler() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • sdio_block_size_type : at32f415_sdio.h
  • sdio_buffer_counter_get() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_bus_width_config() : at32f415_sdio.h, at32f415_sdio.c
  • SDIO_BUS_WIDTH_D1 : at32f415_sdio.h
  • SDIO_BUS_WIDTH_D4 : at32f415_sdio.h
  • SDIO_BUS_WIDTH_D8 : at32f415_sdio.h
  • sdio_bus_width_type : at32f415_sdio.h
  • sdio_clock_bypass() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_clock_config() : at32f415_sdio.h, at32f415_sdio.c
  • SDIO_CLOCK_EDGE_FALLING : at32f415_sdio.h
  • SDIO_CLOCK_EDGE_RISING : at32f415_sdio.h
  • sdio_clock_enable() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_clock_set() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • SDIO_CMD0TIMEOUT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_CMDCMPL_FLAG : at32f415_sdio.h
  • SDIO_CMDCMPL_INT : at32f415_sdio.h
  • SDIO_CMDFAIL_FLAG : at32f415_sdio.h
  • SDIO_CMDFAIL_INT : at32f415_sdio.h
  • SDIO_CMDRSPCMPL_FLAG : at32f415_sdio.h
  • SDIO_CMDRSPCMPL_INT : at32f415_sdio.h
  • SDIO_CMDTIMEOUT_FLAG : at32f415_sdio.h
  • SDIO_CMDTIMEOUT_INT : at32f415_sdio.h
  • sdio_command_config() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_command_data_send() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • sdio_command_init_struct : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • sdio_command_response_get() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_command_state_machine_enable() : at32f415_sdio.h, at32f415_sdio.c
  • SDIO_DATA_BLOCK_SIZE_1024B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_128B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_16384B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_16B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_1B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_2048B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_256B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_2B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_32B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_4096B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_4B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_512B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_64B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_8192B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_8B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_TRANSFER : at32f415_sdio.h
  • sdio_data_config() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_data_counter_get() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_data_init_struct : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • sdio_data_read() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_data_state_machine_enable() : at32f415_sdio.h, at32f415_sdio.c
  • SDIO_DATA_STREAM_TRANSFER : at32f415_sdio.h
  • SDIO_DATA_TRANSFER_TO_CARD : at32f415_sdio.h
  • SDIO_DATA_TRANSFER_TO_CONTROLLER : at32f415_sdio.h
  • sdio_data_write() : at32f415_sdio.h, at32f415_sdio.c
  • SDIO_DATATIMEOUT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sdio_dma_enable() : at32f415_sdio.h, at32f415_sdio.c
  • SDIO_DOCMD_FLAG : at32f415_sdio.h
  • SDIO_DOCMD_INT : at32f415_sdio.h
  • SDIO_DORX_FLAG : at32f415_sdio.h
  • SDIO_DORX_INT : at32f415_sdio.h
  • SDIO_DOTX_FLAG : at32f415_sdio.h
  • SDIO_DOTX_INT : at32f415_sdio.h
  • SDIO_DTBLKCMPL_FLAG : at32f415_sdio.h
  • SDIO_DTBLKCMPL_INT : at32f415_sdio.h
  • SDIO_DTCMP_INT : at32f415_sdio.h
  • SDIO_DTCMPL_FLAG : at32f415_sdio.h
  • SDIO_DTFAIL_FLAG : at32f415_sdio.h
  • SDIO_DTFAIL_INT : at32f415_sdio.h
  • SDIO_DTTIMEOUT_FLAG : at32f415_sdio.h
  • SDIO_DTTIMEOUT_INT : at32f415_sdio.h
  • sdio_edge_phase_type : at32f415_sdio.h
  • SDIO_FIFO_Address : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sdio_flag_clear() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_flag_get() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_flow_control_enable() : at32f415_sdio.h, at32f415_sdio.c
  • SDIO_HIGH_CAPACITY_MMC_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_HIGH_CAPACITY_SD_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_HIGH_SPEED_MULTIMEDIA_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sdio_interrupt_enable() : at32f415_sdio.h, at32f415_sdio.c
  • SDIO_INTR_STS_READ_MASK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_INTR_STS_WRITE_MASK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sdio_io_function_enable() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_io_suspend_command_set() : at32f415_sdio.h, at32f415_sdio.c
  • SDIO_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • SDIO_MULTIMEDIA_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_POWER_OFF : at32f415_sdio.h
  • SDIO_POWER_ON : at32f415_sdio.h
  • sdio_power_saving_mode_enable() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_power_set() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_power_state_type : at32f415_sdio.h
  • sdio_power_status_get() : at32f415_sdio.h, at32f415_sdio.c
  • SDIO_READ_WAIT_CONTROLLED_BY_CK : at32f415_sdio.h
  • SDIO_READ_WAIT_CONTROLLED_BY_D2 : at32f415_sdio.h
  • sdio_read_wait_mode_set() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_read_wait_mode_type : at32f415_sdio.h
  • sdio_read_wait_start() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_read_wait_stop() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_reponse_type : at32f415_sdio.h
  • sdio_reset() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_response_get() : at32f415_sdio.h, at32f415_sdio.c
  • SDIO_RESPONSE_LONG : at32f415_sdio.h
  • SDIO_RESPONSE_NO : at32f415_sdio.h
  • SDIO_RESPONSE_SHORT : at32f415_sdio.h
  • SDIO_RSP1_INDEX : at32f415_sdio.h
  • SDIO_RSP2_INDEX : at32f415_sdio.h
  • SDIO_RSP3_INDEX : at32f415_sdio.h
  • SDIO_RSP4_INDEX : at32f415_sdio.h
  • sdio_rsp_index_type : at32f415_sdio.h
  • SDIO_RXBUF_FLAG : at32f415_sdio.h
  • SDIO_RXBUF_INT : at32f415_sdio.h
  • SDIO_RXBUFE_FLAG : at32f415_sdio.h
  • SDIO_RXBUFE_INT : at32f415_sdio.h
  • SDIO_RXBUFF_FLAG : at32f415_sdio.h
  • SDIO_RXBUFF_INT : at32f415_sdio.h
  • SDIO_RXBUFH_FLAG : at32f415_sdio.h
  • SDIO_RXBUFH_INT : at32f415_sdio.h
  • SDIO_RXERRO_FLAG : at32f415_sdio.h
  • SDIO_RXERRO_INT : at32f415_sdio.h
  • SDIO_SBITERR_FLAG : at32f415_sdio.h
  • SDIO_SBITERR_INT : at32f415_sdio.h
  • SDIO_SDIO_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_SDIOIF_FLAG : at32f415_sdio.h
  • SDIO_SDIOIF_INT : at32f415_sdio.h
  • SDIO_SECURE_DIGITAL_IO_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_SECURE_DIGITAL_IO_COMBO_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_SEND_IF_COND : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_STATIC_FLAGS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_STD_CAPACITY_SD_CARD_V1_1 : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_STD_CAPACITY_SD_CARD_V2_0 : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sdio_transfer_direction_type : at32f415_sdio.h
  • sdio_transfer_mode_type : at32f415_sdio.h
  • SDIO_TXBUF_FLAG : at32f415_sdio.h
  • SDIO_TXBUF_INT : at32f415_sdio.h
  • SDIO_TXBUFE_FLAG : at32f415_sdio.h
  • SDIO_TXBUFE_INT : at32f415_sdio.h
  • SDIO_TXBUFF_FLAG : at32f415_sdio.h
  • SDIO_TXBUFF_INT : at32f415_sdio.h
  • SDIO_TXBUFH_FLAG : at32f415_sdio.h
  • SDIO_TXBUFH_INT : at32f415_sdio.h
  • SDIO_TXERRU_FLAG : at32f415_sdio.h
  • SDIO_TXERRU_INT : at32f415_sdio.h
  • SDIO_WAIT_FOR_INT : at32f415_sdio.h
  • SDIO_WAIT_FOR_NO : at32f415_sdio.h
  • SDIO_WAIT_FOR_PEND : at32f415_sdio.h
  • sdio_wait_type : at32f415_sdio.h
  • SDIOx : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SECTOR_NUM : utilities/at32f415_slib_demo/project_l0/src/main.c
  • SECTOR_SIZE : project/at_start_f415/examples/flash/flash_write_read/src/flash.c
  • sector_size : msc/src/msc_diskio.c
  • SECTOR_SIZE_1K : hid_iap_class.h, msc/inc/msc_diskio.h
  • SECTOR_SIZE_2K : hid_iap_class.h, msc/inc/msc_diskio.h
  • SECTOR_SIZE_4K : hid_iap_class.h, msc/inc/msc_diskio.h
  • SECTOR_WORD_CNT : utilities/at32f415_slib_demo/project_l0/src/main.c
  • SENSE_KEY_ABORTED_COMMAND : msc_bot_scsi.h
  • SENSE_KEY_BLANK_CHECK : msc_bot_scsi.h
  • SENSE_KEY_DATA_PROTECT : msc_bot_scsi.h
  • SENSE_KEY_HARDWARE_ERROR : msc_bot_scsi.h
  • SENSE_KEY_ILLEGAL_REQUEST : msc_bot_scsi.h
  • SENSE_KEY_MEDIUM_ERROR : msc_bot_scsi.h
  • SENSE_KEY_MISCOMPARE : msc_bot_scsi.h
  • SENSE_KEY_NO_SENSE : msc_bot_scsi.h
  • SENSE_KEY_NOT_READY : msc_bot_scsi.h
  • SENSE_KEY_RECOVERED_ERROR : msc_bot_scsi.h
  • SENSE_KEY_UNIT_ATTENTION : msc_bot_scsi.h
  • SENSE_KEY_VENDERO_SPECIFIC : msc_bot_scsi.h
  • SENSE_KEY_VOLUME_OVERFLOW : msc_bot_scsi.h
  • serial_descriptor : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • SET : at32f415.h
  • SET_LINE_CODING : cdc_class.h, cdc_keyboard_class.h, msc_bot_scsi.h, printer_class.h
  • SETUP_LENGTH : project/at_start_f415/examples/usart/smartcard/src/main.c
  • SHIFT : cdc_keyboard_class.c, keyboard_class.c
  • show_card_info() : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • SLIB_DATA_ADDR : utilities/at32f415_slib_demo/project_l0/src/main.c
  • slib_enable() : utilities/at32f415_slib_demo/project_l0/src/main.c
  • SLIB_END_ADDR : utilities/at32f415_slib_demo/project_l0/src/main.c
  • SLIB_START_ADDR : utilities/at32f415_slib_demo/project_l0/src/main.c
  • SLIB_UNLOCK_KEY : at32f415_flash.h
  • SLOW : project/at_start_f415/templates/src/main.c
  • SNR_THRESHOLD_F32 : utilities/at32f415_slib_demo/project_l0/src/main.c, utilities/at32f415_slib_demo/project_l1/src/main.c
  • speed_change() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • SPI1 : at32f415_spi.h
  • SPI1_BASE : at32f415.h
  • SPI1_buffer_tx : project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c
  • SPI1_GMUX_0001 : at32f415_gpio.h
  • SPI1_IRQHandler() : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c
  • SPI1_IRQn : at32f415.h
  • SPI1_MUX_01 : at32f415_gpio.h
  • spi1_rx_buffer : project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c
  • spi1_tx_buffer : project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c
  • SPI2 : at32f415_spi.h
  • SPI2_BASE : at32f415.h
  • spi2_buffer_rx : project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c
  • SPI2_GMUX_0001 : at32f415_gpio.h
  • SPI2_IRQHandler() : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c
  • SPI2_IRQn : at32f415.h
  • spi2_rx_buffer : project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c
  • spi2_rx_counter : project/at_start_f415/examples/usart/synchronous/src/main.c
  • spi2_tx_buffer : project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c
  • SPI2_TX_BUFFER_SIZE : project/at_start_f415/examples/usart/synchronous/src/main.c
  • spi2_tx_buffer_size : project/at_start_f415/examples/usart/synchronous/src/main.c
  • spi2_tx_counter : project/at_start_f415/examples/usart/synchronous/src/main.c
  • spi_byte_read() : spi_flash.h, spi_flash.c
  • spi_byte_write() : spi_flash.h, spi_flash.c
  • spi_bytes_read() : spi_flash.h, spi_flash.c
  • spi_bytes_write() : spi_flash.h, spi_flash.c
  • SPI_CCERR_FLAG : at32f415_spi.h
  • SPI_CLOCK_PHASE_1EDGE : at32f415_spi.h
  • SPI_CLOCK_PHASE_2EDGE : at32f415_spi.h
  • spi_clock_phase_type : at32f415_spi.h
  • SPI_CLOCK_POLARITY_HIGH : at32f415_spi.h
  • SPI_CLOCK_POLARITY_LOW : at32f415_spi.h
  • spi_clock_polarity_type : at32f415_spi.h
  • spi_config() : project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c
  • spi_crc_direction_type : at32f415_spi.h
  • spi_crc_enable() : at32f415_spi.h, at32f415_spi.c
  • spi_crc_next_transmit() : at32f415_spi.h, at32f415_spi.c
  • spi_crc_polynomial_get() : at32f415_spi.h, at32f415_spi.c
  • spi_crc_polynomial_set() : at32f415_spi.h, at32f415_spi.c
  • SPI_CRC_RX : at32f415_spi.h
  • SPI_CRC_TX : at32f415_spi.h
  • spi_crc_value_get() : at32f415_spi.h, at32f415_spi.c
  • SPI_CS_HARDWARE_MODE : at32f415_spi.h
  • spi_cs_mode_type : at32f415_spi.h
  • SPI_CS_SOFTWARE_MODE : at32f415_spi.h
  • spi_default_para_init() : at32f415_spi.h, at32f415_spi.c
  • spi_enable() : at32f415_spi.h, at32f415_spi.c
  • SPI_FIRST_BIT_LSB : at32f415_spi.h
  • SPI_FIRST_BIT_MSB : at32f415_spi.h
  • spi_first_bit_type : at32f415_spi.h
  • SPI_FLASH_LUN : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • SPI_FRAME_16BIT : at32f415_spi.h
  • SPI_FRAME_8BIT : at32f415_spi.h
  • spi_frame_bit_num_set() : at32f415_spi.h, at32f415_spi.c
  • spi_frame_bit_num_type : at32f415_spi.h
  • SPI_HALF_DUPLEX_DIRECTION_RX : at32f415_spi.h
  • spi_half_duplex_direction_set() : at32f415_spi.h, at32f415_spi.c
  • SPI_HALF_DUPLEX_DIRECTION_TX : at32f415_spi.h
  • spi_half_duplex_direction_type : at32f415_spi.h
  • spi_hardware_cs_output_enable() : at32f415_spi.h, at32f415_spi.c
  • SPI_I2S_BF_FLAG : at32f415_spi.h
  • spi_i2s_data_receive() : at32f415_spi.h, at32f415_spi.c
  • spi_i2s_data_transmit() : at32f415_spi.h, at32f415_spi.c
  • spi_i2s_dma_receiver_enable() : at32f415_spi.h, at32f415_spi.c
  • spi_i2s_dma_transmitter_enable() : at32f415_spi.h, at32f415_spi.c
  • SPI_I2S_ERROR_INT : at32f415_spi.h
  • spi_i2s_flag_clear() : at32f415_spi.h, at32f415_spi.c
  • spi_i2s_flag_get() : at32f415_spi.h, at32f415_spi.c
  • spi_i2s_interrupt_enable() : at32f415_spi.h, at32f415_spi.c
  • SPI_I2S_RDBF_FLAG : at32f415_spi.h
  • SPI_I2S_RDBF_INT : at32f415_spi.h
  • spi_i2s_reset() : at32f415_spi.h, at32f415_spi.c
  • SPI_I2S_ROERR_FLAG : at32f415_spi.h
  • SPI_I2S_TDBE_FLAG : at32f415_spi.h
  • SPI_I2S_TDBE_INT : at32f415_spi.h
  • spi_init() : at32f415_spi.h, at32f415_spi.c
  • spi_init_struct : project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c
  • spi_master_slave_mode_type : at32f415_spi.h
  • SPI_MCLK_DIV_1024 : at32f415_spi.h
  • SPI_MCLK_DIV_128 : at32f415_spi.h
  • SPI_MCLK_DIV_16 : at32f415_spi.h
  • SPI_MCLK_DIV_2 : at32f415_spi.h
  • SPI_MCLK_DIV_256 : at32f415_spi.h
  • SPI_MCLK_DIV_32 : at32f415_spi.h
  • SPI_MCLK_DIV_4 : at32f415_spi.h
  • SPI_MCLK_DIV_512 : at32f415_spi.h
  • SPI_MCLK_DIV_64 : at32f415_spi.h
  • SPI_MCLK_DIV_8 : at32f415_spi.h
  • spi_mclk_freq_div_type : at32f415_spi.h
  • SPI_MMERR_FLAG : at32f415_spi.h
  • SPI_MODE_MASTER : at32f415_spi.h
  • SPI_MODE_SLAVE : at32f415_spi.h
  • SPI_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • spi_software_cs_internal_level_set() : at32f415_spi.h, at32f415_spi.c
  • spi_software_cs_level_type : at32f415_spi.h
  • SPI_SWCS_INTERNAL_LEVEL_HIGHT : at32f415_spi.h
  • SPI_SWCS_INTERNAL_LEVEL_LOW : at32f415_spi.h
  • spi_transmission_mode_type : at32f415_spi.h
  • SPI_TRANSMIT_FULL_DUPLEX : at32f415_spi.h
  • SPI_TRANSMIT_HALF_DUPLEX_RX : at32f415_spi.h
  • SPI_TRANSMIT_HALF_DUPLEX_TX : at32f415_spi.h
  • SPI_TRANSMIT_SIMPLEX_RX : at32f415_spi.h
  • SPIF_BLOCKERASE : spi_flash.h
  • SPIF_CHIP_SIZE : spi_flash.h
  • SPIF_CHIPERASE : spi_flash.h
  • SPIF_DEVICEID : spi_flash.h
  • SPIF_FASTREADDATA : spi_flash.h
  • SPIF_FASTREADDUAL : spi_flash.h
  • SPIF_JEDECDEVICEID : spi_flash.h
  • SPIF_MANUFACTDEVICEID : spi_flash.h
  • SPIF_PAGE_SIZE : spi_flash.h
  • SPIF_PAGEPROGRAM : spi_flash.h
  • SPIF_POWERDOWN : spi_flash.h
  • SPIF_READDATA : spi_flash.h
  • SPIF_READSTATUSREG1 : spi_flash.h
  • SPIF_READSTATUSREG2 : spi_flash.h
  • SPIF_READSTATUSREG3 : spi_flash.h
  • SPIF_RELEASEPOWERDOWN : spi_flash.h
  • SPIF_SECTOR_SIZE : spi_flash.h
  • SPIF_SECTORERASE : spi_flash.h
  • SPIF_WRITEDISABLE : spi_flash.h
  • SPIF_WRITEENABLE : spi_flash.h
  • SPIF_WRITESTATUSREG1 : spi_flash.h
  • SPIF_WRITESTATUSREG2 : spi_flash.h
  • SPIF_WRITESTATUSREG3 : spi_flash.h
  • spiflash_init() : spi_flash.h, spi_flash.c
  • spiflash_page_write() : spi_flash.h, spi_flash.c
  • spiflash_read() : spi_flash.h, spi_flash.c
  • spiflash_read_id() : spi_flash.h, spi_flash.c
  • spiflash_read_sr1() : spi_flash.h, spi_flash.c
  • spiflash_sector_buf : spi_flash.c
  • spiflash_sector_erase() : spi_flash.h, spi_flash.c
  • spiflash_wait_busy() : spi_flash.h, spi_flash.c
  • spiflash_write() : spi_flash.h, spi_flash.c
  • spiflash_write_enable() : spi_flash.h, spi_flash.c
  • spiflash_write_nocheck() : spi_flash.h, spi_flash.c
  • SPIM_FLASH_BASE : at32f415.h
  • SPK_BUFFER_SIZE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • spk_dma_buffer : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • SPK_TX_FIFO_SIZE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • SRAM_BASE : at32f415.h
  • SRAM_SIZE : utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h
  • src_buffer : project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c
  • src_const_buffer : project/at_start_f415/examples/dma/flash_to_sram/src/main.c
  • step : project/at_start_f415/examples/tmr/6_steps/src/main.c
  • STEP_DELAY_MS : at32f415_board.c
  • stop_flag : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • STREAM_BUFFER_SIZE : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • stream_rbuffer : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • stream_tbuffer : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • sub_tmr_input_sel_type : at32f415_tmr.h
  • SUCCESS : at32f415.h
  • SVC_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • SVCall_IRQn : at32f415.h
  • SWAPBYTE : usb_std.h
  • switch_system_clock() : project/at_start_f415/examples/crm/sysclk_switch/src/main.c
  • swj_dp_config() : project/at_start_f415/examples/gpio/swjtag_remap/src/main.c
  • SWJTAG_GMUX_001 : at32f415_gpio.h
  • SWJTAG_GMUX_010 : at32f415_gpio.h
  • SWJTAG_GMUX_100 : at32f415_gpio.h
  • SWJTAG_MUX_001 : at32f415_gpio.h
  • SWJTAG_MUX_010 : at32f415_gpio.h
  • SWJTAG_MUX_100 : at32f415_gpio.h
  • sys_counter : project/at_start_f415/examples/tmr/input_capture/src/main.c
  • sysclk_config_deep_sleep() : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c
  • system_clock_config() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_clock.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_clock.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_clock.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_clock.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_clock.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_clock.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_clock.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_clock.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_clock.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_clock.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_clock.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_clock.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_clock.c, project/at_start_f415/examples/can/filter/inc/at32f415_clock.h, project/at_start_f415/examples/can/filter/src/at32f415_clock.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_clock.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_clock.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_clock.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_clock.c, project/at_start_f415/examples/cmp/output/inc/at32f415_clock.h, project/at_start_f415/examples/cmp/output/src/at32f415_clock.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_clock.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_clock.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_clock.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_clock.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_clock.h, project/at_start_f415/examples/crc/calculation/src/at32f415_clock.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_clock.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_clock.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_clock.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_clock.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_clock.h, project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_clock.c, project/at_start_f415/examples/debug/tmr1/inc/at32f415_clock.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_clock.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_clock.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_clock.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_clock.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_clock.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_clock.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_clock.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_clock.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_clock.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_clock.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_clock.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_clock.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_clock.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_clock.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_clock.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_clock.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_clock.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_clock.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_clock.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_clock.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_clock.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_clock.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_clock.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_clock.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_clock.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_clock.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_clock.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_clock.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_clock.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_clock.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_clock.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_clock.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_clock.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_clock.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_clock.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_clock.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_clock.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_clock.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_clock.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_clock.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_clock.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_clock.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_clock.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_clock.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_clock.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_clock.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_clock.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_clock.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_clock.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_clock.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_clock.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_clock.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_clock.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_clock.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_clock.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_clock.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_clock.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_clock.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_clock.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_clock.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_clock.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_clock.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_clock.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_clock.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_clock.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_clock.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_clock.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_clock.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_clock.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_clock.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/dma/src/at32f415_clock.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_clock.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_clock.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_clock.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_clock.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_clock.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_clock.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_clock.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_clock.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_clock.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_clock.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_clock.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_clock.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_clock.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_clock.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_clock.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_clock.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_clock.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_clock.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_clock.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_clock.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_clock.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_clock.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_clock.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_clock.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_clock.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_clock.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_clock.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_clock.c, project/at_start_f415/examples/usart/irda/inc/at32f415_clock.h, project/at_start_f415/examples/usart/irda/src/at32f415_clock.c, project/at_start_f415/examples/usart/polling/inc/at32f415_clock.h, project/at_start_f415/examples/usart/polling/src/at32f415_clock.c, project/at_start_f415/examples/usart/printf/inc/at32f415_clock.h, project/at_start_f415/examples/usart/printf/src/at32f415_clock.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_clock.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_clock.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_clock.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_clock.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_clock.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_clock.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_clock.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_clock.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_clock.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_clock.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_clock.h, project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_clock.c, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_clock.h, project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_clock.c, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_clock.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_clock.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_clock.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_clock.c, project/at_start_f415/templates/inc/at32f415_clock.h, project/at_start_f415/templates/src/at32f415_clock.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_clock.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_clock.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_clock.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_clock.c, utilities/at32f415_freertos_demo/inc/at32f415_clock.h, utilities/at32f415_freertos_demo/src/at32f415_clock.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_clock.h, utilities/at32f415_gen_random_number_demo/src/at32f415_clock.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_clock.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_clock.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_clock.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_clock.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_clock.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_clock.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_clock.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_clock.c
  • system_clock_recover() : project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c
  • system_core_clock : system_at32f415.c, system_at32f415.h
  • system_core_clock_update() : system_at32f415.c, system_at32f415.h
  • SystemInit() : system_at32f415.c, system_at32f415.h
  • SYSTICK_CLOCK_SOURCE_AHBCLK_DIV8 : at32f415_misc.h
  • SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV : at32f415_misc.h
  • systick_clock_source_config() : at32f415_misc.h, at32f415_misc.c
  • systick_clock_source_type : at32f415_misc.h
  • systick_configuration() : project/at_start_f415/examples/tmr/6_steps/src/main.c
  • SysTick_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • systick_handler() : project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c
  • SysTick_IRQn : at32f415.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- t -

  • T0_PROTOCOL : project/at_start_f415/examples/usart/smartcard/src/main.c
  • TAMP_STAMP_IRQHandler() : project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c
  • TAMP_STAMP_IRQn : at32f415.h
  • temp_buf : utilities/at32f415_slib_demo/project_l0/src/main.c
  • TEST_BUFEER_SIZE : project/at_start_f415/examples/flash/flash_write_read/src/main.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c
  • TEST_FLASH_ADDRESS_START : project/at_start_f415/examples/flash/flash_write_read/src/main.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c
  • TEST_LENGTH_SAMPLES : utilities/at32f415_slib_demo/project_l0/src/main.c, utilities/at32f415_slib_demo/project_l1/src/main.c
  • test_result : project/at_start_f415/examples/can/filter/src/main.c
  • TEST_SLIB_PSW : utilities/at32f415_slib_demo/project_l0/src/main.c
  • testInput_f32_1kHz_15kHz : project_l0/src/arm_fir_data.c, utilities/at32f415_slib_demo/project_l0/src/main.c, project_l1/src/arm_fir_data.c, utilities/at32f415_slib_demo/project_l1/src/main.c
  • testOutput : utilities/at32f415_slib_demo/project_l0/src/main.c, utilities/at32f415_slib_demo/project_l1/src/main.c
  • time : random.c
  • time_cnt : project/at_start_f415/examples/usart/printf/src/main.c
  • time_ira_cnt : bootloader/inc/tmr.h, bootloader/src/tmr.c
  • timer_period : project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c
  • tmp_c4 : project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c
  • TMR1 : at32f415_tmr.h
  • TMR10 : at32f415_tmr.h
  • TMR10_BASE : at32f415.h
  • TMR10_GMUX : at32f415_gpio.h
  • TMR11 : at32f415_tmr.h
  • TMR11_BASE : at32f415.h
  • TMR11_GMUX : at32f415_gpio.h
  • TMR12 : at32f415_tmr.h
  • TMR13 : at32f415_tmr.h
  • TMR14 : at32f415_tmr.h
  • TMR1_BASE : at32f415.h
  • TMR1_BK1_CMP_GMUX_10 : at32f415_gpio.h
  • TMR1_BK1_CMP_GMUX_11 : at32f415_gpio.h
  • TMR1_BRK_TMR9_IRQHandler() : project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c
  • TMR1_BRK_TMR9_IRQn : at32f415.h
  • TMR1_C1DT_ADDRESS : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • TMR1_C2DT_ADDRESS : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • TMR1_CH1_CMP_GMUX_10 : at32f415_gpio.h
  • TMR1_CH1_CMP_GMUX_11 : at32f415_gpio.h
  • TMR1_CH_IRQHandler() : project/at_start_f415/examples/cmp/output/src/at32f415_int.c
  • TMR1_CH_IRQn : at32f415.h
  • tmr1_config() : project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c, project/at_start_f415/examples/exint/exint_software_trigger/src/main.c
  • TMR1_GMUX_0001 : at32f415_gpio.h
  • TMR1_GMUX_0010 : at32f415_gpio.h
  • tmr1_init() : project/at_start_f415/examples/cmp/output/src/main.c
  • TMR1_MUX_01 : at32f415_gpio.h
  • TMR1_OVF_TMR10_IRQHandler() : project/at_start_f415/examples/debug/tmr1/src/main.c, project/at_start_f415/examples/exint/exint_software_trigger/src/main.c, project/at_start_f415/examples/tmr/timer_base/src/main.c
  • TMR1_OVF_TMR10_IRQn : at32f415.h
  • TMR1_TRG_HALL_TMR11_IRQHandler() : project/at_start_f415/examples/tmr/6_steps/src/main.c
  • TMR1_TRG_HALL_TMR11_IRQn : at32f415.h
  • tmr1freq : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c, project/at_start_f415/examples/cmp/output/src/main.c
  • TMR2 : at32f415_tmr.h
  • TMR2_BASE : at32f415.h
  • TMR2_CH4_CMP_GMUX_10 : at32f415_gpio.h
  • TMR2_CH4_CMP_GMUX_11 : at32f415_gpio.h
  • tmr2_config() : project/at_start_f415/examples/pwc/sleep_tmr2/src/main.c
  • TMR2_GLOBAL_IRQHandler() : project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c
  • TMR2_GLOBAL_IRQn : at32f415.h
  • TMR2_GMUX_001 : at32f415_gpio.h
  • TMR2_GMUX_010 : at32f415_gpio.h
  • TMR2_GMUX_011 : at32f415_gpio.h
  • TMR2_MUX_01 : at32f415_gpio.h
  • TMR2_MUX_10 : at32f415_gpio.h
  • TMR2_MUX_11 : at32f415_gpio.h
  • TMR3 : at32f415_tmr.h
  • TMR3_BASE : at32f415.h
  • TMR3_CH1_CMP_GMUX_10 : at32f415_gpio.h
  • TMR3_CH1_CMP_GMUX_11 : at32f415_gpio.h
  • TMR3_GLOBAL_IRQHandler() : project/at_start_f415/examples/tmr/input_capture/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, app_led3_toggle/src/tmr.c, app_led4_toggle/src/tmr.c, bootloader/src/tmr.c
  • TMR3_GLOBAL_IRQn : at32f415.h
  • TMR3_GMUX_0010 : at32f415_gpio.h
  • TMR3_GMUX_0011 : at32f415_gpio.h
  • TMR3_MUX_10 : at32f415_gpio.h
  • TMR3_MUX_11 : at32f415_gpio.h
  • tmr3freq : project/at_start_f415/examples/tmr/input_capture/src/main.c
  • TMR4 : at32f415_tmr.h
  • TMR4_BASE : at32f415.h
  • TMR4_GLOBAL_IRQn : at32f415.h
  • TMR5 : at32f415_tmr.h
  • TMR5_BASE : at32f415.h
  • TMR5_GLOBAL_IRQHandler() : project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c
  • TMR5_GLOBAL_IRQn : at32f415.h
  • TMR5_GMUX_001 : at32f415_gpio.h
  • TMR5CH4_GMUX : at32f415_gpio.h
  • TMR5CH4_MUX : at32f415_gpio.h
  • TMR6 : at32f415_tmr.h
  • TMR7 : at32f415_tmr.h
  • TMR8 : at32f415_tmr.h
  • TMR9 : at32f415_tmr.h
  • TMR9_BASE : at32f415.h
  • TMR9_GMUX : at32f415_gpio.h
  • tmr_32_bit_function_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_base_init() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_BRK_ADDRESS : at32f415_tmr.h
  • TMR_BRK_FLAG : at32f415_tmr.h
  • TMR_BRK_INPUT_ACTIVE_HIGH : at32f415_tmr.h
  • TMR_BRK_INPUT_ACTIVE_LOW : at32f415_tmr.h
  • TMR_BRK_INT : at32f415_tmr.h
  • tmr_brk_polarity_type : at32f415_tmr.h
  • TMR_BRK_SWTRIG : at32f415_tmr.h
  • tmr_brkdt_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_brkdt_config_struct : project/at_start_f415/examples/tmr/6_steps/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c
  • tmr_brkdt_default_para_init() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_C1_DMA_REQUEST : at32f415_tmr.h
  • TMR_C1_FLAG : at32f415_tmr.h
  • TMR_C1_INT : at32f415_tmr.h
  • TMR_C1_RECAPTURE_FLAG : at32f415_tmr.h
  • TMR_C1_SWTRIG : at32f415_tmr.h
  • TMR_C1DT_ADDRESS : at32f415_tmr.h
  • TMR_C2_DMA_REQUEST : at32f415_tmr.h
  • TMR_C2_FLAG : at32f415_tmr.h
  • TMR_C2_INT : at32f415_tmr.h
  • TMR_C2_RECAPTURE_FLAG : at32f415_tmr.h
  • TMR_C2_SWTRIG : at32f415_tmr.h
  • TMR_C2DT_ADDRESS : at32f415_tmr.h
  • TMR_C3_DMA_REQUEST : at32f415_tmr.h
  • TMR_C3_FLAG : at32f415_tmr.h
  • TMR_C3_INT : at32f415_tmr.h
  • TMR_C3_RECAPTURE_FLAG : at32f415_tmr.h
  • TMR_C3_SWTRIG : at32f415_tmr.h
  • TMR_C3DT_ADDRESS : at32f415_tmr.h
  • TMR_C4_DMA_REQUEST : at32f415_tmr.h
  • TMR_C4_FLAG : at32f415_tmr.h
  • TMR_C4_INT : at32f415_tmr.h
  • TMR_C4_RECAPTURE_FLAG : at32f415_tmr.h
  • TMR_C4_SWTRIG : at32f415_tmr.h
  • TMR_C4DT_ADDRESS : at32f415_tmr.h
  • TMR_CC_CHANNEL_MAPPED_DIRECT : at32f415_tmr.h
  • TMR_CC_CHANNEL_MAPPED_INDIRECT : at32f415_tmr.h
  • TMR_CC_CHANNEL_MAPPED_STI : at32f415_tmr.h
  • TMR_CCTRL_ADDRESS : at32f415_tmr.h
  • TMR_CHANEL1_2_3_CONNECTED_C1IRAW_XOR : at32f415_tmr.h
  • TMR_CHANEL1_CONNECTED_C1IRAW : at32f415_tmr.h
  • tmr_channel1_input_connected_type : at32f415_tmr.h
  • tmr_channel1_input_select() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_channel_buffer_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_channel_dma_select() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_channel_enable() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_CHANNEL_INPUT_DIV_1 : at32f415_tmr.h
  • TMR_CHANNEL_INPUT_DIV_2 : at32f415_tmr.h
  • TMR_CHANNEL_INPUT_DIV_4 : at32f415_tmr.h
  • TMR_CHANNEL_INPUT_DIV_8 : at32f415_tmr.h
  • tmr_channel_input_divider_type : at32f415_tmr.h
  • tmr_channel_select_type : at32f415_tmr.h
  • tmr_channel_value_get() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_channel_value_set() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_CLOCK_DIV1 : at32f415_tmr.h
  • TMR_CLOCK_DIV2 : at32f415_tmr.h
  • TMR_CLOCK_DIV4 : at32f415_tmr.h
  • tmr_clock_division_type : at32f415_tmr.h
  • tmr_clock_source_div_set() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_CM1_ADDRESS : at32f415_tmr.h
  • TMR_CM2_ADDRESS : at32f415_tmr.h
  • tmr_cnt_dir_set() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_COUNT_DOWN : at32f415_tmr.h
  • tmr_count_mode_type : at32f415_tmr.h
  • TMR_COUNT_TWO_WAY_1 : at32f415_tmr.h
  • TMR_COUNT_TWO_WAY_2 : at32f415_tmr.h
  • TMR_COUNT_TWO_WAY_3 : at32f415_tmr.h
  • TMR_COUNT_UP : at32f415_tmr.h
  • tmr_counter_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_counter_value_get() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_counter_value_set() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_CTRL1_ADDRESS : at32f415_tmr.h
  • TMR_CTRL2_ADDRESS : at32f415_tmr.h
  • TMR_CVAL_ADDRESS : at32f415_tmr.h
  • TMR_DIV_ADDRESS : at32f415_tmr.h
  • tmr_div_value_get() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_div_value_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_dma_address_type : at32f415_tmr.h
  • tmr_dma_control_config() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_DMA_REQUEST_BY_CHANNEL : at32f415_tmr.h
  • TMR_DMA_REQUEST_BY_OVERFLOW : at32f415_tmr.h
  • tmr_dma_request_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_dma_request_source_type : at32f415_tmr.h
  • tmr_dma_request_type : at32f415_tmr.h
  • TMR_DMA_TRANSFER_10BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_11BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_12BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_13BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_14BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_15BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_16BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_17BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_18BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_1BYTE : at32f415_tmr.h
  • TMR_DMA_TRANSFER_2BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_3BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_4BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_5BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_6BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_7BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_8BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_9BYTES : at32f415_tmr.h
  • tmr_dma_transfer_length_type : at32f415_tmr.h
  • TMR_DMACTRL_ADDRESS : at32f415_tmr.h
  • TMR_ENCODER_MODE_A : at32f415_tmr.h
  • TMR_ENCODER_MODE_B : at32f415_tmr.h
  • TMR_ENCODER_MODE_C : at32f415_tmr.h
  • tmr_encoder_mode_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_encoder_mode_type : at32f415_tmr.h
  • TMR_ES_FREQUENCY_DIV_1 : at32f415_tmr.h
  • TMR_ES_FREQUENCY_DIV_2 : at32f415_tmr.h
  • TMR_ES_FREQUENCY_DIV_4 : at32f415_tmr.h
  • TMR_ES_FREQUENCY_DIV_8 : at32f415_tmr.h
  • TMR_ES_POLARITY_INVERTED : at32f415_tmr.h
  • TMR_ES_POLARITY_NON_INVERTED : at32f415_tmr.h
  • tmr_event_sw_trigger() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_event_trigger_type : at32f415_tmr.h
  • tmr_external_clock_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_external_clock_mode1_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_external_clock_mode2_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_external_signal_divider_type : at32f415_tmr.h
  • tmr_external_signal_polarity_type : at32f415_tmr.h
  • tmr_flag_clear() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_flag_get() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_FORCE_OUTPUT_HIGH : at32f415_tmr.h
  • TMR_FORCE_OUTPUT_LOW : at32f415_tmr.h
  • tmr_force_output_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_force_output_type : at32f415_tmr.h
  • TMR_HALL_DMA_REQUEST : at32f415_tmr.h
  • TMR_HALL_FLAG : at32f415_tmr.h
  • TMR_HALL_INT : at32f415_tmr.h
  • tmr_hall_select() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_HALL_SWTRIG : at32f415_tmr.h
  • tmr_ic_init_structure : project/at_start_f415/examples/tmr/one_cycle/src/main.c, project/at_start_f415/examples/tmr/pwm_input/src/main.c, project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • TMR_IDEN_ADDRESS : at32f415_tmr.h
  • tmr_init() : app_led3_toggle/inc/tmr.h, app_led3_toggle/src/tmr.c, app_led4_toggle/inc/tmr.h, app_led4_toggle/src/tmr.c, bootloader/inc/tmr.h, bootloader/src/tmr.c
  • TMR_INPUT_BOTH_EDGE : at32f415_tmr.h
  • tmr_input_channel_divider_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_input_channel_filter_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_input_channel_init() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_input_config_struct : project/at_start_f415/examples/tmr/external_clock/src/main.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c, project/at_start_f415/examples/tmr/hang_mode/src/main.c, project/at_start_f415/examples/tmr/input_capture/src/main.c
  • tmr_input_default_para_init() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_input_direction_mapped_type : at32f415_tmr.h
  • TMR_INPUT_FALLING_EDGE : at32f415_tmr.h
  • tmr_input_polarity_type : at32f415_tmr.h
  • TMR_INPUT_RISING_EDGE : at32f415_tmr.h
  • tmr_internal_clock_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_interrupt_enable() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_ISTS_ADDRESS : at32f415_tmr.h
  • TMR_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • tmr_oc_init_structure : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/one_cycle/src/main.c, project/at_start_f415/examples/tmr/parallel_synchro/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • tmr_one_cycle_mode_enable() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_OUTPUT_ACTIVE_HIGH : at32f415_tmr.h
  • TMR_OUTPUT_ACTIVE_LOW : at32f415_tmr.h
  • tmr_output_channel_buffer_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_channel_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_channel_immediately_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_channel_mode_select() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_channel_polarity_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_channel_switch_set() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_OUTPUT_CONTROL_FORCE_HIGH : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_FORCE_LOW : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_HIGH : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_LOW : at32f415_tmr.h
  • tmr_output_control_mode_type : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_OFF : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_PWM_MODE_A : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_PWM_MODE_B : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_SWITCH : at32f415_tmr.h
  • tmr_output_default_para_init() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_polarity_type : at32f415_tmr.h
  • tmr_output_struct : project/at_start_f415/examples/tmr/6_steps/src/main.c, project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/cascade_synchro/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c, project/at_start_f415/examples/tmr/external_clock/src/main.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c, project/at_start_f415/examples/tmr/hang_mode/src/main.c
  • TMR_OVERFLOW_DMA_REQUEST : at32f415_tmr.h
  • tmr_overflow_event_disable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_overflow_request_source_set() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_OVERFLOW_SWTRIG : at32f415_tmr.h
  • TMR_OVF_FLAG : at32f415_tmr.h
  • TMR_OVF_INT : at32f415_tmr.h
  • tmr_period_buffer_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_period_value_get() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_period_value_set() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_POLARITY_ACTIVE_BOTH : at32f415_tmr.h
  • TMR_POLARITY_ACTIVE_HIGH : at32f415_tmr.h
  • TMR_POLARITY_ACTIVE_LOW : at32f415_tmr.h
  • tmr_polarity_active_type : at32f415_tmr.h
  • TMR_PR_ADDRESS : at32f415_tmr.h
  • tmr_primary_mode_select() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_PRIMARY_SEL_C1ORAW : at32f415_tmr.h
  • TMR_PRIMARY_SEL_C2ORAW : at32f415_tmr.h
  • TMR_PRIMARY_SEL_C3ORAW : at32f415_tmr.h
  • TMR_PRIMARY_SEL_C4ORAW : at32f415_tmr.h
  • TMR_PRIMARY_SEL_COMPARE : at32f415_tmr.h
  • TMR_PRIMARY_SEL_ENABLE : at32f415_tmr.h
  • TMR_PRIMARY_SEL_OVERFLOW : at32f415_tmr.h
  • TMR_PRIMARY_SEL_RESET : at32f415_tmr.h
  • tmr_primary_select_type : at32f415_tmr.h
  • tmr_pwm_input_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_repetition_counter_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_reset() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_RPR_ADDRESS : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_1 : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_1C : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_2 : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_2C : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_3 : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_3C : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_4 : at32f415_tmr.h
  • TMR_STCTRL_ADDRESS : at32f415_tmr.h
  • TMR_SUB_ENCODER_MODE_A : at32f415_tmr.h
  • TMR_SUB_ENCODER_MODE_B : at32f415_tmr.h
  • TMR_SUB_ENCODER_MODE_C : at32f415_tmr.h
  • TMR_SUB_EXTERNAL_CLOCK_MODE_A : at32f415_tmr.h
  • TMR_SUB_HANG_MODE : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_C1DF1 : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_C1INC : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_C2DF2 : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_EXTIN : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_IS0 : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_IS1 : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_IS2 : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_IS3 : at32f415_tmr.h
  • TMR_SUB_MODE_DIABLE : at32f415_tmr.h
  • tmr_sub_mode_select() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_sub_mode_select_type : at32f415_tmr.h
  • TMR_SUB_RESET_MODE : at32f415_tmr.h
  • tmr_sub_sync_mode_set() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_SUB_TRIGGER_MODE : at32f415_tmr.h
  • TMR_SWEVT_ADDRESS : at32f415_tmr.h
  • TMR_TRIGGER_DMA_REQUEST : at32f415_tmr.h
  • TMR_TRIGGER_FLAG : at32f415_tmr.h
  • tmr_trigger_input_select() : at32f415_tmr.h, at32f415_tmr.c
  • TMR_TRIGGER_INT : at32f415_tmr.h
  • TMR_TRIGGER_SWTRIG : at32f415_tmr.h
  • TMR_WP_LEVEL_1 : at32f415_tmr.h
  • TMR_WP_LEVEL_2 : at32f415_tmr.h
  • TMR_WP_LEVEL_3 : at32f415_tmr.h
  • tmr_wp_level_type : at32f415_tmr.h
  • TMR_WP_OFF : at32f415_tmr.h
  • transfer_end : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • transfer_error : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • transfer_status : project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c, project/at_start_f415/examples/spi/w25q_flash/src/main.c
  • transfer_status1 : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c
  • transfer_status2 : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c
  • transfer_status3 : project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c
  • transfer_status4 : project/at_start_f415/examples/spi/fullduplex_polling/src/main.c
  • TRUE : at32f415.h
  • tx_buf : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c
  • tx_buf1 : project/at_start_f415/examples/i2c/eeprom/src/main.c
  • tx_buf2 : project/at_start_f415/examples/i2c/eeprom/src/main.c
  • tx_buf3 : project/at_start_f415/examples/i2c/eeprom/src/main.c
  • tx_buffer : project/at_start_f415/examples/spi/w25q_flash/src/main.c
  • tx_counter : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • tx_data_fill() : project/at_start_f415/examples/spi/w25q_flash/src/main.c
  • tx_index : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- u -

  • u16 : at32f415.h
  • u32 : at32f415.h
  • u8 : at32f415.h
  • UART4 : at32f415_usart.h
  • UART4_BASE : at32f415.h
  • UART4_GMUX_0001 : at32f415_gpio.h
  • UART4_IRQn : at32f415.h
  • UART5 : at32f415_usart.h
  • UART5_BASE : at32f415.h
  • UART5_IRQn : at32f415.h
  • uart_init() : project/at_start_f415/examples/tmr/input_capture/src/main.c, app_led3_toggle/inc/usart.h, app_led3_toggle/src/usart.c, app_led4_toggle/inc/usart.h, app_led4_toggle/src/usart.c, bootloader/inc/usart.h, bootloader/src/usart.c
  • uart_print_init() : at32f415_board.c, at32f415_board.h
  • uc16 : at32f415.h
  • uc32 : at32f415.h
  • uc8 : at32f415.h
  • uhost_class_handler : usbh_hid_class.c, usbh_hid_class.h, usbh_msc_class.c, usbh_msc_class.h
  • uhost_init_handler() : usbh_hid_class.c, usbh_msc_class.c
  • uhost_process_handler() : usbh_hid_class.c, usbh_msc_class.c
  • uhost_request_handler() : usbh_hid_class.c, usbh_msc_class.c
  • uhost_reset_handler() : usbh_hid_class.c, usbh_msc_class.c
  • UINT16 : at32f415.h
  • UINT32 : at32f415.h
  • UINT8 : at32f415.h
  • UP_MOVE : mouse_class.h
  • UPDATE_CLEAR_FLAG : bootloader/inc/iap.h
  • UPDATE_DONE : bootloader/inc/iap.h
  • UPDATE_ING : bootloader/inc/iap.h
  • UPDATE_PRE : bootloader/inc/iap.h
  • update_status : bootloader/inc/iap.h, bootloader/src/iap.c
  • update_status_type : bootloader/inc/iap.h
  • UPGRADE_DONE : flash_fat16.h
  • UPGRADE_ERROR : flash_fat16.h
  • UPGRADE_JUMP : flash_fat16.h
  • UPGRADE_LARGE : flash_fat16.h
  • UPGRADE_READY : flash_fat16.h
  • upgrade_status_type : flash_fat16.h
  • UPGRADE_SUCCESS : flash_fat16.h
  • UPGRADE_UNKNOWN : flash_fat16.h
  • UPGRAGE_ONGOING : flash_fat16.h
  • UsageFault_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_freertos_demo/src/at32f415_int.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • UsageFault_IRQn : at32f415.h
  • USART1 : at32f415_usart.h
  • USART1_BASE : at32f415.h
  • usart1_config() : project/at_start_f415/examples/pwc/sleep_usart1/src/main.c
  • USART1_GMUX_0001 : at32f415_gpio.h
  • usart1_index : project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c
  • USART1_IRQHandler() : project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, app_led3_toggle/src/usart.c, app_led4_toggle/src/usart.c, bootloader/src/usart.c
  • USART1_IRQn : at32f415.h
  • USART1_MUX : at32f415_gpio.h
  • USART2 : at32f415_usart.h
  • USART2_BASE : at32f415.h
  • USART2_IRQHandler() : project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c
  • USART2_IRQn : at32f415.h
  • usart2_rx_buffer : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • usart2_rx_counter : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c
  • usart2_rx_dma_status : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c
  • usart2_tx_buffer : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/receiver_mute/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • USART2_TX_BUFFER_SIZE : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • usart2_tx_buffer_size : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c
  • usart2_tx_counter : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c
  • usart2_tx_dma_status : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c
  • USART3 : at32f415_usart.h
  • USART3_BASE : at32f415.h
  • USART3_GMUX_0001 : at32f415_gpio.h
  • USART3_GMUX_0010 : at32f415_gpio.h
  • USART3_IRQHandler() : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c
  • USART3_IRQn : at32f415.h
  • USART3_MUX_01 : at32f415_gpio.h
  • USART3_MUX_10 : at32f415_gpio.h
  • usart3_rx_buffer : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • usart3_rx_counter : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c
  • usart3_rx_dma_status : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c
  • usart3_tx_buffer : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • usart3_tx_buffer_size : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c
  • USART3_TX_BUFFER_SIZE : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • usart3_tx_counter : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c
  • usart3_tx_dma_status : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c
  • USART_BF_INT : at32f415_usart.h
  • USART_BFF_FLAG : at32f415_usart.h
  • USART_BREAK_10BITS : at32f415_usart.h
  • USART_BREAK_11BITS : at32f415_usart.h
  • usart_break_bit_num_set() : at32f415_usart.h, at32f415_usart.c
  • usart_break_bit_num_type : at32f415_usart.h
  • usart_break_send() : at32f415_usart.h, at32f415_usart.c
  • usart_clock_config() : at32f415_usart.h, at32f415_usart.c
  • usart_clock_enable() : at32f415_usart.h, at32f415_usart.c
  • USART_CLOCK_LAST_BIT_NONE : at32f415_usart.h
  • USART_CLOCK_LAST_BIT_OUTPUT : at32f415_usart.h
  • USART_CLOCK_PHASE_1EDGE : at32f415_usart.h
  • USART_CLOCK_PHASE_2EDGE : at32f415_usart.h
  • usart_clock_phase_type : at32f415_usart.h
  • USART_CLOCK_POLARITY_HIGH : at32f415_usart.h
  • USART_CLOCK_POLARITY_LOW : at32f415_usart.h
  • usart_clock_polarity_type : at32f415_usart.h
  • usart_configuration() : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/hw_flow_control/src/main.c, project/at_start_f415/examples/usart/idle_detection/src/main.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/irda/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/receiver_mute/src/main.c, project/at_start_f415/examples/usart/smartcard/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • USART_CTSCF_FLAG : at32f415_usart.h
  • USART_CTSCF_INT : at32f415_usart.h
  • USART_DATA_8BITS : at32f415_usart.h
  • USART_DATA_9BITS : at32f415_usart.h
  • usart_data_bit_num_type : at32f415_usart.h
  • usart_data_receive() : at32f415_usart.h, at32f415_usart.c
  • usart_data_transmit() : at32f415_usart.h, at32f415_usart.c
  • usart_dma_receiver_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_dma_transmitter_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_enable() : at32f415_usart.h, at32f415_usart.c
  • USART_ERR_INT : at32f415_usart.h
  • USART_FERR_FLAG : at32f415_usart.h
  • usart_flag_clear() : at32f415_usart.h, at32f415_usart.c
  • usart_flag_get() : at32f415_usart.h, at32f415_usart.c
  • usart_group_struct : bootloader/inc/usart.h, bootloader/src/usart.c
  • usart_hardware_flow_control_set() : at32f415_usart.h, at32f415_usart.c
  • usart_hardware_flow_control_type : at32f415_usart.h
  • USART_HARDWARE_FLOW_CTS : at32f415_usart.h
  • USART_HARDWARE_FLOW_NONE : at32f415_usart.h
  • USART_HARDWARE_FLOW_RTS : at32f415_usart.h
  • USART_HARDWARE_FLOW_RTS_CTS : at32f415_usart.h
  • USART_IDLE_INT : at32f415_usart.h
  • USART_IDLEF_FLAG : at32f415_usart.h
  • usart_init() : at32f415_usart.h, at32f415_usart.c
  • usart_interrupt_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_irda_low_power_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_irda_mode_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_irda_smartcard_division_set() : at32f415_usart.h, at32f415_usart.c
  • usart_lbcp_type : at32f415_usart.h
  • usart_lin_mode_enable() : at32f415_usart.h, at32f415_usart.c
  • USART_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • USART_NERR_FLAG : at32f415_usart.h
  • USART_PARITY_EVEN : at32f415_usart.h
  • USART_PARITY_NONE : at32f415_usart.h
  • USART_PARITY_ODD : at32f415_usart.h
  • usart_parity_selection_config() : at32f415_usart.h, at32f415_usart.c
  • usart_parity_selection_type : at32f415_usart.h
  • USART_PERR_FLAG : at32f415_usart.h
  • USART_PERR_INT : at32f415_usart.h
  • USART_RDBF_FLAG : at32f415_usart.h
  • USART_RDBF_INT : at32f415_usart.h
  • USART_REC_LEN : bootloader/inc/usart.h
  • usart_receiver_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_receiver_mute_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_reset() : at32f415_usart.h, at32f415_usart.c
  • USART_ROERR_FLAG : at32f415_usart.h
  • usart_single_line_halfduplex_select() : at32f415_usart.h, at32f415_usart.c
  • usart_smartcard_guard_time_set() : at32f415_usart.h, at32f415_usart.c
  • usart_smartcard_mode_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_smartcard_nack_set() : at32f415_usart.h, at32f415_usart.c
  • usart_spi_configuration() : project/at_start_f415/examples/usart/synchronous/src/main.c
  • USART_STOP_0_5_BIT : at32f415_usart.h
  • USART_STOP_1_5_BIT : at32f415_usart.h
  • USART_STOP_1_BIT : at32f415_usart.h
  • USART_STOP_2_BIT : at32f415_usart.h
  • usart_stop_bit_num_type : at32f415_usart.h
  • USART_TDBE_FLAG : at32f415_usart.h
  • USART_TDBE_INT : at32f415_usart.h
  • USART_TDC_FLAG : at32f415_usart.h
  • USART_TDC_INT : at32f415_usart.h
  • usart_transmitter_enable() : at32f415_usart.h, at32f415_usart.c
  • USART_WAKEUP_BY_IDLE_FRAME : at32f415_usart.h
  • USART_WAKEUP_BY_MATCHING_ID : at32f415_usart.h
  • usart_wakeup_id_set() : at32f415_usart.h, at32f415_usart.c
  • usart_wakeup_mode_set() : at32f415_usart.h, at32f415_usart.c
  • usart_wakeup_mode_type : at32f415_usart.h
  • usb_bot_request() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • usb_buffer : project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c
  • USB_CHL : at32f415_usb.h
  • USB_CLASS_CODE_AUDIO : usb_std.h
  • USB_CLASS_CODE_CCID : usb_std.h
  • USB_CLASS_CODE_CDC : usb_std.h
  • USB_CLASS_CODE_CDCDATA : usb_std.h
  • USB_CLASS_CODE_HID : usb_std.h
  • USB_CLASS_CODE_HUB : usb_std.h
  • USB_CLASS_CODE_MSC : usb_std.h
  • USB_CLASS_CODE_PRINTER : usb_std.h
  • USB_CLASS_CODE_VENDOR : usb_std.h
  • USB_CLASS_CODE_VIDEO : usb_std.h
  • usb_clk48_s : at32f415_usb.h
  • USB_CLK_HEXT : at32f415_usb.h
  • USB_CLK_HICK : at32f415_usb.h
  • usb_clock48m_select() : project/at_start_f415/examples/usb_device/audio/src/main.c, project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/msc/src/main.c, project/at_start_f415/examples/usb_device/printer/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • USB_CONF_REMOTE_WAKEUP : usb_std.h
  • USB_CONF_SELF_POWERED : usb_std.h
  • USB_CONFIG_STRING : usb_std.h
  • USB_CONN_STATE_ADDRESSED : usb_std.h
  • USB_CONN_STATE_CONFIGURED : usb_std.h
  • USB_CONN_STATE_DEFAULT : usb_std.h
  • USB_CONN_STATE_SUSPENDED : usb_std.h
  • usb_connect() : at32f415_usb.h, at32f415_usb.c
  • usb_core_config() : usb_core.h, usb_core.c
  • USB_DCFG_FULL_SPEED : at32f415_usb.h
  • usb_delay_ms() : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • usb_delay_us() : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • USB_DESCIPTOR_TYPE_CONFIGURATION : usb_std.h
  • USB_DESCIPTOR_TYPE_DEVICE : usb_std.h
  • USB_DESCIPTOR_TYPE_DEVICE_QUALIFIER : usb_std.h
  • USB_DESCIPTOR_TYPE_ENDPOINT : usb_std.h
  • USB_DESCIPTOR_TYPE_INTERFACE : usb_std.h
  • USB_DESCIPTOR_TYPE_INTERFACE_POWER : usb_std.h
  • USB_DESCIPTOR_TYPE_OTHER_SPEED : usb_std.h
  • USB_DESCIPTOR_TYPE_STRING : usb_std.h
  • USB_DEVICE_CFG_DESC_LEN : usb_std.h
  • USB_DEVICE_DESC_LEN : usb_std.h
  • USB_DEVICE_EPT_LEN : usb_std.h
  • USB_DEVICE_IF_DESC_LEN : usb_std.h
  • USB_DEVICE_LANGID_STR_DESC_LEN : usb_std.h
  • USB_DEVICE_OTG_DESC_LEN : usb_std.h
  • USB_DEVICE_OTHER_SPEED_DESC_SIZ_LEN : usb_std.h
  • USB_DEVICE_QUALIFIER_DESC_LEN : usb_std.h
  • usb_disconnect() : at32f415_usb.h, at32f415_usb.c
  • usb_endpoint_number_type : at32f415_usb.h
  • USB_EPT0 : at32f415_usb.h
  • USB_EPT0_DATA_IN : usb_std.h
  • USB_EPT0_DATA_OUT : usb_std.h
  • USB_EPT0_IDLE : usb_std.h
  • USB_EPT0_MPS_16 : at32f415_usb.h
  • USB_EPT0_MPS_32 : at32f415_usb.h
  • USB_EPT0_MPS_64 : at32f415_usb.h
  • USB_EPT0_MPS_8 : at32f415_usb.h
  • usb_ept0_setup() : at32f415_usb.h, at32f415_usb.c
  • USB_EPT0_SETUP : usb_std.h
  • USB_EPT0_STALL : usb_std.h
  • usb_ept0_start() : at32f415_usb.h, at32f415_usb.c
  • USB_EPT0_STATUS_IN : usb_std.h
  • USB_EPT0_STATUS_OUT : usb_std.h
  • USB_EPT1 : at32f415_usb.h
  • USB_EPT2 : at32f415_usb.h
  • USB_EPT3 : at32f415_usb.h
  • USB_EPT4 : at32f415_usb.h
  • USB_EPT5 : at32f415_usb.h
  • USB_EPT6 : at32f415_usb.h
  • USB_EPT7 : at32f415_usb.h
  • usb_ept_clear_stall() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_close() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_default_init() : usbd_core.c
  • USB_EPT_DESC_BULK : usb_std.h
  • USB_EPT_DESC_CONTROL : usb_std.h
  • USB_EPT_DESC_DATA_EPT : usb_std.h
  • USB_EPT_DESC_FD_EPT : usb_std.h
  • USB_EPT_DESC_FDDATA_EPT : usb_std.h
  • USB_EPT_DESC_INTERRUPT : usb_std.h
  • USB_EPT_DESC_ISO : usb_std.h
  • USB_EPT_DESC_NSYNC : usb_std.h
  • usb_ept_in_clear() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_in_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_open() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_out_clear() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_out_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_stall() : at32f415_usb.h, at32f415_usb.c
  • USB_ERROR : usb_std.h
  • USB_ETP_DESC_ADAPTIVE : usb_std.h
  • USB_ETP_DESC_ASYNC : usb_std.h
  • USB_ETP_DESC_SYNC : usb_std.h
  • USB_FAIL : usb_std.h
  • USB_FEATURE_EPT_HALT : usb_std.h
  • USB_FEATURE_REMOTE_WAKEUP : usb_std.h
  • USB_FEATURE_TEST_MODE : usb_std.h
  • USB_FIFO : at32f415_usb.h
  • USB_FLASH_ADDR_OFFSET : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • usb_flush_rx_fifo() : at32f415_usb.h, at32f415_usb.c
  • usb_flush_tx_fifo() : at32f415_usb.h, at32f415_usb.c
  • USB_FULL_SPEED_CORE_ID : usb_core.h
  • usb_get_all_in_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_get_all_out_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_global_clear_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_global_get_all_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_global_init() : at32f415_usb.h, at32f415_usb.c
  • usb_global_interrupt_enable() : at32f415_usb.h, at32f415_usb.c
  • usb_global_power_on() : at32f415_usb.h, at32f415_usb.c
  • usb_global_reset() : at32f415_usb.h, at32f415_usb.c
  • usb_global_select_core() : at32f415_usb.h, at32f415_usb.c
  • usb_global_set_mode() : at32f415_usb.h, at32f415_usb.c
  • usb_gpio_config() : project/at_start_f415/examples/usb_device/audio/src/main.c, project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/msc/src/main.c, project/at_start_f415/examples/usb_device/printer/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • usb_hc_enable() : at32f415_usb.h, at32f415_usb.c
  • USB_HCFG_CLK_48M : at32f415_usb.h
  • USB_HCFG_CLK_60M : at32f415_usb.h
  • USB_HCFG_CLK_6M : at32f415_usb.h
  • usb_hch_halt() : at32f415_usb.h, at32f415_usb.c
  • usb_hch_read_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_hid_buf_process() : audio_hid_class.c, custom_hid_class.c, hid_iap_class.c
  • USB_HID_BUSY : usbh_hid_class.h
  • usb_hid_ctrl_state_type : usbh_hid_class.h
  • USB_HID_ERROR : usbh_hid_class.h
  • USB_HID_GET : usbh_hid_class.h
  • USB_HID_GET_IDLE : usbh_hid_class.h, usbh_msc_class.h
  • USB_HID_GET_PROTOCOL : usbh_hid_class.h, usbh_msc_class.h
  • USB_HID_GET_REPORT : usbh_hid_class.h, usbh_msc_class.h
  • USB_HID_INIT : usbh_hid_class.h
  • USB_HID_KEYBOARD_PROTOCOL_CODE : usbh_hid_class.h
  • usb_hid_keyboard_send_char() : cdc_keyboard_class.c, cdc_keyboard_class.h, keyboard_class.c, keyboard_class.h
  • USB_HID_MOUSE_PROTOCOL_CODE : usbh_hid_class.h
  • usb_hid_mouse_send() : mouse_class.c, mouse_class.h
  • USB_HID_NONE_PROTOCOL_CODE : usbh_hid_class.h
  • USB_HID_POLL : usbh_hid_class.h
  • USB_HID_SEND : usbh_hid_class.h
  • USB_HID_SET_IDLE : usbh_hid_class.h, usbh_msc_class.h
  • USB_HID_SET_PROTOCOL : usbh_hid_class.h, usbh_msc_class.h
  • USB_HID_SET_REPORT : usbh_hid_class.h, usbh_msc_class.h
  • USB_HID_STATE_COMPLETE : usbh_hid_class.h
  • USB_HID_STATE_GET_DESC : usbh_hid_class.h
  • USB_HID_STATE_GET_REPORT : usbh_hid_class.h
  • USB_HID_STATE_IDLE : usbh_hid_class.h
  • USB_HID_STATE_SET_IDLE : usbh_hid_class.h
  • USB_HID_STATE_SET_PROTOCOL : usbh_hid_class.h
  • usb_hid_state_type : usbh_hid_class.h
  • USB_HIGH_SPEED_CORE_ID : usb_core.h
  • usb_host_disable() : at32f415_usb.h, at32f415_usb.c
  • USB_ID : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • USB_INEPT : at32f415_usb.h
  • USB_INTERFACE_STRING : usb_std.h
  • usb_interrupt_disable() : at32f415_usb.h, at32f415_usb.c
  • usb_interrupt_enable() : at32f415_usb.h, at32f415_usb.c
  • USB_LANGID_STRING : usb_std.h
  • usb_low_power_wakeup_config() : project/at_start_f415/examples/usb_device/audio/src/main.c, project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/msc/src/main.c, project/at_start_f415/examples/usb_device/printer/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • USB_LOW_POWER_WAKUP : project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h
  • USB_LOW_SPEED_CORE_ID : usb_core.h
  • USB_MAX_DATA_LENGTH : at32f415_usb.h
  • USB_MAX_EP0_SIZE : usb_std.h
  • USB_MFC_STRING : usb_std.h
  • USB_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • USB_NOT_SUPPORT : usb_std.h
  • USB_OK : usb_std.h
  • usb_open_phy_clk() : at32f415_usb.h, at32f415_usb.c
  • USB_OTG1_ID : at32f415_usb.h
  • USB_OTG2_ID : at32f415_usb.h
  • USB_OTG_CONIDSCHG_FLAG : at32f415_usb.h
  • USB_OTG_CONIDSCHG_INT : at32f415_usb.h
  • USB_OTG_CURMODE : at32f415_usb.h
  • USB_OTG_DCTL_CGNPINNAK : at32f415_usb.h
  • USB_OTG_DCTL_CGOUTNAK : at32f415_usb.h
  • USB_OTG_DCTL_GNPINNAKSTS : at32f415_usb.h
  • USB_OTG_DCTL_GOUTNAKSTS : at32f415_usb.h
  • USB_OTG_DCTL_PWROPRGDNE : at32f415_usb.h
  • USB_OTG_DCTL_RWKUPSIG : at32f415_usb.h
  • USB_OTG_DCTL_SFTDISCON : at32f415_usb.h
  • USB_OTG_DCTL_SGNPINNAK : at32f415_usb.h
  • USB_OTG_DCTL_SGOUTNAK : at32f415_usb.h
  • USB_OTG_DIEPINT_EPTDISD_FLAG : at32f415_usb.h
  • USB_OTG_DIEPINT_INEPTNAK_FLAG : at32f415_usb.h
  • USB_OTG_DIEPINT_INTKNTXFEMP_FLAG : at32f415_usb.h
  • USB_OTG_DIEPINT_TIMEOUT_FLAG : at32f415_usb.h
  • USB_OTG_DIEPINT_TXFEMP_FLAG : at32f415_usb.h
  • USB_OTG_DIEPINT_XFERC_FLAG : at32f415_usb.h
  • USB_OTG_DISCON_FLAG : at32f415_usb.h
  • USB_OTG_DISCON_INT : at32f415_usb.h
  • USB_OTG_DOEPINT_B2BSTUP_FLAG : at32f415_usb.h
  • USB_OTG_DOEPINT_EPTDISD_FLAG : at32f415_usb.h
  • USB_OTG_DOEPINT_OUTTEPD_FLAG : at32f415_usb.h
  • USB_OTG_DOEPINT_SETUP_FLAG : at32f415_usb.h
  • USB_OTG_DOEPINT_XFERC_FLAG : at32f415_usb.h
  • USB_OTG_DTXFSTS_INEPTFSAV : at32f415_usb.h
  • USB_OTG_ENUMDONE_FLAG : at32f415_usb.h
  • USB_OTG_ENUMDONE_INT : at32f415_usb.h
  • USB_OTG_EOPF_FLAG : at32f415_usb.h
  • USB_OTG_EOPF_INT : at32f415_usb.h
  • USB_OTG_ERLYSUSP_FLAG : at32f415_usb.h
  • USB_OTG_ERLYSUSP_INT : at32f415_usb.h
  • USB_OTG_GINNAKEFF_FLAG : at32f415_usb.h
  • USB_OTG_GINNAKEFF_INT : at32f415_usb.h
  • USB_OTG_GOUTNAKEFF_FLAG : at32f415_usb.h
  • USB_OTG_GOUTNAKEFF_INT : at32f415_usb.h
  • USB_OTG_GRXSTSP_BCNT : at32f415_usb.h
  • USB_OTG_GRXSTSP_CHNUM : at32f415_usb.h
  • USB_OTG_GRXSTSP_DPID : at32f415_usb.h
  • USB_OTG_GRXSTSP_EPTNUM : at32f415_usb.h
  • USB_OTG_GRXSTSP_PKTSTS : at32f415_usb.h
  • USB_OTG_HC_ACK_FLAG : at32f415_usb.h
  • USB_OTG_HC_ACKM_INT : at32f415_usb.h
  • USB_OTG_HC_BBLERR_FLAG : at32f415_usb.h
  • USB_OTG_HC_BBLERRM_INT : at32f415_usb.h
  • USB_OTG_HC_CHHLTD_FLAG : at32f415_usb.h
  • USB_OTG_HC_CHHLTDM_INT : at32f415_usb.h
  • USB_OTG_HC_DTGLERR_FLAG : at32f415_usb.h
  • USB_OTG_HC_DTGLERRM_INT : at32f415_usb.h
  • USB_OTG_HC_FRMOVRRUN_FLAG : at32f415_usb.h
  • USB_OTG_HC_FRMOVRRUN_INT : at32f415_usb.h
  • USB_OTG_HC_NAK_FLAG : at32f415_usb.h
  • USB_OTG_HC_NAKM_INT : at32f415_usb.h
  • USB_OTG_HC_NYET_FLAG : at32f415_usb.h
  • USB_OTG_HC_NYETM_INT : at32f415_usb.h
  • USB_OTG_HC_STALL_FLAG : at32f415_usb.h
  • USB_OTG_HC_STALLM_INT : at32f415_usb.h
  • USB_OTG_HC_XACTERR_FLAG : at32f415_usb.h
  • USB_OTG_HC_XACTERRM_INT : at32f415_usb.h
  • USB_OTG_HC_XFERC_FLAG : at32f415_usb.h
  • USB_OTG_HC_XFERCM_INT : at32f415_usb.h
  • USB_OTG_HCCHAR_CHDIS : at32f415_usb.h
  • USB_OTG_HCCHAR_CHENA : at32f415_usb.h
  • USB_OTG_HCCHAR_DEVADDR : at32f415_usb.h
  • USB_OTG_HCCHAR_EPTDIR : at32f415_usb.h
  • USB_OTG_HCCHAR_EPTNUM : at32f415_usb.h
  • USB_OTG_HCCHAR_EPTYPE : at32f415_usb.h
  • USB_OTG_HCCHAR_LSPDDEV : at32f415_usb.h
  • USB_OTG_HCCHAR_MC : at32f415_usb.h
  • USB_OTG_HCCHAR_MPS : at32f415_usb.h
  • USB_OTG_HCCHAR_ODDFRM : at32f415_usb.h
  • USB_OTG_HCH_FLAG : at32f415_usb.h
  • USB_OTG_HCH_INT : at32f415_usb.h
  • USB_OTG_HCTSIZ_PID : at32f415_usb.h
  • USB_OTG_HCTSIZ_PKTCNT : at32f415_usb.h
  • USB_OTG_HCTSIZ_XFERSIZE : at32f415_usb.h
  • USB_OTG_HPRT_PRTCONDET : at32f415_usb.h
  • USB_OTG_HPRT_PRTCONSTS : at32f415_usb.h
  • USB_OTG_HPRT_PRTENA : at32f415_usb.h
  • USB_OTG_HPRT_PRTENCHNG : at32f415_usb.h
  • USB_OTG_HPRT_PRTLNSTS : at32f415_usb.h
  • USB_OTG_HPRT_PRTOVRCACT : at32f415_usb.h
  • USB_OTG_HPRT_PRTOVRCCHNG : at32f415_usb.h
  • USB_OTG_HPRT_PRTPWR : at32f415_usb.h
  • USB_OTG_HPRT_PRTRES : at32f415_usb.h
  • USB_OTG_HPRT_PRTRST : at32f415_usb.h
  • USB_OTG_HPRT_PRTSPD : at32f415_usb.h
  • USB_OTG_HPRT_PRTSUSP : at32f415_usb.h
  • USB_OTG_IEPT_FLAG : at32f415_usb.h
  • USB_OTG_IEPT_INT : at32f415_usb.h
  • USB_OTG_INCOMISOIN_FLAG : at32f415_usb.h
  • USB_OTG_INCOMISOIN_INT : at32f415_usb.h
  • USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG : at32f415_usb.h
  • USB_OTG_INCOMPIP_INCOMPISOOUT_INT : at32f415_usb.h
  • USB_OTG_ISOOUTDROP_FLAG : at32f415_usb.h
  • USB_OTG_ISOOUTDROP_INT : at32f415_usb.h
  • USB_OTG_MODEMIS_FLAG : at32f415_usb.h
  • USB_OTG_MODEMIS_INT : at32f415_usb.h
  • USB_OTG_NPTXFEMP_FLAG : at32f415_usb.h
  • USB_OTG_NPTXFEMP_INT : at32f415_usb.h
  • USB_OTG_OEPT_FLAG : at32f415_usb.h
  • USB_OTG_OEPT_INT : at32f415_usb.h
  • USB_OTG_OTGINT_FLAG : at32f415_usb.h
  • USB_OTG_OTGINT_INT : at32f415_usb.h
  • USB_OTG_PRT_FLAG : at32f415_usb.h
  • USB_OTG_PRT_INT : at32f415_usb.h
  • USB_OTG_PTXFEMP_FLAG : at32f415_usb.h
  • USB_OTG_PTXFEMP_INT : at32f415_usb.h
  • USB_OTG_RXFLVL_FLAG : at32f415_usb.h
  • USB_OTG_RXFLVL_INT : at32f415_usb.h
  • USB_OTG_SOF_FLAG : at32f415_usb.h
  • USB_OTG_SOF_INT : at32f415_usb.h
  • USB_OTG_USBRST_FLAG : at32f415_usb.h
  • USB_OTG_USBRST_INT : at32f415_usb.h
  • USB_OTG_USBSUSP_FLAG : at32f415_usb.h
  • USB_OTG_USBSUSP_INT : at32f415_usb.h
  • USB_OTG_WKUP_FLAG : at32f415_usb.h
  • USB_OTG_WKUP_INT : at32f415_usb.h
  • USB_OUT_STS_COMP : at32f415_usb.h
  • USB_OUT_STS_DATA : at32f415_usb.h
  • USB_OUT_STS_NAK : at32f415_usb.h
  • USB_OUTEPT : at32f415_usb.h
  • usb_port_power_on() : at32f415_usb.h, at32f415_usb.c
  • usb_printer_get_rxdata() : printer_class.h
  • usb_printer_send_data() : printer_class.c, printer_class.h
  • USB_PRODUCT_STRING : usb_std.h
  • USB_PRTSPD_FULL_SPEED : at32f415_usb.h
  • USB_PRTSPD_HIGH_SPEED : at32f415_usb.h
  • USB_PRTSPD_LOW_SPEED : at32f415_usb.h
  • usb_re_connect() : project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c
  • usb_read_packet() : at32f415_usb.h, at32f415_usb.c
  • usb_reg_type : at32f415_usb.h
  • usb_remote_wkup_clear() : at32f415_usb.h, at32f415_usb.c
  • usb_remote_wkup_set() : at32f415_usb.h, at32f415_usb.c
  • USB_REQ_DIR_DTH : usb_std.h
  • USB_REQ_DIR_HTD : usb_std.h
  • USB_REQ_RECIPIENT_DEVICE : usb_std.h
  • USB_REQ_RECIPIENT_ENDPOINT : usb_std.h
  • USB_REQ_RECIPIENT_INTERFACE : usb_std.h
  • USB_REQ_RECIPIENT_MASK : usb_std.h
  • USB_REQ_RECIPIENT_OTHER : usb_std.h
  • USB_REQ_TYPE_CLASS : usb_std.h
  • USB_REQ_TYPE_RESERVED : usb_std.h
  • USB_REQ_TYPE_STANDARD : usb_std.h
  • USB_REQ_TYPE_VENDOR : usb_std.h
  • USB_SERIAL_STRING : usb_std.h
  • usb_set_address() : at32f415_usb.h, at32f415_usb.c
  • usb_set_rx_fifo() : at32f415_usb.h, at32f415_usb.c
  • usb_set_tx_fifo() : at32f415_usb.h, at32f415_usb.c
  • USB_SETUP_STS_COMP : at32f415_usb.h
  • USB_SETUP_STS_DATA : at32f415_usb.h
  • usb_speed_type : usb_core.h
  • USB_STD_REQ_CLEAR_FEATURE : usb_std.h
  • USB_STD_REQ_GET_CONFIGURATION : usb_std.h
  • USB_STD_REQ_GET_DESCRIPTOR : usb_std.h
  • USB_STD_REQ_GET_INTERFACE : usb_std.h
  • USB_STD_REQ_GET_STATUS : usb_std.h
  • USB_STD_REQ_SET_ADDRESS : usb_std.h
  • USB_STD_REQ_SET_CONFIGURATION : usb_std.h
  • USB_STD_REQ_SET_DESCRIPTOR : usb_std.h
  • USB_STD_REQ_SET_FEATURE : usb_std.h
  • USB_STD_REQ_SET_INTERFACE : usb_std.h
  • USB_STD_REQ_SYNCH_FRAME : usb_std.h
  • usb_stop_phy_clk() : at32f415_usb.h, at32f415_usb.c
  • usb_sts_type : usb_std.h
  • usb_suspend_status_get() : at32f415_usb.h, at32f415_usb.c
  • USB_TRDTIM_16 : at32f415_usb.h
  • USB_TRDTIM_8 : at32f415_usb.h
  • usb_vcp_cmd_process() : cdc_class.c, cdc_keyboard_class.c
  • usb_vcp_get_rxdata() : cdc_class.c, cdc_class.h, cdc_keyboard_class.c, cdc_keyboard_class.h
  • usb_vcp_send_data() : cdc_class.c, cdc_class.h, cdc_keyboard_class.c, cdc_keyboard_class.h
  • USB_WAIT : usb_std.h
  • usb_write_empty_txfifo() : usbd_int.h, usbd_int.c
  • usb_write_packet() : at32f415_usb.h, at32f415_usb.c
  • USBD_AUDIO_FEEDBACK_EPT : audio_class.h, audio_hid_class.h
  • USBD_AUDIO_MIC_IN_EPT : audio_class.h, audio_hid_class.h
  • USBD_AUDIO_SPK_OUT_EPT : audio_class.h, audio_hid_class.h
  • USBD_CDC_BULK_IN_EPT : cdc_class.h, cdc_keyboard_class.h
  • USBD_CDC_BULK_OUT_EPT : cdc_class.h, cdc_keyboard_class.h
  • USBD_CDC_CS_ENDPOINT : cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h
  • USBD_CDC_CS_INTERFACE : cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h
  • USBD_CDC_INT_EPT : cdc_class.h, cdc_keyboard_class.h
  • USBD_CDC_SUBTYPE_ACM : cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h
  • USBD_CDC_SUBTYPE_CMF : cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h
  • USBD_CDC_SUBTYPE_HEADER : cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h
  • USBD_CDC_SUBTYPE_UFD : cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h
  • usbd_clear_feature() : usbd_sdr.c
  • usbd_clear_stall() : usbd_core.c
  • USBD_CMD_MAXPACKET_SIZE : cdc_class.h, cdc_keyboard_class.h
  • USBD_CONFIG_DESC_SIZE : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • usbd_conn_state : usb_std.h
  • usbd_connect() : usbd_core.c
  • usbd_connect_state_get() : usbd_core.c
  • usbd_core_in_handler() : usbd_core.c
  • usbd_core_init() : usbd_core.c
  • usbd_core_out_handler() : usbd_core.c
  • usbd_core_setup_handler() : usbd_core.c
  • usbd_ctrl_recv() : usbd_core.c
  • usbd_ctrl_recv_status() : usbd_core.c
  • usbd_ctrl_send() : usbd_core.c
  • usbd_ctrl_send_status() : usbd_core.c
  • usbd_ctrl_unsupport() : usbd_core.c
  • USBD_DESC_CONFIGURATION_STRING : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • USBD_DESC_INTERFACE_STRING : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • USBD_DESC_MANUFACTURER_STRING : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • USBD_DESC_PRODUCT_STRING : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • usbd_device_request() : usbd_sdr.h, usbd_sdr.c
  • usbd_discon_handler() : usbd_int.h, usbd_int.c
  • usbd_disconnect() : usbd_core.c
  • usbd_endpoint_request() : usbd_sdr.h, usbd_sdr.c
  • usbd_enter_suspend() : usbd_core.c
  • usbd_enumdone_handler() : usbd_int.h, usbd_int.c
  • USBD_EP0_TX_SIZE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • USBD_EP1_TX_SIZE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • USBD_EP2_TX_SIZE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • USBD_EP3_TX_SIZE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • usbd_ept_close() : usbd_core.c
  • usbd_ept_handler() : usbd_int.h
  • usbd_ept_open() : usbd_core.c
  • usbd_ept_recv() : usbd_core.c
  • usbd_ept_send() : usbd_core.c
  • usbd_fifo_alloc() : usbd_core.c
  • usbd_flush_tx_fifo() : usbd_core.c
  • usbd_get_configuration() : usbd_sdr.c
  • usbd_get_descriptor() : usbd_sdr.c
  • usbd_get_recv_len() : usbd_core.c
  • usbd_get_status() : usbd_sdr.c
  • USBD_HID_DESC_SIZE : audio_hid_desc.h
  • usbd_hid_iap_in_complete() : hid_iap_class.h, app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • usbd_hid_iap_process() : hid_iap_class.h, app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • USBD_HID_IN_EPT : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • USBD_HID_OUT_EPT : audio_hid_class.h, custom_hid_class.h, hid_iap_class.h
  • USBD_HID_SIZ_REPORT_DESC : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • USBD_IN_MAXPACKET_SIZE : audio_hid_class.h, cdc_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h, msc_class.h, printer_class.h
  • usbd_incomisioin_handler() : usbd_int.h, usbd_int.c
  • usbd_incomisoout_handler() : usbd_int.h, usbd_int.c
  • usbd_inept_handler() : usbd_int.h, usbd_int.c
  • usbd_int_to_unicode() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • usbd_interface_request() : usbd_sdr.h, usbd_sdr.c
  • usbd_irq_handler() : usbd_int.h, usbd_int.c
  • USBD_MSC_BULK_IN_EPT : msc_class.h
  • USBD_MSC_BULK_OUT_EPT : msc_class.h
  • USBD_OUT_MAXPACKET_SIZE : audio_hid_class.h, cdc_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, msc_class.h, printer_class.h
  • usbd_outept_handler() : usbd_int.h, usbd_int.c
  • USBD_PRINTER_BULK_IN_EPT : printer_class.h
  • USBD_PRINTER_BULK_OUT_EPT : printer_class.h
  • USBD_PRODUCT_ID : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • usbd_remote_wakeup() : usbd_core.c
  • usbd_reset_handler() : usbd_int.h, usbd_int.c
  • USBD_RX_SIZE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • usbd_rxflvl_handler() : usbd_int.h, usbd_int.c
  • usbd_set_address() : usbd_sdr.c
  • usbd_set_configuration() : usbd_sdr.c
  • usbd_set_device_addr() : usbd_core.c
  • usbd_set_feature() : usbd_sdr.c
  • usbd_set_stall() : usbd_core.c
  • usbd_setup_request_parse() : usbd_sdr.h, usbd_sdr.c
  • USBD_SIZ_STRING_LANGID : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • USBD_SIZ_STRING_SERIAL : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • usbd_sof_handler() : usbd_int.h, usbd_int.c
  • usbd_suspend_handler() : usbd_int.h, usbd_int.c
  • usbd_unicode_convert() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • USBD_VENDOR_ID : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • usbd_wakeup_handler() : usbd_int.h, usbd_int.c
  • usbh_active_vbus() : usbh_core.c
  • usbh_alloc_address() : usbh_core.c
  • usbh_alloc_channel() : usbh_core.c
  • usbh_attached() : usbh_core.c
  • usbh_bot_cbw() : usbh_msc_bot_scsi.c
  • usbh_bulk_recv() : usbh_core.c
  • usbh_bulk_send() : usbh_core.c
  • usbh_cfg_default_init() : usbh_core.c
  • usbh_ch_disable() : usbh_core.c
  • usbh_check_csw() : usbh_msc_bot_scsi.c
  • usbh_class() : usbh_core.c
  • usbh_class_request() : usbh_core.c
  • usbh_clear_dev_feature() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_clear_endpoint_feature() : usbh_hid_class.c
  • usbh_clear_ept_feature() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_cmd_capacity10() : usbh_msc_bot_scsi.c
  • usbh_cmd_inquiry() : usbh_msc_bot_scsi.c
  • usbh_cmd_read() : usbh_msc_bot_scsi.c
  • usbh_cmd_requset_sense() : usbh_msc_bot_scsi.c
  • usbh_cmd_test_unit_ready() : usbh_msc_bot_scsi.c
  • usbh_cmd_write() : usbh_msc_bot_scsi.c
  • usbh_core_init() : usbh_core.c
  • usbh_ctrl_complete_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_data_in_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_data_in_wait_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_data_out_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_data_out_wait_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_error_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_recv_data() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_request() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_result_check() : usbh_core.c
  • usbh_ctrl_send_data() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_send_setup() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_setup_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_setup_wait_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_stall_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_status_in_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_status_in_wait_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_status_out_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_status_out_wait_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_transfer_loop() : usbh_ctrl.h, usbh_ctrl.c
  • USBH_DEBUG : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • USBH_DEBUG_ENABLE : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • usbh_disconnect() : usbh_core.c
  • usbh_disconnect_handler() : usbh_int.h, usbh_int.c
  • usbh_enter_suspend() : usbh_core.c
  • usbh_enum_handler() : usbh_core.c
  • usbh_enumeration() : usbh_core.c
  • usbh_find_interface() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_free_channel() : usbh_core.c
  • usbh_fsls_clksel() : at32f415_usb.h, at32f415_usb.c
  • usbh_get_configure_descriptor() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_get_descriptor() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_get_device_descriptor() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_get_frame() : at32f415_usb.h, at32f415_usb.c
  • usbh_get_free_channel() : usbh_core.c
  • usbh_get_next_header() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_get_sting_descriptor() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_get_urb_status() : usbh_core.c
  • usbh_hc_open() : usbh_core.c
  • usbh_hch_handler() : usbh_int.h, usbh_int.c
  • usbh_hch_in_handler() : usbh_int.h, usbh_int.c
  • usbh_hch_out_handler() : usbh_int.h, usbh_int.c
  • usbh_hid : usbh_hid_class.c
  • usbh_hid_get_desc() : usbh_hid_class.c
  • usbh_hid_get_report() : usbh_hid_class.c
  • usbh_hid_keyboard_decode() : usbh_hid_keyboard.c, usbh_hid_keyboard.h
  • usbh_hid_mouse_button_press() : usbh_hid_mouse.c
  • usbh_hid_mouse_button_release() : usbh_hid_mouse.c
  • usbh_hid_mouse_decode() : usbh_hid_mouse.c, usbh_hid_mouse.h
  • usbh_hid_mouse_position() : usbh_hid_mouse.c
  • usbh_hid_mouse_process() : usbh_hid_mouse.c
  • usbh_hid_set_idle() : usbh_hid_class.c
  • usbh_hid_set_protocol() : usbh_hid_class.c
  • usbh_in_out_request() : usbh_core.c
  • usbh_interrupt_recv() : usbh_core.c
  • usbh_interrupt_send() : usbh_core.c
  • usbh_irq_handler() : usbh_int.h, usbh_int.c
  • usbh_isoc_recv() : usbh_core.c
  • usbh_isoc_send() : usbh_core.c
  • usbh_loop_handler() : usbh_core.c
  • usbh_msc : usbh_msc_class.c, usbh_msc_class.h
  • usbh_msc_bot_scsi_capacity() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • usbh_msc_bot_scsi_get_inquiry() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • usbh_msc_bot_scsi_read() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • usbh_msc_bot_scsi_request_sense() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • usbh_msc_bot_scsi_test_unit_ready() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • usbh_msc_bot_scsi_write() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • USBH_MSC_BUSY : usbh_msc_bot_scsi.h
  • usbh_msc_clear_feature() : usbh_msc_class.c
  • usbh_msc_ctrl_state_type : usbh_msc_class.h
  • USBH_MSC_ERROR : usbh_msc_bot_scsi.h
  • usbh_msc_get_max_lun() : usbh_msc_class.c
  • USBH_MSC_IDLE : usbh_msc_bot_scsi.h
  • USBH_MSC_INIT : usbh_msc_bot_scsi.h
  • USBH_MSC_INQUIRY : usbh_msc_bot_scsi.h
  • usbh_msc_is_ready() : usbh_msc_class.c, usbh_msc_class.h
  • usbh_msc_read() : usbh_msc_class.c, usbh_msc_class.h
  • USBH_MSC_READ10 : usbh_msc_bot_scsi.h
  • USBH_MSC_READ_CAPACITY10 : usbh_msc_bot_scsi.h
  • USBH_MSC_REQUEST_SENSE : usbh_msc_bot_scsi.h
  • USBH_MSC_STATE_COMPLETE : usbh_msc_class.h
  • USBH_MSC_STATE_ERROR : usbh_msc_class.h
  • USBH_MSC_STATE_GET_LUN : usbh_msc_class.h
  • USBH_MSC_STATE_IDLE : usbh_msc_class.h
  • USBH_MSC_TEST_UNIT_READY : usbh_msc_bot_scsi.h
  • usbh_msc_write() : usbh_msc_class.c, usbh_msc_class.h
  • USBH_MSC_WRITE : usbh_msc_bot_scsi.h
  • USBH_NP_TX_FIFO_SIZE : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • USBH_P_TX_FIFO_SIZE : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • usbh_parse_configure_desc() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_parse_dev_desc() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_parse_endpoint_desc() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_parse_interface_desc() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_parse_string_desc() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_port_handler() : usbh_int.h, usbh_int.c
  • usbh_reset_port() : usbh_core.c
  • usbh_resume() : usbh_core.c
  • USBH_RX_FIFO_SIZE : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • usbh_rx_qlvl_handler() : usbh_int.h, usbh_int.c
  • usbh_set_address() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_set_configuration() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_set_feature() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_set_interface() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_set_toggle() : usbh_core.c
  • usbh_sof_handler() : usbh_int.h, usbh_int.c
  • USBH_SUPPORT_MAX_LUN : usbh_msc_class.h
  • usbh_suspend() : usbh_core.c
  • usbh_user_active_vbus() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_application() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_attached() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_disconnect() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_enumeration_done() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_handle : hid_demo/inc/usbh_user.h, hid_demo/src/usbh_user.c, msc_only_fat32/inc/usbh_user.h, msc_only_fat32/src/usbh_user.c
  • usbh_user_init() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_mfc_string() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_not_support() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_product_string() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_reset() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_serial_string() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_speed() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_wakeup() : usbh_core.c
  • usbh_wakeup_handler() : usbh_int.h, usbh_int.c
  • USD : at32f415_flash.h
  • USD_BASE : at32f415.h
  • USD_DEPSLP_NO_RST : at32f415_flash.h
  • USD_DEPSLP_RST : at32f415_flash.h
  • USD_STDBY_NO_RST : at32f415_flash.h
  • USD_STDBY_RST : at32f415_flash.h
  • USD_WDT_ATO_DISABLE : at32f415_flash.h
  • USD_WDT_ATO_ENABLE : at32f415_flash.h
  • USE_OTG_DEVICE_MODE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • USE_OTG_HOST_MODE : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • USE_SLIB_FUNCTION : utilities/at32f415_slib_demo/project_l0/src/main.c
  • USER_BUTTON : at32f415_board.h
  • USER_BUTTON_CRM_CLK : at32f415_board.h
  • USER_BUTTON_PIN : at32f415_board.h
  • USER_BUTTON_PORT : at32f415_board.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- v -

  • variables : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • variables_addr : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • variables_bit_val : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • VARIABLES_GET_BIT : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • VARIABLES_RESET_BIT : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • VARIABLES_SET_BIT : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • VECT_TAB_OFFSET : system_at32f415.c
  • vmor_flag_index : project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/src/main.c
  • vp_desc : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • vPortSVCHandler : FreeRTOSConfig.h
  • vs16 : at32f415.h
  • vs32 : at32f415.h
  • vs8 : at32f415.h
  • vsc16 : at32f415.h
  • vsc32 : at32f415.h
  • vsc8 : at32f415.h
  • vu16 : at32f415.h
  • vu32 : at32f415.h
  • vu8 : at32f415.h
  • vuc16 : at32f415.h
  • vuc32 : at32f415.h
  • vuc8 : at32f415.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- w -

  • W25Q128 : spi_flash.h
  • W25Q16 : spi_flash.h
  • W25Q32 : spi_flash.h
  • W25Q64 : spi_flash.h
  • W25Q80 : spi_flash.h
  • wakeup_timer_config() : project/at_start_f415/examples/ertc/wakeup_timer/src/main.c
  • WDT : at32f415_wdt.h
  • WDT_BASE : at32f415.h
  • WDT_CLK_DIV_128 : at32f415_wdt.h
  • WDT_CLK_DIV_16 : at32f415_wdt.h
  • WDT_CLK_DIV_256 : at32f415_wdt.h
  • WDT_CLK_DIV_32 : at32f415_wdt.h
  • WDT_CLK_DIV_4 : at32f415_wdt.h
  • WDT_CLK_DIV_64 : at32f415_wdt.h
  • WDT_CLK_DIV_8 : at32f415_wdt.h
  • WDT_CMD_ENABLE : at32f415_wdt.h
  • WDT_CMD_LOCK : at32f415_wdt.h
  • WDT_CMD_RELOAD : at32f415_wdt.h
  • WDT_CMD_UNLOCK : at32f415_wdt.h
  • wdt_cmd_value_type : at32f415_wdt.h
  • wdt_counter_reload() : at32f415_wdt.h, at32f415_wdt.c
  • WDT_DIVF_UPDATE_FLAG : at32f415_wdt.h
  • wdt_divider_set() : at32f415_wdt.h, at32f415_wdt.c
  • wdt_division_type : at32f415_wdt.h
  • wdt_enable() : at32f415_wdt.h, at32f415_wdt.c
  • wdt_flag_get() : at32f415_wdt.h, at32f415_wdt.c
  • WDT_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • wdt_register_write_enable() : at32f415_wdt.h, at32f415_wdt.c
  • wdt_reload_value_set() : at32f415_wdt.h, at32f415_wdt.c
  • WDT_RLDF_UPDATE_FLAG : at32f415_wdt.h
  • WM8988_I2C_ADDR_CSB_HIGH : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_I2C_ADDR_CSB_LOW : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R0_LEFT_INPUT_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R10_LEFT_DAC_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R11_RIGHT_DAC_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R12_BASS_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R13_TREBLE_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R14_ : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R15_RESET : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R16_3D_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R17_ALC1 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R18_ALC2 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R19_ALC3 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R1_RIGHT_INPUT_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R20_NOISE_GATE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R21_LEFT_ADC_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R22_RIGHT_ADC_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R23_ADDITIONAL_1_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R24_ADDITIONAL_2_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R25_PWR_1_MGMT : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R26_PWR_2_MGMT : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R27_ADDITIONAL_3_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R2_LOUT1_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R31_ADC_INPUT_MODE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R32_ADC_L_SIGNAL_PATH : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R33_ADC_R_SIGNAL_PATH : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R34_LEFT_OUT_MIX_1 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R35_LEFT_OUT_MIX_2 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R36_RIGHT_OUT_MIX_1 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R37_RIGHT_OUT_MIX_2 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R38_RESERVED : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R39_RESERVED : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R3_ROUT1_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R40_LOUT2_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R41_ROUT2_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R42_RESERVED : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R43_LOW_POWER_PALYBACK : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R4_RESERVED : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R5_ADC_DAC_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R6_RESERVED : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R7_AUDIO_INTERFACE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R8_SAMPLE_RATE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R9_RESERVED : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_REG_BITW16 : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • WM8988_REG_FREQ16K : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • WM8988_REG_FREQ48K : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • work : project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c
  • WWDT : at32f415_wwdt.h
  • WWDT_BASE : at32f415.h
  • wwdt_counter_set() : at32f415_wwdt.h, at32f415_wwdt.c
  • wwdt_divider_set() : at32f415_wwdt.h, at32f415_wwdt.c
  • wwdt_division_type : at32f415_wwdt.h
  • WWDT_EN_BIT : at32f415_wwdt.h
  • wwdt_enable() : at32f415_wwdt.h, at32f415_wwdt.c
  • wwdt_flag_clear() : at32f415_wwdt.h, at32f415_wwdt.c
  • wwdt_flag_get() : at32f415_wwdt.h, at32f415_wwdt.c
  • wwdt_interrupt_enable() : at32f415_wwdt.h, at32f415_wwdt.c
  • WWDT_IRQn : at32f415.h
  • WWDT_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • WWDT_PCLK1_DIV_16384 : at32f415_wwdt.h
  • WWDT_PCLK1_DIV_32768 : at32f415_wwdt.h
  • WWDT_PCLK1_DIV_4096 : at32f415_wwdt.h
  • WWDT_PCLK1_DIV_8192 : at32f415_wwdt.h
  • wwdt_reset() : at32f415_wwdt.h, at32f415_wwdt.c
  • wwdt_window_counter_set() : at32f415_wwdt.h, at32f415_wwdt.c


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- x -

  • x_pos : usbh_hid_mouse.c
  • xPortPendSVHandler : FreeRTOSConfig.h
  • xPortSysTickHandler : FreeRTOSConfig.h


AT32F415 Firmwary Library: Globals

Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:

- y -

  • y_pos : usbh_hid_mouse.c


AT32F415 Firmwary Library: Globals

- _ -

  • __align() : sd_mmc_card/src/at32_sdio.c, diskio.c


AT32F415 Firmwary Library: Globals

- a -

  • ADC1_IRQHandler() : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c
  • adc_base_config() : at32f415_adc.h, at32f415_adc.c
  • adc_base_default_para_init() : at32f415_adc.h, at32f415_adc.c
  • adc_calibration_init() : at32f415_adc.h, at32f415_adc.c
  • adc_calibration_init_status_get() : at32f415_adc.h, at32f415_adc.c
  • adc_calibration_start() : at32f415_adc.h, at32f415_adc.c
  • adc_calibration_status_get() : at32f415_adc.h, at32f415_adc.c
  • adc_combine_mode_select() : at32f415_adc.h, at32f415_adc.c
  • adc_combine_ordinary_conversion_data_get() : at32f415_adc.h, at32f415_adc.c
  • adc_config() : project/at_start_f415/examples/adc/current_vref_value_check/src/main.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c, project/at_start_f415/examples/adc/voltage_monitoring/src/main.c
  • adc_dma_mode_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_flag_clear() : at32f415_adc.h, at32f415_adc.c
  • adc_flag_get() : at32f415_adc.h, at32f415_adc.c
  • adc_interrupt_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_ordinary_channel_set() : at32f415_adc.h, at32f415_adc.c
  • adc_ordinary_conversion_data_get() : at32f415_adc.h, at32f415_adc.c
  • adc_ordinary_conversion_trigger_set() : at32f415_adc.h, at32f415_adc.c
  • adc_ordinary_part_count_set() : at32f415_adc.h, at32f415_adc.c
  • adc_ordinary_part_mode_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_ordinary_software_trigger_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_ordinary_software_trigger_status_get() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_auto_mode_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_channel_length_set() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_channel_set() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_conversion_data_get() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_conversion_trigger_set() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_offset_value_set() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_part_mode_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_software_trigger_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_preempt_software_trigger_status_get() : at32f415_adc.h, at32f415_adc.c
  • adc_reset() : at32f415_adc.h, at32f415_adc.c
  • adc_tempersensor_vintrv_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_voltage_monitor_enable() : at32f415_adc.h, at32f415_adc.c
  • adc_voltage_monitor_single_channel_select() : at32f415_adc.h, at32f415_adc.c
  • adc_voltage_monitor_threshold_value_set() : at32f415_adc.h, at32f415_adc.c
  • app_load() : bootloader/inc/iap.h, bootloader/src/iap.c
  • app_loop() : app_led3_toggle/inc/hid_iap_user.h, app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/inc/hid_iap_user.h, app_led4_toggle/src/hid_iap_user.c
  • app_update_handle() : bootloader/src/iap.c
  • arm_apply_guard_bits() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_calc_2pow() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_calc_guard_bits() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_clip_f32() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_compare_fixed_q15() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_compare_fixed_q31() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_fir_f32() : project_l0/inc/fir_filter.h, project_l1/inc/fir_filter.h
  • arm_fir_init_f32() : project_l0/inc/fir_filter.h, arm_fir_init_f32.c, project_l1/inc/fir_filter.h
  • arm_float_to_q12_20() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_float_to_q14() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_float_to_q28() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_float_to_q29() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_float_to_q30() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_provide_guard_bits_q15() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_provide_guard_bits_q31() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • arm_provide_guard_bits_q7() : project_l0/src/math_helper.c, project_l1/src/math_helper.c
  • arm_snr_f32() : project_l0/inc/math_helper.h, project_l0/src/math_helper.c, project_l1/inc/math_helper.h, project_l1/src/math_helper.c
  • at32_board_init() : at32f415_board.c, at32f415_board.h
  • at32_button_init() : at32f415_board.c, at32f415_board.h
  • at32_button_press() : at32f415_board.c, at32f415_board.h
  • at32_button_state() : at32f415_board.c, at32f415_board.h
  • at32_led_init() : at32f415_board.c, at32f415_board.h
  • at32_led_off() : at32f415_board.c, at32f415_board.h
  • at32_led_on() : at32f415_board.c, at32f415_board.h
  • at32_led_toggle() : at32f415_board.c, at32f415_board.h
  • audio_codec_init() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_loop() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_mic_alt_setting() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_mic_get_data() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_modify_freq() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_set_mic_freq() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_set_mic_mute() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_set_mic_volume() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_set_spk_freq() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_set_spk_mute() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_set_spk_volume() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_spk_alt_setting() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_spk_feedback() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_codec_spk_fifo_write() : audio/inc/audio_codec.h, audio/src/audio_codec.c, composite_audio_hid/inc/audio_codec.h, composite_audio_hid/src/audio_codec.c
  • audio_get_interface() : audio_class.c, audio_hid_class.c
  • audio_inisoincom_event() : audio_class.c, audio_hid_class.c
  • audio_req_get_cur() : audio_class.c, audio_hid_class.c
  • audio_req_get_max() : audio_class.c, audio_hid_class.c
  • audio_req_get_min() : audio_class.c, audio_hid_class.c
  • audio_req_get_res() : audio_class.c, audio_hid_class.c
  • audio_req_set_cur() : audio_class.c, audio_hid_class.c
  • audio_set_interface() : audio_class.c, audio_hid_class.c


AT32F415 Firmwary Library: Globals

- b -

  • back_err() : app_led3_toggle/inc/usart.h, app_led3_toggle/src/usart.c, app_led4_toggle/inc/usart.h, app_led4_toggle/src/usart.c, bootloader/inc/iap.h, bootloader/src/iap.c
  • back_ok() : app_led3_toggle/inc/usart.h, app_led3_toggle/src/usart.c, app_led4_toggle/inc/usart.h, app_led4_toggle/src/usart.c, bootloader/inc/iap.h, bootloader/src/iap.c
  • bot_cbw_decode() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_allow_medium_removal() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_capacity() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_check_address() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_clear_feature() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_cmd_process() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_datain_handler() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_dataout_handler() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_format_capacity() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_init() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_inquiry() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_mode_sense10() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_mode_sense6() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_read10() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_request_sense() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_reset() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_send_csw() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_send_data() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_sense_code() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_stall() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_start_stop() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_test_unit() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_verify() : msc_bot_scsi.c, msc_bot_scsi.h
  • bot_scsi_write10() : msc_bot_scsi.c, msc_bot_scsi.h
  • bpr_reg_check() : project/at_start_f415/examples/ertc/bpr_domain/src/main.c, project/at_start_f415/examples/ertc/tamper/src/main.c
  • bpr_reg_write() : project/at_start_f415/examples/ertc/bpr_domain/src/main.c, project/at_start_f415/examples/ertc/tamper/src/main.c
  • buffer_compare() : project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/flash/flash_write_read/src/main.c, project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c, project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c, project/at_start_f415/examples/spi/w25q_flash/src/main.c, project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c
  • buffer_compare_24bits() : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c
  • BusFault_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_freertos_demo/src/at32f415_int.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • button_exint_init() : project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/templates/src/main.c
  • button_isr() : project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/templates/src/main.c


AT32F415 Firmwary Library: Globals

- c -

  • CAN1_RX0_IRQHandler() : project/at_start_f415/examples/can/communication_mode/src/main.c, project/at_start_f415/examples/can/filter/src/main.c, project/at_start_f415/examples/can/loopback_mode/src/main.c
  • CAN1_SE_IRQHandler() : project/at_start_f415/examples/can/communication_mode/src/main.c, project/at_start_f415/examples/can/filter/src/main.c, project/at_start_f415/examples/can/loopback_mode/src/main.c
  • can_base_init() : at32f415_can.h, at32f415_can.c
  • can_baudrate_default_para_init() : at32f415_can.h, at32f415_can.c
  • can_baudrate_set() : at32f415_can.h, at32f415_can.c
  • can_configuration() : project/at_start_f415/examples/can/communication_mode/src/main.c, project/at_start_f415/examples/can/filter/src/main.c, project/at_start_f415/examples/can/loopback_mode/src/main.c
  • can_debug_transmission_prohibit() : at32f415_can.h, at32f415_can.c
  • can_default_para_init() : at32f415_can.h, at32f415_can.c
  • can_doze_mode_enter() : at32f415_can.h, at32f415_can.c
  • can_doze_mode_exit() : at32f415_can.h, at32f415_can.c
  • can_error_type_record_get() : at32f415_can.h, at32f415_can.c
  • can_filter_default_para_init() : at32f415_can.h, at32f415_can.c
  • can_filter_init() : at32f415_can.h, at32f415_can.c
  • can_flag_clear() : at32f415_can.h, at32f415_can.c
  • can_flag_get() : at32f415_can.h, at32f415_can.c
  • can_gpio_config() : project/at_start_f415/examples/can/communication_mode/src/main.c, project/at_start_f415/examples/can/filter/src/main.c, project/at_start_f415/examples/can/loopback_mode/src/main.c
  • can_interrupt_enable() : at32f415_can.h, at32f415_can.c
  • can_message_receive() : at32f415_can.h, at32f415_can.c
  • can_message_transmit() : at32f415_can.h, at32f415_can.c
  • can_operating_mode_set() : at32f415_can.h, at32f415_can.c
  • can_receive_error_counter_get() : at32f415_can.h, at32f415_can.c
  • can_receive_fifo_release() : at32f415_can.h, at32f415_can.c
  • can_receive_message_pending_get() : at32f415_can.h, at32f415_can.c
  • can_reset() : at32f415_can.h, at32f415_can.c
  • can_transmit_cancel() : at32f415_can.h, at32f415_can.c
  • can_transmit_data() : project/at_start_f415/examples/can/communication_mode/src/main.c, project/at_start_f415/examples/can/filter/src/main.c, project/at_start_f415/examples/can/loopback_mode/src/main.c
  • can_transmit_error_counter_get() : at32f415_can.h, at32f415_can.c
  • can_transmit_status_get() : at32f415_can.h, at32f415_can.c
  • can_ttc_mode_enable() : at32f415_can.h, at32f415_can.c
  • cdc_class_setup_handler() : cdc_keyboard_class.c
  • check_card_programming() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • class_audio_setup_handler() : audio_hid_class.c
  • class_clear_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_ept0_rx_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_ept0_tx_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_event_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_hid_setup_handler() : audio_hid_class.c
  • class_in_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_init_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_out_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_send_report() : audio_hid_class.c, audio_hid_class.h, cdc_keyboard_class.c, cdc_keyboard_class.h, custom_hid_class.c, custom_hid_class.h, hid_iap_class.c, hid_iap_class.h, keyboard_class.c, keyboard_class.h, mouse_class.c
  • class_setup_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • class_sof_handler() : audio_class.c, audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • clkout_config() : project/at_start_f415/examples/crm/clock_failure_detection/src/main.c, project/at_start_f415/examples/crm/pll_config2/src/main.c, project/at_start_f415/examples/crm/sysclk_switch/src/main.c, project/at_start_f415/examples/tmr/timer_base/src/main.c
  • clock_failure_detection_handler() : project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/src/main.c
  • CMP1_IRQHandler() : project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c
  • cmp_config() : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c, project/at_start_f415/examples/cmp/output/src/main.c
  • cmp_default_para_init() : at32f415_cmp.h, at32f415_cmp.c
  • cmp_enable() : at32f415_cmp.h, at32f415_cmp.c
  • cmp_exint_init() : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c
  • cmp_init() : at32f415_cmp.h, at32f415_cmp.c
  • cmp_input_shift_enable() : at32f415_cmp.h, at32f415_cmp.c
  • cmp_output_value_get() : at32f415_cmp.h, at32f415_cmp.c
  • cmp_reset() : at32f415_cmp.h, at32f415_cmp.c
  • cmp_write_protect_enable() : at32f415_cmp.h, at32f415_cmp.c
  • codec_i2s_init() : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • codec_i2s_reset() : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • command_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_handle() : bootloader/inc/iap.h, bootloader/src/iap.c
  • command_rsp1_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_rsp2_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_rsp3_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_rsp4_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_rsp5_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_rsp6_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • command_rsp7_error() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • config_flash_interrupt() : utilities/at32f415_slib_demo/project_l0/src/main.c, utilities/at32f415_slib_demo/project_l1/src/main.c
  • convert_from_bytes_to_power_of_two() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • copy_buff() : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • crc_block_calculate() : at32f415_crc.h, at32f415_crc.c
  • crc_cal() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • crc_common_data_set() : at32f415_crc.h, at32f415_crc.c
  • crc_common_date_get() : at32f415_crc.h, at32f415_crc.c
  • crc_data_get() : at32f415_crc.h, at32f415_crc.c
  • crc_data_reset() : at32f415_crc.h, at32f415_crc.c
  • crc_init_data_set() : at32f415_crc.h, at32f415_crc.c
  • crc_one_word_calculate() : at32f415_crc.h, at32f415_crc.c
  • crc_reverse_input_data_set() : at32f415_crc.h, at32f415_crc.c
  • crc_reverse_output_data_set() : at32f415_crc.h, at32f415_crc.c
  • crm_adc_clock_div_set() : at32f415_crm.h, at32f415_crm.c
  • crm_ahb_div_set() : at32f415_crm.h, at32f415_crm.c
  • crm_apb1_div_set() : at32f415_crm.h, at32f415_crm.c
  • crm_apb2_div_set() : at32f415_crm.h, at32f415_crm.c
  • crm_auto_step_mode_enable() : at32f415_crm.h, at32f415_crm.c
  • crm_battery_powered_domain_reset() : at32f415_crm.h, at32f415_crm.c
  • crm_clkout_div_set() : at32f415_crm.h, at32f415_crm.c
  • crm_clock_failure_detection_enable() : at32f415_crm.h, at32f415_crm.c
  • crm_clock_out_set() : at32f415_crm.h, at32f415_crm.c
  • crm_clock_source_enable() : at32f415_crm.h, at32f415_crm.c
  • crm_clocks_freq_get() : at32f415_crm.h, at32f415_crm.c
  • crm_configuration() : project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/one_cycle/src/main.c, project/at_start_f415/examples/tmr/parallel_synchro/src/main.c, project/at_start_f415/examples/tmr/pwm_input/src/main.c, project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • crm_ertc_clock_enable() : at32f415_crm.h, at32f415_crm.c
  • crm_ertc_clock_select() : at32f415_crm.h, at32f415_crm.c
  • crm_flag_clear() : at32f415_crm.h, at32f415_crm.c
  • crm_flag_get() : at32f415_crm.h, at32f415_crm.c
  • crm_hext_bypass() : at32f415_crm.h, at32f415_crm.c
  • crm_hext_stable_wait() : at32f415_crm.h, at32f415_crm.c
  • crm_hick_clock_calibration_set() : at32f415_crm.h, at32f415_crm.c
  • crm_hick_clock_trimming_set() : at32f415_crm.h, at32f415_crm.c
  • crm_hick_divider_select() : at32f415_crm.h, at32f415_crm.c
  • crm_hick_sclk_frequency_select() : at32f415_crm.h, at32f415_crm.c
  • crm_interrupt_enable() : at32f415_crm.h, at32f415_crm.c
  • crm_lext_bypass() : at32f415_crm.h, at32f415_crm.c
  • crm_otgfs_ep3_remap_enable() : at32f415_crm.h, at32f415_crm.c
  • crm_periph_clock_enable() : at32f415_crm.h, at32f415_crm.c
  • crm_periph_reset() : at32f415_crm.h, at32f415_crm.c
  • crm_periph_sleep_mode_clock_enable() : at32f415_crm.h, at32f415_crm.c
  • crm_pll_config() : at32f415_crm.h, at32f415_crm.c
  • crm_pll_config2() : at32f415_crm.h, at32f415_crm.c
  • crm_reset() : at32f415_crm.h, at32f415_crm.c
  • crm_sysclk_switch() : at32f415_crm.h, at32f415_crm.c
  • crm_sysclk_switch_status_get() : at32f415_crm.h, at32f415_crm.c
  • crm_usb_clock_div_set() : at32f415_crm.h, at32f415_crm.c
  • crm_usb_clock_source_select() : at32f415_crm.h, at32f415_crm.c
  • crm_usbdiv_reset() : at32f415_crm.h, at32f415_crm.c


AT32F415 Firmwary Library: Globals

- d -

  • data_take() : bootloader/src/iap.c
  • debug_device_id_get() : at32f415_debug.h, at32f415_debug.c
  • debug_periph_mode_set() : at32f415_debug.h, at32f415_debug.c
  • DebugMon_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_freertos_demo/src/at32f415_int.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • delay() : project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c
  • delay_init() : at32f415_board.c, at32f415_board.h
  • delay_ms() : at32f415_board.c, at32f415_board.h
  • delay_sec() : at32f415_board.c, at32f415_board.h
  • delay_us() : at32f415_board.c, at32f415_board.h
  • disk_initialize() : diskio.c, usbh_msc_diskio.c
  • disk_ioctl() : diskio.c, usbh_msc_diskio.c
  • disk_read() : diskio.c, usbh_msc_diskio.c
  • disk_status() : diskio.c, usbh_msc_diskio.c
  • disk_write() : diskio.c, usbh_msc_diskio.c
  • DMA1_Channel1_IRQHandler() : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c
  • DMA1_Channel2_IRQHandler() : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c
  • DMA1_Channel3_IRQHandler() : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • DMA1_Channel4_IRQHandler() : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • DMA1_Channel6_IRQHandler() : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • DMA1_Channel7_IRQHandler() : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • DMA2_Channel1_IRQHandler() : project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c
  • dma_channel_enable() : at32f415_dma.h, at32f415_dma.c
  • dma_config() : project/at_start_f415/examples/adc/current_vref_value_check/src/main.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c, project/at_start_f415/examples/adc/voltage_monitoring/src/main.c
  • dma_configuration() : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • dma_data_number_get() : at32f415_dma.h, at32f415_dma.c
  • dma_data_number_set() : at32f415_dma.h, at32f415_dma.c
  • dma_default_para_init() : at32f415_dma.h, at32f415_dma.c
  • dma_flag_clear() : at32f415_dma.h, at32f415_dma.c
  • dma_flag_get() : at32f415_dma.h, at32f415_dma.c
  • dma_flexible_config() : at32f415_dma.h, at32f415_dma.c
  • dma_init() : at32f415_dma.h, at32f415_dma.c
  • dma_interrupt_enable() : at32f415_dma.h, at32f415_dma.c
  • dma_reset() : at32f415_dma.h, at32f415_dma.c


AT32F415 Firmwary Library: Globals

- e -

  • error_handler() : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • ertc_alarm_config() : project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c
  • ertc_alarm_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_alarm_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_alarm_mask_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_alarm_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_alarm_show() : project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c
  • ertc_alarm_sub_second_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_alarm_sub_second_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_alarm_value_set() : project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c
  • ertc_alarm_week_date_select() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_bcd_to_num() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_bpr_data_read() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_bpr_data_write() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_cal_output_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_cal_output_select() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_calendar_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_coarse_calibration_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_coarse_calibration_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_config() : project/at_start_f415/examples/ertc/bpr_domain/src/main.c, project/at_start_f415/examples/ertc/calendar/src/main.c, project/at_start_f415/examples/ertc/lick_calibration/src/main.c, project/at_start_f415/examples/ertc/tamper/src/main.c, project/at_start_f415/examples/ertc/time_stamp/src/main.c, project/at_start_f415/examples/ertc/wakeup_timer/src/main.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c
  • ertc_date_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_daylight_bpr_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_daylight_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_direct_read_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_divider_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_flag_clear() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_flag_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_hour_mode_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_init_mode_enter() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_init_mode_exit() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_interrupt_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_interrupt_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_num_to_bcd() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_output_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_refer_clock_detect_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_reset() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_smooth_calibration_config() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_sub_second_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_tamper_config() : project/at_start_f415/examples/ertc/tamper/src/main.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c
  • ertc_tamper_detect_freq_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_tamper_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_tamper_filter_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_tamper_precharge_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_tamper_pull_up_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_tamper_timestamp_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_tamper_valid_edge_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_time_adjust() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_time_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_time_show() : project/at_start_f415/examples/ertc/calendar/src/main.c, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c
  • ertc_timestamp_config() : project/at_start_f415/examples/ertc/time_stamp/src/main.c
  • ertc_timestamp_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_timestamp_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_timestamp_show() : project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c
  • ertc_timestamp_sub_second_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_timestamp_valid_edge_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_wait_flag() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_wait_update() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_wakeup_clock_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_wakeup_counter_get() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_wakeup_counter_set() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_wakeup_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_wakeup_show() : project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c
  • ERTC_WKUP_IRQHandler() : project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c
  • ertc_write_protect_disable() : at32f415_ertc.h, at32f415_ertc.c
  • ertc_write_protect_enable() : at32f415_ertc.h, at32f415_ertc.c
  • ERTCAlarm_IRQHandler() : project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c
  • EXINT0_IRQHandler() : project/at_start_f415/examples/exint/exint_config/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/templates/src/main.c
  • EXINT4_IRQHandler() : project/at_start_f415/examples/exint/exint_software_trigger/src/main.c
  • EXINT9_5_IRQHandler() : project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c
  • exint_config() : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c
  • exint_default_para_init() : at32f415_exint.h, at32f415_exint.c
  • exint_event_enable() : at32f415_exint.h, at32f415_exint.c
  • exint_flag_clear() : at32f415_exint.h, at32f415_exint.c
  • exint_flag_get() : at32f415_exint.h, at32f415_exint.c
  • exint_init() : at32f415_exint.h, at32f415_exint.c
  • exint_interrupt_enable() : at32f415_exint.h, at32f415_exint.c
  • exint_line0_config() : project/at_start_f415/examples/exint/exint_config/src/main.c
  • exint_line4_config() : project/at_start_f415/examples/exint/exint_software_trigger/src/main.c
  • exint_reset() : at32f415_exint.h, at32f415_exint.c
  • exint_software_interrupt_event_generate() : at32f415_exint.h, at32f415_exint.c


AT32F415 Firmwary Library: Globals

- f -

  • fat16_memory_cmp() : flash_fat16.c
  • fat16_memory_copy() : flash_fat16.c
  • fat16_memory_memset() : flash_fat16.c
  • fatfs_test() : project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c
  • FIR_lowpass_filter() : project_l0/inc/fir_filter.h, fir_filter.c, project_l1/inc/fir_filter.h
  • flash_2kb_write() : utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c
  • flash_boot_memory_extension_mode_enable() : at32f415_flash.h, at32f415_flash.c
  • flash_byte_program() : at32f415_flash.h, at32f415_flash.c
  • flash_crc_calibrate() : at32f415_flash.h, at32f415_flash.c
  • flash_crc_check() : flash_fat16.c
  • flash_em_slib_datastart_sector_get() : at32f415_flash.h, at32f415_flash.c
  • flash_epp_set() : at32f415_flash.h, at32f415_flash.c
  • flash_epp_status_get() : at32f415_flash.h, at32f415_flash.c
  • flash_extension_memory_slib_enable() : at32f415_flash.h, at32f415_flash.c
  • flash_extension_memory_slib_state_get() : at32f415_flash.h, at32f415_flash.c
  • flash_fap_enable() : at32f415_flash.h, at32f415_flash.c
  • flash_fap_high_level_enable() : at32f415_flash.h, at32f415_flash.c
  • flash_fap_high_level_status_get() : at32f415_flash.h, at32f415_flash.c
  • flash_fap_status_get() : at32f415_flash.h, at32f415_flash.c
  • flash_fat16_addr_offset() : flash_fat16.c
  • flash_fat16_boot_dir_write() : flash_fat16.c
  • flash_fat16_clear_upgrade_flag() : flash_fat16.c
  • flash_fat16_get_upgrade_flag() : flash_fat16.h, flash_fat16.c
  • flash_fat16_init() : flash_fat16.h, flash_fat16.c
  • flash_fat16_loop_status() : flash_fat16.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c
  • flash_fat16_read() : flash_fat16.h, flash_fat16.c
  • flash_fat16_sector_write() : flash_fat16.c
  • flash_fat16_set_name() : flash_fat16.h, flash_fat16.c
  • flash_fat16_set_upgrade_flag() : flash_fat16.c
  • flash_fat16_write() : flash_fat16.h, flash_fat16.c
  • flash_flag_clear() : at32f415_flash.h, at32f415_flash.c
  • flash_flag_get() : at32f415_flash.h, at32f415_flash.c
  • flash_halfword_program() : at32f415_flash.h, at32f415_flash.c
  • flash_internal_all_erase() : at32f415_flash.h, at32f415_flash.c
  • flash_interrupt_enable() : at32f415_flash.h, at32f415_flash.c
  • FLASH_IRQHandler() : utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c
  • flash_lock() : at32f415_flash.h, at32f415_flash.c
  • flash_operation_status_get() : at32f415_flash.h, at32f415_flash.c
  • flash_operation_wait_for() : at32f415_flash.h, at32f415_flash.c
  • flash_read() : project/at_start_f415/examples/flash/flash_write_read/inc/flash.h, project/at_start_f415/examples/flash/flash_write_read/src/flash.c
  • flash_read_data() : flash_fat16.c
  • flash_sector_erase() : at32f415_flash.h, at32f415_flash.c
  • flash_slib_datastart_sector_get() : at32f415_flash.h, at32f415_flash.c
  • flash_slib_disable() : at32f415_flash.h, at32f415_flash.c
  • flash_slib_enable() : at32f415_flash.h, at32f415_flash.c
  • flash_slib_end_sector_get() : at32f415_flash.h, at32f415_flash.c
  • flash_slib_start_sector_get() : at32f415_flash.h, at32f415_flash.c
  • flash_slib_state_get() : at32f415_flash.h, at32f415_flash.c
  • flash_ssb_set() : at32f415_flash.h, at32f415_flash.c
  • flash_ssb_status_get() : at32f415_flash.h, at32f415_flash.c
  • flash_unlock() : at32f415_flash.h, at32f415_flash.c
  • flash_upgrade_flag_read() : utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c
  • flash_user_system_data_erase() : at32f415_flash.h, at32f415_flash.c
  • flash_user_system_data_program() : at32f415_flash.h, at32f415_flash.c
  • flash_word_program() : at32f415_flash.h, at32f415_flash.c
  • flash_write() : project/at_start_f415/examples/flash/flash_write_read/inc/flash.h, project/at_start_f415/examples/flash/flash_write_read/src/flash.c
  • flash_write_data() : flash_fat16.c
  • flash_write_nocheck() : project/at_start_f415/examples/flash/flash_write_read/inc/flash.h, project/at_start_f415/examples/flash/flash_write_read/src/flash.c
  • fputc() : at32f415_board.c


AT32F415 Firmwary Library: Globals

- g -

  • get_device_config_string() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_configuration() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_descriptor() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_interface_string() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_lang_id() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_manufacturer_string() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_other_speed() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_product_string() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_qualifier() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_device_serial_string() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_fattime() : usbh_msc_diskio.c
  • get_inquiry() : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • get_serial_num() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • get_uid_for_seed() : random.c
  • gpio_bits_reset() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_bits_set() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_bits_write() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_config() : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c, project/at_start_f415/examples/adc/voltage_monitoring/src/main.c, project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c
  • gpio_configuration() : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/one_cycle/src/main.c, project/at_start_f415/examples/tmr/parallel_synchro/src/main.c, project/at_start_f415/examples/tmr/pwm_input/src/main.c, project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • gpio_default_para_init() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_event_output_config() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_event_output_enable() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_exint_line_config() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_init() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_input_data_bit_read() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_input_data_read() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_iomux_reset() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_output_data_bit_read() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_output_data_read() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_pin_remap_config() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_pin_wp_config() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_pins_toggle() : project/at_start_f415/examples/gpio/swjtag_remap/src/main.c
  • gpio_port_wirte() : at32f415_gpio.h, at32f415_gpio.c
  • gpio_reset() : at32f415_gpio.h, at32f415_gpio.c


AT32F415 Firmwary Library: Globals

- h -

  • HardFault_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_freertos_demo/src/at32f415_int.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c


AT32F415 Firmwary Library: Globals

- i -

  • I2C1_ERR_IRQHandler() : project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • I2C1_EVT_IRQHandler() : project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • i2c_7bit_address_send() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_ack_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_addr_flag_clear() : i2c_application.c
  • i2c_arp_mode_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_clock_stretch_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_config() : i2c_application.c, i2c_application.h
  • i2c_data_receive() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_data_send() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_dma_config() : i2c_application.c
  • i2c_dma_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_dma_end_transfer_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_dma_rx_irq_handler() : i2c_application.c, i2c_application.h
  • i2c_dma_tx_irq_handler() : i2c_application.c, i2c_application.h
  • i2c_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_err_irq_handler() : i2c_application.c, i2c_application.h
  • i2c_evt_irq_handler() : i2c_application.c, i2c_application.h
  • i2c_fast_mode_duty_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_flag_clear() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_flag_get() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_general_call_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_init() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_interrupt_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_lowlevel_init() : i2c_application.h, project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • i2c_master_read_addr() : i2c_application.c
  • i2c_master_receive() : i2c_application.c, i2c_application.h
  • i2c_master_receive_ack_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_master_receive_dma() : i2c_application.c, i2c_application.h
  • i2c_master_receive_int() : i2c_application.c, i2c_application.h
  • i2c_master_rx_isr_int() : i2c_application.c
  • i2c_master_transmit() : i2c_application.c, i2c_application.h
  • i2c_master_transmit_dma() : i2c_application.c, i2c_application.h
  • i2c_master_transmit_int() : i2c_application.c, i2c_application.h
  • i2c_master_tx_isr_int() : i2c_application.c
  • i2c_master_write_addr() : i2c_application.c
  • i2c_memory_read() : i2c_application.c, i2c_application.h
  • i2c_memory_read_dma() : i2c_application.c, i2c_application.h
  • i2c_memory_read_int() : i2c_application.c, i2c_application.h
  • i2c_memory_write() : i2c_application.c, i2c_application.h
  • i2c_memory_write_dma() : i2c_application.c, i2c_application.h
  • i2c_memory_write_int() : i2c_application.c, i2c_application.h
  • i2c_own_address1_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_own_address2_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_own_address2_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_pec_calculate_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_pec_position_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_pec_transmit_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_pec_value_get() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_reset() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_slave_receive() : i2c_application.c, i2c_application.h
  • i2c_slave_receive_dma() : i2c_application.c, i2c_application.h
  • i2c_slave_receive_int() : i2c_application.c, i2c_application.h
  • i2c_slave_rx_isr_int() : i2c_application.c
  • i2c_slave_transmit() : i2c_application.c, i2c_application.h
  • i2c_slave_transmit_dma() : i2c_application.c, i2c_application.h
  • i2c_slave_transmit_int() : i2c_application.c, i2c_application.h
  • i2c_slave_tx_isr_int() : i2c_application.c
  • i2c_smbus_alert_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_smbus_enable() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_smbus_mode_set() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_software_reset() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_start_generate() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_stop_flag_clear() : i2c_application.c
  • i2c_stop_generate() : at32f415_i2c.h, at32f415_i2c.c
  • i2c_wait_end() : i2c_application.c, i2c_application.h
  • i2c_wait_flag() : i2c_application.c
  • i2s_config() : project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c
  • i2s_default_para_init() : at32f415_spi.h, at32f415_spi.c
  • i2s_enable() : at32f415_spi.h, at32f415_spi.c
  • i2s_init() : at32f415_spi.h, at32f415_spi.c
  • iap_address() : bootloader/src/hid_iap_user.c
  • iap_clear_upgrade_flag() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_command_handle() : app_led3_toggle/inc/iap.h, app_led3_toggle/src/iap.c, app_led4_toggle/inc/iap.h, app_led4_toggle/src/iap.c
  • iap_crc() : bootloader/src/hid_iap_user.c
  • iap_data_write() : bootloader/src/hid_iap_user.c
  • iap_erase_sector() : bootloader/src/hid_iap_user.c
  • iap_finish() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_get() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_get_upgrade_flag() : app_led3_toggle/inc/hid_iap_user.h, app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/inc/hid_iap_user.h, app_led4_toggle/src/hid_iap_user.c, bootloader/inc/hid_iap_user.h, bootloader/src/hid_iap_user.c
  • iap_idle() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_init() : app_led3_toggle/inc/iap.h, app_led3_toggle/src/iap.c, app_led4_toggle/inc/iap.h, app_led4_toggle/src/iap.c, app_led3_toggle/inc/hid_iap_user.h, app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/inc/hid_iap_user.h, app_led4_toggle/src/hid_iap_user.c, bootloader/inc/hid_iap_user.h, bootloader/src/hid_iap_user.c
  • iap_jump() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_loop() : bootloader/inc/hid_iap_user.h, bootloader/src/hid_iap_user.c
  • iap_respond() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_set_upgrade_flag() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_start() : app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • iap_upgrade_app_handle() : bootloader/inc/iap.h, bootloader/src/iap.c
  • is_bpr_reg_reset() : project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c


AT32F415 Firmwary Library: Globals

- j -

  • jump_to_app() : project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, bootloader/inc/hid_iap_user.h, bootloader/src/hid_iap_user.c


AT32F415 Firmwary Library: Globals

- k -

  • keyboard_class_setup_handler() : cdc_keyboard_class.c
  • keyboard_send_string() : project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c


AT32F415 Firmwary Library: Globals

- l -

  • led2_task_function() : utilities/at32f415_freertos_demo/src/main.c
  • led3_task_function() : utilities/at32f415_freertos_demo/src/main.c
  • lick_frequency_get() : project/at_start_f415/examples/ertc/lick_calibration/src/main.c


AT32F415 Firmwary Library: Globals

- m -

  • main() : project/at_start_f415/examples/adc/current_vref_value_check/src/main.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c, project/at_start_f415/examples/adc/voltage_monitoring/src/main.c, project/at_start_f415/examples/can/communication_mode/src/main.c, project/at_start_f415/examples/can/filter/src/main.c, project/at_start_f415/examples/can/loopback_mode/src/main.c, project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c, project/at_start_f415/examples/cmp/output/src/main.c, project/at_start_f415/examples/cortex_m4/bit_band/src/main.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c, project/at_start_f415/examples/crc/calculation/src/main.c, project/at_start_f415/examples/crm/clock_failure_detection/src/main.c, project/at_start_f415/examples/crm/pll_config2/src/main.c, project/at_start_f415/examples/debug/tmr1/src/main.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c, project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/ertc/bpr_domain/src/main.c, project/at_start_f415/examples/ertc/calendar/src/main.c, project/at_start_f415/examples/ertc/lick_calibration/src/main.c, project/at_start_f415/examples/ertc/tamper/src/main.c, project/at_start_f415/examples/ertc/time_stamp/src/main.c, project/at_start_f415/examples/ertc/wakeup_timer/src/main.c, project/at_start_f415/examples/exint/exint_config/src/main.c, project/at_start_f415/examples/exint/exint_software_trigger/src/main.c, project/at_start_f415/examples/flash/flash_write_read/src/main.c, project/at_start_f415/examples/gpio/led_toggle/src/main.c, project/at_start_f415/examples/gpio/swjtag_remap/src/main.c, project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c, project/at_start_f415/examples/pwc/power_voltage_monitor/src/main.c, project/at_start_f415/examples/pwc/sleep_tmr2/src/main.c, project/at_start_f415/examples/pwc/sleep_usart1/src/main.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/main.c, project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c, project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c, project/at_start_f415/examples/spi/w25q_flash/src/main.c, project/at_start_f415/examples/tmr/6_steps/src/main.c, project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/cascade_synchro/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c, project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c, project/at_start_f415/examples/tmr/external_clock/src/main.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c, project/at_start_f415/examples/tmr/hang_mode/src/main.c, project/at_start_f415/examples/tmr/input_capture/src/main.c, project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/one_cycle/src/main.c, project/at_start_f415/examples/tmr/parallel_synchro/src/main.c, project/at_start_f415/examples/tmr/pwm_input/src/main.c, project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/timer_base/src/main.c, project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c, project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/hw_flow_control/src/main.c, project/at_start_f415/examples/usart/idle_detection/src/main.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/irda/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/printf/src/main.c, project/at_start_f415/examples/usart/receiver_mute/src/main.c, project/at_start_f415/examples/usart/smartcard/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c, project/at_start_f415/examples/usb_device/audio/src/main.c, project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/msc/src/main.c, project/at_start_f415/examples/usb_device/printer/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, project/at_start_f415/examples/wdt/wdt_reset/src/main.c, project/at_start_f415/examples/wwdt/wwdt_reset/src/main.c, project/at_start_f415/templates/src/main.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/main.c, utilities/at32f415_freertos_demo/src/main.c, utilities/at32f415_gen_random_number_demo/src/main.c, utilities/at32f415_slib_demo/project_l0/src/main.c, utilities/at32f415_slib_demo/project_l1/src/main.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • mclk_tmr1_init() : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • MemManage_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_freertos_demo/src/at32f415_int.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • memset16_buffer() : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • mmc_stream_read() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • mmc_stream_test() : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • mmc_stream_write() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • mmc_switch() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • msc_bot_scsi_init() : usbh_msc_bot_scsi.c, usbh_msc_class.h
  • msc_disk_capacity() : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • msc_disk_read() : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • msc_disk_write() : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h


AT32F415 Firmwary Library: Globals

- n -

  • NMI_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_freertos_demo/src/at32f415_int.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • nvic_configuration() : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c, project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c
  • nvic_irq_disable() : at32f415_misc.h, at32f415_misc.c
  • nvic_irq_enable() : at32f415_misc.h, at32f415_misc.c
  • nvic_lowpower_mode_config() : at32f415_misc.h, at32f415_misc.c
  • nvic_priority_group_config() : at32f415_misc.h, at32f415_misc.c
  • nvic_system_reset() : at32f415_misc.h, at32f415_misc.c
  • nvic_vector_table_set() : at32f415_misc.h, at32f415_misc.c


AT32F415 Firmwary Library: Globals

- o -

  • OTG_IRQ_HANDLER() : project/at_start_f415/examples/usb_device/audio/src/main.c, project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/msc/src/main.c, project/at_start_f415/examples/usb_device/printer/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c


AT32F415 Firmwary Library: Globals

- p -

  • PendSV_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • pvm_exint_config() : project/at_start_f415/examples/pwc/power_voltage_monitor/src/main.c
  • PVM_IRQHandler() : project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c
  • pwc_battery_powered_domain_access() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_deep_sleep_mode_enter() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_flag_clear() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_flag_get() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_power_voltage_monitor_enable() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_pvm_level_select() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_reset() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_sleep_mode_enter() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_standby_mode_enter() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_voltage_regulate_set() : at32f415_pwc.h, at32f415_pwc.c
  • pwc_wakeup_pin_enable() : at32f415_pwc.h, at32f415_pwc.c


AT32F415 Firmwary Library: Globals

- r -

  • randnum_test() : random.h, random.c
  • result_error() : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • run_in_boot_memory_test() : run_in_boot_memory.h, run_in_boot_memory.c


AT32F415 Firmwary Library: Globals

- s -

  • sc_response_decode() : project/at_start_f415/examples/usart/smartcard/src/main.c
  • SC_USART_IRQHandler() : project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c
  • sclk_144m_hick_config() : project/at_start_f415/examples/crm/clock_failure_detection/src/main.c
  • sclk_64m_hick_config() : project/at_start_f415/examples/crm/sysclk_switch/src/main.c
  • sclk_96m_hext_config() : project/at_start_f415/examples/crm/sysclk_switch/src/main.c
  • scr_find() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • sd_block_read() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_block_write() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_blocks_erase() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_bus_wide_enable() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • sd_card_info_get() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_card_init() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_deselect_select() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_device_mode_set() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_dma_config() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_init() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_irq_service() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_mult_blocks_read() : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_mult_blocks_write() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_multiple_blocks_test() : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • sd_power_off() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_power_on() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_single_block_test() : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • sd_state_get() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_status_send() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_switch() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • sd_test_error() : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c, project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c
  • sd_wide_bus_operation_config() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sd_write_disk() : diskio.c
  • SDIO1_IRQHandler() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • SDIO2_IRQHandler() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • sdio_buffer_counter_get() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_bus_width_config() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_clock_bypass() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_clock_config() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_clock_enable() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_clock_set() : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sdio_command_config() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_command_data_send() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • sdio_command_response_get() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_command_state_machine_enable() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_data_config() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_data_counter_get() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_data_read() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_data_state_machine_enable() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_data_write() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_dma_enable() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_flag_clear() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_flag_get() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_flow_control_enable() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_interrupt_enable() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_io_function_enable() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_io_suspend_command_set() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_power_saving_mode_enable() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_power_set() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_power_status_get() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_read_wait_mode_set() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_read_wait_start() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_read_wait_stop() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_reset() : at32f415_sdio.h, at32f415_sdio.c
  • sdio_response_get() : at32f415_sdio.h, at32f415_sdio.c
  • show_card_info() : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • slib_enable() : utilities/at32f415_slib_demo/project_l0/src/main.c
  • speed_change() : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • SPI1_IRQHandler() : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c
  • SPI2_IRQHandler() : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c
  • spi_byte_read() : spi_flash.h, spi_flash.c
  • spi_byte_write() : spi_flash.h, spi_flash.c
  • spi_bytes_read() : spi_flash.h, spi_flash.c
  • spi_bytes_write() : spi_flash.h, spi_flash.c
  • spi_config() : project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c
  • spi_crc_enable() : at32f415_spi.h, at32f415_spi.c
  • spi_crc_next_transmit() : at32f415_spi.h, at32f415_spi.c
  • spi_crc_polynomial_get() : at32f415_spi.h, at32f415_spi.c
  • spi_crc_polynomial_set() : at32f415_spi.h, at32f415_spi.c
  • spi_crc_value_get() : at32f415_spi.h, at32f415_spi.c
  • spi_default_para_init() : at32f415_spi.h, at32f415_spi.c
  • spi_enable() : at32f415_spi.h, at32f415_spi.c
  • spi_frame_bit_num_set() : at32f415_spi.h, at32f415_spi.c
  • spi_half_duplex_direction_set() : at32f415_spi.h, at32f415_spi.c
  • spi_hardware_cs_output_enable() : at32f415_spi.h, at32f415_spi.c
  • spi_i2s_data_receive() : at32f415_spi.h, at32f415_spi.c
  • spi_i2s_data_transmit() : at32f415_spi.h, at32f415_spi.c
  • spi_i2s_dma_receiver_enable() : at32f415_spi.h, at32f415_spi.c
  • spi_i2s_dma_transmitter_enable() : at32f415_spi.h, at32f415_spi.c
  • spi_i2s_flag_clear() : at32f415_spi.h, at32f415_spi.c
  • spi_i2s_flag_get() : at32f415_spi.h, at32f415_spi.c
  • spi_i2s_interrupt_enable() : at32f415_spi.h, at32f415_spi.c
  • spi_i2s_reset() : at32f415_spi.h, at32f415_spi.c
  • spi_init() : at32f415_spi.h, at32f415_spi.c
  • spi_software_cs_internal_level_set() : at32f415_spi.h, at32f415_spi.c
  • spiflash_init() : spi_flash.h, spi_flash.c
  • spiflash_page_write() : spi_flash.h, spi_flash.c
  • spiflash_read() : spi_flash.h, spi_flash.c
  • spiflash_read_id() : spi_flash.h, spi_flash.c
  • spiflash_read_sr1() : spi_flash.h, spi_flash.c
  • spiflash_sector_erase() : spi_flash.h, spi_flash.c
  • spiflash_wait_busy() : spi_flash.h, spi_flash.c
  • spiflash_write() : spi_flash.h, spi_flash.c
  • spiflash_write_enable() : spi_flash.h, spi_flash.c
  • spiflash_write_nocheck() : spi_flash.h, spi_flash.c
  • SVC_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • switch_system_clock() : project/at_start_f415/examples/crm/sysclk_switch/src/main.c
  • swj_dp_config() : project/at_start_f415/examples/gpio/swjtag_remap/src/main.c
  • sysclk_config_deep_sleep() : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c
  • system_clock_config() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_clock.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_clock.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_clock.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_clock.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_clock.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_clock.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_clock.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_clock.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_clock.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_clock.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_clock.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_clock.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_clock.c, project/at_start_f415/examples/can/filter/inc/at32f415_clock.h, project/at_start_f415/examples/can/filter/src/at32f415_clock.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_clock.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_clock.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_clock.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_clock.c, project/at_start_f415/examples/cmp/output/inc/at32f415_clock.h, project/at_start_f415/examples/cmp/output/src/at32f415_clock.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_clock.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_clock.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_clock.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_clock.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_clock.h, project/at_start_f415/examples/crc/calculation/src/at32f415_clock.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_clock.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_clock.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_clock.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_clock.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_clock.h, project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_clock.c, project/at_start_f415/examples/debug/tmr1/inc/at32f415_clock.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_clock.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_clock.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_clock.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_clock.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_clock.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_clock.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_clock.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_clock.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_clock.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_clock.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_clock.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_clock.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_clock.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_clock.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_clock.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_clock.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_clock.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_clock.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_clock.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_clock.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_clock.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_clock.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_clock.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_clock.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_clock.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_clock.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_clock.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_clock.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_clock.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_clock.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_clock.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_clock.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_clock.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_clock.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_clock.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_clock.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_clock.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_clock.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_clock.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_clock.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_clock.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_clock.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_clock.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_clock.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_clock.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_clock.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_clock.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_clock.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_clock.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_clock.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_clock.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_clock.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_clock.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_clock.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_clock.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_clock.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_clock.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_clock.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_clock.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_clock.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_clock.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_clock.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_clock.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_clock.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_clock.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_clock.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_clock.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_clock.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_clock.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_clock.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_clock.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/dma/src/at32f415_clock.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_clock.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_clock.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_clock.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_clock.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_clock.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_clock.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_clock.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_clock.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_clock.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_clock.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_clock.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_clock.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_clock.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_clock.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_clock.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_clock.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_clock.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_clock.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_clock.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_clock.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_clock.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_clock.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_clock.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_clock.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_clock.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_clock.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_clock.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_clock.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_clock.c, project/at_start_f415/examples/usart/irda/inc/at32f415_clock.h, project/at_start_f415/examples/usart/irda/src/at32f415_clock.c, project/at_start_f415/examples/usart/polling/inc/at32f415_clock.h, project/at_start_f415/examples/usart/polling/src/at32f415_clock.c, project/at_start_f415/examples/usart/printf/inc/at32f415_clock.h, project/at_start_f415/examples/usart/printf/src/at32f415_clock.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_clock.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_clock.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_clock.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_clock.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_clock.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_clock.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_clock.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_clock.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_clock.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_clock.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_clock.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_clock.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_clock.h, project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_clock.c, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_clock.h, project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_clock.c, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_clock.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_clock.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_clock.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_clock.c, project/at_start_f415/templates/inc/at32f415_clock.h, project/at_start_f415/templates/src/at32f415_clock.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_clock.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_clock.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_clock.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_clock.c, utilities/at32f415_freertos_demo/inc/at32f415_clock.h, utilities/at32f415_freertos_demo/src/at32f415_clock.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_clock.h, utilities/at32f415_gen_random_number_demo/src/at32f415_clock.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_clock.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_clock.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_clock.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_clock.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_clock.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_clock.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_clock.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_clock.c
  • system_clock_recover() : project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c
  • system_core_clock_update() : system_at32f415.c, system_at32f415.h
  • SystemInit() : system_at32f415.c, system_at32f415.h
  • systick_clock_source_config() : at32f415_misc.h, at32f415_misc.c
  • systick_configuration() : project/at_start_f415/examples/tmr/6_steps/src/main.c
  • SysTick_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • systick_handler() : project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c


AT32F415 Firmwary Library: Globals

- t -

  • TAMP_STAMP_IRQHandler() : project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c
  • TMR1_BRK_TMR9_IRQHandler() : project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c
  • TMR1_CH_IRQHandler() : project/at_start_f415/examples/cmp/output/src/at32f415_int.c
  • tmr1_config() : project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c, project/at_start_f415/examples/exint/exint_software_trigger/src/main.c
  • tmr1_init() : project/at_start_f415/examples/cmp/output/src/main.c
  • TMR1_OVF_TMR10_IRQHandler() : project/at_start_f415/examples/debug/tmr1/src/main.c, project/at_start_f415/examples/exint/exint_software_trigger/src/main.c, project/at_start_f415/examples/tmr/timer_base/src/main.c
  • TMR1_TRG_HALL_TMR11_IRQHandler() : project/at_start_f415/examples/tmr/6_steps/src/main.c
  • tmr2_config() : project/at_start_f415/examples/pwc/sleep_tmr2/src/main.c
  • TMR2_GLOBAL_IRQHandler() : project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c
  • TMR3_GLOBAL_IRQHandler() : project/at_start_f415/examples/tmr/input_capture/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, app_led3_toggle/src/tmr.c, app_led4_toggle/src/tmr.c, bootloader/src/tmr.c
  • TMR5_GLOBAL_IRQHandler() : project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c
  • tmr_32_bit_function_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_base_init() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_brkdt_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_brkdt_default_para_init() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_channel1_input_select() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_channel_buffer_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_channel_dma_select() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_channel_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_channel_value_get() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_channel_value_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_clock_source_div_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_cnt_dir_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_counter_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_counter_value_get() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_counter_value_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_div_value_get() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_div_value_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_dma_control_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_dma_request_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_encoder_mode_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_event_sw_trigger() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_external_clock_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_external_clock_mode1_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_external_clock_mode2_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_flag_clear() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_flag_get() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_force_output_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_hall_select() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_init() : app_led3_toggle/inc/tmr.h, app_led3_toggle/src/tmr.c, app_led4_toggle/inc/tmr.h, app_led4_toggle/src/tmr.c, bootloader/inc/tmr.h, bootloader/src/tmr.c
  • tmr_input_channel_divider_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_input_channel_filter_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_input_channel_init() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_input_default_para_init() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_internal_clock_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_interrupt_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_one_cycle_mode_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_channel_buffer_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_channel_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_channel_immediately_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_channel_mode_select() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_channel_polarity_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_channel_switch_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_default_para_init() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_output_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_overflow_event_disable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_overflow_request_source_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_period_buffer_enable() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_period_value_get() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_period_value_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_primary_mode_select() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_pwm_input_config() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_repetition_counter_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_reset() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_sub_mode_select() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_sub_sync_mode_set() : at32f415_tmr.h, at32f415_tmr.c
  • tmr_trigger_input_select() : at32f415_tmr.h, at32f415_tmr.c
  • tx_data_fill() : project/at_start_f415/examples/spi/w25q_flash/src/main.c


AT32F415 Firmwary Library: Globals

- u -

  • uart_init() : project/at_start_f415/examples/tmr/input_capture/src/main.c, app_led3_toggle/inc/usart.h, app_led3_toggle/src/usart.c, app_led4_toggle/inc/usart.h, app_led4_toggle/src/usart.c, bootloader/inc/usart.h, bootloader/src/usart.c
  • uart_print_init() : at32f415_board.c, at32f415_board.h
  • uhost_init_handler() : usbh_hid_class.c, usbh_msc_class.c
  • uhost_process_handler() : usbh_hid_class.c, usbh_msc_class.c
  • uhost_request_handler() : usbh_hid_class.c, usbh_msc_class.c
  • uhost_reset_handler() : usbh_hid_class.c, usbh_msc_class.c
  • UsageFault_Handler() : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h, project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h, project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c, project/at_start_f415/examples/can/filter/inc/at32f415_int.h, project/at_start_f415/examples/can/filter/src/at32f415_int.c, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h, project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h, project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/inc/at32f415_int.h, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c, project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h, project/at_start_f415/examples/crc/calculation/src/at32f415_int.c, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h, project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h, project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h, project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h, project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h, project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c, project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h, project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h, project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h, project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h, project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h, project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h, project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h, project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h, project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h, project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h, project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h, project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h, project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h, project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h, project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h, project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h, project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h, project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h, project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h, project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h, project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h, project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h, project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h, project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h, project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h, project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h, project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h, project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h, project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/irda/inc/at32f415_int.h, project/at_start_f415/examples/usart/irda/src/at32f415_int.c, project/at_start_f415/examples/usart/polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/polling/src/at32f415_int.c, project/at_start_f415/examples/usart/printf/inc/at32f415_int.h, project/at_start_f415/examples/usart/printf/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h, project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h, project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c, project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c, project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c, project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h, project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c, project/at_start_f415/templates/inc/at32f415_int.h, project/at_start_f415/templates/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c, utilities/at32f415_freertos_demo/inc/at32f415_int.h, utilities/at32f415_freertos_demo/src/at32f415_int.c, utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h, utilities/at32f415_gen_random_number_demo/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c, utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h, utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
  • usart1_config() : project/at_start_f415/examples/pwc/sleep_usart1/src/main.c
  • USART1_IRQHandler() : project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c, app_led3_toggle/src/usart.c, app_led4_toggle/src/usart.c, bootloader/src/usart.c
  • USART2_IRQHandler() : project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c
  • USART3_IRQHandler() : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c
  • usart_break_bit_num_set() : at32f415_usart.h, at32f415_usart.c
  • usart_break_send() : at32f415_usart.h, at32f415_usart.c
  • usart_clock_config() : at32f415_usart.h, at32f415_usart.c
  • usart_clock_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_configuration() : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/hw_flow_control/src/main.c, project/at_start_f415/examples/usart/idle_detection/src/main.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/irda/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/receiver_mute/src/main.c, project/at_start_f415/examples/usart/smartcard/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • usart_data_receive() : at32f415_usart.h, at32f415_usart.c
  • usart_data_transmit() : at32f415_usart.h, at32f415_usart.c
  • usart_dma_receiver_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_dma_transmitter_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_flag_clear() : at32f415_usart.h, at32f415_usart.c
  • usart_flag_get() : at32f415_usart.h, at32f415_usart.c
  • usart_hardware_flow_control_set() : at32f415_usart.h, at32f415_usart.c
  • usart_init() : at32f415_usart.h, at32f415_usart.c
  • usart_interrupt_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_irda_low_power_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_irda_mode_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_irda_smartcard_division_set() : at32f415_usart.h, at32f415_usart.c
  • usart_lin_mode_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_parity_selection_config() : at32f415_usart.h, at32f415_usart.c
  • usart_receiver_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_receiver_mute_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_reset() : at32f415_usart.h, at32f415_usart.c
  • usart_single_line_halfduplex_select() : at32f415_usart.h, at32f415_usart.c
  • usart_smartcard_guard_time_set() : at32f415_usart.h, at32f415_usart.c
  • usart_smartcard_mode_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_smartcard_nack_set() : at32f415_usart.h, at32f415_usart.c
  • usart_spi_configuration() : project/at_start_f415/examples/usart/synchronous/src/main.c
  • usart_transmitter_enable() : at32f415_usart.h, at32f415_usart.c
  • usart_wakeup_id_set() : at32f415_usart.h, at32f415_usart.c
  • usart_wakeup_mode_set() : at32f415_usart.h, at32f415_usart.c
  • usb_bot_request() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • usb_clock48m_select() : project/at_start_f415/examples/usb_device/audio/src/main.c, project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/msc/src/main.c, project/at_start_f415/examples/usb_device/printer/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • usb_connect() : at32f415_usb.h, at32f415_usb.c
  • usb_core_config() : usb_core.h, usb_core.c
  • usb_delay_ms() : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • usb_delay_us() : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • usb_disconnect() : at32f415_usb.h, at32f415_usb.c
  • usb_ept0_setup() : at32f415_usb.h, at32f415_usb.c
  • usb_ept0_start() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_clear_stall() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_close() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_default_init() : usbd_core.c
  • usb_ept_in_clear() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_in_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_open() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_out_clear() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_out_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_ept_stall() : at32f415_usb.h, at32f415_usb.c
  • usb_flush_rx_fifo() : at32f415_usb.h, at32f415_usb.c
  • usb_flush_tx_fifo() : at32f415_usb.h, at32f415_usb.c
  • usb_get_all_in_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_get_all_out_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_global_clear_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_global_get_all_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_global_init() : at32f415_usb.h, at32f415_usb.c
  • usb_global_interrupt_enable() : at32f415_usb.h, at32f415_usb.c
  • usb_global_power_on() : at32f415_usb.h, at32f415_usb.c
  • usb_global_reset() : at32f415_usb.h, at32f415_usb.c
  • usb_global_select_core() : at32f415_usb.h, at32f415_usb.c
  • usb_global_set_mode() : at32f415_usb.h, at32f415_usb.c
  • usb_gpio_config() : project/at_start_f415/examples/usb_device/audio/src/main.c, project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/msc/src/main.c, project/at_start_f415/examples/usb_device/printer/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • usb_hc_enable() : at32f415_usb.h, at32f415_usb.c
  • usb_hch_halt() : at32f415_usb.h, at32f415_usb.c
  • usb_hch_read_interrupt() : at32f415_usb.h, at32f415_usb.c
  • usb_hid_buf_process() : audio_hid_class.c, custom_hid_class.c, hid_iap_class.c
  • usb_hid_keyboard_send_char() : cdc_keyboard_class.c, cdc_keyboard_class.h, keyboard_class.c, keyboard_class.h
  • usb_hid_mouse_send() : mouse_class.c, mouse_class.h
  • usb_host_disable() : at32f415_usb.h, at32f415_usb.c
  • usb_interrupt_disable() : at32f415_usb.h, at32f415_usb.c
  • usb_interrupt_enable() : at32f415_usb.h, at32f415_usb.c
  • usb_low_power_wakeup_config() : project/at_start_f415/examples/usb_device/audio/src/main.c, project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/msc/src/main.c, project/at_start_f415/examples/usb_device/printer/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
  • usb_open_phy_clk() : at32f415_usb.h, at32f415_usb.c
  • usb_port_power_on() : at32f415_usb.h, at32f415_usb.c
  • usb_printer_get_rxdata() : printer_class.h
  • usb_printer_send_data() : printer_class.c, printer_class.h
  • usb_re_connect() : project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c
  • usb_read_packet() : at32f415_usb.h, at32f415_usb.c
  • usb_remote_wkup_clear() : at32f415_usb.h, at32f415_usb.c
  • usb_remote_wkup_set() : at32f415_usb.h, at32f415_usb.c
  • usb_set_address() : at32f415_usb.h, at32f415_usb.c
  • usb_set_rx_fifo() : at32f415_usb.h, at32f415_usb.c
  • usb_set_tx_fifo() : at32f415_usb.h, at32f415_usb.c
  • usb_stop_phy_clk() : at32f415_usb.h, at32f415_usb.c
  • usb_suspend_status_get() : at32f415_usb.h, at32f415_usb.c
  • usb_vcp_cmd_process() : cdc_class.c, cdc_keyboard_class.c
  • usb_vcp_get_rxdata() : cdc_class.c, cdc_class.h, cdc_keyboard_class.c, cdc_keyboard_class.h
  • usb_vcp_send_data() : cdc_class.c, cdc_class.h, cdc_keyboard_class.c, cdc_keyboard_class.h
  • usb_write_empty_txfifo() : usbd_int.h, usbd_int.c
  • usb_write_packet() : at32f415_usb.h, at32f415_usb.c
  • usbd_clear_feature() : usbd_sdr.c
  • usbd_clear_stall() : usbd_core.c
  • usbd_connect() : usbd_core.c
  • usbd_connect_state_get() : usbd_core.c
  • usbd_core_in_handler() : usbd_core.c
  • usbd_core_init() : usbd_core.c
  • usbd_core_out_handler() : usbd_core.c
  • usbd_core_setup_handler() : usbd_core.c
  • usbd_ctrl_recv() : usbd_core.c
  • usbd_ctrl_recv_status() : usbd_core.c
  • usbd_ctrl_send() : usbd_core.c
  • usbd_ctrl_send_status() : usbd_core.c
  • usbd_ctrl_unsupport() : usbd_core.c
  • usbd_device_request() : usbd_sdr.h, usbd_sdr.c
  • usbd_discon_handler() : usbd_int.h, usbd_int.c
  • usbd_disconnect() : usbd_core.c
  • usbd_endpoint_request() : usbd_sdr.h, usbd_sdr.c
  • usbd_enter_suspend() : usbd_core.c
  • usbd_enumdone_handler() : usbd_int.h, usbd_int.c
  • usbd_ept_close() : usbd_core.c
  • usbd_ept_handler() : usbd_int.h
  • usbd_ept_open() : usbd_core.c
  • usbd_ept_recv() : usbd_core.c
  • usbd_ept_send() : usbd_core.c
  • usbd_fifo_alloc() : usbd_core.c
  • usbd_flush_tx_fifo() : usbd_core.c
  • usbd_get_configuration() : usbd_sdr.c
  • usbd_get_descriptor() : usbd_sdr.c
  • usbd_get_recv_len() : usbd_core.c
  • usbd_get_status() : usbd_sdr.c
  • usbd_hid_iap_in_complete() : hid_iap_class.h, app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • usbd_hid_iap_process() : hid_iap_class.h, app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • usbd_incomisioin_handler() : usbd_int.h, usbd_int.c
  • usbd_incomisoout_handler() : usbd_int.h, usbd_int.c
  • usbd_inept_handler() : usbd_int.h, usbd_int.c
  • usbd_int_to_unicode() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • usbd_interface_request() : usbd_sdr.h, usbd_sdr.c
  • usbd_irq_handler() : usbd_int.h, usbd_int.c
  • usbd_outept_handler() : usbd_int.h, usbd_int.c
  • usbd_remote_wakeup() : usbd_core.c
  • usbd_reset_handler() : usbd_int.h, usbd_int.c
  • usbd_rxflvl_handler() : usbd_int.h, usbd_int.c
  • usbd_set_address() : usbd_sdr.c
  • usbd_set_configuration() : usbd_sdr.c
  • usbd_set_device_addr() : usbd_core.c
  • usbd_set_feature() : usbd_sdr.c
  • usbd_set_stall() : usbd_core.c
  • usbd_setup_request_parse() : usbd_sdr.h, usbd_sdr.c
  • usbd_sof_handler() : usbd_int.h, usbd_int.c
  • usbd_suspend_handler() : usbd_int.h, usbd_int.c
  • usbd_unicode_convert() : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • usbd_wakeup_handler() : usbd_int.h, usbd_int.c
  • usbh_active_vbus() : usbh_core.c
  • usbh_alloc_address() : usbh_core.c
  • usbh_alloc_channel() : usbh_core.c
  • usbh_attached() : usbh_core.c
  • usbh_bot_cbw() : usbh_msc_bot_scsi.c
  • usbh_bulk_recv() : usbh_core.c
  • usbh_bulk_send() : usbh_core.c
  • usbh_cfg_default_init() : usbh_core.c
  • usbh_ch_disable() : usbh_core.c
  • usbh_check_csw() : usbh_msc_bot_scsi.c
  • usbh_class() : usbh_core.c
  • usbh_class_request() : usbh_core.c
  • usbh_clear_dev_feature() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_clear_endpoint_feature() : usbh_hid_class.c
  • usbh_clear_ept_feature() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_cmd_capacity10() : usbh_msc_bot_scsi.c
  • usbh_cmd_inquiry() : usbh_msc_bot_scsi.c
  • usbh_cmd_read() : usbh_msc_bot_scsi.c
  • usbh_cmd_requset_sense() : usbh_msc_bot_scsi.c
  • usbh_cmd_test_unit_ready() : usbh_msc_bot_scsi.c
  • usbh_cmd_write() : usbh_msc_bot_scsi.c
  • usbh_core_init() : usbh_core.c
  • usbh_ctrl_complete_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_data_in_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_data_in_wait_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_data_out_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_data_out_wait_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_error_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_recv_data() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_request() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_result_check() : usbh_core.c
  • usbh_ctrl_send_data() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_send_setup() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_setup_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_setup_wait_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_stall_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_status_in_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_status_in_wait_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_status_out_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_status_out_wait_handler() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_ctrl_transfer_loop() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_disconnect() : usbh_core.c
  • usbh_disconnect_handler() : usbh_int.h, usbh_int.c
  • usbh_enter_suspend() : usbh_core.c
  • usbh_enum_handler() : usbh_core.c
  • usbh_enumeration() : usbh_core.c
  • usbh_find_interface() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_free_channel() : usbh_core.c
  • usbh_fsls_clksel() : at32f415_usb.h, at32f415_usb.c
  • usbh_get_configure_descriptor() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_get_descriptor() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_get_device_descriptor() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_get_frame() : at32f415_usb.h, at32f415_usb.c
  • usbh_get_free_channel() : usbh_core.c
  • usbh_get_next_header() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_get_sting_descriptor() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_get_urb_status() : usbh_core.c
  • usbh_hc_open() : usbh_core.c
  • usbh_hch_handler() : usbh_int.h, usbh_int.c
  • usbh_hch_in_handler() : usbh_int.h, usbh_int.c
  • usbh_hch_out_handler() : usbh_int.h, usbh_int.c
  • usbh_hid_get_desc() : usbh_hid_class.c
  • usbh_hid_get_report() : usbh_hid_class.c
  • usbh_hid_keyboard_decode() : usbh_hid_keyboard.c, usbh_hid_keyboard.h
  • usbh_hid_mouse_button_press() : usbh_hid_mouse.c
  • usbh_hid_mouse_button_release() : usbh_hid_mouse.c
  • usbh_hid_mouse_decode() : usbh_hid_mouse.c, usbh_hid_mouse.h
  • usbh_hid_mouse_position() : usbh_hid_mouse.c
  • usbh_hid_mouse_process() : usbh_hid_mouse.c
  • usbh_hid_set_idle() : usbh_hid_class.c
  • usbh_hid_set_protocol() : usbh_hid_class.c
  • usbh_in_out_request() : usbh_core.c
  • usbh_interrupt_recv() : usbh_core.c
  • usbh_interrupt_send() : usbh_core.c
  • usbh_irq_handler() : usbh_int.h, usbh_int.c
  • usbh_isoc_recv() : usbh_core.c
  • usbh_isoc_send() : usbh_core.c
  • usbh_loop_handler() : usbh_core.c
  • usbh_msc_bot_scsi_capacity() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • usbh_msc_bot_scsi_get_inquiry() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • usbh_msc_bot_scsi_read() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • usbh_msc_bot_scsi_request_sense() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • usbh_msc_bot_scsi_test_unit_ready() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • usbh_msc_bot_scsi_write() : usbh_msc_bot_scsi.c, usbh_msc_bot_scsi.h
  • usbh_msc_clear_feature() : usbh_msc_class.c
  • usbh_msc_get_max_lun() : usbh_msc_class.c
  • usbh_msc_is_ready() : usbh_msc_class.c, usbh_msc_class.h
  • usbh_msc_read() : usbh_msc_class.c, usbh_msc_class.h
  • usbh_msc_write() : usbh_msc_class.c, usbh_msc_class.h
  • usbh_parse_configure_desc() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_parse_dev_desc() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_parse_endpoint_desc() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_parse_interface_desc() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_parse_string_desc() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_port_handler() : usbh_int.h, usbh_int.c
  • usbh_reset_port() : usbh_core.c
  • usbh_resume() : usbh_core.c
  • usbh_rx_qlvl_handler() : usbh_int.h, usbh_int.c
  • usbh_set_address() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_set_configuration() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_set_feature() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_set_interface() : usbh_ctrl.h, usbh_ctrl.c
  • usbh_set_toggle() : usbh_core.c
  • usbh_sof_handler() : usbh_int.h, usbh_int.c
  • usbh_suspend() : usbh_core.c
  • usbh_user_active_vbus() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_application() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_attached() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_disconnect() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_enumeration_done() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_init() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_mfc_string() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_not_support() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_product_string() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_reset() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_serial_string() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_user_speed() : hid_demo/src/usbh_user.c, msc_only_fat32/src/usbh_user.c
  • usbh_wakeup() : usbh_core.c
  • usbh_wakeup_handler() : usbh_int.h, usbh_int.c


AT32F415 Firmwary Library: Globals

- w -

  • wakeup_timer_config() : project/at_start_f415/examples/ertc/wakeup_timer/src/main.c
  • wdt_counter_reload() : at32f415_wdt.h, at32f415_wdt.c
  • wdt_divider_set() : at32f415_wdt.h, at32f415_wdt.c
  • wdt_enable() : at32f415_wdt.h, at32f415_wdt.c
  • wdt_flag_get() : at32f415_wdt.h, at32f415_wdt.c
  • wdt_register_write_enable() : at32f415_wdt.h, at32f415_wdt.c
  • wdt_reload_value_set() : at32f415_wdt.h, at32f415_wdt.c
  • wwdt_counter_set() : at32f415_wwdt.h, at32f415_wwdt.c
  • wwdt_divider_set() : at32f415_wwdt.h, at32f415_wwdt.c
  • wwdt_enable() : at32f415_wwdt.h, at32f415_wwdt.c
  • wwdt_flag_clear() : at32f415_wwdt.h, at32f415_wwdt.c
  • wwdt_flag_get() : at32f415_wwdt.h, at32f415_wwdt.c
  • wwdt_interrupt_enable() : at32f415_wwdt.h, at32f415_wwdt.c
  • wwdt_reset() : at32f415_wwdt.h, at32f415_wwdt.c
  • wwdt_window_counter_set() : at32f415_wwdt.h, at32f415_wwdt.c


AT32F415 Firmwary Library: Globals

- _ -

  • _asciimap : cdc_keyboard_class.c, keyboard_class.c


AT32F415 Firmwary Library: Globals

- a -

  • adc1_ordinary_value : project/at_start_f415/examples/adc/current_vref_value_check/src/main.c, project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c
  • adc1_ordinary_valuetab : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c, project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/src/main.c
  • adc1_preempt_valuetab : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c
  • ALIGNED_TAIL : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_bot_scsi.c, msc_desc.c, printer_desc.c
  • alt_setting : audio_hid_class.c, cdc_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c, msc_class.c, printer_class.c
  • atr_decode_status : project/at_start_f415/examples/usart/smartcard/src/main.c
  • audio_class_handler : audio_class.c, audio_class.h
  • audio_codec : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • audio_desc_handler : audio_desc.c, audio_desc.h
  • audio_feedback_state : audio_class.c, audio_hid_class.c
  • audio_hid_class_handler : audio_hid_class.c, audio_hid_class.h
  • audio_hid_desc_handler : audio_hid_desc.c, audio_hid_desc.h
  • audio_spk_out_stage : audio_class.c, audio_hid_class.c
  • audio_struct : audio_class.c, audio_hid_class.c


AT32F415 Firmwary Library: Globals

- b -

  • bpr_addr_tab : project/at_start_f415/examples/ertc/bpr_domain/src/main.c, project/at_start_f415/examples/ertc/tamper/src/main.c
  • buffer_ch1 : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • buffer_ch2 : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • buffer_read : project/at_start_f415/examples/flash/flash_write_read/src/main.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c
  • buffer_write : project/at_start_f415/examples/flash/flash_write_read/src/main.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c


AT32F415 Firmwary Library: Globals

- c -

  • capture : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c, project/at_start_f415/examples/cmp/output/src/main.c, project/at_start_f415/examples/tmr/input_capture/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c
  • capture_number : project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/src/main.c
  • capturenumber : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c, project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/src/main.c, project/at_start_f415/examples/tmr/input_capture/src/main.c
  • card_inserted : project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c, project/at_start_f415/examples/usart/smartcard/src/main.c
  • card_protocol : project/at_start_f415/examples/usart/smartcard/src/main.c
  • card_type : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • cbw_struct : msc_bot_scsi.c, msc_class.c
  • cdc_keyboard_class_handler : cdc_keyboard_class.c, cdc_keyboard_class.h
  • cdc_keyboard_desc_handler : cdc_keyboard_desc.c, cdc_keyboard_desc.h
  • ch1_val : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • ch1readvalue1 : project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/src/main.c
  • ch1readvalue2 : project/at_start_f415/examples/cmp/output/src/at32f415_int.c, project/at_start_f415/examples/cmp/output/src/main.c
  • ch2_val : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • ch3_val : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • ch3readvalue1 : project/at_start_f415/examples/tmr/input_capture/src/main.c
  • ch3readvalue2 : project/at_start_f415/examples/tmr/input_capture/src/main.c
  • ch4_val : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • channel1_pulse : project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c
  • channel2_pulse : project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c
  • channel3_pulse : project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c
  • channel4_pulse : project/at_start_f415/examples/tmr/7_pwm_output/src/main.c
  • cid_table : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • class_handler : cdc_class.c, cdc_class.h, printer_class.c, printer_class.h
  • cmd_addr_cnt : bootloader/src/iap.c
  • cmd_ctr_step : bootloader/inc/iap.h, bootloader/src/iap.c
  • cmd_data_cnt : bootloader/src/iap.c
  • cmd_data_group_struct : bootloader/src/iap.c
  • cmd_data_group_type_struct : bootloader/inc/iap.h
  • cmd_data_step : bootloader/inc/iap.h, bootloader/src/iap.c
  • config_descriptor : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • counter : project/at_start_f415/examples/debug/tmr1/src/main.c, project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c, project/at_start_f415/examples/usart/smartcard/src/main.c
  • crc1_value : project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c
  • crc2_value : project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c
  • crc_value : project/at_start_f415/examples/crc/calculation/src/main.c
  • crm_clocks_freq_struct : project/at_start_f415/examples/debug/tmr1/src/main.c, project/at_start_f415/examples/tmr/6_steps/src/main.c, project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c, project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c, project/at_start_f415/examples/tmr/external_clock/src/main.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c, project/at_start_f415/examples/tmr/hang_mode/src/main.c, project/at_start_f415/examples/tmr/input_capture/src/main.c, project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/timer_base/src/main.c
  • csd_table : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • csw_struct : msc_bot_scsi.c, msc_class.c
  • custom_hid_class_handler : custom_hid_class.c, custom_hid_class.h


AT32F415 Firmwary Library: Globals

- d -

  • data_buffer : project/at_start_f415/examples/crc/calculation/src/main.c
  • data_count : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/hw_flow_control/src/main.c
  • data_counter_end : project/at_start_f415/examples/dma/flash_to_sram/src/main.c
  • desc_handler : cdc_desc.c, cdc_desc.h, printer_desc.c, printer_desc.h
  • device_descriptor : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • device_mode : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • div_value : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/one_cycle/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c
  • dma_init_struct : project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c, project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c
  • dma_init_structure : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • dma_trans_complete_flag : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c, project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c
  • dst_buffer : project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/usart/smartcard/src/main.c
  • duty_cycle : project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/src/main.c, project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • duty_result : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • dw_data_start_sector : utilities/at32f415_slib_demo/project_l0/src/main.c
  • dw_end_sector : utilities/at32f415_slib_demo/project_l0/src/main.c
  • dw_start_sector : utilities/at32f415_slib_demo/project_l0/src/main.c


AT32F415 Firmwary Library: Globals

- e -

  • ertc_clk_div_a : project/at_start_f415/examples/ertc/calendar/src/main.c, random.c
  • ertc_clk_div_b : project/at_start_f415/examples/ertc/calendar/src/main.c, random.c


AT32F415 Firmwary Library: Globals

- f -

  • fac_ms : at32f415_board.c
  • fac_us : at32f415_board.c
  • fat16_file_name : flash_fat16.c
  • fat16_root_dir_sector : flash_fat16.c
  • fat16_sector : flash_fat16.c
  • fat16_table_sector0 : flash_fat16.c
  • file : project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c, msc_only_fat32/src/usbh_user.c
  • file_write_nr : flash_fat16.c
  • firCoeffs32 : fir_coefficient.c, fir_filter.c
  • firStateF32 : fir_filter.c
  • flash_buf : project/at_start_f415/examples/flash/flash_write_read/src/flash.c
  • flash_fat16_1_addr : flash_fat16.c
  • flash_fat16_2_addr : flash_fat16.c
  • flash_fat16_boot_sector_addr : flash_fat16.c
  • flash_fat16_file_start_addr : flash_fat16.c
  • flash_fat16_root_addr : flash_fat16.c
  • flash_iap : flash_fat16.h, flash_fat16.c
  • freq_result : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • frequency : project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c, project/at_start_f415/examples/tmr/pwm_input/src/main.c, project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • fs : project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c, msc_only_fat32/src/usbh_user.c


AT32F415 Firmwary Library: Globals

- g -

  • g_cmd : cdc_class.c, cdc_keyboard_class.c
  • g_file_attr : flash_fat16.c
  • g_hid_usb_desc : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • g_keyboard_tx_completed : cdc_keyboard_class.c, cdc_keyboard_class.h
  • g_len : cdc_class.c, cdc_keyboard_class.c
  • g_printer_data : printer_class.c
  • g_printer_port_status : printer_class.c
  • g_req : cdc_class.c, cdc_keyboard_class.c
  • g_rx_buff : cdc_class.c, cdc_keyboard_class.c, printer_class.c
  • g_rx_completed : cdc_class.c, cdc_keyboard_class.c, printer_class.c
  • g_rxhid_buff : audio_hid_class.c, custom_hid_class.c, hid_iap_class.c
  • g_rxlen : cdc_class.c, cdc_keyboard_class.c
  • g_speed : project/at_start_f415/templates/src/main.c
  • g_tx_completed : cdc_class.c, cdc_keyboard_class.c, printer_class.c
  • g_txhid_buff : audio_hid_class.c, custom_hid_class.c
  • g_u8tx_completed : keyboard_class.c, keyboard_class.h
  • g_usbd_configuration : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • g_usbd_desc_buffer : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • g_usbd_descriptor : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • g_usbd_hid_report : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • get_data_from_usart_flag : bootloader/inc/tmr.h, bootloader/src/tmr.c
  • gpio_init_struct : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c, project/at_start_f415/examples/cmp/output/src/main.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c, project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/tmr/6_steps/src/main.c, project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/cascade_synchro/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c, project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c, project/at_start_f415/examples/tmr/external_clock/src/main.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c, project/at_start_f415/examples/tmr/hang_mode/src/main.c, project/at_start_f415/examples/tmr/input_capture/src/main.c


AT32F415 Firmwary Library: Globals

- h -

  • hi2cx : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • hid_desc_handler : custom_hid_desc.c, custom_hid_desc.h
  • hid_iap_class_handler : hid_iap_class.c, hid_iap_class.h
  • hid_iap_desc_handler : hid_iap_desc.c, hid_iap_desc.h
  • hid_keyboard_codes : usbh_hid_keyboard.c
  • hid_keyboard_key : usbh_hid_keyboard.c
  • hid_keyboard_key_shift : usbh_hid_keyboard.c
  • hid_mouse : usbh_hid_mouse.c
  • hid_protocol : audio_hid_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c
  • hid_set_idle : audio_hid_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c
  • hid_set_report : audio_hid_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c
  • hid_state : audio_hid_class.c, cdc_keyboard_class.c, custom_hid_class.c, hid_iap_class.c, keyboard_class.c, mouse_class.c
  • hid_suspend_flag : keyboard_class.c, mouse_class.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c


AT32F415 Firmwary Library: Globals

- i -

  • i2s1_buffer_tx : project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c
  • i2s2_buffer_rx : project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c
  • iap_flag : app_led3_toggle/inc/usart.h, app_led3_toggle/src/usart.c, app_led4_toggle/inc/usart.h, app_led4_toggle/src/usart.c
  • iap_info : hid_iap_class.c, hid_iap_class.h
  • ic1readvalue1 : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c
  • ic1readvalue2 : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c
  • ic2value : project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c


AT32F415 Firmwary Library: Globals

- j -

  • jump_to_app : bootloader/src/iap.c


AT32F415 Firmwary Library: Globals

- k -

  • keyboard_class_handler : keyboard_class.c, keyboard_class.h
  • keyboard_desc_handler : keyboard_desc.c, keyboard_desc.h
  • keyboard_send_flag : project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c


AT32F415 Firmwary Library: Globals

- l -

  • langid_descriptor : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • led2_handler : utilities/at32f415_freertos_demo/src/main.c
  • led3_handler : utilities/at32f415_freertos_demo/src/main.c
  • led_gpio_crm_clk : at32f415_board.c
  • led_gpio_pin : at32f415_board.c
  • led_gpio_port : at32f415_board.c
  • lick_freq : project/at_start_f415/examples/ertc/lick_calibration/src/main.c
  • linecoding : cdc_class.c, cdc_keyboard_class.c


AT32F415 Firmwary Library: Globals

- m -

  • mblock_rbuffer : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • mblock_tbuffer : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • mic_dma_buffer : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • mouse_class_handler : mouse_class.c, mouse_class.h
  • mouse_desc_handler : mouse_desc.c, mouse_desc.h
  • msc_class_handler : msc_class.c, msc_class.h
  • msc_desc_handler : msc_desc.c, msc_desc.h
  • msc_flash_size : msc/src/msc_diskio.c
  • msc_struct : msc_bot_scsi.c, msc_class.c


AT32F415 Firmwary Library: Globals

- o -

  • otg_core_struct : project/at_start_f415/examples/usb_device/audio/src/main.c, project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c, project/at_start_f415/examples/usb_device/keyboard/src/main.c, project/at_start_f415/examples/usb_device/mouse/src/main.c, project/at_start_f415/examples/usb_device/msc/src/main.c, project/at_start_f415/examples/usb_device/printer/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c, project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, project/at_start_f415/examples/usb_host/hid_demo/src/main.c, project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c, usbh_msc_diskio.c, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c, utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c


AT32F415 Firmwary Library: Globals

- p -

  • period_value : project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c, project/at_start_f415/examples/ertc/lick_calibration/src/main.c
  • pftarget : project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c, app_led3_toggle/src/hid_iap_user.c, app_led4_toggle/src/hid_iap_user.c, bootloader/src/hid_iap_user.c
  • preempt_conversion_count : project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c
  • preempt_trigger_count : project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c, project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c
  • press_mouse : project/at_start_f415/examples/usb_device/mouse/src/main.c
  • PRINTER_DEVICE_ID : printer_class.c


AT32F415 Firmwary Library: Globals

- r -

  • rca : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • refOutput : project_l0/src/arm_fir_data.c, utilities/at32f415_slib_demo/project_l0/src/main.c, project_l1/src/arm_fir_data.c, utilities/at32f415_slib_demo/project_l1/src/main.c
  • reg_addr_data : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • report_buf : project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c, project/at_start_f415/examples/usb_device/custom_hid/src/main.c
  • rx_buf : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c
  • rx_buf1 : project/at_start_f415/examples/i2c/eeprom/src/main.c
  • rx_buf2 : project/at_start_f415/examples/i2c/eeprom/src/main.c
  • rx_buf3 : project/at_start_f415/examples/i2c/eeprom/src/main.c
  • rx_buffer : project/at_start_f415/examples/spi/w25q_flash/src/main.c, project/at_start_f415/examples/usart/hw_flow_control/src/main.c
  • rx_counter : project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • rx_index : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c


AT32F415 Firmwary Library: Globals

- s -

  • sblock_rbuffer : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • sblock_tbuffer : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • sc_a2r_struct : project/at_start_f415/examples/usart/smartcard/src/main.c
  • scsi_inquiry : msc/src/msc_diskio.c, virtual_msc_iap/src/msc_diskio.c
  • sd_card_info : sd_mmc_card/inc/at32_sdio.h, sd_mmc_card/src/at32_sdio.c, sdio_fatfs/inc/at32_sdio.h, sdio_fatfs/src/at32_sdio.c
  • sdio_command_init_struct : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • sdio_data_init_struct : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • sector_size : msc/src/msc_diskio.c
  • serial_descriptor : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c
  • SPI1_buffer_tx : project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c
  • spi1_rx_buffer : project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c
  • spi1_tx_buffer : project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c
  • spi2_buffer_rx : project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c
  • spi2_rx_buffer : project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c
  • spi2_rx_counter : project/at_start_f415/examples/usart/synchronous/src/main.c
  • spi2_tx_buffer : project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c
  • spi2_tx_buffer_size : project/at_start_f415/examples/usart/synchronous/src/main.c
  • spi2_tx_counter : project/at_start_f415/examples/usart/synchronous/src/main.c
  • spi_init_struct : project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c
  • spiflash_sector_buf : spi_flash.c
  • spk_dma_buffer : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • src_buffer : project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c
  • src_const_buffer : project/at_start_f415/examples/dma/flash_to_sram/src/main.c
  • step : project/at_start_f415/examples/tmr/6_steps/src/main.c
  • stop_flag : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • stream_rbuffer : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • stream_tbuffer : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • sys_counter : project/at_start_f415/examples/tmr/input_capture/src/main.c
  • system_core_clock : system_at32f415.c, system_at32f415.h


AT32F415 Firmwary Library: Globals

- t -

  • temp_buf : utilities/at32f415_slib_demo/project_l0/src/main.c
  • test_result : project/at_start_f415/examples/can/filter/src/main.c
  • testInput_f32_1kHz_15kHz : project_l0/src/arm_fir_data.c, utilities/at32f415_slib_demo/project_l0/src/main.c, project_l1/src/arm_fir_data.c, utilities/at32f415_slib_demo/project_l1/src/main.c
  • testOutput : utilities/at32f415_slib_demo/project_l0/src/main.c, utilities/at32f415_slib_demo/project_l1/src/main.c
  • time : random.c
  • time_cnt : project/at_start_f415/examples/usart/printf/src/main.c
  • time_ira_cnt : bootloader/inc/tmr.h, bootloader/src/tmr.c
  • timer_period : project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c
  • tmp_c4 : project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c
  • tmr1freq : project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c, project/at_start_f415/examples/cmp/output/src/main.c
  • tmr3freq : project/at_start_f415/examples/tmr/input_capture/src/main.c
  • tmr_brkdt_config_struct : project/at_start_f415/examples/tmr/6_steps/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c
  • tmr_ic_init_structure : project/at_start_f415/examples/tmr/one_cycle/src/main.c, project/at_start_f415/examples/tmr/pwm_input/src/main.c, project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • tmr_input_config_struct : project/at_start_f415/examples/tmr/external_clock/src/main.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c, project/at_start_f415/examples/tmr/hang_mode/src/main.c, project/at_start_f415/examples/tmr/input_capture/src/main.c
  • tmr_oc_init_structure : project/at_start_f415/examples/tmr/oc_high/src/main.c, project/at_start_f415/examples/tmr/oc_low/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c, project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c, project/at_start_f415/examples/tmr/one_cycle/src/main.c, project/at_start_f415/examples/tmr/parallel_synchro/src/main.c, project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c, project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c, project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c, project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
  • tmr_output_struct : project/at_start_f415/examples/tmr/6_steps/src/main.c, project/at_start_f415/examples/tmr/7_pwm_output/src/main.c, project/at_start_f415/examples/tmr/cascade_synchro/src/main.c, project/at_start_f415/examples/tmr/complementary_signals/src/main.c, project/at_start_f415/examples/tmr/dma/src/main.c, project/at_start_f415/examples/tmr/dma_burst/src/main.c, project/at_start_f415/examples/tmr/external_clock/src/main.c, project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c, project/at_start_f415/examples/tmr/hang_mode/src/main.c
  • transfer_end : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • transfer_error : sd_mmc_card/src/at32_sdio.c, sdio_fatfs/src/at32_sdio.c
  • transfer_status : project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c, project/at_start_f415/examples/spi/w25q_flash/src/main.c
  • transfer_status1 : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c
  • transfer_status2 : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c
  • transfer_status3 : project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c
  • transfer_status4 : project/at_start_f415/examples/spi/fullduplex_polling/src/main.c
  • tx_buf : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c
  • tx_buf1 : project/at_start_f415/examples/i2c/eeprom/src/main.c
  • tx_buf2 : project/at_start_f415/examples/i2c/eeprom/src/main.c
  • tx_buf3 : project/at_start_f415/examples/i2c/eeprom/src/main.c
  • tx_buffer : project/at_start_f415/examples/spi/w25q_flash/src/main.c
  • tx_counter : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • tx_index : project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c


AT32F415 Firmwary Library: Globals

- u -

  • uhost_class_handler : usbh_hid_class.c, usbh_hid_class.h, usbh_msc_class.c, usbh_msc_class.h
  • update_status : bootloader/inc/iap.h, bootloader/src/iap.c
  • usart1_index : project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c
  • usart2_rx_buffer : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • usart2_rx_counter : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c
  • usart2_rx_dma_status : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c
  • usart2_tx_buffer : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/receiver_mute/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • usart2_tx_buffer_size : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c
  • usart2_tx_counter : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c
  • usart2_tx_dma_status : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c
  • usart3_rx_buffer : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c, project/at_start_f415/examples/usart/receiver_mute/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • usart3_rx_counter : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c
  • usart3_rx_dma_status : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c
  • usart3_tx_buffer : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • usart3_tx_buffer_size : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c
  • usart3_tx_counter : project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c
  • usart3_tx_dma_status : project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c
  • usart_group_struct : bootloader/inc/usart.h, bootloader/src/usart.c
  • usb_buffer : project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c, project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c
  • usbh_hid : usbh_hid_class.c
  • usbh_msc : usbh_msc_class.c, usbh_msc_class.h
  • usbh_user_handle : hid_demo/inc/usbh_user.h, hid_demo/src/usbh_user.c, msc_only_fat32/inc/usbh_user.h, msc_only_fat32/src/usbh_user.c


AT32F415 Firmwary Library: Globals

- v -

  • variables : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • variables_addr : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • variables_bit_val : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • vmor_flag_index : project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c, project/at_start_f415/examples/adc/voltage_monitoring/src/main.c
  • vp_desc : audio_desc.c, audio_hid_desc.c, cdc_desc.c, cdc_keyboard_desc.c, custom_hid_desc.c, hid_iap_desc.c, keyboard_desc.c, mouse_desc.c, msc_desc.c, printer_desc.c


AT32F415 Firmwary Library: Globals

- w -

  • work : project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c


AT32F415 Firmwary Library: Globals

- x -

  • x_pos : usbh_hid_mouse.c


AT32F415 Firmwary Library: Globals

- y -

  • y_pos : usbh_hid_mouse.c


AT32F415 Firmwary Library: Globals

- i -

  • iapfun : bootloader/inc/iap.h
  • INT16 : at32f415.h
  • INT32 : at32f415.h
  • INT8 : at32f415.h
  • IRQn_Type : at32f415.h

- s -

  • s16 : at32f415.h
  • s32 : at32f415.h
  • s8 : at32f415.h
  • sc16 : at32f415.h
  • sc32 : at32f415.h
  • sc8 : at32f415.h

- u -

  • u16 : at32f415.h
  • u32 : at32f415.h
  • u8 : at32f415.h
  • uc16 : at32f415.h
  • uc32 : at32f415.h
  • uc8 : at32f415.h
  • UINT16 : at32f415.h
  • UINT32 : at32f415.h
  • UINT8 : at32f415.h
  • usb_reg_type : at32f415_usb.h

- v -

  • vs16 : at32f415.h
  • vs32 : at32f415.h
  • vs8 : at32f415.h
  • vsc16 : at32f415.h
  • vsc32 : at32f415.h
  • vsc8 : at32f415.h
  • vu16 : at32f415.h
  • vu32 : at32f415.h
  • vu8 : at32f415.h
  • vuc16 : at32f415.h
  • vuc32 : at32f415.h
  • vuc8 : at32f415.h


AT32F415 Firmwary Library: Globals

- a -

  • adc_channel_select_type : at32f415_adc.h
  • adc_combine_mode_type : at32f415_adc.h
  • adc_data_align_type : at32f415_adc.h
  • adc_ordinary_trig_select_type : at32f415_adc.h
  • adc_preempt_channel_type : at32f415_adc.h
  • adc_preempt_trig_select_type : at32f415_adc.h
  • adc_sampletime_select_type : at32f415_adc.h
  • adc_voltage_monitoring_type : at32f415_adc.h


AT32F415 Firmwary Library: Globals

- b -

  • button_type : at32f415_board.h


AT32F415 Firmwary Library: Globals

- c -

  • can_bts1_type : at32f415_can.h
  • can_bts2_type : at32f415_can.h
  • can_enter_doze_status_type : at32f415_can.h
  • can_error_record_type : at32f415_can.h
  • can_filter_bit_width_type : at32f415_can.h
  • can_filter_fifo_type : at32f415_can.h
  • can_filter_mode_type : at32f415_can.h
  • can_identifier_type : at32f415_can.h
  • can_mode_type : at32f415_can.h
  • can_msg_discarding_rule_type : at32f415_can.h
  • can_msg_sending_rule_type : at32f415_can.h
  • can_operating_mode_type : at32f415_can.h
  • can_quit_doze_status_type : at32f415_can.h
  • can_rsaw_type : at32f415_can.h
  • can_rx_fifo_num_type : at32f415_can.h
  • can_trans_frame_type : at32f415_can.h
  • can_transmit_status_type : at32f415_can.h
  • can_tx_mailbox_num_type : at32f415_can.h
  • cmd_ctr_step_type : bootloader/inc/iap.h
  • cmd_data_step_type : bootloader/inc/iap.h
  • cmp_hysteresis_type : at32f415_cmp.h
  • cmp_inverting_type : at32f415_cmp.h
  • cmp_non_inverting_type : at32f415_cmp.h
  • cmp_output_type : at32f415_cmp.h
  • cmp_polarity_type : at32f415_cmp.h
  • cmp_sel_type : at32f415_cmp.h
  • cmp_speed_type : at32f415_cmp.h
  • confirm_state : at32f415.h
  • crc_reverse_input_type : at32f415_crc.h
  • crc_reverse_output_type : at32f415_crc.h
  • crm_adc_div_type : at32f415_crm.h
  • crm_ahb_div_type : at32f415_crm.h
  • crm_apb1_div_type : at32f415_crm.h
  • crm_apb2_div_type : at32f415_crm.h
  • crm_auto_step_mode_type : at32f415_crm.h
  • crm_clkout_div_type : at32f415_crm.h
  • crm_clkout_select_type : at32f415_crm.h
  • crm_clock_source_type : at32f415_crm.h
  • crm_ertc_clock_type : at32f415_crm.h
  • crm_hick_div_6_type : at32f415_crm.h
  • crm_hick_sclk_frequency_type : at32f415_crm.h
  • crm_periph_clock_sleepmd_type : at32f415_crm.h
  • crm_periph_clock_type : at32f415_crm.h
  • crm_periph_reset_type : at32f415_crm.h
  • crm_pll_clock_source_type : at32f415_crm.h
  • crm_pll_fr_type : at32f415_crm.h
  • crm_pll_fref_type : at32f415_crm.h
  • crm_pll_mult_type : at32f415_crm.h
  • crm_sclk_type : at32f415_crm.h
  • crm_usb_clock_source_type : at32f415_crm.h
  • crm_usb_div_type : at32f415_crm.h


AT32F415 Firmwary Library: Globals

- d -

  • dcfg_perfrint_type : at32f415_usb.h
  • dma_dir_type : at32f415_dma.h
  • dma_flexible_request_type : at32f415_dma.h
  • dma_memory_data_size_type : at32f415_dma.h
  • dma_memory_inc_type : at32f415_dma.h
  • dma_peripheral_data_size_type : at32f415_dma.h
  • dma_peripheral_inc_type : at32f415_dma.h
  • dma_priority_level_type : at32f415_dma.h


AT32F415 Firmwary Library: Globals

- e -

  • endpoint_dir_type : at32f415_usb.h
  • endpoint_trans_type : at32f415_usb.h
  • error_status : at32f415.h
  • ertc_alarm_sbs_mask_type : at32f415_ertc.h
  • ertc_alarm_type : at32f415_ertc.h
  • ertc_am_pm_type : at32f415_ertc.h
  • ertc_cal_direction_type : at32f415_ertc.h
  • ertc_cal_output_select_type : at32f415_ertc.h
  • ertc_dst_operation_type : at32f415_ertc.h
  • ertc_dst_save_type : at32f415_ertc.h
  • ertc_dt_type : at32f415_ertc.h
  • ertc_hour_mode_set_type : at32f415_ertc.h
  • ertc_output_polarity_type : at32f415_ertc.h
  • ertc_output_source_type : at32f415_ertc.h
  • ertc_output_type : at32f415_ertc.h
  • ertc_pin_select_type : at32f415_ertc.h
  • ertc_smooth_cal_clk_add_type : at32f415_ertc.h
  • ertc_smooth_cal_period_type : at32f415_ertc.h
  • ertc_tamper_detect_freq_type : at32f415_ertc.h
  • ertc_tamper_filter_type : at32f415_ertc.h
  • ertc_tamper_precharge_type : at32f415_ertc.h
  • ertc_tamper_select_type : at32f415_ertc.h
  • ertc_tamper_valid_edge_type : at32f415_ertc.h
  • ertc_time_adjust_type : at32f415_ertc.h
  • ertc_timestamp_valid_edge_type : at32f415_ertc.h
  • ertc_wakeup_clock_type : at32f415_ertc.h
  • ertc_week_date_select_type : at32f415_ertc.h
  • exint_line_mode_type : at32f415_exint.h
  • exint_polarity_config_type : at32f415_exint.h


AT32F415 Firmwary Library: Globals

- f -

  • flag_status : at32f415.h
  • flash_status_type : at32f415_flash.h
  • flash_wait_cycle_type : at32f415_flash.h


AT32F415 Firmwary Library: Globals

- g -

  • gpio_drive_type : at32f415_gpio.h
  • gpio_mode_type : at32f415_gpio.h
  • gpio_output_type : at32f415_gpio.h
  • gpio_pins_source_type : at32f415_gpio.h
  • gpio_port_source_type : at32f415_gpio.h
  • gpio_pull_type : at32f415_gpio.h


AT32F415 Firmwary Library: Globals

- i -

  • i2c_address_mode_type : at32f415_i2c.h
  • i2c_direction_type : at32f415_i2c.h
  • i2c_fsmode_duty_cycle_type : at32f415_i2c.h
  • i2c_master_ack_type : at32f415_i2c.h
  • i2c_mode_type : i2c_application.h
  • i2c_pec_position_type : at32f415_i2c.h
  • i2c_smbus_alert_set_type : at32f415_i2c.h
  • i2c_smbus_mode_set_type : at32f415_i2c.h
  • i2c_status_type : i2c_application.h
  • i2s_audio_protocol_type : at32f415_spi.h
  • i2s_audio_sampling_freq_type : at32f415_spi.h
  • i2s_clock_polarity_type : at32f415_spi.h
  • i2s_data_channel_format_type : at32f415_spi.h
  • i2s_operation_mode_type : at32f415_spi.h
  • iap_machine_state_type : hid_iap_class.h
  • iap_result_type : hid_iap_class.h
  • IRQn : at32f415.h


AT32F415 Firmwary Library: Globals

- l -

  • led_type : at32f415_board.h


AT32F415 Firmwary Library: Globals

- m -

  • msc_bot_state_type : usbh_msc_bot_scsi.h
  • msc_cmd_state_type : usbh_msc_bot_scsi.h
  • msc_error_type : usbh_msc_bot_scsi.h
  • msc_state_type : usbh_msc_bot_scsi.h


AT32F415 Firmwary Library: Globals

- n -

  • nvic_lowpower_mode_type : at32f415_misc.h
  • nvic_priority_group_type : at32f415_misc.h


AT32F415 Firmwary Library: Globals

- o -

  • otg_id_type : at32f415_usb.h
  • otg_mode_type : at32f415_usb.h


AT32F415 Firmwary Library: Globals

- p -

  • printer_req_type : printer_class.h
  • pwc_deep_sleep_enter_type : at32f415_pwc.h
  • pwc_pvm_voltage_type : at32f415_pwc.h
  • pwc_regulator_type : at32f415_pwc.h
  • pwc_sleep_enter_type : at32f415_pwc.h


AT32F415 Firmwary Library: Globals

- s -

  • sd_card_state_type : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_data_transfer_mode_type : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_error_status_type : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sd_memory_card_type : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • sdio_block_size_type : at32f415_sdio.h
  • sdio_bus_width_type : at32f415_sdio.h
  • sdio_edge_phase_type : at32f415_sdio.h
  • sdio_power_state_type : at32f415_sdio.h
  • sdio_read_wait_mode_type : at32f415_sdio.h
  • sdio_reponse_type : at32f415_sdio.h
  • sdio_rsp_index_type : at32f415_sdio.h
  • sdio_transfer_direction_type : at32f415_sdio.h
  • sdio_transfer_mode_type : at32f415_sdio.h
  • sdio_wait_type : at32f415_sdio.h
  • spi_clock_phase_type : at32f415_spi.h
  • spi_clock_polarity_type : at32f415_spi.h
  • spi_crc_direction_type : at32f415_spi.h
  • spi_cs_mode_type : at32f415_spi.h
  • spi_first_bit_type : at32f415_spi.h
  • spi_frame_bit_num_type : at32f415_spi.h
  • spi_half_duplex_direction_type : at32f415_spi.h
  • spi_master_slave_mode_type : at32f415_spi.h
  • spi_mclk_freq_div_type : at32f415_spi.h
  • spi_software_cs_level_type : at32f415_spi.h
  • spi_transmission_mode_type : at32f415_spi.h
  • sub_tmr_input_sel_type : at32f415_tmr.h
  • systick_clock_source_type : at32f415_misc.h


AT32F415 Firmwary Library: Globals

- t -

  • tmr_brk_polarity_type : at32f415_tmr.h
  • tmr_channel1_input_connected_type : at32f415_tmr.h
  • tmr_channel_input_divider_type : at32f415_tmr.h
  • tmr_channel_select_type : at32f415_tmr.h
  • tmr_clock_division_type : at32f415_tmr.h
  • tmr_count_mode_type : at32f415_tmr.h
  • tmr_dma_address_type : at32f415_tmr.h
  • tmr_dma_request_source_type : at32f415_tmr.h
  • tmr_dma_request_type : at32f415_tmr.h
  • tmr_dma_transfer_length_type : at32f415_tmr.h
  • tmr_encoder_mode_type : at32f415_tmr.h
  • tmr_event_trigger_type : at32f415_tmr.h
  • tmr_external_signal_divider_type : at32f415_tmr.h
  • tmr_external_signal_polarity_type : at32f415_tmr.h
  • tmr_force_output_type : at32f415_tmr.h
  • tmr_input_direction_mapped_type : at32f415_tmr.h
  • tmr_input_polarity_type : at32f415_tmr.h
  • tmr_output_control_mode_type : at32f415_tmr.h
  • tmr_output_polarity_type : at32f415_tmr.h
  • tmr_polarity_active_type : at32f415_tmr.h
  • tmr_primary_select_type : at32f415_tmr.h
  • tmr_sub_mode_select_type : at32f415_tmr.h
  • tmr_wp_level_type : at32f415_tmr.h


AT32F415 Firmwary Library: Globals

- u -

  • update_status_type : bootloader/inc/iap.h
  • upgrade_status_type : flash_fat16.h
  • usart_break_bit_num_type : at32f415_usart.h
  • usart_clock_phase_type : at32f415_usart.h
  • usart_clock_polarity_type : at32f415_usart.h
  • usart_data_bit_num_type : at32f415_usart.h
  • usart_hardware_flow_control_type : at32f415_usart.h
  • usart_lbcp_type : at32f415_usart.h
  • usart_parity_selection_type : at32f415_usart.h
  • usart_stop_bit_num_type : at32f415_usart.h
  • usart_wakeup_mode_type : at32f415_usart.h
  • usb_clk48_s : at32f415_usb.h
  • usb_endpoint_number_type : at32f415_usb.h
  • usb_hid_ctrl_state_type : usbh_hid_class.h
  • usb_hid_state_type : usbh_hid_class.h
  • usb_speed_type : usb_core.h
  • usb_sts_type : usb_std.h
  • usbd_conn_state : usb_std.h
  • usbh_msc_ctrl_state_type : usbh_msc_class.h


AT32F415 Firmwary Library: Globals

- w -

  • wdt_cmd_value_type : at32f415_wdt.h
  • wdt_division_type : at32f415_wdt.h
  • wwdt_division_type : at32f415_wwdt.h


AT32F415 Firmwary Library: Globals

- a -

  • ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_SOFTWARE : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR1CH1 : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR1CH2 : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR1CH3 : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR1TRGOUT : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR2CH2 : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR3TRGOUT : at32f415_adc.h
  • ADC12_ORDINARY_TRIG_TMR4CH4 : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4 : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_SOFTWARE : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR1CH1 : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR1CH4 : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR1TRGOUT : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR2CH1 : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR2TRGOUT : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR3CH4 : at32f415_adc.h
  • ADC12_PREEMPT_TRIG_TMR4TRGOUT : at32f415_adc.h
  • ADC1_IRQn : at32f415.h
  • ADC_CHANNEL_0 : at32f415_adc.h
  • ADC_CHANNEL_1 : at32f415_adc.h
  • ADC_CHANNEL_10 : at32f415_adc.h
  • ADC_CHANNEL_11 : at32f415_adc.h
  • ADC_CHANNEL_12 : at32f415_adc.h
  • ADC_CHANNEL_13 : at32f415_adc.h
  • ADC_CHANNEL_14 : at32f415_adc.h
  • ADC_CHANNEL_15 : at32f415_adc.h
  • ADC_CHANNEL_16 : at32f415_adc.h
  • ADC_CHANNEL_17 : at32f415_adc.h
  • ADC_CHANNEL_2 : at32f415_adc.h
  • ADC_CHANNEL_3 : at32f415_adc.h
  • ADC_CHANNEL_4 : at32f415_adc.h
  • ADC_CHANNEL_5 : at32f415_adc.h
  • ADC_CHANNEL_6 : at32f415_adc.h
  • ADC_CHANNEL_7 : at32f415_adc.h
  • ADC_CHANNEL_8 : at32f415_adc.h
  • ADC_CHANNEL_9 : at32f415_adc.h
  • ADC_INDEPENDENT_MODE : at32f415_adc.h
  • ADC_LEFT_ALIGNMENT : at32f415_adc.h
  • ADC_ORDINARY_LONGSHIFT_ONLY_MODE : at32f415_adc.h
  • ADC_ORDINARY_LONGSHIFT_PREEMPT_SMLT_MODE : at32f415_adc.h
  • ADC_ORDINARY_SHORTSHIFT_ONLY_MODE : at32f415_adc.h
  • ADC_ORDINARY_SHORTSHIFT_PREEMPT_SMLT_MODE : at32f415_adc.h
  • ADC_ORDINARY_SMLT_ONLY_MODE : at32f415_adc.h
  • ADC_ORDINARY_SMLT_PREEMPT_INTERLTRIG_MODE : at32f415_adc.h
  • ADC_ORDINARY_SMLT_PREEMPT_SMLT_MODE : at32f415_adc.h
  • ADC_PREEMPT_CHANNEL_1 : at32f415_adc.h
  • ADC_PREEMPT_CHANNEL_2 : at32f415_adc.h
  • ADC_PREEMPT_CHANNEL_3 : at32f415_adc.h
  • ADC_PREEMPT_CHANNEL_4 : at32f415_adc.h
  • ADC_PREEMPT_INTERLTRIG_ONLY_MODE : at32f415_adc.h
  • ADC_PREEMPT_SMLT_ONLY_MODE : at32f415_adc.h
  • ADC_RIGHT_ALIGNMENT : at32f415_adc.h
  • ADC_SAMPLETIME_13_5 : at32f415_adc.h
  • ADC_SAMPLETIME_1_5 : at32f415_adc.h
  • ADC_SAMPLETIME_239_5 : at32f415_adc.h
  • ADC_SAMPLETIME_28_5 : at32f415_adc.h
  • ADC_SAMPLETIME_41_5 : at32f415_adc.h
  • ADC_SAMPLETIME_55_5 : at32f415_adc.h
  • ADC_SAMPLETIME_71_5 : at32f415_adc.h
  • ADC_SAMPLETIME_7_5 : at32f415_adc.h
  • ADC_VMONITOR_ALL_ORDINARY : at32f415_adc.h
  • ADC_VMONITOR_ALL_ORDINARY_PREEMPT : at32f415_adc.h
  • ADC_VMONITOR_ALL_PREEMPT : at32f415_adc.h
  • ADC_VMONITOR_NONE : at32f415_adc.h
  • ADC_VMONITOR_SINGLE_ORDINARY : at32f415_adc.h
  • ADC_VMONITOR_SINGLE_ORDINARY_PREEMPT : at32f415_adc.h
  • ADC_VMONITOR_SINGLE_PREEMPT : at32f415_adc.h


AT32F415 Firmwary Library: Globals

- b -

  • BOT_STATE_COMPLETE : usbh_msc_bot_scsi.h
  • BOT_STATE_DATA_IN : usbh_msc_bot_scsi.h
  • BOT_STATE_DATA_IN_WAIT : usbh_msc_bot_scsi.h
  • BOT_STATE_DATA_OUT : usbh_msc_bot_scsi.h
  • BOT_STATE_DATA_OUT_WAIT : usbh_msc_bot_scsi.h
  • BOT_STATE_ERROR : usbh_msc_bot_scsi.h
  • BOT_STATE_IDLE : usbh_msc_bot_scsi.h
  • BOT_STATE_RECV_CSW : usbh_msc_bot_scsi.h
  • BOT_STATE_RECV_CSW_WAIT : usbh_msc_bot_scsi.h
  • BOT_STATE_SEND_CBW : usbh_msc_bot_scsi.h
  • BOT_STATE_SEND_CBW_WAIT : usbh_msc_bot_scsi.h
  • BusFault_IRQn : at32f415.h


AT32F415 Firmwary Library: Globals

- c -

  • CAN1_RX0_IRQn : at32f415.h
  • CAN1_RX1_IRQn : at32f415.h
  • CAN1_SE_IRQn : at32f415.h
  • CAN1_TX_IRQn : at32f415.h
  • CAN_BTS1_10TQ : at32f415_can.h
  • CAN_BTS1_11TQ : at32f415_can.h
  • CAN_BTS1_12TQ : at32f415_can.h
  • CAN_BTS1_13TQ : at32f415_can.h
  • CAN_BTS1_14TQ : at32f415_can.h
  • CAN_BTS1_15TQ : at32f415_can.h
  • CAN_BTS1_16TQ : at32f415_can.h
  • CAN_BTS1_1TQ : at32f415_can.h
  • CAN_BTS1_2TQ : at32f415_can.h
  • CAN_BTS1_3TQ : at32f415_can.h
  • CAN_BTS1_4TQ : at32f415_can.h
  • CAN_BTS1_5TQ : at32f415_can.h
  • CAN_BTS1_6TQ : at32f415_can.h
  • CAN_BTS1_7TQ : at32f415_can.h
  • CAN_BTS1_8TQ : at32f415_can.h
  • CAN_BTS1_9TQ : at32f415_can.h
  • CAN_BTS2_1TQ : at32f415_can.h
  • CAN_BTS2_2TQ : at32f415_can.h
  • CAN_BTS2_3TQ : at32f415_can.h
  • CAN_BTS2_4TQ : at32f415_can.h
  • CAN_BTS2_5TQ : at32f415_can.h
  • CAN_BTS2_6TQ : at32f415_can.h
  • CAN_BTS2_7TQ : at32f415_can.h
  • CAN_BTS2_8TQ : at32f415_can.h
  • CAN_DISCARDING_FIRST_RECEIVED : at32f415_can.h
  • CAN_DISCARDING_LAST_RECEIVED : at32f415_can.h
  • CAN_ENTER_DOZE_FAILED : at32f415_can.h
  • CAN_ENTER_DOZE_SUCCESSFUL : at32f415_can.h
  • CAN_ERRORRECORD_ACKERR : at32f415_can.h
  • CAN_ERRORRECORD_BITDOMINANTERR : at32f415_can.h
  • CAN_ERRORRECORD_BITRECESSIVEERR : at32f415_can.h
  • CAN_ERRORRECORD_CRCERR : at32f415_can.h
  • CAN_ERRORRECORD_FORMERR : at32f415_can.h
  • CAN_ERRORRECORD_NOERR : at32f415_can.h
  • CAN_ERRORRECORD_SOFTWARESETERR : at32f415_can.h
  • CAN_ERRORRECORD_STUFFERR : at32f415_can.h
  • CAN_FILTER_16BIT : at32f415_can.h
  • CAN_FILTER_32BIT : at32f415_can.h
  • CAN_FILTER_FIFO0 : at32f415_can.h
  • CAN_FILTER_FIFO1 : at32f415_can.h
  • CAN_FILTER_MODE_ID_LIST : at32f415_can.h
  • CAN_FILTER_MODE_ID_MASK : at32f415_can.h
  • CAN_ID_EXTENDED : at32f415_can.h
  • CAN_ID_STANDARD : at32f415_can.h
  • CAN_MODE_COMMUNICATE : at32f415_can.h
  • CAN_MODE_LISTENONLY : at32f415_can.h
  • CAN_MODE_LISTENONLY_LOOPBACK : at32f415_can.h
  • CAN_MODE_LOOPBACK : at32f415_can.h
  • CAN_OPERATINGMODE_COMMUNICATE : at32f415_can.h
  • CAN_OPERATINGMODE_DOZE : at32f415_can.h
  • CAN_OPERATINGMODE_FREEZE : at32f415_can.h
  • CAN_QUIT_DOZE_FAILED : at32f415_can.h
  • CAN_QUIT_DOZE_SUCCESSFUL : at32f415_can.h
  • CAN_RSAW_1TQ : at32f415_can.h
  • CAN_RSAW_2TQ : at32f415_can.h
  • CAN_RSAW_3TQ : at32f415_can.h
  • CAN_RSAW_4TQ : at32f415_can.h
  • CAN_RX_FIFO0 : at32f415_can.h
  • CAN_RX_FIFO1 : at32f415_can.h
  • CAN_SENDING_BY_ID : at32f415_can.h
  • CAN_SENDING_BY_REQUEST : at32f415_can.h
  • CAN_TFT_DATA : at32f415_can.h
  • CAN_TFT_REMOTE : at32f415_can.h
  • CAN_TX_MAILBOX0 : at32f415_can.h
  • CAN_TX_MAILBOX1 : at32f415_can.h
  • CAN_TX_MAILBOX2 : at32f415_can.h
  • CAN_TX_STATUS_FAILED : at32f415_can.h
  • CAN_TX_STATUS_NO_EMPTY : at32f415_can.h
  • CAN_TX_STATUS_PENDING : at32f415_can.h
  • CAN_TX_STATUS_SUCCESSFUL : at32f415_can.h
  • CMD_CTR_APP : bootloader/inc/iap.h
  • CMD_CTR_DONE : bootloader/inc/iap.h
  • CMD_CTR_ERR : bootloader/inc/iap.h
  • CMD_CTR_IDLE : bootloader/inc/iap.h
  • CMD_CTR_INIT : bootloader/inc/iap.h
  • CMD_DATA_ADDR : bootloader/inc/iap.h
  • CMD_DATA_BUF : bootloader/inc/iap.h
  • CMD_DATA_CHACK : bootloader/inc/iap.h
  • CMD_DATA_DONE : bootloader/inc/iap.h
  • CMD_DATA_ERR : bootloader/inc/iap.h
  • CMD_DATA_IDLE : bootloader/inc/iap.h
  • CMD_STATE_SEND : usbh_msc_bot_scsi.h
  • CMD_STATE_WAIT : usbh_msc_bot_scsi.h
  • CMP1_IRQn : at32f415.h
  • CMP1_SELECTION : at32f415_cmp.h
  • CMP2_IRQn : at32f415.h
  • CMP2_SELECTION : at32f415_cmp.h
  • CMP_HYSTERESIS_HIGH : at32f415_cmp.h
  • CMP_HYSTERESIS_LOW : at32f415_cmp.h
  • CMP_HYSTERESIS_MEDIUM : at32f415_cmp.h
  • CMP_HYSTERESIS_NONE : at32f415_cmp.h
  • CMP_INVERTING_1_2VREFINT : at32f415_cmp.h
  • CMP_INVERTING_1_4VREFINT : at32f415_cmp.h
  • CMP_INVERTING_3_4VREFINT : at32f415_cmp.h
  • CMP_INVERTING_PA0 : at32f415_cmp.h
  • CMP_INVERTING_PA2 : at32f415_cmp.h
  • CMP_INVERTING_PA4 : at32f415_cmp.h
  • CMP_INVERTING_PA5 : at32f415_cmp.h
  • CMP_INVERTING_VREFINT : at32f415_cmp.h
  • CMP_NON_INVERTING_PA0 : at32f415_cmp.h
  • CMP_NON_INVERTING_PA1 : at32f415_cmp.h
  • CMP_NON_INVERTING_PA5 : at32f415_cmp.h
  • CMP_NON_INVERTING_VSSA : at32f415_cmp.h
  • CMP_OUTPUT_NONE : at32f415_cmp.h
  • CMP_OUTPUT_TMR1BRK : at32f415_cmp.h
  • CMP_OUTPUT_TMR1CH1 : at32f415_cmp.h
  • CMP_OUTPUT_TMR1CHCLR : at32f415_cmp.h
  • CMP_OUTPUT_TMR2CH4 : at32f415_cmp.h
  • CMP_OUTPUT_TMR2CHCLR : at32f415_cmp.h
  • CMP_OUTPUT_TMR3CH1 : at32f415_cmp.h
  • CMP_OUTPUT_TMR3CHCLR : at32f415_cmp.h
  • CMP_POL_INVERTING : at32f415_cmp.h
  • CMP_POL_NON_INVERTING : at32f415_cmp.h
  • CMP_SPEED_FAST : at32f415_cmp.h
  • CMP_SPEED_MEDIUM : at32f415_cmp.h
  • CMP_SPEED_SLOW : at32f415_cmp.h
  • CMP_SPEED_ULTRALOW : at32f415_cmp.h
  • CRC_REVERSE_INPUT_BY_BYTE : at32f415_crc.h
  • CRC_REVERSE_INPUT_BY_HALFWORD : at32f415_crc.h
  • CRC_REVERSE_INPUT_BY_WORD : at32f415_crc.h
  • CRC_REVERSE_INPUT_NO_AFFECTE : at32f415_crc.h
  • CRC_REVERSE_OUTPUT_DATA : at32f415_crc.h
  • CRC_REVERSE_OUTPUT_NO_AFFECTE : at32f415_crc.h
  • CRM_ADC1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_ADC1_PERIPH_RESET : at32f415_crm.h
  • CRM_ADC_DIV_12 : at32f415_crm.h
  • CRM_ADC_DIV_16 : at32f415_crm.h
  • CRM_ADC_DIV_2 : at32f415_crm.h
  • CRM_ADC_DIV_4 : at32f415_crm.h
  • CRM_ADC_DIV_6 : at32f415_crm.h
  • CRM_ADC_DIV_8 : at32f415_crm.h
  • CRM_AHB_DIV_1 : at32f415_crm.h
  • CRM_AHB_DIV_128 : at32f415_crm.h
  • CRM_AHB_DIV_16 : at32f415_crm.h
  • CRM_AHB_DIV_2 : at32f415_crm.h
  • CRM_AHB_DIV_256 : at32f415_crm.h
  • CRM_AHB_DIV_4 : at32f415_crm.h
  • CRM_AHB_DIV_512 : at32f415_crm.h
  • CRM_AHB_DIV_64 : at32f415_crm.h
  • CRM_AHB_DIV_8 : at32f415_crm.h
  • CRM_APB1_DIV_1 : at32f415_crm.h
  • CRM_APB1_DIV_16 : at32f415_crm.h
  • CRM_APB1_DIV_2 : at32f415_crm.h
  • CRM_APB1_DIV_4 : at32f415_crm.h
  • CRM_APB1_DIV_8 : at32f415_crm.h
  • CRM_APB2_DIV_1 : at32f415_crm.h
  • CRM_APB2_DIV_16 : at32f415_crm.h
  • CRM_APB2_DIV_2 : at32f415_crm.h
  • CRM_APB2_DIV_4 : at32f415_crm.h
  • CRM_APB2_DIV_8 : at32f415_crm.h
  • CRM_AUTO_STEP_MODE_DISABLE : at32f415_crm.h
  • CRM_AUTO_STEP_MODE_ENABLE : at32f415_crm.h
  • CRM_CAN1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_CAN1_PERIPH_RESET : at32f415_crm.h
  • CRM_CLKOUT_ADC : at32f415_crm.h
  • CRM_CLKOUT_DIV_1 : at32f415_crm.h
  • CRM_CLKOUT_DIV_128 : at32f415_crm.h
  • CRM_CLKOUT_DIV_16 : at32f415_crm.h
  • CRM_CLKOUT_DIV_2 : at32f415_crm.h
  • CRM_CLKOUT_DIV_256 : at32f415_crm.h
  • CRM_CLKOUT_DIV_4 : at32f415_crm.h
  • CRM_CLKOUT_DIV_512 : at32f415_crm.h
  • CRM_CLKOUT_DIV_64 : at32f415_crm.h
  • CRM_CLKOUT_DIV_8 : at32f415_crm.h
  • CRM_CLKOUT_HEXT : at32f415_crm.h
  • CRM_CLKOUT_HICK : at32f415_crm.h
  • CRM_CLKOUT_LEXT : at32f415_crm.h
  • CRM_CLKOUT_LICK : at32f415_crm.h
  • CRM_CLKOUT_NOCLK : at32f415_crm.h
  • CRM_CLKOUT_PLL_DIV_2 : at32f415_crm.h
  • CRM_CLKOUT_PLL_DIV_4 : at32f415_crm.h
  • CRM_CLKOUT_SCLK : at32f415_crm.h
  • CRM_CLKOUT_USB : at32f415_crm.h
  • CRM_CLOCK_SOURCE_HEXT : at32f415_crm.h
  • CRM_CLOCK_SOURCE_HICK : at32f415_crm.h
  • CRM_CLOCK_SOURCE_LEXT : at32f415_crm.h
  • CRM_CLOCK_SOURCE_LICK : at32f415_crm.h
  • CRM_CLOCK_SOURCE_PLL : at32f415_crm.h
  • CRM_CMP_PERIPH_CLOCK : at32f415_crm.h
  • CRM_CMP_PERIPH_RESET : at32f415_crm.h
  • CRM_CRC_PERIPH_CLOCK : at32f415_crm.h
  • CRM_DMA1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_DMA2_PERIPH_CLOCK : at32f415_crm.h
  • CRM_ERTC_CLOCK_HEXT_DIV : at32f415_crm.h
  • CRM_ERTC_CLOCK_LEXT : at32f415_crm.h
  • CRM_ERTC_CLOCK_LICK : at32f415_crm.h
  • CRM_ERTC_CLOCK_NOCLK : at32f415_crm.h
  • CRM_EXINT_PERIPH_RESET : at32f415_crm.h
  • CRM_FLASH_PERIPH_CLOCK_SLEEP_MODE : at32f415_crm.h
  • CRM_GPIOA_PERIPH_CLOCK : at32f415_crm.h
  • CRM_GPIOA_PERIPH_RESET : at32f415_crm.h
  • CRM_GPIOB_PERIPH_CLOCK : at32f415_crm.h
  • CRM_GPIOB_PERIPH_RESET : at32f415_crm.h
  • CRM_GPIOC_PERIPH_CLOCK : at32f415_crm.h
  • CRM_GPIOC_PERIPH_RESET : at32f415_crm.h
  • CRM_GPIOD_PERIPH_CLOCK : at32f415_crm.h
  • CRM_GPIOD_PERIPH_RESET : at32f415_crm.h
  • CRM_GPIOF_PERIPH_CLOCK : at32f415_crm.h
  • CRM_GPIOF_PERIPH_RESET : at32f415_crm.h
  • CRM_HICK48_DIV6 : at32f415_crm.h
  • CRM_HICK48_NODIV : at32f415_crm.h
  • CRM_HICK_SCLK_48MHZ : at32f415_crm.h
  • CRM_HICK_SCLK_8MHZ : at32f415_crm.h
  • CRM_I2C1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_I2C1_PERIPH_RESET : at32f415_crm.h
  • CRM_I2C2_PERIPH_CLOCK : at32f415_crm.h
  • CRM_I2C2_PERIPH_RESET : at32f415_crm.h
  • CRM_IOMUX_PERIPH_CLOCK : at32f415_crm.h
  • CRM_IOMUX_PERIPH_RESET : at32f415_crm.h
  • CRM_IRQn : at32f415.h
  • CRM_OTGFS1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_OTGFS1_PERIPH_RESET : at32f415_crm.h
  • CRM_PLL_FR_1 : at32f415_crm.h
  • CRM_PLL_FR_16 : at32f415_crm.h
  • CRM_PLL_FR_2 : at32f415_crm.h
  • CRM_PLL_FR_32 : at32f415_crm.h
  • CRM_PLL_FR_4 : at32f415_crm.h
  • CRM_PLL_FR_8 : at32f415_crm.h
  • CRM_PLL_FREF_12M : at32f415_crm.h
  • CRM_PLL_FREF_16M : at32f415_crm.h
  • CRM_PLL_FREF_25M : at32f415_crm.h
  • CRM_PLL_FREF_4M : at32f415_crm.h
  • CRM_PLL_FREF_6M : at32f415_crm.h
  • CRM_PLL_FREF_8M : at32f415_crm.h
  • CRM_PLL_MULT_10 : at32f415_crm.h
  • CRM_PLL_MULT_11 : at32f415_crm.h
  • CRM_PLL_MULT_12 : at32f415_crm.h
  • CRM_PLL_MULT_13 : at32f415_crm.h
  • CRM_PLL_MULT_14 : at32f415_crm.h
  • CRM_PLL_MULT_15 : at32f415_crm.h
  • CRM_PLL_MULT_16 : at32f415_crm.h
  • CRM_PLL_MULT_17 : at32f415_crm.h
  • CRM_PLL_MULT_18 : at32f415_crm.h
  • CRM_PLL_MULT_19 : at32f415_crm.h
  • CRM_PLL_MULT_2 : at32f415_crm.h
  • CRM_PLL_MULT_20 : at32f415_crm.h
  • CRM_PLL_MULT_21 : at32f415_crm.h
  • CRM_PLL_MULT_22 : at32f415_crm.h
  • CRM_PLL_MULT_23 : at32f415_crm.h
  • CRM_PLL_MULT_24 : at32f415_crm.h
  • CRM_PLL_MULT_25 : at32f415_crm.h
  • CRM_PLL_MULT_26 : at32f415_crm.h
  • CRM_PLL_MULT_27 : at32f415_crm.h
  • CRM_PLL_MULT_28 : at32f415_crm.h
  • CRM_PLL_MULT_29 : at32f415_crm.h
  • CRM_PLL_MULT_3 : at32f415_crm.h
  • CRM_PLL_MULT_30 : at32f415_crm.h
  • CRM_PLL_MULT_31 : at32f415_crm.h
  • CRM_PLL_MULT_32 : at32f415_crm.h
  • CRM_PLL_MULT_33 : at32f415_crm.h
  • CRM_PLL_MULT_34 : at32f415_crm.h
  • CRM_PLL_MULT_35 : at32f415_crm.h
  • CRM_PLL_MULT_36 : at32f415_crm.h
  • CRM_PLL_MULT_37 : at32f415_crm.h
  • CRM_PLL_MULT_38 : at32f415_crm.h
  • CRM_PLL_MULT_39 : at32f415_crm.h
  • CRM_PLL_MULT_4 : at32f415_crm.h
  • CRM_PLL_MULT_40 : at32f415_crm.h
  • CRM_PLL_MULT_41 : at32f415_crm.h
  • CRM_PLL_MULT_42 : at32f415_crm.h
  • CRM_PLL_MULT_43 : at32f415_crm.h
  • CRM_PLL_MULT_44 : at32f415_crm.h
  • CRM_PLL_MULT_45 : at32f415_crm.h
  • CRM_PLL_MULT_46 : at32f415_crm.h
  • CRM_PLL_MULT_47 : at32f415_crm.h
  • CRM_PLL_MULT_48 : at32f415_crm.h
  • CRM_PLL_MULT_49 : at32f415_crm.h
  • CRM_PLL_MULT_5 : at32f415_crm.h
  • CRM_PLL_MULT_50 : at32f415_crm.h
  • CRM_PLL_MULT_51 : at32f415_crm.h
  • CRM_PLL_MULT_52 : at32f415_crm.h
  • CRM_PLL_MULT_53 : at32f415_crm.h
  • CRM_PLL_MULT_54 : at32f415_crm.h
  • CRM_PLL_MULT_55 : at32f415_crm.h
  • CRM_PLL_MULT_56 : at32f415_crm.h
  • CRM_PLL_MULT_57 : at32f415_crm.h
  • CRM_PLL_MULT_58 : at32f415_crm.h
  • CRM_PLL_MULT_59 : at32f415_crm.h
  • CRM_PLL_MULT_6 : at32f415_crm.h
  • CRM_PLL_MULT_60 : at32f415_crm.h
  • CRM_PLL_MULT_61 : at32f415_crm.h
  • CRM_PLL_MULT_62 : at32f415_crm.h
  • CRM_PLL_MULT_63 : at32f415_crm.h
  • CRM_PLL_MULT_64 : at32f415_crm.h
  • CRM_PLL_MULT_7 : at32f415_crm.h
  • CRM_PLL_MULT_8 : at32f415_crm.h
  • CRM_PLL_MULT_9 : at32f415_crm.h
  • CRM_PLL_SOURCE_HEXT : at32f415_crm.h
  • CRM_PLL_SOURCE_HEXT_DIV : at32f415_crm.h
  • CRM_PLL_SOURCE_HICK : at32f415_crm.h
  • CRM_PWC_PERIPH_CLOCK : at32f415_crm.h
  • CRM_PWC_PERIPH_RESET : at32f415_crm.h
  • CRM_SCLK_HEXT : at32f415_crm.h
  • CRM_SCLK_HICK : at32f415_crm.h
  • CRM_SCLK_PLL : at32f415_crm.h
  • CRM_SDIO1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_SPI1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_SPI1_PERIPH_RESET : at32f415_crm.h
  • CRM_SPI2_PERIPH_CLOCK : at32f415_crm.h
  • CRM_SPI2_PERIPH_RESET : at32f415_crm.h
  • CRM_SRAM_PERIPH_CLOCK_SLEEP_MODE : at32f415_crm.h
  • CRM_TMR10_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR10_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR11_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR11_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR1_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR2_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR2_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR3_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR3_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR4_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR4_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR5_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR5_PERIPH_RESET : at32f415_crm.h
  • CRM_TMR9_PERIPH_CLOCK : at32f415_crm.h
  • CRM_TMR9_PERIPH_RESET : at32f415_crm.h
  • CRM_UART4_PERIPH_CLOCK : at32f415_crm.h
  • CRM_UART4_PERIPH_RESET : at32f415_crm.h
  • CRM_UART5_PERIPH_CLOCK : at32f415_crm.h
  • CRM_UART5_PERIPH_RESET : at32f415_crm.h
  • CRM_USART1_PERIPH_CLOCK : at32f415_crm.h
  • CRM_USART1_PERIPH_RESET : at32f415_crm.h
  • CRM_USART2_PERIPH_CLOCK : at32f415_crm.h
  • CRM_USART2_PERIPH_RESET : at32f415_crm.h
  • CRM_USART3_PERIPH_CLOCK : at32f415_crm.h
  • CRM_USART3_PERIPH_RESET : at32f415_crm.h
  • CRM_USB_CLOCK_SOURCE_HICK : at32f415_crm.h
  • CRM_USB_CLOCK_SOURCE_PLL : at32f415_crm.h
  • CRM_USB_DIV_1 : at32f415_crm.h
  • CRM_USB_DIV_1_5 : at32f415_crm.h
  • CRM_USB_DIV_2 : at32f415_crm.h
  • CRM_USB_DIV_2_5 : at32f415_crm.h
  • CRM_USB_DIV_3 : at32f415_crm.h
  • CRM_USB_DIV_3_5 : at32f415_crm.h
  • CRM_USB_DIV_4 : at32f415_crm.h
  • CRM_WWDT_PERIPH_CLOCK : at32f415_crm.h
  • CRM_WWDT_PERIPH_RESET : at32f415_crm.h


AT32F415 Firmwary Library: Globals

- d -

  • DCFG_PERFRINT_80 : at32f415_usb.h
  • DCFG_PERFRINT_85 : at32f415_usb.h
  • DCFG_PERFRINT_90 : at32f415_usb.h
  • DCFG_PERFRINT_95 : at32f415_usb.h
  • DebugMonitor_IRQn : at32f415.h
  • DMA1_Channel1_IRQn : at32f415.h
  • DMA1_Channel2_IRQn : at32f415.h
  • DMA1_Channel3_IRQn : at32f415.h
  • DMA1_Channel4_IRQn : at32f415.h
  • DMA1_Channel5_IRQn : at32f415.h
  • DMA1_Channel6_IRQn : at32f415.h
  • DMA1_Channel7_IRQn : at32f415.h
  • DMA2_Channel1_IRQn : at32f415.h
  • DMA2_Channel2_IRQn : at32f415.h
  • DMA2_Channel3_IRQn : at32f415.h
  • DMA2_Channel4_5_IRQn : at32f415.h
  • DMA2_Channel6_7_IRQn : at32f415.h
  • DMA_DIR_MEMORY_TO_MEMORY : at32f415_dma.h
  • DMA_DIR_MEMORY_TO_PERIPHERAL : at32f415_dma.h
  • DMA_DIR_PERIPHERAL_TO_MEMORY : at32f415_dma.h
  • DMA_FLEXIBLE_ADC1 : at32f415_dma.h
  • DMA_FLEXIBLE_I2C1_RX : at32f415_dma.h
  • DMA_FLEXIBLE_I2C1_TX : at32f415_dma.h
  • DMA_FLEXIBLE_I2C2_RX : at32f415_dma.h
  • DMA_FLEXIBLE_I2C2_TX : at32f415_dma.h
  • DMA_FLEXIBLE_SDIO1 : at32f415_dma.h
  • DMA_FLEXIBLE_SPI1_RX : at32f415_dma.h
  • DMA_FLEXIBLE_SPI1_TX : at32f415_dma.h
  • DMA_FLEXIBLE_SPI2_RX : at32f415_dma.h
  • DMA_FLEXIBLE_SPI2_TX : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_CH1 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_CH2 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_CH3 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_CH4 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_HALL : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_OVERFLOW : at32f415_dma.h
  • DMA_FLEXIBLE_TMR1_TRIG : at32f415_dma.h
  • DMA_FLEXIBLE_TMR2_CH1 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR2_CH2 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR2_CH3 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR2_CH4 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR2_OVERFLOW : at32f415_dma.h
  • DMA_FLEXIBLE_TMR2_TRIG : at32f415_dma.h
  • DMA_FLEXIBLE_TMR3_CH1 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR3_CH2 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR3_CH3 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR3_CH4 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR3_OVERFLOW : at32f415_dma.h
  • DMA_FLEXIBLE_TMR3_TRIG : at32f415_dma.h
  • DMA_FLEXIBLE_TMR4_CH1 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR4_CH2 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR4_CH3 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR4_CH4 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR4_OVERFLOW : at32f415_dma.h
  • DMA_FLEXIBLE_TMR4_TRIG : at32f415_dma.h
  • DMA_FLEXIBLE_TMR5_CH1 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR5_CH2 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR5_CH3 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR5_CH4 : at32f415_dma.h
  • DMA_FLEXIBLE_TMR5_OVERFLOW : at32f415_dma.h
  • DMA_FLEXIBLE_TMR5_TRIG : at32f415_dma.h
  • DMA_FLEXIBLE_UART1_RX : at32f415_dma.h
  • DMA_FLEXIBLE_UART1_TX : at32f415_dma.h
  • DMA_FLEXIBLE_UART2_RX : at32f415_dma.h
  • DMA_FLEXIBLE_UART2_TX : at32f415_dma.h
  • DMA_FLEXIBLE_UART3_RX : at32f415_dma.h
  • DMA_FLEXIBLE_UART3_TX : at32f415_dma.h
  • DMA_FLEXIBLE_UART4_RX : at32f415_dma.h
  • DMA_FLEXIBLE_UART4_TX : at32f415_dma.h
  • DMA_FLEXIBLE_UART5_RX : at32f415_dma.h
  • DMA_FLEXIBLE_UART5_TX : at32f415_dma.h
  • DMA_MEMORY_DATA_WIDTH_BYTE : at32f415_dma.h
  • DMA_MEMORY_DATA_WIDTH_HALFWORD : at32f415_dma.h
  • DMA_MEMORY_DATA_WIDTH_WORD : at32f415_dma.h
  • DMA_MEMORY_INC_DISABLE : at32f415_dma.h
  • DMA_MEMORY_INC_ENABLE : at32f415_dma.h
  • DMA_PERIPHERAL_DATA_WIDTH_BYTE : at32f415_dma.h
  • DMA_PERIPHERAL_DATA_WIDTH_HALFWORD : at32f415_dma.h
  • DMA_PERIPHERAL_DATA_WIDTH_WORD : at32f415_dma.h
  • DMA_PERIPHERAL_INC_DISABLE : at32f415_dma.h
  • DMA_PERIPHERAL_INC_ENABLE : at32f415_dma.h
  • DMA_PRIORITY_HIGH : at32f415_dma.h
  • DMA_PRIORITY_LOW : at32f415_dma.h
  • DMA_PRIORITY_MEDIUM : at32f415_dma.h
  • DMA_PRIORITY_VERY_HIGH : at32f415_dma.h


AT32F415 Firmwary Library: Globals

- e -

  • EPT_BULK_TYPE : at32f415_usb.h
  • EPT_CONTROL_TYPE : at32f415_usb.h
  • EPT_DIR_IN : at32f415_usb.h
  • EPT_DIR_OUT : at32f415_usb.h
  • EPT_INT_TYPE : at32f415_usb.h
  • EPT_ISO_TYPE : at32f415_usb.h
  • ERROR : at32f415.h
  • ERTC_24H : at32f415_ertc.h
  • ERTC_ALA : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_1 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_10 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_11 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_12 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_13 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_2 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_3 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_4 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_5 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_6 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_7 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_8 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_14_9 : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_ALL : at32f415_ertc.h
  • ERTC_ALARM_SBS_MASK_NONE : at32f415_ertc.h
  • ERTC_ALB : at32f415_ertc.h
  • ERTC_AM : at32f415_ertc.h
  • ERTC_CAL_DIR_NEGATIVE : at32f415_ertc.h
  • ERTC_CAL_DIR_POSITIVE : at32f415_ertc.h
  • ERTC_CAL_OUTPUT_1HZ : at32f415_ertc.h
  • ERTC_CAL_OUTPUT_512HZ : at32f415_ertc.h
  • ERTC_DST_ADD_1H : at32f415_ertc.h
  • ERTC_DST_DEC_1H : at32f415_ertc.h
  • ERTC_DST_SAVE_0 : at32f415_ertc.h
  • ERTC_DST_SAVE_1 : at32f415_ertc.h
  • ERTC_DT1 : at32f415_ertc.h
  • ERTC_DT10 : at32f415_ertc.h
  • ERTC_DT11 : at32f415_ertc.h
  • ERTC_DT12 : at32f415_ertc.h
  • ERTC_DT13 : at32f415_ertc.h
  • ERTC_DT14 : at32f415_ertc.h
  • ERTC_DT15 : at32f415_ertc.h
  • ERTC_DT16 : at32f415_ertc.h
  • ERTC_DT17 : at32f415_ertc.h
  • ERTC_DT18 : at32f415_ertc.h
  • ERTC_DT19 : at32f415_ertc.h
  • ERTC_DT2 : at32f415_ertc.h
  • ERTC_DT20 : at32f415_ertc.h
  • ERTC_DT3 : at32f415_ertc.h
  • ERTC_DT4 : at32f415_ertc.h
  • ERTC_DT5 : at32f415_ertc.h
  • ERTC_DT6 : at32f415_ertc.h
  • ERTC_DT7 : at32f415_ertc.h
  • ERTC_DT8 : at32f415_ertc.h
  • ERTC_DT9 : at32f415_ertc.h
  • ERTC_HOUR_MODE_12 : at32f415_ertc.h
  • ERTC_HOUR_MODE_24 : at32f415_ertc.h
  • ERTC_OUTPUT_ALARM_A : at32f415_ertc.h
  • ERTC_OUTPUT_ALARM_B : at32f415_ertc.h
  • ERTC_OUTPUT_DISABLE : at32f415_ertc.h
  • ERTC_OUTPUT_POLARITY_HIGH : at32f415_ertc.h
  • ERTC_OUTPUT_POLARITY_LOW : at32f415_ertc.h
  • ERTC_OUTPUT_TYPE_OPEN_DRAIN : at32f415_ertc.h
  • ERTC_OUTPUT_TYPE_PUSH_PULL : at32f415_ertc.h
  • ERTC_OUTPUT_WAKEUP : at32f415_ertc.h
  • ERTC_PIN_PA0 : at32f415_ertc.h
  • ERTC_PIN_PC13 : at32f415_ertc.h
  • ERTC_PM : at32f415_ertc.h
  • ERTC_SLECT_DATE : at32f415_ertc.h
  • ERTC_SLECT_WEEK : at32f415_ertc.h
  • ERTC_SMOOTH_CAL_CLK_ADD_0 : at32f415_ertc.h
  • ERTC_SMOOTH_CAL_CLK_ADD_512 : at32f415_ertc.h
  • ERTC_SMOOTH_CAL_PERIOD_16 : at32f415_ertc.h
  • ERTC_SMOOTH_CAL_PERIOD_32 : at32f415_ertc.h
  • ERTC_SMOOTH_CAL_PERIOD_8 : at32f415_ertc.h
  • ERTC_TAMPER_1 : at32f415_ertc.h
  • ERTC_TAMPER_EDGE_FALLING : at32f415_ertc.h
  • ERTC_TAMPER_EDGE_HIGH : at32f415_ertc.h
  • ERTC_TAMPER_EDGE_LOW : at32f415_ertc.h
  • ERTC_TAMPER_EDGE_RISING : at32f415_ertc.h
  • ERTC_TAMPER_FILTER_2 : at32f415_ertc.h
  • ERTC_TAMPER_FILTER_4 : at32f415_ertc.h
  • ERTC_TAMPER_FILTER_8 : at32f415_ertc.h
  • ERTC_TAMPER_FILTER_DISABLE : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_1024 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_16384 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_2048 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_256 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_32768 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_4096 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_512 : at32f415_ertc.h
  • ERTC_TAMPER_FREQ_DIV_8192 : at32f415_ertc.h
  • ERTC_TAMPER_PR_1_ERTCCLK : at32f415_ertc.h
  • ERTC_TAMPER_PR_2_ERTCCLK : at32f415_ertc.h
  • ERTC_TAMPER_PR_4_ERTCCLK : at32f415_ertc.h
  • ERTC_TAMPER_PR_8_ERTCCLK : at32f415_ertc.h
  • ERTC_TIME_ADD_1S : at32f415_ertc.h
  • ERTC_TIME_ADD_NONE : at32f415_ertc.h
  • ERTC_TIMESTAMP_EDGE_FALLING : at32f415_ertc.h
  • ERTC_TIMESTAMP_EDGE_RISING : at32f415_ertc.h
  • ERTC_WAT_CLK_CK_A_16BITS : at32f415_ertc.h
  • ERTC_WAT_CLK_CK_A_17BITS : at32f415_ertc.h
  • ERTC_WAT_CLK_ERTCCLK_DIV16 : at32f415_ertc.h
  • ERTC_WAT_CLK_ERTCCLK_DIV2 : at32f415_ertc.h
  • ERTC_WAT_CLK_ERTCCLK_DIV4 : at32f415_ertc.h
  • ERTC_WAT_CLK_ERTCCLK_DIV8 : at32f415_ertc.h
  • ERTC_WKUP_IRQn : at32f415.h
  • ERTCAlarm_IRQn : at32f415.h
  • EXINT0_IRQn : at32f415.h
  • EXINT15_10_IRQn : at32f415.h
  • EXINT1_IRQn : at32f415.h
  • EXINT2_IRQn : at32f415.h
  • EXINT3_IRQn : at32f415.h
  • EXINT4_IRQn : at32f415.h
  • EXINT9_5_IRQn : at32f415.h
  • EXINT_LINE_EVENT : at32f415_exint.h
  • EXINT_LINE_INTERRUPUT : at32f415_exint.h
  • EXINT_TRIGGER_BOTH_EDGE : at32f415_exint.h
  • EXINT_TRIGGER_FALLING_EDGE : at32f415_exint.h
  • EXINT_TRIGGER_RISING_EDGE : at32f415_exint.h


AT32F415 Firmwary Library: Globals

- f -

  • FALSE : at32f415.h
  • FLASH_EPP_ERROR : at32f415_flash.h
  • FLASH_IRQn : at32f415.h
  • FLASH_OPERATE_BUSY : at32f415_flash.h
  • FLASH_OPERATE_DONE : at32f415_flash.h
  • FLASH_OPERATE_TIMEOUT : at32f415_flash.h
  • FLASH_PROGRAM_ERROR : at32f415_flash.h
  • FLASH_WAIT_CYCLE_0 : at32f415_flash.h
  • FLASH_WAIT_CYCLE_1 : at32f415_flash.h
  • FLASH_WAIT_CYCLE_2 : at32f415_flash.h
  • FLASH_WAIT_CYCLE_3 : at32f415_flash.h
  • FLASH_WAIT_CYCLE_4 : at32f415_flash.h


AT32F415 Firmwary Library: Globals

- g -

  • GPIO_DRIVE_STRENGTH_MAXIMUM : at32f415_gpio.h
  • GPIO_DRIVE_STRENGTH_MODERATE : at32f415_gpio.h
  • GPIO_DRIVE_STRENGTH_STRONGER : at32f415_gpio.h
  • GPIO_MODE_ANALOG : at32f415_gpio.h
  • GPIO_MODE_INPUT : at32f415_gpio.h
  • GPIO_MODE_MUX : at32f415_gpio.h
  • GPIO_MODE_OUTPUT : at32f415_gpio.h
  • GPIO_OUTPUT_OPEN_DRAIN : at32f415_gpio.h
  • GPIO_OUTPUT_PUSH_PULL : at32f415_gpio.h
  • GPIO_PINS_SOURCE0 : at32f415_gpio.h
  • GPIO_PINS_SOURCE1 : at32f415_gpio.h
  • GPIO_PINS_SOURCE10 : at32f415_gpio.h
  • GPIO_PINS_SOURCE11 : at32f415_gpio.h
  • GPIO_PINS_SOURCE12 : at32f415_gpio.h
  • GPIO_PINS_SOURCE13 : at32f415_gpio.h
  • GPIO_PINS_SOURCE14 : at32f415_gpio.h
  • GPIO_PINS_SOURCE15 : at32f415_gpio.h
  • GPIO_PINS_SOURCE2 : at32f415_gpio.h
  • GPIO_PINS_SOURCE3 : at32f415_gpio.h
  • GPIO_PINS_SOURCE4 : at32f415_gpio.h
  • GPIO_PINS_SOURCE5 : at32f415_gpio.h
  • GPIO_PINS_SOURCE6 : at32f415_gpio.h
  • GPIO_PINS_SOURCE7 : at32f415_gpio.h
  • GPIO_PINS_SOURCE8 : at32f415_gpio.h
  • GPIO_PINS_SOURCE9 : at32f415_gpio.h
  • GPIO_PORT_SOURCE_GPIOA : at32f415_gpio.h
  • GPIO_PORT_SOURCE_GPIOB : at32f415_gpio.h
  • GPIO_PORT_SOURCE_GPIOC : at32f415_gpio.h
  • GPIO_PORT_SOURCE_GPIOD : at32f415_gpio.h
  • GPIO_PORT_SOURCE_GPIOF : at32f415_gpio.h
  • GPIO_PULL_DOWN : at32f415_gpio.h
  • GPIO_PULL_NONE : at32f415_gpio.h
  • GPIO_PULL_UP : at32f415_gpio.h


AT32F415 Firmwary Library: Globals

- h -

  • HardFault_IRQn : at32f415.h


AT32F415 Firmwary Library: Globals

- i -

  • I2C1_ERR_IRQn : at32f415.h
  • I2C1_EVT_IRQn : at32f415.h
  • I2C2_ERR_IRQn : at32f415.h
  • I2C2_EVT_IRQn : at32f415.h
  • I2C_ADDRESS_MODE_10BIT : at32f415_i2c.h
  • I2C_ADDRESS_MODE_7BIT : at32f415_i2c.h
  • I2C_DIRECTION_RECEIVE : at32f415_i2c.h
  • I2C_DIRECTION_TRANSMIT : at32f415_i2c.h
  • I2C_DMA_MA_RX : i2c_application.h
  • I2C_DMA_MA_TX : i2c_application.h
  • I2C_DMA_SLA_RX : i2c_application.h
  • I2C_DMA_SLA_TX : i2c_application.h
  • I2C_ERR_ACKFAIL : i2c_application.h
  • I2C_ERR_ADDR : i2c_application.h
  • I2C_ERR_ADDR10 : i2c_application.h
  • I2C_ERR_INTERRUPT : i2c_application.h
  • I2C_ERR_START : i2c_application.h
  • I2C_ERR_STEP_1 : i2c_application.h
  • I2C_ERR_STEP_10 : i2c_application.h
  • I2C_ERR_STEP_11 : i2c_application.h
  • I2C_ERR_STEP_12 : i2c_application.h
  • I2C_ERR_STEP_2 : i2c_application.h
  • I2C_ERR_STEP_3 : i2c_application.h
  • I2C_ERR_STEP_4 : i2c_application.h
  • I2C_ERR_STEP_5 : i2c_application.h
  • I2C_ERR_STEP_6 : i2c_application.h
  • I2C_ERR_STEP_7 : i2c_application.h
  • I2C_ERR_STEP_8 : i2c_application.h
  • I2C_ERR_STEP_9 : i2c_application.h
  • I2C_ERR_STOP : i2c_application.h
  • I2C_ERR_TIMEOUT : i2c_application.h
  • I2C_FSMODE_DUTY_16_9 : at32f415_i2c.h
  • I2C_FSMODE_DUTY_2_1 : at32f415_i2c.h
  • I2C_INT_MA_RX : i2c_application.h
  • I2C_INT_MA_TX : i2c_application.h
  • I2C_INT_SLA_RX : i2c_application.h
  • I2C_INT_SLA_TX : i2c_application.h
  • I2C_MASTER_ACK_CURRENT : at32f415_i2c.h
  • I2C_MASTER_ACK_NEXT : at32f415_i2c.h
  • I2C_OK : i2c_application.h
  • I2C_PEC_POSITION_CURRENT : at32f415_i2c.h
  • I2C_PEC_POSITION_NEXT : at32f415_i2c.h
  • I2C_SMBUS_ALERT_HIGH : at32f415_i2c.h
  • I2C_SMBUS_ALERT_LOW : at32f415_i2c.h
  • I2C_SMBUS_MODE_DEVICE : at32f415_i2c.h
  • I2C_SMBUS_MODE_HOST : at32f415_i2c.h
  • I2S_AUDIO_FREQUENCY_11_025K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_16K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_192K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_22_05K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_32K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_44_1K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_48K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_8K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_96K : at32f415_spi.h
  • I2S_AUDIO_FREQUENCY_DEFAULT : at32f415_spi.h
  • I2S_AUDIO_PROTOCOL_LSB : at32f415_spi.h
  • I2S_AUDIO_PROTOCOL_MSB : at32f415_spi.h
  • I2S_AUDIO_PROTOCOL_PCM_LONG : at32f415_spi.h
  • I2S_AUDIO_PROTOCOL_PCM_SHORT : at32f415_spi.h
  • I2S_AUDIO_PROTOCOL_PHILLIPS : at32f415_spi.h
  • I2S_CLOCK_POLARITY_HIGH : at32f415_spi.h
  • I2S_CLOCK_POLARITY_LOW : at32f415_spi.h
  • I2S_DATA_16BIT_CHANNEL_16BIT : at32f415_spi.h
  • I2S_DATA_16BIT_CHANNEL_32BIT : at32f415_spi.h
  • I2S_DATA_24BIT_CHANNEL_32BIT : at32f415_spi.h
  • I2S_DATA_32BIT_CHANNEL_32BIT : at32f415_spi.h
  • I2S_MODE_MASTER_RX : at32f415_spi.h
  • I2S_MODE_MASTER_TX : at32f415_spi.h
  • I2S_MODE_SLAVE_RX : at32f415_spi.h
  • I2S_MODE_SLAVE_TX : at32f415_spi.h
  • IAP_FAILED : hid_iap_class.h
  • IAP_STS_ADDR : hid_iap_class.h
  • IAP_STS_CRC : hid_iap_class.h
  • IAP_STS_DATA : hid_iap_class.h
  • IAP_STS_FINISH : hid_iap_class.h
  • IAP_STS_IDLE : hid_iap_class.h
  • IAP_STS_JMP : hid_iap_class.h
  • IAP_STS_JMP_WAIT : hid_iap_class.h
  • IAP_STS_START : hid_iap_class.h
  • IAP_SUCCESS : hid_iap_class.h
  • IAP_WAIT : hid_iap_class.h


AT32F415 Firmwary Library: Globals

- l -

  • LED2 : at32f415_board.h
  • LED3 : at32f415_board.h
  • LED4 : at32f415_board.h


AT32F415 Firmwary Library: Globals

- m -

  • MemoryManagement_IRQn : at32f415.h
  • MSC_ERROR : usbh_msc_bot_scsi.h
  • MSC_NOT_READY : usbh_msc_bot_scsi.h
  • MSC_OK : usbh_msc_bot_scsi.h


AT32F415 Firmwary Library: Globals

- n -

  • NO_BUTTON : at32f415_board.h
  • NonMaskableInt_IRQn : at32f415.h
  • NVIC_LP_SEVONPEND : at32f415_misc.h
  • NVIC_LP_SLEEPDEEP : at32f415_misc.h
  • NVIC_LP_SLEEPONEXIT : at32f415_misc.h
  • NVIC_PRIORITY_GROUP_0 : at32f415_misc.h
  • NVIC_PRIORITY_GROUP_1 : at32f415_misc.h
  • NVIC_PRIORITY_GROUP_2 : at32f415_misc.h
  • NVIC_PRIORITY_GROUP_3 : at32f415_misc.h
  • NVIC_PRIORITY_GROUP_4 : at32f415_misc.h


AT32F415 Firmwary Library: Globals

- o -

  • OTG_DEVICE_MODE : at32f415_usb.h
  • OTG_DRD_MODE : at32f415_usb.h
  • OTG_HOST_MODE : at32f415_usb.h
  • OTGFS1_IRQn : at32f415.h
  • OTGFS1_WKUP_IRQn : at32f415.h


AT32F415 Firmwary Library: Globals

- p -

  • PendSV_IRQn : at32f415.h
  • PRINTER_REQ_GET_DEVICE_ID : printer_class.h
  • PRINTER_REQ_GET_PORT_STATUS : printer_class.h
  • PRINTER_REQ_GET_SOFT_RESET : printer_class.h
  • PVM_IRQn : at32f415.h
  • PWC_DEEP_SLEEP_ENTER_WFE : at32f415_pwc.h
  • PWC_DEEP_SLEEP_ENTER_WFI : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V3 : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V4 : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V5 : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V6 : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V7 : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V8 : at32f415_pwc.h
  • PWC_PVM_VOLTAGE_2V9 : at32f415_pwc.h
  • PWC_REGULATOR_LOW_POWER : at32f415_pwc.h
  • PWC_REGULATOR_ON : at32f415_pwc.h
  • PWC_SLEEP_ENTER_WFE : at32f415_pwc.h
  • PWC_SLEEP_ENTER_WFI : at32f415_pwc.h


AT32F415 Firmwary Library: Globals

- r -

  • RESET : at32f415.h
  • Reset_IRQn : at32f415.h


AT32F415 Firmwary Library: Globals

- s -

  • SD_ADDR_MISALIGNED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_ADDR_OUT_OF_RANGE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_AKE_SEQ_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_BLK_LEN_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_CONTROLLER_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_DISCONNECTED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_ECC_DISABLED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_ECC_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_IDENTIFICATION : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_PROGRAMMING : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_READY : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_RECEIVING : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_SENDING : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_STANDBY : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_TRANSFER : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CID_CSD_OVERWRITE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_CRC_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_FAIL : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_OUT_OF_RANGE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_RSP_TIMEOUT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_DATA_FAIL : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_DATA_TIMEOUT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_ERASE_RESET : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_ERASE_SEQ_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_GENERAL_UNKNOWN_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_ILLEGAL_CMD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_INTERNAL_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_INVALID_ERASE_PARAM : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_INVALID_PARAMETER : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_INVALID_VOLTRANGE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_LOCK_UNLOCK_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_NOT_CONFIGURED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_REQ_NOT_APPLICABLE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_REQ_PENDING : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_RX_OVERRUN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_SDIO_DISABLED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_SDIO_FUNC_BUSY : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_SDIO_FUNC_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_SDIO_UNKNOWN_FUNC : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_START_BIT_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_STREAM_RD_UNDERRUN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_STREAM_WR_OVERRUN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_SWITCH_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_TRANSFER_DMA_MODE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_TRANSFER_POLLING_MODE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_TX_UNDERRUN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_UNSUPPORTED_FEATURE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_UNSUPPORTED_HW : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_WP_ERASE_SKIP : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_WR_PROTECT_VIOLATION : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO1_IRQn : at32f415.h
  • SDIO_BUS_WIDTH_D1 : at32f415_sdio.h
  • SDIO_BUS_WIDTH_D4 : at32f415_sdio.h
  • SDIO_BUS_WIDTH_D8 : at32f415_sdio.h
  • SDIO_CLOCK_EDGE_FALLING : at32f415_sdio.h
  • SDIO_CLOCK_EDGE_RISING : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_1024B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_128B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_16384B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_16B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_1B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_2048B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_256B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_2B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_32B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_4096B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_4B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_512B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_64B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_8192B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_SIZE_8B : at32f415_sdio.h
  • SDIO_DATA_BLOCK_TRANSFER : at32f415_sdio.h
  • SDIO_DATA_STREAM_TRANSFER : at32f415_sdio.h
  • SDIO_DATA_TRANSFER_TO_CARD : at32f415_sdio.h
  • SDIO_DATA_TRANSFER_TO_CONTROLLER : at32f415_sdio.h
  • SDIO_HIGH_CAPACITY_MMC_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_HIGH_CAPACITY_SD_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_HIGH_SPEED_MULTIMEDIA_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_MULTIMEDIA_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_POWER_OFF : at32f415_sdio.h
  • SDIO_POWER_ON : at32f415_sdio.h
  • SDIO_READ_WAIT_CONTROLLED_BY_CK : at32f415_sdio.h
  • SDIO_READ_WAIT_CONTROLLED_BY_D2 : at32f415_sdio.h
  • SDIO_RESPONSE_LONG : at32f415_sdio.h
  • SDIO_RESPONSE_NO : at32f415_sdio.h
  • SDIO_RESPONSE_SHORT : at32f415_sdio.h
  • SDIO_RSP1_INDEX : at32f415_sdio.h
  • SDIO_RSP2_INDEX : at32f415_sdio.h
  • SDIO_RSP3_INDEX : at32f415_sdio.h
  • SDIO_RSP4_INDEX : at32f415_sdio.h
  • SDIO_SDIO_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_SECURE_DIGITAL_IO_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_SECURE_DIGITAL_IO_COMBO_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_STD_CAPACITY_SD_CARD_V1_1 : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_STD_CAPACITY_SD_CARD_V2_0 : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_WAIT_FOR_INT : at32f415_sdio.h
  • SDIO_WAIT_FOR_NO : at32f415_sdio.h
  • SDIO_WAIT_FOR_PEND : at32f415_sdio.h
  • SET : at32f415.h
  • SPI1_IRQn : at32f415.h
  • SPI2_IRQn : at32f415.h
  • SPI_CLOCK_PHASE_1EDGE : at32f415_spi.h
  • SPI_CLOCK_PHASE_2EDGE : at32f415_spi.h
  • SPI_CLOCK_POLARITY_HIGH : at32f415_spi.h
  • SPI_CLOCK_POLARITY_LOW : at32f415_spi.h
  • SPI_CRC_RX : at32f415_spi.h
  • SPI_CRC_TX : at32f415_spi.h
  • SPI_CS_HARDWARE_MODE : at32f415_spi.h
  • SPI_CS_SOFTWARE_MODE : at32f415_spi.h
  • SPI_FIRST_BIT_LSB : at32f415_spi.h
  • SPI_FIRST_BIT_MSB : at32f415_spi.h
  • SPI_FRAME_16BIT : at32f415_spi.h
  • SPI_FRAME_8BIT : at32f415_spi.h
  • SPI_HALF_DUPLEX_DIRECTION_RX : at32f415_spi.h
  • SPI_HALF_DUPLEX_DIRECTION_TX : at32f415_spi.h
  • SPI_MCLK_DIV_1024 : at32f415_spi.h
  • SPI_MCLK_DIV_128 : at32f415_spi.h
  • SPI_MCLK_DIV_16 : at32f415_spi.h
  • SPI_MCLK_DIV_2 : at32f415_spi.h
  • SPI_MCLK_DIV_256 : at32f415_spi.h
  • SPI_MCLK_DIV_32 : at32f415_spi.h
  • SPI_MCLK_DIV_4 : at32f415_spi.h
  • SPI_MCLK_DIV_512 : at32f415_spi.h
  • SPI_MCLK_DIV_64 : at32f415_spi.h
  • SPI_MCLK_DIV_8 : at32f415_spi.h
  • SPI_MODE_MASTER : at32f415_spi.h
  • SPI_MODE_SLAVE : at32f415_spi.h
  • SPI_SWCS_INTERNAL_LEVEL_HIGHT : at32f415_spi.h
  • SPI_SWCS_INTERNAL_LEVEL_LOW : at32f415_spi.h
  • SPI_TRANSMIT_FULL_DUPLEX : at32f415_spi.h
  • SPI_TRANSMIT_HALF_DUPLEX_RX : at32f415_spi.h
  • SPI_TRANSMIT_HALF_DUPLEX_TX : at32f415_spi.h
  • SPI_TRANSMIT_SIMPLEX_RX : at32f415_spi.h
  • SUCCESS : at32f415.h
  • SVCall_IRQn : at32f415.h
  • SYSTICK_CLOCK_SOURCE_AHBCLK_DIV8 : at32f415_misc.h
  • SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV : at32f415_misc.h
  • SysTick_IRQn : at32f415.h


AT32F415 Firmwary Library: Globals

- t -

  • TAMP_STAMP_IRQn : at32f415.h
  • TMR1_BRK_TMR9_IRQn : at32f415.h
  • TMR1_CH_IRQn : at32f415.h
  • TMR1_OVF_TMR10_IRQn : at32f415.h
  • TMR1_TRG_HALL_TMR11_IRQn : at32f415.h
  • TMR2_GLOBAL_IRQn : at32f415.h
  • TMR3_GLOBAL_IRQn : at32f415.h
  • TMR4_GLOBAL_IRQn : at32f415.h
  • TMR5_GLOBAL_IRQn : at32f415.h
  • TMR_BRK_ADDRESS : at32f415_tmr.h
  • TMR_BRK_INPUT_ACTIVE_HIGH : at32f415_tmr.h
  • TMR_BRK_INPUT_ACTIVE_LOW : at32f415_tmr.h
  • TMR_BRK_SWTRIG : at32f415_tmr.h
  • TMR_C1_DMA_REQUEST : at32f415_tmr.h
  • TMR_C1_SWTRIG : at32f415_tmr.h
  • TMR_C1DT_ADDRESS : at32f415_tmr.h
  • TMR_C2_DMA_REQUEST : at32f415_tmr.h
  • TMR_C2_SWTRIG : at32f415_tmr.h
  • TMR_C2DT_ADDRESS : at32f415_tmr.h
  • TMR_C3_DMA_REQUEST : at32f415_tmr.h
  • TMR_C3_SWTRIG : at32f415_tmr.h
  • TMR_C3DT_ADDRESS : at32f415_tmr.h
  • TMR_C4_DMA_REQUEST : at32f415_tmr.h
  • TMR_C4_SWTRIG : at32f415_tmr.h
  • TMR_C4DT_ADDRESS : at32f415_tmr.h
  • TMR_CC_CHANNEL_MAPPED_DIRECT : at32f415_tmr.h
  • TMR_CC_CHANNEL_MAPPED_INDIRECT : at32f415_tmr.h
  • TMR_CC_CHANNEL_MAPPED_STI : at32f415_tmr.h
  • TMR_CCTRL_ADDRESS : at32f415_tmr.h
  • TMR_CHANEL1_2_3_CONNECTED_C1IRAW_XOR : at32f415_tmr.h
  • TMR_CHANEL1_CONNECTED_C1IRAW : at32f415_tmr.h
  • TMR_CHANNEL_INPUT_DIV_1 : at32f415_tmr.h
  • TMR_CHANNEL_INPUT_DIV_2 : at32f415_tmr.h
  • TMR_CHANNEL_INPUT_DIV_4 : at32f415_tmr.h
  • TMR_CHANNEL_INPUT_DIV_8 : at32f415_tmr.h
  • TMR_CLOCK_DIV1 : at32f415_tmr.h
  • TMR_CLOCK_DIV2 : at32f415_tmr.h
  • TMR_CLOCK_DIV4 : at32f415_tmr.h
  • TMR_CM1_ADDRESS : at32f415_tmr.h
  • TMR_CM2_ADDRESS : at32f415_tmr.h
  • TMR_COUNT_DOWN : at32f415_tmr.h
  • TMR_COUNT_TWO_WAY_1 : at32f415_tmr.h
  • TMR_COUNT_TWO_WAY_2 : at32f415_tmr.h
  • TMR_COUNT_TWO_WAY_3 : at32f415_tmr.h
  • TMR_COUNT_UP : at32f415_tmr.h
  • TMR_CTRL1_ADDRESS : at32f415_tmr.h
  • TMR_CTRL2_ADDRESS : at32f415_tmr.h
  • TMR_CVAL_ADDRESS : at32f415_tmr.h
  • TMR_DIV_ADDRESS : at32f415_tmr.h
  • TMR_DMA_REQUEST_BY_CHANNEL : at32f415_tmr.h
  • TMR_DMA_REQUEST_BY_OVERFLOW : at32f415_tmr.h
  • TMR_DMA_TRANSFER_10BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_11BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_12BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_13BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_14BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_15BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_16BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_17BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_18BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_1BYTE : at32f415_tmr.h
  • TMR_DMA_TRANSFER_2BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_3BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_4BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_5BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_6BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_7BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_8BYTES : at32f415_tmr.h
  • TMR_DMA_TRANSFER_9BYTES : at32f415_tmr.h
  • TMR_DMACTRL_ADDRESS : at32f415_tmr.h
  • TMR_ENCODER_MODE_A : at32f415_tmr.h
  • TMR_ENCODER_MODE_B : at32f415_tmr.h
  • TMR_ENCODER_MODE_C : at32f415_tmr.h
  • TMR_ES_FREQUENCY_DIV_1 : at32f415_tmr.h
  • TMR_ES_FREQUENCY_DIV_2 : at32f415_tmr.h
  • TMR_ES_FREQUENCY_DIV_4 : at32f415_tmr.h
  • TMR_ES_FREQUENCY_DIV_8 : at32f415_tmr.h
  • TMR_ES_POLARITY_INVERTED : at32f415_tmr.h
  • TMR_ES_POLARITY_NON_INVERTED : at32f415_tmr.h
  • TMR_FORCE_OUTPUT_HIGH : at32f415_tmr.h
  • TMR_FORCE_OUTPUT_LOW : at32f415_tmr.h
  • TMR_HALL_DMA_REQUEST : at32f415_tmr.h
  • TMR_HALL_SWTRIG : at32f415_tmr.h
  • TMR_IDEN_ADDRESS : at32f415_tmr.h
  • TMR_INPUT_BOTH_EDGE : at32f415_tmr.h
  • TMR_INPUT_FALLING_EDGE : at32f415_tmr.h
  • TMR_INPUT_RISING_EDGE : at32f415_tmr.h
  • TMR_ISTS_ADDRESS : at32f415_tmr.h
  • TMR_OUTPUT_ACTIVE_HIGH : at32f415_tmr.h
  • TMR_OUTPUT_ACTIVE_LOW : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_FORCE_HIGH : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_FORCE_LOW : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_HIGH : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_LOW : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_OFF : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_PWM_MODE_A : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_PWM_MODE_B : at32f415_tmr.h
  • TMR_OUTPUT_CONTROL_SWITCH : at32f415_tmr.h
  • TMR_OVERFLOW_DMA_REQUEST : at32f415_tmr.h
  • TMR_OVERFLOW_SWTRIG : at32f415_tmr.h
  • TMR_POLARITY_ACTIVE_BOTH : at32f415_tmr.h
  • TMR_POLARITY_ACTIVE_HIGH : at32f415_tmr.h
  • TMR_POLARITY_ACTIVE_LOW : at32f415_tmr.h
  • TMR_PR_ADDRESS : at32f415_tmr.h
  • TMR_PRIMARY_SEL_C1ORAW : at32f415_tmr.h
  • TMR_PRIMARY_SEL_C2ORAW : at32f415_tmr.h
  • TMR_PRIMARY_SEL_C3ORAW : at32f415_tmr.h
  • TMR_PRIMARY_SEL_C4ORAW : at32f415_tmr.h
  • TMR_PRIMARY_SEL_COMPARE : at32f415_tmr.h
  • TMR_PRIMARY_SEL_ENABLE : at32f415_tmr.h
  • TMR_PRIMARY_SEL_OVERFLOW : at32f415_tmr.h
  • TMR_PRIMARY_SEL_RESET : at32f415_tmr.h
  • TMR_RPR_ADDRESS : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_1 : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_1C : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_2 : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_2C : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_3 : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_3C : at32f415_tmr.h
  • TMR_SELECT_CHANNEL_4 : at32f415_tmr.h
  • TMR_STCTRL_ADDRESS : at32f415_tmr.h
  • TMR_SUB_ENCODER_MODE_A : at32f415_tmr.h
  • TMR_SUB_ENCODER_MODE_B : at32f415_tmr.h
  • TMR_SUB_ENCODER_MODE_C : at32f415_tmr.h
  • TMR_SUB_EXTERNAL_CLOCK_MODE_A : at32f415_tmr.h
  • TMR_SUB_HANG_MODE : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_C1DF1 : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_C1INC : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_C2DF2 : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_EXTIN : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_IS0 : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_IS1 : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_IS2 : at32f415_tmr.h
  • TMR_SUB_INPUT_SEL_IS3 : at32f415_tmr.h
  • TMR_SUB_MODE_DIABLE : at32f415_tmr.h
  • TMR_SUB_RESET_MODE : at32f415_tmr.h
  • TMR_SUB_TRIGGER_MODE : at32f415_tmr.h
  • TMR_SWEVT_ADDRESS : at32f415_tmr.h
  • TMR_TRIGGER_DMA_REQUEST : at32f415_tmr.h
  • TMR_TRIGGER_SWTRIG : at32f415_tmr.h
  • TMR_WP_LEVEL_1 : at32f415_tmr.h
  • TMR_WP_LEVEL_2 : at32f415_tmr.h
  • TMR_WP_LEVEL_3 : at32f415_tmr.h
  • TMR_WP_OFF : at32f415_tmr.h
  • TRUE : at32f415.h


AT32F415 Firmwary Library: Globals

- u -

  • UART4_IRQn : at32f415.h
  • UART5_IRQn : at32f415.h
  • UPDATE_CLEAR_FLAG : bootloader/inc/iap.h
  • UPDATE_DONE : bootloader/inc/iap.h
  • UPDATE_ING : bootloader/inc/iap.h
  • UPDATE_PRE : bootloader/inc/iap.h
  • UPGRADE_DONE : flash_fat16.h
  • UPGRADE_ERROR : flash_fat16.h
  • UPGRADE_JUMP : flash_fat16.h
  • UPGRADE_LARGE : flash_fat16.h
  • UPGRADE_READY : flash_fat16.h
  • UPGRADE_SUCCESS : flash_fat16.h
  • UPGRADE_UNKNOWN : flash_fat16.h
  • UPGRAGE_ONGOING : flash_fat16.h
  • UsageFault_IRQn : at32f415.h
  • USART1_IRQn : at32f415.h
  • USART2_IRQn : at32f415.h
  • USART3_IRQn : at32f415.h
  • USART_BREAK_10BITS : at32f415_usart.h
  • USART_BREAK_11BITS : at32f415_usart.h
  • USART_CLOCK_LAST_BIT_NONE : at32f415_usart.h
  • USART_CLOCK_LAST_BIT_OUTPUT : at32f415_usart.h
  • USART_CLOCK_PHASE_1EDGE : at32f415_usart.h
  • USART_CLOCK_PHASE_2EDGE : at32f415_usart.h
  • USART_CLOCK_POLARITY_HIGH : at32f415_usart.h
  • USART_CLOCK_POLARITY_LOW : at32f415_usart.h
  • USART_DATA_8BITS : at32f415_usart.h
  • USART_DATA_9BITS : at32f415_usart.h
  • USART_HARDWARE_FLOW_CTS : at32f415_usart.h
  • USART_HARDWARE_FLOW_NONE : at32f415_usart.h
  • USART_HARDWARE_FLOW_RTS : at32f415_usart.h
  • USART_HARDWARE_FLOW_RTS_CTS : at32f415_usart.h
  • USART_PARITY_EVEN : at32f415_usart.h
  • USART_PARITY_NONE : at32f415_usart.h
  • USART_PARITY_ODD : at32f415_usart.h
  • USART_STOP_0_5_BIT : at32f415_usart.h
  • USART_STOP_1_5_BIT : at32f415_usart.h
  • USART_STOP_1_BIT : at32f415_usart.h
  • USART_STOP_2_BIT : at32f415_usart.h
  • USART_WAKEUP_BY_IDLE_FRAME : at32f415_usart.h
  • USART_WAKEUP_BY_MATCHING_ID : at32f415_usart.h
  • USB_CLK_HEXT : at32f415_usb.h
  • USB_CLK_HICK : at32f415_usb.h
  • USB_CONN_STATE_ADDRESSED : usb_std.h
  • USB_CONN_STATE_CONFIGURED : usb_std.h
  • USB_CONN_STATE_DEFAULT : usb_std.h
  • USB_CONN_STATE_SUSPENDED : usb_std.h
  • USB_EPT0 : at32f415_usb.h
  • USB_EPT1 : at32f415_usb.h
  • USB_EPT2 : at32f415_usb.h
  • USB_EPT3 : at32f415_usb.h
  • USB_EPT4 : at32f415_usb.h
  • USB_EPT5 : at32f415_usb.h
  • USB_EPT6 : at32f415_usb.h
  • USB_EPT7 : at32f415_usb.h
  • USB_ERROR : usb_std.h
  • USB_FAIL : usb_std.h
  • USB_FULL_SPEED_CORE_ID : usb_core.h
  • USB_HID_BUSY : usbh_hid_class.h
  • USB_HID_ERROR : usbh_hid_class.h
  • USB_HID_GET : usbh_hid_class.h
  • USB_HID_INIT : usbh_hid_class.h
  • USB_HID_POLL : usbh_hid_class.h
  • USB_HID_SEND : usbh_hid_class.h
  • USB_HID_STATE_COMPLETE : usbh_hid_class.h
  • USB_HID_STATE_GET_DESC : usbh_hid_class.h
  • USB_HID_STATE_GET_REPORT : usbh_hid_class.h
  • USB_HID_STATE_IDLE : usbh_hid_class.h
  • USB_HID_STATE_SET_IDLE : usbh_hid_class.h
  • USB_HID_STATE_SET_PROTOCOL : usbh_hid_class.h
  • USB_HIGH_SPEED_CORE_ID : usb_core.h
  • USB_LOW_SPEED_CORE_ID : usb_core.h
  • USB_NOT_SUPPORT : usb_std.h
  • USB_OK : usb_std.h
  • USB_OTG1_ID : at32f415_usb.h
  • USB_OTG2_ID : at32f415_usb.h
  • USB_WAIT : usb_std.h
  • USBH_MSC_BUSY : usbh_msc_bot_scsi.h
  • USBH_MSC_ERROR : usbh_msc_bot_scsi.h
  • USBH_MSC_IDLE : usbh_msc_bot_scsi.h
  • USBH_MSC_INIT : usbh_msc_bot_scsi.h
  • USBH_MSC_INQUIRY : usbh_msc_bot_scsi.h
  • USBH_MSC_READ10 : usbh_msc_bot_scsi.h
  • USBH_MSC_READ_CAPACITY10 : usbh_msc_bot_scsi.h
  • USBH_MSC_REQUEST_SENSE : usbh_msc_bot_scsi.h
  • USBH_MSC_STATE_COMPLETE : usbh_msc_class.h
  • USBH_MSC_STATE_ERROR : usbh_msc_class.h
  • USBH_MSC_STATE_GET_LUN : usbh_msc_class.h
  • USBH_MSC_STATE_IDLE : usbh_msc_class.h
  • USBH_MSC_TEST_UNIT_READY : usbh_msc_bot_scsi.h
  • USBH_MSC_WRITE : usbh_msc_bot_scsi.h
  • USER_BUTTON : at32f415_board.h


AT32F415 Firmwary Library: Globals

- w -

  • WDT_CLK_DIV_128 : at32f415_wdt.h
  • WDT_CLK_DIV_16 : at32f415_wdt.h
  • WDT_CLK_DIV_256 : at32f415_wdt.h
  • WDT_CLK_DIV_32 : at32f415_wdt.h
  • WDT_CLK_DIV_4 : at32f415_wdt.h
  • WDT_CLK_DIV_64 : at32f415_wdt.h
  • WDT_CLK_DIV_8 : at32f415_wdt.h
  • WDT_CMD_ENABLE : at32f415_wdt.h
  • WDT_CMD_LOCK : at32f415_wdt.h
  • WDT_CMD_RELOAD : at32f415_wdt.h
  • WDT_CMD_UNLOCK : at32f415_wdt.h
  • WWDT_IRQn : at32f415.h
  • WWDT_PCLK1_DIV_16384 : at32f415_wwdt.h
  • WWDT_PCLK1_DIV_32768 : at32f415_wwdt.h
  • WWDT_PCLK1_DIV_4096 : at32f415_wwdt.h
  • WWDT_PCLK1_DIV_8192 : at32f415_wwdt.h


AT32F415 Firmwary Library: Globals

- _ -

  • __AT32F415_LIBRARY_VERSION : at32f415.h
  • __AT32F415_LIBRARY_VERSION_MAJOR : at32f415.h
  • __AT32F415_LIBRARY_VERSION_MIDDLE : at32f415.h
  • __AT32F415_LIBRARY_VERSION_MINOR : at32f415.h
  • __AT32F415_LIBRARY_VERSION_RC : at32f415.h
  • __CM4_REV : at32f415.h
  • __FPU_PRESENT : at32f415.h
  • __MPU_PRESENT : at32f415.h
  • __NVIC_PRIO_BITS : at32f415.h
  • __Vendor_SysTickConfig : at32f415.h


AT32F415 Firmwary Library: Globals

- a -

  • ADC1 : at32f415_adc.h
  • ADC1_BASE : at32f415.h
  • ADC1_ETO_GMUX : at32f415_gpio.h
  • ADC1_ETO_MUX : at32f415_gpio.h
  • ADC1_ETP_GMUX : at32f415_gpio.h
  • ADC1_ETP_MUX : at32f415_gpio.h
  • ADC_CCE_FLAG : at32f415_adc.h
  • ADC_CCE_INT : at32f415_adc.h
  • ADC_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • ADC_OCCS_FLAG : at32f415_adc.h
  • ADC_PCCE_FLAG : at32f415_adc.h
  • ADC_PCCE_INT : at32f415_adc.h
  • ADC_PCCS_FLAG : at32f415_adc.h
  • ADC_TEMP_BASE : project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c
  • ADC_TEMP_SLOPE : project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c
  • ADC_VMOR_FLAG : at32f415_adc.h
  • ADC_VMOR_INT : at32f415_adc.h
  • ADC_VREF : project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c
  • ADDRESS_OUT_OF_RANGE : msc_bot_scsi.h
  • AHBPERIPH_BASE : at32f415.h
  • AIRCR_VECTKEY_MASK : at32f415_misc.c
  • APB1PERIPH_BASE : at32f415.h
  • APB2PERIPH_BASE : at32f415.h
  • APP_START_ADDR : app_led3_toggle/inc/iap.h, app_led4_toggle/inc/iap.h, bootloader/inc/iap.h
  • AT32_AUDIO_FREQ_16K : audio_desc.h, audio_hid_desc.h
  • AT32_AUDIO_FREQ_48K : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_DESCRIPTOR_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_EXTENSION_UNIT : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_FEATURE_UNIT : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_HEADER : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_INPUT_TERMINAL : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_MIXER_UNIT : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_OUTPUT_TERMINAL : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_PROCESSING_UNIT : audio_desc.h, audio_hid_desc.h
  • AUDIO_AC_SELECTOR_UNIT : audio_desc.h, audio_hid_desc.h
  • AUDIO_AS_DESCRIPTOR_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_AS_FORMAT_SPECIFIC : audio_desc.h, audio_hid_desc.h
  • AUDIO_AS_FORMAT_TYPE : audio_desc.h, audio_hid_desc.h
  • AUDIO_AS_GENERAL : audio_desc.h, audio_hid_desc.h
  • AUDIO_BITW_16 : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_CS_CONFIGURATION : audio_desc.h, audio_hid_desc.h
  • AUDIO_CS_DEVICE : audio_desc.h, audio_hid_desc.h
  • AUDIO_CS_ENDPOINT : audio_desc.h, audio_hid_desc.h
  • AUDIO_CS_INTERFACE : audio_desc.h, audio_hid_desc.h
  • AUDIO_CS_STRING : audio_desc.h, audio_hid_desc.h
  • AUDIO_CS_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_DEFAULT_BITW : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_DEFAULT_FREQ : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_DESCRIPTOR_SIZE : audio_class.h, audio_hid_class.h
  • AUDIO_DESCRIPTOR_TYPE : audio_class.h, audio_hid_class.h
  • AUDIO_FEATURE_UNIT_SIZE : audio_desc.h, audio_hid_desc.h
  • AUDIO_FEEDBACK_MAXPACKET_SIZE : audio_class.h, audio_hid_class.h
  • AUDIO_FORMAT_TYPE_I : audio_desc.h, audio_hid_desc.h
  • AUDIO_FREQ_16K : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_FREQ_48K : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_FREQ_SET_CONTROL : audio_class.h, audio_hid_class.h
  • AUDIO_FU_BASS_CONTROL : audio_desc.h, audio_hid_desc.h
  • AUDIO_FU_CONTROL_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_FU_MID_CONTROL : audio_desc.h, audio_hid_desc.h
  • AUDIO_FU_MUTE_CONTROL : audio_desc.h, audio_hid_desc.h
  • AUDIO_FU_TREBLE_CONTROL : audio_desc.h, audio_hid_desc.h
  • AUDIO_FU_VOLUME_CONTROL : audio_desc.h, audio_hid_desc.h
  • AUDIO_INPUT_TERMINAL_MICROPHONE : audio_desc.h, audio_hid_desc.h
  • AUDIO_INPUT_TERMINAL_SIZE : audio_desc.h, audio_hid_desc.h
  • AUDIO_INPUT_TERMINAL_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_INTERFACE_LEN : audio_desc.h, audio_hid_desc.h
  • AUDIO_INTERFACE_NUM : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_BITW : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_CHANEL_NUM : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_MIC_CHR : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_DEFAULT_BITW : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_MIC_FEATURE_UNIT_ID : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_FREQ_SIZE : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_IN_MAXPACKET_SIZE : audio_class.h, audio_hid_class.h
  • AUDIO_MIC_INPUT_TERMINAL_ID : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_INTERFACE : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_INTERFACE_NUMBER : audio_desc.h, audio_hid_desc.h
  • AUDIO_MIC_OUTPUT_TERMINAL_ID : audio_desc.h, audio_hid_desc.h
  • AUDIO_MUTE_CONTROL : audio_class.h, audio_hid_class.h
  • AUDIO_OUTPUT_TERMINAL_SIZE : audio_desc.h, audio_hid_desc.h
  • AUDIO_OUTPUT_TERMINAL_SPEAKER : audio_desc.h, audio_hid_desc.h
  • AUDIO_OUTPUT_TERMINAL_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_PROTOCOL_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_REMAIN_SIZE : audio_class.h, audio_hid_class.h
  • AUDIO_REQ_CONTROL_ENDPOINT : audio_class.h, audio_hid_class.h
  • AUDIO_REQ_CONTROL_INTERFACE : audio_class.h, audio_hid_class.h
  • AUDIO_REQ_CONTROL_MASK : audio_class.h, audio_hid_class.h
  • AUDIO_REQ_GET_CUR : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_GET_MAX : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_GET_MEM : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_GET_MIN : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_GET_RES : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_GET_STAT : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_SET_CUR : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_SET_MAX : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_SET_MEM : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_SET_MIN : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQ_SET_RES : audio_desc.h, audio_hid_desc.h
  • AUDIO_REQUEST_CODE_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_BITW : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_CHANEL_NUM : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SPK_CHR : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_DEFAULT_BITW : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SPK_FEATURE_UNIT_ID : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_FREQ_SIZE : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_INPUT_TERMINAL_ID : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_INTERFACE : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_INTERFACE_NUMBER : audio_desc.h, audio_hid_desc.h
  • AUDIO_SPK_OUT_MAXPACKET_SIZE : audio_class.h, audio_hid_class.h
  • AUDIO_SPK_OUTPUT_TERMINAL_ID : audio_desc.h, audio_hid_desc.h
  • AUDIO_SUBCLASS_AUDIOCONTROL : audio_desc.h, audio_hid_desc.h
  • AUDIO_SUBCLASS_AUDIOSTREAMING : audio_desc.h, audio_hid_desc.h
  • AUDIO_SUBCLASS_MIDISTREMING : audio_desc.h, audio_hid_desc.h
  • AUDIO_SUBCLASS_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_SUPPORT_FEEDBACK : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SUPPORT_FREQ : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SUPPORT_FREQ_16K : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SUPPORT_FREQ_48K : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SUPPORT_MAX_FREQ : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SUPPORT_MIC : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_SUPPORT_SPK : audio/audio_conf.h, audio_hid/audio_conf.h
  • AUDIO_TERMINAL_TYPE_STREAMING : audio_desc.h, audio_hid_desc.h
  • AUDIO_TERMINAL_TYPE_UNDEFINED : audio_desc.h, audio_hid_desc.h
  • AUDIO_TERMINAL_TYPE_VENDOR : audio_desc.h, audio_hid_desc.h
  • AUDIO_VOLUME_CONTROL : audio_class.h, audio_hid_class.h


AT32F415 Firmwary Library: Globals

- b -

  • BCD_NUM : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h, printer_desc.h
  • BLOCK_SIZE : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c, fir_filter.c
  • BLOCKS_NUMBER : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • BUF_SIZE : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, project/at_start_f415/examples/spi/w25q_flash/src/main.c
  • BUFFER_SIZE : project/at_start_f415/examples/crc/calculation/src/main.c, project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c, project/at_start_f415/examples/dma/flash_to_sram/src/main.c, project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c, project/at_start_f415/examples/spi/fullduplex_polling/src/main.c, project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c, project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c, project/at_start_f415/examples/usart/hw_flow_control/src/main.c, project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • BUFFERSIZE : project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c
  • BUTTON_RELEASE : mouse_class.h


AT32F415 Firmwary Library: Globals

- c -

  • CAN1 : at32f415_can.h
  • CAN1_BASE : at32f415.h
  • CAN1_GMUX_0010 : at32f415_gpio.h
  • CAN_BOF_FLAG : at32f415_can.h
  • CAN_BOIEN_INT : at32f415_can.h
  • CAN_EAF_FLAG : at32f415_can.h
  • CAN_EAIEN_INT : at32f415_can.h
  • CAN_EDZC_FLAG : at32f415_can.h
  • CAN_EDZIEN_INT : at32f415_can.h
  • CAN_EOIEN_INT : at32f415_can.h
  • CAN_EOIF_FLAG : at32f415_can.h
  • CAN_EPF_FLAG : at32f415_can.h
  • CAN_EPIEN_INT : at32f415_can.h
  • CAN_ETR_FLAG : at32f415_can.h
  • CAN_ETRIEN_INT : at32f415_can.h
  • CAN_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • CAN_MSTS_EDZIF_VAL : at32f415_can.h
  • CAN_MSTS_EOIF_VAL : at32f415_can.h
  • CAN_MSTS_QDZIF_VAL : at32f415_can.h
  • CAN_MUX_10 : at32f415_gpio.h
  • CAN_QDZIEN_INT : at32f415_can.h
  • CAN_QDZIF_FLAG : at32f415_can.h
  • CAN_RF0_RF0FF_VAL : at32f415_can.h
  • CAN_RF0_RF0OF_VAL : at32f415_can.h
  • CAN_RF0_RF0R_VAL : at32f415_can.h
  • CAN_RF0FF_FLAG : at32f415_can.h
  • CAN_RF0FIEN_INT : at32f415_can.h
  • CAN_RF0MIEN_INT : at32f415_can.h
  • CAN_RF0MN_FLAG : at32f415_can.h
  • CAN_RF0OF_FLAG : at32f415_can.h
  • CAN_RF0OIEN_INT : at32f415_can.h
  • CAN_RF1_RF1FF_VAL : at32f415_can.h
  • CAN_RF1_RF1OF_VAL : at32f415_can.h
  • CAN_RF1_RF1R_VAL : at32f415_can.h
  • CAN_RF1FF_FLAG : at32f415_can.h
  • CAN_RF1FIEN_INT : at32f415_can.h
  • CAN_RF1MIEN_INT : at32f415_can.h
  • CAN_RF1MN_FLAG : at32f415_can.h
  • CAN_RF1OF_FLAG : at32f415_can.h
  • CAN_RF1OIEN_INT : at32f415_can.h
  • CAN_TCIEN_INT : at32f415_can.h
  • CAN_TM0TCF_FLAG : at32f415_can.h
  • CAN_TM1TCF_FLAG : at32f415_can.h
  • CAN_TM2TCF_FLAG : at32f415_can.h
  • CAN_TMEF_FLAG : at32f415_can.h
  • CAN_TSTS_TM0CT_VAL : at32f415_can.h
  • CAN_TSTS_TM0TCF_VAL : at32f415_can.h
  • CAN_TSTS_TM1CT_VAL : at32f415_can.h
  • CAN_TSTS_TM1TCF_VAL : at32f415_can.h
  • CAN_TSTS_TM2CT_VAL : at32f415_can.h
  • CAN_TSTS_TM2TCF_VAL : at32f415_can.h
  • CBW_BMCBWFLAGS_DIR_IN : msc_bot_scsi.h
  • CBW_BMCBWFLAGS_DIR_OUT : msc_bot_scsi.h
  • CBW_CMD_LENGTH : msc_bot_scsi.h
  • CBW_DCBWSIGNATURE : msc_bot_scsi.h
  • CDC_DATA_INTERFACE : cdc_keyboard_desc.h
  • CDC_INTERFACE : cdc_keyboard_desc.h
  • CMP : at32f415_cmp.h
  • CMP_BASE : at32f415.h
  • CMP_CTRLSTS1_CLEAR_MASK : at32f415_cmp.c
  • CMP_HIGH_PULSE_CLEAR_MASK : at32f415_cmp.c
  • CMP_INPINPUT_CLEAR_MASK : at32f415_cmp.c
  • CMP_LOW_PULSE_CLEAR_MASK : at32f415_cmp.c
  • CMP_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • CMP_MUX_01 : at32f415_gpio.h
  • CMP_MUX_10 : at32f415_gpio.h
  • configASSERT : FreeRTOSConfig.h
  • configCPU_CLOCK_HZ : FreeRTOSConfig.h
  • configIDLE_SHOULD_YIELD : FreeRTOSConfig.h
  • configKERNEL_INTERRUPT_PRIORITY : FreeRTOSConfig.h
  • configLIBRARY_LOWEST_INTERRUPT_PRIORITY : FreeRTOSConfig.h
  • configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY : FreeRTOSConfig.h
  • configMAX_CO_ROUTINE_PRIORITIES : FreeRTOSConfig.h
  • configMAX_PRIORITIES : FreeRTOSConfig.h
  • configMAX_SYSCALL_INTERRUPT_PRIORITY : FreeRTOSConfig.h
  • configMAX_TASK_NAME_LEN : FreeRTOSConfig.h
  • configMINIMAL_STACK_SIZE : FreeRTOSConfig.h
  • configPRIO_BITS : FreeRTOSConfig.h
  • configSUPPORT_DYNAMIC_ALLOCATION : FreeRTOSConfig.h
  • configTICK_RATE_HZ : FreeRTOSConfig.h
  • configTOTAL_HEAP_SIZE : FreeRTOSConfig.h
  • configUSE_16_BIT_TICKS : FreeRTOSConfig.h
  • configUSE_CO_ROUTINES : FreeRTOSConfig.h
  • configUSE_IDLE_HOOK : FreeRTOSConfig.h
  • configUSE_PREEMPTION : FreeRTOSConfig.h
  • configUSE_TICK_HOOK : FreeRTOSConfig.h
  • CONVERT_ENDIAN : hid_iap_class.h
  • COUNTOF : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • CRC : at32f415_crc.h
  • CRC_BASE : at32f415.h
  • CRC_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • CRM : at32f415_crm.h
  • CRM_BASE : at32f415.h
  • CRM_CLOCK_FAILURE_INT : at32f415_crm.h
  • CRM_CLOCK_FAILURE_INT_FLAG : at32f415_crm.h
  • CRM_HEXT_READY_INT_FLAG : at32f415_crm.h
  • CRM_HEXT_STABLE_FLAG : at32f415_crm.h
  • CRM_HEXT_STABLE_INT : at32f415_crm.h
  • CRM_HICK_READY_INT_FLAG : at32f415_crm.h
  • CRM_HICK_STABLE_FLAG : at32f415_crm.h
  • CRM_HICK_STABLE_INT : at32f415_crm.h
  • CRM_LEXT_READY_INT_FLAG : at32f415_crm.h
  • CRM_LEXT_STABLE_FLAG : at32f415_crm.h
  • CRM_LEXT_STABLE_INT : at32f415_crm.h
  • CRM_LICK_READY_INT_FLAG : at32f415_crm.h
  • CRM_LICK_STABLE_FLAG : at32f415_crm.h
  • CRM_LICK_STABLE_INT : at32f415_crm.h
  • CRM_LOWPOWER_RESET_FLAG : at32f415_crm.h
  • CRM_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • CRM_NRST_RESET_FLAG : at32f415_crm.h
  • CRM_PLL_READY_INT_FLAG : at32f415_crm.h
  • CRM_PLL_STABLE_FLAG : at32f415_crm.h
  • CRM_PLL_STABLE_INT : at32f415_crm.h
  • CRM_POR_RESET_FLAG : at32f415_crm.h
  • CRM_REG : at32f415_crm.h
  • CRM_REG_BIT : at32f415_crm.h
  • CRM_SW_RESET_FLAG : at32f415_crm.h
  • CRM_WDT_RESET_FLAG : at32f415_crm.h
  • CRM_WWDT_RESET_FLAG : at32f415_crm.h
  • CSW_BCSWSTATUS_FAILED : msc_bot_scsi.h
  • CSW_BCSWSTATUS_PASS : msc_bot_scsi.h
  • CSW_BCSWSTATUS_PHASE_ERR : msc_bot_scsi.h
  • CSW_CMD_LENGTH : msc_bot_scsi.h
  • CSW_DCSWSIGNATURE : msc_bot_scsi.h


AT32F415 Firmwary Library: Globals

- d -

  • DATA1_VAL : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • DATA2_VAL : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • DATA3_VAL : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • DATA4_VAL : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • DEBUG_BASE : at32f415.h
  • DEBUG_CAN1_PAUSE : at32f415_debug.h
  • DEBUG_I2C1_SMBUS_TIMEOUT : at32f415_debug.h
  • DEBUG_I2C2_SMBUS_TIMEOUT : at32f415_debug.h
  • DEBUG_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • DEBUG_SLEEP : at32f415_debug.h
  • DEBUG_STANDBY : at32f415_debug.h
  • DEBUG_STOP : at32f415_debug.h
  • DEBUG_TMR10_PAUSE : at32f415_debug.h
  • DEBUG_TMR11_PAUSE : at32f415_debug.h
  • DEBUG_TMR1_PAUSE : at32f415_debug.h
  • DEBUG_TMR2_PAUSE : at32f415_debug.h
  • DEBUG_TMR3_PAUSE : at32f415_debug.h
  • DEBUG_TMR4_PAUSE : at32f415_debug.h
  • DEBUG_TMR5_PAUSE : at32f415_debug.h
  • DEBUG_TMR9_PAUSE : at32f415_debug.h
  • DEBUG_WDT_PAUSE : at32f415_debug.h
  • DEBUG_WWDT_PAUSE : at32f415_debug.h
  • DEBUGMCU : at32f415_debug.h
  • DELAY : project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c, project/at_start_f415/templates/src/main.c
  • DEV_MMC : diskio.c, usbh_msc_diskio.c
  • DEV_RAM : diskio.c, usbh_msc_diskio.c
  • DEV_USB : diskio.c, usbh_msc_diskio.c
  • DEVICE_ID_ADDR1 : random.c
  • DMA1 : at32f415_dma.h
  • DMA1_BASE : at32f415.h
  • DMA1_CHANNEL1 : at32f415_dma.h
  • DMA1_CHANNEL1_BASE : at32f415.h
  • DMA1_CHANNEL2 : at32f415_dma.h
  • DMA1_CHANNEL2_BASE : at32f415.h
  • DMA1_CHANNEL3 : at32f415_dma.h
  • DMA1_CHANNEL3_BASE : at32f415.h
  • DMA1_CHANNEL4 : at32f415_dma.h
  • DMA1_CHANNEL4_BASE : at32f415.h
  • DMA1_CHANNEL5 : at32f415_dma.h
  • DMA1_CHANNEL5_BASE : at32f415.h
  • DMA1_CHANNEL6 : at32f415_dma.h
  • DMA1_CHANNEL6_BASE : at32f415.h
  • DMA1_CHANNEL7 : at32f415_dma.h
  • DMA1_CHANNEL7_BASE : at32f415.h
  • DMA1_DTERR1_FLAG : at32f415_dma.h
  • DMA1_DTERR2_FLAG : at32f415_dma.h
  • DMA1_DTERR3_FLAG : at32f415_dma.h
  • DMA1_DTERR4_FLAG : at32f415_dma.h
  • DMA1_DTERR5_FLAG : at32f415_dma.h
  • DMA1_DTERR6_FLAG : at32f415_dma.h
  • DMA1_DTERR7_FLAG : at32f415_dma.h
  • DMA1_FDT1_FLAG : at32f415_dma.h
  • DMA1_FDT2_FLAG : at32f415_dma.h
  • DMA1_FDT3_FLAG : at32f415_dma.h
  • DMA1_FDT4_FLAG : at32f415_dma.h
  • DMA1_FDT5_FLAG : at32f415_dma.h
  • DMA1_FDT6_FLAG : at32f415_dma.h
  • DMA1_FDT7_FLAG : at32f415_dma.h
  • DMA1_GL1_FLAG : at32f415_dma.h
  • DMA1_GL2_FLAG : at32f415_dma.h
  • DMA1_GL3_FLAG : at32f415_dma.h
  • DMA1_GL4_FLAG : at32f415_dma.h
  • DMA1_GL5_FLAG : at32f415_dma.h
  • DMA1_GL6_FLAG : at32f415_dma.h
  • DMA1_GL7_FLAG : at32f415_dma.h
  • DMA1_HDT1_FLAG : at32f415_dma.h
  • DMA1_HDT2_FLAG : at32f415_dma.h
  • DMA1_HDT3_FLAG : at32f415_dma.h
  • DMA1_HDT4_FLAG : at32f415_dma.h
  • DMA1_HDT5_FLAG : at32f415_dma.h
  • DMA1_HDT6_FLAG : at32f415_dma.h
  • DMA1_HDT7_FLAG : at32f415_dma.h
  • DMA2 : at32f415_dma.h
  • DMA2_BASE : at32f415.h
  • DMA2_CHANNEL1 : at32f415_dma.h
  • DMA2_CHANNEL1_BASE : at32f415.h
  • DMA2_CHANNEL2 : at32f415_dma.h
  • DMA2_CHANNEL2_BASE : at32f415.h
  • DMA2_CHANNEL3 : at32f415_dma.h
  • DMA2_CHANNEL3_BASE : at32f415.h
  • DMA2_CHANNEL4 : at32f415_dma.h
  • DMA2_CHANNEL4_BASE : at32f415.h
  • DMA2_CHANNEL5 : at32f415_dma.h
  • DMA2_CHANNEL5_BASE : at32f415.h
  • DMA2_CHANNEL6 : at32f415_dma.h
  • DMA2_CHANNEL6_BASE : at32f415.h
  • DMA2_CHANNEL7 : at32f415_dma.h
  • DMA2_CHANNEL7_BASE : at32f415.h
  • DMA2_DTERR1_FLAG : at32f415_dma.h
  • DMA2_DTERR2_FLAG : at32f415_dma.h
  • DMA2_DTERR3_FLAG : at32f415_dma.h
  • DMA2_DTERR4_FLAG : at32f415_dma.h
  • DMA2_DTERR5_FLAG : at32f415_dma.h
  • DMA2_DTERR6_FLAG : at32f415_dma.h
  • DMA2_DTERR7_FLAG : at32f415_dma.h
  • DMA2_FDT1_FLAG : at32f415_dma.h
  • DMA2_FDT2_FLAG : at32f415_dma.h
  • DMA2_FDT3_FLAG : at32f415_dma.h
  • DMA2_FDT4_FLAG : at32f415_dma.h
  • DMA2_FDT5_FLAG : at32f415_dma.h
  • DMA2_FDT6_FLAG : at32f415_dma.h
  • DMA2_FDT7_FLAG : at32f415_dma.h
  • DMA2_GL1_FLAG : at32f415_dma.h
  • DMA2_GL2_FLAG : at32f415_dma.h
  • DMA2_GL3_FLAG : at32f415_dma.h
  • DMA2_GL4_FLAG : at32f415_dma.h
  • DMA2_GL5_FLAG : at32f415_dma.h
  • DMA2_GL6_FLAG : at32f415_dma.h
  • DMA2_GL7_FLAG : at32f415_dma.h
  • DMA2_HDT1_FLAG : at32f415_dma.h
  • DMA2_HDT2_FLAG : at32f415_dma.h
  • DMA2_HDT3_FLAG : at32f415_dma.h
  • DMA2_HDT4_FLAG : at32f415_dma.h
  • DMA2_HDT5_FLAG : at32f415_dma.h
  • DMA2_HDT6_FLAG : at32f415_dma.h
  • DMA2_HDT7_FLAG : at32f415_dma.h
  • DMA_BUFFER_SIZE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • DMA_DTERR_INT : at32f415_dma.h
  • DMA_FDT_INT : at32f415_dma.h
  • DMA_GET_HT_FLAG : i2c_application.c
  • DMA_GET_TC_FLAG : i2c_application.c
  • DMA_GET_TERR_FLAG : i2c_application.c
  • DMA_HDT_INT : at32f415_dma.h
  • DMA_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • DOWN_MOVE : mouse_class.h
  • DYMMY_BYTE : project/at_start_f415/examples/usart/synchronous/src/main.c
  • DZC_TIMEOUT : at32f415_can.h


AT32F415 Firmwary Library: Globals

- e -

  • ENABLE_ERTC_ASSEED : random.h
  • ERASE_TIMEOUT : at32f415_flash.h
  • ERROR_ID_VAL : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • ERTC : at32f415_ertc.h
  • ERTC_ALA_INT : at32f415_ertc.h
  • ERTC_ALAF_FLAG : at32f415_ertc.h
  • ERTC_ALARM_MASK_ALL : at32f415_ertc.h
  • ERTC_ALARM_MASK_DATE_WEEK : at32f415_ertc.h
  • ERTC_ALARM_MASK_HOUR : at32f415_ertc.h
  • ERTC_ALARM_MASK_MIN : at32f415_ertc.h
  • ERTC_ALARM_MASK_NONE : at32f415_ertc.h
  • ERTC_ALARM_MASK_SEC : at32f415_ertc.h
  • ERTC_ALAWF_FLAG : at32f415_ertc.h
  • ERTC_ALB_INT : at32f415_ertc.h
  • ERTC_ALBF_FLAG : at32f415_ertc.h
  • ERTC_ALBWF_FLAG : at32f415_ertc.h
  • ERTC_BASE : at32f415.h
  • ERTC_BPR_DT_NUMBER : project/at_start_f415/examples/ertc/bpr_domain/src/main.c, project/at_start_f415/examples/ertc/tamper/src/main.c
  • ERTC_CALUPDF_FLAG : at32f415_ertc.h
  • ERTC_CLOCK_SOURCE_LEXT : project/at_start_f415/examples/ertc/calendar/src/main.c
  • ERTC_IMF_FLAG : at32f415_ertc.h
  • ERTC_INITF_FLAG : at32f415_ertc.h
  • ERTC_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • ERTC_TADJF_FLAG : at32f415_ertc.h
  • ERTC_TIMEOUT : at32f415_ertc.c
  • ERTC_TP1F_FLAG : at32f415_ertc.h
  • ERTC_TP_INT : at32f415_ertc.h
  • ERTC_TS_INT : at32f415_ertc.h
  • ERTC_TSF_FLAG : at32f415_ertc.h
  • ERTC_TSOF_FLAG : at32f415_ertc.h
  • ERTC_UPDF_FLAG : at32f415_ertc.h
  • ERTC_WAT_INT : at32f415_ertc.h
  • ERTC_WATF_FLAG : at32f415_ertc.h
  • ERTC_WATWF_FLAG : at32f415_ertc.h
  • EXINT : at32f415_exint.h
  • EXINT_BASE : at32f415.h
  • EXINT_LINE_0 : at32f415_exint.h
  • EXINT_LINE_1 : at32f415_exint.h
  • EXINT_LINE_10 : at32f415_exint.h
  • EXINT_LINE_11 : at32f415_exint.h
  • EXINT_LINE_12 : at32f415_exint.h
  • EXINT_LINE_13 : at32f415_exint.h
  • EXINT_LINE_14 : at32f415_exint.h
  • EXINT_LINE_15 : at32f415_exint.h
  • EXINT_LINE_16 : at32f415_exint.h
  • EXINT_LINE_17 : at32f415_exint.h
  • EXINT_LINE_18 : at32f415_exint.h
  • EXINT_LINE_19 : at32f415_exint.h
  • EXINT_LINE_2 : at32f415_exint.h
  • EXINT_LINE_20 : at32f415_exint.h
  • EXINT_LINE_21 : at32f415_exint.h
  • EXINT_LINE_22 : at32f415_exint.h
  • EXINT_LINE_3 : at32f415_exint.h
  • EXINT_LINE_4 : at32f415_exint.h
  • EXINT_LINE_5 : at32f415_exint.h
  • EXINT_LINE_6 : at32f415_exint.h
  • EXINT_LINE_7 : at32f415_exint.h
  • EXINT_LINE_8 : at32f415_exint.h
  • EXINT_LINE_9 : at32f415_exint.h
  • EXINT_LINE_NONE : at32f415_exint.h
  • EXINT_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • EXT_CSD_BUS_WIDTH : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_Clear_byte : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_CMD_SET_CPSECURE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_CMD_SET_NORMAL : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_CMD_SET_SECURE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_Command_set : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_HS_TIMING : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_Set_bit : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • EXT_CSD_Write_byte : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h


AT32F415 Firmwary Library: Globals

- f -

  • FAP_HIGH_LEVEL_KEY : at32f415_flash.h
  • FAP_RELIEVE_KEY : at32f415_flash.h
  • FAST : project/at_start_f415/templates/src/main.c
  • FAT16_BYTE_PER_SIZE : flash_fat16.h
  • FAT16_DIR_SIZE : flash_fat16.h
  • FAT16_FILENAME_SIZE : flash_fat16.h
  • FAT16_SECTOR_SIZE : flash_fat16.h, flash_fat16.c
  • FAT16_TABLE_SIZE : flash_fat16.h
  • FEEDBACK_REFRESH_TIME : audio_class.h, audio_hid_class.h
  • FF_CODE_PAGE : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_EXFAT : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_LOCK : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_MINIMIZE : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_NOFSINFO : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_NORTC : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_READONLY : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_REENTRANT : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_RPATH : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_TIMEOUT : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_FS_TINY : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_LBA64 : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_LFN_BUF : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_LFN_UNICODE : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_MAX_LFN : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_MAX_SS : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_MIN_GPT : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_MIN_SS : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_MULTI_PARTITION : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_NORTC_MDAY : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_NORTC_MON : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_NORTC_YEAR : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_PRINT_FLOAT : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_PRINT_LLI : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_SFN_BUF : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_STR_VOLUME_ID : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_STRF_ENCODE : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_SYNC_t : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_CHMOD : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_EXPAND : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_FASTSEEK : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_FIND : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_FORWARD : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_LABEL : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_LFN : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_MKFS : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_STRFUNC : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_USE_TRIM : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_VOLUME_STRS : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FF_VOLUMES : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FFCONF_DEF : sdio/sdio_fatfs/inc/ffconf.h, usb_host/msc_only_fat32/inc/ffconf.h
  • FILE_SUFFIX1_LEN : flash_fat16.h
  • FILE_SUFFIX1_NAME : flash_fat16.h
  • FILE_SUFFIX2_LEN : flash_fat16.h
  • FILE_SUFFIX2_NAME : flash_fat16.h
  • FILTER_EXT_ID1 : project/at_start_f415/examples/can/filter/src/main.c
  • FILTER_EXT_ID2 : project/at_start_f415/examples/can/filter/src/main.c
  • FILTER_EXT_ID3 : project/at_start_f415/examples/can/filter/src/main.c
  • FILTER_STD_ID1 : project/at_start_f415/examples/can/filter/src/main.c
  • FILTER_STD_ID2 : project/at_start_f415/examples/can/filter/src/main.c
  • FILTER_STD_ID3 : project/at_start_f415/examples/can/filter/src/main.c
  • FLASH : at32f415_flash.h
  • FLASH_APP_ADDRESS : app_led3_toggle/inc/hid_iap_user.h, app_led4_toggle/inc/hid_iap_user.h, bootloader/inc/hid_iap_user.h
  • FLASH_APP_START_ADDR : flash_fat16.h
  • FLASH_BASE : at32f415.h
  • FLASH_CS_HIGH : spi_flash.h
  • FLASH_CS_LOW : spi_flash.h
  • FLASH_EPPERR_FLAG : at32f415_flash.h
  • FLASH_ERR_INT : at32f415_flash.h
  • FLASH_FAT16_1_ADDR : flash_fat16.h
  • FLASH_FAT16_2_ADDR : flash_fat16.h
  • FLASH_FAT16_BOOT_SECTOR_ADDR : flash_fat16.h
  • FLASH_FAT16_FILE_START_ADDR : flash_fat16.h
  • FLASH_FAT16_ROOT_ADDR : flash_fat16.h
  • FLASH_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • FLASH_OBF_FLAG : at32f415_flash.h
  • FLASH_ODF_FLAG : at32f415_flash.h
  • FLASH_ODF_INT : at32f415_flash.h
  • FLASH_PRGMERR_FLAG : at32f415_flash.h
  • flash_psr_set : at32f415_flash.h
  • FLASH_REG_BASE : at32f415.h
  • FLASH_SECTOR_1K_ALLGNED : flash_fat16.h
  • FLASH_SECTOR_1K_SIZE : flash_fat16.h
  • FLASH_SECTOR_2K_ALLGNED : flash_fat16.h
  • FLASH_SECTOR_2K_SIZE : flash_fat16.h
  • FLASH_SECTOR_4K_ALLGNED : flash_fat16.h
  • FLASH_SECTOR_4K_SIZE : flash_fat16.h
  • FLASH_SECTOR_SIZE : utilities/at32f415_slib_demo/project_l0/src/main.c
  • FLASH_SIZE : utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h
  • FLASH_SIZE_REG : hid_iap_class.h
  • FLASH_SLIB_DATA_START_SECTOR : at32f415_flash.h
  • FLASH_SLIB_END_SECTOR : at32f415_flash.h
  • FLASH_SLIB_START_SECTOR : at32f415_flash.h
  • FLASH_SPI_DUMMY_BYTE : spi_flash.h
  • FLASH_START_ADDR : utilities/at32f415_slib_demo/project_l0/src/main.c
  • FLASH_TEST_ADDR : project/at_start_f415/examples/spi/w25q_flash/src/main.c
  • FLASH_UNLOCK_KEY1 : at32f415_flash.h
  • FLASH_UNLOCK_KEY2 : at32f415_flash.h
  • FLASH_USDERR_FLAG : at32f415_flash.h
  • FLEX_CHANNEL1 : at32f415_dma.h
  • FLEX_CHANNEL2 : at32f415_dma.h
  • FLEX_CHANNEL3 : at32f415_dma.h
  • FLEX_CHANNEL4 : at32f415_dma.h
  • FLEX_CHANNEL5 : at32f415_dma.h
  • FLEX_CHANNEL6 : at32f415_dma.h
  • FLEX_CHANNEL7 : at32f415_dma.h
  • FZC_TIMEOUT : at32f415_can.h


AT32F415 Firmwary Library: Globals

- g -

  • GET_LINE_CODING : cdc_class.h, cdc_keyboard_class.h, msc_bot_scsi.h, printer_class.h
  • GPIO_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • GPIO_PINS_0 : at32f415_gpio.h
  • GPIO_PINS_1 : at32f415_gpio.h
  • GPIO_PINS_10 : at32f415_gpio.h
  • GPIO_PINS_11 : at32f415_gpio.h
  • GPIO_PINS_12 : at32f415_gpio.h
  • GPIO_PINS_13 : at32f415_gpio.h
  • GPIO_PINS_14 : at32f415_gpio.h
  • GPIO_PINS_15 : at32f415_gpio.h
  • GPIO_PINS_2 : at32f415_gpio.h
  • GPIO_PINS_3 : at32f415_gpio.h
  • GPIO_PINS_4 : at32f415_gpio.h
  • GPIO_PINS_5 : at32f415_gpio.h
  • GPIO_PINS_6 : at32f415_gpio.h
  • GPIO_PINS_7 : at32f415_gpio.h
  • GPIO_PINS_8 : at32f415_gpio.h
  • GPIO_PINS_9 : at32f415_gpio.h
  • GPIO_PINS_ALL : at32f415_gpio.h
  • GPIOA : at32f415_gpio.h
  • GPIOA_BASE : at32f415.h
  • GPIOB : at32f415_gpio.h
  • GPIOB_BASE : at32f415.h
  • GPIOC : at32f415_gpio.h
  • GPIOC_BASE : at32f415.h
  • GPIOD : at32f415_gpio.h
  • GPIOD_BASE : at32f415.h
  • GPIOF : at32f415_gpio.h
  • GPIOF_BASE : at32f415.h


AT32F415 Firmwary Library: Globals

- h -

  • HBYTE : usb_std.h
  • HEXT_STABLE_DELAY : system_at32f415.h
  • HEXT_STARTUP_TIMEOUT : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • HEXT_VALUE : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • HICK_VALUE : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • HID_BCD_NUM : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • HID_BINTERVAL_TIME : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • HID_CLASS_DESC_HID : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • HID_CLASS_DESC_PHYSICAL : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • HID_CLASS_DESC_REPORT : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • HID_DESCRIPTOR_TYPE : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_IAP_BUFFER_LEN : hid_iap_class.h
  • HID_INTERFACE_NUMBER : audio_hid_desc.h
  • HID_KEYBOARD_INTERFACE : cdc_keyboard_desc.h
  • HID_REPORT_DESC : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_REPORT_ID_1 : audio_hid_desc.h, custom_hid_desc.h
  • HID_REPORT_ID_2 : audio_hid_desc.h, custom_hid_desc.h
  • HID_REPORT_ID_3 : audio_hid_desc.h, custom_hid_desc.h
  • HID_REPORT_ID_4 : audio_hid_desc.h, custom_hid_desc.h
  • HID_REPORT_ID_5 : audio_hid_desc.h, custom_hid_desc.h
  • HID_REPORT_ID_6 : audio_hid_desc.h, custom_hid_desc.h
  • HID_REQ_GET_IDLE : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_REQ_GET_PROTOCOL : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_REQ_GET_REPORT : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_REQ_SET_IDLE : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_REQ_SET_PROTOCOL : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HID_REQ_SET_REPORT : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • HIST_LENGTH : project/at_start_f415/examples/usart/smartcard/src/main.c


AT32F415 Firmwary Library: Globals

- i -

  • I2C1 : at32f415_i2c.h
  • I2C1_BASE : at32f415.h
  • I2C1_GMUX_0001 : at32f415_gpio.h
  • I2C1_GMUX_0010 : at32f415_gpio.h
  • I2C1_MUX : at32f415_gpio.h
  • I2C2 : at32f415_i2c.h
  • I2C2_BASE : at32f415.h
  • I2C2_GMUX_0001 : at32f415_gpio.h
  • I2C2_GMUX_0010 : at32f415_gpio.h
  • I2C2_GMUX_0011 : at32f415_gpio.h
  • I2C_ACKFAIL_FLAG : at32f415_i2c.h
  • I2C_ADDR2_FLAG : at32f415_i2c.h
  • I2C_ADDR7F_FLAG : at32f415_i2c.h
  • I2C_ADDRHF_FLAG : at32f415_i2c.h
  • I2C_ALERTF_FLAG : at32f415_i2c.h
  • I2C_ARLOST_FLAG : at32f415_i2c.h
  • I2C_BUSERR_FLAG : at32f415_i2c.h
  • I2C_BUSYF_FLAG : at32f415_i2c.h
  • I2C_DATA_INT : at32f415_i2c.h
  • I2C_DEVADDRF_FLAG : at32f415_i2c.h
  • I2C_DIRF_FLAG : at32f415_i2c.h
  • I2C_END : i2c_application.c
  • I2C_ERR_INT : at32f415_i2c.h
  • I2C_EVENT_CHECK_ACKFAIL : i2c_application.h
  • I2C_EVENT_CHECK_NONE : i2c_application.h
  • I2C_EVENT_CHECK_STOP : i2c_application.h
  • I2C_EVT_INT : at32f415_i2c.h
  • I2C_GCADDRF_FLAG : at32f415_i2c.h
  • I2C_HOSTADDRF_FLAG : at32f415_i2c.h
  • I2C_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • I2C_OUF_FLAG : at32f415_i2c.h
  • I2C_PECERR_FLAG : at32f415_i2c.h
  • I2C_RDBF_FLAG : at32f415_i2c.h
  • I2C_START : i2c_application.c
  • I2C_STARTF_FLAG : at32f415_i2c.h
  • I2C_STOPF_FLAG : at32f415_i2c.h
  • I2C_TDBE_FLAG : at32f415_i2c.h
  • I2C_TDC_FLAG : at32f415_i2c.h
  • I2C_TIMEOUT : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2C_TMOUT_FLAG : at32f415_i2c.h
  • I2C_TRMODE_FLAG : at32f415_i2c.h
  • I2Cx_ADDRESS : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_CLK : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_DMA_CLK : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_DMA_RX_CHANNEL : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_DMA_RX_IRQHandler : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • I2Cx_DMA_RX_IRQn : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_DMA_TX_CHANNEL : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_DMA_TX_IRQHandler : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • I2Cx_DMA_TX_IRQn : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_ERR_IRQHandler : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • I2Cx_ERR_IRQn : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_EVT_IRQHandler : project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c, project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c, project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
  • I2Cx_EVT_IRQn : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_PORT : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SCL_GPIO_CLK : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SCL_GPIO_PIN : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SCL_GPIO_PORT : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SCL_PIN : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_SDA_GPIO_CLK : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SDA_GPIO_PIN : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SDA_GPIO_PORT : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2Cx_SDA_PIN : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c
  • I2Cx_SPEED : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c, project/at_start_f415/examples/i2c/eeprom/src/main.c, audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • I2S1_CK_PIN : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S1_DT_ADDRESS : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S1_GPIO : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S1_GPIO_CRM_CLK : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S1_SD_PIN : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S1_WS_PIN : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S2_CK_PIN : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S2_DT_ADDRESS : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S2_GPIO : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S2_GPIO_CRM_CLK : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S2_SD_PIN : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S2_WS_PIN : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • I2S_ACS_FLAG : at32f415_spi.h
  • I2S_TUERR_FLAG : at32f415_spi.h
  • IAP_ACK : hid_iap_class.h
  • IAP_CMD_ADDR : hid_iap_class.h
  • IAP_CMD_CRC : hid_iap_class.h
  • IAP_CMD_DATA : hid_iap_class.h
  • IAP_CMD_FINISH : hid_iap_class.h
  • IAP_CMD_GET : hid_iap_class.h
  • IAP_CMD_IDLE : hid_iap_class.h
  • IAP_CMD_JMP : hid_iap_class.h
  • IAP_CMD_START : hid_iap_class.h
  • IAP_ERROR : flash_fat16.h
  • IAP_NACK : hid_iap_class.h
  • IAP_REV_FLAG_5A : app_led3_toggle/inc/usart.h, app_led4_toggle/inc/usart.h
  • IAP_REV_FLAG_DONE : app_led3_toggle/inc/usart.h, app_led4_toggle/inc/usart.h
  • IAP_REV_FLAG_ERROR : app_led3_toggle/inc/usart.h, app_led4_toggle/inc/usart.h
  • IAP_REV_FLAG_NO : app_led3_toggle/inc/usart.h, app_led4_toggle/inc/usart.h
  • IAP_SUCCESS : flash_fat16.h
  • IAP_UPGRADE_COMPLETE_FLAG : hid_iap_class.h, flash_fat16.h
  • IAP_UPGRADE_FLAG : app_led3_toggle/inc/iap.h, app_led4_toggle/inc/iap.h, bootloader/inc/iap.h
  • IAP_UPGRADE_FLAG_ADDR : app_led3_toggle/inc/iap.h, app_led4_toggle/inc/iap.h, bootloader/inc/iap.h
  • INCLUDE_uxTaskPriorityGet : FreeRTOSConfig.h
  • INCLUDE_vTaskCleanUpResources : FreeRTOSConfig.h
  • INCLUDE_vTaskDelay : FreeRTOSConfig.h
  • INCLUDE_vTaskDelayUntil : FreeRTOSConfig.h
  • INCLUDE_vTaskDelete : FreeRTOSConfig.h
  • INCLUDE_vTaskPrioritySet : FreeRTOSConfig.h
  • INCLUDE_vTaskSuspend : FreeRTOSConfig.h
  • INCLUDE_xTaskGetCurrentTaskHandle : FreeRTOSConfig.h
  • INTERNAL_FLASH_LUN : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • INVAILD_OFFSET_ADDR : flash_fat16.h
  • INVALID_COMMAND : msc_bot_scsi.h
  • INVALID_FIELD_IN_PARAMETER_LIST : msc_bot_scsi.h
  • INVALID_FIELED_IN_COMMAND : msc_bot_scsi.h
  • IOMUX : at32f415_gpio.h
  • IOMUX_BASE : at32f415.h
  • IOMUX_MAKE_VALUE : at32f415_gpio.h


AT32F415 Firmwary Library: Globals

- k -

  • KB_TO_B : hid_iap_class.h
  • KEYBOARD_LEFT_ALT : usbh_hid_keyboard.h
  • KEYBOARD_LEFT_CTRL : usbh_hid_keyboard.h
  • KEYBOARD_LEFT_GUI : usbh_hid_keyboard.h
  • KEYBOARD_LEFT_SHIFT : usbh_hid_keyboard.h
  • KEYBOARD_MAX_NB_PRESSED : usbh_hid_keyboard.h
  • KEYBOARD_RIGHT_ALT : usbh_hid_keyboard.h
  • KEYBOARD_RIGHT_CTRL : usbh_hid_keyboard.h
  • KEYBOARD_RIGHT_GUI : usbh_hid_keyboard.h
  • KEYBOARD_RIGHT_SHIFT : usbh_hid_keyboard.h


AT32F415 Firmwary Library: Globals

- l -

  • LBYTE : usb_std.h
  • LED_NUM : at32f415_board.h
  • LEFT_BUTTON : mouse_class.h
  • LEFT_MOVE : mouse_class.h


AT32F415 Firmwary Library: Globals

- m -

  • MAKE_VALUE : at32f415.h
  • MASTER_BOARD : project/at_start_f415/examples/i2c/communication_dma/src/main.c, project/at_start_f415/examples/i2c/communication_int/src/main.c, project/at_start_f415/examples/i2c/communication_poll/src/main.c
  • MATCH_ID_VAL : project/at_start_f415/examples/usart/receiver_mute/src/main.c
  • MAX : usb_std.h
  • MCU_ID1 : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • MCU_ID2 : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • MCU_ID3 : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • MEDIUM_HAVE_CHANGED : msc_bot_scsi.h
  • MEDIUM_NOT_PRESENT : msc_bot_scsi.h
  • MIC_BUFFER_SIZE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • MIN : usb_std.h
  • MISC_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • MMC_SWITCH_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • MOUSE_BUTTON_LEFT : usbh_hid_mouse.h
  • MOUSE_BUTTON_MIDDLE : usbh_hid_mouse.h
  • MOUSE_BUTTON_RIGHT : usbh_hid_mouse.h
  • MOUSE_WINDOW_HEIGHT : usbh_hid_mouse.h
  • MOUSE_WINDOW_WIDTH : usbh_hid_mouse.h
  • MOUSE_WINDOW_X : usbh_hid_mouse.h
  • MOUSE_WINDOW_Y : usbh_hid_mouse.h
  • MOVE_STEP : mouse_class.h
  • MS_TICK : project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c
  • MSC_BOT_STATE_ERROR : msc_bot_scsi.h
  • MSC_BOT_STATE_IDLE : msc_bot_scsi.h
  • MSC_BOT_STATE_RECOVERY : msc_bot_scsi.h
  • MSC_CAPACITY10_CMD_LEN : usbh_msc_bot_scsi.h
  • MSC_CAPACITY10_DATA_LEN : usbh_msc_bot_scsi.h
  • MSC_CBW_CB_LEN : usbh_msc_bot_scsi.h
  • MSC_CBW_FLAG_IN : usbh_msc_bot_scsi.h
  • MSC_CBW_FLAG_OUT : usbh_msc_bot_scsi.h
  • MSC_CBW_LEN : usbh_msc_bot_scsi.h
  • MSC_CBW_SIGNATURE : usbh_msc_bot_scsi.h
  • MSC_CBW_TAG : usbh_msc_bot_scsi.h
  • MSC_CMD_ALLOW_MEDIUM_REMOVAL : msc_bot_scsi.h
  • MSC_CMD_FORMAT_UNIT : msc_bot_scsi.h
  • MSC_CMD_INQUIRY : msc_bot_scsi.h
  • MSC_CMD_MODE_SENSE10 : msc_bot_scsi.h
  • MSC_CMD_MODE_SENSE6 : msc_bot_scsi.h
  • MSC_CMD_READ_10 : msc_bot_scsi.h
  • MSC_CMD_READ_12 : msc_bot_scsi.h
  • MSC_CMD_READ_CAPACITY : msc_bot_scsi.h
  • MSC_CMD_READ_FORMAT_CAPACITY : msc_bot_scsi.h
  • MSC_CMD_REQUEST_SENSE : msc_bot_scsi.h
  • MSC_CMD_START_STOP : msc_bot_scsi.h
  • MSC_CMD_TEST_UNIT : msc_bot_scsi.h
  • MSC_CMD_VERIFY : msc_bot_scsi.h
  • MSC_CMD_WRITE_10 : msc_bot_scsi.h
  • MSC_CMD_WRITE_12 : msc_bot_scsi.h
  • MSC_CMD_WRITE_VERIFY : msc_bot_scsi.h
  • MSC_CSW_LEN : usbh_msc_bot_scsi.h
  • MSC_CSW_SIGNATURE : usbh_msc_bot_scsi.h
  • MSC_INQUIRY_CMD_LEN : usbh_msc_bot_scsi.h
  • MSC_INQUIRY_DATA_LEN : usbh_msc_bot_scsi.h
  • MSC_MAX_DATA_BUF_LEN : msc_bot_scsi.h
  • MSC_OPCODE_CAPACITY : usbh_msc_bot_scsi.h
  • MSC_OPCODE_INQUIRY : usbh_msc_bot_scsi.h
  • MSC_OPCODE_READ10 : usbh_msc_bot_scsi.h
  • MSC_OPCODE_REQUEST_SENSE : usbh_msc_bot_scsi.h
  • MSC_OPCODE_TEST_UNIT_READY : usbh_msc_bot_scsi.h
  • MSC_OPCODE_WRITE10 : usbh_msc_bot_scsi.h
  • MSC_PROTOCOL_BBB : usbh_msc_class.h
  • MSC_READ_CMD_LEN : usbh_msc_bot_scsi.h
  • MSC_REQ_BO_RESET : msc_bot_scsi.h
  • MSC_REQ_BOMSR : usbh_msc_class.h
  • MSC_REQ_GET_MAX_LUN : msc_bot_scsi.h, usbh_msc_class.h
  • MSC_REQUEST_SENSE_CMD_LEN : usbh_msc_bot_scsi.h
  • MSC_REQUEST_SENSE_DATA_LEN : usbh_msc_bot_scsi.h
  • MSC_STATE_MACHINE_CMD : msc_bot_scsi.h
  • MSC_STATE_MACHINE_DATA_IN : msc_bot_scsi.h
  • MSC_STATE_MACHINE_DATA_OUT : msc_bot_scsi.h
  • MSC_STATE_MACHINE_FAILED : msc_bot_scsi.h
  • MSC_STATE_MACHINE_IDLE : msc_bot_scsi.h
  • MSC_STATE_MACHINE_LAST_DATA : msc_bot_scsi.h
  • MSC_STATE_MACHINE_SEND_DATA : msc_bot_scsi.h
  • MSC_STATE_MACHINE_STATUS : msc_bot_scsi.h
  • MSC_SUBCLASS_SCSI_TRANS : usbh_msc_class.h
  • MSC_SUPPORT_MAX_LUN : msc_bot_scsi.h
  • MSC_TEST_UNIT_READY_CMD_LEN : usbh_msc_bot_scsi.h
  • MSC_TEST_UNIT_READY_DATA_LEN : usbh_msc_bot_scsi.h
  • MSC_WRITE_CMD_LEN : usbh_msc_bot_scsi.h
  • MULTI_BUFFER_SIZE : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c


AT32F415 Firmwary Library: Globals

- n -

  • NULL : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • NUM_TAPS : fir_coefficient.c, fir_filter.c
  • NVIC_VECTTAB_FLASH : at32f415_misc.h
  • NVIC_VECTTAB_RAM : at32f415_misc.h


AT32F415 Firmwary Library: Globals

- o -

  • OPERATION_TIMEOUT : at32f415_flash.h
  • OTG1_GLOBAL : at32f415_usb.h
  • OTG_CLOCK : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_DEVICE : at32f415_usb.h
  • OTG_DEVICE_ADDR_OFFSET : at32f415_usb.h
  • OTG_DEVICE_EPTIN_ADDR_OFFSET : at32f415_usb.h
  • OTG_DEVICE_EPTOUT_ADDR_OFFSET : at32f415_usb.h
  • OTG_FIFO_ADDR_OFFSET : at32f415_usb.h
  • OTG_FIFO_SIZE : at32f415_usb.h
  • OTG_HOST : at32f415_usb.h
  • OTG_HOST_ADDR_OFFSET : at32f415_usb.h
  • OTG_HOST_CHANNEL_ADDR_OFFSET : at32f415_usb.h
  • OTG_IRQ : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_IRQ_HANDLER : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_PCGCCTL : at32f415_usb.h
  • OTG_PCGCCTL_ADDR_OFFSET : at32f415_usb.h
  • OTG_PIN_DM : project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h
  • OTG_PIN_DP : project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h
  • OTG_PIN_GPIO : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_PIN_GPIO_CLOCK : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_PIN_ID : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_PIN_POWER_SWITCH : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • OTG_PIN_POWER_SWITCH_CLOCK : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • OTG_PIN_POWER_SWITCH_GPIO : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • OTG_PIN_SOF : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_PIN_SOF_GPIO : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_PIN_SOF_GPIO_CLOCK : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_PIN_VBUS : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_WKUP_EXINT_LINE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_WKUP_HANDLER : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTG_WKUP_IRQ : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • OTGFS1_BASE : at32f415.h
  • OTGFS_USB_DEVICE : at32f415_usb.h
  • OTGFS_USB_GLOBAL : at32f415_usb.h
  • OTGFS_USB_HOST : at32f415_usb.h


AT32F415 Firmwary Library: Globals

- p -

  • PARAMETER_LIST_LENGTH_ERROR : msc_bot_scsi.h
  • PD01_GMUX : at32f415_gpio.h
  • PD01_MUX : at32f415_gpio.h
  • PERIPH_BASE : at32f415.h
  • PERIPH_REG : at32f415.h
  • PERIPH_REG_BIT : at32f415.h
  • PERIPHERAL_BASE : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • PERIPHERAL_BITBAND_BASE : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • PERIPHERAL_RESET_BIT : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • PERIPHERAL_SET_BIT : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • PKTSTS_CHANNEL_STOP : at32f415_usb.h
  • PKTSTS_DATA_BIT_ERROR : at32f415_usb.h
  • PKTSTS_IN_DATA_PACKET_RECV : at32f415_usb.h
  • PKTSTS_IN_TRANSFER_COMPLETE : at32f415_usb.h
  • PLL_STABLE_DELAY : system_at32f415.h
  • PRINT_UART : at32f415_board.h
  • PRINT_UART_CRM_CLK : at32f415_board.h
  • PRINT_UART_TX_GPIO : at32f415_board.h
  • PRINT_UART_TX_GPIO_CRM_CLK : at32f415_board.h
  • PRINT_UART_TX_PIN : at32f415_board.h
  • PRINTER_DEVICE_ID_LEN : printer_class.h
  • PRINTER_PROTOCOL_1284_4 : printer_desc.h
  • PRINTER_PROTOCOL_BI_DIRECTIONAL : printer_desc.h
  • PRINTER_PROTOCOL_UNIDIRECTIONAL : printer_desc.h
  • PRINTER_PROTOCOL_VENDOR_SPECIFIC : printer_desc.h
  • PROGRAMMING_TIMEOUT : at32f415_flash.h
  • PUTCHAR_PROTOTYPE : at32f415_board.c
  • PWC : at32f415_pwc.h
  • PWC_BASE : at32f415.h
  • PWC_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • PWC_PVM_OUTPUT_FLAG : at32f415_pwc.h
  • PWC_STANDBY_FLAG : at32f415_pwc.h
  • PWC_WAKEUP_FLAG : at32f415_pwc.h
  • PWC_WAKEUP_PIN_1 : at32f415_pwc.h


AT32F415 Firmwary Library: Globals

- q -

  • QWERTY_KEYBOARD : usbh_hid_keyboard.h


AT32F415 Firmwary Library: Globals

- r -

  • RAM_BASE : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • RAM_BITBAND_BASE : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • REG16 : at32f415.h
  • REG32 : at32f415.h
  • REG8 : at32f415.h
  • REQ_SENSE_STANDARD_DATA_LEN : msc_bot_scsi.h
  • RIGHT_BUTTON : mouse_class.h
  • RIGHT_MOVE : mouse_class.h


AT32F415 Firmwary Library: Globals

- s -

  • SAMPLE_FREQ : audio_desc.h, audio_hid_desc.h
  • SAMPLING_NUM : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • SC_3_5V_CLK : smartcard_config.h
  • SC_3_5V_PIN : smartcard_config.h
  • SC_3_5V_PORT : smartcard_config.h
  • SC_CMDVCC_CLK : smartcard_config.h
  • SC_CMDVCC_PIN : smartcard_config.h
  • SC_CMDVCC_PORT : smartcard_config.h
  • SC_OFF_CLK : smartcard_config.h
  • SC_OFF_EXINT : smartcard_config.h
  • SC_OFF_EXINT_IRQ : smartcard_config.h
  • SC_OFF_PIN : smartcard_config.h
  • SC_OFF_PINSOURCE : smartcard_config.h
  • SC_OFF_PORT : smartcard_config.h
  • SC_OFF_PORTSOURCE : smartcard_config.h
  • SC_RECEIVE_TIMEOUT : project/at_start_f415/examples/usart/smartcard/src/main.c
  • SC_RESET_CLK : smartcard_config.h
  • SC_RESET_PIN : smartcard_config.h
  • SC_RESET_PORT : smartcard_config.h
  • SC_USART : smartcard_config.h
  • SC_USART_CLK : smartcard_config.h
  • SC_USART_CLK_PIN : smartcard_config.h
  • SC_USART_CLK_PORT : smartcard_config.h
  • SC_USART_GPIO_CLK : smartcard_config.h
  • SC_USART_IRQHandler : smartcard_config.h
  • SC_USART_IRQn : smartcard_config.h
  • SC_USART_TX_PIN : smartcard_config.h
  • SC_USART_TX_PORT : smartcard_config.h
  • SCSI_INQUIRY_DATA_LENGTH : msc_bot_scsi.h
  • SD_0TO7BITS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_16TO23BITS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_24TO31BITS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_8TO15BITS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_ALLZERO : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_LOCKED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_PROGRAMMING : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CARD_RECEIVING : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CCCC_ERASE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CCCC_LOCK_UNLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CCCC_WRITE_PROT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CHECK_PATTERN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_ALL_SEND_CID : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_APP_CMD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_APP_SD_SET_BUSWIDTH : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_CLR_WRITE_PROT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_ERASE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_ERASE_GRP_END : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_ERASE_GRP_START : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_FAST_IO : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_GEN_CMD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_GO_IDLE_STATE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_GO_INACTIVE_STATE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_GO_IRQ_STATE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_HS_BUSTEST_READ : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_HS_BUSTEST_WRITE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_HS_SEND_EXT_CSD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_HS_SWITCH : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_LOCK_UNLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_NO_CMD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_PROG_CID : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_PROG_CSD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_READ_DAT_UNTIL_STOP : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_READ_MULT_BLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_READ_SINGLE_BLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_CHANGE_SECURE_AREA : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_GET_CER_RES1 : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_GET_CER_RN2 : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_GET_MID : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_GET_MKB : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_OP_COND : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SECURE_ERASE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SECURE_WRITE_MKB : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SEND_SCR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SET_CER_RES2 : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SET_CER_RN1 : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_SET_CLR_CARD_DETECT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_APP_STAUS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_ERASE_GRP_END : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SD_ERASE_GRP_START : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SDIO_RW_DIRECT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SDIO_RW_EXTENDED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SDIO_SEN_OP_COND : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SEL_DESEL_CARD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SEND_CID : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SEND_CSD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SEND_OP_COND : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SEND_STATUS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SEND_WRITE_PROT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SET_BLOCK_COUNT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SET_BLOCKLEN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SET_DSR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SET_REL_ADDR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_SET_WRITE_PROT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_STOP_TRANSMISSION : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_WRITE_DAT_UNTIL_STOP : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_WRITE_MULT_BLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_CMD_WRITE_SINGLE_BLOCK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_DATATIMEOUT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_HALFFIFO : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_HALFFIFOBYTES : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_HIGH_CAPACITY : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_LUN : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • SD_MAX_DATA_LENGTH : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_MAX_VOLT_TRIAL : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_ADDR_MISALIGNED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_ADDR_OUT_OF_RANGE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_AKE_SEQ_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_BLK_LEN_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_CARD_CONTROLLER_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_CARD_ECC_DISABLED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_CARD_ECC_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_CID_CSD_OVERWRIETE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_CMD_CRC_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_ERASE_RESET : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_ERASE_SEQ_ERR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_ERRORBITS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_GENERAL_UNKNOWN_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_ILLEGAL_CMD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_INVALID_ERASE_PARAM : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_LOCK_UNLOCK_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_STREAM_RD_UNDERRUN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_STREAM_WR_OVERRUN : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_WP_ERASE_SKIP : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_OCR_WR_PROTECT_VIOLATION : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_R5_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_R5_FUNCTION_NUMBER : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_R5_OUT_OF_RANGE : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_R6_CMD_CRC_FAILED : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_R6_GENERAL_UNKNOWN_ERROR : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_R6_ILLEGAL_CMD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_SINGLE_BUS_SUPPORT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_STD_CAPACITY : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_VOLTAGE_WINDOW_MMC : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_VOLTAGE_WINDOW_SD : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SD_WIDE_BUS_SUPPORT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO1 : at32f415_sdio.h
  • SDIO1_BASE : at32f415.h
  • SDIO1_GMUX_0100 : at32f415_gpio.h
  • SDIO1_GMUX_0101 : at32f415_gpio.h
  • SDIO1_GMUX_0110 : at32f415_gpio.h
  • SDIO1_GMUX_0111 : at32f415_gpio.h
  • SDIO_CMD0TIMEOUT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_CMDCMPL_FLAG : at32f415_sdio.h
  • SDIO_CMDCMPL_INT : at32f415_sdio.h
  • SDIO_CMDFAIL_FLAG : at32f415_sdio.h
  • SDIO_CMDFAIL_INT : at32f415_sdio.h
  • SDIO_CMDRSPCMPL_FLAG : at32f415_sdio.h
  • SDIO_CMDRSPCMPL_INT : at32f415_sdio.h
  • SDIO_CMDTIMEOUT_FLAG : at32f415_sdio.h
  • SDIO_CMDTIMEOUT_INT : at32f415_sdio.h
  • SDIO_DATATIMEOUT : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_DOCMD_FLAG : at32f415_sdio.h
  • SDIO_DOCMD_INT : at32f415_sdio.h
  • SDIO_DORX_FLAG : at32f415_sdio.h
  • SDIO_DORX_INT : at32f415_sdio.h
  • SDIO_DOTX_FLAG : at32f415_sdio.h
  • SDIO_DOTX_INT : at32f415_sdio.h
  • SDIO_DTBLKCMPL_FLAG : at32f415_sdio.h
  • SDIO_DTBLKCMPL_INT : at32f415_sdio.h
  • SDIO_DTCMP_INT : at32f415_sdio.h
  • SDIO_DTCMPL_FLAG : at32f415_sdio.h
  • SDIO_DTFAIL_FLAG : at32f415_sdio.h
  • SDIO_DTFAIL_INT : at32f415_sdio.h
  • SDIO_DTTIMEOUT_FLAG : at32f415_sdio.h
  • SDIO_DTTIMEOUT_INT : at32f415_sdio.h
  • SDIO_FIFO_Address : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_INTR_STS_READ_MASK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_INTR_STS_WRITE_MASK : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • SDIO_RXBUF_FLAG : at32f415_sdio.h
  • SDIO_RXBUF_INT : at32f415_sdio.h
  • SDIO_RXBUFE_FLAG : at32f415_sdio.h
  • SDIO_RXBUFE_INT : at32f415_sdio.h
  • SDIO_RXBUFF_FLAG : at32f415_sdio.h
  • SDIO_RXBUFF_INT : at32f415_sdio.h
  • SDIO_RXBUFH_FLAG : at32f415_sdio.h
  • SDIO_RXBUFH_INT : at32f415_sdio.h
  • SDIO_RXERRO_FLAG : at32f415_sdio.h
  • SDIO_RXERRO_INT : at32f415_sdio.h
  • SDIO_SBITERR_FLAG : at32f415_sdio.h
  • SDIO_SBITERR_INT : at32f415_sdio.h
  • SDIO_SDIOIF_FLAG : at32f415_sdio.h
  • SDIO_SDIOIF_INT : at32f415_sdio.h
  • SDIO_SEND_IF_COND : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_STATIC_FLAGS : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SDIO_TXBUF_FLAG : at32f415_sdio.h
  • SDIO_TXBUF_INT : at32f415_sdio.h
  • SDIO_TXBUFE_FLAG : at32f415_sdio.h
  • SDIO_TXBUFE_INT : at32f415_sdio.h
  • SDIO_TXBUFF_FLAG : at32f415_sdio.h
  • SDIO_TXBUFF_INT : at32f415_sdio.h
  • SDIO_TXBUFH_FLAG : at32f415_sdio.h
  • SDIO_TXBUFH_INT : at32f415_sdio.h
  • SDIO_TXERRU_FLAG : at32f415_sdio.h
  • SDIO_TXERRU_INT : at32f415_sdio.h
  • SDIOx : sd_mmc_card/inc/at32_sdio.h, sdio_fatfs/inc/at32_sdio.h
  • SECTOR_NUM : utilities/at32f415_slib_demo/project_l0/src/main.c
  • SECTOR_SIZE : project/at_start_f415/examples/flash/flash_write_read/src/flash.c
  • SECTOR_SIZE_1K : hid_iap_class.h, msc/inc/msc_diskio.h
  • SECTOR_SIZE_2K : hid_iap_class.h, msc/inc/msc_diskio.h
  • SECTOR_SIZE_4K : hid_iap_class.h, msc/inc/msc_diskio.h
  • SECTOR_WORD_CNT : utilities/at32f415_slib_demo/project_l0/src/main.c
  • SENSE_KEY_ABORTED_COMMAND : msc_bot_scsi.h
  • SENSE_KEY_BLANK_CHECK : msc_bot_scsi.h
  • SENSE_KEY_DATA_PROTECT : msc_bot_scsi.h
  • SENSE_KEY_HARDWARE_ERROR : msc_bot_scsi.h
  • SENSE_KEY_ILLEGAL_REQUEST : msc_bot_scsi.h
  • SENSE_KEY_MEDIUM_ERROR : msc_bot_scsi.h
  • SENSE_KEY_MISCOMPARE : msc_bot_scsi.h
  • SENSE_KEY_NO_SENSE : msc_bot_scsi.h
  • SENSE_KEY_NOT_READY : msc_bot_scsi.h
  • SENSE_KEY_RECOVERED_ERROR : msc_bot_scsi.h
  • SENSE_KEY_UNIT_ATTENTION : msc_bot_scsi.h
  • SENSE_KEY_VENDERO_SPECIFIC : msc_bot_scsi.h
  • SENSE_KEY_VOLUME_OVERFLOW : msc_bot_scsi.h
  • SET_LINE_CODING : cdc_class.h, cdc_keyboard_class.h, msc_bot_scsi.h, printer_class.h
  • SETUP_LENGTH : project/at_start_f415/examples/usart/smartcard/src/main.c
  • SHIFT : cdc_keyboard_class.c, keyboard_class.c
  • SLIB_DATA_ADDR : utilities/at32f415_slib_demo/project_l0/src/main.c
  • SLIB_END_ADDR : utilities/at32f415_slib_demo/project_l0/src/main.c
  • SLIB_START_ADDR : utilities/at32f415_slib_demo/project_l0/src/main.c
  • SLIB_UNLOCK_KEY : at32f415_flash.h
  • SLOW : project/at_start_f415/templates/src/main.c
  • SNR_THRESHOLD_F32 : utilities/at32f415_slib_demo/project_l0/src/main.c, utilities/at32f415_slib_demo/project_l1/src/main.c
  • SPI1 : at32f415_spi.h
  • SPI1_BASE : at32f415.h
  • SPI1_GMUX_0001 : at32f415_gpio.h
  • SPI1_MUX_01 : at32f415_gpio.h
  • SPI2 : at32f415_spi.h
  • SPI2_BASE : at32f415.h
  • SPI2_GMUX_0001 : at32f415_gpio.h
  • SPI2_TX_BUFFER_SIZE : project/at_start_f415/examples/usart/synchronous/src/main.c
  • SPI_CCERR_FLAG : at32f415_spi.h
  • SPI_FLASH_LUN : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • SPI_I2S_BF_FLAG : at32f415_spi.h
  • SPI_I2S_ERROR_INT : at32f415_spi.h
  • SPI_I2S_RDBF_FLAG : at32f415_spi.h
  • SPI_I2S_RDBF_INT : at32f415_spi.h
  • SPI_I2S_ROERR_FLAG : at32f415_spi.h
  • SPI_I2S_TDBE_FLAG : at32f415_spi.h
  • SPI_I2S_TDBE_INT : at32f415_spi.h
  • SPI_MMERR_FLAG : at32f415_spi.h
  • SPI_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • SPIF_BLOCKERASE : spi_flash.h
  • SPIF_CHIP_SIZE : spi_flash.h
  • SPIF_CHIPERASE : spi_flash.h
  • SPIF_DEVICEID : spi_flash.h
  • SPIF_FASTREADDATA : spi_flash.h
  • SPIF_FASTREADDUAL : spi_flash.h
  • SPIF_JEDECDEVICEID : spi_flash.h
  • SPIF_MANUFACTDEVICEID : spi_flash.h
  • SPIF_PAGE_SIZE : spi_flash.h
  • SPIF_PAGEPROGRAM : spi_flash.h
  • SPIF_POWERDOWN : spi_flash.h
  • SPIF_READDATA : spi_flash.h
  • SPIF_READSTATUSREG1 : spi_flash.h
  • SPIF_READSTATUSREG2 : spi_flash.h
  • SPIF_READSTATUSREG3 : spi_flash.h
  • SPIF_RELEASEPOWERDOWN : spi_flash.h
  • SPIF_SECTOR_SIZE : spi_flash.h
  • SPIF_SECTORERASE : spi_flash.h
  • SPIF_WRITEDISABLE : spi_flash.h
  • SPIF_WRITEENABLE : spi_flash.h
  • SPIF_WRITESTATUSREG1 : spi_flash.h
  • SPIF_WRITESTATUSREG2 : spi_flash.h
  • SPIF_WRITESTATUSREG3 : spi_flash.h
  • SPIM_FLASH_BASE : at32f415.h
  • SPK_BUFFER_SIZE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • SPK_TX_FIFO_SIZE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • SRAM_BASE : at32f415.h
  • SRAM_SIZE : utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h
  • STEP_DELAY_MS : at32f415_board.c
  • STREAM_BUFFER_SIZE : project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
  • SWAPBYTE : usb_std.h
  • SWJTAG_GMUX_001 : at32f415_gpio.h
  • SWJTAG_GMUX_010 : at32f415_gpio.h
  • SWJTAG_GMUX_100 : at32f415_gpio.h
  • SWJTAG_MUX_001 : at32f415_gpio.h
  • SWJTAG_MUX_010 : at32f415_gpio.h
  • SWJTAG_MUX_100 : at32f415_gpio.h


AT32F415 Firmwary Library: Globals

- t -

  • T0_PROTOCOL : project/at_start_f415/examples/usart/smartcard/src/main.c
  • TEST_BUFEER_SIZE : project/at_start_f415/examples/flash/flash_write_read/src/main.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c
  • TEST_FLASH_ADDRESS_START : project/at_start_f415/examples/flash/flash_write_read/src/main.c, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c
  • TEST_LENGTH_SAMPLES : utilities/at32f415_slib_demo/project_l0/src/main.c, utilities/at32f415_slib_demo/project_l1/src/main.c
  • TEST_SLIB_PSW : utilities/at32f415_slib_demo/project_l0/src/main.c
  • TMR1 : at32f415_tmr.h
  • TMR10 : at32f415_tmr.h
  • TMR10_BASE : at32f415.h
  • TMR10_GMUX : at32f415_gpio.h
  • TMR11 : at32f415_tmr.h
  • TMR11_BASE : at32f415.h
  • TMR11_GMUX : at32f415_gpio.h
  • TMR12 : at32f415_tmr.h
  • TMR13 : at32f415_tmr.h
  • TMR14 : at32f415_tmr.h
  • TMR1_BASE : at32f415.h
  • TMR1_BK1_CMP_GMUX_10 : at32f415_gpio.h
  • TMR1_BK1_CMP_GMUX_11 : at32f415_gpio.h
  • TMR1_C1DT_ADDRESS : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • TMR1_C2DT_ADDRESS : project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
  • TMR1_CH1_CMP_GMUX_10 : at32f415_gpio.h
  • TMR1_CH1_CMP_GMUX_11 : at32f415_gpio.h
  • TMR1_GMUX_0001 : at32f415_gpio.h
  • TMR1_GMUX_0010 : at32f415_gpio.h
  • TMR1_MUX_01 : at32f415_gpio.h
  • TMR2 : at32f415_tmr.h
  • TMR2_BASE : at32f415.h
  • TMR2_CH4_CMP_GMUX_10 : at32f415_gpio.h
  • TMR2_CH4_CMP_GMUX_11 : at32f415_gpio.h
  • TMR2_GMUX_001 : at32f415_gpio.h
  • TMR2_GMUX_010 : at32f415_gpio.h
  • TMR2_GMUX_011 : at32f415_gpio.h
  • TMR2_MUX_01 : at32f415_gpio.h
  • TMR2_MUX_10 : at32f415_gpio.h
  • TMR2_MUX_11 : at32f415_gpio.h
  • TMR3 : at32f415_tmr.h
  • TMR3_BASE : at32f415.h
  • TMR3_CH1_CMP_GMUX_10 : at32f415_gpio.h
  • TMR3_CH1_CMP_GMUX_11 : at32f415_gpio.h
  • TMR3_GMUX_0010 : at32f415_gpio.h
  • TMR3_GMUX_0011 : at32f415_gpio.h
  • TMR3_MUX_10 : at32f415_gpio.h
  • TMR3_MUX_11 : at32f415_gpio.h
  • TMR4 : at32f415_tmr.h
  • TMR4_BASE : at32f415.h
  • TMR5 : at32f415_tmr.h
  • TMR5_BASE : at32f415.h
  • TMR5_GMUX_001 : at32f415_gpio.h
  • TMR5CH4_GMUX : at32f415_gpio.h
  • TMR5CH4_MUX : at32f415_gpio.h
  • TMR6 : at32f415_tmr.h
  • TMR7 : at32f415_tmr.h
  • TMR8 : at32f415_tmr.h
  • TMR9 : at32f415_tmr.h
  • TMR9_BASE : at32f415.h
  • TMR9_GMUX : at32f415_gpio.h
  • TMR_BRK_FLAG : at32f415_tmr.h
  • TMR_BRK_INT : at32f415_tmr.h
  • TMR_C1_FLAG : at32f415_tmr.h
  • TMR_C1_INT : at32f415_tmr.h
  • TMR_C1_RECAPTURE_FLAG : at32f415_tmr.h
  • TMR_C2_FLAG : at32f415_tmr.h
  • TMR_C2_INT : at32f415_tmr.h
  • TMR_C2_RECAPTURE_FLAG : at32f415_tmr.h
  • TMR_C3_FLAG : at32f415_tmr.h
  • TMR_C3_INT : at32f415_tmr.h
  • TMR_C3_RECAPTURE_FLAG : at32f415_tmr.h
  • TMR_C4_FLAG : at32f415_tmr.h
  • TMR_C4_INT : at32f415_tmr.h
  • TMR_C4_RECAPTURE_FLAG : at32f415_tmr.h
  • TMR_HALL_FLAG : at32f415_tmr.h
  • TMR_HALL_INT : at32f415_tmr.h
  • TMR_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • TMR_OVF_FLAG : at32f415_tmr.h
  • TMR_OVF_INT : at32f415_tmr.h
  • TMR_TRIGGER_FLAG : at32f415_tmr.h
  • TMR_TRIGGER_INT : at32f415_tmr.h


AT32F415 Firmwary Library: Globals

- u -

  • UART4 : at32f415_usart.h
  • UART4_BASE : at32f415.h
  • UART4_GMUX_0001 : at32f415_gpio.h
  • UART5 : at32f415_usart.h
  • UART5_BASE : at32f415.h
  • UP_MOVE : mouse_class.h
  • USART1 : at32f415_usart.h
  • USART1_BASE : at32f415.h
  • USART1_GMUX_0001 : at32f415_gpio.h
  • USART1_MUX : at32f415_gpio.h
  • USART2 : at32f415_usart.h
  • USART2_BASE : at32f415.h
  • USART2_TX_BUFFER_SIZE : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/synchronous/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • USART3 : at32f415_usart.h
  • USART3_BASE : at32f415.h
  • USART3_GMUX_0001 : at32f415_gpio.h
  • USART3_GMUX_0010 : at32f415_gpio.h
  • USART3_MUX_01 : at32f415_gpio.h
  • USART3_MUX_10 : at32f415_gpio.h
  • USART3_TX_BUFFER_SIZE : project/at_start_f415/examples/usart/half_duplex/src/main.c, project/at_start_f415/examples/usart/interrupt/src/main.c, project/at_start_f415/examples/usart/polling/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c, project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
  • USART_BF_INT : at32f415_usart.h
  • USART_BFF_FLAG : at32f415_usart.h
  • USART_CTSCF_FLAG : at32f415_usart.h
  • USART_CTSCF_INT : at32f415_usart.h
  • USART_ERR_INT : at32f415_usart.h
  • USART_FERR_FLAG : at32f415_usart.h
  • USART_IDLE_INT : at32f415_usart.h
  • USART_IDLEF_FLAG : at32f415_usart.h
  • USART_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • USART_NERR_FLAG : at32f415_usart.h
  • USART_PERR_FLAG : at32f415_usart.h
  • USART_PERR_INT : at32f415_usart.h
  • USART_RDBF_FLAG : at32f415_usart.h
  • USART_RDBF_INT : at32f415_usart.h
  • USART_REC_LEN : bootloader/inc/usart.h
  • USART_ROERR_FLAG : at32f415_usart.h
  • USART_TDBE_FLAG : at32f415_usart.h
  • USART_TDBE_INT : at32f415_usart.h
  • USART_TDC_FLAG : at32f415_usart.h
  • USART_TDC_INT : at32f415_usart.h
  • USB_CHL : at32f415_usb.h
  • USB_CLASS_CODE_AUDIO : usb_std.h
  • USB_CLASS_CODE_CCID : usb_std.h
  • USB_CLASS_CODE_CDC : usb_std.h
  • USB_CLASS_CODE_CDCDATA : usb_std.h
  • USB_CLASS_CODE_HID : usb_std.h
  • USB_CLASS_CODE_HUB : usb_std.h
  • USB_CLASS_CODE_MSC : usb_std.h
  • USB_CLASS_CODE_PRINTER : usb_std.h
  • USB_CLASS_CODE_VENDOR : usb_std.h
  • USB_CLASS_CODE_VIDEO : usb_std.h
  • USB_CONF_REMOTE_WAKEUP : usb_std.h
  • USB_CONF_SELF_POWERED : usb_std.h
  • USB_CONFIG_STRING : usb_std.h
  • USB_DCFG_FULL_SPEED : at32f415_usb.h
  • USB_DESCIPTOR_TYPE_CONFIGURATION : usb_std.h
  • USB_DESCIPTOR_TYPE_DEVICE : usb_std.h
  • USB_DESCIPTOR_TYPE_DEVICE_QUALIFIER : usb_std.h
  • USB_DESCIPTOR_TYPE_ENDPOINT : usb_std.h
  • USB_DESCIPTOR_TYPE_INTERFACE : usb_std.h
  • USB_DESCIPTOR_TYPE_INTERFACE_POWER : usb_std.h
  • USB_DESCIPTOR_TYPE_OTHER_SPEED : usb_std.h
  • USB_DESCIPTOR_TYPE_STRING : usb_std.h
  • USB_DEVICE_CFG_DESC_LEN : usb_std.h
  • USB_DEVICE_DESC_LEN : usb_std.h
  • USB_DEVICE_EPT_LEN : usb_std.h
  • USB_DEVICE_IF_DESC_LEN : usb_std.h
  • USB_DEVICE_LANGID_STR_DESC_LEN : usb_std.h
  • USB_DEVICE_OTG_DESC_LEN : usb_std.h
  • USB_DEVICE_OTHER_SPEED_DESC_SIZ_LEN : usb_std.h
  • USB_DEVICE_QUALIFIER_DESC_LEN : usb_std.h
  • USB_EPT0_DATA_IN : usb_std.h
  • USB_EPT0_DATA_OUT : usb_std.h
  • USB_EPT0_IDLE : usb_std.h
  • USB_EPT0_MPS_16 : at32f415_usb.h
  • USB_EPT0_MPS_32 : at32f415_usb.h
  • USB_EPT0_MPS_64 : at32f415_usb.h
  • USB_EPT0_MPS_8 : at32f415_usb.h
  • USB_EPT0_SETUP : usb_std.h
  • USB_EPT0_STALL : usb_std.h
  • USB_EPT0_STATUS_IN : usb_std.h
  • USB_EPT0_STATUS_OUT : usb_std.h
  • USB_EPT_DESC_BULK : usb_std.h
  • USB_EPT_DESC_CONTROL : usb_std.h
  • USB_EPT_DESC_DATA_EPT : usb_std.h
  • USB_EPT_DESC_FD_EPT : usb_std.h
  • USB_EPT_DESC_FDDATA_EPT : usb_std.h
  • USB_EPT_DESC_INTERRUPT : usb_std.h
  • USB_EPT_DESC_ISO : usb_std.h
  • USB_EPT_DESC_NSYNC : usb_std.h
  • USB_ETP_DESC_ADAPTIVE : usb_std.h
  • USB_ETP_DESC_ASYNC : usb_std.h
  • USB_ETP_DESC_SYNC : usb_std.h
  • USB_FEATURE_EPT_HALT : usb_std.h
  • USB_FEATURE_REMOTE_WAKEUP : usb_std.h
  • USB_FEATURE_TEST_MODE : usb_std.h
  • USB_FIFO : at32f415_usb.h
  • USB_FLASH_ADDR_OFFSET : msc/inc/msc_diskio.h, virtual_msc_iap/inc/msc_diskio.h
  • USB_HCFG_CLK_48M : at32f415_usb.h
  • USB_HCFG_CLK_60M : at32f415_usb.h
  • USB_HCFG_CLK_6M : at32f415_usb.h
  • USB_HID_GET_IDLE : usbh_hid_class.h, usbh_msc_class.h
  • USB_HID_GET_PROTOCOL : usbh_hid_class.h, usbh_msc_class.h
  • USB_HID_GET_REPORT : usbh_hid_class.h, usbh_msc_class.h
  • USB_HID_KEYBOARD_PROTOCOL_CODE : usbh_hid_class.h
  • USB_HID_MOUSE_PROTOCOL_CODE : usbh_hid_class.h
  • USB_HID_NONE_PROTOCOL_CODE : usbh_hid_class.h
  • USB_HID_SET_IDLE : usbh_hid_class.h, usbh_msc_class.h
  • USB_HID_SET_PROTOCOL : usbh_hid_class.h, usbh_msc_class.h
  • USB_HID_SET_REPORT : usbh_hid_class.h, usbh_msc_class.h
  • USB_ID : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • USB_INEPT : at32f415_usb.h
  • USB_INTERFACE_STRING : usb_std.h
  • USB_LANGID_STRING : usb_std.h
  • USB_LOW_POWER_WAKUP : project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h
  • USB_MAX_DATA_LENGTH : at32f415_usb.h
  • USB_MAX_EP0_SIZE : usb_std.h
  • USB_MFC_STRING : usb_std.h
  • USB_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • USB_OTG_CONIDSCHG_FLAG : at32f415_usb.h
  • USB_OTG_CONIDSCHG_INT : at32f415_usb.h
  • USB_OTG_CURMODE : at32f415_usb.h
  • USB_OTG_DCTL_CGNPINNAK : at32f415_usb.h
  • USB_OTG_DCTL_CGOUTNAK : at32f415_usb.h
  • USB_OTG_DCTL_GNPINNAKSTS : at32f415_usb.h
  • USB_OTG_DCTL_GOUTNAKSTS : at32f415_usb.h
  • USB_OTG_DCTL_PWROPRGDNE : at32f415_usb.h
  • USB_OTG_DCTL_RWKUPSIG : at32f415_usb.h
  • USB_OTG_DCTL_SFTDISCON : at32f415_usb.h
  • USB_OTG_DCTL_SGNPINNAK : at32f415_usb.h
  • USB_OTG_DCTL_SGOUTNAK : at32f415_usb.h
  • USB_OTG_DIEPINT_EPTDISD_FLAG : at32f415_usb.h
  • USB_OTG_DIEPINT_INEPTNAK_FLAG : at32f415_usb.h
  • USB_OTG_DIEPINT_INTKNTXFEMP_FLAG : at32f415_usb.h
  • USB_OTG_DIEPINT_TIMEOUT_FLAG : at32f415_usb.h
  • USB_OTG_DIEPINT_TXFEMP_FLAG : at32f415_usb.h
  • USB_OTG_DIEPINT_XFERC_FLAG : at32f415_usb.h
  • USB_OTG_DISCON_FLAG : at32f415_usb.h
  • USB_OTG_DISCON_INT : at32f415_usb.h
  • USB_OTG_DOEPINT_B2BSTUP_FLAG : at32f415_usb.h
  • USB_OTG_DOEPINT_EPTDISD_FLAG : at32f415_usb.h
  • USB_OTG_DOEPINT_OUTTEPD_FLAG : at32f415_usb.h
  • USB_OTG_DOEPINT_SETUP_FLAG : at32f415_usb.h
  • USB_OTG_DOEPINT_XFERC_FLAG : at32f415_usb.h
  • USB_OTG_DTXFSTS_INEPTFSAV : at32f415_usb.h
  • USB_OTG_ENUMDONE_FLAG : at32f415_usb.h
  • USB_OTG_ENUMDONE_INT : at32f415_usb.h
  • USB_OTG_EOPF_FLAG : at32f415_usb.h
  • USB_OTG_EOPF_INT : at32f415_usb.h
  • USB_OTG_ERLYSUSP_FLAG : at32f415_usb.h
  • USB_OTG_ERLYSUSP_INT : at32f415_usb.h
  • USB_OTG_GINNAKEFF_FLAG : at32f415_usb.h
  • USB_OTG_GINNAKEFF_INT : at32f415_usb.h
  • USB_OTG_GOUTNAKEFF_FLAG : at32f415_usb.h
  • USB_OTG_GOUTNAKEFF_INT : at32f415_usb.h
  • USB_OTG_GRXSTSP_BCNT : at32f415_usb.h
  • USB_OTG_GRXSTSP_CHNUM : at32f415_usb.h
  • USB_OTG_GRXSTSP_DPID : at32f415_usb.h
  • USB_OTG_GRXSTSP_EPTNUM : at32f415_usb.h
  • USB_OTG_GRXSTSP_PKTSTS : at32f415_usb.h
  • USB_OTG_HC_ACK_FLAG : at32f415_usb.h
  • USB_OTG_HC_ACKM_INT : at32f415_usb.h
  • USB_OTG_HC_BBLERR_FLAG : at32f415_usb.h
  • USB_OTG_HC_BBLERRM_INT : at32f415_usb.h
  • USB_OTG_HC_CHHLTD_FLAG : at32f415_usb.h
  • USB_OTG_HC_CHHLTDM_INT : at32f415_usb.h
  • USB_OTG_HC_DTGLERR_FLAG : at32f415_usb.h
  • USB_OTG_HC_DTGLERRM_INT : at32f415_usb.h
  • USB_OTG_HC_FRMOVRRUN_FLAG : at32f415_usb.h
  • USB_OTG_HC_FRMOVRRUN_INT : at32f415_usb.h
  • USB_OTG_HC_NAK_FLAG : at32f415_usb.h
  • USB_OTG_HC_NAKM_INT : at32f415_usb.h
  • USB_OTG_HC_NYET_FLAG : at32f415_usb.h
  • USB_OTG_HC_NYETM_INT : at32f415_usb.h
  • USB_OTG_HC_STALL_FLAG : at32f415_usb.h
  • USB_OTG_HC_STALLM_INT : at32f415_usb.h
  • USB_OTG_HC_XACTERR_FLAG : at32f415_usb.h
  • USB_OTG_HC_XACTERRM_INT : at32f415_usb.h
  • USB_OTG_HC_XFERC_FLAG : at32f415_usb.h
  • USB_OTG_HC_XFERCM_INT : at32f415_usb.h
  • USB_OTG_HCCHAR_CHDIS : at32f415_usb.h
  • USB_OTG_HCCHAR_CHENA : at32f415_usb.h
  • USB_OTG_HCCHAR_DEVADDR : at32f415_usb.h
  • USB_OTG_HCCHAR_EPTDIR : at32f415_usb.h
  • USB_OTG_HCCHAR_EPTNUM : at32f415_usb.h
  • USB_OTG_HCCHAR_EPTYPE : at32f415_usb.h
  • USB_OTG_HCCHAR_LSPDDEV : at32f415_usb.h
  • USB_OTG_HCCHAR_MC : at32f415_usb.h
  • USB_OTG_HCCHAR_MPS : at32f415_usb.h
  • USB_OTG_HCCHAR_ODDFRM : at32f415_usb.h
  • USB_OTG_HCH_FLAG : at32f415_usb.h
  • USB_OTG_HCH_INT : at32f415_usb.h
  • USB_OTG_HCTSIZ_PID : at32f415_usb.h
  • USB_OTG_HCTSIZ_PKTCNT : at32f415_usb.h
  • USB_OTG_HCTSIZ_XFERSIZE : at32f415_usb.h
  • USB_OTG_HPRT_PRTCONDET : at32f415_usb.h
  • USB_OTG_HPRT_PRTCONSTS : at32f415_usb.h
  • USB_OTG_HPRT_PRTENA : at32f415_usb.h
  • USB_OTG_HPRT_PRTENCHNG : at32f415_usb.h
  • USB_OTG_HPRT_PRTLNSTS : at32f415_usb.h
  • USB_OTG_HPRT_PRTOVRCACT : at32f415_usb.h
  • USB_OTG_HPRT_PRTOVRCCHNG : at32f415_usb.h
  • USB_OTG_HPRT_PRTPWR : at32f415_usb.h
  • USB_OTG_HPRT_PRTRES : at32f415_usb.h
  • USB_OTG_HPRT_PRTRST : at32f415_usb.h
  • USB_OTG_HPRT_PRTSPD : at32f415_usb.h
  • USB_OTG_HPRT_PRTSUSP : at32f415_usb.h
  • USB_OTG_IEPT_FLAG : at32f415_usb.h
  • USB_OTG_IEPT_INT : at32f415_usb.h
  • USB_OTG_INCOMISOIN_FLAG : at32f415_usb.h
  • USB_OTG_INCOMISOIN_INT : at32f415_usb.h
  • USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG : at32f415_usb.h
  • USB_OTG_INCOMPIP_INCOMPISOOUT_INT : at32f415_usb.h
  • USB_OTG_ISOOUTDROP_FLAG : at32f415_usb.h
  • USB_OTG_ISOOUTDROP_INT : at32f415_usb.h
  • USB_OTG_MODEMIS_FLAG : at32f415_usb.h
  • USB_OTG_MODEMIS_INT : at32f415_usb.h
  • USB_OTG_NPTXFEMP_FLAG : at32f415_usb.h
  • USB_OTG_NPTXFEMP_INT : at32f415_usb.h
  • USB_OTG_OEPT_FLAG : at32f415_usb.h
  • USB_OTG_OEPT_INT : at32f415_usb.h
  • USB_OTG_OTGINT_FLAG : at32f415_usb.h
  • USB_OTG_OTGINT_INT : at32f415_usb.h
  • USB_OTG_PRT_FLAG : at32f415_usb.h
  • USB_OTG_PRT_INT : at32f415_usb.h
  • USB_OTG_PTXFEMP_FLAG : at32f415_usb.h
  • USB_OTG_PTXFEMP_INT : at32f415_usb.h
  • USB_OTG_RXFLVL_FLAG : at32f415_usb.h
  • USB_OTG_RXFLVL_INT : at32f415_usb.h
  • USB_OTG_SOF_FLAG : at32f415_usb.h
  • USB_OTG_SOF_INT : at32f415_usb.h
  • USB_OTG_USBRST_FLAG : at32f415_usb.h
  • USB_OTG_USBRST_INT : at32f415_usb.h
  • USB_OTG_USBSUSP_FLAG : at32f415_usb.h
  • USB_OTG_USBSUSP_INT : at32f415_usb.h
  • USB_OTG_WKUP_FLAG : at32f415_usb.h
  • USB_OTG_WKUP_INT : at32f415_usb.h
  • USB_OUT_STS_COMP : at32f415_usb.h
  • USB_OUT_STS_DATA : at32f415_usb.h
  • USB_OUT_STS_NAK : at32f415_usb.h
  • USB_OUTEPT : at32f415_usb.h
  • USB_PRODUCT_STRING : usb_std.h
  • USB_PRTSPD_FULL_SPEED : at32f415_usb.h
  • USB_PRTSPD_HIGH_SPEED : at32f415_usb.h
  • USB_PRTSPD_LOW_SPEED : at32f415_usb.h
  • USB_REQ_DIR_DTH : usb_std.h
  • USB_REQ_DIR_HTD : usb_std.h
  • USB_REQ_RECIPIENT_DEVICE : usb_std.h
  • USB_REQ_RECIPIENT_ENDPOINT : usb_std.h
  • USB_REQ_RECIPIENT_INTERFACE : usb_std.h
  • USB_REQ_RECIPIENT_MASK : usb_std.h
  • USB_REQ_RECIPIENT_OTHER : usb_std.h
  • USB_REQ_TYPE_CLASS : usb_std.h
  • USB_REQ_TYPE_RESERVED : usb_std.h
  • USB_REQ_TYPE_STANDARD : usb_std.h
  • USB_REQ_TYPE_VENDOR : usb_std.h
  • USB_SERIAL_STRING : usb_std.h
  • USB_SETUP_STS_COMP : at32f415_usb.h
  • USB_SETUP_STS_DATA : at32f415_usb.h
  • USB_STD_REQ_CLEAR_FEATURE : usb_std.h
  • USB_STD_REQ_GET_CONFIGURATION : usb_std.h
  • USB_STD_REQ_GET_DESCRIPTOR : usb_std.h
  • USB_STD_REQ_GET_INTERFACE : usb_std.h
  • USB_STD_REQ_GET_STATUS : usb_std.h
  • USB_STD_REQ_SET_ADDRESS : usb_std.h
  • USB_STD_REQ_SET_CONFIGURATION : usb_std.h
  • USB_STD_REQ_SET_DESCRIPTOR : usb_std.h
  • USB_STD_REQ_SET_FEATURE : usb_std.h
  • USB_STD_REQ_SET_INTERFACE : usb_std.h
  • USB_STD_REQ_SYNCH_FRAME : usb_std.h
  • USB_TRDTIM_16 : at32f415_usb.h
  • USB_TRDTIM_8 : at32f415_usb.h
  • USBD_AUDIO_FEEDBACK_EPT : audio_class.h, audio_hid_class.h
  • USBD_AUDIO_MIC_IN_EPT : audio_class.h, audio_hid_class.h
  • USBD_AUDIO_SPK_OUT_EPT : audio_class.h, audio_hid_class.h
  • USBD_CDC_BULK_IN_EPT : cdc_class.h, cdc_keyboard_class.h
  • USBD_CDC_BULK_OUT_EPT : cdc_class.h, cdc_keyboard_class.h
  • USBD_CDC_CS_ENDPOINT : cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h
  • USBD_CDC_CS_INTERFACE : cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h
  • USBD_CDC_INT_EPT : cdc_class.h, cdc_keyboard_class.h
  • USBD_CDC_SUBTYPE_ACM : cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h
  • USBD_CDC_SUBTYPE_CMF : cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h
  • USBD_CDC_SUBTYPE_HEADER : cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h
  • USBD_CDC_SUBTYPE_UFD : cdc_desc.h, cdc_keyboard_desc.h, msc_desc.h
  • USBD_CMD_MAXPACKET_SIZE : cdc_class.h, cdc_keyboard_class.h
  • USBD_CONFIG_DESC_SIZE : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • USBD_DESC_CONFIGURATION_STRING : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • USBD_DESC_INTERFACE_STRING : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • USBD_DESC_MANUFACTURER_STRING : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • USBD_DESC_PRODUCT_STRING : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • USBD_EP0_TX_SIZE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • USBD_EP1_TX_SIZE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • USBD_EP2_TX_SIZE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • USBD_EP3_TX_SIZE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • USBD_HID_DESC_SIZE : audio_hid_desc.h
  • USBD_HID_IN_EPT : audio_hid_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h
  • USBD_HID_OUT_EPT : audio_hid_class.h, custom_hid_class.h, hid_iap_class.h
  • USBD_HID_SIZ_REPORT_DESC : audio_hid_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h
  • USBD_IN_MAXPACKET_SIZE : audio_hid_class.h, cdc_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, mouse_class.h, msc_class.h, printer_class.h
  • USBD_MSC_BULK_IN_EPT : msc_class.h
  • USBD_MSC_BULK_OUT_EPT : msc_class.h
  • USBD_OUT_MAXPACKET_SIZE : audio_hid_class.h, cdc_class.h, cdc_keyboard_class.h, custom_hid_class.h, hid_iap_class.h, keyboard_class.h, msc_class.h, printer_class.h
  • USBD_PRINTER_BULK_IN_EPT : printer_class.h
  • USBD_PRINTER_BULK_OUT_EPT : printer_class.h
  • USBD_PRODUCT_ID : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • USBD_RX_SIZE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • USBD_SIZ_STRING_LANGID : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • USBD_SIZ_STRING_SERIAL : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • USBD_VENDOR_ID : audio_desc.h, audio_hid_desc.h, cdc_desc.h, cdc_keyboard_desc.h, custom_hid_desc.h, hid_iap_desc.h, keyboard_desc.h, mouse_desc.h, msc_desc.h, printer_desc.h
  • USBH_DEBUG : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • USBH_DEBUG_ENABLE : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • USBH_NP_TX_FIFO_SIZE : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • USBH_P_TX_FIFO_SIZE : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • USBH_RX_FIFO_SIZE : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • USBH_SUPPORT_MAX_LUN : usbh_msc_class.h
  • USD : at32f415_flash.h
  • USD_BASE : at32f415.h
  • USD_DEPSLP_NO_RST : at32f415_flash.h
  • USD_DEPSLP_RST : at32f415_flash.h
  • USD_STDBY_NO_RST : at32f415_flash.h
  • USD_STDBY_RST : at32f415_flash.h
  • USD_WDT_ATO_DISABLE : at32f415_flash.h
  • USD_WDT_ATO_ENABLE : at32f415_flash.h
  • USE_OTG_DEVICE_MODE : project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h, project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h, project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
  • USE_OTG_HOST_MODE : project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
  • USE_SLIB_FUNCTION : utilities/at32f415_slib_demo/project_l0/src/main.c
  • USER_BUTTON_CRM_CLK : at32f415_board.h
  • USER_BUTTON_PIN : at32f415_board.h
  • USER_BUTTON_PORT : at32f415_board.h


AT32F415 Firmwary Library: Globals

- v -

  • VARIABLES_GET_BIT : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • VARIABLES_RESET_BIT : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • VARIABLES_SET_BIT : project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
  • VECT_TAB_OFFSET : system_at32f415.c
  • vPortSVCHandler : FreeRTOSConfig.h


AT32F415 Firmwary Library: Globals

- w -

  • W25Q128 : spi_flash.h
  • W25Q16 : spi_flash.h
  • W25Q32 : spi_flash.h
  • W25Q64 : spi_flash.h
  • W25Q80 : spi_flash.h
  • WDT : at32f415_wdt.h
  • WDT_BASE : at32f415.h
  • WDT_DIVF_UPDATE_FLAG : at32f415_wdt.h
  • WDT_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
  • WDT_RLDF_UPDATE_FLAG : at32f415_wdt.h
  • WM8988_I2C_ADDR_CSB_HIGH : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_I2C_ADDR_CSB_LOW : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R0_LEFT_INPUT_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R10_LEFT_DAC_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R11_RIGHT_DAC_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R12_BASS_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R13_TREBLE_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R14_ : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R15_RESET : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R16_3D_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R17_ALC1 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R18_ALC2 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R19_ALC3 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R1_RIGHT_INPUT_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R20_NOISE_GATE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R21_LEFT_ADC_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R22_RIGHT_ADC_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R23_ADDITIONAL_1_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R24_ADDITIONAL_2_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R25_PWR_1_MGMT : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R26_PWR_2_MGMT : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R27_ADDITIONAL_3_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R2_LOUT1_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R31_ADC_INPUT_MODE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R32_ADC_L_SIGNAL_PATH : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R33_ADC_R_SIGNAL_PATH : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R34_LEFT_OUT_MIX_1 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R35_LEFT_OUT_MIX_2 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R36_RIGHT_OUT_MIX_1 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R37_RIGHT_OUT_MIX_2 : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R38_RESERVED : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R39_RESERVED : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R3_ROUT1_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R40_LOUT2_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R41_ROUT2_VOLUME : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R42_RESERVED : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R43_LOW_POWER_PALYBACK : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R4_RESERVED : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R5_ADC_DAC_CONTROL : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R6_RESERVED : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R7_AUDIO_INTERFACE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R8_SAMPLE_RATE : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_R9_RESERVED : audio/inc/audio_codec.h, composite_audio_hid/inc/audio_codec.h
  • WM8988_REG_BITW16 : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • WM8988_REG_FREQ16K : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • WM8988_REG_FREQ48K : audio/src/audio_codec.c, composite_audio_hid/src/audio_codec.c
  • WWDT : at32f415_wwdt.h
  • WWDT_BASE : at32f415.h
  • WWDT_EN_BIT : at32f415_wwdt.h
  • WWDT_MODULE_ENABLED : project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h, project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h, project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h, project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h, project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h, project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h, project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h, project/at_start_f415/examples/can/filter/inc/at32f415_conf.h, project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h, project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h, project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h, project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h, project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h, project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h, project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h, project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h, project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h, project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h, project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h, project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h, project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h, project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h, project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h, project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h, project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h, project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h, project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h, project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h, project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h, project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h, project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h, project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h, project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h, project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h, project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h, project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h, project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h, project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h, project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h, project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h, project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h, project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h, project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h, project/at_start_f415/templates/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h, utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h, utilities/at32f415_freertos_demo/inc/at32f415_conf.h, utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h, utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h, utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h


AT32F415 Firmwary Library: Globals

- x -

  • xPortPendSVHandler : FreeRTOSConfig.h
  • xPortSysTickHandler : FreeRTOSConfig.h


AT32F415 Firmwary Library: FreeRTOSConfig.h Source File

  • utilities
  • at32f415_freertos_demo
  • inc
FreeRTOSConfig.h
Go to the documentation of this file.
1/*
2 FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.
3 All rights reserved
4
5 VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6
7 This file is part of the FreeRTOS distribution.
8
9 FreeRTOS is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License (version 2) as published by the
11 Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
12
13 ***************************************************************************
14 >>! NOTE: The modification to the GPL is included to allow you to !<<
15 >>! distribute a combined work that includes FreeRTOS without being !<<
16 >>! obliged to provide the source code for proprietary components !<<
17 >>! outside of the FreeRTOS kernel. !<<
18 ***************************************************************************
19
20 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
21 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22 FOR A PARTICULAR PURPOSE. Full license text is available on the following
23 link: http://www.freertos.org/a00114.html
24
25 ***************************************************************************
26 * *
27 * FreeRTOS provides completely free yet professionally developed, *
28 * robust, strictly quality controlled, supported, and cross *
29 * platform software that is more than just the market leader, it *
30 * is the industry's de facto standard. *
31 * *
32 * Help yourself get started quickly while simultaneously helping *
33 * to support the FreeRTOS project by purchasing a FreeRTOS *
34 * tutorial book, reference manual, or both: *
35 * http://www.FreeRTOS.org/Documentation *
36 * *
37 ***************************************************************************
38
39 http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
40 the FAQ page "My application does not run, what could be wrong?". Have you
41 defined configASSERT()?
42
43 http://www.FreeRTOS.org/support - In return for receiving this top quality
44 embedded software for free we request you assist our global community by
45 participating in the support forum.
46
47 http://www.FreeRTOS.org/training - Investing in training allows your team to
48 be as productive as possible as early as possible. Now you can receive
49 FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
50 Ltd, and the world's leading authority on the world's leading RTOS.
51
52 http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
53 including FreeRTOS+Trace - an indispensable productivity tool, a DOS
54 compatible FAT file system, and our tiny thread aware UDP/IP stack.
55
56 http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
57 Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
58
59 http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
60 Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
61 licenses offer ticketed support, indemnification and commercial middleware.
62
63 http://www.SafeRTOS.com - High Integrity Systems also provide a safety
64 engineered and independently SIL3 certified version for use in safety and
65 mission critical applications that require provable dependability.
66
67 1 tab == 4 spaces!
68 * Copyright notice & Disclaimer
69 *
70 * The software Board Support Package (BSP) that is made available to
71 * download from Artery official website is the copyrighted work of Artery.
72 * Artery authorizes customers to use, copy, and distribute the BSP
73 * software and its related documentation for the purpose of design and
74 * development in conjunction with Artery microcontrollers. Use of the
75 * software is governed by this copyright notice and the following disclaimer.
76 *
77 * THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
78 * GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
79 * TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
80 * STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
81 * INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
82 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
83 *
84 **************************************************************************
85*/
86
87#ifndef FREERTOS_CONFIG_H
88#define FREERTOS_CONFIG_H
89
90#ifdef __cplusplus
91 extern "C" {
92#endif
93
94#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
95 #include <stdint.h>
96 static uint32_t systemcoreclock = 240000000;
97#endif
98
99
100
101/*-----------------------------------------------------------
102 * Application specific definitions.
103 *
104 * These definitions should be adjusted for your particular hardware and
105 * application requirements.
106 *
107 * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
108 * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
109 *
110 * See http://www.freertos.org/a00110.html.
111 *----------------------------------------------------------*/
112#define configUSE_PREEMPTION 1
113#define configUSE_IDLE_HOOK 0
114#define configUSE_TICK_HOOK 0
115#define configCPU_CLOCK_HZ ( ( unsigned long ) systemcoreclock )
116#define configTICK_RATE_HZ ( ( TickType_t ) 1000 )
117#define configMAX_PRIORITIES ( 5 )
118#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 )
119#define configSUPPORT_DYNAMIC_ALLOCATION 1
120#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 8 * 1024 ) )
121#define configMAX_TASK_NAME_LEN ( 16 )
122#define configUSE_16_BIT_TICKS 0
123#define configIDLE_SHOULD_YIELD 1
124
125
126/* Co-routine definitions. */
127#define configUSE_CO_ROUTINES 0
128#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
129
130/* Set the following definitions to 1 to include the API function, or zero
131to exclude the API function. */
132
133#define INCLUDE_vTaskPrioritySet 1
134#define INCLUDE_uxTaskPriorityGet 1
135#define INCLUDE_vTaskDelete 1
136#define INCLUDE_vTaskCleanUpResources 0
137#define INCLUDE_vTaskSuspend 1
138#define INCLUDE_vTaskDelayUntil 1
139#define INCLUDE_vTaskDelay 1
140#define INCLUDE_xTaskGetCurrentTaskHandle 1
141/* Cortex-M specific definitions. */
142#ifdef __NVIC_PRIO_BITS
143 /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
144 #define configPRIO_BITS __NVIC_PRIO_BITS
145#else
146 #define configPRIO_BITS 4 /* 15 priority levels */
147#endif
148
149/* The lowest interrupt priority that can be used in a call to a "set priority"
150function. */
151#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x0f
152
153/* The highest interrupt priority that can be used by any interrupt service
154routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
155INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
156PRIORITY THAN THIS! (higher priorities are lower numeric values. */
157#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 0x01
158
159/* Interrupt priorities used by the kernel port layer itself. These are generic
160to all Cortex-M ports, and do not rely on any particular library functions. */
161#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
162/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
163See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
164#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
165
166/* Normal assert() semantics without relying on the provision of an assert.h
167header file. */
168#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
169
170/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
171standard names. */
172#define vPortSVCHandler SVC_Handler
173#define xPortPendSVHandler PendSV_Handler
174#define xPortSysTickHandler SysTick_Handler
175
176#ifdef __cplusplus
177 }
178#endif
179
180#endif /* FREERTOS_CONFIG_H */
181


AT32F415 Firmwary Library: hid_iap_user.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • inc
app_led3_toggle/inc/hid_iap_user.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __HID_IAP_USER_H
29#define __HID_IAP_USER_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "hid_iap_class.h"
36
49#define FLASH_APP_ADDRESS 0x08005000
50
59void iap_init(void);
60 iap_result_type iap_get_upgrade_flag(void);
61void app_loop(void);
62
75#ifdef __cplusplus
76}
77#endif
78
79#endif
80
iap_result_type
iap_result_type
Definition: hid_iap_class.h:98
iap_init
void iap_init(void)
iap init.
Definition: app_led3_toggle/src/iap.c:61
iap_get_upgrade_flag
iap_result_type iap_get_upgrade_flag(void)
get iap upgrade complete flag
Definition: app_led3_toggle/src/hid_iap_user.c:79
app_loop
void app_loop(void)
iap loop
Definition: app_led3_toggle/src/hid_iap_user.c:253
hid_iap_class.h
usb hid iap header file


AT32F415 Firmwary Library: iap.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • inc
app_led3_toggle/inc/iap.h
Go to the documentation of this file.
1
27#ifndef __IAP_H__
28#define __IAP_H__
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "at32f415_board.h"
35
48/* app starting address */
49#define APP_START_ADDR 0x08004000
50
51/* the previous sector of app starting address is iap upgrade flag */
52#define IAP_UPGRADE_FLAG_ADDR (APP_START_ADDR - 0x800)
53
54/* when app received cmd 0x5aa5 from pc-tool, will set up the flag,
55indicates that an app upgrade will follow, see iap application note for more details */
56#define IAP_UPGRADE_FLAG 0x41544B38
57
66void iap_command_handle(void);
67void iap_init(void);
68
81#ifdef __cplusplus
82}
83#endif
84
85#endif
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
iap_init
void iap_init(void)
iap init.
Definition: app_led3_toggle/src/iap.c:61
iap_command_handle
void iap_command_handle(void)
iap command handle handle.
Definition: app_led3_toggle/src/iap.c:44


AT32F415 Firmwary Library: tmr.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • inc
app_led3_toggle/inc/tmr.h
Go to the documentation of this file.
1
27#ifndef __TMR_H
28#define __TMR_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "at32f415_board.h"
35
48void tmr_init(void);
49
62#ifdef __cplusplus
63}
64#endif
65
66#endif
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
tmr_init
void tmr_init(void)
init tmr.
Definition: app_led3_toggle/src/tmr.c:44


AT32F415 Firmwary Library: usart.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • inc
app_led3_toggle/inc/usart.h
Go to the documentation of this file.
1
27#ifndef __USART_H
28#define __USART_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "at32f415_board.h"
35
36extern uint8_t iap_flag;
37
50#define IAP_REV_FLAG_NO 0
51#define IAP_REV_FLAG_5A 1
52#define IAP_REV_FLAG_DONE 2
53#define IAP_REV_FLAG_ERROR 3
54
63void uart_init(uint32_t baudrate);
64void back_ok(void);
65void back_err(void);
66
79#ifdef __cplusplus
80}
81#endif
82
83#endif
84
85
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
iap_flag
uint8_t iap_flag
Definition: app_led3_toggle/src/usart.c:38
uart_init
void uart_init(uint32_t baudrate)
init usart.
Definition: app_led3_toggle/src/usart.c:45
back_err
void back_err(void)
command response error.
Definition: app_led3_toggle/src/usart.c:120
back_ok
void back_ok(void)
command response ok.
Definition: app_led3_toggle/src/usart.c:107


AT32F415 Firmwary Library: hid_iap_user.c Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • src
app_led3_toggle/src/hid_iap_user.c
Go to the documentation of this file.
1
27#include "hid_iap_user.h"
28#include "hid_iap_class.h"
29#include "string.h"
30
39void (*pftarget)(void);
40void iap_clear_upgrade_flag(void);
41void iap_set_upgrade_flag(void);
42uint32_t crc_cal(uint32_t addr, uint16_t nk);
43
44void iap_idle(void);
45void iap_start(void);
46void iap_finish(void);
47void iap_jump(void);
48void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result);
49
55void iap_clear_upgrade_flag(void)
56{
57 flash_unlock();
58 flash_sector_erase(iap_info.flag_address);
59 flash_lock();
60}
61
67void iap_set_upgrade_flag(void)
68{
69 flash_unlock();
70 flash_word_program(iap_info.flag_address, IAP_UPGRADE_COMPLETE_FLAG);
71 flash_lock();
72}
73
79 iap_result_type iap_get_upgrade_flag(void)
80{
81 uint32_t flag_address = iap_info.flag_address;
82 if(*((uint32_t *)flag_address) == IAP_UPGRADE_COMPLETE_FLAG)
83 {
84 return IAP_SUCCESS;
85 }
86 else
87 {
88 return IAP_FAILED;
89 }
90}
91
97void iap_init(void)
98{
99 iap_info.flash_size = KB_TO_B(FLASH_SIZE_REG());
100 if(iap_info.flash_size < KB_TO_B(256))
101 {
102 iap_info.sector_size = SECTOR_SIZE_1K;
103 }
104 else
105 {
106 iap_info.sector_size = SECTOR_SIZE_2K;
107 }
108
109 iap_info.flash_start_address = FLASH_BASE;
110 iap_info.flash_end_address = iap_info.flash_start_address + iap_info.flash_size;
111
112 iap_info.app_address = FLASH_APP_ADDRESS;
113 iap_info.flag_address = iap_info.app_address - iap_info.sector_size;
114
115 iap_info.fifo_length = 0;
116 iap_info.iap_address = 0;
117}
118
124void iap_idle(void)
125{
126 iap_info.state = IAP_STS_JMP_WAIT;
127 iap_init();
128 iap_respond(iap_info.iap_tx, IAP_CMD_IDLE, IAP_ACK);
129}
130
136void iap_start(void)
137{
138 iap_info.state = IAP_STS_START;
139 iap_init();
140 iap_respond(iap_info.iap_tx, IAP_CMD_START, IAP_ACK);
141}
142
143/*
144 * @brief iap jump
145 * @param none
146 * @retval none
147 */
148void iap_jump()
149{
150 iap_info.state = IAP_STS_JMP_WAIT;
151 iap_respond(iap_info.iap_tx, IAP_CMD_JMP, IAP_ACK);
152}
153
154/*
155 * @brief iap get
156 * @param none
157 * @retval none
158 */
159void iap_get()
160{
161 iap_respond(iap_info.iap_tx, IAP_CMD_GET, IAP_ACK);
162 iap_info.iap_tx[4] = (uint8_t)((iap_info.app_address >> 24) & 0xFF);
163 iap_info.iap_tx[5] = (uint8_t)((iap_info.app_address >> 16) & 0xFF);
164 iap_info.iap_tx[6] = (uint8_t)((iap_info.app_address >> 8) & 0xFF);
165 iap_info.iap_tx[7] = (uint8_t)((iap_info.app_address) & 0xFF);
166}
167
168
169
170/*
171 * @brief iap respond
172 * @param res_buf: data buffer pointer.
173 * @param iap_cmd: iap command
174 * @param result: iap result
175 * @retval the result of the address parse
176 */
177void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
178{
179 res_buf[0] = (uint8_t)((iap_cmd >> 8) & 0xFF);
180 res_buf[1] = (uint8_t)((iap_cmd) & 0xFF);
181 res_buf[2] = (uint8_t)((result >> 8) & 0xFF);
182 res_buf[3] = (uint8_t)((result) & 0xFF);
183
184 iap_info.respond_flag = 1;
185}
186
194 iap_result_type usbd_hid_iap_process(void *udev, uint8_t *pdata, uint16_t len)
195{
196 iap_result_type status = IAP_SUCCESS;
197 uint16_t iap_cmd;
198
199 if(len < 2)
200 {
201 return IAP_FAILED;
202 }
203
204 iap_info.respond_flag = 0;
205
206 iap_cmd = (pdata[0] << 8) | pdata[1];
207
208 switch(iap_cmd)
209 {
210 case IAP_CMD_IDLE:
211 iap_idle();
212 break;
213 case IAP_CMD_START:
214 iap_start();
215 break;
216 case IAP_CMD_JMP:
217 iap_jump();
218 break;
219 case IAP_CMD_GET:
220 iap_get();
221 break;
222 default:
223 status = IAP_FAILED;
224 break;
225 }
226
227 if(iap_info.respond_flag)
228 {
229 class_send_report(udev, iap_info.iap_tx, 64);
230 }
231
232 return status;
233}
234
240void usbd_hid_iap_in_complete(void *udev)
241{
242 if(iap_info.state == IAP_STS_JMP_WAIT)
243 {
244 iap_info.state = IAP_STS_JMP;
245 }
246}
247
253void app_loop(void)
254{
255 if(iap_info.state == IAP_STS_JMP)
256 {
257 iap_clear_upgrade_flag();
258 nvic_system_reset();
259 }
260}
261
flash_sector_erase
flash_status_type flash_sector_erase(uint32_t sector_address)
erase a specified flash sector.
Definition: at32f415_flash.c:173
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
flash_word_program
flash_status_type flash_word_program(uint32_t address, uint32_t data)
program a word at a specified address.
Definition: at32f415_flash.c:288
flash_lock
void flash_lock(void)
lock the flash controller.
Definition: at32f415_flash.c:162
nvic_system_reset
void nvic_system_reset(void)
system reset
Definition: at32f415_misc.c:52
FLASH_BASE
#define FLASH_BASE
Definition: at32f415.h:285
iap_set_upgrade_flag
void iap_set_upgrade_flag(void)
set iap upgrade complete flag
Definition: app_led3_toggle/src/hid_iap_user.c:67
iap_idle
void iap_idle(void)
iap idle function
Definition: app_led3_toggle/src/hid_iap_user.c:124
iap_respond
void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
Definition: app_led3_toggle/src/hid_iap_user.c:177
iap_init
void iap_init(void)
iap init
Definition: app_led3_toggle/src/hid_iap_user.c:97
usbd_hid_iap_process
iap_result_type usbd_hid_iap_process(void *udev, uint8_t *pdata, uint16_t len)
usb device iap function
Definition: app_led3_toggle/src/hid_iap_user.c:194
crc_cal
uint32_t crc_cal(uint32_t addr, uint16_t nk)
crc cal
Definition: bootloader/src/hid_iap_user.c:157
iap_get_upgrade_flag
iap_result_type iap_get_upgrade_flag(void)
get iap upgrade complete flag
Definition: app_led3_toggle/src/hid_iap_user.c:79
iap_finish
void iap_finish(void)
Definition: bootloader/src/hid_iap_user.c:318
iap_start
void iap_start(void)
iap start function
Definition: app_led3_toggle/src/hid_iap_user.c:136
pftarget
void(* pftarget)(void)
Definition: app_led3_toggle/src/hid_iap_user.c:39
iap_clear_upgrade_flag
void iap_clear_upgrade_flag(void)
clear iap upgrade flag
Definition: app_led3_toggle/src/hid_iap_user.c:55
iap_get
void iap_get()
Definition: app_led3_toggle/src/hid_iap_user.c:159
app_loop
void app_loop(void)
iap loop
Definition: app_led3_toggle/src/hid_iap_user.c:253
iap_jump
void iap_jump(void)
Definition: app_led3_toggle/src/hid_iap_user.c:148
usbd_hid_iap_in_complete
void usbd_hid_iap_in_complete(void *udev)
usb device in transfer complete function
Definition: app_led3_toggle/src/hid_iap_user.c:240
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: audio_hid_class.c:818
IAP_CMD_IDLE
#define IAP_CMD_IDLE
iap command
Definition: hid_iap_class.h:80
IAP_CMD_GET
#define IAP_CMD_GET
Definition: hid_iap_class.h:87
SECTOR_SIZE_1K
#define SECTOR_SIZE_1K
Definition: hid_iap_class.h:73
iap_result_type
iap_result_type
Definition: hid_iap_class.h:98
IAP_ACK
#define IAP_ACK
Definition: hid_iap_class.h:94
SECTOR_SIZE_2K
#define SECTOR_SIZE_2K
Definition: hid_iap_class.h:74
IAP_UPGRADE_COMPLETE_FLAG
#define IAP_UPGRADE_COMPLETE_FLAG
Definition: hid_iap_class.h:90
FLASH_SIZE_REG
#define FLASH_SIZE_REG()
Definition: hid_iap_class.h:70
IAP_CMD_START
#define IAP_CMD_START
Definition: hid_iap_class.h:81
IAP_CMD_JMP
#define IAP_CMD_JMP
Definition: hid_iap_class.h:86
KB_TO_B
#define KB_TO_B(kb)
Definition: hid_iap_class.h:71
IAP_FAILED
@ IAP_FAILED
Definition: hid_iap_class.h:101
IAP_SUCCESS
@ IAP_SUCCESS
Definition: hid_iap_class.h:99
IAP_STS_START
@ IAP_STS_START
Definition: hid_iap_class.h:107
IAP_STS_JMP
@ IAP_STS_JMP
Definition: hid_iap_class.h:113
IAP_STS_JMP_WAIT
@ IAP_STS_JMP_WAIT
Definition: hid_iap_class.h:112
iap_info
iap_info_type iap_info
Definition: hid_iap_class.c:65
FLASH_APP_ADDRESS
#define FLASH_APP_ADDRESS
Definition: app_led3_toggle/inc/hid_iap_user.h:49
hid_iap_class.h
usb hid iap header file
iap_info_type::flag_address
uint32_t flag_address
Definition: hid_iap_class.h:128
iap_info_type::sector_size
uint32_t sector_size
Definition: hid_iap_class.h:133
iap_info_type::iap_address
uint32_t iap_address
Definition: hid_iap_class.h:127
iap_info_type::flash_start_address
uint32_t flash_start_address
Definition: hid_iap_class.h:130
iap_info_type::flash_end_address
uint32_t flash_end_address
Definition: hid_iap_class.h:131
iap_info_type::fifo_length
uint32_t fifo_length
Definition: hid_iap_class.h:123
iap_info_type::flash_size
uint32_t flash_size
Definition: hid_iap_class.h:134
iap_info_type::iap_tx
uint8_t iap_tx[0x40]
Definition: hid_iap_class.h:121
iap_info_type::app_address
uint32_t app_address
Definition: hid_iap_class.h:126
iap_info_type::respond_flag
uint8_t respond_flag
Definition: hid_iap_class.h:137
iap_info_type::state
iap_machine_state_type state
Definition: hid_iap_class.h:136


AT32F415 Firmwary Library: iap.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • src
app_led3_toggle/src/iap.c
Go to the documentation of this file.
1
27#include "iap.h"
28#include "usart.h"
29#include "tmr.h"
30
44void iap_command_handle(void)
45{
46 if(iap_flag==IAP_REV_FLAG_DONE)
47 {
48 flash_unlock();
49 flash_sector_erase(IAP_UPGRADE_FLAG_ADDR);
50 flash_word_program(IAP_UPGRADE_FLAG_ADDR, IAP_UPGRADE_FLAG);
51 flash_lock();
52 nvic_system_reset();
53 }
54}
55
61void iap_init(void)
62{
63 if((*(uint32_t*)IAP_UPGRADE_FLAG_ADDR) == IAP_UPGRADE_FLAG)
64 {
65 flash_unlock();
66 flash_sector_erase(IAP_UPGRADE_FLAG_ADDR);
67 flash_lock();
68 }
69}
70
flash_sector_erase
flash_status_type flash_sector_erase(uint32_t sector_address)
erase a specified flash sector.
Definition: at32f415_flash.c:173
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
flash_word_program
flash_status_type flash_word_program(uint32_t address, uint32_t data)
program a word at a specified address.
Definition: at32f415_flash.c:288
flash_lock
void flash_lock(void)
lock the flash controller.
Definition: at32f415_flash.c:162
nvic_system_reset
void nvic_system_reset(void)
system reset
Definition: at32f415_misc.c:52
iap_init
void iap_init(void)
iap init.
Definition: app_led3_toggle/src/iap.c:61
iap_command_handle
void iap_command_handle(void)
iap command handle handle.
Definition: app_led3_toggle/src/iap.c:44
iap_flag
uint8_t iap_flag
Definition: app_led3_toggle/src/usart.c:38
IAP_UPGRADE_FLAG_ADDR
#define IAP_UPGRADE_FLAG_ADDR
Definition: app_led3_toggle/inc/iap.h:52
IAP_REV_FLAG_DONE
#define IAP_REV_FLAG_DONE
Definition: app_led3_toggle/inc/usart.h:52
IAP_UPGRADE_FLAG
#define IAP_UPGRADE_FLAG
Definition: app_led3_toggle/inc/iap.h:56


AT32F415 Firmwary Library: tmr.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • src
app_led3_toggle/src/tmr.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "tmr.h"
29#include "iap.h"
30
44void tmr_init(void)
45{
46 crm_clocks_freq_type crm_clocks_freq_struct = {0};
47
48 crm_periph_clock_enable(CRM_TMR3_PERIPH_CLOCK, TRUE);
49
50 /* enable the tmr3 global interrupt */
51 nvic_irq_enable(TMR3_GLOBAL_IRQn, 1, 0);
52
53 /* get system clock */
54 crm_clocks_freq_get(&crm_clocks_freq_struct);
55
56 /* time base configuration */
57 tmr_base_init(TMR3, 10000, crm_clocks_freq_struct.ahb_freq / 10000);
58 tmr_cnt_dir_set(TMR3, TMR_COUNT_UP);
59
60 /* overflow interrupt enable */
61 tmr_interrupt_enable(TMR3, TMR_OVF_INT, TRUE);
62
63 /* enable tmr */
64 tmr_counter_enable(TMR3, TRUE);
65}
66
72void TMR3_GLOBAL_IRQHandler(void)
73{
74 if(tmr_flag_get(TMR3, TMR_OVF_FLAG) == SET)
75 {
76 tmr_flag_clear(TMR3, TMR_OVF_FLAG);
77 at32_led_toggle(LED3);
78 }
79}
80
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/debug/tmr1/src/main.c:39
LED3
@ LED3
Definition: at32f415_board.h:64
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_TMR3_PERIPH_CLOCK
@ CRM_TMR3_PERIPH_CLOCK
Definition: at32f415_crm.h:124
TMR3_GLOBAL_IRQn
@ TMR3_GLOBAL_IRQn
Definition: at32f415.h:165
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_OVF_FLAG
#define TMR_OVF_FLAG
Definition: at32f415_tmr.h:52
TMR_OVF_INT
#define TMR_OVF_INT
Definition: at32f415_tmr.h:74
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
TMR3_GLOBAL_IRQHandler
void TMR3_GLOBAL_IRQHandler(void)
tmr3 global interrupt handler.
Definition: app_led3_toggle/src/tmr.c:72
tmr_init
void tmr_init(void)
init tmr.
Definition: app_led3_toggle/src/tmr.c:44
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::ahb_freq
uint32_t ahb_freq
Definition: at32f415_crm.h:473


AT32F415 Firmwary Library: usart.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • src
app_led3_toggle/src/usart.c
Go to the documentation of this file.
1
27#include "usart.h"
28#include "tmr.h"
29
38uint8_t iap_flag = IAP_REV_FLAG_NO;
39
45void uart_init(uint32_t baudrate)
46{
47 gpio_init_type gpio_init_struct;
48 /* enable the usart and it's io clock */
49 crm_periph_clock_enable(CRM_USART1_PERIPH_CLOCK, TRUE);
50 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
51
52 /* set default parameter */
53 gpio_default_para_init(&gpio_init_struct);
54
55 /* configure the usart1_tx pa9 */
56 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
57 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
58 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
59 gpio_init_struct.gpio_pins = GPIO_PINS_9;
60 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
61 gpio_init(GPIOA, &gpio_init_struct);
62
63 /* configure the usart1_rx pa10 */
64 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
65 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
66 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
67 gpio_init_struct.gpio_pins = GPIO_PINS_10;
68 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
69 gpio_init(GPIOA, &gpio_init_struct);
70
71 /*configure usart nvic interrupt */
72 nvic_irq_enable(USART1_IRQn, 0, 0);
73
74 /*configure usart param*/
75 usart_init(USART1, baudrate, USART_DATA_8BITS, USART_STOP_1_BIT);
76 usart_transmitter_enable(USART1, TRUE);
77 usart_receiver_enable(USART1, TRUE);
78 usart_interrupt_enable(USART1, USART_RDBF_INT, TRUE);
79 usart_enable(USART1, TRUE);
80}
81
87void USART1_IRQHandler(void)
88{
89 uint16_t reval;
90 if(usart_flag_get(USART1, USART_RDBF_FLAG) != RESET)
91 {
92 reval = usart_data_receive(USART1);
93 if((reval == 0x5A) && (iap_flag == IAP_REV_FLAG_NO))
94 iap_flag = IAP_REV_FLAG_5A;
95 else if((reval == 0xA5) && (iap_flag == IAP_REV_FLAG_5A))
96 iap_flag = IAP_REV_FLAG_DONE;
97 else
98 iap_flag = IAP_REV_FLAG_NO;
99 }
100}
101
107void back_ok(void)
108{
109 usart_data_transmit(USART1, 0xCC);
110 while(usart_flag_get(USART1, USART_TDC_FLAG) == RESET);
111 usart_data_transmit(USART1, 0xDD);
112 while(usart_flag_get(USART1, USART_TDC_FLAG) == RESET);
113}
114
120void back_err(void)
121{
122 usart_data_transmit(USART1, 0xEE);
123 while(usart_flag_get(USART1, USART_TDC_FLAG) == RESET);
124 usart_data_transmit(USART1, 0xFF);
125 while(usart_flag_get(USART1, USART_TDC_FLAG) == RESET);
126}
127
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_USART1_PERIPH_CLOCK
@ CRM_USART1_PERIPH_CLOCK
Definition: at32f415_crm.h:118
USART1_IRQn
@ USART1_IRQn
Definition: at32f415.h:173
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
USART1_IRQHandler
void USART1_IRQHandler(void)
usart1 interrupt handler.
Definition: app_led3_toggle/src/usart.c:87
uart_init
void uart_init(uint32_t baudrate)
init usart.
Definition: app_led3_toggle/src/usart.c:45
iap_flag
uint8_t iap_flag
Definition: app_led3_toggle/src/usart.c:38
back_err
void back_err(void)
command response error.
Definition: app_led3_toggle/src/usart.c:120
back_ok
void back_ok(void)
command response ok.
Definition: app_led3_toggle/src/usart.c:107
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_interrupt_enable
void usart_interrupt_enable(usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts.
Definition: at32f415_usart.c:257
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_TDC_FLAG
#define USART_TDC_FLAG
Definition: at32f415_usart.h:58
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART_RDBF_INT
#define USART_RDBF_INT
Definition: at32f415_usart.h:73
USART1
#define USART1
Definition: at32f415_usart.h:319
IAP_REV_FLAG_DONE
#define IAP_REV_FLAG_DONE
Definition: app_led3_toggle/inc/usart.h:52
IAP_REV_FLAG_NO
#define IAP_REV_FLAG_NO
Definition: app_led3_toggle/inc/usart.h:50
IAP_REV_FLAG_5A
#define IAP_REV_FLAG_5A
Definition: app_led3_toggle/inc/usart.h:51
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303


AT32F415 Firmwary Library: hid_iap_user.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • inc
app_led4_toggle/inc/hid_iap_user.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __HID_IAP_USER_H
29#define __HID_IAP_USER_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "hid_iap_class.h"
36
49#define FLASH_APP_ADDRESS 0x08005000
50
59void iap_init(void);
60 iap_result_type iap_get_upgrade_flag(void);
61void app_loop(void);
62
75#ifdef __cplusplus
76}
77#endif
78
79#endif
80
iap_result_type
iap_result_type
Definition: hid_iap_class.h:98
iap_init
void iap_init(void)
iap init.
Definition: app_led3_toggle/src/iap.c:61
iap_get_upgrade_flag
iap_result_type iap_get_upgrade_flag(void)
get iap upgrade complete flag
Definition: app_led3_toggle/src/hid_iap_user.c:79
app_loop
void app_loop(void)
iap loop
Definition: app_led3_toggle/src/hid_iap_user.c:253
hid_iap_class.h
usb hid iap header file


AT32F415 Firmwary Library: iap.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • inc
app_led4_toggle/inc/iap.h
Go to the documentation of this file.
1
27#ifndef __IAP_H__
28#define __IAP_H__
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "at32f415_board.h"
35
48/* app starting address */
49#define APP_START_ADDR 0x08004000
50
51/* the previous sector of app starting address is iap upgrade flag */
52#define IAP_UPGRADE_FLAG_ADDR (APP_START_ADDR - 0x800)
53
54/* when app received cmd 0x5aa5 from pc-tool, will set up the flag,
55indicates that an app upgrade will follow, see iap application note for more details */
56#define IAP_UPGRADE_FLAG 0x41544B38
57
66void iap_command_handle(void);
67void iap_init(void);
68
81#ifdef __cplusplus
82}
83#endif
84
85#endif
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
iap_init
void iap_init(void)
iap init.
Definition: app_led3_toggle/src/iap.c:61
iap_command_handle
void iap_command_handle(void)
iap command handle handle.
Definition: app_led3_toggle/src/iap.c:44


AT32F415 Firmwary Library: tmr.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • inc
app_led4_toggle/inc/tmr.h
Go to the documentation of this file.
1
27#ifndef __TMR_H
28#define __TMR_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "at32f415_board.h"
35
48void tmr_init(void);
49
62#ifdef __cplusplus
63}
64#endif
65
66#endif
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
tmr_init
void tmr_init(void)
init tmr.
Definition: app_led3_toggle/src/tmr.c:44


AT32F415 Firmwary Library: usart.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • inc
app_led4_toggle/inc/usart.h
Go to the documentation of this file.
1
27#ifndef __USART_H
28#define __USART_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "at32f415_board.h"
35
36extern uint8_t iap_flag;
37
50#define IAP_REV_FLAG_NO 0
51#define IAP_REV_FLAG_5A 1
52#define IAP_REV_FLAG_DONE 2
53#define IAP_REV_FLAG_ERROR 3
54
63void uart_init(uint32_t baudrate);
64void back_ok(void);
65void back_err(void);
66
79#ifdef __cplusplus
80}
81#endif
82
83#endif
84
85
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
iap_flag
uint8_t iap_flag
Definition: app_led3_toggle/src/usart.c:38
uart_init
void uart_init(uint32_t baudrate)
init usart.
Definition: app_led3_toggle/src/usart.c:45
back_err
void back_err(void)
command response error.
Definition: app_led3_toggle/src/usart.c:120
back_ok
void back_ok(void)
command response ok.
Definition: app_led3_toggle/src/usart.c:107


AT32F415 Firmwary Library: hid_iap_user.c Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • src
app_led4_toggle/src/hid_iap_user.c
Go to the documentation of this file.
1
27#include "hid_iap_user.h"
28#include "hid_iap_class.h"
29#include "string.h"
30
39void (*pftarget)(void);
40void iap_clear_upgrade_flag(void);
41void iap_set_upgrade_flag(void);
42uint32_t crc_cal(uint32_t addr, uint16_t nk);
43
44void iap_idle(void);
45void iap_start(void);
46void iap_finish(void);
47void iap_jump(void);
48void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result);
49
55void iap_clear_upgrade_flag(void)
56{
57 flash_unlock();
58 flash_sector_erase(iap_info.flag_address);
59 flash_lock();
60}
61
67void iap_set_upgrade_flag(void)
68{
69 flash_unlock();
70 flash_word_program(iap_info.flag_address, IAP_UPGRADE_COMPLETE_FLAG);
71 flash_lock();
72}
73
79 iap_result_type iap_get_upgrade_flag(void)
80{
81 uint32_t flag_address = iap_info.flag_address;
82 if(*((uint32_t *)flag_address) == IAP_UPGRADE_COMPLETE_FLAG)
83 {
84 return IAP_SUCCESS;
85 }
86 else
87 {
88 return IAP_FAILED;
89 }
90}
91
97void iap_init(void)
98{
99 iap_info.flash_size = KB_TO_B(FLASH_SIZE_REG());
100 if(iap_info.flash_size < KB_TO_B(256))
101 {
102 iap_info.sector_size = SECTOR_SIZE_1K;
103 }
104 else
105 {
106 iap_info.sector_size = SECTOR_SIZE_2K;
107 }
108
109 iap_info.flash_start_address = FLASH_BASE;
110 iap_info.flash_end_address = iap_info.flash_start_address + iap_info.flash_size;
111
112 iap_info.app_address = FLASH_APP_ADDRESS;
113 iap_info.flag_address = iap_info.app_address - iap_info.sector_size;
114
115 iap_info.fifo_length = 0;
116 iap_info.iap_address = 0;
117}
118
124void iap_idle(void)
125{
126 iap_info.state = IAP_STS_JMP_WAIT;
127 iap_init();
128 iap_respond(iap_info.iap_tx, IAP_CMD_IDLE, IAP_ACK);
129}
130
136void iap_start(void)
137{
138 iap_info.state = IAP_STS_START;
139 iap_init();
140 iap_respond(iap_info.iap_tx, IAP_CMD_START, IAP_ACK);
141}
142
143/*
144 * @brief iap jump
145 * @param none
146 * @retval none
147 */
148void iap_jump()
149{
150 iap_info.state = IAP_STS_JMP_WAIT;
151 iap_respond(iap_info.iap_tx, IAP_CMD_JMP, IAP_ACK);
152}
153
154/*
155 * @brief iap get
156 * @param none
157 * @retval none
158 */
159void iap_get()
160{
161 iap_respond(iap_info.iap_tx, IAP_CMD_GET, IAP_ACK);
162 iap_info.iap_tx[4] = (uint8_t)((iap_info.app_address >> 24) & 0xFF);
163 iap_info.iap_tx[5] = (uint8_t)((iap_info.app_address >> 16) & 0xFF);
164 iap_info.iap_tx[6] = (uint8_t)((iap_info.app_address >> 8) & 0xFF);
165 iap_info.iap_tx[7] = (uint8_t)((iap_info.app_address) & 0xFF);
166}
167
168
169
170/*
171 * @brief iap respond
172 * @param res_buf: data buffer pointer.
173 * @param iap_cmd: iap command
174 * @param result: iap result
175 * @retval the result of the address parse
176 */
177void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
178{
179 res_buf[0] = (uint8_t)((iap_cmd >> 8) & 0xFF);
180 res_buf[1] = (uint8_t)((iap_cmd) & 0xFF);
181 res_buf[2] = (uint8_t)((result >> 8) & 0xFF);
182 res_buf[3] = (uint8_t)((result) & 0xFF);
183
184 iap_info.respond_flag = 1;
185}
186
194 iap_result_type usbd_hid_iap_process(void *udev, uint8_t *pdata, uint16_t len)
195{
196 iap_result_type status = IAP_SUCCESS;
197 uint16_t iap_cmd;
198
199 if(len < 2)
200 {
201 return IAP_FAILED;
202 }
203
204 iap_info.respond_flag = 0;
205
206 iap_cmd = (pdata[0] << 8) | pdata[1];
207
208 switch(iap_cmd)
209 {
210 case IAP_CMD_IDLE:
211 iap_idle();
212 break;
213 case IAP_CMD_START:
214 iap_start();
215 break;
216 case IAP_CMD_JMP:
217 iap_jump();
218 break;
219 case IAP_CMD_GET:
220 iap_get();
221 break;
222 default:
223 status = IAP_FAILED;
224 break;
225 }
226
227 if(iap_info.respond_flag)
228 {
229 class_send_report(udev, iap_info.iap_tx, 64);
230 }
231
232 return status;
233}
234
240void usbd_hid_iap_in_complete(void *udev)
241{
242 if(iap_info.state == IAP_STS_JMP_WAIT)
243 {
244 iap_info.state = IAP_STS_JMP;
245 }
246}
247
253void app_loop(void)
254{
255 if(iap_info.state == IAP_STS_JMP)
256 {
257 iap_clear_upgrade_flag();
258 nvic_system_reset();
259 }
260}
261
flash_sector_erase
flash_status_type flash_sector_erase(uint32_t sector_address)
erase a specified flash sector.
Definition: at32f415_flash.c:173
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
flash_word_program
flash_status_type flash_word_program(uint32_t address, uint32_t data)
program a word at a specified address.
Definition: at32f415_flash.c:288
flash_lock
void flash_lock(void)
lock the flash controller.
Definition: at32f415_flash.c:162
nvic_system_reset
void nvic_system_reset(void)
system reset
Definition: at32f415_misc.c:52
FLASH_BASE
#define FLASH_BASE
Definition: at32f415.h:285
iap_set_upgrade_flag
void iap_set_upgrade_flag(void)
set iap upgrade complete flag
Definition: app_led4_toggle/src/hid_iap_user.c:67
iap_idle
void iap_idle(void)
iap idle function
Definition: app_led4_toggle/src/hid_iap_user.c:124
iap_respond
void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
Definition: app_led4_toggle/src/hid_iap_user.c:177
iap_init
void iap_init(void)
iap init
Definition: app_led4_toggle/src/hid_iap_user.c:97
usbd_hid_iap_process
iap_result_type usbd_hid_iap_process(void *udev, uint8_t *pdata, uint16_t len)
usb device iap function
Definition: app_led4_toggle/src/hid_iap_user.c:194
crc_cal
uint32_t crc_cal(uint32_t addr, uint16_t nk)
crc cal
Definition: bootloader/src/hid_iap_user.c:157
iap_get_upgrade_flag
iap_result_type iap_get_upgrade_flag(void)
get iap upgrade complete flag
Definition: app_led4_toggle/src/hid_iap_user.c:79
iap_finish
void iap_finish(void)
Definition: bootloader/src/hid_iap_user.c:318
iap_start
void iap_start(void)
iap start function
Definition: app_led4_toggle/src/hid_iap_user.c:136
pftarget
void(* pftarget)(void)
Definition: app_led4_toggle/src/hid_iap_user.c:39
iap_clear_upgrade_flag
void iap_clear_upgrade_flag(void)
clear iap upgrade flag
Definition: app_led4_toggle/src/hid_iap_user.c:55
iap_get
void iap_get()
Definition: app_led4_toggle/src/hid_iap_user.c:159
app_loop
void app_loop(void)
iap loop
Definition: app_led4_toggle/src/hid_iap_user.c:253
iap_jump
void iap_jump(void)
Definition: app_led4_toggle/src/hid_iap_user.c:148
usbd_hid_iap_in_complete
void usbd_hid_iap_in_complete(void *udev)
usb device in transfer complete function
Definition: app_led4_toggle/src/hid_iap_user.c:240
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: audio_hid_class.c:818
IAP_CMD_IDLE
#define IAP_CMD_IDLE
iap command
Definition: hid_iap_class.h:80
IAP_CMD_GET
#define IAP_CMD_GET
Definition: hid_iap_class.h:87
SECTOR_SIZE_1K
#define SECTOR_SIZE_1K
Definition: hid_iap_class.h:73
iap_result_type
iap_result_type
Definition: hid_iap_class.h:98
IAP_ACK
#define IAP_ACK
Definition: hid_iap_class.h:94
SECTOR_SIZE_2K
#define SECTOR_SIZE_2K
Definition: hid_iap_class.h:74
IAP_UPGRADE_COMPLETE_FLAG
#define IAP_UPGRADE_COMPLETE_FLAG
Definition: hid_iap_class.h:90
FLASH_SIZE_REG
#define FLASH_SIZE_REG()
Definition: hid_iap_class.h:70
IAP_CMD_START
#define IAP_CMD_START
Definition: hid_iap_class.h:81
IAP_CMD_JMP
#define IAP_CMD_JMP
Definition: hid_iap_class.h:86
KB_TO_B
#define KB_TO_B(kb)
Definition: hid_iap_class.h:71
IAP_FAILED
@ IAP_FAILED
Definition: hid_iap_class.h:101
IAP_SUCCESS
@ IAP_SUCCESS
Definition: hid_iap_class.h:99
IAP_STS_START
@ IAP_STS_START
Definition: hid_iap_class.h:107
IAP_STS_JMP
@ IAP_STS_JMP
Definition: hid_iap_class.h:113
IAP_STS_JMP_WAIT
@ IAP_STS_JMP_WAIT
Definition: hid_iap_class.h:112
iap_info
iap_info_type iap_info
Definition: hid_iap_class.c:65
FLASH_APP_ADDRESS
#define FLASH_APP_ADDRESS
Definition: app_led3_toggle/inc/hid_iap_user.h:49
hid_iap_class.h
usb hid iap header file
iap_info_type::flag_address
uint32_t flag_address
Definition: hid_iap_class.h:128
iap_info_type::sector_size
uint32_t sector_size
Definition: hid_iap_class.h:133
iap_info_type::iap_address
uint32_t iap_address
Definition: hid_iap_class.h:127
iap_info_type::flash_start_address
uint32_t flash_start_address
Definition: hid_iap_class.h:130
iap_info_type::flash_end_address
uint32_t flash_end_address
Definition: hid_iap_class.h:131
iap_info_type::fifo_length
uint32_t fifo_length
Definition: hid_iap_class.h:123
iap_info_type::flash_size
uint32_t flash_size
Definition: hid_iap_class.h:134
iap_info_type::iap_tx
uint8_t iap_tx[0x40]
Definition: hid_iap_class.h:121
iap_info_type::app_address
uint32_t app_address
Definition: hid_iap_class.h:126
iap_info_type::respond_flag
uint8_t respond_flag
Definition: hid_iap_class.h:137
iap_info_type::state
iap_machine_state_type state
Definition: hid_iap_class.h:136


AT32F415 Firmwary Library: iap.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • src
app_led4_toggle/src/iap.c
Go to the documentation of this file.
1
27#include "iap.h"
28#include "usart.h"
29#include "tmr.h"
30
44void iap_command_handle(void)
45{
46 if(iap_flag==IAP_REV_FLAG_DONE)
47 {
48 flash_unlock();
49 flash_sector_erase(IAP_UPGRADE_FLAG_ADDR);
50 flash_word_program(IAP_UPGRADE_FLAG_ADDR, IAP_UPGRADE_FLAG);
51 flash_lock();
52 nvic_system_reset();
53 }
54}
55
61void iap_init(void)
62{
63 if((*(uint32_t*)IAP_UPGRADE_FLAG_ADDR) == IAP_UPGRADE_FLAG)
64 {
65 flash_unlock();
66 flash_sector_erase(IAP_UPGRADE_FLAG_ADDR);
67 flash_lock();
68 }
69}
70
flash_sector_erase
flash_status_type flash_sector_erase(uint32_t sector_address)
erase a specified flash sector.
Definition: at32f415_flash.c:173
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
flash_word_program
flash_status_type flash_word_program(uint32_t address, uint32_t data)
program a word at a specified address.
Definition: at32f415_flash.c:288
flash_lock
void flash_lock(void)
lock the flash controller.
Definition: at32f415_flash.c:162
nvic_system_reset
void nvic_system_reset(void)
system reset
Definition: at32f415_misc.c:52
iap_flag
uint8_t iap_flag
Definition: app_led3_toggle/src/usart.c:38
iap_init
void iap_init(void)
iap init.
Definition: app_led4_toggle/src/iap.c:61
iap_command_handle
void iap_command_handle(void)
iap command handle handle.
Definition: app_led4_toggle/src/iap.c:44
IAP_UPGRADE_FLAG_ADDR
#define IAP_UPGRADE_FLAG_ADDR
Definition: app_led3_toggle/inc/iap.h:52
IAP_REV_FLAG_DONE
#define IAP_REV_FLAG_DONE
Definition: app_led3_toggle/inc/usart.h:52
IAP_UPGRADE_FLAG
#define IAP_UPGRADE_FLAG
Definition: app_led3_toggle/inc/iap.h:56


AT32F415 Firmwary Library: tmr.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • src
app_led4_toggle/src/tmr.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "tmr.h"
29#include "iap.h"
30
44void tmr_init(void)
45{
46 crm_clocks_freq_type crm_clocks_freq_struct = {0};
47
48 crm_periph_clock_enable(CRM_TMR3_PERIPH_CLOCK, TRUE);
49
50 /* enable the tmr3 global interrupt */
51 nvic_irq_enable(TMR3_GLOBAL_IRQn, 1, 0);
52
53 /* get system clock */
54 crm_clocks_freq_get(&crm_clocks_freq_struct);
55
56 /* time base configuration */
57 tmr_base_init(TMR3, 10000, crm_clocks_freq_struct.ahb_freq / 10000);
58 tmr_cnt_dir_set(TMR3, TMR_COUNT_UP);
59
60 /* overflow interrupt enable */
61 tmr_interrupt_enable(TMR3, TMR_OVF_INT, TRUE);
62
63 /* enable tmr */
64 tmr_counter_enable(TMR3, TRUE);
65}
66
72void TMR3_GLOBAL_IRQHandler(void)
73{
74 if(tmr_flag_get(TMR3, TMR_OVF_FLAG) == SET)
75 {
76 tmr_flag_clear(TMR3, TMR_OVF_FLAG);
77 at32_led_toggle(LED4);
78 }
79}
80
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/debug/tmr1/src/main.c:39
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_TMR3_PERIPH_CLOCK
@ CRM_TMR3_PERIPH_CLOCK
Definition: at32f415_crm.h:124
TMR3_GLOBAL_IRQn
@ TMR3_GLOBAL_IRQn
Definition: at32f415.h:165
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_OVF_FLAG
#define TMR_OVF_FLAG
Definition: at32f415_tmr.h:52
TMR_OVF_INT
#define TMR_OVF_INT
Definition: at32f415_tmr.h:74
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
TMR3_GLOBAL_IRQHandler
void TMR3_GLOBAL_IRQHandler(void)
tmr3 global interrupt handler.
Definition: app_led4_toggle/src/tmr.c:72
tmr_init
void tmr_init(void)
init tmr.
Definition: app_led4_toggle/src/tmr.c:44
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::ahb_freq
uint32_t ahb_freq
Definition: at32f415_crm.h:473


AT32F415 Firmwary Library: usart.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • src
app_led4_toggle/src/usart.c
Go to the documentation of this file.
1
27#include "usart.h"
28#include "tmr.h"
29
38uint8_t iap_flag = IAP_REV_FLAG_NO;
39
45void uart_init(uint32_t baudrate)
46{
47 gpio_init_type gpio_init_struct;
48 /* enable the usart and it's io clock */
49 crm_periph_clock_enable(CRM_USART1_PERIPH_CLOCK, TRUE);
50 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
51
52 /* set default parameter */
53 gpio_default_para_init(&gpio_init_struct);
54
55 /* configure the usart1_tx pa9 */
56 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
57 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
58 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
59 gpio_init_struct.gpio_pins = GPIO_PINS_9;
60 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
61 gpio_init(GPIOA, &gpio_init_struct);
62
63 /* configure the usart1_rx pa10 */
64 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
65 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
66 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
67 gpio_init_struct.gpio_pins = GPIO_PINS_10;
68 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
69 gpio_init(GPIOA, &gpio_init_struct);
70
71 /*configure usart nvic interrupt */
72 nvic_irq_enable(USART1_IRQn, 0, 0);
73
74 /*configure usart param*/
75 usart_init(USART1, baudrate, USART_DATA_8BITS, USART_STOP_1_BIT);
76 usart_transmitter_enable(USART1, TRUE);
77 usart_receiver_enable(USART1, TRUE);
78 usart_interrupt_enable(USART1, USART_RDBF_INT, TRUE);
79 usart_enable(USART1, TRUE);
80}
81
87void USART1_IRQHandler(void)
88{
89 uint16_t reval;
90 if(usart_flag_get(USART1, USART_RDBF_FLAG) != RESET)
91 {
92 reval = usart_data_receive(USART1);
93 if((reval == 0x5A) && (iap_flag == IAP_REV_FLAG_NO))
94 iap_flag = IAP_REV_FLAG_5A;
95 else if((reval == 0xA5) && (iap_flag == IAP_REV_FLAG_5A))
96 iap_flag = IAP_REV_FLAG_DONE;
97 else
98 iap_flag = IAP_REV_FLAG_NO;
99 }
100}
101
107void back_ok(void)
108{
109 usart_data_transmit(USART1, 0xCC);
110 while(usart_flag_get(USART1, USART_TDC_FLAG) == RESET);
111 usart_data_transmit(USART1, 0xDD);
112 while(usart_flag_get(USART1, USART_TDC_FLAG) == RESET);
113}
114
120void back_err(void)
121{
122 usart_data_transmit(USART1, 0xEE);
123 while(usart_flag_get(USART1, USART_TDC_FLAG) == RESET);
124 usart_data_transmit(USART1, 0xFF);
125 while(usart_flag_get(USART1, USART_TDC_FLAG) == RESET);
126}
127
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_USART1_PERIPH_CLOCK
@ CRM_USART1_PERIPH_CLOCK
Definition: at32f415_crm.h:118
USART1_IRQn
@ USART1_IRQn
Definition: at32f415.h:173
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
USART1_IRQHandler
void USART1_IRQHandler(void)
usart1 interrupt handler.
Definition: app_led4_toggle/src/usart.c:87
uart_init
void uart_init(uint32_t baudrate)
init usart.
Definition: app_led4_toggle/src/usart.c:45
iap_flag
uint8_t iap_flag
Definition: app_led4_toggle/src/usart.c:38
back_err
void back_err(void)
command response error.
Definition: app_led4_toggle/src/usart.c:120
back_ok
void back_ok(void)
command response ok.
Definition: app_led4_toggle/src/usart.c:107
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_interrupt_enable
void usart_interrupt_enable(usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts.
Definition: at32f415_usart.c:257
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_TDC_FLAG
#define USART_TDC_FLAG
Definition: at32f415_usart.h:58
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART_RDBF_INT
#define USART_RDBF_INT
Definition: at32f415_usart.h:73
USART1
#define USART1
Definition: at32f415_usart.h:319
IAP_REV_FLAG_DONE
#define IAP_REV_FLAG_DONE
Definition: app_led3_toggle/inc/usart.h:52
IAP_REV_FLAG_NO
#define IAP_REV_FLAG_NO
Definition: app_led3_toggle/inc/usart.h:50
IAP_REV_FLAG_5A
#define IAP_REV_FLAG_5A
Definition: app_led3_toggle/inc/usart.h:51
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303


AT32F415 Firmwary Library: arm_fir_init_f32.c Source File

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
arm_fir_init_f32.c
Go to the documentation of this file.
1/* ----------------------------------------------------------------------
2 * Project: CMSIS DSP Library
3 * Title: arm_fir_init_f32.c
4 * Description: Floating-point FIR filter initialization function
5 *
6 * $Date: 18. March 2019
7 * $Revision: V1.6.0
8 *
9 * Target Processor: Cortex-M cores
10 * -------------------------------------------------------------------- */
11/*
12 * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved.
13 *
14 * SPDX-License-Identifier: Apache-2.0
15 *
16 * Licensed under the Apache License, Version 2.0 (the License); you may
17 * not use this file except in compliance with the License.
18 * You may obtain a copy of the License at
19 *
20 * www.apache.org/licenses/LICENSE-2.0
21 *
22 * Unless required by applicable law or agreed to in writing, software
23 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
24 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 * See the License for the specific language governing permissions and
26 * limitations under the License.
27 */
28
29#include "arm_math.h"
30
57void arm_fir_init_f32(
58 arm_fir_instance_f32 * S,
59 uint16_t numTaps,
60 const float32_t * pCoeffs,
61 float32_t * pState,
62 uint32_t blockSize)
63{
64 /* Assign filter taps */
65 S->numTaps = numTaps;
66
67 /* Assign coefficient pointer */
68 S->pCoeffs = pCoeffs;
69
70 /* Clear state buffer. The size is always (blockSize + numTaps - 1) */
71 memset(pState, 0, (numTaps + (blockSize - 1u)) * sizeof(float32_t));
72
73 /* Assign state pointer */
74 S->pState = pState;
75}
76
arm_fir_init_f32
void arm_fir_init_f32(arm_fir_instance_f32 *S, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR filter.
Definition: arm_fir_init_f32.c:57


AT32F415 Firmwary Library: at32f415.h Source File

  • libraries
  • cmsis
  • cm4
  • device_support
at32f415.h
Go to the documentation of this file.
1
27#ifndef __AT32F415_H
28#define __AT32F415_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#if defined (__CC_ARM)
35 #pragma anon_unions
36#endif
37
55#if !defined (AT32F415RCT7) && !defined (AT32F415RCT7_7) && !defined (AT32F415CCT7) && \
56 !defined (AT32F415CCU7) && !defined (AT32F415KCU7_4) && !defined (AT32F415RBT7) && \
57 !defined (AT32F415RBT7_7) && !defined (AT32F415CBT7) && !defined (AT32F415CBU7) && \
58 !defined (AT32F415KBU7_4) && !defined (AT32F415R8T7) && !defined (AT32F415R8T7_7) && \
59 !defined (AT32F415C8T7) && !defined (AT32F415K8U7_4)
60
61 #error "Please select first the target device used in your application (in at32f415.h file)"
62#endif
63
64#if defined (AT32F415RCT7) || defined (AT32F415RCT7_7) || defined (AT32F415CCT7) || \
65 defined (AT32F415CCU7) || defined (AT32F415KCU7_4) || defined (AT32F415RBT7) || \
66 defined (AT32F415RBT7_7) || defined (AT32F415CBT7) || defined (AT32F415CBU7) || \
67 defined (AT32F415KBU7_4) || defined (AT32F415R8T7) || defined (AT32F415R8T7_7) || \
68 defined (AT32F415C8T7) || defined (AT32F415K8U7_4)
69
70 #define AT32F415xx
71#endif
72
73#ifndef USE_STDPERIPH_DRIVER
79 #ifdef _RTE_
80 #include "RTE_Components.h"
81 #ifdef RTE_DEVICE_STDPERIPH_FRAMEWORK
82 #define USE_STDPERIPH_DRIVER
83 #endif
84 #endif
85#endif
86
90#define __AT32F415_LIBRARY_VERSION_MAJOR (0x02)
91#define __AT32F415_LIBRARY_VERSION_MIDDLE (0x00)
92#define __AT32F415_LIBRARY_VERSION_MINOR (0x02)
93#define __AT32F415_LIBRARY_VERSION_RC (0x00)
94#define __AT32F415_LIBRARY_VERSION ((__AT32F415_LIBRARY_VERSION_MAJOR << 24) | \
95 (__AT32F415_LIBRARY_VERSION_MIDDLE << 16) | \
96 (__AT32F415_LIBRARY_VERSION_MINOR << 8) | \
97 (__AT32F415_LIBRARY_VERSION_RC))
98
110#define __CM4_REV 0x0001U
111#define __MPU_PRESENT 1
112#define __NVIC_PRIO_BITS 4
113#define __Vendor_SysTickConfig 0
114#define __FPU_PRESENT 0U
120typedef enum IRQn
121{
122 /****** cortex-m4 processor exceptions numbers ***************************************************/
123 Reset_IRQn = -15,
124 NonMaskableInt_IRQn = -14,
125 HardFault_IRQn = -13,
126 MemoryManagement_IRQn = -12,
127 BusFault_IRQn = -11,
128 UsageFault_IRQn = -10,
129 SVCall_IRQn = -5,
130 DebugMonitor_IRQn = -4,
131 PendSV_IRQn = -2,
132 SysTick_IRQn = -1,
134 /****** at32 specific interrupt numbers *********************************************************/
135 WWDT_IRQn = 0,
136 PVM_IRQn = 1,
137 TAMP_STAMP_IRQn = 2,
138 ERTC_WKUP_IRQn = 3,
139 FLASH_IRQn = 4,
140 CRM_IRQn = 5,
141 EXINT0_IRQn = 6,
142 EXINT1_IRQn = 7,
143 EXINT2_IRQn = 8,
144 EXINT3_IRQn = 9,
145 EXINT4_IRQn = 10,
146 DMA1_Channel1_IRQn = 11,
147 DMA1_Channel2_IRQn = 12,
148 DMA1_Channel3_IRQn = 13,
149 DMA1_Channel4_IRQn = 14,
150 DMA1_Channel5_IRQn = 15,
151 DMA1_Channel6_IRQn = 16,
152 DMA1_Channel7_IRQn = 17,
154 ADC1_IRQn = 18,
155 CAN1_TX_IRQn = 19,
156 CAN1_RX0_IRQn = 20,
157 CAN1_RX1_IRQn = 21,
158 CAN1_SE_IRQn = 22,
159 EXINT9_5_IRQn = 23,
160 TMR1_BRK_TMR9_IRQn = 24,
161 TMR1_OVF_TMR10_IRQn = 25,
162 TMR1_TRG_HALL_TMR11_IRQn = 26,
163 TMR1_CH_IRQn = 27,
164 TMR2_GLOBAL_IRQn = 28,
165 TMR3_GLOBAL_IRQn = 29,
166 TMR4_GLOBAL_IRQn = 30,
167 I2C1_EVT_IRQn = 31,
168 I2C1_ERR_IRQn = 32,
169 I2C2_EVT_IRQn = 33,
170 I2C2_ERR_IRQn = 34,
171 SPI1_IRQn = 35,
172 SPI2_IRQn = 36,
173 USART1_IRQn = 37,
174 USART2_IRQn = 38,
175 USART3_IRQn = 39,
176 EXINT15_10_IRQn = 40,
177 ERTCAlarm_IRQn = 41,
178 OTGFS1_WKUP_IRQn = 42,
179 SDIO1_IRQn = 49,
180 TMR5_GLOBAL_IRQn = 50,
181 UART4_IRQn = 52,
182 UART5_IRQn = 53,
183 DMA2_Channel1_IRQn = 56,
184 DMA2_Channel2_IRQn = 57,
185 DMA2_Channel3_IRQn = 58,
186 DMA2_Channel4_5_IRQn = 59,
187 OTGFS1_IRQn = 67,
188 CMP1_IRQn = 70,
189 CMP2_IRQn = 71,
190 DMA2_Channel6_7_IRQn = 75,
192} IRQn_Type;
193
198#include "core_cm4.h"
199#include "system_at32f415.h"
200#include <stdint.h>
201
206typedef int32_t INT32;
207typedef int16_t INT16;
208typedef int8_t INT8;
209typedef uint32_t UINT32;
210typedef uint16_t UINT16;
211typedef uint8_t UINT8;
212
213typedef int32_t s32;
214typedef int16_t s16;
215typedef int8_t s8;
216
217typedef const int32_t sc32;
218typedef const int16_t sc16;
219typedef const int8_t sc8;
221typedef __IO int32_t vs32;
222typedef __IO int16_t vs16;
223typedef __IO int8_t vs8;
224
225typedef __I int32_t vsc32;
226typedef __I int16_t vsc16;
227typedef __I int8_t vsc8;
229typedef uint32_t u32;
230typedef uint16_t u16;
231typedef uint8_t u8;
232
233typedef const uint32_t uc32;
234typedef const uint16_t uc16;
235typedef const uint8_t uc8;
237typedef __IO uint32_t vu32;
238typedef __IO uint16_t vu16;
239typedef __IO uint8_t vu8;
240
241typedef __I uint32_t vuc32;
242typedef __I uint16_t vuc16;
243typedef __I uint8_t vuc8;
248typedef enum {RESET = 0, SET = !RESET} flag_status;
249
253typedef enum {FALSE = 0, TRUE = !FALSE} confirm_state;
254
258typedef enum {ERROR = 0, SUCCESS = !ERROR} error_status;
259
268#define REG8(addr) *(volatile uint8_t *)(addr)
269#define REG16(addr) *(volatile uint16_t *)(addr)
270#define REG32(addr) *(volatile uint32_t *)(addr)
271
272#define MAKE_VALUE(reg_offset, bit_num) (uint32_t)(((reg_offset) << 16) | (bit_num & 0x1F))
273
274#define PERIPH_REG(periph_base, value) REG32((periph_base + (value >> 16)))
275#define PERIPH_REG_BIT(value) (0x1U << (value & 0x1F))
276
285#define FLASH_BASE ((uint32_t)0x08000000)
286#define SPIM_FLASH_BASE ((uint32_t)0x08400000)
287#define USD_BASE ((uint32_t)0x1FFFF800)
288#define SRAM_BASE ((uint32_t)0x20000000)
289#define PERIPH_BASE ((uint32_t)0x40000000)
290#define DEBUG_BASE ((uint32_t)0xE0042000)
291
292#define APB1PERIPH_BASE (PERIPH_BASE + 0x00000)
293#define APB2PERIPH_BASE (PERIPH_BASE + 0x10000)
294#define AHBPERIPH_BASE (PERIPH_BASE + 0x20000)
295
296/* apb1 bus base address */
297#define TMR2_BASE (APB1PERIPH_BASE + 0x0000)
298#define TMR3_BASE (APB1PERIPH_BASE + 0x0400)
299#define TMR4_BASE (APB1PERIPH_BASE + 0x0800)
300#define TMR5_BASE (APB1PERIPH_BASE + 0x0C00)
301#define CMP_BASE (APB1PERIPH_BASE + 0x2400)
302#define ERTC_BASE (APB1PERIPH_BASE + 0x2800)
303#define WWDT_BASE (APB1PERIPH_BASE + 0x2C00)
304#define WDT_BASE (APB1PERIPH_BASE + 0x3000)
305#define SPI2_BASE (APB1PERIPH_BASE + 0x3800)
306#define USART2_BASE (APB1PERIPH_BASE + 0x4400)
307#define USART3_BASE (APB1PERIPH_BASE + 0x4800)
308#define UART4_BASE (APB1PERIPH_BASE + 0x4C00)
309#define UART5_BASE (APB1PERIPH_BASE + 0x5000)
310#define I2C1_BASE (APB1PERIPH_BASE + 0x5400)
311#define I2C2_BASE (APB1PERIPH_BASE + 0x5800)
312#define CAN1_BASE (APB1PERIPH_BASE + 0x6400)
313#define PWC_BASE (APB1PERIPH_BASE + 0x7000)
314/* apb2 bus base address */
315#define IOMUX_BASE (APB2PERIPH_BASE + 0x0000)
316#define EXINT_BASE (APB2PERIPH_BASE + 0x0400)
317#define GPIOA_BASE (APB2PERIPH_BASE + 0x0800)
318#define GPIOB_BASE (APB2PERIPH_BASE + 0x0C00)
319#define GPIOC_BASE (APB2PERIPH_BASE + 0x1000)
320#define GPIOD_BASE (APB2PERIPH_BASE + 0x1400)
321#define GPIOF_BASE (APB2PERIPH_BASE + 0x1C00)
322#define ADC1_BASE (APB2PERIPH_BASE + 0x2400)
323#define TMR1_BASE (APB2PERIPH_BASE + 0x2C00)
324#define SPI1_BASE (APB2PERIPH_BASE + 0x3000)
325#define USART1_BASE (APB2PERIPH_BASE + 0x3800)
326#define TMR9_BASE (APB2PERIPH_BASE + 0x4C00)
327#define TMR10_BASE (APB2PERIPH_BASE + 0x5000)
328#define TMR11_BASE (APB2PERIPH_BASE + 0x5400)
329#define SDIO1_BASE (APB2PERIPH_BASE + 0x8000)
330/* ahb bus base address */
331#define DMA1_BASE (AHBPERIPH_BASE + 0x0000)
332#define DMA1_CHANNEL1_BASE (AHBPERIPH_BASE + 0x0008)
333#define DMA1_CHANNEL2_BASE (AHBPERIPH_BASE + 0x001C)
334#define DMA1_CHANNEL3_BASE (AHBPERIPH_BASE + 0x0030)
335#define DMA1_CHANNEL4_BASE (AHBPERIPH_BASE + 0x0044)
336#define DMA1_CHANNEL5_BASE (AHBPERIPH_BASE + 0x0058)
337#define DMA1_CHANNEL6_BASE (AHBPERIPH_BASE + 0x006C)
338#define DMA1_CHANNEL7_BASE (AHBPERIPH_BASE + 0x0080)
339#define DMA2_BASE (AHBPERIPH_BASE + 0x0400)
340#define DMA2_CHANNEL1_BASE (AHBPERIPH_BASE + 0x0408)
341#define DMA2_CHANNEL2_BASE (AHBPERIPH_BASE + 0x041C)
342#define DMA2_CHANNEL3_BASE (AHBPERIPH_BASE + 0x0430)
343#define DMA2_CHANNEL4_BASE (AHBPERIPH_BASE + 0x0444)
344#define DMA2_CHANNEL5_BASE (AHBPERIPH_BASE + 0x0458)
345#define DMA2_CHANNEL6_BASE (AHBPERIPH_BASE + 0x046C)
346#define DMA2_CHANNEL7_BASE (AHBPERIPH_BASE + 0x0480)
347#define CRM_BASE (AHBPERIPH_BASE + 0x1000)
348#define FLASH_REG_BASE (AHBPERIPH_BASE + 0x2000)
349#define CRC_BASE (AHBPERIPH_BASE + 0x3000)
350#define OTGFS1_BASE (PERIPH_BASE + 0x10000000)
351
364#include "at32f415_def.h"
365#include "at32f415_conf.h"
366
367#ifdef __cplusplus
368}
369#endif
370
371#endif
at32f415_def.h
at32f415 macros header file
IRQn_Type
enum IRQn IRQn_Type
at32f415 interrupt number definition, according to the selected device in Library_configuration_secti...
IRQn
IRQn
at32f415 interrupt number definition, according to the selected device in Library_configuration_secti...
Definition: at32f415.h:121
PendSV_IRQn
@ PendSV_IRQn
Definition: at32f415.h:131
TMR1_BRK_TMR9_IRQn
@ TMR1_BRK_TMR9_IRQn
Definition: at32f415.h:160
DMA1_Channel2_IRQn
@ DMA1_Channel2_IRQn
Definition: at32f415.h:147
TMR1_OVF_TMR10_IRQn
@ TMR1_OVF_TMR10_IRQn
Definition: at32f415.h:161
OTGFS1_WKUP_IRQn
@ OTGFS1_WKUP_IRQn
Definition: at32f415.h:178
ERTC_WKUP_IRQn
@ ERTC_WKUP_IRQn
Definition: at32f415.h:138
MemoryManagement_IRQn
@ MemoryManagement_IRQn
Definition: at32f415.h:126
ADC1_IRQn
@ ADC1_IRQn
Definition: at32f415.h:154
DMA1_Channel1_IRQn
@ DMA1_Channel1_IRQn
Definition: at32f415.h:146
DMA1_Channel3_IRQn
@ DMA1_Channel3_IRQn
Definition: at32f415.h:148
USART2_IRQn
@ USART2_IRQn
Definition: at32f415.h:174
DMA2_Channel6_7_IRQn
@ DMA2_Channel6_7_IRQn
Definition: at32f415.h:190
I2C1_ERR_IRQn
@ I2C1_ERR_IRQn
Definition: at32f415.h:168
SVCall_IRQn
@ SVCall_IRQn
Definition: at32f415.h:129
I2C1_EVT_IRQn
@ I2C1_EVT_IRQn
Definition: at32f415.h:167
SPI2_IRQn
@ SPI2_IRQn
Definition: at32f415.h:172
Reset_IRQn
@ Reset_IRQn
Definition: at32f415.h:123
ERTCAlarm_IRQn
@ ERTCAlarm_IRQn
Definition: at32f415.h:177
DMA1_Channel7_IRQn
@ DMA1_Channel7_IRQn
Definition: at32f415.h:152
UsageFault_IRQn
@ UsageFault_IRQn
Definition: at32f415.h:128
SysTick_IRQn
@ SysTick_IRQn
Definition: at32f415.h:132
CMP2_IRQn
@ CMP2_IRQn
Definition: at32f415.h:189
EXINT9_5_IRQn
@ EXINT9_5_IRQn
Definition: at32f415.h:159
EXINT1_IRQn
@ EXINT1_IRQn
Definition: at32f415.h:142
BusFault_IRQn
@ BusFault_IRQn
Definition: at32f415.h:127
WWDT_IRQn
@ WWDT_IRQn
Definition: at32f415.h:135
TMR4_GLOBAL_IRQn
@ TMR4_GLOBAL_IRQn
Definition: at32f415.h:166
DebugMonitor_IRQn
@ DebugMonitor_IRQn
Definition: at32f415.h:130
EXINT0_IRQn
@ EXINT0_IRQn
Definition: at32f415.h:141
FLASH_IRQn
@ FLASH_IRQn
Definition: at32f415.h:139
CRM_IRQn
@ CRM_IRQn
Definition: at32f415.h:140
PVM_IRQn
@ PVM_IRQn
Definition: at32f415.h:136
TMR3_GLOBAL_IRQn
@ TMR3_GLOBAL_IRQn
Definition: at32f415.h:165
SDIO1_IRQn
@ SDIO1_IRQn
Definition: at32f415.h:179
TMR5_GLOBAL_IRQn
@ TMR5_GLOBAL_IRQn
Definition: at32f415.h:180
CAN1_TX_IRQn
@ CAN1_TX_IRQn
Definition: at32f415.h:155
EXINT3_IRQn
@ EXINT3_IRQn
Definition: at32f415.h:144
DMA1_Channel6_IRQn
@ DMA1_Channel6_IRQn
Definition: at32f415.h:151
SPI1_IRQn
@ SPI1_IRQn
Definition: at32f415.h:171
HardFault_IRQn
@ HardFault_IRQn
Definition: at32f415.h:125
OTGFS1_IRQn
@ OTGFS1_IRQn
Definition: at32f415.h:187
CAN1_RX0_IRQn
@ CAN1_RX0_IRQn
Definition: at32f415.h:156
CMP1_IRQn
@ CMP1_IRQn
Definition: at32f415.h:188
EXINT15_10_IRQn
@ EXINT15_10_IRQn
Definition: at32f415.h:176
DMA2_Channel1_IRQn
@ DMA2_Channel1_IRQn
Definition: at32f415.h:183
DMA1_Channel5_IRQn
@ DMA1_Channel5_IRQn
Definition: at32f415.h:150
TAMP_STAMP_IRQn
@ TAMP_STAMP_IRQn
Definition: at32f415.h:137
UART5_IRQn
@ UART5_IRQn
Definition: at32f415.h:182
DMA2_Channel2_IRQn
@ DMA2_Channel2_IRQn
Definition: at32f415.h:184
TMR1_TRG_HALL_TMR11_IRQn
@ TMR1_TRG_HALL_TMR11_IRQn
Definition: at32f415.h:162
TMR1_CH_IRQn
@ TMR1_CH_IRQn
Definition: at32f415.h:163
EXINT4_IRQn
@ EXINT4_IRQn
Definition: at32f415.h:145
I2C2_ERR_IRQn
@ I2C2_ERR_IRQn
Definition: at32f415.h:170
USART1_IRQn
@ USART1_IRQn
Definition: at32f415.h:173
DMA2_Channel3_IRQn
@ DMA2_Channel3_IRQn
Definition: at32f415.h:185
DMA2_Channel4_5_IRQn
@ DMA2_Channel4_5_IRQn
Definition: at32f415.h:186
CAN1_SE_IRQn
@ CAN1_SE_IRQn
Definition: at32f415.h:158
NonMaskableInt_IRQn
@ NonMaskableInt_IRQn
Definition: at32f415.h:124
UART4_IRQn
@ UART4_IRQn
Definition: at32f415.h:181
DMA1_Channel4_IRQn
@ DMA1_Channel4_IRQn
Definition: at32f415.h:149
EXINT2_IRQn
@ EXINT2_IRQn
Definition: at32f415.h:143
I2C2_EVT_IRQn
@ I2C2_EVT_IRQn
Definition: at32f415.h:169
CAN1_RX1_IRQn
@ CAN1_RX1_IRQn
Definition: at32f415.h:157
TMR2_GLOBAL_IRQn
@ TMR2_GLOBAL_IRQn
Definition: at32f415.h:164
USART3_IRQn
@ USART3_IRQn
Definition: at32f415.h:175
vu32
__IO uint32_t vu32
Definition: at32f415.h:237
INT8
int8_t INT8
Definition: at32f415.h:208
vs16
__IO int16_t vs16
Definition: at32f415.h:222
error_status
error_status
error status
Definition: at32f415.h:258
INT32
int32_t INT32
Definition: at32f415.h:206
vuc32
__I uint32_t vuc32
Definition: at32f415.h:241
sc8
const int8_t sc8
Definition: at32f415.h:219
vsc16
__I int16_t vsc16
Definition: at32f415.h:226
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
vsc8
__I int8_t vsc8
Definition: at32f415.h:227
vs32
__IO int32_t vs32
Definition: at32f415.h:221
vu8
__IO uint8_t vu8
Definition: at32f415.h:239
uc32
const uint32_t uc32
Definition: at32f415.h:233
sc16
const int16_t sc16
Definition: at32f415.h:218
vuc16
__I uint16_t vuc16
Definition: at32f415.h:242
flag_status
flag_status
flag status
Definition: at32f415.h:248
u8
uint8_t u8
Definition: at32f415.h:231
vu16
__IO uint16_t vu16
Definition: at32f415.h:238
s8
int8_t s8
Definition: at32f415.h:215
vs8
__IO int8_t vs8
Definition: at32f415.h:223
s16
int16_t s16
Definition: at32f415.h:214
vuc8
__I uint8_t vuc8
Definition: at32f415.h:243
uc16
const uint16_t uc16
Definition: at32f415.h:234
uc8
const uint8_t uc8
Definition: at32f415.h:235
INT16
int16_t INT16
Definition: at32f415.h:207
UINT16
uint16_t UINT16
Definition: at32f415.h:210
u16
uint16_t u16
Definition: at32f415.h:230
sc32
const int32_t sc32
Definition: at32f415.h:217
UINT32
uint32_t UINT32
Definition: at32f415.h:209
s32
int32_t s32
Definition: at32f415.h:213
vsc32
__I int32_t vsc32
Definition: at32f415.h:225
UINT8
uint8_t UINT8
Definition: at32f415.h:211
u32
uint32_t u32
Definition: at32f415.h:229
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
system_at32f415.h
cmsis cortex-m4 system header file.
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_adc.c Source File

  • libraries
  • drivers
  • src
at32f415_adc.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef ADC_MODULE_ENABLED
39
51void adc_reset(adc_type *adc_x)
52{
53 if(adc_x == ADC1)
54 {
55 crm_periph_reset(CRM_ADC1_PERIPH_RESET, TRUE);
56 crm_periph_reset(CRM_ADC1_PERIPH_RESET, FALSE);
57 }
58}
59
70void adc_enable(adc_type *adc_x, confirm_state new_state)
71{
72 adc_x->ctrl2_bit.adcen = new_state;
73}
74
91void adc_combine_mode_select(adc_combine_mode_type combine_mode)
92{
93 ADC1->ctrl1_bit.mssel = combine_mode;
94}
95
111void adc_base_default_para_init(adc_base_config_type *adc_base_struct)
112{
113 adc_base_struct->sequence_mode = FALSE;
114 adc_base_struct->repeat_mode = FALSE;
115 adc_base_struct->data_align = ADC_RIGHT_ALIGNMENT;
116 adc_base_struct->ordinary_channel_length = 1;
117}
118
137void adc_base_config(adc_type *adc_x, adc_base_config_type *adc_base_struct)
138{
139 adc_x->ctrl1_bit.sqen = adc_base_struct->sequence_mode;
140 adc_x->ctrl2_bit.rpen = adc_base_struct->repeat_mode;
141 adc_x->ctrl2_bit.dtalign = adc_base_struct->data_align;
142 adc_x->osq1_bit.oclen = adc_base_struct->ordinary_channel_length - 1;
143}
144
154void adc_dma_mode_enable(adc_type *adc_x, confirm_state new_state)
155{
156 adc_x->ctrl2_bit.ocdmaen = new_state;
157}
158
173void adc_interrupt_enable(adc_type *adc_x, uint32_t adc_int, confirm_state new_state)
174{
175 if(new_state == TRUE)
176 {
177 adc_x->ctrl1 |= adc_int;
178 }
179 else if(new_state == FALSE)
180 {
181 adc_x->ctrl1 &= ~adc_int;
182 }
183}
184
192void adc_calibration_init(adc_type *adc_x)
193{
194 adc_x->ctrl2_bit.adcalinit = TRUE;
195}
196
204 flag_status adc_calibration_init_status_get(adc_type *adc_x)
205{
206 if(adc_x->ctrl2_bit.adcalinit)
207 {
208 return SET;
209 }
210 else
211 {
212 return RESET;
213 }
214}
215
223void adc_calibration_start(adc_type *adc_x)
224{
225 adc_x->ctrl2_bit.adcal = TRUE;
226}
227
235 flag_status adc_calibration_status_get(adc_type *adc_x)
236{
237 if(adc_x->ctrl2_bit.adcal)
238 {
239 return SET;
240 }
241 else
242 {
243 return RESET;
244 }
245}
246
263void adc_voltage_monitor_enable(adc_type *adc_x, adc_voltage_monitoring_type adc_voltage_monitoring)
264{
265 adc_x->ctrl1_bit.ocvmen = FALSE;
266 adc_x->ctrl1_bit.pcvmen = FALSE;
267 adc_x->ctrl1_bit.vmsgen = FALSE;
268 adc_x->ctrl1 |= adc_voltage_monitoring;
269}
270
284void adc_voltage_monitor_threshold_value_set(adc_type *adc_x, uint16_t adc_high_threshold, uint16_t adc_low_threshold)
285{
286 adc_x->vmhb_bit.vmhb = adc_high_threshold;
287 adc_x->vmlb_bit.vmlb = adc_low_threshold;
288}
289
304void adc_voltage_monitor_single_channel_select(adc_type *adc_x, adc_channel_select_type adc_channel)
305{
306 adc_x->ctrl1_bit.vmcsel = adc_channel;
307}
308
336void adc_ordinary_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
337{
338 switch(adc_channel)
339 {
340 case ADC_CHANNEL_0:
341 adc_x->spt2_bit.cspt0 = adc_sampletime;
342 break;
343 case ADC_CHANNEL_1:
344 adc_x->spt2_bit.cspt1 = adc_sampletime;
345 break;
346 case ADC_CHANNEL_2:
347 adc_x->spt2_bit.cspt2 = adc_sampletime;
348 break;
349 case ADC_CHANNEL_3:
350 adc_x->spt2_bit.cspt3 = adc_sampletime;
351 break;
352 case ADC_CHANNEL_4:
353 adc_x->spt2_bit.cspt4 = adc_sampletime;
354 break;
355 case ADC_CHANNEL_5:
356 adc_x->spt2_bit.cspt5 = adc_sampletime;
357 break;
358 case ADC_CHANNEL_6:
359 adc_x->spt2_bit.cspt6 = adc_sampletime;
360 break;
361 case ADC_CHANNEL_7:
362 adc_x->spt2_bit.cspt7 = adc_sampletime;
363 break;
364 case ADC_CHANNEL_8:
365 adc_x->spt2_bit.cspt8 = adc_sampletime;
366 break;
367 case ADC_CHANNEL_9:
368 adc_x->spt2_bit.cspt9 = adc_sampletime;
369 break;
370 case ADC_CHANNEL_10:
371 adc_x->spt1_bit.cspt10 = adc_sampletime;
372 break;
373 case ADC_CHANNEL_11:
374 adc_x->spt1_bit.cspt11 = adc_sampletime;
375 break;
376 case ADC_CHANNEL_12:
377 adc_x->spt1_bit.cspt12 = adc_sampletime;
378 break;
379 case ADC_CHANNEL_13:
380 adc_x->spt1_bit.cspt13 = adc_sampletime;
381 break;
382 case ADC_CHANNEL_14:
383 adc_x->spt1_bit.cspt14 = adc_sampletime;
384 break;
385 case ADC_CHANNEL_15:
386 adc_x->spt1_bit.cspt15 = adc_sampletime;
387 break;
388 case ADC_CHANNEL_16:
389 adc_x->spt1_bit.cspt16 = adc_sampletime;
390 break;
391 case ADC_CHANNEL_17:
392 adc_x->spt1_bit.cspt17 = adc_sampletime;
393 break;
394 default:
395 break;
396 }
397 switch(adc_sequence)
398 {
399 case 1:
400 adc_x->osq3_bit.osn1 = adc_channel;
401 break;
402 case 2:
403 adc_x->osq3_bit.osn2 = adc_channel;
404 break;
405 case 3:
406 adc_x->osq3_bit.osn3 = adc_channel;
407 break;
408 case 4:
409 adc_x->osq3_bit.osn4 = adc_channel;
410 break;
411 case 5:
412 adc_x->osq3_bit.osn5 = adc_channel;
413 break;
414 case 6:
415 adc_x->osq3_bit.osn6 = adc_channel;
416 break;
417 case 7:
418 adc_x->osq2_bit.osn7 = adc_channel;
419 break;
420 case 8:
421 adc_x->osq2_bit.osn8 = adc_channel;
422 break;
423 case 9:
424 adc_x->osq2_bit.osn9 = adc_channel;
425 break;
426 case 10:
427 adc_x->osq2_bit.osn10 = adc_channel;
428 break;
429 case 11:
430 adc_x->osq2_bit.osn11 = adc_channel;
431 break;
432 case 12:
433 adc_x->osq2_bit.osn12 = adc_channel;
434 break;
435 case 13:
436 adc_x->osq1_bit.osn13 = adc_channel;
437 break;
438 case 14:
439 adc_x->osq1_bit.osn14 = adc_channel;
440 break;
441 case 15:
442 adc_x->osq1_bit.osn15 = adc_channel;
443 break;
444 case 16:
445 adc_x->osq1_bit.osn16 = adc_channel;
446 break;
447 default:
448 break;
449 }
450}
451
462void adc_preempt_channel_length_set(adc_type *adc_x, uint8_t adc_channel_lenght)
463{
464 adc_x->psq_bit.pclen = adc_channel_lenght - 1;
465}
466
494void adc_preempt_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
495{
496 uint16_t sequence_index=0;
497 switch(adc_channel)
498 {
499 case ADC_CHANNEL_0:
500 adc_x->spt2_bit.cspt0 = adc_sampletime;
501 break;
502 case ADC_CHANNEL_1:
503 adc_x->spt2_bit.cspt1 = adc_sampletime;
504 break;
505 case ADC_CHANNEL_2:
506 adc_x->spt2_bit.cspt2 = adc_sampletime;
507 break;
508 case ADC_CHANNEL_3:
509 adc_x->spt2_bit.cspt3 = adc_sampletime;
510 break;
511 case ADC_CHANNEL_4:
512 adc_x->spt2_bit.cspt4 = adc_sampletime;
513 break;
514 case ADC_CHANNEL_5:
515 adc_x->spt2_bit.cspt5 = adc_sampletime;
516 break;
517 case ADC_CHANNEL_6:
518 adc_x->spt2_bit.cspt6 = adc_sampletime;
519 break;
520 case ADC_CHANNEL_7:
521 adc_x->spt2_bit.cspt7 = adc_sampletime;
522 break;
523 case ADC_CHANNEL_8:
524 adc_x->spt2_bit.cspt8 = adc_sampletime;
525 break;
526 case ADC_CHANNEL_9:
527 adc_x->spt2_bit.cspt9 = adc_sampletime;
528 break;
529 case ADC_CHANNEL_10:
530 adc_x->spt1_bit.cspt10 = adc_sampletime;
531 break;
532 case ADC_CHANNEL_11:
533 adc_x->spt1_bit.cspt11 = adc_sampletime;
534 break;
535 case ADC_CHANNEL_12:
536 adc_x->spt1_bit.cspt12 = adc_sampletime;
537 break;
538 case ADC_CHANNEL_13:
539 adc_x->spt1_bit.cspt13 = adc_sampletime;
540 break;
541 case ADC_CHANNEL_14:
542 adc_x->spt1_bit.cspt14 = adc_sampletime;
543 break;
544 case ADC_CHANNEL_15:
545 adc_x->spt1_bit.cspt15 = adc_sampletime;
546 break;
547 case ADC_CHANNEL_16:
548 adc_x->spt1_bit.cspt16 = adc_sampletime;
549 break;
550 case ADC_CHANNEL_17:
551 adc_x->spt1_bit.cspt17 = adc_sampletime;
552 break;
553 default:
554 break;
555 }
556 sequence_index = adc_sequence + 3 - adc_x->psq_bit.pclen;
557 switch(sequence_index)
558 {
559 case 1:
560 adc_x->psq_bit.psn1 = adc_channel;
561 break;
562 case 2:
563 adc_x->psq_bit.psn2 = adc_channel;
564 break;
565 case 3:
566 adc_x->psq_bit.psn3 = adc_channel;
567 break;
568 case 4:
569 adc_x->psq_bit.psn4 = adc_channel;
570 break;
571 default:
572 break;
573 }
574}
575
592void adc_ordinary_conversion_trigger_set(adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state)
593{
594 if(adc_ordinary_trig > 7)
595 {
596 adc_x->ctrl2_bit.octesel_h = 1;
597 adc_x->ctrl2_bit.octesel_l = adc_ordinary_trig & 0x7;
598 }
599 else
600 {
601 adc_x->ctrl2_bit.octesel_h = 0;
602 adc_x->ctrl2_bit.octesel_l = adc_ordinary_trig & 0x7;
603 }
604 adc_x->ctrl2_bit.octen = new_state;
605}
606
623void adc_preempt_conversion_trigger_set(adc_type *adc_x, adc_preempt_trig_select_type adc_preempt_trig, confirm_state new_state)
624{
625 if(adc_preempt_trig > 7)
626 {
627 adc_x->ctrl2_bit.pctesel_h = 1;
628 adc_x->ctrl2_bit.pctesel_l = adc_preempt_trig & 0x7;
629 }
630 else
631 {
632 adc_x->ctrl2_bit.pctesel_h = 0;
633 adc_x->ctrl2_bit.pctesel_l = adc_preempt_trig & 0x7;
634 }
635 adc_x->ctrl2_bit.pcten = new_state;
636}
637
638
655void adc_preempt_offset_value_set(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel, uint16_t adc_offset_value)
656{
657 switch(adc_preempt_channel)
658 {
659 case ADC_PREEMPT_CHANNEL_1:
660 adc_x->pcdto1_bit.pcdto1 = adc_offset_value;
661 break;
662 case ADC_PREEMPT_CHANNEL_2:
663 adc_x->pcdto2_bit.pcdto2 = adc_offset_value;
664 break;
665 case ADC_PREEMPT_CHANNEL_3:
666 adc_x->pcdto3_bit.pcdto3 = adc_offset_value;
667 break;
668 case ADC_PREEMPT_CHANNEL_4:
669 adc_x->pcdto4_bit.pcdto4 = adc_offset_value;
670 break;
671 default:
672 break;
673 }
674}
675
686void adc_ordinary_part_count_set(adc_type *adc_x, uint8_t adc_channel_count)
687{
688
689 adc_x->ctrl1_bit.ocpcnt = adc_channel_count - 1;
690}
691
701void adc_ordinary_part_mode_enable(adc_type *adc_x, confirm_state new_state)
702{
703 adc_x->ctrl1_bit.ocpen = new_state;
704}
705
715void adc_preempt_part_mode_enable(adc_type *adc_x, confirm_state new_state)
716{
717 adc_x->ctrl1_bit.pcpen = new_state;
718}
719
729void adc_preempt_auto_mode_enable(adc_type *adc_x, confirm_state new_state)
730{
731 adc_x->ctrl1_bit.pcautoen = new_state;
732}
733
741void adc_tempersensor_vintrv_enable(confirm_state new_state)
742{
743 ADC1->ctrl2_bit.itsrven = new_state;
744}
745
755void adc_ordinary_software_trigger_enable(adc_type *adc_x, confirm_state new_state)
756{
757 adc_x->ctrl2_bit.ocswtrg = new_state;
758}
759
767 flag_status adc_ordinary_software_trigger_status_get(adc_type *adc_x)
768{
769 if(adc_x->ctrl2_bit.ocswtrg)
770 {
771 return SET;
772 }
773 else
774 {
775 return RESET;
776 }
777}
778
788void adc_preempt_software_trigger_enable(adc_type *adc_x, confirm_state new_state)
789{
790 adc_x->ctrl2_bit.pcswtrg = new_state;
791}
792
800 flag_status adc_preempt_software_trigger_status_get(adc_type *adc_x)
801{
802 if(adc_x->ctrl2_bit.pcswtrg)
803 {
804 return SET;
805 }
806 else
807 {
808 return RESET;
809 }
810}
811
819uint16_t adc_ordinary_conversion_data_get(adc_type *adc_x)
820{
821 return (uint16_t)(adc_x->odt_bit.odt);
822}
823
828uint32_t adc_combine_ordinary_conversion_data_get(void)
829{
830 return (uint32_t)(ADC1->odt);
831}
832
846uint16_t adc_preempt_conversion_data_get(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel)
847{
848 uint16_t preempt_conv_data_index = 0;
849 switch(adc_preempt_channel)
850 {
851 case ADC_PREEMPT_CHANNEL_1:
852 preempt_conv_data_index = (uint16_t)(adc_x->pdt1_bit.pdt1);
853 break;
854 case ADC_PREEMPT_CHANNEL_2:
855 preempt_conv_data_index = (uint16_t)(adc_x->pdt2_bit.pdt2);
856 break;
857 case ADC_PREEMPT_CHANNEL_3:
858 preempt_conv_data_index = (uint16_t)(adc_x->pdt3_bit.pdt3);
859 break;
860 case ADC_PREEMPT_CHANNEL_4:
861 preempt_conv_data_index = (uint16_t)(adc_x->pdt4_bit.pdt4);
862 break;
863 default:
864 break;
865 }
866 return preempt_conv_data_index;
867}
868
883 flag_status adc_flag_get(adc_type *adc_x, uint8_t adc_flag)
884{
885 flag_status status = RESET;
886
887 if((adc_x->sts & adc_flag) == RESET)
888 {
889 status = RESET;
890 }
891 else
892 {
893 status = SET;
894 }
895 return status;
896}
897
912void adc_flag_clear(adc_type *adc_x, uint32_t adc_flag)
913{
914 adc_x->sts = ~adc_flag;
915}
916
921#endif
922
adc_voltage_monitoring_type
adc_voltage_monitoring_type
adc voltage_monitoring type
Definition: at32f415_adc.h:194
adc_channel_select_type
adc_channel_select_type
adc channel select type
Definition: at32f415_adc.h:109
adc_sampletime_select_type
adc_sampletime_select_type
adc sampletime select type
Definition: at32f415_adc.h:134
adc_preempt_trig_select_type
adc_preempt_trig_select_type
adc preempt group trigger event select type
Definition: at32f415_adc.h:166
adc_combine_mode_type
adc_combine_mode_type
adc combine mode type
Definition: at32f415_adc.h:83
adc_ordinary_trig_select_type
adc_ordinary_trig_select_type
adc ordinary group trigger event select type
Definition: at32f415_adc.h:149
adc_preempt_channel_type
adc_preempt_channel_type
adc preempt channel type
Definition: at32f415_adc.h:183
ADC_RIGHT_ALIGNMENT
@ ADC_RIGHT_ALIGNMENT
Definition: at32f415_adc.h:101
ADC_CHANNEL_9
@ ADC_CHANNEL_9
Definition: at32f415_adc.h:119
ADC_CHANNEL_1
@ ADC_CHANNEL_1
Definition: at32f415_adc.h:111
ADC_CHANNEL_17
@ ADC_CHANNEL_17
Definition: at32f415_adc.h:127
ADC_CHANNEL_8
@ ADC_CHANNEL_8
Definition: at32f415_adc.h:118
ADC_CHANNEL_4
@ ADC_CHANNEL_4
Definition: at32f415_adc.h:114
ADC_CHANNEL_12
@ ADC_CHANNEL_12
Definition: at32f415_adc.h:122
ADC_CHANNEL_16
@ ADC_CHANNEL_16
Definition: at32f415_adc.h:126
ADC_CHANNEL_0
@ ADC_CHANNEL_0
Definition: at32f415_adc.h:110
ADC_CHANNEL_3
@ ADC_CHANNEL_3
Definition: at32f415_adc.h:113
ADC_CHANNEL_14
@ ADC_CHANNEL_14
Definition: at32f415_adc.h:124
ADC_CHANNEL_10
@ ADC_CHANNEL_10
Definition: at32f415_adc.h:120
ADC_CHANNEL_13
@ ADC_CHANNEL_13
Definition: at32f415_adc.h:123
ADC_CHANNEL_2
@ ADC_CHANNEL_2
Definition: at32f415_adc.h:112
ADC_CHANNEL_6
@ ADC_CHANNEL_6
Definition: at32f415_adc.h:116
ADC_CHANNEL_7
@ ADC_CHANNEL_7
Definition: at32f415_adc.h:117
ADC_CHANNEL_5
@ ADC_CHANNEL_5
Definition: at32f415_adc.h:115
ADC_CHANNEL_11
@ ADC_CHANNEL_11
Definition: at32f415_adc.h:121
ADC_CHANNEL_15
@ ADC_CHANNEL_15
Definition: at32f415_adc.h:125
ADC_PREEMPT_CHANNEL_3
@ ADC_PREEMPT_CHANNEL_3
Definition: at32f415_adc.h:186
ADC_PREEMPT_CHANNEL_4
@ ADC_PREEMPT_CHANNEL_4
Definition: at32f415_adc.h:187
ADC_PREEMPT_CHANNEL_2
@ ADC_PREEMPT_CHANNEL_2
Definition: at32f415_adc.h:185
ADC_PREEMPT_CHANNEL_1
@ ADC_PREEMPT_CHANNEL_1
Definition: at32f415_adc.h:184
adc_ordinary_software_trigger_enable
void adc_ordinary_software_trigger_enable(adc_type *adc_x, confirm_state new_state)
enable or disable ordinary software start conversion of the specified adc peripheral.
Definition: at32f415_adc.c:755
adc_voltage_monitor_enable
void adc_voltage_monitor_enable(adc_type *adc_x, adc_voltage_monitoring_type adc_voltage_monitoring)
enable or disable the voltage monitoring on single/all ordinary or preempt channels of the specified ...
Definition: at32f415_adc.c:263
adc_voltage_monitor_single_channel_select
void adc_voltage_monitor_single_channel_select(adc_type *adc_x, adc_channel_select_type adc_channel)
select the voltage monitoring's channel of the specified adc peripheral.
Definition: at32f415_adc.c:304
adc_ordinary_conversion_data_get
uint16_t adc_ordinary_conversion_data_get(adc_type *adc_x)
return the last conversion data for ordinary channel of the specified adc peripheral.
Definition: at32f415_adc.c:819
adc_preempt_offset_value_set
void adc_preempt_offset_value_set(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel, uint16_t adc_offset_value)
set preempt channel's conversion value offset of the specified adc peripheral.
Definition: at32f415_adc.c:655
adc_base_config
void adc_base_config(adc_type *adc_x, adc_base_config_type *adc_base_struct)
initialize the adc peripheral according to the specified parameters.
Definition: at32f415_adc.c:137
adc_ordinary_software_trigger_status_get
flag_status adc_ordinary_software_trigger_status_get(adc_type *adc_x)
get ordinary software start conversion status of the specified adc peripheral.
Definition: at32f415_adc.c:767
adc_preempt_auto_mode_enable
void adc_preempt_auto_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable automatic preempt group conversion of the specified adc peripheral.
Definition: at32f415_adc.c:729
adc_tempersensor_vintrv_enable
void adc_tempersensor_vintrv_enable(confirm_state new_state)
enable or disable the temperature sensor and vintrv channel.
Definition: at32f415_adc.c:741
adc_preempt_software_trigger_status_get
flag_status adc_preempt_software_trigger_status_get(adc_type *adc_x)
get preempt software start conversion status of the specified adc peripheral.
Definition: at32f415_adc.c:800
adc_enable
void adc_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the specified adc peripheral.
Definition: at32f415_adc.c:70
adc_ordinary_part_count_set
void adc_ordinary_part_count_set(adc_type *adc_x, uint8_t adc_channel_count)
set partitioned mode channel count of the specified adc peripheral.
Definition: at32f415_adc.c:686
adc_preempt_conversion_data_get
uint16_t adc_preempt_conversion_data_get(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel)
return the conversion data for selection preempt channel of the specified adc peripheral.
Definition: at32f415_adc.c:846
adc_flag_clear
void adc_flag_clear(adc_type *adc_x, uint32_t adc_flag)
clear flag of the specified adc peripheral.
Definition: at32f415_adc.c:912
adc_interrupt_enable
void adc_interrupt_enable(adc_type *adc_x, uint32_t adc_int, confirm_state new_state)
enable or disable the specified adc interrupts.
Definition: at32f415_adc.c:173
adc_base_default_para_init
void adc_base_default_para_init(adc_base_config_type *adc_base_struct)
adc base default para init.
Definition: at32f415_adc.c:111
adc_calibration_start
void adc_calibration_start(adc_type *adc_x)
start calibration process of the specified adc peripheral.
Definition: at32f415_adc.c:223
adc_calibration_status_get
flag_status adc_calibration_status_get(adc_type *adc_x)
get calibration status of the specified adc peripheral.
Definition: at32f415_adc.c:235
adc_voltage_monitor_threshold_value_set
void adc_voltage_monitor_threshold_value_set(adc_type *adc_x, uint16_t adc_high_threshold, uint16_t adc_low_threshold)
set voltage monitoring's high and low thresholds value of the specified adc peripheral.
Definition: at32f415_adc.c:284
adc_preempt_part_mode_enable
void adc_preempt_part_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the partitioned mode on preempt channel of the specified adc peripheral.
Definition: at32f415_adc.c:715
adc_ordinary_conversion_trigger_set
void adc_ordinary_conversion_trigger_set(adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state)
enable or disable the ordinary channel's external trigger and set external trigger event of the speci...
Definition: at32f415_adc.c:592
adc_preempt_conversion_trigger_set
void adc_preempt_conversion_trigger_set(adc_type *adc_x, adc_preempt_trig_select_type adc_preempt_trig, confirm_state new_state)
enable or disable the preempt channel's external trigger and set external trigger event of the specif...
Definition: at32f415_adc.c:623
adc_combine_ordinary_conversion_data_get
uint32_t adc_combine_ordinary_conversion_data_get(void)
return the last conversion data for ordinary channel of combine adc.
Definition: at32f415_adc.c:828
adc_flag_get
flag_status adc_flag_get(adc_type *adc_x, uint8_t adc_flag)
get flag of the specified adc peripheral.
Definition: at32f415_adc.c:883
adc_calibration_init
void adc_calibration_init(adc_type *adc_x)
initialize calibration register of the specified adc peripheral.
Definition: at32f415_adc.c:192
adc_preempt_channel_set
void adc_preempt_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
configure preempt channel's corresponding rank in the sequencer and sample time of the specified adc ...
Definition: at32f415_adc.c:494
adc_calibration_init_status_get
flag_status adc_calibration_init_status_get(adc_type *adc_x)
get calibration register's initialize status of the specified adc peripheral.
Definition: at32f415_adc.c:204
adc_ordinary_part_mode_enable
void adc_ordinary_part_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the partitioned mode on ordinary channel of the specified adc peripheral.
Definition: at32f415_adc.c:701
adc_dma_mode_enable
void adc_dma_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the adc dma transfer.
Definition: at32f415_adc.c:154
adc_combine_mode_select
void adc_combine_mode_select(adc_combine_mode_type combine_mode)
select combine mode of the specified adc peripheral.
Definition: at32f415_adc.c:91
adc_preempt_channel_length_set
void adc_preempt_channel_length_set(adc_type *adc_x, uint8_t adc_channel_lenght)
set preempt channel lenghth of the specified adc peripheral.
Definition: at32f415_adc.c:462
adc_reset
void adc_reset(adc_type *adc_x)
deinitialize the adc peripheral registers to their default reset values.
Definition: at32f415_adc.c:51
adc_preempt_software_trigger_enable
void adc_preempt_software_trigger_enable(adc_type *adc_x, confirm_state new_state)
enable or disable preempt software start conversion of the specified adc peripheral.
Definition: at32f415_adc.c:788
adc_ordinary_channel_set
void adc_ordinary_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc perip...
Definition: at32f415_adc.c:336
ADC1
#define ADC1
Definition: at32f415_adc.h:555
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
CRM_ADC1_PERIPH_RESET
@ CRM_ADC1_PERIPH_RESET
Definition: at32f415_crm.h:156
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
adc_base_config_type
adc base config type
Definition: at32f415_adc.h:208
adc_base_config_type::data_align
adc_data_align_type data_align
Definition: at32f415_adc.h:211
adc_base_config_type::repeat_mode
confirm_state repeat_mode
Definition: at32f415_adc.h:210
adc_base_config_type::sequence_mode
confirm_state sequence_mode
Definition: at32f415_adc.h:209
adc_base_config_type::ordinary_channel_length
uint8_t ordinary_channel_length
Definition: at32f415_adc.h:212
adc_type
type define adc register all
Definition: at32f415_adc.h:219
adc_type::cspt1
__IO uint32_t cspt1
Definition: at32f415_adc.h:323
adc_type::dtalign
__IO uint32_t dtalign
Definition: at32f415_adc.h:279
adc_type::pdt3_bit
struct adc_type::@34::@57 pdt3_bit
adc_type::ocdmaen
__IO uint32_t ocdmaen
Definition: at32f415_adc.h:277
adc_type::ocswtrg
__IO uint32_t ocswtrg
Definition: at32f415_adc.h:286
adc_type::osn14
__IO uint32_t osn14
Definition: at32f415_adc.h:423
adc_type::rpen
__IO uint32_t rpen
Definition: at32f415_adc.h:273
adc_type::sqen
__IO uint32_t sqen
Definition: at32f415_adc.h:250
adc_type::pcdto1_bit
struct adc_type::@10::@45 pcdto1_bit
adc_type::pctesel_h
__IO uint32_t pctesel_h
Definition: at32f415_adc.h:288
adc_type::pdt4
__IO uint32_t pdt4
Definition: at32f415_adc.h:528
adc_type::cspt15
__IO uint32_t cspt15
Definition: at32f415_adc.h:307
adc_type::pclen
__IO uint32_t pclen
Definition: at32f415_adc.h:479
adc_type::vmcsel
__IO uint32_t vmcsel
Definition: at32f415_adc.h:246
adc_type::cspt7
__IO uint32_t cspt7
Definition: at32f415_adc.h:329
adc_type::odt
__IO uint32_t odt
Definition: at32f415_adc.h:541
adc_type::pcvmen
__IO uint32_t pcvmen
Definition: at32f415_adc.h:258
adc_type::osn1
__IO uint32_t osn1
Definition: at32f415_adc.h:457
adc_type::ctrl2_bit
struct adc_type::@4::@42 ctrl2_bit
adc_type::pdt4_bit
struct adc_type::@36::@58 pdt4_bit
adc_type::pcdto2_bit
struct adc_type::@12::@46 pcdto2_bit
adc_type::pcdto4
__IO uint32_t pcdto4
Definition: at32f415_adc.h:380
adc_type::pdt1
__IO uint32_t pdt1
Definition: at32f415_adc.h:489
adc_type::psq_bit
struct adc_type::@28::@54 psq_bit
adc_type::pcdto2
__IO uint32_t pcdto2
Definition: at32f415_adc.h:354
adc_type::cspt6
__IO uint32_t cspt6
Definition: at32f415_adc.h:328
adc_type::osn6
__IO uint32_t osn6
Definition: at32f415_adc.h:462
adc_type::osn8
__IO uint32_t osn8
Definition: at32f415_adc.h:440
adc_type::pcpen
__IO uint32_t pcpen
Definition: at32f415_adc.h:254
adc_type::osn16
__IO uint32_t osn16
Definition: at32f415_adc.h:425
adc_type::osq2_bit
struct adc_type::@24::@52 osq2_bit
adc_type::cspt13
__IO uint32_t cspt13
Definition: at32f415_adc.h:305
adc_type::vmsgen
__IO uint32_t vmsgen
Definition: at32f415_adc.h:251
adc_type::osn3
__IO uint32_t osn3
Definition: at32f415_adc.h:459
adc_type::pdt2_bit
struct adc_type::@32::@56 pdt2_bit
adc_type::octen
__IO uint32_t octen
Definition: at32f415_adc.h:284
adc_type::spt2_bit
struct adc_type::@8::@44 spt2_bit
adc_type::vmlb_bit
struct adc_type::@20::@50 vmlb_bit
adc_type::ocvmen
__IO uint32_t ocvmen
Definition: at32f415_adc.h:259
adc_type::spt1_bit
struct adc_type::@6::@43 spt1_bit
adc_type::oclen
__IO uint32_t oclen
Definition: at32f415_adc.h:426
adc_type::pcdto1
__IO uint32_t pcdto1
Definition: at32f415_adc.h:341
adc_type::osn9
__IO uint32_t osn9
Definition: at32f415_adc.h:441
adc_type::cspt5
__IO uint32_t cspt5
Definition: at32f415_adc.h:327
adc_type::psn4
__IO uint32_t psn4
Definition: at32f415_adc.h:478
adc_type::cspt12
__IO uint32_t cspt12
Definition: at32f415_adc.h:304
adc_type::adcal
__IO uint32_t adcal
Definition: at32f415_adc.h:274
adc_type::cspt14
__IO uint32_t cspt14
Definition: at32f415_adc.h:306
adc_type::octesel_l
__IO uint32_t octesel_l
Definition: at32f415_adc.h:283
adc_type::odt_bit
struct adc_type::@38::@59 odt_bit
adc_type::pctesel_l
__IO uint32_t pctesel_l
Definition: at32f415_adc.h:280
adc_type::octesel_h
__IO uint32_t octesel_h
Definition: at32f415_adc.h:289
adc_type::psn3
__IO uint32_t psn3
Definition: at32f415_adc.h:477
adc_type::osn4
__IO uint32_t osn4
Definition: at32f415_adc.h:460
adc_type::adcen
__IO uint32_t adcen
Definition: at32f415_adc.h:272
adc_type::vmhb
__IO uint32_t vmhb
Definition: at32f415_adc.h:393
adc_type::ocpen
__IO uint32_t ocpen
Definition: at32f415_adc.h:253
adc_type::pcdto4_bit
struct adc_type::@16::@48 pcdto4_bit
adc_type::cspt9
__IO uint32_t cspt9
Definition: at32f415_adc.h:331
adc_type::pdt1_bit
struct adc_type::@30::@55 pdt1_bit
adc_type::adcalinit
__IO uint32_t adcalinit
Definition: at32f415_adc.h:275
adc_type::pdt3
__IO uint32_t pdt3
Definition: at32f415_adc.h:515
adc_type::ctrl1_bit
struct adc_type::@2::@41 ctrl1_bit
adc_type::psn1
__IO uint32_t psn1
Definition: at32f415_adc.h:475
adc_type::cspt10
__IO uint32_t cspt10
Definition: at32f415_adc.h:302
adc_type::osn10
__IO uint32_t osn10
Definition: at32f415_adc.h:442
adc_type::osn12
__IO uint32_t osn12
Definition: at32f415_adc.h:444
adc_type::vmhb_bit
struct adc_type::@18::@49 vmhb_bit
adc_type::ctrl1
__IO uint32_t ctrl1
Definition: at32f415_adc.h:243
adc_type::sts
__IO uint32_t sts
Definition: at32f415_adc.h:226
adc_type::cspt0
__IO uint32_t cspt0
Definition: at32f415_adc.h:322
adc_type::cspt16
__IO uint32_t cspt16
Definition: at32f415_adc.h:308
adc_type::pcdto3_bit
struct adc_type::@14::@47 pcdto3_bit
adc_type::psn2
__IO uint32_t psn2
Definition: at32f415_adc.h:476
adc_type::osn2
__IO uint32_t osn2
Definition: at32f415_adc.h:458
adc_type::osn15
__IO uint32_t osn15
Definition: at32f415_adc.h:424
adc_type::osn11
__IO uint32_t osn11
Definition: at32f415_adc.h:443
adc_type::vmlb
__IO uint32_t vmlb
Definition: at32f415_adc.h:406
adc_type::osn5
__IO uint32_t osn5
Definition: at32f415_adc.h:461
adc_type::pdt2
__IO uint32_t pdt2
Definition: at32f415_adc.h:502
adc_type::cspt4
__IO uint32_t cspt4
Definition: at32f415_adc.h:326
adc_type::ocpcnt
__IO uint32_t ocpcnt
Definition: at32f415_adc.h:255
adc_type::pcautoen
__IO uint32_t pcautoen
Definition: at32f415_adc.h:252
adc_type::cspt2
__IO uint32_t cspt2
Definition: at32f415_adc.h:324
adc_type::cspt17
__IO uint32_t cspt17
Definition: at32f415_adc.h:309
adc_type::cspt11
__IO uint32_t cspt11
Definition: at32f415_adc.h:303
adc_type::osq3_bit
struct adc_type::@26::@53 osq3_bit
adc_type::pcdto3
__IO uint32_t pcdto3
Definition: at32f415_adc.h:367
adc_type::cspt8
__IO uint32_t cspt8
Definition: at32f415_adc.h:330
adc_type::osn7
__IO uint32_t osn7
Definition: at32f415_adc.h:439
adc_type::pcten
__IO uint32_t pcten
Definition: at32f415_adc.h:281
adc_type::pcswtrg
__IO uint32_t pcswtrg
Definition: at32f415_adc.h:285
adc_type::osq1_bit
struct adc_type::@22::@51 osq1_bit
adc_type::osn13
__IO uint32_t osn13
Definition: at32f415_adc.h:422
adc_type::cspt3
__IO uint32_t cspt3
Definition: at32f415_adc.h:325
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_adc.h Source File

  • libraries
  • drivers
  • inc
at32f415_adc.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_ADC_H
29#define __AT32F415_ADC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
52#define ADC_CCE_INT ((uint32_t)0x00000020)
53#define ADC_VMOR_INT ((uint32_t)0x00000040)
54#define ADC_PCCE_INT ((uint32_t)0x00000080)
65#define ADC_VMOR_FLAG ((uint8_t)0x01)
66#define ADC_CCE_FLAG ((uint8_t)0x02)
67#define ADC_PCCE_FLAG ((uint8_t)0x04)
68#define ADC_PCCS_FLAG ((uint8_t)0x08)
69#define ADC_OCCS_FLAG ((uint8_t)0x10)
82typedef enum
83{
84 ADC_INDEPENDENT_MODE = 0x00,
85 ADC_ORDINARY_SMLT_PREEMPT_SMLT_MODE = 0x01,
86 ADC_ORDINARY_SMLT_PREEMPT_INTERLTRIG_MODE = 0x02,
87 ADC_ORDINARY_SHORTSHIFT_PREEMPT_SMLT_MODE = 0x03,
88 ADC_ORDINARY_LONGSHIFT_PREEMPT_SMLT_MODE = 0x04,
89 ADC_PREEMPT_SMLT_ONLY_MODE = 0x05,
90 ADC_ORDINARY_SMLT_ONLY_MODE = 0x06,
91 ADC_ORDINARY_SHORTSHIFT_ONLY_MODE = 0x07,
92 ADC_ORDINARY_LONGSHIFT_ONLY_MODE = 0x08,
93 ADC_PREEMPT_INTERLTRIG_ONLY_MODE = 0x09
94} adc_combine_mode_type;
95
99typedef enum
100{
101 ADC_RIGHT_ALIGNMENT = 0x00,
102 ADC_LEFT_ALIGNMENT = 0x01
103} adc_data_align_type;
104
108typedef enum
109{
110 ADC_CHANNEL_0 = 0x00,
111 ADC_CHANNEL_1 = 0x01,
112 ADC_CHANNEL_2 = 0x02,
113 ADC_CHANNEL_3 = 0x03,
114 ADC_CHANNEL_4 = 0x04,
115 ADC_CHANNEL_5 = 0x05,
116 ADC_CHANNEL_6 = 0x06,
117 ADC_CHANNEL_7 = 0x07,
118 ADC_CHANNEL_8 = 0x08,
119 ADC_CHANNEL_9 = 0x09,
120 ADC_CHANNEL_10 = 0x0A,
121 ADC_CHANNEL_11 = 0x0B,
122 ADC_CHANNEL_12 = 0x0C,
123 ADC_CHANNEL_13 = 0x0D,
124 ADC_CHANNEL_14 = 0x0E,
125 ADC_CHANNEL_15 = 0x0F,
126 ADC_CHANNEL_16 = 0x10,
127 ADC_CHANNEL_17 = 0x11
128} adc_channel_select_type;
129
133typedef enum
134{
135 ADC_SAMPLETIME_1_5 = 0x00,
136 ADC_SAMPLETIME_7_5 = 0x01,
137 ADC_SAMPLETIME_13_5 = 0x02,
138 ADC_SAMPLETIME_28_5 = 0x03,
139 ADC_SAMPLETIME_41_5 = 0x04,
140 ADC_SAMPLETIME_55_5 = 0x05,
141 ADC_SAMPLETIME_71_5 = 0x06,
142 ADC_SAMPLETIME_239_5 = 0x07
143} adc_sampletime_select_type;
144
148typedef enum
149{
150 /*adc1 ordinary trigger event*/
151 ADC12_ORDINARY_TRIG_TMR1CH1 = 0x00,
152 ADC12_ORDINARY_TRIG_TMR1CH2 = 0x01,
153 ADC12_ORDINARY_TRIG_TMR1CH3 = 0x02,
154 ADC12_ORDINARY_TRIG_TMR2CH2 = 0x03,
155 ADC12_ORDINARY_TRIG_TMR3TRGOUT = 0x04,
156 ADC12_ORDINARY_TRIG_TMR4CH4 = 0x05,
157 ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT = 0x06,
158 ADC12_ORDINARY_TRIG_SOFTWARE = 0x07,
159 ADC12_ORDINARY_TRIG_TMR1TRGOUT = 0x0D,
160} adc_ordinary_trig_select_type;
161
165typedef enum
166{
167 /*adc1 preempt trigger event*/
168 ADC12_PREEMPT_TRIG_TMR1TRGOUT = 0x00,
169 ADC12_PREEMPT_TRIG_TMR1CH4 = 0x01,
170 ADC12_PREEMPT_TRIG_TMR2TRGOUT = 0x02,
171 ADC12_PREEMPT_TRIG_TMR2CH1 = 0x03,
172 ADC12_PREEMPT_TRIG_TMR3CH4 = 0x04,
173 ADC12_PREEMPT_TRIG_TMR4TRGOUT = 0x05,
174 ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4 = 0x06,
175 ADC12_PREEMPT_TRIG_SOFTWARE = 0x07,
176 ADC12_PREEMPT_TRIG_TMR1CH1 = 0x0D,
177} adc_preempt_trig_select_type;
178
182typedef enum
183{
184 ADC_PREEMPT_CHANNEL_1 = 0x00,
185 ADC_PREEMPT_CHANNEL_2 = 0x01,
186 ADC_PREEMPT_CHANNEL_3 = 0x02,
187 ADC_PREEMPT_CHANNEL_4 = 0x03
188} adc_preempt_channel_type;
189
193typedef enum
194{
195 ADC_VMONITOR_SINGLE_ORDINARY = 0x00800200,
196 ADC_VMONITOR_SINGLE_PREEMPT = 0x00400200,
197 ADC_VMONITOR_SINGLE_ORDINARY_PREEMPT = 0x00C00200,
198 ADC_VMONITOR_ALL_ORDINARY = 0x00800000,
199 ADC_VMONITOR_ALL_PREEMPT = 0x00400000,
200 ADC_VMONITOR_ALL_ORDINARY_PREEMPT = 0x00C00000,
201 ADC_VMONITOR_NONE = 0x00000000
202} adc_voltage_monitoring_type;
203
207typedef struct
208{
209 confirm_state sequence_mode;
210 confirm_state repeat_mode;
211 adc_data_align_type data_align;
212 uint8_t ordinary_channel_length;
213} adc_base_config_type;
214
218typedef struct
219{
220
224 union
225 {
226 __IO uint32_t sts;
227 struct
228 {
229 __IO uint32_t vmor : 1; /* [0] */
230 __IO uint32_t cce : 1; /* [1] */
231 __IO uint32_t pcce : 1; /* [2] */
232 __IO uint32_t pccs : 1; /* [3] */
233 __IO uint32_t occs : 1; /* [4] */
234 __IO uint32_t reserved1 : 27;/* [31:5] */
235 } sts_bit;
236 };
237
241 union
242 {
243 __IO uint32_t ctrl1;
244 struct
245 {
246 __IO uint32_t vmcsel : 5; /* [4:0] */
247 __IO uint32_t cceien : 1; /* [5] */
248 __IO uint32_t vmorien : 1; /* [6] */
249 __IO uint32_t pcceien : 1; /* [7] */
250 __IO uint32_t sqen : 1; /* [8] */
251 __IO uint32_t vmsgen : 1; /* [9] */
252 __IO uint32_t pcautoen : 1; /* [10] */
253 __IO uint32_t ocpen : 1; /* [11] */
254 __IO uint32_t pcpen : 1; /* [12] */
255 __IO uint32_t ocpcnt : 3; /* [15:13] */
256 __IO uint32_t mssel : 4; /* [19:16] */
257 __IO uint32_t reserved1 : 2; /* [21:20] */
258 __IO uint32_t pcvmen : 1; /* [22] */
259 __IO uint32_t ocvmen : 1; /* [23] */
260 __IO uint32_t reserved2 : 8; /* [31:24] */
261 } ctrl1_bit;
262 };
263
267 union
268 {
269 __IO uint32_t ctrl2;
270 struct
271 {
272 __IO uint32_t adcen : 1; /* [0] */
273 __IO uint32_t rpen : 1; /* [1] */
274 __IO uint32_t adcal : 1; /* [2] */
275 __IO uint32_t adcalinit : 1; /* [3] */
276 __IO uint32_t reserved1 : 4; /* [7:4] */
277 __IO uint32_t ocdmaen : 1; /* [8] */
278 __IO uint32_t reserved2 : 2; /* [10:9] */
279 __IO uint32_t dtalign : 1; /* [11] */
280 __IO uint32_t pctesel_l : 3; /* [14:12] */
281 __IO uint32_t pcten : 1; /* [15] */
282 __IO uint32_t reserved3 : 1; /* [16] */
283 __IO uint32_t octesel_l : 3; /* [19:17] */
284 __IO uint32_t octen : 1; /* [20] */
285 __IO uint32_t pcswtrg : 1; /* [21] */
286 __IO uint32_t ocswtrg : 1; /* [22] */
287 __IO uint32_t itsrven : 1; /* [23] */
288 __IO uint32_t pctesel_h : 1; /* [24] */
289 __IO uint32_t octesel_h : 1; /* [25] */
290 __IO uint32_t reserved4 : 6; /* [31:26] */
291 } ctrl2_bit;
292 };
293
297 union
298 {
299 __IO uint32_t spt1;
300 struct
301 {
302 __IO uint32_t cspt10 : 3; /* [2:0] */
303 __IO uint32_t cspt11 : 3; /* [5:3] */
304 __IO uint32_t cspt12 : 3; /* [8:6] */
305 __IO uint32_t cspt13 : 3; /* [11:9] */
306 __IO uint32_t cspt14 : 3; /* [14:12] */
307 __IO uint32_t cspt15 : 3; /* [17:15] */
308 __IO uint32_t cspt16 : 3; /* [20:18] */
309 __IO uint32_t cspt17 : 3; /* [23:21] */
310 __IO uint32_t reserved1 : 8;/* [31:24] */
311 } spt1_bit;
312 };
313
317 union
318 {
319 __IO uint32_t spt2;
320 struct
321 {
322 __IO uint32_t cspt0 : 3;/* [2:0] */
323 __IO uint32_t cspt1 : 3;/* [5:3] */
324 __IO uint32_t cspt2 : 3;/* [8:6] */
325 __IO uint32_t cspt3 : 3;/* [11:9] */
326 __IO uint32_t cspt4 : 3;/* [14:12] */
327 __IO uint32_t cspt5 : 3;/* [17:15] */
328 __IO uint32_t cspt6 : 3;/* [20:18] */
329 __IO uint32_t cspt7 : 3;/* [23:21] */
330 __IO uint32_t cspt8 : 3;/* [26:24] */
331 __IO uint32_t cspt9 : 3;/* [29:27] */
332 __IO uint32_t reserved1 : 2;/* [31:30] */
333 } spt2_bit;
334 };
335
339 union
340 {
341 __IO uint32_t pcdto1;
342 struct
343 {
344 __IO uint32_t pcdto1 : 12; /* [11:0] */
345 __IO uint32_t reserved1 : 20; /* [31:12] */
346 } pcdto1_bit;
347 };
348
352 union
353 {
354 __IO uint32_t pcdto2;
355 struct
356 {
357 __IO uint32_t pcdto2 : 12; /* [11:0] */
358 __IO uint32_t reserved1 : 20; /* [31:12] */
359 } pcdto2_bit;
360 };
361
365 union
366 {
367 __IO uint32_t pcdto3;
368 struct
369 {
370 __IO uint32_t pcdto3 : 12; /* [11:0] */
371 __IO uint32_t reserved1 : 20; /* [31:12] */
372 } pcdto3_bit;
373 };
374
378 union
379 {
380 __IO uint32_t pcdto4;
381 struct
382 {
383 __IO uint32_t pcdto4 : 12; /* [11:0] */
384 __IO uint32_t reserved1 : 20; /* [31:12] */
385 } pcdto4_bit;
386 };
387
391 union
392 {
393 __IO uint32_t vmhb;
394 struct
395 {
396 __IO uint32_t vmhb : 12; /* [11:0] */
397 __IO uint32_t reserved1 : 20; /* [31:12] */
398 } vmhb_bit;
399 };
400
404 union
405 {
406 __IO uint32_t vmlb;
407 struct
408 {
409 __IO uint32_t vmlb : 12; /* [11:0] */
410 __IO uint32_t reserved1 : 20; /* [31:12] */
411 } vmlb_bit;
412 };
413
417 union
418 {
419 __IO uint32_t osq1;
420 struct
421 {
422 __IO uint32_t osn13 : 5; /* [4:0] */
423 __IO uint32_t osn14 : 5; /* [9:5] */
424 __IO uint32_t osn15 : 5; /* [14:10] */
425 __IO uint32_t osn16 : 5; /* [19:15] */
426 __IO uint32_t oclen : 4; /* [23:20] */
427 __IO uint32_t reserved1 : 8; /* [31:24] */
428 } osq1_bit;
429 };
430
434 union
435 {
436 __IO uint32_t osq2;
437 struct
438 {
439 __IO uint32_t osn7 : 5; /* [4:0] */
440 __IO uint32_t osn8 : 5; /* [9:5] */
441 __IO uint32_t osn9 : 5; /* [14:10] */
442 __IO uint32_t osn10 : 5; /* [19:15] */
443 __IO uint32_t osn11 : 5; /* [24:20] */
444 __IO uint32_t osn12 : 5; /* [29:25] */
445 __IO uint32_t reserved1 : 2; /* [31:30] */
446 } osq2_bit;
447 };
448
452 union
453 {
454 __IO uint32_t osq3;
455 struct
456 {
457 __IO uint32_t osn1 : 5; /* [4:0] */
458 __IO uint32_t osn2 : 5; /* [9:5] */
459 __IO uint32_t osn3 : 5; /* [14:10] */
460 __IO uint32_t osn4 : 5; /* [19:15] */
461 __IO uint32_t osn5 : 5; /* [24:20] */
462 __IO uint32_t osn6 : 5; /* [29:25] */
463 __IO uint32_t reserved1 : 2; /* [31:30] */
464 } osq3_bit;
465 };
466
470 union
471 {
472 __IO uint32_t psq;
473 struct
474 {
475 __IO uint32_t psn1 : 5; /* [4:0] */
476 __IO uint32_t psn2 : 5; /* [9:5] */
477 __IO uint32_t psn3 : 5; /* [14:10] */
478 __IO uint32_t psn4 : 5; /* [19:15] */
479 __IO uint32_t pclen : 2; /* [21:20] */
480 __IO uint32_t reserved1 : 10;/* [31:22] */
481 } psq_bit;
482 };
483
487 union
488 {
489 __IO uint32_t pdt1;
490 struct
491 {
492 __IO uint32_t pdt1 : 16; /* [15:0] */
493 __IO uint32_t reserved1 : 16; /* [31:16] */
494 } pdt1_bit;
495 };
496
500 union
501 {
502 __IO uint32_t pdt2;
503 struct
504 {
505 __IO uint32_t pdt2 : 16; /* [15:0] */
506 __IO uint32_t reserved1 : 16; /* [31:16] */
507 } pdt2_bit;
508 };
509
513 union
514 {
515 __IO uint32_t pdt3;
516 struct
517 {
518 __IO uint32_t pdt3 : 16; /* [15:0] */
519 __IO uint32_t reserved1 : 16; /* [31:16] */
520 } pdt3_bit;
521 };
522
526 union
527 {
528 __IO uint32_t pdt4;
529 struct
530 {
531 __IO uint32_t pdt4 : 16; /* [15:0] */
532 __IO uint32_t reserved1 : 16; /* [31:16] */
533 } pdt4_bit;
534 };
535
539 union
540 {
541 __IO uint32_t odt;
542 struct
543 {
544 __IO uint32_t odt : 16; /* [15:0] */
545 __IO uint32_t reserved1 : 16; /* [31:16] */
546 } odt_bit;
547 };
548
549} adc_type;
550
555#define ADC1 ((adc_type *) ADC1_BASE)
556
561void adc_reset(adc_type *adc_x);
562void adc_enable(adc_type *adc_x, confirm_state new_state);
563void adc_combine_mode_select(adc_combine_mode_type combine_mode);
564void adc_base_default_para_init(adc_base_config_type *adc_base_struct);
565void adc_base_config(adc_type *adc_x, adc_base_config_type *adc_base_struct);
566void adc_dma_mode_enable(adc_type *adc_x, confirm_state new_state);
567void adc_interrupt_enable(adc_type *adc_x, uint32_t adc_int, confirm_state new_state);
568void adc_calibration_init(adc_type *adc_x);
569 flag_status adc_calibration_init_status_get(adc_type *adc_x);
570void adc_calibration_start(adc_type *adc_x);
571 flag_status adc_calibration_status_get(adc_type *adc_x);
572void adc_voltage_monitor_enable(adc_type *adc_x, adc_voltage_monitoring_type adc_voltage_monitoring);
573void adc_voltage_monitor_threshold_value_set(adc_type *adc_x, uint16_t adc_high_threshold, uint16_t adc_low_threshold);
574void adc_voltage_monitor_single_channel_select(adc_type *adc_x, adc_channel_select_type adc_channel);
575void adc_ordinary_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime);
576void adc_preempt_channel_length_set(adc_type *adc_x, uint8_t adc_channel_lenght);
577void adc_preempt_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime);
578void adc_ordinary_conversion_trigger_set(adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state);
579void adc_preempt_conversion_trigger_set(adc_type *adc_x, adc_preempt_trig_select_type adc_preempt_trig, confirm_state new_state);
580void adc_preempt_offset_value_set(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel, uint16_t adc_offset_value);
581void adc_ordinary_part_count_set(adc_type *adc_x, uint8_t adc_channel_count);
582void adc_ordinary_part_mode_enable(adc_type *adc_x, confirm_state new_state);
583void adc_preempt_part_mode_enable(adc_type *adc_x, confirm_state new_state);
584void adc_preempt_auto_mode_enable(adc_type *adc_x, confirm_state new_state);
585void adc_tempersensor_vintrv_enable(confirm_state new_state);
586void adc_ordinary_software_trigger_enable(adc_type *adc_x, confirm_state new_state);
587 flag_status adc_ordinary_software_trigger_status_get(adc_type *adc_x);
588void adc_preempt_software_trigger_enable(adc_type *adc_x, confirm_state new_state);
589 flag_status adc_preempt_software_trigger_status_get(adc_type *adc_x);
590uint16_t adc_ordinary_conversion_data_get(adc_type *adc_x);
591uint32_t adc_combine_ordinary_conversion_data_get(void);
592uint16_t adc_preempt_conversion_data_get(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel);
593 flag_status adc_flag_get(adc_type *adc_x, uint8_t adc_flag);
594void adc_flag_clear(adc_type *adc_x, uint32_t adc_flag);
595
608#ifdef __cplusplus
609}
610#endif
611
612#endif
at32f415.h
at32f415 header file
adc_ordinary_software_trigger_enable
void adc_ordinary_software_trigger_enable(adc_type *adc_x, confirm_state new_state)
enable or disable ordinary software start conversion of the specified adc peripheral.
Definition: at32f415_adc.c:755
adc_voltage_monitor_enable
void adc_voltage_monitor_enable(adc_type *adc_x, adc_voltage_monitoring_type adc_voltage_monitoring)
enable or disable the voltage monitoring on single/all ordinary or preempt channels of the specified ...
Definition: at32f415_adc.c:263
adc_voltage_monitor_single_channel_select
void adc_voltage_monitor_single_channel_select(adc_type *adc_x, adc_channel_select_type adc_channel)
select the voltage monitoring's channel of the specified adc peripheral.
Definition: at32f415_adc.c:304
adc_ordinary_conversion_data_get
uint16_t adc_ordinary_conversion_data_get(adc_type *adc_x)
return the last conversion data for ordinary channel of the specified adc peripheral.
Definition: at32f415_adc.c:819
adc_preempt_offset_value_set
void adc_preempt_offset_value_set(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel, uint16_t adc_offset_value)
set preempt channel's conversion value offset of the specified adc peripheral.
Definition: at32f415_adc.c:655
adc_base_config
void adc_base_config(adc_type *adc_x, adc_base_config_type *adc_base_struct)
initialize the adc peripheral according to the specified parameters.
Definition: at32f415_adc.c:137
adc_ordinary_software_trigger_status_get
flag_status adc_ordinary_software_trigger_status_get(adc_type *adc_x)
get ordinary software start conversion status of the specified adc peripheral.
Definition: at32f415_adc.c:767
adc_preempt_auto_mode_enable
void adc_preempt_auto_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable automatic preempt group conversion of the specified adc peripheral.
Definition: at32f415_adc.c:729
adc_tempersensor_vintrv_enable
void adc_tempersensor_vintrv_enable(confirm_state new_state)
enable or disable the temperature sensor and vintrv channel.
Definition: at32f415_adc.c:741
adc_preempt_software_trigger_status_get
flag_status adc_preempt_software_trigger_status_get(adc_type *adc_x)
get preempt software start conversion status of the specified adc peripheral.
Definition: at32f415_adc.c:800
adc_enable
void adc_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the specified adc peripheral.
Definition: at32f415_adc.c:70
adc_ordinary_part_count_set
void adc_ordinary_part_count_set(adc_type *adc_x, uint8_t adc_channel_count)
set partitioned mode channel count of the specified adc peripheral.
Definition: at32f415_adc.c:686
adc_preempt_conversion_data_get
uint16_t adc_preempt_conversion_data_get(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel)
return the conversion data for selection preempt channel of the specified adc peripheral.
Definition: at32f415_adc.c:846
adc_flag_clear
void adc_flag_clear(adc_type *adc_x, uint32_t adc_flag)
clear flag of the specified adc peripheral.
Definition: at32f415_adc.c:912
adc_interrupt_enable
void adc_interrupt_enable(adc_type *adc_x, uint32_t adc_int, confirm_state new_state)
enable or disable the specified adc interrupts.
Definition: at32f415_adc.c:173
adc_base_default_para_init
void adc_base_default_para_init(adc_base_config_type *adc_base_struct)
adc base default para init.
Definition: at32f415_adc.c:111
adc_calibration_start
void adc_calibration_start(adc_type *adc_x)
start calibration process of the specified adc peripheral.
Definition: at32f415_adc.c:223
adc_calibration_status_get
flag_status adc_calibration_status_get(adc_type *adc_x)
get calibration status of the specified adc peripheral.
Definition: at32f415_adc.c:235
adc_voltage_monitor_threshold_value_set
void adc_voltage_monitor_threshold_value_set(adc_type *adc_x, uint16_t adc_high_threshold, uint16_t adc_low_threshold)
set voltage monitoring's high and low thresholds value of the specified adc peripheral.
Definition: at32f415_adc.c:284
adc_preempt_part_mode_enable
void adc_preempt_part_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the partitioned mode on preempt channel of the specified adc peripheral.
Definition: at32f415_adc.c:715
adc_ordinary_conversion_trigger_set
void adc_ordinary_conversion_trigger_set(adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state)
enable or disable the ordinary channel's external trigger and set external trigger event of the speci...
Definition: at32f415_adc.c:592
adc_preempt_conversion_trigger_set
void adc_preempt_conversion_trigger_set(adc_type *adc_x, adc_preempt_trig_select_type adc_preempt_trig, confirm_state new_state)
enable or disable the preempt channel's external trigger and set external trigger event of the specif...
Definition: at32f415_adc.c:623
adc_combine_ordinary_conversion_data_get
uint32_t adc_combine_ordinary_conversion_data_get(void)
return the last conversion data for ordinary channel of combine adc.
Definition: at32f415_adc.c:828
adc_flag_get
flag_status adc_flag_get(adc_type *adc_x, uint8_t adc_flag)
get flag of the specified adc peripheral.
Definition: at32f415_adc.c:883
adc_calibration_init
void adc_calibration_init(adc_type *adc_x)
initialize calibration register of the specified adc peripheral.
Definition: at32f415_adc.c:192
adc_preempt_channel_set
void adc_preempt_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
configure preempt channel's corresponding rank in the sequencer and sample time of the specified adc ...
Definition: at32f415_adc.c:494
adc_calibration_init_status_get
flag_status adc_calibration_init_status_get(adc_type *adc_x)
get calibration register's initialize status of the specified adc peripheral.
Definition: at32f415_adc.c:204
adc_ordinary_part_mode_enable
void adc_ordinary_part_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the partitioned mode on ordinary channel of the specified adc peripheral.
Definition: at32f415_adc.c:701
adc_dma_mode_enable
void adc_dma_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the adc dma transfer.
Definition: at32f415_adc.c:154
adc_combine_mode_select
void adc_combine_mode_select(adc_combine_mode_type combine_mode)
select combine mode of the specified adc peripheral.
Definition: at32f415_adc.c:91
adc_preempt_channel_length_set
void adc_preempt_channel_length_set(adc_type *adc_x, uint8_t adc_channel_lenght)
set preempt channel lenghth of the specified adc peripheral.
Definition: at32f415_adc.c:462
adc_reset
void adc_reset(adc_type *adc_x)
deinitialize the adc peripheral registers to their default reset values.
Definition: at32f415_adc.c:51
adc_preempt_software_trigger_enable
void adc_preempt_software_trigger_enable(adc_type *adc_x, confirm_state new_state)
enable or disable preempt software start conversion of the specified adc peripheral.
Definition: at32f415_adc.c:788
adc_ordinary_channel_set
void adc_ordinary_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc perip...
Definition: at32f415_adc.c:336
adc_voltage_monitoring_type
adc_voltage_monitoring_type
adc voltage_monitoring type
Definition: at32f415_adc.h:194
adc_data_align_type
adc_data_align_type
adc data align type
Definition: at32f415_adc.h:100
adc_channel_select_type
adc_channel_select_type
adc channel select type
Definition: at32f415_adc.h:109
adc_sampletime_select_type
adc_sampletime_select_type
adc sampletime select type
Definition: at32f415_adc.h:134
adc_preempt_trig_select_type
adc_preempt_trig_select_type
adc preempt group trigger event select type
Definition: at32f415_adc.h:166
adc_combine_mode_type
adc_combine_mode_type
adc combine mode type
Definition: at32f415_adc.h:83
adc_ordinary_trig_select_type
adc_ordinary_trig_select_type
adc ordinary group trigger event select type
Definition: at32f415_adc.h:149
adc_preempt_channel_type
adc_preempt_channel_type
adc preempt channel type
Definition: at32f415_adc.h:183
ADC_VMONITOR_SINGLE_ORDINARY_PREEMPT
@ ADC_VMONITOR_SINGLE_ORDINARY_PREEMPT
Definition: at32f415_adc.h:197
ADC_VMONITOR_SINGLE_ORDINARY
@ ADC_VMONITOR_SINGLE_ORDINARY
Definition: at32f415_adc.h:195
ADC_VMONITOR_ALL_ORDINARY
@ ADC_VMONITOR_ALL_ORDINARY
Definition: at32f415_adc.h:198
ADC_VMONITOR_ALL_PREEMPT
@ ADC_VMONITOR_ALL_PREEMPT
Definition: at32f415_adc.h:199
ADC_VMONITOR_ALL_ORDINARY_PREEMPT
@ ADC_VMONITOR_ALL_ORDINARY_PREEMPT
Definition: at32f415_adc.h:200
ADC_VMONITOR_NONE
@ ADC_VMONITOR_NONE
Definition: at32f415_adc.h:201
ADC_VMONITOR_SINGLE_PREEMPT
@ ADC_VMONITOR_SINGLE_PREEMPT
Definition: at32f415_adc.h:196
ADC_RIGHT_ALIGNMENT
@ ADC_RIGHT_ALIGNMENT
Definition: at32f415_adc.h:101
ADC_LEFT_ALIGNMENT
@ ADC_LEFT_ALIGNMENT
Definition: at32f415_adc.h:102
ADC_CHANNEL_9
@ ADC_CHANNEL_9
Definition: at32f415_adc.h:119
ADC_CHANNEL_1
@ ADC_CHANNEL_1
Definition: at32f415_adc.h:111
ADC_CHANNEL_17
@ ADC_CHANNEL_17
Definition: at32f415_adc.h:127
ADC_CHANNEL_8
@ ADC_CHANNEL_8
Definition: at32f415_adc.h:118
ADC_CHANNEL_4
@ ADC_CHANNEL_4
Definition: at32f415_adc.h:114
ADC_CHANNEL_12
@ ADC_CHANNEL_12
Definition: at32f415_adc.h:122
ADC_CHANNEL_16
@ ADC_CHANNEL_16
Definition: at32f415_adc.h:126
ADC_CHANNEL_0
@ ADC_CHANNEL_0
Definition: at32f415_adc.h:110
ADC_CHANNEL_3
@ ADC_CHANNEL_3
Definition: at32f415_adc.h:113
ADC_CHANNEL_14
@ ADC_CHANNEL_14
Definition: at32f415_adc.h:124
ADC_CHANNEL_10
@ ADC_CHANNEL_10
Definition: at32f415_adc.h:120
ADC_CHANNEL_13
@ ADC_CHANNEL_13
Definition: at32f415_adc.h:123
ADC_CHANNEL_2
@ ADC_CHANNEL_2
Definition: at32f415_adc.h:112
ADC_CHANNEL_6
@ ADC_CHANNEL_6
Definition: at32f415_adc.h:116
ADC_CHANNEL_7
@ ADC_CHANNEL_7
Definition: at32f415_adc.h:117
ADC_CHANNEL_5
@ ADC_CHANNEL_5
Definition: at32f415_adc.h:115
ADC_CHANNEL_11
@ ADC_CHANNEL_11
Definition: at32f415_adc.h:121
ADC_CHANNEL_15
@ ADC_CHANNEL_15
Definition: at32f415_adc.h:125
ADC_SAMPLETIME_41_5
@ ADC_SAMPLETIME_41_5
Definition: at32f415_adc.h:139
ADC_SAMPLETIME_55_5
@ ADC_SAMPLETIME_55_5
Definition: at32f415_adc.h:140
ADC_SAMPLETIME_71_5
@ ADC_SAMPLETIME_71_5
Definition: at32f415_adc.h:141
ADC_SAMPLETIME_239_5
@ ADC_SAMPLETIME_239_5
Definition: at32f415_adc.h:142
ADC_SAMPLETIME_1_5
@ ADC_SAMPLETIME_1_5
Definition: at32f415_adc.h:135
ADC_SAMPLETIME_28_5
@ ADC_SAMPLETIME_28_5
Definition: at32f415_adc.h:138
ADC_SAMPLETIME_13_5
@ ADC_SAMPLETIME_13_5
Definition: at32f415_adc.h:137
ADC_SAMPLETIME_7_5
@ ADC_SAMPLETIME_7_5
Definition: at32f415_adc.h:136
ADC12_PREEMPT_TRIG_TMR4TRGOUT
@ ADC12_PREEMPT_TRIG_TMR4TRGOUT
Definition: at32f415_adc.h:173
ADC12_PREEMPT_TRIG_TMR2TRGOUT
@ ADC12_PREEMPT_TRIG_TMR2TRGOUT
Definition: at32f415_adc.h:170
ADC12_PREEMPT_TRIG_TMR1CH1
@ ADC12_PREEMPT_TRIG_TMR1CH1
Definition: at32f415_adc.h:176
ADC12_PREEMPT_TRIG_TMR1CH4
@ ADC12_PREEMPT_TRIG_TMR1CH4
Definition: at32f415_adc.h:169
ADC12_PREEMPT_TRIG_TMR1TRGOUT
@ ADC12_PREEMPT_TRIG_TMR1TRGOUT
Definition: at32f415_adc.h:168
ADC12_PREEMPT_TRIG_TMR3CH4
@ ADC12_PREEMPT_TRIG_TMR3CH4
Definition: at32f415_adc.h:172
ADC12_PREEMPT_TRIG_SOFTWARE
@ ADC12_PREEMPT_TRIG_SOFTWARE
Definition: at32f415_adc.h:175
ADC12_PREEMPT_TRIG_TMR2CH1
@ ADC12_PREEMPT_TRIG_TMR2CH1
Definition: at32f415_adc.h:171
ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4
@ ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4
Definition: at32f415_adc.h:174
ADC_PREEMPT_SMLT_ONLY_MODE
@ ADC_PREEMPT_SMLT_ONLY_MODE
Definition: at32f415_adc.h:89
ADC_PREEMPT_INTERLTRIG_ONLY_MODE
@ ADC_PREEMPT_INTERLTRIG_ONLY_MODE
Definition: at32f415_adc.h:93
ADC_ORDINARY_LONGSHIFT_ONLY_MODE
@ ADC_ORDINARY_LONGSHIFT_ONLY_MODE
Definition: at32f415_adc.h:92
ADC_ORDINARY_SHORTSHIFT_PREEMPT_SMLT_MODE
@ ADC_ORDINARY_SHORTSHIFT_PREEMPT_SMLT_MODE
Definition: at32f415_adc.h:87
ADC_ORDINARY_SMLT_ONLY_MODE
@ ADC_ORDINARY_SMLT_ONLY_MODE
Definition: at32f415_adc.h:90
ADC_INDEPENDENT_MODE
@ ADC_INDEPENDENT_MODE
Definition: at32f415_adc.h:84
ADC_ORDINARY_SHORTSHIFT_ONLY_MODE
@ ADC_ORDINARY_SHORTSHIFT_ONLY_MODE
Definition: at32f415_adc.h:91
ADC_ORDINARY_SMLT_PREEMPT_INTERLTRIG_MODE
@ ADC_ORDINARY_SMLT_PREEMPT_INTERLTRIG_MODE
Definition: at32f415_adc.h:86
ADC_ORDINARY_LONGSHIFT_PREEMPT_SMLT_MODE
@ ADC_ORDINARY_LONGSHIFT_PREEMPT_SMLT_MODE
Definition: at32f415_adc.h:88
ADC_ORDINARY_SMLT_PREEMPT_SMLT_MODE
@ ADC_ORDINARY_SMLT_PREEMPT_SMLT_MODE
Definition: at32f415_adc.h:85
ADC12_ORDINARY_TRIG_TMR2CH2
@ ADC12_ORDINARY_TRIG_TMR2CH2
Definition: at32f415_adc.h:154
ADC12_ORDINARY_TRIG_TMR1TRGOUT
@ ADC12_ORDINARY_TRIG_TMR1TRGOUT
Definition: at32f415_adc.h:159
ADC12_ORDINARY_TRIG_TMR1CH2
@ ADC12_ORDINARY_TRIG_TMR1CH2
Definition: at32f415_adc.h:152
ADC12_ORDINARY_TRIG_TMR1CH1
@ ADC12_ORDINARY_TRIG_TMR1CH1
Definition: at32f415_adc.h:151
ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT
@ ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT
Definition: at32f415_adc.h:157
ADC12_ORDINARY_TRIG_TMR4CH4
@ ADC12_ORDINARY_TRIG_TMR4CH4
Definition: at32f415_adc.h:156
ADC12_ORDINARY_TRIG_TMR1CH3
@ ADC12_ORDINARY_TRIG_TMR1CH3
Definition: at32f415_adc.h:153
ADC12_ORDINARY_TRIG_SOFTWARE
@ ADC12_ORDINARY_TRIG_SOFTWARE
Definition: at32f415_adc.h:158
ADC12_ORDINARY_TRIG_TMR3TRGOUT
@ ADC12_ORDINARY_TRIG_TMR3TRGOUT
Definition: at32f415_adc.h:155
ADC_PREEMPT_CHANNEL_3
@ ADC_PREEMPT_CHANNEL_3
Definition: at32f415_adc.h:186
ADC_PREEMPT_CHANNEL_4
@ ADC_PREEMPT_CHANNEL_4
Definition: at32f415_adc.h:187
ADC_PREEMPT_CHANNEL_2
@ ADC_PREEMPT_CHANNEL_2
Definition: at32f415_adc.h:185
ADC_PREEMPT_CHANNEL_1
@ ADC_PREEMPT_CHANNEL_1
Definition: at32f415_adc.h:184
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
adc_base_config_type
adc base config type
Definition: at32f415_adc.h:208
adc_base_config_type::data_align
adc_data_align_type data_align
Definition: at32f415_adc.h:211
adc_base_config_type::repeat_mode
confirm_state repeat_mode
Definition: at32f415_adc.h:210
adc_base_config_type::sequence_mode
confirm_state sequence_mode
Definition: at32f415_adc.h:209
adc_base_config_type::ordinary_channel_length
uint8_t ordinary_channel_length
Definition: at32f415_adc.h:212
adc_type
type define adc register all
Definition: at32f415_adc.h:219
adc_type::cspt1
__IO uint32_t cspt1
Definition: at32f415_adc.h:323
adc_type::pcce
__IO uint32_t pcce
Definition: at32f415_adc.h:231
adc_type::dtalign
__IO uint32_t dtalign
Definition: at32f415_adc.h:279
adc_type::osq2
__IO uint32_t osq2
Definition: at32f415_adc.h:436
adc_type::ocdmaen
__IO uint32_t ocdmaen
Definition: at32f415_adc.h:277
adc_type::ocswtrg
__IO uint32_t ocswtrg
Definition: at32f415_adc.h:286
adc_type::osn14
__IO uint32_t osn14
Definition: at32f415_adc.h:423
adc_type::rpen
__IO uint32_t rpen
Definition: at32f415_adc.h:273
adc_type::sqen
__IO uint32_t sqen
Definition: at32f415_adc.h:250
adc_type::pctesel_h
__IO uint32_t pctesel_h
Definition: at32f415_adc.h:288
adc_type::pdt4
__IO uint32_t pdt4
Definition: at32f415_adc.h:528
adc_type::cspt15
__IO uint32_t cspt15
Definition: at32f415_adc.h:307
adc_type::pclen
__IO uint32_t pclen
Definition: at32f415_adc.h:479
adc_type::vmcsel
__IO uint32_t vmcsel
Definition: at32f415_adc.h:246
adc_type::cspt7
__IO uint32_t cspt7
Definition: at32f415_adc.h:329
adc_type::odt
__IO uint32_t odt
Definition: at32f415_adc.h:541
adc_type::pcvmen
__IO uint32_t pcvmen
Definition: at32f415_adc.h:258
adc_type::osn1
__IO uint32_t osn1
Definition: at32f415_adc.h:457
adc_type::pcdto4
__IO uint32_t pcdto4
Definition: at32f415_adc.h:380
adc_type::pdt1
__IO uint32_t pdt1
Definition: at32f415_adc.h:489
adc_type::pcdto2
__IO uint32_t pcdto2
Definition: at32f415_adc.h:354
adc_type::reserved3
__IO uint32_t reserved3
Definition: at32f415_adc.h:282
adc_type::cspt6
__IO uint32_t cspt6
Definition: at32f415_adc.h:328
adc_type::osn6
__IO uint32_t osn6
Definition: at32f415_adc.h:462
adc_type::osn8
__IO uint32_t osn8
Definition: at32f415_adc.h:440
adc_type::pcpen
__IO uint32_t pcpen
Definition: at32f415_adc.h:254
adc_type::osn16
__IO uint32_t osn16
Definition: at32f415_adc.h:425
adc_type::cspt13
__IO uint32_t cspt13
Definition: at32f415_adc.h:305
adc_type::vmsgen
__IO uint32_t vmsgen
Definition: at32f415_adc.h:251
adc_type::psq
__IO uint32_t psq
Definition: at32f415_adc.h:472
adc_type::osn3
__IO uint32_t osn3
Definition: at32f415_adc.h:459
adc_type::pcceien
__IO uint32_t pcceien
Definition: at32f415_adc.h:249
adc_type::octen
__IO uint32_t octen
Definition: at32f415_adc.h:284
adc_type::vmorien
__IO uint32_t vmorien
Definition: at32f415_adc.h:248
adc_type::ocvmen
__IO uint32_t ocvmen
Definition: at32f415_adc.h:259
adc_type::oclen
__IO uint32_t oclen
Definition: at32f415_adc.h:426
adc_type::pcdto1
__IO uint32_t pcdto1
Definition: at32f415_adc.h:341
adc_type::mssel
__IO uint32_t mssel
Definition: at32f415_adc.h:256
adc_type::occs
__IO uint32_t occs
Definition: at32f415_adc.h:233
adc_type::osn9
__IO uint32_t osn9
Definition: at32f415_adc.h:441
adc_type::cspt5
__IO uint32_t cspt5
Definition: at32f415_adc.h:327
adc_type::spt1
__IO uint32_t spt1
Definition: at32f415_adc.h:299
adc_type::psn4
__IO uint32_t psn4
Definition: at32f415_adc.h:478
adc_type::cspt12
__IO uint32_t cspt12
Definition: at32f415_adc.h:304
adc_type::adcal
__IO uint32_t adcal
Definition: at32f415_adc.h:274
adc_type::cspt14
__IO uint32_t cspt14
Definition: at32f415_adc.h:306
adc_type::octesel_l
__IO uint32_t octesel_l
Definition: at32f415_adc.h:283
adc_type::cceien
__IO uint32_t cceien
Definition: at32f415_adc.h:247
adc_type::pctesel_l
__IO uint32_t pctesel_l
Definition: at32f415_adc.h:280
adc_type::octesel_h
__IO uint32_t octesel_h
Definition: at32f415_adc.h:289
adc_type::psn3
__IO uint32_t psn3
Definition: at32f415_adc.h:477
adc_type::itsrven
__IO uint32_t itsrven
Definition: at32f415_adc.h:287
adc_type::spt2
__IO uint32_t spt2
Definition: at32f415_adc.h:319
adc_type::osn4
__IO uint32_t osn4
Definition: at32f415_adc.h:460
adc_type::adcen
__IO uint32_t adcen
Definition: at32f415_adc.h:272
adc_type::vmhb
__IO uint32_t vmhb
Definition: at32f415_adc.h:393
adc_type::ocpen
__IO uint32_t ocpen
Definition: at32f415_adc.h:253
adc_type::cspt9
__IO uint32_t cspt9
Definition: at32f415_adc.h:331
adc_type::adcalinit
__IO uint32_t adcalinit
Definition: at32f415_adc.h:275
adc_type::pdt3
__IO uint32_t pdt3
Definition: at32f415_adc.h:515
adc_type::psn1
__IO uint32_t psn1
Definition: at32f415_adc.h:475
adc_type::reserved4
__IO uint32_t reserved4
Definition: at32f415_adc.h:290
adc_type::cspt10
__IO uint32_t cspt10
Definition: at32f415_adc.h:302
adc_type::osn10
__IO uint32_t osn10
Definition: at32f415_adc.h:442
adc_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_adc.h:260
adc_type::osn12
__IO uint32_t osn12
Definition: at32f415_adc.h:444
adc_type::ctrl1
__IO uint32_t ctrl1
Definition: at32f415_adc.h:243
adc_type::sts
__IO uint32_t sts
Definition: at32f415_adc.h:226
adc_type::ctrl2
__IO uint32_t ctrl2
Definition: at32f415_adc.h:269
adc_type::cspt0
__IO uint32_t cspt0
Definition: at32f415_adc.h:322
adc_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_adc.h:234
adc_type::cce
__IO uint32_t cce
Definition: at32f415_adc.h:230
adc_type::osq1
__IO uint32_t osq1
Definition: at32f415_adc.h:419
adc_type::cspt16
__IO uint32_t cspt16
Definition: at32f415_adc.h:308
adc_type::psn2
__IO uint32_t psn2
Definition: at32f415_adc.h:476
adc_type::osn2
__IO uint32_t osn2
Definition: at32f415_adc.h:458
adc_type::vmor
__IO uint32_t vmor
Definition: at32f415_adc.h:229
adc_type::osn15
__IO uint32_t osn15
Definition: at32f415_adc.h:424
adc_type::osn11
__IO uint32_t osn11
Definition: at32f415_adc.h:443
adc_type::vmlb
__IO uint32_t vmlb
Definition: at32f415_adc.h:406
adc_type::osn5
__IO uint32_t osn5
Definition: at32f415_adc.h:461
adc_type::pdt2
__IO uint32_t pdt2
Definition: at32f415_adc.h:502
adc_type::cspt4
__IO uint32_t cspt4
Definition: at32f415_adc.h:326
adc_type::ocpcnt
__IO uint32_t ocpcnt
Definition: at32f415_adc.h:255
adc_type::osq3
__IO uint32_t osq3
Definition: at32f415_adc.h:454
adc_type::pcautoen
__IO uint32_t pcautoen
Definition: at32f415_adc.h:252
adc_type::cspt2
__IO uint32_t cspt2
Definition: at32f415_adc.h:324
adc_type::cspt17
__IO uint32_t cspt17
Definition: at32f415_adc.h:309
adc_type::cspt11
__IO uint32_t cspt11
Definition: at32f415_adc.h:303
adc_type::pcdto3
__IO uint32_t pcdto3
Definition: at32f415_adc.h:367
adc_type::cspt8
__IO uint32_t cspt8
Definition: at32f415_adc.h:330
adc_type::osn7
__IO uint32_t osn7
Definition: at32f415_adc.h:439
adc_type::pcten
__IO uint32_t pcten
Definition: at32f415_adc.h:281
adc_type::pcswtrg
__IO uint32_t pcswtrg
Definition: at32f415_adc.h:285
adc_type::osn13
__IO uint32_t osn13
Definition: at32f415_adc.h:422
adc_type::cspt3
__IO uint32_t cspt3
Definition: at32f415_adc.h:325
adc_type::pccs
__IO uint32_t pccs
Definition: at32f415_adc.h:232


AT32F415 Firmwary Library: at32f415_board.c Source File

  • at32f415_board
at32f415_board.c
Go to the documentation of this file.
1
28#include "at32f415_board.h"
29
39/* delay macros */
40#define STEP_DELAY_MS 50
41
42/* at-start led resouce array */
43 gpio_type *led_gpio_port[LED_NUM] = {LED2_GPIO, LED3_GPIO, LED4_GPIO};
44uint16_t led_gpio_pin[LED_NUM] = {LED2_PIN, LED3_PIN, LED4_PIN};
45 crm_periph_clock_type led_gpio_crm_clk[LED_NUM] = {LED2_GPIO_CRM_CLK, LED3_GPIO_CRM_CLK, LED4_GPIO_CRM_CLK};
46
47/* delay variable */
48static __IO uint32_t fac_us;
49static __IO uint32_t fac_ms;
50
51/* support printf function, usemicrolib is unnecessary */
52#if (__ARMCC_VERSION > 6000000)
53 __asm (".global __use_no_semihosting\n\t");
54 void _sys_exit(int x)
55 {
56 x = x;
57 }
58 /* __use_no_semihosting was requested, but _ttywrch was */
59 void _ttywrch(int ch)
60 {
61 ch = ch;
62 }
63 FILE __stdout;
64#else
65 #ifdef __CC_ARM
66 #pragma import(__use_no_semihosting)
67 struct __FILE
68 {
69 int handle;
70 };
71 FILE __stdout;
72 void _sys_exit(int x)
73 {
74 x = x;
75 }
76 /* __use_no_semihosting was requested, but _ttywrch was */
77 void _ttywrch(int ch)
78 {
79 ch = ch;
80 }
81 #endif
82#endif
83
84#if defined (__GNUC__) && !defined (__clang__)
85 #define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
86#else
87 #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
88#endif
89
95 PUTCHAR_PROTOTYPE
96{
97 while(usart_flag_get(PRINT_UART, USART_TDBE_FLAG) == RESET);
98 usart_data_transmit(PRINT_UART, ch);
99 return ch;
100}
101
107void uart_print_init(uint32_t baudrate)
108{
109 gpio_init_type gpio_init_struct;
110
111 /* enable the uart and gpio clock */
112 crm_periph_clock_enable(PRINT_UART_CRM_CLK, TRUE);
113 crm_periph_clock_enable(PRINT_UART_TX_GPIO_CRM_CLK, TRUE);
114
115 gpio_default_para_init(&gpio_init_struct);
116
117 /* configure the uart tx pin */
118 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
119 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
120 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
121 gpio_init_struct.gpio_pins = PRINT_UART_TX_PIN;
122 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
123 gpio_init(PRINT_UART_TX_GPIO, &gpio_init_struct);
124
125 /* configure uart param */
126 usart_init(PRINT_UART, baudrate, USART_DATA_8BITS, USART_STOP_1_BIT);
127 usart_transmitter_enable(PRINT_UART, TRUE);
128 usart_enable(PRINT_UART, TRUE);
129}
130
136void at32_board_init()
137{
138 /* initialize delay function */
139 delay_init();
140
141 /* configure led in at_start_board */
142 at32_led_init(LED2);
143 at32_led_init(LED3);
144 at32_led_init(LED4);
145 at32_led_off(LED2);
146 at32_led_off(LED3);
147 at32_led_off(LED4);
148
149 /* configure button in at_start board */
150 at32_button_init();
151}
152
158void at32_button_init(void)
159{
160 gpio_init_type gpio_init_struct;
161
162 /* enable the button clock */
163 crm_periph_clock_enable(USER_BUTTON_CRM_CLK, TRUE);
164
165 /* set default parameter */
166 gpio_default_para_init(&gpio_init_struct);
167
168 /* configure button pin as input with pull-up/pull-down */
169 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
170 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
171 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
172 gpio_init_struct.gpio_pins = USER_BUTTON_PIN;
173 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
174 gpio_init(USER_BUTTON_PORT, &gpio_init_struct);
175}
176
182uint8_t at32_button_state(void)
183{
184 return gpio_input_data_bit_read(USER_BUTTON_PORT, USER_BUTTON_PIN);
185}
186
192 button_type at32_button_press()
193{
194 static uint8_t pressed = 1;
195 /* get button state in at_start board */
196 if((pressed == 1) && (at32_button_state() != RESET))
197 {
198 /* debounce */
199 pressed = 0;
200 delay_ms(10);
201 if(at32_button_state() != RESET)
202 return USER_BUTTON;
203 }
204 else if(at32_button_state() == RESET)
205 {
206 pressed = 1;
207 }
208 return NO_BUTTON;
209}
210
216void at32_led_init(led_type led)
217{
218 gpio_init_type gpio_init_struct;
219
220 /* enable the led clock */
221 crm_periph_clock_enable(led_gpio_crm_clk[led], TRUE);
222
223 /* set default parameter */
224 gpio_default_para_init(&gpio_init_struct);
225
226 /* configure the led gpio */
227 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
228 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
229 gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
230 gpio_init_struct.gpio_pins = led_gpio_pin[led];
231 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
232 gpio_init(led_gpio_port[led], &gpio_init_struct);
233}
234
244void at32_led_on(led_type led)
245{
246 if(led > (LED_NUM - 1))
247 return;
248 if(led_gpio_pin[led])
249 led_gpio_port[led]->clr = led_gpio_pin[led];
250}
251
261void at32_led_off(led_type led)
262{
263 if(led > (LED_NUM - 1))
264 return;
265 if(led_gpio_pin[led])
266 led_gpio_port[led]->scr = led_gpio_pin[led];
267}
268
278void at32_led_toggle(led_type led)
279{
280 if(led > (LED_NUM - 1))
281 return;
282 if(led_gpio_pin[led])
283 led_gpio_port[led]->odt ^= led_gpio_pin[led];
284}
285
291void delay_init()
292{
293 /* configure systick */
294 systick_clock_source_config(SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV);
295 fac_us = system_core_clock / (1000000U);
296 fac_ms = fac_us * (1000U);
297}
298
304void delay_us(uint32_t nus)
305{
306 uint32_t temp = 0;
307 SysTick->LOAD = (uint32_t)(nus * fac_us);
308 SysTick->VAL = 0x00;
309 SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk ;
310 do
311 {
312 temp = SysTick->CTRL;
313 }while((temp & 0x01) && !(temp & (1 << 16)));
314
315 SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
316 SysTick->VAL = 0x00;
317}
318
324void delay_ms(uint16_t nms)
325{
326 uint32_t temp = 0;
327 while(nms)
328 {
329 if(nms > STEP_DELAY_MS)
330 {
331 SysTick->LOAD = (uint32_t)(STEP_DELAY_MS * fac_ms);
332 nms -= STEP_DELAY_MS;
333 }
334 else
335 {
336 SysTick->LOAD = (uint32_t)(nms * fac_ms);
337 nms = 0;
338 }
339 SysTick->VAL = 0x00;
340 SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk;
341 do
342 {
343 temp = SysTick->CTRL;
344 }while((temp & 0x01) && !(temp & (1 << 16)));
345
346 SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
347 SysTick->VAL = 0x00;
348 }
349}
350
356void delay_sec(uint16_t sec)
357{
358 uint16_t index;
359 for(index = 0; index < sec; index++)
360 {
361 delay_ms(500);
362 delay_ms(500);
363 }
364}
365
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
USER_BUTTON_PORT
#define USER_BUTTON_PORT
Definition: at32f415_board.h:99
PRINT_UART_CRM_CLK
#define PRINT_UART_CRM_CLK
Definition: at32f415_board.h:86
USER_BUTTON_PIN
#define USER_BUTTON_PIN
Definition: at32f415_board.h:98
PRINT_UART_TX_PIN
#define PRINT_UART_TX_PIN
Definition: at32f415_board.h:87
LED_NUM
#define LED_NUM
Definition: at32f415_board.h:68
led_type
led_type
Definition: at32f415_board.h:62
PRINT_UART
#define PRINT_UART
Definition: at32f415_board.h:85
PRINT_UART_TX_GPIO
#define PRINT_UART_TX_GPIO
Definition: at32f415_board.h:88
USER_BUTTON_CRM_CLK
#define USER_BUTTON_CRM_CLK
Definition: at32f415_board.h:100
PRINT_UART_TX_GPIO_CRM_CLK
#define PRINT_UART_TX_GPIO_CRM_CLK
Definition: at32f415_board.h:89
button_type
button_type
Definition: at32f415_board.h:93
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
NO_BUTTON
@ NO_BUTTON
Definition: at32f415_board.h:95
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94
led_gpio_port
gpio_type * led_gpio_port[3]
Definition: at32f415_board.c:43
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
fac_ms
static __IO uint32_t fac_ms
Definition: at32f415_board.c:49
led_gpio_pin
uint16_t led_gpio_pin[3]
Definition: at32f415_board.c:44
at32_led_init
void at32_led_init(led_type led)
configure led gpio
Definition: at32f415_board.c:216
delay_init
void delay_init()
initialize delay function
Definition: at32f415_board.c:291
at32_button_state
uint8_t at32_button_state(void)
returns the selected button state
Definition: at32f415_board.c:182
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
STEP_DELAY_MS
#define STEP_DELAY_MS
Definition: at32f415_board.c:40
led_gpio_crm_clk
crm_periph_clock_type led_gpio_crm_clk[3]
Definition: at32f415_board.c:45
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
PUTCHAR_PROTOTYPE
#define PUTCHAR_PROTOTYPE
Definition: at32f415_board.c:87
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
at32_button_init
void at32_button_init(void)
configure button gpio
Definition: at32f415_board.c:158
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
fac_us
static __IO uint32_t fac_us
Definition: at32f415_board.c:48
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_periph_clock_type
crm_periph_clock_type
crm periph clock
Definition: at32f415_crm.h:101
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_input_data_bit_read
flag_status gpio_input_data_bit_read(gpio_type *gpio_x, uint16_t pins)
read the specified input port pin.
Definition: at32f415_gpio.c:203
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_MODE_OUTPUT
@ GPIO_MODE_OUTPUT
Definition: at32f415_gpio.h:229
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
systick_clock_source_config
void systick_clock_source_config(systick_clock_source_type source)
config systick clock source
Definition: at32f415_misc.c:147
SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV
@ SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV
Definition: at32f415_misc.h:90
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_TDBE_FLAG
#define USART_TDBE_FLAG
Definition: at32f415_usart.h:59
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
gpio_type
type define gpio register all
Definition: at32f415_gpio.h:314
gpio_type::scr
__IO uint32_t scr
Definition: at32f415_gpio.h:430
gpio_type::odt
__IO uint32_t odt
Definition: at32f415_gpio.h:402
gpio_type::clr
__IO uint32_t clr
Definition: at32f415_gpio.h:473


AT32F415 Firmwary Library: at32f415_board.h Source File

  • at32f415_board
at32f415_board.h
Go to the documentation of this file.
1
28#ifndef __AT32F415_BOARD_H
29#define __AT32F415_BOARD_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "stdio.h"
36#include "at32f415.h"
37
56#if !defined (AT_START_F415_V1)
57#error "please select first the board at-start device used in your application (in at32f415_board.h file)"
58#endif
59
60/******************** define led ********************/
61typedef enum
62{
63 LED2 = 0,
64 LED3 = 1,
65 LED4 = 2
66} led_type;
67
68#define LED_NUM 3
69
70#if defined (AT_START_F415_V1)
71#define LED2_PIN GPIO_PINS_2
72#define LED2_GPIO GPIOC
73#define LED2_GPIO_CRM_CLK CRM_GPIOC_PERIPH_CLOCK
74
75#define LED3_PIN GPIO_PINS_3
76#define LED3_GPIO GPIOC
77#define LED3_GPIO_CRM_CLK CRM_GPIOC_PERIPH_CLOCK
78
79#define LED4_PIN GPIO_PINS_5
80#define LED4_GPIO GPIOC
81#define LED4_GPIO_CRM_CLK CRM_GPIOC_PERIPH_CLOCK
82#endif
83
84/**************** define print uart ******************/
85#define PRINT_UART USART1
86#define PRINT_UART_CRM_CLK CRM_USART1_PERIPH_CLOCK
87#define PRINT_UART_TX_PIN GPIO_PINS_9
88#define PRINT_UART_TX_GPIO GPIOA
89#define PRINT_UART_TX_GPIO_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
90
91/******************* define button *******************/
92typedef enum
93{
94 USER_BUTTON = 0,
95 NO_BUTTON = 1
96} button_type;
97
98#define USER_BUTTON_PIN GPIO_PINS_0
99#define USER_BUTTON_PORT GPIOA
100#define USER_BUTTON_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
101
110/******************** functions ********************/
111void at32_board_init(void);
112
113/* led operation function */
114void at32_led_init(led_type led);
115void at32_led_on(led_type led);
116void at32_led_off(led_type led);
117void at32_led_toggle(led_type led);
118
119/* button operation function */
120void at32_button_init(void);
121 button_type at32_button_press(void);
122uint8_t at32_button_state(void);
123
124/* delay function */
125void delay_init(void);
126void delay_us(uint32_t nus);
127void delay_ms(uint16_t nms);
128void delay_sec(uint16_t sec);
129
130/* printf uart init function */
131void uart_print_init(uint32_t baudrate);
132
145#ifdef __cplusplus
146}
147#endif
148
149#endif
150
at32f415.h
at32f415 header file
at32_board_init
void at32_board_init(void)
board initialize interface init led and button
Definition: at32f415_board.c:136
at32_led_init
void at32_led_init(led_type led)
configure led gpio
Definition: at32f415_board.c:216
at32_button_state
uint8_t at32_button_state(void)
returns the selected button state
Definition: at32f415_board.c:182
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_button_press
button_type at32_button_press(void)
returns which button have press down
Definition: at32f415_board.c:192
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
at32_button_init
void at32_button_init(void)
configure button gpio
Definition: at32f415_board.c:158
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
delay_init
void delay_init(void)
initialize delay function
Definition: at32f415_board.c:291
led_type
led_type
Definition: at32f415_board.h:62
button_type
button_type
Definition: at32f415_board.h:93
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
NO_BUTTON
@ NO_BUTTON
Definition: at32f415_board.h:95
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94


AT32F415 Firmwary Library: at32f415_can.c Source File

  • libraries
  • drivers
  • src
at32f415_can.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef CAN_MODULE_ENABLED
39
51void can_reset(can_type* can_x)
52{
53 crm_periph_reset(CRM_CAN1_PERIPH_RESET, TRUE);
54 crm_periph_reset(CRM_CAN1_PERIPH_RESET, FALSE);
55}
56
62void can_baudrate_default_para_init(can_baudrate_type* can_baudrate_struct)
63{
64 /* reset can baudrate structure parameters values */
65
66 /* baud rate division */
67 can_baudrate_struct->baudrate_div = 1;
68
69 /* resynchronization adjust width */
70 can_baudrate_struct->rsaw_size = CAN_RSAW_2TQ;
71
72 /* bit time segment 1 */
73 can_baudrate_struct->bts1_size = CAN_BTS1_4TQ;
74
75 /* bit time segment 2 */
76 can_baudrate_struct->bts2_size = CAN_BTS2_3TQ;
77}
78
91 error_status can_baudrate_set(can_type* can_x, can_baudrate_type* can_baudrate_struct)
92{
93 error_status status_index = ERROR;
94 uint32_t wait_ack_index = 0x00000000;
95 /* exit from doze mode */
96 can_x->mctrl_bit.dzen = FALSE;
97
98 /* request freeze mode */
99 can_x->mctrl_bit.fzen = TRUE;
100
101 /* wait the acknowledge */
102 while((!can_x->msts_bit.fzc) && (wait_ack_index != FZC_TIMEOUT))
103 {
104 wait_ack_index++;
105 }
106
107 /* check acknowledge */
108 if(can_x->msts_bit.fzc)
109 {
110 can_x->btmg_bit.brdiv = can_baudrate_struct->baudrate_div - 1;
111 can_x->btmg_bit.rsaw = can_baudrate_struct->rsaw_size;
112 can_x->btmg_bit.bts1 = can_baudrate_struct->bts1_size;
113 can_x->btmg_bit.bts2 = can_baudrate_struct->bts2_size;
114
115 /* request leave freeze mode */
116 can_x->mctrl_bit.fzen = FALSE;
117
118 /* wait the acknowledge */
119 wait_ack_index = 0;
120 while((can_x->msts_bit.fzc) && (wait_ack_index != FZC_TIMEOUT))
121 {
122 wait_ack_index++;
123 }
124
125 /* check acknowledged */
126 if(can_x->msts_bit.fzc)
127 {
128 status_index = ERROR;
129 }
130 else
131 {
132 status_index = SUCCESS ;
133 }
134 }
135 else
136 {
137 status_index = ERROR;
138 }
139
140 /* return the status of baudrate set */
141 return status_index;
142}
143
149void can_default_para_init(can_base_type* can_base_struct)
150{
151 /* reset can init structure parameters values */
152
153 /* initialize the time triggered communication mode */
154 can_base_struct->ttc_enable = FALSE;
155
156 /* initialize the automatic exit bus-off management */
157 can_base_struct->aebo_enable = FALSE;
158
159 /* initialize the automatic exit doze mode */
160 can_base_struct->aed_enable = FALSE;
161
162 /* initialize the prohibit retransmission when sending fails */
163 can_base_struct->prsf_enable = FALSE;
164
165 /* initialize the message discarding rule select when overflow */
166 can_base_struct->mdrsel_selection = CAN_DISCARDING_FIRST_RECEIVED;
167
168 /* initialize the multiple message sending sequence rule */
169 can_base_struct->mmssr_selection = CAN_SENDING_BY_ID;
170
171 /* initialize the can_mode */
172 can_base_struct->mode_selection = CAN_MODE_COMMUNICATE;
173}
174
186 error_status can_base_init(can_type* can_x, can_base_type* can_base_struct)
187{
188 error_status init_status_index = ERROR;
189 uint32_t wait_ack_index = 0x00000000;
190 /* exit from doze mode */
191 can_x->mctrl_bit.dzen = FALSE;
192
193 /* request freeze mode */
194 can_x->mctrl_bit.fzen = TRUE;
195
196 /* wait the acknowledge */
197 while((!can_x->msts_bit.fzc) && (wait_ack_index != FZC_TIMEOUT))
198 {
199 wait_ack_index++;
200 }
201
202 /* check acknowledge */
203 if(can_x->msts_bit.fzc)
204 {
205 /* set the time triggered communication mode */
206 can_x->mctrl_bit.ttcen = can_base_struct->ttc_enable;
207
208 /* set the automatic exit bus-off management */
209 can_x->mctrl_bit.aeboen = can_base_struct->aebo_enable;
210
211 /* set the automatic automatic exit doze mode */
212 can_x->mctrl_bit.aeden = can_base_struct->aed_enable;
213
214 /* set the prohibit retransmission when sending fails */
215 can_x->mctrl_bit.prsfen = can_base_struct->prsf_enable;
216
217 /* set the message discarding rule select when overflow */
218 can_x->mctrl_bit.mdrsel = can_base_struct->mdrsel_selection;
219
220 /* set the multiple message sending sequence rule */
221 can_x->mctrl_bit.mmssr = can_base_struct->mmssr_selection;
222
223 /* set the test mode */
224 can_x->btmg_bit.lben = can_base_struct->mode_selection & 0x01;
225 can_x->btmg_bit.loen = (can_base_struct->mode_selection >> 1) & 0x01;
226
227 /* request leave freeze mode */
228 can_x->mctrl_bit.fzen = FALSE;
229
230 /* wait the acknowledge */
231 wait_ack_index = 0;
232 while((can_x->msts_bit.fzc) && (wait_ack_index != FZC_TIMEOUT))
233 {
234 wait_ack_index++;
235 }
236
237 /* check acknowledged */
238 if(can_x->msts_bit.fzc)
239 {
240 init_status_index = ERROR;
241 }
242 else
243 {
244 init_status_index = SUCCESS ;
245 }
246 }
247 else
248 {
249 init_status_index = ERROR;
250 }
251
252 /* return the status of initialization */
253 return init_status_index;
254}
255
261void can_filter_default_para_init(can_filter_init_type* can_filter_init_struct)
262{
263 /* reset can filter init structure parameters values */
264
265 /* initialize the filter activate state */
266 can_filter_init_struct->filter_activate_enable = FALSE;
267
268 /* filter mode */
269 can_filter_init_struct->filter_mode = CAN_FILTER_MODE_ID_MASK;
270
271 /* filter relation fifo select */
272 can_filter_init_struct->filter_fifo = CAN_FILTER_FIFO0;
273
274 /* filter number select */
275 can_filter_init_struct->filter_number = 0;
276
277 /* initialize the filter bit width */
278 can_filter_init_struct->filter_bit = CAN_FILTER_16BIT;
279
280 /* initialize the filters filter data bit */
281 can_filter_init_struct->filter_id_high = 0;
282 can_filter_init_struct->filter_id_low = 0;
283 can_filter_init_struct->filter_mask_high = 0;
284 can_filter_init_struct->filter_mask_low = 0;
285}
286
296void can_filter_init(can_type* can_x, can_filter_init_type* can_filter_init_struct)
297{
298 uint32_t filter_number_bit_pos = 0;
299 filter_number_bit_pos = ((uint32_t)1) << can_filter_init_struct->filter_number;
300 /* set the filter turn into configuration condition */
301 can_x->fctrl_bit.fcs = TRUE;
302
303 /* filter activate disable */
304 can_x->facfg &= ~(uint32_t)filter_number_bit_pos;
305
306 /* filter bit width */
307 switch(can_filter_init_struct->filter_bit)
308 {
309 case CAN_FILTER_16BIT:
310 can_x->fbwcfg &= ~(uint32_t)filter_number_bit_pos;
311 /* first 16-bit identifier and first 16-bit mask or first 16-bit identifier and second 16-bit identifier */
312 can_x->ffb[can_filter_init_struct->filter_number].ffdb1 = ((0x0000FFFF & (uint32_t)can_filter_init_struct->filter_mask_low) << 16);
313 can_x->ffb[can_filter_init_struct->filter_number].ffdb1 |= (0x0000FFFF & (uint32_t)can_filter_init_struct->filter_id_low);
314
315 /* second 16-bit identifier and second 16-bit mask or third 16-bit identifier and fourth 16-bit identifier */
316 can_x->ffb[can_filter_init_struct->filter_number].ffdb2 = ((0x0000FFFF & (uint32_t)can_filter_init_struct->filter_mask_high) << 16);
317 can_x->ffb[can_filter_init_struct->filter_number].ffdb2 |= (0x0000FFFF & (uint32_t)can_filter_init_struct->filter_id_high);
318
319 break;
320 case CAN_FILTER_32BIT:
321 can_x->fbwcfg |= filter_number_bit_pos;
322 /* 32-bit identifier or first 32-bit identifier */
323 can_x->ffb[can_filter_init_struct->filter_number].ffdb1 = ((0x0000FFFF & (uint32_t)can_filter_init_struct->filter_id_high) << 16);
324 can_x->ffb[can_filter_init_struct->filter_number].ffdb1 |= (0x0000FFFF & (uint32_t)can_filter_init_struct->filter_id_low);
325
326 /* 32-bit mask or second 32-bit identifier */
327 can_x->ffb[can_filter_init_struct->filter_number].ffdb2 = ((0x0000FFFF & (uint32_t)can_filter_init_struct->filter_mask_high) << 16);
328 can_x->ffb[can_filter_init_struct->filter_number].ffdb2 |= (0x0000FFFF & (uint32_t)can_filter_init_struct->filter_mask_low);
329
330 break;
331 default:
332 break;
333 }
334
335 /* filter mode */
336 switch(can_filter_init_struct->filter_mode)
337 {
338 case CAN_FILTER_MODE_ID_MASK:
339 can_x->fmcfg &= ~(uint32_t)filter_number_bit_pos;
340 break;
341 case CAN_FILTER_MODE_ID_LIST:
342 can_x->fmcfg |= (uint32_t)filter_number_bit_pos;
343 break;
344 default:
345 break;
346 }
347
348 /* filter relation fifo select */
349 switch(can_filter_init_struct->filter_fifo)
350 {
351 case CAN_FILTER_FIFO0:
352 can_x->frf &= ~(uint32_t)filter_number_bit_pos;
353 break;
354 case CAN_FILTER_FIFO1:
355 can_x->frf |= (uint32_t)filter_number_bit_pos;
356 break;
357 default:
358 break;
359 }
360
361 /* filter activate enable */
362 switch(can_filter_init_struct->filter_activate_enable)
363 {
364 case TRUE:
365 can_x->facfg |= (uint32_t)filter_number_bit_pos;
366 break;
367 case FALSE:
368 can_x->facfg &= ~(uint32_t)filter_number_bit_pos;
369 break;
370 default:
371 break;
372 }
373
374 /* set the filter turn into working condition */
375 can_x->fctrl_bit.fcs = FALSE;
376}
377
387void can_debug_transmission_prohibit(can_type* can_x, confirm_state new_state)
388{
389 can_x->mctrl_bit.ptd = new_state;
390}
391
408void can_ttc_mode_enable(can_type* can_x, confirm_state new_state)
409{
410 /* config the ttc mode new_state */
411 can_x->mctrl_bit.ttcen = new_state;
412
413 /* config tmtsten bits new_state */
414 can_x->tx_mailbox[0].tmc_bit.tmtsten = new_state;
415 can_x->tx_mailbox[1].tmc_bit.tmtsten = new_state;
416 can_x->tx_mailbox[2].tmc_bit.tmtsten = new_state;
417}
418
432uint8_t can_message_transmit(can_type* can_x, can_tx_message_type* tx_message_struct)
433{
434 uint8_t transmit_mailbox = CAN_TX_STATUS_NO_EMPTY;
435
436 /* select one empty transmit mailbox */
437 if(can_x->tsts_bit.tm0ef)
438 {
439 transmit_mailbox = CAN_TX_MAILBOX0;
440 }
441 else if(can_x->tsts_bit.tm1ef)
442 {
443 transmit_mailbox = CAN_TX_MAILBOX1;
444 }
445 else if(can_x->tsts_bit.tm2ef)
446 {
447 transmit_mailbox = CAN_TX_MAILBOX2;
448 }
449 else
450 {
451 transmit_mailbox = CAN_TX_STATUS_NO_EMPTY;
452 }
453
454 if(transmit_mailbox != CAN_TX_STATUS_NO_EMPTY)
455 {
456 /* set up the id */
457 can_x->tx_mailbox[transmit_mailbox].tmi &= 0x00000001;
458 can_x->tx_mailbox[transmit_mailbox].tmi_bit.tmidsel = tx_message_struct->id_type;
459 switch(tx_message_struct->id_type)
460 {
461 case CAN_ID_STANDARD:
462 can_x->tx_mailbox[transmit_mailbox].tmi_bit.tmsid = tx_message_struct->standard_id;
463 break;
464 case CAN_ID_EXTENDED:
465 can_x->tx_mailbox[transmit_mailbox].tmi |= (tx_message_struct->extended_id << 3);
466 break;
467 default:
468 break;
469 }
470 can_x->tx_mailbox[transmit_mailbox].tmi_bit.tmfrsel = tx_message_struct->frame_type;
471 /* set up the dlc */
472 can_x->tx_mailbox[transmit_mailbox].tmc_bit.tmdtbl = (tx_message_struct->dlc & ((uint8_t)0x0F));
473
474 /* set up the data field */
475 can_x->tx_mailbox[transmit_mailbox].tmdtl = (((uint32_t)tx_message_struct->data[3] << 24) |
476 ((uint32_t)tx_message_struct->data[2] << 16) |
477 ((uint32_t)tx_message_struct->data[1] << 8) |
478 ((uint32_t)tx_message_struct->data[0]));
479 can_x->tx_mailbox[transmit_mailbox].tmdth = (((uint32_t)tx_message_struct->data[7] << 24) |
480 ((uint32_t)tx_message_struct->data[6] << 16) |
481 ((uint32_t)tx_message_struct->data[5] << 8) |
482 ((uint32_t)tx_message_struct->data[4]));
483
484 /* request transmission */
485 can_x->tx_mailbox[transmit_mailbox].tmi_bit.tmsr = TRUE;
486 }
487 return transmit_mailbox;
488}
489
506 can_transmit_status_type can_transmit_status_get(can_type* can_x, can_tx_mailbox_num_type transmit_mailbox)
507{
508 can_transmit_status_type state_index = CAN_TX_STATUS_FAILED;
509 switch(transmit_mailbox)
510 {
511 case CAN_TX_MAILBOX0:
512 if(can_x->tsts_bit.tm0tcf != RESET)
513 {
514 if(can_x->tsts_bit.tm0tsf != RESET)
515 {
516 state_index = CAN_TX_STATUS_SUCCESSFUL;
517 }
518 else
519 {
520 state_index = CAN_TX_STATUS_FAILED;
521 }
522 }
523 else
524 {
525 state_index = CAN_TX_STATUS_PENDING;
526 }
527 break;
528 case CAN_TX_MAILBOX1:
529 if(can_x->tsts_bit.tm1tcf != RESET)
530 {
531 if(can_x->tsts_bit.tm1tsf != RESET)
532 {
533 state_index = CAN_TX_STATUS_SUCCESSFUL;
534 }
535 else
536 {
537 state_index = CAN_TX_STATUS_FAILED;
538 }
539 }
540 else
541 {
542 state_index = CAN_TX_STATUS_PENDING;
543 }
544 break;
545 case CAN_TX_MAILBOX2:
546 if(can_x->tsts_bit.tm2tcf != RESET)
547 {
548 if(can_x->tsts_bit.tm2tsf != RESET)
549 {
550 state_index = CAN_TX_STATUS_SUCCESSFUL;
551 }
552 else
553 {
554 state_index = CAN_TX_STATUS_FAILED;
555 }
556 }
557 else
558 {
559 state_index = CAN_TX_STATUS_PENDING;
560 }
561 break;
562 default:
563 state_index = CAN_TX_STATUS_FAILED;
564 break;
565 }
566 return state_index;
567}
568
581void can_transmit_cancel(can_type* can_x, can_tx_mailbox_num_type transmit_mailbox)
582{
583 switch (transmit_mailbox)
584 {
585 case CAN_TX_MAILBOX0:
586 can_x->tsts = CAN_TSTS_TM0CT_VAL;
587 break;
588 case CAN_TX_MAILBOX1:
589 can_x->tsts = CAN_TSTS_TM1CT_VAL;
590 break;
591 case CAN_TX_MAILBOX2:
592 can_x->tsts = CAN_TSTS_TM2CT_VAL;
593 break;
594 default:
595 break;
596 }
597}
598
611void can_message_receive(can_type* can_x, can_rx_fifo_num_type fifo_number, can_rx_message_type* rx_message_struct)
612{
613 /* get the id type */
614 rx_message_struct->id_type = (can_identifier_type)can_x->fifo_mailbox[fifo_number].rfi_bit.rfidi;
615 switch (rx_message_struct->id_type)
616 {
617 case CAN_ID_STANDARD:
618 rx_message_struct->standard_id = can_x->fifo_mailbox[fifo_number].rfi_bit.rfsid;
619 break;
620 case CAN_ID_EXTENDED:
621 rx_message_struct->extended_id = 0x1FFFFFFF & (can_x->fifo_mailbox[fifo_number].rfi >> 3);
622 break;
623 default:
624 break;
625 }
626 rx_message_struct->frame_type = (can_trans_frame_type)can_x->fifo_mailbox[fifo_number].rfi_bit.rffri;
627 /* get the dlc */
628 rx_message_struct->dlc = can_x->fifo_mailbox[fifo_number].rfc_bit.rfdtl;
629
630 /* get the filter match number */
631 rx_message_struct->filter_index = can_x->fifo_mailbox[fifo_number].rfc_bit.rffmn;
632
633 /* get the data field */
634 rx_message_struct->data[0] = can_x->fifo_mailbox[fifo_number].rfdtl_bit.rfdt0;
635 rx_message_struct->data[1] = can_x->fifo_mailbox[fifo_number].rfdtl_bit.rfdt1;
636 rx_message_struct->data[2] = can_x->fifo_mailbox[fifo_number].rfdtl_bit.rfdt2;
637 rx_message_struct->data[3] = can_x->fifo_mailbox[fifo_number].rfdtl_bit.rfdt3;
638 rx_message_struct->data[4] = can_x->fifo_mailbox[fifo_number].rfdth_bit.rfdt4;
639 rx_message_struct->data[5] = can_x->fifo_mailbox[fifo_number].rfdth_bit.rfdt5;
640 rx_message_struct->data[6] = can_x->fifo_mailbox[fifo_number].rfdth_bit.rfdt6;
641 rx_message_struct->data[7] = can_x->fifo_mailbox[fifo_number].rfdth_bit.rfdt7;
642
643 /* release the fifo */
644 can_receive_fifo_release(can_x, fifo_number);
645}
646
658void can_receive_fifo_release(can_type* can_x, can_rx_fifo_num_type fifo_number)
659{
660 switch (fifo_number)
661 {
662 case CAN_RX_FIFO0:
663 can_x->rf0 = CAN_RF0_RF0R_VAL;
664 break;
665 case CAN_RX_FIFO1:
666 can_x->rf1 = CAN_RF1_RF1R_VAL;
667 break;
668 default:
669 break;
670 }
671}
672
684uint8_t can_receive_message_pending_get(can_type* can_x, can_rx_fifo_num_type fifo_number)
685{
686 uint8_t message_pending = 0;
687 switch (fifo_number)
688 {
689 case CAN_RX_FIFO0:
690 message_pending = can_x->rf0_bit.rf0mn;
691 break;
692 case CAN_RX_FIFO1:
693 message_pending = can_x->rf1_bit.rf1mn;
694 break;
695 default:
696 break;
697 }
698 return message_pending;
699}
700
715 error_status can_operating_mode_set(can_type* can_x, can_operating_mode_type can_operating_mode)
716{
717 error_status status = ERROR;
718 uint32_t time_out_index = FZC_TIMEOUT;
719
720 if (can_operating_mode == CAN_OPERATINGMODE_FREEZE)
721 {
722 /* request enter freeze mode */
723 can_x->mctrl_bit.dzen = FALSE;
724 can_x->mctrl_bit.fzen = TRUE;
725
726 while(((can_x->msts_bit.dzc) || (!can_x->msts_bit.fzc)) && (time_out_index != 0))
727 {
728 time_out_index--;
729 }
730 if((can_x->msts_bit.dzc) || (!can_x->msts_bit.fzc))
731 {
732 status = ERROR;
733 }
734 else
735 {
736 status = SUCCESS;
737 }
738 }
739 else if(can_operating_mode == CAN_OPERATINGMODE_DOZE)
740 {
741 /* request enter doze mode */
742 can_x->mctrl_bit.dzen = TRUE;
743 can_x->mctrl_bit.fzen = FALSE;
744
745 while(((!can_x->msts_bit.dzc) || (can_x->msts_bit.fzc)) && (time_out_index != 0))
746 {
747 time_out_index--;
748 }
749 if((!can_x->msts_bit.dzc) || (can_x->msts_bit.fzc))
750 {
751 status = ERROR;
752 }
753 else
754 {
755 status = SUCCESS;
756 }
757 }
758 else if(can_operating_mode == CAN_OPERATINGMODE_COMMUNICATE)
759 {
760 /* request enter normal mode */
761 can_x->mctrl_bit.dzen = FALSE;
762 can_x->mctrl_bit.fzen = FALSE;
763
764 while(((can_x->msts_bit.dzc) || (can_x->msts_bit.fzc)) && (time_out_index != 0))
765 {
766 time_out_index--;
767 }
768 if((can_x->msts_bit.dzc) || (can_x->msts_bit.fzc))
769 {
770 status = ERROR;
771 }
772 else
773 {
774 status = SUCCESS;
775 }
776 }
777 else
778 {
779 status = ERROR;
780 }
781 return status;
782}
783
793 can_enter_doze_status_type can_doze_mode_enter(can_type* can_x)
794{
795 can_enter_doze_status_type status = CAN_ENTER_DOZE_FAILED;
796 uint32_t time_out_index = FZC_TIMEOUT;
797 can_x->mctrl_bit.fzen = FALSE;
798 can_x->mctrl_bit.dzen = TRUE;
799 while(((!can_x->msts_bit.dzc) || (can_x->msts_bit.fzc)) && (time_out_index != 0))
800 {
801 time_out_index--;
802 }
803 if((!can_x->msts_bit.dzc) || (can_x->msts_bit.fzc))
804 {
805 status = CAN_ENTER_DOZE_FAILED;
806 }
807 else
808 {
809 status = CAN_ENTER_DOZE_SUCCESSFUL;
810 }
811 return status;
812}
813
823 can_quit_doze_status_type can_doze_mode_exit(can_type* can_x)
824{
825 can_quit_doze_status_type status = CAN_QUIT_DOZE_FAILED;
826 uint32_t time_out_index = DZC_TIMEOUT;
827 can_x->mctrl_bit.dzen = FALSE;
828 while((can_x->msts_bit.dzc) && (time_out_index != 0))
829 {
830 time_out_index--;
831 }
832 if(!can_x->msts_bit.dzc)
833 {
834 status = CAN_QUIT_DOZE_SUCCESSFUL;
835 }
836 return status;
837}
838
855 can_error_record_type can_error_type_record_get(can_type* can_x)
856{
857 can_error_record_type error_code = CAN_ERRORRECORD_NOERR;
858
859 error_code = (can_error_record_type)can_x->ests_bit.etr;
860 return error_code;
861}
862
870uint8_t can_receive_error_counter_get(can_type* can_x)
871{
872 uint8_t counter = 0;
873 counter = can_x->ests_bit.rec;
874 return counter;
875}
876
884uint8_t can_transmit_error_counter_get(can_type* can_x)
885{
886 uint8_t counter = 0;
887 counter = can_x->ests_bit.tec;
888 return counter;
889}
890
916void can_interrupt_enable(can_type* can_x, uint32_t can_int, confirm_state new_state)
917{
918 if (new_state != FALSE)
919 {
920 can_x->inten |= can_int;
921 }
922 else
923 {
924 can_x->inten &= ~can_int;
925 }
926}
927
956 flag_status can_flag_get(can_type* can_x, uint32_t can_flag)
957{
958 flag_status bit_status = RESET;
959 switch(can_flag)
960 {
961 case CAN_EAF_FLAG:
962 bit_status = (flag_status)can_x->ests_bit.eaf;
963 break;
964 case CAN_EPF_FLAG:
965 bit_status = (flag_status)can_x->ests_bit.epf;
966 break;
967 case CAN_BOF_FLAG:
968 bit_status = (flag_status)can_x->ests_bit.bof;
969 break;
970 case CAN_ETR_FLAG:
971 if(can_x->ests_bit.etr != 0)
972 {
973 bit_status = SET;
974 }
975 else
976 {
977 bit_status = RESET;
978 }
979 break;
980 case CAN_EOIF_FLAG:
981 bit_status = (flag_status)can_x->msts_bit.eoif;
982 break;
983 case CAN_TM0TCF_FLAG:
984 bit_status = (flag_status)can_x->tsts_bit.tm0tcf;
985 break;
986 case CAN_TM1TCF_FLAG:
987 bit_status = (flag_status)can_x->tsts_bit.tm1tcf;
988 break;
989 case CAN_TM2TCF_FLAG:
990 bit_status = (flag_status)can_x->tsts_bit.tm2tcf;
991 break;
992 case CAN_RF0MN_FLAG:
993 if(can_x->rf0_bit.rf0mn != 0)
994 {
995 bit_status = SET;
996 }
997 else
998 {
999 bit_status = RESET;
1000 }
1001 break;
1002 case CAN_RF0FF_FLAG:
1003 bit_status = (flag_status)can_x->rf0_bit.rf0ff;
1004 break;
1005 case CAN_RF0OF_FLAG:
1006 bit_status = (flag_status)can_x->rf0_bit.rf0of;
1007 break;
1008 case CAN_RF1MN_FLAG:
1009 if(can_x->rf1_bit.rf1mn != 0)
1010 {
1011 bit_status = SET;
1012 }
1013 else
1014 {
1015 bit_status = RESET;
1016 }
1017 break;
1018 case CAN_RF1FF_FLAG:
1019 bit_status = (flag_status)can_x->rf1_bit.rf1ff;
1020 break;
1021 case CAN_RF1OF_FLAG:
1022 bit_status = (flag_status)can_x->rf1_bit.rf1of;
1023 break;
1024 case CAN_QDZIF_FLAG:
1025 bit_status = (flag_status)can_x->msts_bit.qdzif;
1026 break;
1027 case CAN_EDZC_FLAG:
1028 if((can_x->msts_bit.dzc != RESET) ||(can_x->msts_bit.edzif != RESET))
1029 {
1030 bit_status = SET;
1031 }
1032 else
1033 {
1034 bit_status = RESET;
1035 }
1036 break;
1037 case CAN_TMEF_FLAG:
1038 if((can_x->tsts_bit.tm0ef != RESET) || (can_x->tsts_bit.tm1ef != RESET) || (can_x->tsts_bit.tm2ef != RESET))
1039 {
1040 bit_status = SET;
1041 }
1042 else
1043 {
1044 bit_status = RESET;
1045 }
1046 break;
1047 default:
1048 bit_status = RESET;
1049 break;
1050 }
1051 return bit_status;
1052}
1053
1079void can_flag_clear(can_type* can_x, uint32_t can_flag)
1080{
1081 switch(can_flag)
1082 {
1083 case CAN_EAF_FLAG:
1084 case CAN_EPF_FLAG:
1085 case CAN_BOF_FLAG:
1086 case CAN_EOIF_FLAG:
1087 can_x->msts = CAN_MSTS_EOIF_VAL;
1088 break;
1089 case CAN_ETR_FLAG:
1090 can_x->msts = CAN_MSTS_EOIF_VAL;
1091 can_x->ests = 0;
1092 break;
1093 case CAN_TM0TCF_FLAG:
1094 can_x->tsts = CAN_TSTS_TM0TCF_VAL;
1095 break;
1096 case CAN_TM1TCF_FLAG:
1097 can_x->tsts = CAN_TSTS_TM1TCF_VAL;
1098 break;
1099 case CAN_TM2TCF_FLAG:
1100 can_x->tsts = CAN_TSTS_TM2TCF_VAL;
1101 break;
1102 case CAN_RF0FF_FLAG:
1103 can_x->rf0 = CAN_RF0_RF0FF_VAL;
1104 break;
1105 case CAN_RF0OF_FLAG:
1106 can_x->rf0 = CAN_RF0_RF0OF_VAL;
1107 break;
1108 case CAN_RF1FF_FLAG:
1109 can_x->rf1 = CAN_RF1_RF1FF_VAL;
1110 break;
1111 case CAN_RF1OF_FLAG:
1112 can_x->rf1 = CAN_RF1_RF1OF_VAL;
1113 break;
1114 case CAN_QDZIF_FLAG:
1115 can_x->msts = CAN_MSTS_QDZIF_VAL;
1116 break;
1117 case CAN_EDZC_FLAG:
1118 can_x->msts = CAN_MSTS_EDZIF_VAL;
1119 break;
1120 case CAN_TMEF_FLAG:
1121 can_x->tsts = CAN_TSTS_TM0TCF_VAL | CAN_TSTS_TM1TCF_VAL | CAN_TSTS_TM2TCF_VAL;
1122 break;
1123 default:
1124 break;
1125 }
1126}
1127
1132#endif
1133
counter
uint16_t counter
Definition: project/at_start_f415/examples/debug/tmr1/src/main.c:40
can_transmit_status_type
can_transmit_status_type
can transmit status
Definition: at32f415_can.h:271
can_quit_doze_status_type
can_quit_doze_status_type
can quit doze mode status
Definition: at32f415_can.h:291
can_trans_frame_type
can_trans_frame_type
can transmission frame type
Definition: at32f415_can.h:243
can_error_record_type
can_error_record_type
can error type record
Definition: at32f415_can.h:318
can_operating_mode_type
can_operating_mode_type
can operating mode
Definition: at32f415_can.h:175
can_tx_mailbox_num_type
can_tx_mailbox_num_type
can tx mailboxes
Definition: at32f415_can.h:252
can_enter_doze_status_type
can_enter_doze_status_type
can enter doze mode status
Definition: at32f415_can.h:282
can_rx_fifo_num_type
can_rx_fifo_num_type
can receive fifo
Definition: at32f415_can.h:262
can_identifier_type
can_identifier_type
can identifier type
Definition: at32f415_can.h:234
CAN_FILTER_FIFO0
@ CAN_FILTER_FIFO0
Definition: at32f415_can.h:138
CAN_FILTER_FIFO1
@ CAN_FILTER_FIFO1
Definition: at32f415_can.h:139
CAN_TX_STATUS_SUCCESSFUL
@ CAN_TX_STATUS_SUCCESSFUL
Definition: at32f415_can.h:273
CAN_TX_STATUS_PENDING
@ CAN_TX_STATUS_PENDING
Definition: at32f415_can.h:274
CAN_TX_STATUS_NO_EMPTY
@ CAN_TX_STATUS_NO_EMPTY
Definition: at32f415_can.h:275
CAN_TX_STATUS_FAILED
@ CAN_TX_STATUS_FAILED
Definition: at32f415_can.h:272
CAN_DISCARDING_FIRST_RECEIVED
@ CAN_DISCARDING_FIRST_RECEIVED
Definition: at32f415_can.h:301
CAN_BTS2_3TQ
@ CAN_BTS2_3TQ
Definition: at32f415_can.h:222
CAN_QUIT_DOZE_FAILED
@ CAN_QUIT_DOZE_FAILED
Definition: at32f415_can.h:292
CAN_QUIT_DOZE_SUCCESSFUL
@ CAN_QUIT_DOZE_SUCCESSFUL
Definition: at32f415_can.h:293
CAN_BTS1_4TQ
@ CAN_BTS1_4TQ
Definition: at32f415_can.h:200
CAN_ERRORRECORD_NOERR
@ CAN_ERRORRECORD_NOERR
Definition: at32f415_can.h:319
CAN_FILTER_MODE_ID_LIST
@ CAN_FILTER_MODE_ID_LIST
Definition: at32f415_can.h:148
CAN_FILTER_MODE_ID_MASK
@ CAN_FILTER_MODE_ID_MASK
Definition: at32f415_can.h:147
CAN_OPERATINGMODE_FREEZE
@ CAN_OPERATINGMODE_FREEZE
Definition: at32f415_can.h:176
CAN_OPERATINGMODE_COMMUNICATE
@ CAN_OPERATINGMODE_COMMUNICATE
Definition: at32f415_can.h:178
CAN_OPERATINGMODE_DOZE
@ CAN_OPERATINGMODE_DOZE
Definition: at32f415_can.h:177
CAN_SENDING_BY_ID
@ CAN_SENDING_BY_ID
Definition: at32f415_can.h:310
CAN_TX_MAILBOX2
@ CAN_TX_MAILBOX2
Definition: at32f415_can.h:255
CAN_TX_MAILBOX0
@ CAN_TX_MAILBOX0
Definition: at32f415_can.h:253
CAN_TX_MAILBOX1
@ CAN_TX_MAILBOX1
Definition: at32f415_can.h:254
CAN_FILTER_16BIT
@ CAN_FILTER_16BIT
Definition: at32f415_can.h:156
CAN_FILTER_32BIT
@ CAN_FILTER_32BIT
Definition: at32f415_can.h:157
CAN_ENTER_DOZE_FAILED
@ CAN_ENTER_DOZE_FAILED
Definition: at32f415_can.h:283
CAN_ENTER_DOZE_SUCCESSFUL
@ CAN_ENTER_DOZE_SUCCESSFUL
Definition: at32f415_can.h:284
CAN_RX_FIFO0
@ CAN_RX_FIFO0
Definition: at32f415_can.h:263
CAN_RX_FIFO1
@ CAN_RX_FIFO1
Definition: at32f415_can.h:264
CAN_ID_STANDARD
@ CAN_ID_STANDARD
Definition: at32f415_can.h:235
CAN_ID_EXTENDED
@ CAN_ID_EXTENDED
Definition: at32f415_can.h:236
CAN_MODE_COMMUNICATE
@ CAN_MODE_COMMUNICATE
Definition: at32f415_can.h:165
CAN_RSAW_2TQ
@ CAN_RSAW_2TQ
Definition: at32f415_can.h:187
CAN_EDZC_FLAG
#define CAN_EDZC_FLAG
Definition: at32f415_can.h:79
CAN_TM1TCF_FLAG
#define CAN_TM1TCF_FLAG
Definition: at32f415_can.h:70
CAN_QDZIF_FLAG
#define CAN_QDZIF_FLAG
Definition: at32f415_can.h:78
CAN_TM0TCF_FLAG
#define CAN_TM0TCF_FLAG
Definition: at32f415_can.h:69
CAN_RF1FF_FLAG
#define CAN_RF1FF_FLAG
Definition: at32f415_can.h:76
CAN_RF0FF_FLAG
#define CAN_RF0FF_FLAG
Definition: at32f415_can.h:73
CAN_RF1MN_FLAG
#define CAN_RF1MN_FLAG
Definition: at32f415_can.h:75
CAN_EPF_FLAG
#define CAN_EPF_FLAG
Definition: at32f415_can.h:65
CAN_RF1OF_FLAG
#define CAN_RF1OF_FLAG
Definition: at32f415_can.h:77
CAN_EAF_FLAG
#define CAN_EAF_FLAG
Definition: at32f415_can.h:64
CAN_RF0MN_FLAG
#define CAN_RF0MN_FLAG
Definition: at32f415_can.h:72
CAN_TM2TCF_FLAG
#define CAN_TM2TCF_FLAG
Definition: at32f415_can.h:71
CAN_ETR_FLAG
#define CAN_ETR_FLAG
Definition: at32f415_can.h:67
CAN_RF0OF_FLAG
#define CAN_RF0OF_FLAG
Definition: at32f415_can.h:74
CAN_EOIF_FLAG
#define CAN_EOIF_FLAG
Definition: at32f415_can.h:68
CAN_TMEF_FLAG
#define CAN_TMEF_FLAG
Definition: at32f415_can.h:80
CAN_BOF_FLAG
#define CAN_BOF_FLAG
Definition: at32f415_can.h:66
can_base_init
error_status can_base_init(can_type *can_x, can_base_type *can_base_struct)
initialize the can peripheral according to the specified parameters in the can_init_struct.
Definition: at32f415_can.c:186
can_reset
void can_reset(can_type *can_x)
deinitialize the can peripheral registers to their default reset values.
Definition: at32f415_can.c:51
can_transmit_error_counter_get
uint8_t can_transmit_error_counter_get(can_type *can_x)
return the transmit error counter of the specified can peripheral.
Definition: at32f415_can.c:884
can_transmit_status_get
can_transmit_status_type can_transmit_status_get(can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
check the transmission state of the specified can peripheral.
Definition: at32f415_can.c:506
can_ttc_mode_enable
void can_ttc_mode_enable(can_type *can_x, confirm_state new_state)
enable or disable time trigger operation communication mode of the specified can peripheral.
Definition: at32f415_can.c:408
can_filter_default_para_init
void can_filter_default_para_init(can_filter_init_type *can_filter_init_struct)
fill each can_filter_init_struct member with its default value.
Definition: at32f415_can.c:261
can_receive_fifo_release
void can_receive_fifo_release(can_type *can_x, can_rx_fifo_num_type fifo_number)
release the specified fifo of the specified can peripheral.
Definition: at32f415_can.c:658
can_receive_error_counter_get
uint8_t can_receive_error_counter_get(can_type *can_x)
return the receive error counter (rec) of the specified can peripheral.
Definition: at32f415_can.c:870
can_operating_mode_set
error_status can_operating_mode_set(can_type *can_x, can_operating_mode_type can_operating_mode)
set the operation mode of the specified can peripheral.
Definition: at32f415_can.c:715
can_baudrate_default_para_init
void can_baudrate_default_para_init(can_baudrate_type *can_baudrate_struct)
fill each can_baudrate_struct member with its default value.
Definition: at32f415_can.c:62
can_transmit_cancel
void can_transmit_cancel(can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
cancel a transmit request of the specified can peripheral.
Definition: at32f415_can.c:581
can_receive_message_pending_get
uint8_t can_receive_message_pending_get(can_type *can_x, can_rx_fifo_num_type fifo_number)
return the number of pending messages of the specified can peripheral.
Definition: at32f415_can.c:684
can_message_transmit
uint8_t can_message_transmit(can_type *can_x, can_tx_message_type *tx_message_struct)
fill the transmission message and transmit of the specified can peripheral.
Definition: at32f415_can.c:432
can_message_receive
void can_message_receive(can_type *can_x, can_rx_fifo_num_type fifo_number, can_rx_message_type *rx_message_struct)
receive message of the specified can peripheral.
Definition: at32f415_can.c:611
can_interrupt_enable
void can_interrupt_enable(can_type *can_x, uint32_t can_int, confirm_state new_state)
enable or disable the interrupt of the specified can peripheral.
Definition: at32f415_can.c:916
can_flag_get
flag_status can_flag_get(can_type *can_x, uint32_t can_flag)
get flag of the specified can peripheral.
Definition: at32f415_can.c:956
can_flag_clear
void can_flag_clear(can_type *can_x, uint32_t can_flag)
clear flag of the specified can peripheral.
Definition: at32f415_can.c:1079
can_baudrate_set
error_status can_baudrate_set(can_type *can_x, can_baudrate_type *can_baudrate_struct)
set the baudrate of the can peripheral
Definition: at32f415_can.c:91
can_debug_transmission_prohibit
void can_debug_transmission_prohibit(can_type *can_x, confirm_state new_state)
enable or disable the debug transmission prohibit of the specified can peripheral.
Definition: at32f415_can.c:387
can_error_type_record_get
can_error_record_type can_error_type_record_get(can_type *can_x)
return the error type record (etr) of the specified can peripheral.
Definition: at32f415_can.c:855
can_filter_init
void can_filter_init(can_type *can_x, can_filter_init_type *can_filter_init_struct)
initialize the can peripheral according to the specified parameters in the can_filter_init_struct.
Definition: at32f415_can.c:296
can_default_para_init
void can_default_para_init(can_base_type *can_base_struct)
fill each can_init_struct member with its default value.
Definition: at32f415_can.c:149
can_doze_mode_exit
can_quit_doze_status_type can_doze_mode_exit(can_type *can_x)
exit the doze mode of the specified can peripheral.
Definition: at32f415_can.c:823
can_doze_mode_enter
can_enter_doze_status_type can_doze_mode_enter(can_type *can_x)
enter the low power mode of the specified can peripheral.
Definition: at32f415_can.c:793
DZC_TIMEOUT
#define DZC_TIMEOUT
Definition: at32f415_can.h:53
FZC_TIMEOUT
#define FZC_TIMEOUT
Definition: at32f415_can.h:52
CAN_RF1_RF1FF_VAL
#define CAN_RF1_RF1FF_VAL
Definition: at32f415_can.h:125
CAN_RF0_RF0FF_VAL
#define CAN_RF0_RF0FF_VAL
Definition: at32f415_can.h:122
CAN_TSTS_TM0TCF_VAL
#define CAN_TSTS_TM0TCF_VAL
Definition: at32f415_can.h:116
CAN_TSTS_TM2CT_VAL
#define CAN_TSTS_TM2CT_VAL
Definition: at32f415_can.h:121
CAN_RF1_RF1R_VAL
#define CAN_RF1_RF1R_VAL
Definition: at32f415_can.h:127
CAN_MSTS_EOIF_VAL
#define CAN_MSTS_EOIF_VAL
can flag clear operation macro definition val
Definition: at32f415_can.h:113
CAN_MSTS_QDZIF_VAL
#define CAN_MSTS_QDZIF_VAL
Definition: at32f415_can.h:114
CAN_TSTS_TM2TCF_VAL
#define CAN_TSTS_TM2TCF_VAL
Definition: at32f415_can.h:118
CAN_RF0_RF0OF_VAL
#define CAN_RF0_RF0OF_VAL
Definition: at32f415_can.h:123
CAN_RF0_RF0R_VAL
#define CAN_RF0_RF0R_VAL
Definition: at32f415_can.h:124
CAN_RF1_RF1OF_VAL
#define CAN_RF1_RF1OF_VAL
Definition: at32f415_can.h:126
CAN_TSTS_TM1TCF_VAL
#define CAN_TSTS_TM1TCF_VAL
Definition: at32f415_can.h:117
CAN_TSTS_TM0CT_VAL
#define CAN_TSTS_TM0CT_VAL
Definition: at32f415_can.h:119
CAN_TSTS_TM1CT_VAL
#define CAN_TSTS_TM1CT_VAL
Definition: at32f415_can.h:120
CAN_MSTS_EDZIF_VAL
#define CAN_MSTS_EDZIF_VAL
Definition: at32f415_can.h:115
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
CRM_CAN1_PERIPH_RESET
@ CRM_CAN1_PERIPH_RESET
Definition: at32f415_crm.h:177
error_status
error_status
error status
Definition: at32f415.h:258
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
can_base_type
can init structure definition
Definition: at32f415_can.h:333
can_base_type::prsf_enable
confirm_state prsf_enable
Definition: at32f415_can.h:342
can_base_type::mdrsel_selection
can_msg_discarding_rule_type mdrsel_selection
Definition: at32f415_can.h:344
can_base_type::aed_enable
confirm_state aed_enable
Definition: at32f415_can.h:340
can_base_type::mmssr_selection
can_msg_sending_rule_type mmssr_selection
Definition: at32f415_can.h:346
can_base_type::ttc_enable
confirm_state ttc_enable
Definition: at32f415_can.h:336
can_base_type::mode_selection
can_mode_type mode_selection
Definition: at32f415_can.h:334
can_base_type::aebo_enable
confirm_state aebo_enable
Definition: at32f415_can.h:338
can_baudrate_type
can baudrate structure definition
Definition: at32f415_can.h:354
can_baudrate_type::baudrate_div
uint16_t baudrate_div
Definition: at32f415_can.h:355
can_baudrate_type::rsaw_size
can_rsaw_type rsaw_size
Definition: at32f415_can.h:357
can_baudrate_type::bts2_size
can_bts2_type bts2_size
Definition: at32f415_can.h:361
can_baudrate_type::bts1_size
can_bts1_type bts1_size
Definition: at32f415_can.h:359
can_fifo_mailbox_type::rfdt4
__IO uint32_t rfdt4
Definition: at32f415_can.h:566
can_fifo_mailbox_type::rfi
__IO uint32_t rfi
Definition: at32f415_can.h:517
can_fifo_mailbox_type::rfdt0
__IO uint32_t rfdt0
Definition: at32f415_can.h:551
can_fifo_mailbox_type::rfsid
__IO uint32_t rfsid
Definition: at32f415_can.h:524
can_fifo_mailbox_type::rfdt2
__IO uint32_t rfdt2
Definition: at32f415_can.h:553
can_fifo_mailbox_type::rfdth_bit
struct can_fifo_mailbox_type::@78::@83 rfdth_bit
can_fifo_mailbox_type::rfi_bit
struct can_fifo_mailbox_type::@72::@80 rfi_bit
can_fifo_mailbox_type::rfdtl
__IO uint32_t rfdtl
Definition: at32f415_can.h:536
can_fifo_mailbox_type::rfidi
__IO uint32_t rfidi
Definition: at32f415_can.h:522
can_fifo_mailbox_type::rfdt1
__IO uint32_t rfdt1
Definition: at32f415_can.h:552
can_fifo_mailbox_type::rfdt6
__IO uint32_t rfdt6
Definition: at32f415_can.h:568
can_fifo_mailbox_type::rfc_bit
struct can_fifo_mailbox_type::@74::@81 rfc_bit
can_fifo_mailbox_type::rffri
__IO uint32_t rffri
Definition: at32f415_can.h:521
can_fifo_mailbox_type::rfdt3
__IO uint32_t rfdt3
Definition: at32f415_can.h:554
can_fifo_mailbox_type::rfdt5
__IO uint32_t rfdt5
Definition: at32f415_can.h:567
can_fifo_mailbox_type::rfdt7
__IO uint32_t rfdt7
Definition: at32f415_can.h:569
can_fifo_mailbox_type::rfdtl_bit
struct can_fifo_mailbox_type::@76::@82 rfdtl_bit
can_fifo_mailbox_type::rffmn
__IO uint32_t rffmn
Definition: at32f415_can.h:538
can_filter_init_type
can filter init structure definition
Definition: at32f415_can.h:369
can_filter_init_type::filter_mask_low
uint16_t filter_mask_low
Definition: at32f415_can.h:389
can_filter_init_type::filter_number
uint8_t filter_number
Definition: at32f415_can.h:376
can_filter_init_type::filter_fifo
can_filter_fifo_type filter_fifo
Definition: at32f415_can.h:374
can_filter_init_type::filter_bit
can_filter_bit_width_type filter_bit
Definition: at32f415_can.h:378
can_filter_init_type::filter_mode
can_filter_mode_type filter_mode
Definition: at32f415_can.h:372
can_filter_init_type::filter_activate_enable
confirm_state filter_activate_enable
Definition: at32f415_can.h:370
can_filter_init_type::filter_mask_high
uint16_t filter_mask_high
Definition: at32f415_can.h:386
can_filter_init_type::filter_id_high
uint16_t filter_id_high
Definition: at32f415_can.h:380
can_filter_init_type::filter_id_low
uint16_t filter_id_low
Definition: at32f415_can.h:383
can_filter_register_type::ffdb1
__IO uint32_t ffdb1
Definition: at32f415_can.h:579
can_filter_register_type::ffdb2
__IO uint32_t ffdb2
Definition: at32f415_can.h:580
can_rx_message_type
can rx message structure definition
Definition: at32f415_can.h:419
can_rx_message_type::standard_id
uint32_t standard_id
Definition: at32f415_can.h:420
can_rx_message_type::id_type
can_identifier_type id_type
Definition: at32f415_can.h:426
can_rx_message_type::frame_type
can_trans_frame_type frame_type
Definition: at32f415_can.h:428
can_rx_message_type::data
uint8_t data[8]
Definition: at32f415_can.h:433
can_rx_message_type::dlc
uint8_t dlc
Definition: at32f415_can.h:430
can_rx_message_type::extended_id
uint32_t extended_id
Definition: at32f415_can.h:423
can_rx_message_type::filter_index
uint8_t filter_index
Definition: at32f415_can.h:435
can_tx_mailbox_type::tmtsten
__IO uint32_t tmtsten
Definition: at32f415_can.h:470
can_tx_mailbox_type::tmi
__IO uint32_t tmi
Definition: at32f415_can.h:449
can_tx_mailbox_type::tmsr
__IO uint32_t tmsr
Definition: at32f415_can.h:452
can_tx_mailbox_type::tmdtl
__IO uint32_t tmdtl
Definition: at32f415_can.h:481
can_tx_mailbox_type::tmdtbl
__IO uint32_t tmdtbl
Definition: at32f415_can.h:468
can_tx_mailbox_type::tmc_bit
struct can_tx_mailbox_type::@62::@69 tmc_bit
can_tx_mailbox_type::tmfrsel
__IO uint32_t tmfrsel
Definition: at32f415_can.h:453
can_tx_mailbox_type::tmsid
__IO uint32_t tmsid
Definition: at32f415_can.h:456
can_tx_mailbox_type::tmi_bit
struct can_tx_mailbox_type::@60::@68 tmi_bit
can_tx_mailbox_type::tmdth
__IO uint32_t tmdth
Definition: at32f415_can.h:496
can_tx_mailbox_type::tmidsel
__IO uint32_t tmidsel
Definition: at32f415_can.h:454
can_tx_message_type
can tx message structure definition
Definition: at32f415_can.h:397
can_tx_message_type::extended_id
uint32_t extended_id
Definition: at32f415_can.h:401
can_tx_message_type::frame_type
can_trans_frame_type frame_type
Definition: at32f415_can.h:406
can_tx_message_type::data
uint8_t data[8]
Definition: at32f415_can.h:411
can_tx_message_type::dlc
uint8_t dlc
Definition: at32f415_can.h:408
can_tx_message_type::id_type
can_identifier_type id_type
Definition: at32f415_can.h:404
can_tx_message_type::standard_id
uint32_t standard_id
Definition: at32f415_can.h:398
can_type
type define can register all
Definition: at32f415_can.h:587
can_type::rf0of
__IO uint32_t rf0of
Definition: at32f415_can.h:681
can_type::tm2ef
__IO uint32_t tm2ef
Definition: at32f415_can.h:663
can_type::ests_bit
struct can_type::@96::@116 ests_bit
can_type::eaf
__IO uint32_t eaf
Definition: at32f415_can.h:740
can_type::rf1
__IO uint32_t rf1
Definition: at32f415_can.h:692
can_type::tm0tsf
__IO uint32_t tm0tsf
Definition: at32f415_can.h:643
can_type::aeden
__IO uint32_t aeden
Definition: at32f415_can.h:602
can_type::dzc
__IO uint32_t dzc
Definition: at32f415_can.h:621
can_type::tm0tcf
__IO uint32_t tm0tcf
Definition: at32f415_can.h:642
can_type::tsts_bit
struct can_type::@88::@112 tsts_bit
can_type::edzif
__IO uint32_t edzif
Definition: at32f415_can.h:624
can_type::mdrsel
__IO uint32_t mdrsel
Definition: at32f415_can.h:600
can_type::rf1ff
__IO uint32_t rf1ff
Definition: at32f415_can.h:697
can_type::bof
__IO uint32_t bof
Definition: at32f415_can.h:742
can_type::tec
__IO uint32_t tec
Definition: at32f415_can.h:746
can_type::rf1_bit
struct can_type::@92::@114 rf1_bit
can_type::ttcen
__IO uint32_t ttcen
Definition: at32f415_can.h:604
can_type::tx_mailbox
can_tx_mailbox_type tx_mailbox[3]
can controller area network tx mailbox register, offset:0x180~0x1AC
Definition: at32f415_can.h:779
can_type::tm1tcf
__IO uint32_t tm1tcf
Definition: at32f415_can.h:648
can_type::lben
__IO uint32_t lben
Definition: at32f415_can.h:766
can_type::ptd
__IO uint32_t ptd
Definition: at32f415_can.h:607
can_type::fzc
__IO uint32_t fzc
Definition: at32f415_can.h:620
can_type::ffb
can_filter_register_type ffb[14]
can ffb register, offset:0x240~0x2AC
Definition: at32f415_can.h:931
can_type::tm0ef
__IO uint32_t tm0ef
Definition: at32f415_can.h:661
can_type::bts2
__IO uint32_t bts2
Definition: at32f415_can.h:762
can_type::loen
__IO uint32_t loen
Definition: at32f415_can.h:767
can_type::ests
__IO uint32_t ests
Definition: at32f415_can.h:737
can_type::fctrl_bit
struct can_type::@100::@118 fctrl_bit
can_type::frf
__IO uint32_t frf
Definition: at32f415_can.h:871
can_type::mctrl_bit
struct can_type::@84::@110 mctrl_bit
can_type::rsaw
__IO uint32_t rsaw
Definition: at32f415_can.h:764
can_type::rf0
__IO uint32_t rf0
Definition: at32f415_can.h:675
can_type::rf1mn
__IO uint32_t rf1mn
Definition: at32f415_can.h:695
can_type::prsfen
__IO uint32_t prsfen
Definition: at32f415_can.h:601
can_type::facfg
__IO uint32_t facfg
Definition: at32f415_can.h:902
can_type::tm1ef
__IO uint32_t tm1ef
Definition: at32f415_can.h:662
can_type::aeboen
__IO uint32_t aeboen
Definition: at32f415_can.h:603
can_type::eoif
__IO uint32_t eoif
Definition: at32f415_can.h:622
can_type::tm2tcf
__IO uint32_t tm2tcf
Definition: at32f415_can.h:654
can_type::brdiv
__IO uint32_t brdiv
Definition: at32f415_can.h:759
can_type::msts_bit
struct can_type::@86::@111 msts_bit
can_type::epf
__IO uint32_t epf
Definition: at32f415_can.h:741
can_type::btmg_bit
struct can_type::@98::@117 btmg_bit
can_type::dzen
__IO uint32_t dzen
Definition: at32f415_can.h:598
can_type::etr
__IO uint32_t etr
Definition: at32f415_can.h:744
can_type::fifo_mailbox
can_fifo_mailbox_type fifo_mailbox[2]
can controller area network fifo mailbox register, offset:0x1B0~0x1CC
Definition: at32f415_can.h:784
can_type::tsts
__IO uint32_t tsts
Definition: at32f415_can.h:639
can_type::fbwcfg
__IO uint32_t fbwcfg
Definition: at32f415_can.h:840
can_type::qdzif
__IO uint32_t qdzif
Definition: at32f415_can.h:623
can_type::rf0mn
__IO uint32_t rf0mn
Definition: at32f415_can.h:678
can_type::rf0ff
__IO uint32_t rf0ff
Definition: at32f415_can.h:680
can_type::fcs
__IO uint32_t fcs
Definition: at32f415_can.h:799
can_type::msts
__IO uint32_t msts
Definition: at32f415_can.h:617
can_type::rec
__IO uint32_t rec
Definition: at32f415_can.h:747
can_type::bts1
__IO uint32_t bts1
Definition: at32f415_can.h:761
can_type::tm2tsf
__IO uint32_t tm2tsf
Definition: at32f415_can.h:655
can_type::rf1of
__IO uint32_t rf1of
Definition: at32f415_can.h:698
can_type::fzen
__IO uint32_t fzen
Definition: at32f415_can.h:597
can_type::mmssr
__IO uint32_t mmssr
Definition: at32f415_can.h:599
can_type::rf0_bit
struct can_type::@90::@113 rf0_bit
can_type::inten
__IO uint32_t inten
Definition: at32f415_can.h:709
can_type::fmcfg
__IO uint32_t fmcfg
Definition: at32f415_can.h:809
can_type::tm1tsf
__IO uint32_t tm1tsf
Definition: at32f415_can.h:649
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_can.h Source File

  • libraries
  • drivers
  • inc
at32f415_can.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CAN_H
29#define __AT32F415_CAN_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
52#define FZC_TIMEOUT ((uint32_t)0x0000FFFF)
53#define DZC_TIMEOUT ((uint32_t)0x0000FFFF)
64#define CAN_EAF_FLAG ((uint32_t)0x01)
65#define CAN_EPF_FLAG ((uint32_t)0x02)
66#define CAN_BOF_FLAG ((uint32_t)0x03)
67#define CAN_ETR_FLAG ((uint32_t)0x04)
68#define CAN_EOIF_FLAG ((uint32_t)0x05)
69#define CAN_TM0TCF_FLAG ((uint32_t)0x06)
70#define CAN_TM1TCF_FLAG ((uint32_t)0x07)
71#define CAN_TM2TCF_FLAG ((uint32_t)0x08)
72#define CAN_RF0MN_FLAG ((uint32_t)0x09)
73#define CAN_RF0FF_FLAG ((uint32_t)0x0A)
74#define CAN_RF0OF_FLAG ((uint32_t)0x0B)
75#define CAN_RF1MN_FLAG ((uint32_t)0x0C)
76#define CAN_RF1FF_FLAG ((uint32_t)0x0D)
77#define CAN_RF1OF_FLAG ((uint32_t)0x0E)
78#define CAN_QDZIF_FLAG ((uint32_t)0x0F)
79#define CAN_EDZC_FLAG ((uint32_t)0x10)
80#define CAN_TMEF_FLAG ((uint32_t)0x11)
91#define CAN_TCIEN_INT ((uint32_t)0x00000001)
92#define CAN_RF0MIEN_INT ((uint32_t)0x00000002)
93#define CAN_RF0FIEN_INT ((uint32_t)0x00000004)
94#define CAN_RF0OIEN_INT ((uint32_t)0x00000008)
95#define CAN_RF1MIEN_INT ((uint32_t)0x00000010)
96#define CAN_RF1FIEN_INT ((uint32_t)0x00000020)
97#define CAN_RF1OIEN_INT ((uint32_t)0x00000040)
98#define CAN_EAIEN_INT ((uint32_t)0x00000100)
99#define CAN_EPIEN_INT ((uint32_t)0x00000200)
100#define CAN_BOIEN_INT ((uint32_t)0x00000400)
101#define CAN_ETRIEN_INT ((uint32_t)0x00000800)
102#define CAN_EOIEN_INT ((uint32_t)0x00008000)
103#define CAN_QDZIEN_INT ((uint32_t)0x00010000)
104#define CAN_EDZIEN_INT ((uint32_t)0x00020000)
113#define CAN_MSTS_EOIF_VAL ((uint32_t)0x00000004)
114#define CAN_MSTS_QDZIF_VAL ((uint32_t)0x00000008)
115#define CAN_MSTS_EDZIF_VAL ((uint32_t)0x00000010)
116#define CAN_TSTS_TM0TCF_VAL ((uint32_t)0x00000001)
117#define CAN_TSTS_TM1TCF_VAL ((uint32_t)0x00000100)
118#define CAN_TSTS_TM2TCF_VAL ((uint32_t)0x00010000)
119#define CAN_TSTS_TM0CT_VAL ((uint32_t)0x00000080)
120#define CAN_TSTS_TM1CT_VAL ((uint32_t)0x00008000)
121#define CAN_TSTS_TM2CT_VAL ((uint32_t)0x00800000)
122#define CAN_RF0_RF0FF_VAL ((uint32_t)0x00000008)
123#define CAN_RF0_RF0OF_VAL ((uint32_t)0x00000010)
124#define CAN_RF0_RF0R_VAL ((uint32_t)0x00000020)
125#define CAN_RF1_RF1FF_VAL ((uint32_t)0x00000008)
126#define CAN_RF1_RF1OF_VAL ((uint32_t)0x00000010)
127#define CAN_RF1_RF1R_VAL ((uint32_t)0x00000020)
136typedef enum
137{
138 CAN_FILTER_FIFO0 = 0x00,
139 CAN_FILTER_FIFO1 = 0x01
140} can_filter_fifo_type;
141
145typedef enum
146{
147 CAN_FILTER_MODE_ID_MASK = 0x00,
148 CAN_FILTER_MODE_ID_LIST = 0x01
149} can_filter_mode_type;
150
154typedef enum
155{
156 CAN_FILTER_16BIT = 0x00,
157 CAN_FILTER_32BIT = 0x01
158} can_filter_bit_width_type;
159
163typedef enum
164{
165 CAN_MODE_COMMUNICATE = 0x00,
166 CAN_MODE_LOOPBACK = 0x01,
167 CAN_MODE_LISTENONLY = 0x02,
168 CAN_MODE_LISTENONLY_LOOPBACK = 0x03
169} can_mode_type;
170
174typedef enum
175{
176 CAN_OPERATINGMODE_FREEZE = 0x00,
177 CAN_OPERATINGMODE_DOZE = 0x01,
178 CAN_OPERATINGMODE_COMMUNICATE = 0x02
179} can_operating_mode_type;
180
184typedef enum
185{
186 CAN_RSAW_1TQ = 0x00,
187 CAN_RSAW_2TQ = 0x01,
188 CAN_RSAW_3TQ = 0x02,
189 CAN_RSAW_4TQ = 0x03
190} can_rsaw_type;
191
195typedef enum
196{
197 CAN_BTS1_1TQ = 0x00,
198 CAN_BTS1_2TQ = 0x01,
199 CAN_BTS1_3TQ = 0x02,
200 CAN_BTS1_4TQ = 0x03,
201 CAN_BTS1_5TQ = 0x04,
202 CAN_BTS1_6TQ = 0x05,
203 CAN_BTS1_7TQ = 0x06,
204 CAN_BTS1_8TQ = 0x07,
205 CAN_BTS1_9TQ = 0x08,
206 CAN_BTS1_10TQ = 0x09,
207 CAN_BTS1_11TQ = 0x0A,
208 CAN_BTS1_12TQ = 0x0B,
209 CAN_BTS1_13TQ = 0x0C,
210 CAN_BTS1_14TQ = 0x0D,
211 CAN_BTS1_15TQ = 0x0E,
212 CAN_BTS1_16TQ = 0x0F
213} can_bts1_type;
214
218typedef enum
219{
220 CAN_BTS2_1TQ = 0x00,
221 CAN_BTS2_2TQ = 0x01,
222 CAN_BTS2_3TQ = 0x02,
223 CAN_BTS2_4TQ = 0x03,
224 CAN_BTS2_5TQ = 0x04,
225 CAN_BTS2_6TQ = 0x05,
226 CAN_BTS2_7TQ = 0x06,
227 CAN_BTS2_8TQ = 0x07
228} can_bts2_type;
229
233typedef enum
234{
235 CAN_ID_STANDARD = 0x00,
236 CAN_ID_EXTENDED = 0x01
237} can_identifier_type;
238
242typedef enum
243{
244 CAN_TFT_DATA = 0x00,
245 CAN_TFT_REMOTE = 0x01
246} can_trans_frame_type;
247
251typedef enum
252{
253 CAN_TX_MAILBOX0 = 0x00,
254 CAN_TX_MAILBOX1 = 0x01,
255 CAN_TX_MAILBOX2 = 0x02
256} can_tx_mailbox_num_type;
257
261typedef enum
262{
263 CAN_RX_FIFO0 = 0x00,
264 CAN_RX_FIFO1 = 0x01
265} can_rx_fifo_num_type;
266
270typedef enum
271{
272 CAN_TX_STATUS_FAILED = 0x00,
273 CAN_TX_STATUS_SUCCESSFUL = 0x01,
274 CAN_TX_STATUS_PENDING = 0x02,
275 CAN_TX_STATUS_NO_EMPTY = 0x04
276} can_transmit_status_type;
277
281typedef enum
282{
283 CAN_ENTER_DOZE_FAILED = 0x00,
284 CAN_ENTER_DOZE_SUCCESSFUL = 0x01
285} can_enter_doze_status_type;
286
290typedef enum
291{
292 CAN_QUIT_DOZE_FAILED = 0x00,
293 CAN_QUIT_DOZE_SUCCESSFUL = 0x01
294} can_quit_doze_status_type;
295
299typedef enum
300{
301 CAN_DISCARDING_FIRST_RECEIVED = 0x00,
302 CAN_DISCARDING_LAST_RECEIVED = 0x01
303} can_msg_discarding_rule_type;
304
308typedef enum
309{
310 CAN_SENDING_BY_ID = 0x00,
311 CAN_SENDING_BY_REQUEST = 0x01
312} can_msg_sending_rule_type;
313
317typedef enum
318{
319 CAN_ERRORRECORD_NOERR = 0x00,
320 CAN_ERRORRECORD_STUFFERR = 0x01,
321 CAN_ERRORRECORD_FORMERR = 0x02,
322 CAN_ERRORRECORD_ACKERR = 0x03,
323 CAN_ERRORRECORD_BITRECESSIVEERR = 0x04,
324 CAN_ERRORRECORD_BITDOMINANTERR = 0x05,
325 CAN_ERRORRECORD_CRCERR = 0x06,
326 CAN_ERRORRECORD_SOFTWARESETERR = 0x07
327} can_error_record_type;
328
332typedef struct
333{
334 can_mode_type mode_selection;
336 confirm_state ttc_enable;
338 confirm_state aebo_enable;
340 confirm_state aed_enable;
342 confirm_state prsf_enable;
344 can_msg_discarding_rule_type mdrsel_selection;
346 can_msg_sending_rule_type mmssr_selection;
348} can_base_type;
349
353typedef struct
354{
355 uint16_t baudrate_div;
357 can_rsaw_type rsaw_size;
359 can_bts1_type bts1_size;
361 can_bts2_type bts2_size;
363} can_baudrate_type;
364
368typedef struct
369{
370 confirm_state filter_activate_enable;
372 can_filter_mode_type filter_mode;
374 can_filter_fifo_type filter_fifo;
376 uint8_t filter_number;
378 can_filter_bit_width_type filter_bit;
380 uint16_t filter_id_high;
383 uint16_t filter_id_low;
386 uint16_t filter_mask_high;
389 uint16_t filter_mask_low;
391} can_filter_init_type;
392
396typedef struct
397{
398 uint32_t standard_id;
401 uint32_t extended_id;
404 can_identifier_type id_type;
406 can_trans_frame_type frame_type;
408 uint8_t dlc;
411 uint8_t data[8];
413} can_tx_message_type;
414
418typedef struct
419{
420 uint32_t standard_id;
423 uint32_t extended_id;
426 can_identifier_type id_type;
428 can_trans_frame_type frame_type;
430 uint8_t dlc;
433 uint8_t data[8];
435 uint8_t filter_index;
437} can_rx_message_type;
438
442typedef struct
443{
447 union
448 {
449 __IO uint32_t tmi;
450 struct
451 {
452 __IO uint32_t tmsr : 1; /* [0] */
453 __IO uint32_t tmfrsel : 1; /* [1] */
454 __IO uint32_t tmidsel : 1; /* [2] */
455 __IO uint32_t tmeid : 18;/* [20:3] */
456 __IO uint32_t tmsid : 11;/* [31:21] */
457 } tmi_bit;
458 };
459
463 union
464 {
465 __IO uint32_t tmc;
466 struct
467 {
468 __IO uint32_t tmdtbl : 4; /* [3:0] */
469 __IO uint32_t reserved1 : 4; /* [7:4] */
470 __IO uint32_t tmtsten : 1; /* [8] */
471 __IO uint32_t reserved2 : 7; /* [15:9] */
472 __IO uint32_t tmts : 16;/* [31:16] */
473 } tmc_bit;
474 };
475
479 union
480 {
481 __IO uint32_t tmdtl;
482 struct
483 {
484 __IO uint32_t tmdt0 : 8; /* [7:0] */
485 __IO uint32_t tmdt1 : 8; /* [15:8] */
486 __IO uint32_t tmdt2 : 8; /* [23:16] */
487 __IO uint32_t tmdt3 : 8; /* [31:24] */
488 } tmdtl_bit;
489 };
490
494 union
495 {
496 __IO uint32_t tmdth;
497 struct
498 {
499 __IO uint32_t tmdt4 : 8; /* [7:0] */
500 __IO uint32_t tmdt5 : 8; /* [15:8] */
501 __IO uint32_t tmdt6 : 8; /* [23:16] */
502 __IO uint32_t tmdt7 : 8; /* [31:24] */
503 } tmdth_bit;
504 };
505} can_tx_mailbox_type;
506
510typedef struct
511{
515 union
516 {
517 __IO uint32_t rfi;
518 struct
519 {
520 __IO uint32_t reserved1 : 1; /* [0] */
521 __IO uint32_t rffri : 1; /* [1] */
522 __IO uint32_t rfidi : 1; /* [2] */
523 __IO uint32_t rfeid : 18;/* [20:3] */
524 __IO uint32_t rfsid : 11;/* [31:21] */
525 } rfi_bit;
526 };
527
531 union
532 {
533 __IO uint32_t rfc;
534 struct
535 {
536 __IO uint32_t rfdtl : 4; /* [3:0] */
537 __IO uint32_t reserved1 : 4; /* [7:4] */
538 __IO uint32_t rffmn : 8; /* [15:8] */
539 __IO uint32_t rfts : 16;/* [31:16] */
540 } rfc_bit;
541 };
542
546 union
547 {
548 __IO uint32_t rfdtl;
549 struct
550 {
551 __IO uint32_t rfdt0 : 8; /* [7:0] */
552 __IO uint32_t rfdt1 : 8; /* [15:8] */
553 __IO uint32_t rfdt2 : 8; /* [23:16] */
554 __IO uint32_t rfdt3 : 8; /* [31:24] */
555 } rfdtl_bit;
556 };
557
561 union
562 {
563 __IO uint32_t rfdth;
564 struct
565 {
566 __IO uint32_t rfdt4 : 8; /* [7:0] */
567 __IO uint32_t rfdt5 : 8; /* [15:8] */
568 __IO uint32_t rfdt6 : 8; /* [23:16] */
569 __IO uint32_t rfdt7 : 8; /* [31:24] */
570 } rfdth_bit;
571 };
572} can_fifo_mailbox_type;
573
577typedef struct
578{
579 __IO uint32_t ffdb1;
580 __IO uint32_t ffdb2;
581} can_filter_register_type;
582
586typedef struct
587{
588
592 union
593 {
594 __IO uint32_t mctrl;
595 struct
596 {
597 __IO uint32_t fzen : 1; /* [0] */
598 __IO uint32_t dzen : 1; /* [1] */
599 __IO uint32_t mmssr : 1; /* [2] */
600 __IO uint32_t mdrsel : 1; /* [3] */
601 __IO uint32_t prsfen : 1; /* [4] */
602 __IO uint32_t aeden : 1; /* [5] */
603 __IO uint32_t aeboen : 1; /* [6] */
604 __IO uint32_t ttcen : 1; /* [7] */
605 __IO uint32_t reserved1 : 7; /* [14:8] */
606 __IO uint32_t sprst : 1; /* [15] */
607 __IO uint32_t ptd : 1; /* [16] */
608 __IO uint32_t reserved2 : 15;/*[31:17] */
609 } mctrl_bit;
610 };
611
615 union
616 {
617 __IO uint32_t msts;
618 struct
619 {
620 __IO uint32_t fzc : 1; /* [0] */
621 __IO uint32_t dzc : 1; /* [1] */
622 __IO uint32_t eoif : 1; /* [2] */
623 __IO uint32_t qdzif : 1; /* [3] */
624 __IO uint32_t edzif : 1; /* [4] */
625 __IO uint32_t reserved1 : 3; /* [7:5] */
626 __IO uint32_t cuss : 1; /* [8] */
627 __IO uint32_t curs : 1; /* [9] */
628 __IO uint32_t lsamprx : 1; /* [10] */
629 __IO uint32_t realrx : 1; /* [11] */
630 __IO uint32_t reserved2 : 20;/*[31:12] */
631 } msts_bit;
632 };
633
637 union
638 {
639 __IO uint32_t tsts;
640 struct
641 {
642 __IO uint32_t tm0tcf : 1; /* [0] */
643 __IO uint32_t tm0tsf : 1; /* [1] */
644 __IO uint32_t tm0alf : 1; /* [2] */
645 __IO uint32_t tm0tef : 1; /* [3] */
646 __IO uint32_t reserved1 : 3; /* [6:4] */
647 __IO uint32_t tm0ct : 1; /* [7] */
648 __IO uint32_t tm1tcf : 1; /* [8] */
649 __IO uint32_t tm1tsf : 1; /* [9] */
650 __IO uint32_t tm1alf : 1; /* [10] */
651 __IO uint32_t tm1tef : 1; /* [11] */
652 __IO uint32_t reserved2 : 3; /* [14:12] */
653 __IO uint32_t tm1ct : 1; /* [15] */
654 __IO uint32_t tm2tcf : 1; /* [16] */
655 __IO uint32_t tm2tsf : 1; /* [17] */
656 __IO uint32_t tm2alf : 1; /* [18] */
657 __IO uint32_t tm2tef : 1; /* [19] */
658 __IO uint32_t reserved3 : 3; /* [22:20] */
659 __IO uint32_t tm2ct : 1; /* [23] */
660 __IO uint32_t tmnr : 2; /* [25:24] */
661 __IO uint32_t tm0ef : 1; /* [26] */
662 __IO uint32_t tm1ef : 1; /* [27] */
663 __IO uint32_t tm2ef : 1; /* [28] */
664 __IO uint32_t tm0lpf : 1; /* [29] */
665 __IO uint32_t tm1lpf : 1; /* [30] */
666 __IO uint32_t tm2lpf : 1; /* [31] */
667 } tsts_bit;
668 };
669
673 union
674 {
675 __IO uint32_t rf0;
676 struct
677 {
678 __IO uint32_t rf0mn : 2; /* [1:0] */
679 __IO uint32_t reserved1 : 1; /* [2] */
680 __IO uint32_t rf0ff : 1; /* [3] */
681 __IO uint32_t rf0of : 1; /* [4] */
682 __IO uint32_t rf0r : 1; /* [5] */
683 __IO uint32_t reserved2 : 26;/* [31:6] */
684 } rf0_bit;
685 };
686
690 union
691 {
692 __IO uint32_t rf1;
693 struct
694 {
695 __IO uint32_t rf1mn : 2; /* [1:0] */
696 __IO uint32_t reserved1 : 1; /* [2] */
697 __IO uint32_t rf1ff : 1; /* [3] */
698 __IO uint32_t rf1of : 1; /* [4] */
699 __IO uint32_t rf1r : 1; /* [5] */
700 __IO uint32_t reserved2 : 26;/* [31:6] */
701 } rf1_bit;
702 };
703
707 union
708 {
709 __IO uint32_t inten;
710 struct
711 {
712 __IO uint32_t tcien : 1; /* [0] */
713 __IO uint32_t rf0mien : 1; /* [1] */
714 __IO uint32_t rf0fien : 1; /* [2] */
715 __IO uint32_t rf0oien : 1; /* [3] */
716 __IO uint32_t rf1mien : 1; /* [4] */
717 __IO uint32_t rf1fien : 1; /* [5] */
718 __IO uint32_t rf1oien : 1; /* [6] */
719 __IO uint32_t reserved1 : 1; /* [7] */
720 __IO uint32_t eaien : 1; /* [8] */
721 __IO uint32_t epien : 1; /* [9] */
722 __IO uint32_t boien : 1; /* [10] */
723 __IO uint32_t etrien : 1; /* [11] */
724 __IO uint32_t reserved2 : 3; /* [14:12] */
725 __IO uint32_t eoien : 1; /* [15] */
726 __IO uint32_t qdzien : 1; /* [16] */
727 __IO uint32_t edzien : 1; /* [17] */
728 __IO uint32_t reserved3 : 14;/* [31:18] */
729 } inten_bit;
730 };
731
735 union
736 {
737 __IO uint32_t ests;
738 struct
739 {
740 __IO uint32_t eaf : 1; /* [0] */
741 __IO uint32_t epf : 1; /* [1] */
742 __IO uint32_t bof : 1; /* [2] */
743 __IO uint32_t reserved1 : 1; /* [3] */
744 __IO uint32_t etr : 3; /* [6:4] */
745 __IO uint32_t reserved2 : 9; /* [15:7] */
746 __IO uint32_t tec : 8; /* [23:16] */
747 __IO uint32_t rec : 8; /* [31:24] */
748 } ests_bit;
749 };
750
754 union
755 {
756 __IO uint32_t btmg;
757 struct
758 {
759 __IO uint32_t brdiv : 12;/* [11:0] */
760 __IO uint32_t reserved1 : 4; /* [15:12] */
761 __IO uint32_t bts1 : 4; /* [19:16] */
762 __IO uint32_t bts2 : 3; /* [22:20] */
763 __IO uint32_t reserved2 : 1; /* [23] */
764 __IO uint32_t rsaw : 2; /* [25:24] */
765 __IO uint32_t reserved3 : 4; /* [29:26] */
766 __IO uint32_t lben : 1; /* [30] */
767 __IO uint32_t loen : 1; /* [31] */
768 } btmg_bit;
769 };
770
774 __IO uint32_t reserved1[88];
775
779 can_tx_mailbox_type tx_mailbox[3];
780
784 can_fifo_mailbox_type fifo_mailbox[2];
785
789 __IO uint32_t reserved2[12];
790
794 union
795 {
796 __IO uint32_t fctrl;
797 struct
798 {
799 __IO uint32_t fcs : 1; /* [0] */
800 __IO uint32_t reserved1 : 31;/* [31:1] */
801 } fctrl_bit;
802 };
803
807 union
808 {
809 __IO uint32_t fmcfg;
810 struct
811 {
812 __IO uint32_t fmsel0 : 1; /* [0] */
813 __IO uint32_t fmsel1 : 1; /* [1] */
814 __IO uint32_t fmsel2 : 1; /* [2] */
815 __IO uint32_t fmsel3 : 1; /* [3] */
816 __IO uint32_t fmsel4 : 1; /* [4] */
817 __IO uint32_t fmsel5 : 1; /* [5] */
818 __IO uint32_t fmsel6 : 1; /* [6] */
819 __IO uint32_t fmsel7 : 1; /* [7] */
820 __IO uint32_t fmsel8 : 1; /* [8] */
821 __IO uint32_t fmsel9 : 1; /* [9] */
822 __IO uint32_t fmsel10 : 1; /* [10] */
823 __IO uint32_t fmsel11 : 1; /* [11] */
824 __IO uint32_t fmsel12 : 1; /* [12] */
825 __IO uint32_t fmsel13 : 1; /* [13] */
826 __IO uint32_t reserved1 : 18;/* [31:14] */
827 } fmcfg_bit;
828 };
829
833 __IO uint32_t reserved3;
834
838 union
839 {
840 __IO uint32_t fbwcfg;
841 struct
842 {
843 __IO uint32_t fbwsel0 : 1; /* [0] */
844 __IO uint32_t fbwsel1 : 1; /* [1] */
845 __IO uint32_t fbwsel2 : 1; /* [2] */
846 __IO uint32_t fbwsel3 : 1; /* [3] */
847 __IO uint32_t fbwsel4 : 1; /* [4] */
848 __IO uint32_t fbwsel5 : 1; /* [5] */
849 __IO uint32_t fbwsel6 : 1; /* [6] */
850 __IO uint32_t fbwsel7 : 1; /* [7] */
851 __IO uint32_t fbwsel8 : 1; /* [8] */
852 __IO uint32_t fbwsel9 : 1; /* [9] */
853 __IO uint32_t fbwsel10 : 1; /* [10] */
854 __IO uint32_t fbwsel11 : 1; /* [11] */
855 __IO uint32_t fbwsel12 : 1; /* [12] */
856 __IO uint32_t fbwsel13 : 1; /* [13] */
857 __IO uint32_t reserved1 : 18;/* [31:14] */
858 } fbwcfg_bit;
859 };
860
864 __IO uint32_t reserved4;
865
869 union
870 {
871 __IO uint32_t frf;
872 struct
873 {
874 __IO uint32_t frfsel0 : 1; /* [0] */
875 __IO uint32_t frfsel1 : 1; /* [1] */
876 __IO uint32_t frfsel2 : 1; /* [2] */
877 __IO uint32_t frfsel3 : 1; /* [3] */
878 __IO uint32_t frfsel4 : 1; /* [4] */
879 __IO uint32_t frfsel5 : 1; /* [5] */
880 __IO uint32_t frfsel6 : 1; /* [6] */
881 __IO uint32_t frfsel7 : 1; /* [7] */
882 __IO uint32_t frfsel8 : 1; /* [8] */
883 __IO uint32_t frfsel9 : 1; /* [9] */
884 __IO uint32_t frfsel10 : 1; /* [10] */
885 __IO uint32_t frfsel11 : 1; /* [11] */
886 __IO uint32_t frfsel12 : 1; /* [12] */
887 __IO uint32_t frfsel13 : 1; /* [13] */
888 __IO uint32_t reserved1 : 18;/* [31:14] */
889 } frf_bit;
890 };
891
895 __IO uint32_t reserved5;
896
900 union
901 {
902 __IO uint32_t facfg;
903 struct
904 {
905 __IO uint32_t faen0 : 1; /* [0] */
906 __IO uint32_t faen1 : 1; /* [1] */
907 __IO uint32_t faen2 : 1; /* [2] */
908 __IO uint32_t faen3 : 1; /* [3] */
909 __IO uint32_t faen4 : 1; /* [4] */
910 __IO uint32_t faen5 : 1; /* [5] */
911 __IO uint32_t faen6 : 1; /* [6] */
912 __IO uint32_t faen7 : 1; /* [7] */
913 __IO uint32_t faen8 : 1; /* [8] */
914 __IO uint32_t faen9 : 1; /* [9] */
915 __IO uint32_t faen10 : 1; /* [10] */
916 __IO uint32_t faen11 : 1; /* [11] */
917 __IO uint32_t faen12 : 1; /* [12] */
918 __IO uint32_t faen13 : 1; /* [13] */
919 __IO uint32_t reserved1 : 18;/* [31:14] */
920 } facfg_bit;
921 };
922
926 __IO uint32_t reserved6[8];
927
931 can_filter_register_type ffb[14];
932} can_type;
933
938#define CAN1 ((can_type *) CAN1_BASE)
939
944void can_reset(can_type* can_x);
945void can_baudrate_default_para_init(can_baudrate_type* can_baudrate_struct);
946 error_status can_baudrate_set(can_type* can_x, can_baudrate_type* can_baudrate_struct);
947void can_default_para_init(can_base_type* can_base_struct);
948 error_status can_base_init(can_type* can_x, can_base_type* can_base_struct);
949void can_filter_default_para_init(can_filter_init_type* can_filter_init_struct);
950void can_filter_init(can_type* can_x, can_filter_init_type* can_filter_init_struct);
951void can_debug_transmission_prohibit(can_type* can_x, confirm_state new_state);
952void can_ttc_mode_enable(can_type* can_x, confirm_state new_state);
953uint8_t can_message_transmit(can_type* can_x, can_tx_message_type* tx_message_struct);
954 can_transmit_status_type can_transmit_status_get(can_type* can_x, can_tx_mailbox_num_type transmit_mailbox);
955void can_transmit_cancel(can_type* can_x, can_tx_mailbox_num_type transmit_mailbox);
956void can_message_receive(can_type* can_x, can_rx_fifo_num_type fifo_number, can_rx_message_type* rx_message_struct);
957void can_receive_fifo_release(can_type* can_x, can_rx_fifo_num_type fifo_number);
958uint8_t can_receive_message_pending_get(can_type* can_x, can_rx_fifo_num_type fifo_number);
959 error_status can_operating_mode_set(can_type* can_x, can_operating_mode_type can_operating_mode);
960 can_enter_doze_status_type can_doze_mode_enter(can_type* can_x);
961 can_quit_doze_status_type can_doze_mode_exit(can_type* can_x);
962 can_error_record_type can_error_type_record_get(can_type* can_x);
963uint8_t can_receive_error_counter_get(can_type* can_x);
964uint8_t can_transmit_error_counter_get(can_type* can_x);
965void can_interrupt_enable(can_type* can_x, uint32_t can_int, confirm_state new_state);
966 flag_status can_flag_get(can_type* can_x, uint32_t can_flag);
967void can_flag_clear(can_type* can_x, uint32_t can_flag);
968
981#ifdef __cplusplus
982}
983#endif
984
985#endif
at32f415.h
at32f415 header file
can_base_init
error_status can_base_init(can_type *can_x, can_base_type *can_base_struct)
initialize the can peripheral according to the specified parameters in the can_init_struct.
Definition: at32f415_can.c:186
can_reset
void can_reset(can_type *can_x)
deinitialize the can peripheral registers to their default reset values.
Definition: at32f415_can.c:51
can_transmit_error_counter_get
uint8_t can_transmit_error_counter_get(can_type *can_x)
return the transmit error counter of the specified can peripheral.
Definition: at32f415_can.c:884
can_transmit_status_get
can_transmit_status_type can_transmit_status_get(can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
check the transmission state of the specified can peripheral.
Definition: at32f415_can.c:506
can_ttc_mode_enable
void can_ttc_mode_enable(can_type *can_x, confirm_state new_state)
enable or disable time trigger operation communication mode of the specified can peripheral.
Definition: at32f415_can.c:408
can_filter_default_para_init
void can_filter_default_para_init(can_filter_init_type *can_filter_init_struct)
fill each can_filter_init_struct member with its default value.
Definition: at32f415_can.c:261
can_receive_fifo_release
void can_receive_fifo_release(can_type *can_x, can_rx_fifo_num_type fifo_number)
release the specified fifo of the specified can peripheral.
Definition: at32f415_can.c:658
can_receive_error_counter_get
uint8_t can_receive_error_counter_get(can_type *can_x)
return the receive error counter (rec) of the specified can peripheral.
Definition: at32f415_can.c:870
can_operating_mode_set
error_status can_operating_mode_set(can_type *can_x, can_operating_mode_type can_operating_mode)
set the operation mode of the specified can peripheral.
Definition: at32f415_can.c:715
can_baudrate_default_para_init
void can_baudrate_default_para_init(can_baudrate_type *can_baudrate_struct)
fill each can_baudrate_struct member with its default value.
Definition: at32f415_can.c:62
can_transmit_cancel
void can_transmit_cancel(can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
cancel a transmit request of the specified can peripheral.
Definition: at32f415_can.c:581
can_receive_message_pending_get
uint8_t can_receive_message_pending_get(can_type *can_x, can_rx_fifo_num_type fifo_number)
return the number of pending messages of the specified can peripheral.
Definition: at32f415_can.c:684
can_message_transmit
uint8_t can_message_transmit(can_type *can_x, can_tx_message_type *tx_message_struct)
fill the transmission message and transmit of the specified can peripheral.
Definition: at32f415_can.c:432
can_message_receive
void can_message_receive(can_type *can_x, can_rx_fifo_num_type fifo_number, can_rx_message_type *rx_message_struct)
receive message of the specified can peripheral.
Definition: at32f415_can.c:611
can_interrupt_enable
void can_interrupt_enable(can_type *can_x, uint32_t can_int, confirm_state new_state)
enable or disable the interrupt of the specified can peripheral.
Definition: at32f415_can.c:916
can_flag_get
flag_status can_flag_get(can_type *can_x, uint32_t can_flag)
get flag of the specified can peripheral.
Definition: at32f415_can.c:956
can_flag_clear
void can_flag_clear(can_type *can_x, uint32_t can_flag)
clear flag of the specified can peripheral.
Definition: at32f415_can.c:1079
can_baudrate_set
error_status can_baudrate_set(can_type *can_x, can_baudrate_type *can_baudrate_struct)
set the baudrate of the can peripheral
Definition: at32f415_can.c:91
can_debug_transmission_prohibit
void can_debug_transmission_prohibit(can_type *can_x, confirm_state new_state)
enable or disable the debug transmission prohibit of the specified can peripheral.
Definition: at32f415_can.c:387
can_error_type_record_get
can_error_record_type can_error_type_record_get(can_type *can_x)
return the error type record (etr) of the specified can peripheral.
Definition: at32f415_can.c:855
can_filter_init
void can_filter_init(can_type *can_x, can_filter_init_type *can_filter_init_struct)
initialize the can peripheral according to the specified parameters in the can_filter_init_struct.
Definition: at32f415_can.c:296
can_default_para_init
void can_default_para_init(can_base_type *can_base_struct)
fill each can_init_struct member with its default value.
Definition: at32f415_can.c:149
can_doze_mode_exit
can_quit_doze_status_type can_doze_mode_exit(can_type *can_x)
exit the doze mode of the specified can peripheral.
Definition: at32f415_can.c:823
can_doze_mode_enter
can_enter_doze_status_type can_doze_mode_enter(can_type *can_x)
enter the low power mode of the specified can peripheral.
Definition: at32f415_can.c:793
can_filter_fifo_type
can_filter_fifo_type
can filter fifo
Definition: at32f415_can.h:137
can_transmit_status_type
can_transmit_status_type
can transmit status
Definition: at32f415_can.h:271
can_msg_discarding_rule_type
can_msg_discarding_rule_type
can message discarding rule select when overflow
Definition: at32f415_can.h:300
can_bts2_type
can_bts2_type
can bit time segment 2
Definition: at32f415_can.h:219
can_quit_doze_status_type
can_quit_doze_status_type
can quit doze mode status
Definition: at32f415_can.h:291
can_trans_frame_type
can_trans_frame_type
can transmission frame type
Definition: at32f415_can.h:243
can_bts1_type
can_bts1_type
can bit time segment 1
Definition: at32f415_can.h:196
can_error_record_type
can_error_record_type
can error type record
Definition: at32f415_can.h:318
can_filter_mode_type
can_filter_mode_type
can filter mode
Definition: at32f415_can.h:146
can_operating_mode_type
can_operating_mode_type
can operating mode
Definition: at32f415_can.h:175
can_msg_sending_rule_type
can_msg_sending_rule_type
can multiple message sending sequence rule
Definition: at32f415_can.h:309
can_tx_mailbox_num_type
can_tx_mailbox_num_type
can tx mailboxes
Definition: at32f415_can.h:252
can_filter_bit_width_type
can_filter_bit_width_type
can filter bit width select
Definition: at32f415_can.h:155
can_enter_doze_status_type
can_enter_doze_status_type
can enter doze mode status
Definition: at32f415_can.h:282
can_rx_fifo_num_type
can_rx_fifo_num_type
can receive fifo
Definition: at32f415_can.h:262
can_identifier_type
can_identifier_type
can identifier type
Definition: at32f415_can.h:234
can_mode_type
can_mode_type
can mode
Definition: at32f415_can.h:164
can_rsaw_type
can_rsaw_type
can resynchronization adjust width
Definition: at32f415_can.h:185
CAN_FILTER_FIFO0
@ CAN_FILTER_FIFO0
Definition: at32f415_can.h:138
CAN_FILTER_FIFO1
@ CAN_FILTER_FIFO1
Definition: at32f415_can.h:139
CAN_TX_STATUS_SUCCESSFUL
@ CAN_TX_STATUS_SUCCESSFUL
Definition: at32f415_can.h:273
CAN_TX_STATUS_PENDING
@ CAN_TX_STATUS_PENDING
Definition: at32f415_can.h:274
CAN_TX_STATUS_NO_EMPTY
@ CAN_TX_STATUS_NO_EMPTY
Definition: at32f415_can.h:275
CAN_TX_STATUS_FAILED
@ CAN_TX_STATUS_FAILED
Definition: at32f415_can.h:272
CAN_DISCARDING_FIRST_RECEIVED
@ CAN_DISCARDING_FIRST_RECEIVED
Definition: at32f415_can.h:301
CAN_DISCARDING_LAST_RECEIVED
@ CAN_DISCARDING_LAST_RECEIVED
Definition: at32f415_can.h:302
CAN_BTS2_4TQ
@ CAN_BTS2_4TQ
Definition: at32f415_can.h:223
CAN_BTS2_2TQ
@ CAN_BTS2_2TQ
Definition: at32f415_can.h:221
CAN_BTS2_5TQ
@ CAN_BTS2_5TQ
Definition: at32f415_can.h:224
CAN_BTS2_6TQ
@ CAN_BTS2_6TQ
Definition: at32f415_can.h:225
CAN_BTS2_7TQ
@ CAN_BTS2_7TQ
Definition: at32f415_can.h:226
CAN_BTS2_8TQ
@ CAN_BTS2_8TQ
Definition: at32f415_can.h:227
CAN_BTS2_3TQ
@ CAN_BTS2_3TQ
Definition: at32f415_can.h:222
CAN_BTS2_1TQ
@ CAN_BTS2_1TQ
Definition: at32f415_can.h:220
CAN_QUIT_DOZE_FAILED
@ CAN_QUIT_DOZE_FAILED
Definition: at32f415_can.h:292
CAN_QUIT_DOZE_SUCCESSFUL
@ CAN_QUIT_DOZE_SUCCESSFUL
Definition: at32f415_can.h:293
CAN_TFT_REMOTE
@ CAN_TFT_REMOTE
Definition: at32f415_can.h:245
CAN_TFT_DATA
@ CAN_TFT_DATA
Definition: at32f415_can.h:244
CAN_BTS1_7TQ
@ CAN_BTS1_7TQ
Definition: at32f415_can.h:203
CAN_BTS1_1TQ
@ CAN_BTS1_1TQ
Definition: at32f415_can.h:197
CAN_BTS1_14TQ
@ CAN_BTS1_14TQ
Definition: at32f415_can.h:210
CAN_BTS1_4TQ
@ CAN_BTS1_4TQ
Definition: at32f415_can.h:200
CAN_BTS1_15TQ
@ CAN_BTS1_15TQ
Definition: at32f415_can.h:211
CAN_BTS1_11TQ
@ CAN_BTS1_11TQ
Definition: at32f415_can.h:207
CAN_BTS1_10TQ
@ CAN_BTS1_10TQ
Definition: at32f415_can.h:206
CAN_BTS1_16TQ
@ CAN_BTS1_16TQ
Definition: at32f415_can.h:212
CAN_BTS1_8TQ
@ CAN_BTS1_8TQ
Definition: at32f415_can.h:204
CAN_BTS1_3TQ
@ CAN_BTS1_3TQ
Definition: at32f415_can.h:199
CAN_BTS1_12TQ
@ CAN_BTS1_12TQ
Definition: at32f415_can.h:208
CAN_BTS1_9TQ
@ CAN_BTS1_9TQ
Definition: at32f415_can.h:205
CAN_BTS1_5TQ
@ CAN_BTS1_5TQ
Definition: at32f415_can.h:201
CAN_BTS1_6TQ
@ CAN_BTS1_6TQ
Definition: at32f415_can.h:202
CAN_BTS1_2TQ
@ CAN_BTS1_2TQ
Definition: at32f415_can.h:198
CAN_BTS1_13TQ
@ CAN_BTS1_13TQ
Definition: at32f415_can.h:209
CAN_ERRORRECORD_CRCERR
@ CAN_ERRORRECORD_CRCERR
Definition: at32f415_can.h:325
CAN_ERRORRECORD_FORMERR
@ CAN_ERRORRECORD_FORMERR
Definition: at32f415_can.h:321
CAN_ERRORRECORD_BITDOMINANTERR
@ CAN_ERRORRECORD_BITDOMINANTERR
Definition: at32f415_can.h:324
CAN_ERRORRECORD_BITRECESSIVEERR
@ CAN_ERRORRECORD_BITRECESSIVEERR
Definition: at32f415_can.h:323
CAN_ERRORRECORD_NOERR
@ CAN_ERRORRECORD_NOERR
Definition: at32f415_can.h:319
CAN_ERRORRECORD_STUFFERR
@ CAN_ERRORRECORD_STUFFERR
Definition: at32f415_can.h:320
CAN_ERRORRECORD_SOFTWARESETERR
@ CAN_ERRORRECORD_SOFTWARESETERR
Definition: at32f415_can.h:326
CAN_ERRORRECORD_ACKERR
@ CAN_ERRORRECORD_ACKERR
Definition: at32f415_can.h:322
CAN_FILTER_MODE_ID_LIST
@ CAN_FILTER_MODE_ID_LIST
Definition: at32f415_can.h:148
CAN_FILTER_MODE_ID_MASK
@ CAN_FILTER_MODE_ID_MASK
Definition: at32f415_can.h:147
CAN_OPERATINGMODE_FREEZE
@ CAN_OPERATINGMODE_FREEZE
Definition: at32f415_can.h:176
CAN_OPERATINGMODE_COMMUNICATE
@ CAN_OPERATINGMODE_COMMUNICATE
Definition: at32f415_can.h:178
CAN_OPERATINGMODE_DOZE
@ CAN_OPERATINGMODE_DOZE
Definition: at32f415_can.h:177
CAN_SENDING_BY_ID
@ CAN_SENDING_BY_ID
Definition: at32f415_can.h:310
CAN_SENDING_BY_REQUEST
@ CAN_SENDING_BY_REQUEST
Definition: at32f415_can.h:311
CAN_TX_MAILBOX2
@ CAN_TX_MAILBOX2
Definition: at32f415_can.h:255
CAN_TX_MAILBOX0
@ CAN_TX_MAILBOX0
Definition: at32f415_can.h:253
CAN_TX_MAILBOX1
@ CAN_TX_MAILBOX1
Definition: at32f415_can.h:254
CAN_FILTER_16BIT
@ CAN_FILTER_16BIT
Definition: at32f415_can.h:156
CAN_FILTER_32BIT
@ CAN_FILTER_32BIT
Definition: at32f415_can.h:157
CAN_ENTER_DOZE_FAILED
@ CAN_ENTER_DOZE_FAILED
Definition: at32f415_can.h:283
CAN_ENTER_DOZE_SUCCESSFUL
@ CAN_ENTER_DOZE_SUCCESSFUL
Definition: at32f415_can.h:284
CAN_RX_FIFO0
@ CAN_RX_FIFO0
Definition: at32f415_can.h:263
CAN_RX_FIFO1
@ CAN_RX_FIFO1
Definition: at32f415_can.h:264
CAN_ID_STANDARD
@ CAN_ID_STANDARD
Definition: at32f415_can.h:235
CAN_ID_EXTENDED
@ CAN_ID_EXTENDED
Definition: at32f415_can.h:236
CAN_MODE_COMMUNICATE
@ CAN_MODE_COMMUNICATE
Definition: at32f415_can.h:165
CAN_MODE_LISTENONLY
@ CAN_MODE_LISTENONLY
Definition: at32f415_can.h:167
CAN_MODE_LISTENONLY_LOOPBACK
@ CAN_MODE_LISTENONLY_LOOPBACK
Definition: at32f415_can.h:168
CAN_MODE_LOOPBACK
@ CAN_MODE_LOOPBACK
Definition: at32f415_can.h:166
CAN_RSAW_1TQ
@ CAN_RSAW_1TQ
Definition: at32f415_can.h:186
CAN_RSAW_4TQ
@ CAN_RSAW_4TQ
Definition: at32f415_can.h:189
CAN_RSAW_3TQ
@ CAN_RSAW_3TQ
Definition: at32f415_can.h:188
CAN_RSAW_2TQ
@ CAN_RSAW_2TQ
Definition: at32f415_can.h:187
error_status
error_status
error status
Definition: at32f415.h:258
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
can_base_type
can init structure definition
Definition: at32f415_can.h:333
can_base_type::prsf_enable
confirm_state prsf_enable
Definition: at32f415_can.h:342
can_base_type::mdrsel_selection
can_msg_discarding_rule_type mdrsel_selection
Definition: at32f415_can.h:344
can_base_type::aed_enable
confirm_state aed_enable
Definition: at32f415_can.h:340
can_base_type::mmssr_selection
can_msg_sending_rule_type mmssr_selection
Definition: at32f415_can.h:346
can_base_type::ttc_enable
confirm_state ttc_enable
Definition: at32f415_can.h:336
can_base_type::mode_selection
can_mode_type mode_selection
Definition: at32f415_can.h:334
can_base_type::aebo_enable
confirm_state aebo_enable
Definition: at32f415_can.h:338
can_baudrate_type
can baudrate structure definition
Definition: at32f415_can.h:354
can_baudrate_type::baudrate_div
uint16_t baudrate_div
Definition: at32f415_can.h:355
can_baudrate_type::rsaw_size
can_rsaw_type rsaw_size
Definition: at32f415_can.h:357
can_baudrate_type::bts2_size
can_bts2_type bts2_size
Definition: at32f415_can.h:361
can_baudrate_type::bts1_size
can_bts1_type bts1_size
Definition: at32f415_can.h:359
can_fifo_mailbox_type
can controller area network fifo mailbox
Definition: at32f415_can.h:511
can_fifo_mailbox_type::rfdt4
__IO uint32_t rfdt4
Definition: at32f415_can.h:566
can_fifo_mailbox_type::rfi
__IO uint32_t rfi
Definition: at32f415_can.h:517
can_fifo_mailbox_type::rfdt0
__IO uint32_t rfdt0
Definition: at32f415_can.h:551
can_fifo_mailbox_type::rfsid
__IO uint32_t rfsid
Definition: at32f415_can.h:524
can_fifo_mailbox_type::rfdt2
__IO uint32_t rfdt2
Definition: at32f415_can.h:553
can_fifo_mailbox_type::rfdth
__IO uint32_t rfdth
Definition: at32f415_can.h:563
can_fifo_mailbox_type::rfdtl
__IO uint32_t rfdtl
Definition: at32f415_can.h:536
can_fifo_mailbox_type::rfidi
__IO uint32_t rfidi
Definition: at32f415_can.h:522
can_fifo_mailbox_type::rfdt1
__IO uint32_t rfdt1
Definition: at32f415_can.h:552
can_fifo_mailbox_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_can.h:520
can_fifo_mailbox_type::rfdt6
__IO uint32_t rfdt6
Definition: at32f415_can.h:568
can_fifo_mailbox_type::rffri
__IO uint32_t rffri
Definition: at32f415_can.h:521
can_fifo_mailbox_type::rfc
__IO uint32_t rfc
Definition: at32f415_can.h:533
can_fifo_mailbox_type::rfdt3
__IO uint32_t rfdt3
Definition: at32f415_can.h:554
can_fifo_mailbox_type::rfdt5
__IO uint32_t rfdt5
Definition: at32f415_can.h:567
can_fifo_mailbox_type::rfdt7
__IO uint32_t rfdt7
Definition: at32f415_can.h:569
can_fifo_mailbox_type::rfts
__IO uint32_t rfts
Definition: at32f415_can.h:539
can_fifo_mailbox_type::rffmn
__IO uint32_t rffmn
Definition: at32f415_can.h:538
can_fifo_mailbox_type::rfeid
__IO uint32_t rfeid
Definition: at32f415_can.h:523
can_filter_init_type
can filter init structure definition
Definition: at32f415_can.h:369
can_filter_init_type::filter_mask_low
uint16_t filter_mask_low
Definition: at32f415_can.h:389
can_filter_init_type::filter_number
uint8_t filter_number
Definition: at32f415_can.h:376
can_filter_init_type::filter_fifo
can_filter_fifo_type filter_fifo
Definition: at32f415_can.h:374
can_filter_init_type::filter_bit
can_filter_bit_width_type filter_bit
Definition: at32f415_can.h:378
can_filter_init_type::filter_mode
can_filter_mode_type filter_mode
Definition: at32f415_can.h:372
can_filter_init_type::filter_activate_enable
confirm_state filter_activate_enable
Definition: at32f415_can.h:370
can_filter_init_type::filter_mask_high
uint16_t filter_mask_high
Definition: at32f415_can.h:386
can_filter_init_type::filter_id_high
uint16_t filter_id_high
Definition: at32f415_can.h:380
can_filter_init_type::filter_id_low
uint16_t filter_id_low
Definition: at32f415_can.h:383
can_filter_register_type
can controller area network filter bit register
Definition: at32f415_can.h:578
can_filter_register_type::ffdb1
__IO uint32_t ffdb1
Definition: at32f415_can.h:579
can_filter_register_type::ffdb2
__IO uint32_t ffdb2
Definition: at32f415_can.h:580
can_rx_message_type
can rx message structure definition
Definition: at32f415_can.h:419
can_rx_message_type::standard_id
uint32_t standard_id
Definition: at32f415_can.h:420
can_rx_message_type::id_type
can_identifier_type id_type
Definition: at32f415_can.h:426
can_rx_message_type::frame_type
can_trans_frame_type frame_type
Definition: at32f415_can.h:428
can_rx_message_type::dlc
uint8_t dlc
Definition: at32f415_can.h:430
can_rx_message_type::extended_id
uint32_t extended_id
Definition: at32f415_can.h:423
can_rx_message_type::filter_index
uint8_t filter_index
Definition: at32f415_can.h:435
can_tx_mailbox_type
can controller area network tx mailbox
Definition: at32f415_can.h:443
can_tx_mailbox_type::tmdt5
__IO uint32_t tmdt5
Definition: at32f415_can.h:500
can_tx_mailbox_type::tmtsten
__IO uint32_t tmtsten
Definition: at32f415_can.h:470
can_tx_mailbox_type::tmi
__IO uint32_t tmi
Definition: at32f415_can.h:449
can_tx_mailbox_type::tmc
__IO uint32_t tmc
Definition: at32f415_can.h:465
can_tx_mailbox_type::tmts
__IO uint32_t tmts
Definition: at32f415_can.h:472
can_tx_mailbox_type::tmdt0
__IO uint32_t tmdt0
Definition: at32f415_can.h:484
can_tx_mailbox_type::tmsr
__IO uint32_t tmsr
Definition: at32f415_can.h:452
can_tx_mailbox_type::tmdtl
__IO uint32_t tmdtl
Definition: at32f415_can.h:481
can_tx_mailbox_type::tmdt2
__IO uint32_t tmdt2
Definition: at32f415_can.h:486
can_tx_mailbox_type::tmdtbl
__IO uint32_t tmdtbl
Definition: at32f415_can.h:468
can_tx_mailbox_type::tmdt3
__IO uint32_t tmdt3
Definition: at32f415_can.h:487
can_tx_mailbox_type::tmdt1
__IO uint32_t tmdt1
Definition: at32f415_can.h:485
can_tx_mailbox_type::tmdt4
__IO uint32_t tmdt4
Definition: at32f415_can.h:499
can_tx_mailbox_type::tmfrsel
__IO uint32_t tmfrsel
Definition: at32f415_can.h:453
can_tx_mailbox_type::tmsid
__IO uint32_t tmsid
Definition: at32f415_can.h:456
can_tx_mailbox_type::tmdt6
__IO uint32_t tmdt6
Definition: at32f415_can.h:501
can_tx_mailbox_type::tmdth
__IO uint32_t tmdth
Definition: at32f415_can.h:496
can_tx_mailbox_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_can.h:469
can_tx_mailbox_type::tmidsel
__IO uint32_t tmidsel
Definition: at32f415_can.h:454
can_tx_mailbox_type::tmdt7
__IO uint32_t tmdt7
Definition: at32f415_can.h:502
can_tx_mailbox_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_can.h:471
can_tx_mailbox_type::tmeid
__IO uint32_t tmeid
Definition: at32f415_can.h:455
can_tx_message_type
can tx message structure definition
Definition: at32f415_can.h:397
can_tx_message_type::extended_id
uint32_t extended_id
Definition: at32f415_can.h:401
can_tx_message_type::frame_type
can_trans_frame_type frame_type
Definition: at32f415_can.h:406
can_tx_message_type::dlc
uint8_t dlc
Definition: at32f415_can.h:408
can_tx_message_type::id_type
can_identifier_type id_type
Definition: at32f415_can.h:404
can_tx_message_type::standard_id
uint32_t standard_id
Definition: at32f415_can.h:398
can_type
type define can register all
Definition: at32f415_can.h:587
can_type::tmnr
__IO uint32_t tmnr
Definition: at32f415_can.h:660
can_type::fbwsel10
__IO uint32_t fbwsel10
Definition: at32f415_can.h:853
can_type::rf0of
__IO uint32_t rf0of
Definition: at32f415_can.h:681
can_type::tm1alf
__IO uint32_t tm1alf
Definition: at32f415_can.h:650
can_type::tm2lpf
__IO uint32_t tm2lpf
Definition: at32f415_can.h:666
can_type::fmsel13
__IO uint32_t fmsel13
Definition: at32f415_can.h:825
can_type::tm2ef
__IO uint32_t tm2ef
Definition: at32f415_can.h:663
can_type::tm2ct
__IO uint32_t tm2ct
Definition: at32f415_can.h:659
can_type::frfsel1
__IO uint32_t frfsel1
Definition: at32f415_can.h:875
can_type::frfsel12
__IO uint32_t frfsel12
Definition: at32f415_can.h:886
can_type::fmsel4
__IO uint32_t fmsel4
Definition: at32f415_can.h:816
can_type::etrien
__IO uint32_t etrien
Definition: at32f415_can.h:723
can_type::tm1tef
__IO uint32_t tm1tef
Definition: at32f415_can.h:651
can_type::fbwsel8
__IO uint32_t fbwsel8
Definition: at32f415_can.h:851
can_type::boien
__IO uint32_t boien
Definition: at32f415_can.h:722
can_type::eoien
__IO uint32_t eoien
Definition: at32f415_can.h:725
can_type::fctrl
__IO uint32_t fctrl
Definition: at32f415_can.h:796
can_type::frfsel4
__IO uint32_t frfsel4
Definition: at32f415_can.h:878
can_type::tm0ct
__IO uint32_t tm0ct
Definition: at32f415_can.h:647
can_type::eaf
__IO uint32_t eaf
Definition: at32f415_can.h:740
can_type::rf1
__IO uint32_t rf1
Definition: at32f415_can.h:692
can_type::tm0tsf
__IO uint32_t tm0tsf
Definition: at32f415_can.h:643
can_type::tm0lpf
__IO uint32_t tm0lpf
Definition: at32f415_can.h:664
can_type::frfsel2
__IO uint32_t frfsel2
Definition: at32f415_can.h:876
can_type::aeden
__IO uint32_t aeden
Definition: at32f415_can.h:602
can_type::dzc
__IO uint32_t dzc
Definition: at32f415_can.h:621
can_type::fmsel0
__IO uint32_t fmsel0
Definition: at32f415_can.h:812
can_type::faen4
__IO uint32_t faen4
Definition: at32f415_can.h:909
can_type::tm0tcf
__IO uint32_t tm0tcf
Definition: at32f415_can.h:642
can_type::fmsel12
__IO uint32_t fmsel12
Definition: at32f415_can.h:824
can_type::eaien
__IO uint32_t eaien
Definition: at32f415_can.h:720
can_type::fbwsel4
__IO uint32_t fbwsel4
Definition: at32f415_can.h:847
can_type::fbwsel9
__IO uint32_t fbwsel9
Definition: at32f415_can.h:852
can_type::reserved5
__IO uint32_t reserved5
can reserved register, offset:0x218
Definition: at32f415_can.h:895
can_type::edzif
__IO uint32_t edzif
Definition: at32f415_can.h:624
can_type::frfsel11
__IO uint32_t frfsel11
Definition: at32f415_can.h:885
can_type::fmsel9
__IO uint32_t fmsel9
Definition: at32f415_can.h:821
can_type::frfsel10
__IO uint32_t frfsel10
Definition: at32f415_can.h:884
can_type::mctrl
__IO uint32_t mctrl
Definition: at32f415_can.h:594
can_type::frfsel13
__IO uint32_t frfsel13
Definition: at32f415_can.h:887
can_type::faen7
__IO uint32_t faen7
Definition: at32f415_can.h:912
can_type::faen6
__IO uint32_t faen6
Definition: at32f415_can.h:911
can_type::mdrsel
__IO uint32_t mdrsel
Definition: at32f415_can.h:600
can_type::faen8
__IO uint32_t faen8
Definition: at32f415_can.h:913
can_type::rf0fien
__IO uint32_t rf0fien
Definition: at32f415_can.h:714
can_type::rf1ff
__IO uint32_t rf1ff
Definition: at32f415_can.h:697
can_type::cuss
__IO uint32_t cuss
Definition: at32f415_can.h:626
can_type::bof
__IO uint32_t bof
Definition: at32f415_can.h:742
can_type::faen10
__IO uint32_t faen10
Definition: at32f415_can.h:915
can_type::tec
__IO uint32_t tec
Definition: at32f415_can.h:746
can_type::btmg
__IO uint32_t btmg
Definition: at32f415_can.h:756
can_type::fbwsel0
__IO uint32_t fbwsel0
Definition: at32f415_can.h:843
can_type::sprst
__IO uint32_t sprst
Definition: at32f415_can.h:606
can_type::ttcen
__IO uint32_t ttcen
Definition: at32f415_can.h:604
can_type::tm1tcf
__IO uint32_t tm1tcf
Definition: at32f415_can.h:648
can_type::lben
__IO uint32_t lben
Definition: at32f415_can.h:766
can_type::ptd
__IO uint32_t ptd
Definition: at32f415_can.h:607
can_type::fzc
__IO uint32_t fzc
Definition: at32f415_can.h:620
can_type::epien
__IO uint32_t epien
Definition: at32f415_can.h:721
can_type::fbwsel11
__IO uint32_t fbwsel11
Definition: at32f415_can.h:854
can_type::faen3
__IO uint32_t faen3
Definition: at32f415_can.h:908
can_type::rf1oien
__IO uint32_t rf1oien
Definition: at32f415_can.h:718
can_type::rf0oien
__IO uint32_t rf0oien
Definition: at32f415_can.h:715
can_type::tm0ef
__IO uint32_t tm0ef
Definition: at32f415_can.h:661
can_type::fbwsel1
__IO uint32_t fbwsel1
Definition: at32f415_can.h:844
can_type::frfsel8
__IO uint32_t frfsel8
Definition: at32f415_can.h:882
can_type::fbwsel6
__IO uint32_t fbwsel6
Definition: at32f415_can.h:849
can_type::bts2
__IO uint32_t bts2
Definition: at32f415_can.h:762
can_type::loen
__IO uint32_t loen
Definition: at32f415_can.h:767
can_type::fbwsel7
__IO uint32_t fbwsel7
Definition: at32f415_can.h:850
can_type::fmsel3
__IO uint32_t fmsel3
Definition: at32f415_can.h:815
can_type::ests
__IO uint32_t ests
Definition: at32f415_can.h:737
can_type::frfsel9
__IO uint32_t frfsel9
Definition: at32f415_can.h:883
can_type::frf
__IO uint32_t frf
Definition: at32f415_can.h:871
can_type::reserved4
__IO uint32_t reserved4
can reserved register, offset:0x210
Definition: at32f415_can.h:864
can_type::qdzien
__IO uint32_t qdzien
Definition: at32f415_can.h:726
can_type::fbwsel13
__IO uint32_t fbwsel13
Definition: at32f415_can.h:856
can_type::reserved3
__IO uint32_t reserved3
can reserved register, offset:0x208
Definition: at32f415_can.h:658
can_type::rsaw
__IO uint32_t rsaw
Definition: at32f415_can.h:764
can_type::rf0r
__IO uint32_t rf0r
Definition: at32f415_can.h:682
can_type::rf0
__IO uint32_t rf0
Definition: at32f415_can.h:675
can_type::rf1mien
__IO uint32_t rf1mien
Definition: at32f415_can.h:716
can_type::fmsel1
__IO uint32_t fmsel1
Definition: at32f415_can.h:813
can_type::frfsel6
__IO uint32_t frfsel6
Definition: at32f415_can.h:880
can_type::tm1ct
__IO uint32_t tm1ct
Definition: at32f415_can.h:653
can_type::rf0mien
__IO uint32_t rf0mien
Definition: at32f415_can.h:713
can_type::rf1mn
__IO uint32_t rf1mn
Definition: at32f415_can.h:695
can_type::edzien
__IO uint32_t edzien
Definition: at32f415_can.h:727
can_type::reserved1
__IO uint32_t reserved1
can reserved register, offset:0x20~0x17C
Definition: at32f415_can.h:605
can_type::prsfen
__IO uint32_t prsfen
Definition: at32f415_can.h:601
can_type::facfg
__IO uint32_t facfg
Definition: at32f415_can.h:902
can_type::fmsel11
__IO uint32_t fmsel11
Definition: at32f415_can.h:823
can_type::tm1ef
__IO uint32_t tm1ef
Definition: at32f415_can.h:662
can_type::realrx
__IO uint32_t realrx
Definition: at32f415_can.h:629
can_type::aeboen
__IO uint32_t aeboen
Definition: at32f415_can.h:603
can_type::eoif
__IO uint32_t eoif
Definition: at32f415_can.h:622
can_type::tm2tcf
__IO uint32_t tm2tcf
Definition: at32f415_can.h:654
can_type::faen11
__IO uint32_t faen11
Definition: at32f415_can.h:916
can_type::faen1
__IO uint32_t faen1
Definition: at32f415_can.h:906
can_type::brdiv
__IO uint32_t brdiv
Definition: at32f415_can.h:759
can_type::fmsel2
__IO uint32_t fmsel2
Definition: at32f415_can.h:814
can_type::fbwsel3
__IO uint32_t fbwsel3
Definition: at32f415_can.h:846
can_type::frfsel7
__IO uint32_t frfsel7
Definition: at32f415_can.h:881
can_type::epf
__IO uint32_t epf
Definition: at32f415_can.h:741
can_type::faen0
__IO uint32_t faen0
Definition: at32f415_can.h:905
can_type::dzen
__IO uint32_t dzen
Definition: at32f415_can.h:598
can_type::tm2alf
__IO uint32_t tm2alf
Definition: at32f415_can.h:656
can_type::faen2
__IO uint32_t faen2
Definition: at32f415_can.h:907
can_type::fmsel10
__IO uint32_t fmsel10
Definition: at32f415_can.h:822
can_type::etr
__IO uint32_t etr
Definition: at32f415_can.h:744
can_type::tsts
__IO uint32_t tsts
Definition: at32f415_can.h:639
can_type::fbwsel5
__IO uint32_t fbwsel5
Definition: at32f415_can.h:848
can_type::fbwcfg
__IO uint32_t fbwcfg
Definition: at32f415_can.h:840
can_type::qdzif
__IO uint32_t qdzif
Definition: at32f415_can.h:623
can_type::tcien
__IO uint32_t tcien
Definition: at32f415_can.h:712
can_type::fbwsel2
__IO uint32_t fbwsel2
Definition: at32f415_can.h:845
can_type::fmsel8
__IO uint32_t fmsel8
Definition: at32f415_can.h:820
can_type::rf0mn
__IO uint32_t rf0mn
Definition: at32f415_can.h:678
can_type::fmsel5
__IO uint32_t fmsel5
Definition: at32f415_can.h:817
can_type::rf0ff
__IO uint32_t rf0ff
Definition: at32f415_can.h:680
can_type::frfsel0
__IO uint32_t frfsel0
Definition: at32f415_can.h:874
can_type::reserved2
__IO uint32_t reserved2
can reserved register, offset:0x1D0~0x1FC
Definition: at32f415_can.h:608
can_type::fcs
__IO uint32_t fcs
Definition: at32f415_can.h:799
can_type::msts
__IO uint32_t msts
Definition: at32f415_can.h:617
can_type::lsamprx
__IO uint32_t lsamprx
Definition: at32f415_can.h:628
can_type::faen13
__IO uint32_t faen13
Definition: at32f415_can.h:918
can_type::tm0alf
__IO uint32_t tm0alf
Definition: at32f415_can.h:644
can_type::rec
__IO uint32_t rec
Definition: at32f415_can.h:747
can_type::bts1
__IO uint32_t bts1
Definition: at32f415_can.h:761
can_type::fmsel7
__IO uint32_t fmsel7
Definition: at32f415_can.h:819
can_type::rf1r
__IO uint32_t rf1r
Definition: at32f415_can.h:699
can_type::tm1lpf
__IO uint32_t tm1lpf
Definition: at32f415_can.h:665
can_type::tm2tsf
__IO uint32_t tm2tsf
Definition: at32f415_can.h:655
can_type::frfsel5
__IO uint32_t frfsel5
Definition: at32f415_can.h:879
can_type::faen9
__IO uint32_t faen9
Definition: at32f415_can.h:914
can_type::fmsel6
__IO uint32_t fmsel6
Definition: at32f415_can.h:818
can_type::rf1fien
__IO uint32_t rf1fien
Definition: at32f415_can.h:717
can_type::faen5
__IO uint32_t faen5
Definition: at32f415_can.h:910
can_type::rf1of
__IO uint32_t rf1of
Definition: at32f415_can.h:698
can_type::fbwsel12
__IO uint32_t fbwsel12
Definition: at32f415_can.h:855
can_type::tm0tef
__IO uint32_t tm0tef
Definition: at32f415_can.h:645
can_type::fzen
__IO uint32_t fzen
Definition: at32f415_can.h:597
can_type::mmssr
__IO uint32_t mmssr
Definition: at32f415_can.h:599
can_type::faen12
__IO uint32_t faen12
Definition: at32f415_can.h:917
can_type::frfsel3
__IO uint32_t frfsel3
Definition: at32f415_can.h:877
can_type::tm2tef
__IO uint32_t tm2tef
Definition: at32f415_can.h:657
can_type::inten
__IO uint32_t inten
Definition: at32f415_can.h:709
can_type::fmcfg
__IO uint32_t fmcfg
Definition: at32f415_can.h:809
can_type::tm1tsf
__IO uint32_t tm1tsf
Definition: at32f415_can.h:649
can_type::curs
__IO uint32_t curs
Definition: at32f415_can.h:627


AT32F415 Firmwary Library: at32f415_cmp.c Source File

  • libraries
  • drivers
  • src
at32f415_cmp.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef CMP_MODULE_ENABLED
39
44#define CMP_CTRLSTS1_CLEAR_MASK ((uint32_t)0x00039C7C)
45#define CMP_INPINPUT_CLEAR_MASK ((uint32_t)0x00000180)
46#define CMP_HIGH_PULSE_CLEAR_MASK ((uint16_t)0x003F)
47#define CMP_LOW_PULSE_CLEAR_MASK ((uint16_t)0x003F)
48
54void cmp_reset(void)
55{
56 crm_periph_reset(CRM_CMP_PERIPH_RESET, TRUE);
57 crm_periph_reset(CRM_CMP_PERIPH_RESET, FALSE);
58}
59
67void cmp_init(cmp_sel_type cmp_sel, cmp_init_type* cmp_init_struct)
68{
69 if(cmp_sel == CMP1_SELECTION)
70 {
71 CMP->ctrlsts2_bit.cmp1ninvsel = cmp_init_struct->cmp_non_inverting;
72 CMP->ctrlsts1_bit.cmp1invsel = cmp_init_struct->cmp_inverting;
73 CMP->ctrlsts1_bit.cmp1ssel = cmp_init_struct->cmp_speed;
74 CMP->ctrlsts1_bit.cmp1tag = cmp_init_struct->cmp_output;
75 CMP->ctrlsts1_bit.cmp1p = cmp_init_struct->cmp_polarity;
76 CMP->ctrlsts1_bit.cmp1hyst = cmp_init_struct->cmp_hysteresis;
77 }
78 else
79 {
80 CMP->ctrlsts2_bit.cmp2ninvsel = cmp_init_struct->cmp_non_inverting;
81 CMP->ctrlsts1_bit.cmp2invsel = cmp_init_struct->cmp_inverting;
82 CMP->ctrlsts1_bit.cmp2ssel = cmp_init_struct->cmp_speed;
83 CMP->ctrlsts1_bit.cmp2tag = cmp_init_struct->cmp_output;
84 CMP->ctrlsts1_bit.cmp2p = cmp_init_struct->cmp_polarity;
85 CMP->ctrlsts1_bit.cmp2hyst = cmp_init_struct->cmp_hysteresis;
86 }
87}
88
95void cmp_default_para_init(cmp_init_type *cmp_init_struct)
96{
97 /* reset cmp init structure parameters values */
98 cmp_init_struct->cmp_non_inverting = CMP_NON_INVERTING_PA1;
99 cmp_init_struct->cmp_inverting = CMP_INVERTING_1_4VREFINT;
100 cmp_init_struct->cmp_speed = CMP_SPEED_FAST;
101 cmp_init_struct->cmp_output = CMP_OUTPUT_NONE;
102 cmp_init_struct->cmp_polarity = CMP_POL_NON_INVERTING;
103 cmp_init_struct->cmp_hysteresis = CMP_HYSTERESIS_NONE;
104}
105
113void cmp_enable(cmp_sel_type cmp_sel, confirm_state new_state)
114{
115 /* cmp enable */
116 if(cmp_sel == CMP1_SELECTION)
117 {
118 CMP->ctrlsts1_bit.cmp1en = new_state;
119 }
120 else
121 {
122 CMP->ctrlsts1_bit.cmp2en = new_state;
123 }
124}
125
131void cmp_input_shift_enable(confirm_state new_state)
132{
133 CMP->ctrlsts1_bit.cmp1is = new_state;
134}
135
142uint32_t cmp_output_value_get(cmp_sel_type cmp_sel)
143{
144 uint32_t cmpout = 0x0;
145 if(cmp_sel == CMP1_SELECTION)
146 {
147 cmpout = CMP->ctrlsts1_bit.cmp1value;
148 }
149 else
150 {
151 cmpout = CMP->ctrlsts1_bit.cmp2value;
152 }
153
154 /* return the comparator output level */
155 return (uint32_t)(cmpout);
156}
157
164void cmp_write_protect_enable(cmp_sel_type cmp_sel)
165{
166 if(cmp_sel == CMP1_SELECTION)
167 {
168 CMP->ctrlsts1_bit.cmp1wp = TRUE;
169 }
170 else
171 {
172 CMP->ctrlsts1_bit.cmp2wp = TRUE;
173 }
174}
175
180#endif
181
cmp_sel_type
cmp_sel_type
cmp selection type
Definition: at32f415_cmp.h:126
CMP1_SELECTION
@ CMP1_SELECTION
Definition: at32f415_cmp.h:127
CMP_POL_NON_INVERTING
@ CMP_POL_NON_INVERTING
Definition: at32f415_cmp.h:107
CMP_NON_INVERTING_PA1
@ CMP_NON_INVERTING_PA1
Definition: at32f415_cmp.h:56
CMP_SPEED_FAST
@ CMP_SPEED_FAST
Definition: at32f415_cmp.h:81
CMP_INVERTING_1_4VREFINT
@ CMP_INVERTING_1_4VREFINT
Definition: at32f415_cmp.h:66
CMP_OUTPUT_NONE
@ CMP_OUTPUT_NONE
Definition: at32f415_cmp.h:92
CMP_HYSTERESIS_NONE
@ CMP_HYSTERESIS_NONE
Definition: at32f415_cmp.h:116
cmp_output_value_get
uint32_t cmp_output_value_get(cmp_sel_type cmp_sel)
get cmp output value
Definition: at32f415_cmp.c:142
cmp_init
void cmp_init(cmp_sel_type cmp_sel, cmp_init_type *cmp_init_struct)
initialize the cmp peripheral
Definition: at32f415_cmp.c:67
cmp_write_protect_enable
void cmp_write_protect_enable(cmp_sel_type cmp_sel)
enable cmp write protect
Definition: at32f415_cmp.c:164
cmp_reset
void cmp_reset(void)
reset the cmp register
Definition: at32f415_cmp.c:54
cmp_input_shift_enable
void cmp_input_shift_enable(confirm_state new_state)
enable or disable cmp input shift
Definition: at32f415_cmp.c:131
cmp_enable
void cmp_enable(cmp_sel_type cmp_sel, confirm_state new_state)
enable or disable cmp
Definition: at32f415_cmp.c:113
cmp_default_para_init
void cmp_default_para_init(cmp_init_type *cmp_init_struct)
fill each cmp_init_type member with its default value.
Definition: at32f415_cmp.c:95
CMP
#define CMP
Definition: at32f415_cmp.h:203
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
CRM_CMP_PERIPH_RESET
@ CRM_CMP_PERIPH_RESET
Definition: at32f415_crm.h:168
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
cmp_init_type
cmp init type
Definition: at32f415_cmp.h:135
cmp_init_type::cmp_non_inverting
cmp_non_inverting_type cmp_non_inverting
Definition: at32f415_cmp.h:136
cmp_init_type::cmp_output
cmp_output_type cmp_output
Definition: at32f415_cmp.h:139
cmp_init_type::cmp_polarity
cmp_polarity_type cmp_polarity
Definition: at32f415_cmp.h:140
cmp_init_type::cmp_speed
cmp_speed_type cmp_speed
Definition: at32f415_cmp.h:138
cmp_init_type::cmp_inverting
cmp_inverting_type cmp_inverting
Definition: at32f415_cmp.h:137
cmp_init_type::cmp_hysteresis
cmp_hysteresis_type cmp_hysteresis
Definition: at32f415_cmp.h:141
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_cmp.h Source File

  • libraries
  • drivers
  • inc
at32f415_cmp.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CMP_H
29#define __AT32F415_CMP_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
53typedef enum
54{
55 CMP_NON_INVERTING_PA5 = 0x00,
56 CMP_NON_INVERTING_PA1 = 0x01,
57 CMP_NON_INVERTING_PA0 = 0x02,
58 CMP_NON_INVERTING_VSSA = 0x03
59} cmp_non_inverting_type;
60
64typedef enum
65{
66 CMP_INVERTING_1_4VREFINT = 0x00,
67 CMP_INVERTING_1_2VREFINT = 0x01,
68 CMP_INVERTING_3_4VREFINT = 0x02,
69 CMP_INVERTING_VREFINT = 0x03,
70 CMP_INVERTING_PA4 = 0x04,
71 CMP_INVERTING_PA5 = 0x05,
72 CMP_INVERTING_PA0 = 0x06,
73 CMP_INVERTING_PA2 = 0x07
74} cmp_inverting_type;
75
79typedef enum
80{
81 CMP_SPEED_FAST = 0x00,
82 CMP_SPEED_MEDIUM = 0x01,
83 CMP_SPEED_SLOW = 0x02,
84 CMP_SPEED_ULTRALOW = 0x03
85} cmp_speed_type;
86
90typedef enum
91{
92 CMP_OUTPUT_NONE = 0x00,
93 CMP_OUTPUT_TMR1BRK = 0x01,
94 CMP_OUTPUT_TMR1CH1 = 0x02,
95 CMP_OUTPUT_TMR1CHCLR = 0x03,
96 CMP_OUTPUT_TMR2CH4 = 0x04,
97 CMP_OUTPUT_TMR2CHCLR = 0x05,
98 CMP_OUTPUT_TMR3CH1 = 0x06,
99 CMP_OUTPUT_TMR3CHCLR = 0x07
100} cmp_output_type;
101
105typedef enum
106{
107 CMP_POL_NON_INVERTING = 0x00,
108 CMP_POL_INVERTING = 0x01,
109} cmp_polarity_type;
110
114typedef enum
115{
116 CMP_HYSTERESIS_NONE = 0x00,
117 CMP_HYSTERESIS_LOW = 0x01,
118 CMP_HYSTERESIS_MEDIUM = 0x02,
119 CMP_HYSTERESIS_HIGH = 0x03
120} cmp_hysteresis_type;
121
125typedef enum
126{
127 CMP1_SELECTION = 0x00,
128 CMP2_SELECTION = 0x01,
129} cmp_sel_type;
130
134typedef struct
135{
136 cmp_non_inverting_type cmp_non_inverting;
137 cmp_inverting_type cmp_inverting;
138 cmp_speed_type cmp_speed;
139 cmp_output_type cmp_output;
140 cmp_polarity_type cmp_polarity;
141 cmp_hysteresis_type cmp_hysteresis;
142}cmp_init_type;
143
147typedef struct
148{
152 union
153 {
154 __IO uint32_t ctrlsts1;
155 struct
156 {
157 __IO uint32_t cmp1en : 1; /* [0] */
158 __IO uint32_t cmp1is : 1; /* [1] */
159 __IO uint32_t cmp1ssel : 1; /* [2] */
160 __IO uint32_t reserved1 : 1; /* [3] */
161 __IO uint32_t cmp1invsel : 3; /* [6:4] */
162 __IO uint32_t reserved2 : 1; /* [7] */
163 __IO uint32_t cmp1tag : 3; /* [10:8] */
164 __IO uint32_t cmp1p : 1; /* [11] */
165 __IO uint32_t cmp1hyst : 2; /* [13:12] */
166 __IO uint32_t cmp1value : 1; /* [14] */
167 __IO uint32_t cmp1wp : 1; /* [15] */
168 __IO uint32_t cmp2en : 1; /* [16] */
169 __IO uint32_t reserved3 : 1; /* [17] */
170 __IO uint32_t cmp2ssel : 1; /* [18] */
171 __IO uint32_t reserved4 : 1; /* [19] */
172 __IO uint32_t cmp2invsel : 3; /* [22:20] */
173 __IO uint32_t dcmpen : 1; /* [23] */
174 __IO uint32_t cmp2tag : 3; /* [26:24] */
175 __IO uint32_t cmp2p : 1; /* [27] */
176 __IO uint32_t cmp2hyst : 2; /* [29:28] */
177 __IO uint32_t cmp2value : 1; /* [30] */
178 __IO uint32_t cmp2wp : 1; /* [31] */
179 } ctrlsts1_bit;
180 };
181
185 union
186 {
187 __IO uint32_t ctrlsts2;
188 struct
189 {
190 __IO uint32_t cmp1ninvsel : 2; /* [1:0] */
191 __IO uint32_t reserved1 : 14;/* [15:2] */
192 __IO uint32_t cmp2ninvsel : 2; /* [17:16] */
193 __IO uint32_t reserved2 : 14;/* [31:18] */
194 } ctrlsts2_bit;
195 };
196
197} cmp_type;
198
203#define CMP ((cmp_type *) (CMP_BASE))
204
209void cmp_reset(void);
210void cmp_init(cmp_sel_type cmp_sel, cmp_init_type* cmp_init_struct);
211void cmp_default_para_init(cmp_init_type *cmp_init_struct);
212void cmp_enable(cmp_sel_type cmp_sel, confirm_state new_state);
213void cmp_input_shift_enable(confirm_state new_state);
214uint32_t cmp_output_value_get(cmp_sel_type cmp_sel);
215void cmp_write_protect_enable(cmp_sel_type cmp_sel);
216
229#ifdef __cplusplus
230}
231#endif
232
233#endif
at32f415.h
at32f415 header file
cmp_output_value_get
uint32_t cmp_output_value_get(cmp_sel_type cmp_sel)
get cmp output value
Definition: at32f415_cmp.c:142
cmp_init
void cmp_init(cmp_sel_type cmp_sel, cmp_init_type *cmp_init_struct)
initialize the cmp peripheral
Definition: at32f415_cmp.c:67
cmp_write_protect_enable
void cmp_write_protect_enable(cmp_sel_type cmp_sel)
enable cmp write protect
Definition: at32f415_cmp.c:164
cmp_reset
void cmp_reset(void)
reset the cmp register
Definition: at32f415_cmp.c:54
cmp_input_shift_enable
void cmp_input_shift_enable(confirm_state new_state)
enable or disable cmp input shift
Definition: at32f415_cmp.c:131
cmp_enable
void cmp_enable(cmp_sel_type cmp_sel, confirm_state new_state)
enable or disable cmp
Definition: at32f415_cmp.c:113
cmp_default_para_init
void cmp_default_para_init(cmp_init_type *cmp_init_struct)
fill each cmp_init_type member with its default value.
Definition: at32f415_cmp.c:95
cmp_sel_type
cmp_sel_type
cmp selection type
Definition: at32f415_cmp.h:126
cmp_polarity_type
cmp_polarity_type
cmp polarity type
Definition: at32f415_cmp.h:106
cmp_non_inverting_type
cmp_non_inverting_type
cmp non-inverting type
Definition: at32f415_cmp.h:54
cmp_speed_type
cmp_speed_type
cmp speed type
Definition: at32f415_cmp.h:80
cmp_inverting_type
cmp_inverting_type
cmp inverting type
Definition: at32f415_cmp.h:65
cmp_output_type
cmp_output_type
cmp output type
Definition: at32f415_cmp.h:91
cmp_hysteresis_type
cmp_hysteresis_type
cmp hysteresis type
Definition: at32f415_cmp.h:115
CMP2_SELECTION
@ CMP2_SELECTION
Definition: at32f415_cmp.h:128
CMP1_SELECTION
@ CMP1_SELECTION
Definition: at32f415_cmp.h:127
CMP_POL_INVERTING
@ CMP_POL_INVERTING
Definition: at32f415_cmp.h:108
CMP_POL_NON_INVERTING
@ CMP_POL_NON_INVERTING
Definition: at32f415_cmp.h:107
CMP_NON_INVERTING_PA0
@ CMP_NON_INVERTING_PA0
Definition: at32f415_cmp.h:57
CMP_NON_INVERTING_PA5
@ CMP_NON_INVERTING_PA5
Definition: at32f415_cmp.h:55
CMP_NON_INVERTING_VSSA
@ CMP_NON_INVERTING_VSSA
Definition: at32f415_cmp.h:58
CMP_NON_INVERTING_PA1
@ CMP_NON_INVERTING_PA1
Definition: at32f415_cmp.h:56
CMP_SPEED_SLOW
@ CMP_SPEED_SLOW
Definition: at32f415_cmp.h:83
CMP_SPEED_ULTRALOW
@ CMP_SPEED_ULTRALOW
Definition: at32f415_cmp.h:84
CMP_SPEED_FAST
@ CMP_SPEED_FAST
Definition: at32f415_cmp.h:81
CMP_SPEED_MEDIUM
@ CMP_SPEED_MEDIUM
Definition: at32f415_cmp.h:82
CMP_INVERTING_PA2
@ CMP_INVERTING_PA2
Definition: at32f415_cmp.h:73
CMP_INVERTING_PA4
@ CMP_INVERTING_PA4
Definition: at32f415_cmp.h:70
CMP_INVERTING_1_4VREFINT
@ CMP_INVERTING_1_4VREFINT
Definition: at32f415_cmp.h:66
CMP_INVERTING_PA0
@ CMP_INVERTING_PA0
Definition: at32f415_cmp.h:72
CMP_INVERTING_VREFINT
@ CMP_INVERTING_VREFINT
Definition: at32f415_cmp.h:69
CMP_INVERTING_PA5
@ CMP_INVERTING_PA5
Definition: at32f415_cmp.h:71
CMP_INVERTING_1_2VREFINT
@ CMP_INVERTING_1_2VREFINT
Definition: at32f415_cmp.h:67
CMP_INVERTING_3_4VREFINT
@ CMP_INVERTING_3_4VREFINT
Definition: at32f415_cmp.h:68
CMP_OUTPUT_TMR1CHCLR
@ CMP_OUTPUT_TMR1CHCLR
Definition: at32f415_cmp.h:95
CMP_OUTPUT_TMR1BRK
@ CMP_OUTPUT_TMR1BRK
Definition: at32f415_cmp.h:93
CMP_OUTPUT_TMR1CH1
@ CMP_OUTPUT_TMR1CH1
Definition: at32f415_cmp.h:94
CMP_OUTPUT_TMR3CH1
@ CMP_OUTPUT_TMR3CH1
Definition: at32f415_cmp.h:98
CMP_OUTPUT_TMR2CHCLR
@ CMP_OUTPUT_TMR2CHCLR
Definition: at32f415_cmp.h:97
CMP_OUTPUT_TMR3CHCLR
@ CMP_OUTPUT_TMR3CHCLR
Definition: at32f415_cmp.h:99
CMP_OUTPUT_NONE
@ CMP_OUTPUT_NONE
Definition: at32f415_cmp.h:92
CMP_OUTPUT_TMR2CH4
@ CMP_OUTPUT_TMR2CH4
Definition: at32f415_cmp.h:96
CMP_HYSTERESIS_LOW
@ CMP_HYSTERESIS_LOW
Definition: at32f415_cmp.h:117
CMP_HYSTERESIS_NONE
@ CMP_HYSTERESIS_NONE
Definition: at32f415_cmp.h:116
CMP_HYSTERESIS_MEDIUM
@ CMP_HYSTERESIS_MEDIUM
Definition: at32f415_cmp.h:118
CMP_HYSTERESIS_HIGH
@ CMP_HYSTERESIS_HIGH
Definition: at32f415_cmp.h:119
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
cmp_init_type
cmp init type
Definition: at32f415_cmp.h:135
cmp_init_type::cmp_non_inverting
cmp_non_inverting_type cmp_non_inverting
Definition: at32f415_cmp.h:136
cmp_init_type::cmp_output
cmp_output_type cmp_output
Definition: at32f415_cmp.h:139
cmp_init_type::cmp_polarity
cmp_polarity_type cmp_polarity
Definition: at32f415_cmp.h:140
cmp_init_type::cmp_speed
cmp_speed_type cmp_speed
Definition: at32f415_cmp.h:138
cmp_init_type::cmp_inverting
cmp_inverting_type cmp_inverting
Definition: at32f415_cmp.h:137
cmp_init_type::cmp_hysteresis
cmp_hysteresis_type cmp_hysteresis
Definition: at32f415_cmp.h:141
cmp_type
type define cmp register all
Definition: at32f415_cmp.h:148
cmp_type::cmp1p
__IO uint32_t cmp1p
Definition: at32f415_cmp.h:164
cmp_type::cmp2tag
__IO uint32_t cmp2tag
Definition: at32f415_cmp.h:174
cmp_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_cmp.h:162
cmp_type::reserved3
__IO uint32_t reserved3
Definition: at32f415_cmp.h:169
cmp_type::cmp1tag
__IO uint32_t cmp1tag
Definition: at32f415_cmp.h:163
cmp_type::cmp1is
__IO uint32_t cmp1is
Definition: at32f415_cmp.h:158
cmp_type::cmp2invsel
__IO uint32_t cmp2invsel
Definition: at32f415_cmp.h:172
cmp_type::cmp2en
__IO uint32_t cmp2en
Definition: at32f415_cmp.h:168
cmp_type::cmp2wp
__IO uint32_t cmp2wp
Definition: at32f415_cmp.h:178
cmp_type::ctrlsts1
__IO uint32_t ctrlsts1
Definition: at32f415_cmp.h:154
cmp_type::cmp1en
__IO uint32_t cmp1en
Definition: at32f415_cmp.h:157
cmp_type::cmp1invsel
__IO uint32_t cmp1invsel
Definition: at32f415_cmp.h:161
cmp_type::cmp2p
__IO uint32_t cmp2p
Definition: at32f415_cmp.h:175
cmp_type::cmp2ninvsel
__IO uint32_t cmp2ninvsel
Definition: at32f415_cmp.h:192
cmp_type::dcmpen
__IO uint32_t dcmpen
Definition: at32f415_cmp.h:173
cmp_type::ctrlsts2
__IO uint32_t ctrlsts2
Definition: at32f415_cmp.h:187
cmp_type::reserved4
__IO uint32_t reserved4
Definition: at32f415_cmp.h:171
cmp_type::cmp1value
__IO uint32_t cmp1value
Definition: at32f415_cmp.h:166
cmp_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_cmp.h:160
cmp_type::cmp1hyst
__IO uint32_t cmp1hyst
Definition: at32f415_cmp.h:165
cmp_type::cmp2ssel
__IO uint32_t cmp2ssel
Definition: at32f415_cmp.h:170
cmp_type::cmp2hyst
__IO uint32_t cmp2hyst
Definition: at32f415_cmp.h:176
cmp_type::cmp2value
__IO uint32_t cmp2value
Definition: at32f415_cmp.h:177
cmp_type::cmp1ninvsel
__IO uint32_t cmp1ninvsel
Definition: at32f415_cmp.h:190
cmp_type::cmp1wp
__IO uint32_t cmp1wp
Definition: at32f415_cmp.h:167
cmp_type::cmp1ssel
__IO uint32_t cmp1ssel
Definition: at32f415_cmp.h:159


AT32F415 Firmwary Library: at32f415_crc.c Source File

  • libraries
  • drivers
  • src
at32f415_crc.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef CRC_MODULE_ENABLED
39
49void crc_data_reset(void)
50{
51 /* reset crc generator */
52 CRC->ctrl_bit.rst = 0x1;
53}
54
60uint32_t crc_one_word_calculate(uint32_t data)
61{
62 CRC->dt = data;
63 return (CRC->dt);
64}
65
72uint32_t crc_block_calculate(uint32_t *pbuffer, uint32_t length)
73{
74 uint32_t index = 0;
75
76 for(index = 0; index < length; index++)
77 {
78 CRC->dt = pbuffer[index];
79 }
80
81 return (CRC->dt);
82}
83
89uint32_t crc_data_get(void)
90{
91 return (CRC->dt);
92}
93
99void crc_common_data_set(uint8_t cdt_value)
100{
101 CRC->cdt_bit.cdt = cdt_value;
102}
103
109uint8_t crc_common_date_get(void)
110{
111 return (CRC->cdt_bit.cdt);
112}
113
119void crc_init_data_set(uint32_t value)
120{
121 CRC->idt = value;
122}
123
134void crc_reverse_input_data_set(crc_reverse_input_type value)
135{
136 CRC->ctrl_bit.revid = value;
137}
138
147void crc_reverse_output_data_set(crc_reverse_output_type value)
148{
149 CRC->ctrl_bit.revod = value;
150}
151
156#endif
157
crc_reverse_output_type
crc_reverse_output_type
crc reverse output data
Definition: at32f415_crc.h:66
crc_reverse_input_type
crc_reverse_input_type
crc reverse input data
Definition: at32f415_crc.h:55
crc_reverse_input_data_set
void crc_reverse_input_data_set(crc_reverse_input_type value)
control the reversal of the bit order in the input data
Definition: at32f415_crc.c:134
crc_block_calculate
uint32_t crc_block_calculate(uint32_t *pbuffer, uint32_t length)
compute the 32-bit crc of a given buffer of data word(32-bit).
Definition: at32f415_crc.c:72
crc_init_data_set
void crc_init_data_set(uint32_t value)
set the 32-bit initial data of crc
Definition: at32f415_crc.c:119
crc_common_data_set
void crc_common_data_set(uint8_t cdt_value)
store a 8-bit data in the common data register.
Definition: at32f415_crc.c:99
crc_data_reset
void crc_data_reset(void)
reset the crc data register.
Definition: at32f415_crc.c:49
crc_common_date_get
uint8_t crc_common_date_get(void)
return the 8-bit data stored in the common data register
Definition: at32f415_crc.c:109
crc_data_get
uint32_t crc_data_get(void)
return the current crc value.
Definition: at32f415_crc.c:89
crc_one_word_calculate
uint32_t crc_one_word_calculate(uint32_t data)
compute the 32-bit crc of a given data word(32-bit).
Definition: at32f415_crc.c:60
crc_reverse_output_data_set
void crc_reverse_output_data_set(crc_reverse_output_type value)
control the reversal of the bit order in the output data
Definition: at32f415_crc.c:147
CRC
#define CRC
Definition: at32f415_crc.h:140
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_crc.h Source File

  • libraries
  • drivers
  • inc
at32f415_crc.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CRC_H
29#define __AT32F415_CRC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
54typedef enum
55{
56 CRC_REVERSE_INPUT_NO_AFFECTE = 0x00,
57 CRC_REVERSE_INPUT_BY_BYTE = 0x01,
58 CRC_REVERSE_INPUT_BY_HALFWORD = 0x02,
59 CRC_REVERSE_INPUT_BY_WORD = 0x03
60} crc_reverse_input_type;
61
65typedef enum
66{
67 CRC_REVERSE_OUTPUT_NO_AFFECTE = 0x00,
68 CRC_REVERSE_OUTPUT_DATA = 0x01
69} crc_reverse_output_type;
70
74typedef struct
75{
79 union
80 {
81 __IO uint32_t dt;
82 struct
83 {
84 __IO uint32_t dt : 32; /* [31:0] */
85 } dt_bit;
86 };
87
91 union
92 {
93 __IO uint32_t cdt;
94 struct
95 {
96 __IO uint32_t cdt : 8 ; /* [7:0] */
97 __IO uint32_t reserved1 : 24 ;/* [31:8] */
98 } cdt_bit;
99 };
100
104 union
105 {
106 __IO uint32_t ctrl;
107 struct
108 {
109 __IO uint32_t rst : 1 ; /* [0] */
110 __IO uint32_t reserved1 : 4 ; /* [4:1] */
111 __IO uint32_t revid : 2 ; /* [6:5] */
112 __IO uint32_t revod : 1 ; /* [7] */
113 __IO uint32_t reserved2 : 24 ;/* [31:8] */
114 } ctrl_bit;
115 };
116
120 __IO uint32_t reserved1;
121
125 union
126 {
127 __IO uint32_t idt;
128 struct
129 {
130 __IO uint32_t idt : 32; /* [31:0] */
131 } idt_bit;
132 };
133
134} crc_type;
135
140#define CRC ((crc_type *) CRC_BASE)
141
146void crc_data_reset(void);
147uint32_t crc_one_word_calculate(uint32_t data);
148uint32_t crc_block_calculate(uint32_t *pbuffer, uint32_t length);
149uint32_t crc_data_get(void);
150void crc_common_data_set(uint8_t cdt_value);
151uint8_t crc_common_date_get(void);
152void crc_init_data_set(uint32_t value);
153void crc_reverse_input_data_set(crc_reverse_input_type value);
154void crc_reverse_output_data_set(crc_reverse_output_type value);
155
168#ifdef __cplusplus
169}
170#endif
171
172#endif
at32f415.h
at32f415 header file
crc_reverse_input_data_set
void crc_reverse_input_data_set(crc_reverse_input_type value)
control the reversal of the bit order in the input data
Definition: at32f415_crc.c:134
crc_block_calculate
uint32_t crc_block_calculate(uint32_t *pbuffer, uint32_t length)
compute the 32-bit crc of a given buffer of data word(32-bit).
Definition: at32f415_crc.c:72
crc_init_data_set
void crc_init_data_set(uint32_t value)
set the 32-bit initial data of crc
Definition: at32f415_crc.c:119
crc_common_data_set
void crc_common_data_set(uint8_t cdt_value)
store a 8-bit data in the common data register.
Definition: at32f415_crc.c:99
crc_data_reset
void crc_data_reset(void)
reset the crc data register.
Definition: at32f415_crc.c:49
crc_common_date_get
uint8_t crc_common_date_get(void)
return the 8-bit data stored in the common data register
Definition: at32f415_crc.c:109
crc_data_get
uint32_t crc_data_get(void)
return the current crc value.
Definition: at32f415_crc.c:89
crc_one_word_calculate
uint32_t crc_one_word_calculate(uint32_t data)
compute the 32-bit crc of a given data word(32-bit).
Definition: at32f415_crc.c:60
crc_reverse_output_data_set
void crc_reverse_output_data_set(crc_reverse_output_type value)
control the reversal of the bit order in the output data
Definition: at32f415_crc.c:147
crc_reverse_output_type
crc_reverse_output_type
crc reverse output data
Definition: at32f415_crc.h:66
crc_reverse_input_type
crc_reverse_input_type
crc reverse input data
Definition: at32f415_crc.h:55
CRC_REVERSE_OUTPUT_DATA
@ CRC_REVERSE_OUTPUT_DATA
Definition: at32f415_crc.h:68
CRC_REVERSE_OUTPUT_NO_AFFECTE
@ CRC_REVERSE_OUTPUT_NO_AFFECTE
Definition: at32f415_crc.h:67
CRC_REVERSE_INPUT_BY_HALFWORD
@ CRC_REVERSE_INPUT_BY_HALFWORD
Definition: at32f415_crc.h:58
CRC_REVERSE_INPUT_BY_WORD
@ CRC_REVERSE_INPUT_BY_WORD
Definition: at32f415_crc.h:59
CRC_REVERSE_INPUT_BY_BYTE
@ CRC_REVERSE_INPUT_BY_BYTE
Definition: at32f415_crc.h:57
CRC_REVERSE_INPUT_NO_AFFECTE
@ CRC_REVERSE_INPUT_NO_AFFECTE
Definition: at32f415_crc.h:56
crc_type
type define crc register all
Definition: at32f415_crc.h:75
crc_type::ctrl
__IO uint32_t ctrl
Definition: at32f415_crc.h:106
crc_type::cdt
__IO uint32_t cdt
Definition: at32f415_crc.h:93
crc_type::dt
__IO uint32_t dt
Definition: at32f415_crc.h:81
crc_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_crc.h:113
crc_type::rst
__IO uint32_t rst
Definition: at32f415_crc.h:109
crc_type::revod
__IO uint32_t revod
Definition: at32f415_crc.h:112
crc_type::idt
__IO uint32_t idt
Definition: at32f415_crc.h:127
crc_type::reserved1
__IO uint32_t reserved1
crm reserved1 register, offset:0x0C
Definition: at32f415_crc.h:97
crc_type::revid
__IO uint32_t revid
Definition: at32f415_crc.h:111


AT32F415 Firmwary Library: at32f415_crm.c Source File

  • libraries
  • drivers
  • src
at32f415_crm.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef CRM_MODULE_ENABLED
39
49void crm_reset(void)
50{
51 /* reset the crm clock configuration to the default reset state(for debug purpose) */
52 /* set hicken bit */
53 CRM->ctrl_bit.hicken = TRUE;
54
55 /* wait hick stable */
56 while(CRM->ctrl_bit.hickstbl != SET);
57
58 /* hick used as system clock */
59 CRM->cfg_bit.sclksel = CRM_SCLK_HICK;
60
61 /* wait sclk switch status */
62 while(CRM->cfg_bit.sclksts != CRM_SCLK_HICK);
63
64 /* reset cfg register, include sclk switch, ahbdiv, apb1div, apb2div, adcdiv,
65 clkout pllrcs, pllhextdiv, pllmult, usbdiv and pllrange bits */
66 CRM->cfg = 0;
67
68 /* reset pllfr, pllms, pllns and pllfref bits */
69 CRM->pll = (0x00001F10U);
70
71 /* reset hexten, hextbyps, cfden and pllen bits */
72 CRM->ctrl &= ~(0x010D0000U);
73
74 /* reset clkout[3], usbbufs, hickdiv, clkoutdiv */
75 CRM->misc1 = 0x00100000;
76
77 /* disable all interrupts enable and clear pending bits */
78 CRM->clkint = 0x009F0000;
79}
80
86void crm_lext_bypass(confirm_state new_state)
87{
88 CRM->bpdc_bit.lextbyps = new_state;
89}
90
96void crm_hext_bypass(confirm_state new_state)
97{
98 CRM->ctrl_bit.hextbyps = new_state;
99}
100
125 flag_status crm_flag_get(uint32_t flag)
126{
127 flag_status status = RESET;
128 if((CRM_REG(flag) & CRM_REG_BIT(flag)) != CRM_REG_BIT(flag))
129 {
130 status = RESET;
131 }
132 else
133 {
134 status = SET;
135 }
136 return status;
137}
138
144 error_status crm_hext_stable_wait(void)
145{
146 uint32_t stable_cnt = 0;
147 error_status status = ERROR;
148
149 while((crm_flag_get(CRM_HEXT_STABLE_FLAG) != SET) && (stable_cnt < HEXT_STARTUP_TIMEOUT))
150 {
151 stable_cnt ++;
152 }
153
154 if(crm_flag_get(CRM_HEXT_STABLE_FLAG) != SET)
155 {
156 status = ERROR;
157 }
158 else
159 {
160 status = SUCCESS;
161 }
162
163 return status;
164}
165
171void crm_hick_clock_trimming_set(uint8_t trim_value)
172{
173 CRM->ctrl_bit.hicktrim = trim_value;
174}
175
181void crm_hick_clock_calibration_set(uint8_t cali_value)
182{
183 /* enable write hick calibration */
184 CRM->misc1_bit.hickcal_key = 0x5A;
185
186 /* write hick calibration value */
187 CRM->ctrl_bit.hickcal = cali_value;
188
189 /* disable write hick calibration */
190 CRM->misc1_bit.hickcal_key = 0x0;
191}
192
210void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
211{
212 /* enable periph clock */
213 if(TRUE == new_state)
214 {
215 CRM_REG(value) |= CRM_REG_BIT(value);
216 }
217 /* disable periph clock */
218 else
219 {
220 CRM_REG(value) &= ~(CRM_REG_BIT(value));
221 }
222}
223
239void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
240{
241 /* enable periph reset */
242 if(new_state == TRUE)
243 {
244 CRM_REG(value) |= (CRM_REG_BIT(value));
245 }
246 /* disable periph reset */
247 else
248 {
249 CRM_REG(value) &= ~(CRM_REG_BIT(value));
250 }
251}
252
262void crm_periph_sleep_mode_clock_enable(crm_periph_clock_sleepmd_type value, confirm_state new_state)
263{
264 /* enable periph clock in sleep mode */
265 if(new_state == TRUE)
266 {
267 CRM_REG(value) |= (CRM_REG_BIT(value));
268 }
269 /* disable perph clock in sleep mode */
270 else
271 {
272 CRM_REG(value) &= ~(CRM_REG_BIT(value));
273 }
274
275}
276
289void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
290{
291 switch(source)
292 {
293 case CRM_CLOCK_SOURCE_HICK:
294 CRM->ctrl_bit.hicken = new_state;
295 break;
296 case CRM_CLOCK_SOURCE_HEXT:
297 CRM->ctrl_bit.hexten = new_state;
298 break;
299 case CRM_CLOCK_SOURCE_PLL:
300 CRM->ctrl_bit.pllen = new_state;
301 break;
302 case CRM_CLOCK_SOURCE_LEXT:
303 CRM->bpdc_bit.lexten = new_state;
304 break;
305 case CRM_CLOCK_SOURCE_LICK:
306 CRM->ctrlsts_bit.licken = new_state;
307 break;
308 default:
309 break;
310 }
311}
312
333void crm_flag_clear(uint32_t flag)
334{
335 switch(flag)
336 {
337 case CRM_NRST_RESET_FLAG:
338 case CRM_POR_RESET_FLAG:
339 case CRM_SW_RESET_FLAG:
340 case CRM_WDT_RESET_FLAG:
341 case CRM_WWDT_RESET_FLAG:
342 case CRM_LOWPOWER_RESET_FLAG:
343 CRM->ctrlsts_bit.rstfc = TRUE;
344 break;
345 case CRM_LICK_READY_INT_FLAG:
346 CRM->clkint_bit.lickstblfc = TRUE;
347 break;
348 case CRM_LEXT_READY_INT_FLAG:
349 CRM->clkint_bit.lextstblfc = TRUE;
350 break;
351 case CRM_HICK_READY_INT_FLAG:
352 CRM->clkint_bit.hickstblfc = TRUE;
353 break;
354 case CRM_HEXT_READY_INT_FLAG:
355 CRM->clkint_bit.hextstblfc = TRUE;
356 break;
357 case CRM_PLL_READY_INT_FLAG:
358 CRM->clkint_bit.pllstblfc = TRUE;
359 break;
360 case CRM_CLOCK_FAILURE_INT_FLAG:
361 CRM->clkint_bit.cfdfc = TRUE;
362 break;
363 default:
364 break;
365 }
366}
367
377void crm_ertc_clock_select(crm_ertc_clock_type value)
378{
379 CRM->bpdc_bit.ertcsel = value;
380}
381
387void crm_ertc_clock_enable(confirm_state new_state)
388{
389 CRM->bpdc_bit.ertcen = new_state;
390}
391
407void crm_ahb_div_set(crm_ahb_div_type value)
408{
409 CRM->cfg_bit.ahbdiv = value;
410}
411
423void crm_apb1_div_set(crm_apb1_div_type value)
424{
425 CRM->cfg_bit.apb1div = value;
426}
427
439void crm_apb2_div_set(crm_apb2_div_type value)
440{
441 CRM->cfg_bit.apb2div = value;
442}
443
456void crm_adc_clock_div_set(crm_adc_div_type div_value)
457{
458 CRM->cfg_bit.adcdiv_l = div_value & 0x03;
459 CRM->cfg_bit.adcdiv_h = (div_value >> 2) & 0x01;
460}
461
475void crm_usb_clock_div_set(crm_usb_div_type div_value)
476{
477 CRM->cfg_bit.usbdiv_l = div_value & 0x03;
478 CRM->cfg_bit.usbdiv_h = (div_value >> 2) & 0x01;
479}
480
486void crm_clock_failure_detection_enable(confirm_state new_state)
487{
488 CRM->ctrl_bit.cfden = new_state;
489}
490
496void crm_battery_powered_domain_reset(confirm_state new_state)
497{
498 CRM->bpdc_bit.bpdrst = new_state;
499}
500
511void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
512{
513 uint32_t pllrcfreq = 0;
514 crm_pll_fref_type pllfref = CRM_PLL_FREF_4M;
515
516 /* config pll clock source */
517 if(clock_source == CRM_PLL_SOURCE_HICK)
518 {
519 CRM->cfg_bit.pllrcs = FALSE;
520 pllrcfreq = (HICK_VALUE / 2);
521 }
522 else
523 {
524 CRM->cfg_bit.pllrcs = TRUE;
525 if(CRM_PLL_SOURCE_HEXT == clock_source)
526 {
527 pllrcfreq = HEXT_VALUE;
528 CRM->cfg_bit.pllhextdiv = FALSE;
529 }
530 else
531 {
532 pllrcfreq = (HEXT_VALUE / 2);
533 CRM->cfg_bit.pllhextdiv = TRUE;
534 }
535 }
536
537 if((pllrcfreq > 3900000U) && (pllrcfreq < 5000000U))
538 {
539 pllfref = CRM_PLL_FREF_4M;
540 }
541 else if((pllrcfreq > 5200000U) && (pllrcfreq < 6250000U))
542 {
543 pllfref = CRM_PLL_FREF_6M;
544 }
545 else if((pllrcfreq > 7812500U) && (pllrcfreq < 8330000U))
546 {
547 pllfref = CRM_PLL_FREF_8M;
548 }
549 else if((pllrcfreq > 8330000U) && (pllrcfreq < 12500000U))
550 {
551 pllfref = CRM_PLL_FREF_12M;
552 }
553 else if((pllrcfreq > 15625000U) && (pllrcfreq < 20830000U))
554 {
555 pllfref = CRM_PLL_FREF_16M;
556 }
557 else if((pllrcfreq > 20830000U) && (pllrcfreq < 31255000U))
558 {
559 pllfref = CRM_PLL_FREF_25M;
560 }
561
562 /* config pll multiplication factor */
563 CRM->cfg_bit.pllmult_l = (mult_value & 0x0F);
564 CRM->cfg_bit.pllmult_h = ((mult_value & 0x30) >> 4);
565
566 /* config pll fref */
567 CRM->pll_bit.pllfref = pllfref;
568}
569
603void crm_pll_config2(crm_pll_clock_source_type clock_source, uint16_t pll_ns, \
604 uint16_t pll_ms, crm_pll_fr_type pll_fr)
605{
606 /* config pll clock source */
607 if(clock_source == CRM_PLL_SOURCE_HICK)
608 {
609 CRM->cfg_bit.pllrcs = FALSE;
610 }
611 else
612 {
613 CRM->cfg_bit.pllrcs = TRUE;
614 if(clock_source == CRM_PLL_SOURCE_HEXT)
615 {
616 CRM->cfg_bit.pllhextdiv = FALSE;
617 }
618 else
619 {
620 CRM->cfg_bit.pllhextdiv = TRUE;
621 }
622 }
623
624 /* config pll multiplication factor */
625 CRM->pll_bit.pllns = pll_ns;
626 CRM->pll_bit.pllms = pll_ms;
627 CRM->pll_bit.pllfr = pll_fr;
628
629 CRM->pll_bit.pllcfgen = TRUE;
630}
631
641void crm_sysclk_switch(crm_sclk_type value)
642{
643 CRM->cfg_bit.sclksel = value;
644}
645
655 crm_sclk_type crm_sysclk_switch_status_get(void)
656{
657 return (crm_sclk_type)CRM->cfg_bit.sclksts;
658}
659
666void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
667{
668 uint32_t pll_mult = 0, pll_mult_h = 0, pll_clock_source = 0, temp = 0, div_value = 0;
669 uint32_t pllrcsfreq = 0, pll_ms = 0, pll_ns = 0, pll_fr = 0;
670 crm_sclk_type sclk_source;
671
672 static const uint8_t sclk_ahb_div_table[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
673 static const uint8_t ahb_apb1_div_table[8] = {0, 0, 0, 0, 1, 2, 3, 4};
674 static const uint8_t ahb_apb2_div_table[8] = {0, 0, 0, 0, 1, 2, 3, 4};
675 static const uint8_t adc_div_table[8] = {2, 4, 6, 8, 2, 12, 8, 16};
676
677 /* get sclk source */
678 sclk_source = crm_sysclk_switch_status_get();
679
680 switch(sclk_source)
681 {
682 case CRM_SCLK_HICK:
683 if(((CRM->misc2_bit.hick_to_sclk) != RESET) && ((CRM->misc1_bit.hickdiv) != RESET))
684 clocks_struct->sclk_freq = HICK_VALUE * 6;
685 else
686 clocks_struct->sclk_freq = HICK_VALUE;
687 break;
688 case CRM_SCLK_HEXT:
689 clocks_struct->sclk_freq = HEXT_VALUE;
690 break;
691 case CRM_SCLK_PLL:
692 pll_clock_source = CRM->cfg_bit.pllrcs;
693 if(CRM->pll_bit.pllcfgen == FALSE)
694 {
695 /* get multiplication factor */
696 pll_mult = CRM->cfg_bit.pllmult_l;
697 pll_mult_h = CRM->cfg_bit.pllmult_h;
698
699 /* process high bits */
700 if((pll_mult_h != 0U) || (pll_mult == 15U))
701 {
702 pll_mult += ((16U * pll_mult_h) + 1U);
703 }
704 else
705 {
706 pll_mult += 2U;
707 }
708
709 if (pll_clock_source == 0x00)
710 {
711 /* hick divided by 2 selected as pll clock entry */
712 clocks_struct->sclk_freq = (HICK_VALUE >> 1) * pll_mult;
713 }
714 else
715 {
716 /* hext selected as pll clock entry */
717 if (CRM->cfg_bit.pllhextdiv != RESET)
718 {
719 /* hext clock divided by 2 */
720 clocks_struct->sclk_freq = (HEXT_VALUE / 2) * pll_mult;
721 }
722 else
723 {
724 clocks_struct->sclk_freq = HEXT_VALUE * pll_mult;
725 }
726 }
727 }
728 else
729 {
730 pll_ms = CRM->pll_bit.pllms;
731 pll_ns = CRM->pll_bit.pllns;
732 pll_fr = CRM->pll_bit.pllfr;
733
734 if (pll_clock_source == 0x00)
735 {
736 /* hick divided by 2 selected as pll clock entry */
737 pllrcsfreq = (HICK_VALUE >> 1);
738 }
739 else
740 {
741 /* hext selected as pll clock entry */
742 if (CRM->cfg_bit.pllhextdiv != RESET)
743 {
744 /* hext clock divided by 2 */
745 pllrcsfreq = (HEXT_VALUE / 2);
746 }
747 else
748 {
749 pllrcsfreq = HEXT_VALUE;
750 }
751 }
752 clocks_struct->sclk_freq = (pllrcsfreq * pll_ns) / (pll_ms * (0x1 << pll_fr));
753 }
754 break;
755 default:
756 clocks_struct->sclk_freq = HICK_VALUE;
757 break;
758 }
759
760 /* compute sclk, ahbclk, abp1clk apb2clk and adcclk frequencies */
761 /* get ahb division */
762 temp = CRM->cfg_bit.ahbdiv;
763 div_value = sclk_ahb_div_table[temp];
764 /* ahbclk frequency */
765 clocks_struct->ahb_freq = clocks_struct->sclk_freq >> div_value;
766
767 /* get apb1 division */
768 temp = CRM->cfg_bit.apb1div;
769 div_value = ahb_apb1_div_table[temp];
770 /* apb1clk frequency */
771 clocks_struct->apb1_freq = clocks_struct->ahb_freq >> div_value;
772
773 /* get apb2 division */
774 temp = CRM->cfg_bit.apb2div;
775 div_value = ahb_apb2_div_table[temp];
776 /* apb2clk frequency */
777 clocks_struct->apb2_freq = clocks_struct->ahb_freq >> div_value;
778
779 /* get adc division */
780 temp = CRM->cfg_bit.adcdiv_h;
781 temp = ((temp << 2) | (CRM->cfg_bit.adcdiv_l));
782 div_value = adc_div_table[temp];
783 /* adcclk clock frequency */
784 clocks_struct->adc_freq = clocks_struct->apb2_freq / div_value;
785}
786
803void crm_clock_out_set(crm_clkout_select_type clkout)
804{
805 CRM->cfg_bit.clkout_sel = clkout & 0x7;
806 CRM->misc1_bit.clkout_sel = (clkout >> 3) & 0x1;
807}
808
821void crm_interrupt_enable(uint32_t crm_int, confirm_state new_state)
822{
823 if(new_state == TRUE)
824 CRM->clkint |= crm_int;
825 else
826 CRM->clkint &= ~crm_int;
827}
828
834void crm_auto_step_mode_enable(confirm_state new_state)
835{
836 if(new_state == TRUE)
837 CRM->misc2_bit.auto_step_en = CRM_AUTO_STEP_MODE_ENABLE;
838 else
839 CRM->misc2_bit.auto_step_en = CRM_AUTO_STEP_MODE_DISABLE;
840}
841
850void crm_hick_divider_select(crm_hick_div_6_type value)
851{
852 CRM->misc1_bit.hickdiv = value;
853}
854
863void crm_hick_sclk_frequency_select(crm_hick_sclk_frequency_type value)
864{
865 crm_hick_divider_select(CRM_HICK48_NODIV);
866 CRM->misc2_bit.hick_to_sclk = value;
867}
868
877void crm_usb_clock_source_select(crm_usb_clock_source_type value)
878{
879 if(value == CRM_USB_CLOCK_SOURCE_HICK)
880 {
881 crm_hick_sclk_frequency_select(CRM_HICK_SCLK_48MHZ);
882 }
883 CRM->misc2_bit.hick_to_usb = value;
884}
885
901void crm_clkout_div_set(crm_clkout_div_type clkout_div)
902{
903 CRM->misc1_bit.clkoutdiv = clkout_div;
904}
905
915void crm_otgfs_ep3_remap_enable(confirm_state new_state)
916{
917 CRM->otg_extctrl_bit.ep3_rmpen = new_state;
918}
919
930void crm_usbdiv_reset(confirm_state new_state)
931{
932 CRM->otg_extctrl_bit.usbdivrst = new_state;
933}
934
939#endif
940
div_value
uint16_t div_value
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:44
crm_periph_clock_type
crm_periph_clock_type
crm periph clock
Definition: at32f415_crm.h:101
crm_hick_sclk_frequency_type
crm_hick_sclk_frequency_type
crm hick as system clock frequency select
Definition: at32f415_crm.h:462
crm_apb1_div_type
crm_apb1_div_type
crm apb1 division
Definition: at32f415_crm.h:330
crm_clock_source_type
crm_clock_source_type
crm clock source
Definition: at32f415_crm.h:302
crm_usb_div_type
crm_usb_div_type
crm usb division
Definition: at32f415_crm.h:367
crm_clkout_div_type
crm_clkout_div_type
crm clkout division
Definition: at32f415_crm.h:428
crm_usb_clock_source_type
crm_usb_clock_source_type
crm usb 48 mhz clock source select
Definition: at32f415_crm.h:453
crm_periph_clock_sleepmd_type
crm_periph_clock_sleepmd_type
crm periph clock in sleep mode
Definition: at32f415_crm.h:186
crm_pll_fref_type
crm_pll_fref_type
crm pll fref_x
Definition: at32f415_crm.h:266
crm_pll_clock_source_type
crm_pll_clock_source_type
crm pll clock source
Definition: at32f415_crm.h:279
crm_pll_mult_type
crm_pll_mult_type
crm pll mult_x
Definition: at32f415_crm.h:196
crm_ahb_div_type
crm_ahb_div_type
crm ahb division
Definition: at32f415_crm.h:314
crm_adc_div_type
crm_adc_div_type
crm adc division
Definition: at32f415_crm.h:354
crm_clkout_select_type
crm_clkout_select_type
crm clkout select
Definition: at32f415_crm.h:411
crm_sclk_type
crm_sclk_type
crm sclk select
Definition: at32f415_crm.h:401
crm_periph_reset_type
crm_periph_reset_type
crm periph reset
Definition: at32f415_crm.h:145
crm_apb2_div_type
crm_apb2_div_type
crm apb2 division
Definition: at32f415_crm.h:342
crm_ertc_clock_type
crm_ertc_clock_type
crm ertc clock
Definition: at32f415_crm.h:381
crm_pll_fr_type
crm_pll_fr_type
crm pll fr
Definition: at32f415_crm.h:289
crm_hick_div_6_type
crm_hick_div_6_type
crm hick 48mhz division
Definition: at32f415_crm.h:392
CRM_HICK_SCLK_48MHZ
@ CRM_HICK_SCLK_48MHZ
Definition: at32f415_crm.h:464
CRM_CLOCK_SOURCE_HICK
@ CRM_CLOCK_SOURCE_HICK
Definition: at32f415_crm.h:303
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_LEXT
@ CRM_CLOCK_SOURCE_LEXT
Definition: at32f415_crm.h:306
CRM_CLOCK_SOURCE_LICK
@ CRM_CLOCK_SOURCE_LICK
Definition: at32f415_crm.h:307
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_USB_CLOCK_SOURCE_HICK
@ CRM_USB_CLOCK_SOURCE_HICK
Definition: at32f415_crm.h:455
CRM_PLL_FREF_16M
@ CRM_PLL_FREF_16M
Definition: at32f415_crm.h:271
CRM_PLL_FREF_6M
@ CRM_PLL_FREF_6M
Definition: at32f415_crm.h:268
CRM_PLL_FREF_4M
@ CRM_PLL_FREF_4M
Definition: at32f415_crm.h:267
CRM_PLL_FREF_25M
@ CRM_PLL_FREF_25M
Definition: at32f415_crm.h:272
CRM_PLL_FREF_8M
@ CRM_PLL_FREF_8M
Definition: at32f415_crm.h:269
CRM_PLL_FREF_12M
@ CRM_PLL_FREF_12M
Definition: at32f415_crm.h:270
CRM_PLL_SOURCE_HEXT
@ CRM_PLL_SOURCE_HEXT
Definition: at32f415_crm.h:281
CRM_PLL_SOURCE_HICK
@ CRM_PLL_SOURCE_HICK
Definition: at32f415_crm.h:280
CRM_AUTO_STEP_MODE_ENABLE
@ CRM_AUTO_STEP_MODE_ENABLE
Definition: at32f415_crm.h:446
CRM_AUTO_STEP_MODE_DISABLE
@ CRM_AUTO_STEP_MODE_DISABLE
Definition: at32f415_crm.h:445
CRM_SCLK_HICK
@ CRM_SCLK_HICK
Definition: at32f415_crm.h:402
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_SCLK_HEXT
@ CRM_SCLK_HEXT
Definition: at32f415_crm.h:403
CRM_HICK48_NODIV
@ CRM_HICK48_NODIV
Definition: at32f415_crm.h:394
CRM_PLL_READY_INT_FLAG
#define CRM_PLL_READY_INT_FLAG
Definition: at32f415_crm.h:70
CRM_HEXT_READY_INT_FLAG
#define CRM_HEXT_READY_INT_FLAG
Definition: at32f415_crm.h:69
CRM_LOWPOWER_RESET_FLAG
#define CRM_LOWPOWER_RESET_FLAG
Definition: at32f415_crm.h:65
CRM_CLOCK_FAILURE_INT_FLAG
#define CRM_CLOCK_FAILURE_INT_FLAG
Definition: at32f415_crm.h:71
CRM_HICK_READY_INT_FLAG
#define CRM_HICK_READY_INT_FLAG
Definition: at32f415_crm.h:68
CRM_LEXT_READY_INT_FLAG
#define CRM_LEXT_READY_INT_FLAG
Definition: at32f415_crm.h:67
CRM_POR_RESET_FLAG
#define CRM_POR_RESET_FLAG
Definition: at32f415_crm.h:61
CRM_HEXT_STABLE_FLAG
#define CRM_HEXT_STABLE_FLAG
Definition: at32f415_crm.h:56
CRM_SW_RESET_FLAG
#define CRM_SW_RESET_FLAG
Definition: at32f415_crm.h:62
CRM_NRST_RESET_FLAG
#define CRM_NRST_RESET_FLAG
Definition: at32f415_crm.h:60
CRM_WWDT_RESET_FLAG
#define CRM_WWDT_RESET_FLAG
Definition: at32f415_crm.h:64
CRM_LICK_READY_INT_FLAG
#define CRM_LICK_READY_INT_FLAG
Definition: at32f415_crm.h:66
CRM_WDT_RESET_FLAG
#define CRM_WDT_RESET_FLAG
Definition: at32f415_crm.h:63
crm_pll_config2
void crm_pll_config2(crm_pll_clock_source_type clock_source, uint16_t pll_ns, uint16_t pll_ms, crm_pll_fr_type pll_fr)
config crm pll function2, another method. pll_rcs_freq * pll_ns pll clock = -------------------------...
Definition: at32f415_crm.c:603
crm_periph_sleep_mode_clock_enable
void crm_periph_sleep_mode_clock_enable(crm_periph_clock_sleepmd_type value, confirm_state new_state)
enable or disable the peripheral clock in sleep mode
Definition: at32f415_crm.c:262
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hick_clock_calibration_set
void crm_hick_clock_calibration_set(uint8_t cali_value)
set the crm calibration value
Definition: at32f415_crm.c:181
crm_clkout_div_set
void crm_clkout_div_set(crm_clkout_div_type clkout_div)
set crm clkout division
Definition: at32f415_crm.c:901
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_interrupt_enable
void crm_interrupt_enable(uint32_t crm_int, confirm_state new_state)
config crm interrupt
Definition: at32f415_crm.c:821
crm_flag_clear
void crm_flag_clear(uint32_t flag)
clear the crm reset flags
Definition: at32f415_crm.c:333
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_lext_bypass
void crm_lext_bypass(confirm_state new_state)
enable or disable crm low speed external crystal bypass
Definition: at32f415_crm.c:86
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_ertc_clock_select
void crm_ertc_clock_select(crm_ertc_clock_type value)
select ertc clock
Definition: at32f415_crm.c:377
crm_hick_sclk_frequency_select
void crm_hick_sclk_frequency_select(crm_hick_sclk_frequency_type value)
hick as system clock frequency select
Definition: at32f415_crm.c:863
crm_hick_divider_select
void crm_hick_divider_select(crm_hick_div_6_type value)
config hick divider select
Definition: at32f415_crm.c:850
crm_usbdiv_reset
void crm_usbdiv_reset(confirm_state new_state)
usb divider reset, only available in at32f415xx revision C. at32f415xx revision B: (not support) usb ...
Definition: at32f415_crm.c:930
crm_adc_clock_div_set
void crm_adc_clock_div_set(crm_adc_div_type div_value)
set crm adc division
Definition: at32f415_crm.c:456
crm_clock_out_set
void crm_clock_out_set(crm_clkout_select_type clkout)
set crm clkout
Definition: at32f415_crm.c:803
crm_clock_failure_detection_enable
void crm_clock_failure_detection_enable(confirm_state new_state)
enable or disable clock failure detection
Definition: at32f415_crm.c:486
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
crm_otgfs_ep3_remap_enable
void crm_otgfs_ep3_remap_enable(confirm_state new_state)
enable or disable otgfs end-point3 remap, only available in at32f415xx revision C....
Definition: at32f415_crm.c:915
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_hick_clock_trimming_set
void crm_hick_clock_trimming_set(uint8_t trim_value)
set the hick trimming value
Definition: at32f415_crm.c:171
crm_ertc_clock_enable
void crm_ertc_clock_enable(confirm_state new_state)
enable or disable ertc
Definition: at32f415_crm.c:387
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
crm_battery_powered_domain_reset
void crm_battery_powered_domain_reset(confirm_state new_state)
battery powered domain software reset
Definition: at32f415_crm.c:496
crm_usb_clock_source_select
void crm_usb_clock_source_select(crm_usb_clock_source_type value)
usb 48 mhz clock source select
Definition: at32f415_crm.c:877
crm_hext_bypass
void crm_hext_bypass(confirm_state new_state)
enable or disable crm high speed external crystal bypass
Definition: at32f415_crm.c:96
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_REG_BIT
#define CRM_REG_BIT(value)
Definition: at32f415_crm.h:48
CRM
#define CRM
Definition: at32f415_crm.h:858
CRM_REG
#define CRM_REG(value)
Definition: at32f415_crm.h:47
error_status
error_status
error status
Definition: at32f415.h:258
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
HEXT_VALUE
#define HEXT_VALUE
in the following line adjust the value of high speed exernal crystal (hext) used in your application ...
Definition: project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h:42
HICK_VALUE
#define HICK_VALUE
Definition: project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h:50
HEXT_STARTUP_TIMEOUT
#define HEXT_STARTUP_TIMEOUT
in the following line adjust the high speed exernal crystal (hext) startup timeout value
Definition: project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h:49
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::adc_freq
uint32_t adc_freq
Definition: at32f415_crm.h:476
crm_clocks_freq_type::apb1_freq
uint32_t apb1_freq
Definition: at32f415_crm.h:475
crm_clocks_freq_type::apb2_freq
uint32_t apb2_freq
Definition: at32f415_crm.h:474
crm_clocks_freq_type::sclk_freq
uint32_t sclk_freq
Definition: at32f415_crm.h:472
crm_clocks_freq_type::ahb_freq
uint32_t ahb_freq
Definition: at32f415_crm.h:473
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_crm.h Source File

  • libraries
  • drivers
  • inc
at32f415_crm.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CRM_H
29#define __AT32F415_CRM_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
47#define CRM_REG(value) PERIPH_REG(CRM_BASE, value)
48#define CRM_REG_BIT(value) PERIPH_REG_BIT(value)
49
55#define CRM_HICK_STABLE_FLAG MAKE_VALUE(0x00, 1)
56#define CRM_HEXT_STABLE_FLAG MAKE_VALUE(0x00, 17)
57#define CRM_PLL_STABLE_FLAG MAKE_VALUE(0x00, 25)
58#define CRM_LEXT_STABLE_FLAG MAKE_VALUE(0x20, 1)
59#define CRM_LICK_STABLE_FLAG MAKE_VALUE(0x24, 1)
60#define CRM_NRST_RESET_FLAG MAKE_VALUE(0x24, 26)
61#define CRM_POR_RESET_FLAG MAKE_VALUE(0x24, 27)
62#define CRM_SW_RESET_FLAG MAKE_VALUE(0x24, 28)
63#define CRM_WDT_RESET_FLAG MAKE_VALUE(0x24, 29)
64#define CRM_WWDT_RESET_FLAG MAKE_VALUE(0x24, 30)
65#define CRM_LOWPOWER_RESET_FLAG MAKE_VALUE(0x24, 31)
66#define CRM_LICK_READY_INT_FLAG MAKE_VALUE(0x08, 0)
67#define CRM_LEXT_READY_INT_FLAG MAKE_VALUE(0x08, 1)
68#define CRM_HICK_READY_INT_FLAG MAKE_VALUE(0x08, 2)
69#define CRM_HEXT_READY_INT_FLAG MAKE_VALUE(0x08, 3)
70#define CRM_PLL_READY_INT_FLAG MAKE_VALUE(0x08, 4)
71#define CRM_CLOCK_FAILURE_INT_FLAG MAKE_VALUE(0x08, 7)
82#define CRM_LICK_STABLE_INT ((uint32_t)0x00000100)
83#define CRM_LEXT_STABLE_INT ((uint32_t)0x00000200)
84#define CRM_HICK_STABLE_INT ((uint32_t)0x00000400)
85#define CRM_HEXT_STABLE_INT ((uint32_t)0x00000800)
86#define CRM_PLL_STABLE_INT ((uint32_t)0x00001000)
87#define CRM_CLOCK_FAILURE_INT ((uint32_t)0x00800000)
100typedef enum
101{
102 /* ahb periph */
103 CRM_DMA1_PERIPH_CLOCK = MAKE_VALUE(0x14, 0),
104 CRM_DMA2_PERIPH_CLOCK = MAKE_VALUE(0x14, 1),
105 CRM_CRC_PERIPH_CLOCK = MAKE_VALUE(0x14, 6),
106 CRM_SDIO1_PERIPH_CLOCK = MAKE_VALUE(0x14, 10),
107 CRM_OTGFS1_PERIPH_CLOCK = MAKE_VALUE(0x14, 12),
108 /* apb2 periph */
109 CRM_IOMUX_PERIPH_CLOCK = MAKE_VALUE(0x18, 0),
110 CRM_GPIOA_PERIPH_CLOCK = MAKE_VALUE(0x18, 2),
111 CRM_GPIOB_PERIPH_CLOCK = MAKE_VALUE(0x18, 3),
112 CRM_GPIOC_PERIPH_CLOCK = MAKE_VALUE(0x18, 4),
113 CRM_GPIOD_PERIPH_CLOCK = MAKE_VALUE(0x18, 5),
114 CRM_GPIOF_PERIPH_CLOCK = MAKE_VALUE(0x18, 7),
115 CRM_ADC1_PERIPH_CLOCK = MAKE_VALUE(0x18, 9),
116 CRM_TMR1_PERIPH_CLOCK = MAKE_VALUE(0x18, 11),
117 CRM_SPI1_PERIPH_CLOCK = MAKE_VALUE(0x18, 12),
118 CRM_USART1_PERIPH_CLOCK = MAKE_VALUE(0x18, 14),
119 CRM_TMR9_PERIPH_CLOCK = MAKE_VALUE(0x18, 19),
120 CRM_TMR10_PERIPH_CLOCK = MAKE_VALUE(0x18, 20),
121 CRM_TMR11_PERIPH_CLOCK = MAKE_VALUE(0x18, 21),
122 /* apb1 periph */
123 CRM_TMR2_PERIPH_CLOCK = MAKE_VALUE(0x1C, 0),
124 CRM_TMR3_PERIPH_CLOCK = MAKE_VALUE(0x1C, 1),
125 CRM_TMR4_PERIPH_CLOCK = MAKE_VALUE(0x1C, 2),
126 CRM_TMR5_PERIPH_CLOCK = MAKE_VALUE(0x1C, 3),
127 CRM_CMP_PERIPH_CLOCK = MAKE_VALUE(0x1C, 9),
128 CRM_WWDT_PERIPH_CLOCK = MAKE_VALUE(0x1C, 11),
129 CRM_SPI2_PERIPH_CLOCK = MAKE_VALUE(0x1C, 14),
130 CRM_USART2_PERIPH_CLOCK = MAKE_VALUE(0x1C, 17),
131 CRM_USART3_PERIPH_CLOCK = MAKE_VALUE(0x1C, 18),
132 CRM_UART4_PERIPH_CLOCK = MAKE_VALUE(0x1C, 19),
133 CRM_UART5_PERIPH_CLOCK = MAKE_VALUE(0x1C, 20),
134 CRM_I2C1_PERIPH_CLOCK = MAKE_VALUE(0x1C, 21),
135 CRM_I2C2_PERIPH_CLOCK = MAKE_VALUE(0x1C, 22),
136 CRM_CAN1_PERIPH_CLOCK = MAKE_VALUE(0x1C, 25),
137 CRM_PWC_PERIPH_CLOCK = MAKE_VALUE(0x1C, 28),
139} crm_periph_clock_type;
140
144typedef enum
145{
146 /* ahb periph */
147 CRM_OTGFS1_PERIPH_RESET = MAKE_VALUE(0x28, 12),
148 /* apb2 periph */
149 CRM_IOMUX_PERIPH_RESET = MAKE_VALUE(0x0C, 0),
150 CRM_EXINT_PERIPH_RESET = MAKE_VALUE(0x0C, 1),
151 CRM_GPIOA_PERIPH_RESET = MAKE_VALUE(0x0C, 2),
152 CRM_GPIOB_PERIPH_RESET = MAKE_VALUE(0x0C, 3),
153 CRM_GPIOC_PERIPH_RESET = MAKE_VALUE(0x0C, 4),
154 CRM_GPIOD_PERIPH_RESET = MAKE_VALUE(0x0C, 5),
155 CRM_GPIOF_PERIPH_RESET = MAKE_VALUE(0x0C, 7),
156 CRM_ADC1_PERIPH_RESET = MAKE_VALUE(0x0C, 9),
157 CRM_TMR1_PERIPH_RESET = MAKE_VALUE(0x0C, 11),
158 CRM_SPI1_PERIPH_RESET = MAKE_VALUE(0x0C, 12),
159 CRM_USART1_PERIPH_RESET = MAKE_VALUE(0x0C, 14),
160 CRM_TMR9_PERIPH_RESET = MAKE_VALUE(0x0C, 19),
161 CRM_TMR10_PERIPH_RESET = MAKE_VALUE(0x0C, 20),
162 CRM_TMR11_PERIPH_RESET = MAKE_VALUE(0x0C, 21),
163 /* apb1 periph */
164 CRM_TMR2_PERIPH_RESET = MAKE_VALUE(0x10, 0),
165 CRM_TMR3_PERIPH_RESET = MAKE_VALUE(0x10, 1),
166 CRM_TMR4_PERIPH_RESET = MAKE_VALUE(0x10, 2),
167 CRM_TMR5_PERIPH_RESET = MAKE_VALUE(0x10, 3),
168 CRM_CMP_PERIPH_RESET = MAKE_VALUE(0x10, 9),
169 CRM_WWDT_PERIPH_RESET = MAKE_VALUE(0x10, 11),
170 CRM_SPI2_PERIPH_RESET = MAKE_VALUE(0x10, 14),
171 CRM_USART2_PERIPH_RESET = MAKE_VALUE(0x10, 17),
172 CRM_USART3_PERIPH_RESET = MAKE_VALUE(0x10, 18),
173 CRM_UART4_PERIPH_RESET = MAKE_VALUE(0x10, 19),
174 CRM_UART5_PERIPH_RESET = MAKE_VALUE(0x10, 20),
175 CRM_I2C1_PERIPH_RESET = MAKE_VALUE(0x10, 21),
176 CRM_I2C2_PERIPH_RESET = MAKE_VALUE(0x10, 22),
177 CRM_CAN1_PERIPH_RESET = MAKE_VALUE(0x10, 25),
178 CRM_PWC_PERIPH_RESET = MAKE_VALUE(0x10, 28),
180} crm_periph_reset_type;
181
185typedef enum
186{
187 /* ahb periph */
188 CRM_SRAM_PERIPH_CLOCK_SLEEP_MODE = MAKE_VALUE(0x14, 2),
189 CRM_FLASH_PERIPH_CLOCK_SLEEP_MODE = MAKE_VALUE(0x14, 4)
190} crm_periph_clock_sleepmd_type;
191
195typedef enum
196{
197 CRM_PLL_MULT_2 = 0,
198 CRM_PLL_MULT_3 = 1,
199 CRM_PLL_MULT_4 = 2,
200 CRM_PLL_MULT_5 = 3,
201 CRM_PLL_MULT_6 = 4,
202 CRM_PLL_MULT_7 = 5,
203 CRM_PLL_MULT_8 = 6,
204 CRM_PLL_MULT_9 = 7,
205 CRM_PLL_MULT_10 = 8,
206 CRM_PLL_MULT_11 = 9,
207 CRM_PLL_MULT_12 = 10,
208 CRM_PLL_MULT_13 = 11,
209 CRM_PLL_MULT_14 = 12,
210 CRM_PLL_MULT_15 = 13,
211 CRM_PLL_MULT_16 = 15,
212 CRM_PLL_MULT_17 = 16,
213 CRM_PLL_MULT_18 = 17,
214 CRM_PLL_MULT_19 = 18,
215 CRM_PLL_MULT_20 = 19,
216 CRM_PLL_MULT_21 = 20,
217 CRM_PLL_MULT_22 = 21,
218 CRM_PLL_MULT_23 = 22,
219 CRM_PLL_MULT_24 = 23,
220 CRM_PLL_MULT_25 = 24,
221 CRM_PLL_MULT_26 = 25,
222 CRM_PLL_MULT_27 = 26,
223 CRM_PLL_MULT_28 = 27,
224 CRM_PLL_MULT_29 = 28,
225 CRM_PLL_MULT_30 = 29,
226 CRM_PLL_MULT_31 = 30,
227 CRM_PLL_MULT_32 = 31,
228 CRM_PLL_MULT_33 = 32,
229 CRM_PLL_MULT_34 = 33,
230 CRM_PLL_MULT_35 = 34,
231 CRM_PLL_MULT_36 = 35,
232 CRM_PLL_MULT_37 = 36,
233 CRM_PLL_MULT_38 = 37,
234 CRM_PLL_MULT_39 = 38,
235 CRM_PLL_MULT_40 = 39,
236 CRM_PLL_MULT_41 = 40,
237 CRM_PLL_MULT_42 = 41,
238 CRM_PLL_MULT_43 = 42,
239 CRM_PLL_MULT_44 = 43,
240 CRM_PLL_MULT_45 = 44,
241 CRM_PLL_MULT_46 = 45,
242 CRM_PLL_MULT_47 = 46,
243 CRM_PLL_MULT_48 = 47,
244 CRM_PLL_MULT_49 = 48,
245 CRM_PLL_MULT_50 = 49,
246 CRM_PLL_MULT_51 = 50,
247 CRM_PLL_MULT_52 = 51,
248 CRM_PLL_MULT_53 = 52,
249 CRM_PLL_MULT_54 = 53,
250 CRM_PLL_MULT_55 = 54,
251 CRM_PLL_MULT_56 = 55,
252 CRM_PLL_MULT_57 = 56,
253 CRM_PLL_MULT_58 = 57,
254 CRM_PLL_MULT_59 = 58,
255 CRM_PLL_MULT_60 = 59,
256 CRM_PLL_MULT_61 = 60,
257 CRM_PLL_MULT_62 = 61,
258 CRM_PLL_MULT_63 = 62,
259 CRM_PLL_MULT_64 = 63
260} crm_pll_mult_type;
261
265typedef enum
266{
267 CRM_PLL_FREF_4M = 0,
268 CRM_PLL_FREF_6M = 1,
269 CRM_PLL_FREF_8M = 2,
270 CRM_PLL_FREF_12M = 3,
271 CRM_PLL_FREF_16M = 4,
272 CRM_PLL_FREF_25M = 5,
273} crm_pll_fref_type;
274
278typedef enum
279{
280 CRM_PLL_SOURCE_HICK = 0x00,
281 CRM_PLL_SOURCE_HEXT = 0x01,
282 CRM_PLL_SOURCE_HEXT_DIV = 0x02
283} crm_pll_clock_source_type;
284
288typedef enum
289{
290 CRM_PLL_FR_1 = 0x00,
291 CRM_PLL_FR_2 = 0x01,
292 CRM_PLL_FR_4 = 0x02,
293 CRM_PLL_FR_8 = 0x03,
294 CRM_PLL_FR_16 = 0x04,
295 CRM_PLL_FR_32 = 0x05
296} crm_pll_fr_type;
297
301typedef enum
302{
303 CRM_CLOCK_SOURCE_HICK = 0x00,
304 CRM_CLOCK_SOURCE_HEXT = 0x01,
305 CRM_CLOCK_SOURCE_PLL = 0x02,
306 CRM_CLOCK_SOURCE_LEXT = 0x03,
307 CRM_CLOCK_SOURCE_LICK = 0x04
308} crm_clock_source_type;
309
313typedef enum
314{
315 CRM_AHB_DIV_1 = 0x00,
316 CRM_AHB_DIV_2 = 0x08,
317 CRM_AHB_DIV_4 = 0x09,
318 CRM_AHB_DIV_8 = 0x0A,
319 CRM_AHB_DIV_16 = 0x0B,
320 CRM_AHB_DIV_64 = 0x0C,
321 CRM_AHB_DIV_128 = 0x0D,
322 CRM_AHB_DIV_256 = 0x0E,
323 CRM_AHB_DIV_512 = 0x0F
324} crm_ahb_div_type;
325
329typedef enum
330{
331 CRM_APB1_DIV_1 = 0x00,
332 CRM_APB1_DIV_2 = 0x04,
333 CRM_APB1_DIV_4 = 0x05,
334 CRM_APB1_DIV_8 = 0x06,
335 CRM_APB1_DIV_16 = 0x07
336} crm_apb1_div_type;
337
341typedef enum
342{
343 CRM_APB2_DIV_1 = 0x00,
344 CRM_APB2_DIV_2 = 0x04,
345 CRM_APB2_DIV_4 = 0x05,
346 CRM_APB2_DIV_8 = 0x06,
347 CRM_APB2_DIV_16 = 0x07
348} crm_apb2_div_type;
349
353typedef enum
354{
355 CRM_ADC_DIV_2 = 0x00,
356 CRM_ADC_DIV_4 = 0x01,
357 CRM_ADC_DIV_6 = 0x02,
358 CRM_ADC_DIV_8 = 0x03,
359 CRM_ADC_DIV_12 = 0x05,
360 CRM_ADC_DIV_16 = 0x07
361} crm_adc_div_type;
362
366typedef enum
367{
368 CRM_USB_DIV_1_5 = 0x00,
369 CRM_USB_DIV_1 = 0x01,
370 CRM_USB_DIV_2_5 = 0x02,
371 CRM_USB_DIV_2 = 0x03,
372 CRM_USB_DIV_3_5 = 0x04,
373 CRM_USB_DIV_3 = 0x05,
374 CRM_USB_DIV_4 = 0x06
375} crm_usb_div_type;
376
380typedef enum
381{
382 CRM_ERTC_CLOCK_NOCLK = 0x00,
383 CRM_ERTC_CLOCK_LEXT = 0x01,
384 CRM_ERTC_CLOCK_LICK = 0x02,
385 CRM_ERTC_CLOCK_HEXT_DIV = 0x03
386} crm_ertc_clock_type;
387
391typedef enum
392{
393 CRM_HICK48_DIV6 = 0x00,
394 CRM_HICK48_NODIV = 0x01
395} crm_hick_div_6_type;
396
400typedef enum
401{
402 CRM_SCLK_HICK = 0x00,
403 CRM_SCLK_HEXT = 0x01,
404 CRM_SCLK_PLL = 0x02
405} crm_sclk_type;
406
410typedef enum
411{
412 CRM_CLKOUT_NOCLK = 0x00,
413 CRM_CLKOUT_LICK = 0x02,
414 CRM_CLKOUT_LEXT = 0x03,
415 CRM_CLKOUT_SCLK = 0x04,
416 CRM_CLKOUT_HICK = 0x05,
417 CRM_CLKOUT_HEXT = 0x06,
418 CRM_CLKOUT_PLL_DIV_2 = 0x07,
419 CRM_CLKOUT_PLL_DIV_4 = 0x0C,
420 CRM_CLKOUT_USB = 0x0D,
421 CRM_CLKOUT_ADC = 0x0E
422} crm_clkout_select_type;
423
427typedef enum
428{
429 CRM_CLKOUT_DIV_1 = 0x00,
430 CRM_CLKOUT_DIV_2 = 0x08,
431 CRM_CLKOUT_DIV_4 = 0x09,
432 CRM_CLKOUT_DIV_8 = 0x0A,
433 CRM_CLKOUT_DIV_16 = 0x0B,
434 CRM_CLKOUT_DIV_64 = 0x0C,
435 CRM_CLKOUT_DIV_128 = 0x0D,
436 CRM_CLKOUT_DIV_256 = 0x0E,
437 CRM_CLKOUT_DIV_512 = 0x0F
438} crm_clkout_div_type;
439
443typedef enum
444{
445 CRM_AUTO_STEP_MODE_DISABLE = 0x00,
446 CRM_AUTO_STEP_MODE_ENABLE = 0x03
447} crm_auto_step_mode_type;
448
452typedef enum
453{
454 CRM_USB_CLOCK_SOURCE_PLL = 0x00,
455 CRM_USB_CLOCK_SOURCE_HICK = 0x01
456} crm_usb_clock_source_type;
457
461typedef enum
462{
463 CRM_HICK_SCLK_8MHZ = 0x00,
464 CRM_HICK_SCLK_48MHZ = 0x01
465} crm_hick_sclk_frequency_type;
466
470typedef struct
471{
472 uint32_t sclk_freq;
473 uint32_t ahb_freq;
474 uint32_t apb2_freq;
475 uint32_t apb1_freq;
476 uint32_t adc_freq;
477} crm_clocks_freq_type;
478
482typedef struct
483{
487 union
488 {
489 __IO uint32_t ctrl;
490 struct
491 {
492 __IO uint32_t hicken : 1; /* [0] */
493 __IO uint32_t hickstbl : 1; /* [1] */
494 __IO uint32_t hicktrim : 6; /* [7:2] */
495 __IO uint32_t hickcal : 8; /* [15:8] */
496 __IO uint32_t hexten : 1; /* [16] */
497 __IO uint32_t hextstbl : 1; /* [17] */
498 __IO uint32_t hextbyps : 1; /* [18] */
499 __IO uint32_t cfden : 1; /* [19] */
500 __IO uint32_t reserved1 : 4; /* [23:20] */
501 __IO uint32_t pllen : 1; /* [24] */
502 __IO uint32_t pllstbl : 1; /* [25] */
503 __IO uint32_t reserved2 : 6; /* [31:26] */
504 } ctrl_bit;
505 };
506
510 union
511 {
512 __IO uint32_t cfg;
513 struct
514 {
515 __IO uint32_t sclksel : 2; /* [1:0] */
516 __IO uint32_t sclksts : 2; /* [3:2] */
517 __IO uint32_t ahbdiv : 4; /* [7:4] */
518 __IO uint32_t apb1div : 3; /* [10:8] */
519 __IO uint32_t apb2div : 3; /* [13:11] */
520 __IO uint32_t adcdiv_l : 2; /* [15:14] */
521 __IO uint32_t pllrcs : 1; /* [16] */
522 __IO uint32_t pllhextdiv : 1; /* [17] */
523 __IO uint32_t pllmult_l : 4; /* [21:18] */
524 __IO uint32_t usbdiv_l : 2; /* [23:22] */
525 __IO uint32_t clkout_sel : 3; /* [26:24] */
526 __IO uint32_t usbdiv_h : 1; /* [27] */
527 __IO uint32_t adcdiv_h : 1; /* [28] */
528 __IO uint32_t pllmult_h : 2; /* [30:29] */
529 __IO uint32_t reserved1 : 1; /* [31] */
530 } cfg_bit;
531 };
532
536 union
537 {
538 __IO uint32_t clkint;
539 struct
540 {
541 __IO uint32_t lickstblf : 1; /* [0] */
542 __IO uint32_t lextstblf : 1; /* [1] */
543 __IO uint32_t hickstblf : 1; /* [2] */
544 __IO uint32_t hextstblf : 1; /* [3] */
545 __IO uint32_t pllstblf : 1; /* [4] */
546 __IO uint32_t reserved1 : 2; /* [6:5] */
547 __IO uint32_t cfdf : 1; /* [7] */
548 __IO uint32_t lickstblien : 1; /* [8] */
549 __IO uint32_t lextstblien : 1; /* [9] */
550 __IO uint32_t hickstblien : 1; /* [10] */
551 __IO uint32_t hextstblien : 1; /* [11] */
552 __IO uint32_t pllstblien : 1; /* [12] */
553 __IO uint32_t reserved2 : 3; /* [15:13] */
554 __IO uint32_t lickstblfc : 1; /* [16] */
555 __IO uint32_t lextstblfc : 1; /* [17] */
556 __IO uint32_t hickstblfc : 1; /* [18] */
557 __IO uint32_t hextstblfc : 1; /* [19] */
558 __IO uint32_t pllstblfc : 1; /* [20] */
559 __IO uint32_t reserved3 : 2; /* [22:21] */
560 __IO uint32_t cfdfc : 1; /* [23] */
561 __IO uint32_t reserved4 : 8; /* [31:24] */
562 } clkint_bit;
563 };
564
568 union
569 {
570 __IO uint32_t apb2rst;
571 struct
572 {
573 __IO uint32_t iomuxrst : 1; /* [0] */
574 __IO uint32_t exintrst : 1; /* [1] */
575 __IO uint32_t gpioarst : 1; /* [2] */
576 __IO uint32_t gpiobrst : 1; /* [3] */
577 __IO uint32_t gpiocrst : 1; /* [4] */
578 __IO uint32_t gpiodrst : 1; /* [5] */
579 __IO uint32_t reserved1 : 1; /* [6] */
580 __IO uint32_t gpiofrst : 1; /* [7] */
581 __IO uint32_t reserved2 : 1; /* [8] */
582 __IO uint32_t adc1rst : 1; /* [9] */
583 __IO uint32_t reserved3 : 1; /* [10] */
584 __IO uint32_t tmr1rst : 1; /* [11] */
585 __IO uint32_t spi1rst : 1; /* [12] */
586 __IO uint32_t reserved4 : 1; /* [13] */
587 __IO uint32_t usart1rst : 1; /* [14] */
588 __IO uint32_t reserved5 : 4; /* [18:15] */
589 __IO uint32_t tmr9rst : 1; /* [19] */
590 __IO uint32_t tmr10rst : 1; /* [20] */
591 __IO uint32_t tmr11rst : 1; /* [21] */
592 __IO uint32_t reserved6 : 10;/* [31:22] */
593 } apb2rst_bit;
594 };
595
599 union
600 {
601 __IO uint32_t apb1rst;
602 struct
603 {
604 __IO uint32_t tmr2rst : 1; /* [0] */
605 __IO uint32_t tmr3rst : 1; /* [1] */
606 __IO uint32_t tmr4rst : 1; /* [2] */
607 __IO uint32_t tmr5rst : 1; /* [3] */
608 __IO uint32_t reserved1 : 5; /* [8:4] */
609 __IO uint32_t cmprst : 1; /* [9] */
610 __IO uint32_t reserved2 : 1; /* [10] */
611 __IO uint32_t wwdtrst : 1; /* [11] */
612 __IO uint32_t reserved3 : 2; /* [13:12] */
613 __IO uint32_t spi2rst : 1; /* [14] */
614 __IO uint32_t reserved4 : 2; /* [16:15] */
615 __IO uint32_t usart2rst : 1; /* [17] */
616 __IO uint32_t usart3rst : 1; /* [18] */
617 __IO uint32_t uart4rst : 1; /* [19] */
618 __IO uint32_t uart5rst : 1; /* [20] */
619 __IO uint32_t i2c1rst : 1; /* [21] */
620 __IO uint32_t i2c2rst : 1; /* [22] */
621 __IO uint32_t reserved5 : 2; /* [24:23] */
622 __IO uint32_t can1rst : 1; /* [25] */
623 __IO uint32_t reserved6 : 2; /* [27:26] */
624 __IO uint32_t pwcrst : 1; /* [28] */
625 __IO uint32_t reserved7 : 3; /* [31:29] */
626 } apb1rst_bit;
627 };
628
632 union
633 {
634 __IO uint32_t ahben;
635 struct
636 {
637 __IO uint32_t dma1en : 1; /* [0] */
638 __IO uint32_t dma2en : 1; /* [1] */
639 __IO uint32_t sramen : 1; /* [2] */
640 __IO uint32_t reserved1 : 1; /* [3] */
641 __IO uint32_t flashen : 1; /* [4] */
642 __IO uint32_t reserved2 : 1; /* [5] */
643 __IO uint32_t crcen : 1; /* [6] */
644 __IO uint32_t reserved3 : 3; /* [9:7] */
645 __IO uint32_t sdio1en : 1; /* [10] */
646 __IO uint32_t reserved4 : 1; /* [11] */
647 __IO uint32_t usben : 1; /* [12] */
648 __IO uint32_t reserved5 : 19;/* [31:13] */
649 } ahben_bit;
650 };
651
655 union
656 {
657 __IO uint32_t apb2en;
658 struct
659 {
660 __IO uint32_t iomuxen : 1; /* [0] */
661 __IO uint32_t reserved1 : 1; /* [1] */
662 __IO uint32_t gpioaen : 1; /* [2] */
663 __IO uint32_t gpioben : 1; /* [3] */
664 __IO uint32_t gpiocen : 1; /* [4] */
665 __IO uint32_t gpioden : 1; /* [5] */
666 __IO uint32_t reserved2 : 1; /* [6] */
667 __IO uint32_t gpiofen : 1; /* [7] */
668 __IO uint32_t reserved3 : 1; /* [8] */
669 __IO uint32_t adc1en : 1; /* [9] */
670 __IO uint32_t reserved4 : 1; /* [10] */
671 __IO uint32_t tmr1en : 1; /* [11] */
672 __IO uint32_t spi1en : 1; /* [12] */
673 __IO uint32_t reserved5 : 1; /* [13] */
674 __IO uint32_t usart1en : 1; /* [14] */
675 __IO uint32_t reserved6 : 4; /* [18:15] */
676 __IO uint32_t tmr9en : 1; /* [19] */
677 __IO uint32_t tmr10en : 1; /* [20] */
678 __IO uint32_t tmr11en : 1; /* [21] */
679 __IO uint32_t reserved7 : 10;/* [31:22] */
680 } apb2en_bit;
681 };
682
686 union
687 {
688 __IO uint32_t apb1en;
689 struct
690 {
691 __IO uint32_t tmr2en : 1; /* [0] */
692 __IO uint32_t tmr3en : 1; /* [1] */
693 __IO uint32_t tmr4en : 1; /* [2] */
694 __IO uint32_t tmr5en : 1; /* [3] */
695 __IO uint32_t reserved1 : 5; /* [8:4] */
696 __IO uint32_t cmpen : 1; /* [9] */
697 __IO uint32_t reserved2 : 1; /* [10] */
698 __IO uint32_t wwdten : 1; /* [11] */
699 __IO uint32_t reserved3 : 2; /* [13:12] */
700 __IO uint32_t spi2en : 1; /* [14] */
701 __IO uint32_t reserved4 : 2; /* [16:15] */
702 __IO uint32_t usart2en : 1; /* [17] */
703 __IO uint32_t usart3en : 1; /* [18] */
704 __IO uint32_t uart4en : 1; /* [19] */
705 __IO uint32_t uart5en : 1; /* [20] */
706 __IO uint32_t i2c1en : 1; /* [21] */
707 __IO uint32_t i2c2en : 1; /* [22] */
708 __IO uint32_t reserved5 : 2; /* [24:23] */
709 __IO uint32_t can1en : 1; /* [25] */
710 __IO uint32_t reserved6 : 1; /* [26] */
711 __IO uint32_t bpren : 1; /* [27] */
712 __IO uint32_t pwcen : 1; /* [28] */
713 __IO uint32_t reserved7 : 2; /* [31:29] */
714 } apb1en_bit;
715 };
716
720 union
721 {
722 __IO uint32_t bpdc;
723 struct
724 {
725 __IO uint32_t lexten : 1; /* [0] */
726 __IO uint32_t lextstbl : 1; /* [1] */
727 __IO uint32_t lextbyps : 1; /* [2] */
728 __IO uint32_t reserved1 : 5; /* [7:3] */
729 __IO uint32_t ertcsel : 2; /* [9:8] */
730 __IO uint32_t reserved2 : 5; /* [14:10] */
731 __IO uint32_t ertcen : 1; /* [15] */
732 __IO uint32_t bpdrst : 1; /* [16] */
733 __IO uint32_t reserved3 : 15;/* [31:17] */
734 } bpdc_bit;
735 };
736
740 union
741 {
742 __IO uint32_t ctrlsts;
743 struct
744 {
745 __IO uint32_t licken : 1; /* [0] */
746 __IO uint32_t lickstbl : 1; /* [1] */
747 __IO uint32_t reserved1 : 22;/* [23:2] */
748 __IO uint32_t rstfc : 1; /* [24] */
749 __IO uint32_t reserved2 : 1; /* [25] */
750 __IO uint32_t nrstf : 1; /* [26] */
751 __IO uint32_t porrstf : 1; /* [27] */
752 __IO uint32_t swrstf : 1; /* [28] */
753 __IO uint32_t wdtrstf : 1; /* [29] */
754 __IO uint32_t wwdtrstf : 1; /* [30] */
755 __IO uint32_t lprstf : 1; /* [31] */
756 } ctrlsts_bit;
757 };
758
762 union
763 {
764 __IO uint32_t ahbrst;
765 struct
766 {
767 __IO uint32_t reserved1 : 12;/* [11:0] */
768 __IO uint32_t usbrst : 1; /* [12] */
769 __IO uint32_t reserved2 : 19;/* [31:13] */
770 } ahbrst_bit;
771 };
772
776 union
777 {
778 __IO uint32_t pll;
779 struct
780 {
781 __IO uint32_t pllfr : 3; /* [2:0] */
782 __IO uint32_t reserved1 : 1; /* [3] */
783 __IO uint32_t pllms : 4; /* [7:4] */
784 __IO uint32_t pllns : 9; /* [16:8] */
785 __IO uint32_t reserved2 : 7; /* [23:17] */
786 __IO uint32_t pllfref : 3; /* [26:24] */
787 __IO uint32_t reserved3 : 4; /* [30:27] */
788 __IO uint32_t pllcfgen : 1; /* [31] */
789 } pll_bit;
790 };
791
795 union
796 {
797 __IO uint32_t misc1;
798 struct
799 {
800 __IO uint32_t hickcal_key : 8; /* [7:0] */
801 __IO uint32_t reserved1 : 8; /* [15:8] */
802 __IO uint32_t clkout_sel : 1; /* [16] */
803 __IO uint32_t reserved2 : 7; /* [23:17] */
804 __IO uint32_t usbbufs : 1; /* [24] */
805 __IO uint32_t hickdiv : 1; /* [25] */
806 __IO uint32_t reserved3 : 2; /* [27:26] */
807 __IO uint32_t clkoutdiv : 4; /* [31:28] */
808 } misc1_bit;
809 };
810
814 __IO uint32_t reserved2[4];
815
819 union
820 {
821 __IO uint32_t otg_extctrl;
822 struct
823 {
824 __IO uint32_t reserved1 : 30;/* [29:0] */
825 __IO uint32_t usbdivrst : 1; /* [30] */
826 __IO uint32_t ep3_rmpen : 1; /* [31] */
827 } otg_extctrl_bit;
828 };
829
833 __IO uint32_t reserved3[3];
834
838 union
839 {
840 __IO uint32_t misc2;
841 struct
842 {
843 __IO uint32_t reserved1 : 4; /* [3:0] */
844 __IO uint32_t auto_step_en : 2; /* [5:4] */
845 __IO uint32_t reserved2 : 2; /* [7:6] */
846 __IO uint32_t hick_to_usb : 1; /* [8] */
847 __IO uint32_t hick_to_sclk : 1; /* [9] */
848 __IO uint32_t reserved3 : 22;/* [31:10] */
849 } misc2_bit;
850 };
851
852} crm_type;
853
858#define CRM ((crm_type *) CRM_BASE)
859
864void crm_reset(void);
865void crm_lext_bypass(confirm_state new_state);
866void crm_hext_bypass(confirm_state new_state);
867 flag_status crm_flag_get(uint32_t flag);
868 error_status crm_hext_stable_wait(void);
869void crm_hick_clock_trimming_set(uint8_t trim_value);
870void crm_hick_clock_calibration_set(uint8_t cali_value);
871void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state);
872void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state);
873void crm_periph_sleep_mode_clock_enable(crm_periph_clock_sleepmd_type value, confirm_state new_state);
874void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state);
875void crm_flag_clear(uint32_t flag);
876void crm_ertc_clock_select(crm_ertc_clock_type value);
877void crm_ertc_clock_enable(confirm_state new_state);
878void crm_ahb_div_set(crm_ahb_div_type value);
879void crm_apb1_div_set(crm_apb1_div_type value);
880void crm_apb2_div_set(crm_apb2_div_type value);
881void crm_adc_clock_div_set(crm_adc_div_type div_value);
882void crm_usb_clock_div_set(crm_usb_div_type div_value);
883void crm_clock_failure_detection_enable(confirm_state new_state);
884void crm_battery_powered_domain_reset(confirm_state new_state);
885void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value);
886void crm_pll_config2(crm_pll_clock_source_type clock_source, uint16_t pll_ns, uint16_t pll_ms, crm_pll_fr_type pll_fr);
887void crm_sysclk_switch(crm_sclk_type value);
888 crm_sclk_type crm_sysclk_switch_status_get(void);
889void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct);
890void crm_clock_out_set(crm_clkout_select_type clkout);
891void crm_interrupt_enable(uint32_t crm_int, confirm_state new_state);
892void crm_auto_step_mode_enable(confirm_state new_state);
893void crm_hick_divider_select(crm_hick_div_6_type value);
894void crm_hick_sclk_frequency_select(crm_hick_sclk_frequency_type value);
895void crm_usb_clock_source_select(crm_usb_clock_source_type value);
896void crm_clkout_div_set(crm_clkout_div_type clkout_div);
897void crm_otgfs_ep3_remap_enable(confirm_state new_state);
898void crm_usbdiv_reset(confirm_state new_state);
899
912#ifdef __cplusplus
913}
914#endif
915
916#endif
at32f415.h
at32f415 header file
div_value
uint16_t div_value
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:44
crm_pll_config2
void crm_pll_config2(crm_pll_clock_source_type clock_source, uint16_t pll_ns, uint16_t pll_ms, crm_pll_fr_type pll_fr)
config crm pll function2, another method. pll_rcs_freq * pll_ns pll clock = -------------------------...
Definition: at32f415_crm.c:603
crm_periph_sleep_mode_clock_enable
void crm_periph_sleep_mode_clock_enable(crm_periph_clock_sleepmd_type value, confirm_state new_state)
enable or disable the peripheral clock in sleep mode
Definition: at32f415_crm.c:262
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hick_clock_calibration_set
void crm_hick_clock_calibration_set(uint8_t cali_value)
set the crm calibration value
Definition: at32f415_crm.c:181
crm_clkout_div_set
void crm_clkout_div_set(crm_clkout_div_type clkout_div)
set crm clkout division
Definition: at32f415_crm.c:901
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_interrupt_enable
void crm_interrupt_enable(uint32_t crm_int, confirm_state new_state)
config crm interrupt
Definition: at32f415_crm.c:821
crm_flag_clear
void crm_flag_clear(uint32_t flag)
clear the crm reset flags
Definition: at32f415_crm.c:333
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_lext_bypass
void crm_lext_bypass(confirm_state new_state)
enable or disable crm low speed external crystal bypass
Definition: at32f415_crm.c:86
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_ertc_clock_select
void crm_ertc_clock_select(crm_ertc_clock_type value)
select ertc clock
Definition: at32f415_crm.c:377
crm_hick_sclk_frequency_select
void crm_hick_sclk_frequency_select(crm_hick_sclk_frequency_type value)
hick as system clock frequency select
Definition: at32f415_crm.c:863
crm_hick_divider_select
void crm_hick_divider_select(crm_hick_div_6_type value)
config hick divider select
Definition: at32f415_crm.c:850
crm_usbdiv_reset
void crm_usbdiv_reset(confirm_state new_state)
usb divider reset, only available in at32f415xx revision C. at32f415xx revision B: (not support) usb ...
Definition: at32f415_crm.c:930
crm_adc_clock_div_set
void crm_adc_clock_div_set(crm_adc_div_type div_value)
set crm adc division
Definition: at32f415_crm.c:456
crm_clock_out_set
void crm_clock_out_set(crm_clkout_select_type clkout)
set crm clkout
Definition: at32f415_crm.c:803
crm_clock_failure_detection_enable
void crm_clock_failure_detection_enable(confirm_state new_state)
enable or disable clock failure detection
Definition: at32f415_crm.c:486
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
crm_otgfs_ep3_remap_enable
void crm_otgfs_ep3_remap_enable(confirm_state new_state)
enable or disable otgfs end-point3 remap, only available in at32f415xx revision C....
Definition: at32f415_crm.c:915
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_hick_clock_trimming_set
void crm_hick_clock_trimming_set(uint8_t trim_value)
set the hick trimming value
Definition: at32f415_crm.c:171
crm_ertc_clock_enable
void crm_ertc_clock_enable(confirm_state new_state)
enable or disable ertc
Definition: at32f415_crm.c:387
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
crm_battery_powered_domain_reset
void crm_battery_powered_domain_reset(confirm_state new_state)
battery powered domain software reset
Definition: at32f415_crm.c:496
crm_usb_clock_source_select
void crm_usb_clock_source_select(crm_usb_clock_source_type value)
usb 48 mhz clock source select
Definition: at32f415_crm.c:877
crm_hext_bypass
void crm_hext_bypass(confirm_state new_state)
enable or disable crm high speed external crystal bypass
Definition: at32f415_crm.c:96
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
crm_periph_clock_type
crm_periph_clock_type
crm periph clock
Definition: at32f415_crm.h:101
crm_hick_sclk_frequency_type
crm_hick_sclk_frequency_type
crm hick as system clock frequency select
Definition: at32f415_crm.h:462
crm_apb1_div_type
crm_apb1_div_type
crm apb1 division
Definition: at32f415_crm.h:330
crm_clock_source_type
crm_clock_source_type
crm clock source
Definition: at32f415_crm.h:302
crm_usb_div_type
crm_usb_div_type
crm usb division
Definition: at32f415_crm.h:367
crm_clkout_div_type
crm_clkout_div_type
crm clkout division
Definition: at32f415_crm.h:428
crm_usb_clock_source_type
crm_usb_clock_source_type
crm usb 48 mhz clock source select
Definition: at32f415_crm.h:453
crm_periph_clock_sleepmd_type
crm_periph_clock_sleepmd_type
crm periph clock in sleep mode
Definition: at32f415_crm.h:186
crm_pll_fref_type
crm_pll_fref_type
crm pll fref_x
Definition: at32f415_crm.h:266
crm_pll_clock_source_type
crm_pll_clock_source_type
crm pll clock source
Definition: at32f415_crm.h:279
crm_pll_mult_type
crm_pll_mult_type
crm pll mult_x
Definition: at32f415_crm.h:196
crm_ahb_div_type
crm_ahb_div_type
crm ahb division
Definition: at32f415_crm.h:314
crm_adc_div_type
crm_adc_div_type
crm adc division
Definition: at32f415_crm.h:354
crm_clkout_select_type
crm_clkout_select_type
crm clkout select
Definition: at32f415_crm.h:411
crm_auto_step_mode_type
crm_auto_step_mode_type
crm auto step mode
Definition: at32f415_crm.h:444
crm_sclk_type
crm_sclk_type
crm sclk select
Definition: at32f415_crm.h:401
crm_periph_reset_type
crm_periph_reset_type
crm periph reset
Definition: at32f415_crm.h:145
crm_apb2_div_type
crm_apb2_div_type
crm apb2 division
Definition: at32f415_crm.h:342
crm_ertc_clock_type
crm_ertc_clock_type
crm ertc clock
Definition: at32f415_crm.h:381
crm_pll_fr_type
crm_pll_fr_type
crm pll fr
Definition: at32f415_crm.h:289
crm_hick_div_6_type
crm_hick_div_6_type
crm hick 48mhz division
Definition: at32f415_crm.h:392
CRM_SDIO1_PERIPH_CLOCK
@ CRM_SDIO1_PERIPH_CLOCK
Definition: at32f415_crm.h:106
CRM_TMR10_PERIPH_CLOCK
@ CRM_TMR10_PERIPH_CLOCK
Definition: at32f415_crm.h:120
CRM_GPIOC_PERIPH_CLOCK
@ CRM_GPIOC_PERIPH_CLOCK
Definition: at32f415_crm.h:112
CRM_GPIOF_PERIPH_CLOCK
@ CRM_GPIOF_PERIPH_CLOCK
Definition: at32f415_crm.h:114
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_UART5_PERIPH_CLOCK
@ CRM_UART5_PERIPH_CLOCK
Definition: at32f415_crm.h:133
CRM_OTGFS1_PERIPH_CLOCK
@ CRM_OTGFS1_PERIPH_CLOCK
Definition: at32f415_crm.h:107
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR9_PERIPH_CLOCK
@ CRM_TMR9_PERIPH_CLOCK
Definition: at32f415_crm.h:119
CRM_USART3_PERIPH_CLOCK
@ CRM_USART3_PERIPH_CLOCK
Definition: at32f415_crm.h:131
CRM_CMP_PERIPH_CLOCK
@ CRM_CMP_PERIPH_CLOCK
Definition: at32f415_crm.h:127
CRM_TMR2_PERIPH_CLOCK
@ CRM_TMR2_PERIPH_CLOCK
Definition: at32f415_crm.h:123
CRM_I2C1_PERIPH_CLOCK
@ CRM_I2C1_PERIPH_CLOCK
Definition: at32f415_crm.h:134
CRM_TMR4_PERIPH_CLOCK
@ CRM_TMR4_PERIPH_CLOCK
Definition: at32f415_crm.h:125
CRM_SPI2_PERIPH_CLOCK
@ CRM_SPI2_PERIPH_CLOCK
Definition: at32f415_crm.h:129
CRM_CRC_PERIPH_CLOCK
@ CRM_CRC_PERIPH_CLOCK
Definition: at32f415_crm.h:105
CRM_TMR3_PERIPH_CLOCK
@ CRM_TMR3_PERIPH_CLOCK
Definition: at32f415_crm.h:124
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_USART1_PERIPH_CLOCK
@ CRM_USART1_PERIPH_CLOCK
Definition: at32f415_crm.h:118
CRM_UART4_PERIPH_CLOCK
@ CRM_UART4_PERIPH_CLOCK
Definition: at32f415_crm.h:132
CRM_GPIOD_PERIPH_CLOCK
@ CRM_GPIOD_PERIPH_CLOCK
Definition: at32f415_crm.h:113
CRM_SPI1_PERIPH_CLOCK
@ CRM_SPI1_PERIPH_CLOCK
Definition: at32f415_crm.h:117
CRM_CAN1_PERIPH_CLOCK
@ CRM_CAN1_PERIPH_CLOCK
Definition: at32f415_crm.h:136
CRM_ADC1_PERIPH_CLOCK
@ CRM_ADC1_PERIPH_CLOCK
Definition: at32f415_crm.h:115
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_I2C2_PERIPH_CLOCK
@ CRM_I2C2_PERIPH_CLOCK
Definition: at32f415_crm.h:135
CRM_DMA2_PERIPH_CLOCK
@ CRM_DMA2_PERIPH_CLOCK
Definition: at32f415_crm.h:104
CRM_TMR5_PERIPH_CLOCK
@ CRM_TMR5_PERIPH_CLOCK
Definition: at32f415_crm.h:126
CRM_USART2_PERIPH_CLOCK
@ CRM_USART2_PERIPH_CLOCK
Definition: at32f415_crm.h:130
CRM_TMR11_PERIPH_CLOCK
@ CRM_TMR11_PERIPH_CLOCK
Definition: at32f415_crm.h:121
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
CRM_WWDT_PERIPH_CLOCK
@ CRM_WWDT_PERIPH_CLOCK
Definition: at32f415_crm.h:128
CRM_HICK_SCLK_48MHZ
@ CRM_HICK_SCLK_48MHZ
Definition: at32f415_crm.h:464
CRM_HICK_SCLK_8MHZ
@ CRM_HICK_SCLK_8MHZ
Definition: at32f415_crm.h:463
CRM_APB1_DIV_8
@ CRM_APB1_DIV_8
Definition: at32f415_crm.h:334
CRM_APB1_DIV_4
@ CRM_APB1_DIV_4
Definition: at32f415_crm.h:333
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_APB1_DIV_16
@ CRM_APB1_DIV_16
Definition: at32f415_crm.h:335
CRM_APB1_DIV_1
@ CRM_APB1_DIV_1
Definition: at32f415_crm.h:331
CRM_CLOCK_SOURCE_HICK
@ CRM_CLOCK_SOURCE_HICK
Definition: at32f415_crm.h:303
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_LEXT
@ CRM_CLOCK_SOURCE_LEXT
Definition: at32f415_crm.h:306
CRM_CLOCK_SOURCE_LICK
@ CRM_CLOCK_SOURCE_LICK
Definition: at32f415_crm.h:307
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_4
@ CRM_USB_DIV_4
Definition: at32f415_crm.h:374
CRM_USB_DIV_3_5
@ CRM_USB_DIV_3_5
Definition: at32f415_crm.h:372
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
CRM_CLKOUT_DIV_2
@ CRM_CLKOUT_DIV_2
Definition: at32f415_crm.h:430
CRM_CLKOUT_DIV_1
@ CRM_CLKOUT_DIV_1
Definition: at32f415_crm.h:429
CRM_CLKOUT_DIV_128
@ CRM_CLKOUT_DIV_128
Definition: at32f415_crm.h:435
CRM_CLKOUT_DIV_64
@ CRM_CLKOUT_DIV_64
Definition: at32f415_crm.h:434
CRM_CLKOUT_DIV_8
@ CRM_CLKOUT_DIV_8
Definition: at32f415_crm.h:432
CRM_CLKOUT_DIV_16
@ CRM_CLKOUT_DIV_16
Definition: at32f415_crm.h:433
CRM_CLKOUT_DIV_256
@ CRM_CLKOUT_DIV_256
Definition: at32f415_crm.h:436
CRM_CLKOUT_DIV_4
@ CRM_CLKOUT_DIV_4
Definition: at32f415_crm.h:431
CRM_CLKOUT_DIV_512
@ CRM_CLKOUT_DIV_512
Definition: at32f415_crm.h:437
CRM_USB_CLOCK_SOURCE_HICK
@ CRM_USB_CLOCK_SOURCE_HICK
Definition: at32f415_crm.h:455
CRM_USB_CLOCK_SOURCE_PLL
@ CRM_USB_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:454
CRM_FLASH_PERIPH_CLOCK_SLEEP_MODE
@ CRM_FLASH_PERIPH_CLOCK_SLEEP_MODE
Definition: at32f415_crm.h:189
CRM_SRAM_PERIPH_CLOCK_SLEEP_MODE
@ CRM_SRAM_PERIPH_CLOCK_SLEEP_MODE
Definition: at32f415_crm.h:188
CRM_PLL_FREF_16M
@ CRM_PLL_FREF_16M
Definition: at32f415_crm.h:271
CRM_PLL_FREF_6M
@ CRM_PLL_FREF_6M
Definition: at32f415_crm.h:268
CRM_PLL_FREF_4M
@ CRM_PLL_FREF_4M
Definition: at32f415_crm.h:267
CRM_PLL_FREF_25M
@ CRM_PLL_FREF_25M
Definition: at32f415_crm.h:272
CRM_PLL_FREF_8M
@ CRM_PLL_FREF_8M
Definition: at32f415_crm.h:269
CRM_PLL_FREF_12M
@ CRM_PLL_FREF_12M
Definition: at32f415_crm.h:270
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_SOURCE_HEXT
@ CRM_PLL_SOURCE_HEXT
Definition: at32f415_crm.h:281
CRM_PLL_SOURCE_HICK
@ CRM_PLL_SOURCE_HICK
Definition: at32f415_crm.h:280
CRM_PLL_MULT_17
@ CRM_PLL_MULT_17
Definition: at32f415_crm.h:212
CRM_PLL_MULT_24
@ CRM_PLL_MULT_24
Definition: at32f415_crm.h:219
CRM_PLL_MULT_53
@ CRM_PLL_MULT_53
Definition: at32f415_crm.h:248
CRM_PLL_MULT_61
@ CRM_PLL_MULT_61
Definition: at32f415_crm.h:256
CRM_PLL_MULT_27
@ CRM_PLL_MULT_27
Definition: at32f415_crm.h:222
CRM_PLL_MULT_50
@ CRM_PLL_MULT_50
Definition: at32f415_crm.h:245
CRM_PLL_MULT_41
@ CRM_PLL_MULT_41
Definition: at32f415_crm.h:236
CRM_PLL_MULT_56
@ CRM_PLL_MULT_56
Definition: at32f415_crm.h:251
CRM_PLL_MULT_11
@ CRM_PLL_MULT_11
Definition: at32f415_crm.h:206
CRM_PLL_MULT_37
@ CRM_PLL_MULT_37
Definition: at32f415_crm.h:232
CRM_PLL_MULT_63
@ CRM_PLL_MULT_63
Definition: at32f415_crm.h:258
CRM_PLL_MULT_18
@ CRM_PLL_MULT_18
Definition: at32f415_crm.h:213
CRM_PLL_MULT_9
@ CRM_PLL_MULT_9
Definition: at32f415_crm.h:204
CRM_PLL_MULT_4
@ CRM_PLL_MULT_4
Definition: at32f415_crm.h:199
CRM_PLL_MULT_35
@ CRM_PLL_MULT_35
Definition: at32f415_crm.h:230
CRM_PLL_MULT_14
@ CRM_PLL_MULT_14
Definition: at32f415_crm.h:209
CRM_PLL_MULT_28
@ CRM_PLL_MULT_28
Definition: at32f415_crm.h:223
CRM_PLL_MULT_62
@ CRM_PLL_MULT_62
Definition: at32f415_crm.h:257
CRM_PLL_MULT_20
@ CRM_PLL_MULT_20
Definition: at32f415_crm.h:215
CRM_PLL_MULT_47
@ CRM_PLL_MULT_47
Definition: at32f415_crm.h:242
CRM_PLL_MULT_32
@ CRM_PLL_MULT_32
Definition: at32f415_crm.h:227
CRM_PLL_MULT_58
@ CRM_PLL_MULT_58
Definition: at32f415_crm.h:253
CRM_PLL_MULT_10
@ CRM_PLL_MULT_10
Definition: at32f415_crm.h:205
CRM_PLL_MULT_44
@ CRM_PLL_MULT_44
Definition: at32f415_crm.h:239
CRM_PLL_MULT_5
@ CRM_PLL_MULT_5
Definition: at32f415_crm.h:200
CRM_PLL_MULT_34
@ CRM_PLL_MULT_34
Definition: at32f415_crm.h:229
CRM_PLL_MULT_15
@ CRM_PLL_MULT_15
Definition: at32f415_crm.h:210
CRM_PLL_MULT_39
@ CRM_PLL_MULT_39
Definition: at32f415_crm.h:234
CRM_PLL_MULT_13
@ CRM_PLL_MULT_13
Definition: at32f415_crm.h:208
CRM_PLL_MULT_45
@ CRM_PLL_MULT_45
Definition: at32f415_crm.h:240
CRM_PLL_MULT_12
@ CRM_PLL_MULT_12
Definition: at32f415_crm.h:207
CRM_PLL_MULT_33
@ CRM_PLL_MULT_33
Definition: at32f415_crm.h:228
CRM_PLL_MULT_64
@ CRM_PLL_MULT_64
Definition: at32f415_crm.h:259
CRM_PLL_MULT_31
@ CRM_PLL_MULT_31
Definition: at32f415_crm.h:226
CRM_PLL_MULT_48
@ CRM_PLL_MULT_48
Definition: at32f415_crm.h:243
CRM_PLL_MULT_19
@ CRM_PLL_MULT_19
Definition: at32f415_crm.h:214
CRM_PLL_MULT_29
@ CRM_PLL_MULT_29
Definition: at32f415_crm.h:224
CRM_PLL_MULT_49
@ CRM_PLL_MULT_49
Definition: at32f415_crm.h:244
CRM_PLL_MULT_3
@ CRM_PLL_MULT_3
Definition: at32f415_crm.h:198
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_PLL_MULT_21
@ CRM_PLL_MULT_21
Definition: at32f415_crm.h:216
CRM_PLL_MULT_40
@ CRM_PLL_MULT_40
Definition: at32f415_crm.h:235
CRM_PLL_MULT_46
@ CRM_PLL_MULT_46
Definition: at32f415_crm.h:241
CRM_PLL_MULT_59
@ CRM_PLL_MULT_59
Definition: at32f415_crm.h:254
CRM_PLL_MULT_2
@ CRM_PLL_MULT_2
Definition: at32f415_crm.h:197
CRM_PLL_MULT_54
@ CRM_PLL_MULT_54
Definition: at32f415_crm.h:249
CRM_PLL_MULT_7
@ CRM_PLL_MULT_7
Definition: at32f415_crm.h:202
CRM_PLL_MULT_25
@ CRM_PLL_MULT_25
Definition: at32f415_crm.h:220
CRM_PLL_MULT_22
@ CRM_PLL_MULT_22
Definition: at32f415_crm.h:217
CRM_PLL_MULT_51
@ CRM_PLL_MULT_51
Definition: at32f415_crm.h:246
CRM_PLL_MULT_57
@ CRM_PLL_MULT_57
Definition: at32f415_crm.h:252
CRM_PLL_MULT_43
@ CRM_PLL_MULT_43
Definition: at32f415_crm.h:238
CRM_PLL_MULT_55
@ CRM_PLL_MULT_55
Definition: at32f415_crm.h:250
CRM_PLL_MULT_42
@ CRM_PLL_MULT_42
Definition: at32f415_crm.h:237
CRM_PLL_MULT_23
@ CRM_PLL_MULT_23
Definition: at32f415_crm.h:218
CRM_PLL_MULT_38
@ CRM_PLL_MULT_38
Definition: at32f415_crm.h:233
CRM_PLL_MULT_16
@ CRM_PLL_MULT_16
Definition: at32f415_crm.h:211
CRM_PLL_MULT_30
@ CRM_PLL_MULT_30
Definition: at32f415_crm.h:225
CRM_PLL_MULT_52
@ CRM_PLL_MULT_52
Definition: at32f415_crm.h:247
CRM_PLL_MULT_6
@ CRM_PLL_MULT_6
Definition: at32f415_crm.h:201
CRM_PLL_MULT_26
@ CRM_PLL_MULT_26
Definition: at32f415_crm.h:221
CRM_PLL_MULT_8
@ CRM_PLL_MULT_8
Definition: at32f415_crm.h:203
CRM_PLL_MULT_60
@ CRM_PLL_MULT_60
Definition: at32f415_crm.h:255
CRM_AHB_DIV_4
@ CRM_AHB_DIV_4
Definition: at32f415_crm.h:317
CRM_AHB_DIV_16
@ CRM_AHB_DIV_16
Definition: at32f415_crm.h:319
CRM_AHB_DIV_64
@ CRM_AHB_DIV_64
Definition: at32f415_crm.h:320
CRM_AHB_DIV_8
@ CRM_AHB_DIV_8
Definition: at32f415_crm.h:318
CRM_AHB_DIV_512
@ CRM_AHB_DIV_512
Definition: at32f415_crm.h:323
CRM_AHB_DIV_128
@ CRM_AHB_DIV_128
Definition: at32f415_crm.h:321
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_AHB_DIV_256
@ CRM_AHB_DIV_256
Definition: at32f415_crm.h:322
CRM_AHB_DIV_2
@ CRM_AHB_DIV_2
Definition: at32f415_crm.h:316
CRM_ADC_DIV_6
@ CRM_ADC_DIV_6
Definition: at32f415_crm.h:357
CRM_ADC_DIV_16
@ CRM_ADC_DIV_16
Definition: at32f415_crm.h:360
CRM_ADC_DIV_4
@ CRM_ADC_DIV_4
Definition: at32f415_crm.h:356
CRM_ADC_DIV_12
@ CRM_ADC_DIV_12
Definition: at32f415_crm.h:359
CRM_ADC_DIV_2
@ CRM_ADC_DIV_2
Definition: at32f415_crm.h:355
CRM_ADC_DIV_8
@ CRM_ADC_DIV_8
Definition: at32f415_crm.h:358
CRM_CLKOUT_NOCLK
@ CRM_CLKOUT_NOCLK
Definition: at32f415_crm.h:412
CRM_CLKOUT_HICK
@ CRM_CLKOUT_HICK
Definition: at32f415_crm.h:416
CRM_CLKOUT_USB
@ CRM_CLKOUT_USB
Definition: at32f415_crm.h:420
CRM_CLKOUT_LICK
@ CRM_CLKOUT_LICK
Definition: at32f415_crm.h:413
CRM_CLKOUT_PLL_DIV_2
@ CRM_CLKOUT_PLL_DIV_2
Definition: at32f415_crm.h:418
CRM_CLKOUT_ADC
@ CRM_CLKOUT_ADC
Definition: at32f415_crm.h:421
CRM_CLKOUT_LEXT
@ CRM_CLKOUT_LEXT
Definition: at32f415_crm.h:414
CRM_CLKOUT_SCLK
@ CRM_CLKOUT_SCLK
Definition: at32f415_crm.h:415
CRM_CLKOUT_PLL_DIV_4
@ CRM_CLKOUT_PLL_DIV_4
Definition: at32f415_crm.h:419
CRM_CLKOUT_HEXT
@ CRM_CLKOUT_HEXT
Definition: at32f415_crm.h:417
CRM_AUTO_STEP_MODE_ENABLE
@ CRM_AUTO_STEP_MODE_ENABLE
Definition: at32f415_crm.h:446
CRM_AUTO_STEP_MODE_DISABLE
@ CRM_AUTO_STEP_MODE_DISABLE
Definition: at32f415_crm.h:445
CRM_SCLK_HICK
@ CRM_SCLK_HICK
Definition: at32f415_crm.h:402
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_SCLK_HEXT
@ CRM_SCLK_HEXT
Definition: at32f415_crm.h:403
CRM_TMR2_PERIPH_RESET
@ CRM_TMR2_PERIPH_RESET
Definition: at32f415_crm.h:164
CRM_TMR4_PERIPH_RESET
@ CRM_TMR4_PERIPH_RESET
Definition: at32f415_crm.h:166
CRM_SPI1_PERIPH_RESET
@ CRM_SPI1_PERIPH_RESET
Definition: at32f415_crm.h:158
CRM_TMR10_PERIPH_RESET
@ CRM_TMR10_PERIPH_RESET
Definition: at32f415_crm.h:161
CRM_I2C2_PERIPH_RESET
@ CRM_I2C2_PERIPH_RESET
Definition: at32f415_crm.h:176
CRM_UART4_PERIPH_RESET
@ CRM_UART4_PERIPH_RESET
Definition: at32f415_crm.h:173
CRM_USART1_PERIPH_RESET
@ CRM_USART1_PERIPH_RESET
Definition: at32f415_crm.h:159
CRM_OTGFS1_PERIPH_RESET
@ CRM_OTGFS1_PERIPH_RESET
Definition: at32f415_crm.h:147
CRM_IOMUX_PERIPH_RESET
@ CRM_IOMUX_PERIPH_RESET
Definition: at32f415_crm.h:149
CRM_CAN1_PERIPH_RESET
@ CRM_CAN1_PERIPH_RESET
Definition: at32f415_crm.h:177
CRM_TMR5_PERIPH_RESET
@ CRM_TMR5_PERIPH_RESET
Definition: at32f415_crm.h:167
CRM_TMR9_PERIPH_RESET
@ CRM_TMR9_PERIPH_RESET
Definition: at32f415_crm.h:160
CRM_GPIOF_PERIPH_RESET
@ CRM_GPIOF_PERIPH_RESET
Definition: at32f415_crm.h:155
CRM_CMP_PERIPH_RESET
@ CRM_CMP_PERIPH_RESET
Definition: at32f415_crm.h:168
CRM_TMR1_PERIPH_RESET
@ CRM_TMR1_PERIPH_RESET
Definition: at32f415_crm.h:157
CRM_GPIOD_PERIPH_RESET
@ CRM_GPIOD_PERIPH_RESET
Definition: at32f415_crm.h:154
CRM_USART2_PERIPH_RESET
@ CRM_USART2_PERIPH_RESET
Definition: at32f415_crm.h:171
CRM_GPIOC_PERIPH_RESET
@ CRM_GPIOC_PERIPH_RESET
Definition: at32f415_crm.h:153
CRM_WWDT_PERIPH_RESET
@ CRM_WWDT_PERIPH_RESET
Definition: at32f415_crm.h:169
CRM_UART5_PERIPH_RESET
@ CRM_UART5_PERIPH_RESET
Definition: at32f415_crm.h:174
CRM_ADC1_PERIPH_RESET
@ CRM_ADC1_PERIPH_RESET
Definition: at32f415_crm.h:156
CRM_EXINT_PERIPH_RESET
@ CRM_EXINT_PERIPH_RESET
Definition: at32f415_crm.h:150
CRM_TMR3_PERIPH_RESET
@ CRM_TMR3_PERIPH_RESET
Definition: at32f415_crm.h:165
CRM_SPI2_PERIPH_RESET
@ CRM_SPI2_PERIPH_RESET
Definition: at32f415_crm.h:170
CRM_PWC_PERIPH_RESET
@ CRM_PWC_PERIPH_RESET
Definition: at32f415_crm.h:178
CRM_GPIOA_PERIPH_RESET
@ CRM_GPIOA_PERIPH_RESET
Definition: at32f415_crm.h:151
CRM_TMR11_PERIPH_RESET
@ CRM_TMR11_PERIPH_RESET
Definition: at32f415_crm.h:162
CRM_USART3_PERIPH_RESET
@ CRM_USART3_PERIPH_RESET
Definition: at32f415_crm.h:172
CRM_GPIOB_PERIPH_RESET
@ CRM_GPIOB_PERIPH_RESET
Definition: at32f415_crm.h:152
CRM_I2C1_PERIPH_RESET
@ CRM_I2C1_PERIPH_RESET
Definition: at32f415_crm.h:175
CRM_APB2_DIV_4
@ CRM_APB2_DIV_4
Definition: at32f415_crm.h:345
CRM_APB2_DIV_1
@ CRM_APB2_DIV_1
Definition: at32f415_crm.h:343
CRM_APB2_DIV_16
@ CRM_APB2_DIV_16
Definition: at32f415_crm.h:347
CRM_APB2_DIV_8
@ CRM_APB2_DIV_8
Definition: at32f415_crm.h:346
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_ERTC_CLOCK_LICK
@ CRM_ERTC_CLOCK_LICK
Definition: at32f415_crm.h:384
CRM_ERTC_CLOCK_HEXT_DIV
@ CRM_ERTC_CLOCK_HEXT_DIV
Definition: at32f415_crm.h:385
CRM_ERTC_CLOCK_LEXT
@ CRM_ERTC_CLOCK_LEXT
Definition: at32f415_crm.h:383
CRM_ERTC_CLOCK_NOCLK
@ CRM_ERTC_CLOCK_NOCLK
Definition: at32f415_crm.h:382
CRM_PLL_FR_32
@ CRM_PLL_FR_32
Definition: at32f415_crm.h:295
CRM_PLL_FR_2
@ CRM_PLL_FR_2
Definition: at32f415_crm.h:291
CRM_PLL_FR_16
@ CRM_PLL_FR_16
Definition: at32f415_crm.h:294
CRM_PLL_FR_4
@ CRM_PLL_FR_4
Definition: at32f415_crm.h:292
CRM_PLL_FR_8
@ CRM_PLL_FR_8
Definition: at32f415_crm.h:293
CRM_PLL_FR_1
@ CRM_PLL_FR_1
Definition: at32f415_crm.h:290
CRM_HICK48_NODIV
@ CRM_HICK48_NODIV
Definition: at32f415_crm.h:394
CRM_HICK48_DIV6
@ CRM_HICK48_DIV6
Definition: at32f415_crm.h:393
MAKE_VALUE
#define MAKE_VALUE(reg_offset, bit_num)
Definition: at32f415.h:272
error_status
error_status
error status
Definition: at32f415.h:258
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::adc_freq
uint32_t adc_freq
Definition: at32f415_crm.h:476
crm_clocks_freq_type::apb1_freq
uint32_t apb1_freq
Definition: at32f415_crm.h:475
crm_clocks_freq_type::apb2_freq
uint32_t apb2_freq
Definition: at32f415_crm.h:474
crm_clocks_freq_type::sclk_freq
uint32_t sclk_freq
Definition: at32f415_crm.h:472
crm_clocks_freq_type::ahb_freq
uint32_t ahb_freq
Definition: at32f415_crm.h:473
crm_type
type define crm register all
Definition: at32f415_crm.h:483
crm_type::misc1
__IO uint32_t misc1
Definition: at32f415_crm.h:797
crm_type::lickstblien
__IO uint32_t lickstblien
Definition: at32f415_crm.h:548
crm_type::ertcsel
__IO uint32_t ertcsel
Definition: at32f415_crm.h:729
crm_type::cmprst
__IO uint32_t cmprst
Definition: at32f415_crm.h:609
crm_type::uart4en
__IO uint32_t uart4en
Definition: at32f415_crm.h:704
crm_type::auto_step_en
__IO uint32_t auto_step_en
Definition: at32f415_crm.h:844
crm_type::usart1en
__IO uint32_t usart1en
Definition: at32f415_crm.h:674
crm_type::ctrl
__IO uint32_t ctrl
Definition: at32f415_crm.h:489
crm_type::apb2en
__IO uint32_t apb2en
Definition: at32f415_crm.h:657
crm_type::apb1rst
__IO uint32_t apb1rst
Definition: at32f415_crm.h:601
crm_type::usbdivrst
__IO uint32_t usbdivrst
Definition: at32f415_crm.h:825
crm_type::uart4rst
__IO uint32_t uart4rst
Definition: at32f415_crm.h:617
crm_type::misc2
__IO uint32_t misc2
Definition: at32f415_crm.h:840
crm_type::tmr11rst
__IO uint32_t tmr11rst
Definition: at32f415_crm.h:591
crm_type::i2c2rst
__IO uint32_t i2c2rst
Definition: at32f415_crm.h:620
crm_type::apb2rst
__IO uint32_t apb2rst
Definition: at32f415_crm.h:570
crm_type::adc1rst
__IO uint32_t adc1rst
Definition: at32f415_crm.h:582
crm_type::adcdiv_h
__IO uint32_t adcdiv_h
Definition: at32f415_crm.h:527
crm_type::cfdf
__IO uint32_t cfdf
Definition: at32f415_crm.h:547
crm_type::pllfref
__IO uint32_t pllfref
Definition: at32f415_crm.h:786
crm_type::pllmult_l
__IO uint32_t pllmult_l
Definition: at32f415_crm.h:523
crm_type::reserved5
__IO uint32_t reserved5
Definition: at32f415_crm.h:588
crm_type::tmr3en
__IO uint32_t tmr3en
Definition: at32f415_crm.h:692
crm_type::usart2rst
__IO uint32_t usart2rst
Definition: at32f415_crm.h:615
crm_type::tmr3rst
__IO uint32_t tmr3rst
Definition: at32f415_crm.h:605
crm_type::hexten
__IO uint32_t hexten
Definition: at32f415_crm.h:496
crm_type::pllns
__IO uint32_t pllns
Definition: at32f415_crm.h:784
crm_type::gpiocrst
__IO uint32_t gpiocrst
Definition: at32f415_crm.h:577
crm_type::bpdc
__IO uint32_t bpdc
Definition: at32f415_crm.h:722
crm_type::dma1en
__IO uint32_t dma1en
Definition: at32f415_crm.h:637
crm_type::tmr4en
__IO uint32_t tmr4en
Definition: at32f415_crm.h:693
crm_type::usbrst
__IO uint32_t usbrst
Definition: at32f415_crm.h:768
crm_type::tmr1en
__IO uint32_t tmr1en
Definition: at32f415_crm.h:671
crm_type::hickcal_key
__IO uint32_t hickcal_key
Definition: at32f415_crm.h:800
crm_type::pllstblfc
__IO uint32_t pllstblfc
Definition: at32f415_crm.h:558
crm_type::uart5en
__IO uint32_t uart5en
Definition: at32f415_crm.h:705
crm_type::hick_to_usb
__IO uint32_t hick_to_usb
Definition: at32f415_crm.h:846
crm_type::pllhextdiv
__IO uint32_t pllhextdiv
Definition: at32f415_crm.h:522
crm_type::lprstf
__IO uint32_t lprstf
Definition: at32f415_crm.h:755
crm_type::uart5rst
__IO uint32_t uart5rst
Definition: at32f415_crm.h:618
crm_type::hickcal
__IO uint32_t hickcal
Definition: at32f415_crm.h:495
crm_type::sclksel
__IO uint32_t sclksel
Definition: at32f415_crm.h:515
crm_type::gpioben
__IO uint32_t gpioben
Definition: at32f415_crm.h:663
crm_type::tmr11en
__IO uint32_t tmr11en
Definition: at32f415_crm.h:678
crm_type::gpioden
__IO uint32_t gpioden
Definition: at32f415_crm.h:665
crm_type::lextstblfc
__IO uint32_t lextstblfc
Definition: at32f415_crm.h:555
crm_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_crm.h:500
crm_type::usbbufs
__IO uint32_t usbbufs
Definition: at32f415_crm.h:804
crm_type::gpiofen
__IO uint32_t gpiofen
Definition: at32f415_crm.h:667
crm_type::hextbyps
__IO uint32_t hextbyps
Definition: at32f415_crm.h:498
crm_type::otg_extctrl
__IO uint32_t otg_extctrl
Definition: at32f415_crm.h:821
crm_type::reserved7
__IO uint32_t reserved7
Definition: at32f415_crm.h:625
crm_type::wdtrstf
__IO uint32_t wdtrstf
Definition: at32f415_crm.h:753
crm_type::bpdrst
__IO uint32_t bpdrst
Definition: at32f415_crm.h:732
crm_type::tmr10en
__IO uint32_t tmr10en
Definition: at32f415_crm.h:677
crm_type::usart2en
__IO uint32_t usart2en
Definition: at32f415_crm.h:702
crm_type::lickstbl
__IO uint32_t lickstbl
Definition: at32f415_crm.h:746
crm_type::tmr9rst
__IO uint32_t tmr9rst
Definition: at32f415_crm.h:589
crm_type::nrstf
__IO uint32_t nrstf
Definition: at32f415_crm.h:750
crm_type::sramen
__IO uint32_t sramen
Definition: at32f415_crm.h:639
crm_type::lickstblfc
__IO uint32_t lickstblfc
Definition: at32f415_crm.h:554
crm_type::swrstf
__IO uint32_t swrstf
Definition: at32f415_crm.h:752
crm_type::cfdfc
__IO uint32_t cfdfc
Definition: at32f415_crm.h:560
crm_type::pllcfgen
__IO uint32_t pllcfgen
Definition: at32f415_crm.h:788
crm_type::gpioarst
__IO uint32_t gpioarst
Definition: at32f415_crm.h:575
crm_type::apb1en
__IO uint32_t apb1en
Definition: at32f415_crm.h:688
crm_type::tmr10rst
__IO uint32_t tmr10rst
Definition: at32f415_crm.h:590
crm_type::rstfc
__IO uint32_t rstfc
Definition: at32f415_crm.h:748
crm_type::tmr1rst
__IO uint32_t tmr1rst
Definition: at32f415_crm.h:584
crm_type::tmr5en
__IO uint32_t tmr5en
Definition: at32f415_crm.h:694
crm_type::hextstbl
__IO uint32_t hextstbl
Definition: at32f415_crm.h:497
crm_type::usart1rst
__IO uint32_t usart1rst
Definition: at32f415_crm.h:587
crm_type::gpioaen
__IO uint32_t gpioaen
Definition: at32f415_crm.h:662
crm_type::spi2rst
__IO uint32_t spi2rst
Definition: at32f415_crm.h:613
crm_type::spi1rst
__IO uint32_t spi1rst
Definition: at32f415_crm.h:585
crm_type::cfg
__IO uint32_t cfg
Definition: at32f415_crm.h:512
crm_type::i2c1rst
__IO uint32_t i2c1rst
Definition: at32f415_crm.h:619
crm_type::licken
__IO uint32_t licken
Definition: at32f415_crm.h:745
crm_type::pllrcs
__IO uint32_t pllrcs
Definition: at32f415_crm.h:521
crm_type::tmr9en
__IO uint32_t tmr9en
Definition: at32f415_crm.h:676
crm_type::ahbrst
__IO uint32_t ahbrst
Definition: at32f415_crm.h:764
crm_type::hickstblfc
__IO uint32_t hickstblfc
Definition: at32f415_crm.h:556
crm_type::gpiofrst
__IO uint32_t gpiofrst
Definition: at32f415_crm.h:580
crm_type::hickstblien
__IO uint32_t hickstblien
Definition: at32f415_crm.h:550
crm_type::pllstblf
__IO uint32_t pllstblf
Definition: at32f415_crm.h:545
crm_type::hicktrim
__IO uint32_t hicktrim
Definition: at32f415_crm.h:494
crm_type::sdio1en
__IO uint32_t sdio1en
Definition: at32f415_crm.h:645
crm_type::ahben
__IO uint32_t ahben
Definition: at32f415_crm.h:634
crm_type::pllmult_h
__IO uint32_t pllmult_h
Definition: at32f415_crm.h:528
crm_type::wwdten
__IO uint32_t wwdten
Definition: at32f415_crm.h:698
crm_type::flashen
__IO uint32_t flashen
Definition: at32f415_crm.h:641
crm_type::reserved6
__IO uint32_t reserved6
Definition: at32f415_crm.h:592
crm_type::usart3rst
__IO uint32_t usart3rst
Definition: at32f415_crm.h:616
crm_type::gpiocen
__IO uint32_t gpiocen
Definition: at32f415_crm.h:664
crm_type::pllfr
__IO uint32_t pllfr
Definition: at32f415_crm.h:781
crm_type::iomuxen
__IO uint32_t iomuxen
Definition: at32f415_crm.h:660
crm_type::usben
__IO uint32_t usben
Definition: at32f415_crm.h:647
crm_type::usbdiv_h
__IO uint32_t usbdiv_h
Definition: at32f415_crm.h:526
crm_type::lextstblf
__IO uint32_t lextstblf
Definition: at32f415_crm.h:542
crm_type::clkoutdiv
__IO uint32_t clkoutdiv
Definition: at32f415_crm.h:807
crm_type::pwcrst
__IO uint32_t pwcrst
Definition: at32f415_crm.h:624
crm_type::apb2div
__IO uint32_t apb2div
Definition: at32f415_crm.h:519
crm_type::wwdtrst
__IO uint32_t wwdtrst
Definition: at32f415_crm.h:611
crm_type::usart3en
__IO uint32_t usart3en
Definition: at32f415_crm.h:703
crm_type::tmr2rst
__IO uint32_t tmr2rst
Definition: at32f415_crm.h:604
crm_type::adc1en
__IO uint32_t adc1en
Definition: at32f415_crm.h:669
crm_type::pllstbl
__IO uint32_t pllstbl
Definition: at32f415_crm.h:502
crm_type::pllstblien
__IO uint32_t pllstblien
Definition: at32f415_crm.h:552
crm_type::can1rst
__IO uint32_t can1rst
Definition: at32f415_crm.h:622
crm_type::can1en
__IO uint32_t can1en
Definition: at32f415_crm.h:709
crm_type::exintrst
__IO uint32_t exintrst
Definition: at32f415_crm.h:574
crm_type::lextbyps
__IO uint32_t lextbyps
Definition: at32f415_crm.h:727
crm_type::lextstbl
__IO uint32_t lextstbl
Definition: at32f415_crm.h:726
crm_type::usbdiv_l
__IO uint32_t usbdiv_l
Definition: at32f415_crm.h:524
crm_type::reserved3
__IO uint32_t reserved3
crm reserved3 register, offset:0x50~0x48
Definition: at32f415_crm.h:559
crm_type::crcen
__IO uint32_t crcen
Definition: at32f415_crm.h:643
crm_type::tmr2en
__IO uint32_t tmr2en
Definition: at32f415_crm.h:691
crm_type::hick_to_sclk
__IO uint32_t hick_to_sclk
Definition: at32f415_crm.h:847
crm_type::sclksts
__IO uint32_t sclksts
Definition: at32f415_crm.h:516
crm_type::i2c1en
__IO uint32_t i2c1en
Definition: at32f415_crm.h:706
crm_type::hextstblien
__IO uint32_t hextstblien
Definition: at32f415_crm.h:551
crm_type::gpiodrst
__IO uint32_t gpiodrst
Definition: at32f415_crm.h:578
crm_type::ertcen
__IO uint32_t ertcen
Definition: at32f415_crm.h:731
crm_type::ctrlsts
__IO uint32_t ctrlsts
Definition: at32f415_crm.h:742
crm_type::ep3_rmpen
__IO uint32_t ep3_rmpen
Definition: at32f415_crm.h:826
crm_type::bpren
__IO uint32_t bpren
Definition: at32f415_crm.h:711
crm_type::reserved2
__IO uint32_t reserved2
crm reserved2 register, offset:0x40~0x34
Definition: at32f415_crm.h:503
crm_type::hickdiv
__IO uint32_t hickdiv
Definition: at32f415_crm.h:805
crm_type::reserved4
__IO uint32_t reserved4
Definition: at32f415_crm.h:561
crm_type::pllms
__IO uint32_t pllms
Definition: at32f415_crm.h:783
crm_type::wwdtrstf
__IO uint32_t wwdtrstf
Definition: at32f415_crm.h:754
crm_type::porrstf
__IO uint32_t porrstf
Definition: at32f415_crm.h:751
crm_type::hextstblfc
__IO uint32_t hextstblfc
Definition: at32f415_crm.h:557
crm_type::cmpen
__IO uint32_t cmpen
Definition: at32f415_crm.h:696
crm_type::tmr4rst
__IO uint32_t tmr4rst
Definition: at32f415_crm.h:606
crm_type::iomuxrst
__IO uint32_t iomuxrst
Definition: at32f415_crm.h:573
crm_type::cfden
__IO uint32_t cfden
Definition: at32f415_crm.h:499
crm_type::adcdiv_l
__IO uint32_t adcdiv_l
Definition: at32f415_crm.h:520
crm_type::apb1div
__IO uint32_t apb1div
Definition: at32f415_crm.h:518
crm_type::pwcen
__IO uint32_t pwcen
Definition: at32f415_crm.h:712
crm_type::lextstblien
__IO uint32_t lextstblien
Definition: at32f415_crm.h:549
crm_type::lickstblf
__IO uint32_t lickstblf
Definition: at32f415_crm.h:541
crm_type::clkout_sel
__IO uint32_t clkout_sel
Definition: at32f415_crm.h:525
crm_type::hicken
__IO uint32_t hicken
Definition: at32f415_crm.h:492
crm_type::lexten
__IO uint32_t lexten
Definition: at32f415_crm.h:725
crm_type::hickstbl
__IO uint32_t hickstbl
Definition: at32f415_crm.h:493
crm_type::i2c2en
__IO uint32_t i2c2en
Definition: at32f415_crm.h:707
crm_type::spi1en
__IO uint32_t spi1en
Definition: at32f415_crm.h:672
crm_type::dma2en
__IO uint32_t dma2en
Definition: at32f415_crm.h:638
crm_type::pll
__IO uint32_t pll
Definition: at32f415_crm.h:778
crm_type::hextstblf
__IO uint32_t hextstblf
Definition: at32f415_crm.h:544
crm_type::spi2en
__IO uint32_t spi2en
Definition: at32f415_crm.h:700
crm_type::gpiobrst
__IO uint32_t gpiobrst
Definition: at32f415_crm.h:576
crm_type::pllen
__IO uint32_t pllen
Definition: at32f415_crm.h:501
crm_type::tmr5rst
__IO uint32_t tmr5rst
Definition: at32f415_crm.h:607
crm_type::hickstblf
__IO uint32_t hickstblf
Definition: at32f415_crm.h:543
crm_type::clkint
__IO uint32_t clkint
Definition: at32f415_crm.h:538
crm_type::ahbdiv
__IO uint32_t ahbdiv
Definition: at32f415_crm.h:517


AT32F415 Firmwary Library: at32f415_debug.c Source File

  • libraries
  • drivers
  • src
at32f415_debug.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef DEBUG_MODULE_ENABLED
39
49uint32_t debug_device_id_get(void)
50{
51 return DEBUGMCU->pid;
52}
76void debug_periph_mode_set(uint32_t periph_debug_mode, confirm_state new_state)
77{
78 if(new_state != FALSE)
79 {
80 DEBUGMCU->ctrl |= periph_debug_mode;
81 }
82 else
83 {
84 DEBUGMCU->ctrl &= ~periph_debug_mode;
85 }
86}
87
92#endif
93
debug_periph_mode_set
void debug_periph_mode_set(uint32_t periph_debug_mode, confirm_state new_state)
set periph debug mode
Definition: at32f415_debug.c:76
debug_device_id_get
uint32_t debug_device_id_get(void)
get debug device id
Definition: at32f415_debug.c:49
DEBUGMCU
#define DEBUGMCU
Definition: at32f415_debug.h:136
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
FALSE
@ FALSE
Definition: at32f415.h:253
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_debug.h Source File

  • libraries
  • drivers
  • inc
at32f415_debug.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_DEBUG_H
29#define __AT32F415_DEBUG_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
50#define DEBUG_SLEEP ((uint32_t)0x00000001)
51#define DEBUG_STOP ((uint32_t)0x00000002)
52#define DEBUG_STANDBY ((uint32_t)0x00000004)
53#define DEBUG_WDT_PAUSE ((uint32_t)0x00000100)
54#define DEBUG_WWDT_PAUSE ((uint32_t)0x00000200)
55#define DEBUG_TMR1_PAUSE ((uint32_t)0x00000400)
56#define DEBUG_TMR3_PAUSE ((uint32_t)0x00001000)
57#define DEBUG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00008000)
58#define DEBUG_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00010000)
59#define DEBUG_TMR2_PAUSE ((uint32_t)0x00000800)
60#define DEBUG_TMR4_PAUSE ((uint32_t)0x00002000)
61#define DEBUG_CAN1_PAUSE ((uint32_t)0x00004000)
62#define DEBUG_TMR5_PAUSE ((uint32_t)0x00040000)
63#define DEBUG_TMR9_PAUSE ((uint32_t)0x10000000)
64#define DEBUG_TMR10_PAUSE ((uint32_t)0x20000000)
65#define DEBUG_TMR11_PAUSE ((uint32_t)0x40000000)
77typedef struct
78{
82 union
83 {
84 __IO uint32_t pid;
85 struct
86 {
87 __IO uint32_t pid : 32;/* [31:0] */
88 } idcode_bit;
89 };
90
94 union
95 {
96 __IO uint32_t ctrl;
97 struct
98 {
99 __IO uint32_t sleep_debug : 1;/* [0] */
100 __IO uint32_t deepsleep_debug : 1;/* [1] */
101 __IO uint32_t standby_debug : 1;/* [2] */
102 __IO uint32_t reserved1 : 2;/* [4:3] */
103 __IO uint32_t trace_ioen : 1;/* [5] */
104 __IO uint32_t trace_mode : 2;/* [7:6] */
105 __IO uint32_t wdt_pause : 1;/* [8] */
106 __IO uint32_t wwdt_pause : 1;/* [9] */
107 __IO uint32_t tmr1_pause : 1;/* [10] */
108 __IO uint32_t tmr2_pause : 1;/* [11] */
109 __IO uint32_t tmr3_pause : 1;/* [12] */
110 __IO uint32_t tmr4_pause : 1;/* [13] */
111 __IO uint32_t can1_pause : 1;/* [14] */
112 __IO uint32_t i2c1_smbus_timeout : 1;/* [15] */
113 __IO uint32_t i2c2_smbus_timeout : 1;/* [16] */
114 __IO uint32_t tim8_pause : 1;/* [17] */
115 __IO uint32_t tim5_pause : 1;/* [18] */
116 __IO uint32_t tim6_pause : 1;/* [19] */
117 __IO uint32_t tim7_pause : 1;/* [20] */
118 __IO uint32_t can2_pause : 1;/* [21] */
119 __IO uint32_t reserved2 : 3;/* [24:22] */
120 __IO uint32_t tim12_pause : 1;/* [25] */
121 __IO uint32_t tim13_pause : 1;/* [26] */
122 __IO uint32_t tim14_pause : 1;/* [27] */
123 __IO uint32_t tim9_pause : 1;/* [28] */
124 __IO uint32_t tim10_pause : 1;/* [29] */
125 __IO uint32_t tim11_pause : 1;/* [30] */
126 __IO uint32_t i2c3_smbus_timeout : 1;/* [31] */
127 } ctrl_bit;
128 };
129
130} debug_type;
131
136#define DEBUGMCU ((debug_type *) DEBUG_BASE)
137
142uint32_t debug_device_id_get(void);
143void debug_periph_mode_set(uint32_t periph_debug_mode, confirm_state new_state);
144
157#ifdef __cplusplus
158}
159#endif
160
161#endif
at32f415.h
at32f415 header file
debug_periph_mode_set
void debug_periph_mode_set(uint32_t periph_debug_mode, confirm_state new_state)
set periph debug mode
Definition: at32f415_debug.c:76
debug_device_id_get
uint32_t debug_device_id_get(void)
get debug device id
Definition: at32f415_debug.c:49
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
debug_type
type define debug register all
Definition: at32f415_debug.h:78
debug_type::can2_pause
__IO uint32_t can2_pause
Definition: at32f415_debug.h:118
debug_type::i2c2_smbus_timeout
__IO uint32_t i2c2_smbus_timeout
Definition: at32f415_debug.h:113
debug_type::tim6_pause
__IO uint32_t tim6_pause
Definition: at32f415_debug.h:116
debug_type::pid
__IO uint32_t pid
Definition: at32f415_debug.h:84
debug_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_debug.h:119
debug_type::sleep_debug
__IO uint32_t sleep_debug
Definition: at32f415_debug.h:99
debug_type::trace_ioen
__IO uint32_t trace_ioen
Definition: at32f415_debug.h:103
debug_type::ctrl
__IO uint32_t ctrl
Definition: at32f415_debug.h:96
debug_type::tmr2_pause
__IO uint32_t tmr2_pause
Definition: at32f415_debug.h:108
debug_type::wdt_pause
__IO uint32_t wdt_pause
Definition: at32f415_debug.h:105
debug_type::tim7_pause
__IO uint32_t tim7_pause
Definition: at32f415_debug.h:117
debug_type::deepsleep_debug
__IO uint32_t deepsleep_debug
Definition: at32f415_debug.h:100
debug_type::tim5_pause
__IO uint32_t tim5_pause
Definition: at32f415_debug.h:115
debug_type::tmr1_pause
__IO uint32_t tmr1_pause
Definition: at32f415_debug.h:107
debug_type::i2c1_smbus_timeout
__IO uint32_t i2c1_smbus_timeout
Definition: at32f415_debug.h:112
debug_type::tim14_pause
__IO uint32_t tim14_pause
Definition: at32f415_debug.h:122
debug_type::trace_mode
__IO uint32_t trace_mode
Definition: at32f415_debug.h:104
debug_type::standby_debug
__IO uint32_t standby_debug
Definition: at32f415_debug.h:101
debug_type::wwdt_pause
__IO uint32_t wwdt_pause
Definition: at32f415_debug.h:106
debug_type::can1_pause
__IO uint32_t can1_pause
Definition: at32f415_debug.h:111
debug_type::tim10_pause
__IO uint32_t tim10_pause
Definition: at32f415_debug.h:124
debug_type::tmr4_pause
__IO uint32_t tmr4_pause
Definition: at32f415_debug.h:110
debug_type::i2c3_smbus_timeout
__IO uint32_t i2c3_smbus_timeout
Definition: at32f415_debug.h:126
debug_type::tim9_pause
__IO uint32_t tim9_pause
Definition: at32f415_debug.h:123
debug_type::tim12_pause
__IO uint32_t tim12_pause
Definition: at32f415_debug.h:120
debug_type::tmr3_pause
__IO uint32_t tmr3_pause
Definition: at32f415_debug.h:109
debug_type::tim8_pause
__IO uint32_t tim8_pause
Definition: at32f415_debug.h:114
debug_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_debug.h:102
debug_type::tim13_pause
__IO uint32_t tim13_pause
Definition: at32f415_debug.h:121
debug_type::tim11_pause
__IO uint32_t tim11_pause
Definition: at32f415_debug.h:125


AT32F415 Firmwary Library: at32f415_def.h Source File

  • libraries
  • drivers
  • inc
at32f415_def.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_DEF_H
29#define __AT32F415_DEF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* gnu compiler */
36#if defined (__GNUC__)
37 #ifndef ALIGNED_HEAD
38 #define ALIGNED_HEAD
39 #endif
40 #ifndef ALIGNED_TAIL
41 #define ALIGNED_TAIL __attribute__ ((aligned (4)))
42 #endif
43#endif
44
45/* arm compiler */
46#if defined (__CC_ARM)
47 #ifndef ALIGNED_HEAD
48 #define ALIGNED_HEAD __align(4)
49 #endif
50 #ifndef ALIGNED_TAIL
51 #define ALIGNED_TAIL
52 #endif
53#endif
54
55/* iar compiler */
56#if defined (__ICCARM__)
57 #ifndef ALIGNED_HEAD
58 #define ALIGNED_HEAD
59 #endif
60 #ifndef ALIGNED_TAIL
61 #define ALIGNED_TAIL
62 #endif
63#endif
64
65#ifdef __cplusplus
66}
67#endif
68
69#endif


AT32F415 Firmwary Library: at32f415_dma.c Source File

  • libraries
  • drivers
  • src
at32f415_dma.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef DMA_MODULE_ENABLED
39
64void dma_reset(dma_channel_type* dmax_channely)
65{
66 uint32_t temp = 0;
67 dmax_channely->ctrl_bit.chen = FALSE;
68 dmax_channely->ctrl = 0;
69 dmax_channely->dtcnt = 0;
70 dmax_channely->paddr = 0;
71 dmax_channely->maddr = 0;
72
73 temp = (uint32_t)dmax_channely;
74
75 if((temp & 0x4ff) < 0x408)
76 {
77 /* dma1 channel */
78 DMA1->clr |= (uint32_t)(0x0f << ((((temp & 0xff) - 0x08) / 0x14) * 4));
79 }
80 else if((temp & 0x4ff) < 0x488)
81 {
82 /* dma2 channel */
83 DMA2->clr |= (uint32_t)(0x0f << ((((temp & 0xff) - 0x08) / 0x14) * 4));
84 }
85}
86
109void dma_data_number_set(dma_channel_type* dmax_channely, uint16_t data_number)
110{
111 dmax_channely->dtcnt = data_number;
112}
113
134uint16_t dma_data_number_get(dma_channel_type* dmax_channely)
135{
136 return (uint16_t)dmax_channely->dtcnt;
137}
138
165void dma_interrupt_enable(dma_channel_type* dmax_channely, uint32_t dma_int, confirm_state new_state)
166{
167 if (new_state != FALSE)
168 {
169 dmax_channely->ctrl |= dma_int;
170 }
171 else
172 {
173 dmax_channely->ctrl &= ~dma_int;
174 }
175}
176
198void dma_channel_enable(dma_channel_type* dmax_channely, confirm_state new_state)
199{
200 dmax_channely->ctrl_bit.chen = new_state;
201}
202
236void dma_flexible_config(dma_type* dma_x, uint8_t flex_channelx, dma_flexible_request_type flexible_request)
237{
238 if(dma_x->src_sel1_bit.dma_flex_en == RESET)
239 {
240 dma_x->src_sel1_bit.dma_flex_en = TRUE;
241 }
242
243 if(flex_channelx == FLEX_CHANNEL1)
244 {
245 dma_x->src_sel0_bit.ch1_src = flexible_request;
246 }
247 else if(flex_channelx == FLEX_CHANNEL2)
248 {
249 dma_x->src_sel0_bit.ch2_src = flexible_request;
250 }
251 else if(flex_channelx == FLEX_CHANNEL3)
252 {
253 dma_x->src_sel0_bit.ch3_src = flexible_request;
254 }
255 else if(flex_channelx == FLEX_CHANNEL4)
256 {
257 dma_x->src_sel0_bit.ch4_src = flexible_request;
258 }
259 else if(flex_channelx == FLEX_CHANNEL5)
260 {
261 dma_x->src_sel1_bit.ch5_src = flexible_request;
262 }
263 else if(flex_channelx == FLEX_CHANNEL6)
264 {
265 dma_x->src_sel1_bit.ch6_src = flexible_request;
266 }
267 else
268 {
269 if(flex_channelx == FLEX_CHANNEL7)
270 {
271 dma_x->src_sel1_bit.ch7_src = flexible_request;
272 }
273 }
274}
275
296 flag_status dma_flag_get(uint32_t dmax_flag)
297{
298 flag_status status = RESET;
299 uint32_t temp = 0;
300
301 if(dmax_flag > 0x10000000)
302 {
303 temp = DMA2->sts;
304 }
305 else
306 {
307 temp = DMA1->sts;
308 }
309
310 if ((temp & dmax_flag) != (uint16_t)RESET)
311 {
312 status = SET;
313 }
314 else
315 {
316 status = RESET;
317 }
318
319 return status;
320}
321
342void dma_flag_clear(uint32_t dmax_flag)
343{
344 if(dmax_flag > ((uint32_t)0x10000000))
345 {
346 DMA2->clr = (uint32_t)(dmax_flag & 0x0FFFFFFF);
347 }
348 else
349 {
350 DMA1->clr = dmax_flag;
351 }
352}
353
360void dma_default_para_init(dma_init_type* dma_init_struct)
361{
362 dma_init_struct->peripheral_base_addr = 0x0;
363 dma_init_struct->memory_base_addr = 0x0;
364 dma_init_struct->direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
365 dma_init_struct->buffer_size = 0x0;
366 dma_init_struct->peripheral_inc_enable = FALSE;
367 dma_init_struct->memory_inc_enable = FALSE;
368 dma_init_struct->peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
369 dma_init_struct->memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
370 dma_init_struct->loop_mode_enable = FALSE;
371 dma_init_struct->priority = DMA_PRIORITY_LOW;
372}
373
395void dma_init(dma_channel_type* dmax_channely, dma_init_type* dma_init_struct)
396{
397 /* clear ctrl register dtd bit and m2m bit */
398 dmax_channely->ctrl &= 0xbfef;
399 dmax_channely->ctrl |= dma_init_struct->direction;
400
401 dmax_channely->ctrl_bit.chpl = dma_init_struct->priority;
402 dmax_channely->ctrl_bit.mwidth = dma_init_struct->memory_data_width;
403 dmax_channely->ctrl_bit.pwidth = dma_init_struct->peripheral_data_width;
404 dmax_channely->ctrl_bit.mincm = dma_init_struct->memory_inc_enable;
405 dmax_channely->ctrl_bit.pincm = dma_init_struct->peripheral_inc_enable;
406 dmax_channely->ctrl_bit.lm = dma_init_struct->loop_mode_enable;
407 dmax_channely->dtcnt = dma_init_struct->buffer_size;
408 dmax_channely->paddr = dma_init_struct->peripheral_base_addr;
409 dmax_channely->maddr = dma_init_struct->memory_base_addr;
410}
411
416#endif
417
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
dma_flexible_request_type
dma_flexible_request_type
dma flexible request type
Definition: at32f415_dma.h:151
DMA_PERIPHERAL_DATA_WIDTH_BYTE
@ DMA_PERIPHERAL_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:238
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_BYTE
@ DMA_MEMORY_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:248
DMA_PRIORITY_LOW
@ DMA_PRIORITY_LOW
Definition: at32f415_dma.h:258
FLEX_CHANNEL5
#define FLEX_CHANNEL5
Definition: at32f415_dma.h:68
FLEX_CHANNEL7
#define FLEX_CHANNEL7
Definition: at32f415_dma.h:70
FLEX_CHANNEL3
#define FLEX_CHANNEL3
Definition: at32f415_dma.h:66
FLEX_CHANNEL1
#define FLEX_CHANNEL1
Definition: at32f415_dma.h:64
FLEX_CHANNEL6
#define FLEX_CHANNEL6
Definition: at32f415_dma.h:69
FLEX_CHANNEL4
#define FLEX_CHANNEL4
Definition: at32f415_dma.h:67
FLEX_CHANNEL2
#define FLEX_CHANNEL2
Definition: at32f415_dma.h:65
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_flexible_config
void dma_flexible_config(dma_type *dma_x, uint8_t flex_channelx, dma_flexible_request_type flexible_request)
initialize the dma_x flexible function according to the specified parameters.
Definition: at32f415_dma.c:236
dma_interrupt_enable
void dma_interrupt_enable(dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt
Definition: at32f415_dma.c:165
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_data_number_get
uint16_t dma_data_number_get(dma_channel_type *dmax_channely)
get number of data from dtcnt register
Definition: at32f415_dma.c:134
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
dma_data_number_set
void dma_data_number_set(dma_channel_type *dmax_channely, uint16_t data_number)
set the number of data to be transferred
Definition: at32f415_dma.c:109
DMA2
#define DMA2
Definition: at32f415_dma.h:481
DMA1
#define DMA1
Definition: at32f415_dma.h:472
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
dma_channel_type
type define dma channel register all
Definition: at32f415_dma.h:405
dma_channel_type::dtcnt
__IO uint32_t dtcnt
Definition: at32f415_dma.h:435
dma_channel_type::pwidth
__IO uint32_t pwidth
Definition: at32f415_dma.h:422
dma_channel_type::paddr
__IO uint32_t paddr
Definition: at32f415_dma.h:448
dma_channel_type::mincm
__IO uint32_t mincm
Definition: at32f415_dma.h:421
dma_channel_type::chen
__IO uint32_t chen
Definition: at32f415_dma.h:414
dma_channel_type::ctrl_bit
struct dma_channel_type::@204::@212 ctrl_bit
dma_channel_type::lm
__IO uint32_t lm
Definition: at32f415_dma.h:419
dma_channel_type::mwidth
__IO uint32_t mwidth
Definition: at32f415_dma.h:423
dma_channel_type::maddr
__IO uint32_t maddr
Definition: at32f415_dma.h:460
dma_channel_type::pincm
__IO uint32_t pincm
Definition: at32f415_dma.h:420
dma_channel_type::ctrl
__IO uint32_t ctrl
Definition: at32f415_dma.h:411
dma_channel_type::chpl
__IO uint32_t chpl
Definition: at32f415_dma.h:424
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
dma_type
type define dma register
Definition: at32f415_dma.h:285
dma_type::ch2_src
__IO uint32_t ch2_src
Definition: at32f415_dma.h:378
dma_type::ch3_src
__IO uint32_t ch3_src
Definition: at32f415_dma.h:379
dma_type::dma_flex_en
__IO uint32_t dma_flex_en
Definition: at32f415_dma.h:395
dma_type::src_sel1_bit
struct dma_type::@198::@203 src_sel1_bit
dma_type::ch5_src
__IO uint32_t ch5_src
Definition: at32f415_dma.h:392
dma_type::src_sel0_bit
struct dma_type::@196::@202 src_sel0_bit
dma_type::ch1_src
__IO uint32_t ch1_src
Definition: at32f415_dma.h:377
dma_type::ch7_src
__IO uint32_t ch7_src
Definition: at32f415_dma.h:394
dma_type::ch4_src
__IO uint32_t ch4_src
Definition: at32f415_dma.h:380
dma_type::ch6_src
__IO uint32_t ch6_src
Definition: at32f415_dma.h:393
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_dma.h Source File

  • libraries
  • drivers
  • inc
at32f415_dma.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_DMA_H
29#define __AT32F415_DMA_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
52#define DMA_FDT_INT ((uint32_t)0x00000002)
53#define DMA_HDT_INT ((uint32_t)0x00000004)
54#define DMA_DTERR_INT ((uint32_t)0x00000008)
64#define FLEX_CHANNEL1 ((uint8_t)0x01)
65#define FLEX_CHANNEL2 ((uint8_t)0x02)
66#define FLEX_CHANNEL3 ((uint8_t)0x03)
67#define FLEX_CHANNEL4 ((uint8_t)0x04)
68#define FLEX_CHANNEL5 ((uint8_t)0x05)
69#define FLEX_CHANNEL6 ((uint8_t)0x06)
70#define FLEX_CHANNEL7 ((uint8_t)0x07)
81#define DMA1_GL1_FLAG ((uint32_t)0x00000001)
82#define DMA1_FDT1_FLAG ((uint32_t)0x00000002)
83#define DMA1_HDT1_FLAG ((uint32_t)0x00000004)
84#define DMA1_DTERR1_FLAG ((uint32_t)0x00000008)
85#define DMA1_GL2_FLAG ((uint32_t)0x00000010)
86#define DMA1_FDT2_FLAG ((uint32_t)0x00000020)
87#define DMA1_HDT2_FLAG ((uint32_t)0x00000040)
88#define DMA1_DTERR2_FLAG ((uint32_t)0x00000080)
89#define DMA1_GL3_FLAG ((uint32_t)0x00000100)
90#define DMA1_FDT3_FLAG ((uint32_t)0x00000200)
91#define DMA1_HDT3_FLAG ((uint32_t)0x00000400)
92#define DMA1_DTERR3_FLAG ((uint32_t)0x00000800)
93#define DMA1_GL4_FLAG ((uint32_t)0x00001000)
94#define DMA1_FDT4_FLAG ((uint32_t)0x00002000)
95#define DMA1_HDT4_FLAG ((uint32_t)0x00004000)
96#define DMA1_DTERR4_FLAG ((uint32_t)0x00008000)
97#define DMA1_GL5_FLAG ((uint32_t)0x00010000)
98#define DMA1_FDT5_FLAG ((uint32_t)0x00020000)
99#define DMA1_HDT5_FLAG ((uint32_t)0x00040000)
100#define DMA1_DTERR5_FLAG ((uint32_t)0x00080000)
101#define DMA1_GL6_FLAG ((uint32_t)0x00100000)
102#define DMA1_FDT6_FLAG ((uint32_t)0x00200000)
103#define DMA1_HDT6_FLAG ((uint32_t)0x00400000)
104#define DMA1_DTERR6_FLAG ((uint32_t)0x00800000)
105#define DMA1_GL7_FLAG ((uint32_t)0x01000000)
106#define DMA1_FDT7_FLAG ((uint32_t)0x02000000)
107#define DMA1_HDT7_FLAG ((uint32_t)0x04000000)
108#define DMA1_DTERR7_FLAG ((uint32_t)0x08000000)
110#define DMA2_GL1_FLAG ((uint32_t)0x10000001)
111#define DMA2_FDT1_FLAG ((uint32_t)0x10000002)
112#define DMA2_HDT1_FLAG ((uint32_t)0x10000004)
113#define DMA2_DTERR1_FLAG ((uint32_t)0x10000008)
114#define DMA2_GL2_FLAG ((uint32_t)0x10000010)
115#define DMA2_FDT2_FLAG ((uint32_t)0x10000020)
116#define DMA2_HDT2_FLAG ((uint32_t)0x10000040)
117#define DMA2_DTERR2_FLAG ((uint32_t)0x10000080)
118#define DMA2_GL3_FLAG ((uint32_t)0x10000100)
119#define DMA2_FDT3_FLAG ((uint32_t)0x10000200)
120#define DMA2_HDT3_FLAG ((uint32_t)0x10000400)
121#define DMA2_DTERR3_FLAG ((uint32_t)0x10000800)
122#define DMA2_GL4_FLAG ((uint32_t)0x10001000)
123#define DMA2_FDT4_FLAG ((uint32_t)0x10002000)
124#define DMA2_HDT4_FLAG ((uint32_t)0x10004000)
125#define DMA2_DTERR4_FLAG ((uint32_t)0x10008000)
126#define DMA2_GL5_FLAG ((uint32_t)0x10010000)
127#define DMA2_FDT5_FLAG ((uint32_t)0x10020000)
128#define DMA2_HDT5_FLAG ((uint32_t)0x10040000)
129#define DMA2_DTERR5_FLAG ((uint32_t)0x10080000)
130#define DMA2_GL6_FLAG ((uint32_t)0x10100000)
131#define DMA2_FDT6_FLAG ((uint32_t)0x10200000)
132#define DMA2_HDT6_FLAG ((uint32_t)0x10400000)
133#define DMA2_DTERR6_FLAG ((uint32_t)0x10800000)
134#define DMA2_GL7_FLAG ((uint32_t)0x11000000)
135#define DMA2_FDT7_FLAG ((uint32_t)0x12000000)
136#define DMA2_HDT7_FLAG ((uint32_t)0x14000000)
137#define DMA2_DTERR7_FLAG ((uint32_t)0x18000000)
150typedef enum
151{
152 DMA_FLEXIBLE_ADC1 = 0x01,
153 DMA_FLEXIBLE_SPI1_RX = 0x09,
154 DMA_FLEXIBLE_SPI1_TX = 0x0A,
155 DMA_FLEXIBLE_SPI2_RX = 0x0B,
156 DMA_FLEXIBLE_SPI2_TX = 0x0C,
157 DMA_FLEXIBLE_UART1_RX = 0x19,
158 DMA_FLEXIBLE_UART1_TX = 0x1A,
159 DMA_FLEXIBLE_UART2_RX = 0x1B,
160 DMA_FLEXIBLE_UART2_TX = 0x1C,
161 DMA_FLEXIBLE_UART3_RX = 0x1D,
162 DMA_FLEXIBLE_UART3_TX = 0x1E,
163 DMA_FLEXIBLE_UART4_RX = 0x1F,
164 DMA_FLEXIBLE_UART4_TX = 0x20,
165 DMA_FLEXIBLE_UART5_RX = 0x21,
166 DMA_FLEXIBLE_UART5_TX = 0x22,
167 DMA_FLEXIBLE_I2C1_RX = 0x29,
168 DMA_FLEXIBLE_I2C1_TX = 0x2A,
169 DMA_FLEXIBLE_I2C2_RX = 0x2B,
170 DMA_FLEXIBLE_I2C2_TX = 0x2C,
171 DMA_FLEXIBLE_SDIO1 = 0x31,
172 DMA_FLEXIBLE_TMR1_TRIG = 0x35,
173 DMA_FLEXIBLE_TMR1_HALL = 0x36,
174 DMA_FLEXIBLE_TMR1_OVERFLOW = 0x37,
175 DMA_FLEXIBLE_TMR1_CH1 = 0x38,
176 DMA_FLEXIBLE_TMR1_CH2 = 0x39,
177 DMA_FLEXIBLE_TMR1_CH3 = 0x3A,
178 DMA_FLEXIBLE_TMR1_CH4 = 0x3B,
179 DMA_FLEXIBLE_TMR2_TRIG = 0x3D,
180 DMA_FLEXIBLE_TMR2_OVERFLOW = 0x3F,
181 DMA_FLEXIBLE_TMR2_CH1 = 0x40,
182 DMA_FLEXIBLE_TMR2_CH2 = 0x41,
183 DMA_FLEXIBLE_TMR2_CH3 = 0x42,
184 DMA_FLEXIBLE_TMR2_CH4 = 0x43,
185 DMA_FLEXIBLE_TMR3_TRIG = 0x45,
186 DMA_FLEXIBLE_TMR3_OVERFLOW = 0x47,
187 DMA_FLEXIBLE_TMR3_CH1 = 0x48,
188 DMA_FLEXIBLE_TMR3_CH2 = 0x49,
189 DMA_FLEXIBLE_TMR3_CH3 = 0x4A,
190 DMA_FLEXIBLE_TMR3_CH4 = 0x4B,
191 DMA_FLEXIBLE_TMR4_TRIG = 0x4D,
192 DMA_FLEXIBLE_TMR4_OVERFLOW = 0x4F,
193 DMA_FLEXIBLE_TMR4_CH1 = 0x50,
194 DMA_FLEXIBLE_TMR4_CH2 = 0x51,
195 DMA_FLEXIBLE_TMR4_CH3 = 0x52,
196 DMA_FLEXIBLE_TMR4_CH4 = 0x53,
197 DMA_FLEXIBLE_TMR5_TRIG = 0x55,
198 DMA_FLEXIBLE_TMR5_OVERFLOW = 0x57,
199 DMA_FLEXIBLE_TMR5_CH1 = 0x58,
200 DMA_FLEXIBLE_TMR5_CH2 = 0x59,
201 DMA_FLEXIBLE_TMR5_CH3 = 0x5A,
202 DMA_FLEXIBLE_TMR5_CH4 = 0x5B,
203} dma_flexible_request_type;
204
208typedef enum
209{
210 DMA_DIR_PERIPHERAL_TO_MEMORY = 0x0000,
211 DMA_DIR_MEMORY_TO_PERIPHERAL = 0x0010,
212 DMA_DIR_MEMORY_TO_MEMORY = 0x4000
213} dma_dir_type;
214
218typedef enum
219{
220 DMA_PERIPHERAL_INC_DISABLE = 0x00,
221 DMA_PERIPHERAL_INC_ENABLE = 0x01
222} dma_peripheral_inc_type;
223
227typedef enum
228{
229 DMA_MEMORY_INC_DISABLE = 0x00,
230 DMA_MEMORY_INC_ENABLE = 0x01
231} dma_memory_inc_type;
232
236typedef enum
237{
238 DMA_PERIPHERAL_DATA_WIDTH_BYTE = 0x00,
239 DMA_PERIPHERAL_DATA_WIDTH_HALFWORD = 0x01,
240 DMA_PERIPHERAL_DATA_WIDTH_WORD = 0x02
241} dma_peripheral_data_size_type;
242
246typedef enum
247{
248 DMA_MEMORY_DATA_WIDTH_BYTE = 0x00,
249 DMA_MEMORY_DATA_WIDTH_HALFWORD = 0x01,
250 DMA_MEMORY_DATA_WIDTH_WORD = 0x02
251} dma_memory_data_size_type;
252
256typedef enum
257{
258 DMA_PRIORITY_LOW = 0x00,
259 DMA_PRIORITY_MEDIUM = 0x01,
260 DMA_PRIORITY_HIGH = 0x02,
261 DMA_PRIORITY_VERY_HIGH = 0x03
262} dma_priority_level_type;
263
267typedef struct
268{
269 uint32_t peripheral_base_addr;
270 uint32_t memory_base_addr;
271 dma_dir_type direction;
272 uint16_t buffer_size;
273 confirm_state peripheral_inc_enable;
274 confirm_state memory_inc_enable;
275 dma_peripheral_data_size_type peripheral_data_width;
276 dma_memory_data_size_type memory_data_width;
277 confirm_state loop_mode_enable;
278 dma_priority_level_type priority;
279} dma_init_type;
280
284typedef struct
285{
289 union
290 {
291 __IO uint32_t sts;
292 struct
293 {
294 __IO uint32_t gf1 : 1; /* [0] */
295 __IO uint32_t fdtf1 : 1; /* [1] */
296 __IO uint32_t hdtf1 : 1; /* [2] */
297 __IO uint32_t dterrf1 : 1; /* [3] */
298 __IO uint32_t gf2 : 1; /* [4] */
299 __IO uint32_t fdtf2 : 1; /* [5] */
300 __IO uint32_t hdtf2 : 1; /* [6] */
301 __IO uint32_t dterrf2 : 1; /* [7] */
302 __IO uint32_t gf3 : 1; /* [8] */
303 __IO uint32_t fdtf3 : 1; /* [9] */
304 __IO uint32_t hdtf3 : 1; /* [10] */
305 __IO uint32_t dterrf3 : 1; /* [11] */
306 __IO uint32_t gf4 : 1; /* [12] */
307 __IO uint32_t fdtf4 : 1; /* [13] */
308 __IO uint32_t hdtf4 : 1; /* [14] */
309 __IO uint32_t dterrf4 : 1; /* [15] */
310 __IO uint32_t gf5 : 1; /* [16] */
311 __IO uint32_t fdtf5 : 1; /* [17] */
312 __IO uint32_t hdtf5 : 1; /* [18] */
313 __IO uint32_t dterrf5 : 1; /* [19] */
314 __IO uint32_t gf6 : 1; /* [20] */
315 __IO uint32_t fdtf6 : 1; /* [21] */
316 __IO uint32_t hdtf6 : 1; /* [22] */
317 __IO uint32_t dterrf6 : 1; /* [23] */
318 __IO uint32_t gf7 : 1; /* [24] */
319 __IO uint32_t fdtf7 : 1; /* [25] */
320 __IO uint32_t hdtf7 : 1; /* [26] */
321 __IO uint32_t dterrf7 : 1; /* [27] */
322 __IO uint32_t reserved1 : 4; /* [31:28] */
323 } sts_bit;
324 };
325
329 union
330 {
331 __IO uint32_t clr;
332 struct
333 {
334 __IO uint32_t gfc1 : 1; /* [0] */
335 __IO uint32_t fdtfc1 : 1; /* [1] */
336 __IO uint32_t hdtfc1 : 1; /* [2] */
337 __IO uint32_t dterrfc1 : 1; /* [3] */
338 __IO uint32_t gfc2 : 1; /* [4] */
339 __IO uint32_t fdtfc2 : 1; /* [5] */
340 __IO uint32_t hdtfc2 : 1; /* [6] */
341 __IO uint32_t dterrfc2 : 1; /* [7] */
342 __IO uint32_t gfc3 : 1; /* [8] */
343 __IO uint32_t fdtfc3 : 1; /* [9] */
344 __IO uint32_t hdtfc3 : 1; /* [10] */
345 __IO uint32_t dterrfc3 : 1; /* [11] */
346 __IO uint32_t gfc4 : 1; /* [12] */
347 __IO uint32_t fdtfc4 : 1; /* [13] */
348 __IO uint32_t hdtfc4 : 1; /* [14] */
349 __IO uint32_t dterrfc4 : 1; /* [15] */
350 __IO uint32_t gfc5 : 1; /* [16] */
351 __IO uint32_t fdtfc5 : 1; /* [17] */
352 __IO uint32_t hdtfc5 : 1; /* [18] */
353 __IO uint32_t dterrfc5 : 1; /* [19] */
354 __IO uint32_t gfc6 : 1; /* [20] */
355 __IO uint32_t fdtfc6 : 1; /* [21] */
356 __IO uint32_t hdtfc6 : 1; /* [22] */
357 __IO uint32_t dterrfc6 : 1; /* [23] */
358 __IO uint32_t gfc7 : 1; /* [24] */
359 __IO uint32_t fdtfc7 : 1; /* [25] */
360 __IO uint32_t hdtfc7 : 1; /* [26] */
361 __IO uint32_t dterrfc7 : 1; /* [27] */
362 __IO uint32_t reserved1 : 4; /* [31:28] */
363 } clr_bit;
364 };
368 __IO uint32_t reserved1[38];
372 union
373 {
374 __IO uint32_t src_sel0;
375 struct
376 {
377 __IO uint32_t ch1_src : 8; /* [7:0] */
378 __IO uint32_t ch2_src : 8; /* [15:8] */
379 __IO uint32_t ch3_src : 8; /* [23:16] */
380 __IO uint32_t ch4_src : 8; /* [31:24] */
381 } src_sel0_bit;
382 };
383
387 union
388 {
389 __IO uint32_t src_sel1;
390 struct
391 {
392 __IO uint32_t ch5_src : 8; /* [7:0] */
393 __IO uint32_t ch6_src : 8; /* [15:8] */
394 __IO uint32_t ch7_src : 8; /* [23:16] */
395 __IO uint32_t dma_flex_en : 1; /* [24] */
396 __IO uint32_t reserved1 : 7; /* [31:25] */
397 } src_sel1_bit;
398 };
399} dma_type;
400
404typedef struct
405{
409 union
410 {
411 __IO uint32_t ctrl;
412 struct
413 {
414 __IO uint32_t chen : 1; /* [0] */
415 __IO uint32_t fdtien : 1; /* [1] */
416 __IO uint32_t hdtien : 1; /* [2] */
417 __IO uint32_t dterrien : 1; /* [3] */
418 __IO uint32_t dtd : 1; /* [4] */
419 __IO uint32_t lm : 1; /* [5] */
420 __IO uint32_t pincm : 1; /* [6] */
421 __IO uint32_t mincm : 1; /* [7] */
422 __IO uint32_t pwidth : 2; /* [9:8] */
423 __IO uint32_t mwidth : 2; /* [11:10] */
424 __IO uint32_t chpl : 2; /* [13:12] */
425 __IO uint32_t m2m : 1; /* [14] */
426 __IO uint32_t reserved1 : 17;/* [31:15] */
427 } ctrl_bit;
428 };
429
433 union
434 {
435 __IO uint32_t dtcnt;
436 struct
437 {
438 __IO uint32_t cnt : 16;/* [15:0] */
439 __IO uint32_t reserved1 : 16;/* [31:16] */
440 } dtcnt_bit;
441 };
442
446 union
447 {
448 __IO uint32_t paddr;
449 struct
450 {
451 __IO uint32_t paddr : 32;/* [31:0] */
452 } paddr_bit;
453 };
454
458 union
459 {
460 __IO uint32_t maddr;
461 struct
462 {
463 __IO uint32_t maddr : 32;/* [31:0] */
464 } maddr_bit;
465 };
466} dma_channel_type;
467
472#define DMA1 ((dma_type *) DMA1_BASE)
473#define DMA1_CHANNEL1 ((dma_channel_type *) DMA1_CHANNEL1_BASE)
474#define DMA1_CHANNEL2 ((dma_channel_type *) DMA1_CHANNEL2_BASE)
475#define DMA1_CHANNEL3 ((dma_channel_type *) DMA1_CHANNEL3_BASE)
476#define DMA1_CHANNEL4 ((dma_channel_type *) DMA1_CHANNEL4_BASE)
477#define DMA1_CHANNEL5 ((dma_channel_type *) DMA1_CHANNEL5_BASE)
478#define DMA1_CHANNEL6 ((dma_channel_type *) DMA1_CHANNEL6_BASE)
479#define DMA1_CHANNEL7 ((dma_channel_type *) DMA1_CHANNEL7_BASE)
480
481#define DMA2 ((dma_type *) DMA2_BASE)
482#define DMA2_CHANNEL1 ((dma_channel_type *) DMA2_CHANNEL1_BASE)
483#define DMA2_CHANNEL2 ((dma_channel_type *) DMA2_CHANNEL2_BASE)
484#define DMA2_CHANNEL3 ((dma_channel_type *) DMA2_CHANNEL3_BASE)
485#define DMA2_CHANNEL4 ((dma_channel_type *) DMA2_CHANNEL4_BASE)
486#define DMA2_CHANNEL5 ((dma_channel_type *) DMA2_CHANNEL5_BASE)
487#define DMA2_CHANNEL6 ((dma_channel_type *) DMA2_CHANNEL6_BASE)
488#define DMA2_CHANNEL7 ((dma_channel_type *) DMA2_CHANNEL7_BASE)
489
494void dma_reset(dma_channel_type* dmax_channely);
495void dma_default_para_init(dma_init_type* dma_init_struct);
496void dma_init(dma_channel_type* dmax_channely, dma_init_type* dma_init_struct);
497void dma_channel_enable(dma_channel_type* dmax_channely, confirm_state new_state);
498void dma_flexible_config(dma_type* dma_x, uint8_t flex_channelx, dma_flexible_request_type flexible_request);
499void dma_data_number_set(dma_channel_type* dmax_channely, uint16_t data_number);
500uint16_t dma_data_number_get(dma_channel_type* dmax_channely);
501void dma_interrupt_enable(dma_channel_type* dmax_channely, uint32_t dma_int, confirm_state new_state);
502 flag_status dma_flag_get(uint32_t dmax_flag);
503void dma_flag_clear(uint32_t dmax_flag);
504
505
518#ifdef __cplusplus
519}
520#endif
521
522#endif
at32f415.h
at32f415 header file
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_flexible_config
void dma_flexible_config(dma_type *dma_x, uint8_t flex_channelx, dma_flexible_request_type flexible_request)
initialize the dma_x flexible function according to the specified parameters.
Definition: at32f415_dma.c:236
dma_interrupt_enable
void dma_interrupt_enable(dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt
Definition: at32f415_dma.c:165
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_data_number_get
uint16_t dma_data_number_get(dma_channel_type *dmax_channely)
get number of data from dtcnt register
Definition: at32f415_dma.c:134
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
dma_data_number_set
void dma_data_number_set(dma_channel_type *dmax_channely, uint16_t data_number)
set the number of data to be transferred
Definition: at32f415_dma.c:109
dma_peripheral_inc_type
dma_peripheral_inc_type
dma peripheral incremented type
Definition: at32f415_dma.h:219
dma_peripheral_data_size_type
dma_peripheral_data_size_type
dma peripheral data size type
Definition: at32f415_dma.h:237
dma_flexible_request_type
dma_flexible_request_type
dma flexible request type
Definition: at32f415_dma.h:151
dma_dir_type
dma_dir_type
dma direction type
Definition: at32f415_dma.h:209
dma_memory_data_size_type
dma_memory_data_size_type
dma memory data size type
Definition: at32f415_dma.h:247
dma_priority_level_type
dma_priority_level_type
dma priority level type
Definition: at32f415_dma.h:257
dma_memory_inc_type
dma_memory_inc_type
dma memory incremented type
Definition: at32f415_dma.h:228
DMA_PERIPHERAL_INC_DISABLE
@ DMA_PERIPHERAL_INC_DISABLE
Definition: at32f415_dma.h:220
DMA_PERIPHERAL_INC_ENABLE
@ DMA_PERIPHERAL_INC_ENABLE
Definition: at32f415_dma.h:221
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_PERIPHERAL_DATA_WIDTH_WORD
@ DMA_PERIPHERAL_DATA_WIDTH_WORD
Definition: at32f415_dma.h:240
DMA_PERIPHERAL_DATA_WIDTH_BYTE
@ DMA_PERIPHERAL_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:238
DMA_FLEXIBLE_TMR4_OVERFLOW
@ DMA_FLEXIBLE_TMR4_OVERFLOW
Definition: at32f415_dma.h:192
DMA_FLEXIBLE_TMR4_CH4
@ DMA_FLEXIBLE_TMR4_CH4
Definition: at32f415_dma.h:196
DMA_FLEXIBLE_SDIO1
@ DMA_FLEXIBLE_SDIO1
Definition: at32f415_dma.h:171
DMA_FLEXIBLE_UART5_RX
@ DMA_FLEXIBLE_UART5_RX
Definition: at32f415_dma.h:165
DMA_FLEXIBLE_UART3_TX
@ DMA_FLEXIBLE_UART3_TX
Definition: at32f415_dma.h:162
DMA_FLEXIBLE_TMR4_CH2
@ DMA_FLEXIBLE_TMR4_CH2
Definition: at32f415_dma.h:194
DMA_FLEXIBLE_I2C2_TX
@ DMA_FLEXIBLE_I2C2_TX
Definition: at32f415_dma.h:170
DMA_FLEXIBLE_TMR4_CH3
@ DMA_FLEXIBLE_TMR4_CH3
Definition: at32f415_dma.h:195
DMA_FLEXIBLE_TMR5_CH3
@ DMA_FLEXIBLE_TMR5_CH3
Definition: at32f415_dma.h:201
DMA_FLEXIBLE_TMR2_OVERFLOW
@ DMA_FLEXIBLE_TMR2_OVERFLOW
Definition: at32f415_dma.h:180
DMA_FLEXIBLE_UART2_RX
@ DMA_FLEXIBLE_UART2_RX
Definition: at32f415_dma.h:159
DMA_FLEXIBLE_TMR4_TRIG
@ DMA_FLEXIBLE_TMR4_TRIG
Definition: at32f415_dma.h:191
DMA_FLEXIBLE_TMR1_HALL
@ DMA_FLEXIBLE_TMR1_HALL
Definition: at32f415_dma.h:173
DMA_FLEXIBLE_TMR3_OVERFLOW
@ DMA_FLEXIBLE_TMR3_OVERFLOW
Definition: at32f415_dma.h:186
DMA_FLEXIBLE_TMR3_CH2
@ DMA_FLEXIBLE_TMR3_CH2
Definition: at32f415_dma.h:188
DMA_FLEXIBLE_SPI2_RX
@ DMA_FLEXIBLE_SPI2_RX
Definition: at32f415_dma.h:155
DMA_FLEXIBLE_UART1_TX
@ DMA_FLEXIBLE_UART1_TX
Definition: at32f415_dma.h:158
DMA_FLEXIBLE_TMR2_TRIG
@ DMA_FLEXIBLE_TMR2_TRIG
Definition: at32f415_dma.h:179
DMA_FLEXIBLE_TMR3_CH1
@ DMA_FLEXIBLE_TMR3_CH1
Definition: at32f415_dma.h:187
DMA_FLEXIBLE_TMR2_CH2
@ DMA_FLEXIBLE_TMR2_CH2
Definition: at32f415_dma.h:182
DMA_FLEXIBLE_TMR3_CH4
@ DMA_FLEXIBLE_TMR3_CH4
Definition: at32f415_dma.h:190
DMA_FLEXIBLE_TMR5_CH1
@ DMA_FLEXIBLE_TMR5_CH1
Definition: at32f415_dma.h:199
DMA_FLEXIBLE_TMR2_CH1
@ DMA_FLEXIBLE_TMR2_CH1
Definition: at32f415_dma.h:181
DMA_FLEXIBLE_TMR1_CH4
@ DMA_FLEXIBLE_TMR1_CH4
Definition: at32f415_dma.h:178
DMA_FLEXIBLE_I2C1_RX
@ DMA_FLEXIBLE_I2C1_RX
Definition: at32f415_dma.h:167
DMA_FLEXIBLE_TMR2_CH4
@ DMA_FLEXIBLE_TMR2_CH4
Definition: at32f415_dma.h:184
DMA_FLEXIBLE_TMR5_CH4
@ DMA_FLEXIBLE_TMR5_CH4
Definition: at32f415_dma.h:202
DMA_FLEXIBLE_TMR1_CH1
@ DMA_FLEXIBLE_TMR1_CH1
Definition: at32f415_dma.h:175
DMA_FLEXIBLE_ADC1
@ DMA_FLEXIBLE_ADC1
Definition: at32f415_dma.h:152
DMA_FLEXIBLE_UART2_TX
@ DMA_FLEXIBLE_UART2_TX
Definition: at32f415_dma.h:160
DMA_FLEXIBLE_UART4_TX
@ DMA_FLEXIBLE_UART4_TX
Definition: at32f415_dma.h:164
DMA_FLEXIBLE_TMR4_CH1
@ DMA_FLEXIBLE_TMR4_CH1
Definition: at32f415_dma.h:193
DMA_FLEXIBLE_TMR1_TRIG
@ DMA_FLEXIBLE_TMR1_TRIG
Definition: at32f415_dma.h:172
DMA_FLEXIBLE_UART1_RX
@ DMA_FLEXIBLE_UART1_RX
Definition: at32f415_dma.h:157
DMA_FLEXIBLE_SPI1_RX
@ DMA_FLEXIBLE_SPI1_RX
Definition: at32f415_dma.h:153
DMA_FLEXIBLE_UART3_RX
@ DMA_FLEXIBLE_UART3_RX
Definition: at32f415_dma.h:161
DMA_FLEXIBLE_TMR1_CH2
@ DMA_FLEXIBLE_TMR1_CH2
Definition: at32f415_dma.h:176
DMA_FLEXIBLE_TMR5_OVERFLOW
@ DMA_FLEXIBLE_TMR5_OVERFLOW
Definition: at32f415_dma.h:198
DMA_FLEXIBLE_TMR5_TRIG
@ DMA_FLEXIBLE_TMR5_TRIG
Definition: at32f415_dma.h:197
DMA_FLEXIBLE_UART4_RX
@ DMA_FLEXIBLE_UART4_RX
Definition: at32f415_dma.h:163
DMA_FLEXIBLE_TMR3_TRIG
@ DMA_FLEXIBLE_TMR3_TRIG
Definition: at32f415_dma.h:185
DMA_FLEXIBLE_I2C2_RX
@ DMA_FLEXIBLE_I2C2_RX
Definition: at32f415_dma.h:169
DMA_FLEXIBLE_TMR2_CH3
@ DMA_FLEXIBLE_TMR2_CH3
Definition: at32f415_dma.h:183
DMA_FLEXIBLE_I2C1_TX
@ DMA_FLEXIBLE_I2C1_TX
Definition: at32f415_dma.h:168
DMA_FLEXIBLE_SPI1_TX
@ DMA_FLEXIBLE_SPI1_TX
Definition: at32f415_dma.h:154
DMA_FLEXIBLE_TMR5_CH2
@ DMA_FLEXIBLE_TMR5_CH2
Definition: at32f415_dma.h:200
DMA_FLEXIBLE_SPI2_TX
@ DMA_FLEXIBLE_SPI2_TX
Definition: at32f415_dma.h:156
DMA_FLEXIBLE_TMR1_OVERFLOW
@ DMA_FLEXIBLE_TMR1_OVERFLOW
Definition: at32f415_dma.h:174
DMA_FLEXIBLE_TMR1_CH3
@ DMA_FLEXIBLE_TMR1_CH3
Definition: at32f415_dma.h:177
DMA_FLEXIBLE_TMR3_CH3
@ DMA_FLEXIBLE_TMR3_CH3
Definition: at32f415_dma.h:189
DMA_FLEXIBLE_UART5_TX
@ DMA_FLEXIBLE_UART5_TX
Definition: at32f415_dma.h:166
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_DIR_MEMORY_TO_MEMORY
@ DMA_DIR_MEMORY_TO_MEMORY
Definition: at32f415_dma.h:212
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_WORD
@ DMA_MEMORY_DATA_WIDTH_WORD
Definition: at32f415_dma.h:250
DMA_MEMORY_DATA_WIDTH_BYTE
@ DMA_MEMORY_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:248
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_HIGH
@ DMA_PRIORITY_HIGH
Definition: at32f415_dma.h:260
DMA_PRIORITY_MEDIUM
@ DMA_PRIORITY_MEDIUM
Definition: at32f415_dma.h:259
DMA_PRIORITY_VERY_HIGH
@ DMA_PRIORITY_VERY_HIGH
Definition: at32f415_dma.h:261
DMA_PRIORITY_LOW
@ DMA_PRIORITY_LOW
Definition: at32f415_dma.h:258
DMA_MEMORY_INC_ENABLE
@ DMA_MEMORY_INC_ENABLE
Definition: at32f415_dma.h:230
DMA_MEMORY_INC_DISABLE
@ DMA_MEMORY_INC_DISABLE
Definition: at32f415_dma.h:229
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
dma_channel_type
type define dma channel register all
Definition: at32f415_dma.h:405
dma_channel_type::dtcnt
__IO uint32_t dtcnt
Definition: at32f415_dma.h:435
dma_channel_type::cnt
__IO uint32_t cnt
Definition: at32f415_dma.h:438
dma_channel_type::pwidth
__IO uint32_t pwidth
Definition: at32f415_dma.h:422
dma_channel_type::paddr
__IO uint32_t paddr
Definition: at32f415_dma.h:448
dma_channel_type::mincm
__IO uint32_t mincm
Definition: at32f415_dma.h:421
dma_channel_type::dterrien
__IO uint32_t dterrien
Definition: at32f415_dma.h:417
dma_channel_type::chen
__IO uint32_t chen
Definition: at32f415_dma.h:414
dma_channel_type::lm
__IO uint32_t lm
Definition: at32f415_dma.h:419
dma_channel_type::mwidth
__IO uint32_t mwidth
Definition: at32f415_dma.h:423
dma_channel_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_dma.h:426
dma_channel_type::dtd
__IO uint32_t dtd
Definition: at32f415_dma.h:418
dma_channel_type::maddr
__IO uint32_t maddr
Definition: at32f415_dma.h:460
dma_channel_type::hdtien
__IO uint32_t hdtien
Definition: at32f415_dma.h:416
dma_channel_type::m2m
__IO uint32_t m2m
Definition: at32f415_dma.h:425
dma_channel_type::pincm
__IO uint32_t pincm
Definition: at32f415_dma.h:420
dma_channel_type::ctrl
__IO uint32_t ctrl
Definition: at32f415_dma.h:411
dma_channel_type::fdtien
__IO uint32_t fdtien
Definition: at32f415_dma.h:415
dma_channel_type::chpl
__IO uint32_t chpl
Definition: at32f415_dma.h:424
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
dma_type
type define dma register
Definition: at32f415_dma.h:285
dma_type::gfc3
__IO uint32_t gfc3
Definition: at32f415_dma.h:342
dma_type::dterrfc1
__IO uint32_t dterrfc1
Definition: at32f415_dma.h:337
dma_type::ch2_src
__IO uint32_t ch2_src
Definition: at32f415_dma.h:378
dma_type::gfc2
__IO uint32_t gfc2
Definition: at32f415_dma.h:338
dma_type::src_sel1
__IO uint32_t src_sel1
Definition: at32f415_dma.h:389
dma_type::ch3_src
__IO uint32_t ch3_src
Definition: at32f415_dma.h:379
dma_type::hdtfc3
__IO uint32_t hdtfc3
Definition: at32f415_dma.h:344
dma_type::fdtfc2
__IO uint32_t fdtfc2
Definition: at32f415_dma.h:339
dma_type::hdtf7
__IO uint32_t hdtf7
Definition: at32f415_dma.h:320
dma_type::gfc1
__IO uint32_t gfc1
Definition: at32f415_dma.h:334
dma_type::gf4
__IO uint32_t gf4
Definition: at32f415_dma.h:306
dma_type::hdtf2
__IO uint32_t hdtf2
Definition: at32f415_dma.h:300
dma_type::hdtf3
__IO uint32_t hdtf3
Definition: at32f415_dma.h:304
dma_type::dma_flex_en
__IO uint32_t dma_flex_en
Definition: at32f415_dma.h:395
dma_type::fdtf7
__IO uint32_t fdtf7
Definition: at32f415_dma.h:319
dma_type::reserved1
__IO uint32_t reserved1
reserved, offset:0x08~0x9C
Definition: at32f415_dma.h:322
dma_type::dterrfc2
__IO uint32_t dterrfc2
Definition: at32f415_dma.h:341
dma_type::dterrf4
__IO uint32_t dterrf4
Definition: at32f415_dma.h:309
dma_type::gf7
__IO uint32_t gf7
Definition: at32f415_dma.h:318
dma_type::fdtfc4
__IO uint32_t fdtfc4
Definition: at32f415_dma.h:347
dma_type::src_sel0
__IO uint32_t src_sel0
Definition: at32f415_dma.h:374
dma_type::gf2
__IO uint32_t gf2
Definition: at32f415_dma.h:298
dma_type::hdtfc6
__IO uint32_t hdtfc6
Definition: at32f415_dma.h:356
dma_type::dterrf5
__IO uint32_t dterrf5
Definition: at32f415_dma.h:313
dma_type::hdtf5
__IO uint32_t hdtf5
Definition: at32f415_dma.h:312
dma_type::fdtfc5
__IO uint32_t fdtfc5
Definition: at32f415_dma.h:351
dma_type::fdtfc1
__IO uint32_t fdtfc1
Definition: at32f415_dma.h:335
dma_type::hdtf4
__IO uint32_t hdtf4
Definition: at32f415_dma.h:308
dma_type::ch5_src
__IO uint32_t ch5_src
Definition: at32f415_dma.h:392
dma_type::fdtf1
__IO uint32_t fdtf1
Definition: at32f415_dma.h:295
dma_type::gfc6
__IO uint32_t gfc6
Definition: at32f415_dma.h:354
dma_type::dterrf6
__IO uint32_t dterrf6
Definition: at32f415_dma.h:317
dma_type::fdtf4
__IO uint32_t fdtf4
Definition: at32f415_dma.h:307
dma_type::dterrf2
__IO uint32_t dterrf2
Definition: at32f415_dma.h:301
dma_type::gfc4
__IO uint32_t gfc4
Definition: at32f415_dma.h:346
dma_type::dterrfc3
__IO uint32_t dterrfc3
Definition: at32f415_dma.h:345
dma_type::dterrf1
__IO uint32_t dterrf1
Definition: at32f415_dma.h:297
dma_type::hdtfc1
__IO uint32_t hdtfc1
Definition: at32f415_dma.h:336
dma_type::sts
__IO uint32_t sts
Definition: at32f415_dma.h:291
dma_type::dterrf3
__IO uint32_t dterrf3
Definition: at32f415_dma.h:305
dma_type::fdtf5
__IO uint32_t fdtf5
Definition: at32f415_dma.h:311
dma_type::clr
__IO uint32_t clr
Definition: at32f415_dma.h:331
dma_type::fdtfc7
__IO uint32_t fdtfc7
Definition: at32f415_dma.h:359
dma_type::fdtf2
__IO uint32_t fdtf2
Definition: at32f415_dma.h:299
dma_type::gf1
__IO uint32_t gf1
Definition: at32f415_dma.h:294
dma_type::fdtf3
__IO uint32_t fdtf3
Definition: at32f415_dma.h:303
dma_type::hdtfc5
__IO uint32_t hdtfc5
Definition: at32f415_dma.h:352
dma_type::gf3
__IO uint32_t gf3
Definition: at32f415_dma.h:302
dma_type::dterrfc6
__IO uint32_t dterrfc6
Definition: at32f415_dma.h:357
dma_type::fdtfc3
__IO uint32_t fdtfc3
Definition: at32f415_dma.h:343
dma_type::hdtfc2
__IO uint32_t hdtfc2
Definition: at32f415_dma.h:340
dma_type::fdtfc6
__IO uint32_t fdtfc6
Definition: at32f415_dma.h:355
dma_type::ch1_src
__IO uint32_t ch1_src
Definition: at32f415_dma.h:377
dma_type::dterrfc7
__IO uint32_t dterrfc7
Definition: at32f415_dma.h:361
dma_type::gf6
__IO uint32_t gf6
Definition: at32f415_dma.h:314
dma_type::fdtf6
__IO uint32_t fdtf6
Definition: at32f415_dma.h:315
dma_type::gfc5
__IO uint32_t gfc5
Definition: at32f415_dma.h:350
dma_type::hdtfc7
__IO uint32_t hdtfc7
Definition: at32f415_dma.h:360
dma_type::dterrfc5
__IO uint32_t dterrfc5
Definition: at32f415_dma.h:353
dma_type::gfc7
__IO uint32_t gfc7
Definition: at32f415_dma.h:358
dma_type::hdtf1
__IO uint32_t hdtf1
Definition: at32f415_dma.h:296
dma_type::ch7_src
__IO uint32_t ch7_src
Definition: at32f415_dma.h:394
dma_type::ch4_src
__IO uint32_t ch4_src
Definition: at32f415_dma.h:380
dma_type::dterrf7
__IO uint32_t dterrf7
Definition: at32f415_dma.h:321
dma_type::dterrfc4
__IO uint32_t dterrfc4
Definition: at32f415_dma.h:349
dma_type::gf5
__IO uint32_t gf5
Definition: at32f415_dma.h:310
dma_type::hdtfc4
__IO uint32_t hdtfc4
Definition: at32f415_dma.h:348
dma_type::ch6_src
__IO uint32_t ch6_src
Definition: at32f415_dma.h:393
dma_type::hdtf6
__IO uint32_t hdtf6
Definition: at32f415_dma.h:316


AT32F415 Firmwary Library: at32f415_ertc.c Source File

  • libraries
  • drivers
  • src
at32f415_ertc.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef ERTC_MODULE_ENABLED
39
44#define ERTC_TIMEOUT ((uint32_t) 0x00360000)
45
51uint8_t ertc_num_to_bcd(uint8_t num)
52{
53 uint8_t bcd_h = 0, bcd_l = 0;
54
55 bcd_h = num / 10;
56 bcd_l = num % 10;
57
58 return ((uint8_t)(bcd_h << 4) | bcd_l);
59}
60
66uint8_t ertc_bcd_to_num(uint8_t bcd)
67{
68 return ((((uint8_t)(bcd & (uint8_t)0xF0) >> 4) * 10) + (bcd & (uint8_t)0x0F));
69}
70
76void ertc_write_protect_enable(void)
77{
78 ERTC->wp = 0xFF;
79}
80
86void ertc_write_protect_disable(void)
87{
88 ERTC->wp = 0xCA;
89 ERTC->wp = 0x53;
90}
91
97 error_status ertc_wait_update(void)
98{
99 uint32_t timeout = ERTC_TIMEOUT * 2;
100
101 /* disable write protection */
102 ertc_write_protect_disable();
103
104 /* clear updf flag */
105 ERTC->sts = ~(ERTC_UPDF_FLAG | 0x00000080) | (ERTC->sts_bit.imen << 7);
106
107 /* enable write protection */
108 ertc_write_protect_enable();
109
110 while(ERTC->sts_bit.updf == 0)
111 {
112 if(timeout == 0)
113 {
114 return ERROR;
115 }
116
117 timeout--;
118 }
119
120 return SUCCESS;
121}
122
138 error_status ertc_wait_flag(uint32_t flag, flag_status status)
139{
140 uint32_t timeout = ERTC_TIMEOUT;
141
142 while(ertc_flag_get(flag) == status)
143 {
144 if(timeout == 0)
145 {
146 /* enable write protection */
147 ertc_write_protect_enable();
148
149 return ERROR;
150 }
151
152 timeout--;
153 }
154
155 return SUCCESS;
156}
157
163 error_status ertc_init_mode_enter(void)
164{
165 uint32_t timeout = ERTC_TIMEOUT * 2;
166
167 /* disable write protection */
168 ertc_write_protect_disable();
169
170 if(ERTC->sts_bit.imf == 0)
171 {
172 /* enter init mode */
173 ERTC->sts = 0xFFFFFFFF;
174
175 while(ERTC->sts_bit.imf == 0)
176 {
177 if(timeout == 0)
178 {
179 /* enable write protection */
180 ertc_write_protect_enable();
181
182 return ERROR;
183 }
184
185 timeout--;
186 }
187 }
188
189 return SUCCESS;
190}
191
197void ertc_init_mode_exit(void)
198{
199 ERTC->sts = 0xFFFFFF7F;
200}
201
207 error_status ertc_reset(void)
208{
209 /* disable write protection */
210 ertc_write_protect_disable();
211
212 ERTC->ctrl = (uint32_t)0x00000000;
213
214 /* enter init mode */
215 if(ertc_init_mode_enter() != SUCCESS)
216 {
217 return ERROR;
218 }
219
220 /* reset register */
221 ERTC->time = (uint32_t)0x00000000;
222 ERTC->date = (uint32_t)0x00002101;
223 ERTC->ctrl = (uint32_t)0x00000000;
224 ERTC->div = (uint32_t)0x007F00FF;
225 ERTC->wat = (uint32_t)0x0000FFFF;
226 ERTC->ccal = (uint32_t)0x00000000;
227 ERTC->ala = (uint32_t)0x00000000;
228 ERTC->alb = (uint32_t)0x00000000;
229 ERTC->tadj = (uint32_t)0x00000000;
230 ERTC->scal = (uint32_t)0x00000000;
231 ERTC->tamp = (uint32_t)0x00000000;
232 ERTC->alasbs = (uint32_t)0x00000000;
233 ERTC->albsbs = (uint32_t)0x00000000;
234 ERTC->sts = (uint32_t)0x00000000;
235
236 /* wait calendar update */
237 ertc_wait_update();
238
239 /* enable write protection */
240 ertc_write_protect_enable();
241
242 return SUCCESS;
243}
244
251 error_status ertc_divider_set(uint16_t div_a, uint16_t div_b)
252{
253 /* disable write protection */
254 ertc_write_protect_disable();
255
256 /* enter init mode */
257 if(ertc_init_mode_enter() != SUCCESS)
258 {
259 return ERROR;
260 }
261
262 /* config the ertc divider */
263 ERTC->div_bit.diva = div_a;
264 ERTC->div_bit.divb = div_b;
265
266 /* exit init mode */
267 ertc_init_mode_exit();
268
269 /* enable write protection */
270 ertc_write_protect_enable();
271
272 return SUCCESS;
273}
274
283 error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode)
284{
285 /* disable write protection */
286 ertc_write_protect_disable();
287
288 /* enter init mode */
289 if(ertc_init_mode_enter() != SUCCESS)
290 {
291 return ERROR;
292 }
293
294 /* write register */
295 ERTC->ctrl_bit.hm = mode;
296
297 /* exit init mode */
298 ertc_init_mode_exit();
299
300 /* enable write protection */
301 ertc_write_protect_enable();
302
303 return SUCCESS;
304}
305
314 error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
315{
316 ertc_reg_date_type reg;
317
318 reg.date = 0;
319
320 reg.date_bit.y = ertc_num_to_bcd(year);
321 reg.date_bit.m = ertc_num_to_bcd(month);
322 reg.date_bit.d = ertc_num_to_bcd(date);
323 reg.date_bit.wk = week;
324
325 /* disable write protection */
326 ertc_write_protect_disable();
327
328 /* enter init mode */
329 if(ertc_init_mode_enter() != SUCCESS)
330 {
331 return ERROR;
332 }
333
334 /* Set the ertc_DR register */
335 ERTC->date = reg.date;
336
337 /* exit init mode */
338 ertc_init_mode_exit();
339
340 if(ERTC->ctrl_bit.dren == 0)
341 {
342 ertc_wait_update();
343 }
344
345 /* enable write protection */
346 ertc_write_protect_enable();
347
348 return SUCCESS;
349}
350
363 error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
364{
365 ertc_reg_time_type reg;
366
367 reg.time = 0;
368
369 reg.time_bit.h = ertc_num_to_bcd(hour);
370 reg.time_bit.m = ertc_num_to_bcd(min);
371 reg.time_bit.s = ertc_num_to_bcd(sec);
372 reg.time_bit.ampm = ampm;
373
374 /* disable write protection */
375 ertc_write_protect_disable();
376
377 /* enter init mode */
378 if(ertc_init_mode_enter() != SUCCESS)
379 {
380 return ERROR;
381 }
382
383 ERTC->time = reg.time;
384
385 /* exit init mode */
386 ertc_init_mode_exit();
387
388 if(ERTC->ctrl_bit.dren == 0)
389 {
390 ertc_wait_update();
391 }
392
393 /* enable write protection */
394 ertc_write_protect_enable();
395
396 return SUCCESS;
397}
398
404void ertc_calendar_get(ertc_time_type* time)
405{
406 ertc_reg_time_type reg_tm;
407 ertc_reg_date_type reg_dt;
408
409 (void) (ERTC->sts);
410
411 reg_tm.time = ERTC->time;
412 reg_dt.date = ERTC->date;
413
414 time->hour = ertc_bcd_to_num(reg_tm.time_bit.h);
415 time->min = ertc_bcd_to_num(reg_tm.time_bit.m);
416 time->sec = ertc_bcd_to_num(reg_tm.time_bit.s);
417 time->ampm = (ertc_am_pm_type)reg_tm.time_bit.ampm;
418
419 time->year = ertc_bcd_to_num(reg_dt.date_bit.y);
420 time->month = ertc_bcd_to_num(reg_dt.date_bit.m);
421 time->day = ertc_bcd_to_num(reg_dt.date_bit.d);
422 time->week = reg_dt.date_bit.wk;
423}
424
430uint32_t ertc_sub_second_get(void)
431{
432 uint32_t reg = 0;
433
434 reg = ERTC->sbs;
435
436 (void) (ERTC->date);
437
438 return (reg);
439}
440
458void ertc_alarm_mask_set(ertc_alarm_type alarm_x, uint32_t mask)
459{
460 uint32_t reg;
461
462 /* disable write protection */
463 ertc_write_protect_disable();
464
465 if(alarm_x == ERTC_ALA)
466 {
467 reg = ERTC->ala;
468
469 reg &= ~ERTC_ALARM_MASK_ALL;
470 reg |= mask;
471
472 ERTC->ala= reg;
473 }
474 else
475 {
476 reg = ERTC->alb;
477
478 reg &= ~ERTC_ALARM_MASK_ALL;
479 reg |= mask;
480
481 ERTC->alb= reg;
482 }
483
484 /* enable write protection */
485 ertc_write_protect_enable();
486}
487
500void ertc_alarm_week_date_select(ertc_alarm_type alarm_x, ertc_week_date_select_type wk)
501{
502 /* disable write protection */
503 ertc_write_protect_disable();
504
505 if(alarm_x == ERTC_ALA)
506 {
507 ERTC->ala_bit.wksel = wk;
508 }
509 else
510 {
511 ERTC->alb_bit.wksel = wk;
512 }
513
514 /* enable write protection */
515 ertc_write_protect_enable();
516}
517
538void ertc_alarm_set(ertc_alarm_type alarm_x, uint8_t week_date, uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
539{
540 ertc_reg_alarm_type reg;
541
542 if(alarm_x == ERTC_ALA)
543 {
544 reg.ala = ERTC->ala;
545 }
546 else
547 {
548 reg.ala = ERTC->alb;
549 }
550
551 reg.ala_bit.d = ertc_num_to_bcd(week_date);
552 reg.ala_bit.h = ertc_num_to_bcd(hour);
553 reg.ala_bit.m = ertc_num_to_bcd(min);
554 reg.ala_bit.s = ertc_num_to_bcd(sec);
555 reg.ala_bit.ampm = ampm;
556
557 /* disable write protection */
558 ertc_write_protect_disable();
559
560 if(alarm_x == ERTC_ALA)
561 {
562 ERTC->ala= reg.ala;
563 }
564 else
565 {
566 ERTC->alb = reg.ala;
567 }
568
569 /* enable write protection */
570 ertc_write_protect_enable();
571}
572
600void ertc_alarm_sub_second_set(ertc_alarm_type alarm_x, uint32_t value, ertc_alarm_sbs_mask_type mask)
601{
602 /* disable write protection */
603 ertc_write_protect_disable();
604
605 if(alarm_x == ERTC_ALA)
606 {
607 ERTC->alasbs_bit.sbsmsk = mask;
608 ERTC->alasbs_bit.sbs = value;
609 }
610 else
611 {
612 ERTC->albsbs_bit.sbsmsk = mask;
613 ERTC->albsbs_bit.sbs = value;
614 }
615
616 /* enable write protection */
617 ertc_write_protect_enable();
618}
619
629 error_status ertc_alarm_enable(ertc_alarm_type alarm_x, confirm_state new_state)
630{
631 /* disable write protection */
632 ertc_write_protect_disable();
633
634 if(alarm_x == ERTC_ALA)
635 {
636 ERTC->ctrl_bit.alaen = new_state;
637
638 if(new_state == FALSE)
639 {
640 if(ertc_wait_flag(ERTC_ALAWF_FLAG, RESET) != SUCCESS)
641 {
642 return ERROR;
643 }
644 }
645 }
646 else
647 {
648 ERTC->ctrl_bit.alben = new_state;
649
650 if(new_state == FALSE)
651 {
652 if(ertc_wait_flag(ERTC_ALBWF_FLAG, RESET) != SUCCESS)
653 {
654 return ERROR;
655 }
656 }
657 }
658
659 /* enable write protection */
660 ertc_write_protect_enable();
661
662 return SUCCESS;
663}
664
674void ertc_alarm_get(ertc_alarm_type alarm_x, ertc_alarm_value_type* alarm)
675{
676 ertc_reg_alarm_type reg;
677
678 reg.ala = 0;
679
680 if(alarm_x == ERTC_ALA)
681 {
682 reg.ala = ERTC->ala;
683 }
684 else
685 {
686 reg.ala = ERTC->alb;
687 }
688
689 alarm->day = ertc_bcd_to_num(reg.ala_bit.d);
690 alarm->week = ertc_bcd_to_num(reg.ala_bit.d);
691 alarm->hour = ertc_bcd_to_num(reg.ala_bit.h);
692 alarm->min = ertc_bcd_to_num(reg.ala_bit.m);
693 alarm->sec = ertc_bcd_to_num(reg.ala_bit.s);
694 alarm->ampm = (ertc_am_pm_type)reg.ala_bit.ampm;
695 alarm->week_date_sel = reg.ala_bit.wksel;
696 alarm->mask = reg.ala & ERTC_ALARM_MASK_ALL;
697}
698
707uint32_t ertc_alarm_sub_second_get(ertc_alarm_type alarm_x)
708{
709 if(alarm_x == ERTC_ALA)
710 {
711 return (ERTC->alasbs_bit.sbs);
712 }
713 else
714 {
715 return (ERTC->albsbs_bit.sbs);
716 }
717}
718
731void ertc_wakeup_clock_set(ertc_wakeup_clock_type clock)
732{
733 /* disable write protection */
734 ertc_write_protect_disable();
735
736 ERTC->ctrl_bit.watclk = clock;
737
738 /* enable write protection */
739 ertc_write_protect_enable();
740}
741
747void ertc_wakeup_counter_set(uint32_t counter)
748{
749 /* disable write protection */
750 ertc_write_protect_disable();
751
752 ERTC->wat_bit.val = counter;
753
754 /* enable write protection */
755 ertc_write_protect_enable();
756}
757
763uint16_t ertc_wakeup_counter_get(void)
764{
765 return ERTC->wat_bit.val;
766}
767
773 error_status ertc_wakeup_enable(confirm_state new_state)
774{
775 /* disable write protection */
776 ertc_write_protect_disable();
777
778 ERTC->ctrl_bit.waten = new_state;
779
780 if(new_state == FALSE)
781 {
782 if(ertc_wait_flag(ERTC_ALAWF_FLAG, RESET) != SUCCESS)
783 {
784 return ERROR;
785 }
786 }
787
788 /* enable write protection */
789 ertc_write_protect_enable();
790
791 return SUCCESS;
792}
793
808 error_status ertc_smooth_calibration_config(ertc_smooth_cal_period_type period, ertc_smooth_cal_clk_add_type clk_add, uint32_t clk_dec)
809{
810 ertc_reg_scal_type reg;
811
812 /* disable write protection */
813 ertc_write_protect_disable();
814
815 if(ertc_wait_flag(ERTC_CALUPDF_FLAG, SET) != SUCCESS)
816 {
817 return ERROR;
818 }
819
820 reg.scal = 0;
821
822 switch (period)
823 {
824 case ERTC_SMOOTH_CAL_PERIOD_32:
825 break;
826 case ERTC_SMOOTH_CAL_PERIOD_16:
827 reg.scal_bit.cal16 = 1;
828 break;
829 case ERTC_SMOOTH_CAL_PERIOD_8:
830 reg.scal_bit.cal8 = 1;
831 break;
832 default:
833 break;
834 }
835
836 reg.scal_bit.add = clk_add;
837 reg.scal_bit.dec = clk_dec;
838
839 ERTC->scal = reg.scal;
840
841 /* enable write protection */
842 ertc_write_protect_enable();
843
844 return SUCCESS;
845}
846
856 error_status ertc_coarse_calibration_set(ertc_cal_direction_type dir, uint32_t value)
857{
858 /* disable write protection */
859 ertc_write_protect_disable();
860
861 /* enter init mode */
862 if(ertc_init_mode_enter() == ERROR)
863 {
864 return ERROR;
865 }
866
867 ERTC->ccal_bit.caldir = dir;
868
869 ERTC->ccal_bit.calval = value;
870
871 /* exit init mode */
872 ertc_init_mode_exit();
873
874 /* enable write protection */
875 ertc_write_protect_enable();
876
877 return SUCCESS;
878}
879
885 error_status ertc_coarse_calibration_enable(confirm_state new_state)
886{
887 /* disable write protection */
888 ertc_write_protect_disable();
889
890 /* enter init mode */
891 if(ertc_init_mode_enter() == ERROR)
892 {
893 return ERROR;
894 }
895
896 ERTC->ctrl_bit.ccalen = new_state;
897
898 /* exit init mode */
899 ertc_init_mode_exit();
900
901 /* enable write protection */
902 ertc_write_protect_enable();
903
904 return SUCCESS;
905}
906
915void ertc_cal_output_select(ertc_cal_output_select_type output)
916{
917 /* disable write protection */
918 ertc_write_protect_disable();
919
920 ERTC->ctrl_bit.calosel = output;
921
922 /* enable write protection */
923 ertc_write_protect_enable();
924}
925
931void ertc_cal_output_enable(confirm_state new_state)
932{
933 /* disable write protection */
934 ertc_write_protect_disable();
935
936 ERTC->ctrl_bit.caloen = new_state;
937
938 /* enable write protection */
939 ertc_write_protect_enable();
940}
941
951 error_status ertc_time_adjust(ertc_time_adjust_type add1s, uint32_t decsbs)
952{
953 ertc_reg_tadj_type reg;
954
955 reg.tadj = 0;
956
957 /* disable write protection */
958 ertc_write_protect_disable();
959
960 if(ertc_wait_flag(ERTC_TADJF_FLAG, SET) != SUCCESS)
961 {
962 return ERROR;
963 }
964
965 /* check if the reference clock detection is disabled */
966 if(ERTC->ctrl_bit.rcden == 0)
967 {
968 reg.tadj_bit.add1s = add1s;
969 reg.tadj_bit.decsbs = decsbs;
970
971 ERTC->tadj = reg.tadj;
972
973 if(ertc_wait_update() == ERROR)
974 {
975 return ERROR;
976 }
977 }
978 else
979 {
980 return ERROR;
981 }
982
983 /* enable write protection */
984 ertc_write_protect_enable();
985
986 return SUCCESS;
987}
988
1001void ertc_daylight_set(ertc_dst_operation_type operation, ertc_dst_save_type save)
1002{
1003 /* disable write protection */
1004 ertc_write_protect_disable();
1005
1006 if(operation == ERTC_DST_ADD_1H)
1007 {
1008 ERTC->ctrl_bit.add1h = 1;
1009 }
1010 else
1011 {
1012 ERTC->ctrl_bit.dec1h = 1;
1013 }
1014
1015 ERTC->ctrl_bit.bpr = save;
1016
1017 /* enable write protection */
1018 ertc_write_protect_enable();
1019}
1020
1026uint8_t ertc_daylight_bpr_get(void)
1027{
1028 return ERTC->ctrl_bit.bpr;
1029}
1030
1036 error_status ertc_refer_clock_detect_enable(confirm_state new_state)
1037{
1038 /* disable write protection */
1039 ertc_write_protect_disable();
1040
1041 /* enter init mode */
1042 if(ertc_init_mode_enter() != SUCCESS)
1043 {
1044 return ERROR;
1045 }
1046
1047 /* write register */
1048 ERTC->ctrl_bit.rcden = new_state;
1049
1050 /* exit init mode */
1051 ertc_init_mode_exit();
1052
1053 /* enable write protection */
1054 ertc_write_protect_enable();
1055
1056 return SUCCESS;
1057}
1058
1064void ertc_direct_read_enable(confirm_state new_state)
1065{
1066 /* disable write protection */
1067 ertc_write_protect_disable();
1068
1069 ERTC->ctrl_bit.dren = new_state;
1070
1071 /* enable write protection */
1072 ertc_write_protect_enable();
1073}
1074
1093void ertc_output_set(ertc_output_source_type source, ertc_output_polarity_type polarity, ertc_output_type type)
1094{
1095 /* disable write protection */
1096 ertc_write_protect_disable();
1097
1098 ERTC->ctrl_bit.outp = polarity;
1099
1100 ERTC->tamp_bit.outtype = type;
1101
1102 ERTC->ctrl_bit.outsel = source;
1103
1104 /* enable write protection */
1105 ertc_write_protect_enable();
1106}
1107
1116void ertc_timestamp_valid_edge_set(ertc_timestamp_valid_edge_type edge)
1117{
1118 /* disable write protection */
1119 ertc_write_protect_disable();
1120
1121 ERTC->ctrl_bit.tsedg = edge;
1122
1123 /* enable write protection */
1124 ertc_write_protect_enable();
1125}
1126
1132void ertc_timestamp_enable(confirm_state new_state)
1133{
1134 /* disable write protection */
1135 ertc_write_protect_disable();
1136
1137 ERTC->ctrl_bit.tsen = new_state;
1138
1139 /* enable write protection */
1140 ertc_write_protect_enable();
1141}
1142
1149void ertc_timestamp_get(ertc_time_type* time)
1150{
1151 ertc_reg_tstm_type tmtime;
1152 ertc_reg_tsdt_type tmdate;
1153
1154 tmtime.tstm = ERTC->tstm;
1155 tmdate.tsdt = ERTC->tsdt;
1156
1157 time->year = 0;
1158 time->month = ertc_bcd_to_num(tmdate.tsdt_bit.m);
1159 time->day = ertc_bcd_to_num(tmdate.tsdt_bit.d);
1160 time->week = ertc_bcd_to_num(tmdate.tsdt_bit.wk);
1161 time->hour = ertc_bcd_to_num(tmtime.tstm_bit.h);
1162 time->min = ertc_bcd_to_num(tmtime.tstm_bit.m);
1163 time->sec = ertc_bcd_to_num(tmtime.tstm_bit.s);
1164 time->ampm = (ertc_am_pm_type)tmtime.tstm_bit.ampm;
1165}
1166
1172uint32_t ertc_timestamp_sub_second_get(void)
1173{
1174 return ERTC->tssbs_bit.sbs;
1175}
1176
1182void ertc_tamper_pull_up_enable(confirm_state new_state)
1183{
1184 /* disable write protection */
1185 ertc_write_protect_disable();
1186
1187 ERTC->tamp_bit.tppu = !new_state;
1188
1189 /* enable write protection */
1190 ertc_write_protect_enable();
1191}
1192
1203void ertc_tamper_precharge_set(ertc_tamper_precharge_type precharge)
1204{
1205 /* disable write protection */
1206 ertc_write_protect_disable();
1207
1208 ERTC->tamp_bit.tppr = precharge;
1209
1210 /* enable write protection */
1211 ertc_write_protect_enable();
1212}
1213
1224void ertc_tamper_filter_set(ertc_tamper_filter_type filter)
1225{
1226 /* disable write protection */
1227 ertc_write_protect_disable();
1228
1229 ERTC->tamp_bit.tpflt = filter;
1230
1231 /* enable write protection */
1232 ertc_write_protect_enable();
1233}
1234
1249void ertc_tamper_detect_freq_set(ertc_tamper_detect_freq_type freq)
1250{
1251 /* disable write protection */
1252 ertc_write_protect_disable();
1253
1254 ERTC->tamp_bit.tpfreq = freq;
1255
1256 /* enable write protection */
1257 ertc_write_protect_enable();
1258}
1259
1275void ertc_tamper_valid_edge_set(ertc_tamper_select_type tamper_x, ertc_tamper_valid_edge_type trigger)
1276{
1277 /* disable write protection */
1278 ertc_write_protect_disable();
1279
1280 if(tamper_x == ERTC_TAMPER_1)
1281 {
1282 ERTC->tamp_bit.tp1edg = trigger;
1283 }
1284
1285 /* enable write protection */
1286 ertc_write_protect_enable();
1287}
1288
1294void ertc_tamper_timestamp_enable(confirm_state new_state)
1295{
1296 /* disable write protection */
1297 ertc_write_protect_disable();
1298
1299 ERTC->tamp_bit.tptsen = new_state;
1300
1301 /* enable write protection */
1302 ertc_write_protect_enable();
1303}
1304
1314void ertc_tamper_enable(ertc_tamper_select_type tamper_x, confirm_state new_state)
1315{
1316 /* disable write protection */
1317 ertc_write_protect_disable();
1318
1319 if(tamper_x == ERTC_TAMPER_1)
1320 {
1321 ERTC->tamp_bit.tp1en = new_state;
1322 }
1323
1324 /* enable write protection */
1325 ertc_write_protect_enable();
1326}
1327
1340void ertc_interrupt_enable(uint32_t source, confirm_state new_state)
1341{
1342 /* disable write protection */
1343 ertc_write_protect_disable();
1344
1345 if(source & ERTC_TP_INT)
1346 {
1347 if(new_state != FALSE)
1348 {
1349 ERTC->tamp |= ERTC_TP_INT;
1350 }
1351 else
1352 {
1353 ERTC->tamp &= ~ERTC_TP_INT;
1354 }
1355
1356 source &= ~ERTC_TP_INT;
1357 }
1358
1359 if(new_state != FALSE)
1360 {
1361 ERTC->ctrl |= source;
1362 }
1363 else
1364 {
1365 ERTC->ctrl &= ~source;
1366 }
1367
1368 /* enable write protection */
1369 ertc_write_protect_enable();
1370}
1371
1383 flag_status ertc_interrupt_get(uint32_t source)
1384{
1385 if(source & ERTC_TP_INT)
1386 {
1387 if((ERTC->tamp & ERTC_TP_INT) != RESET)
1388 {
1389 return SET;
1390 }
1391 else
1392 {
1393 return RESET;
1394 }
1395 }
1396
1397 if((ERTC->ctrl & source) != RESET)
1398 {
1399 return SET;
1400 }
1401 else
1402 {
1403 return RESET;
1404 }
1405}
1406
1428 flag_status ertc_flag_get(uint32_t flag)
1429{
1430 if((ERTC->sts & flag) != (uint32_t)RESET)
1431 {
1432 return SET;
1433 }
1434 else
1435 {
1436 return RESET;
1437 }
1438}
1439
1461void ertc_flag_clear(uint32_t flag)
1462{
1463 /* disable write protection */
1464 ertc_write_protect_disable();
1465
1466 ERTC->sts = ~(flag | 0x00000080) | (ERTC->sts_bit.imen << 7);
1467
1468 /* enable write protection */
1469 ertc_write_protect_enable();
1470}
1471
1484void ertc_bpr_data_write(ertc_dt_type dt, uint32_t data)
1485{
1486 __IO uint32_t reg = 0;
1487
1488 reg = ERTC_BASE + 0x50 + (dt * 4);
1489
1490 /* disable write protection */
1491 ertc_write_protect_disable();
1492
1493 *(__IO uint32_t *)reg = data;
1494
1495 /* enable write protection */
1496 ertc_write_protect_enable();
1497}
1498
1510uint32_t ertc_bpr_data_read(ertc_dt_type dt)
1511{
1512 __IO uint32_t reg = 0;
1513
1514 reg = ERTC_BASE + 0x50 + (dt * 4);
1515
1516 return (*(__IO uint32_t *)reg);
1517}
1518
1523#endif
1524
counter
uint16_t counter
Definition: project/at_start_f415/examples/debug/tmr1/src/main.c:40
ertc_week_date_select_type
ertc_week_date_select_type
ertc week or date select
Definition: at32f415_ertc.h:123
ertc_cal_direction_type
ertc_cal_direction_type
ertc calibration direction mode
Definition: at32f415_ertc.h:196
ertc_smooth_cal_period_type
ertc_smooth_cal_period_type
ertc smooth calibration period
Definition: at32f415_ertc.h:177
ertc_tamper_valid_edge_type
ertc_tamper_valid_edge_type
ertc tamper valid edge
Definition: at32f415_ertc.h:333
ertc_output_type
ertc_output_type
output type
Definition: at32f415_ertc.h:261
ertc_cal_output_select_type
ertc_cal_output_select_type
ertc calibration output mode
Definition: at32f415_ertc.h:205
ertc_hour_mode_set_type
ertc_hour_mode_set_type
ertc hour mode
Definition: at32f415_ertc.h:104
ertc_wakeup_clock_type
ertc_wakeup_clock_type
ertc wakeup timer clock select
Definition: at32f415_ertc.h:164
ertc_tamper_precharge_type
ertc_tamper_precharge_type
tamper detection pre-charge time
Definition: at32f415_ertc.h:296
ertc_smooth_cal_clk_add_type
ertc_smooth_cal_clk_add_type
ertc smooth calibration clock add mode
Definition: at32f415_ertc.h:187
ertc_timestamp_valid_edge_type
ertc_timestamp_valid_edge_type
ertc timestamp valid edge
Definition: at32f415_ertc.h:279
ertc_tamper_select_type
ertc_tamper_select_type
ertc tamper x select
Definition: at32f415_ertc.h:288
ertc_tamper_filter_type
ertc_tamper_filter_type
ertc tamper filter
Definition: at32f415_ertc.h:307
ertc_dst_operation_type
ertc_dst_operation_type
ertc daylight saving time hour adjustment mode
Definition: at32f415_ertc.h:223
ertc_output_polarity_type
ertc_output_polarity_type
output polarity
Definition: at32f415_ertc.h:252
ertc_dt_type
ertc_dt_type
ertc bpr register
Definition: at32f415_ertc.h:344
ertc_dst_save_type
ertc_dst_save_type
ertc daylight saving time store operation mode
Definition: at32f415_ertc.h:232
ertc_output_source_type
ertc_output_source_type
output source
Definition: at32f415_ertc.h:241
ertc_tamper_detect_freq_type
ertc_tamper_detect_freq_type
ertc tamper detection frequency
Definition: at32f415_ertc.h:318
ertc_alarm_type
ertc_alarm_type
ertc alarm x select
Definition: at32f415_ertc.h:132
ertc_am_pm_type
ertc_am_pm_type
ertc 12-hour format am/pm
Definition: at32f415_ertc.h:113
ertc_time_adjust_type
ertc_time_adjust_type
time adjust add mode
Definition: at32f415_ertc.h:214
ertc_alarm_sbs_mask_type
ertc_alarm_sbs_mask_type
ertc alarm sub second mask
Definition: at32f415_ertc.h:141
ERTC_SMOOTH_CAL_PERIOD_8
@ ERTC_SMOOTH_CAL_PERIOD_8
Definition: at32f415_ertc.h:180
ERTC_SMOOTH_CAL_PERIOD_32
@ ERTC_SMOOTH_CAL_PERIOD_32
Definition: at32f415_ertc.h:178
ERTC_SMOOTH_CAL_PERIOD_16
@ ERTC_SMOOTH_CAL_PERIOD_16
Definition: at32f415_ertc.h:179
ERTC_TAMPER_1
@ ERTC_TAMPER_1
Definition: at32f415_ertc.h:289
ERTC_DST_ADD_1H
@ ERTC_DST_ADD_1H
Definition: at32f415_ertc.h:224
ERTC_ALA
@ ERTC_ALA
Definition: at32f415_ertc.h:133
ERTC_ALARM_MASK_ALL
#define ERTC_ALARM_MASK_ALL
Definition: at32f415_ertc.h:90
ERTC_UPDF_FLAG
#define ERTC_UPDF_FLAG
Definition: at32f415_ertc.h:72
ERTC_ALBWF_FLAG
#define ERTC_ALBWF_FLAG
Definition: at32f415_ertc.h:68
ERTC_TADJF_FLAG
#define ERTC_TADJF_FLAG
Definition: at32f415_ertc.h:70
ERTC_CALUPDF_FLAG
#define ERTC_CALUPDF_FLAG
Definition: at32f415_ertc.h:80
ERTC_ALAWF_FLAG
#define ERTC_ALAWF_FLAG
Definition: at32f415_ertc.h:67
ERTC_TP_INT
#define ERTC_TP_INT
Definition: at32f415_ertc.h:52
ertc_write_protect_enable
void ertc_write_protect_enable(void)
enable write protection.
Definition: at32f415_ertc.c:76
ertc_direct_read_enable
void ertc_direct_read_enable(confirm_state new_state)
enable or disable direct read mode.
Definition: at32f415_ertc.c:1064
ertc_daylight_set
void ertc_daylight_set(ertc_dst_operation_type operation, ertc_dst_save_type save)
config the daylight saving time.
Definition: at32f415_ertc.c:1001
ertc_alarm_get
void ertc_alarm_get(ertc_alarm_type alarm_x, ertc_alarm_value_type *alarm)
get alarm value.
Definition: at32f415_ertc.c:674
ertc_hour_mode_set
error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode)
ertc hour mode set.
Definition: at32f415_ertc.c:283
ertc_wakeup_clock_set
void ertc_wakeup_clock_set(ertc_wakeup_clock_type clock)
set wakeup timer clock.
Definition: at32f415_ertc.c:731
ERTC_TIMEOUT
#define ERTC_TIMEOUT
Definition: at32f415_ertc.c:44
ertc_wait_update
error_status ertc_wait_update(void)
ertc wait register update finish.
Definition: at32f415_ertc.c:97
ertc_coarse_calibration_enable
error_status ertc_coarse_calibration_enable(confirm_state new_state)
enable or disable coarse calibration.
Definition: at32f415_ertc.c:885
ertc_sub_second_get
uint32_t ertc_sub_second_get(void)
get current sub second.
Definition: at32f415_ertc.c:430
ertc_wakeup_counter_set
void ertc_wakeup_counter_set(uint32_t counter)
set wakeup counter.
Definition: at32f415_ertc.c:747
ertc_bcd_to_num
uint8_t ertc_bcd_to_num(uint8_t bcd)
bcd code conversion to number.
Definition: at32f415_ertc.c:66
ertc_timestamp_valid_edge_set
void ertc_timestamp_valid_edge_set(ertc_timestamp_valid_edge_type edge)
set the timestamp valid edge.
Definition: at32f415_ertc.c:1116
ertc_flag_get
flag_status ertc_flag_get(uint32_t flag)
get flag status.
Definition: at32f415_ertc.c:1428
ertc_interrupt_get
flag_status ertc_interrupt_get(uint32_t source)
get interrupt status
Definition: at32f415_ertc.c:1383
ertc_time_set
error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time.
Definition: at32f415_ertc.c:363
ertc_reset
error_status ertc_reset(void)
ertc reset all register.
Definition: at32f415_ertc.c:207
ertc_time_adjust
error_status ertc_time_adjust(ertc_time_adjust_type add1s, uint32_t decsbs)
adjust the time.
Definition: at32f415_ertc.c:951
ertc_tamper_timestamp_enable
void ertc_tamper_timestamp_enable(confirm_state new_state)
enable or disable trigger timestamp when tamper event occurs.
Definition: at32f415_ertc.c:1294
ertc_alarm_mask_set
void ertc_alarm_mask_set(ertc_alarm_type alarm_x, uint32_t mask)
set which bits are irrelevant to the alarm match.
Definition: at32f415_ertc.c:458
ertc_coarse_calibration_set
error_status ertc_coarse_calibration_set(ertc_cal_direction_type dir, uint32_t value)
set the coarse digital calibration.
Definition: at32f415_ertc.c:856
ertc_output_set
void ertc_output_set(ertc_output_source_type source, ertc_output_polarity_type polarity, ertc_output_type type)
set the output mode.
Definition: at32f415_ertc.c:1093
ertc_alarm_sub_second_get
uint32_t ertc_alarm_sub_second_get(ertc_alarm_type alarm_x)
get alarm sub second.
Definition: at32f415_ertc.c:707
ertc_interrupt_enable
void ertc_interrupt_enable(uint32_t source, confirm_state new_state)
enable or disable interrupt.
Definition: at32f415_ertc.c:1340
ertc_alarm_week_date_select
void ertc_alarm_week_date_select(ertc_alarm_type alarm_x, ertc_week_date_select_type wk)
alarm week or date mode select.
Definition: at32f415_ertc.c:500
ertc_wakeup_enable
error_status ertc_wakeup_enable(confirm_state new_state)
enable or disable wakeup timer.
Definition: at32f415_ertc.c:773
ertc_date_set
error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date.
Definition: at32f415_ertc.c:314
ertc_tamper_precharge_set
void ertc_tamper_precharge_set(ertc_tamper_precharge_type precharge)
set the tamper pin pre-charge time.
Definition: at32f415_ertc.c:1203
ertc_tamper_enable
void ertc_tamper_enable(ertc_tamper_select_type tamper_x, confirm_state new_state)
enable or disable tamper.
Definition: at32f415_ertc.c:1314
ertc_smooth_calibration_config
error_status ertc_smooth_calibration_config(ertc_smooth_cal_period_type period, ertc_smooth_cal_clk_add_type clk_add, uint32_t clk_dec)
config the smooth calibration.
Definition: at32f415_ertc.c:808
ertc_num_to_bcd
uint8_t ertc_num_to_bcd(uint8_t num)
number conversion to bcd code.
Definition: at32f415_ertc.c:51
ertc_flag_clear
void ertc_flag_clear(uint32_t flag)
clear flag status
Definition: at32f415_ertc.c:1461
ertc_refer_clock_detect_enable
error_status ertc_refer_clock_detect_enable(confirm_state new_state)
enable or disable refer clock detect.
Definition: at32f415_ertc.c:1036
ertc_wakeup_counter_get
uint16_t ertc_wakeup_counter_get(void)
get wakeup counter.
Definition: at32f415_ertc.c:763
ertc_init_mode_enter
error_status ertc_init_mode_enter(void)
ertc enter init mode.
Definition: at32f415_ertc.c:163
ertc_bpr_data_read
uint32_t ertc_bpr_data_read(ertc_dt_type dt)
read data from bpr register.
Definition: at32f415_ertc.c:1510
ertc_timestamp_get
void ertc_timestamp_get(ertc_time_type *time)
get the timestamp.
Definition: at32f415_ertc.c:1149
ertc_timestamp_sub_second_get
uint32_t ertc_timestamp_sub_second_get(void)
get the timestamp sub second.
Definition: at32f415_ertc.c:1172
ertc_timestamp_enable
void ertc_timestamp_enable(confirm_state new_state)
enable or disable timestamp.
Definition: at32f415_ertc.c:1132
ertc_tamper_pull_up_enable
void ertc_tamper_pull_up_enable(confirm_state new_state)
enable or disable tamper pin pull up.
Definition: at32f415_ertc.c:1182
ertc_tamper_filter_set
void ertc_tamper_filter_set(ertc_tamper_filter_type filter)
set the tamper filter time.
Definition: at32f415_ertc.c:1224
ertc_tamper_valid_edge_set
void ertc_tamper_valid_edge_set(ertc_tamper_select_type tamper_x, ertc_tamper_valid_edge_type trigger)
set the tamper trigger.
Definition: at32f415_ertc.c:1275
ertc_cal_output_enable
void ertc_cal_output_enable(confirm_state new_state)
enable or disable calibration output.
Definition: at32f415_ertc.c:931
ertc_alarm_set
void ertc_alarm_set(ertc_alarm_type alarm_x, uint8_t week_date, uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set alarm.
Definition: at32f415_ertc.c:538
ertc_alarm_sub_second_set
void ertc_alarm_sub_second_set(ertc_alarm_type alarm_x, uint32_t value, ertc_alarm_sbs_mask_type mask)
set alarm sub second.
Definition: at32f415_ertc.c:600
ertc_calendar_get
void ertc_calendar_get(ertc_time_type *time)
get calendar
Definition: at32f415_ertc.c:404
ertc_wait_flag
error_status ertc_wait_flag(uint32_t flag, flag_status status)
ertc wait flag status.
Definition: at32f415_ertc.c:138
ertc_tamper_detect_freq_set
void ertc_tamper_detect_freq_set(ertc_tamper_detect_freq_type freq)
set the tamper detection frequency.
Definition: at32f415_ertc.c:1249
ertc_divider_set
error_status ertc_divider_set(uint16_t div_a, uint16_t div_b)
ertc division set.
Definition: at32f415_ertc.c:251
ertc_cal_output_select
void ertc_cal_output_select(ertc_cal_output_select_type output)
calibration output source select.
Definition: at32f415_ertc.c:915
ertc_bpr_data_write
void ertc_bpr_data_write(ertc_dt_type dt, uint32_t data)
write data to the bpr register.
Definition: at32f415_ertc.c:1484
ertc_daylight_bpr_get
uint8_t ertc_daylight_bpr_get(void)
get the bpr value.
Definition: at32f415_ertc.c:1026
ertc_write_protect_disable
void ertc_write_protect_disable(void)
disable write protection.
Definition: at32f415_ertc.c:86
ertc_init_mode_exit
void ertc_init_mode_exit(void)
ertc exit init mode.
Definition: at32f415_ertc.c:197
ertc_alarm_enable
error_status ertc_alarm_enable(ertc_alarm_type alarm_x, confirm_state new_state)
enable or disable alarm clock.
Definition: at32f415_ertc.c:629
ERTC
#define ERTC
Definition: at32f415_ertc.h:1118
error_status
error_status
error status
Definition: at32f415.h:258
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
time
ertc_time_type * time
Definition: random.c:42
ERTC_BASE
#define ERTC_BASE
Definition: at32f415.h:302
ertc_alarm_value_type
ertc alarm
Definition: at32f415_ertc.h:386
ertc_alarm_value_type::min
uint8_t min
Definition: at32f415_ertc.h:389
ertc_alarm_value_type::mask
uint32_t mask
Definition: at32f415_ertc.h:392
ertc_alarm_value_type::week_date_sel
uint8_t week_date_sel
Definition: at32f415_ertc.h:393
ertc_alarm_value_type::sec
uint8_t sec
Definition: at32f415_ertc.h:390
ertc_alarm_value_type::week
uint8_t week
Definition: at32f415_ertc.h:394
ertc_alarm_value_type::hour
uint8_t hour
Definition: at32f415_ertc.h:388
ertc_alarm_value_type::ampm
ertc_am_pm_type ampm
Definition: at32f415_ertc.h:391
ertc_alarm_value_type::day
uint8_t day
Definition: at32f415_ertc.h:387
ertc_time_type
ertc time
Definition: at32f415_ertc.h:371
ertc_time_type::ampm
ertc_am_pm_type ampm
Definition: at32f415_ertc.h:379
ertc_time_type::year
uint8_t year
Definition: at32f415_ertc.h:372
ertc_time_type::day
uint8_t day
Definition: at32f415_ertc.h:374
ertc_time_type::hour
uint8_t hour
Definition: at32f415_ertc.h:375
ertc_time_type::min
uint8_t min
Definition: at32f415_ertc.h:376
ertc_time_type::month
uint8_t month
Definition: at32f415_ertc.h:373
ertc_time_type::week
uint8_t week
Definition: at32f415_ertc.h:378
ertc_time_type::sec
uint8_t sec
Definition: at32f415_ertc.h:377
ertc_reg_alarm_type
ertc alarm reg union
Definition: at32f415_ertc.h:436
ertc_reg_alarm_type::d
__IO uint32_t d
Definition: at32f415_ertc.h:447
ertc_reg_alarm_type::h
__IO uint32_t h
Definition: at32f415_ertc.h:444
ertc_reg_alarm_type::wksel
__IO uint32_t wksel
Definition: at32f415_ertc.h:448
ertc_reg_alarm_type::ala
__IO uint32_t ala
Definition: at32f415_ertc.h:437
ertc_reg_alarm_type::ala_bit
struct ertc_reg_alarm_type::@218 ala_bit
ertc_reg_alarm_type::ampm
__IO uint32_t ampm
Definition: at32f415_ertc.h:445
ertc_reg_alarm_type::s
__IO uint32_t s
Definition: at32f415_ertc.h:440
ertc_reg_alarm_type::m
__IO uint32_t m
Definition: at32f415_ertc.h:442
ertc_reg_date_type
ertc date reg union
Definition: at32f415_ertc.h:419
ertc_reg_date_type::y
__IO uint32_t y
Definition: at32f415_ertc.h:427
ertc_reg_date_type::m
__IO uint32_t m
Definition: at32f415_ertc.h:425
ertc_reg_date_type::date_bit
struct ertc_reg_date_type::@217 date_bit
ertc_reg_date_type::wk
__IO uint32_t wk
Definition: at32f415_ertc.h:426
ertc_reg_date_type::date
__IO uint32_t date
Definition: at32f415_ertc.h:420
ertc_reg_date_type::d
__IO uint32_t d
Definition: at32f415_ertc.h:423
ertc_reg_scal_type
ertc scal reg union
Definition: at32f415_ertc.h:457
ertc_reg_scal_type::dec
__IO uint32_t dec
Definition: at32f415_ertc.h:461
ertc_reg_scal_type::cal8
__IO uint32_t cal8
Definition: at32f415_ertc.h:464
ertc_reg_scal_type::cal16
__IO uint32_t cal16
Definition: at32f415_ertc.h:463
ertc_reg_scal_type::scal
__IO uint32_t scal
Definition: at32f415_ertc.h:458
ertc_reg_scal_type::add
__IO uint32_t add
Definition: at32f415_ertc.h:465
ertc_reg_scal_type::scal_bit
struct ertc_reg_scal_type::@219 scal_bit
ertc_reg_tadj_type
ertc tadj reg union
Definition: at32f415_ertc.h:474
ertc_reg_tadj_type::tadj
__IO uint32_t tadj
Definition: at32f415_ertc.h:475
ertc_reg_tadj_type::decsbs
__IO uint32_t decsbs
Definition: at32f415_ertc.h:478
ertc_reg_tadj_type::tadj_bit
struct ertc_reg_tadj_type::@220 tadj_bit
ertc_reg_tadj_type::add1s
__IO uint32_t add1s
Definition: at32f415_ertc.h:480
ertc_reg_time_type
ertc time reg union
Definition: at32f415_ertc.h:401
ertc_reg_time_type::ampm
__IO uint32_t ampm
Definition: at32f415_ertc.h:410
ertc_reg_time_type::time_bit
struct ertc_reg_time_type::@216 time_bit
ertc_reg_time_type::s
__IO uint32_t s
Definition: at32f415_ertc.h:405
ertc_reg_time_type::m
__IO uint32_t m
Definition: at32f415_ertc.h:407
ertc_reg_time_type::time
__IO uint32_t time
Definition: at32f415_ertc.h:402
ertc_reg_time_type::h
__IO uint32_t h
Definition: at32f415_ertc.h:409
ertc_reg_tsdt_type
ertc tsdt register, offset:0x34
Definition: at32f415_ertc.h:506
ertc_reg_tsdt_type::tsdt_bit
struct ertc_reg_tsdt_type::@222 tsdt_bit
ertc_reg_tsdt_type::wk
__IO uint32_t wk
Definition: at32f415_ertc.h:513
ertc_reg_tsdt_type::d
__IO uint32_t d
Definition: at32f415_ertc.h:510
ertc_reg_tsdt_type::tsdt
__IO uint32_t tsdt
Definition: at32f415_ertc.h:507
ertc_reg_tsdt_type::m
__IO uint32_t m
Definition: at32f415_ertc.h:512
ertc_reg_tstm_type
ertc tstm reg union
Definition: at32f415_ertc.h:488
ertc_reg_tstm_type::s
__IO uint32_t s
Definition: at32f415_ertc.h:492
ertc_reg_tstm_type::ampm
__IO uint32_t ampm
Definition: at32f415_ertc.h:497
ertc_reg_tstm_type::m
__IO uint32_t m
Definition: at32f415_ertc.h:494
ertc_reg_tstm_type::tstm_bit
struct ertc_reg_tstm_type::@221 tstm_bit
ertc_reg_tstm_type::h
__IO uint32_t h
Definition: at32f415_ertc.h:496
ertc_reg_tstm_type::tstm
__IO uint32_t tstm
Definition: at32f415_ertc.h:489
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_ertc.h Source File

  • libraries
  • drivers
  • inc
at32f415_ertc.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_ERTC_H
29#define __AT32F415_ERTC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
52#define ERTC_TP_INT ((uint32_t)0x00000004)
53#define ERTC_ALA_INT ((uint32_t)0x00001000)
54#define ERTC_ALB_INT ((uint32_t)0x00002000)
55#define ERTC_WAT_INT ((uint32_t)0x00004000)
56#define ERTC_TS_INT ((uint32_t)0x00008000)
67#define ERTC_ALAWF_FLAG ((uint32_t)0x00000001)
68#define ERTC_ALBWF_FLAG ((uint32_t)0x00000002)
69#define ERTC_WATWF_FLAG ((uint32_t)0x00000004)
70#define ERTC_TADJF_FLAG ((uint32_t)0x00000008)
71#define ERTC_INITF_FLAG ((uint32_t)0x00000010)
72#define ERTC_UPDF_FLAG ((uint32_t)0x00000020)
73#define ERTC_IMF_FLAG ((uint32_t)0x00000040)
74#define ERTC_ALAF_FLAG ((uint32_t)0x00000100)
75#define ERTC_ALBF_FLAG ((uint32_t)0x00000200)
76#define ERTC_WATF_FLAG ((uint32_t)0x00000400)
77#define ERTC_TSF_FLAG ((uint32_t)0x00000800)
78#define ERTC_TSOF_FLAG ((uint32_t)0x00001000)
79#define ERTC_TP1F_FLAG ((uint32_t)0x00002000)
80#define ERTC_CALUPDF_FLAG ((uint32_t)0x00010000)
85#define ERTC_ALARM_MASK_NONE ((uint32_t)0x00000000)
86#define ERTC_ALARM_MASK_SEC ((uint32_t)0x00000080)
87#define ERTC_ALARM_MASK_MIN ((uint32_t)0x00008000)
88#define ERTC_ALARM_MASK_HOUR ((uint32_t)0x00800000)
89#define ERTC_ALARM_MASK_DATE_WEEK ((uint32_t)0x80000000)
90#define ERTC_ALARM_MASK_ALL ((uint32_t)0x80808080)
103typedef enum
104{
105 ERTC_HOUR_MODE_24 = 0x00,
106 ERTC_HOUR_MODE_12 = 0x01
107} ertc_hour_mode_set_type;
108
112typedef enum
113{
114 ERTC_24H = 0x00,
115 ERTC_AM = 0x00,
116 ERTC_PM = 0x01
117} ertc_am_pm_type;
118
122typedef enum
123{
124 ERTC_SLECT_DATE = 0x00,
125 ERTC_SLECT_WEEK = 0x01
126} ertc_week_date_select_type;
127
131typedef enum
132{
133 ERTC_ALA = 0x00,
134 ERTC_ALB = 0x01
135} ertc_alarm_type;
136
140typedef enum
141{
142 ERTC_ALARM_SBS_MASK_ALL = 0x00,
143 ERTC_ALARM_SBS_MASK_14_1 = 0x01,
144 ERTC_ALARM_SBS_MASK_14_2 = 0x02,
145 ERTC_ALARM_SBS_MASK_14_3 = 0x03,
146 ERTC_ALARM_SBS_MASK_14_4 = 0x04,
147 ERTC_ALARM_SBS_MASK_14_5 = 0x05,
148 ERTC_ALARM_SBS_MASK_14_6 = 0x06,
149 ERTC_ALARM_SBS_MASK_14_7 = 0x07,
150 ERTC_ALARM_SBS_MASK_14_8 = 0x08,
151 ERTC_ALARM_SBS_MASK_14_9 = 0x09,
152 ERTC_ALARM_SBS_MASK_14_10 = 0x0A,
153 ERTC_ALARM_SBS_MASK_14_11 = 0x0B,
154 ERTC_ALARM_SBS_MASK_14_12 = 0x0C,
155 ERTC_ALARM_SBS_MASK_14_13 = 0x0D,
156 ERTC_ALARM_SBS_MASK_14 = 0x0E,
157 ERTC_ALARM_SBS_MASK_NONE = 0x0F
158} ertc_alarm_sbs_mask_type;
159
163typedef enum
164{
165 ERTC_WAT_CLK_ERTCCLK_DIV16 = 0x00,
166 ERTC_WAT_CLK_ERTCCLK_DIV8 = 0x01,
167 ERTC_WAT_CLK_ERTCCLK_DIV4 = 0x02,
168 ERTC_WAT_CLK_ERTCCLK_DIV2 = 0x03,
169 ERTC_WAT_CLK_CK_A_16BITS = 0x04,
170 ERTC_WAT_CLK_CK_A_17BITS = 0x06
171} ertc_wakeup_clock_type;
172
176typedef enum
177{
178 ERTC_SMOOTH_CAL_PERIOD_32 = 0x00,
179 ERTC_SMOOTH_CAL_PERIOD_16 = 0x01,
180 ERTC_SMOOTH_CAL_PERIOD_8 = 0x02
181} ertc_smooth_cal_period_type;
182
186typedef enum
187{
188 ERTC_SMOOTH_CAL_CLK_ADD_0 = 0x00,
189 ERTC_SMOOTH_CAL_CLK_ADD_512 = 0x01
190} ertc_smooth_cal_clk_add_type;
191
195typedef enum
196{
197 ERTC_CAL_DIR_POSITIVE = 0x00,
198 ERTC_CAL_DIR_NEGATIVE = 0x01
199} ertc_cal_direction_type;
200
204typedef enum
205{
206 ERTC_CAL_OUTPUT_512HZ = 0x00,
207 ERTC_CAL_OUTPUT_1HZ = 0x01
208} ertc_cal_output_select_type;
209
213typedef enum
214{
215 ERTC_TIME_ADD_NONE = 0x00,
216 ERTC_TIME_ADD_1S = 0x01
217} ertc_time_adjust_type;
218
222typedef enum
223{
224 ERTC_DST_ADD_1H = 0x00,
225 ERTC_DST_DEC_1H = 0x01
226} ertc_dst_operation_type;
227
231typedef enum
232{
233 ERTC_DST_SAVE_0 = 0x00,
234 ERTC_DST_SAVE_1 = 0x01
235} ertc_dst_save_type;
236
240typedef enum
241{
242 ERTC_OUTPUT_DISABLE = 0x00,
243 ERTC_OUTPUT_ALARM_A = 0x01,
244 ERTC_OUTPUT_ALARM_B = 0x02,
245 ERTC_OUTPUT_WAKEUP = 0x03
246} ertc_output_source_type;
247
251typedef enum
252{
253 ERTC_OUTPUT_POLARITY_HIGH = 0x00,
254 ERTC_OUTPUT_POLARITY_LOW = 0x01
255} ertc_output_polarity_type;
256
260typedef enum
261{
262 ERTC_OUTPUT_TYPE_OPEN_DRAIN = 0x00,
263 ERTC_OUTPUT_TYPE_PUSH_PULL = 0x01
264} ertc_output_type;
265
269typedef enum
270{
271 ERTC_PIN_PC13 = 0x00,
272 ERTC_PIN_PA0 = 0x01
273} ertc_pin_select_type;
274
278typedef enum
279{
280 ERTC_TIMESTAMP_EDGE_RISING = 0x00,
281 ERTC_TIMESTAMP_EDGE_FALLING = 0x01
282} ertc_timestamp_valid_edge_type;
283
287typedef enum
288{
289 ERTC_TAMPER_1 = 0x00,
290} ertc_tamper_select_type;
291
295typedef enum
296{
297 ERTC_TAMPER_PR_1_ERTCCLK = 0x00,
298 ERTC_TAMPER_PR_2_ERTCCLK = 0x01,
299 ERTC_TAMPER_PR_4_ERTCCLK = 0x02,
300 ERTC_TAMPER_PR_8_ERTCCLK = 0x03
301} ertc_tamper_precharge_type;
302
306typedef enum
307{
308 ERTC_TAMPER_FILTER_DISABLE = 0x00,
309 ERTC_TAMPER_FILTER_2 = 0x01,
310 ERTC_TAMPER_FILTER_4 = 0x02,
311 ERTC_TAMPER_FILTER_8 = 0x03
312} ertc_tamper_filter_type;
313
317typedef enum
318{
319 ERTC_TAMPER_FREQ_DIV_32768 = 0x00,
320 ERTC_TAMPER_FREQ_DIV_16384 = 0x01,
321 ERTC_TAMPER_FREQ_DIV_8192 = 0x02,
322 ERTC_TAMPER_FREQ_DIV_4096 = 0x03,
323 ERTC_TAMPER_FREQ_DIV_2048 = 0x04,
324 ERTC_TAMPER_FREQ_DIV_1024 = 0x05,
325 ERTC_TAMPER_FREQ_DIV_512 = 0x06,
326 ERTC_TAMPER_FREQ_DIV_256 = 0x07
327} ertc_tamper_detect_freq_type;
328
332typedef enum
333{
334 ERTC_TAMPER_EDGE_RISING = 0x00,
335 ERTC_TAMPER_EDGE_FALLING = 0x01,
336 ERTC_TAMPER_EDGE_LOW = 0x00,
337 ERTC_TAMPER_EDGE_HIGH = 0x01
338} ertc_tamper_valid_edge_type;
339
343typedef enum
344{
345 ERTC_DT1 = 0,
346 ERTC_DT2 = 1,
347 ERTC_DT3 = 2,
348 ERTC_DT4 = 3,
349 ERTC_DT5 = 4,
350 ERTC_DT6 = 5,
351 ERTC_DT7 = 6,
352 ERTC_DT8 = 7,
353 ERTC_DT9 = 8,
354 ERTC_DT10 = 9,
355 ERTC_DT11 = 10,
356 ERTC_DT12 = 11,
357 ERTC_DT13 = 12,
358 ERTC_DT14 = 13,
359 ERTC_DT15 = 14,
360 ERTC_DT16 = 15,
361 ERTC_DT17 = 16,
362 ERTC_DT18 = 17,
363 ERTC_DT19 = 18,
364 ERTC_DT20 = 19
365} ertc_dt_type;
366
370typedef struct
371{
372 uint8_t year;
373 uint8_t month;
374 uint8_t day;
375 uint8_t hour;
376 uint8_t min;
377 uint8_t sec;
378 uint8_t week;
379 ertc_am_pm_type ampm;
380} ertc_time_type;
381
385typedef struct
386{
387 uint8_t day;
388 uint8_t hour;
389 uint8_t min;
390 uint8_t sec;
391 ertc_am_pm_type ampm;
392 uint32_t mask;
393 uint8_t week_date_sel;
394 uint8_t week;
395} ertc_alarm_value_type;
396
400typedef union
401{
402 __IO uint32_t time;
403 struct
404 {
405 __IO uint32_t s : 7; /* [6:0] */
406 __IO uint32_t reserved1 : 1; /* [7] */
407 __IO uint32_t m : 7; /* [14:8] */
408 __IO uint32_t reserved2 : 1; /* [15] */
409 __IO uint32_t h : 6; /* [21:16] */
410 __IO uint32_t ampm : 1; /* [22] */
411 __IO uint32_t reserved3 : 9; /* [31:23] */
412 } time_bit;
413} ertc_reg_time_type;
414
418typedef union
419{
420 __IO uint32_t date;
421 struct
422 {
423 __IO uint32_t d :6; /* [5:0] */
424 __IO uint32_t reserved1 :2; /* [7:6] */
425 __IO uint32_t m :5; /* [12:8] */
426 __IO uint32_t wk :3; /* [15:13] */
427 __IO uint32_t y :8; /* [23:16] */
428 __IO uint32_t reserved2 :8; /* [31:24] */
429 } date_bit;
430} ertc_reg_date_type;
431
435typedef union
436{
437 __IO uint32_t ala;
438 struct
439 {
440 __IO uint32_t s :7; /* [6:0] */
441 __IO uint32_t mask1 :1; /* [7] */
442 __IO uint32_t m :7; /* [14:8] */
443 __IO uint32_t mask2 :1; /* [15] */
444 __IO uint32_t h :6; /* [21:16] */
445 __IO uint32_t ampm :1; /* [22] */
446 __IO uint32_t mask3 :1; /* [23] */
447 __IO uint32_t d :6; /* [29:24] */
448 __IO uint32_t wksel :1; /* [30] */
449 __IO uint32_t mask4 :1; /* [31] */
450 } ala_bit;
451} ertc_reg_alarm_type;
452
456typedef union
457{
458 __IO uint32_t scal;
459 struct
460 {
461 __IO uint32_t dec :9; /* [8:0] */
462 __IO uint32_t reserved1 :4; /* [12:9] */
463 __IO uint32_t cal16 :1; /* [13] */
464 __IO uint32_t cal8 :1; /* [14] */
465 __IO uint32_t add :1; /* [15] */
466 __IO uint32_t reserved2 :16;/* [31:16] */
467 } scal_bit;
468} ertc_reg_scal_type;
469
473typedef union
474{
475 __IO uint32_t tadj;
476 struct
477 {
478 __IO uint32_t decsbs :15;/* [14:0] */
479 __IO uint32_t reserved1 :16;/* [30:15] */
480 __IO uint32_t add1s :1; /* [31] */
481 } tadj_bit;
482} ertc_reg_tadj_type;
483
487typedef union
488{
489 __IO uint32_t tstm;
490 struct
491 {
492 __IO uint32_t s :7; /* [6:0] */
493 __IO uint32_t reserved1 :1; /* [7] */
494 __IO uint32_t m :7; /* [14:8] */
495 __IO uint32_t reserved2 :1; /* [15] */
496 __IO uint32_t h :6; /* [21:16] */
497 __IO uint32_t ampm :1; /* [22] */
498 __IO uint32_t reserved3 :9; /* [31:23] */
499 } tstm_bit;
500} ertc_reg_tstm_type;
501
505typedef union
506{
507 __IO uint32_t tsdt;
508 struct
509 {
510 __IO uint32_t d :6; /* [5:0] */
511 __IO uint32_t reserved1 :2; /* [7:6] */
512 __IO uint32_t m :5; /* [12:8] */
513 __IO uint32_t wk :3; /* [15:13] */
514 __IO uint32_t reserved2 :16;/* [31:16] */
515 } tsdt_bit;
516} ertc_reg_tsdt_type;
517
521typedef struct
522{
523
527 union
528 {
529 __IO uint32_t time;
530 struct
531 {
532 __IO uint32_t s : 7; /* [6:0] */
533 __IO uint32_t reserved1 : 1; /* [7] */
534 __IO uint32_t m : 7; /* [14:8] */
535 __IO uint32_t reserved2 : 1; /* [15] */
536 __IO uint32_t h : 6; /* [21:16] */
537 __IO uint32_t ampm : 1; /* [22] */
538 __IO uint32_t reserved3 : 9; /* [31:23] */
539 } time_bit;
540 };
541
545 union
546 {
547 __IO uint32_t date;
548 struct
549 {
550 __IO uint32_t d :6; /* [5:0] */
551 __IO uint32_t reserved1 :2; /* [7:6] */
552 __IO uint32_t m :5; /* [12:8] */
553 __IO uint32_t wk :3; /* [15:13] */
554 __IO uint32_t y :8; /* [23:16] */
555 __IO uint32_t reserved2 :8; /* [31:24] */
556 } date_bit;
557 };
558
562 union
563 {
564 __IO uint32_t ctrl;
565 struct
566 {
567 __IO uint32_t watclk :3; /* [2:0] */
568 __IO uint32_t tsedg :1; /* [3] */
569 __IO uint32_t rcden :1; /* [4] */
570 __IO uint32_t dren :1; /* [5] */
571 __IO uint32_t hm :1; /* [6] */
572 __IO uint32_t ccalen :1; /* [7] */
573 __IO uint32_t alaen :1; /* [8] */
574 __IO uint32_t alben :1; /* [9] */
575 __IO uint32_t waten :1; /* [10] */
576 __IO uint32_t tsen :1; /* [11] */
577 __IO uint32_t alaien :1; /* [12] */
578 __IO uint32_t albien :1; /* [13] */
579 __IO uint32_t watien :1; /* [14] */
580 __IO uint32_t tsien :1; /* [15] */
581 __IO uint32_t add1h :1; /* [16] */
582 __IO uint32_t dec1h :1; /* [17] */
583 __IO uint32_t bpr :1; /* [18] */
584 __IO uint32_t calosel :1; /* [19] */
585 __IO uint32_t outp :1; /* [20] */
586 __IO uint32_t outsel :2; /* [22:21] */
587 __IO uint32_t caloen :1; /* [23] */
588 __IO uint32_t reserved1 :8; /* [31:24] */
589 } ctrl_bit;
590 };
591
595 union
596 {
597 __IO uint32_t sts;
598 struct
599 {
600 __IO uint32_t alawf :1; /* [0] */
601 __IO uint32_t albwf :1; /* [1] */
602 __IO uint32_t watwf :1; /* [2] */
603 __IO uint32_t tadjf :1; /* [3] */
604 __IO uint32_t initf :1; /* [4] */
605 __IO uint32_t updf :1; /* [5] */
606 __IO uint32_t imf :1; /* [6] */
607 __IO uint32_t imen :1; /* [7] */
608 __IO uint32_t alaf :1; /* [8] */
609 __IO uint32_t albf :1; /* [9] */
610 __IO uint32_t watf :1; /* [10] */
611 __IO uint32_t tsf :1; /* [11] */
612 __IO uint32_t tsof :1; /* [12] */
613 __IO uint32_t tp1f :1; /* [13] */
614 __IO uint32_t reserved1 :1; /* [14] */
615 __IO uint32_t reserved2 :1; /* [15] */
616 __IO uint32_t calupdf :1; /* [16] */
617 __IO uint32_t reserved3 :15;/* [31:17] */
618 } sts_bit;
619 };
620
624 union
625 {
626 __IO uint32_t div;
627 struct
628 {
629 __IO uint32_t divb :15;/* [14:0] */
630 __IO uint32_t reserved1 :1; /* [15] */
631 __IO uint32_t diva :7; /* [22:16] */
632 __IO uint32_t reserved2 :9; /* [31:23] */
633 } div_bit;
634 };
635
639 union
640 {
641 __IO uint32_t wat;
642 struct
643 {
644 __IO uint32_t val :16;/* [15:0] */
645 __IO uint32_t reserved1 :16;/* [31:16] */
646 } wat_bit;
647 };
648
652 union
653 {
654 __IO uint32_t ccal;
655 struct
656 {
657 __IO uint32_t calval :5; /* [4:0] */
658 __IO uint32_t reserved1 :2; /* [6:5] */
659 __IO uint32_t caldir :1; /* [7] */
660 __IO uint32_t reserved2 :24;/* [31:8] */
661 } ccal_bit;
662 };
663
667 union
668 {
669 __IO uint32_t ala;
670 struct
671 {
672 __IO uint32_t s :7; /* [6:0] */
673 __IO uint32_t mask1 :1; /* [7] */
674 __IO uint32_t m :7; /* [14:8] */
675 __IO uint32_t mask2 :1; /* [15] */
676 __IO uint32_t h :6; /* [21:16] */
677 __IO uint32_t ampm :1; /* [22] */
678 __IO uint32_t mask3 :1; /* [23] */
679 __IO uint32_t d :6; /* [29:24] */
680 __IO uint32_t wksel :1; /* [30] */
681 __IO uint32_t mask4 :1; /* [31] */
682 } ala_bit;
683 };
684
688 union
689 {
690 __IO uint32_t alb;
691 struct
692 {
693 __IO uint32_t s :7; /* [6:0] */
694 __IO uint32_t mask1 :1; /* [7] */
695 __IO uint32_t m :7; /* [14:8] */
696 __IO uint32_t mask2 :1; /* [15] */
697 __IO uint32_t h :6; /* [21:16] */
698 __IO uint32_t ampm :1; /* [22] */
699 __IO uint32_t mask3 :1; /* [23] */
700 __IO uint32_t d :6; /* [29:24] */
701 __IO uint32_t wksel :1; /* [30] */
702 __IO uint32_t mask4 :1; /* [31] */
703 } alb_bit;
704 };
705
709 union
710 {
711 __IO uint32_t wp;
712 struct
713 {
714 __IO uint32_t cmd :8; /* [7:0] */
715 __IO uint32_t reserved1 :24;/* [31:8] */
716 } wp_bit;
717 };
718
722 union
723 {
724 __IO uint32_t sbs;
725 struct
726 {
727 __IO uint32_t sbs :16;/* [15:0] */
728 __IO uint32_t reserved1 :16;/* [31:16] */
729 } sbs_bit;
730 };
731
735 union
736 {
737 __IO uint32_t tadj;
738 struct
739 {
740 __IO uint32_t decsbs :15;/* [14:0] */
741 __IO uint32_t reserved1 :16;/* [30:15] */
742 __IO uint32_t add1s :1; /* [31] */
743 } tadj_bit;
744 };
745
749 union
750 {
751 __IO uint32_t tstm;
752 struct
753 {
754 __IO uint32_t s :7; /* [6:0] */
755 __IO uint32_t reserved1 :1; /* [7] */
756 __IO uint32_t m :7; /* [14:8] */
757 __IO uint32_t reserved2 :1; /* [15] */
758 __IO uint32_t h :6; /* [21:16] */
759 __IO uint32_t ampm :1; /* [22] */
760 __IO uint32_t reserved3 :9; /* [31:23] */
761 } tstm_bit;
762 };
763
767 union
768 {
769 __IO uint32_t tsdt;
770 struct
771 {
772 __IO uint32_t d :6; /* [5:0] */
773 __IO uint32_t reserved1 :2; /* [7:6] */
774 __IO uint32_t m :5; /* [12:8] */
775 __IO uint32_t wk :3; /* [15:13] */
776 __IO uint32_t reserved2 :16;/* [31:16] */
777 } tsdt_bit;
778 };
779
783 union
784 {
785 __IO uint32_t tssbs;
786 struct
787 {
788 __IO uint32_t sbs :16;/* [15:0] */
789 __IO uint32_t reserved1 :16;/* [31:16] */
790 } tssbs_bit;
791 };
792
796 union
797 {
798 __IO uint32_t scal;
799 struct
800 {
801 __IO uint32_t dec :9; /* [8:0] */
802 __IO uint32_t reserved1 :4; /* [12:9] */
803 __IO uint32_t cal16 :1; /* [13] */
804 __IO uint32_t cal8 :1; /* [14] */
805 __IO uint32_t add :1; /* [15] */
806 __IO uint32_t reserved2 :16;/* [31:16] */
807 } scal_bit;
808 };
809
813 union
814 {
815 __IO uint32_t tamp;
816 struct
817 {
818 __IO uint32_t tp1en :1; /* [0] */
819 __IO uint32_t tp1edg :1; /* [1] */
820 __IO uint32_t tpien :1; /* [2] */
821 __IO uint32_t reserved1 :1; /* [3] */
822 __IO uint32_t reserved2 :1; /* [4] */
823 __IO uint32_t reserved3 :2; /* [6:5] */
824 __IO uint32_t tptsen :1; /* [7] */
825 __IO uint32_t tpfreq :3; /* [10:8] */
826 __IO uint32_t tpflt :2; /* [12:11] */
827 __IO uint32_t tppr :2; /* [14:13] */
828 __IO uint32_t tppu :1; /* [15] */
829 __IO uint32_t reserved4 :1; /* [16] */
830 __IO uint32_t reserved5 :1; /* [17] */
831 __IO uint32_t outtype :1; /* [18] */
832 __IO uint32_t reserved6 :13;/* [31:19] */
833 } tamp_bit;
834 };
835
839 union
840 {
841 __IO uint32_t alasbs;
842 struct
843 {
844 __IO uint32_t sbs :15;/* [14:0] */
845 __IO uint32_t reserved1 :9; /* [23:15] */
846 __IO uint32_t sbsmsk :4; /* [27:24] */
847 __IO uint32_t reserved2 :4; /* [31:28] */
848 } alasbs_bit;
849 };
850
854 union
855 {
856 __IO uint32_t albsbs;
857 struct
858 {
859 __IO uint32_t sbs :15;/* [14:0] */
860 __IO uint32_t reserved1 :9; /* [23:15] */
861 __IO uint32_t sbsmsk :4; /* [27:24] */
862 __IO uint32_t reserved2 :4; /* [31:28] */
863 } albsbs_bit;
864 };
865
869 __IO uint32_t reserved1;
870
874 union
875 {
876 __IO uint32_t dt1;
877 struct
878 {
879 __IO uint32_t dt :32;/* [31:0] */
880 } dt1_bit;
881 };
882
886 union
887 {
888 __IO uint32_t dt2;
889 struct
890 {
891 __IO uint32_t dt :32;/* [31:0] */
892 } dt2_bit;
893 };
894
898 union
899 {
900 __IO uint32_t dt3;
901 struct
902 {
903 __IO uint32_t dt :32;/* [31:0] */
904 } dt3_bit;
905 };
906
910 union
911 {
912 __IO uint32_t dt4;
913 struct
914 {
915 __IO uint32_t dt :32;/* [31:0] */
916 } dt4_bit;
917 };
918
922 union
923 {
924 __IO uint32_t dt5;
925 struct
926 {
927 __IO uint32_t dt :32;/* [31:0] */
928 } dt5_bit;
929 };
930
934 union
935 {
936 __IO uint32_t dt6;
937 struct
938 {
939 __IO uint32_t dt :32;/* [31:0] */
940 } dt6_bit;
941 };
942
946 union
947 {
948 __IO uint32_t dt7;
949 struct
950 {
951 __IO uint32_t dt :32;/* [31:0] */
952 } dt7_bit;
953 };
954
958 union
959 {
960 __IO uint32_t dt8;
961 struct
962 {
963 __IO uint32_t dt :32;/* [31:0] */
964 } dt8_bit;
965 };
966
970 union
971 {
972 __IO uint32_t dt9;
973 struct
974 {
975 __IO uint32_t dt :32;/* [31:0] */
976 } dt9_bit;
977 };
978
982 union
983 {
984 __IO uint32_t dt10;
985 struct
986 {
987 __IO uint32_t dt :32;/* [31:0] */
988 } dt10_bit;
989 };
990
994 union
995 {
996 __IO uint32_t dt11;
997 struct
998 {
999 __IO uint32_t dt :32;/* [31:0] */
1000 } dt11_bit;
1001 };
1002
1006 union
1007 {
1008 __IO uint32_t dt12;
1009 struct
1010 {
1011 __IO uint32_t dt :32;/* [31:0] */
1012 } dt12_bit;
1013 };
1014
1018 union
1019 {
1020 __IO uint32_t dt13;
1021 struct
1022 {
1023 __IO uint32_t dt :32;/* [31:0] */
1024 } dt13_bit;
1025 };
1026
1030 union
1031 {
1032 __IO uint32_t dt14;
1033 struct
1034 {
1035 __IO uint32_t dt :32;/* [31:0] */
1036 } dt14_bit;
1037 };
1038
1042 union
1043 {
1044 __IO uint32_t dt15;
1045 struct
1046 {
1047 __IO uint32_t dt :32;/* [31:0] */
1048 } dt15_bit;
1049 };
1050
1054 union
1055 {
1056 __IO uint32_t dt16;
1057 struct
1058 {
1059 __IO uint32_t dt :32;/* [31:0] */
1060 } dt16_bit;
1061 };
1062
1066 union
1067 {
1068 __IO uint32_t dt17;
1069 struct
1070 {
1071 __IO uint32_t dt :32;/* [31:0] */
1072 } dt17_bit;
1073 };
1074
1078 union
1079 {
1080 __IO uint32_t dt18;
1081 struct
1082 {
1083 __IO uint32_t dt :32;/* [31:0] */
1084 } dt18_bit;
1085 };
1086
1090 union
1091 {
1092 __IO uint32_t dt19;
1093 struct
1094 {
1095 __IO uint32_t dt :32;/* [31:0] */
1096 } dt19_bit;
1097 };
1098
1102 union
1103 {
1104 __IO uint32_t dt20;
1105 struct
1106 {
1107 __IO uint32_t dt :32;/* [31:0] */
1108 } dt20_bit;
1109 };
1110
1111
1112} ertc_type;
1113
1118#define ERTC ((ertc_type *) ERTC_BASE)
1119
1124uint8_t ertc_num_to_bcd(uint8_t num);
1125uint8_t ertc_bcd_to_num(uint8_t bcd);
1126void ertc_write_protect_enable(void);
1127void ertc_write_protect_disable(void);
1128 error_status ertc_wait_update(void);
1129 error_status ertc_wait_flag(uint32_t flag, flag_status status);
1130 error_status ertc_init_mode_enter(void);
1131void ertc_init_mode_exit(void);
1132 error_status ertc_reset(void);
1133 error_status ertc_divider_set(uint16_t div_a, uint16_t div_b);
1134 error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode);
1135 error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week);
1136 error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm);
1137void ertc_calendar_get(ertc_time_type* time);
1138uint32_t ertc_sub_second_get(void);
1139void ertc_alarm_mask_set(ertc_alarm_type alarm_x, uint32_t mask);
1140void ertc_alarm_week_date_select(ertc_alarm_type alarm_x, ertc_week_date_select_type wk);
1141void ertc_alarm_set(ertc_alarm_type alarm_x, uint8_t week_date, uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm);
1142void ertc_alarm_sub_second_set(ertc_alarm_type alarm_x, uint32_t value, ertc_alarm_sbs_mask_type mask);
1143 error_status ertc_alarm_enable(ertc_alarm_type alarm_x, confirm_state new_state);
1144void ertc_alarm_get(ertc_alarm_type alarm_x, ertc_alarm_value_type* alarm);
1145uint32_t ertc_alarm_sub_second_get(ertc_alarm_type alarm_x);
1146void ertc_wakeup_clock_set(ertc_wakeup_clock_type clock);
1147void ertc_wakeup_counter_set(uint32_t counter);
1148uint16_t ertc_wakeup_counter_get(void);
1149 error_status ertc_wakeup_enable(confirm_state new_state);
1150 error_status ertc_smooth_calibration_config(ertc_smooth_cal_period_type period, ertc_smooth_cal_clk_add_type clk_add, uint32_t clk_dec);
1151 error_status ertc_coarse_calibration_set(ertc_cal_direction_type dir, uint32_t value);
1152 error_status ertc_coarse_calibration_enable(confirm_state new_state);
1153void ertc_cal_output_select(ertc_cal_output_select_type output);
1154void ertc_cal_output_enable(confirm_state new_state);
1155 error_status ertc_time_adjust(ertc_time_adjust_type add1s, uint32_t decsbs);
1156void ertc_daylight_set(ertc_dst_operation_type operation, ertc_dst_save_type save);
1157uint8_t ertc_daylight_bpr_get(void);
1158 error_status ertc_refer_clock_detect_enable(confirm_state new_state);
1159void ertc_direct_read_enable(confirm_state new_state);
1160void ertc_output_set(ertc_output_source_type source, ertc_output_polarity_type polarity, ertc_output_type type);
1161void ertc_timestamp_valid_edge_set(ertc_timestamp_valid_edge_type edge);
1162void ertc_timestamp_enable(confirm_state new_state);
1163void ertc_timestamp_get(ertc_time_type* time);
1164uint32_t ertc_timestamp_sub_second_get(void);
1165void ertc_tamper_pull_up_enable(confirm_state new_state);
1166void ertc_tamper_precharge_set(ertc_tamper_precharge_type precharge);
1167void ertc_tamper_filter_set(ertc_tamper_filter_type filter);
1168void ertc_tamper_detect_freq_set(ertc_tamper_detect_freq_type freq);
1169void ertc_tamper_valid_edge_set(ertc_tamper_select_type tamper_x, ertc_tamper_valid_edge_type trigger);
1170void ertc_tamper_timestamp_enable(confirm_state new_state);
1171void ertc_tamper_enable(ertc_tamper_select_type tamper_x, confirm_state new_state);
1172void ertc_interrupt_enable(uint32_t source, confirm_state new_state);
1173 flag_status ertc_interrupt_get(uint32_t source);
1174 flag_status ertc_flag_get(uint32_t flag);
1175void ertc_flag_clear(uint32_t flag);
1176void ertc_bpr_data_write(ertc_dt_type dt, uint32_t data);
1177uint32_t ertc_bpr_data_read(ertc_dt_type dt);
1178
1191#ifdef __cplusplus
1192}
1193#endif
1194
1195#endif
at32f415.h
at32f415 header file
counter
uint16_t counter
Definition: project/at_start_f415/examples/debug/tmr1/src/main.c:40
ertc_write_protect_enable
void ertc_write_protect_enable(void)
enable write protection.
Definition: at32f415_ertc.c:76
ertc_direct_read_enable
void ertc_direct_read_enable(confirm_state new_state)
enable or disable direct read mode.
Definition: at32f415_ertc.c:1064
ertc_daylight_set
void ertc_daylight_set(ertc_dst_operation_type operation, ertc_dst_save_type save)
config the daylight saving time.
Definition: at32f415_ertc.c:1001
ertc_alarm_get
void ertc_alarm_get(ertc_alarm_type alarm_x, ertc_alarm_value_type *alarm)
get alarm value.
Definition: at32f415_ertc.c:674
ertc_hour_mode_set
error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode)
ertc hour mode set.
Definition: at32f415_ertc.c:283
ertc_wakeup_clock_set
void ertc_wakeup_clock_set(ertc_wakeup_clock_type clock)
set wakeup timer clock.
Definition: at32f415_ertc.c:731
ertc_wait_update
error_status ertc_wait_update(void)
ertc wait register update finish.
Definition: at32f415_ertc.c:97
ertc_coarse_calibration_enable
error_status ertc_coarse_calibration_enable(confirm_state new_state)
enable or disable coarse calibration.
Definition: at32f415_ertc.c:885
ertc_sub_second_get
uint32_t ertc_sub_second_get(void)
get current sub second.
Definition: at32f415_ertc.c:430
ertc_wakeup_counter_set
void ertc_wakeup_counter_set(uint32_t counter)
set wakeup counter.
Definition: at32f415_ertc.c:747
ertc_bcd_to_num
uint8_t ertc_bcd_to_num(uint8_t bcd)
bcd code conversion to number.
Definition: at32f415_ertc.c:66
ertc_timestamp_valid_edge_set
void ertc_timestamp_valid_edge_set(ertc_timestamp_valid_edge_type edge)
set the timestamp valid edge.
Definition: at32f415_ertc.c:1116
ertc_flag_get
flag_status ertc_flag_get(uint32_t flag)
get flag status.
Definition: at32f415_ertc.c:1428
ertc_interrupt_get
flag_status ertc_interrupt_get(uint32_t source)
get interrupt status
Definition: at32f415_ertc.c:1383
ertc_time_set
error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time.
Definition: at32f415_ertc.c:363
ertc_reset
error_status ertc_reset(void)
ertc reset all register.
Definition: at32f415_ertc.c:207
ertc_time_adjust
error_status ertc_time_adjust(ertc_time_adjust_type add1s, uint32_t decsbs)
adjust the time.
Definition: at32f415_ertc.c:951
ertc_tamper_timestamp_enable
void ertc_tamper_timestamp_enable(confirm_state new_state)
enable or disable trigger timestamp when tamper event occurs.
Definition: at32f415_ertc.c:1294
ertc_alarm_mask_set
void ertc_alarm_mask_set(ertc_alarm_type alarm_x, uint32_t mask)
set which bits are irrelevant to the alarm match.
Definition: at32f415_ertc.c:458
ertc_coarse_calibration_set
error_status ertc_coarse_calibration_set(ertc_cal_direction_type dir, uint32_t value)
set the coarse digital calibration.
Definition: at32f415_ertc.c:856
ertc_output_set
void ertc_output_set(ertc_output_source_type source, ertc_output_polarity_type polarity, ertc_output_type type)
set the output mode.
Definition: at32f415_ertc.c:1093
ertc_alarm_sub_second_get
uint32_t ertc_alarm_sub_second_get(ertc_alarm_type alarm_x)
get alarm sub second.
Definition: at32f415_ertc.c:707
ertc_interrupt_enable
void ertc_interrupt_enable(uint32_t source, confirm_state new_state)
enable or disable interrupt.
Definition: at32f415_ertc.c:1340
ertc_alarm_week_date_select
void ertc_alarm_week_date_select(ertc_alarm_type alarm_x, ertc_week_date_select_type wk)
alarm week or date mode select.
Definition: at32f415_ertc.c:500
ertc_wakeup_enable
error_status ertc_wakeup_enable(confirm_state new_state)
enable or disable wakeup timer.
Definition: at32f415_ertc.c:773
ertc_date_set
error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date.
Definition: at32f415_ertc.c:314
ertc_tamper_precharge_set
void ertc_tamper_precharge_set(ertc_tamper_precharge_type precharge)
set the tamper pin pre-charge time.
Definition: at32f415_ertc.c:1203
ertc_tamper_enable
void ertc_tamper_enable(ertc_tamper_select_type tamper_x, confirm_state new_state)
enable or disable tamper.
Definition: at32f415_ertc.c:1314
ertc_smooth_calibration_config
error_status ertc_smooth_calibration_config(ertc_smooth_cal_period_type period, ertc_smooth_cal_clk_add_type clk_add, uint32_t clk_dec)
config the smooth calibration.
Definition: at32f415_ertc.c:808
ertc_num_to_bcd
uint8_t ertc_num_to_bcd(uint8_t num)
number conversion to bcd code.
Definition: at32f415_ertc.c:51
ertc_flag_clear
void ertc_flag_clear(uint32_t flag)
clear flag status
Definition: at32f415_ertc.c:1461
ertc_refer_clock_detect_enable
error_status ertc_refer_clock_detect_enable(confirm_state new_state)
enable or disable refer clock detect.
Definition: at32f415_ertc.c:1036
ertc_wakeup_counter_get
uint16_t ertc_wakeup_counter_get(void)
get wakeup counter.
Definition: at32f415_ertc.c:763
ertc_init_mode_enter
error_status ertc_init_mode_enter(void)
ertc enter init mode.
Definition: at32f415_ertc.c:163
ertc_bpr_data_read
uint32_t ertc_bpr_data_read(ertc_dt_type dt)
read data from bpr register.
Definition: at32f415_ertc.c:1510
ertc_timestamp_get
void ertc_timestamp_get(ertc_time_type *time)
get the timestamp.
Definition: at32f415_ertc.c:1149
ertc_timestamp_sub_second_get
uint32_t ertc_timestamp_sub_second_get(void)
get the timestamp sub second.
Definition: at32f415_ertc.c:1172
ertc_timestamp_enable
void ertc_timestamp_enable(confirm_state new_state)
enable or disable timestamp.
Definition: at32f415_ertc.c:1132
ertc_tamper_pull_up_enable
void ertc_tamper_pull_up_enable(confirm_state new_state)
enable or disable tamper pin pull up.
Definition: at32f415_ertc.c:1182
ertc_tamper_filter_set
void ertc_tamper_filter_set(ertc_tamper_filter_type filter)
set the tamper filter time.
Definition: at32f415_ertc.c:1224
ertc_tamper_valid_edge_set
void ertc_tamper_valid_edge_set(ertc_tamper_select_type tamper_x, ertc_tamper_valid_edge_type trigger)
set the tamper trigger.
Definition: at32f415_ertc.c:1275
ertc_cal_output_enable
void ertc_cal_output_enable(confirm_state new_state)
enable or disable calibration output.
Definition: at32f415_ertc.c:931
ertc_alarm_set
void ertc_alarm_set(ertc_alarm_type alarm_x, uint8_t week_date, uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set alarm.
Definition: at32f415_ertc.c:538
ertc_alarm_sub_second_set
void ertc_alarm_sub_second_set(ertc_alarm_type alarm_x, uint32_t value, ertc_alarm_sbs_mask_type mask)
set alarm sub second.
Definition: at32f415_ertc.c:600
ertc_calendar_get
void ertc_calendar_get(ertc_time_type *time)
get calendar
Definition: at32f415_ertc.c:404
ertc_wait_flag
error_status ertc_wait_flag(uint32_t flag, flag_status status)
ertc wait flag status.
Definition: at32f415_ertc.c:138
ertc_tamper_detect_freq_set
void ertc_tamper_detect_freq_set(ertc_tamper_detect_freq_type freq)
set the tamper detection frequency.
Definition: at32f415_ertc.c:1249
ertc_divider_set
error_status ertc_divider_set(uint16_t div_a, uint16_t div_b)
ertc division set.
Definition: at32f415_ertc.c:251
ertc_cal_output_select
void ertc_cal_output_select(ertc_cal_output_select_type output)
calibration output source select.
Definition: at32f415_ertc.c:915
ertc_bpr_data_write
void ertc_bpr_data_write(ertc_dt_type dt, uint32_t data)
write data to the bpr register.
Definition: at32f415_ertc.c:1484
ertc_daylight_bpr_get
uint8_t ertc_daylight_bpr_get(void)
get the bpr value.
Definition: at32f415_ertc.c:1026
ertc_write_protect_disable
void ertc_write_protect_disable(void)
disable write protection.
Definition: at32f415_ertc.c:86
ertc_init_mode_exit
void ertc_init_mode_exit(void)
ertc exit init mode.
Definition: at32f415_ertc.c:197
ertc_alarm_enable
error_status ertc_alarm_enable(ertc_alarm_type alarm_x, confirm_state new_state)
enable or disable alarm clock.
Definition: at32f415_ertc.c:629
ertc_week_date_select_type
ertc_week_date_select_type
ertc week or date select
Definition: at32f415_ertc.h:123
ertc_cal_direction_type
ertc_cal_direction_type
ertc calibration direction mode
Definition: at32f415_ertc.h:196
ertc_smooth_cal_period_type
ertc_smooth_cal_period_type
ertc smooth calibration period
Definition: at32f415_ertc.h:177
ertc_tamper_valid_edge_type
ertc_tamper_valid_edge_type
ertc tamper valid edge
Definition: at32f415_ertc.h:333
ertc_output_type
ertc_output_type
output type
Definition: at32f415_ertc.h:261
ertc_cal_output_select_type
ertc_cal_output_select_type
ertc calibration output mode
Definition: at32f415_ertc.h:205
ertc_hour_mode_set_type
ertc_hour_mode_set_type
ertc hour mode
Definition: at32f415_ertc.h:104
ertc_wakeup_clock_type
ertc_wakeup_clock_type
ertc wakeup timer clock select
Definition: at32f415_ertc.h:164
ertc_tamper_precharge_type
ertc_tamper_precharge_type
tamper detection pre-charge time
Definition: at32f415_ertc.h:296
ertc_smooth_cal_clk_add_type
ertc_smooth_cal_clk_add_type
ertc smooth calibration clock add mode
Definition: at32f415_ertc.h:187
ertc_timestamp_valid_edge_type
ertc_timestamp_valid_edge_type
ertc timestamp valid edge
Definition: at32f415_ertc.h:279
ertc_tamper_select_type
ertc_tamper_select_type
ertc tamper x select
Definition: at32f415_ertc.h:288
ertc_tamper_filter_type
ertc_tamper_filter_type
ertc tamper filter
Definition: at32f415_ertc.h:307
ertc_dst_operation_type
ertc_dst_operation_type
ertc daylight saving time hour adjustment mode
Definition: at32f415_ertc.h:223
ertc_output_polarity_type
ertc_output_polarity_type
output polarity
Definition: at32f415_ertc.h:252
ertc_dt_type
ertc_dt_type
ertc bpr register
Definition: at32f415_ertc.h:344
ertc_dst_save_type
ertc_dst_save_type
ertc daylight saving time store operation mode
Definition: at32f415_ertc.h:232
ertc_output_source_type
ertc_output_source_type
output source
Definition: at32f415_ertc.h:241
ertc_tamper_detect_freq_type
ertc_tamper_detect_freq_type
ertc tamper detection frequency
Definition: at32f415_ertc.h:318
ertc_pin_select_type
ertc_pin_select_type
timestamp/ tamper detection pin selection
Definition: at32f415_ertc.h:270
ertc_alarm_type
ertc_alarm_type
ertc alarm x select
Definition: at32f415_ertc.h:132
ertc_am_pm_type
ertc_am_pm_type
ertc 12-hour format am/pm
Definition: at32f415_ertc.h:113
ertc_time_adjust_type
ertc_time_adjust_type
time adjust add mode
Definition: at32f415_ertc.h:214
ertc_alarm_sbs_mask_type
ertc_alarm_sbs_mask_type
ertc alarm sub second mask
Definition: at32f415_ertc.h:141
ERTC_SLECT_WEEK
@ ERTC_SLECT_WEEK
Definition: at32f415_ertc.h:125
ERTC_SLECT_DATE
@ ERTC_SLECT_DATE
Definition: at32f415_ertc.h:124
ERTC_CAL_DIR_NEGATIVE
@ ERTC_CAL_DIR_NEGATIVE
Definition: at32f415_ertc.h:198
ERTC_CAL_DIR_POSITIVE
@ ERTC_CAL_DIR_POSITIVE
Definition: at32f415_ertc.h:197
ERTC_SMOOTH_CAL_PERIOD_8
@ ERTC_SMOOTH_CAL_PERIOD_8
Definition: at32f415_ertc.h:180
ERTC_SMOOTH_CAL_PERIOD_32
@ ERTC_SMOOTH_CAL_PERIOD_32
Definition: at32f415_ertc.h:178
ERTC_SMOOTH_CAL_PERIOD_16
@ ERTC_SMOOTH_CAL_PERIOD_16
Definition: at32f415_ertc.h:179
ERTC_TAMPER_EDGE_RISING
@ ERTC_TAMPER_EDGE_RISING
Definition: at32f415_ertc.h:334
ERTC_TAMPER_EDGE_LOW
@ ERTC_TAMPER_EDGE_LOW
Definition: at32f415_ertc.h:336
ERTC_TAMPER_EDGE_FALLING
@ ERTC_TAMPER_EDGE_FALLING
Definition: at32f415_ertc.h:335
ERTC_TAMPER_EDGE_HIGH
@ ERTC_TAMPER_EDGE_HIGH
Definition: at32f415_ertc.h:337
ERTC_OUTPUT_TYPE_OPEN_DRAIN
@ ERTC_OUTPUT_TYPE_OPEN_DRAIN
Definition: at32f415_ertc.h:262
ERTC_OUTPUT_TYPE_PUSH_PULL
@ ERTC_OUTPUT_TYPE_PUSH_PULL
Definition: at32f415_ertc.h:263
ERTC_CAL_OUTPUT_512HZ
@ ERTC_CAL_OUTPUT_512HZ
Definition: at32f415_ertc.h:206
ERTC_CAL_OUTPUT_1HZ
@ ERTC_CAL_OUTPUT_1HZ
Definition: at32f415_ertc.h:207
ERTC_HOUR_MODE_24
@ ERTC_HOUR_MODE_24
Definition: at32f415_ertc.h:105
ERTC_HOUR_MODE_12
@ ERTC_HOUR_MODE_12
Definition: at32f415_ertc.h:106
ERTC_WAT_CLK_ERTCCLK_DIV16
@ ERTC_WAT_CLK_ERTCCLK_DIV16
Definition: at32f415_ertc.h:165
ERTC_WAT_CLK_ERTCCLK_DIV4
@ ERTC_WAT_CLK_ERTCCLK_DIV4
Definition: at32f415_ertc.h:167
ERTC_WAT_CLK_CK_A_16BITS
@ ERTC_WAT_CLK_CK_A_16BITS
Definition: at32f415_ertc.h:169
ERTC_WAT_CLK_CK_A_17BITS
@ ERTC_WAT_CLK_CK_A_17BITS
Definition: at32f415_ertc.h:170
ERTC_WAT_CLK_ERTCCLK_DIV8
@ ERTC_WAT_CLK_ERTCCLK_DIV8
Definition: at32f415_ertc.h:166
ERTC_WAT_CLK_ERTCCLK_DIV2
@ ERTC_WAT_CLK_ERTCCLK_DIV2
Definition: at32f415_ertc.h:168
ERTC_TAMPER_PR_8_ERTCCLK
@ ERTC_TAMPER_PR_8_ERTCCLK
Definition: at32f415_ertc.h:300
ERTC_TAMPER_PR_4_ERTCCLK
@ ERTC_TAMPER_PR_4_ERTCCLK
Definition: at32f415_ertc.h:299
ERTC_TAMPER_PR_1_ERTCCLK
@ ERTC_TAMPER_PR_1_ERTCCLK
Definition: at32f415_ertc.h:297
ERTC_TAMPER_PR_2_ERTCCLK
@ ERTC_TAMPER_PR_2_ERTCCLK
Definition: at32f415_ertc.h:298
ERTC_SMOOTH_CAL_CLK_ADD_0
@ ERTC_SMOOTH_CAL_CLK_ADD_0
Definition: at32f415_ertc.h:188
ERTC_SMOOTH_CAL_CLK_ADD_512
@ ERTC_SMOOTH_CAL_CLK_ADD_512
Definition: at32f415_ertc.h:189
ERTC_TIMESTAMP_EDGE_RISING
@ ERTC_TIMESTAMP_EDGE_RISING
Definition: at32f415_ertc.h:280
ERTC_TIMESTAMP_EDGE_FALLING
@ ERTC_TIMESTAMP_EDGE_FALLING
Definition: at32f415_ertc.h:281
ERTC_TAMPER_1
@ ERTC_TAMPER_1
Definition: at32f415_ertc.h:289
ERTC_TAMPER_FILTER_4
@ ERTC_TAMPER_FILTER_4
Definition: at32f415_ertc.h:310
ERTC_TAMPER_FILTER_8
@ ERTC_TAMPER_FILTER_8
Definition: at32f415_ertc.h:311
ERTC_TAMPER_FILTER_2
@ ERTC_TAMPER_FILTER_2
Definition: at32f415_ertc.h:309
ERTC_TAMPER_FILTER_DISABLE
@ ERTC_TAMPER_FILTER_DISABLE
Definition: at32f415_ertc.h:308
ERTC_DST_ADD_1H
@ ERTC_DST_ADD_1H
Definition: at32f415_ertc.h:224
ERTC_DST_DEC_1H
@ ERTC_DST_DEC_1H
Definition: at32f415_ertc.h:225
ERTC_OUTPUT_POLARITY_HIGH
@ ERTC_OUTPUT_POLARITY_HIGH
Definition: at32f415_ertc.h:253
ERTC_OUTPUT_POLARITY_LOW
@ ERTC_OUTPUT_POLARITY_LOW
Definition: at32f415_ertc.h:254
ERTC_DT11
@ ERTC_DT11
Definition: at32f415_ertc.h:355
ERTC_DT13
@ ERTC_DT13
Definition: at32f415_ertc.h:357
ERTC_DT2
@ ERTC_DT2
Definition: at32f415_ertc.h:346
ERTC_DT1
@ ERTC_DT1
Definition: at32f415_ertc.h:345
ERTC_DT15
@ ERTC_DT15
Definition: at32f415_ertc.h:359
ERTC_DT18
@ ERTC_DT18
Definition: at32f415_ertc.h:362
ERTC_DT19
@ ERTC_DT19
Definition: at32f415_ertc.h:363
ERTC_DT6
@ ERTC_DT6
Definition: at32f415_ertc.h:350
ERTC_DT7
@ ERTC_DT7
Definition: at32f415_ertc.h:351
ERTC_DT20
@ ERTC_DT20
Definition: at32f415_ertc.h:364
ERTC_DT17
@ ERTC_DT17
Definition: at32f415_ertc.h:361
ERTC_DT3
@ ERTC_DT3
Definition: at32f415_ertc.h:347
ERTC_DT4
@ ERTC_DT4
Definition: at32f415_ertc.h:348
ERTC_DT8
@ ERTC_DT8
Definition: at32f415_ertc.h:352
ERTC_DT5
@ ERTC_DT5
Definition: at32f415_ertc.h:349
ERTC_DT10
@ ERTC_DT10
Definition: at32f415_ertc.h:354
ERTC_DT9
@ ERTC_DT9
Definition: at32f415_ertc.h:353
ERTC_DT16
@ ERTC_DT16
Definition: at32f415_ertc.h:360
ERTC_DT12
@ ERTC_DT12
Definition: at32f415_ertc.h:356
ERTC_DT14
@ ERTC_DT14
Definition: at32f415_ertc.h:358
ERTC_DST_SAVE_0
@ ERTC_DST_SAVE_0
Definition: at32f415_ertc.h:233
ERTC_DST_SAVE_1
@ ERTC_DST_SAVE_1
Definition: at32f415_ertc.h:234
ERTC_OUTPUT_WAKEUP
@ ERTC_OUTPUT_WAKEUP
Definition: at32f415_ertc.h:245
ERTC_OUTPUT_ALARM_B
@ ERTC_OUTPUT_ALARM_B
Definition: at32f415_ertc.h:244
ERTC_OUTPUT_ALARM_A
@ ERTC_OUTPUT_ALARM_A
Definition: at32f415_ertc.h:243
ERTC_OUTPUT_DISABLE
@ ERTC_OUTPUT_DISABLE
Definition: at32f415_ertc.h:242
ERTC_TAMPER_FREQ_DIV_1024
@ ERTC_TAMPER_FREQ_DIV_1024
Definition: at32f415_ertc.h:324
ERTC_TAMPER_FREQ_DIV_32768
@ ERTC_TAMPER_FREQ_DIV_32768
Definition: at32f415_ertc.h:319
ERTC_TAMPER_FREQ_DIV_16384
@ ERTC_TAMPER_FREQ_DIV_16384
Definition: at32f415_ertc.h:320
ERTC_TAMPER_FREQ_DIV_512
@ ERTC_TAMPER_FREQ_DIV_512
Definition: at32f415_ertc.h:325
ERTC_TAMPER_FREQ_DIV_8192
@ ERTC_TAMPER_FREQ_DIV_8192
Definition: at32f415_ertc.h:321
ERTC_TAMPER_FREQ_DIV_4096
@ ERTC_TAMPER_FREQ_DIV_4096
Definition: at32f415_ertc.h:322
ERTC_TAMPER_FREQ_DIV_2048
@ ERTC_TAMPER_FREQ_DIV_2048
Definition: at32f415_ertc.h:323
ERTC_TAMPER_FREQ_DIV_256
@ ERTC_TAMPER_FREQ_DIV_256
Definition: at32f415_ertc.h:326
ERTC_PIN_PA0
@ ERTC_PIN_PA0
Definition: at32f415_ertc.h:272
ERTC_PIN_PC13
@ ERTC_PIN_PC13
Definition: at32f415_ertc.h:271
ERTC_ALB
@ ERTC_ALB
Definition: at32f415_ertc.h:134
ERTC_ALA
@ ERTC_ALA
Definition: at32f415_ertc.h:133
ERTC_AM
@ ERTC_AM
Definition: at32f415_ertc.h:115
ERTC_24H
@ ERTC_24H
Definition: at32f415_ertc.h:114
ERTC_PM
@ ERTC_PM
Definition: at32f415_ertc.h:116
ERTC_TIME_ADD_1S
@ ERTC_TIME_ADD_1S
Definition: at32f415_ertc.h:216
ERTC_TIME_ADD_NONE
@ ERTC_TIME_ADD_NONE
Definition: at32f415_ertc.h:215
ERTC_ALARM_SBS_MASK_14_12
@ ERTC_ALARM_SBS_MASK_14_12
Definition: at32f415_ertc.h:154
ERTC_ALARM_SBS_MASK_14_6
@ ERTC_ALARM_SBS_MASK_14_6
Definition: at32f415_ertc.h:148
ERTC_ALARM_SBS_MASK_14
@ ERTC_ALARM_SBS_MASK_14
Definition: at32f415_ertc.h:156
ERTC_ALARM_SBS_MASK_14_10
@ ERTC_ALARM_SBS_MASK_14_10
Definition: at32f415_ertc.h:152
ERTC_ALARM_SBS_MASK_14_9
@ ERTC_ALARM_SBS_MASK_14_9
Definition: at32f415_ertc.h:151
ERTC_ALARM_SBS_MASK_14_7
@ ERTC_ALARM_SBS_MASK_14_7
Definition: at32f415_ertc.h:149
ERTC_ALARM_SBS_MASK_NONE
@ ERTC_ALARM_SBS_MASK_NONE
Definition: at32f415_ertc.h:157
ERTC_ALARM_SBS_MASK_14_4
@ ERTC_ALARM_SBS_MASK_14_4
Definition: at32f415_ertc.h:146
ERTC_ALARM_SBS_MASK_14_3
@ ERTC_ALARM_SBS_MASK_14_3
Definition: at32f415_ertc.h:145
ERTC_ALARM_SBS_MASK_14_13
@ ERTC_ALARM_SBS_MASK_14_13
Definition: at32f415_ertc.h:155
ERTC_ALARM_SBS_MASK_14_5
@ ERTC_ALARM_SBS_MASK_14_5
Definition: at32f415_ertc.h:147
ERTC_ALARM_SBS_MASK_14_8
@ ERTC_ALARM_SBS_MASK_14_8
Definition: at32f415_ertc.h:150
ERTC_ALARM_SBS_MASK_ALL
@ ERTC_ALARM_SBS_MASK_ALL
Definition: at32f415_ertc.h:142
ERTC_ALARM_SBS_MASK_14_2
@ ERTC_ALARM_SBS_MASK_14_2
Definition: at32f415_ertc.h:144
ERTC_ALARM_SBS_MASK_14_11
@ ERTC_ALARM_SBS_MASK_14_11
Definition: at32f415_ertc.h:153
ERTC_ALARM_SBS_MASK_14_1
@ ERTC_ALARM_SBS_MASK_14_1
Definition: at32f415_ertc.h:143
error_status
error_status
error status
Definition: at32f415.h:258
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
time
ertc_time_type * time
Definition: random.c:42
ertc_alarm_value_type
ertc alarm
Definition: at32f415_ertc.h:386
ertc_alarm_value_type::min
uint8_t min
Definition: at32f415_ertc.h:389
ertc_alarm_value_type::mask
uint32_t mask
Definition: at32f415_ertc.h:392
ertc_alarm_value_type::week_date_sel
uint8_t week_date_sel
Definition: at32f415_ertc.h:393
ertc_alarm_value_type::sec
uint8_t sec
Definition: at32f415_ertc.h:390
ertc_alarm_value_type::week
uint8_t week
Definition: at32f415_ertc.h:394
ertc_alarm_value_type::hour
uint8_t hour
Definition: at32f415_ertc.h:388
ertc_alarm_value_type::ampm
ertc_am_pm_type ampm
Definition: at32f415_ertc.h:391
ertc_alarm_value_type::day
uint8_t day
Definition: at32f415_ertc.h:387
ertc_time_type
ertc time
Definition: at32f415_ertc.h:371
ertc_time_type::ampm
ertc_am_pm_type ampm
Definition: at32f415_ertc.h:379
ertc_time_type::year
uint8_t year
Definition: at32f415_ertc.h:372
ertc_time_type::day
uint8_t day
Definition: at32f415_ertc.h:374
ertc_time_type::hour
uint8_t hour
Definition: at32f415_ertc.h:375
ertc_time_type::min
uint8_t min
Definition: at32f415_ertc.h:376
ertc_time_type::month
uint8_t month
Definition: at32f415_ertc.h:373
ertc_time_type::week
uint8_t week
Definition: at32f415_ertc.h:378
ertc_time_type::sec
uint8_t sec
Definition: at32f415_ertc.h:377
ertc_type
type define ertc register all
Definition: at32f415_ertc.h:522
ertc_type::reserved3
__IO uint32_t reserved3
Definition: at32f415_ertc.h:538
ertc_type::dt6
__IO uint32_t dt6
Definition: at32f415_ertc.h:936
ertc_type::tsf
__IO uint32_t tsf
Definition: at32f415_ertc.h:611
ertc_type::imf
__IO uint32_t imf
Definition: at32f415_ertc.h:606
ertc_type::alben
__IO uint32_t alben
Definition: at32f415_ertc.h:574
ertc_type::alb
__IO uint32_t alb
Definition: at32f415_ertc.h:690
ertc_type::outtype
__IO uint32_t outtype
Definition: at32f415_ertc.h:831
ertc_type::dt14
__IO uint32_t dt14
Definition: at32f415_ertc.h:1032
ertc_type::waten
__IO uint32_t waten
Definition: at32f415_ertc.h:575
ertc_type::m
__IO uint32_t m
Definition: at32f415_ertc.h:534
ertc_type::mask3
__IO uint32_t mask3
Definition: at32f415_ertc.h:678
ertc_type::calosel
__IO uint32_t calosel
Definition: at32f415_ertc.h:584
ertc_type::tssbs
__IO uint32_t tssbs
Definition: at32f415_ertc.h:785
ertc_type::albsbs
__IO uint32_t albsbs
Definition: at32f415_ertc.h:856
ertc_type::tppr
__IO uint32_t tppr
Definition: at32f415_ertc.h:827
ertc_type::dt20
__IO uint32_t dt20
Definition: at32f415_ertc.h:1104
ertc_type::tadjf
__IO uint32_t tadjf
Definition: at32f415_ertc.h:603
ertc_type::d
__IO uint32_t d
Definition: at32f415_ertc.h:550
ertc_type::wk
__IO uint32_t wk
Definition: at32f415_ertc.h:553
ertc_type::date
__IO uint32_t date
Definition: at32f415_ertc.h:547
ertc_type::tadj
__IO uint32_t tadj
Definition: at32f415_ertc.h:737
ertc_type::bpr
__IO uint32_t bpr
Definition: at32f415_ertc.h:583
ertc_type::ampm
__IO uint32_t ampm
Definition: at32f415_ertc.h:537
ertc_type::add1s
__IO uint32_t add1s
Definition: at32f415_ertc.h:742
ertc_type::add1h
__IO uint32_t add1h
Definition: at32f415_ertc.h:581
ertc_type::cal16
__IO uint32_t cal16
Definition: at32f415_ertc.h:803
ertc_type::reserved6
__IO uint32_t reserved6
Definition: at32f415_ertc.h:832
ertc_type::tptsen
__IO uint32_t tptsen
Definition: at32f415_ertc.h:824
ertc_type::rcden
__IO uint32_t rcden
Definition: at32f415_ertc.h:569
ertc_type::tstm
__IO uint32_t tstm
Definition: at32f415_ertc.h:751
ertc_type::alaien
__IO uint32_t alaien
Definition: at32f415_ertc.h:577
ertc_type::ala
__IO uint32_t ala
Definition: at32f415_ertc.h:669
ertc_type::caloen
__IO uint32_t caloen
Definition: at32f415_ertc.h:587
ertc_type::outp
__IO uint32_t outp
Definition: at32f415_ertc.h:585
ertc_type::dt18
__IO uint32_t dt18
Definition: at32f415_ertc.h:1080
ertc_type::dt9
__IO uint32_t dt9
Definition: at32f415_ertc.h:972
ertc_type::time
__IO uint32_t time
Definition: at32f415_ertc.h:529
ertc_type::mask1
__IO uint32_t mask1
Definition: at32f415_ertc.h:673
ertc_type::alasbs
__IO uint32_t alasbs
Definition: at32f415_ertc.h:841
ertc_type::mask2
__IO uint32_t mask2
Definition: at32f415_ertc.h:675
ertc_type::wp
__IO uint32_t wp
Definition: at32f415_ertc.h:711
ertc_type::watien
__IO uint32_t watien
Definition: at32f415_ertc.h:579
ertc_type::dt8
__IO uint32_t dt8
Definition: at32f415_ertc.h:960
ertc_type::tp1en
__IO uint32_t tp1en
Definition: at32f415_ertc.h:818
ertc_type::initf
__IO uint32_t initf
Definition: at32f415_ertc.h:604
ertc_type::dt15
__IO uint32_t dt15
Definition: at32f415_ertc.h:1044
ertc_type::wat
__IO uint32_t wat
Definition: at32f415_ertc.h:641
ertc_type::scal
__IO uint32_t scal
Definition: at32f415_ertc.h:798
ertc_type::reserved1
__IO uint32_t reserved1
reserved register, offset:0x4c
Definition: at32f415_ertc.h:533
ertc_type::tppu
__IO uint32_t tppu
Definition: at32f415_ertc.h:828
ertc_type::dt17
__IO uint32_t dt17
Definition: at32f415_ertc.h:1068
ertc_type::dt1
__IO uint32_t dt1
Definition: at32f415_ertc.h:876
ertc_type::tpfreq
__IO uint32_t tpfreq
Definition: at32f415_ertc.h:825
ertc_type::calupdf
__IO uint32_t calupdf
Definition: at32f415_ertc.h:616
ertc_type::alaen
__IO uint32_t alaen
Definition: at32f415_ertc.h:573
ertc_type::sts
__IO uint32_t sts
Definition: at32f415_ertc.h:597
ertc_type::divb
__IO uint32_t divb
Definition: at32f415_ertc.h:629
ertc_type::dec
__IO uint32_t dec
Definition: at32f415_ertc.h:801
ertc_type::dren
__IO uint32_t dren
Definition: at32f415_ertc.h:570
ertc_type::mask4
__IO uint32_t mask4
Definition: at32f415_ertc.h:681
ertc_type::hm
__IO uint32_t hm
Definition: at32f415_ertc.h:571
ertc_type::dt3
__IO uint32_t dt3
Definition: at32f415_ertc.h:900
ertc_type::dt2
__IO uint32_t dt2
Definition: at32f415_ertc.h:888
ertc_type::dt19
__IO uint32_t dt19
Definition: at32f415_ertc.h:1092
ertc_type::dt
__IO uint32_t dt
Definition: at32f415_ertc.h:879
ertc_type::sbs
__IO uint32_t sbs
Definition: at32f415_ertc.h:724
ertc_type::ctrl
__IO uint32_t ctrl
Definition: at32f415_ertc.h:564
ertc_type::watf
__IO uint32_t watf
Definition: at32f415_ertc.h:610
ertc_type::tsof
__IO uint32_t tsof
Definition: at32f415_ertc.h:612
ertc_type::imen
__IO uint32_t imen
Definition: at32f415_ertc.h:607
ertc_type::decsbs
__IO uint32_t decsbs
Definition: at32f415_ertc.h:740
ertc_type::dt11
__IO uint32_t dt11
Definition: at32f415_ertc.h:996
ertc_type::dt7
__IO uint32_t dt7
Definition: at32f415_ertc.h:948
ertc_type::watclk
__IO uint32_t watclk
Definition: at32f415_ertc.h:567
ertc_type::dt10
__IO uint32_t dt10
Definition: at32f415_ertc.h:984
ertc_type::s
__IO uint32_t s
Definition: at32f415_ertc.h:532
ertc_type::reserved4
__IO uint32_t reserved4
Definition: at32f415_ertc.h:829
ertc_type::watwf
__IO uint32_t watwf
Definition: at32f415_ertc.h:602
ertc_type::tsedg
__IO uint32_t tsedg
Definition: at32f415_ertc.h:568
ertc_type::tp1edg
__IO uint32_t tp1edg
Definition: at32f415_ertc.h:819
ertc_type::diva
__IO uint32_t diva
Definition: at32f415_ertc.h:631
ertc_type::dt16
__IO uint32_t dt16
Definition: at32f415_ertc.h:1056
ertc_type::dt13
__IO uint32_t dt13
Definition: at32f415_ertc.h:1020
ertc_type::val
__IO uint32_t val
Definition: at32f415_ertc.h:644
ertc_type::tsdt
__IO uint32_t tsdt
Definition: at32f415_ertc.h:769
ertc_type::tp1f
__IO uint32_t tp1f
Definition: at32f415_ertc.h:613
ertc_type::dt4
__IO uint32_t dt4
Definition: at32f415_ertc.h:912
ertc_type::wksel
__IO uint32_t wksel
Definition: at32f415_ertc.h:680
ertc_type::updf
__IO uint32_t updf
Definition: at32f415_ertc.h:605
ertc_type::cal8
__IO uint32_t cal8
Definition: at32f415_ertc.h:804
ertc_type::tsien
__IO uint32_t tsien
Definition: at32f415_ertc.h:580
ertc_type::tpien
__IO uint32_t tpien
Definition: at32f415_ertc.h:820
ertc_type::ccalen
__IO uint32_t ccalen
Definition: at32f415_ertc.h:572
ertc_type::dt12
__IO uint32_t dt12
Definition: at32f415_ertc.h:1008
ertc_type::caldir
__IO uint32_t caldir
Definition: at32f415_ertc.h:659
ertc_type::outsel
__IO uint32_t outsel
Definition: at32f415_ertc.h:586
ertc_type::calval
__IO uint32_t calval
Definition: at32f415_ertc.h:657
ertc_type::div
__IO uint32_t div
Definition: at32f415_ertc.h:626
ertc_type::dec1h
__IO uint32_t dec1h
Definition: at32f415_ertc.h:582
ertc_type::albwf
__IO uint32_t albwf
Definition: at32f415_ertc.h:601
ertc_type::alawf
__IO uint32_t alawf
Definition: at32f415_ertc.h:600
ertc_type::albien
__IO uint32_t albien
Definition: at32f415_ertc.h:578
ertc_type::sbsmsk
__IO uint32_t sbsmsk
Definition: at32f415_ertc.h:846
ertc_type::alaf
__IO uint32_t alaf
Definition: at32f415_ertc.h:608
ertc_type::tamp
__IO uint32_t tamp
Definition: at32f415_ertc.h:815
ertc_type::ccal
__IO uint32_t ccal
Definition: at32f415_ertc.h:654
ertc_type::reserved5
__IO uint32_t reserved5
Definition: at32f415_ertc.h:830
ertc_type::y
__IO uint32_t y
Definition: at32f415_ertc.h:554
ertc_type::tsen
__IO uint32_t tsen
Definition: at32f415_ertc.h:576
ertc_type::dt5
__IO uint32_t dt5
Definition: at32f415_ertc.h:924
ertc_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_ertc.h:535
ertc_type::h
__IO uint32_t h
Definition: at32f415_ertc.h:536
ertc_type::cmd
__IO uint32_t cmd
Definition: at32f415_ertc.h:714
ertc_type::add
__IO uint32_t add
Definition: at32f415_ertc.h:805
ertc_type::albf
__IO uint32_t albf
Definition: at32f415_ertc.h:609
ertc_type::tpflt
__IO uint32_t tpflt
Definition: at32f415_ertc.h:826
ertc_reg_alarm_type
ertc alarm reg union
Definition: at32f415_ertc.h:436
ertc_reg_alarm_type::d
__IO uint32_t d
Definition: at32f415_ertc.h:447
ertc_reg_alarm_type::h
__IO uint32_t h
Definition: at32f415_ertc.h:444
ertc_reg_alarm_type::mask3
__IO uint32_t mask3
Definition: at32f415_ertc.h:446
ertc_reg_alarm_type::mask2
__IO uint32_t mask2
Definition: at32f415_ertc.h:443
ertc_reg_alarm_type::wksel
__IO uint32_t wksel
Definition: at32f415_ertc.h:448
ertc_reg_alarm_type::ala
__IO uint32_t ala
Definition: at32f415_ertc.h:437
ertc_reg_alarm_type::mask1
__IO uint32_t mask1
Definition: at32f415_ertc.h:441
ertc_reg_alarm_type::ampm
__IO uint32_t ampm
Definition: at32f415_ertc.h:445
ertc_reg_alarm_type::s
__IO uint32_t s
Definition: at32f415_ertc.h:440
ertc_reg_alarm_type::mask4
__IO uint32_t mask4
Definition: at32f415_ertc.h:449
ertc_reg_alarm_type::m
__IO uint32_t m
Definition: at32f415_ertc.h:442
ertc_reg_date_type
ertc date reg union
Definition: at32f415_ertc.h:419
ertc_reg_date_type::y
__IO uint32_t y
Definition: at32f415_ertc.h:427
ertc_reg_date_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_ertc.h:428
ertc_reg_date_type::m
__IO uint32_t m
Definition: at32f415_ertc.h:425
ertc_reg_date_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_ertc.h:424
ertc_reg_date_type::wk
__IO uint32_t wk
Definition: at32f415_ertc.h:426
ertc_reg_date_type::date
__IO uint32_t date
Definition: at32f415_ertc.h:420
ertc_reg_date_type::d
__IO uint32_t d
Definition: at32f415_ertc.h:423
ertc_reg_scal_type
ertc scal reg union
Definition: at32f415_ertc.h:457
ertc_reg_scal_type::dec
__IO uint32_t dec
Definition: at32f415_ertc.h:461
ertc_reg_scal_type::cal8
__IO uint32_t cal8
Definition: at32f415_ertc.h:464
ertc_reg_scal_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_ertc.h:466
ertc_reg_scal_type::cal16
__IO uint32_t cal16
Definition: at32f415_ertc.h:463
ertc_reg_scal_type::scal
__IO uint32_t scal
Definition: at32f415_ertc.h:458
ertc_reg_scal_type::add
__IO uint32_t add
Definition: at32f415_ertc.h:465
ertc_reg_scal_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_ertc.h:462
ertc_reg_tadj_type
ertc tadj reg union
Definition: at32f415_ertc.h:474
ertc_reg_tadj_type::tadj
__IO uint32_t tadj
Definition: at32f415_ertc.h:475
ertc_reg_tadj_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_ertc.h:479
ertc_reg_tadj_type::decsbs
__IO uint32_t decsbs
Definition: at32f415_ertc.h:478
ertc_reg_tadj_type::add1s
__IO uint32_t add1s
Definition: at32f415_ertc.h:480
ertc_reg_time_type
ertc time reg union
Definition: at32f415_ertc.h:401
ertc_reg_time_type::ampm
__IO uint32_t ampm
Definition: at32f415_ertc.h:410
ertc_reg_time_type::s
__IO uint32_t s
Definition: at32f415_ertc.h:405
ertc_reg_time_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_ertc.h:406
ertc_reg_time_type::m
__IO uint32_t m
Definition: at32f415_ertc.h:407
ertc_reg_time_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_ertc.h:408
ertc_reg_time_type::time
__IO uint32_t time
Definition: at32f415_ertc.h:402
ertc_reg_time_type::h
__IO uint32_t h
Definition: at32f415_ertc.h:409
ertc_reg_time_type::reserved3
__IO uint32_t reserved3
Definition: at32f415_ertc.h:411
ertc_reg_tsdt_type
ertc tsdt register, offset:0x34
Definition: at32f415_ertc.h:506
ertc_reg_tsdt_type::wk
__IO uint32_t wk
Definition: at32f415_ertc.h:513
ertc_reg_tsdt_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_ertc.h:511
ertc_reg_tsdt_type::d
__IO uint32_t d
Definition: at32f415_ertc.h:510
ertc_reg_tsdt_type::tsdt
__IO uint32_t tsdt
Definition: at32f415_ertc.h:507
ertc_reg_tsdt_type::m
__IO uint32_t m
Definition: at32f415_ertc.h:512
ertc_reg_tsdt_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_ertc.h:514
ertc_reg_tstm_type
ertc tstm reg union
Definition: at32f415_ertc.h:488
ertc_reg_tstm_type::s
__IO uint32_t s
Definition: at32f415_ertc.h:492
ertc_reg_tstm_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_ertc.h:493
ertc_reg_tstm_type::ampm
__IO uint32_t ampm
Definition: at32f415_ertc.h:497
ertc_reg_tstm_type::m
__IO uint32_t m
Definition: at32f415_ertc.h:494
ertc_reg_tstm_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_ertc.h:495
ertc_reg_tstm_type::reserved3
__IO uint32_t reserved3
Definition: at32f415_ertc.h:498
ertc_reg_tstm_type::h
__IO uint32_t h
Definition: at32f415_ertc.h:496
ertc_reg_tstm_type::tstm
__IO uint32_t tstm
Definition: at32f415_ertc.h:489


AT32F415 Firmwary Library: at32f415_exint.c Source File

  • libraries
  • drivers
  • src
at32f415_exint.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef EXINT_MODULE_ENABLED
39
49void exint_reset(void)
50{
51 EXINT->inten = 0x00000000;
52 EXINT->polcfg1 = 0x00000000;
53 EXINT->polcfg2 = 0x00000000;
54 EXINT->evten = 0x00000000;
55 EXINT->intsts = 0x007FFFFF;
56}
57
64void exint_default_para_init(exint_init_type *exint_struct)
65{
66 exint_struct->line_enable = FALSE;
67 exint_struct->line_select = EXINT_LINE_NONE;
68 exint_struct->line_polarity = EXINT_TRIGGER_FALLING_EDGE;
69 exint_struct->line_mode = EXINT_LINE_EVENT;
70}
71
78void exint_init(exint_init_type *exint_struct)
79{
80 uint32_t line_index = 0;
81 line_index = exint_struct->line_select;
82
83 EXINT->inten &= ~line_index;
84 EXINT->evten &= ~line_index;
85
86 if(exint_struct->line_enable != FALSE)
87 {
88 if(exint_struct->line_mode == EXINT_LINE_INTERRUPUT)
89 {
90 EXINT->inten |= line_index;
91 }
92 else
93 {
94 EXINT->evten |= line_index;
95 }
96
97 EXINT->polcfg1 &= ~line_index;
98 EXINT->polcfg2 &= ~line_index;
99 if(exint_struct->line_polarity == EXINT_TRIGGER_RISING_EDGE)
100 {
101 EXINT->polcfg1 |= line_index;
102 }
103 else if(exint_struct->line_polarity == EXINT_TRIGGER_FALLING_EDGE)
104 {
105 EXINT->polcfg2 |= line_index;
106 }
107 else
108 {
109 EXINT->polcfg1 |= line_index;
110 EXINT->polcfg2 |= line_index;
111 }
112 }
113}
114
126void exint_flag_clear(uint32_t exint_line)
127{
128 EXINT->intsts = exint_line;
129}
130
142 flag_status exint_flag_get(uint32_t exint_line)
143{
144 flag_status status = RESET;
145 uint32_t exint_flag =0;
146 exint_flag = EXINT->intsts & exint_line;
147 if((exint_flag != (uint16_t)RESET))
148 {
149 status = SET;
150 }
151 else
152 {
153 status = RESET;
154 }
155 return status;
156}
157
169void exint_software_interrupt_event_generate(uint32_t exint_line)
170{
171 EXINT->swtrg |= exint_line;
172}
173
187void exint_interrupt_enable(uint32_t exint_line, confirm_state new_state)
188{
189 if(new_state == TRUE)
190 {
191 EXINT->inten |= exint_line;
192 }
193 else
194 {
195 EXINT->inten &= ~exint_line;
196 }
197}
198
212void exint_event_enable(uint32_t exint_line, confirm_state new_state)
213{
214 if(new_state == TRUE)
215 {
216 EXINT->evten |= exint_line;
217 }
218 else
219 {
220 EXINT->evten &= ~exint_line;
221 }
222}
223
228#endif
229
EXINT_LINE_EVENT
@ EXINT_LINE_EVENT
Definition: at32f415_exint.h:90
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_TRIGGER_FALLING_EDGE
@ EXINT_TRIGGER_FALLING_EDGE
Definition: at32f415_exint.h:99
EXINT_LINE_NONE
#define EXINT_LINE_NONE
Definition: at32f415_exint.h:51
exint_flag_get
flag_status exint_flag_get(uint32_t exint_line)
get exint flag
Definition: at32f415_exint.c:142
exint_interrupt_enable
void exint_interrupt_enable(uint32_t exint_line, confirm_state new_state)
enable or disable exint interrupt
Definition: at32f415_exint.c:187
exint_event_enable
void exint_event_enable(uint32_t exint_line, confirm_state new_state)
enable or disable exint event
Definition: at32f415_exint.c:212
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_reset
void exint_reset(void)
exint reset
Definition: at32f415_exint.c:49
exint_software_interrupt_event_generate
void exint_software_interrupt_event_generate(uint32_t exint_line)
generate exint software interrupt event
Definition: at32f415_exint.c:169
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT
#define EXINT
Definition: at32f415_exint.h:203
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_exint.h Source File

  • libraries
  • drivers
  • inc
at32f415_exint.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_EXINT_H
29#define __AT32F415_EXINT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
51#define EXINT_LINE_NONE ((uint32_t)0x000000)
52#define EXINT_LINE_0 ((uint32_t)0x000001)
53#define EXINT_LINE_1 ((uint32_t)0x000002)
54#define EXINT_LINE_2 ((uint32_t)0x000004)
55#define EXINT_LINE_3 ((uint32_t)0x000008)
56#define EXINT_LINE_4 ((uint32_t)0x000010)
57#define EXINT_LINE_5 ((uint32_t)0x000020)
58#define EXINT_LINE_6 ((uint32_t)0x000040)
59#define EXINT_LINE_7 ((uint32_t)0x000080)
60#define EXINT_LINE_8 ((uint32_t)0x000100)
61#define EXINT_LINE_9 ((uint32_t)0x000200)
62#define EXINT_LINE_10 ((uint32_t)0x000400)
63#define EXINT_LINE_11 ((uint32_t)0x000800)
64#define EXINT_LINE_12 ((uint32_t)0x001000)
65#define EXINT_LINE_13 ((uint32_t)0x002000)
66#define EXINT_LINE_14 ((uint32_t)0x004000)
67#define EXINT_LINE_15 ((uint32_t)0x008000)
68#define EXINT_LINE_16 ((uint32_t)0x010000)
69#define EXINT_LINE_17 ((uint32_t)0x020000)
70#define EXINT_LINE_18 ((uint32_t)0x040000)
71#define EXINT_LINE_19 ((uint32_t)0x080000)
72#define EXINT_LINE_20 ((uint32_t)0x100000)
73#define EXINT_LINE_21 ((uint32_t)0x200000)
74#define EXINT_LINE_22 ((uint32_t)0x400000)
87typedef enum
88{
89 EXINT_LINE_INTERRUPUT = 0x00,
90 EXINT_LINE_EVENT = 0x01
91} exint_line_mode_type;
92
96typedef enum
97{
98 EXINT_TRIGGER_RISING_EDGE = 0x00,
99 EXINT_TRIGGER_FALLING_EDGE = 0x01,
100 EXINT_TRIGGER_BOTH_EDGE = 0x02
101} exint_polarity_config_type;
102
106typedef struct
107{
108 exint_line_mode_type line_mode;
109 uint32_t line_select;
110 exint_polarity_config_type line_polarity;
111 confirm_state line_enable;
112} exint_init_type;
113
117typedef struct
118{
119
123 union
124 {
125 __IO uint32_t inten;
126 struct
127 {
128 __IO uint32_t intenx : 23;/* [22:0] */
129 __IO uint32_t reserved1 : 9;/* [31:23] */
130 } inten_bit;
131 };
132
136 union
137 {
138 __IO uint32_t evten;
139 struct
140 {
141 __IO uint32_t evtenx : 23;/* [22:0] */
142 __IO uint32_t reserved1 : 9;/* [31:23] */
143 } evten_bit;
144 };
145
149 union
150 {
151 __IO uint32_t polcfg1;
152 struct
153 {
154 __IO uint32_t rpx : 23;/* [22:0] */
155 __IO uint32_t reserved1 : 9;/* [31:23] */
156 } polcfg1_bit;
157 };
158
162 union
163 {
164 __IO uint32_t polcfg2;
165 struct
166 {
167 __IO uint32_t fpx : 23;/* [22:0] */
168 __IO uint32_t reserved1 : 9;/* [31:23] */
169 } polcfg2_bit;
170 };
171
175 union
176 {
177 __IO uint32_t swtrg;
178 struct
179 {
180 __IO uint32_t swtx : 23;/* [22:0] */
181 __IO uint32_t reserved1 : 9;/* [31:23] */
182 } swtrg_bit;
183 };
184
188 union
189 {
190 __IO uint32_t intsts;
191 struct
192 {
193 __IO uint32_t linex : 23;/* [22:0] */
194 __IO uint32_t reserved1 : 9;/* [31:23] */
195 } intsts_bit;
196 };
197} exint_type;
198
203#define EXINT ((exint_type *) EXINT_BASE)
204
209void exint_reset(void);
210void exint_default_para_init(exint_init_type *exint_struct);
211void exint_init(exint_init_type *exint_struct);
212void exint_flag_clear(uint32_t exint_line);
213 flag_status exint_flag_get(uint32_t exint_line);
214void exint_software_interrupt_event_generate(uint32_t exint_line);
215void exint_interrupt_enable(uint32_t exint_line, confirm_state new_state);
216void exint_event_enable(uint32_t exint_line, confirm_state new_state);
217
230#ifdef __cplusplus
231}
232#endif
233
234#endif
at32f415.h
at32f415 header file
exint_flag_get
flag_status exint_flag_get(uint32_t exint_line)
get exint flag
Definition: at32f415_exint.c:142
exint_interrupt_enable
void exint_interrupt_enable(uint32_t exint_line, confirm_state new_state)
enable or disable exint interrupt
Definition: at32f415_exint.c:187
exint_event_enable
void exint_event_enable(uint32_t exint_line, confirm_state new_state)
enable or disable exint event
Definition: at32f415_exint.c:212
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_reset
void exint_reset(void)
exint reset
Definition: at32f415_exint.c:49
exint_software_interrupt_event_generate
void exint_software_interrupt_event_generate(uint32_t exint_line)
generate exint software interrupt event
Definition: at32f415_exint.c:169
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
exint_line_mode_type
exint_line_mode_type
exint line mode type
Definition: at32f415_exint.h:88
exint_polarity_config_type
exint_polarity_config_type
exint polarity configuration type
Definition: at32f415_exint.h:97
EXINT_LINE_EVENT
@ EXINT_LINE_EVENT
Definition: at32f415_exint.h:90
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_TRIGGER_FALLING_EDGE
@ EXINT_TRIGGER_FALLING_EDGE
Definition: at32f415_exint.h:99
EXINT_TRIGGER_BOTH_EDGE
@ EXINT_TRIGGER_BOTH_EDGE
Definition: at32f415_exint.h:100
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
exint_type
type define exint register all
Definition: at32f415_exint.h:118
exint_type::polcfg1
__IO uint32_t polcfg1
Definition: at32f415_exint.h:151
exint_type::intsts
__IO uint32_t intsts
Definition: at32f415_exint.h:190
exint_type::polcfg2
__IO uint32_t polcfg2
Definition: at32f415_exint.h:164
exint_type::fpx
__IO uint32_t fpx
Definition: at32f415_exint.h:167
exint_type::intenx
__IO uint32_t intenx
Definition: at32f415_exint.h:128
exint_type::rpx
__IO uint32_t rpx
Definition: at32f415_exint.h:154
exint_type::evtenx
__IO uint32_t evtenx
Definition: at32f415_exint.h:141
exint_type::linex
__IO uint32_t linex
Definition: at32f415_exint.h:193
exint_type::inten
__IO uint32_t inten
Definition: at32f415_exint.h:125
exint_type::evten
__IO uint32_t evten
Definition: at32f415_exint.h:138
exint_type::swtx
__IO uint32_t swtx
Definition: at32f415_exint.h:180
exint_type::swtrg
__IO uint32_t swtrg
Definition: at32f415_exint.h:177
exint_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_exint.h:129


AT32F415 Firmwary Library: at32f415_flash.c Source File

  • libraries
  • drivers
  • src
at32f415_flash.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef FLASH_MODULE_ENABLED
39
55 flag_status flash_flag_get(uint32_t flash_flag)
56{
57 flag_status status = RESET;
58 uint32_t flag_position;
59 flag_position = flash_flag & 0x70000000;
60 flash_flag &= 0x8FFFFFFF;
61 switch(flag_position)
62 {
63 case 0x00000000:
64 if(FLASH->sts & flash_flag)
65 status = SET;
66 break;
67 case 0x40000000:
68 if(FLASH->usd & flash_flag)
69 status = SET;
70 break;
71 default:
72 break;
73 }
74 /* return the new state of flash_flag (SET or RESET) */
75 return status;
76}
77
87void flash_flag_clear(uint32_t flash_flag)
88{
89 FLASH->sts = flash_flag;
90}
91
98 flash_status_type flash_operation_status_get(void)
99{
100 flash_status_type flash_status = FLASH_OPERATE_DONE;
101 if(FLASH->sts_bit.obf != RESET)
102 {
103 flash_status = FLASH_OPERATE_BUSY;
104 }
105 else if(FLASH->sts_bit.prgmerr != RESET)
106 {
107 flash_status = FLASH_PROGRAM_ERROR;
108 }
109 else if(FLASH->sts_bit.epperr != RESET)
110 {
111 flash_status = FLASH_EPP_ERROR;
112 }
113 else
114 {
115 flash_status = FLASH_OPERATE_DONE;
116 }
117 /* return the flash status */
118 return flash_status;
119}
120
127 flash_status_type flash_operation_wait_for(uint32_t time_out)
128{
129 flash_status_type status = FLASH_OPERATE_DONE;
130 /* check for the flash status */
131 status = flash_operation_status_get();
132
133 while((status == FLASH_OPERATE_BUSY) && (time_out != 0x00))
134 {
135 status = flash_operation_status_get();
136 time_out--;
137 }
138 if(time_out == 0x00)
139 {
140 status = FLASH_OPERATE_TIMEOUT;
141 }
142 /* return the status */
143 return status;
144}
145
151void flash_unlock(void)
152{
153 FLASH->unlock = FLASH_UNLOCK_KEY1;
154 FLASH->unlock = FLASH_UNLOCK_KEY2;
155}
156
162void flash_lock(void)
163{
164 FLASH->ctrl_bit.oplk = TRUE;
165}
166
173 flash_status_type flash_sector_erase(uint32_t sector_address)
174{
175 flash_status_type status = FLASH_OPERATE_DONE;
176 /* wait for last operation to be completed */
177 status = flash_operation_wait_for(ERASE_TIMEOUT);
178
179 if(status == FLASH_OPERATE_DONE)
180 {
181 /* if the previous operation is completed, continue to erase the sector */
182 FLASH->ctrl_bit.secers = TRUE;
183 FLASH->addr = sector_address;
184 FLASH->ctrl_bit.erstr = TRUE;
185
186 /* wait for operation to be completed */
187 status = flash_operation_wait_for(ERASE_TIMEOUT);
188
189 /* disable the secers bit */
190 FLASH->ctrl_bit.secers = FALSE;
191 }
192 /* return the erase status */
193 return status;
194}
195
202 flash_status_type flash_internal_all_erase(void)
203{
204 flash_status_type status = FLASH_OPERATE_DONE;
205 /* wait for last operation to be completed */
206 status = flash_operation_wait_for(ERASE_TIMEOUT);
207
208 if(status == FLASH_OPERATE_DONE)
209 {
210 /* if the previous operation is completed, continue to erase */
211 FLASH->ctrl_bit.bankers = TRUE;
212 FLASH->ctrl_bit.erstr = TRUE;
213
214 /* wait for operation to be completed */
215 status = flash_operation_wait_for(ERASE_TIMEOUT);
216
217 /* disable the bankers bit */
218 FLASH->ctrl_bit.bankers = FALSE;
219 }
220 /* return the erase status */
221 return status;
222}
223
232 flash_status_type flash_user_system_data_erase(void)
233{
234 flash_status_type status = FLASH_OPERATE_DONE;
235 uint16_t fap_val = FAP_RELIEVE_KEY;
236 /* get the flash access protection status */
237 if(flash_fap_status_get() != RESET)
238 {
239 fap_val = 0x0000;
240 }
241
242 /* wait for last operation to be completed */
243 status = flash_operation_wait_for(ERASE_TIMEOUT);
244
245 if(status == FLASH_OPERATE_DONE)
246 {
247 /* unlock the user system data */
248 FLASH->usd_unlock = FLASH_UNLOCK_KEY1;
249 FLASH->usd_unlock = FLASH_UNLOCK_KEY2;
250 while(FLASH->ctrl_bit.usdulks==RESET);
251
252 /* erase the user system data */
253 FLASH->ctrl_bit.usders = TRUE;
254 FLASH->ctrl_bit.erstr = TRUE;
255
256 /* wait for operation to be completed */
257 status = flash_operation_wait_for(ERASE_TIMEOUT);
258
259 /* disable the usders bit */
260 FLASH->ctrl_bit.usders = FALSE;
261
262 if((status == FLASH_OPERATE_DONE) && (fap_val == FAP_RELIEVE_KEY))
263 {
264 /* enable the user system data programming operation */
265 FLASH->ctrl_bit.usdprgm = TRUE;
266
267 /* restore the last flash access protection value */
268 USD->fap = (uint16_t)fap_val;
269
270 /* wait for operation to be completed */
271 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
272
273 /*disable the usdprgm bit */
274 FLASH->ctrl_bit.usdprgm = FALSE;
275 }
276 }
277 /* return the erase status */
278 return status;
279}
280
288 flash_status_type flash_word_program(uint32_t address, uint32_t data)
289{
290 flash_status_type status = FLASH_OPERATE_DONE;
291 /* wait for last operation to be completed */
292 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
293
294 if(status == FLASH_OPERATE_DONE)
295 {
296 FLASH->ctrl_bit.fprgm = TRUE;
297 *(__IO uint32_t*)address = data;
298 /* wait for operation to be completed */
299 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
300
301 /* disable the fprgm bit */
302 FLASH->ctrl_bit.fprgm = FALSE;
303 }
304 /* return the program status */
305 return status;
306}
307
315 flash_status_type flash_halfword_program(uint32_t address, uint16_t data)
316{
317 flash_status_type status = FLASH_OPERATE_DONE;
318 /* wait for last operation to be completed */
319 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
320
321 if(status == FLASH_OPERATE_DONE)
322 {
323 FLASH->ctrl_bit.fprgm = TRUE;
324 *(__IO uint16_t*)address = data;
325 /* wait for operation to be completed */
326 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
327
328 /* disable the fprgm bit */
329 FLASH->ctrl_bit.fprgm = FALSE;
330 }
331 /* return the program status */
332 return status;
333}
334
342 flash_status_type flash_byte_program(uint32_t address, uint8_t data)
343{
344 flash_status_type status = FLASH_OPERATE_DONE;
345 /* wait for last operation to be completed */
346 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
347
348 if(status == FLASH_OPERATE_DONE)
349 {
350 FLASH->ctrl_bit.fprgm = TRUE;
351 *(__IO uint8_t*)address = data;
352 /* wait for operation to be completed */
353 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
354
355 /* disable the fprgm bit */
356 FLASH->ctrl_bit.fprgm = FALSE;
357 }
358 /* return the program status */
359 return status;
360}
361
369 flash_status_type flash_user_system_data_program(uint32_t address, uint8_t data)
370{
371 flash_status_type status = FLASH_OPERATE_DONE;
372 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
373 if(status == FLASH_OPERATE_DONE)
374 {
375 /* unlock the user system data */
376 FLASH->usd_unlock = FLASH_UNLOCK_KEY1;
377 FLASH->usd_unlock = FLASH_UNLOCK_KEY2;
378 while(FLASH->ctrl_bit.usdulks==RESET);
379
380 /* enable the user system data programming operation */
381 FLASH->ctrl_bit.usdprgm = TRUE;
382 *(__IO uint16_t*)address = data;
383
384 /* wait for operation to be completed */
385 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
386
387 /* disable the usdprgm bit */
388 FLASH->ctrl_bit.usdprgm = FALSE;
389 }
390 /* return the user system data program status */
391 return status;
392}
393
403 flash_status_type flash_epp_set(uint32_t *sector_bits)
404{
405 uint16_t epp_data[4] = {0xFFFF,0xFFFF,0xFFFF,0xFFFF};
406 flash_status_type status = FLASH_OPERATE_DONE;
407 sector_bits[0] = (uint32_t)(~sector_bits[0]);
408 epp_data[0] = (uint16_t)((sector_bits[0] >> 0) & 0xFF);
409 epp_data[1] = (uint16_t)((sector_bits[0] >> 8) & 0xFF);
410 epp_data[2] = (uint16_t)((sector_bits[0] >> 16) & 0xFF);
411 epp_data[3] = (uint16_t)((sector_bits[0] >> 24) & 0xFF);
412 /* wait for last operation to be completed */
413 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
414
415 if(status == FLASH_OPERATE_DONE)
416 {
417 /* unlock the user system data */
418 FLASH->usd_unlock = FLASH_UNLOCK_KEY1;
419 FLASH->usd_unlock = FLASH_UNLOCK_KEY2;
420 while(FLASH->ctrl_bit.usdulks==RESET);
421
422 FLASH->ctrl_bit.usdprgm = TRUE;
423 USD->epp0 = epp_data[0];
424 /* wait for operation to be completed */
425 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
426
427 if(status == FLASH_OPERATE_DONE)
428 {
429 USD->epp1 = epp_data[1];
430 /* wait for operation to be completed */
431 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
432 }
433 if(status == FLASH_OPERATE_DONE)
434 {
435 USD->epp2 = epp_data[2];
436 /* wait for operation to be completed */
437 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
438 }
439 if(status == FLASH_OPERATE_DONE)
440 {
441 USD->epp3 = epp_data[3];
442 /* wait for operation to be completed */
443 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
444 }
445 /* disable the usdprgm bit */
446 FLASH->ctrl_bit.usdprgm = FALSE;
447 }
448 /* return the erase/program protection operation status */
449 return status;
450}
451
457void flash_epp_status_get(uint32_t *sector_bits)
458{
459 /* return the flash erase/program protection register value */
460 sector_bits[0] = (uint32_t)(FLASH->epps);
461}
462
472 flash_status_type flash_fap_enable(confirm_state new_state)
473{
474 flash_status_type status = FLASH_OPERATE_DONE;
475 status = flash_operation_wait_for(ERASE_TIMEOUT);
476 if(status == FLASH_OPERATE_DONE)
477 {
478 /* unlock the user system data */
479 FLASH->usd_unlock = FLASH_UNLOCK_KEY1;
480 FLASH->usd_unlock = FLASH_UNLOCK_KEY2;
481 while(FLASH->ctrl_bit.usdulks==RESET);
482
483 FLASH->ctrl_bit.usders = TRUE;
484 FLASH->ctrl_bit.erstr = TRUE;
485 /* wait for operation to be completed */
486 status = flash_operation_wait_for(ERASE_TIMEOUT);
487
488 /* disable the usders bit */
489 FLASH->ctrl_bit.usders = FALSE;
490
491 if(status == FLASH_OPERATE_DONE)
492 {
493 if(new_state == FALSE)
494 {
495 /* enable the user system data programming operation */
496 FLASH->ctrl_bit.usdprgm = TRUE;
497 USD->fap = FAP_RELIEVE_KEY;
498
499 /* Wait for operation to be completed */
500 status = flash_operation_wait_for(ERASE_TIMEOUT);
501
502 /* disable the usdprgm bit */
503 FLASH->ctrl_bit.usdprgm = FALSE;
504 }
505 }
506 }
507 /* return the flash access protection operation status */
508 return status;
509}
510
516 flag_status flash_fap_status_get(void)
517{
518 return (flag_status)FLASH->usd_bit.fap;
519}
520
530 flash_status_type flash_fap_high_level_enable(confirm_state new_state)
531{
532 flash_status_type status = FLASH_OPERATE_DONE;
533 status = flash_operation_wait_for(ERASE_TIMEOUT);
534 if(status == FLASH_OPERATE_DONE)
535 {
536 /* unlock the user system data */
537 FLASH->usd_unlock = FLASH_UNLOCK_KEY1;
538 FLASH->usd_unlock = FLASH_UNLOCK_KEY2;
539 while(FLASH->ctrl_bit.usdulks==RESET);
540
541 if(new_state == FALSE)
542 {
543 FLASH->ctrl_bit.fap_hl_dis = TRUE;
544 /* wait for operation to be completed */
545 status = flash_operation_wait_for(ERASE_TIMEOUT);
546
547 FLASH->ctrl_bit.usders = TRUE;
548 FLASH->ctrl_bit.erstr = TRUE;
549 /* wait for operation to be completed */
550 status = flash_operation_wait_for(ERASE_TIMEOUT);
551
552 /* disable the usders bit */
553 FLASH->ctrl_bit.usders = FALSE;
554
555 if(status == FLASH_OPERATE_DONE)
556 {
557 /* enable the user system data programming operation */
558 FLASH->ctrl_bit.usdprgm = TRUE;
559 USD->fap = FAP_RELIEVE_KEY;
560
561 /* wait for operation to be completed */
562 status = flash_operation_wait_for(ERASE_TIMEOUT);
563
564 /* disable the usdprgm bit */
565 FLASH->ctrl_bit.usdprgm = FALSE;
566 }
567 }
568 else
569 {
570 FLASH->ctrl_bit.usders = TRUE;
571 FLASH->ctrl_bit.erstr = TRUE;
572 /* wait for operation to be completed */
573 status = flash_operation_wait_for(ERASE_TIMEOUT);
574
575 /* disable the usders bit */
576 FLASH->ctrl_bit.usders = FALSE;
577
578 if(status == FLASH_OPERATE_DONE)
579 {
580 /* enable the user system data programming operation */
581 FLASH->ctrl_bit.usdprgm = TRUE;
582 USD->fap = FAP_HIGH_LEVEL_KEY;
583
584 /* wait for operation to be completed */
585 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
586
587 /* disable the usdprgm bit */
588 FLASH->ctrl_bit.usdprgm = FALSE;
589 }
590 }
591 }
592 /* return the flash access protection operation status */
593 return status;
594}
595
601 flag_status flash_fap_high_level_status_get(void)
602{
603 return (flag_status)FLASH->usd_bit.fap_hl;
604}
605
625 flash_status_type flash_ssb_set(uint8_t usd_ssb)
626{
627 flash_status_type status = FLASH_OPERATE_DONE;
628 /* wait for last operation to be completed */
629 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
630
631 if(status == FLASH_OPERATE_DONE)
632 {
633 /* unlock the user system data */
634 FLASH->usd_unlock = FLASH_UNLOCK_KEY1;
635 FLASH->usd_unlock = FLASH_UNLOCK_KEY2;
636 while(FLASH->ctrl_bit.usdulks==RESET);
637
638 /* enable the user system data programming operation */
639 FLASH->ctrl_bit.usdprgm = TRUE;
640
641 USD->ssb = usd_ssb;
642 /* wait for operation to be completed */
643 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
644
645 /* disable the usdprgm bit */
646 FLASH->ctrl_bit.usdprgm = FALSE;
647 }
648 /* return the user system data program status */
649 return status;
650}
651
658uint8_t flash_ssb_status_get(void)
659{
660 /* return the system setting byte status */
661 return (uint8_t)(FLASH->usd >> 2);
662}
663
674void flash_interrupt_enable(uint32_t flash_int, confirm_state new_state)
675{
676 if(flash_int & FLASH_ERR_INT)
677 FLASH->ctrl_bit.errie = new_state;
678 if(flash_int & FLASH_ODF_INT)
679 FLASH->ctrl_bit.odfie = new_state;
680}
681
691 flash_status_type flash_slib_enable(uint32_t pwd, uint16_t start_sector, uint16_t data_start_sector, uint16_t end_sector)
692{
693 uint32_t slib_range;
694 flash_status_type status = FLASH_OPERATE_DONE;
695 /* wait for last operation to be completed */
696 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
697
698 /*check range param limits*/
699 if((start_sector>=data_start_sector) || ((data_start_sector > end_sector) && \
700 (data_start_sector != 0x7FF)) || (start_sector > end_sector))
701 return FLASH_PROGRAM_ERROR;
702
703 if(status == FLASH_OPERATE_DONE)
704 {
705 /* unlock slib cfg register */
706 FLASH->slib_unlock = SLIB_UNLOCK_KEY;
707 while(FLASH->slib_misc_sts_bit.slib_ulkf==RESET);
708
709 slib_range = ((uint32_t)(data_start_sector << 11) & FLASH_SLIB_DATA_START_SECTOR) | \
710 ((uint32_t)(end_sector << 22) & FLASH_SLIB_END_SECTOR) | \
711 (start_sector & FLASH_SLIB_START_SECTOR);
712 /* configure slib, set pwd and range */
713 FLASH->slib_set_pwd = pwd;
714 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
715 FLASH->slib_set_range = slib_range;
716 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
717 }
718 return status;
719}
720
726 error_status flash_slib_disable(uint32_t pwd)
727{
728 flash_status_type status = FLASH_OPERATE_DONE;
729 /* write password to disable slib */
730 FLASH->slib_pwd_clr = pwd;
731
732 status = flash_operation_wait_for(ERASE_TIMEOUT);
733 if(status == FLASH_OPERATE_DONE)
734 {
735 if(FLASH->slib_misc_sts_bit.slib_pwd_ok)
736 return SUCCESS;
737 else
738 return ERROR;
739 }
740 return ERROR;
741}
742
748 flag_status flash_slib_state_get(void)
749{
750 if(FLASH->slib_sts0_bit.slib_enf)
751 return SET;
752 else
753 return RESET;
754}
755
761uint16_t flash_slib_start_sector_get(void)
762{
763 return (uint16_t)FLASH->slib_sts1_bit.slib_ss;
764}
765
771uint16_t flash_slib_datastart_sector_get(void)
772{
773 return (uint16_t)FLASH->slib_sts1_bit.slib_dat_ss;
774}
775
781uint16_t flash_slib_end_sector_get(void)
782{
783 return (uint16_t)FLASH->slib_sts1_bit.slib_es;
784}
785
792uint32_t flash_crc_calibrate(uint32_t start_addr, uint32_t sector_cnt)
793{
794 FLASH->crc_addr = start_addr;
795 FLASH->crc_ctrl = sector_cnt | 0x10000;
796 flash_operation_wait_for(OPERATION_TIMEOUT);
797 return FLASH->crc_chkr;
798}
799
806void flash_boot_memory_extension_mode_enable(void)
807{
808 if(FLASH->slib_sts0_bit.btm_ap_enf == RESET)
809 {
810 FLASH->slib_unlock = SLIB_UNLOCK_KEY;
811 while(FLASH->slib_misc_sts_bit.slib_ulkf==RESET);
812 FLASH->btm_mode_set = 0;
813 flash_operation_wait_for(OPERATION_TIMEOUT);
814 }
815}
816
824 flash_status_type flash_extension_memory_slib_enable(uint32_t pwd, uint16_t data_start_sector)
825{
826 flash_status_type status = FLASH_OPERATE_DONE;
827 /* wait for last operation to be completed */
828 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
829
830 if(status == FLASH_OPERATE_DONE)
831 {
832 /* unlock slib cfg register */
833 FLASH->slib_unlock = SLIB_UNLOCK_KEY;
834 while(FLASH->slib_misc_sts_bit.slib_ulkf==RESET);
835
836 /* configure slib, set pwd and range */
837 FLASH->slib_set_pwd = pwd;
838 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
839 FLASH->em_slib_set = (uint32_t)(data_start_sector << 16) + (uint32_t)0x5AA5;
840 status = flash_operation_wait_for(PROGRAMMING_TIMEOUT);
841 }
842 return status;
843}
844
850 flag_status flash_extension_memory_slib_state_get(void)
851{
852 if(FLASH->slib_sts0_bit.em_slib_enf)
853 return SET;
854 else
855 return RESET;
856}
857
863uint16_t flash_em_slib_datastart_sector_get(void)
864{
865 return (uint16_t)FLASH->slib_sts0_bit.em_slib_dat_ss;
866}
867
872#endif
873
error_status
error_status
error status
Definition: at32f415.h:258
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
flash_status_type
flash_status_type
flash status type
Definition: at32f415_flash.h:154
FLASH_OPERATE_BUSY
@ FLASH_OPERATE_BUSY
Definition: at32f415_flash.h:155
FLASH_OPERATE_DONE
@ FLASH_OPERATE_DONE
Definition: at32f415_flash.h:158
FLASH_OPERATE_TIMEOUT
@ FLASH_OPERATE_TIMEOUT
Definition: at32f415_flash.h:159
FLASH_PROGRAM_ERROR
@ FLASH_PROGRAM_ERROR
Definition: at32f415_flash.h:156
FLASH_EPP_ERROR
@ FLASH_EPP_ERROR
Definition: at32f415_flash.h:157
FLASH_ERR_INT
#define FLASH_ERR_INT
Definition: at32f415_flash.h:83
FLASH_ODF_INT
#define FLASH_ODF_INT
Definition: at32f415_flash.h:84
FAP_RELIEVE_KEY
#define FAP_RELIEVE_KEY
Definition: at32f415_flash.h:55
FAP_HIGH_LEVEL_KEY
#define FAP_HIGH_LEVEL_KEY
Definition: at32f415_flash.h:56
FLASH_UNLOCK_KEY2
#define FLASH_UNLOCK_KEY2
Definition: at32f415_flash.h:54
FLASH_UNLOCK_KEY1
#define FLASH_UNLOCK_KEY1
Definition: at32f415_flash.h:53
SLIB_UNLOCK_KEY
#define SLIB_UNLOCK_KEY
Definition: at32f415_flash.h:57
flash_slib_state_get
flag_status flash_slib_state_get(void)
get the main block slib state.
Definition: at32f415_flash.c:748
flash_slib_enable
flash_status_type flash_slib_enable(uint32_t pwd, uint16_t start_sector, uint16_t data_start_sector, uint16_t end_sector)
enable main block security library function.
Definition: at32f415_flash.c:691
flash_fap_status_get
flag_status flash_fap_status_get(void)
check the flash access protection status.
Definition: at32f415_flash.c:516
flash_slib_disable
error_status flash_slib_disable(uint32_t pwd)
disable main block slib when slib enabled.
Definition: at32f415_flash.c:726
flash_sector_erase
flash_status_type flash_sector_erase(uint32_t sector_address)
erase a specified flash sector.
Definition: at32f415_flash.c:173
flash_halfword_program
flash_status_type flash_halfword_program(uint32_t address, uint16_t data)
program a halfword at a specified address.
Definition: at32f415_flash.c:315
flash_user_system_data_program
flash_status_type flash_user_system_data_program(uint32_t address, uint8_t data)
program a halfword at a specified user system data address.
Definition: at32f415_flash.c:369
flash_byte_program
flash_status_type flash_byte_program(uint32_t address, uint8_t data)
program a byte at a specified address.
Definition: at32f415_flash.c:342
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
flash_fap_high_level_enable
flash_status_type flash_fap_high_level_enable(confirm_state new_state)
enable or disable the flash access protection high level.
Definition: at32f415_flash.c:530
flash_operation_status_get
flash_status_type flash_operation_status_get(void)
return the flash operation status.
Definition: at32f415_flash.c:98
flash_epp_set
flash_status_type flash_epp_set(uint32_t *sector_bits)
config erase/program protection for the desired sectors.
Definition: at32f415_flash.c:403
flash_ssb_set
flash_status_type flash_ssb_set(uint8_t usd_ssb)
program the flash system setting byte in usd: wdt_ato_en / depslp_rst / stdby_rst .
Definition: at32f415_flash.c:625
flash_extension_memory_slib_state_get
flag_status flash_extension_memory_slib_state_get(void)
get the extension memory slib state.
Definition: at32f415_flash.c:850
flash_slib_start_sector_get
uint16_t flash_slib_start_sector_get(void)
get the main block start sector of slib.
Definition: at32f415_flash.c:761
flash_em_slib_datastart_sector_get
uint16_t flash_em_slib_datastart_sector_get(void)
get the extension memory data start sector of slib.
Definition: at32f415_flash.c:863
flash_interrupt_enable
void flash_interrupt_enable(uint32_t flash_int, confirm_state new_state)
enable or disable the specified flash interrupts.
Definition: at32f415_flash.c:674
flash_fap_enable
flash_status_type flash_fap_enable(confirm_state new_state)
enable or disable the flash access protection.
Definition: at32f415_flash.c:472
flash_slib_end_sector_get
uint16_t flash_slib_end_sector_get(void)
get the main block end sector of slib.
Definition: at32f415_flash.c:781
flash_word_program
flash_status_type flash_word_program(uint32_t address, uint32_t data)
program a word at a specified address.
Definition: at32f415_flash.c:288
flash_slib_datastart_sector_get
uint16_t flash_slib_datastart_sector_get(void)
get the main block data start sector of slib.
Definition: at32f415_flash.c:771
flash_boot_memory_extension_mode_enable
void flash_boot_memory_extension_mode_enable(void)
enable boot memory as extension mode.
Definition: at32f415_flash.c:806
flash_lock
void flash_lock(void)
lock the flash controller.
Definition: at32f415_flash.c:162
flash_flag_get
flag_status flash_flag_get(uint32_t flash_flag)
check whether the specified flash flag is set or not.
Definition: at32f415_flash.c:55
flash_extension_memory_slib_enable
flash_status_type flash_extension_memory_slib_enable(uint32_t pwd, uint16_t data_start_sector)
enable extension memory security library function.
Definition: at32f415_flash.c:824
flash_user_system_data_erase
flash_status_type flash_user_system_data_erase(void)
erase the flash user system data.
Definition: at32f415_flash.c:232
flash_internal_all_erase
flash_status_type flash_internal_all_erase(void)
erase flash all internal sectors.
Definition: at32f415_flash.c:202
flash_operation_wait_for
flash_status_type flash_operation_wait_for(uint32_t time_out)
wait for flash operation complete or timeout.
Definition: at32f415_flash.c:127
flash_fap_high_level_status_get
flag_status flash_fap_high_level_status_get(void)
check the flash access protection high level status.
Definition: at32f415_flash.c:601
flash_ssb_status_get
uint8_t flash_ssb_status_get(void)
return the flash system setting byte status.
Definition: at32f415_flash.c:658
flash_epp_status_get
void flash_epp_status_get(uint32_t *sector_bits)
return the flash erase/program protection status.
Definition: at32f415_flash.c:457
flash_flag_clear
void flash_flag_clear(uint32_t flash_flag)
clear the flash flag.
Definition: at32f415_flash.c:87
flash_crc_calibrate
uint32_t flash_crc_calibrate(uint32_t start_addr, uint32_t sector_cnt)
flash crc calibration.
Definition: at32f415_flash.c:792
FLASH_SLIB_END_SECTOR
#define FLASH_SLIB_END_SECTOR
Definition: at32f415_flash.h:97
FLASH_SLIB_DATA_START_SECTOR
#define FLASH_SLIB_DATA_START_SECTOR
Definition: at32f415_flash.h:96
FLASH_SLIB_START_SECTOR
#define FLASH_SLIB_START_SECTOR
Definition: at32f415_flash.h:95
PROGRAMMING_TIMEOUT
#define PROGRAMMING_TIMEOUT
Definition: at32f415_flash.h:127
OPERATION_TIMEOUT
#define OPERATION_TIMEOUT
Definition: at32f415_flash.h:128
ERASE_TIMEOUT
#define ERASE_TIMEOUT
Definition: at32f415_flash.h:126
USD
#define USD
Definition: at32f415_flash.h:508
FLASH
#define FLASH
Definition: at32f415_flash.h:507
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_flash.h Source File

  • libraries
  • drivers
  • inc
at32f415_flash.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_FLASH_H
29#define __AT32F415_FLASH_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
39
53#define FLASH_UNLOCK_KEY1 ((uint32_t)0x45670123)
54#define FLASH_UNLOCK_KEY2 ((uint32_t)0xCDEF89AB)
55#define FAP_RELIEVE_KEY ((uint16_t)0x00A5)
56#define FAP_HIGH_LEVEL_KEY ((uint16_t)0x00CC)
57#define SLIB_UNLOCK_KEY ((uint32_t)0xA35F6D24)
68#define FLASH_OBF_FLAG ((uint32_t)0x00000001)
69#define FLASH_ODF_FLAG ((uint32_t)0x00000020)
70#define FLASH_PRGMERR_FLAG ((uint32_t)0x00000004)
71#define FLASH_EPPERR_FLAG ((uint32_t)0x00000010)
72#define FLASH_USDERR_FLAG ((uint32_t)0x40000001)
83#define FLASH_ERR_INT ((uint32_t)0x00000001)
84#define FLASH_ODF_INT ((uint32_t)0x00000002)
95#define FLASH_SLIB_START_SECTOR ((uint32_t)0x000007FF)
96#define FLASH_SLIB_DATA_START_SECTOR ((uint32_t)0x003FF800)
97#define FLASH_SLIB_END_SECTOR ((uint32_t)0xFFC00000)
108#define USD_WDT_ATO_DISABLE ((uint16_t)0x0001)
109#define USD_WDT_ATO_ENABLE ((uint16_t)0x0000)
111#define USD_DEPSLP_NO_RST ((uint16_t)0x0002)
112#define USD_DEPSLP_RST ((uint16_t)0x0000)
114#define USD_STDBY_NO_RST ((uint16_t)0x0004)
115#define USD_STDBY_RST ((uint16_t)0x0000)
126#define ERASE_TIMEOUT ((uint32_t)0x40000000)
127#define PROGRAMMING_TIMEOUT ((uint32_t)0x00100000)
128#define OPERATION_TIMEOUT ((uint32_t)0x10000000)
144#define flash_psr_set(wtcyc) (FLASH->psr |= (uint32_t)(0x150 | wtcyc))
145
153typedef enum
154{
155 FLASH_OPERATE_BUSY = 0x00,
156 FLASH_PROGRAM_ERROR = 0x01,
157 FLASH_EPP_ERROR = 0x02,
158 FLASH_OPERATE_DONE = 0x03,
159 FLASH_OPERATE_TIMEOUT = 0x04
160} flash_status_type;
161
165typedef enum
166{
167 FLASH_WAIT_CYCLE_0 = 0x00,
168 FLASH_WAIT_CYCLE_1 = 0x01,
169 FLASH_WAIT_CYCLE_2 = 0x02,
170 FLASH_WAIT_CYCLE_3 = 0x03,
171 FLASH_WAIT_CYCLE_4 = 0x04
172} flash_wait_cycle_type;
173
177typedef struct
178{
182 union
183 {
184 __IO uint32_t psr;
185 struct
186 {
187 __IO uint32_t wtcyc : 3; /* [2:0] */
188 __IO uint32_t hfcyc_en : 1; /* [3] */
189 __IO uint32_t pft_en : 1; /* [4] */
190 __IO uint32_t pft_enf : 1; /* [5] */
191 __IO uint32_t reserved1 : 26;/* [31:6] */
192 } psr_bit;
193 };
194
198 union
199 {
200 __IO uint32_t unlock;
201 struct
202 {
203 __IO uint32_t ukval : 32;/* [31:0] */
204 } unlock_bit;
205 };
206
210 union
211 {
212 __IO uint32_t usd_unlock;
213 struct
214 {
215 __IO uint32_t usd_ukval : 32;/* [31:0] */
216 } usd_unlock_bit;
217 };
218
222 union
223 {
224 __IO uint32_t sts;
225 struct
226 {
227 __IO uint32_t obf : 1; /* [0] */
228 __IO uint32_t reserved1 : 1; /* [1] */
229 __IO uint32_t prgmerr : 1; /* [2] */
230 __IO uint32_t reserved2 : 1; /* [3] */
231 __IO uint32_t epperr : 1; /* [4] */
232 __IO uint32_t odf : 1; /* [5] */
233 __IO uint32_t reserved3 : 26;/* [31:6] */
234 } sts_bit;
235 };
236
240 union
241 {
242 __IO uint32_t ctrl;
243 struct
244 {
245 __IO uint32_t fprgm : 1; /* [0] */
246 __IO uint32_t secers : 1; /* [1] */
247 __IO uint32_t bankers : 1; /* [2] */
248 __IO uint32_t reserved1 : 1; /* [3] */
249 __IO uint32_t usdprgm : 1; /* [4] */
250 __IO uint32_t usders : 1; /* [5] */
251 __IO uint32_t erstr : 1; /* [6] */
252 __IO uint32_t oplk : 1; /* [7] */
253 __IO uint32_t reserved2 : 1; /* [8] */
254 __IO uint32_t usdulks : 1; /* [9] */
255 __IO uint32_t errie : 1; /* [10] */
256 __IO uint32_t reserved3 : 1; /* [11] */
257 __IO uint32_t odfie : 1; /* [12] */
258 __IO uint32_t reserved4 : 3; /* [15:13] */
259 __IO uint32_t fap_hl_dis : 1; /* [16] */
260 __IO uint32_t reserved5 : 15;/* [31:17] */
261 } ctrl_bit;
262 };
263
267 union
268 {
269 __IO uint32_t addr;
270 struct
271 {
272 __IO uint32_t fa : 32;/* [31:0] */
273 } addr_bit;
274 };
275
279 __IO uint32_t reserved1;
280
284 union
285 {
286 __IO uint32_t usd;
287 struct
288 {
289 __IO uint32_t usderr : 1; /* [0] */
290 __IO uint32_t fap : 1; /* [1] */
291 __IO uint32_t wdt_ato_en : 1; /* [2] */
292 __IO uint32_t depslp_rst : 1; /* [3] */
293 __IO uint32_t stdby_rst : 1; /* [4] */
294 __IO uint32_t reserved1 : 5; /* [9:5] */
295 __IO uint32_t user_d0 : 8; /* [17:10] */
296 __IO uint32_t user_d1 : 8; /* [25:18] */
297 __IO uint32_t fap_hl : 1; /* [26] */
298 __IO uint32_t reserved2 : 5; /* [31:27] */
299 } usd_bit;
300 };
301
305 union
306 {
307 __IO uint32_t epps;
308 struct
309 {
310 __IO uint32_t epps : 32;/* [31:0] */
311 } epps_bit;
312 };
313
317 __IO uint32_t reserved2[20];
318
322 union
323 {
324 __IO uint32_t slib_sts0;
325 struct
326 {
327 __IO uint32_t btm_ap_enf : 1; /* [0] */
328 __IO uint32_t reserved1 : 1; /* [1] */
329 __IO uint32_t em_slib_enf : 1; /* [2] */
330 __IO uint32_t slib_enf : 1; /* [3] */
331 __IO uint32_t reserved2 : 12;/* [15:4] */
332 __IO uint32_t em_slib_dat_ss : 8; /* [23:16] */
333 __IO uint32_t reserved3 : 8; /* [31:24] */
334 } slib_sts0_bit;
335 };
336
340 union
341 {
342 __IO uint32_t slib_sts1;
343 struct
344 {
345 __IO uint32_t slib_ss : 11;/* [10:0] */
346 __IO uint32_t slib_dat_ss : 11;/* [21:11] */
347 __IO uint32_t slib_es : 10;/* [31:22] */
348 } slib_sts1_bit;
349 };
350
354 union
355 {
356 __IO uint32_t slib_pwd_clr;
357 struct
358 {
359 __IO uint32_t slib_pclr_val : 32;/* [31:0] */
360 } slib_pwd_clr_bit;
361 };
362
366 union
367 {
368 __IO uint32_t slib_misc_sts;
369 struct
370 {
371 __IO uint32_t slib_pwd_err : 1; /* [0] */
372 __IO uint32_t slib_pwd_ok : 1; /* [1] */
373 __IO uint32_t slib_ulkf : 1; /* [2] */
374 __IO uint32_t reserved1 : 29;/* [31:3] */
375 } slib_misc_sts_bit;
376 };
377
381 union
382 {
383 __IO uint32_t crc_addr;
384 struct
385 {
386 __IO uint32_t crc_addr : 32;/* [31:0] */
387 } crc_addr_bit;
388 };
389
393 union
394 {
395 __IO uint32_t crc_ctrl;
396 struct
397 {
398 __IO uint32_t crc_sn : 16;/* [15:0] */
399 __IO uint32_t crc_strt : 1; /* [16] */
400 __IO uint32_t reserved1 : 15;/* [31:17] */
401 } crc_ctrl_bit;
402 };
403
407 union
408 {
409 __IO uint32_t crc_chkr;
410 struct
411 {
412 __IO uint32_t crc_chkr : 32;/* [31:0] */
413 } crc_chkr_bit;
414 };
415
419 __IO uint32_t reserved3[52];
420
424 union
425 {
426 __IO uint32_t slib_set_pwd;
427 struct
428 {
429 __IO uint32_t slib_pset_val : 32;/* [31:0] */
430 } slib_set_pwd_bit;
431 };
432
436 union
437 {
438 __IO uint32_t slib_set_range;
439 struct
440 {
441 __IO uint32_t slib_ss_set : 11;/* [10:0] */
442 __IO uint32_t slib_dss_set : 11;/* [21:11] */
443 __IO uint32_t slib_es_set : 10;/* [31:22] */
444 } slib_set_range_bit;
445 };
446
450 union
451 {
452 __IO uint32_t em_slib_set;
453 struct
454 {
455 __IO uint32_t em_slib_set : 16;/* [15:0] */
456 __IO uint32_t em_slib_iss_set : 8; /* [23:16] */
457 __IO uint32_t reserved1 : 8; /* [31:24] */
458 } em_slib_set_bit;
459 };
460
464 union
465 {
466 __IO uint32_t btm_mode_set;
467 struct
468 {
469 __IO uint32_t btm_mode_set : 8; /* [7:0] */
470 __IO uint32_t reserved1 : 24;/* [31:8] */
471 } btm_mode_set_bit;
472 };
473
477 union
478 {
479 __IO uint32_t slib_unlock;
480 struct
481 {
482 __IO uint32_t slib_ukval : 32;/* [31:0] */
483 } slib_unlock_bit;
484 };
485
486} flash_type;
487
491typedef struct
492{
493 __IO uint16_t fap;
494 __IO uint16_t ssb;
495 __IO uint16_t data0;
496 __IO uint16_t data1;
497 __IO uint16_t epp0;
498 __IO uint16_t epp1;
499 __IO uint16_t epp2;
500 __IO uint16_t epp3;
501} usd_type;
502
507#define FLASH ((flash_type *) FLASH_REG_BASE)
508#define USD ((usd_type *) USD_BASE)
509
514 flag_status flash_flag_get(uint32_t flash_flag);
515void flash_flag_clear(uint32_t flash_flag);
516 flash_status_type flash_operation_status_get(void);
517 flash_status_type flash_operation_wait_for(uint32_t time_out);
518void flash_unlock(void);
519void flash_lock(void);
520 flash_status_type flash_sector_erase(uint32_t sector_address);
521 flash_status_type flash_internal_all_erase(void);
522 flash_status_type flash_user_system_data_erase(void);
523 flash_status_type flash_word_program(uint32_t address, uint32_t data);
524 flash_status_type flash_halfword_program(uint32_t address, uint16_t data);
525 flash_status_type flash_byte_program(uint32_t address, uint8_t data);
526 flash_status_type flash_user_system_data_program(uint32_t address, uint8_t data);
527 flash_status_type flash_epp_set(uint32_t *sector_bits);
528void flash_epp_status_get(uint32_t *sector_bits);
529 flash_status_type flash_fap_enable(confirm_state new_state);
530 flag_status flash_fap_status_get(void);
531 flash_status_type flash_fap_high_level_enable(confirm_state new_state);
532 flag_status flash_fap_high_level_status_get(void);
533 flash_status_type flash_ssb_set(uint8_t usd_ssb);
534uint8_t flash_ssb_status_get(void);
535void flash_interrupt_enable(uint32_t flash_int, confirm_state new_state);
536 flash_status_type flash_slib_enable(uint32_t pwd, uint16_t start_sector, uint16_t data_start_sector, uint16_t end_sector);
537 error_status flash_slib_disable(uint32_t pwd);
538 flag_status flash_slib_state_get(void);
539uint16_t flash_slib_start_sector_get(void);
540uint16_t flash_slib_datastart_sector_get(void);
541uint16_t flash_slib_end_sector_get(void);
542uint32_t flash_crc_calibrate(uint32_t start_addr, uint32_t sector_cnt);
543void flash_boot_memory_extension_mode_enable(void);
544 flash_status_type flash_extension_memory_slib_enable(uint32_t pwd, uint16_t data_start_sector);
545 flag_status flash_extension_memory_slib_state_get(void);
546uint16_t flash_em_slib_datastart_sector_get(void);
547
560#ifdef __cplusplus
561}
562#endif
563
564#endif
at32f415.h
at32f415 header file
error_status
error_status
error status
Definition: at32f415.h:258
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
flash_slib_state_get
flag_status flash_slib_state_get(void)
get the main block slib state.
Definition: at32f415_flash.c:748
flash_slib_enable
flash_status_type flash_slib_enable(uint32_t pwd, uint16_t start_sector, uint16_t data_start_sector, uint16_t end_sector)
enable main block security library function.
Definition: at32f415_flash.c:691
flash_fap_status_get
flag_status flash_fap_status_get(void)
check the flash access protection status.
Definition: at32f415_flash.c:516
flash_slib_disable
error_status flash_slib_disable(uint32_t pwd)
disable main block slib when slib enabled.
Definition: at32f415_flash.c:726
flash_sector_erase
flash_status_type flash_sector_erase(uint32_t sector_address)
erase a specified flash sector.
Definition: at32f415_flash.c:173
flash_halfword_program
flash_status_type flash_halfword_program(uint32_t address, uint16_t data)
program a halfword at a specified address.
Definition: at32f415_flash.c:315
flash_user_system_data_program
flash_status_type flash_user_system_data_program(uint32_t address, uint8_t data)
program a halfword at a specified user system data address.
Definition: at32f415_flash.c:369
flash_byte_program
flash_status_type flash_byte_program(uint32_t address, uint8_t data)
program a byte at a specified address.
Definition: at32f415_flash.c:342
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
flash_fap_high_level_enable
flash_status_type flash_fap_high_level_enable(confirm_state new_state)
enable or disable the flash access protection high level.
Definition: at32f415_flash.c:530
flash_operation_status_get
flash_status_type flash_operation_status_get(void)
return the flash operation status.
Definition: at32f415_flash.c:98
flash_epp_set
flash_status_type flash_epp_set(uint32_t *sector_bits)
config erase/program protection for the desired sectors.
Definition: at32f415_flash.c:403
flash_ssb_set
flash_status_type flash_ssb_set(uint8_t usd_ssb)
program the flash system setting byte in usd: wdt_ato_en / depslp_rst / stdby_rst .
Definition: at32f415_flash.c:625
flash_extension_memory_slib_state_get
flag_status flash_extension_memory_slib_state_get(void)
get the extension memory slib state.
Definition: at32f415_flash.c:850
flash_slib_start_sector_get
uint16_t flash_slib_start_sector_get(void)
get the main block start sector of slib.
Definition: at32f415_flash.c:761
flash_em_slib_datastart_sector_get
uint16_t flash_em_slib_datastart_sector_get(void)
get the extension memory data start sector of slib.
Definition: at32f415_flash.c:863
flash_interrupt_enable
void flash_interrupt_enable(uint32_t flash_int, confirm_state new_state)
enable or disable the specified flash interrupts.
Definition: at32f415_flash.c:674
flash_fap_enable
flash_status_type flash_fap_enable(confirm_state new_state)
enable or disable the flash access protection.
Definition: at32f415_flash.c:472
flash_slib_end_sector_get
uint16_t flash_slib_end_sector_get(void)
get the main block end sector of slib.
Definition: at32f415_flash.c:781
flash_word_program
flash_status_type flash_word_program(uint32_t address, uint32_t data)
program a word at a specified address.
Definition: at32f415_flash.c:288
flash_slib_datastart_sector_get
uint16_t flash_slib_datastart_sector_get(void)
get the main block data start sector of slib.
Definition: at32f415_flash.c:771
flash_boot_memory_extension_mode_enable
void flash_boot_memory_extension_mode_enable(void)
enable boot memory as extension mode.
Definition: at32f415_flash.c:806
flash_lock
void flash_lock(void)
lock the flash controller.
Definition: at32f415_flash.c:162
flash_flag_get
flag_status flash_flag_get(uint32_t flash_flag)
check whether the specified flash flag is set or not.
Definition: at32f415_flash.c:55
flash_extension_memory_slib_enable
flash_status_type flash_extension_memory_slib_enable(uint32_t pwd, uint16_t data_start_sector)
enable extension memory security library function.
Definition: at32f415_flash.c:824
flash_user_system_data_erase
flash_status_type flash_user_system_data_erase(void)
erase the flash user system data.
Definition: at32f415_flash.c:232
flash_internal_all_erase
flash_status_type flash_internal_all_erase(void)
erase flash all internal sectors.
Definition: at32f415_flash.c:202
flash_operation_wait_for
flash_status_type flash_operation_wait_for(uint32_t time_out)
wait for flash operation complete or timeout.
Definition: at32f415_flash.c:127
flash_fap_high_level_status_get
flag_status flash_fap_high_level_status_get(void)
check the flash access protection high level status.
Definition: at32f415_flash.c:601
flash_ssb_status_get
uint8_t flash_ssb_status_get(void)
return the flash system setting byte status.
Definition: at32f415_flash.c:658
flash_epp_status_get
void flash_epp_status_get(uint32_t *sector_bits)
return the flash erase/program protection status.
Definition: at32f415_flash.c:457
flash_flag_clear
void flash_flag_clear(uint32_t flash_flag)
clear the flash flag.
Definition: at32f415_flash.c:87
flash_crc_calibrate
uint32_t flash_crc_calibrate(uint32_t start_addr, uint32_t sector_cnt)
flash crc calibration.
Definition: at32f415_flash.c:792
flash_wait_cycle_type
flash_wait_cycle_type
flash wait cycle type
Definition: at32f415_flash.h:166
flash_status_type
flash_status_type
flash status type
Definition: at32f415_flash.h:154
FLASH_WAIT_CYCLE_0
@ FLASH_WAIT_CYCLE_0
Definition: at32f415_flash.h:167
FLASH_WAIT_CYCLE_3
@ FLASH_WAIT_CYCLE_3
Definition: at32f415_flash.h:170
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
FLASH_WAIT_CYCLE_1
@ FLASH_WAIT_CYCLE_1
Definition: at32f415_flash.h:168
FLASH_WAIT_CYCLE_2
@ FLASH_WAIT_CYCLE_2
Definition: at32f415_flash.h:169
FLASH_OPERATE_BUSY
@ FLASH_OPERATE_BUSY
Definition: at32f415_flash.h:155
FLASH_OPERATE_DONE
@ FLASH_OPERATE_DONE
Definition: at32f415_flash.h:158
FLASH_OPERATE_TIMEOUT
@ FLASH_OPERATE_TIMEOUT
Definition: at32f415_flash.h:159
FLASH_PROGRAM_ERROR
@ FLASH_PROGRAM_ERROR
Definition: at32f415_flash.h:156
FLASH_EPP_ERROR
@ FLASH_EPP_ERROR
Definition: at32f415_flash.h:157
flash_type
type define flash register all
Definition: at32f415_flash.h:178
flash_type::secers
__IO uint32_t secers
Definition: at32f415_flash.h:246
flash_type::em_slib_enf
__IO uint32_t em_slib_enf
Definition: at32f415_flash.h:329
flash_type::unlock
__IO uint32_t unlock
Definition: at32f415_flash.h:200
flash_type::em_slib_dat_ss
__IO uint32_t em_slib_dat_ss
Definition: at32f415_flash.h:332
flash_type::reserved2
__IO uint32_t reserved2
flash reserved2 register, offset:0x70~0x24
Definition: at32f415_flash.h:230
flash_type::crc_sn
__IO uint32_t crc_sn
Definition: at32f415_flash.h:398
flash_type::psr
__IO uint32_t psr
Definition: at32f415_flash.h:184
flash_type::user_d0
__IO uint32_t user_d0
Definition: at32f415_flash.h:295
flash_type::slib_set_pwd
__IO uint32_t slib_set_pwd
Definition: at32f415_flash.h:426
flash_type::slib_pwd_err
__IO uint32_t slib_pwd_err
Definition: at32f415_flash.h:371
flash_type::ukval
__IO uint32_t ukval
Definition: at32f415_flash.h:203
flash_type::slib_ukval
__IO uint32_t slib_ukval
Definition: at32f415_flash.h:482
flash_type::bankers
__IO uint32_t bankers
Definition: at32f415_flash.h:247
flash_type::hfcyc_en
__IO uint32_t hfcyc_en
Definition: at32f415_flash.h:188
flash_type::slib_set_range
__IO uint32_t slib_set_range
Definition: at32f415_flash.h:438
flash_type::usd_ukval
__IO uint32_t usd_ukval
Definition: at32f415_flash.h:215
flash_type::ctrl
__IO uint32_t ctrl
Definition: at32f415_flash.h:242
flash_type::stdby_rst
__IO uint32_t stdby_rst
Definition: at32f415_flash.h:293
flash_type::crc_strt
__IO uint32_t crc_strt
Definition: at32f415_flash.h:399
flash_type::slib_dat_ss
__IO uint32_t slib_dat_ss
Definition: at32f415_flash.h:346
flash_type::epps
__IO uint32_t epps
Definition: at32f415_flash.h:307
flash_type::fprgm
__IO uint32_t fprgm
Definition: at32f415_flash.h:245
flash_type::reserved1
__IO uint32_t reserved1
flash reserved1 register, offset:0x18
Definition: at32f415_flash.h:191
flash_type::em_slib_set
__IO uint32_t em_slib_set
Definition: at32f415_flash.h:452
flash_type::slib_sts1
__IO uint32_t slib_sts1
Definition: at32f415_flash.h:342
flash_type::erstr
__IO uint32_t erstr
Definition: at32f415_flash.h:251
flash_type::usderr
__IO uint32_t usderr
Definition: at32f415_flash.h:289
flash_type::crc_chkr
__IO uint32_t crc_chkr
Definition: at32f415_flash.h:409
flash_type::slib_misc_sts
__IO uint32_t slib_misc_sts
Definition: at32f415_flash.h:368
flash_type::usdulks
__IO uint32_t usdulks
Definition: at32f415_flash.h:254
flash_type::slib_pclr_val
__IO uint32_t slib_pclr_val
Definition: at32f415_flash.h:359
flash_type::em_slib_iss_set
__IO uint32_t em_slib_iss_set
Definition: at32f415_flash.h:456
flash_type::fap_hl_dis
__IO uint32_t fap_hl_dis
Definition: at32f415_flash.h:259
flash_type::slib_ulkf
__IO uint32_t slib_ulkf
Definition: at32f415_flash.h:373
flash_type::epperr
__IO uint32_t epperr
Definition: at32f415_flash.h:231
flash_type::odfie
__IO uint32_t odfie
Definition: at32f415_flash.h:257
flash_type::slib_ss
__IO uint32_t slib_ss
Definition: at32f415_flash.h:345
flash_type::fa
__IO uint32_t fa
Definition: at32f415_flash.h:272
flash_type::slib_es
__IO uint32_t slib_es
Definition: at32f415_flash.h:347
flash_type::reserved5
__IO uint32_t reserved5
Definition: at32f415_flash.h:260
flash_type::slib_ss_set
__IO uint32_t slib_ss_set
Definition: at32f415_flash.h:441
flash_type::prgmerr
__IO uint32_t prgmerr
Definition: at32f415_flash.h:229
flash_type::slib_unlock
__IO uint32_t slib_unlock
Definition: at32f415_flash.h:479
flash_type::wtcyc
__IO uint32_t wtcyc
Definition: at32f415_flash.h:187
flash_type::errie
__IO uint32_t errie
Definition: at32f415_flash.h:255
flash_type::user_d1
__IO uint32_t user_d1
Definition: at32f415_flash.h:296
flash_type::pft_enf
__IO uint32_t pft_enf
Definition: at32f415_flash.h:190
flash_type::crc_addr
__IO uint32_t crc_addr
Definition: at32f415_flash.h:383
flash_type::usd
__IO uint32_t usd
Definition: at32f415_flash.h:286
flash_type::depslp_rst
__IO uint32_t depslp_rst
Definition: at32f415_flash.h:292
flash_type::slib_pwd_clr
__IO uint32_t slib_pwd_clr
Definition: at32f415_flash.h:356
flash_type::usd_unlock
__IO uint32_t usd_unlock
Definition: at32f415_flash.h:212
flash_type::btm_ap_enf
__IO uint32_t btm_ap_enf
Definition: at32f415_flash.h:327
flash_type::wdt_ato_en
__IO uint32_t wdt_ato_en
Definition: at32f415_flash.h:291
flash_type::usdprgm
__IO uint32_t usdprgm
Definition: at32f415_flash.h:249
flash_type::slib_pwd_ok
__IO uint32_t slib_pwd_ok
Definition: at32f415_flash.h:372
flash_type::slib_es_set
__IO uint32_t slib_es_set
Definition: at32f415_flash.h:443
flash_type::btm_mode_set
__IO uint32_t btm_mode_set
Definition: at32f415_flash.h:466
flash_type::fap_hl
__IO uint32_t fap_hl
Definition: at32f415_flash.h:297
flash_type::pft_en
__IO uint32_t pft_en
Definition: at32f415_flash.h:189
flash_type::usders
__IO uint32_t usders
Definition: at32f415_flash.h:250
flash_type::oplk
__IO uint32_t oplk
Definition: at32f415_flash.h:252
flash_type::addr
__IO uint32_t addr
Definition: at32f415_flash.h:269
flash_type::reserved4
__IO uint32_t reserved4
Definition: at32f415_flash.h:258
flash_type::slib_dss_set
__IO uint32_t slib_dss_set
Definition: at32f415_flash.h:442
flash_type::slib_sts0
__IO uint32_t slib_sts0
Definition: at32f415_flash.h:324
flash_type::odf
__IO uint32_t odf
Definition: at32f415_flash.h:232
flash_type::fap
__IO uint32_t fap
Definition: at32f415_flash.h:290
flash_type::crc_ctrl
__IO uint32_t crc_ctrl
Definition: at32f415_flash.h:395
flash_type::sts
__IO uint32_t sts
Definition: at32f415_flash.h:224
flash_type::slib_pset_val
__IO uint32_t slib_pset_val
Definition: at32f415_flash.h:429
flash_type::slib_enf
__IO uint32_t slib_enf
Definition: at32f415_flash.h:330
flash_type::reserved3
__IO uint32_t reserved3
flash reserved3 register, offset:0x15C~0x90
Definition: at32f415_flash.h:233
flash_type::obf
__IO uint32_t obf
Definition: at32f415_flash.h:227
usd_type
user system data
Definition: at32f415_flash.h:492
usd_type::epp2
__IO uint16_t epp2
Definition: at32f415_flash.h:499
usd_type::epp0
__IO uint16_t epp0
Definition: at32f415_flash.h:497
usd_type::epp3
__IO uint16_t epp3
Definition: at32f415_flash.h:500
usd_type::data1
__IO uint16_t data1
Definition: at32f415_flash.h:496
usd_type::ssb
__IO uint16_t ssb
Definition: at32f415_flash.h:494
usd_type::fap
__IO uint16_t fap
Definition: at32f415_flash.h:493
usd_type::epp1
__IO uint16_t epp1
Definition: at32f415_flash.h:498
usd_type::data0
__IO uint16_t data0
Definition: at32f415_flash.h:495


AT32F415 Firmwary Library: at32f415_gpio.c Source File

  • libraries
  • drivers
  • src
at32f415_gpio.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef GPIO_MODULE_ENABLED
39
51void gpio_reset(gpio_type *gpio_x)
52{
53 if(gpio_x == GPIOA)
54 {
55 crm_periph_reset(CRM_GPIOA_PERIPH_RESET, TRUE);
56 crm_periph_reset(CRM_GPIOA_PERIPH_RESET, FALSE);
57 }
58 else if(gpio_x == GPIOB)
59 {
60 crm_periph_reset(CRM_GPIOB_PERIPH_RESET, TRUE);
61 crm_periph_reset(CRM_GPIOB_PERIPH_RESET, FALSE);
62 }
63 else if(gpio_x == GPIOC)
64 {
65 crm_periph_reset(CRM_GPIOC_PERIPH_RESET, TRUE);
66 crm_periph_reset(CRM_GPIOC_PERIPH_RESET, FALSE);
67 }
68 else if(gpio_x == GPIOD)
69 {
70 crm_periph_reset(CRM_GPIOD_PERIPH_RESET, TRUE);
71 crm_periph_reset(CRM_GPIOD_PERIPH_RESET, FALSE);
72 }
73 else if(gpio_x == GPIOF)
74 {
75 crm_periph_reset(CRM_GPIOF_PERIPH_RESET, TRUE);
76 crm_periph_reset(CRM_GPIOF_PERIPH_RESET, FALSE);
77 }
78}
79
86void gpio_iomux_reset(void)
87{
88 crm_periph_reset(CRM_IOMUX_PERIPH_RESET, TRUE);
89 crm_periph_reset(CRM_IOMUX_PERIPH_RESET, FALSE);
90}
91
100void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
101{
102 uint32_t temp;
103 uint16_t pinx_value, pin_index;
104
105 pin_index = (uint16_t)gpio_init_struct->gpio_pins;
106
107 /* pinx_value indecate pin grounp bit[3:0] from modey[1:0] confy[1:0] */
108
109 /* pin input analog config */
110 if(gpio_init_struct->gpio_mode == GPIO_MODE_ANALOG)
111 {
112 pinx_value = 0x00;
113 }
114 /* pin input config */
115 else if(gpio_init_struct->gpio_mode == GPIO_MODE_INPUT)
116 {
117 pinx_value = gpio_init_struct->gpio_pull & 0x0F;
118
119 if(gpio_init_struct->gpio_pull == GPIO_PULL_UP)
120 {
121 gpio_x->scr = pin_index;
122 }
123 else if(gpio_init_struct->gpio_pull == GPIO_PULL_DOWN)
124 {
125 gpio_x->clr = pin_index;
126 }
127 }
128 else
129 {
130 pinx_value = (gpio_init_struct->gpio_mode & 0x08) | (gpio_init_struct->gpio_out_type & 0x04) | \
131 (gpio_init_struct->gpio_drive_strength & 0x03);
132 }
133
134 /* pin 0~7 config */
135 if(((uint32_t)pin_index & ((uint32_t)0x00FF)) != 0x00)
136 {
137 for(temp = 0; temp < 0x08; temp++)
138 {
139 if((1 << temp) & pin_index)
140 {
141 gpio_x->cfglr &= (uint32_t)~(0x0F << (temp * 4));
142 gpio_x->cfglr |= (uint32_t)(pinx_value << (temp * 4));
143 }
144 }
145 }
146
147 /* pin 8~15 config */
148 if(pin_index > 0x00ff)
149 {
150 pin_index = pin_index >> 8;
151
152 for(temp = 0; temp < 0x8; temp++)
153 {
154 if((1 << temp) & pin_index)
155 {
156 gpio_x->cfghr &= (uint32_t)~(0xf << (temp * 4));
157 gpio_x->cfghr |= (uint32_t)(pinx_value << (temp * 4));
158 }
159 }
160 }
161}
162
168void gpio_default_para_init(gpio_init_type *gpio_init_struct)
169{
170 /* reset gpio init structure parameters values */
171 gpio_init_struct->gpio_pins = GPIO_PINS_ALL;
172 gpio_init_struct->gpio_mode = GPIO_MODE_INPUT;
173 gpio_init_struct->gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
174 gpio_init_struct->gpio_pull = GPIO_PULL_NONE;
175 gpio_init_struct->gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
176}
177
203 flag_status gpio_input_data_bit_read(gpio_type *gpio_x, uint16_t pins)
204{
205 flag_status status = RESET;
206
207 if(pins != (pins & gpio_x->idt))
208 {
209 status = RESET;
210 }
211 else
212 {
213 status = SET;
214 }
215
216 return status;
217}
218
226uint16_t gpio_input_data_read(gpio_type *gpio_x)
227{
228 return ((uint16_t)(gpio_x->idt));
229}
230
256 flag_status gpio_output_data_bit_read(gpio_type *gpio_x, uint16_t pins)
257{
258 flag_status status = RESET;
259
260 if((gpio_x->odt & pins) != RESET)
261 {
262 status = SET;
263 }
264 else
265 {
266 status = RESET;
267 }
268
269 return status;
270}
271
279uint16_t gpio_output_data_read(gpio_type *gpio_x)
280{
281 return ((uint16_t)(gpio_x->odt));
282}
283
310void gpio_bits_set(gpio_type *gpio_x, uint16_t pins)
311{
312 gpio_x->scr = pins;
313}
314
341void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins)
342{
343 gpio_x->clr = pins;
344}
345
373void gpio_bits_write(gpio_type *gpio_x, uint16_t pins, confirm_state bit_state)
374{
375 if(bit_state != FALSE)
376 {
377 gpio_x->scr = pins;
378 }
379 else
380 {
381 gpio_x->clr = pins;
382 }
383}
384
393void gpio_port_wirte(gpio_type *gpio_x, uint16_t port_value)
394{
395 gpio_x->odt = port_value;
396}
397
424void gpio_pin_wp_config(gpio_type *gpio_x, uint16_t pins)
425{
426 uint32_t temp = 0x00010000;
427
428 temp |= pins;
429 /* set wpen bit */
430 gpio_x->wpr = temp;
431 /* reset wpen bit */
432 gpio_x->wpr = pins;
433 /* set wpen bit */
434 gpio_x->wpr = temp;
435 /* read wpen bit*/
436 temp = gpio_x->wpr;
437 /* read wpen bit*/
438 temp = gpio_x->wpr;
439}
440
471void gpio_event_output_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
472{
473 uint32_t tmpreg = 0x00;
474
475 tmpreg = IOMUX->evtout;
476
477 /* clear the port[6:4] and pin[3:0] bits */
478 tmpreg &= 0x80;
479 tmpreg |= (uint32_t)gpio_port_source << 0x04;
480 tmpreg |= gpio_pin_source;
481 IOMUX->evtout = tmpreg;
482}
483
490void gpio_event_output_enable(confirm_state new_state)
491{
492 IOMUX->evtout_bit.evoen = new_state;
493}
494
521void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state)
522{
523 uint32_t reg_addr, remap_mask;
524 uint8_t bit_offset, bit_num, bit_val;
525
526 /* get register address, bit offset, bit number and remap value */
527 reg_addr = IOMUX_BASE + (gpio_remap >> 24);
528 bit_offset = (gpio_remap >> 16) & 0xFF;
529 bit_num = (gpio_remap >> 8) & 0xFF;
530 bit_val = gpio_remap & 0xFF;
531
532 /* get remap mask value */
533 remap_mask = 0xFFFFFFFF << (32 - bit_num - bit_offset);
534 remap_mask = remap_mask >> (32 - bit_num - bit_offset);
535 remap_mask = remap_mask >> bit_offset;
536 remap_mask = remap_mask << bit_offset;
537
538 /* clear remap value */
539 *(uint32_t*)reg_addr &= ~remap_mask;
540
541 if(new_state != FALSE)
542 {
543 /* set remap value */
544 *(uint32_t*)reg_addr |= (uint32_t)(bit_val << bit_offset);
545 }
546}
547
577void gpio_exint_line_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
578{
579 uint32_t tmp = 0x00;
580 tmp = ((uint32_t)0x0F) << (0x04 * (gpio_pin_source & (uint8_t)0x03));
581
582 switch (gpio_pin_source >> 0x02)
583 {
584 case 0:
585 IOMUX->exintc1 &= ~tmp;
586 IOMUX->exintc1 |= (((uint32_t)gpio_port_source) << (0x04 * (gpio_pin_source & (uint8_t)0x03)));
587 break;
588 case 1:
589 IOMUX->exintc2 &= ~tmp;
590 IOMUX->exintc2 |= (((uint32_t)gpio_port_source) << (0x04 * (gpio_pin_source & (uint8_t)0x03)));
591 break;
592 case 2:
593 IOMUX->exintc3 &= ~tmp;
594 IOMUX->exintc3 |= (((uint32_t)gpio_port_source) << (0x04 * (gpio_pin_source & (uint8_t)0x03)));
595 break;
596 case 3:
597 IOMUX->exintc4 &= ~tmp;
598 IOMUX->exintc4 |= (((uint32_t)gpio_port_source) << (0x04 * (gpio_pin_source & (uint8_t)0x03)));
599 break;
600 default:
601 break;
602 }
603}
604
609#endif
610
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
CRM_IOMUX_PERIPH_RESET
@ CRM_IOMUX_PERIPH_RESET
Definition: at32f415_crm.h:149
CRM_GPIOF_PERIPH_RESET
@ CRM_GPIOF_PERIPH_RESET
Definition: at32f415_crm.h:155
CRM_GPIOD_PERIPH_RESET
@ CRM_GPIOD_PERIPH_RESET
Definition: at32f415_crm.h:154
CRM_GPIOC_PERIPH_RESET
@ CRM_GPIOC_PERIPH_RESET
Definition: at32f415_crm.h:153
CRM_GPIOA_PERIPH_RESET
@ CRM_GPIOA_PERIPH_RESET
Definition: at32f415_crm.h:151
CRM_GPIOB_PERIPH_RESET
@ CRM_GPIOB_PERIPH_RESET
Definition: at32f415_crm.h:152
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
gpio_pins_source_type
gpio_pins_source_type
gpio pins source type
Definition: at32f415_gpio.h:267
gpio_port_source_type
gpio_port_source_type
gpio port source type
Definition: at32f415_gpio.h:290
GPIO_MODE_ANALOG
@ GPIO_MODE_ANALOG
Definition: at32f415_gpio.h:231
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_ALL
#define GPIO_PINS_ALL
Definition: at32f415_gpio.h:67
gpio_iomux_reset
void gpio_iomux_reset(void)
reset the mux functions (remap, event control and exint configuration) registers to their default val...
Definition: at32f415_gpio.c:86
gpio_output_data_read
uint16_t gpio_output_data_read(gpio_type *gpio_x)
read the specified gpio ouput data port.
Definition: at32f415_gpio.c:279
gpio_event_output_config
void gpio_event_output_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as event output.
Definition: at32f415_gpio.c:471
gpio_output_data_bit_read
flag_status gpio_output_data_bit_read(gpio_type *gpio_x, uint16_t pins)
read the specified output port pin.
Definition: at32f415_gpio.c:256
gpio_bits_write
void gpio_bits_write(gpio_type *gpio_x, uint16_t pins, confirm_state bit_state)
set or clear the selected data port bit.
Definition: at32f415_gpio.c:373
gpio_event_output_enable
void gpio_event_output_enable(confirm_state new_state)
enable or disable the event output.
Definition: at32f415_gpio.c:490
gpio_bits_reset
void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins)
clear the selected data port bits.
Definition: at32f415_gpio.c:341
gpio_input_data_read
uint16_t gpio_input_data_read(gpio_type *gpio_x)
read the specified gpio input data port.
Definition: at32f415_gpio.c:226
gpio_pin_wp_config
void gpio_pin_wp_config(gpio_type *gpio_x, uint16_t pins)
write protect gpio pins configuration registers.
Definition: at32f415_gpio.c:424
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_pin_remap_config
void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration.
Definition: at32f415_gpio.c:521
gpio_input_data_bit_read
flag_status gpio_input_data_bit_read(gpio_type *gpio_x, uint16_t pins)
read the specified input port pin.
Definition: at32f415_gpio.c:203
gpio_bits_set
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins)
set the selected data port bits.
Definition: at32f415_gpio.c:310
gpio_exint_line_config
void gpio_exint_line_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line.
Definition: at32f415_gpio.c:577
gpio_reset
void gpio_reset(gpio_type *gpio_x)
reset the gpio register
Definition: at32f415_gpio.c:51
gpio_port_wirte
void gpio_port_wirte(gpio_type *gpio_x, uint16_t port_value)
write data to the specified gpio data port.
Definition: at32f415_gpio.c:393
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIOC
#define GPIOC
Definition: at32f415_gpio.h:772
GPIOF
#define GPIOF
Definition: at32f415_gpio.h:774
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOD
#define GPIOD
Definition: at32f415_gpio.h:773
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
IOMUX
#define IOMUX
Definition: at32f415_gpio.h:775
IOMUX_BASE
#define IOMUX_BASE
Definition: at32f415.h:315
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
gpio_type
type define gpio register all
Definition: at32f415_gpio.h:314
gpio_type::scr
__IO uint32_t scr
Definition: at32f415_gpio.h:430
gpio_type::odt
__IO uint32_t odt
Definition: at32f415_gpio.h:402
gpio_type::clr
__IO uint32_t clr
Definition: at32f415_gpio.h:473
gpio_type::cfghr
__IO uint32_t cfghr
Definition: at32f415_gpio.h:347
gpio_type::cfglr
__IO uint32_t cfglr
Definition: at32f415_gpio.h:320
gpio_type::idt
__IO uint32_t idt
Definition: at32f415_gpio.h:374
gpio_type::wpr
__IO uint32_t wpr
Definition: at32f415_gpio.h:501
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_gpio.h Source File

  • libraries
  • drivers
  • inc
at32f415_gpio.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_GPIO_H
29#define __AT32F415_GPIO_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
51#define GPIO_PINS_0 0x0001
52#define GPIO_PINS_1 0x0002
53#define GPIO_PINS_2 0x0004
54#define GPIO_PINS_3 0x0008
55#define GPIO_PINS_4 0x0010
56#define GPIO_PINS_5 0x0020
57#define GPIO_PINS_6 0x0040
58#define GPIO_PINS_7 0x0080
59#define GPIO_PINS_8 0x0100
60#define GPIO_PINS_9 0x0200
61#define GPIO_PINS_10 0x0400
62#define GPIO_PINS_11 0x0800
63#define GPIO_PINS_12 0x1000
64#define GPIO_PINS_13 0x2000
65#define GPIO_PINS_14 0x4000
66#define GPIO_PINS_15 0x8000
67#define GPIO_PINS_ALL 0xFFFF
73#define IOMUX_MAKE_VALUE(reg_offset, bit_addr ,bit_num, bit_val) \
74 (uint32_t)(((reg_offset) << 24) | ((bit_addr) << 16) | ((bit_num) << 8) | (bit_val))
75
81#define SPI1_MUX_01 SPI1_GMUX_0001
82#define I2C1_MUX I2C1_GMUX_0001
83#define USART1_MUX USART1_GMUX_0001
84#define USART3_MUX_01 USART3_GMUX_0001
85#define USART3_MUX_10 USART3_GMUX_0010
86#define TMR1_MUX_01 TMR1_GMUX_0001
87#define TMR2_MUX_01 TMR2_GMUX_001
88#define TMR2_MUX_10 TMR2_GMUX_010
89#define TMR2_MUX_11 TMR2_GMUX_011
90#define TMR3_MUX_10 TMR3_GMUX_0010
91#define TMR3_MUX_11 TMR3_GMUX_0011
92#define CAN_MUX_10 CAN1_GMUX_0010
93#define PD01_MUX PD01_GMUX
94#define TMR5CH4_MUX TMR5CH4_GMUX
95#define ADC1_ETP_MUX ADC1_ETP_GMUX
96#define ADC1_ETO_MUX ADC1_ETO_GMUX
97#define SWJTAG_MUX_001 SWJTAG_GMUX_001
98#define SWJTAG_MUX_010 SWJTAG_GMUX_010
99#define SWJTAG_MUX_100 SWJTAG_GMUX_100
110#define CMP_MUX_01 IOMUX_MAKE_VALUE(0x1C, 26, 2, 0x01)
111#define CMP_MUX_10 IOMUX_MAKE_VALUE(0x1C, 26, 2, 0x02)
122#define TMR9_GMUX IOMUX_MAKE_VALUE(0x20, 0, 4, 0x02)
123#define TMR10_GMUX IOMUX_MAKE_VALUE(0x20, 4, 4, 0x02)
124#define TMR11_GMUX IOMUX_MAKE_VALUE(0x20, 8, 4, 0x02)
135#define TMR1_GMUX_0001 IOMUX_MAKE_VALUE(0x24, 0, 4, 0x01)
136#define TMR1_GMUX_0010 IOMUX_MAKE_VALUE(0x24, 0, 4, 0x02)
137#define TMR2_GMUX_001 IOMUX_MAKE_VALUE(0x24, 4, 3, 0x01)
138#define TMR2_GMUX_010 IOMUX_MAKE_VALUE(0x24, 4, 3, 0x02)
139#define TMR2_GMUX_011 IOMUX_MAKE_VALUE(0x24, 4, 3, 0x03)
140#define TMR3_GMUX_0010 IOMUX_MAKE_VALUE(0x24, 8, 4, 0x02)
141#define TMR3_GMUX_0011 IOMUX_MAKE_VALUE(0x24, 8, 4, 0x03)
142#define TMR5_GMUX_001 IOMUX_MAKE_VALUE(0x24, 16, 3, 0x01)
143#define TMR5CH4_GMUX IOMUX_MAKE_VALUE(0x24, 19, 1, 0x01)
154#define I2C1_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 4, 4, 0x01)
155#define I2C1_GMUX_0010 IOMUX_MAKE_VALUE(0x28, 4, 4, 0x02)
156#define I2C2_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 8, 4, 0x01)
157#define I2C2_GMUX_0010 IOMUX_MAKE_VALUE(0x28, 8, 4, 0x02)
158#define I2C2_GMUX_0011 IOMUX_MAKE_VALUE(0x28, 8, 4, 0x03)
159#define SPI1_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 16, 4, 0x01)
160#define SPI2_GMUX_0001 IOMUX_MAKE_VALUE(0x28, 20, 4, 0x01)
171#define CAN1_GMUX_0010 IOMUX_MAKE_VALUE(0x2C, 0, 4, 0x02)
172#define SDIO1_GMUX_0100 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x04)
173#define SDIO1_GMUX_0101 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x05)
174#define SDIO1_GMUX_0110 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x06)
175#define SDIO1_GMUX_0111 IOMUX_MAKE_VALUE(0x2C, 8, 4, 0x07)
176#define USART1_GMUX_0001 IOMUX_MAKE_VALUE(0x2C, 16, 4, 0x01)
177#define USART3_GMUX_0001 IOMUX_MAKE_VALUE(0x2C, 24, 4, 0x01)
178#define USART3_GMUX_0010 IOMUX_MAKE_VALUE(0x2C, 24, 4, 0x02)
179#define UART4_GMUX_0001 IOMUX_MAKE_VALUE(0x2C, 28, 4, 0x01)
190#define ADC1_ETP_GMUX IOMUX_MAKE_VALUE(0x30, 4, 1, 0x01)
191#define ADC1_ETO_GMUX IOMUX_MAKE_VALUE(0x30, 5, 1, 0x01)
192#define SWJTAG_GMUX_001 IOMUX_MAKE_VALUE(0x30, 16, 3, 0x01)
193#define SWJTAG_GMUX_010 IOMUX_MAKE_VALUE(0x30, 16, 3, 0x02)
194#define SWJTAG_GMUX_100 IOMUX_MAKE_VALUE(0x30, 16, 3, 0x04)
195#define PD01_GMUX IOMUX_MAKE_VALUE(0x30, 20, 1, 0x01)
206#define TMR1_BK1_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 0, 2, 0x02)
207#define TMR1_BK1_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 0, 2, 0x03)
208#define TMR1_CH1_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 2, 2, 0x02)
209#define TMR1_CH1_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 2, 2, 0x03)
210#define TMR2_CH4_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 4, 2, 0x02)
211#define TMR2_CH4_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 4, 2, 0x03)
212#define TMR3_CH1_CMP_GMUX_10 IOMUX_MAKE_VALUE(0x34, 6, 2, 0x02)
213#define TMR3_CH1_CMP_GMUX_11 IOMUX_MAKE_VALUE(0x34, 6, 2, 0x03)
226typedef enum
227{
228 GPIO_MODE_INPUT = 0x00,
229 GPIO_MODE_OUTPUT = 0x10,
230 GPIO_MODE_MUX = 0x08,
231 GPIO_MODE_ANALOG = 0x03
232} gpio_mode_type;
233
237typedef enum
238{
239 GPIO_DRIVE_STRENGTH_STRONGER = 0x01,
240 GPIO_DRIVE_STRENGTH_MODERATE = 0x02,
241 GPIO_DRIVE_STRENGTH_MAXIMUM = 0x03
242} gpio_drive_type;
243
247typedef enum
248{
249 GPIO_OUTPUT_PUSH_PULL = 0x00,
250 GPIO_OUTPUT_OPEN_DRAIN = 0x04
251} gpio_output_type;
252
256typedef enum
257{
258 GPIO_PULL_NONE = 0x0004,
259 GPIO_PULL_UP = 0x0018,
260 GPIO_PULL_DOWN = 0x0028
261} gpio_pull_type;
262
266typedef enum
267{
268 GPIO_PINS_SOURCE0 = 0x00,
269 GPIO_PINS_SOURCE1 = 0x01,
270 GPIO_PINS_SOURCE2 = 0x02,
271 GPIO_PINS_SOURCE3 = 0x03,
272 GPIO_PINS_SOURCE4 = 0x04,
273 GPIO_PINS_SOURCE5 = 0x05,
274 GPIO_PINS_SOURCE6 = 0x06,
275 GPIO_PINS_SOURCE7 = 0x07,
276 GPIO_PINS_SOURCE8 = 0x08,
277 GPIO_PINS_SOURCE9 = 0x09,
278 GPIO_PINS_SOURCE10 = 0x0A,
279 GPIO_PINS_SOURCE11 = 0x0B,
280 GPIO_PINS_SOURCE12 = 0x0C,
281 GPIO_PINS_SOURCE13 = 0x0D,
282 GPIO_PINS_SOURCE14 = 0x0E,
283 GPIO_PINS_SOURCE15 = 0x0F
284} gpio_pins_source_type;
285
289typedef enum
290{
291 GPIO_PORT_SOURCE_GPIOA = 0x00,
292 GPIO_PORT_SOURCE_GPIOB = 0x01,
293 GPIO_PORT_SOURCE_GPIOC = 0x02,
294 GPIO_PORT_SOURCE_GPIOD = 0x03,
295 GPIO_PORT_SOURCE_GPIOF = 0x05,
296} gpio_port_source_type;
297
301typedef struct
302{
303 uint32_t gpio_pins;
304 gpio_output_type gpio_out_type;
305 gpio_pull_type gpio_pull;
306 gpio_mode_type gpio_mode;
307 gpio_drive_type gpio_drive_strength;
308} gpio_init_type;
309
313typedef struct
314{
318 union
319 {
320 __IO uint32_t cfglr;
321 struct
322 {
323 __IO uint32_t iomc0 : 2; /* [1:0] */
324 __IO uint32_t iofc0 : 2; /* [3:2] */
325 __IO uint32_t iomc1 : 2; /* [5:4] */
326 __IO uint32_t iofc1 : 2; /* [7:6] */
327 __IO uint32_t iomc2 : 2; /* [9:8] */
328 __IO uint32_t iofc2 : 2; /* [11:10] */
329 __IO uint32_t iomc3 : 2; /* [13:12] */
330 __IO uint32_t iofc3 : 2; /* [15:14] */
331 __IO uint32_t iomc4 : 2; /* [17:16] */
332 __IO uint32_t iofc4 : 2; /* [19:18] */
333 __IO uint32_t iomc5 : 2; /* [21:20] */
334 __IO uint32_t iofc5 : 2; /* [23:22] */
335 __IO uint32_t iomc6 : 2; /* [25:24] */
336 __IO uint32_t iofc6 : 2; /* [27:26] */
337 __IO uint32_t iomc7 : 2; /* [29:28] */
338 __IO uint32_t iofc7 : 2; /* [31:30] */
339 } cfglr_bit;
340 };
341
345 union
346 {
347 __IO uint32_t cfghr;
348 struct
349 {
350 __IO uint32_t iomc8 : 2; /* [1:0] */
351 __IO uint32_t iofc8 : 2; /* [3:2] */
352 __IO uint32_t iomc9 : 2; /* [5:4] */
353 __IO uint32_t iofc9 : 2; /* [7:6] */
354 __IO uint32_t iomc10 : 2; /* [9:8] */
355 __IO uint32_t iofc10 : 2; /* [11:10] */
356 __IO uint32_t iomc11 : 2; /* [13:12] */
357 __IO uint32_t iofc11 : 2; /* [15:14] */
358 __IO uint32_t iomc12 : 2; /* [17:16] */
359 __IO uint32_t iofc12 : 2; /* [19:18] */
360 __IO uint32_t iomc13 : 2; /* [21:20] */
361 __IO uint32_t iofc13 : 2; /* [23:22] */
362 __IO uint32_t iomc14 : 2; /* [25:24] */
363 __IO uint32_t iofc14 : 2; /* [27:26] */
364 __IO uint32_t iomc15 : 2; /* [29:28] */
365 __IO uint32_t iofc15 : 2; /* [31:30] */
366 } cfghr_bit;
367 };
368
372 union
373 {
374 __IO uint32_t idt;
375 struct
376 {
377 __IO uint32_t idt0 : 1; /* [0] */
378 __IO uint32_t idt1 : 1; /* [1] */
379 __IO uint32_t idt2 : 1; /* [2] */
380 __IO uint32_t idt3 : 1; /* [3] */
381 __IO uint32_t idt4 : 1; /* [4] */
382 __IO uint32_t idt5 : 1; /* [5] */
383 __IO uint32_t idt6 : 1; /* [6] */
384 __IO uint32_t idt7 : 1; /* [7] */
385 __IO uint32_t idt8 : 1; /* [8] */
386 __IO uint32_t idt9 : 1; /* [9] */
387 __IO uint32_t idt10 : 1; /* [10] */
388 __IO uint32_t idt11 : 1; /* [11] */
389 __IO uint32_t idt12 : 1; /* [12] */
390 __IO uint32_t idt13 : 1; /* [13] */
391 __IO uint32_t idt14 : 1; /* [14] */
392 __IO uint32_t idt15 : 1; /* [15] */
393 __IO uint32_t reserved1 : 16;/* [31:16] */
394 } idt_bit;
395 };
396
400 union
401 {
402 __IO uint32_t odt;
403 struct
404 {
405 __IO uint32_t odt0 : 1; /* [0] */
406 __IO uint32_t odt1 : 1; /* [1] */
407 __IO uint32_t odt2 : 1; /* [2] */
408 __IO uint32_t odt3 : 1; /* [3] */
409 __IO uint32_t odt4 : 1; /* [4] */
410 __IO uint32_t odt5 : 1; /* [5] */
411 __IO uint32_t odt6 : 1; /* [6] */
412 __IO uint32_t odt7 : 1; /* [7] */
413 __IO uint32_t odt8 : 1; /* [8] */
414 __IO uint32_t odt9 : 1; /* [9] */
415 __IO uint32_t odt10 : 1; /* [10] */
416 __IO uint32_t odt11 : 1; /* [11] */
417 __IO uint32_t odt12 : 1; /* [12] */
418 __IO uint32_t odt13 : 1; /* [13] */
419 __IO uint32_t odt14 : 1; /* [14] */
420 __IO uint32_t odt15 : 1; /* [15] */
421 __IO uint32_t reserved1 : 16;/* [31:16] */
422 } odt_bit;
423 };
424
428 union
429 {
430 __IO uint32_t scr;
431 struct
432 {
433 __IO uint32_t iosb0 : 1; /* [0] */
434 __IO uint32_t iosb1 : 1; /* [1] */
435 __IO uint32_t iosb2 : 1; /* [2] */
436 __IO uint32_t iosb3 : 1; /* [3] */
437 __IO uint32_t iosb4 : 1; /* [4] */
438 __IO uint32_t iosb5 : 1; /* [5] */
439 __IO uint32_t iosb6 : 1; /* [6] */
440 __IO uint32_t iosb7 : 1; /* [7] */
441 __IO uint32_t iosb8 : 1; /* [8] */
442 __IO uint32_t iosb9 : 1; /* [9] */
443 __IO uint32_t iosb10 : 1; /* [10] */
444 __IO uint32_t iosb11 : 1; /* [11] */
445 __IO uint32_t iosb12 : 1; /* [12] */
446 __IO uint32_t iosb13 : 1; /* [13] */
447 __IO uint32_t iosb14 : 1; /* [14] */
448 __IO uint32_t iosb15 : 1; /* [15] */
449 __IO uint32_t iocb0 : 1; /* [16] */
450 __IO uint32_t iocb1 : 1; /* [17] */
451 __IO uint32_t iocb2 : 1; /* [18] */
452 __IO uint32_t iocb3 : 1; /* [19] */
453 __IO uint32_t iocb4 : 1; /* [20] */
454 __IO uint32_t iocb5 : 1; /* [21] */
455 __IO uint32_t iocb6 : 1; /* [22] */
456 __IO uint32_t iocb7 : 1; /* [23] */
457 __IO uint32_t iocb8 : 1; /* [24] */
458 __IO uint32_t iocb9 : 1; /* [25] */
459 __IO uint32_t iocb10 : 1; /* [26] */
460 __IO uint32_t iocb11 : 1; /* [27] */
461 __IO uint32_t iocb12 : 1; /* [28] */
462 __IO uint32_t iocb13 : 1; /* [29] */
463 __IO uint32_t iocb14 : 1; /* [30] */
464 __IO uint32_t iocb15 : 1; /* [31] */
465 } scr_bit;
466 };
467
471 union
472 {
473 __IO uint32_t clr;
474 struct
475 {
476 __IO uint32_t iocb0 : 1; /* [0] */
477 __IO uint32_t iocb1 : 1; /* [1] */
478 __IO uint32_t iocb2 : 1; /* [2] */
479 __IO uint32_t iocb3 : 1; /* [3] */
480 __IO uint32_t iocb4 : 1; /* [4] */
481 __IO uint32_t iocb5 : 1; /* [5] */
482 __IO uint32_t iocb6 : 1; /* [6] */
483 __IO uint32_t iocb7 : 1; /* [7] */
484 __IO uint32_t iocb8 : 1; /* [8] */
485 __IO uint32_t iocb9 : 1; /* [9] */
486 __IO uint32_t iocb10 : 1; /* [10] */
487 __IO uint32_t iocb11 : 1; /* [11] */
488 __IO uint32_t iocb12 : 1; /* [12] */
489 __IO uint32_t iocb13 : 1; /* [13] */
490 __IO uint32_t iocb14 : 1; /* [14] */
491 __IO uint32_t iocb15 : 1; /* [15] */
492 __IO uint32_t reserved1 : 16;/* [31:16] */
493 } clr_bit;
494 };
495
499 union
500 {
501 __IO uint32_t wpr;
502 struct
503 {
504 __IO uint32_t wpen0 : 1; /* [0] */
505 __IO uint32_t wpen1 : 1; /* [1] */
506 __IO uint32_t wpen2 : 1; /* [2] */
507 __IO uint32_t wpen3 : 1; /* [3] */
508 __IO uint32_t wpen4 : 1; /* [4] */
509 __IO uint32_t wpen5 : 1; /* [5] */
510 __IO uint32_t wpen6 : 1; /* [6] */
511 __IO uint32_t wpen7 : 1; /* [7] */
512 __IO uint32_t wpen8 : 1; /* [8] */
513 __IO uint32_t wpen9 : 1; /* [9] */
514 __IO uint32_t wpen10 : 1; /* [10] */
515 __IO uint32_t wpen11 : 1; /* [11] */
516 __IO uint32_t wpen12 : 1; /* [12] */
517 __IO uint32_t wpen13 : 1; /* [13] */
518 __IO uint32_t wpen14 : 1; /* [14] */
519 __IO uint32_t wpen15 : 1; /* [15] */
520 __IO uint32_t wpseq : 1; /* [16] */
521 __IO uint32_t reserved1 : 15;/* [31:17] */
522 } wpr_bit;
523 };
524
525} gpio_type;
526
530typedef struct
531{
535 union
536 {
537 __IO uint32_t evtout;
538 struct
539 {
540 __IO uint32_t selpin : 4; /* [3:0] */
541 __IO uint32_t selport : 3; /* [6:4] */
542 __IO uint32_t evoen : 1; /* [7] */
543 __IO uint32_t reserved1 : 24;/* [31:8] */
544 } evtout_bit;
545 };
546
550 union
551 {
552 __IO uint32_t remap;
553 struct
554 {
555 __IO uint32_t spi1_mux_l : 1; /* [0] */
556 __IO uint32_t i2c1_mux : 1; /* [1] */
557 __IO uint32_t usart1_mux : 1; /* [2] */
558 __IO uint32_t reserved1 : 1; /* [3] */
559 __IO uint32_t usart3_mux : 2; /* [5:4] */
560 __IO uint32_t tmr1_mux : 2; /* [7:6] */
561 __IO uint32_t tmr2_mux : 2; /* [9:8] */
562 __IO uint32_t tmr3_mux : 2; /* [11:10] */
563 __IO uint32_t reserved2 : 1; /* [12] */
564 __IO uint32_t can_mux : 2; /* [14:13] */
565 __IO uint32_t pd01_mux : 1; /* [15] */
566 __IO uint32_t tmr5ch4_mux : 1; /* [16] */
567 __IO uint32_t adc1_extrgpre_mux : 1; /* [17] */
568 __IO uint32_t adc1_extrgord_mux : 1; /* [18] */
569 __IO uint32_t reserved3 : 5; /* [23:19] */
570 __IO uint32_t swjtag_conf : 3; /* [26:24] */
571 __IO uint32_t reserved4 : 4; /* [30:27] */
572 __IO uint32_t spi1_mux_h : 1; /* [31] */
573 } remap_bit;
574 };
575
579 union
580 {
581 __IO uint32_t exintc1;
582 struct
583 {
584 __IO uint32_t exint0 : 4; /* [3:0] */
585 __IO uint32_t exint1 : 4; /* [7:4] */
586 __IO uint32_t exint2 : 4; /* [11:8] */
587 __IO uint32_t exint3 : 4; /* [15:12] */
588 __IO uint32_t reserved1 : 16;/* [31:16] */
589 } exintc1_bit;
590 };
591
595 union
596 {
597 __IO uint32_t exintc2;
598 struct
599 {
600 __IO uint32_t exint4 : 4; /* [3:0] */
601 __IO uint32_t exint5 : 4; /* [7:4] */
602 __IO uint32_t exint6 : 4; /* [11:8] */
603 __IO uint32_t exint7 : 4; /* [15:12] */
604 __IO uint32_t reserved1 : 16;/* [31:16] */
605 } exintc2_bit;
606 };
607
611 union
612 {
613 __IO uint32_t exintc3;
614 struct
615 {
616 __IO uint32_t exint8 : 4; /* [3:0] */
617 __IO uint32_t exint9 : 4; /* [7:4] */
618 __IO uint32_t exint10 : 4; /* [11:8] */
619 __IO uint32_t exint11 : 4; /* [15:12] */
620 __IO uint32_t reserved1 : 16;/* [31:16] */
621 } exintc3_bit;
622 };
623
627 union
628 {
629 __IO uint32_t exintc4;
630 struct
631 {
632 __IO uint32_t exint12 : 4; /* [3:0] */
633 __IO uint32_t exint13 : 4; /* [7:4] */
634 __IO uint32_t exint14 : 4; /* [11:8] */
635 __IO uint32_t exint15 : 4; /* [15:12] */
636 __IO uint32_t reserved1 : 16;/* [31:16] */
637 } exintc4_bit;
638 };
639
643 __IO uint32_t reserved1;
644
648 union
649 {
650 __IO uint32_t remap2;
651 struct
652 {
653 __IO uint32_t reserved1 : 26;/* [25:0] */
654 __IO uint32_t cmp_mux : 2; /* [27:26] */
655 __IO uint32_t reserved2 : 4; /* [31:28] */
656 } remap2_bit;
657 };
658
662 union
663 {
664 __IO uint32_t remap3;
665 struct
666 {
667 __IO uint32_t tmr9_gmux : 4; /* [3:0] */
668 __IO uint32_t tmr10_gmux : 4; /* [7:4] */
669 __IO uint32_t tmr11_gmux : 4; /* [11:8] */
670 __IO uint32_t reserved1 : 20;/* [31:12] */
671 } remap3_bit;
672 };
673
677 union
678 {
679 __IO uint32_t remap4;
680 struct
681 {
682 __IO uint32_t tmr1_gmux : 4; /* [3:0] */
683 __IO uint32_t tmr2_gmux : 3; /* [6:4] */
684 __IO uint32_t reserved1 : 1; /* [7] */
685 __IO uint32_t tmr3_gmux : 4; /* [11:8] */
686 __IO uint32_t reserved2 : 4; /* [15:12] */
687 __IO uint32_t tmr5_gmux : 3; /* [18:16] */
688 __IO uint32_t tmr5ch4_gmux : 1; /* [19] */
689 __IO uint32_t reserved3 : 12;/* [31:20] */
690 } remap4_bit;
691 };
692
696 union
697 {
698 __IO uint32_t remap5;
699 struct
700 {
701 __IO uint32_t reserved1 : 4; /* [3:0] */
702 __IO uint32_t i2c1_gmux : 4; /* [7:4] */
703 __IO uint32_t i2c2_gmux : 4; /* [11:8] */
704 __IO uint32_t reserved2 : 4; /* [15:12] */
705 __IO uint32_t spi1_gmux : 4; /* [19:16] */
706 __IO uint32_t spi2_gmux : 4; /* [23:20] */
707 __IO uint32_t reserved3 : 8; /* [31:24] */
708 } remap5_bit;
709 };
710
714 union
715 {
716 __IO uint32_t remap6;
717 struct
718 {
719 __IO uint32_t can1_gmux : 4; /* [3:0] */
720 __IO uint32_t reserved1 : 4; /* [7:4] */
721 __IO uint32_t sdio1_gmux : 4; /* [11:8] */
722 __IO uint32_t reserved2 : 4; /* [15:12] */
723 __IO uint32_t usart1_gmux : 4; /* [19:16] */
724 __IO uint32_t reserved3 : 4; /* [23:20] */
725 __IO uint32_t usart3_gmux : 4; /* [27:24] */
726 __IO uint32_t uart4_gmux : 4; /* [31:28] */
727 } remap6_bit;
728 };
729
733 union
734 {
735 __IO uint32_t remap7;
736 struct
737 {
738 __IO uint32_t reserved1 : 4; /* [3:0] */
739 __IO uint32_t adc1_etp_gmux : 1; /* [4] */
740 __IO uint32_t adc1_eto_gmux : 1; /* [5] */
741 __IO uint32_t reserved2 : 10;/* [15:6] */
742 __IO uint32_t swjtag_gmux : 3; /* [18:16] */
743 __IO uint32_t reserved3 : 1; /* [19] */
744 __IO uint32_t pd01_gmux : 1; /* [20] */
745 __IO uint32_t reserved4 : 11;/* [31:21] */
746 } remap7_bit;
747 };
748
752 union
753 {
754 __IO uint32_t remap8;
755 struct
756 {
757 __IO uint32_t tmr1_bk1_cmp_gmux : 2; /* [1:0] */
758 __IO uint32_t tmr1_ch1_cmp_gmux : 2; /* [3:2] */
759 __IO uint32_t tmr2_ch4_cmp_gmux : 2; /* [5:4] */
760 __IO uint32_t tmr3_ch1_cmp_gmux : 2; /* [7:6] */
761 __IO uint32_t reserved1 : 24;/* [31:8] */
762 } remap8_bit;
763 };
764} iomux_type;
765
770#define GPIOA ((gpio_type *) GPIOA_BASE)
771#define GPIOB ((gpio_type *) GPIOB_BASE)
772#define GPIOC ((gpio_type *) GPIOC_BASE)
773#define GPIOD ((gpio_type *) GPIOD_BASE)
774#define GPIOF ((gpio_type *) GPIOF_BASE)
775#define IOMUX ((iomux_type *) IOMUX_BASE)
776
781void gpio_reset(gpio_type *gpio_x);
782void gpio_iomux_reset(void);
783void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct);
784void gpio_default_para_init(gpio_init_type *gpio_init_struct);
785 flag_status gpio_input_data_bit_read(gpio_type *gpio_x, uint16_t pins);
786uint16_t gpio_input_data_read(gpio_type *gpio_x);
787 flag_status gpio_output_data_bit_read(gpio_type *gpio_x, uint16_t pins);
788uint16_t gpio_output_data_read(gpio_type *gpio_x);
789void gpio_bits_set(gpio_type *gpio_x, uint16_t pins);
790void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins);
791void gpio_bits_write(gpio_type *gpio_x, uint16_t pins, confirm_state bit_state);
792void gpio_port_wirte(gpio_type *gpio_x, uint16_t port_value);
793void gpio_pin_wp_config(gpio_type *gpio_x, uint16_t pins);
794void gpio_event_output_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source);
795void gpio_event_output_enable(confirm_state new_state);
796void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state);
797void gpio_exint_line_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source);
798
811#ifdef __cplusplus
812}
813#endif
814
815#endif
at32f415.h
at32f415 header file
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
gpio_iomux_reset
void gpio_iomux_reset(void)
reset the mux functions (remap, event control and exint configuration) registers to their default val...
Definition: at32f415_gpio.c:86
gpio_output_data_read
uint16_t gpio_output_data_read(gpio_type *gpio_x)
read the specified gpio ouput data port.
Definition: at32f415_gpio.c:279
gpio_event_output_config
void gpio_event_output_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as event output.
Definition: at32f415_gpio.c:471
gpio_output_data_bit_read
flag_status gpio_output_data_bit_read(gpio_type *gpio_x, uint16_t pins)
read the specified output port pin.
Definition: at32f415_gpio.c:256
gpio_bits_write
void gpio_bits_write(gpio_type *gpio_x, uint16_t pins, confirm_state bit_state)
set or clear the selected data port bit.
Definition: at32f415_gpio.c:373
gpio_event_output_enable
void gpio_event_output_enable(confirm_state new_state)
enable or disable the event output.
Definition: at32f415_gpio.c:490
gpio_bits_reset
void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins)
clear the selected data port bits.
Definition: at32f415_gpio.c:341
gpio_input_data_read
uint16_t gpio_input_data_read(gpio_type *gpio_x)
read the specified gpio input data port.
Definition: at32f415_gpio.c:226
gpio_pin_wp_config
void gpio_pin_wp_config(gpio_type *gpio_x, uint16_t pins)
write protect gpio pins configuration registers.
Definition: at32f415_gpio.c:424
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_pin_remap_config
void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration.
Definition: at32f415_gpio.c:521
gpio_input_data_bit_read
flag_status gpio_input_data_bit_read(gpio_type *gpio_x, uint16_t pins)
read the specified input port pin.
Definition: at32f415_gpio.c:203
gpio_bits_set
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins)
set the selected data port bits.
Definition: at32f415_gpio.c:310
gpio_exint_line_config
void gpio_exint_line_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line.
Definition: at32f415_gpio.c:577
gpio_reset
void gpio_reset(gpio_type *gpio_x)
reset the gpio register
Definition: at32f415_gpio.c:51
gpio_port_wirte
void gpio_port_wirte(gpio_type *gpio_x, uint16_t port_value)
write data to the specified gpio data port.
Definition: at32f415_gpio.c:393
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
gpio_mode_type
gpio_mode_type
gpio mode select
Definition: at32f415_gpio.h:227
gpio_drive_type
gpio_drive_type
gpio output drive strength select
Definition: at32f415_gpio.h:238
gpio_pins_source_type
gpio_pins_source_type
gpio pins source type
Definition: at32f415_gpio.h:267
gpio_port_source_type
gpio_port_source_type
gpio port source type
Definition: at32f415_gpio.h:290
gpio_pull_type
gpio_pull_type
gpio pull type
Definition: at32f415_gpio.h:257
gpio_output_type
gpio_output_type
gpio output type
Definition: at32f415_gpio.h:248
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_ANALOG
@ GPIO_MODE_ANALOG
Definition: at32f415_gpio.h:231
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_MODE_OUTPUT
@ GPIO_MODE_OUTPUT
Definition: at32f415_gpio.h:229
GPIO_DRIVE_STRENGTH_MAXIMUM
@ GPIO_DRIVE_STRENGTH_MAXIMUM
Definition: at32f415_gpio.h:241
GPIO_DRIVE_STRENGTH_MODERATE
@ GPIO_DRIVE_STRENGTH_MODERATE
Definition: at32f415_gpio.h:240
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PINS_SOURCE3
@ GPIO_PINS_SOURCE3
Definition: at32f415_gpio.h:271
GPIO_PINS_SOURCE1
@ GPIO_PINS_SOURCE1
Definition: at32f415_gpio.h:269
GPIO_PINS_SOURCE7
@ GPIO_PINS_SOURCE7
Definition: at32f415_gpio.h:275
GPIO_PINS_SOURCE12
@ GPIO_PINS_SOURCE12
Definition: at32f415_gpio.h:280
GPIO_PINS_SOURCE13
@ GPIO_PINS_SOURCE13
Definition: at32f415_gpio.h:281
GPIO_PINS_SOURCE6
@ GPIO_PINS_SOURCE6
Definition: at32f415_gpio.h:274
GPIO_PINS_SOURCE0
@ GPIO_PINS_SOURCE0
Definition: at32f415_gpio.h:268
GPIO_PINS_SOURCE2
@ GPIO_PINS_SOURCE2
Definition: at32f415_gpio.h:270
GPIO_PINS_SOURCE10
@ GPIO_PINS_SOURCE10
Definition: at32f415_gpio.h:278
GPIO_PINS_SOURCE9
@ GPIO_PINS_SOURCE9
Definition: at32f415_gpio.h:277
GPIO_PINS_SOURCE4
@ GPIO_PINS_SOURCE4
Definition: at32f415_gpio.h:272
GPIO_PINS_SOURCE11
@ GPIO_PINS_SOURCE11
Definition: at32f415_gpio.h:279
GPIO_PINS_SOURCE15
@ GPIO_PINS_SOURCE15
Definition: at32f415_gpio.h:283
GPIO_PINS_SOURCE14
@ GPIO_PINS_SOURCE14
Definition: at32f415_gpio.h:282
GPIO_PINS_SOURCE5
@ GPIO_PINS_SOURCE5
Definition: at32f415_gpio.h:273
GPIO_PINS_SOURCE8
@ GPIO_PINS_SOURCE8
Definition: at32f415_gpio.h:276
GPIO_PORT_SOURCE_GPIOF
@ GPIO_PORT_SOURCE_GPIOF
Definition: at32f415_gpio.h:295
GPIO_PORT_SOURCE_GPIOA
@ GPIO_PORT_SOURCE_GPIOA
Definition: at32f415_gpio.h:291
GPIO_PORT_SOURCE_GPIOB
@ GPIO_PORT_SOURCE_GPIOB
Definition: at32f415_gpio.h:292
GPIO_PORT_SOURCE_GPIOD
@ GPIO_PORT_SOURCE_GPIOD
Definition: at32f415_gpio.h:294
GPIO_PORT_SOURCE_GPIOC
@ GPIO_PORT_SOURCE_GPIOC
Definition: at32f415_gpio.h:293
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_OPEN_DRAIN
@ GPIO_OUTPUT_OPEN_DRAIN
Definition: at32f415_gpio.h:250
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
gpio_type
type define gpio register all
Definition: at32f415_gpio.h:314
gpio_type::iocb9
__IO uint32_t iocb9
Definition: at32f415_gpio.h:458
gpio_type::idt4
__IO uint32_t idt4
Definition: at32f415_gpio.h:381
gpio_type::iocb4
__IO uint32_t iocb4
Definition: at32f415_gpio.h:453
gpio_type::iocb6
__IO uint32_t iocb6
Definition: at32f415_gpio.h:455
gpio_type::iomc13
__IO uint32_t iomc13
Definition: at32f415_gpio.h:360
gpio_type::odt11
__IO uint32_t odt11
Definition: at32f415_gpio.h:416
gpio_type::iocb7
__IO uint32_t iocb7
Definition: at32f415_gpio.h:456
gpio_type::idt3
__IO uint32_t idt3
Definition: at32f415_gpio.h:380
gpio_type::idt7
__IO uint32_t idt7
Definition: at32f415_gpio.h:384
gpio_type::iosb12
__IO uint32_t iosb12
Definition: at32f415_gpio.h:445
gpio_type::iomc5
__IO uint32_t iomc5
Definition: at32f415_gpio.h:333
gpio_type::iofc13
__IO uint32_t iofc13
Definition: at32f415_gpio.h:361
gpio_type::iosb4
__IO uint32_t iosb4
Definition: at32f415_gpio.h:437
gpio_type::idt1
__IO uint32_t idt1
Definition: at32f415_gpio.h:378
gpio_type::idt14
__IO uint32_t idt14
Definition: at32f415_gpio.h:391
gpio_type::idt6
__IO uint32_t idt6
Definition: at32f415_gpio.h:383
gpio_type::iofc2
__IO uint32_t iofc2
Definition: at32f415_gpio.h:328
gpio_type::scr
__IO uint32_t scr
Definition: at32f415_gpio.h:430
gpio_type::odt6
__IO uint32_t odt6
Definition: at32f415_gpio.h:411
gpio_type::odt
__IO uint32_t odt
Definition: at32f415_gpio.h:402
gpio_type::wpen0
__IO uint32_t wpen0
Definition: at32f415_gpio.h:504
gpio_type::wpen9
__IO uint32_t wpen9
Definition: at32f415_gpio.h:513
gpio_type::iomc0
__IO uint32_t iomc0
Definition: at32f415_gpio.h:323
gpio_type::odt5
__IO uint32_t odt5
Definition: at32f415_gpio.h:410
gpio_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_gpio.h:393
gpio_type::odt2
__IO uint32_t odt2
Definition: at32f415_gpio.h:407
gpio_type::iosb7
__IO uint32_t iosb7
Definition: at32f415_gpio.h:440
gpio_type::iocb15
__IO uint32_t iocb15
Definition: at32f415_gpio.h:464
gpio_type::idt12
__IO uint32_t idt12
Definition: at32f415_gpio.h:389
gpio_type::idt9
__IO uint32_t idt9
Definition: at32f415_gpio.h:386
gpio_type::iofc5
__IO uint32_t iofc5
Definition: at32f415_gpio.h:334
gpio_type::odt14
__IO uint32_t odt14
Definition: at32f415_gpio.h:419
gpio_type::iomc6
__IO uint32_t iomc6
Definition: at32f415_gpio.h:335
gpio_type::wpen14
__IO uint32_t wpen14
Definition: at32f415_gpio.h:518
gpio_type::idt8
__IO uint32_t idt8
Definition: at32f415_gpio.h:385
gpio_type::clr
__IO uint32_t clr
Definition: at32f415_gpio.h:473
gpio_type::iosb9
__IO uint32_t iosb9
Definition: at32f415_gpio.h:442
gpio_type::iomc2
__IO uint32_t iomc2
Definition: at32f415_gpio.h:327
gpio_type::iocb14
__IO uint32_t iocb14
Definition: at32f415_gpio.h:463
gpio_type::iofc3
__IO uint32_t iofc3
Definition: at32f415_gpio.h:330
gpio_type::iosb2
__IO uint32_t iosb2
Definition: at32f415_gpio.h:435
gpio_type::wpen8
__IO uint32_t wpen8
Definition: at32f415_gpio.h:512
gpio_type::wpen1
__IO uint32_t wpen1
Definition: at32f415_gpio.h:505
gpio_type::iocb13
__IO uint32_t iocb13
Definition: at32f415_gpio.h:462
gpio_type::wpen13
__IO uint32_t wpen13
Definition: at32f415_gpio.h:517
gpio_type::iofc14
__IO uint32_t iofc14
Definition: at32f415_gpio.h:363
gpio_type::odt15
__IO uint32_t odt15
Definition: at32f415_gpio.h:420
gpio_type::iocb12
__IO uint32_t iocb12
Definition: at32f415_gpio.h:461
gpio_type::iocb3
__IO uint32_t iocb3
Definition: at32f415_gpio.h:452
gpio_type::iosb13
__IO uint32_t iosb13
Definition: at32f415_gpio.h:446
gpio_type::odt3
__IO uint32_t odt3
Definition: at32f415_gpio.h:408
gpio_type::odt9
__IO uint32_t odt9
Definition: at32f415_gpio.h:414
gpio_type::iofc11
__IO uint32_t iofc11
Definition: at32f415_gpio.h:357
gpio_type::idt5
__IO uint32_t idt5
Definition: at32f415_gpio.h:382
gpio_type::iosb5
__IO uint32_t iosb5
Definition: at32f415_gpio.h:438
gpio_type::iosb14
__IO uint32_t iosb14
Definition: at32f415_gpio.h:447
gpio_type::iosb1
__IO uint32_t iosb1
Definition: at32f415_gpio.h:434
gpio_type::iofc6
__IO uint32_t iofc6
Definition: at32f415_gpio.h:336
gpio_type::odt12
__IO uint32_t odt12
Definition: at32f415_gpio.h:417
gpio_type::wpen15
__IO uint32_t wpen15
Definition: at32f415_gpio.h:519
gpio_type::iomc8
__IO uint32_t iomc8
Definition: at32f415_gpio.h:350
gpio_type::wpseq
__IO uint32_t wpseq
Definition: at32f415_gpio.h:520
gpio_type::idt10
__IO uint32_t idt10
Definition: at32f415_gpio.h:387
gpio_type::wpen12
__IO uint32_t wpen12
Definition: at32f415_gpio.h:516
gpio_type::iofc10
__IO uint32_t iofc10
Definition: at32f415_gpio.h:355
gpio_type::iomc9
__IO uint32_t iomc9
Definition: at32f415_gpio.h:352
gpio_type::iocb8
__IO uint32_t iocb8
Definition: at32f415_gpio.h:457
gpio_type::iosb6
__IO uint32_t iosb6
Definition: at32f415_gpio.h:439
gpio_type::iocb1
__IO uint32_t iocb1
Definition: at32f415_gpio.h:450
gpio_type::iocb2
__IO uint32_t iocb2
Definition: at32f415_gpio.h:451
gpio_type::wpen2
__IO uint32_t wpen2
Definition: at32f415_gpio.h:506
gpio_type::iofc12
__IO uint32_t iofc12
Definition: at32f415_gpio.h:359
gpio_type::iomc7
__IO uint32_t iomc7
Definition: at32f415_gpio.h:337
gpio_type::idt13
__IO uint32_t idt13
Definition: at32f415_gpio.h:390
gpio_type::odt13
__IO uint32_t odt13
Definition: at32f415_gpio.h:418
gpio_type::iocb5
__IO uint32_t iocb5
Definition: at32f415_gpio.h:454
gpio_type::odt7
__IO uint32_t odt7
Definition: at32f415_gpio.h:412
gpio_type::odt4
__IO uint32_t odt4
Definition: at32f415_gpio.h:409
gpio_type::iosb0
__IO uint32_t iosb0
Definition: at32f415_gpio.h:433
gpio_type::wpen6
__IO uint32_t wpen6
Definition: at32f415_gpio.h:510
gpio_type::cfghr
__IO uint32_t cfghr
Definition: at32f415_gpio.h:347
gpio_type::iofc0
__IO uint32_t iofc0
Definition: at32f415_gpio.h:324
gpio_type::wpen11
__IO uint32_t wpen11
Definition: at32f415_gpio.h:515
gpio_type::wpen4
__IO uint32_t wpen4
Definition: at32f415_gpio.h:508
gpio_type::wpen5
__IO uint32_t wpen5
Definition: at32f415_gpio.h:509
gpio_type::idt11
__IO uint32_t idt11
Definition: at32f415_gpio.h:388
gpio_type::idt2
__IO uint32_t idt2
Definition: at32f415_gpio.h:379
gpio_type::odt1
__IO uint32_t odt1
Definition: at32f415_gpio.h:406
gpio_type::cfglr
__IO uint32_t cfglr
Definition: at32f415_gpio.h:320
gpio_type::wpen7
__IO uint32_t wpen7
Definition: at32f415_gpio.h:511
gpio_type::iomc11
__IO uint32_t iomc11
Definition: at32f415_gpio.h:356
gpio_type::iocb10
__IO uint32_t iocb10
Definition: at32f415_gpio.h:459
gpio_type::iofc9
__IO uint32_t iofc9
Definition: at32f415_gpio.h:353
gpio_type::iomc15
__IO uint32_t iomc15
Definition: at32f415_gpio.h:364
gpio_type::iomc14
__IO uint32_t iomc14
Definition: at32f415_gpio.h:362
gpio_type::iofc8
__IO uint32_t iofc8
Definition: at32f415_gpio.h:351
gpio_type::iomc12
__IO uint32_t iomc12
Definition: at32f415_gpio.h:358
gpio_type::iosb15
__IO uint32_t iosb15
Definition: at32f415_gpio.h:448
gpio_type::odt10
__IO uint32_t odt10
Definition: at32f415_gpio.h:415
gpio_type::iofc7
__IO uint32_t iofc7
Definition: at32f415_gpio.h:338
gpio_type::iosb3
__IO uint32_t iosb3
Definition: at32f415_gpio.h:436
gpio_type::odt0
__IO uint32_t odt0
Definition: at32f415_gpio.h:405
gpio_type::wpen3
__IO uint32_t wpen3
Definition: at32f415_gpio.h:507
gpio_type::idt15
__IO uint32_t idt15
Definition: at32f415_gpio.h:392
gpio_type::idt
__IO uint32_t idt
Definition: at32f415_gpio.h:374
gpio_type::odt8
__IO uint32_t odt8
Definition: at32f415_gpio.h:413
gpio_type::iofc15
__IO uint32_t iofc15
Definition: at32f415_gpio.h:365
gpio_type::iofc1
__IO uint32_t iofc1
Definition: at32f415_gpio.h:326
gpio_type::idt0
__IO uint32_t idt0
Definition: at32f415_gpio.h:377
gpio_type::wpr
__IO uint32_t wpr
Definition: at32f415_gpio.h:501
gpio_type::iomc3
__IO uint32_t iomc3
Definition: at32f415_gpio.h:329
gpio_type::iocb0
__IO uint32_t iocb0
Definition: at32f415_gpio.h:449
gpio_type::iosb8
__IO uint32_t iosb8
Definition: at32f415_gpio.h:441
gpio_type::iosb11
__IO uint32_t iosb11
Definition: at32f415_gpio.h:444
gpio_type::iomc4
__IO uint32_t iomc4
Definition: at32f415_gpio.h:331
gpio_type::iomc10
__IO uint32_t iomc10
Definition: at32f415_gpio.h:354
gpio_type::iomc1
__IO uint32_t iomc1
Definition: at32f415_gpio.h:325
gpio_type::iofc4
__IO uint32_t iofc4
Definition: at32f415_gpio.h:332
gpio_type::wpen10
__IO uint32_t wpen10
Definition: at32f415_gpio.h:514
gpio_type::iosb10
__IO uint32_t iosb10
Definition: at32f415_gpio.h:443
gpio_type::iocb11
__IO uint32_t iocb11
Definition: at32f415_gpio.h:460
iomux_type
type define iomux register all
Definition: at32f415_gpio.h:531
iomux_type::adc1_etp_gmux
__IO uint32_t adc1_etp_gmux
Definition: at32f415_gpio.h:739
iomux_type::exint1
__IO uint32_t exint1
Definition: at32f415_gpio.h:585
iomux_type::remap
__IO uint32_t remap
Definition: at32f415_gpio.h:552
iomux_type::tmr3_gmux
__IO uint32_t tmr3_gmux
Definition: at32f415_gpio.h:685
iomux_type::reserved3
__IO uint32_t reserved3
Definition: at32f415_gpio.h:569
iomux_type::exint9
__IO uint32_t exint9
Definition: at32f415_gpio.h:617
iomux_type::tmr1_ch1_cmp_gmux
__IO uint32_t tmr1_ch1_cmp_gmux
Definition: at32f415_gpio.h:758
iomux_type::remap2
__IO uint32_t remap2
Definition: at32f415_gpio.h:650
iomux_type::tmr1_gmux
__IO uint32_t tmr1_gmux
Definition: at32f415_gpio.h:682
iomux_type::tmr2_gmux
__IO uint32_t tmr2_gmux
Definition: at32f415_gpio.h:683
iomux_type::exint15
__IO uint32_t exint15
Definition: at32f415_gpio.h:635
iomux_type::remap6
__IO uint32_t remap6
Definition: at32f415_gpio.h:716
iomux_type::exint13
__IO uint32_t exint13
Definition: at32f415_gpio.h:633
iomux_type::usart1_gmux
__IO uint32_t usart1_gmux
Definition: at32f415_gpio.h:723
iomux_type::remap5
__IO uint32_t remap5
Definition: at32f415_gpio.h:698
iomux_type::uart4_gmux
__IO uint32_t uart4_gmux
Definition: at32f415_gpio.h:726
iomux_type::exint10
__IO uint32_t exint10
Definition: at32f415_gpio.h:618
iomux_type::tmr3_mux
__IO uint32_t tmr3_mux
Definition: at32f415_gpio.h:562
iomux_type::tmr10_gmux
__IO uint32_t tmr10_gmux
Definition: at32f415_gpio.h:668
iomux_type::reserved1
__IO uint32_t reserved1
iomux reserved1 register, offset:0x18
Definition: at32f415_gpio.h:543
iomux_type::i2c1_mux
__IO uint32_t i2c1_mux
Definition: at32f415_gpio.h:556
iomux_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_gpio.h:563
iomux_type::exint12
__IO uint32_t exint12
Definition: at32f415_gpio.h:632
iomux_type::pd01_mux
__IO uint32_t pd01_mux
Definition: at32f415_gpio.h:565
iomux_type::exint11
__IO uint32_t exint11
Definition: at32f415_gpio.h:619
iomux_type::adc1_extrgpre_mux
__IO uint32_t adc1_extrgpre_mux
Definition: at32f415_gpio.h:567
iomux_type::exint7
__IO uint32_t exint7
Definition: at32f415_gpio.h:603
iomux_type::exint6
__IO uint32_t exint6
Definition: at32f415_gpio.h:602
iomux_type::remap7
__IO uint32_t remap7
Definition: at32f415_gpio.h:735
iomux_type::remap4
__IO uint32_t remap4
Definition: at32f415_gpio.h:679
iomux_type::pd01_gmux
__IO uint32_t pd01_gmux
Definition: at32f415_gpio.h:744
iomux_type::evoen
__IO uint32_t evoen
Definition: at32f415_gpio.h:542
iomux_type::i2c2_gmux
__IO uint32_t i2c2_gmux
Definition: at32f415_gpio.h:703
iomux_type::exint3
__IO uint32_t exint3
Definition: at32f415_gpio.h:587
iomux_type::tmr2_ch4_cmp_gmux
__IO uint32_t tmr2_ch4_cmp_gmux
Definition: at32f415_gpio.h:759
iomux_type::swjtag_conf
__IO uint32_t swjtag_conf
Definition: at32f415_gpio.h:570
iomux_type::tmr1_mux
__IO uint32_t tmr1_mux
Definition: at32f415_gpio.h:560
iomux_type::usart3_gmux
__IO uint32_t usart3_gmux
Definition: at32f415_gpio.h:725
iomux_type::tmr11_gmux
__IO uint32_t tmr11_gmux
Definition: at32f415_gpio.h:669
iomux_type::tmr9_gmux
__IO uint32_t tmr9_gmux
Definition: at32f415_gpio.h:667
iomux_type::selpin
__IO uint32_t selpin
Definition: at32f415_gpio.h:540
iomux_type::spi1_gmux
__IO uint32_t spi1_gmux
Definition: at32f415_gpio.h:705
iomux_type::cmp_mux
__IO uint32_t cmp_mux
Definition: at32f415_gpio.h:654
iomux_type::reserved4
__IO uint32_t reserved4
Definition: at32f415_gpio.h:571
iomux_type::tmr2_mux
__IO uint32_t tmr2_mux
Definition: at32f415_gpio.h:561
iomux_type::spi2_gmux
__IO uint32_t spi2_gmux
Definition: at32f415_gpio.h:706
iomux_type::exint4
__IO uint32_t exint4
Definition: at32f415_gpio.h:600
iomux_type::spi1_mux_h
__IO uint32_t spi1_mux_h
Definition: at32f415_gpio.h:572
iomux_type::exint8
__IO uint32_t exint8
Definition: at32f415_gpio.h:616
iomux_type::sdio1_gmux
__IO uint32_t sdio1_gmux
Definition: at32f415_gpio.h:721
iomux_type::tmr3_ch1_cmp_gmux
__IO uint32_t tmr3_ch1_cmp_gmux
Definition: at32f415_gpio.h:760
iomux_type::can1_gmux
__IO uint32_t can1_gmux
Definition: at32f415_gpio.h:719
iomux_type::exintc4
__IO uint32_t exintc4
Definition: at32f415_gpio.h:629
iomux_type::exint2
__IO uint32_t exint2
Definition: at32f415_gpio.h:586
iomux_type::exint5
__IO uint32_t exint5
Definition: at32f415_gpio.h:601
iomux_type::selport
__IO uint32_t selport
Definition: at32f415_gpio.h:541
iomux_type::exint0
__IO uint32_t exint0
Definition: at32f415_gpio.h:584
iomux_type::exint14
__IO uint32_t exint14
Definition: at32f415_gpio.h:634
iomux_type::adc1_eto_gmux
__IO uint32_t adc1_eto_gmux
Definition: at32f415_gpio.h:740
iomux_type::remap3
__IO uint32_t remap3
Definition: at32f415_gpio.h:664
iomux_type::spi1_mux_l
__IO uint32_t spi1_mux_l
Definition: at32f415_gpio.h:555
iomux_type::tmr1_bk1_cmp_gmux
__IO uint32_t tmr1_bk1_cmp_gmux
Definition: at32f415_gpio.h:757
iomux_type::usart1_mux
__IO uint32_t usart1_mux
Definition: at32f415_gpio.h:557
iomux_type::exintc3
__IO uint32_t exintc3
Definition: at32f415_gpio.h:613
iomux_type::remap8
__IO uint32_t remap8
Definition: at32f415_gpio.h:754
iomux_type::tmr5ch4_gmux
__IO uint32_t tmr5ch4_gmux
Definition: at32f415_gpio.h:688
iomux_type::can_mux
__IO uint32_t can_mux
Definition: at32f415_gpio.h:564
iomux_type::usart3_mux
__IO uint32_t usart3_mux
Definition: at32f415_gpio.h:559
iomux_type::tmr5ch4_mux
__IO uint32_t tmr5ch4_mux
Definition: at32f415_gpio.h:566
iomux_type::evtout
__IO uint32_t evtout
Definition: at32f415_gpio.h:537
iomux_type::adc1_extrgord_mux
__IO uint32_t adc1_extrgord_mux
Definition: at32f415_gpio.h:568
iomux_type::tmr5_gmux
__IO uint32_t tmr5_gmux
Definition: at32f415_gpio.h:687
iomux_type::exintc2
__IO uint32_t exintc2
Definition: at32f415_gpio.h:597
iomux_type::swjtag_gmux
__IO uint32_t swjtag_gmux
Definition: at32f415_gpio.h:742
iomux_type::exintc1
__IO uint32_t exintc1
Definition: at32f415_gpio.h:581
iomux_type::i2c1_gmux
__IO uint32_t i2c1_gmux
Definition: at32f415_gpio.h:702


AT32F415 Firmwary Library: at32f415_i2c.c Source File

  • libraries
  • drivers
  • src
at32f415_i2c.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef I2C_MODULE_ENABLED
39
51void i2c_reset(i2c_type *i2c_x)
52{
53 if(i2c_x == I2C1)
54 {
55 crm_periph_reset(CRM_I2C1_PERIPH_RESET, TRUE);
56 crm_periph_reset(CRM_I2C1_PERIPH_RESET, FALSE);
57 }
58 else if(i2c_x == I2C2)
59 {
60 crm_periph_reset(CRM_I2C2_PERIPH_RESET, TRUE);
61 crm_periph_reset(CRM_I2C2_PERIPH_RESET, FALSE);
62 }
63}
64
73void i2c_software_reset(i2c_type *i2c_x, confirm_state new_state)
74{
75 i2c_x->ctrl1_bit.reset = new_state;
76}
77
90void i2c_init(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed)
91{
92 uint32_t apb_freq = 0;
93 uint16_t freq_mhz = 0, temp = 0;
94
95 crm_clocks_freq_type clocks;
96
97 /* disable i2c peripherals */
98 i2c_x->ctrl1_bit.i2cen = FALSE;
99
100 /* get system clock */
101 crm_clocks_freq_get(&clocks);
102
103 if((i2c_x == I2C1) || (i2c_x == I2C2))
104 {
105 apb_freq = clocks.apb1_freq;
106 }
107
108 freq_mhz = (apb_freq / 1000000);
109
110 /* set i2c input clock frequency */
111 i2c_x->ctrl2_bit.clkfreq = freq_mhz;
112
113 /* standard mode */
114 if(speed <= 100000)
115 {
116 temp = (uint16_t)(apb_freq / (speed << 1));
117
118 if (temp < 0x04)
119 {
120 temp = 0x04;
121 }
122
123 /* set scl clock */
124 i2c_x->clkctrl_bit.speed = temp;
125
126 /* disable fast mode */
127 i2c_x->clkctrl_bit.speedmode = FALSE;
128
129 /* set the maximum rise time */
130 if((freq_mhz + 1) > 0x3F)
131 {
132 i2c_x->tmrise_bit.risetime = 0x3F;
133 }
134 else
135 {
136 i2c_x->tmrise_bit.risetime = (freq_mhz + 1);
137 }
138 }
139 /* fast mode */
140 else
141 {
142 if (duty == I2C_FSMODE_DUTY_2_1)
143 {
144 temp = (uint16_t)(apb_freq / (speed * 3));
145
146 /* the ratio of high level to low level is 1:2 */
147 i2c_x->clkctrl_bit.dutymode = I2C_FSMODE_DUTY_2_1;
148 }
149 else
150 {
151 temp = (uint16_t)(apb_freq / (speed * 25));
152
153 /* the ratio of high level to low level is 9:16 */
154 i2c_x->clkctrl_bit.dutymode = I2C_FSMODE_DUTY_16_9;
155 }
156
157 if (temp == 0)
158 {
159 temp = 0x0001;
160 }
161
162 /* set scl clock*/
163 i2c_x->clkctrl_bit.speed = temp;
164
165 /* set the mode to fast mode */
166 i2c_x->clkctrl_bit.speedmode = TRUE;
167
168 /* set the maximum rise time */
169 i2c_x->tmrise_bit.risetime = (uint16_t)(((freq_mhz * (uint16_t)300) / (uint16_t)1000) + (uint16_t)1);
170 }
171}
172
185void i2c_own_address1_set(i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address)
186{
187 /* set address mode */
188 i2c_x->oaddr1_bit.addr1mode = mode;
189
190 /* set own address1 */
191 i2c_x->oaddr1_bit.addr1 = address;
192}
193
202void i2c_own_address2_set(i2c_type *i2c_x, uint8_t address)
203{
204 i2c_x->oaddr2_bit.addr2 = (address >> 1);
205}
206
215void i2c_own_address2_enable(i2c_type *i2c_x, confirm_state new_state)
216{
217 i2c_x->oaddr2_bit.addr2en = new_state;
218}
219
228void i2c_smbus_enable(i2c_type *i2c_x, confirm_state new_state)
229{
230 i2c_x->ctrl1_bit.permode = new_state;
231}
232
241void i2c_enable(i2c_type *i2c_x, confirm_state new_state)
242{
243 i2c_x->ctrl1_bit.i2cen = new_state;
244}
245
257void i2c_fast_mode_duty_set(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty)
258{
259 i2c_x->clkctrl_bit.dutymode = duty;
260}
261
270void i2c_clock_stretch_enable(i2c_type *i2c_x, confirm_state new_state)
271{
272 i2c_x->ctrl1_bit.stretch = !new_state;
273}
274
283void i2c_ack_enable(i2c_type *i2c_x, confirm_state new_state)
284{
285 i2c_x->ctrl1_bit.acken = new_state;
286}
287
299void i2c_master_receive_ack_set(i2c_type *i2c_x, i2c_master_ack_type pos)
300{
301 i2c_x->ctrl1_bit.mackctrl = pos;
302}
303
315void i2c_pec_position_set(i2c_type *i2c_x, i2c_pec_position_type pos)
316{
317 i2c_x->ctrl1_bit.mackctrl = pos;
318}
319
328void i2c_general_call_enable(i2c_type *i2c_x, confirm_state new_state)
329{
330 i2c_x->ctrl1_bit.gcaen = new_state;
331}
332
341void i2c_arp_mode_enable(i2c_type *i2c_x, confirm_state new_state)
342{
343 i2c_x->ctrl1_bit.arpen = new_state;
344}
345
357void i2c_smbus_mode_set(i2c_type *i2c_x, i2c_smbus_mode_set_type mode)
358{
359 i2c_x->ctrl1_bit.smbmode = mode;
360}
361
373void i2c_smbus_alert_set(i2c_type *i2c_x, i2c_smbus_alert_set_type level)
374{
375 i2c_x->ctrl1_bit.smbalert = level;
376}
377
386void i2c_pec_transmit_enable(i2c_type *i2c_x, confirm_state new_state)
387{
388 i2c_x->ctrl1_bit.pecten = new_state;
389}
390
399void i2c_pec_calculate_enable(i2c_type *i2c_x, confirm_state new_state)
400{
401 i2c_x->ctrl1_bit.pecen = new_state;
402}
403
411uint8_t i2c_pec_value_get(i2c_type *i2c_x)
412{
413 return i2c_x->sts2_bit.pecval;
414}
415
424void i2c_dma_end_transfer_set(i2c_type *i2c_x, confirm_state new_state)
425{
426 i2c_x->ctrl2_bit.dmaend = new_state;
427}
428
437void i2c_dma_enable(i2c_type *i2c_x, confirm_state new_state)
438{
439 i2c_x->ctrl2_bit.dmaen = new_state;
440}
441
455void i2c_interrupt_enable(i2c_type *i2c_x, uint16_t source, confirm_state new_state)
456{
457 if (new_state != FALSE)
458 {
459 i2c_x->ctrl2 |= source;
460 }
461 else
462 {
463 i2c_x->ctrl2 &= (uint16_t)~source;
464 }
465}
466
474void i2c_start_generate(i2c_type *i2c_x)
475{
476 i2c_x->ctrl1_bit.genstart = TRUE;
477}
478
486void i2c_stop_generate(i2c_type *i2c_x)
487{
488 i2c_x->ctrl1_bit.genstop = TRUE;
489}
490
503void i2c_7bit_address_send(i2c_type *i2c_x, uint8_t address, i2c_direction_type direction)
504{
505 if(direction == I2C_DIRECTION_TRANSMIT)
506 {
507 i2c_x->dt = address & 0xFE;
508 }
509 else
510 {
511 i2c_x->dt = address | 0x01;
512 }
513}
514
523void i2c_data_send(i2c_type *i2c_x, uint8_t data)
524{
525 i2c_x->dt = data;
526}
527
535uint8_t i2c_data_receive(i2c_type *i2c_x)
536{
537 return (uint8_t)i2c_x->dt;
538}
539
570 flag_status i2c_flag_get(i2c_type *i2c_x, uint32_t flag)
571{
572 __IO uint32_t reg = 0, value = 0;
573
574 reg = flag >> 28;
575
576 flag &= (uint32_t)0x00FFFFFF;
577
578 if(reg == 0)
579 {
580 value = i2c_x->sts1;
581 }
582 else
583 {
584 flag = (uint32_t)(flag >> 16);
585
586 value = i2c_x->sts2;
587 }
588
589 if((value & flag) != (uint32_t)RESET)
590 {
591 return SET;
592 }
593 else
594 {
595 return RESET;
596 }
597}
598
615void i2c_flag_clear(i2c_type *i2c_x, uint32_t flag)
616{
617 i2c_x->sts1 = (uint16_t)~(flag & (uint32_t)0x00FFFFFF);
618}
619
624#endif
625
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_I2C2_PERIPH_RESET
@ CRM_I2C2_PERIPH_RESET
Definition: at32f415_crm.h:176
CRM_I2C1_PERIPH_RESET
@ CRM_I2C1_PERIPH_RESET
Definition: at32f415_crm.h:175
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
i2c_fsmode_duty_cycle_type
i2c_fsmode_duty_cycle_type
i2c fast mode duty cycle
Definition: at32f415_i2c.h:147
i2c_smbus_mode_set_type
i2c_smbus_mode_set_type
i2c smbus mode set
Definition: at32f415_i2c.h:137
i2c_direction_type
i2c_direction_type
i2c address direction
Definition: at32f415_i2c.h:165
i2c_master_ack_type
i2c_master_ack_type
i2c master receiving mode acknowledge control
Definition: at32f415_i2c.h:109
i2c_address_mode_type
i2c_address_mode_type
i2c address mode
Definition: at32f415_i2c.h:156
i2c_smbus_alert_set_type
i2c_smbus_alert_set_type
i2c smbus alert pin set
Definition: at32f415_i2c.h:128
i2c_pec_position_type
i2c_pec_position_type
i2c pec position set
Definition: at32f415_i2c.h:118
I2C_FSMODE_DUTY_2_1
@ I2C_FSMODE_DUTY_2_1
Definition: at32f415_i2c.h:148
I2C_FSMODE_DUTY_16_9
@ I2C_FSMODE_DUTY_16_9
Definition: at32f415_i2c.h:149
I2C_DIRECTION_TRANSMIT
@ I2C_DIRECTION_TRANSMIT
Definition: at32f415_i2c.h:166
i2c_pec_position_set
void i2c_pec_position_set(i2c_type *i2c_x, i2c_pec_position_type pos)
pec position set.
Definition: at32f415_i2c.c:315
i2c_pec_transmit_enable
void i2c_pec_transmit_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable pec transfer.
Definition: at32f415_i2c.c:386
i2c_arp_mode_enable
void i2c_arp_mode_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable arp mode.
Definition: at32f415_i2c.c:341
i2c_data_receive
uint8_t i2c_data_receive(i2c_type *i2c_x)
receive a byte through the i2c periph.
Definition: at32f415_i2c.c:535
i2c_reset
void i2c_reset(i2c_type *i2c_x)
reset the i2c register
Definition: at32f415_i2c.c:51
i2c_smbus_alert_set
void i2c_smbus_alert_set(i2c_type *i2c_x, i2c_smbus_alert_set_type level)
drive the smbus alert pin high or low.
Definition: at32f415_i2c.c:373
i2c_smbus_enable
void i2c_smbus_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable the smbus mode
Definition: at32f415_i2c.c:228
i2c_pec_value_get
uint8_t i2c_pec_value_get(i2c_type *i2c_x)
get pec value.
Definition: at32f415_i2c.c:411
i2c_software_reset
void i2c_software_reset(i2c_type *i2c_x, confirm_state new_state)
software reset.
Definition: at32f415_i2c.c:73
i2c_general_call_enable
void i2c_general_call_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable general call.
Definition: at32f415_i2c.c:328
i2c_ack_enable
void i2c_ack_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable acknowledge.
Definition: at32f415_i2c.c:283
i2c_own_address2_set
void i2c_own_address2_set(i2c_type *i2c_x, uint8_t address)
config own address2.
Definition: at32f415_i2c.c:202
i2c_7bit_address_send
void i2c_7bit_address_send(i2c_type *i2c_x, uint8_t address, i2c_direction_type direction)
transmit the slave address.
Definition: at32f415_i2c.c:503
i2c_dma_end_transfer_set
void i2c_dma_end_transfer_set(i2c_type *i2c_x, confirm_state new_state)
enable or disable if the next dma transfer will be the last one.
Definition: at32f415_i2c.c:424
i2c_own_address2_enable
void i2c_own_address2_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable own address2.
Definition: at32f415_i2c.c:215
i2c_pec_calculate_enable
void i2c_pec_calculate_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable pec calcultetion.
Definition: at32f415_i2c.c:399
i2c_stop_generate
void i2c_stop_generate(i2c_type *i2c_x)
generate stop condition.
Definition: at32f415_i2c.c:486
i2c_own_address1_set
void i2c_own_address1_set(i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address)
config own address1.
Definition: at32f415_i2c.c:185
i2c_enable
void i2c_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable i2c periph
Definition: at32f415_i2c.c:241
i2c_fast_mode_duty_set
void i2c_fast_mode_duty_set(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty)
config fast mode duty cycle
Definition: at32f415_i2c.c:257
i2c_flag_get
flag_status i2c_flag_get(i2c_type *i2c_x, uint32_t flag)
get flag status
Definition: at32f415_i2c.c:570
i2c_smbus_mode_set
void i2c_smbus_mode_set(i2c_type *i2c_x, i2c_smbus_mode_set_type mode)
config smbus host or device.
Definition: at32f415_i2c.c:357
i2c_interrupt_enable
void i2c_interrupt_enable(i2c_type *i2c_x, uint16_t source, confirm_state new_state)
enable or disable interrupt
Definition: at32f415_i2c.c:455
i2c_flag_clear
void i2c_flag_clear(i2c_type *i2c_x, uint32_t flag)
clear flag status
Definition: at32f415_i2c.c:615
i2c_dma_enable
void i2c_dma_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable dma requests.
Definition: at32f415_i2c.c:437
i2c_data_send
void i2c_data_send(i2c_type *i2c_x, uint8_t data)
send a byte through the i2c periph.
Definition: at32f415_i2c.c:523
i2c_clock_stretch_enable
void i2c_clock_stretch_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable clock stretch.
Definition: at32f415_i2c.c:270
i2c_init
void i2c_init(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed)
init i2c speed and duty cycle.
Definition: at32f415_i2c.c:90
i2c_master_receive_ack_set
void i2c_master_receive_ack_set(i2c_type *i2c_x, i2c_master_ack_type pos)
master receiving mode acknowledge control.
Definition: at32f415_i2c.c:299
i2c_start_generate
void i2c_start_generate(i2c_type *i2c_x)
generate start condition.
Definition: at32f415_i2c.c:474
I2C1
#define I2C1
Definition: at32f415_i2c.h:347
I2C2
#define I2C2
Definition: at32f415_i2c.h:348
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::apb1_freq
uint32_t apb1_freq
Definition: at32f415_crm.h:475
i2c_type
type define i2c register all
Definition: at32f415_i2c.h:174
i2c_type::tmrise_bit
struct i2c_type::@494::@504 tmrise_bit
i2c_type::smbalert
__IO uint32_t smbalert
Definition: at32f415_i2c.h:196
i2c_type::dmaend
__IO uint32_t dmaend
Definition: at32f415_i2c.h:216
i2c_type::genstop
__IO uint32_t genstop
Definition: at32f415_i2c.h:192
i2c_type::addr2en
__IO uint32_t addr2en
Definition: at32f415_i2c.h:244
i2c_type::dmaen
__IO uint32_t dmaen
Definition: at32f415_i2c.h:215
i2c_type::ctrl1_bit
struct i2c_type::@478::@496 ctrl1_bit
i2c_type::gcaen
__IO uint32_t gcaen
Definition: at32f415_i2c.h:189
i2c_type::clkfreq
__IO uint32_t clkfreq
Definition: at32f415_i2c.h:211
i2c_type::oaddr1_bit
struct i2c_type::@482::@498 oaddr1_bit
i2c_type::addr2
__IO uint32_t addr2
Definition: at32f415_i2c.h:245
i2c_type::sts1
__IO uint32_t sts1
Definition: at32f415_i2c.h:268
i2c_type::risetime
__IO uint32_t risetime
Definition: at32f415_i2c.h:336
i2c_type::permode
__IO uint32_t permode
Definition: at32f415_i2c.h:184
i2c_type::genstart
__IO uint32_t genstart
Definition: at32f415_i2c.h:191
i2c_type::oaddr2_bit
struct i2c_type::@484::@499 oaddr2_bit
i2c_type::speedmode
__IO uint32_t speedmode
Definition: at32f415_i2c.h:323
i2c_type::pecten
__IO uint32_t pecten
Definition: at32f415_i2c.h:195
i2c_type::ctrl2
__IO uint32_t ctrl2
Definition: at32f415_i2c.h:208
i2c_type::speed
__IO uint32_t speed
Definition: at32f415_i2c.h:320
i2c_type::clkctrl_bit
struct i2c_type::@492::@503 clkctrl_bit
i2c_type::stretch
__IO uint32_t stretch
Definition: at32f415_i2c.h:190
i2c_type::dutymode
__IO uint32_t dutymode
Definition: at32f415_i2c.h:322
i2c_type::arpen
__IO uint32_t arpen
Definition: at32f415_i2c.h:187
i2c_type::addr1mode
__IO uint32_t addr1mode
Definition: at32f415_i2c.h:231
i2c_type::reset
__IO uint32_t reset
Definition: at32f415_i2c.h:198
i2c_type::pecval
__IO uint32_t pecval
Definition: at32f415_i2c.h:307
i2c_type::dt
__IO uint32_t dt
Definition: at32f415_i2c.h:255
i2c_type::acken
__IO uint32_t acken
Definition: at32f415_i2c.h:193
i2c_type::i2cen
__IO uint32_t i2cen
Definition: at32f415_i2c.h:183
i2c_type::addr1
__IO uint32_t addr1
Definition: at32f415_i2c.h:229
i2c_type::sts2
__IO uint32_t sts2
Definition: at32f415_i2c.h:296
i2c_type::sts2_bit
struct i2c_type::@490::@502 sts2_bit
i2c_type::mackctrl
__IO uint32_t mackctrl
Definition: at32f415_i2c.h:194
i2c_type::pecen
__IO uint32_t pecen
Definition: at32f415_i2c.h:188
i2c_type::ctrl2_bit
struct i2c_type::@480::@497 ctrl2_bit
i2c_type::smbmode
__IO uint32_t smbmode
Definition: at32f415_i2c.h:186
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_i2c.h Source File

  • libraries
  • drivers
  • inc
at32f415_i2c.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_I2C_H
29#define __AT32F415_I2C_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
52#define I2C_STARTF_FLAG ((uint32_t)0x00000001)
53#define I2C_ADDR7F_FLAG ((uint32_t)0x00000002)
54#define I2C_TDC_FLAG ((uint32_t)0x00000004)
55#define I2C_ADDRHF_FLAG ((uint32_t)0x00000008)
56#define I2C_STOPF_FLAG ((uint32_t)0x00000010)
57#define I2C_RDBF_FLAG ((uint32_t)0x00000040)
58#define I2C_TDBE_FLAG ((uint32_t)0x00000080)
59#define I2C_BUSERR_FLAG ((uint32_t)0x00000100)
60#define I2C_ARLOST_FLAG ((uint32_t)0x00000200)
61#define I2C_ACKFAIL_FLAG ((uint32_t)0x00000400)
62#define I2C_OUF_FLAG ((uint32_t)0x00000800)
63#define I2C_PECERR_FLAG ((uint32_t)0x00001000)
64#define I2C_TMOUT_FLAG ((uint32_t)0x00004000)
65#define I2C_ALERTF_FLAG ((uint32_t)0x00008000)
76#define I2C_TRMODE_FLAG ((uint32_t)0x10010000)
77#define I2C_BUSYF_FLAG ((uint32_t)0x10020000)
78#define I2C_DIRF_FLAG ((uint32_t)0x10040000)
79#define I2C_GCADDRF_FLAG ((uint32_t)0x10100000)
80#define I2C_DEVADDRF_FLAG ((uint32_t)0x10200000)
81#define I2C_HOSTADDRF_FLAG ((uint32_t)0x10400000)
82#define I2C_ADDR2_FLAG ((uint32_t)0x10800000)
93#define I2C_DATA_INT ((uint16_t)0x0400)
94#define I2C_EVT_INT ((uint16_t)0x0200)
95#define I2C_ERR_INT ((uint16_t)0x0100)
108typedef enum
109{
110 I2C_MASTER_ACK_CURRENT = 0x00,
111 I2C_MASTER_ACK_NEXT = 0x01
112} i2c_master_ack_type;
113
117typedef enum
118{
119 I2C_PEC_POSITION_CURRENT = 0x00,
120 I2C_PEC_POSITION_NEXT = 0x01
121} i2c_pec_position_type;
122
123
127typedef enum
128{
129 I2C_SMBUS_ALERT_HIGH = 0x00,
130 I2C_SMBUS_ALERT_LOW = 0x01
131} i2c_smbus_alert_set_type;
132
136typedef enum
137{
138 I2C_SMBUS_MODE_DEVICE = 0x00,
139 I2C_SMBUS_MODE_HOST = 0x01
140} i2c_smbus_mode_set_type;
141
142
146typedef enum
147{
148 I2C_FSMODE_DUTY_2_1 = 0x00,
149 I2C_FSMODE_DUTY_16_9 = 0x01
150} i2c_fsmode_duty_cycle_type;
151
155typedef enum
156{
157 I2C_ADDRESS_MODE_7BIT = 0x00,
158 I2C_ADDRESS_MODE_10BIT = 0x01
159} i2c_address_mode_type;
160
164typedef enum
165{
166 I2C_DIRECTION_TRANSMIT = 0x00,
167 I2C_DIRECTION_RECEIVE = 0x01
168} i2c_direction_type;
169
173typedef struct
174{
178 union
179 {
180 __IO uint32_t ctrl1;
181 struct
182 {
183 __IO uint32_t i2cen : 1; /* [0] */
184 __IO uint32_t permode : 1; /* [1] */
185 __IO uint32_t reserved1 : 1; /* [2] */
186 __IO uint32_t smbmode : 1; /* [3] */
187 __IO uint32_t arpen : 1; /* [4] */
188 __IO uint32_t pecen : 1; /* [5] */
189 __IO uint32_t gcaen : 1; /* [6] */
190 __IO uint32_t stretch : 1; /* [7] */
191 __IO uint32_t genstart : 1; /* [8] */
192 __IO uint32_t genstop : 1; /* [9] */
193 __IO uint32_t acken : 1; /* [10] */
194 __IO uint32_t mackctrl : 1; /* [11] */
195 __IO uint32_t pecten : 1; /* [12] */
196 __IO uint32_t smbalert : 1; /* [13] */
197 __IO uint32_t reserved2 : 1; /* [14] */
198 __IO uint32_t reset : 1; /* [15] */
199 __IO uint32_t reserved3 : 16;/* [31:16] */
200 } ctrl1_bit;
201 };
202
206 union
207 {
208 __IO uint32_t ctrl2;
209 struct
210 {
211 __IO uint32_t clkfreq : 8; /* [7:0] */
212 __IO uint32_t errien : 1; /* [8] */
213 __IO uint32_t evtien : 1; /* [9] */
214 __IO uint32_t dataien : 1; /* [10] */
215 __IO uint32_t dmaen : 1; /* [11] */
216 __IO uint32_t dmaend : 1; /* [12] */
217 __IO uint32_t reserved1 : 19;/* [31:13] */
218 } ctrl2_bit;
219 };
220
224 union
225 {
226 __IO uint32_t oaddr1;
227 struct
228 {
229 __IO uint32_t addr1 : 10;/* [9:0] */
230 __IO uint32_t reserved1 : 5; /* [14:10] */
231 __IO uint32_t addr1mode : 1; /* [15] */
232 __IO uint32_t reserved2 : 16;/* [31:16] */
233 } oaddr1_bit;
234 };
235
239 union
240 {
241 __IO uint32_t oaddr2;
242 struct
243 {
244 __IO uint32_t addr2en : 1; /* [0] */
245 __IO uint32_t addr2 : 7; /* [7:1] */
246 __IO uint32_t reserved1 : 24;/* [31:8] */
247 } oaddr2_bit;
248 };
249
253 union
254 {
255 __IO uint32_t dt;
256 struct
257 {
258 __IO uint32_t dt : 8; /* [7:0] */
259 __IO uint32_t reserved1 : 24;/* [31:8] */
260 } dt_bit;
261 };
262
266 union
267 {
268 __IO uint32_t sts1;
269 struct
270 {
271 __IO uint32_t startf : 1; /* [0] */
272 __IO uint32_t addr7f : 1; /* [1] */
273 __IO uint32_t tdc : 1; /* [2] */
274 __IO uint32_t addrhf : 1; /* [3] */
275 __IO uint32_t stopf : 1; /* [4] */
276 __IO uint32_t reserved1 : 1; /* [5] */
277 __IO uint32_t rdbf : 1; /* [6] */
278 __IO uint32_t tdbe : 1; /* [7] */
279 __IO uint32_t buserr : 1; /* [8] */
280 __IO uint32_t arlost : 1; /* [9] */
281 __IO uint32_t ackfail : 1; /* [10] */
282 __IO uint32_t ouf : 1; /* [11] */
283 __IO uint32_t pecerr : 1; /* [12] */
284 __IO uint32_t reserved2 : 1; /* [13] */
285 __IO uint32_t tmout : 1; /* [14] */
286 __IO uint32_t alertf : 1; /* [15] */
287 __IO uint32_t reserved3 : 16; /* [31:16] */
288 } sts1_bit;
289 };
290
294 union
295 {
296 __IO uint32_t sts2;
297 struct
298 {
299 __IO uint32_t trmode : 1; /* [0] */
300 __IO uint32_t busyf : 1; /* [1] */
301 __IO uint32_t dirf : 1; /* [2] */
302 __IO uint32_t reserved1 : 1; /* [3] */
303 __IO uint32_t gcaddrf : 1; /* [4] */
304 __IO uint32_t devaddrf : 1; /* [5] */
305 __IO uint32_t hostaddrf : 1; /* [6] */
306 __IO uint32_t addr2 : 1; /* [7] */
307 __IO uint32_t pecval : 8; /* [15:8] */
308 __IO uint32_t reserved2 : 16;/* [31:16] */
309 } sts2_bit;
310 };
311
315 union
316 {
317 __IO uint32_t clkctrl;
318 struct
319 {
320 __IO uint32_t speed : 12;/* [11:0] */
321 __IO uint32_t reserved1 : 2; /* [13:12] */
322 __IO uint32_t dutymode : 1; /* [14] */
323 __IO uint32_t speedmode : 1; /* [15] */
324 __IO uint32_t reserved2 : 16;/* [31:16] */
325 } clkctrl_bit;
326 };
327
331 union
332 {
333 __IO uint32_t tmrise;
334 struct
335 {
336 __IO uint32_t risetime : 6; /* [5:0] */
337 __IO uint32_t reserved1 : 26;/* [31:6] */
338 } tmrise_bit;
339 };
340
341} i2c_type;
342
347#define I2C1 ((i2c_type *) I2C1_BASE)
348#define I2C2 ((i2c_type *) I2C2_BASE)
349
354void i2c_reset(i2c_type *i2c_x);
355void i2c_software_reset(i2c_type *i2c_x, confirm_state new_state);
356void i2c_init(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed);
357void i2c_own_address1_set(i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address);
358void i2c_own_address2_set(i2c_type *i2c_x, uint8_t address);
359void i2c_own_address2_enable(i2c_type *i2c_x, confirm_state new_state);
360void i2c_smbus_enable(i2c_type *i2c_x, confirm_state new_state);
361void i2c_enable(i2c_type *i2c_x, confirm_state new_state);
362void i2c_fast_mode_duty_set(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty);
363void i2c_clock_stretch_enable(i2c_type *i2c_x, confirm_state new_state);
364void i2c_ack_enable(i2c_type *i2c_x, confirm_state new_state);
365void i2c_master_receive_ack_set(i2c_type *i2c_x, i2c_master_ack_type pos);
366void i2c_pec_position_set(i2c_type *i2c_x, i2c_pec_position_type pos);
367void i2c_general_call_enable(i2c_type *i2c_x, confirm_state new_state);
368void i2c_arp_mode_enable(i2c_type *i2c_x, confirm_state new_state);
369void i2c_smbus_mode_set(i2c_type *i2c_x, i2c_smbus_mode_set_type mode);
370void i2c_smbus_alert_set(i2c_type *i2c_x, i2c_smbus_alert_set_type level);
371void i2c_pec_transmit_enable(i2c_type *i2c_x, confirm_state new_state);
372void i2c_pec_calculate_enable(i2c_type *i2c_x, confirm_state new_state);
373uint8_t i2c_pec_value_get(i2c_type *i2c_x);
374void i2c_dma_end_transfer_set(i2c_type *i2c_x, confirm_state new_state);
375void i2c_dma_enable(i2c_type *i2c_x, confirm_state new_state);
376void i2c_interrupt_enable(i2c_type *i2c_x, uint16_t source, confirm_state new_state);
377void i2c_start_generate(i2c_type *i2c_x);
378void i2c_stop_generate(i2c_type *i2c_x);
379void i2c_7bit_address_send(i2c_type *i2c_x, uint8_t address, i2c_direction_type direction);
380void i2c_data_send(i2c_type *i2c_x, uint8_t data);
381uint8_t i2c_data_receive(i2c_type *i2c_x);
382 flag_status i2c_flag_get(i2c_type *i2c_x, uint32_t flag);
383void i2c_flag_clear(i2c_type *i2c_x, uint32_t flag);
384
397#ifdef __cplusplus
398}
399#endif
400
401#endif
at32f415.h
at32f415 header file
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
i2c_pec_position_set
void i2c_pec_position_set(i2c_type *i2c_x, i2c_pec_position_type pos)
pec position set.
Definition: at32f415_i2c.c:315
i2c_pec_transmit_enable
void i2c_pec_transmit_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable pec transfer.
Definition: at32f415_i2c.c:386
i2c_arp_mode_enable
void i2c_arp_mode_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable arp mode.
Definition: at32f415_i2c.c:341
i2c_data_receive
uint8_t i2c_data_receive(i2c_type *i2c_x)
receive a byte through the i2c periph.
Definition: at32f415_i2c.c:535
i2c_reset
void i2c_reset(i2c_type *i2c_x)
reset the i2c register
Definition: at32f415_i2c.c:51
i2c_smbus_alert_set
void i2c_smbus_alert_set(i2c_type *i2c_x, i2c_smbus_alert_set_type level)
drive the smbus alert pin high or low.
Definition: at32f415_i2c.c:373
i2c_smbus_enable
void i2c_smbus_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable the smbus mode
Definition: at32f415_i2c.c:228
i2c_pec_value_get
uint8_t i2c_pec_value_get(i2c_type *i2c_x)
get pec value.
Definition: at32f415_i2c.c:411
i2c_software_reset
void i2c_software_reset(i2c_type *i2c_x, confirm_state new_state)
software reset.
Definition: at32f415_i2c.c:73
i2c_general_call_enable
void i2c_general_call_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable general call.
Definition: at32f415_i2c.c:328
i2c_ack_enable
void i2c_ack_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable acknowledge.
Definition: at32f415_i2c.c:283
i2c_own_address2_set
void i2c_own_address2_set(i2c_type *i2c_x, uint8_t address)
config own address2.
Definition: at32f415_i2c.c:202
i2c_7bit_address_send
void i2c_7bit_address_send(i2c_type *i2c_x, uint8_t address, i2c_direction_type direction)
transmit the slave address.
Definition: at32f415_i2c.c:503
i2c_dma_end_transfer_set
void i2c_dma_end_transfer_set(i2c_type *i2c_x, confirm_state new_state)
enable or disable if the next dma transfer will be the last one.
Definition: at32f415_i2c.c:424
i2c_own_address2_enable
void i2c_own_address2_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable own address2.
Definition: at32f415_i2c.c:215
i2c_pec_calculate_enable
void i2c_pec_calculate_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable pec calcultetion.
Definition: at32f415_i2c.c:399
i2c_stop_generate
void i2c_stop_generate(i2c_type *i2c_x)
generate stop condition.
Definition: at32f415_i2c.c:486
i2c_own_address1_set
void i2c_own_address1_set(i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address)
config own address1.
Definition: at32f415_i2c.c:185
i2c_enable
void i2c_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable i2c periph
Definition: at32f415_i2c.c:241
i2c_fast_mode_duty_set
void i2c_fast_mode_duty_set(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty)
config fast mode duty cycle
Definition: at32f415_i2c.c:257
i2c_flag_get
flag_status i2c_flag_get(i2c_type *i2c_x, uint32_t flag)
get flag status
Definition: at32f415_i2c.c:570
i2c_smbus_mode_set
void i2c_smbus_mode_set(i2c_type *i2c_x, i2c_smbus_mode_set_type mode)
config smbus host or device.
Definition: at32f415_i2c.c:357
i2c_interrupt_enable
void i2c_interrupt_enable(i2c_type *i2c_x, uint16_t source, confirm_state new_state)
enable or disable interrupt
Definition: at32f415_i2c.c:455
i2c_flag_clear
void i2c_flag_clear(i2c_type *i2c_x, uint32_t flag)
clear flag status
Definition: at32f415_i2c.c:615
i2c_dma_enable
void i2c_dma_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable dma requests.
Definition: at32f415_i2c.c:437
i2c_data_send
void i2c_data_send(i2c_type *i2c_x, uint8_t data)
send a byte through the i2c periph.
Definition: at32f415_i2c.c:523
i2c_clock_stretch_enable
void i2c_clock_stretch_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable clock stretch.
Definition: at32f415_i2c.c:270
i2c_init
void i2c_init(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed)
init i2c speed and duty cycle.
Definition: at32f415_i2c.c:90
i2c_master_receive_ack_set
void i2c_master_receive_ack_set(i2c_type *i2c_x, i2c_master_ack_type pos)
master receiving mode acknowledge control.
Definition: at32f415_i2c.c:299
i2c_start_generate
void i2c_start_generate(i2c_type *i2c_x)
generate start condition.
Definition: at32f415_i2c.c:474
i2c_fsmode_duty_cycle_type
i2c_fsmode_duty_cycle_type
i2c fast mode duty cycle
Definition: at32f415_i2c.h:147
i2c_smbus_mode_set_type
i2c_smbus_mode_set_type
i2c smbus mode set
Definition: at32f415_i2c.h:137
i2c_direction_type
i2c_direction_type
i2c address direction
Definition: at32f415_i2c.h:165
i2c_master_ack_type
i2c_master_ack_type
i2c master receiving mode acknowledge control
Definition: at32f415_i2c.h:109
i2c_address_mode_type
i2c_address_mode_type
i2c address mode
Definition: at32f415_i2c.h:156
i2c_smbus_alert_set_type
i2c_smbus_alert_set_type
i2c smbus alert pin set
Definition: at32f415_i2c.h:128
i2c_pec_position_type
i2c_pec_position_type
i2c pec position set
Definition: at32f415_i2c.h:118
I2C_FSMODE_DUTY_2_1
@ I2C_FSMODE_DUTY_2_1
Definition: at32f415_i2c.h:148
I2C_FSMODE_DUTY_16_9
@ I2C_FSMODE_DUTY_16_9
Definition: at32f415_i2c.h:149
I2C_SMBUS_MODE_HOST
@ I2C_SMBUS_MODE_HOST
Definition: at32f415_i2c.h:139
I2C_SMBUS_MODE_DEVICE
@ I2C_SMBUS_MODE_DEVICE
Definition: at32f415_i2c.h:138
I2C_DIRECTION_RECEIVE
@ I2C_DIRECTION_RECEIVE
Definition: at32f415_i2c.h:167
I2C_DIRECTION_TRANSMIT
@ I2C_DIRECTION_TRANSMIT
Definition: at32f415_i2c.h:166
I2C_MASTER_ACK_CURRENT
@ I2C_MASTER_ACK_CURRENT
Definition: at32f415_i2c.h:110
I2C_MASTER_ACK_NEXT
@ I2C_MASTER_ACK_NEXT
Definition: at32f415_i2c.h:111
I2C_ADDRESS_MODE_7BIT
@ I2C_ADDRESS_MODE_7BIT
Definition: at32f415_i2c.h:157
I2C_ADDRESS_MODE_10BIT
@ I2C_ADDRESS_MODE_10BIT
Definition: at32f415_i2c.h:158
I2C_SMBUS_ALERT_HIGH
@ I2C_SMBUS_ALERT_HIGH
Definition: at32f415_i2c.h:129
I2C_SMBUS_ALERT_LOW
@ I2C_SMBUS_ALERT_LOW
Definition: at32f415_i2c.h:130
I2C_PEC_POSITION_NEXT
@ I2C_PEC_POSITION_NEXT
Definition: at32f415_i2c.h:120
I2C_PEC_POSITION_CURRENT
@ I2C_PEC_POSITION_CURRENT
Definition: at32f415_i2c.h:119
i2c_type
type define i2c register all
Definition: at32f415_i2c.h:174
i2c_type::smbalert
__IO uint32_t smbalert
Definition: at32f415_i2c.h:196
i2c_type::dmaend
__IO uint32_t dmaend
Definition: at32f415_i2c.h:216
i2c_type::genstop
__IO uint32_t genstop
Definition: at32f415_i2c.h:192
i2c_type::tmrise
__IO uint32_t tmrise
Definition: at32f415_i2c.h:333
i2c_type::tdc
__IO uint32_t tdc
Definition: at32f415_i2c.h:273
i2c_type::addr2en
__IO uint32_t addr2en
Definition: at32f415_i2c.h:244
i2c_type::pecerr
__IO uint32_t pecerr
Definition: at32f415_i2c.h:283
i2c_type::dmaen
__IO uint32_t dmaen
Definition: at32f415_i2c.h:215
i2c_type::gcaen
__IO uint32_t gcaen
Definition: at32f415_i2c.h:189
i2c_type::clkfreq
__IO uint32_t clkfreq
Definition: at32f415_i2c.h:211
i2c_type::addr2
__IO uint32_t addr2
Definition: at32f415_i2c.h:245
i2c_type::buserr
__IO uint32_t buserr
Definition: at32f415_i2c.h:279
i2c_type::tmout
__IO uint32_t tmout
Definition: at32f415_i2c.h:285
i2c_type::stopf
__IO uint32_t stopf
Definition: at32f415_i2c.h:275
i2c_type::sts1
__IO uint32_t sts1
Definition: at32f415_i2c.h:268
i2c_type::risetime
__IO uint32_t risetime
Definition: at32f415_i2c.h:336
i2c_type::hostaddrf
__IO uint32_t hostaddrf
Definition: at32f415_i2c.h:305
i2c_type::dirf
__IO uint32_t dirf
Definition: at32f415_i2c.h:301
i2c_type::permode
__IO uint32_t permode
Definition: at32f415_i2c.h:184
i2c_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_i2c.h:185
i2c_type::genstart
__IO uint32_t genstart
Definition: at32f415_i2c.h:191
i2c_type::speedmode
__IO uint32_t speedmode
Definition: at32f415_i2c.h:323
i2c_type::pecten
__IO uint32_t pecten
Definition: at32f415_i2c.h:195
i2c_type::ctrl2
__IO uint32_t ctrl2
Definition: at32f415_i2c.h:208
i2c_type::speed
__IO uint32_t speed
Definition: at32f415_i2c.h:320
i2c_type::trmode
__IO uint32_t trmode
Definition: at32f415_i2c.h:299
i2c_type::ouf
__IO uint32_t ouf
Definition: at32f415_i2c.h:282
i2c_type::arlost
__IO uint32_t arlost
Definition: at32f415_i2c.h:280
i2c_type::stretch
__IO uint32_t stretch
Definition: at32f415_i2c.h:190
i2c_type::dutymode
__IO uint32_t dutymode
Definition: at32f415_i2c.h:322
i2c_type::arpen
__IO uint32_t arpen
Definition: at32f415_i2c.h:187
i2c_type::dataien
__IO uint32_t dataien
Definition: at32f415_i2c.h:214
i2c_type::startf
__IO uint32_t startf
Definition: at32f415_i2c.h:271
i2c_type::addr1mode
__IO uint32_t addr1mode
Definition: at32f415_i2c.h:231
i2c_type::tdbe
__IO uint32_t tdbe
Definition: at32f415_i2c.h:278
i2c_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_i2c.h:197
i2c_type::reserved3
__IO uint32_t reserved3
Definition: at32f415_i2c.h:199
i2c_type::reset
__IO uint32_t reset
Definition: at32f415_i2c.h:198
i2c_type::pecval
__IO uint32_t pecval
Definition: at32f415_i2c.h:307
i2c_type::addrhf
__IO uint32_t addrhf
Definition: at32f415_i2c.h:274
i2c_type::addr7f
__IO uint32_t addr7f
Definition: at32f415_i2c.h:272
i2c_type::dt
__IO uint32_t dt
Definition: at32f415_i2c.h:255
i2c_type::ctrl1
__IO uint32_t ctrl1
Definition: at32f415_i2c.h:180
i2c_type::ackfail
__IO uint32_t ackfail
Definition: at32f415_i2c.h:281
i2c_type::acken
__IO uint32_t acken
Definition: at32f415_i2c.h:193
i2c_type::i2cen
__IO uint32_t i2cen
Definition: at32f415_i2c.h:183
i2c_type::rdbf
__IO uint32_t rdbf
Definition: at32f415_i2c.h:277
i2c_type::busyf
__IO uint32_t busyf
Definition: at32f415_i2c.h:300
i2c_type::oaddr1
__IO uint32_t oaddr1
Definition: at32f415_i2c.h:226
i2c_type::errien
__IO uint32_t errien
Definition: at32f415_i2c.h:212
i2c_type::addr1
__IO uint32_t addr1
Definition: at32f415_i2c.h:229
i2c_type::sts2
__IO uint32_t sts2
Definition: at32f415_i2c.h:296
i2c_type::evtien
__IO uint32_t evtien
Definition: at32f415_i2c.h:213
i2c_type::clkctrl
__IO uint32_t clkctrl
Definition: at32f415_i2c.h:317
i2c_type::mackctrl
__IO uint32_t mackctrl
Definition: at32f415_i2c.h:194
i2c_type::oaddr2
__IO uint32_t oaddr2
Definition: at32f415_i2c.h:241
i2c_type::pecen
__IO uint32_t pecen
Definition: at32f415_i2c.h:188
i2c_type::gcaddrf
__IO uint32_t gcaddrf
Definition: at32f415_i2c.h:303
i2c_type::smbmode
__IO uint32_t smbmode
Definition: at32f415_i2c.h:186
i2c_type::devaddrf
__IO uint32_t devaddrf
Definition: at32f415_i2c.h:304
i2c_type::alertf
__IO uint32_t alertf
Definition: at32f415_i2c.h:286


AT32F415 Firmwary Library: at32f415_misc.c Source File

  • libraries
  • drivers
  • src
at32f415_misc.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_conf.h"
29
39#ifdef MISC_MODULE_ENABLED
40
45#define AIRCR_VECTKEY_MASK ((uint32_t)0x05FA0000)
46
52void nvic_system_reset(void)
53{
54 NVIC_SystemReset();
55}
56
64void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
65{
66 uint32_t temp_priority = 0;
67
68 /* encode priority */
69 temp_priority = NVIC_EncodePriority(NVIC_GetPriorityGrouping(), preempt_priority, sub_priority);
70 /* set priority */
71 NVIC_SetPriority((IRQn_Type)irqn, temp_priority);
72 /* enable irqn */
73 NVIC_EnableIRQ((IRQn_Type)irqn);
74}
75
81void nvic_irq_disable(uint32_t irqn)
82{
83 NVIC_DisableIRQ((IRQn_Type)irqn);
84}
85
97void nvic_priority_group_config(nvic_priority_group_type priority_group)
98{
99 /* set the prigroup[10:8] bits according to nvic_prioritygroup value */
100 NVIC_SetPriorityGrouping(priority_group);
101}
102
112void nvic_vector_table_set(uint32_t base, uint32_t offset)
113{
114 SCB->VTOR = base | (offset & (uint32_t)0x1FFFFF80);
115}
116
127void nvic_lowpower_mode_config(nvic_lowpower_mode_type lp_mode, confirm_state new_state)
128{
129 if(new_state != FALSE)
130 {
131 SCB->SCR |= lp_mode;
132 }
133 else
134 {
135 SCB->SCR &= (uint32_t)(~(uint32_t)lp_mode);
136 }
137}
138
147void systick_clock_source_config(systick_clock_source_type source)
148{
149 if(source == SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV)
150 {
151 SysTick->CTRL |= SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV;
152 }
153 else
154 {
155 SysTick->CTRL &= ~(uint32_t)SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV;
156 }
157}
158
163#endif
164
IRQn_Type
enum IRQn IRQn_Type
at32f415 interrupt number definition, according to the selected device in Library_configuration_secti...
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
FALSE
@ FALSE
Definition: at32f415.h:253
nvic_lowpower_mode_type
nvic_lowpower_mode_type
nvic low power mode
Definition: at32f415_misc.h:78
nvic_priority_group_type
nvic_priority_group_type
nvic interrupt priority group
Definition: at32f415_misc.h:66
systick_clock_source_type
systick_clock_source_type
systick clock source
Definition: at32f415_misc.h:88
SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV
@ SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV
Definition: at32f415_misc.h:90
nvic_lowpower_mode_config
void nvic_lowpower_mode_config(nvic_lowpower_mode_type lp_mode, confirm_state new_state)
config nvic lowpower mode
Definition: at32f415_misc.c:127
nvic_system_reset
void nvic_system_reset(void)
system reset
Definition: at32f415_misc.c:52
nvic_vector_table_set
void nvic_vector_table_set(uint32_t base, uint32_t offset)
set the vector table location and offset.
Definition: at32f415_misc.c:112
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
systick_clock_source_config
void systick_clock_source_config(systick_clock_source_type source)
config systick clock source
Definition: at32f415_misc.c:147
nvic_irq_disable
void nvic_irq_disable(uint32_t irqn)
disable nvic irq number
Definition: at32f415_misc.c:81
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_misc.h Source File

  • libraries
  • drivers
  • inc
at32f415_misc.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_MISC_H
29#define __AT32F415_MISC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
51#define NVIC_VECTTAB_RAM ((uint32_t)0x20000000)
52#define NVIC_VECTTAB_FLASH ((uint32_t)0x08000000)
65typedef enum
66{
67 NVIC_PRIORITY_GROUP_0 = ((uint32_t)0x7),
68 NVIC_PRIORITY_GROUP_1 = ((uint32_t)0x6),
69 NVIC_PRIORITY_GROUP_2 = ((uint32_t)0x5),
70 NVIC_PRIORITY_GROUP_3 = ((uint32_t)0x4),
71 NVIC_PRIORITY_GROUP_4 = ((uint32_t)0x3)
72} nvic_priority_group_type;
73
77typedef enum
78{
79 NVIC_LP_SLEEPONEXIT = 0x02,
80 NVIC_LP_SLEEPDEEP = 0x04,
81 NVIC_LP_SEVONPEND = 0x10
82} nvic_lowpower_mode_type;
83
87typedef enum
88{
89 SYSTICK_CLOCK_SOURCE_AHBCLK_DIV8 = ((uint32_t)0x00000000),
90 SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV = ((uint32_t)0x00000004)
91} systick_clock_source_type;
92
101void nvic_system_reset(void);
102void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority);
103void nvic_irq_disable(uint32_t irqn);
104void nvic_priority_group_config(nvic_priority_group_type priority_group);
105void nvic_vector_table_set(uint32_t base, uint32_t offset);
106void nvic_lowpower_mode_config(nvic_lowpower_mode_type lp_mode, confirm_state new_state);
107void systick_clock_source_config(systick_clock_source_type source);
108
121#ifdef __cplusplus
122}
123#endif
124
125#endif
at32f415.h
at32f415 header file
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
nvic_lowpower_mode_config
void nvic_lowpower_mode_config(nvic_lowpower_mode_type lp_mode, confirm_state new_state)
config nvic lowpower mode
Definition: at32f415_misc.c:127
nvic_system_reset
void nvic_system_reset(void)
system reset
Definition: at32f415_misc.c:52
nvic_vector_table_set
void nvic_vector_table_set(uint32_t base, uint32_t offset)
set the vector table location and offset.
Definition: at32f415_misc.c:112
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
systick_clock_source_config
void systick_clock_source_config(systick_clock_source_type source)
config systick clock source
Definition: at32f415_misc.c:147
nvic_irq_disable
void nvic_irq_disable(uint32_t irqn)
disable nvic irq number
Definition: at32f415_misc.c:81
nvic_lowpower_mode_type
nvic_lowpower_mode_type
nvic low power mode
Definition: at32f415_misc.h:78
nvic_priority_group_type
nvic_priority_group_type
nvic interrupt priority group
Definition: at32f415_misc.h:66
systick_clock_source_type
systick_clock_source_type
systick clock source
Definition: at32f415_misc.h:88
NVIC_LP_SEVONPEND
@ NVIC_LP_SEVONPEND
Definition: at32f415_misc.h:81
NVIC_LP_SLEEPONEXIT
@ NVIC_LP_SLEEPONEXIT
Definition: at32f415_misc.h:79
NVIC_LP_SLEEPDEEP
@ NVIC_LP_SLEEPDEEP
Definition: at32f415_misc.h:80
NVIC_PRIORITY_GROUP_1
@ NVIC_PRIORITY_GROUP_1
Definition: at32f415_misc.h:68
NVIC_PRIORITY_GROUP_3
@ NVIC_PRIORITY_GROUP_3
Definition: at32f415_misc.h:70
NVIC_PRIORITY_GROUP_2
@ NVIC_PRIORITY_GROUP_2
Definition: at32f415_misc.h:69
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
NVIC_PRIORITY_GROUP_0
@ NVIC_PRIORITY_GROUP_0
Definition: at32f415_misc.h:67
SYSTICK_CLOCK_SOURCE_AHBCLK_DIV8
@ SYSTICK_CLOCK_SOURCE_AHBCLK_DIV8
Definition: at32f415_misc.h:89
SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV
@ SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV
Definition: at32f415_misc.h:90


AT32F415 Firmwary Library: at32f415_pwc.c Source File

  • libraries
  • drivers
  • src
at32f415_pwc.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef PWC_MODULE_ENABLED
39
49void pwc_reset(void)
50{
51 crm_periph_reset(CRM_PWC_PERIPH_RESET, TRUE);
52 crm_periph_reset(CRM_PWC_PERIPH_RESET, FALSE);
53}
54
61void pwc_battery_powered_domain_access(confirm_state new_state)
62{
63 PWC->ctrl_bit.bpwen = new_state;
64}
65
79void pwc_pvm_level_select(pwc_pvm_voltage_type pvm_voltage)
80{
81 PWC->ctrl_bit.pvmsel = pvm_voltage;
82}
83
90void pwc_power_voltage_monitor_enable(confirm_state new_state)
91{
92 PWC->ctrl_bit.pvmen = new_state;
93}
94
106void pwc_wakeup_pin_enable(uint32_t pin_num, confirm_state new_state)
107{
108 if(new_state == TRUE)
109 {
110 PWC->ctrlsts |= pin_num;
111 }
112 else
113 {
114 PWC->ctrlsts &= ~pin_num;
115 }
116}
117
127void pwc_flag_clear(uint32_t pwc_flag)
128{
129 if(pwc_flag == PWC_STANDBY_FLAG)
130 PWC->ctrl_bit.clsef = TRUE;
131 if(pwc_flag == PWC_WAKEUP_FLAG)
132 PWC->ctrl_bit.clswef = TRUE;
133}
134
144 flag_status pwc_flag_get(uint32_t pwc_flag)
145{
146 flag_status status = RESET;
147 if ((PWC->ctrlsts & pwc_flag) == RESET)
148 {
149 status = RESET;
150 }
151 else
152 {
153 status = SET;
154 }
155 return status;
156}
157
166void pwc_sleep_mode_enter(pwc_sleep_enter_type pwc_sleep_enter)
167{
168 SCB->SCR &= (uint32_t)~0x4;
169 if(pwc_sleep_enter == PWC_SLEEP_ENTER_WFE)
170 {
171 __SEV();
172 __WFE();
173 __WFE();
174 }
175 else if(pwc_sleep_enter == PWC_SLEEP_ENTER_WFI)
176 {
177 __WFI();
178 }
179}
180
189void pwc_deep_sleep_mode_enter(pwc_deep_sleep_enter_type pwc_deep_sleep_enter)
190{
191 SCB->SCR |= 0x04;
192 if(pwc_deep_sleep_enter == PWC_DEEP_SLEEP_ENTER_WFE)
193 {
194 __SEV();
195 __WFE();
196 __WFE();
197 }
198 else if(pwc_deep_sleep_enter == PWC_DEEP_SLEEP_ENTER_WFI)
199 {
200 __WFI();
201 }
202 SCB->SCR &= (uint32_t)~0x4;
203}
204
213void pwc_voltage_regulate_set(pwc_regulator_type pwc_regulator)
214{
215 PWC->ctrl_bit.vrsel = pwc_regulator;
216}
217
223void pwc_standby_mode_enter(void)
224{
225 PWC->ctrl_bit.clswef = FALSE;
226 PWC->ctrl_bit.lpsel = TRUE;
227 SCB->SCR |= 0x04;
228#if defined (__CC_ARM)
229 __force_stores();
230#endif
231 __WFI();
232}
233
238#endif
239
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
CRM_PWC_PERIPH_RESET
@ CRM_PWC_PERIPH_RESET
Definition: at32f415_crm.h:178
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
pwc_pvm_voltage_type
pwc_pvm_voltage_type
pwc pvm voltage type
Definition: at32f415_pwc.h:73
pwc_regulator_type
pwc_regulator_type
pwc regulator type
Definition: at32f415_pwc.h:105
pwc_deep_sleep_enter_type
pwc_deep_sleep_enter_type
pwc deep sleep enter type
Definition: at32f415_pwc.h:96
pwc_sleep_enter_type
pwc_sleep_enter_type
pwc sleep enter type
Definition: at32f415_pwc.h:87
PWC_DEEP_SLEEP_ENTER_WFI
@ PWC_DEEP_SLEEP_ENTER_WFI
Definition: at32f415_pwc.h:97
PWC_DEEP_SLEEP_ENTER_WFE
@ PWC_DEEP_SLEEP_ENTER_WFE
Definition: at32f415_pwc.h:98
PWC_SLEEP_ENTER_WFI
@ PWC_SLEEP_ENTER_WFI
Definition: at32f415_pwc.h:88
PWC_SLEEP_ENTER_WFE
@ PWC_SLEEP_ENTER_WFE
Definition: at32f415_pwc.h:89
PWC_STANDBY_FLAG
#define PWC_STANDBY_FLAG
Definition: at32f415_pwc.h:53
PWC_WAKEUP_FLAG
#define PWC_WAKEUP_FLAG
Definition: at32f415_pwc.h:52
pwc_battery_powered_domain_access
void pwc_battery_powered_domain_access(confirm_state new_state)
enable or disable access to the battery powered domain.
Definition: at32f415_pwc.c:61
pwc_voltage_regulate_set
void pwc_voltage_regulate_set(pwc_regulator_type pwc_regulator)
regulate low power consumption in the deep sleep mode
Definition: at32f415_pwc.c:213
pwc_standby_mode_enter
void pwc_standby_mode_enter(void)
enter pwc standby mode
Definition: at32f415_pwc.c:223
pwc_power_voltage_monitor_enable
void pwc_power_voltage_monitor_enable(confirm_state new_state)
enable or disable pwc power voltage monitor (pvm)
Definition: at32f415_pwc.c:90
pwc_sleep_mode_enter
void pwc_sleep_mode_enter(pwc_sleep_enter_type pwc_sleep_enter)
enter pwc sleep mode
Definition: at32f415_pwc.c:166
pwc_deep_sleep_mode_enter
void pwc_deep_sleep_mode_enter(pwc_deep_sleep_enter_type pwc_deep_sleep_enter)
enter pwc deep-sleep mode
Definition: at32f415_pwc.c:189
pwc_flag_get
flag_status pwc_flag_get(uint32_t pwc_flag)
get flag of pwc
Definition: at32f415_pwc.c:144
pwc_flag_clear
void pwc_flag_clear(uint32_t pwc_flag)
clear flag of pwc
Definition: at32f415_pwc.c:127
pwc_pvm_level_select
void pwc_pvm_level_select(pwc_pvm_voltage_type pvm_voltage)
select the voltage threshold detected by the power voltage detector.
Definition: at32f415_pwc.c:79
pwc_reset
void pwc_reset(void)
deinitialize the pwc peripheral registers to their default reset values.
Definition: at32f415_pwc.c:49
pwc_wakeup_pin_enable
void pwc_wakeup_pin_enable(uint32_t pin_num, confirm_state new_state)
enable or disable pwc standby wakeup pin
Definition: at32f415_pwc.c:106
PWC
#define PWC
Definition: at32f415_pwc.h:157
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_pwc.h Source File

  • libraries
  • drivers
  • inc
at32f415_pwc.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_PWC_H
29#define __AT32F415_PWC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
52#define PWC_WAKEUP_FLAG ((uint32_t)0x00000001)
53#define PWC_STANDBY_FLAG ((uint32_t)0x00000002)
54#define PWC_PVM_OUTPUT_FLAG ((uint32_t)0x00000004)
63#define PWC_WAKEUP_PIN_1 ((uint32_t)0x00000100)
72typedef enum
73{
74 PWC_PVM_VOLTAGE_2V3 = 0x01,
75 PWC_PVM_VOLTAGE_2V4 = 0x02,
76 PWC_PVM_VOLTAGE_2V5 = 0x03,
77 PWC_PVM_VOLTAGE_2V6 = 0x04,
78 PWC_PVM_VOLTAGE_2V7 = 0x05,
79 PWC_PVM_VOLTAGE_2V8 = 0x06,
80 PWC_PVM_VOLTAGE_2V9 = 0x07
81} pwc_pvm_voltage_type;
82
86typedef enum
87{
88 PWC_SLEEP_ENTER_WFI = 0x00,
89 PWC_SLEEP_ENTER_WFE = 0x01
90} pwc_sleep_enter_type;
91
95typedef enum
96{
97 PWC_DEEP_SLEEP_ENTER_WFI = 0x00,
98 PWC_DEEP_SLEEP_ENTER_WFE = 0x01
99} pwc_deep_sleep_enter_type;
100
104typedef enum
105{
106 PWC_REGULATOR_ON = 0x00,
107 PWC_REGULATOR_LOW_POWER = 0x01
108} pwc_regulator_type;
109
113typedef struct
114{
118 union
119 {
120 __IO uint32_t ctrl;
121 struct
122 {
123 __IO uint32_t vrsel : 1; /* [0] */
124 __IO uint32_t lpsel : 1; /* [1] */
125 __IO uint32_t clswef : 1; /* [2] */
126 __IO uint32_t clsef : 1; /* [3] */
127 __IO uint32_t pvmen : 1; /* [4] */
128 __IO uint32_t pvmsel : 3; /* [7:5] */
129 __IO uint32_t bpwen : 1; /* [8] */
130 __IO uint32_t reserved1 : 23;/* [31:9] */
131 } ctrl_bit;
132 };
133
137 union
138 {
139 __IO uint32_t ctrlsts;
140 struct
141 {
142 __IO uint32_t swef : 1; /* [0] */
143 __IO uint32_t sef : 1; /* [1] */
144 __IO uint32_t pvmof : 1; /* [2] */
145 __IO uint32_t reserved1 : 5; /* [7:3] */
146 __IO uint32_t swpen : 1; /* [8] */
147 __IO uint32_t reserved2 : 23;/* [31:9] */
148 } ctrlsts_bit;
149 };
150
151} pwc_type;
152
157#define PWC ((pwc_type *) PWC_BASE)
158
163void pwc_reset(void);
164void pwc_battery_powered_domain_access(confirm_state new_state);
165void pwc_pvm_level_select(pwc_pvm_voltage_type pvm_voltage);
166void pwc_power_voltage_monitor_enable(confirm_state new_state);
167void pwc_wakeup_pin_enable(uint32_t pin_num, confirm_state new_state);
168void pwc_flag_clear(uint32_t pwc_flag);
169 flag_status pwc_flag_get(uint32_t pwc_flag);
170void pwc_sleep_mode_enter(pwc_sleep_enter_type pwc_sleep_enter);
171void pwc_deep_sleep_mode_enter(pwc_deep_sleep_enter_type pwc_deep_sleep_enter);
172void pwc_voltage_regulate_set(pwc_regulator_type pwc_regulator);
173void pwc_standby_mode_enter(void);
174
187#ifdef __cplusplus
188}
189#endif
190
191#endif
at32f415.h
at32f415 header file
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
pwc_battery_powered_domain_access
void pwc_battery_powered_domain_access(confirm_state new_state)
enable or disable access to the battery powered domain.
Definition: at32f415_pwc.c:61
pwc_voltage_regulate_set
void pwc_voltage_regulate_set(pwc_regulator_type pwc_regulator)
regulate low power consumption in the deep sleep mode
Definition: at32f415_pwc.c:213
pwc_standby_mode_enter
void pwc_standby_mode_enter(void)
enter pwc standby mode
Definition: at32f415_pwc.c:223
pwc_power_voltage_monitor_enable
void pwc_power_voltage_monitor_enable(confirm_state new_state)
enable or disable pwc power voltage monitor (pvm)
Definition: at32f415_pwc.c:90
pwc_sleep_mode_enter
void pwc_sleep_mode_enter(pwc_sleep_enter_type pwc_sleep_enter)
enter pwc sleep mode
Definition: at32f415_pwc.c:166
pwc_deep_sleep_mode_enter
void pwc_deep_sleep_mode_enter(pwc_deep_sleep_enter_type pwc_deep_sleep_enter)
enter pwc deep-sleep mode
Definition: at32f415_pwc.c:189
pwc_flag_get
flag_status pwc_flag_get(uint32_t pwc_flag)
get flag of pwc
Definition: at32f415_pwc.c:144
pwc_flag_clear
void pwc_flag_clear(uint32_t pwc_flag)
clear flag of pwc
Definition: at32f415_pwc.c:127
pwc_pvm_level_select
void pwc_pvm_level_select(pwc_pvm_voltage_type pvm_voltage)
select the voltage threshold detected by the power voltage detector.
Definition: at32f415_pwc.c:79
pwc_reset
void pwc_reset(void)
deinitialize the pwc peripheral registers to their default reset values.
Definition: at32f415_pwc.c:49
pwc_wakeup_pin_enable
void pwc_wakeup_pin_enable(uint32_t pin_num, confirm_state new_state)
enable or disable pwc standby wakeup pin
Definition: at32f415_pwc.c:106
pwc_pvm_voltage_type
pwc_pvm_voltage_type
pwc pvm voltage type
Definition: at32f415_pwc.h:73
pwc_regulator_type
pwc_regulator_type
pwc regulator type
Definition: at32f415_pwc.h:105
pwc_deep_sleep_enter_type
pwc_deep_sleep_enter_type
pwc deep sleep enter type
Definition: at32f415_pwc.h:96
pwc_sleep_enter_type
pwc_sleep_enter_type
pwc sleep enter type
Definition: at32f415_pwc.h:87
PWC_PVM_VOLTAGE_2V7
@ PWC_PVM_VOLTAGE_2V7
Definition: at32f415_pwc.h:78
PWC_PVM_VOLTAGE_2V3
@ PWC_PVM_VOLTAGE_2V3
Definition: at32f415_pwc.h:74
PWC_PVM_VOLTAGE_2V8
@ PWC_PVM_VOLTAGE_2V8
Definition: at32f415_pwc.h:79
PWC_PVM_VOLTAGE_2V4
@ PWC_PVM_VOLTAGE_2V4
Definition: at32f415_pwc.h:75
PWC_PVM_VOLTAGE_2V5
@ PWC_PVM_VOLTAGE_2V5
Definition: at32f415_pwc.h:76
PWC_PVM_VOLTAGE_2V6
@ PWC_PVM_VOLTAGE_2V6
Definition: at32f415_pwc.h:77
PWC_PVM_VOLTAGE_2V9
@ PWC_PVM_VOLTAGE_2V9
Definition: at32f415_pwc.h:80
PWC_REGULATOR_LOW_POWER
@ PWC_REGULATOR_LOW_POWER
Definition: at32f415_pwc.h:107
PWC_REGULATOR_ON
@ PWC_REGULATOR_ON
Definition: at32f415_pwc.h:106
PWC_DEEP_SLEEP_ENTER_WFI
@ PWC_DEEP_SLEEP_ENTER_WFI
Definition: at32f415_pwc.h:97
PWC_DEEP_SLEEP_ENTER_WFE
@ PWC_DEEP_SLEEP_ENTER_WFE
Definition: at32f415_pwc.h:98
PWC_SLEEP_ENTER_WFI
@ PWC_SLEEP_ENTER_WFI
Definition: at32f415_pwc.h:88
PWC_SLEEP_ENTER_WFE
@ PWC_SLEEP_ENTER_WFE
Definition: at32f415_pwc.h:89
pwc_type
type define pwc register all
Definition: at32f415_pwc.h:114
pwc_type::bpwen
__IO uint32_t bpwen
Definition: at32f415_pwc.h:129
pwc_type::clswef
__IO uint32_t clswef
Definition: at32f415_pwc.h:125
pwc_type::pvmof
__IO uint32_t pvmof
Definition: at32f415_pwc.h:144
pwc_type::lpsel
__IO uint32_t lpsel
Definition: at32f415_pwc.h:124
pwc_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_pwc.h:130
pwc_type::vrsel
__IO uint32_t vrsel
Definition: at32f415_pwc.h:123
pwc_type::pvmen
__IO uint32_t pvmen
Definition: at32f415_pwc.h:127
pwc_type::ctrl
__IO uint32_t ctrl
Definition: at32f415_pwc.h:120
pwc_type::swef
__IO uint32_t swef
Definition: at32f415_pwc.h:142
pwc_type::clsef
__IO uint32_t clsef
Definition: at32f415_pwc.h:126
pwc_type::ctrlsts
__IO uint32_t ctrlsts
Definition: at32f415_pwc.h:139
pwc_type::sef
__IO uint32_t sef
Definition: at32f415_pwc.h:143
pwc_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_pwc.h:147
pwc_type::swpen
__IO uint32_t swpen
Definition: at32f415_pwc.h:146
pwc_type::pvmsel
__IO uint32_t pvmsel
Definition: at32f415_pwc.h:128


AT32F415 Firmwary Library: at32f415_sdio.c Source File

  • libraries
  • drivers
  • src
at32f415_sdio.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef SDIO_MODULE_ENABLED
39
51void sdio_reset(sdio_type *sdio_x)
52{
53 sdio_x->pwrctrl = 0x0;
54 sdio_x->clkctrl = 0x0;
55 sdio_x->argu = 0x0;
56 sdio_x->cmdctrl = 0x0;
57 sdio_x->dttmr = 0x0;
58 sdio_x->dtlen = 0x0;
59 sdio_x->dtctrl = 0x0;
60 sdio_x->inten = 0x0;
61 sdio_x->intclr = 0x004007FF;
62}
63
75void sdio_power_set(sdio_type *sdio_x, sdio_power_state_type power_state)
76{
77 sdio_x->pwrctrl_bit.ps = power_state;
78}
79
87 flag_status sdio_power_status_get(sdio_type *sdio_x)
88{
89 flag_status flag = RESET;
90
91 if(sdio_x->pwrctrl_bit.ps == SDIO_POWER_ON)
92 {
93 flag = SET;
94 }
95 else if(sdio_x->pwrctrl_bit.ps == SDIO_POWER_OFF)
96 {
97 flag = RESET;
98 }
99
100 return flag;
101}
102
115void sdio_clock_config(sdio_type *sdio_x, uint16_t clk_div, sdio_edge_phase_type clk_edg)
116{
117 /* config clock edge */
118 sdio_x->clkctrl_bit.clkegs = clk_edg;
119
120 /* config clock divide [7:0] */
121 sdio_x->clkctrl_bit.clkdiv_l = (clk_div & 0xFF);
122
123 /* config clock divide [9:8] */
124 sdio_x->clkctrl_bit.clkdiv_h = ((clk_div & 0x300) >> 8);
125}
126
139void sdio_bus_width_config(sdio_type *sdio_x, sdio_bus_width_type width)
140{
141 sdio_x->clkctrl_bit.busws = width;
142}
143
152void sdio_clock_bypass(sdio_type *sdio_x, confirm_state new_state)
153{
154 sdio_x->clkctrl_bit.bypsen = new_state;
155}
156
166void sdio_power_saving_mode_enable(sdio_type *sdio_x, confirm_state new_state)
167{
168 sdio_x->clkctrl_bit.pwrsven = new_state;
169}
170
179void sdio_flow_control_enable(sdio_type *sdio_x, confirm_state new_state)
180{
181 sdio_x->clkctrl_bit.hfcen = new_state;
182}
183
192void sdio_clock_enable(sdio_type *sdio_x, confirm_state new_state)
193{
194 sdio_x->clkctrl_bit.clkoen = new_state;
195}
196
205void sdio_dma_enable(sdio_type *sdio_x, confirm_state new_state)
206{
207 sdio_x->dtctrl_bit.dmaen = new_state;
208}
209
243void sdio_interrupt_enable(sdio_type *sdio_x, uint32_t int_opt, confirm_state new_state)
244{
245 /* enable interrupt */
246 if(TRUE == new_state)
247 {
248 sdio_x->inten |= int_opt;
249 }
250 /* disable interrupt */
251 else
252 {
253 sdio_x->inten &= ~(int_opt);
254 }
255}
256
289 flag_status sdio_flag_get(sdio_type *sdio_x, uint32_t flag)
290{
291 flag_status status = RESET;
292
293 if((sdio_x->sts & flag) == flag)
294 {
295 status = SET;
296 }
297 else
298 {
299 status = RESET;
300 }
301
302 return status;
303}
304
326void sdio_flag_clear(sdio_type *sdio_x, uint32_t flag)
327{
328 sdio_x->intclr = flag;
329}
330
340void sdio_command_config(sdio_type *sdio_x, sdio_command_struct_type *command_struct)
341{
342 /* disable command path state machine */
343 sdio_x->cmdctrl_bit.ccsmen = FALSE;
344
345 /* config command argument */
346 sdio_x->argu = command_struct->argument;
347
348 /* config command register */
349 sdio_x->cmdctrl_bit.cmdidx = command_struct->cmd_index;
350 sdio_x->cmdctrl_bit.rspwt = command_struct->rsp_type;
351 sdio_x->cmdctrl_bit.intwt = (command_struct->wait_type & 0x1); /* [1:0] -> [0] */
352 sdio_x->cmdctrl_bit.pndwt = (command_struct->wait_type & 0x2)>>1; /* [1:0] -> [1] */
353}
354
363void sdio_command_state_machine_enable(sdio_type *sdio_x, confirm_state new_state)
364{
365 sdio_x->cmdctrl_bit.ccsmen = new_state;
366}
367
376uint8_t sdio_command_response_get(sdio_type *sdio_x)
377{
378 return sdio_x->rspcmd_bit.rspcmd;
379}
380
394uint32_t sdio_response_get(sdio_type *sdio_x, sdio_rsp_index_type reg_index)
395{
396 uint32_t response_value = 0;
397
398 switch(reg_index)
399 {
400 case SDIO_RSP1_INDEX:
401 response_value = sdio_x->rsp1;
402 break;
403 case SDIO_RSP2_INDEX:
404 response_value = sdio_x->rsp2;
405 break;
406 case SDIO_RSP3_INDEX:
407 response_value = sdio_x->rsp3;
408 break;
409 case SDIO_RSP4_INDEX:
410 response_value = sdio_x->rsp4;
411 break;
412 default: break;
413 }
414
415 return response_value;
416}
417
427void sdio_data_config(sdio_type *sdio_x, sdio_data_struct_type *data_struct)
428{
429 /* disable data path state machine */
430 sdio_x->dtctrl_bit.tfren = FALSE;
431
432 /* config data block, transfer mode and transfer direction */
433 sdio_x->dtctrl_bit.blksize = data_struct->block_size;
434 sdio_x->dtctrl_bit.tfrdir = data_struct->transfer_direction;
435 sdio_x->dtctrl_bit.tfrmode = data_struct->transfer_mode;
436
437 /* config data length */
438 sdio_x->dtlen_bit.dtlen = data_struct->data_length;
439
440 /* config data transfer timeout */
441 sdio_x->dttmr_bit.timeout = data_struct->timeout;
442}
443
452void sdio_data_state_machine_enable(sdio_type *sdio_x, confirm_state new_state)
453{
454 sdio_x->dtctrl_bit.tfren = new_state;
455}
456
464uint32_t sdio_data_counter_get(sdio_type *sdio_x)
465{
466 return sdio_x->dtcnt;
467}
468
476uint32_t sdio_data_read(sdio_type *sdio_x)
477{
478 return sdio_x->buf;
479}
480
488uint32_t sdio_buffer_counter_get(sdio_type *sdio_x)
489{
490 return sdio_x->bufcnt;
491}
492
501void sdio_data_write(sdio_type *sdio_x, uint32_t data)
502{
503 sdio_x->buf = data;
504}
505
517void sdio_read_wait_mode_set(sdio_type *sdio_x, sdio_read_wait_mode_type mode)
518{
519 sdio_x->dtctrl_bit.rdwtmode = mode;
520}
521
530void sdio_read_wait_start(sdio_type *sdio_x, confirm_state new_state)
531{
532 sdio_x->dtctrl_bit.rdwtstart = new_state;
533}
534
543void sdio_read_wait_stop(sdio_type *sdio_x, confirm_state new_state)
544{
545 sdio_x->dtctrl_bit.rdwtstop = new_state;
546}
547
556void sdio_io_function_enable(sdio_type *sdio_x, confirm_state new_state)
557{
558 sdio_x->dtctrl_bit.ioen = new_state;
559}
560
569void sdio_io_suspend_command_set(sdio_type *sdio_x, confirm_state new_state)
570{
571 sdio_x->cmdctrl_bit.iosusp = new_state;
572}
573
578#endif
579
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
sdio_read_wait_mode_type
sdio_read_wait_mode_type
sdio read wait mode
Definition: at32f415_sdio.h:220
sdio_edge_phase_type
sdio_edge_phase_type
sdio edge phase
Definition: at32f415_sdio.h:130
sdio_power_state_type
sdio_power_state_type
sdio power state
Definition: at32f415_sdio.h:121
sdio_bus_width_type
sdio_bus_width_type
sdio bus width
Definition: at32f415_sdio.h:139
sdio_rsp_index_type
sdio_rsp_index_type
sdio response register index
Definition: at32f415_sdio.h:169
SDIO_POWER_OFF
@ SDIO_POWER_OFF
Definition: at32f415_sdio.h:122
SDIO_POWER_ON
@ SDIO_POWER_ON
Definition: at32f415_sdio.h:123
SDIO_RSP3_INDEX
@ SDIO_RSP3_INDEX
Definition: at32f415_sdio.h:172
SDIO_RSP2_INDEX
@ SDIO_RSP2_INDEX
Definition: at32f415_sdio.h:171
SDIO_RSP4_INDEX
@ SDIO_RSP4_INDEX
Definition: at32f415_sdio.h:173
SDIO_RSP1_INDEX
@ SDIO_RSP1_INDEX
Definition: at32f415_sdio.h:170
sdio_command_config
void sdio_command_config(sdio_type *sdio_x, sdio_command_struct_type *command_struct)
config sdio command.
Definition: at32f415_sdio.c:340
sdio_data_write
void sdio_data_write(sdio_type *sdio_x, uint32_t data)
write one word data to fifo.
Definition: at32f415_sdio.c:501
sdio_io_suspend_command_set
void sdio_io_suspend_command_set(sdio_type *sdio_x, confirm_state new_state)
enable or disable sd i/o suspend command sending.
Definition: at32f415_sdio.c:569
sdio_data_config
void sdio_data_config(sdio_type *sdio_x, sdio_data_struct_type *data_struct)
config sdio data.
Definition: at32f415_sdio.c:427
sdio_data_read
uint32_t sdio_data_read(sdio_type *sdio_x)
read a word data from sdio fifo.
Definition: at32f415_sdio.c:476
sdio_power_status_get
flag_status sdio_power_status_get(sdio_type *sdio_x)
get power status.
Definition: at32f415_sdio.c:87
sdio_io_function_enable
void sdio_io_function_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable the sd i/o function.
Definition: at32f415_sdio.c:556
sdio_command_state_machine_enable
void sdio_command_state_machine_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable command path state machine(CPSM).
Definition: at32f415_sdio.c:363
sdio_clock_bypass
void sdio_clock_bypass(sdio_type *sdio_x, confirm_state new_state)
enable or disable clock divider bypss
Definition: at32f415_sdio.c:152
sdio_flow_control_enable
void sdio_flow_control_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable hardware flow control.
Definition: at32f415_sdio.c:179
sdio_power_set
void sdio_power_set(sdio_type *sdio_x, sdio_power_state_type power_state)
set the power status of the controller
Definition: at32f415_sdio.c:75
sdio_clock_config
void sdio_clock_config(sdio_type *sdio_x, uint16_t clk_div, sdio_edge_phase_type clk_edg)
config sdio clock
Definition: at32f415_sdio.c:115
sdio_bus_width_config
void sdio_bus_width_config(sdio_type *sdio_x, sdio_bus_width_type width)
config sdio bus width
Definition: at32f415_sdio.c:139
sdio_read_wait_stop
void sdio_read_wait_stop(sdio_type *sdio_x, confirm_state new_state)
enable or disable to stop sd i/o read wait operation.
Definition: at32f415_sdio.c:543
sdio_interrupt_enable
void sdio_interrupt_enable(sdio_type *sdio_x, uint32_t int_opt, confirm_state new_state)
config corresponding interrupt.
Definition: at32f415_sdio.c:243
sdio_flag_clear
void sdio_flag_clear(sdio_type *sdio_x, uint32_t flag)
clear sdio flag.
Definition: at32f415_sdio.c:326
sdio_response_get
uint32_t sdio_response_get(sdio_type *sdio_x, sdio_rsp_index_type reg_index)
get response received from the card for the last command.
Definition: at32f415_sdio.c:394
sdio_data_state_machine_enable
void sdio_data_state_machine_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable data path state machine(DPSM).
Definition: at32f415_sdio.c:452
sdio_power_saving_mode_enable
void sdio_power_saving_mode_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable power saving mode, config sdio_ck clock output when the bus is idle.
Definition: at32f415_sdio.c:166
sdio_flag_get
flag_status sdio_flag_get(sdio_type *sdio_x, uint32_t flag)
get sdio flag.
Definition: at32f415_sdio.c:289
sdio_dma_enable
void sdio_dma_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable dma.
Definition: at32f415_sdio.c:205
sdio_data_counter_get
uint32_t sdio_data_counter_get(sdio_type *sdio_x)
get the number of remaining data bytes to be transferred.
Definition: at32f415_sdio.c:464
sdio_buffer_counter_get
uint32_t sdio_buffer_counter_get(sdio_type *sdio_x)
get the number of words left to be written to or read from fifo..
Definition: at32f415_sdio.c:488
sdio_read_wait_start
void sdio_read_wait_start(sdio_type *sdio_x, confirm_state new_state)
enable or disable to start sd i/o read wait operation.
Definition: at32f415_sdio.c:530
sdio_reset
void sdio_reset(sdio_type *sdio_x)
reset the sdio register
Definition: at32f415_sdio.c:51
sdio_read_wait_mode_set
void sdio_read_wait_mode_set(sdio_type *sdio_x, sdio_read_wait_mode_type mode)
set the read wait mode.
Definition: at32f415_sdio.c:517
sdio_clock_enable
void sdio_clock_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable sdio_ck output.
Definition: at32f415_sdio.c:192
sdio_command_response_get
uint8_t sdio_command_response_get(sdio_type *sdio_x)
get command index of last command for which response received.
Definition: at32f415_sdio.c:376
sdio_command_struct_type
sdio command structure
Definition: at32f415_sdio.h:229
sdio_command_struct_type::cmd_index
uint8_t cmd_index
Definition: at32f415_sdio.h:231
sdio_command_struct_type::argument
uint32_t argument
Definition: at32f415_sdio.h:230
sdio_command_struct_type::wait_type
sdio_wait_type wait_type
Definition: at32f415_sdio.h:233
sdio_command_struct_type::rsp_type
sdio_reponse_type rsp_type
Definition: at32f415_sdio.h:232
sdio_data_struct_type
sdio data structure
Definition: at32f415_sdio.h:240
sdio_data_struct_type::block_size
sdio_block_size_type block_size
Definition: at32f415_sdio.h:243
sdio_data_struct_type::transfer_direction
sdio_transfer_direction_type transfer_direction
Definition: at32f415_sdio.h:245
sdio_data_struct_type::timeout
uint32_t timeout
Definition: at32f415_sdio.h:241
sdio_data_struct_type::transfer_mode
sdio_transfer_mode_type transfer_mode
Definition: at32f415_sdio.h:244
sdio_data_struct_type::data_length
uint32_t data_length
Definition: at32f415_sdio.h:242
sdio_type
type define sdio register all
Definition: at32f415_sdio.h:252
sdio_type::ps
__IO uint32_t ps
Definition: at32f415_sdio.h:261
sdio_type::dtlen
__IO uint32_t dtlen
Definition: at32f415_sdio.h:394
sdio_type::intclr
__IO uint32_t intclr
Definition: at32f415_sdio.h:476
sdio_type::rdwtstart
__IO uint32_t rdwtstart
Definition: at32f415_sdio.h:415
sdio_type::rdwtstop
__IO uint32_t rdwtstop
Definition: at32f415_sdio.h:416
sdio_type::rspwt
__IO uint32_t rspwt
Definition: at32f415_sdio.h:307
sdio_type::hfcen
__IO uint32_t hfcen
Definition: at32f415_sdio.h:280
sdio_type::cmdctrl_bit
struct sdio_type::@517::@550 cmdctrl_bit
sdio_type::tfrmode
__IO uint32_t tfrmode
Definition: at32f415_sdio.h:412
sdio_type::clkegs
__IO uint32_t clkegs
Definition: at32f415_sdio.h:279
sdio_type::dtctrl_bit
struct sdio_type::@533::@558 dtctrl_bit
sdio_type::tfrdir
__IO uint32_t tfrdir
Definition: at32f415_sdio.h:411
sdio_type::tfren
__IO uint32_t tfren
Definition: at32f415_sdio.h:410
sdio_type::dttmr
__IO uint32_t dttmr
Definition: at32f415_sdio.h:382
sdio_type::dtlen_bit
struct sdio_type::@531::@557 dtlen_bit
sdio_type::inten
__IO uint32_t inten
Definition: at32f415_sdio.h:501
sdio_type::pndwt
__IO uint32_t pndwt
Definition: at32f415_sdio.h:309
sdio_type::cmdctrl
__IO uint32_t cmdctrl
Definition: at32f415_sdio.h:303
sdio_type::clkoen
__IO uint32_t clkoen
Definition: at32f415_sdio.h:275
sdio_type::ioen
__IO uint32_t ioen
Definition: at32f415_sdio.h:418
sdio_type::bufcnt
__IO uint32_t bufcnt
Definition: at32f415_sdio.h:541
sdio_type::intwt
__IO uint32_t intwt
Definition: at32f415_sdio.h:308
sdio_type::rsp2
__IO uint32_t rsp2
Definition: at32f415_sdio.h:346
sdio_type::dtctrl
__IO uint32_t dtctrl
Definition: at32f415_sdio.h:407
sdio_type::ccsmen
__IO uint32_t ccsmen
Definition: at32f415_sdio.h:310
sdio_type::pwrsven
__IO uint32_t pwrsven
Definition: at32f415_sdio.h:276
sdio_type::cmdidx
__IO uint32_t cmdidx
Definition: at32f415_sdio.h:306
sdio_type::pwrctrl
__IO uint32_t pwrctrl
Definition: at32f415_sdio.h:258
sdio_type::dmaen
__IO uint32_t dmaen
Definition: at32f415_sdio.h:413
sdio_type::dttmr_bit
struct sdio_type::@529::@556 dttmr_bit
sdio_type::sts
__IO uint32_t sts
Definition: at32f415_sdio.h:441
sdio_type::blksize
__IO uint32_t blksize
Definition: at32f415_sdio.h:414
sdio_type::rdwtmode
__IO uint32_t rdwtmode
Definition: at32f415_sdio.h:417
sdio_type::rsp1
__IO uint32_t rsp1
Definition: at32f415_sdio.h:334
sdio_type::pwrctrl_bit
struct sdio_type::@511::@547 pwrctrl_bit
sdio_type::rsp4
__IO uint32_t rsp4
Definition: at32f415_sdio.h:370
sdio_type::bypsen
__IO uint32_t bypsen
Definition: at32f415_sdio.h:277
sdio_type::buf
__IO uint32_t buf
Definition: at32f415_sdio.h:559
sdio_type::clkdiv_l
__IO uint32_t clkdiv_l
Definition: at32f415_sdio.h:274
sdio_type::rspcmd_bit
struct sdio_type::@519::@551 rspcmd_bit
sdio_type::rspcmd
__IO uint32_t rspcmd
Definition: at32f415_sdio.h:321
sdio_type::argu
__IO uint32_t argu
Definition: at32f415_sdio.h:291
sdio_type::timeout
__IO uint32_t timeout
Definition: at32f415_sdio.h:385
sdio_type::busws
__IO uint32_t busws
Definition: at32f415_sdio.h:278
sdio_type::dtcnt
__IO uint32_t dtcnt
Definition: at32f415_sdio.h:428
sdio_type::clkdiv_h
__IO uint32_t clkdiv_h
Definition: at32f415_sdio.h:281
sdio_type::iosusp
__IO uint32_t iosusp
Definition: at32f415_sdio.h:311
sdio_type::clkctrl
__IO uint32_t clkctrl
Definition: at32f415_sdio.h:271
sdio_type::rsp3
__IO uint32_t rsp3
Definition: at32f415_sdio.h:358
sdio_type::clkctrl_bit
struct sdio_type::@513::@548 clkctrl_bit
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_sdio.h Source File

  • libraries
  • drivers
  • inc
at32f415_sdio.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_SDIO_H
29#define __AT32F415_SDIO_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
52#define SDIO_CMDFAIL_INT ((uint32_t)0x00000001)
53#define SDIO_DTFAIL_INT ((uint32_t)0x00000002)
54#define SDIO_CMDTIMEOUT_INT ((uint32_t)0x00000004)
55#define SDIO_DTTIMEOUT_INT ((uint32_t)0x00000008)
56#define SDIO_TXERRU_INT ((uint32_t)0x00000010)
57#define SDIO_RXERRO_INT ((uint32_t)0x00000020)
58#define SDIO_CMDRSPCMPL_INT ((uint32_t)0x00000040)
59#define SDIO_CMDCMPL_INT ((uint32_t)0x00000080)
60#define SDIO_DTCMP_INT ((uint32_t)0x00000100)
61#define SDIO_SBITERR_INT ((uint32_t)0x00000200)
62#define SDIO_DTBLKCMPL_INT ((uint32_t)0x00000400)
63#define SDIO_DOCMD_INT ((uint32_t)0x00000800)
64#define SDIO_DOTX_INT ((uint32_t)0x00001000)
65#define SDIO_DORX_INT ((uint32_t)0x00002000)
66#define SDIO_TXBUFH_INT ((uint32_t)0x00004000)
67#define SDIO_RXBUFH_INT ((uint32_t)0x00008000)
68#define SDIO_TXBUFF_INT ((uint32_t)0x00010000)
69#define SDIO_RXBUFF_INT ((uint32_t)0x00020000)
70#define SDIO_TXBUFE_INT ((uint32_t)0x00040000)
71#define SDIO_RXBUFE_INT ((uint32_t)0x00080000)
72#define SDIO_TXBUF_INT ((uint32_t)0x00100000)
73#define SDIO_RXBUF_INT ((uint32_t)0x00200000)
74#define SDIO_SDIOIF_INT ((uint32_t)0x00400000)
85#define SDIO_CMDFAIL_FLAG ((uint32_t)0x00000001)
86#define SDIO_DTFAIL_FLAG ((uint32_t)0x00000002)
87#define SDIO_CMDTIMEOUT_FLAG ((uint32_t)0x00000004)
88#define SDIO_DTTIMEOUT_FLAG ((uint32_t)0x00000008)
89#define SDIO_TXERRU_FLAG ((uint32_t)0x00000010)
90#define SDIO_RXERRO_FLAG ((uint32_t)0x00000020)
91#define SDIO_CMDRSPCMPL_FLAG ((uint32_t)0x00000040)
92#define SDIO_CMDCMPL_FLAG ((uint32_t)0x00000080)
93#define SDIO_DTCMPL_FLAG ((uint32_t)0x00000100)
94#define SDIO_SBITERR_FLAG ((uint32_t)0x00000200)
95#define SDIO_DTBLKCMPL_FLAG ((uint32_t)0x00000400)
96#define SDIO_DOCMD_FLAG ((uint32_t)0x00000800)
97#define SDIO_DOTX_FLAG ((uint32_t)0x00001000)
98#define SDIO_DORX_FLAG ((uint32_t)0x00002000)
99#define SDIO_TXBUFH_FLAG ((uint32_t)0x00004000)
100#define SDIO_RXBUFH_FLAG ((uint32_t)0x00008000)
101#define SDIO_TXBUFF_FLAG ((uint32_t)0x00010000)
102#define SDIO_RXBUFF_FLAG ((uint32_t)0x00020000)
103#define SDIO_TXBUFE_FLAG ((uint32_t)0x00040000)
104#define SDIO_RXBUFE_FLAG ((uint32_t)0x00080000)
105#define SDIO_TXBUF_FLAG ((uint32_t)0x00100000)
106#define SDIO_RXBUF_FLAG ((uint32_t)0x00200000)
107#define SDIO_SDIOIF_FLAG ((uint32_t)0x00400000)
120typedef enum
121{
122 SDIO_POWER_OFF = 0x00,
123 SDIO_POWER_ON = 0x03
124} sdio_power_state_type;
125
129typedef enum
130{
131 SDIO_CLOCK_EDGE_RISING = 0x00,
132 SDIO_CLOCK_EDGE_FALLING = 0x01
133} sdio_edge_phase_type;
134
138typedef enum
139{
140 SDIO_BUS_WIDTH_D1 = 0x00,
141 SDIO_BUS_WIDTH_D4 = 0x01,
142 SDIO_BUS_WIDTH_D8 = 0x02
143} sdio_bus_width_type;
144
148typedef enum
149{
150 SDIO_RESPONSE_NO = 0x00,
151 SDIO_RESPONSE_SHORT = 0x01,
152 SDIO_RESPONSE_LONG = 0x03
153} sdio_reponse_type;
154
158typedef enum
159{
160 SDIO_WAIT_FOR_NO = 0x00,
161 SDIO_WAIT_FOR_INT = 0x01,
162 SDIO_WAIT_FOR_PEND = 0x02
163} sdio_wait_type;
164
168typedef enum
169{
170 SDIO_RSP1_INDEX = 0x00,
171 SDIO_RSP2_INDEX = 0x01,
172 SDIO_RSP3_INDEX = 0x02,
173 SDIO_RSP4_INDEX = 0x03
174} sdio_rsp_index_type;
175
179typedef enum
180{
181 SDIO_DATA_BLOCK_SIZE_1B = 0x00,
182 SDIO_DATA_BLOCK_SIZE_2B = 0x01,
183 SDIO_DATA_BLOCK_SIZE_4B = 0x02,
184 SDIO_DATA_BLOCK_SIZE_8B = 0x03,
185 SDIO_DATA_BLOCK_SIZE_16B = 0x04,
186 SDIO_DATA_BLOCK_SIZE_32B = 0x05,
187 SDIO_DATA_BLOCK_SIZE_64B = 0x06,
188 SDIO_DATA_BLOCK_SIZE_128B = 0x07,
189 SDIO_DATA_BLOCK_SIZE_256B = 0x08,
190 SDIO_DATA_BLOCK_SIZE_512B = 0x09,
191 SDIO_DATA_BLOCK_SIZE_1024B = 0x0A,
192 SDIO_DATA_BLOCK_SIZE_2048B = 0x0B,
193 SDIO_DATA_BLOCK_SIZE_4096B = 0x0C,
194 SDIO_DATA_BLOCK_SIZE_8192B = 0x0D,
195 SDIO_DATA_BLOCK_SIZE_16384B = 0x0E
196} sdio_block_size_type;
197
201typedef enum
202{
203 SDIO_DATA_BLOCK_TRANSFER = 0x00,
204 SDIO_DATA_STREAM_TRANSFER = 0x01
205} sdio_transfer_mode_type;
206
210typedef enum
211{
212 SDIO_DATA_TRANSFER_TO_CARD = 0x00,
213 SDIO_DATA_TRANSFER_TO_CONTROLLER = 0x01
214} sdio_transfer_direction_type;
215
219typedef enum
220{
221 SDIO_READ_WAIT_CONTROLLED_BY_D2 = 0x00,
222 SDIO_READ_WAIT_CONTROLLED_BY_CK = 0x01
223} sdio_read_wait_mode_type;
224
228typedef struct
229{
230 uint32_t argument;
231 uint8_t cmd_index;
232 sdio_reponse_type rsp_type;
233 sdio_wait_type wait_type;
234} sdio_command_struct_type;
235
239typedef struct
240{
241 uint32_t timeout;
242 uint32_t data_length;
243 sdio_block_size_type block_size;
244 sdio_transfer_mode_type transfer_mode;
245 sdio_transfer_direction_type transfer_direction;
246} sdio_data_struct_type;
247
251typedef struct
252{
256 union
257 {
258 __IO uint32_t pwrctrl;
259 struct
260 {
261 __IO uint32_t ps : 2; /* [1:0] */
262 __IO uint32_t reserved1 : 30;/* [31:2] */
263 } pwrctrl_bit;
264 };
265
269 union
270 {
271 __IO uint32_t clkctrl;
272 struct
273 {
274 __IO uint32_t clkdiv_l : 8; /* [7:0] */
275 __IO uint32_t clkoen : 1; /* [8] */
276 __IO uint32_t pwrsven : 1; /* [9] */
277 __IO uint32_t bypsen : 1; /* [10] */
278 __IO uint32_t busws : 2; /* [12:11] */
279 __IO uint32_t clkegs : 1; /* [13] */
280 __IO uint32_t hfcen : 1; /* [14] */
281 __IO uint32_t clkdiv_h : 2; /* [16:15] */
282 __IO uint32_t reserved1 : 15;/* [31:17] */
283 } clkctrl_bit;
284 };
285
289 union
290 {
291 __IO uint32_t argu;
292 struct
293 {
294 __IO uint32_t argu : 32;/* [31:0] */
295 } argu_bit;
296 };
297
301 union
302 {
303 __IO uint32_t cmdctrl;
304 struct
305 {
306 __IO uint32_t cmdidx : 6; /* [5:0] */
307 __IO uint32_t rspwt : 2; /* [7:6] */
308 __IO uint32_t intwt : 1; /* [8] */
309 __IO uint32_t pndwt : 1; /* [9] */
310 __IO uint32_t ccsmen : 1; /* [10] */
311 __IO uint32_t iosusp : 1; /* [11] */
312 __IO uint32_t reserved1 : 20;/* [31:12] */
313 } cmdctrl_bit;
314 };
315
319 union
320 {
321 __IO uint32_t rspcmd;
322 struct
323 {
324 __IO uint32_t rspcmd : 6; /* [5:0] */
325 __IO uint32_t reserved1 : 26;/* [31:6] */
326 } rspcmd_bit;
327 };
328
332 union
333 {
334 __IO uint32_t rsp1;
335 struct
336 {
337 __IO uint32_t cardsts1 : 32;/* [31:0] */
338 } rsp1_bit;
339 };
340
344 union
345 {
346 __IO uint32_t rsp2;
347 struct
348 {
349 __IO uint32_t cardsts2 : 32;/* [31:0] */
350 } rsp2_bit;
351 };
352
356 union
357 {
358 __IO uint32_t rsp3;
359 struct
360 {
361 __IO uint32_t cardsts3 : 32;/* [31:0] */
362 } rsp3_bit;
363 };
364
368 union
369 {
370 __IO uint32_t rsp4;
371 struct
372 {
373 __IO uint32_t cardsts4 : 32;/* [31:0] */
374 } rsp4_bit;
375 };
376
380 union
381 {
382 __IO uint32_t dttmr;
383 struct
384 {
385 __IO uint32_t timeout : 32;/* [31:0] */
386 } dttmr_bit;
387 };
388
392 union
393 {
394 __IO uint32_t dtlen;
395 struct
396 {
397 __IO uint32_t dtlen : 25;/* [24:0] */
398 __IO uint32_t reserved1 : 7; /* [31:25] */
399 } dtlen_bit;
400 };
401
405 union
406 {
407 __IO uint32_t dtctrl;
408 struct
409 {
410 __IO uint32_t tfren : 1; /* [0] */
411 __IO uint32_t tfrdir : 1; /* [1] */
412 __IO uint32_t tfrmode : 1; /* [2] */
413 __IO uint32_t dmaen : 1; /* [3] */
414 __IO uint32_t blksize : 4; /* [7:4] */
415 __IO uint32_t rdwtstart : 1; /* [8] */
416 __IO uint32_t rdwtstop : 1; /* [9] */
417 __IO uint32_t rdwtmode : 1; /* [10] */
418 __IO uint32_t ioen : 1; /* [11] */
419 __IO uint32_t reserved1 : 20;/* [31:12] */
420 } dtctrl_bit;
421 };
422
426 union
427 {
428 __IO uint32_t dtcnt;
429 struct
430 {
431 __IO uint32_t cnt : 25;/* [24:0] */
432 __IO uint32_t reserved1 : 7; /* [31:25] */
433 } dtcnt_bit;
434 };
435
439 union
440 {
441 __IO uint32_t sts;
442 struct
443 {
444 __IO uint32_t cmdfail : 1; /* [0] */
445 __IO uint32_t dtfail : 1; /* [1] */
446 __IO uint32_t cmdtimeout : 1; /* [2] */
447 __IO uint32_t dttimeout : 1; /* [3] */
448 __IO uint32_t txerru : 1; /* [4] */
449 __IO uint32_t rxerro : 1; /* [5] */
450 __IO uint32_t cmdrspcmpl : 1; /* [6] */
451 __IO uint32_t cmdcmpl : 1; /* [7] */
452 __IO uint32_t dtcmpl : 1; /* [8] */
453 __IO uint32_t sbiterr : 1; /* [9] */
454 __IO uint32_t dtblkcmpl : 1; /* [10] */
455 __IO uint32_t docmd : 1; /* [11] */
456 __IO uint32_t dotx : 1; /* [12] */
457 __IO uint32_t dorx : 1; /* [13] */
458 __IO uint32_t txbufh : 1; /* [14] */
459 __IO uint32_t rxbufh : 1; /* [15] */
460 __IO uint32_t txbuff : 1; /* [16] */
461 __IO uint32_t rxbuff : 1; /* [17] */
462 __IO uint32_t txbufe : 1; /* [18] */
463 __IO uint32_t rxbufe : 1; /* [19] */
464 __IO uint32_t txbuf : 1; /* [20] */
465 __IO uint32_t rxbuf : 1; /* [21] */
466 __IO uint32_t ioif : 1; /* [22] */
467 __IO uint32_t reserved1 : 9; /* [31:23] */
468 } sts_bit;
469 };
470
474 union
475 {
476 __IO uint32_t intclr;
477 struct
478 {
479 __IO uint32_t cmdfail : 1; /* [0] */
480 __IO uint32_t dtfail : 1; /* [1] */
481 __IO uint32_t cmdtimeout : 1; /* [2] */
482 __IO uint32_t dttimeout : 1; /* [3] */
483 __IO uint32_t txerru : 1; /* [4] */
484 __IO uint32_t rxerro : 1; /* [5] */
485 __IO uint32_t cmdrspcmpl : 1; /* [6] */
486 __IO uint32_t cmdcmpl : 1; /* [7] */
487 __IO uint32_t dtcmpl : 1; /* [8] */
488 __IO uint32_t sbiterr : 1; /* [9] */
489 __IO uint32_t dtblkcmpl : 1; /* [10] */
490 __IO uint32_t reserved1 : 11;/* [21:11] */
491 __IO uint32_t ioif : 1; /* [22] */
492 __IO uint32_t reserved2 : 9; /* [31:23] */
493 } intclr_bit;
494 };
495
499 union
500 {
501 __IO uint32_t inten;
502 struct
503 {
504 __IO uint32_t cmdfailien : 1; /* [0] */
505 __IO uint32_t dtfailien : 1; /* [1] */
506 __IO uint32_t cmdtimeoutien : 1; /* [2] */
507 __IO uint32_t dttimeoutien : 1; /* [3] */
508 __IO uint32_t txerruien : 1; /* [4] */
509 __IO uint32_t rxerroien : 1; /* [5] */
510 __IO uint32_t cmdrspcmplien : 1; /* [6] */
511 __IO uint32_t cmdcmplien : 1; /* [7] */
512 __IO uint32_t dtcmplien : 1; /* [8] */
513 __IO uint32_t sbiterrien : 1; /* [9] */
514 __IO uint32_t dtblkcmplien : 1; /* [10] */
515 __IO uint32_t docmdien : 1; /* [11] */
516 __IO uint32_t dotxien : 1; /* [12] */
517 __IO uint32_t dorxien : 1; /* [13] */
518 __IO uint32_t txbufhien : 1; /* [14] */
519 __IO uint32_t rxbufhien : 1; /* [15] */
520 __IO uint32_t txbuffien : 1; /* [16] */
521 __IO uint32_t rxbuffien : 1; /* [17] */
522 __IO uint32_t txbufeien : 1; /* [18] */
523 __IO uint32_t rxbufeien : 1; /* [19] */
524 __IO uint32_t txbufien : 1; /* [20] */
525 __IO uint32_t rxbufien : 1; /* [21] */
526 __IO uint32_t ioifien : 1; /* [22] */
527 __IO uint32_t reserved1 : 9; /* [31:23] */
528 } inten_bit;
529 };
530
534 __IO uint32_t reserved1[2];
535
539 union
540 {
541 __IO uint32_t bufcnt;
542 struct
543 {
544 __IO uint32_t cnt : 24;/* [23:0] */
545 __IO uint32_t reserved1 : 8; /* [31:24] */
546 } bufcnt_bit;
547 };
548
552 __IO uint32_t reserved2[13];
553
557 union
558 {
559 __IO uint32_t buf;
560 struct
561 {
562 __IO uint32_t dt : 32;/* [31:0] */
563 } buf_bit;
564 };
565
566} sdio_type;
567
572#define SDIO1 ((sdio_type *) SDIO1_BASE)
573
578void sdio_reset(sdio_type *sdio_x);
579void sdio_power_set(sdio_type *sdio_x, sdio_power_state_type power_state);
580 flag_status sdio_power_status_get(sdio_type *sdio_x);
581void sdio_clock_config(sdio_type *sdio_x, uint16_t clk_div, sdio_edge_phase_type clk_edg);
582void sdio_bus_width_config(sdio_type *sdio_x, sdio_bus_width_type width);
583void sdio_clock_bypass(sdio_type *sdio_x, confirm_state new_state);
584void sdio_power_saving_mode_enable(sdio_type *sdio_x, confirm_state new_state);
585void sdio_flow_control_enable(sdio_type *sdio_x, confirm_state new_state);
586void sdio_clock_enable(sdio_type *sdio_x, confirm_state new_state);
587void sdio_dma_enable(sdio_type *sdio_x, confirm_state new_state);
588void sdio_interrupt_enable(sdio_type *sdio_x, uint32_t int_opt, confirm_state new_state);
589 flag_status sdio_flag_get(sdio_type *sdio_x, uint32_t flag);
590void sdio_flag_clear(sdio_type *sdio_x, uint32_t flag);
591void sdio_command_config(sdio_type *sdio_x, sdio_command_struct_type *command_struct);
592void sdio_command_state_machine_enable(sdio_type *sdio_x, confirm_state new_state);
593uint8_t sdio_command_response_get(sdio_type *sdio_x);
594uint32_t sdio_response_get(sdio_type *sdio_x, sdio_rsp_index_type reg_index);
595void sdio_data_config(sdio_type *sdio_x, sdio_data_struct_type *data_struct);
596void sdio_data_state_machine_enable(sdio_type *sdio_x, confirm_state new_state);
597uint32_t sdio_data_counter_get(sdio_type *sdio_x);
598uint32_t sdio_data_read(sdio_type *sdio_x);
599uint32_t sdio_buffer_counter_get(sdio_type *sdio_x);
600void sdio_data_write(sdio_type *sdio_x, uint32_t data);
601void sdio_read_wait_mode_set(sdio_type *sdio_x, sdio_read_wait_mode_type mode);
602void sdio_read_wait_start(sdio_type *sdio_x, confirm_state new_state);
603void sdio_read_wait_stop(sdio_type *sdio_x, confirm_state new_state);
604void sdio_io_function_enable(sdio_type *sdio_x, confirm_state new_state);
605void sdio_io_suspend_command_set(sdio_type *sdio_x, confirm_state new_state);
606
619#ifdef __cplusplus
620}
621#endif
622
623#endif
at32f415.h
at32f415 header file
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
sdio_command_config
void sdio_command_config(sdio_type *sdio_x, sdio_command_struct_type *command_struct)
config sdio command.
Definition: at32f415_sdio.c:340
sdio_data_write
void sdio_data_write(sdio_type *sdio_x, uint32_t data)
write one word data to fifo.
Definition: at32f415_sdio.c:501
sdio_io_suspend_command_set
void sdio_io_suspend_command_set(sdio_type *sdio_x, confirm_state new_state)
enable or disable sd i/o suspend command sending.
Definition: at32f415_sdio.c:569
sdio_data_config
void sdio_data_config(sdio_type *sdio_x, sdio_data_struct_type *data_struct)
config sdio data.
Definition: at32f415_sdio.c:427
sdio_data_read
uint32_t sdio_data_read(sdio_type *sdio_x)
read a word data from sdio fifo.
Definition: at32f415_sdio.c:476
sdio_power_status_get
flag_status sdio_power_status_get(sdio_type *sdio_x)
get power status.
Definition: at32f415_sdio.c:87
sdio_io_function_enable
void sdio_io_function_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable the sd i/o function.
Definition: at32f415_sdio.c:556
sdio_command_state_machine_enable
void sdio_command_state_machine_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable command path state machine(CPSM).
Definition: at32f415_sdio.c:363
sdio_clock_bypass
void sdio_clock_bypass(sdio_type *sdio_x, confirm_state new_state)
enable or disable clock divider bypss
Definition: at32f415_sdio.c:152
sdio_flow_control_enable
void sdio_flow_control_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable hardware flow control.
Definition: at32f415_sdio.c:179
sdio_power_set
void sdio_power_set(sdio_type *sdio_x, sdio_power_state_type power_state)
set the power status of the controller
Definition: at32f415_sdio.c:75
sdio_clock_config
void sdio_clock_config(sdio_type *sdio_x, uint16_t clk_div, sdio_edge_phase_type clk_edg)
config sdio clock
Definition: at32f415_sdio.c:115
sdio_bus_width_config
void sdio_bus_width_config(sdio_type *sdio_x, sdio_bus_width_type width)
config sdio bus width
Definition: at32f415_sdio.c:139
sdio_read_wait_stop
void sdio_read_wait_stop(sdio_type *sdio_x, confirm_state new_state)
enable or disable to stop sd i/o read wait operation.
Definition: at32f415_sdio.c:543
sdio_interrupt_enable
void sdio_interrupt_enable(sdio_type *sdio_x, uint32_t int_opt, confirm_state new_state)
config corresponding interrupt.
Definition: at32f415_sdio.c:243
sdio_flag_clear
void sdio_flag_clear(sdio_type *sdio_x, uint32_t flag)
clear sdio flag.
Definition: at32f415_sdio.c:326
sdio_response_get
uint32_t sdio_response_get(sdio_type *sdio_x, sdio_rsp_index_type reg_index)
get response received from the card for the last command.
Definition: at32f415_sdio.c:394
sdio_data_state_machine_enable
void sdio_data_state_machine_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable data path state machine(DPSM).
Definition: at32f415_sdio.c:452
sdio_power_saving_mode_enable
void sdio_power_saving_mode_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable power saving mode, config sdio_ck clock output when the bus is idle.
Definition: at32f415_sdio.c:166
sdio_flag_get
flag_status sdio_flag_get(sdio_type *sdio_x, uint32_t flag)
get sdio flag.
Definition: at32f415_sdio.c:289
sdio_dma_enable
void sdio_dma_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable dma.
Definition: at32f415_sdio.c:205
sdio_data_counter_get
uint32_t sdio_data_counter_get(sdio_type *sdio_x)
get the number of remaining data bytes to be transferred.
Definition: at32f415_sdio.c:464
sdio_buffer_counter_get
uint32_t sdio_buffer_counter_get(sdio_type *sdio_x)
get the number of words left to be written to or read from fifo..
Definition: at32f415_sdio.c:488
sdio_read_wait_start
void sdio_read_wait_start(sdio_type *sdio_x, confirm_state new_state)
enable or disable to start sd i/o read wait operation.
Definition: at32f415_sdio.c:530
sdio_reset
void sdio_reset(sdio_type *sdio_x)
reset the sdio register
Definition: at32f415_sdio.c:51
sdio_read_wait_mode_set
void sdio_read_wait_mode_set(sdio_type *sdio_x, sdio_read_wait_mode_type mode)
set the read wait mode.
Definition: at32f415_sdio.c:517
sdio_clock_enable
void sdio_clock_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable sdio_ck output.
Definition: at32f415_sdio.c:192
sdio_command_response_get
uint8_t sdio_command_response_get(sdio_type *sdio_x)
get command index of last command for which response received.
Definition: at32f415_sdio.c:376
sdio_wait_type
sdio_wait_type
sdio wait type
Definition: at32f415_sdio.h:159
sdio_reponse_type
sdio_reponse_type
sdio response type
Definition: at32f415_sdio.h:149
sdio_read_wait_mode_type
sdio_read_wait_mode_type
sdio read wait mode
Definition: at32f415_sdio.h:220
sdio_edge_phase_type
sdio_edge_phase_type
sdio edge phase
Definition: at32f415_sdio.h:130
sdio_transfer_direction_type
sdio_transfer_direction_type
sdio data transfer direction
Definition: at32f415_sdio.h:211
sdio_power_state_type
sdio_power_state_type
sdio power state
Definition: at32f415_sdio.h:121
sdio_transfer_mode_type
sdio_transfer_mode_type
sdio data transfer mode
Definition: at32f415_sdio.h:202
sdio_bus_width_type
sdio_bus_width_type
sdio bus width
Definition: at32f415_sdio.h:139
sdio_rsp_index_type
sdio_rsp_index_type
sdio response register index
Definition: at32f415_sdio.h:169
sdio_block_size_type
sdio_block_size_type
sdio data block size
Definition: at32f415_sdio.h:180
SDIO_WAIT_FOR_NO
@ SDIO_WAIT_FOR_NO
Definition: at32f415_sdio.h:160
SDIO_WAIT_FOR_PEND
@ SDIO_WAIT_FOR_PEND
Definition: at32f415_sdio.h:162
SDIO_WAIT_FOR_INT
@ SDIO_WAIT_FOR_INT
Definition: at32f415_sdio.h:161
SDIO_RESPONSE_LONG
@ SDIO_RESPONSE_LONG
Definition: at32f415_sdio.h:152
SDIO_RESPONSE_SHORT
@ SDIO_RESPONSE_SHORT
Definition: at32f415_sdio.h:151
SDIO_RESPONSE_NO
@ SDIO_RESPONSE_NO
Definition: at32f415_sdio.h:150
SDIO_READ_WAIT_CONTROLLED_BY_CK
@ SDIO_READ_WAIT_CONTROLLED_BY_CK
Definition: at32f415_sdio.h:222
SDIO_READ_WAIT_CONTROLLED_BY_D2
@ SDIO_READ_WAIT_CONTROLLED_BY_D2
Definition: at32f415_sdio.h:221
SDIO_CLOCK_EDGE_FALLING
@ SDIO_CLOCK_EDGE_FALLING
Definition: at32f415_sdio.h:132
SDIO_CLOCK_EDGE_RISING
@ SDIO_CLOCK_EDGE_RISING
Definition: at32f415_sdio.h:131
SDIO_DATA_TRANSFER_TO_CARD
@ SDIO_DATA_TRANSFER_TO_CARD
Definition: at32f415_sdio.h:212
SDIO_DATA_TRANSFER_TO_CONTROLLER
@ SDIO_DATA_TRANSFER_TO_CONTROLLER
Definition: at32f415_sdio.h:213
SDIO_POWER_OFF
@ SDIO_POWER_OFF
Definition: at32f415_sdio.h:122
SDIO_POWER_ON
@ SDIO_POWER_ON
Definition: at32f415_sdio.h:123
SDIO_DATA_BLOCK_TRANSFER
@ SDIO_DATA_BLOCK_TRANSFER
Definition: at32f415_sdio.h:203
SDIO_DATA_STREAM_TRANSFER
@ SDIO_DATA_STREAM_TRANSFER
Definition: at32f415_sdio.h:204
SDIO_BUS_WIDTH_D8
@ SDIO_BUS_WIDTH_D8
Definition: at32f415_sdio.h:142
SDIO_BUS_WIDTH_D1
@ SDIO_BUS_WIDTH_D1
Definition: at32f415_sdio.h:140
SDIO_BUS_WIDTH_D4
@ SDIO_BUS_WIDTH_D4
Definition: at32f415_sdio.h:141
SDIO_RSP3_INDEX
@ SDIO_RSP3_INDEX
Definition: at32f415_sdio.h:172
SDIO_RSP2_INDEX
@ SDIO_RSP2_INDEX
Definition: at32f415_sdio.h:171
SDIO_RSP4_INDEX
@ SDIO_RSP4_INDEX
Definition: at32f415_sdio.h:173
SDIO_RSP1_INDEX
@ SDIO_RSP1_INDEX
Definition: at32f415_sdio.h:170
SDIO_DATA_BLOCK_SIZE_8B
@ SDIO_DATA_BLOCK_SIZE_8B
Definition: at32f415_sdio.h:184
SDIO_DATA_BLOCK_SIZE_128B
@ SDIO_DATA_BLOCK_SIZE_128B
Definition: at32f415_sdio.h:188
SDIO_DATA_BLOCK_SIZE_2048B
@ SDIO_DATA_BLOCK_SIZE_2048B
Definition: at32f415_sdio.h:192
SDIO_DATA_BLOCK_SIZE_4096B
@ SDIO_DATA_BLOCK_SIZE_4096B
Definition: at32f415_sdio.h:193
SDIO_DATA_BLOCK_SIZE_16B
@ SDIO_DATA_BLOCK_SIZE_16B
Definition: at32f415_sdio.h:185
SDIO_DATA_BLOCK_SIZE_1024B
@ SDIO_DATA_BLOCK_SIZE_1024B
Definition: at32f415_sdio.h:191
SDIO_DATA_BLOCK_SIZE_64B
@ SDIO_DATA_BLOCK_SIZE_64B
Definition: at32f415_sdio.h:187
SDIO_DATA_BLOCK_SIZE_32B
@ SDIO_DATA_BLOCK_SIZE_32B
Definition: at32f415_sdio.h:186
SDIO_DATA_BLOCK_SIZE_8192B
@ SDIO_DATA_BLOCK_SIZE_8192B
Definition: at32f415_sdio.h:194
SDIO_DATA_BLOCK_SIZE_1B
@ SDIO_DATA_BLOCK_SIZE_1B
Definition: at32f415_sdio.h:181
SDIO_DATA_BLOCK_SIZE_512B
@ SDIO_DATA_BLOCK_SIZE_512B
Definition: at32f415_sdio.h:190
SDIO_DATA_BLOCK_SIZE_2B
@ SDIO_DATA_BLOCK_SIZE_2B
Definition: at32f415_sdio.h:182
SDIO_DATA_BLOCK_SIZE_256B
@ SDIO_DATA_BLOCK_SIZE_256B
Definition: at32f415_sdio.h:189
SDIO_DATA_BLOCK_SIZE_4B
@ SDIO_DATA_BLOCK_SIZE_4B
Definition: at32f415_sdio.h:183
SDIO_DATA_BLOCK_SIZE_16384B
@ SDIO_DATA_BLOCK_SIZE_16384B
Definition: at32f415_sdio.h:195
sdio_command_struct_type
sdio command structure
Definition: at32f415_sdio.h:229
sdio_command_struct_type::cmd_index
uint8_t cmd_index
Definition: at32f415_sdio.h:231
sdio_command_struct_type::argument
uint32_t argument
Definition: at32f415_sdio.h:230
sdio_command_struct_type::wait_type
sdio_wait_type wait_type
Definition: at32f415_sdio.h:233
sdio_command_struct_type::rsp_type
sdio_reponse_type rsp_type
Definition: at32f415_sdio.h:232
sdio_data_struct_type
sdio data structure
Definition: at32f415_sdio.h:240
sdio_data_struct_type::block_size
sdio_block_size_type block_size
Definition: at32f415_sdio.h:243
sdio_data_struct_type::transfer_direction
sdio_transfer_direction_type transfer_direction
Definition: at32f415_sdio.h:245
sdio_data_struct_type::timeout
uint32_t timeout
Definition: at32f415_sdio.h:241
sdio_data_struct_type::transfer_mode
sdio_transfer_mode_type transfer_mode
Definition: at32f415_sdio.h:244
sdio_data_struct_type::data_length
uint32_t data_length
Definition: at32f415_sdio.h:242
sdio_type
type define sdio register all
Definition: at32f415_sdio.h:252
sdio_type::ps
__IO uint32_t ps
Definition: at32f415_sdio.h:261
sdio_type::dorx
__IO uint32_t dorx
Definition: at32f415_sdio.h:457
sdio_type::sbiterr
__IO uint32_t sbiterr
Definition: at32f415_sdio.h:453
sdio_type::dtlen
__IO uint32_t dtlen
Definition: at32f415_sdio.h:394
sdio_type::intclr
__IO uint32_t intclr
Definition: at32f415_sdio.h:476
sdio_type::rdwtstart
__IO uint32_t rdwtstart
Definition: at32f415_sdio.h:415
sdio_type::rdwtstop
__IO uint32_t rdwtstop
Definition: at32f415_sdio.h:416
sdio_type::rspwt
__IO uint32_t rspwt
Definition: at32f415_sdio.h:307
sdio_type::rxbuf
__IO uint32_t rxbuf
Definition: at32f415_sdio.h:465
sdio_type::hfcen
__IO uint32_t hfcen
Definition: at32f415_sdio.h:280
sdio_type::rxbufeien
__IO uint32_t rxbufeien
Definition: at32f415_sdio.h:523
sdio_type::tfrmode
__IO uint32_t tfrmode
Definition: at32f415_sdio.h:412
sdio_type::cmdtimeout
__IO uint32_t cmdtimeout
Definition: at32f415_sdio.h:446
sdio_type::clkegs
__IO uint32_t clkegs
Definition: at32f415_sdio.h:279
sdio_type::cmdcmplien
__IO uint32_t cmdcmplien
Definition: at32f415_sdio.h:511
sdio_type::cmdcmpl
__IO uint32_t cmdcmpl
Definition: at32f415_sdio.h:451
sdio_type::dtfailien
__IO uint32_t dtfailien
Definition: at32f415_sdio.h:505
sdio_type::rxbufhien
__IO uint32_t rxbufhien
Definition: at32f415_sdio.h:519
sdio_type::tfrdir
__IO uint32_t tfrdir
Definition: at32f415_sdio.h:411
sdio_type::tfren
__IO uint32_t tfren
Definition: at32f415_sdio.h:410
sdio_type::dttmr
__IO uint32_t dttmr
Definition: at32f415_sdio.h:382
sdio_type::reserved1
__IO uint32_t reserved1
sdio reserved1 register, offset:0x40~0x44
Definition: at32f415_sdio.h:262
sdio_type::cnt
__IO uint32_t cnt
Definition: at32f415_sdio.h:431
sdio_type::cardsts4
__IO uint32_t cardsts4
Definition: at32f415_sdio.h:373
sdio_type::cmdfail
__IO uint32_t cmdfail
Definition: at32f415_sdio.h:444
sdio_type::txbufhien
__IO uint32_t txbufhien
Definition: at32f415_sdio.h:518
sdio_type::txbuffien
__IO uint32_t txbuffien
Definition: at32f415_sdio.h:520
sdio_type::rxbufe
__IO uint32_t rxbufe
Definition: at32f415_sdio.h:463
sdio_type::dtblkcmpl
__IO uint32_t dtblkcmpl
Definition: at32f415_sdio.h:454
sdio_type::inten
__IO uint32_t inten
Definition: at32f415_sdio.h:501
sdio_type::dtcmpl
__IO uint32_t dtcmpl
Definition: at32f415_sdio.h:452
sdio_type::docmd
__IO uint32_t docmd
Definition: at32f415_sdio.h:455
sdio_type::pndwt
__IO uint32_t pndwt
Definition: at32f415_sdio.h:309
sdio_type::cmdctrl
__IO uint32_t cmdctrl
Definition: at32f415_sdio.h:303
sdio_type::dtcmplien
__IO uint32_t dtcmplien
Definition: at32f415_sdio.h:512
sdio_type::clkoen
__IO uint32_t clkoen
Definition: at32f415_sdio.h:275
sdio_type::ioen
__IO uint32_t ioen
Definition: at32f415_sdio.h:418
sdio_type::bufcnt
__IO uint32_t bufcnt
Definition: at32f415_sdio.h:541
sdio_type::intwt
__IO uint32_t intwt
Definition: at32f415_sdio.h:308
sdio_type::rsp2
__IO uint32_t rsp2
Definition: at32f415_sdio.h:346
sdio_type::dtctrl
__IO uint32_t dtctrl
Definition: at32f415_sdio.h:407
sdio_type::dtfail
__IO uint32_t dtfail
Definition: at32f415_sdio.h:445
sdio_type::docmdien
__IO uint32_t docmdien
Definition: at32f415_sdio.h:515
sdio_type::dotxien
__IO uint32_t dotxien
Definition: at32f415_sdio.h:516
sdio_type::dotx
__IO uint32_t dotx
Definition: at32f415_sdio.h:456
sdio_type::rxerroien
__IO uint32_t rxerroien
Definition: at32f415_sdio.h:509
sdio_type::ccsmen
__IO uint32_t ccsmen
Definition: at32f415_sdio.h:310
sdio_type::txerruien
__IO uint32_t txerruien
Definition: at32f415_sdio.h:508
sdio_type::dttimeoutien
__IO uint32_t dttimeoutien
Definition: at32f415_sdio.h:507
sdio_type::pwrsven
__IO uint32_t pwrsven
Definition: at32f415_sdio.h:276
sdio_type::cmdidx
__IO uint32_t cmdidx
Definition: at32f415_sdio.h:306
sdio_type::cardsts3
__IO uint32_t cardsts3
Definition: at32f415_sdio.h:361
sdio_type::cardsts1
__IO uint32_t cardsts1
Definition: at32f415_sdio.h:337
sdio_type::pwrctrl
__IO uint32_t pwrctrl
Definition: at32f415_sdio.h:258
sdio_type::ioifien
__IO uint32_t ioifien
Definition: at32f415_sdio.h:526
sdio_type::dmaen
__IO uint32_t dmaen
Definition: at32f415_sdio.h:413
sdio_type::reserved2
__IO uint32_t reserved2
sdio reserved2 register, offset:0x4C~0x7C
Definition: at32f415_sdio.h:492
sdio_type::dtblkcmplien
__IO uint32_t dtblkcmplien
Definition: at32f415_sdio.h:514
sdio_type::rxbuffien
__IO uint32_t rxbuffien
Definition: at32f415_sdio.h:521
sdio_type::txbufh
__IO uint32_t txbufh
Definition: at32f415_sdio.h:458
sdio_type::sts
__IO uint32_t sts
Definition: at32f415_sdio.h:441
sdio_type::blksize
__IO uint32_t blksize
Definition: at32f415_sdio.h:414
sdio_type::cardsts2
__IO uint32_t cardsts2
Definition: at32f415_sdio.h:349
sdio_type::rdwtmode
__IO uint32_t rdwtmode
Definition: at32f415_sdio.h:417
sdio_type::txbufeien
__IO uint32_t txbufeien
Definition: at32f415_sdio.h:522
sdio_type::ioif
__IO uint32_t ioif
Definition: at32f415_sdio.h:466
sdio_type::cmdrspcmplien
__IO uint32_t cmdrspcmplien
Definition: at32f415_sdio.h:510
sdio_type::rxbufien
__IO uint32_t rxbufien
Definition: at32f415_sdio.h:525
sdio_type::dttimeout
__IO uint32_t dttimeout
Definition: at32f415_sdio.h:447
sdio_type::rxbufh
__IO uint32_t rxbufh
Definition: at32f415_sdio.h:459
sdio_type::txbufien
__IO uint32_t txbufien
Definition: at32f415_sdio.h:524
sdio_type::rsp1
__IO uint32_t rsp1
Definition: at32f415_sdio.h:334
sdio_type::rxbuff
__IO uint32_t rxbuff
Definition: at32f415_sdio.h:461
sdio_type::rsp4
__IO uint32_t rsp4
Definition: at32f415_sdio.h:370
sdio_type::bypsen
__IO uint32_t bypsen
Definition: at32f415_sdio.h:277
sdio_type::txbufe
__IO uint32_t txbufe
Definition: at32f415_sdio.h:462
sdio_type::cmdfailien
__IO uint32_t cmdfailien
Definition: at32f415_sdio.h:504
sdio_type::buf
__IO uint32_t buf
Definition: at32f415_sdio.h:559
sdio_type::clkdiv_l
__IO uint32_t clkdiv_l
Definition: at32f415_sdio.h:274
sdio_type::txerru
__IO uint32_t txerru
Definition: at32f415_sdio.h:448
sdio_type::dorxien
__IO uint32_t dorxien
Definition: at32f415_sdio.h:517
sdio_type::dt
__IO uint32_t dt
Definition: at32f415_sdio.h:562
sdio_type::rspcmd
__IO uint32_t rspcmd
Definition: at32f415_sdio.h:321
sdio_type::argu
__IO uint32_t argu
Definition: at32f415_sdio.h:291
sdio_type::timeout
__IO uint32_t timeout
Definition: at32f415_sdio.h:385
sdio_type::cmdtimeoutien
__IO uint32_t cmdtimeoutien
Definition: at32f415_sdio.h:506
sdio_type::busws
__IO uint32_t busws
Definition: at32f415_sdio.h:278
sdio_type::dtcnt
__IO uint32_t dtcnt
Definition: at32f415_sdio.h:428
sdio_type::clkdiv_h
__IO uint32_t clkdiv_h
Definition: at32f415_sdio.h:281
sdio_type::iosusp
__IO uint32_t iosusp
Definition: at32f415_sdio.h:311
sdio_type::txbuff
__IO uint32_t txbuff
Definition: at32f415_sdio.h:460
sdio_type::cmdrspcmpl
__IO uint32_t cmdrspcmpl
Definition: at32f415_sdio.h:450
sdio_type::txbuf
__IO uint32_t txbuf
Definition: at32f415_sdio.h:464
sdio_type::clkctrl
__IO uint32_t clkctrl
Definition: at32f415_sdio.h:271
sdio_type::sbiterrien
__IO uint32_t sbiterrien
Definition: at32f415_sdio.h:513
sdio_type::rsp3
__IO uint32_t rsp3
Definition: at32f415_sdio.h:358
sdio_type::rxerro
__IO uint32_t rxerro
Definition: at32f415_sdio.h:449


AT32F415 Firmwary Library: at32f415_spi.c Source File

  • libraries
  • drivers
  • src
at32f415_spi.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef SPI_MODULE_ENABLED
39
51void spi_i2s_reset(spi_type *spi_x)
52{
53 if(spi_x == SPI1)
54 {
55 crm_periph_reset(CRM_SPI1_PERIPH_RESET, TRUE);
56 crm_periph_reset(CRM_SPI1_PERIPH_RESET, FALSE);
57 }
58 else if(spi_x == SPI2)
59 {
60 crm_periph_reset(CRM_SPI2_PERIPH_RESET, TRUE);
61 crm_periph_reset(CRM_SPI2_PERIPH_RESET, FALSE);
62 }
63}
64
71void spi_default_para_init(spi_init_type* spi_init_struct)
72{
73 spi_init_struct->transmission_mode = SPI_TRANSMIT_FULL_DUPLEX;
74 spi_init_struct->master_slave_mode = SPI_MODE_SLAVE;
75 spi_init_struct->mclk_freq_division = SPI_MCLK_DIV_2;
76 spi_init_struct->first_bit_transmission = SPI_FIRST_BIT_MSB;
77 spi_init_struct->frame_bit_num = SPI_FRAME_8BIT;
78 spi_init_struct->clock_polarity = SPI_CLOCK_POLARITY_LOW;
79 spi_init_struct->clock_phase = SPI_CLOCK_PHASE_1EDGE;
80 spi_init_struct->cs_mode_selection = SPI_CS_SOFTWARE_MODE;
81}
82
91void spi_init(spi_type* spi_x, spi_init_type* spi_init_struct)
92{
93 spi_x->i2sctrl_bit.i2smsel = FALSE;
94 if(spi_init_struct->transmission_mode == SPI_TRANSMIT_FULL_DUPLEX)
95 {
96 spi_x->ctrl1_bit.slben = FALSE;
97 spi_x->ctrl1_bit.slbtd = FALSE;
98 spi_x->ctrl1_bit.ora = FALSE;
99 }
100 else if(spi_init_struct->transmission_mode == SPI_TRANSMIT_SIMPLEX_RX)
101 {
102 spi_x->ctrl1_bit.slben = FALSE;
103 spi_x->ctrl1_bit.slbtd = FALSE;
104 spi_x->ctrl1_bit.ora = TRUE;
105 }
106 else if(spi_init_struct->transmission_mode == SPI_TRANSMIT_HALF_DUPLEX_RX)
107 {
108 spi_x->ctrl1_bit.slben = TRUE;
109 spi_x->ctrl1_bit.slbtd = FALSE;
110 spi_x->ctrl1_bit.ora = FALSE;
111 }
112 else if(spi_init_struct->transmission_mode == SPI_TRANSMIT_HALF_DUPLEX_TX)
113 {
114 spi_x->ctrl1_bit.slben = TRUE;
115 spi_x->ctrl1_bit.slbtd = TRUE;
116 spi_x->ctrl1_bit.ora = FALSE;
117 }
118
119 spi_x->ctrl1_bit.swcsen = spi_init_struct->cs_mode_selection;
120 if((spi_init_struct->master_slave_mode == SPI_MODE_MASTER) && (spi_init_struct->cs_mode_selection == SPI_CS_SOFTWARE_MODE))
121 {
122 spi_x->ctrl1_bit.swcsil = TRUE;
123 }
124 else
125 {
126 spi_x->ctrl1_bit.swcsil = FALSE;
127 }
128 spi_x->ctrl1_bit.msten = spi_init_struct->master_slave_mode;
129 if(spi_init_struct->mclk_freq_division > SPI_MCLK_DIV_256)
130 {
131 spi_x->ctrl2_bit.mdiv_h = 1;
132 spi_x->ctrl1_bit.mdiv_l = spi_init_struct->mclk_freq_division & 0x7;
133 }
134 else
135 {
136 spi_x->ctrl2_bit.mdiv_h = 0;
137 spi_x->ctrl1_bit.mdiv_l = spi_init_struct->mclk_freq_division;
138 }
139 spi_x->ctrl1_bit.ltf = spi_init_struct->first_bit_transmission;
140 spi_x->ctrl1_bit.fbn = spi_init_struct->frame_bit_num;
141 spi_x->ctrl1_bit.clkpol = spi_init_struct->clock_polarity;
142 spi_x->ctrl1_bit.clkpha = spi_init_struct->clock_phase;
143}
144
152void spi_crc_next_transmit(spi_type* spi_x)
153{
154 spi_x->ctrl1_bit.ntc = TRUE;
155}
156
165void spi_crc_polynomial_set(spi_type* spi_x, uint16_t crc_poly)
166{
167 spi_x->cpoly_bit.cpoly = crc_poly;
168}
169
177uint16_t spi_crc_polynomial_get(spi_type* spi_x)
178{
179 return spi_x->cpoly_bit.cpoly;
180}
181
191void spi_crc_enable(spi_type* spi_x, confirm_state new_state)
192{
193 spi_x->ctrl1_bit.ccen = new_state;
194}
195
206uint16_t spi_crc_value_get(spi_type* spi_x, spi_crc_direction_type crc_direction)
207{
208 if(crc_direction == SPI_CRC_RX)
209 return spi_x->rcrc_bit.rcrc;
210 else
211 return spi_x->tcrc_bit.tcrc;
212}
213
224void spi_hardware_cs_output_enable(spi_type* spi_x, confirm_state new_state)
225{
226 spi_x->ctrl2_bit.hwcsoe = new_state;
227}
228
242void spi_software_cs_internal_level_set(spi_type* spi_x, spi_software_cs_level_type level)
243{
244 spi_x->ctrl1_bit.swcsil = level;
245}
246
257void spi_frame_bit_num_set(spi_type* spi_x, spi_frame_bit_num_type bit_num)
258{
259 spi_x->ctrl1_bit.fbn = bit_num;
260}
261
273void spi_half_duplex_direction_set(spi_type* spi_x, spi_half_duplex_direction_type direction)
274{
275 spi_x->ctrl1_bit.slbtd = direction;
276}
277
287void spi_enable(spi_type* spi_x, confirm_state new_state)
288{
289 spi_x->ctrl1_bit.spien = new_state;
290}
291
298void i2s_default_para_init(i2s_init_type* i2s_init_struct)
299{
300 i2s_init_struct->operation_mode = I2S_MODE_SLAVE_TX;
301 i2s_init_struct->audio_protocol = I2S_AUDIO_PROTOCOL_PHILLIPS;
302 i2s_init_struct->audio_sampling_freq = I2S_AUDIO_FREQUENCY_DEFAULT;
303 i2s_init_struct->data_channel_format = I2S_DATA_16BIT_CHANNEL_16BIT;
304 i2s_init_struct->clock_polarity = I2S_CLOCK_POLARITY_LOW;
305 i2s_init_struct->mclk_output_enable = FALSE;
306}
307
316void i2s_init(spi_type* spi_x, i2s_init_type* i2s_init_struct)
317{
318 crm_clocks_freq_type clocks_freq;
319 uint32_t i2s_sclk_index = 0;
320 uint32_t i2sdiv_index = 2, i2sodd_index = 0, frequency_index = 0;
321
322 /* i2s audio frequency config */
323 if(i2s_init_struct->audio_sampling_freq == I2S_AUDIO_FREQUENCY_DEFAULT)
324 {
325 i2sodd_index = 0;
326 i2sdiv_index = 2;
327 }
328 else
329 {
330 crm_clocks_freq_get(&clocks_freq);
331 i2s_sclk_index = clocks_freq.sclk_freq;
332 if((i2s_init_struct->audio_protocol == I2S_AUDIO_PROTOCOL_PCM_SHORT) || (i2s_init_struct->audio_protocol == I2S_AUDIO_PROTOCOL_PCM_LONG))
333 {
334 if(i2s_init_struct->mclk_output_enable == TRUE)
335 {
336 frequency_index = (((i2s_sclk_index / 128) * 10) / i2s_init_struct->audio_sampling_freq) + 5;
337 }
338 else
339 {
340 if(i2s_init_struct->data_channel_format == I2S_DATA_16BIT_CHANNEL_16BIT)
341 frequency_index = (((i2s_sclk_index / 16) * 10) / i2s_init_struct->audio_sampling_freq) + 5;
342 else
343 frequency_index = (((i2s_sclk_index / 32) * 10) / i2s_init_struct->audio_sampling_freq) + 5;
344 }
345 }
346 else
347 {
348 if(i2s_init_struct->mclk_output_enable == TRUE)
349 {
350 frequency_index = (((i2s_sclk_index / 256) * 10) / i2s_init_struct->audio_sampling_freq) + 5;
351 }
352 else
353 {
354 if(i2s_init_struct->data_channel_format == I2S_DATA_16BIT_CHANNEL_16BIT)
355 frequency_index = (((i2s_sclk_index / 32) * 10) / i2s_init_struct->audio_sampling_freq) + 5;
356 else
357 frequency_index = (((i2s_sclk_index / 64) * 10) / i2s_init_struct->audio_sampling_freq) + 5;
358 }
359 }
360 }
361 frequency_index = frequency_index / 10;
362 i2sodd_index = frequency_index & (uint16_t)0x0001;
363 i2sdiv_index = (frequency_index - i2sodd_index) / 2;
364 if((i2sdiv_index < 2) || (i2sdiv_index > 0x03FF))
365 {
366 i2sodd_index = 0;
367 i2sdiv_index = 2;
368 }
369 spi_x->i2sclk_bit.i2sodd = i2sodd_index;
370 if(i2sdiv_index > 0x00FF)
371 {
372 spi_x->i2sclk_bit.i2sdiv_h = (i2sdiv_index >> 8) & 0x0003;
373 spi_x->i2sclk_bit.i2sdiv_l = i2sdiv_index & 0x00FF;
374 }
375 else
376 {
377 spi_x->i2sclk_bit.i2sdiv_h = 0;
378 spi_x->i2sclk_bit.i2sdiv_l = i2sdiv_index;
379 }
380
381 /* i2s audio_protocol set*/
382 if(i2s_init_struct->audio_protocol == I2S_AUDIO_PROTOCOL_PCM_LONG)
383 {
384 spi_x->i2sctrl_bit.pcmfssel = 1;
385 spi_x->i2sctrl_bit.stdsel = 3;
386 }
387 else if(i2s_init_struct->audio_protocol == I2S_AUDIO_PROTOCOL_PCM_SHORT)
388 {
389 spi_x->i2sctrl_bit.pcmfssel = 0;
390 spi_x->i2sctrl_bit.stdsel = 3;
391 }
392 else if(i2s_init_struct->audio_protocol == I2S_AUDIO_PROTOCOL_LSB)
393 {
394 spi_x->i2sctrl_bit.pcmfssel = 0;
395 spi_x->i2sctrl_bit.stdsel = 2;
396 }
397 else if(i2s_init_struct->audio_protocol == I2S_AUDIO_PROTOCOL_MSB)
398 {
399 spi_x->i2sctrl_bit.pcmfssel = 0;
400 spi_x->i2sctrl_bit.stdsel = 1;
401 }
402 else if(i2s_init_struct->audio_protocol == I2S_AUDIO_PROTOCOL_PHILLIPS)
403 {
404 spi_x->i2sctrl_bit.pcmfssel = 0;
405 spi_x->i2sctrl_bit.stdsel = 0;
406 }
407
408 /* i2s data_channel_format set*/
409 if(i2s_init_struct->data_channel_format == I2S_DATA_16BIT_CHANNEL_16BIT)
410 {
411 spi_x->i2sctrl_bit.i2scbn = 0;
412 spi_x->i2sctrl_bit.i2sdbn = 0;
413 }
414 else if(i2s_init_struct->data_channel_format == I2S_DATA_16BIT_CHANNEL_32BIT)
415 {
416 spi_x->i2sctrl_bit.i2scbn = 1;
417 spi_x->i2sctrl_bit.i2sdbn = 0;
418 }
419 else if(i2s_init_struct->data_channel_format == I2S_DATA_24BIT_CHANNEL_32BIT)
420 {
421 spi_x->i2sctrl_bit.i2scbn = 1;
422 spi_x->i2sctrl_bit.i2sdbn = 1;
423 }
424 else if(i2s_init_struct->data_channel_format == I2S_DATA_32BIT_CHANNEL_32BIT)
425 {
426 spi_x->i2sctrl_bit.i2scbn = 1;
427 spi_x->i2sctrl_bit.i2sdbn = 2;
428 }
429
430 spi_x->i2sctrl_bit.i2sclkpol = i2s_init_struct->clock_polarity;
431 spi_x->i2sclk_bit.i2smclkoe = i2s_init_struct->mclk_output_enable;
432 spi_x->i2sctrl_bit.opersel = i2s_init_struct->operation_mode;
433 spi_x->i2sctrl_bit.i2smsel = TRUE;
434}
435
445void i2s_enable(spi_type* spi_x, confirm_state new_state)
446{
447 spi_x->i2sctrl_bit.i2sen = new_state;
448}
449
464void spi_i2s_interrupt_enable(spi_type* spi_x, uint32_t spi_i2s_int, confirm_state new_state)
465{
466 if(new_state != FALSE)
467 {
468 spi_x->ctrl2 |= spi_i2s_int;
469 }
470 else
471 {
472 spi_x->ctrl2 &= ~spi_i2s_int;
473 }
474}
475
485void spi_i2s_dma_transmitter_enable(spi_type* spi_x, confirm_state new_state)
486{
487 spi_x->ctrl2_bit.dmaten = new_state;
488}
489
499void spi_i2s_dma_receiver_enable(spi_type* spi_x, confirm_state new_state)
500{
501 spi_x->ctrl2_bit.dmaren = new_state;
502}
503
514void spi_i2s_data_transmit(spi_type* spi_x, uint16_t tx_data)
515{
516 spi_x->dt = tx_data;
517}
518
526uint16_t spi_i2s_data_receive(spi_type* spi_x)
527{
528 return (uint16_t)spi_x->dt;
529}
530
548 flag_status spi_i2s_flag_get(spi_type* spi_x, uint32_t spi_i2s_flag)
549{
550 flag_status status = RESET;
551 if ((spi_x->sts & spi_i2s_flag) == RESET)
552 {
553 status = RESET;
554 }
555 else
556 {
557 status = SET;
558 }
559 return status;
560}
561
580void spi_i2s_flag_clear(spi_type* spi_x, uint32_t spi_i2s_flag)
581{
582 volatile uint32_t temp = 0;
583 temp = temp;
584 if(spi_i2s_flag == SPI_CCERR_FLAG)
585 spi_x->sts = ~SPI_CCERR_FLAG;
586 else if(spi_i2s_flag == SPI_I2S_RDBF_FLAG)
587 temp = REG32(&spi_x->dt);
588 else if(spi_i2s_flag == I2S_TUERR_FLAG)
589 temp = REG32(&spi_x->sts);
590 else if(spi_i2s_flag == SPI_MMERR_FLAG)
591 {
592 temp = REG32(&spi_x->sts);
593 spi_x->ctrl1 = spi_x->ctrl1;
594 }
595 else if(spi_i2s_flag == SPI_I2S_ROERR_FLAG)
596 {
597 temp = REG32(&spi_x->dt);
598 temp = REG32(&spi_x->sts);
599 }
600}
601
606#endif
607
spi_init_struct
spi_init_type spi_init_struct
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:40
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_SPI1_PERIPH_RESET
@ CRM_SPI1_PERIPH_RESET
Definition: at32f415_crm.h:158
CRM_SPI2_PERIPH_RESET
@ CRM_SPI2_PERIPH_RESET
Definition: at32f415_crm.h:170
REG32
#define REG32(addr)
Definition: at32f415.h:270
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
I2S_TUERR_FLAG
#define I2S_TUERR_FLAG
Definition: at32f415_spi.h:56
SPI_CCERR_FLAG
#define SPI_CCERR_FLAG
Definition: at32f415_spi.h:57
SPI_I2S_RDBF_FLAG
#define SPI_I2S_RDBF_FLAG
Definition: at32f415_spi.h:53
SPI_MMERR_FLAG
#define SPI_MMERR_FLAG
Definition: at32f415_spi.h:58
SPI_I2S_ROERR_FLAG
#define SPI_I2S_ROERR_FLAG
Definition: at32f415_spi.h:59
spi_software_cs_level_type
spi_software_cs_level_type
spi software cs internal level type
Definition: at32f415_spi.h:188
spi_half_duplex_direction_type
spi_half_duplex_direction_type
spi single line bidirectional direction type
Definition: at32f415_spi.h:179
spi_frame_bit_num_type
spi_frame_bit_num_type
spi frame bit num type
Definition: at32f415_spi.h:88
spi_crc_direction_type
spi_crc_direction_type
spi crc direction type
Definition: at32f415_spi.h:170
I2S_CLOCK_POLARITY_LOW
@ I2S_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:249
SPI_MODE_SLAVE
@ SPI_MODE_SLAVE
Definition: at32f415_spi.h:98
SPI_MODE_MASTER
@ SPI_MODE_MASTER
Definition: at32f415_spi.h:99
I2S_DATA_16BIT_CHANNEL_16BIT
@ I2S_DATA_16BIT_CHANNEL_16BIT
Definition: at32f415_spi.h:227
I2S_DATA_24BIT_CHANNEL_32BIT
@ I2S_DATA_24BIT_CHANNEL_32BIT
Definition: at32f415_spi.h:229
I2S_DATA_32BIT_CHANNEL_32BIT
@ I2S_DATA_32BIT_CHANNEL_32BIT
Definition: at32f415_spi.h:230
I2S_DATA_16BIT_CHANNEL_32BIT
@ I2S_DATA_16BIT_CHANNEL_32BIT
Definition: at32f415_spi.h:228
SPI_CLOCK_PHASE_1EDGE
@ SPI_CLOCK_PHASE_1EDGE
Definition: at32f415_spi.h:116
I2S_AUDIO_FREQUENCY_DEFAULT
@ I2S_AUDIO_FREQUENCY_DEFAULT
Definition: at32f415_spi.h:210
SPI_CS_SOFTWARE_MODE
@ SPI_CS_SOFTWARE_MODE
Definition: at32f415_spi.h:126
SPI_FIRST_BIT_MSB
@ SPI_FIRST_BIT_MSB
Definition: at32f415_spi.h:151
SPI_CLOCK_POLARITY_LOW
@ SPI_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:107
SPI_TRANSMIT_HALF_DUPLEX_RX
@ SPI_TRANSMIT_HALF_DUPLEX_RX
Definition: at32f415_spi.h:162
SPI_TRANSMIT_FULL_DUPLEX
@ SPI_TRANSMIT_FULL_DUPLEX
Definition: at32f415_spi.h:160
SPI_TRANSMIT_HALF_DUPLEX_TX
@ SPI_TRANSMIT_HALF_DUPLEX_TX
Definition: at32f415_spi.h:163
SPI_TRANSMIT_SIMPLEX_RX
@ SPI_TRANSMIT_SIMPLEX_RX
Definition: at32f415_spi.h:161
I2S_AUDIO_PROTOCOL_PCM_LONG
@ I2S_AUDIO_PROTOCOL_PCM_LONG
Definition: at32f415_spi.h:202
I2S_AUDIO_PROTOCOL_LSB
@ I2S_AUDIO_PROTOCOL_LSB
Definition: at32f415_spi.h:200
I2S_AUDIO_PROTOCOL_MSB
@ I2S_AUDIO_PROTOCOL_MSB
Definition: at32f415_spi.h:199
I2S_AUDIO_PROTOCOL_PHILLIPS
@ I2S_AUDIO_PROTOCOL_PHILLIPS
Definition: at32f415_spi.h:198
I2S_AUDIO_PROTOCOL_PCM_SHORT
@ I2S_AUDIO_PROTOCOL_PCM_SHORT
Definition: at32f415_spi.h:201
SPI_MCLK_DIV_2
@ SPI_MCLK_DIV_2
Definition: at32f415_spi.h:134
SPI_MCLK_DIV_256
@ SPI_MCLK_DIV_256
Definition: at32f415_spi.h:141
SPI_FRAME_8BIT
@ SPI_FRAME_8BIT
Definition: at32f415_spi.h:89
SPI_CRC_RX
@ SPI_CRC_RX
Definition: at32f415_spi.h:171
I2S_MODE_SLAVE_TX
@ I2S_MODE_SLAVE_TX
Definition: at32f415_spi.h:238
spi_i2s_interrupt_enable
void spi_i2s_interrupt_enable(spi_type *spi_x, uint32_t spi_i2s_int, confirm_state new_state)
enable or disable the specified spi/i2s interrupts.
Definition: at32f415_spi.c:464
i2s_init
void i2s_init(spi_type *spi_x, i2s_init_type *i2s_init_struct)
i2s init config with its setting value.
Definition: at32f415_spi.c:316
spi_i2s_data_transmit
void spi_i2s_data_transmit(spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit
Definition: at32f415_spi.c:514
spi_crc_enable
void spi_crc_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the hardware crc calculation for the spi peripheral.
Definition: at32f415_spi.c:191
spi_i2s_dma_receiver_enable
void spi_i2s_dma_receiver_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma receiver mode.
Definition: at32f415_spi.c:499
spi_i2s_flag_get
flag_status spi_i2s_flag_get(spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:548
i2s_enable
void i2s_enable(spi_type *spi_x, confirm_state new_state)
enable or disable i2s.
Definition: at32f415_spi.c:445
spi_crc_polynomial_get
uint16_t spi_crc_polynomial_get(spi_type *spi_x)
return the crc polynomial register value for the spi peripheral.
Definition: at32f415_spi.c:177
spi_crc_next_transmit
void spi_crc_next_transmit(spi_type *spi_x)
spi next transmit crc for the spi peripheral.
Definition: at32f415_spi.c:152
spi_init
void spi_init(spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value.
Definition: at32f415_spi.c:91
spi_default_para_init
void spi_default_para_init(spi_init_type *spi_init_struct)
spi init config with its default value.
Definition: at32f415_spi.c:71
spi_crc_polynomial_set
void spi_crc_polynomial_set(spi_type *spi_x, uint16_t crc_poly)
set the crc polynomial value for the spi peripheral.
Definition: at32f415_spi.c:165
spi_i2s_data_receive
uint16_t spi_i2s_data_receive(spi_type *spi_x)
spi/i2s data receive
Definition: at32f415_spi.c:526
spi_crc_value_get
uint16_t spi_crc_value_get(spi_type *spi_x, spi_crc_direction_type crc_direction)
return the transmit or the receive crc value for the spi peripheral.
Definition: at32f415_spi.c:206
spi_i2s_reset
void spi_i2s_reset(spi_type *spi_x)
spi reset by crm reset register
Definition: at32f415_spi.c:51
spi_half_duplex_direction_set
void spi_half_duplex_direction_set(spi_type *spi_x, spi_half_duplex_direction_type direction)
set the data transmission direction in single line bidirectiona half duplex mode of the spi periphera...
Definition: at32f415_spi.c:273
spi_hardware_cs_output_enable
void spi_hardware_cs_output_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the hardware cs output for the spi peripheral.
Definition: at32f415_spi.c:224
spi_i2s_flag_clear
void spi_i2s_flag_clear(spi_type *spi_x, uint32_t spi_i2s_flag)
clear flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:580
i2s_default_para_init
void i2s_default_para_init(i2s_init_type *i2s_init_struct)
i2s init config with its default value.
Definition: at32f415_spi.c:298
spi_enable
void spi_enable(spi_type *spi_x, confirm_state new_state)
enable or disable spi.
Definition: at32f415_spi.c:287
spi_i2s_dma_transmitter_enable
void spi_i2s_dma_transmitter_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma transmitter mode.
Definition: at32f415_spi.c:485
spi_frame_bit_num_set
void spi_frame_bit_num_set(spi_type *spi_x, spi_frame_bit_num_type bit_num)
set the data frame bit num for the spi peripheral.
Definition: at32f415_spi.c:257
spi_software_cs_internal_level_set
void spi_software_cs_internal_level_set(spi_type *spi_x, spi_software_cs_level_type level)
set the software cs internal level for the spi peripheral.
Definition: at32f415_spi.c:242
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::sclk_freq
uint32_t sclk_freq
Definition: at32f415_crm.h:472
i2s_init_type
i2s init type
Definition: at32f415_spi.h:272
i2s_init_type::audio_sampling_freq
i2s_audio_sampling_freq_type audio_sampling_freq
Definition: at32f415_spi.h:275
i2s_init_type::data_channel_format
i2s_data_channel_format_type data_channel_format
Definition: at32f415_spi.h:276
i2s_init_type::mclk_output_enable
confirm_state mclk_output_enable
Definition: at32f415_spi.h:278
i2s_init_type::audio_protocol
i2s_audio_protocol_type audio_protocol
Definition: at32f415_spi.h:274
i2s_init_type::operation_mode
i2s_operation_mode_type operation_mode
Definition: at32f415_spi.h:273
i2s_init_type::clock_polarity
i2s_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:277
spi_init_type
spi init type
Definition: at32f415_spi.h:257
spi_init_type::master_slave_mode
spi_master_slave_mode_type master_slave_mode
Definition: at32f415_spi.h:259
spi_init_type::first_bit_transmission
spi_first_bit_type first_bit_transmission
Definition: at32f415_spi.h:261
spi_init_type::frame_bit_num
spi_frame_bit_num_type frame_bit_num
Definition: at32f415_spi.h:262
spi_init_type::clock_polarity
spi_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:263
spi_init_type::cs_mode_selection
spi_cs_mode_type cs_mode_selection
Definition: at32f415_spi.h:265
spi_init_type::mclk_freq_division
spi_mclk_freq_div_type mclk_freq_division
Definition: at32f415_spi.h:260
spi_init_type::transmission_mode
spi_transmission_mode_type transmission_mode
Definition: at32f415_spi.h:258
spi_init_type::clock_phase
spi_clock_phase_type clock_phase
Definition: at32f415_spi.h:264
spi_type
type define spi register all
Definition: at32f415_spi.h:285
spi_type::clkpha
__IO uint32_t clkpha
Definition: at32f415_spi.h:295
spi_type::hwcsoe
__IO uint32_t hwcsoe
Definition: at32f415_spi.h:323
spi_type::i2sctrl_bit
struct spi_type::@579::@590 i2sctrl_bit
spi_type::slben
__IO uint32_t slben
Definition: at32f415_spi.h:308
spi_type::ntc
__IO uint32_t ntc
Definition: at32f415_spi.h:305
spi_type::mdiv_h
__IO uint32_t mdiv_h
Definition: at32f415_spi.h:328
spi_type::rcrc_bit
struct spi_type::@575::@588 rcrc_bit
spi_type::dmaren
__IO uint32_t dmaren
Definition: at32f415_spi.h:321
spi_type::i2sdbn
__IO uint32_t i2sdbn
Definition: at32f415_spi.h:414
spi_type::ctrl1_bit
struct spi_type::@565::@583 ctrl1_bit
spi_type::rcrc
__IO uint32_t rcrc
Definition: at32f415_spi.h:384
spi_type::i2scbn
__IO uint32_t i2scbn
Definition: at32f415_spi.h:413
spi_type::i2sclkpol
__IO uint32_t i2sclkpol
Definition: at32f415_spi.h:415
spi_type::cpoly
__IO uint32_t cpoly
Definition: at32f415_spi.h:371
spi_type::ctrl1
__IO uint32_t ctrl1
Definition: at32f415_spi.h:292
spi_type::i2sodd
__IO uint32_t i2sodd
Definition: at32f415_spi.h:435
spi_type::swcsil
__IO uint32_t swcsil
Definition: at32f415_spi.h:301
spi_type::tcrc
__IO uint32_t tcrc
Definition: at32f415_spi.h:397
spi_type::i2smclkoe
__IO uint32_t i2smclkoe
Definition: at32f415_spi.h:436
spi_type::ltf
__IO uint32_t ltf
Definition: at32f415_spi.h:300
spi_type::clkpol
__IO uint32_t clkpol
Definition: at32f415_spi.h:296
spi_type::slbtd
__IO uint32_t slbtd
Definition: at32f415_spi.h:307
spi_type::dmaten
__IO uint32_t dmaten
Definition: at32f415_spi.h:322
spi_type::ccen
__IO uint32_t ccen
Definition: at32f415_spi.h:306
spi_type::fbn
__IO uint32_t fbn
Definition: at32f415_spi.h:304
spi_type::dt
__IO uint32_t dt
Definition: at32f415_spi.h:358
spi_type::msten
__IO uint32_t msten
Definition: at32f415_spi.h:297
spi_type::tcrc_bit
struct spi_type::@577::@589 tcrc_bit
spi_type::sts
__IO uint32_t sts
Definition: at32f415_spi.h:338
spi_type::cpoly_bit
struct spi_type::@573::@587 cpoly_bit
spi_type::i2sdiv_h
__IO uint32_t i2sdiv_h
Definition: at32f415_spi.h:437
spi_type::opersel
__IO uint32_t opersel
Definition: at32f415_spi.h:419
spi_type::i2sdiv_l
__IO uint32_t i2sdiv_l
Definition: at32f415_spi.h:434
spi_type::i2smsel
__IO uint32_t i2smsel
Definition: at32f415_spi.h:421
spi_type::pcmfssel
__IO uint32_t pcmfssel
Definition: at32f415_spi.h:418
spi_type::ctrl2
__IO uint32_t ctrl2
Definition: at32f415_spi.h:318
spi_type::stdsel
__IO uint32_t stdsel
Definition: at32f415_spi.h:416
spi_type::mdiv_l
__IO uint32_t mdiv_l
Definition: at32f415_spi.h:298
spi_type::ctrl2_bit
struct spi_type::@567::@584 ctrl2_bit
spi_type::spien
__IO uint32_t spien
Definition: at32f415_spi.h:299
spi_type::swcsen
__IO uint32_t swcsen
Definition: at32f415_spi.h:302
spi_type::ora
__IO uint32_t ora
Definition: at32f415_spi.h:303
spi_type::i2sen
__IO uint32_t i2sen
Definition: at32f415_spi.h:420
spi_type::i2sclk_bit
struct spi_type::@581::@591 i2sclk_bit
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_spi.h Source File

  • libraries
  • drivers
  • inc
at32f415_spi.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_SPI_H
29#define __AT32F415_SPI_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
53#define SPI_I2S_RDBF_FLAG 0x0001
54#define SPI_I2S_TDBE_FLAG 0x0002
55#define I2S_ACS_FLAG 0x0004
56#define I2S_TUERR_FLAG 0x0008
57#define SPI_CCERR_FLAG 0x0010
58#define SPI_MMERR_FLAG 0x0020
59#define SPI_I2S_ROERR_FLAG 0x0040
60#define SPI_I2S_BF_FLAG 0x0080
72#define SPI_I2S_ERROR_INT 0x0020
73#define SPI_I2S_RDBF_INT 0x0040
74#define SPI_I2S_TDBE_INT 0x0080
87typedef enum
88{
89 SPI_FRAME_8BIT = 0x00,
90 SPI_FRAME_16BIT = 0x01
91} spi_frame_bit_num_type;
92
96typedef enum
97{
98 SPI_MODE_SLAVE = 0x00,
99 SPI_MODE_MASTER = 0x01
100} spi_master_slave_mode_type;
101
105typedef enum
106{
107 SPI_CLOCK_POLARITY_LOW = 0x00,
108 SPI_CLOCK_POLARITY_HIGH = 0x01
109} spi_clock_polarity_type;
110
114typedef enum
115{
116 SPI_CLOCK_PHASE_1EDGE = 0x00,
117 SPI_CLOCK_PHASE_2EDGE = 0x01
118} spi_clock_phase_type;
119
123typedef enum
124{
125 SPI_CS_HARDWARE_MODE = 0x00,
126 SPI_CS_SOFTWARE_MODE = 0x01
127} spi_cs_mode_type;
128
132typedef enum
133{
134 SPI_MCLK_DIV_2 = 0x00,
135 SPI_MCLK_DIV_4 = 0x01,
136 SPI_MCLK_DIV_8 = 0x02,
137 SPI_MCLK_DIV_16 = 0x03,
138 SPI_MCLK_DIV_32 = 0x04,
139 SPI_MCLK_DIV_64 = 0x05,
140 SPI_MCLK_DIV_128 = 0x06,
141 SPI_MCLK_DIV_256 = 0x07,
142 SPI_MCLK_DIV_512 = 0x08,
143 SPI_MCLK_DIV_1024 = 0x09
144} spi_mclk_freq_div_type;
145
149typedef enum
150{
151 SPI_FIRST_BIT_MSB = 0x00,
152 SPI_FIRST_BIT_LSB = 0x01
153} spi_first_bit_type;
154
158typedef enum
159{
160 SPI_TRANSMIT_FULL_DUPLEX = 0x00,
161 SPI_TRANSMIT_SIMPLEX_RX = 0x01,
162 SPI_TRANSMIT_HALF_DUPLEX_RX = 0x02,
163 SPI_TRANSMIT_HALF_DUPLEX_TX = 0x03
164} spi_transmission_mode_type;
165
169typedef enum
170{
171 SPI_CRC_RX = 0x0014,
172 SPI_CRC_TX = 0x0018
173} spi_crc_direction_type;
174
178typedef enum
179{
180 SPI_HALF_DUPLEX_DIRECTION_RX = 0x00,
181 SPI_HALF_DUPLEX_DIRECTION_TX = 0x01
182} spi_half_duplex_direction_type;
183
187typedef enum
188{
189 SPI_SWCS_INTERNAL_LEVEL_LOW = 0x00,
190 SPI_SWCS_INTERNAL_LEVEL_HIGHT = 0x01
191} spi_software_cs_level_type;
192
196typedef enum
197{
198 I2S_AUDIO_PROTOCOL_PHILLIPS = 0x00,
199 I2S_AUDIO_PROTOCOL_MSB = 0x01,
200 I2S_AUDIO_PROTOCOL_LSB = 0x02,
201 I2S_AUDIO_PROTOCOL_PCM_SHORT = 0x03,
202 I2S_AUDIO_PROTOCOL_PCM_LONG = 0x04
203} i2s_audio_protocol_type;
204
208typedef enum
209{
210 I2S_AUDIO_FREQUENCY_DEFAULT = 2,
211 I2S_AUDIO_FREQUENCY_8K = 8000,
212 I2S_AUDIO_FREQUENCY_11_025K = 11025,
213 I2S_AUDIO_FREQUENCY_16K = 16000,
214 I2S_AUDIO_FREQUENCY_22_05K = 22050,
215 I2S_AUDIO_FREQUENCY_32K = 32000,
216 I2S_AUDIO_FREQUENCY_44_1K = 44100,
217 I2S_AUDIO_FREQUENCY_48K = 48000,
218 I2S_AUDIO_FREQUENCY_96K = 96000,
219 I2S_AUDIO_FREQUENCY_192K = 192000
220} i2s_audio_sampling_freq_type;
221
225typedef enum
226{
227 I2S_DATA_16BIT_CHANNEL_16BIT = 0x01,
228 I2S_DATA_16BIT_CHANNEL_32BIT = 0x02,
229 I2S_DATA_24BIT_CHANNEL_32BIT = 0x03,
230 I2S_DATA_32BIT_CHANNEL_32BIT = 0x04
231} i2s_data_channel_format_type;
232
236typedef enum
237{
238 I2S_MODE_SLAVE_TX = 0x00,
239 I2S_MODE_SLAVE_RX = 0x01,
240 I2S_MODE_MASTER_TX = 0x02,
241 I2S_MODE_MASTER_RX = 0x03
242} i2s_operation_mode_type;
243
247typedef enum
248{
249 I2S_CLOCK_POLARITY_LOW = 0x00,
250 I2S_CLOCK_POLARITY_HIGH = 0x01
251} i2s_clock_polarity_type;
252
256typedef struct
257{
258 spi_transmission_mode_type transmission_mode;
259 spi_master_slave_mode_type master_slave_mode;
260 spi_mclk_freq_div_type mclk_freq_division;
261 spi_first_bit_type first_bit_transmission;
262 spi_frame_bit_num_type frame_bit_num;
263 spi_clock_polarity_type clock_polarity;
264 spi_clock_phase_type clock_phase;
265 spi_cs_mode_type cs_mode_selection;
266} spi_init_type;
267
271typedef struct
272{
273 i2s_operation_mode_type operation_mode;
274 i2s_audio_protocol_type audio_protocol;
275 i2s_audio_sampling_freq_type audio_sampling_freq;
276 i2s_data_channel_format_type data_channel_format;
277 i2s_clock_polarity_type clock_polarity;
278 confirm_state mclk_output_enable;
279} i2s_init_type;
280
284typedef struct
285{
286
290 union
291 {
292 __IO uint32_t ctrl1;
293 struct
294 {
295 __IO uint32_t clkpha : 1; /* [0] */
296 __IO uint32_t clkpol : 1; /* [1] */
297 __IO uint32_t msten : 1; /* [2] */
298 __IO uint32_t mdiv_l : 3; /* [5:3] */
299 __IO uint32_t spien : 1; /* [6] */
300 __IO uint32_t ltf : 1; /* [7] */
301 __IO uint32_t swcsil : 1; /* [8] */
302 __IO uint32_t swcsen : 1; /* [9] */
303 __IO uint32_t ora : 1; /* [10] */
304 __IO uint32_t fbn : 1; /* [11] */
305 __IO uint32_t ntc : 1; /* [12] */
306 __IO uint32_t ccen : 1; /* [13] */
307 __IO uint32_t slbtd : 1; /* [14] */
308 __IO uint32_t slben : 1; /* [15] */
309 __IO uint32_t reserved1 : 16;/* [31:16] */
310 } ctrl1_bit;
311 };
312
316 union
317 {
318 __IO uint32_t ctrl2;
319 struct
320 {
321 __IO uint32_t dmaren : 1; /* [0] */
322 __IO uint32_t dmaten : 1; /* [1] */
323 __IO uint32_t hwcsoe : 1; /* [2] */
324 __IO uint32_t reserved1 : 2; /* [4:3] */
325 __IO uint32_t errie : 1; /* [5] */
326 __IO uint32_t rdbfie : 1; /* [6] */
327 __IO uint32_t tdbeie : 1; /* [7] */
328 __IO uint32_t mdiv_h : 1; /* [8] */
329 __IO uint32_t reserved2 : 23;/* [31:9] */
330 } ctrl2_bit;
331 };
332
336 union
337 {
338 __IO uint32_t sts;
339 struct
340 {
341 __IO uint32_t rdbf : 1; /* [0] */
342 __IO uint32_t tdbe : 1; /* [1] */
343 __IO uint32_t acs : 1; /* [2] */
344 __IO uint32_t tuerr : 1; /* [3] */
345 __IO uint32_t ccerr : 1; /* [4] */
346 __IO uint32_t mmerr : 1; /* [5] */
347 __IO uint32_t roerr : 1; /* [6] */
348 __IO uint32_t bf : 1; /* [7] */
349 __IO uint32_t reserved1 : 24;/* [31:8] */
350 } sts_bit;
351 };
352
356 union
357 {
358 __IO uint32_t dt;
359 struct
360 {
361 __IO uint32_t dt : 16;/* [15:0] */
362 __IO uint32_t reserved1 : 16;/* [31:16] */
363 } dt_bit;
364 };
365
369 union
370 {
371 __IO uint32_t cpoly;
372 struct
373 {
374 __IO uint32_t cpoly : 16;/* [15:0] */
375 __IO uint32_t reserved1 : 16;/* [31:16] */
376 } cpoly_bit;
377 };
378
382 union
383 {
384 __IO uint32_t rcrc;
385 struct
386 {
387 __IO uint32_t rcrc : 16;/* [15:0] */
388 __IO uint32_t reserved1 : 16;/* [31:16] */
389 } rcrc_bit;
390 };
391
395 union
396 {
397 __IO uint32_t tcrc;
398 struct
399 {
400 __IO uint32_t tcrc : 16;/* [15:0] */
401 __IO uint32_t reserved1 : 16;/* [31:16] */
402 } tcrc_bit;
403 };
404
408 union
409 {
410 __IO uint32_t i2sctrl;
411 struct
412 {
413 __IO uint32_t i2scbn : 1; /* [0] */
414 __IO uint32_t i2sdbn : 2; /* [2:1] */
415 __IO uint32_t i2sclkpol : 1; /* [3] */
416 __IO uint32_t stdsel : 2; /* [5:4] */
417 __IO uint32_t reserved1 : 1; /* [6] */
418 __IO uint32_t pcmfssel : 1; /* [7] */
419 __IO uint32_t opersel : 2; /* [9:8] */
420 __IO uint32_t i2sen : 1; /* [10] */
421 __IO uint32_t i2smsel : 1; /* [11] */
422 __IO uint32_t reserved2 : 20;/* [31:12] */
423 } i2sctrl_bit;
424 };
425
429 union
430 {
431 __IO uint32_t i2sclk;
432 struct
433 {
434 __IO uint32_t i2sdiv_l : 8; /* [7:0] */
435 __IO uint32_t i2sodd : 1; /* [8] */
436 __IO uint32_t i2smclkoe : 1; /* [9] */
437 __IO uint32_t i2sdiv_h : 2; /* [11:10] */
438 __IO uint32_t reserved1 : 20;/* [31:12] */
439 } i2sclk_bit;
440 };
441
442} spi_type;
443
448#define SPI1 ((spi_type *) SPI1_BASE)
449#define SPI2 ((spi_type *) SPI2_BASE)
450
455void spi_i2s_reset(spi_type *spi_x);
456void spi_default_para_init(spi_init_type* spi_init_struct);
457void spi_init(spi_type* spi_x, spi_init_type* spi_init_struct);
458void spi_crc_next_transmit(spi_type* spi_x);
459void spi_crc_polynomial_set(spi_type* spi_x, uint16_t crc_poly);
460uint16_t spi_crc_polynomial_get(spi_type* spi_x);
461void spi_crc_enable(spi_type* spi_x, confirm_state new_state);
462uint16_t spi_crc_value_get(spi_type* spi_x, spi_crc_direction_type crc_direction);
463void spi_hardware_cs_output_enable(spi_type* spi_x, confirm_state new_state);
464void spi_software_cs_internal_level_set(spi_type* spi_x, spi_software_cs_level_type level);
465void spi_frame_bit_num_set(spi_type* spi_x, spi_frame_bit_num_type bit_num);
466void spi_half_duplex_direction_set(spi_type* spi_x, spi_half_duplex_direction_type direction);
467void spi_enable(spi_type* spi_x, confirm_state new_state);
468void i2s_default_para_init(i2s_init_type* i2s_init_struct);
469void i2s_init(spi_type* spi_x, i2s_init_type* i2s_init_struct);
470void i2s_enable(spi_type* spi_x, confirm_state new_state);
471void spi_i2s_interrupt_enable(spi_type* spi_x, uint32_t spi_i2s_int, confirm_state new_state);
472void spi_i2s_dma_transmitter_enable(spi_type* spi_x, confirm_state new_state);
473void spi_i2s_dma_receiver_enable(spi_type* spi_x, confirm_state new_state);
474void spi_i2s_data_transmit(spi_type* spi_x, uint16_t tx_data);
475uint16_t spi_i2s_data_receive(spi_type* spi_x);
476 flag_status spi_i2s_flag_get(spi_type* spi_x, uint32_t spi_i2s_flag);
477void spi_i2s_flag_clear(spi_type* spi_x, uint32_t spi_i2s_flag);
478
491#ifdef __cplusplus
492}
493#endif
494
495#endif
at32f415.h
at32f415 header file
spi_init_struct
spi_init_type spi_init_struct
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:40
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
spi_i2s_interrupt_enable
void spi_i2s_interrupt_enable(spi_type *spi_x, uint32_t spi_i2s_int, confirm_state new_state)
enable or disable the specified spi/i2s interrupts.
Definition: at32f415_spi.c:464
i2s_init
void i2s_init(spi_type *spi_x, i2s_init_type *i2s_init_struct)
i2s init config with its setting value.
Definition: at32f415_spi.c:316
spi_i2s_data_transmit
void spi_i2s_data_transmit(spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit
Definition: at32f415_spi.c:514
spi_crc_enable
void spi_crc_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the hardware crc calculation for the spi peripheral.
Definition: at32f415_spi.c:191
spi_i2s_dma_receiver_enable
void spi_i2s_dma_receiver_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma receiver mode.
Definition: at32f415_spi.c:499
spi_i2s_flag_get
flag_status spi_i2s_flag_get(spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:548
i2s_enable
void i2s_enable(spi_type *spi_x, confirm_state new_state)
enable or disable i2s.
Definition: at32f415_spi.c:445
spi_crc_polynomial_get
uint16_t spi_crc_polynomial_get(spi_type *spi_x)
return the crc polynomial register value for the spi peripheral.
Definition: at32f415_spi.c:177
spi_crc_next_transmit
void spi_crc_next_transmit(spi_type *spi_x)
spi next transmit crc for the spi peripheral.
Definition: at32f415_spi.c:152
spi_init
void spi_init(spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value.
Definition: at32f415_spi.c:91
spi_default_para_init
void spi_default_para_init(spi_init_type *spi_init_struct)
spi init config with its default value.
Definition: at32f415_spi.c:71
spi_crc_polynomial_set
void spi_crc_polynomial_set(spi_type *spi_x, uint16_t crc_poly)
set the crc polynomial value for the spi peripheral.
Definition: at32f415_spi.c:165
spi_i2s_data_receive
uint16_t spi_i2s_data_receive(spi_type *spi_x)
spi/i2s data receive
Definition: at32f415_spi.c:526
spi_crc_value_get
uint16_t spi_crc_value_get(spi_type *spi_x, spi_crc_direction_type crc_direction)
return the transmit or the receive crc value for the spi peripheral.
Definition: at32f415_spi.c:206
spi_i2s_reset
void spi_i2s_reset(spi_type *spi_x)
spi reset by crm reset register
Definition: at32f415_spi.c:51
spi_half_duplex_direction_set
void spi_half_duplex_direction_set(spi_type *spi_x, spi_half_duplex_direction_type direction)
set the data transmission direction in single line bidirectiona half duplex mode of the spi periphera...
Definition: at32f415_spi.c:273
spi_hardware_cs_output_enable
void spi_hardware_cs_output_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the hardware cs output for the spi peripheral.
Definition: at32f415_spi.c:224
spi_i2s_flag_clear
void spi_i2s_flag_clear(spi_type *spi_x, uint32_t spi_i2s_flag)
clear flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:580
i2s_default_para_init
void i2s_default_para_init(i2s_init_type *i2s_init_struct)
i2s init config with its default value.
Definition: at32f415_spi.c:298
spi_enable
void spi_enable(spi_type *spi_x, confirm_state new_state)
enable or disable spi.
Definition: at32f415_spi.c:287
spi_i2s_dma_transmitter_enable
void spi_i2s_dma_transmitter_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma transmitter mode.
Definition: at32f415_spi.c:485
spi_frame_bit_num_set
void spi_frame_bit_num_set(spi_type *spi_x, spi_frame_bit_num_type bit_num)
set the data frame bit num for the spi peripheral.
Definition: at32f415_spi.c:257
spi_software_cs_internal_level_set
void spi_software_cs_internal_level_set(spi_type *spi_x, spi_software_cs_level_type level)
set the software cs internal level for the spi peripheral.
Definition: at32f415_spi.c:242
i2s_clock_polarity_type
i2s_clock_polarity_type
i2s clock polarity type
Definition: at32f415_spi.h:248
spi_master_slave_mode_type
spi_master_slave_mode_type
spi master/slave mode type
Definition: at32f415_spi.h:97
spi_software_cs_level_type
spi_software_cs_level_type
spi software cs internal level type
Definition: at32f415_spi.h:188
i2s_data_channel_format_type
i2s_data_channel_format_type
i2s data bit num and channel bit num type
Definition: at32f415_spi.h:226
spi_clock_phase_type
spi_clock_phase_type
spi clock phase (clkpha) type
Definition: at32f415_spi.h:115
i2s_audio_sampling_freq_type
i2s_audio_sampling_freq_type
i2s audio frequency type
Definition: at32f415_spi.h:209
spi_cs_mode_type
spi_cs_mode_type
spi cs mode type
Definition: at32f415_spi.h:124
spi_first_bit_type
spi_first_bit_type
spi transmit first bit (lsb/msb) type
Definition: at32f415_spi.h:150
spi_clock_polarity_type
spi_clock_polarity_type
spi clock polarity (clkpol) type
Definition: at32f415_spi.h:106
spi_half_duplex_direction_type
spi_half_duplex_direction_type
spi single line bidirectional direction type
Definition: at32f415_spi.h:179
spi_transmission_mode_type
spi_transmission_mode_type
spi transmission mode type
Definition: at32f415_spi.h:159
i2s_audio_protocol_type
i2s_audio_protocol_type
i2s audio protocol type
Definition: at32f415_spi.h:197
spi_mclk_freq_div_type
spi_mclk_freq_div_type
spi master clock frequency division type
Definition: at32f415_spi.h:133
spi_frame_bit_num_type
spi_frame_bit_num_type
spi frame bit num type
Definition: at32f415_spi.h:88
spi_crc_direction_type
spi_crc_direction_type
spi crc direction type
Definition: at32f415_spi.h:170
i2s_operation_mode_type
i2s_operation_mode_type
i2s operation mode type
Definition: at32f415_spi.h:237
I2S_CLOCK_POLARITY_LOW
@ I2S_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:249
I2S_CLOCK_POLARITY_HIGH
@ I2S_CLOCK_POLARITY_HIGH
Definition: at32f415_spi.h:250
SPI_MODE_SLAVE
@ SPI_MODE_SLAVE
Definition: at32f415_spi.h:98
SPI_MODE_MASTER
@ SPI_MODE_MASTER
Definition: at32f415_spi.h:99
SPI_SWCS_INTERNAL_LEVEL_LOW
@ SPI_SWCS_INTERNAL_LEVEL_LOW
Definition: at32f415_spi.h:189
SPI_SWCS_INTERNAL_LEVEL_HIGHT
@ SPI_SWCS_INTERNAL_LEVEL_HIGHT
Definition: at32f415_spi.h:190
I2S_DATA_16BIT_CHANNEL_16BIT
@ I2S_DATA_16BIT_CHANNEL_16BIT
Definition: at32f415_spi.h:227
I2S_DATA_24BIT_CHANNEL_32BIT
@ I2S_DATA_24BIT_CHANNEL_32BIT
Definition: at32f415_spi.h:229
I2S_DATA_32BIT_CHANNEL_32BIT
@ I2S_DATA_32BIT_CHANNEL_32BIT
Definition: at32f415_spi.h:230
I2S_DATA_16BIT_CHANNEL_32BIT
@ I2S_DATA_16BIT_CHANNEL_32BIT
Definition: at32f415_spi.h:228
SPI_CLOCK_PHASE_2EDGE
@ SPI_CLOCK_PHASE_2EDGE
Definition: at32f415_spi.h:117
SPI_CLOCK_PHASE_1EDGE
@ SPI_CLOCK_PHASE_1EDGE
Definition: at32f415_spi.h:116
I2S_AUDIO_FREQUENCY_44_1K
@ I2S_AUDIO_FREQUENCY_44_1K
Definition: at32f415_spi.h:216
I2S_AUDIO_FREQUENCY_11_025K
@ I2S_AUDIO_FREQUENCY_11_025K
Definition: at32f415_spi.h:212
I2S_AUDIO_FREQUENCY_48K
@ I2S_AUDIO_FREQUENCY_48K
Definition: at32f415_spi.h:217
I2S_AUDIO_FREQUENCY_DEFAULT
@ I2S_AUDIO_FREQUENCY_DEFAULT
Definition: at32f415_spi.h:210
I2S_AUDIO_FREQUENCY_8K
@ I2S_AUDIO_FREQUENCY_8K
Definition: at32f415_spi.h:211
I2S_AUDIO_FREQUENCY_32K
@ I2S_AUDIO_FREQUENCY_32K
Definition: at32f415_spi.h:215
I2S_AUDIO_FREQUENCY_192K
@ I2S_AUDIO_FREQUENCY_192K
Definition: at32f415_spi.h:219
I2S_AUDIO_FREQUENCY_96K
@ I2S_AUDIO_FREQUENCY_96K
Definition: at32f415_spi.h:218
I2S_AUDIO_FREQUENCY_22_05K
@ I2S_AUDIO_FREQUENCY_22_05K
Definition: at32f415_spi.h:214
I2S_AUDIO_FREQUENCY_16K
@ I2S_AUDIO_FREQUENCY_16K
Definition: at32f415_spi.h:213
SPI_CS_SOFTWARE_MODE
@ SPI_CS_SOFTWARE_MODE
Definition: at32f415_spi.h:126
SPI_CS_HARDWARE_MODE
@ SPI_CS_HARDWARE_MODE
Definition: at32f415_spi.h:125
SPI_FIRST_BIT_LSB
@ SPI_FIRST_BIT_LSB
Definition: at32f415_spi.h:152
SPI_FIRST_BIT_MSB
@ SPI_FIRST_BIT_MSB
Definition: at32f415_spi.h:151
SPI_CLOCK_POLARITY_HIGH
@ SPI_CLOCK_POLARITY_HIGH
Definition: at32f415_spi.h:108
SPI_CLOCK_POLARITY_LOW
@ SPI_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:107
SPI_HALF_DUPLEX_DIRECTION_TX
@ SPI_HALF_DUPLEX_DIRECTION_TX
Definition: at32f415_spi.h:181
SPI_HALF_DUPLEX_DIRECTION_RX
@ SPI_HALF_DUPLEX_DIRECTION_RX
Definition: at32f415_spi.h:180
SPI_TRANSMIT_HALF_DUPLEX_RX
@ SPI_TRANSMIT_HALF_DUPLEX_RX
Definition: at32f415_spi.h:162
SPI_TRANSMIT_FULL_DUPLEX
@ SPI_TRANSMIT_FULL_DUPLEX
Definition: at32f415_spi.h:160
SPI_TRANSMIT_HALF_DUPLEX_TX
@ SPI_TRANSMIT_HALF_DUPLEX_TX
Definition: at32f415_spi.h:163
SPI_TRANSMIT_SIMPLEX_RX
@ SPI_TRANSMIT_SIMPLEX_RX
Definition: at32f415_spi.h:161
I2S_AUDIO_PROTOCOL_PCM_LONG
@ I2S_AUDIO_PROTOCOL_PCM_LONG
Definition: at32f415_spi.h:202
I2S_AUDIO_PROTOCOL_LSB
@ I2S_AUDIO_PROTOCOL_LSB
Definition: at32f415_spi.h:200
I2S_AUDIO_PROTOCOL_MSB
@ I2S_AUDIO_PROTOCOL_MSB
Definition: at32f415_spi.h:199
I2S_AUDIO_PROTOCOL_PHILLIPS
@ I2S_AUDIO_PROTOCOL_PHILLIPS
Definition: at32f415_spi.h:198
I2S_AUDIO_PROTOCOL_PCM_SHORT
@ I2S_AUDIO_PROTOCOL_PCM_SHORT
Definition: at32f415_spi.h:201
SPI_MCLK_DIV_16
@ SPI_MCLK_DIV_16
Definition: at32f415_spi.h:137
SPI_MCLK_DIV_64
@ SPI_MCLK_DIV_64
Definition: at32f415_spi.h:139
SPI_MCLK_DIV_128
@ SPI_MCLK_DIV_128
Definition: at32f415_spi.h:140
SPI_MCLK_DIV_4
@ SPI_MCLK_DIV_4
Definition: at32f415_spi.h:135
SPI_MCLK_DIV_512
@ SPI_MCLK_DIV_512
Definition: at32f415_spi.h:142
SPI_MCLK_DIV_32
@ SPI_MCLK_DIV_32
Definition: at32f415_spi.h:138
SPI_MCLK_DIV_2
@ SPI_MCLK_DIV_2
Definition: at32f415_spi.h:134
SPI_MCLK_DIV_1024
@ SPI_MCLK_DIV_1024
Definition: at32f415_spi.h:143
SPI_MCLK_DIV_256
@ SPI_MCLK_DIV_256
Definition: at32f415_spi.h:141
SPI_MCLK_DIV_8
@ SPI_MCLK_DIV_8
Definition: at32f415_spi.h:136
SPI_FRAME_8BIT
@ SPI_FRAME_8BIT
Definition: at32f415_spi.h:89
SPI_FRAME_16BIT
@ SPI_FRAME_16BIT
Definition: at32f415_spi.h:90
SPI_CRC_RX
@ SPI_CRC_RX
Definition: at32f415_spi.h:171
SPI_CRC_TX
@ SPI_CRC_TX
Definition: at32f415_spi.h:172
I2S_MODE_MASTER_TX
@ I2S_MODE_MASTER_TX
Definition: at32f415_spi.h:240
I2S_MODE_MASTER_RX
@ I2S_MODE_MASTER_RX
Definition: at32f415_spi.h:241
I2S_MODE_SLAVE_RX
@ I2S_MODE_SLAVE_RX
Definition: at32f415_spi.h:239
I2S_MODE_SLAVE_TX
@ I2S_MODE_SLAVE_TX
Definition: at32f415_spi.h:238
i2s_init_type
i2s init type
Definition: at32f415_spi.h:272
i2s_init_type::audio_sampling_freq
i2s_audio_sampling_freq_type audio_sampling_freq
Definition: at32f415_spi.h:275
i2s_init_type::data_channel_format
i2s_data_channel_format_type data_channel_format
Definition: at32f415_spi.h:276
i2s_init_type::mclk_output_enable
confirm_state mclk_output_enable
Definition: at32f415_spi.h:278
i2s_init_type::audio_protocol
i2s_audio_protocol_type audio_protocol
Definition: at32f415_spi.h:274
i2s_init_type::operation_mode
i2s_operation_mode_type operation_mode
Definition: at32f415_spi.h:273
i2s_init_type::clock_polarity
i2s_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:277
spi_init_type
spi init type
Definition: at32f415_spi.h:257
spi_init_type::master_slave_mode
spi_master_slave_mode_type master_slave_mode
Definition: at32f415_spi.h:259
spi_init_type::first_bit_transmission
spi_first_bit_type first_bit_transmission
Definition: at32f415_spi.h:261
spi_init_type::frame_bit_num
spi_frame_bit_num_type frame_bit_num
Definition: at32f415_spi.h:262
spi_init_type::clock_polarity
spi_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:263
spi_init_type::cs_mode_selection
spi_cs_mode_type cs_mode_selection
Definition: at32f415_spi.h:265
spi_init_type::mclk_freq_division
spi_mclk_freq_div_type mclk_freq_division
Definition: at32f415_spi.h:260
spi_init_type::transmission_mode
spi_transmission_mode_type transmission_mode
Definition: at32f415_spi.h:258
spi_init_type::clock_phase
spi_clock_phase_type clock_phase
Definition: at32f415_spi.h:264
spi_type
type define spi register all
Definition: at32f415_spi.h:285
spi_type::tdbe
__IO uint32_t tdbe
Definition: at32f415_spi.h:342
spi_type::clkpha
__IO uint32_t clkpha
Definition: at32f415_spi.h:295
spi_type::hwcsoe
__IO uint32_t hwcsoe
Definition: at32f415_spi.h:323
spi_type::slben
__IO uint32_t slben
Definition: at32f415_spi.h:308
spi_type::ntc
__IO uint32_t ntc
Definition: at32f415_spi.h:305
spi_type::mdiv_h
__IO uint32_t mdiv_h
Definition: at32f415_spi.h:328
spi_type::rdbfie
__IO uint32_t rdbfie
Definition: at32f415_spi.h:326
spi_type::mmerr
__IO uint32_t mmerr
Definition: at32f415_spi.h:346
spi_type::dmaren
__IO uint32_t dmaren
Definition: at32f415_spi.h:321
spi_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_spi.h:329
spi_type::bf
__IO uint32_t bf
Definition: at32f415_spi.h:348
spi_type::i2sdbn
__IO uint32_t i2sdbn
Definition: at32f415_spi.h:414
spi_type::rcrc
__IO uint32_t rcrc
Definition: at32f415_spi.h:384
spi_type::errie
__IO uint32_t errie
Definition: at32f415_spi.h:325
spi_type::i2scbn
__IO uint32_t i2scbn
Definition: at32f415_spi.h:413
spi_type::i2sclkpol
__IO uint32_t i2sclkpol
Definition: at32f415_spi.h:415
spi_type::cpoly
__IO uint32_t cpoly
Definition: at32f415_spi.h:371
spi_type::ctrl1
__IO uint32_t ctrl1
Definition: at32f415_spi.h:292
spi_type::i2sodd
__IO uint32_t i2sodd
Definition: at32f415_spi.h:435
spi_type::swcsil
__IO uint32_t swcsil
Definition: at32f415_spi.h:301
spi_type::i2sclk
__IO uint32_t i2sclk
Definition: at32f415_spi.h:431
spi_type::tcrc
__IO uint32_t tcrc
Definition: at32f415_spi.h:397
spi_type::acs
__IO uint32_t acs
Definition: at32f415_spi.h:343
spi_type::i2smclkoe
__IO uint32_t i2smclkoe
Definition: at32f415_spi.h:436
spi_type::ltf
__IO uint32_t ltf
Definition: at32f415_spi.h:300
spi_type::clkpol
__IO uint32_t clkpol
Definition: at32f415_spi.h:296
spi_type::slbtd
__IO uint32_t slbtd
Definition: at32f415_spi.h:307
spi_type::dmaten
__IO uint32_t dmaten
Definition: at32f415_spi.h:322
spi_type::ccen
__IO uint32_t ccen
Definition: at32f415_spi.h:306
spi_type::fbn
__IO uint32_t fbn
Definition: at32f415_spi.h:304
spi_type::dt
__IO uint32_t dt
Definition: at32f415_spi.h:358
spi_type::msten
__IO uint32_t msten
Definition: at32f415_spi.h:297
spi_type::ccerr
__IO uint32_t ccerr
Definition: at32f415_spi.h:345
spi_type::sts
__IO uint32_t sts
Definition: at32f415_spi.h:338
spi_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_spi.h:309
spi_type::i2sdiv_h
__IO uint32_t i2sdiv_h
Definition: at32f415_spi.h:437
spi_type::opersel
__IO uint32_t opersel
Definition: at32f415_spi.h:419
spi_type::i2sdiv_l
__IO uint32_t i2sdiv_l
Definition: at32f415_spi.h:434
spi_type::i2smsel
__IO uint32_t i2smsel
Definition: at32f415_spi.h:421
spi_type::pcmfssel
__IO uint32_t pcmfssel
Definition: at32f415_spi.h:418
spi_type::ctrl2
__IO uint32_t ctrl2
Definition: at32f415_spi.h:318
spi_type::roerr
__IO uint32_t roerr
Definition: at32f415_spi.h:347
spi_type::i2sctrl
__IO uint32_t i2sctrl
Definition: at32f415_spi.h:410
spi_type::stdsel
__IO uint32_t stdsel
Definition: at32f415_spi.h:416
spi_type::rdbf
__IO uint32_t rdbf
Definition: at32f415_spi.h:341
spi_type::tuerr
__IO uint32_t tuerr
Definition: at32f415_spi.h:344
spi_type::mdiv_l
__IO uint32_t mdiv_l
Definition: at32f415_spi.h:298
spi_type::spien
__IO uint32_t spien
Definition: at32f415_spi.h:299
spi_type::swcsen
__IO uint32_t swcsen
Definition: at32f415_spi.h:302
spi_type::ora
__IO uint32_t ora
Definition: at32f415_spi.h:303
spi_type::i2sen
__IO uint32_t i2sen
Definition: at32f415_spi.h:420
spi_type::tdbeie
__IO uint32_t tdbeie
Definition: at32f415_spi.h:327


AT32F415 Firmwary Library: at32f415_tmr.c Source File

  • libraries
  • drivers
  • src
at32f415_tmr.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef TMR_MODULE_ENABLED
39
51void tmr_reset(tmr_type *tmr_x)
52{
53 if(tmr_x == TMR1)
54 {
55 crm_periph_reset(CRM_TMR1_PERIPH_RESET, TRUE);
56 crm_periph_reset(CRM_TMR1_PERIPH_RESET, FALSE);
57 }
58 else if(tmr_x == TMR2)
59 {
60 crm_periph_reset(CRM_TMR2_PERIPH_RESET, TRUE);
61 crm_periph_reset(CRM_TMR2_PERIPH_RESET, FALSE);
62 }
63 else if(tmr_x == TMR3)
64 {
65 crm_periph_reset(CRM_TMR3_PERIPH_RESET, TRUE);
66 crm_periph_reset(CRM_TMR3_PERIPH_RESET, FALSE);
67 }
68 else if(tmr_x == TMR4)
69 {
70 crm_periph_reset(CRM_TMR4_PERIPH_RESET, TRUE);
71 crm_periph_reset(CRM_TMR4_PERIPH_RESET, FALSE);
72 }
73 else if(tmr_x == TMR5)
74 {
75 crm_periph_reset(CRM_TMR5_PERIPH_RESET, TRUE);
76 crm_periph_reset(CRM_TMR5_PERIPH_RESET, FALSE);
77 }
78 else if(tmr_x == TMR9)
79 {
80 crm_periph_reset(CRM_TMR9_PERIPH_RESET, TRUE);
81 crm_periph_reset(CRM_TMR9_PERIPH_RESET, FALSE);
82 }
83 else if(tmr_x == TMR10)
84 {
85 crm_periph_reset(CRM_TMR10_PERIPH_RESET, TRUE);
86 crm_periph_reset(CRM_TMR10_PERIPH_RESET, FALSE);
87 }
88 else if(tmr_x == TMR11)
89 {
90 crm_periph_reset(CRM_TMR11_PERIPH_RESET, TRUE);
91 crm_periph_reset(CRM_TMR11_PERIPH_RESET, FALSE);
92 }
93}
94
103void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
104{
105 /* tmr counter enable */
106 tmr_x->ctrl1_bit.tmren = new_state;
107}
108
115void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
116{
117 tmr_output_struct->oc_mode = TMR_OUTPUT_CONTROL_OFF;
118 tmr_output_struct->oc_idle_state = FALSE;
119 tmr_output_struct->occ_idle_state = FALSE;
120 tmr_output_struct->oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
121 tmr_output_struct->occ_polarity = TMR_OUTPUT_ACTIVE_HIGH;
122 tmr_output_struct->oc_output_state = FALSE;
123 tmr_output_struct->occ_output_state = FALSE;
124}
125
132void tmr_input_default_para_init(tmr_input_config_type *tmr_input_struct)
133{
134 tmr_input_struct->input_channel_select = TMR_SELECT_CHANNEL_1;
135 tmr_input_struct->input_polarity_select = TMR_INPUT_RISING_EDGE;
136 tmr_input_struct->input_mapped_select = TMR_CC_CHANNEL_MAPPED_DIRECT;
137 tmr_input_struct->input_filter_value = 0x0;
138}
139
146void tmr_brkdt_default_para_init(tmr_brkdt_config_type *tmr_brkdt_struct)
147{
148 tmr_brkdt_struct->deadtime = 0x0;
149 tmr_brkdt_struct->brk_polarity = TMR_BRK_INPUT_ACTIVE_LOW;
150 tmr_brkdt_struct->wp_level = TMR_WP_OFF;
151 tmr_brkdt_struct->auto_output_enable = FALSE ;
152 tmr_brkdt_struct->fcsoen_state = FALSE ;
153 tmr_brkdt_struct->fcsodis_state = FALSE ;
154 tmr_brkdt_struct->brk_enable = FALSE ;
155}
156
167void tmr_base_init(tmr_type* tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
168{
169 /* set the pr value */
170 tmr_x->pr = tmr_pr;
171
172 /* set the div value */
173 tmr_x->div = tmr_div;
174
175 /* trigger the overflow event to immediately reload pr value and div value */
176 tmr_x->swevt_bit.ovfswtr = TRUE;
177}
178
191void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
192{
193 /* set tmr clock source division */
194 tmr_x->ctrl1_bit.clkdiv = tmr_clock_div;
195}
196
211void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
212{
213 /* set the cnt direct */
214 tmr_x->ctrl1_bit.cnt_dir = tmr_cnt_dir;
215}
216
225void tmr_repetition_counter_set(tmr_type *tmr_x, uint8_t tmr_rpr_value)
226{
227 /* set the repetition counter value */
228 if(tmr_x == TMR1)
229
230 {
231 tmr_x->rpr_bit.rpr = tmr_rpr_value;
232 }
233}
234
244void tmr_counter_value_set(tmr_type *tmr_x, uint32_t tmr_cnt_value)
245{
246 /* set the tmr counter value */
247 tmr_x->cval = tmr_cnt_value;
248}
249
257uint32_t tmr_counter_value_get(tmr_type *tmr_x)
258{
259 return tmr_x->cval;
260}
261
271void tmr_div_value_set(tmr_type *tmr_x, uint32_t tmr_div_value)
272{
273 /* set the tmr div value */
274 tmr_x->div = tmr_div_value;
275}
276
284uint32_t tmr_div_value_get(tmr_type *tmr_x)
285{
286 return tmr_x->div;
287}
288
304void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel,
305 tmr_output_config_type *tmr_output_struct)
306{
307 uint16_t channel_index = 0, channel_c_index = 0, channel = 0;
308
309 /* get channel idle state bit position in ctrl2 register */
310 channel_index = (uint16_t)(tmr_output_struct->oc_idle_state << (8 + tmr_channel));
311
312 /* get channel complementary idle state bit position in ctrl2 register */
313 channel_c_index = (uint16_t)(tmr_output_struct->occ_idle_state << (9 + tmr_channel));
314
315 if(tmr_x == TMR1)
316 {
317 /* set output channel complementary idle state */
318 tmr_x->ctrl2 &= ~channel_c_index;
319 tmr_x->ctrl2 |= channel_c_index;
320 }
321
322 /* set output channel idle state */
323 tmr_x->ctrl2 &= ~channel_index;
324 tmr_x->ctrl2 |= channel_index;
325
326 /* set channel output mode */
327 channel = tmr_channel;
328
329 switch(channel)
330 {
331 case TMR_SELECT_CHANNEL_1:
332 tmr_x->cm1_output_bit.c1octrl = tmr_output_struct->oc_mode;
333 break;
334
335 case TMR_SELECT_CHANNEL_2:
336 tmr_x->cm1_output_bit.c2octrl = tmr_output_struct->oc_mode;
337 break;
338
339 case TMR_SELECT_CHANNEL_3:
340 tmr_x->cm2_output_bit.c3octrl = tmr_output_struct->oc_mode;
341 break;
342
343 case TMR_SELECT_CHANNEL_4:
344 tmr_x->cm2_output_bit.c4octrl = tmr_output_struct->oc_mode;
345 break;
346
347 default:
348 break;
349 }
350
351 /* get channel polarity bit position in cctrl register */
352 channel_index = (uint16_t)(tmr_output_struct->oc_polarity << ((tmr_channel * 2) + 1));
353
354 /* get channel complementary polarity bit position in cctrl register */
355 channel_c_index = (uint16_t)(tmr_output_struct->occ_polarity << ((tmr_channel * 2) + 3));
356
357 if(tmr_x == TMR1)
358 {
359 /* set output channel complementary polarity */
360 tmr_x->cctrl &= ~channel_c_index;
361 tmr_x->cctrl |= channel_c_index;
362 }
363
364 /* set output channel polarity */
365 tmr_x->cctrl &= ~channel_index;
366 tmr_x->cctrl |= channel_index;
367
368 /* get channel enable bit position in cctrl register */
369 channel_index = (uint16_t)(tmr_output_struct->oc_output_state << (tmr_channel * 2));
370
371 /* get channel complementary enable bit position in cctrl register */
372 channel_c_index = (uint16_t)(tmr_output_struct->occ_output_state << ((tmr_channel * 2) + 2));
373
374 if(tmr_x == TMR1)
375 {
376 /* set output channel complementary enable bit */
377 tmr_x->cctrl &= ~channel_c_index;
378 tmr_x->cctrl |= channel_c_index;
379 }
380
381 /* set output channel enable bit */
382 tmr_x->cctrl &= ~channel_index;
383 tmr_x->cctrl |= channel_index;
384}
385
409void tmr_output_channel_mode_select(tmr_type *tmr_x, tmr_channel_select_type tmr_channel,
410 tmr_output_control_mode_type oc_mode)
411{
412 uint16_t channel;
413
414 channel = tmr_channel;
415
416 switch(channel)
417 {
418 case TMR_SELECT_CHANNEL_1:
419 tmr_x->cm1_output_bit.c1octrl = oc_mode;
420 break;
421
422 case TMR_SELECT_CHANNEL_2:
423 tmr_x->cm1_output_bit.c2octrl = oc_mode;
424 break;
425
426 case TMR_SELECT_CHANNEL_3:
427 tmr_x->cm2_output_bit.c3octrl = oc_mode;
428 break;
429
430 case TMR_SELECT_CHANNEL_4:
431 tmr_x->cm2_output_bit.c4octrl = oc_mode;
432 break;
433
434 default:
435 break;
436 }
437}
448void tmr_period_value_set(tmr_type *tmr_x, uint32_t tmr_pr_value)
449{
450 /* set tmr period value */
451 tmr_x->pr = tmr_pr_value;
452}
453
463uint32_t tmr_period_value_get(tmr_type *tmr_x)
464{
465 return tmr_x->pr;
466}
467
483void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel,
484 uint32_t tmr_channel_value)
485{
486 uint16_t channel;
487
488 channel = tmr_channel;
489
490 /* set tmr channel value */
491 switch(channel)
492 {
493 case TMR_SELECT_CHANNEL_1:
494 tmr_x->c1dt = tmr_channel_value;
495 break;
496
497 case TMR_SELECT_CHANNEL_2:
498 tmr_x->c2dt = tmr_channel_value;
499 break;
500
501 case TMR_SELECT_CHANNEL_3:
502 tmr_x->c3dt = tmr_channel_value;
503 break;
504
505 case TMR_SELECT_CHANNEL_4:
506 tmr_x->c4dt = tmr_channel_value;
507 break;
508
509 default:
510 break;
511 }
512}
513
527uint32_t tmr_channel_value_get(tmr_type *tmr_x, tmr_channel_select_type tmr_channel)
528{
529 uint32_t cc_value_get = 0;
530 uint16_t channel;
531
532 channel = tmr_channel;
533
534 /* get tmr channel value */
535 switch(channel)
536 {
537 case TMR_SELECT_CHANNEL_1:
538 cc_value_get = tmr_x->c1dt;
539 break;
540
541 case TMR_SELECT_CHANNEL_2:
542 cc_value_get = tmr_x->c2dt;
543 break;
544
545 case TMR_SELECT_CHANNEL_3:
546 cc_value_get = tmr_x->c3dt;
547 break;
548
549 case TMR_SELECT_CHANNEL_4:
550 cc_value_get = tmr_x->c4dt;
551 break;
552
553 default:
554 break;
555 }
556
557 return cc_value_get;
558}
567void tmr_period_buffer_enable(tmr_type *tmr_x, confirm_state new_state)
568{
569 /* tmr period buffer set */
570 tmr_x->ctrl1_bit.prben = new_state;
571}
572
587void tmr_output_channel_buffer_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel,
588 confirm_state new_state)
589{
590 uint16_t channel;
591
592 channel = tmr_channel;
593
594 /* get tmr channel value */
595 switch(channel)
596 {
597 case TMR_SELECT_CHANNEL_1:
598 tmr_x->cm1_output_bit.c1oben = new_state;
599 break;
600
601 case TMR_SELECT_CHANNEL_2:
602 tmr_x->cm1_output_bit.c2oben = new_state;
603 break;
604
605 case TMR_SELECT_CHANNEL_3:
606 tmr_x->cm2_output_bit.c3oben = new_state;
607 break;
608
609 case TMR_SELECT_CHANNEL_4:
610 tmr_x->cm2_output_bit.c4oben = new_state;
611 break;
612
613 default:
614 break;
615 }
616}
617
632void tmr_output_channel_immediately_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel,
633 confirm_state new_state)
634{
635 uint16_t channel;
636
637 channel = tmr_channel;
638
639 /* get tmr channel value */
640 switch(channel)
641 {
642 case TMR_SELECT_CHANNEL_1:
643 tmr_x->cm1_output_bit.c1oien = new_state;
644 break;
645
646 case TMR_SELECT_CHANNEL_2:
647 tmr_x->cm1_output_bit.c2oien = new_state;
648 break;
649
650 case TMR_SELECT_CHANNEL_3:
651 tmr_x->cm2_output_bit.c3oien = new_state;
652 break;
653
654 case TMR_SELECT_CHANNEL_4:
655 tmr_x->cm2_output_bit.c4oien = new_state;
656 break;
657
658 default:
659 break;
660 }
661}
662
677void tmr_output_channel_switch_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel,
678 confirm_state new_state)
679{
680 uint16_t channel;
681
682 channel = tmr_channel;
683
684 /* get tmr channel value */
685 switch(channel)
686 {
687 case TMR_SELECT_CHANNEL_1:
688 tmr_x->cm1_output_bit.c1osen = new_state;
689 break;
690
691 case TMR_SELECT_CHANNEL_2:
692 tmr_x->cm1_output_bit.c2osen = new_state;
693 break;
694
695 case TMR_SELECT_CHANNEL_3:
696 tmr_x->cm2_output_bit.c3osen = new_state;
697 break;
698
699 case TMR_SELECT_CHANNEL_4:
700 tmr_x->cm2_output_bit.c4osen = new_state;
701 break;
702
703 default:
704 break;
705 }
706}
707
716void tmr_one_cycle_mode_enable(tmr_type *tmr_x, confirm_state new_state)
717{
718 /* tmr one cycle mode enable */
719 tmr_x->ctrl1_bit.ocmen = new_state;
720}
721
730void tmr_32_bit_function_enable (tmr_type *tmr_x, confirm_state new_state)
731{
732 /* tmr 32 bit function(plus mode) enable,only for TMR2/TMR5 */
733 if((tmr_x == TMR2) || (tmr_x == TMR5))
734 {
735 tmr_x->ctrl1_bit.pmen = new_state;
736 }
737}
738
747void tmr_overflow_request_source_set(tmr_type *tmr_x, confirm_state new_state)
748{
749 tmr_x->ctrl1_bit.ovfs = new_state;
750}
751
760void tmr_overflow_event_disable(tmr_type *tmr_x, confirm_state new_state)
761{
762 tmr_x->ctrl1_bit.ovfen = new_state;
763}
764
780void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct,
781 tmr_channel_input_divider_type divider_factor)
782{
783 uint16_t channel = 0;
784
785 /* get channel selected */
786 channel = input_struct->input_channel_select;
787
788 switch(channel)
789 {
790 case TMR_SELECT_CHANNEL_1:
791 tmr_x->cctrl_bit.c1p = (uint32_t)input_struct->input_polarity_select;
792 tmr_x->cctrl_bit.c1cp = (input_struct->input_polarity_select & 0x2) >> 1;
793 tmr_x->cm1_input_bit.c1c = input_struct->input_mapped_select;
794 tmr_x->cm1_input_bit.c1df = input_struct->input_filter_value;
795 tmr_x->cm1_input_bit.c1idiv = divider_factor;
796 tmr_x->cctrl_bit.c1en = TRUE;
797 break;
798
799 case TMR_SELECT_CHANNEL_2:
800 tmr_x->cctrl_bit.c2p = (uint32_t)input_struct->input_polarity_select;
801 tmr_x->cctrl_bit.c2cp = (input_struct->input_polarity_select & 0x2) >> 1;
802 tmr_x->cm1_input_bit.c2c = input_struct->input_mapped_select;
803 tmr_x->cm1_input_bit.c2df = input_struct->input_filter_value;
804 tmr_x->cm1_input_bit.c2idiv = divider_factor;
805 tmr_x->cctrl_bit.c2en = TRUE;
806 break;
807
808 case TMR_SELECT_CHANNEL_3:
809 tmr_x->cctrl_bit.c3p = (uint32_t)input_struct->input_polarity_select;
810 tmr_x->cctrl_bit.c3cp = (input_struct->input_polarity_select & 0x2) >> 1;
811 tmr_x->cm2_input_bit.c3c = input_struct->input_mapped_select;
812 tmr_x->cm2_input_bit.c3df = input_struct->input_filter_value;
813 tmr_x->cm2_input_bit.c3idiv = divider_factor;
814 tmr_x->cctrl_bit.c3en = TRUE;
815 break;
816
817 case TMR_SELECT_CHANNEL_4:
818 tmr_x->cctrl_bit.c4p = (uint32_t)input_struct->input_polarity_select;
819 tmr_x->cm2_input_bit.c4c = input_struct->input_mapped_select;
820 tmr_x->cm2_input_bit.c4df = input_struct->input_filter_value;
821 tmr_x->cm2_input_bit.c4idiv = divider_factor;
822 tmr_x->cctrl_bit.c4en = TRUE;
823 break;
824
825 default:
826 break;
827 }
828}
829
847void tmr_channel_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
848{
849 uint16_t channel;
850
851 channel = tmr_channel;
852
853 switch(channel)
854 {
855 case TMR_SELECT_CHANNEL_1:
856 tmr_x->cctrl_bit.c1en = new_state;
857 break;
858
859 case TMR_SELECT_CHANNEL_1C:
860 tmr_x->cctrl_bit.c1cen = new_state;
861 break;
862
863 case TMR_SELECT_CHANNEL_2:
864 tmr_x->cctrl_bit.c2en = new_state;
865 break;
866
867 case TMR_SELECT_CHANNEL_2C:
868 tmr_x->cctrl_bit.c2cen = new_state;
869 break;
870
871 case TMR_SELECT_CHANNEL_3:
872 tmr_x->cctrl_bit.c3en = new_state;
873 break;
874
875 case TMR_SELECT_CHANNEL_3C:
876 tmr_x->cctrl_bit.c3cen = new_state;
877 break;
878
879 case TMR_SELECT_CHANNEL_4:
880 tmr_x->cctrl_bit.c4en = new_state;
881 break;
882
883 default:
884 break;
885 }
886}
887
902void tmr_input_channel_filter_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel,
903 uint16_t filter_value)
904{
905 uint16_t channel;
906
907 channel = tmr_channel;
908
909 switch(channel)
910 {
911 case TMR_SELECT_CHANNEL_1:
912 tmr_x->cm1_input_bit.c1df = filter_value;
913 break;
914
915 case TMR_SELECT_CHANNEL_2:
916 tmr_x->cm1_input_bit.c2df = filter_value;
917 break;
918
919 case TMR_SELECT_CHANNEL_3:
920 tmr_x->cm2_input_bit.c3df = filter_value;
921 break;
922
923 case TMR_SELECT_CHANNEL_4:
924 tmr_x->cm2_input_bit.c4df = filter_value;
925 break;
926
927 default:
928 break;
929 }
930}
931
947void tmr_pwm_input_config(tmr_type *tmr_x, tmr_input_config_type *input_struct,
948 tmr_channel_input_divider_type divider_factor)
949{
950 uint16_t channel = 0;
951
952 /* get channel selected */
953 channel = input_struct->input_channel_select;
954
955 switch(channel)
956 {
957 case TMR_SELECT_CHANNEL_1:
958 if(input_struct->input_polarity_select == TMR_INPUT_RISING_EDGE)
959 {
960 /* set channel polarity */
961 tmr_x->cctrl_bit.c1p = TMR_INPUT_RISING_EDGE;
962 tmr_x->cctrl_bit.c2p = TMR_INPUT_FALLING_EDGE;
963 }
964 else if(input_struct->input_polarity_select == TMR_INPUT_FALLING_EDGE)
965 {
966 /* set channel polarity */
967 tmr_x->cctrl_bit.c1p = TMR_INPUT_FALLING_EDGE;
968 tmr_x->cctrl_bit.c2p = TMR_INPUT_RISING_EDGE;
969 }
970
971 if(input_struct->input_mapped_select == TMR_CC_CHANNEL_MAPPED_DIRECT)
972 {
973 /* ic1 is mapped on ti1 */
974 tmr_x->cm1_input_bit.c1c = TMR_CC_CHANNEL_MAPPED_DIRECT;
975
976 /* ic1 is mapped on ti2 */
977 tmr_x->cm1_input_bit.c2c = TMR_CC_CHANNEL_MAPPED_INDIRECT;
978 }
979 else if(input_struct->input_mapped_select == TMR_CC_CHANNEL_MAPPED_INDIRECT)
980 {
981 /* ic1 is mapped on ti1 */
982 tmr_x->cm1_input_bit.c1c = TMR_CC_CHANNEL_MAPPED_INDIRECT;
983
984 /* ic1 is mapped on ti2 */
985 tmr_x->cm1_input_bit.c2c = TMR_CC_CHANNEL_MAPPED_DIRECT;
986 }
987
988 /* set input ch1 and ch2 filter value*/
989 tmr_x->cm1_input_bit.c1df = input_struct->input_filter_value;
990 tmr_x->cm1_input_bit.c2df = input_struct->input_filter_value;
991
992 /*set input ch1 and ch2 divider value*/
993 tmr_x->cm1_input_bit.c1idiv = divider_factor;
994 tmr_x->cm1_input_bit.c2idiv = divider_factor;
995
996 tmr_x->cctrl_bit.c1en = TRUE;
997 tmr_x->cctrl_bit.c2en = TRUE;
998 break;
999
1000 case TMR_SELECT_CHANNEL_2:
1001 if(input_struct->input_polarity_select == TMR_INPUT_RISING_EDGE)
1002 {
1003 /* set channel polarity */
1004 tmr_x->cctrl_bit.c2p = TMR_INPUT_RISING_EDGE;
1005 tmr_x->cctrl_bit.c1p = TMR_INPUT_FALLING_EDGE;
1006 }
1007 else if(input_struct->input_polarity_select == TMR_INPUT_FALLING_EDGE)
1008 {
1009 /* set channel polarity */
1010 tmr_x->cctrl_bit.c2p = TMR_INPUT_FALLING_EDGE;
1011 tmr_x->cctrl_bit.c1p = TMR_INPUT_RISING_EDGE;
1012 }
1013
1014 if(input_struct->input_mapped_select == TMR_CC_CHANNEL_MAPPED_DIRECT)
1015 {
1016 /* set mapped direct */
1017 tmr_x->cm1_input_bit.c2c = TMR_CC_CHANNEL_MAPPED_DIRECT;
1018 tmr_x->cm1_input_bit.c1c = TMR_CC_CHANNEL_MAPPED_INDIRECT;
1019 }
1020 else if(input_struct->input_mapped_select == TMR_CC_CHANNEL_MAPPED_INDIRECT)
1021 {
1022 /* set mapped direct */
1023 tmr_x->cm1_input_bit.c2c = TMR_CC_CHANNEL_MAPPED_INDIRECT;
1024 tmr_x->cm1_input_bit.c1c = TMR_CC_CHANNEL_MAPPED_DIRECT;
1025 }
1026
1027 /* set input ch1 and ch2 filter value*/
1028 tmr_x->cm1_input_bit.c1df = input_struct->input_filter_value;
1029 tmr_x->cm1_input_bit.c2df = input_struct->input_filter_value;
1030
1031 /*set input ch1 and ch2 divider value*/
1032 tmr_x->cm1_input_bit.c1idiv = divider_factor;
1033 tmr_x->cm1_input_bit.c2idiv = divider_factor;
1034
1035 tmr_x->cctrl_bit.c1en = TRUE;
1036 tmr_x->cctrl_bit.c2en = TRUE;
1037 break;
1038
1039 default:
1040 break;
1041 }
1042}
1043
1055void tmr_channel1_input_select(tmr_type *tmr_x, tmr_channel1_input_connected_type ti1_connect)
1056{
1057 tmr_x->ctrl2_bit.c1insel = ti1_connect;
1058}
1059
1079void tmr_input_channel_divider_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel,
1080 tmr_channel_input_divider_type divider_factor)
1081{
1082 uint16_t channel;
1083
1084 channel = tmr_channel;
1085
1086 switch(channel)
1087 {
1088 case TMR_SELECT_CHANNEL_1:
1089 tmr_x->cm1_input_bit.c1idiv = divider_factor;
1090 break;
1091
1092 case TMR_SELECT_CHANNEL_2:
1093 tmr_x->cm1_input_bit.c2idiv = divider_factor;
1094 break;
1095
1096 case TMR_SELECT_CHANNEL_3:
1097 tmr_x->cm2_input_bit.c3idiv = divider_factor;
1098 break;
1099
1100 case TMR_SELECT_CHANNEL_4:
1101 tmr_x->cm2_input_bit.c4idiv = divider_factor;
1102 break;
1103
1104 default:
1105 break;
1106 }
1107}
1108
1126void tmr_primary_mode_select(tmr_type *tmr_x, tmr_primary_select_type primary_mode)
1127{
1128 tmr_x->ctrl2_bit.ptos = primary_mode;
1129}
1130
1148void tmr_sub_mode_select(tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
1149{
1150 tmr_x->stctrl_bit.smsel = sub_mode;
1151}
1152
1164void tmr_channel_dma_select(tmr_type *tmr_x, tmr_dma_request_source_type cc_dma_select)
1165{
1166 tmr_x->ctrl2_bit.drs = cc_dma_select;
1167}
1168
1177void tmr_hall_select(tmr_type *tmr_x, confirm_state new_state)
1178{
1179 tmr_x->ctrl2_bit.ccfs = new_state;
1180}
1181
1190void tmr_channel_buffer_enable(tmr_type *tmr_x, confirm_state new_state)
1191{
1192 tmr_x->ctrl2_bit.cbctrl = new_state;
1193}
1194
1212void tmr_trigger_input_select(tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
1213{
1214 tmr_x->stctrl_bit.stis = trigger_select;
1215}
1216
1225void tmr_sub_sync_mode_set(tmr_type *tmr_x, confirm_state new_state)
1226{
1227 tmr_x->stctrl_bit.sts = new_state;
1228}
1229
1247void tmr_dma_request_enable(tmr_type *tmr_x, tmr_dma_request_type dma_request, confirm_state new_state)
1248{
1249 if(new_state == TRUE)
1250 {
1251 tmr_x->iden |= dma_request;
1252 }
1253 else if(new_state == FALSE)
1254 {
1255 tmr_x->iden &= ~dma_request;
1256 }
1257}
1258
1277void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
1278{
1279 if(new_state == TRUE)
1280 {
1281 tmr_x->iden |= tmr_interrupt;
1282 }
1283 else if(new_state == FALSE)
1284 {
1285 tmr_x->iden &= ~tmr_interrupt;
1286 }
1287}
1288
1310 flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
1311{
1312 flag_status status = RESET;
1313
1314 if((tmr_x->ists & tmr_flag) != RESET)
1315 {
1316 status = SET;
1317 }
1318 else
1319 {
1320 status = RESET;
1321 }
1322
1323 return status;
1324}
1325
1347void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
1348{
1349 tmr_x->ists = ~tmr_flag;
1350}
1351
1369void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
1370{
1371 tmr_x->swevt |= tmr_event;
1372}
1373
1382void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state)
1383{
1384 tmr_x->brk_bit.oen = new_state;
1385}
1386
1394void tmr_internal_clock_set(tmr_type *tmr_x)
1395{
1396 tmr_x->stctrl_bit.smsel = TMR_SUB_MODE_DIABLE;
1397}
1398
1419void tmr_output_channel_polarity_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel,
1420 tmr_polarity_active_type oc_polarity)
1421{
1422 uint16_t channel;
1423
1424 channel = tmr_channel;
1425
1426 switch(channel)
1427 {
1428 case TMR_SELECT_CHANNEL_1:
1429 tmr_x->cctrl_bit.c1p = (uint32_t)oc_polarity;
1430 break;
1431
1432 case TMR_SELECT_CHANNEL_2:
1433 tmr_x->cctrl_bit.c2p = (uint32_t)oc_polarity;
1434 break;
1435
1436 case TMR_SELECT_CHANNEL_3:
1437 tmr_x->cctrl_bit.c3p = (uint32_t)oc_polarity;
1438 break;
1439
1440 case TMR_SELECT_CHANNEL_4:
1441 tmr_x->cctrl_bit.c4p = (uint32_t)oc_polarity;
1442 break;
1443
1444 case TMR_SELECT_CHANNEL_1C:
1445 tmr_x->cctrl_bit.c1cp = (uint32_t)oc_polarity;
1446 break;
1447
1448 case TMR_SELECT_CHANNEL_2C:
1449 tmr_x->cctrl_bit.c2cp = (uint32_t)oc_polarity;
1450 break;
1451
1452 case TMR_SELECT_CHANNEL_3C:
1453 tmr_x->cctrl_bit.c3cp = (uint32_t)oc_polarity;
1454 break;
1455
1456 default:
1457 break;
1458 }
1459}
1460
1479void tmr_external_clock_config(tmr_type *tmr_x, tmr_external_signal_divider_type es_divide,
1480 tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
1481{
1482 tmr_x->stctrl_bit.esdiv = es_divide;
1483 tmr_x->stctrl_bit.esp = es_polarity;
1484 tmr_x->stctrl_bit.esf = es_filter;
1485}
1486
1505void tmr_external_clock_mode1_config(tmr_type *tmr_x, tmr_external_signal_divider_type es_divide,
1506 tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
1507{
1508 tmr_external_clock_config(tmr_x, es_divide, es_polarity, es_filter);
1509 tmr_x->stctrl_bit.smsel = TMR_SUB_EXTERNAL_CLOCK_MODE_A;
1510 tmr_x->stctrl_bit.stis = TMR_SUB_INPUT_SEL_EXTIN;
1511}
1512
1531void tmr_external_clock_mode2_config(tmr_type *tmr_x, tmr_external_signal_divider_type es_divide,
1532 tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
1533{
1534 tmr_external_clock_config(tmr_x, es_divide, es_polarity, es_filter);
1535 tmr_x->stctrl_bit.ecmben = TRUE;
1536}
1537
1560void tmr_encoder_mode_config(tmr_type *tmr_x, tmr_encoder_mode_type encoder_mode, tmr_input_polarity_type
1561 ic1_polarity, tmr_input_polarity_type ic2_polarity)
1562{
1563 tmr_x->stctrl_bit.smsel = encoder_mode;
1564
1565 /* set ic1 polarity */
1566 tmr_x->cctrl_bit.c1p = (ic1_polarity & 0x1);
1567 tmr_x->cctrl_bit.c1cp = (ic1_polarity >> 1);
1568 /* set ic1 as input channel */
1569 tmr_x->cm1_input_bit.c1c = TMR_CC_CHANNEL_MAPPED_DIRECT;
1570
1571 /* set ic2 polarity */
1572 tmr_x->cctrl_bit.c2p = (ic2_polarity & 0x1);
1573 tmr_x->cctrl_bit.c2cp = (ic2_polarity >> 1);
1574 /* set ic2 as input channel */
1575 tmr_x->cm1_input_bit.c2c = TMR_CC_CHANNEL_MAPPED_DIRECT;
1576}
1577
1595void tmr_force_output_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel,
1596 tmr_force_output_type force_output)
1597{
1598 uint16_t channel;
1599
1600 channel = tmr_channel;
1601
1602 switch(channel)
1603 {
1604 case TMR_SELECT_CHANNEL_1:
1605 tmr_x->cm1_output_bit.c1octrl = force_output;
1606 break;
1607
1608 case TMR_SELECT_CHANNEL_2:
1609 tmr_x->cm1_output_bit.c2octrl = force_output;
1610 break;
1611
1612 case TMR_SELECT_CHANNEL_3:
1613 tmr_x->cm2_output_bit.c3octrl = force_output;
1614 break;
1615
1616 case TMR_SELECT_CHANNEL_4:
1617 tmr_x->cm2_output_bit.c4octrl = force_output;
1618 break;
1619
1620 default:
1621 break;
1622 }
1623}
1624
1661void tmr_dma_control_config(tmr_type *tmr_x, tmr_dma_transfer_length_type dma_length,
1662 tmr_dma_address_type dma_base_address)
1663{
1664 tmr_x->dmactrl_bit.dtb = dma_length;
1665 tmr_x->dmactrl_bit.addr = dma_base_address;
1666}
1667
1677void tmr_brkdt_config(tmr_type *tmr_x, tmr_brkdt_config_type *brkdt_struct)
1678{
1679 tmr_x->brk_bit.brken = brkdt_struct->brk_enable;
1680 tmr_x->brk_bit.dtc = brkdt_struct->deadtime;
1681 tmr_x->brk_bit.fcsodis = brkdt_struct->fcsodis_state;
1682 tmr_x->brk_bit.fcsoen = brkdt_struct->fcsoen_state;
1683 tmr_x->brk_bit.brkv = brkdt_struct->brk_polarity;
1684 tmr_x->brk_bit.aoen = brkdt_struct->auto_output_enable;
1685 tmr_x->brk_bit.wpc = brkdt_struct->wp_level;
1686}
1687
1692#endif
1693
tmr_output_struct
tmr_output_config_type tmr_output_struct
Definition: project/at_start_f415/examples/tmr/6_steps/src/main.c:39
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
CRM_TMR2_PERIPH_RESET
@ CRM_TMR2_PERIPH_RESET
Definition: at32f415_crm.h:164
CRM_TMR4_PERIPH_RESET
@ CRM_TMR4_PERIPH_RESET
Definition: at32f415_crm.h:166
CRM_TMR10_PERIPH_RESET
@ CRM_TMR10_PERIPH_RESET
Definition: at32f415_crm.h:161
CRM_TMR5_PERIPH_RESET
@ CRM_TMR5_PERIPH_RESET
Definition: at32f415_crm.h:167
CRM_TMR9_PERIPH_RESET
@ CRM_TMR9_PERIPH_RESET
Definition: at32f415_crm.h:160
CRM_TMR1_PERIPH_RESET
@ CRM_TMR1_PERIPH_RESET
Definition: at32f415_crm.h:157
CRM_TMR3_PERIPH_RESET
@ CRM_TMR3_PERIPH_RESET
Definition: at32f415_crm.h:165
CRM_TMR11_PERIPH_RESET
@ CRM_TMR11_PERIPH_RESET
Definition: at32f415_crm.h:162
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
tmr_dma_request_type
tmr_dma_request_type
tmr dma request type
Definition: at32f415_tmr.h:268
tmr_external_signal_divider_type
tmr_external_signal_divider_type
tmr external signal divider type
Definition: at32f415_tmr.h:307
tmr_polarity_active_type
tmr_polarity_active_type
tmr polarity active type
Definition: at32f415_tmr.h:297
tmr_count_mode_type
tmr_count_mode_type
tmr counter mode type
Definition: at32f415_tmr.h:105
tmr_input_polarity_type
tmr_input_polarity_type
tmr input channel polarity type
Definition: at32f415_tmr.h:205
tmr_dma_request_source_type
tmr_dma_request_source_type
tmr dma request source select type
Definition: at32f415_tmr.h:259
tmr_channel_select_type
tmr_channel_select_type
tmr channel select type
Definition: at32f415_tmr.h:215
tmr_external_signal_polarity_type
tmr_external_signal_polarity_type
tmr external signal polarity type
Definition: at32f415_tmr.h:318
tmr_dma_address_type
tmr_dma_address_type
tmr dma base address type
Definition: at32f415_tmr.h:352
tmr_channel1_input_connected_type
tmr_channel1_input_connected_type
tmr channel1 input connected type
Definition: at32f415_tmr.h:229
tmr_clock_division_type
tmr_clock_division_type
tmr clock division type
Definition: at32f415_tmr.h:95
tmr_event_trigger_type
tmr_event_trigger_type
tmr event triggered by software type
Definition: at32f415_tmr.h:282
tmr_output_control_mode_type
tmr_output_control_mode_type
tmr output control mode type
Definition: at32f415_tmr.h:172
tmr_dma_transfer_length_type
tmr_dma_transfer_length_type
tmr dma transfer length type
Definition: at32f415_tmr.h:327
sub_tmr_input_sel_type
sub_tmr_input_sel_type
tmr subordinate mode input select type
Definition: at32f415_tmr.h:132
tmr_force_output_type
tmr_force_output_type
tmr force output type
Definition: at32f415_tmr.h:187
tmr_sub_mode_select_type
tmr_sub_mode_select_type
tmr subordinate mode select type
Definition: at32f415_tmr.h:147
tmr_primary_select_type
tmr_primary_select_type
tmr primary mode select type
Definition: at32f415_tmr.h:117
tmr_encoder_mode_type
tmr_encoder_mode_type
tmr encoder mode type
Definition: at32f415_tmr.h:162
tmr_channel_input_divider_type
tmr_channel_input_divider_type
tmr input divider type
Definition: at32f415_tmr.h:248
TMR_INPUT_FALLING_EDGE
@ TMR_INPUT_FALLING_EDGE
Definition: at32f415_tmr.h:207
TMR_INPUT_RISING_EDGE
@ TMR_INPUT_RISING_EDGE
Definition: at32f415_tmr.h:206
TMR_SELECT_CHANNEL_1C
@ TMR_SELECT_CHANNEL_1C
Definition: at32f415_tmr.h:217
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_2C
@ TMR_SELECT_CHANNEL_2C
Definition: at32f415_tmr.h:219
TMR_SELECT_CHANNEL_4
@ TMR_SELECT_CHANNEL_4
Definition: at32f415_tmr.h:222
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_SELECT_CHANNEL_3C
@ TMR_SELECT_CHANNEL_3C
Definition: at32f415_tmr.h:221
TMR_WP_OFF
@ TMR_WP_OFF
Definition: at32f415_tmr.h:388
TMR_CC_CHANNEL_MAPPED_DIRECT
@ TMR_CC_CHANNEL_MAPPED_DIRECT
Definition: at32f415_tmr.h:239
TMR_CC_CHANNEL_MAPPED_INDIRECT
@ TMR_CC_CHANNEL_MAPPED_INDIRECT
Definition: at32f415_tmr.h:240
TMR_BRK_INPUT_ACTIVE_LOW
@ TMR_BRK_INPUT_ACTIVE_LOW
Definition: at32f415_tmr.h:379
TMR_OUTPUT_CONTROL_OFF
@ TMR_OUTPUT_CONTROL_OFF
Definition: at32f415_tmr.h:173
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR_SUB_INPUT_SEL_EXTIN
@ TMR_SUB_INPUT_SEL_EXTIN
Definition: at32f415_tmr.h:140
TMR_SUB_EXTERNAL_CLOCK_MODE_A
@ TMR_SUB_EXTERNAL_CLOCK_MODE_A
Definition: at32f415_tmr.h:155
TMR_SUB_MODE_DIABLE
@ TMR_SUB_MODE_DIABLE
Definition: at32f415_tmr.h:148
tmr_dma_control_config
void tmr_dma_control_config(tmr_type *tmr_x, tmr_dma_transfer_length_type dma_length, tmr_dma_address_type dma_base_address)
config tmr dma control
Definition: at32f415_tmr.c:1661
tmr_channel_value_get
uint32_t tmr_channel_value_get(tmr_type *tmr_x, tmr_channel_select_type tmr_channel)
get tmr channel value
Definition: at32f415_tmr.c:527
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_period_value_get
uint32_t tmr_period_value_get(tmr_type *tmr_x)
get tmr period value
Definition: at32f415_tmr.c:463
tmr_channel_buffer_enable
void tmr_channel_buffer_enable(tmr_type *tmr_x, confirm_state new_state)
enable tmr channel buffer
Definition: at32f415_tmr.c:1190
tmr_overflow_request_source_set
void tmr_overflow_request_source_set(tmr_type *tmr_x, confirm_state new_state)
select tmr the overflow event sources
Definition: at32f415_tmr.c:747
tmr_output_channel_mode_select
void tmr_output_channel_mode_select(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_control_mode_type oc_mode)
select tmr output channel mode
Definition: at32f415_tmr.c:409
tmr_input_channel_divider_set
void tmr_input_channel_divider_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_channel_input_divider_type divider_factor)
set tmr input channel divider
Definition: at32f415_tmr.c:1079
tmr_dma_request_enable
void tmr_dma_request_enable(tmr_type *tmr_x, tmr_dma_request_type dma_request, confirm_state new_state)
enable or disable tmr dma request
Definition: at32f415_tmr.c:1247
tmr_external_clock_config
void tmr_external_clock_config(tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock
Definition: at32f415_tmr.c:1479
tmr_repetition_counter_set
void tmr_repetition_counter_set(tmr_type *tmr_x, uint8_t tmr_rpr_value)
set the repetition counter register(rpr) value
Definition: at32f415_tmr.c:225
tmr_period_buffer_enable
void tmr_period_buffer_enable(tmr_type *tmr_x, confirm_state new_state)
enable tmr period buffer
Definition: at32f415_tmr.c:567
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_internal_clock_set
void tmr_internal_clock_set(tmr_type *tmr_x)
set tmr select internal clock
Definition: at32f415_tmr.c:1394
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_brkdt_default_para_init
void tmr_brkdt_default_para_init(tmr_brkdt_config_type *tmr_brkdt_struct)
init tmr brkdt default para
Definition: at32f415_tmr.c:146
tmr_force_output_set
void tmr_force_output_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_force_output_type force_output)
set tmr force output
Definition: at32f415_tmr.c:1595
tmr_counter_value_set
void tmr_counter_value_set(tmr_type *tmr_x, uint32_t tmr_cnt_value)
set tmr counter value
Definition: at32f415_tmr.c:244
tmr_div_value_get
uint32_t tmr_div_value_get(tmr_type *tmr_x)
get tmr div value
Definition: at32f415_tmr.c:284
tmr_input_channel_init
void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
init tmr input channel
Definition: at32f415_tmr.c:780
tmr_input_channel_filter_set
void tmr_input_channel_filter_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint16_t filter_value)
set tmr input channel filter
Definition: at32f415_tmr.c:902
tmr_period_value_set
void tmr_period_value_set(tmr_type *tmr_x, uint32_t tmr_pr_value)
set tmr period value
Definition: at32f415_tmr.c:448
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_sub_mode_select
void tmr_sub_mode_select(tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode
Definition: at32f415_tmr.c:1148
tmr_counter_value_get
uint32_t tmr_counter_value_get(tmr_type *tmr_x)
get tmr counter value
Definition: at32f415_tmr.c:257
tmr_brkdt_config
void tmr_brkdt_config(tmr_type *tmr_x, tmr_brkdt_config_type *brkdt_struct)
config tmr break mode and dead-time
Definition: at32f415_tmr.c:1677
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
tmr_external_clock_mode2_config
void tmr_external_clock_mode2_config(tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock mode2
Definition: at32f415_tmr.c:1531
tmr_input_default_para_init
void tmr_input_default_para_init(tmr_input_config_type *tmr_input_struct)
init tmr input default para
Definition: at32f415_tmr.c:132
tmr_div_value_set
void tmr_div_value_set(tmr_type *tmr_x, uint32_t tmr_div_value)
set tmr div value
Definition: at32f415_tmr.c:271
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_event_sw_trigger
void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event
Definition: at32f415_tmr.c:1369
tmr_output_enable
void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable
Definition: at32f415_tmr.c:1382
tmr_channel1_input_select
void tmr_channel1_input_select(tmr_type *tmr_x, tmr_channel1_input_connected_type ti1_connect)
select tmr channel1 input
Definition: at32f415_tmr.c:1055
tmr_sub_sync_mode_set
void tmr_sub_sync_mode_set(tmr_type *tmr_x, confirm_state new_state)
set tmr subordinate synchronization mode
Definition: at32f415_tmr.c:1225
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_hall_select
void tmr_hall_select(tmr_type *tmr_x, confirm_state new_state)
select tmr hall
Definition: at32f415_tmr.c:1177
tmr_32_bit_function_enable
void tmr_32_bit_function_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr 32 bit function(plus mode)
Definition: at32f415_tmr.c:730
tmr_external_clock_mode1_config
void tmr_external_clock_mode1_config(tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock mode1
Definition: at32f415_tmr.c:1505
tmr_pwm_input_config
void tmr_pwm_input_config(tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
config tmr pwm input
Definition: at32f415_tmr.c:947
tmr_trigger_input_select
void tmr_trigger_input_select(tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger
Definition: at32f415_tmr.c:1212
tmr_output_channel_buffer_enable
void tmr_output_channel_buffer_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
enable tmr output channel buffer
Definition: at32f415_tmr.c:587
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_primary_mode_select
void tmr_primary_mode_select(tmr_type *tmr_x, tmr_primary_select_type primary_mode)
select tmr primary mode
Definition: at32f415_tmr.c:1126
tmr_overflow_event_disable
void tmr_overflow_event_disable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr overflow event generation
Definition: at32f415_tmr.c:760
tmr_channel_dma_select
void tmr_channel_dma_select(tmr_type *tmr_x, tmr_dma_request_source_type cc_dma_select)
select tmr channel dma
Definition: at32f415_tmr.c:1164
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_output_channel_immediately_set
void tmr_output_channel_immediately_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
set tmr output channel immediately
Definition: at32f415_tmr.c:632
tmr_encoder_mode_config
void tmr_encoder_mode_config(tmr_type *tmr_x, tmr_encoder_mode_type encoder_mode, tmr_input_polarity_type ic1_polarity, tmr_input_polarity_type ic2_polarity)
config tmr encoder mode
Definition: at32f415_tmr.c:1560
tmr_channel_enable
void tmr_channel_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
tmr channel enable
Definition: at32f415_tmr.c:847
tmr_output_channel_switch_set
void tmr_output_channel_switch_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
set tmr output channel switch
Definition: at32f415_tmr.c:677
tmr_reset
void tmr_reset(tmr_type *tmr_x)
tmr reset by crm reset register
Definition: at32f415_tmr.c:51
tmr_output_channel_polarity_set
void tmr_output_channel_polarity_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_polarity_active_type oc_polarity)
set tmr output channel polarity
Definition: at32f415_tmr.c:1419
tmr_one_cycle_mode_enable
void tmr_one_cycle_mode_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr one cycle mode
Definition: at32f415_tmr.c:716
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
TMR10
#define TMR10
Definition: at32f415_tmr.h:841
TMR11
#define TMR11
Definition: at32f415_tmr.h:842
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
TMR4
#define TMR4
Definition: at32f415_tmr.h:835
TMR5
#define TMR5
Definition: at32f415_tmr.h:836
TMR9
#define TMR9
Definition: at32f415_tmr.h:840
tmr_brkdt_config_type
tmr brkdt config type
Definition: at32f415_tmr.h:423
tmr_brkdt_config_type::brk_enable
confirm_state brk_enable
Definition: at32f415_tmr.h:430
tmr_brkdt_config_type::deadtime
uint8_t deadtime
Definition: at32f415_tmr.h:424
tmr_brkdt_config_type::auto_output_enable
confirm_state auto_output_enable
Definition: at32f415_tmr.h:427
tmr_brkdt_config_type::wp_level
tmr_wp_level_type wp_level
Definition: at32f415_tmr.h:426
tmr_brkdt_config_type::fcsoen_state
confirm_state fcsoen_state
Definition: at32f415_tmr.h:428
tmr_brkdt_config_type::fcsodis_state
confirm_state fcsodis_state
Definition: at32f415_tmr.h:429
tmr_brkdt_config_type::brk_polarity
tmr_brk_polarity_type brk_polarity
Definition: at32f415_tmr.h:425
tmr_input_config_type
tmr input capture config type
Definition: at32f415_tmr.h:412
tmr_input_config_type::input_mapped_select
tmr_input_direction_mapped_type input_mapped_select
Definition: at32f415_tmr.h:415
tmr_input_config_type::input_filter_value
uint8_t input_filter_value
Definition: at32f415_tmr.h:416
tmr_input_config_type::input_polarity_select
tmr_input_polarity_type input_polarity_select
Definition: at32f415_tmr.h:414
tmr_input_config_type::input_channel_select
tmr_channel_select_type input_channel_select
Definition: at32f415_tmr.h:413
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::occ_output_state
confirm_state occ_output_state
Definition: at32f415_tmr.h:405
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::occ_polarity
tmr_output_polarity_type occ_polarity
Definition: at32f415_tmr.h:403
tmr_output_config_type::occ_idle_state
confirm_state occ_idle_state
Definition: at32f415_tmr.h:401
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
tmr_type
type define tmr register all
Definition: at32f415_tmr.h:437
tmr_type::c1cen
__IO uint32_t c1cen
Definition: at32f415_tmr.h:665
tmr_type::pmen
__IO uint32_t pmen
Definition: at32f415_tmr.h:453
tmr_type::brken
__IO uint32_t brken
Definition: at32f415_tmr.h:791
tmr_type::c1idiv
__IO uint32_t c1idiv
Definition: at32f415_tmr.h:606
tmr_type::ctrl2_bit
struct tmr_type::@594::@633 ctrl2_bit
tmr_type::dtc
__IO uint32_t dtc
Definition: at32f415_tmr.h:787
tmr_type::c1en
__IO uint32_t c1en
Definition: at32f415_tmr.h:663
tmr_type::c4df
__IO uint32_t c4df
Definition: at32f415_tmr.h:650
tmr_type::c3octrl
__IO uint32_t c3octrl
Definition: at32f415_tmr.h:630
tmr_type::c2osen
__IO uint32_t c2osen
Definition: at32f415_tmr.h:596
tmr_type::ctrl1_bit
struct tmr_type::@592::@632 ctrl1_bit
tmr_type::swevt
__IO uint32_t swevt
Definition: at32f415_tmr.h:560
tmr_type::c2en
__IO uint32_t c2en
Definition: at32f415_tmr.h:667
tmr_type::c3df
__IO uint32_t c3df
Definition: at32f415_tmr.h:647
tmr_type::wpc
__IO uint32_t wpc
Definition: at32f415_tmr.h:788
tmr_type::c3oben
__IO uint32_t c3oben
Definition: at32f415_tmr.h:629
tmr_type::cnt_dir
__IO uint32_t cnt_dir
Definition: at32f415_tmr.h:450
tmr_type::c4octrl
__IO uint32_t c4octrl
Definition: at32f415_tmr.h:635
tmr_type::c1insel
__IO uint32_t c1insel
Definition: at32f415_tmr.h:471
tmr_type::div
__IO uint32_t div
Definition: at32f415_tmr.h:698
tmr_type::cm2_input_bit
struct tmr_type::@606::@641 cm2_input_bit
input capture mode
tmr_type::esf
__IO uint32_t esf
Definition: at32f415_tmr.h:495
tmr_type::c1osen
__IO uint32_t c1osen
Definition: at32f415_tmr.h:591
tmr_type::c2cen
__IO uint32_t c2cen
Definition: at32f415_tmr.h:669
tmr_type::drs
__IO uint32_t drs
Definition: at32f415_tmr.h:469
tmr_type::dmactrl_bit
struct tmr_type::@628::@652 dmactrl_bit
tmr_type::iden
__IO uint32_t iden
Definition: at32f415_tmr.h:508
tmr_type::c1oben
__IO uint32_t c1oben
Definition: at32f415_tmr.h:589
tmr_type::ists
__IO uint32_t ists
Definition: at32f415_tmr.h:535
tmr_type::c1c
__IO uint32_t c1c
Definition: at32f415_tmr.h:587
tmr_type::c3cen
__IO uint32_t c3cen
Definition: at32f415_tmr.h:673
tmr_type::c4p
__IO uint32_t c4p
Definition: at32f415_tmr.h:676
tmr_type::brkv
__IO uint32_t brkv
Definition: at32f415_tmr.h:792
tmr_type::stis
__IO uint32_t stis
Definition: at32f415_tmr.h:493
tmr_type::ovfswtr
__IO uint32_t ovfswtr
Definition: at32f415_tmr.h:563
tmr_type::c3idiv
__IO uint32_t c3idiv
Definition: at32f415_tmr.h:646
tmr_type::c4osen
__IO uint32_t c4osen
Definition: at32f415_tmr.h:636
tmr_type::c1octrl
__IO uint32_t c1octrl
Definition: at32f415_tmr.h:590
tmr_type::tmren
__IO uint32_t tmren
Definition: at32f415_tmr.h:446
tmr_type::oen
__IO uint32_t oen
Definition: at32f415_tmr.h:794
tmr_type::sts
__IO uint32_t sts
Definition: at32f415_tmr.h:494
tmr_type::c2idiv
__IO uint32_t c2idiv
Definition: at32f415_tmr.h:609
tmr_type::c1p
__IO uint32_t c1p
Definition: at32f415_tmr.h:664
tmr_type::c1oien
__IO uint32_t c1oien
Definition: at32f415_tmr.h:588
tmr_type::cm2_output_bit
struct tmr_type::@606::@640 cm2_output_bit
channel mode
tmr_type::pr
__IO uint32_t pr
Definition: at32f415_tmr.h:711
tmr_type::c3oien
__IO uint32_t c3oien
Definition: at32f415_tmr.h:628
tmr_type::c1dt
uint32_t c1dt
Definition: at32f415_tmr.h:736
tmr_type::c2oben
__IO uint32_t c2oben
Definition: at32f415_tmr.h:594
tmr_type::rpr_bit
struct tmr_type::@616::@646 rpr_bit
tmr_type::c2octrl
__IO uint32_t c2octrl
Definition: at32f415_tmr.h:595
tmr_type::smsel
__IO uint32_t smsel
Definition: at32f415_tmr.h:491
tmr_type::c3p
__IO uint32_t c3p
Definition: at32f415_tmr.h:672
tmr_type::c1cp
__IO uint32_t c1cp
Definition: at32f415_tmr.h:666
tmr_type::c3c
__IO uint32_t c3c
Definition: at32f415_tmr.h:627
tmr_type::clkdiv
__IO uint32_t clkdiv
Definition: at32f415_tmr.h:452
tmr_type::ovfs
__IO uint32_t ovfs
Definition: at32f415_tmr.h:448
tmr_type::cbctrl
__IO uint32_t cbctrl
Definition: at32f415_tmr.h:466
tmr_type::dtb
__IO uint32_t dtb
Definition: at32f415_tmr.h:808
tmr_type::prben
__IO uint32_t prben
Definition: at32f415_tmr.h:451
tmr_type::ccfs
__IO uint32_t ccfs
Definition: at32f415_tmr.h:468
tmr_type::ecmben
__IO uint32_t ecmben
Definition: at32f415_tmr.h:497
tmr_type::ovfen
__IO uint32_t ovfen
Definition: at32f415_tmr.h:447
tmr_type::c4en
__IO uint32_t c4en
Definition: at32f415_tmr.h:675
tmr_type::fcsoen
__IO uint32_t fcsoen
Definition: at32f415_tmr.h:790
tmr_type::esdiv
__IO uint32_t esdiv
Definition: at32f415_tmr.h:496
tmr_type::c3en
__IO uint32_t c3en
Definition: at32f415_tmr.h:671
tmr_type::c2p
__IO uint32_t c2p
Definition: at32f415_tmr.h:668
tmr_type::ocmen
__IO uint32_t ocmen
Definition: at32f415_tmr.h:449
tmr_type::cm1_input_bit
struct tmr_type::@604::@639 cm1_input_bit
input capture mode
tmr_type::swevt_bit
struct tmr_type::@602::@637 swevt_bit
tmr_type::c4oien
__IO uint32_t c4oien
Definition: at32f415_tmr.h:633
tmr_type::cm1_output_bit
struct tmr_type::@604::@638 cm1_output_bit
channel mode
tmr_type::c2dt
uint32_t c2dt
Definition: at32f415_tmr.h:748
tmr_type::addr
__IO uint32_t addr
Definition: at32f415_tmr.h:806
tmr_type::c3cp
__IO uint32_t c3cp
Definition: at32f415_tmr.h:674
tmr_type::c2df
__IO uint32_t c2df
Definition: at32f415_tmr.h:610
tmr_type::c4idiv
__IO uint32_t c4idiv
Definition: at32f415_tmr.h:649
tmr_type::c3osen
__IO uint32_t c3osen
Definition: at32f415_tmr.h:631
tmr_type::rpr
__IO uint32_t rpr
Definition: at32f415_tmr.h:723
tmr_type::c2c
__IO uint32_t c2c
Definition: at32f415_tmr.h:592
tmr_type::cctrl_bit
struct tmr_type::@608::@642 cctrl_bit
tmr_type::c1df
__IO uint32_t c1df
Definition: at32f415_tmr.h:607
tmr_type::c2oien
__IO uint32_t c2oien
Definition: at32f415_tmr.h:593
tmr_type::c4dt
__IO uint32_t c4dt
Definition: at32f415_tmr.h:772
tmr_type::ctrl2
__IO uint32_t ctrl2
Definition: at32f415_tmr.h:463
tmr_type::c3dt
__IO uint32_t c3dt
Definition: at32f415_tmr.h:760
tmr_type::brk_bit
struct tmr_type::@626::@651 brk_bit
tmr_type::c2cp
__IO uint32_t c2cp
Definition: at32f415_tmr.h:670
tmr_type::stctrl_bit
struct tmr_type::@596::@634 stctrl_bit
tmr_type::cctrl
uint32_t cctrl
Definition: at32f415_tmr.h:660
tmr_type::c4c
__IO uint32_t c4c
Definition: at32f415_tmr.h:632
tmr_type::c4oben
__IO uint32_t c4oben
Definition: at32f415_tmr.h:634
tmr_type::fcsodis
__IO uint32_t fcsodis
Definition: at32f415_tmr.h:789
tmr_type::cval
__IO uint32_t cval
Definition: at32f415_tmr.h:686
tmr_type::esp
__IO uint32_t esp
Definition: at32f415_tmr.h:498
tmr_type::ptos
__IO uint32_t ptos
Definition: at32f415_tmr.h:470
tmr_type::aoen
__IO uint32_t aoen
Definition: at32f415_tmr.h:793
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_tmr.h Source File

  • libraries
  • drivers
  • inc
at32f415_tmr.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_TMR_H
29#define __AT32F415_TMR_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
52#define TMR_OVF_FLAG ((uint32_t)0x000001)
53#define TMR_C1_FLAG ((uint32_t)0x000002)
54#define TMR_C2_FLAG ((uint32_t)0x000004)
55#define TMR_C3_FLAG ((uint32_t)0x000008)
56#define TMR_C4_FLAG ((uint32_t)0x000010)
57#define TMR_HALL_FLAG ((uint32_t)0x000020)
58#define TMR_TRIGGER_FLAG ((uint32_t)0x000040)
59#define TMR_BRK_FLAG ((uint32_t)0x000080)
60#define TMR_C1_RECAPTURE_FLAG ((uint32_t)0x000200)
61#define TMR_C2_RECAPTURE_FLAG ((uint32_t)0x000400)
62#define TMR_C3_RECAPTURE_FLAG ((uint32_t)0x000800)
63#define TMR_C4_RECAPTURE_FLAG ((uint32_t)0x001000)
74#define TMR_OVF_INT ((uint32_t)0x000001)
75#define TMR_C1_INT ((uint32_t)0x000002)
76#define TMR_C2_INT ((uint32_t)0x000004)
77#define TMR_C3_INT ((uint32_t)0x000008)
78#define TMR_C4_INT ((uint32_t)0x000010)
79#define TMR_HALL_INT ((uint32_t)0x000020)
80#define TMR_TRIGGER_INT ((uint32_t)0x000040)
81#define TMR_BRK_INT ((uint32_t)0x000080)
94typedef enum
95{
96 TMR_CLOCK_DIV1 = 0x00,
97 TMR_CLOCK_DIV2 = 0x01,
98 TMR_CLOCK_DIV4 = 0x02
99} tmr_clock_division_type;
100
104typedef enum
105{
106 TMR_COUNT_UP = 0x00,
107 TMR_COUNT_DOWN = 0x01,
108 TMR_COUNT_TWO_WAY_1 = 0x02,
109 TMR_COUNT_TWO_WAY_2 = 0x04,
110 TMR_COUNT_TWO_WAY_3 = 0x06
111} tmr_count_mode_type;
112
116typedef enum
117{
118 TMR_PRIMARY_SEL_RESET = 0x00,
119 TMR_PRIMARY_SEL_ENABLE = 0x01,
120 TMR_PRIMARY_SEL_OVERFLOW = 0x02,
121 TMR_PRIMARY_SEL_COMPARE = 0x03,
122 TMR_PRIMARY_SEL_C1ORAW = 0x04,
123 TMR_PRIMARY_SEL_C2ORAW = 0x05,
124 TMR_PRIMARY_SEL_C3ORAW = 0x06,
125 TMR_PRIMARY_SEL_C4ORAW = 0x07
126} tmr_primary_select_type;
127
131typedef enum
132{
133 TMR_SUB_INPUT_SEL_IS0 = 0x00,
134 TMR_SUB_INPUT_SEL_IS1 = 0x01,
135 TMR_SUB_INPUT_SEL_IS2 = 0x02,
136 TMR_SUB_INPUT_SEL_IS3 = 0x03,
137 TMR_SUB_INPUT_SEL_C1INC = 0x04,
138 TMR_SUB_INPUT_SEL_C1DF1 = 0x05,
139 TMR_SUB_INPUT_SEL_C2DF2 = 0x06,
140 TMR_SUB_INPUT_SEL_EXTIN = 0x07
141} sub_tmr_input_sel_type;
142
146typedef enum
147{
148 TMR_SUB_MODE_DIABLE = 0x00,
149 TMR_SUB_ENCODER_MODE_A = 0x01,
150 TMR_SUB_ENCODER_MODE_B = 0x02,
151 TMR_SUB_ENCODER_MODE_C = 0x03,
152 TMR_SUB_RESET_MODE = 0x04,
153 TMR_SUB_HANG_MODE = 0x05,
154 TMR_SUB_TRIGGER_MODE = 0x06,
155 TMR_SUB_EXTERNAL_CLOCK_MODE_A = 0x07
156} tmr_sub_mode_select_type;
157
161typedef enum
162{
163 TMR_ENCODER_MODE_A = TMR_SUB_ENCODER_MODE_A,
164 TMR_ENCODER_MODE_B = TMR_SUB_ENCODER_MODE_B,
165 TMR_ENCODER_MODE_C = TMR_SUB_ENCODER_MODE_C
166} tmr_encoder_mode_type;
167
171typedef enum
172{
173 TMR_OUTPUT_CONTROL_OFF = 0x00,
174 TMR_OUTPUT_CONTROL_HIGH = 0x01,
175 TMR_OUTPUT_CONTROL_LOW = 0x02,
176 TMR_OUTPUT_CONTROL_SWITCH = 0x03,
177 TMR_OUTPUT_CONTROL_FORCE_HIGH = 0x04,
178 TMR_OUTPUT_CONTROL_FORCE_LOW = 0x05,
179 TMR_OUTPUT_CONTROL_PWM_MODE_A = 0x06,
180 TMR_OUTPUT_CONTROL_PWM_MODE_B = 0x07
181} tmr_output_control_mode_type;
182
186typedef enum
187{
188 TMR_FORCE_OUTPUT_HIGH = TMR_OUTPUT_CONTROL_FORCE_HIGH,
189 TMR_FORCE_OUTPUT_LOW = TMR_OUTPUT_CONTROL_FORCE_LOW
190} tmr_force_output_type;
191
195typedef enum
196{
197 TMR_OUTPUT_ACTIVE_HIGH = 0x00,
198 TMR_OUTPUT_ACTIVE_LOW = 0x01
199} tmr_output_polarity_type;
200
204typedef enum
205{
206 TMR_INPUT_RISING_EDGE = 0x00,
207 TMR_INPUT_FALLING_EDGE = 0x01,
208 TMR_INPUT_BOTH_EDGE = 0x03
209} tmr_input_polarity_type;
210
214typedef enum
215{
216 TMR_SELECT_CHANNEL_1 = 0x00,
217 TMR_SELECT_CHANNEL_1C = 0x01,
218 TMR_SELECT_CHANNEL_2 = 0x02,
219 TMR_SELECT_CHANNEL_2C = 0x03,
220 TMR_SELECT_CHANNEL_3 = 0x04,
221 TMR_SELECT_CHANNEL_3C = 0x05,
222 TMR_SELECT_CHANNEL_4 = 0x06
223} tmr_channel_select_type;
224
228typedef enum
229{
230 TMR_CHANEL1_CONNECTED_C1IRAW = 0x00,
231 TMR_CHANEL1_2_3_CONNECTED_C1IRAW_XOR = 0x01
232} tmr_channel1_input_connected_type;
233
237typedef enum
238{
239 TMR_CC_CHANNEL_MAPPED_DIRECT = 0x01,
240 TMR_CC_CHANNEL_MAPPED_INDIRECT = 0x02,
241 TMR_CC_CHANNEL_MAPPED_STI = 0x03
242} tmr_input_direction_mapped_type;
243
247typedef enum
248{
249 TMR_CHANNEL_INPUT_DIV_1 = 0x00,
250 TMR_CHANNEL_INPUT_DIV_2 = 0x01,
251 TMR_CHANNEL_INPUT_DIV_4 = 0x02,
252 TMR_CHANNEL_INPUT_DIV_8 = 0x03
253} tmr_channel_input_divider_type;
254
258typedef enum
259{
260 TMR_DMA_REQUEST_BY_CHANNEL = 0x00,
261 TMR_DMA_REQUEST_BY_OVERFLOW = 0x01
262} tmr_dma_request_source_type;
263
267typedef enum
268{
269 TMR_OVERFLOW_DMA_REQUEST = 0x00000100,
270 TMR_C1_DMA_REQUEST = 0x00000200,
271 TMR_C2_DMA_REQUEST = 0x00000400,
272 TMR_C3_DMA_REQUEST = 0x00000800,
273 TMR_C4_DMA_REQUEST = 0x00001000,
274 TMR_HALL_DMA_REQUEST = 0x00002000,
275 TMR_TRIGGER_DMA_REQUEST = 0x00004000
276} tmr_dma_request_type;
277
281typedef enum
282{
283 TMR_OVERFLOW_SWTRIG = 0x00000001,
284 TMR_C1_SWTRIG = 0x00000002,
285 TMR_C2_SWTRIG = 0x00000004,
286 TMR_C3_SWTRIG = 0x00000008,
287 TMR_C4_SWTRIG = 0x00000010,
288 TMR_HALL_SWTRIG = 0x00000020,
289 TMR_TRIGGER_SWTRIG = 0x00000040,
290 TMR_BRK_SWTRIG = 0x00000080
291}tmr_event_trigger_type;
292
296typedef enum
297{
298 TMR_POLARITY_ACTIVE_HIGH = 0x00,
299 TMR_POLARITY_ACTIVE_LOW = 0x01,
300 TMR_POLARITY_ACTIVE_BOTH = 0x02
301}tmr_polarity_active_type;
302
306typedef enum
307{
308 TMR_ES_FREQUENCY_DIV_1 = 0x00,
309 TMR_ES_FREQUENCY_DIV_2 = 0x01,
310 TMR_ES_FREQUENCY_DIV_4 = 0x02,
311 TMR_ES_FREQUENCY_DIV_8 = 0x03
312}tmr_external_signal_divider_type;
313
317typedef enum
318{
319 TMR_ES_POLARITY_NON_INVERTED = 0x00,
320 TMR_ES_POLARITY_INVERTED = 0x01
321}tmr_external_signal_polarity_type;
322
326typedef enum
327{
328 TMR_DMA_TRANSFER_1BYTE = 0x00,
329 TMR_DMA_TRANSFER_2BYTES = 0x01,
330 TMR_DMA_TRANSFER_3BYTES = 0x02,
331 TMR_DMA_TRANSFER_4BYTES = 0x03,
332 TMR_DMA_TRANSFER_5BYTES = 0x04,
333 TMR_DMA_TRANSFER_6BYTES = 0x05,
334 TMR_DMA_TRANSFER_7BYTES = 0x06,
335 TMR_DMA_TRANSFER_8BYTES = 0x07,
336 TMR_DMA_TRANSFER_9BYTES = 0x08,
337 TMR_DMA_TRANSFER_10BYTES = 0x09,
338 TMR_DMA_TRANSFER_11BYTES = 0x0A,
339 TMR_DMA_TRANSFER_12BYTES = 0x0B,
340 TMR_DMA_TRANSFER_13BYTES = 0x0C,
341 TMR_DMA_TRANSFER_14BYTES = 0x0D,
342 TMR_DMA_TRANSFER_15BYTES = 0x0E,
343 TMR_DMA_TRANSFER_16BYTES = 0x0F,
344 TMR_DMA_TRANSFER_17BYTES = 0x10,
345 TMR_DMA_TRANSFER_18BYTES = 0x11
346}tmr_dma_transfer_length_type;
347
351typedef enum
352{
353 TMR_CTRL1_ADDRESS = 0x0000,
354 TMR_CTRL2_ADDRESS = 0x0001,
355 TMR_STCTRL_ADDRESS = 0x0002,
356 TMR_IDEN_ADDRESS = 0x0003,
357 TMR_ISTS_ADDRESS = 0x0004,
358 TMR_SWEVT_ADDRESS = 0x0005,
359 TMR_CM1_ADDRESS = 0x0006,
360 TMR_CM2_ADDRESS = 0x0007,
361 TMR_CCTRL_ADDRESS = 0x0008,
362 TMR_CVAL_ADDRESS = 0x0009,
363 TMR_DIV_ADDRESS = 0x000A,
364 TMR_PR_ADDRESS = 0x000B,
365 TMR_RPR_ADDRESS = 0x000C,
366 TMR_C1DT_ADDRESS = 0x000D,
367 TMR_C2DT_ADDRESS = 0x000E,
368 TMR_C3DT_ADDRESS = 0x000F,
369 TMR_C4DT_ADDRESS = 0x0010,
370 TMR_BRK_ADDRESS = 0x0011,
371 TMR_DMACTRL_ADDRESS = 0x0012
372}tmr_dma_address_type;
373
377typedef enum
378{
379 TMR_BRK_INPUT_ACTIVE_LOW = 0x00,
380 TMR_BRK_INPUT_ACTIVE_HIGH = 0x01
381}tmr_brk_polarity_type;
382
386typedef enum
387{
388 TMR_WP_OFF = 0x00,
389 TMR_WP_LEVEL_3 = 0x01,
390 TMR_WP_LEVEL_2 = 0x02,
391 TMR_WP_LEVEL_1 = 0x03
392}tmr_wp_level_type;
393
397typedef struct
398{
399 tmr_output_control_mode_type oc_mode;
400 confirm_state oc_idle_state;
401 confirm_state occ_idle_state;
402 tmr_output_polarity_type oc_polarity;
403 tmr_output_polarity_type occ_polarity;
404 confirm_state oc_output_state;
405 confirm_state occ_output_state;
406} tmr_output_config_type;
407
411typedef struct
412{
413 tmr_channel_select_type input_channel_select;
414 tmr_input_polarity_type input_polarity_select;
415 tmr_input_direction_mapped_type input_mapped_select;
416 uint8_t input_filter_value;
417} tmr_input_config_type;
418
422typedef struct
423{
424 uint8_t deadtime;
425 tmr_brk_polarity_type brk_polarity;
426 tmr_wp_level_type wp_level;
427 confirm_state auto_output_enable;
428 confirm_state fcsoen_state;
429 confirm_state fcsodis_state;
430 confirm_state brk_enable;
431} tmr_brkdt_config_type;
432
436typedef struct
437{
441 union
442 {
443 __IO uint32_t ctrl1;
444 struct
445 {
446 __IO uint32_t tmren : 1; /* [0] */
447 __IO uint32_t ovfen : 1; /* [1] */
448 __IO uint32_t ovfs : 1; /* [2] */
449 __IO uint32_t ocmen : 1; /* [3] */
450 __IO uint32_t cnt_dir : 3; /* [6:4] */
451 __IO uint32_t prben : 1; /* [7] */
452 __IO uint32_t clkdiv : 2; /* [9:8] */
453 __IO uint32_t pmen : 1; /* [10] */
454 __IO uint32_t reserved1 : 21;/* [31:11] */
455 } ctrl1_bit;
456 };
457
461 union
462 {
463 __IO uint32_t ctrl2;
464 struct
465 {
466 __IO uint32_t cbctrl : 1; /* [0] */
467 __IO uint32_t reserved1 : 1; /* [1] */
468 __IO uint32_t ccfs : 1; /* [2] */
469 __IO uint32_t drs : 1; /* [3] */
470 __IO uint32_t ptos : 3; /* [6:4] */
471 __IO uint32_t c1insel : 1; /* [7] */
472 __IO uint32_t c1ios : 1; /* [8] */
473 __IO uint32_t c1cios : 1; /* [9] */
474 __IO uint32_t c2ios : 1; /* [10] */
475 __IO uint32_t c2cios : 1; /* [11] */
476 __IO uint32_t c3ios : 1; /* [12] */
477 __IO uint32_t c3cios : 1; /* [13] */
478 __IO uint32_t c4ios : 1; /* [14] */
479 __IO uint32_t reserved2 : 17;/* [31:15] */
480 } ctrl2_bit;
481 };
482
486 union
487 {
488 __IO uint32_t stctrl;
489 struct
490 {
491 __IO uint32_t smsel : 3; /* [2:0] */
492 __IO uint32_t reserved1 : 1; /* [3] */
493 __IO uint32_t stis : 3; /* [6:4] */
494 __IO uint32_t sts : 1; /* [7] */
495 __IO uint32_t esf : 4; /* [11:8] */
496 __IO uint32_t esdiv : 2; /* [13:12] */
497 __IO uint32_t ecmben : 1; /* [14] */
498 __IO uint32_t esp : 1; /* [15] */
499 __IO uint32_t reserved2 : 16;/* [31:16] */
500 } stctrl_bit;
501 };
502
506 union
507 {
508 __IO uint32_t iden;
509 struct
510 {
511 __IO uint32_t ovfien : 1; /* [0] */
512 __IO uint32_t c1ien : 1; /* [1] */
513 __IO uint32_t c2ien : 1; /* [2] */
514 __IO uint32_t c3ien : 1; /* [3] */
515 __IO uint32_t c4ien : 1; /* [4] */
516 __IO uint32_t hallien : 1; /* [5] */
517 __IO uint32_t tien : 1; /* [6] */
518 __IO uint32_t brkie : 1; /* [7] */
519 __IO uint32_t ovfden : 1; /* [8] */
520 __IO uint32_t c1den : 1; /* [9] */
521 __IO uint32_t c2den : 1; /* [10] */
522 __IO uint32_t c3den : 1; /* [11] */
523 __IO uint32_t c4den : 1; /* [12] */
524 __IO uint32_t hallde : 1; /* [13] */
525 __IO uint32_t tden : 1; /* [14] */
526 __IO uint32_t reserved1 : 17;/* [31:15] */
527 } iden_bit;
528 };
529
533 union
534 {
535 __IO uint32_t ists;
536 struct
537 {
538 __IO uint32_t ovfif : 1; /* [0] */
539 __IO uint32_t c1if : 1; /* [1] */
540 __IO uint32_t c2if : 1; /* [2] */
541 __IO uint32_t c3if : 1; /* [3] */
542 __IO uint32_t c4if : 1; /* [4] */
543 __IO uint32_t hallif : 1; /* [5] */
544 __IO uint32_t trgif : 1; /* [6] */
545 __IO uint32_t brkif : 1; /* [7] */
546 __IO uint32_t reserved1 : 1; /* [8] */
547 __IO uint32_t c1rf : 1; /* [9] */
548 __IO uint32_t c2rf : 1; /* [10] */
549 __IO uint32_t c3rf : 1; /* [11] */
550 __IO uint32_t c4rf : 1; /* [12] */
551 __IO uint32_t reserved2 : 19;/* [31:13] */
552 } ists_bit;
553 };
554
558 union
559 {
560 __IO uint32_t swevt;
561 struct
562 {
563 __IO uint32_t ovfswtr : 1; /* [0] */
564 __IO uint32_t c1swtr : 1; /* [1] */
565 __IO uint32_t c2swtr : 1; /* [2] */
566 __IO uint32_t c3swtr : 1; /* [3] */
567 __IO uint32_t c4swtr : 1; /* [4] */
568 __IO uint32_t hallswtr : 1; /* [5] */
569 __IO uint32_t trgswtr : 1; /* [6] */
570 __IO uint32_t brkswtr : 1; /* [7] */
571 __IO uint32_t reserved : 24;/* [31:8] */
572 } swevt_bit;
573 };
574
578 union
579 {
580 __IO uint32_t cm1;
581
585 struct
586 {
587 __IO uint32_t c1c : 2; /* [1:0] */
588 __IO uint32_t c1oien : 1; /* [2] */
589 __IO uint32_t c1oben : 1; /* [3] */
590 __IO uint32_t c1octrl : 3; /* [6:4] */
591 __IO uint32_t c1osen : 1; /* [7] */
592 __IO uint32_t c2c : 2; /* [9:8] */
593 __IO uint32_t c2oien : 1; /* [10] */
594 __IO uint32_t c2oben : 1; /* [11] */
595 __IO uint32_t c2octrl : 3; /* [14:12] */
596 __IO uint32_t c2osen : 1; /* [15] */
597 __IO uint32_t reserved1 : 16;/* [31:16] */
598 } cm1_output_bit;
599
603 struct
604 {
605 __IO uint32_t c1c : 2; /* [1:0] */
606 __IO uint32_t c1idiv : 2; /* [3:2] */
607 __IO uint32_t c1df : 4; /* [7:4] */
608 __IO uint32_t c2c : 2; /* [9:8] */
609 __IO uint32_t c2idiv : 2; /* [11:10] */
610 __IO uint32_t c2df : 4; /* [15:12] */
611 __IO uint32_t reserved1 : 16;/* [31:16] */
612 } cm1_input_bit;
613 };
614
618 union
619 {
620 __IO uint32_t cm2;
621
625 struct
626 {
627 __IO uint32_t c3c : 2; /* [1:0] */
628 __IO uint32_t c3oien : 1; /* [2] */
629 __IO uint32_t c3oben : 1; /* [3] */
630 __IO uint32_t c3octrl : 3; /* [6:4] */
631 __IO uint32_t c3osen : 1; /* [7] */
632 __IO uint32_t c4c : 2; /* [9:8] */
633 __IO uint32_t c4oien : 1; /* [10] */
634 __IO uint32_t c4oben : 1; /* [11] */
635 __IO uint32_t c4octrl : 3; /* [14:12] */
636 __IO uint32_t c4osen : 1; /* [15] */
637 __IO uint32_t reserved1 : 16;/* [31:16] */
638 } cm2_output_bit;
639
643 struct
644 {
645 __IO uint32_t c3c : 2; /* [1:0] */
646 __IO uint32_t c3idiv : 2; /* [3:2] */
647 __IO uint32_t c3df : 4; /* [7:4] */
648 __IO uint32_t c4c : 2; /* [9:8] */
649 __IO uint32_t c4idiv : 2; /* [11:10] */
650 __IO uint32_t c4df : 4; /* [15:12] */
651 __IO uint32_t reserved1 : 16;/* [31:16] */
652 } cm2_input_bit;
653 };
654
658 union
659 {
660 uint32_t cctrl;
661 struct
662 {
663 __IO uint32_t c1en : 1; /* [0] */
664 __IO uint32_t c1p : 1; /* [1] */
665 __IO uint32_t c1cen : 1; /* [2] */
666 __IO uint32_t c1cp : 1; /* [3] */
667 __IO uint32_t c2en : 1; /* [4] */
668 __IO uint32_t c2p : 1; /* [5] */
669 __IO uint32_t c2cen : 1; /* [6] */
670 __IO uint32_t c2cp : 1; /* [7] */
671 __IO uint32_t c3en : 1; /* [8] */
672 __IO uint32_t c3p : 1; /* [9] */
673 __IO uint32_t c3cen : 1; /* [10] */
674 __IO uint32_t c3cp : 1; /* [11] */
675 __IO uint32_t c4en : 1; /* [12] */
676 __IO uint32_t c4p : 1; /* [13] */
677 __IO uint32_t reserved1 : 18;/* [31:14] */
678 } cctrl_bit;
679 };
680
684 union
685 {
686 __IO uint32_t cval;
687 struct
688 {
689 __IO uint32_t cval : 32;/* [31:0] */
690 } cval_bit;
691 };
692
696 union
697 {
698 __IO uint32_t div;
699 struct
700 {
701 __IO uint32_t div : 16;/* [15:0] */
702 __IO uint32_t reserved1 : 16;/* [31:16] */
703 } div_bit;
704 };
705
709 union
710 {
711 __IO uint32_t pr;
712 struct
713 {
714 __IO uint32_t pr : 32;/* [31:0] */
715 } pr_bit;
716 };
717
721 union
722 {
723 __IO uint32_t rpr;
724 struct
725 {
726 __IO uint32_t rpr : 8; /* [7:0] */
727 __IO uint32_t reserved1 : 24;/* [31:8] */
728 } rpr_bit;
729 };
730
734 union
735 {
736 uint32_t c1dt;
737 struct
738 {
739 __IO uint32_t c1dt : 32;/* [31:0] */
740 } c1dt_bit;
741 };
742
746 union
747 {
748 uint32_t c2dt;
749 struct
750 {
751 __IO uint32_t c2dt : 32;/* [31:0] */
752 } c2dt_bit;
753 };
754
758 union
759 {
760 __IO uint32_t c3dt;
761 struct
762 {
763 __IO uint32_t c3dt : 32;/* [31:0] */
764 } c3dt_bit;
765 };
766
770 union
771 {
772 __IO uint32_t c4dt;
773 struct
774 {
775 __IO uint32_t c4dt : 32;/* [31:0] */
776 } c4dt_bit;
777 };
778
782 union
783 {
784 __IO uint32_t brk;
785 struct
786 {
787 __IO uint32_t dtc : 8; /* [7:0] */
788 __IO uint32_t wpc : 2; /* [9:8] */
789 __IO uint32_t fcsodis : 1; /* [10] */
790 __IO uint32_t fcsoen : 1; /* [11] */
791 __IO uint32_t brken : 1; /* [12] */
792 __IO uint32_t brkv : 1; /* [13] */
793 __IO uint32_t aoen : 1; /* [14] */
794 __IO uint32_t oen : 1; /* [15] */
795 __IO uint32_t reserved1 : 16; /* [31:16] */
796 } brk_bit;
797 };
801 union
802 {
803 __IO uint32_t dmactrl;
804 struct
805 {
806 __IO uint32_t addr : 5; /* [4:0] */
807 __IO uint32_t reserved1 : 3; /* [7:5] */
808 __IO uint32_t dtb : 5; /* [12:8] */
809 __IO uint32_t reserved2 : 19;/* [31:13] */
810 } dmactrl_bit;
811 };
812
816 union
817 {
818 __IO uint32_t dmadt;
819 struct
820 {
821 __IO uint32_t dmadt : 16;/* [15:0] */
822 __IO uint32_t reserved1 : 16;/* [31:16] */
823 } dmadt_bit;
824 };
825
826} tmr_type;
827
832#define TMR1 ((tmr_type *) TMR1_BASE)
833#define TMR2 ((tmr_type *) TMR2_BASE)
834#define TMR3 ((tmr_type *) TMR3_BASE)
835#define TMR4 ((tmr_type *) TMR4_BASE)
836#define TMR5 ((tmr_type *) TMR5_BASE)
837#define TMR6 ((tmr_type *) TMR6_BASE)
838#define TMR7 ((tmr_type *) TMR7_BASE)
839#define TMR8 ((tmr_type *) TMR8_BASE)
840#define TMR9 ((tmr_type *) TMR9_BASE)
841#define TMR10 ((tmr_type *) TMR10_BASE)
842#define TMR11 ((tmr_type *) TMR11_BASE)
843#define TMR12 ((tmr_type *) TMR12_BASE)
844#define TMR13 ((tmr_type *) TMR13_BASE)
845#define TMR14 ((tmr_type *) TMR14_BASE)
846
851void tmr_reset(tmr_type *tmr_x);
852void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state);
853void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct);
854void tmr_input_default_para_init(tmr_input_config_type *tmr_input_struct);
855void tmr_brkdt_default_para_init(tmr_brkdt_config_type *tmr_brkdt_struct);
856void tmr_base_init(tmr_type* tmr_x, uint32_t tmr_pr, uint32_t tmr_div);
857void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div);
858void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir);
859void tmr_repetition_counter_set(tmr_type *tmr_x, uint8_t tmr_rpr_value);
860void tmr_counter_value_set(tmr_type *tmr_x, uint32_t tmr_cnt_value);
861uint32_t tmr_counter_value_get(tmr_type *tmr_x);
862void tmr_div_value_set(tmr_type *tmr_x, uint32_t tmr_div_value);
863uint32_t tmr_div_value_get(tmr_type *tmr_x);
864void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, \
865 tmr_output_config_type *tmr_output_struct);
866void tmr_output_channel_mode_select(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, \
867 tmr_output_control_mode_type oc_mode);
868void tmr_period_value_set(tmr_type *tmr_x, uint32_t tmr_pr_value);
869uint32_t tmr_period_value_get(tmr_type *tmr_x);
870void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, \
871 uint32_t tmr_channel_value);
872uint32_t tmr_channel_value_get(tmr_type *tmr_x, tmr_channel_select_type tmr_channel);
873void tmr_period_buffer_enable(tmr_type *tmr_x, confirm_state new_state);
874void tmr_output_channel_buffer_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, \
875 confirm_state new_state);
876void tmr_output_channel_immediately_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, \
877 confirm_state new_state);
878void tmr_output_channel_switch_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, \
879 confirm_state new_state);
880void tmr_one_cycle_mode_enable(tmr_type *tmr_x, confirm_state new_state);
881void tmr_32_bit_function_enable (tmr_type *tmr_x, confirm_state new_state);
882void tmr_overflow_request_source_set(tmr_type *tmr_x, confirm_state new_state);
883void tmr_overflow_event_disable(tmr_type *tmr_x, confirm_state new_state);
884void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct, \
885 tmr_channel_input_divider_type divider_factor);
886void tmr_channel_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state);
887void tmr_input_channel_filter_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, \
888 uint16_t filter_value);
889void tmr_pwm_input_config(tmr_type *tmr_x, tmr_input_config_type *input_struct, \
890 tmr_channel_input_divider_type divider_factor);
891void tmr_channel1_input_select(tmr_type *tmr_x, tmr_channel1_input_connected_type ti1_connect);
892void tmr_input_channel_divider_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, \
893 tmr_channel_input_divider_type divider_factor);
894void tmr_primary_mode_select(tmr_type *tmr_x, tmr_primary_select_type primary_mode);
895void tmr_sub_mode_select(tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode);
896void tmr_channel_dma_select(tmr_type *tmr_x, tmr_dma_request_source_type cc_dma_select);
897void tmr_hall_select(tmr_type *tmr_x, confirm_state new_state);
898void tmr_channel_buffer_enable(tmr_type *tmr_x, confirm_state new_state);
899void tmr_trigger_input_select(tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select);
900void tmr_sub_sync_mode_set(tmr_type *tmr_x, confirm_state new_state);
901void tmr_dma_request_enable(tmr_type *tmr_x, tmr_dma_request_type dma_request, confirm_state new_state);
902void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state);
903 flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag);
904void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag);
905void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event);
906void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state);
907void tmr_internal_clock_set(tmr_type *tmr_x);
908
909void tmr_output_channel_polarity_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, \
910 tmr_polarity_active_type oc_polarity);
911void tmr_external_clock_config(tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, \
912 tmr_external_signal_polarity_type es_polarity, uint16_t es_filter);
913void tmr_external_clock_mode1_config(tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, \
914 tmr_external_signal_polarity_type es_polarity, uint16_t es_filter);
915void tmr_external_clock_mode2_config(tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, \
916 tmr_external_signal_polarity_type es_polarity, uint16_t es_filter);
917void tmr_encoder_mode_config(tmr_type *tmr_x, tmr_encoder_mode_type encoder_mode, tmr_input_polarity_type \
918 ic1_polarity, tmr_input_polarity_type ic2_polarity);
919void tmr_force_output_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, \
920 tmr_force_output_type force_output);
921void tmr_dma_control_config(tmr_type *tmr_x, tmr_dma_transfer_length_type dma_length, \
922 tmr_dma_address_type dma_base_address);
923void tmr_brkdt_config(tmr_type *tmr_x, tmr_brkdt_config_type *brkdt_struct);
924
937#ifdef __cplusplus
938}
939#endif
940
941#endif
at32f415.h
at32f415 header file
tmr_output_struct
tmr_output_config_type tmr_output_struct
Definition: project/at_start_f415/examples/tmr/6_steps/src/main.c:39
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
tmr_dma_control_config
void tmr_dma_control_config(tmr_type *tmr_x, tmr_dma_transfer_length_type dma_length, tmr_dma_address_type dma_base_address)
config tmr dma control
Definition: at32f415_tmr.c:1661
tmr_channel_value_get
uint32_t tmr_channel_value_get(tmr_type *tmr_x, tmr_channel_select_type tmr_channel)
get tmr channel value
Definition: at32f415_tmr.c:527
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_period_value_get
uint32_t tmr_period_value_get(tmr_type *tmr_x)
get tmr period value
Definition: at32f415_tmr.c:463
tmr_channel_buffer_enable
void tmr_channel_buffer_enable(tmr_type *tmr_x, confirm_state new_state)
enable tmr channel buffer
Definition: at32f415_tmr.c:1190
tmr_overflow_request_source_set
void tmr_overflow_request_source_set(tmr_type *tmr_x, confirm_state new_state)
select tmr the overflow event sources
Definition: at32f415_tmr.c:747
tmr_output_channel_mode_select
void tmr_output_channel_mode_select(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_control_mode_type oc_mode)
select tmr output channel mode
Definition: at32f415_tmr.c:409
tmr_input_channel_divider_set
void tmr_input_channel_divider_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_channel_input_divider_type divider_factor)
set tmr input channel divider
Definition: at32f415_tmr.c:1079
tmr_dma_request_enable
void tmr_dma_request_enable(tmr_type *tmr_x, tmr_dma_request_type dma_request, confirm_state new_state)
enable or disable tmr dma request
Definition: at32f415_tmr.c:1247
tmr_external_clock_config
void tmr_external_clock_config(tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock
Definition: at32f415_tmr.c:1479
tmr_repetition_counter_set
void tmr_repetition_counter_set(tmr_type *tmr_x, uint8_t tmr_rpr_value)
set the repetition counter register(rpr) value
Definition: at32f415_tmr.c:225
tmr_period_buffer_enable
void tmr_period_buffer_enable(tmr_type *tmr_x, confirm_state new_state)
enable tmr period buffer
Definition: at32f415_tmr.c:567
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_internal_clock_set
void tmr_internal_clock_set(tmr_type *tmr_x)
set tmr select internal clock
Definition: at32f415_tmr.c:1394
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_brkdt_default_para_init
void tmr_brkdt_default_para_init(tmr_brkdt_config_type *tmr_brkdt_struct)
init tmr brkdt default para
Definition: at32f415_tmr.c:146
tmr_force_output_set
void tmr_force_output_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_force_output_type force_output)
set tmr force output
Definition: at32f415_tmr.c:1595
tmr_counter_value_set
void tmr_counter_value_set(tmr_type *tmr_x, uint32_t tmr_cnt_value)
set tmr counter value
Definition: at32f415_tmr.c:244
tmr_div_value_get
uint32_t tmr_div_value_get(tmr_type *tmr_x)
get tmr div value
Definition: at32f415_tmr.c:284
tmr_input_channel_init
void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
init tmr input channel
Definition: at32f415_tmr.c:780
tmr_input_channel_filter_set
void tmr_input_channel_filter_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint16_t filter_value)
set tmr input channel filter
Definition: at32f415_tmr.c:902
tmr_period_value_set
void tmr_period_value_set(tmr_type *tmr_x, uint32_t tmr_pr_value)
set tmr period value
Definition: at32f415_tmr.c:448
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_sub_mode_select
void tmr_sub_mode_select(tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode
Definition: at32f415_tmr.c:1148
tmr_counter_value_get
uint32_t tmr_counter_value_get(tmr_type *tmr_x)
get tmr counter value
Definition: at32f415_tmr.c:257
tmr_brkdt_config
void tmr_brkdt_config(tmr_type *tmr_x, tmr_brkdt_config_type *brkdt_struct)
config tmr break mode and dead-time
Definition: at32f415_tmr.c:1677
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
tmr_external_clock_mode2_config
void tmr_external_clock_mode2_config(tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock mode2
Definition: at32f415_tmr.c:1531
tmr_input_default_para_init
void tmr_input_default_para_init(tmr_input_config_type *tmr_input_struct)
init tmr input default para
Definition: at32f415_tmr.c:132
tmr_div_value_set
void tmr_div_value_set(tmr_type *tmr_x, uint32_t tmr_div_value)
set tmr div value
Definition: at32f415_tmr.c:271
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_event_sw_trigger
void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event
Definition: at32f415_tmr.c:1369
tmr_output_enable
void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable
Definition: at32f415_tmr.c:1382
tmr_channel1_input_select
void tmr_channel1_input_select(tmr_type *tmr_x, tmr_channel1_input_connected_type ti1_connect)
select tmr channel1 input
Definition: at32f415_tmr.c:1055
tmr_sub_sync_mode_set
void tmr_sub_sync_mode_set(tmr_type *tmr_x, confirm_state new_state)
set tmr subordinate synchronization mode
Definition: at32f415_tmr.c:1225
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_hall_select
void tmr_hall_select(tmr_type *tmr_x, confirm_state new_state)
select tmr hall
Definition: at32f415_tmr.c:1177
tmr_32_bit_function_enable
void tmr_32_bit_function_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr 32 bit function(plus mode)
Definition: at32f415_tmr.c:730
tmr_external_clock_mode1_config
void tmr_external_clock_mode1_config(tmr_type *tmr_x, tmr_external_signal_divider_type es_divide, tmr_external_signal_polarity_type es_polarity, uint16_t es_filter)
config tmr external clock mode1
Definition: at32f415_tmr.c:1505
tmr_pwm_input_config
void tmr_pwm_input_config(tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
config tmr pwm input
Definition: at32f415_tmr.c:947
tmr_trigger_input_select
void tmr_trigger_input_select(tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger
Definition: at32f415_tmr.c:1212
tmr_output_channel_buffer_enable
void tmr_output_channel_buffer_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
enable tmr output channel buffer
Definition: at32f415_tmr.c:587
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_primary_mode_select
void tmr_primary_mode_select(tmr_type *tmr_x, tmr_primary_select_type primary_mode)
select tmr primary mode
Definition: at32f415_tmr.c:1126
tmr_overflow_event_disable
void tmr_overflow_event_disable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr overflow event generation
Definition: at32f415_tmr.c:760
tmr_channel_dma_select
void tmr_channel_dma_select(tmr_type *tmr_x, tmr_dma_request_source_type cc_dma_select)
select tmr channel dma
Definition: at32f415_tmr.c:1164
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_output_channel_immediately_set
void tmr_output_channel_immediately_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
set tmr output channel immediately
Definition: at32f415_tmr.c:632
tmr_encoder_mode_config
void tmr_encoder_mode_config(tmr_type *tmr_x, tmr_encoder_mode_type encoder_mode, tmr_input_polarity_type ic1_polarity, tmr_input_polarity_type ic2_polarity)
config tmr encoder mode
Definition: at32f415_tmr.c:1560
tmr_channel_enable
void tmr_channel_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
tmr channel enable
Definition: at32f415_tmr.c:847
tmr_output_channel_switch_set
void tmr_output_channel_switch_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
set tmr output channel switch
Definition: at32f415_tmr.c:677
tmr_reset
void tmr_reset(tmr_type *tmr_x)
tmr reset by crm reset register
Definition: at32f415_tmr.c:51
tmr_output_channel_polarity_set
void tmr_output_channel_polarity_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_polarity_active_type oc_polarity)
set tmr output channel polarity
Definition: at32f415_tmr.c:1419
tmr_one_cycle_mode_enable
void tmr_one_cycle_mode_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr one cycle mode
Definition: at32f415_tmr.c:716
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
tmr_dma_request_type
tmr_dma_request_type
tmr dma request type
Definition: at32f415_tmr.h:268
tmr_external_signal_divider_type
tmr_external_signal_divider_type
tmr external signal divider type
Definition: at32f415_tmr.h:307
tmr_polarity_active_type
tmr_polarity_active_type
tmr polarity active type
Definition: at32f415_tmr.h:297
tmr_count_mode_type
tmr_count_mode_type
tmr counter mode type
Definition: at32f415_tmr.h:105
tmr_input_polarity_type
tmr_input_polarity_type
tmr input channel polarity type
Definition: at32f415_tmr.h:205
tmr_dma_request_source_type
tmr_dma_request_source_type
tmr dma request source select type
Definition: at32f415_tmr.h:259
tmr_channel_select_type
tmr_channel_select_type
tmr channel select type
Definition: at32f415_tmr.h:215
tmr_external_signal_polarity_type
tmr_external_signal_polarity_type
tmr external signal polarity type
Definition: at32f415_tmr.h:318
tmr_dma_address_type
tmr_dma_address_type
tmr dma base address type
Definition: at32f415_tmr.h:352
tmr_wp_level_type
tmr_wp_level_type
tmr write protect level type
Definition: at32f415_tmr.h:387
tmr_channel1_input_connected_type
tmr_channel1_input_connected_type
tmr channel1 input connected type
Definition: at32f415_tmr.h:229
tmr_input_direction_mapped_type
tmr_input_direction_mapped_type
tmr input channel mapped type channel direction
Definition: at32f415_tmr.h:238
tmr_clock_division_type
tmr_clock_division_type
tmr clock division type
Definition: at32f415_tmr.h:95
tmr_event_trigger_type
tmr_event_trigger_type
tmr event triggered by software type
Definition: at32f415_tmr.h:282
tmr_brk_polarity_type
tmr_brk_polarity_type
tmr brk polarity type
Definition: at32f415_tmr.h:378
tmr_output_control_mode_type
tmr_output_control_mode_type
tmr output control mode type
Definition: at32f415_tmr.h:172
tmr_output_polarity_type
tmr_output_polarity_type
tmr output channel polarity type
Definition: at32f415_tmr.h:196
tmr_dma_transfer_length_type
tmr_dma_transfer_length_type
tmr dma transfer length type
Definition: at32f415_tmr.h:327
sub_tmr_input_sel_type
sub_tmr_input_sel_type
tmr subordinate mode input select type
Definition: at32f415_tmr.h:132
tmr_force_output_type
tmr_force_output_type
tmr force output type
Definition: at32f415_tmr.h:187
tmr_sub_mode_select_type
tmr_sub_mode_select_type
tmr subordinate mode select type
Definition: at32f415_tmr.h:147
tmr_primary_select_type
tmr_primary_select_type
tmr primary mode select type
Definition: at32f415_tmr.h:117
tmr_encoder_mode_type
tmr_encoder_mode_type
tmr encoder mode type
Definition: at32f415_tmr.h:162
tmr_channel_input_divider_type
tmr_channel_input_divider_type
tmr input divider type
Definition: at32f415_tmr.h:248
TMR_OVERFLOW_DMA_REQUEST
@ TMR_OVERFLOW_DMA_REQUEST
Definition: at32f415_tmr.h:269
TMR_HALL_DMA_REQUEST
@ TMR_HALL_DMA_REQUEST
Definition: at32f415_tmr.h:274
TMR_C1_DMA_REQUEST
@ TMR_C1_DMA_REQUEST
Definition: at32f415_tmr.h:270
TMR_C2_DMA_REQUEST
@ TMR_C2_DMA_REQUEST
Definition: at32f415_tmr.h:271
TMR_C3_DMA_REQUEST
@ TMR_C3_DMA_REQUEST
Definition: at32f415_tmr.h:272
TMR_TRIGGER_DMA_REQUEST
@ TMR_TRIGGER_DMA_REQUEST
Definition: at32f415_tmr.h:275
TMR_C4_DMA_REQUEST
@ TMR_C4_DMA_REQUEST
Definition: at32f415_tmr.h:273
TMR_ES_FREQUENCY_DIV_1
@ TMR_ES_FREQUENCY_DIV_1
Definition: at32f415_tmr.h:308
TMR_ES_FREQUENCY_DIV_8
@ TMR_ES_FREQUENCY_DIV_8
Definition: at32f415_tmr.h:311
TMR_ES_FREQUENCY_DIV_4
@ TMR_ES_FREQUENCY_DIV_4
Definition: at32f415_tmr.h:310
TMR_ES_FREQUENCY_DIV_2
@ TMR_ES_FREQUENCY_DIV_2
Definition: at32f415_tmr.h:309
TMR_POLARITY_ACTIVE_HIGH
@ TMR_POLARITY_ACTIVE_HIGH
Definition: at32f415_tmr.h:298
TMR_POLARITY_ACTIVE_LOW
@ TMR_POLARITY_ACTIVE_LOW
Definition: at32f415_tmr.h:299
TMR_POLARITY_ACTIVE_BOTH
@ TMR_POLARITY_ACTIVE_BOTH
Definition: at32f415_tmr.h:300
TMR_COUNT_DOWN
@ TMR_COUNT_DOWN
Definition: at32f415_tmr.h:107
TMR_COUNT_TWO_WAY_2
@ TMR_COUNT_TWO_WAY_2
Definition: at32f415_tmr.h:109
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_COUNT_TWO_WAY_3
@ TMR_COUNT_TWO_WAY_3
Definition: at32f415_tmr.h:110
TMR_COUNT_TWO_WAY_1
@ TMR_COUNT_TWO_WAY_1
Definition: at32f415_tmr.h:108
TMR_INPUT_BOTH_EDGE
@ TMR_INPUT_BOTH_EDGE
Definition: at32f415_tmr.h:208
TMR_INPUT_FALLING_EDGE
@ TMR_INPUT_FALLING_EDGE
Definition: at32f415_tmr.h:207
TMR_INPUT_RISING_EDGE
@ TMR_INPUT_RISING_EDGE
Definition: at32f415_tmr.h:206
TMR_DMA_REQUEST_BY_CHANNEL
@ TMR_DMA_REQUEST_BY_CHANNEL
Definition: at32f415_tmr.h:260
TMR_DMA_REQUEST_BY_OVERFLOW
@ TMR_DMA_REQUEST_BY_OVERFLOW
Definition: at32f415_tmr.h:261
TMR_SELECT_CHANNEL_1C
@ TMR_SELECT_CHANNEL_1C
Definition: at32f415_tmr.h:217
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_2C
@ TMR_SELECT_CHANNEL_2C
Definition: at32f415_tmr.h:219
TMR_SELECT_CHANNEL_4
@ TMR_SELECT_CHANNEL_4
Definition: at32f415_tmr.h:222
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_SELECT_CHANNEL_3C
@ TMR_SELECT_CHANNEL_3C
Definition: at32f415_tmr.h:221
TMR_ES_POLARITY_INVERTED
@ TMR_ES_POLARITY_INVERTED
Definition: at32f415_tmr.h:320
TMR_ES_POLARITY_NON_INVERTED
@ TMR_ES_POLARITY_NON_INVERTED
Definition: at32f415_tmr.h:319
TMR_C2DT_ADDRESS
@ TMR_C2DT_ADDRESS
Definition: at32f415_tmr.h:367
TMR_C1DT_ADDRESS
@ TMR_C1DT_ADDRESS
Definition: at32f415_tmr.h:366
TMR_STCTRL_ADDRESS
@ TMR_STCTRL_ADDRESS
Definition: at32f415_tmr.h:355
TMR_BRK_ADDRESS
@ TMR_BRK_ADDRESS
Definition: at32f415_tmr.h:370
TMR_CTRL2_ADDRESS
@ TMR_CTRL2_ADDRESS
Definition: at32f415_tmr.h:354
TMR_PR_ADDRESS
@ TMR_PR_ADDRESS
Definition: at32f415_tmr.h:364
TMR_CVAL_ADDRESS
@ TMR_CVAL_ADDRESS
Definition: at32f415_tmr.h:362
TMR_CM1_ADDRESS
@ TMR_CM1_ADDRESS
Definition: at32f415_tmr.h:359
TMR_IDEN_ADDRESS
@ TMR_IDEN_ADDRESS
Definition: at32f415_tmr.h:356
TMR_DMACTRL_ADDRESS
@ TMR_DMACTRL_ADDRESS
Definition: at32f415_tmr.h:371
TMR_CCTRL_ADDRESS
@ TMR_CCTRL_ADDRESS
Definition: at32f415_tmr.h:361
TMR_RPR_ADDRESS
@ TMR_RPR_ADDRESS
Definition: at32f415_tmr.h:365
TMR_ISTS_ADDRESS
@ TMR_ISTS_ADDRESS
Definition: at32f415_tmr.h:357
TMR_C4DT_ADDRESS
@ TMR_C4DT_ADDRESS
Definition: at32f415_tmr.h:369
TMR_DIV_ADDRESS
@ TMR_DIV_ADDRESS
Definition: at32f415_tmr.h:363
TMR_SWEVT_ADDRESS
@ TMR_SWEVT_ADDRESS
Definition: at32f415_tmr.h:358
TMR_CM2_ADDRESS
@ TMR_CM2_ADDRESS
Definition: at32f415_tmr.h:360
TMR_C3DT_ADDRESS
@ TMR_C3DT_ADDRESS
Definition: at32f415_tmr.h:368
TMR_CTRL1_ADDRESS
@ TMR_CTRL1_ADDRESS
Definition: at32f415_tmr.h:353
TMR_WP_LEVEL_3
@ TMR_WP_LEVEL_3
Definition: at32f415_tmr.h:389
TMR_WP_LEVEL_2
@ TMR_WP_LEVEL_2
Definition: at32f415_tmr.h:390
TMR_WP_OFF
@ TMR_WP_OFF
Definition: at32f415_tmr.h:388
TMR_WP_LEVEL_1
@ TMR_WP_LEVEL_1
Definition: at32f415_tmr.h:391
TMR_CHANEL1_2_3_CONNECTED_C1IRAW_XOR
@ TMR_CHANEL1_2_3_CONNECTED_C1IRAW_XOR
Definition: at32f415_tmr.h:231
TMR_CHANEL1_CONNECTED_C1IRAW
@ TMR_CHANEL1_CONNECTED_C1IRAW
Definition: at32f415_tmr.h:230
TMR_CC_CHANNEL_MAPPED_STI
@ TMR_CC_CHANNEL_MAPPED_STI
Definition: at32f415_tmr.h:241
TMR_CC_CHANNEL_MAPPED_DIRECT
@ TMR_CC_CHANNEL_MAPPED_DIRECT
Definition: at32f415_tmr.h:239
TMR_CC_CHANNEL_MAPPED_INDIRECT
@ TMR_CC_CHANNEL_MAPPED_INDIRECT
Definition: at32f415_tmr.h:240
TMR_CLOCK_DIV2
@ TMR_CLOCK_DIV2
Definition: at32f415_tmr.h:97
TMR_CLOCK_DIV4
@ TMR_CLOCK_DIV4
Definition: at32f415_tmr.h:98
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_C1_SWTRIG
@ TMR_C1_SWTRIG
Definition: at32f415_tmr.h:284
TMR_C3_SWTRIG
@ TMR_C3_SWTRIG
Definition: at32f415_tmr.h:286
TMR_C2_SWTRIG
@ TMR_C2_SWTRIG
Definition: at32f415_tmr.h:285
TMR_C4_SWTRIG
@ TMR_C4_SWTRIG
Definition: at32f415_tmr.h:287
TMR_BRK_SWTRIG
@ TMR_BRK_SWTRIG
Definition: at32f415_tmr.h:290
TMR_HALL_SWTRIG
@ TMR_HALL_SWTRIG
Definition: at32f415_tmr.h:288
TMR_TRIGGER_SWTRIG
@ TMR_TRIGGER_SWTRIG
Definition: at32f415_tmr.h:289
TMR_OVERFLOW_SWTRIG
@ TMR_OVERFLOW_SWTRIG
Definition: at32f415_tmr.h:283
TMR_BRK_INPUT_ACTIVE_HIGH
@ TMR_BRK_INPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:380
TMR_BRK_INPUT_ACTIVE_LOW
@ TMR_BRK_INPUT_ACTIVE_LOW
Definition: at32f415_tmr.h:379
TMR_OUTPUT_CONTROL_PWM_MODE_B
@ TMR_OUTPUT_CONTROL_PWM_MODE_B
Definition: at32f415_tmr.h:180
TMR_OUTPUT_CONTROL_FORCE_HIGH
@ TMR_OUTPUT_CONTROL_FORCE_HIGH
Definition: at32f415_tmr.h:177
TMR_OUTPUT_CONTROL_SWITCH
@ TMR_OUTPUT_CONTROL_SWITCH
Definition: at32f415_tmr.h:176
TMR_OUTPUT_CONTROL_OFF
@ TMR_OUTPUT_CONTROL_OFF
Definition: at32f415_tmr.h:173
TMR_OUTPUT_CONTROL_LOW
@ TMR_OUTPUT_CONTROL_LOW
Definition: at32f415_tmr.h:175
TMR_OUTPUT_CONTROL_FORCE_LOW
@ TMR_OUTPUT_CONTROL_FORCE_LOW
Definition: at32f415_tmr.h:178
TMR_OUTPUT_CONTROL_PWM_MODE_A
@ TMR_OUTPUT_CONTROL_PWM_MODE_A
Definition: at32f415_tmr.h:179
TMR_OUTPUT_CONTROL_HIGH
@ TMR_OUTPUT_CONTROL_HIGH
Definition: at32f415_tmr.h:174
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR_OUTPUT_ACTIVE_LOW
@ TMR_OUTPUT_ACTIVE_LOW
Definition: at32f415_tmr.h:198
TMR_DMA_TRANSFER_15BYTES
@ TMR_DMA_TRANSFER_15BYTES
Definition: at32f415_tmr.h:342
TMR_DMA_TRANSFER_11BYTES
@ TMR_DMA_TRANSFER_11BYTES
Definition: at32f415_tmr.h:338
TMR_DMA_TRANSFER_13BYTES
@ TMR_DMA_TRANSFER_13BYTES
Definition: at32f415_tmr.h:340
TMR_DMA_TRANSFER_14BYTES
@ TMR_DMA_TRANSFER_14BYTES
Definition: at32f415_tmr.h:341
TMR_DMA_TRANSFER_2BYTES
@ TMR_DMA_TRANSFER_2BYTES
Definition: at32f415_tmr.h:329
TMR_DMA_TRANSFER_18BYTES
@ TMR_DMA_TRANSFER_18BYTES
Definition: at32f415_tmr.h:345
TMR_DMA_TRANSFER_9BYTES
@ TMR_DMA_TRANSFER_9BYTES
Definition: at32f415_tmr.h:336
TMR_DMA_TRANSFER_12BYTES
@ TMR_DMA_TRANSFER_12BYTES
Definition: at32f415_tmr.h:339
TMR_DMA_TRANSFER_7BYTES
@ TMR_DMA_TRANSFER_7BYTES
Definition: at32f415_tmr.h:334
TMR_DMA_TRANSFER_17BYTES
@ TMR_DMA_TRANSFER_17BYTES
Definition: at32f415_tmr.h:344
TMR_DMA_TRANSFER_16BYTES
@ TMR_DMA_TRANSFER_16BYTES
Definition: at32f415_tmr.h:343
TMR_DMA_TRANSFER_5BYTES
@ TMR_DMA_TRANSFER_5BYTES
Definition: at32f415_tmr.h:332
TMR_DMA_TRANSFER_10BYTES
@ TMR_DMA_TRANSFER_10BYTES
Definition: at32f415_tmr.h:337
TMR_DMA_TRANSFER_1BYTE
@ TMR_DMA_TRANSFER_1BYTE
Definition: at32f415_tmr.h:328
TMR_DMA_TRANSFER_6BYTES
@ TMR_DMA_TRANSFER_6BYTES
Definition: at32f415_tmr.h:333
TMR_DMA_TRANSFER_4BYTES
@ TMR_DMA_TRANSFER_4BYTES
Definition: at32f415_tmr.h:331
TMR_DMA_TRANSFER_8BYTES
@ TMR_DMA_TRANSFER_8BYTES
Definition: at32f415_tmr.h:335
TMR_DMA_TRANSFER_3BYTES
@ TMR_DMA_TRANSFER_3BYTES
Definition: at32f415_tmr.h:330
TMR_SUB_INPUT_SEL_IS2
@ TMR_SUB_INPUT_SEL_IS2
Definition: at32f415_tmr.h:135
TMR_SUB_INPUT_SEL_IS0
@ TMR_SUB_INPUT_SEL_IS0
Definition: at32f415_tmr.h:133
TMR_SUB_INPUT_SEL_C2DF2
@ TMR_SUB_INPUT_SEL_C2DF2
Definition: at32f415_tmr.h:139
TMR_SUB_INPUT_SEL_EXTIN
@ TMR_SUB_INPUT_SEL_EXTIN
Definition: at32f415_tmr.h:140
TMR_SUB_INPUT_SEL_IS3
@ TMR_SUB_INPUT_SEL_IS3
Definition: at32f415_tmr.h:136
TMR_SUB_INPUT_SEL_C1DF1
@ TMR_SUB_INPUT_SEL_C1DF1
Definition: at32f415_tmr.h:138
TMR_SUB_INPUT_SEL_C1INC
@ TMR_SUB_INPUT_SEL_C1INC
Definition: at32f415_tmr.h:137
TMR_SUB_INPUT_SEL_IS1
@ TMR_SUB_INPUT_SEL_IS1
Definition: at32f415_tmr.h:134
TMR_FORCE_OUTPUT_HIGH
@ TMR_FORCE_OUTPUT_HIGH
Definition: at32f415_tmr.h:188
TMR_FORCE_OUTPUT_LOW
@ TMR_FORCE_OUTPUT_LOW
Definition: at32f415_tmr.h:189
TMR_SUB_ENCODER_MODE_A
@ TMR_SUB_ENCODER_MODE_A
Definition: at32f415_tmr.h:149
TMR_SUB_EXTERNAL_CLOCK_MODE_A
@ TMR_SUB_EXTERNAL_CLOCK_MODE_A
Definition: at32f415_tmr.h:155
TMR_SUB_ENCODER_MODE_C
@ TMR_SUB_ENCODER_MODE_C
Definition: at32f415_tmr.h:151
TMR_SUB_MODE_DIABLE
@ TMR_SUB_MODE_DIABLE
Definition: at32f415_tmr.h:148
TMR_SUB_RESET_MODE
@ TMR_SUB_RESET_MODE
Definition: at32f415_tmr.h:152
TMR_SUB_ENCODER_MODE_B
@ TMR_SUB_ENCODER_MODE_B
Definition: at32f415_tmr.h:150
TMR_SUB_HANG_MODE
@ TMR_SUB_HANG_MODE
Definition: at32f415_tmr.h:153
TMR_SUB_TRIGGER_MODE
@ TMR_SUB_TRIGGER_MODE
Definition: at32f415_tmr.h:154
TMR_PRIMARY_SEL_RESET
@ TMR_PRIMARY_SEL_RESET
Definition: at32f415_tmr.h:118
TMR_PRIMARY_SEL_C2ORAW
@ TMR_PRIMARY_SEL_C2ORAW
Definition: at32f415_tmr.h:123
TMR_PRIMARY_SEL_C1ORAW
@ TMR_PRIMARY_SEL_C1ORAW
Definition: at32f415_tmr.h:122
TMR_PRIMARY_SEL_C4ORAW
@ TMR_PRIMARY_SEL_C4ORAW
Definition: at32f415_tmr.h:125
TMR_PRIMARY_SEL_COMPARE
@ TMR_PRIMARY_SEL_COMPARE
Definition: at32f415_tmr.h:121
TMR_PRIMARY_SEL_ENABLE
@ TMR_PRIMARY_SEL_ENABLE
Definition: at32f415_tmr.h:119
TMR_PRIMARY_SEL_OVERFLOW
@ TMR_PRIMARY_SEL_OVERFLOW
Definition: at32f415_tmr.h:120
TMR_PRIMARY_SEL_C3ORAW
@ TMR_PRIMARY_SEL_C3ORAW
Definition: at32f415_tmr.h:124
TMR_ENCODER_MODE_C
@ TMR_ENCODER_MODE_C
Definition: at32f415_tmr.h:165
TMR_ENCODER_MODE_A
@ TMR_ENCODER_MODE_A
Definition: at32f415_tmr.h:163
TMR_ENCODER_MODE_B
@ TMR_ENCODER_MODE_B
Definition: at32f415_tmr.h:164
TMR_CHANNEL_INPUT_DIV_4
@ TMR_CHANNEL_INPUT_DIV_4
Definition: at32f415_tmr.h:251
TMR_CHANNEL_INPUT_DIV_2
@ TMR_CHANNEL_INPUT_DIV_2
Definition: at32f415_tmr.h:250
TMR_CHANNEL_INPUT_DIV_8
@ TMR_CHANNEL_INPUT_DIV_8
Definition: at32f415_tmr.h:252
TMR_CHANNEL_INPUT_DIV_1
@ TMR_CHANNEL_INPUT_DIV_1
Definition: at32f415_tmr.h:249
tmr_brkdt_config_type
tmr brkdt config type
Definition: at32f415_tmr.h:423
tmr_brkdt_config_type::brk_enable
confirm_state brk_enable
Definition: at32f415_tmr.h:430
tmr_brkdt_config_type::deadtime
uint8_t deadtime
Definition: at32f415_tmr.h:424
tmr_brkdt_config_type::auto_output_enable
confirm_state auto_output_enable
Definition: at32f415_tmr.h:427
tmr_brkdt_config_type::wp_level
tmr_wp_level_type wp_level
Definition: at32f415_tmr.h:426
tmr_brkdt_config_type::fcsoen_state
confirm_state fcsoen_state
Definition: at32f415_tmr.h:428
tmr_brkdt_config_type::fcsodis_state
confirm_state fcsodis_state
Definition: at32f415_tmr.h:429
tmr_brkdt_config_type::brk_polarity
tmr_brk_polarity_type brk_polarity
Definition: at32f415_tmr.h:425
tmr_input_config_type
tmr input capture config type
Definition: at32f415_tmr.h:412
tmr_input_config_type::input_mapped_select
tmr_input_direction_mapped_type input_mapped_select
Definition: at32f415_tmr.h:415
tmr_input_config_type::input_filter_value
uint8_t input_filter_value
Definition: at32f415_tmr.h:416
tmr_input_config_type::input_polarity_select
tmr_input_polarity_type input_polarity_select
Definition: at32f415_tmr.h:414
tmr_input_config_type::input_channel_select
tmr_channel_select_type input_channel_select
Definition: at32f415_tmr.h:413
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::occ_output_state
confirm_state occ_output_state
Definition: at32f415_tmr.h:405
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::occ_polarity
tmr_output_polarity_type occ_polarity
Definition: at32f415_tmr.h:403
tmr_output_config_type::occ_idle_state
confirm_state occ_idle_state
Definition: at32f415_tmr.h:401
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
tmr_type
type define tmr register all
Definition: at32f415_tmr.h:437
tmr_type::ovfif
__IO uint32_t ovfif
Definition: at32f415_tmr.h:538
tmr_type::c1cen
__IO uint32_t c1cen
Definition: at32f415_tmr.h:665
tmr_type::pmen
__IO uint32_t pmen
Definition: at32f415_tmr.h:453
tmr_type::trgif
__IO uint32_t trgif
Definition: at32f415_tmr.h:544
tmr_type::brken
__IO uint32_t brken
Definition: at32f415_tmr.h:791
tmr_type::c1idiv
__IO uint32_t c1idiv
Definition: at32f415_tmr.h:606
tmr_type::dmactrl
__IO uint32_t dmactrl
Definition: at32f415_tmr.h:803
tmr_type::dtc
__IO uint32_t dtc
Definition: at32f415_tmr.h:787
tmr_type::c1en
__IO uint32_t c1en
Definition: at32f415_tmr.h:663
tmr_type::c4df
__IO uint32_t c4df
Definition: at32f415_tmr.h:650
tmr_type::c3octrl
__IO uint32_t c3octrl
Definition: at32f415_tmr.h:630
tmr_type::brkif
__IO uint32_t brkif
Definition: at32f415_tmr.h:545
tmr_type::c2osen
__IO uint32_t c2osen
Definition: at32f415_tmr.h:596
tmr_type::swevt
__IO uint32_t swevt
Definition: at32f415_tmr.h:560
tmr_type::ovfden
__IO uint32_t ovfden
Definition: at32f415_tmr.h:519
tmr_type::c2en
__IO uint32_t c2en
Definition: at32f415_tmr.h:667
tmr_type::stctrl
__IO uint32_t stctrl
Definition: at32f415_tmr.h:488
tmr_type::c3df
__IO uint32_t c3df
Definition: at32f415_tmr.h:647
tmr_type::wpc
__IO uint32_t wpc
Definition: at32f415_tmr.h:788
tmr_type::c3oben
__IO uint32_t c3oben
Definition: at32f415_tmr.h:629
tmr_type::cnt_dir
__IO uint32_t cnt_dir
Definition: at32f415_tmr.h:450
tmr_type::c2if
__IO uint32_t c2if
Definition: at32f415_tmr.h:540
tmr_type::c3if
__IO uint32_t c3if
Definition: at32f415_tmr.h:541
tmr_type::c4octrl
__IO uint32_t c4octrl
Definition: at32f415_tmr.h:635
tmr_type::hallif
__IO uint32_t hallif
Definition: at32f415_tmr.h:543
tmr_type::c1insel
__IO uint32_t c1insel
Definition: at32f415_tmr.h:471
tmr_type::c2cios
__IO uint32_t c2cios
Definition: at32f415_tmr.h:475
tmr_type::div
__IO uint32_t div
Definition: at32f415_tmr.h:698
tmr_type::hallswtr
__IO uint32_t hallswtr
Definition: at32f415_tmr.h:568
tmr_type::esf
__IO uint32_t esf
Definition: at32f415_tmr.h:495
tmr_type::c1osen
__IO uint32_t c1osen
Definition: at32f415_tmr.h:591
tmr_type::c2cen
__IO uint32_t c2cen
Definition: at32f415_tmr.h:669
tmr_type::c2ien
__IO uint32_t c2ien
Definition: at32f415_tmr.h:513
tmr_type::drs
__IO uint32_t drs
Definition: at32f415_tmr.h:469
tmr_type::iden
__IO uint32_t iden
Definition: at32f415_tmr.h:508
tmr_type::c1oben
__IO uint32_t c1oben
Definition: at32f415_tmr.h:589
tmr_type::ists
__IO uint32_t ists
Definition: at32f415_tmr.h:535
tmr_type::c1c
__IO uint32_t c1c
Definition: at32f415_tmr.h:587
tmr_type::c3cen
__IO uint32_t c3cen
Definition: at32f415_tmr.h:673
tmr_type::c4p
__IO uint32_t c4p
Definition: at32f415_tmr.h:676
tmr_type::brkv
__IO uint32_t brkv
Definition: at32f415_tmr.h:792
tmr_type::brk
__IO uint32_t brk
Definition: at32f415_tmr.h:784
tmr_type::stis
__IO uint32_t stis
Definition: at32f415_tmr.h:493
tmr_type::ovfswtr
__IO uint32_t ovfswtr
Definition: at32f415_tmr.h:563
tmr_type::c3idiv
__IO uint32_t c3idiv
Definition: at32f415_tmr.h:646
tmr_type::c4osen
__IO uint32_t c4osen
Definition: at32f415_tmr.h:636
tmr_type::c1ien
__IO uint32_t c1ien
Definition: at32f415_tmr.h:512
tmr_type::c1octrl
__IO uint32_t c1octrl
Definition: at32f415_tmr.h:590
tmr_type::hallien
__IO uint32_t hallien
Definition: at32f415_tmr.h:516
tmr_type::tmren
__IO uint32_t tmren
Definition: at32f415_tmr.h:446
tmr_type::oen
__IO uint32_t oen
Definition: at32f415_tmr.h:794
tmr_type::sts
__IO uint32_t sts
Definition: at32f415_tmr.h:494
tmr_type::brkie
__IO uint32_t brkie
Definition: at32f415_tmr.h:518
tmr_type::c2idiv
__IO uint32_t c2idiv
Definition: at32f415_tmr.h:609
tmr_type::c1p
__IO uint32_t c1p
Definition: at32f415_tmr.h:664
tmr_type::brkswtr
__IO uint32_t brkswtr
Definition: at32f415_tmr.h:570
tmr_type::c1rf
__IO uint32_t c1rf
Definition: at32f415_tmr.h:547
tmr_type::ovfien
__IO uint32_t ovfien
Definition: at32f415_tmr.h:511
tmr_type::c1oien
__IO uint32_t c1oien
Definition: at32f415_tmr.h:588
tmr_type::pr
__IO uint32_t pr
Definition: at32f415_tmr.h:711
tmr_type::c3oien
__IO uint32_t c3oien
Definition: at32f415_tmr.h:628
tmr_type::c2swtr
__IO uint32_t c2swtr
Definition: at32f415_tmr.h:565
tmr_type::c1dt
uint32_t c1dt
Definition: at32f415_tmr.h:736
tmr_type::c2oben
__IO uint32_t c2oben
Definition: at32f415_tmr.h:594
tmr_type::c1den
__IO uint32_t c1den
Definition: at32f415_tmr.h:520
tmr_type::cm2
__IO uint32_t cm2
Definition: at32f415_tmr.h:620
tmr_type::c2octrl
__IO uint32_t c2octrl
Definition: at32f415_tmr.h:595
tmr_type::smsel
__IO uint32_t smsel
Definition: at32f415_tmr.h:491
tmr_type::c3p
__IO uint32_t c3p
Definition: at32f415_tmr.h:672
tmr_type::c2dt
__IO uint32_t c2dt
Definition: at32f415_tmr.h:751
tmr_type::dmadt
__IO uint32_t dmadt
Definition: at32f415_tmr.h:818
tmr_type::c1if
__IO uint32_t c1if
Definition: at32f415_tmr.h:539
tmr_type::c1cp
__IO uint32_t c1cp
Definition: at32f415_tmr.h:666
tmr_type::c3c
__IO uint32_t c3c
Definition: at32f415_tmr.h:627
tmr_type::c4rf
__IO uint32_t c4rf
Definition: at32f415_tmr.h:550
tmr_type::c3cios
__IO uint32_t c3cios
Definition: at32f415_tmr.h:477
tmr_type::clkdiv
__IO uint32_t clkdiv
Definition: at32f415_tmr.h:452
tmr_type::tden
__IO uint32_t tden
Definition: at32f415_tmr.h:525
tmr_type::ovfs
__IO uint32_t ovfs
Definition: at32f415_tmr.h:448
tmr_type::c1dt
__IO uint32_t c1dt
Definition: at32f415_tmr.h:739
tmr_type::c3swtr
__IO uint32_t c3swtr
Definition: at32f415_tmr.h:566
tmr_type::cbctrl
__IO uint32_t cbctrl
Definition: at32f415_tmr.h:466
tmr_type::dtb
__IO uint32_t dtb
Definition: at32f415_tmr.h:808
tmr_type::c4ios
__IO uint32_t c4ios
Definition: at32f415_tmr.h:478
tmr_type::c4swtr
__IO uint32_t c4swtr
Definition: at32f415_tmr.h:567
tmr_type::prben
__IO uint32_t prben
Definition: at32f415_tmr.h:451
tmr_type::tien
__IO uint32_t tien
Definition: at32f415_tmr.h:517
tmr_type::ccfs
__IO uint32_t ccfs
Definition: at32f415_tmr.h:468
tmr_type::ecmben
__IO uint32_t ecmben
Definition: at32f415_tmr.h:497
tmr_type::ovfen
__IO uint32_t ovfen
Definition: at32f415_tmr.h:447
tmr_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_tmr.h:479
tmr_type::cm1
__IO uint32_t cm1
Definition: at32f415_tmr.h:580
tmr_type::c2den
__IO uint32_t c2den
Definition: at32f415_tmr.h:521
tmr_type::c4en
__IO uint32_t c4en
Definition: at32f415_tmr.h:675
tmr_type::reserved
__IO uint32_t reserved
Definition: at32f415_tmr.h:571
tmr_type::trgswtr
__IO uint32_t trgswtr
Definition: at32f415_tmr.h:569
tmr_type::fcsoen
__IO uint32_t fcsoen
Definition: at32f415_tmr.h:790
tmr_type::esdiv
__IO uint32_t esdiv
Definition: at32f415_tmr.h:496
tmr_type::c3en
__IO uint32_t c3en
Definition: at32f415_tmr.h:671
tmr_type::c2p
__IO uint32_t c2p
Definition: at32f415_tmr.h:668
tmr_type::c3ios
__IO uint32_t c3ios
Definition: at32f415_tmr.h:476
tmr_type::ocmen
__IO uint32_t ocmen
Definition: at32f415_tmr.h:449
tmr_type::hallde
__IO uint32_t hallde
Definition: at32f415_tmr.h:524
tmr_type::c1swtr
__IO uint32_t c1swtr
Definition: at32f415_tmr.h:564
tmr_type::c3rf
__IO uint32_t c3rf
Definition: at32f415_tmr.h:549
tmr_type::c3den
__IO uint32_t c3den
Definition: at32f415_tmr.h:522
tmr_type::c4oien
__IO uint32_t c4oien
Definition: at32f415_tmr.h:633
tmr_type::c2dt
uint32_t c2dt
Definition: at32f415_tmr.h:748
tmr_type::addr
__IO uint32_t addr
Definition: at32f415_tmr.h:806
tmr_type::c3cp
__IO uint32_t c3cp
Definition: at32f415_tmr.h:674
tmr_type::c2df
__IO uint32_t c2df
Definition: at32f415_tmr.h:610
tmr_type::c4idiv
__IO uint32_t c4idiv
Definition: at32f415_tmr.h:649
tmr_type::c2ios
__IO uint32_t c2ios
Definition: at32f415_tmr.h:474
tmr_type::c3osen
__IO uint32_t c3osen
Definition: at32f415_tmr.h:631
tmr_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_tmr.h:454
tmr_type::rpr
__IO uint32_t rpr
Definition: at32f415_tmr.h:723
tmr_type::c2c
__IO uint32_t c2c
Definition: at32f415_tmr.h:592
tmr_type::c1ios
__IO uint32_t c1ios
Definition: at32f415_tmr.h:472
tmr_type::ctrl1
__IO uint32_t ctrl1
Definition: at32f415_tmr.h:443
tmr_type::c4den
__IO uint32_t c4den
Definition: at32f415_tmr.h:523
tmr_type::c1df
__IO uint32_t c1df
Definition: at32f415_tmr.h:607
tmr_type::c2oien
__IO uint32_t c2oien
Definition: at32f415_tmr.h:593
tmr_type::c4dt
__IO uint32_t c4dt
Definition: at32f415_tmr.h:772
tmr_type::c4if
__IO uint32_t c4if
Definition: at32f415_tmr.h:542
tmr_type::c3ien
__IO uint32_t c3ien
Definition: at32f415_tmr.h:514
tmr_type::ctrl2
__IO uint32_t ctrl2
Definition: at32f415_tmr.h:463
tmr_type::c3dt
__IO uint32_t c3dt
Definition: at32f415_tmr.h:760
tmr_type::c2cp
__IO uint32_t c2cp
Definition: at32f415_tmr.h:670
tmr_type::cctrl
uint32_t cctrl
Definition: at32f415_tmr.h:660
tmr_type::c4c
__IO uint32_t c4c
Definition: at32f415_tmr.h:632
tmr_type::c4oben
__IO uint32_t c4oben
Definition: at32f415_tmr.h:634
tmr_type::fcsodis
__IO uint32_t fcsodis
Definition: at32f415_tmr.h:789
tmr_type::cval
__IO uint32_t cval
Definition: at32f415_tmr.h:686
tmr_type::c4ien
__IO uint32_t c4ien
Definition: at32f415_tmr.h:515
tmr_type::esp
__IO uint32_t esp
Definition: at32f415_tmr.h:498
tmr_type::ptos
__IO uint32_t ptos
Definition: at32f415_tmr.h:470
tmr_type::c1cios
__IO uint32_t c1cios
Definition: at32f415_tmr.h:473
tmr_type::aoen
__IO uint32_t aoen
Definition: at32f415_tmr.h:793
tmr_type::c2rf
__IO uint32_t c2rf
Definition: at32f415_tmr.h:548


AT32F415 Firmwary Library: at32f415_usart.c Source File

  • libraries
  • drivers
  • src
at32f415_usart.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_conf.h"
29
39#ifdef USART_MODULE_ENABLED
40
52void usart_reset(usart_type* usart_x)
53{
54 if(usart_x == USART1)
55 {
56 crm_periph_reset(CRM_USART1_PERIPH_RESET, TRUE);
57 crm_periph_reset(CRM_USART1_PERIPH_RESET, FALSE);
58 }
59 else if(usart_x == USART2)
60 {
61 crm_periph_reset(CRM_USART2_PERIPH_RESET, TRUE);
62 crm_periph_reset(CRM_USART2_PERIPH_RESET, FALSE);
63 }
64 else if(usart_x == USART3)
65 {
66 crm_periph_reset(CRM_USART3_PERIPH_RESET, TRUE);
67 crm_periph_reset(CRM_USART3_PERIPH_RESET, FALSE);
68 }
69 else if(usart_x == UART4)
70 {
71 crm_periph_reset(CRM_UART4_PERIPH_RESET, TRUE);
72 crm_periph_reset(CRM_UART4_PERIPH_RESET, FALSE);
73 }
74 else if(usart_x == UART5)
75 {
76 crm_periph_reset(CRM_UART5_PERIPH_RESET, TRUE);
77 crm_periph_reset(CRM_UART5_PERIPH_RESET, FALSE);
78 }
79}
80
99void usart_init(usart_type* usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
100{
101 crm_clocks_freq_type clocks_freq;
102 uint32_t apb_clock, temp_val;
103 crm_clocks_freq_get(&clocks_freq);
104 if(usart_x == USART1)
105 {
106 apb_clock = clocks_freq.apb2_freq;
107 }
108 else
109 {
110 apb_clock = clocks_freq.apb1_freq;
111 }
112 temp_val = (apb_clock * 10 / baud_rate);
113 if((temp_val % 10) < 5)
114 {
115 temp_val = (temp_val / 10);
116 }
117 else
118 {
119 temp_val = (temp_val / 10) + 1;
120 }
121 usart_x->baudr_bit.div = temp_val;
122 usart_x->ctrl1_bit.dbn = data_bit;
123 usart_x->ctrl2_bit.stopbn = stop_bit;
124}
125
138void usart_parity_selection_config(usart_type* usart_x, usart_parity_selection_type parity)
139{
140 if(parity == USART_PARITY_NONE)
141 {
142 usart_x->ctrl1_bit.psel = FALSE;
143 usart_x->ctrl1_bit.pen = FALSE;
144 }
145 else if(parity == USART_PARITY_EVEN)
146 {
147 usart_x->ctrl1_bit.psel = FALSE;
148 usart_x->ctrl1_bit.pen = TRUE;
149 }
150 else if(parity == USART_PARITY_ODD)
151 {
152 usart_x->ctrl1_bit.psel = TRUE;
153 usart_x->ctrl1_bit.pen = TRUE;
154 }
155}
156
166void usart_enable(usart_type* usart_x, confirm_state new_state)
167{
168 usart_x->ctrl1_bit.uen = new_state;
169}
170
179void usart_transmitter_enable(usart_type* usart_x, confirm_state new_state)
180{
181 usart_x->ctrl1_bit.ten = new_state;
182}
183
192void usart_receiver_enable(usart_type* usart_x, confirm_state new_state)
193{
194 usart_x->ctrl1_bit.ren = new_state;
195}
196
217void usart_clock_config(usart_type* usart_x, usart_clock_polarity_type clk_pol, usart_clock_phase_type clk_pha, usart_lbcp_type clk_lb)
218{
219 usart_x->ctrl2_bit.clkpol = clk_pol;
220 usart_x->ctrl2_bit.clkpha = clk_pha;
221 usart_x->ctrl2_bit.lbcp = clk_lb;
222}
223
233void usart_clock_enable(usart_type* usart_x, confirm_state new_state)
234{
235 usart_x->ctrl2_bit.clken = new_state;
236}
237
257void usart_interrupt_enable(usart_type* usart_x, uint32_t usart_int, confirm_state new_state)
258{
259 if(new_state == TRUE)
260 PERIPH_REG((uint32_t)usart_x, usart_int) |= PERIPH_REG_BIT(usart_int);
261 else
262 PERIPH_REG((uint32_t)usart_x, usart_int) &= ~PERIPH_REG_BIT(usart_int);
263}
264
274void usart_dma_transmitter_enable(usart_type* usart_x, confirm_state new_state)
275{
276 usart_x->ctrl3_bit.dmaten = new_state;
277}
278
288void usart_dma_receiver_enable(usart_type* usart_x, confirm_state new_state)
289{
290 usart_x->ctrl3_bit.dmaren = new_state;
291}
292
301void usart_wakeup_id_set(usart_type* usart_x, uint8_t usart_id)
302{
303 usart_x->ctrl2_bit.id = usart_id;
304}
305
317void usart_wakeup_mode_set(usart_type* usart_x, usart_wakeup_mode_type wakeup_mode)
318{
319 usart_x->ctrl1_bit.wum = wakeup_mode;
320}
321
331void usart_receiver_mute_enable(usart_type* usart_x, confirm_state new_state)
332{
333 usart_x->ctrl1_bit.rm = new_state;
334}
335
347void usart_break_bit_num_set(usart_type* usart_x, usart_break_bit_num_type break_bit)
348{
349 usart_x->ctrl2_bit.bfbn = break_bit;
350}
351
361void usart_lin_mode_enable(usart_type* usart_x, confirm_state new_state)
362{
363 usart_x->ctrl2_bit.linen = new_state;
364}
365
374void usart_data_transmit(usart_type* usart_x, uint16_t data)
375{
376 usart_x->dt = (data & 0x01FF);
377}
378
386uint16_t usart_data_receive(usart_type* usart_x)
387{
388 return (uint16_t)(usart_x->dt);
389}
390
398void usart_break_send(usart_type* usart_x)
399{
400 usart_x->ctrl1_bit.sbf = TRUE;
401}
402
412void usart_smartcard_guard_time_set(usart_type* usart_x, uint8_t guard_time_val)
413{
414 usart_x->gdiv_bit.scgt = guard_time_val;
415}
416
426void usart_irda_smartcard_division_set(usart_type* usart_x, uint8_t div_val)
427{
428 usart_x->gdiv_bit.isdiv = div_val;
429}
430
441void usart_smartcard_mode_enable(usart_type* usart_x, confirm_state new_state)
442{
443 usart_x->ctrl3_bit.scmen = new_state;
444}
445
456void usart_smartcard_nack_set(usart_type* usart_x, confirm_state new_state)
457{
458 usart_x->ctrl3_bit.scnacken = new_state;
459}
460
470void usart_single_line_halfduplex_select(usart_type* usart_x, confirm_state new_state)
471{
472 usart_x->ctrl3_bit.slben = new_state;
473}
474
484void usart_irda_mode_enable(usart_type* usart_x, confirm_state new_state)
485{
486 usart_x->ctrl3_bit.irdaen = new_state;
487}
488
498void usart_irda_low_power_enable(usart_type* usart_x, confirm_state new_state)
499{
500 usart_x->ctrl3_bit.irdalp = new_state;
501}
502
516void usart_hardware_flow_control_set(usart_type* usart_x,usart_hardware_flow_control_type flow_state)
517{
518 if(flow_state == USART_HARDWARE_FLOW_NONE)
519 {
520 usart_x->ctrl3_bit.rtsen = FALSE;
521 usart_x->ctrl3_bit.ctsen = FALSE;
522 }
523 else if(flow_state == USART_HARDWARE_FLOW_RTS)
524 {
525 usart_x->ctrl3_bit.rtsen = TRUE;
526 usart_x->ctrl3_bit.ctsen = FALSE;
527 }
528 else if(flow_state == USART_HARDWARE_FLOW_CTS)
529 {
530 usart_x->ctrl3_bit.rtsen = FALSE;
531 usart_x->ctrl3_bit.ctsen = TRUE;
532 }
533 else if(flow_state == USART_HARDWARE_FLOW_RTS_CTS)
534 {
535 usart_x->ctrl3_bit.rtsen = TRUE;
536 usart_x->ctrl3_bit.ctsen = TRUE;
537 }
538}
539
559 flag_status usart_flag_get(usart_type* usart_x, uint32_t flag)
560{
561 if(usart_x->sts & flag)
562 {
563 return SET;
564 }
565 else
566 {
567 return RESET;
568 }
569}
570
592void usart_flag_clear(usart_type* usart_x, uint32_t flag)
593{
594 usart_x->sts = ~flag;
595}
596
601#endif
602
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_UART4_PERIPH_RESET
@ CRM_UART4_PERIPH_RESET
Definition: at32f415_crm.h:173
CRM_USART1_PERIPH_RESET
@ CRM_USART1_PERIPH_RESET
Definition: at32f415_crm.h:159
CRM_USART2_PERIPH_RESET
@ CRM_USART2_PERIPH_RESET
Definition: at32f415_crm.h:171
CRM_UART5_PERIPH_RESET
@ CRM_UART5_PERIPH_RESET
Definition: at32f415_crm.h:174
CRM_USART3_PERIPH_RESET
@ CRM_USART3_PERIPH_RESET
Definition: at32f415_crm.h:172
PERIPH_REG
#define PERIPH_REG(periph_base, value)
Definition: at32f415.h:274
PERIPH_REG_BIT
#define PERIPH_REG_BIT(value)
Definition: at32f415.h:275
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
usart_break_bit_num_type
usart_break_bit_num_type
usart break frame bit num type
Definition: at32f415_usart.h:121
usart_clock_polarity_type
usart_clock_polarity_type
usart polarity of the clock type
Definition: at32f415_usart.h:139
usart_hardware_flow_control_type
usart_hardware_flow_control_type
usart hardware flow control type
Definition: at32f415_usart.h:168
usart_stop_bit_num_type
usart_stop_bit_num_type
usart stop bit num type
Definition: at32f415_usart.h:157
usart_data_bit_num_type
usart_data_bit_num_type
usart data bit num type
Definition: at32f415_usart.h:112
usart_parity_selection_type
usart_parity_selection_type
usart parity selection type
Definition: at32f415_usart.h:93
usart_lbcp_type
usart_lbcp_type
usart last bit clock pulse type
Definition: at32f415_usart.h:148
usart_wakeup_mode_type
usart_wakeup_mode_type
usart wakeup mode type
Definition: at32f415_usart.h:103
usart_clock_phase_type
usart_clock_phase_type
usart phase of the clock type
Definition: at32f415_usart.h:130
USART_HARDWARE_FLOW_CTS
@ USART_HARDWARE_FLOW_CTS
Definition: at32f415_usart.h:171
USART_HARDWARE_FLOW_RTS
@ USART_HARDWARE_FLOW_RTS
Definition: at32f415_usart.h:170
USART_HARDWARE_FLOW_NONE
@ USART_HARDWARE_FLOW_NONE
Definition: at32f415_usart.h:169
USART_HARDWARE_FLOW_RTS_CTS
@ USART_HARDWARE_FLOW_RTS_CTS
Definition: at32f415_usart.h:172
USART_PARITY_ODD
@ USART_PARITY_ODD
Definition: at32f415_usart.h:96
USART_PARITY_EVEN
@ USART_PARITY_EVEN
Definition: at32f415_usart.h:95
USART_PARITY_NONE
@ USART_PARITY_NONE
Definition: at32f415_usart.h:94
usart_clock_enable
void usart_clock_enable(usart_type *usart_x, confirm_state new_state)
usart enable the ck pin.
Definition: at32f415_usart.c:233
usart_smartcard_nack_set
void usart_smartcard_nack_set(usart_type *usart_x, confirm_state new_state)
enable or disable nack transmission in smartcard mode.
Definition: at32f415_usart.c:456
usart_clock_config
void usart_clock_config(usart_type *usart_x, usart_clock_polarity_type clk_pol, usart_clock_phase_type clk_pha, usart_lbcp_type clk_lb)
usart clock config.
Definition: at32f415_usart.c:217
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_parity_selection_config
void usart_parity_selection_config(usart_type *usart_x, usart_parity_selection_type parity)
usart parity selection config.
Definition: at32f415_usart.c:138
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_wakeup_id_set
void usart_wakeup_id_set(usart_type *usart_x, uint8_t usart_id)
set the wakeup id of the usart.
Definition: at32f415_usart.c:301
usart_reset
void usart_reset(usart_type *usart_x)
deinitialize the usart peripheral registers to their default reset values.
Definition: at32f415_usart.c:52
usart_lin_mode_enable
void usart_lin_mode_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart lin mode.
Definition: at32f415_usart.c:361
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_dma_receiver_enable
void usart_dma_receiver_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma receiver interface.
Definition: at32f415_usart.c:288
usart_irda_low_power_enable
void usart_irda_low_power_enable(usart_type *usart_x, confirm_state new_state)
configure the usart's irda low power.
Definition: at32f415_usart.c:498
usart_break_send
void usart_break_send(usart_type *usart_x)
transmit break characters.
Definition: at32f415_usart.c:398
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_irda_smartcard_division_set
void usart_irda_smartcard_division_set(usart_type *usart_x, uint8_t div_val)
config the irda/smartcard division.
Definition: at32f415_usart.c:426
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_smartcard_guard_time_set
void usart_smartcard_guard_time_set(usart_type *usart_x, uint8_t guard_time_val)
config the specified usart smartcard guard time.
Definition: at32f415_usart.c:412
usart_flag_clear
void usart_flag_clear(usart_type *usart_x, uint32_t flag)
clear the usart's pending flags.
Definition: at32f415_usart.c:592
usart_wakeup_mode_set
void usart_wakeup_mode_set(usart_type *usart_x, usart_wakeup_mode_type wakeup_mode)
select the usart wakeup method in multi-processor communication.
Definition: at32f415_usart.c:317
usart_irda_mode_enable
void usart_irda_mode_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart's irda interface.
Definition: at32f415_usart.c:484
usart_break_bit_num_set
void usart_break_bit_num_set(usart_type *usart_x, usart_break_bit_num_type break_bit)
set the usart break frame bit num.
Definition: at32f415_usart.c:347
usart_hardware_flow_control_set
void usart_hardware_flow_control_set(usart_type *usart_x, usart_hardware_flow_control_type flow_state)
configure the usart's hardware flow control.
Definition: at32f415_usart.c:516
usart_interrupt_enable
void usart_interrupt_enable(usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts.
Definition: at32f415_usart.c:257
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
usart_single_line_halfduplex_select
void usart_single_line_halfduplex_select(usart_type *usart_x, confirm_state new_state)
enable or disable the usart single line bidirectional half-duplex communication.
Definition: at32f415_usart.c:470
usart_dma_transmitter_enable
void usart_dma_transmitter_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma transmitter interface.
Definition: at32f415_usart.c:274
usart_smartcard_mode_enable
void usart_smartcard_mode_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart smart card mode.
Definition: at32f415_usart.c:441
usart_receiver_mute_enable
void usart_receiver_mute_enable(usart_type *usart_x, confirm_state new_state)
config the usart in mute mode in multi-processor communication.
Definition: at32f415_usart.c:331
USART3
#define USART3
Definition: at32f415_usart.h:321
UART4
#define UART4
Definition: at32f415_usart.h:322
UART5
#define UART5
Definition: at32f415_usart.h:323
USART1
#define USART1
Definition: at32f415_usart.h:319
USART2
#define USART2
Definition: at32f415_usart.h:320
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::apb1_freq
uint32_t apb1_freq
Definition: at32f415_crm.h:475
crm_clocks_freq_type::apb2_freq
uint32_t apb2_freq
Definition: at32f415_crm.h:474
usart_type
type define usart register all
Definition: at32f415_usart.h:179
usart_type::scmen
__IO uint32_t scmen
Definition: at32f415_usart.h:290
usart_type::scgt
__IO uint32_t scgt
Definition: at32f415_usart.h:309
usart_type::clken
__IO uint32_t clken
Definition: at32f415_usart.h:270
usart_type::linen
__IO uint32_t linen
Definition: at32f415_usart.h:272
usart_type::psel
__IO uint32_t psel
Definition: at32f415_usart.h:245
usart_type::sbf
__IO uint32_t sbf
Definition: at32f415_usart.h:236
usart_type::slben
__IO uint32_t slben
Definition: at32f415_usart.h:288
usart_type::ctrl3_bit
struct usart_type::@664::@673 ctrl3_bit
usart_type::isdiv
__IO uint32_t isdiv
Definition: at32f415_usart.h:308
usart_type::id
__IO uint32_t id
Definition: at32f415_usart.h:262
usart_type::wum
__IO uint32_t wum
Definition: at32f415_usart.h:247
usart_type::pen
__IO uint32_t pen
Definition: at32f415_usart.h:246
usart_type::scnacken
__IO uint32_t scnacken
Definition: at32f415_usart.h:289
usart_type::ctsen
__IO uint32_t ctsen
Definition: at32f415_usart.h:294
usart_type::uen
__IO uint32_t uen
Definition: at32f415_usart.h:249
usart_type::dbn
__IO uint32_t dbn
Definition: at32f415_usart.h:248
usart_type::rm
__IO uint32_t rm
Definition: at32f415_usart.h:237
usart_type::clkpha
__IO uint32_t clkpha
Definition: at32f415_usart.h:268
usart_type::ctrl1_bit
struct usart_type::@660::@671 ctrl1_bit
usart_type::clkpol
__IO uint32_t clkpol
Definition: at32f415_usart.h:269
usart_type::rtsen
__IO uint32_t rtsen
Definition: at32f415_usart.h:293
usart_type::baudr_bit
struct usart_type::@658::@670 baudr_bit
usart_type::dmaren
__IO uint32_t dmaren
Definition: at32f415_usart.h:291
usart_type::lbcp
__IO uint32_t lbcp
Definition: at32f415_usart.h:267
usart_type::dmaten
__IO uint32_t dmaten
Definition: at32f415_usart.h:292
usart_type::sts
__IO uint32_t sts
Definition: at32f415_usart.h:185
usart_type::ren
__IO uint32_t ren
Definition: at32f415_usart.h:238
usart_type::irdaen
__IO uint32_t irdaen
Definition: at32f415_usart.h:286
usart_type::ten
__IO uint32_t ten
Definition: at32f415_usart.h:239
usart_type::div
__IO uint32_t div
Definition: at32f415_usart.h:223
usart_type::stopbn
__IO uint32_t stopbn
Definition: at32f415_usart.h:271
usart_type::irdalp
__IO uint32_t irdalp
Definition: at32f415_usart.h:287
usart_type::dt
__IO uint32_t dt
Definition: at32f415_usart.h:207
usart_type::ctrl2_bit
struct usart_type::@662::@672 ctrl2_bit
usart_type::bfbn
__IO uint32_t bfbn
Definition: at32f415_usart.h:264
usart_type::gdiv_bit
struct usart_type::@666::@674 gdiv_bit
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_usart.h Source File

  • libraries
  • drivers
  • inc
at32f415_usart.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_USART_H
29#define __AT32F415_USART_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
52#define USART_PERR_FLAG ((uint32_t)0x00000001)
53#define USART_FERR_FLAG ((uint32_t)0x00000002)
54#define USART_NERR_FLAG ((uint32_t)0x00000004)
55#define USART_ROERR_FLAG ((uint32_t)0x00000008)
56#define USART_IDLEF_FLAG ((uint32_t)0x00000010)
57#define USART_RDBF_FLAG ((uint32_t)0x00000020)
58#define USART_TDC_FLAG ((uint32_t)0x00000040)
59#define USART_TDBE_FLAG ((uint32_t)0x00000080)
60#define USART_BFF_FLAG ((uint32_t)0x00000100)
61#define USART_CTSCF_FLAG ((uint32_t)0x00000200)
72#define USART_IDLE_INT MAKE_VALUE(0x0C,0x04)
73#define USART_RDBF_INT MAKE_VALUE(0x0C,0x05)
74#define USART_TDC_INT MAKE_VALUE(0x0C,0x06)
75#define USART_TDBE_INT MAKE_VALUE(0x0C,0x07)
76#define USART_PERR_INT MAKE_VALUE(0x0C,0x08)
77#define USART_BF_INT MAKE_VALUE(0x10,0x06)
78#define USART_ERR_INT MAKE_VALUE(0x14,0x00)
79#define USART_CTSCF_INT MAKE_VALUE(0x14,0x0A)
92typedef enum
93{
94 USART_PARITY_NONE = 0x00,
95 USART_PARITY_EVEN = 0x01,
96 USART_PARITY_ODD = 0x02
97} usart_parity_selection_type;
98
102typedef enum
103{
104 USART_WAKEUP_BY_IDLE_FRAME = 0x00,
105 USART_WAKEUP_BY_MATCHING_ID = 0x01
106} usart_wakeup_mode_type;
107
111typedef enum
112{
113 USART_DATA_8BITS = 0x00,
114 USART_DATA_9BITS = 0x01
115} usart_data_bit_num_type;
116
120typedef enum
121{
122 USART_BREAK_10BITS = 0x00,
123 USART_BREAK_11BITS = 0x01
124} usart_break_bit_num_type;
125
129typedef enum
130{
131 USART_CLOCK_PHASE_1EDGE = 0x00,
132 USART_CLOCK_PHASE_2EDGE = 0x01
133} usart_clock_phase_type;
134
138typedef enum
139{
140 USART_CLOCK_POLARITY_LOW = 0x00,
141 USART_CLOCK_POLARITY_HIGH = 0x01
142} usart_clock_polarity_type;
143
147typedef enum
148{
149 USART_CLOCK_LAST_BIT_NONE = 0x00,
150 USART_CLOCK_LAST_BIT_OUTPUT = 0x01
151} usart_lbcp_type;
152
156typedef enum
157{
158 USART_STOP_1_BIT = 0x00,
159 USART_STOP_0_5_BIT = 0x01,
160 USART_STOP_2_BIT = 0x02,
161 USART_STOP_1_5_BIT = 0x03
162} usart_stop_bit_num_type;
163
167typedef enum
168{
169 USART_HARDWARE_FLOW_NONE = 0x00,
170 USART_HARDWARE_FLOW_RTS = 0x01,
171 USART_HARDWARE_FLOW_CTS = 0x02,
172 USART_HARDWARE_FLOW_RTS_CTS = 0x03
173} usart_hardware_flow_control_type;
174
178typedef struct
179{
183 union
184 {
185 __IO uint32_t sts;
186 struct
187 {
188 __IO uint32_t perr : 1; /* [0] */
189 __IO uint32_t ferr : 1; /* [1] */
190 __IO uint32_t nerr : 1; /* [2] */
191 __IO uint32_t roerr : 1; /* [3] */
192 __IO uint32_t idlef : 1; /* [4] */
193 __IO uint32_t rdbf : 1; /* [5] */
194 __IO uint32_t tdc : 1; /* [6] */
195 __IO uint32_t tdbe : 1; /* [7] */
196 __IO uint32_t bff : 1; /* [8] */
197 __IO uint32_t ctscf : 1; /* [9] */
198 __IO uint32_t reserved1 : 22;/* [31:10] */
199 } sts_bit;
200 };
201
205 union
206 {
207 __IO uint32_t dt;
208 struct
209 {
210 __IO uint32_t dt : 9; /* [8:0] */
211 __IO uint32_t reserved1 : 23;/* [31:9] */
212 } dt_bit;
213 };
214
218 union
219 {
220 __IO uint32_t baudr;
221 struct
222 {
223 __IO uint32_t div : 16;/* [15:0] */
224 __IO uint32_t reserved1 : 16;/* [31:16] */
225 } baudr_bit;
226 };
227
231 union
232 {
233 __IO uint32_t ctrl1;
234 struct
235 {
236 __IO uint32_t sbf : 1; /* [0] */
237 __IO uint32_t rm : 1; /* [1] */
238 __IO uint32_t ren : 1; /* [2] */
239 __IO uint32_t ten : 1; /* [3] */
240 __IO uint32_t idleien : 1; /* [4] */
241 __IO uint32_t rdbfien : 1; /* [5] */
242 __IO uint32_t tdcien : 1; /* [6] */
243 __IO uint32_t tdbeien : 1; /* [7] */
244 __IO uint32_t perrien : 1; /* [8] */
245 __IO uint32_t psel : 1; /* [9] */
246 __IO uint32_t pen : 1; /* [10] */
247 __IO uint32_t wum : 1; /* [11] */
248 __IO uint32_t dbn : 1; /* [12] */
249 __IO uint32_t uen : 1; /* [13] */
250 __IO uint32_t reserved1 : 18;/* [31:14] */
251 } ctrl1_bit;
252 };
253
257 union
258 {
259 __IO uint32_t ctrl2;
260 struct
261 {
262 __IO uint32_t id : 4; /* [3:0] */
263 __IO uint32_t reserved1 : 1; /* [4] */
264 __IO uint32_t bfbn : 1; /* [5] */
265 __IO uint32_t bfien : 1; /* [6] */
266 __IO uint32_t reserved2 : 1; /* [7] */
267 __IO uint32_t lbcp : 1; /* [8] */
268 __IO uint32_t clkpha : 1; /* [9] */
269 __IO uint32_t clkpol : 1; /* [10] */
270 __IO uint32_t clken : 1; /* [11] */
271 __IO uint32_t stopbn : 2; /* [13:12] */
272 __IO uint32_t linen : 1; /* [14] */
273 __IO uint32_t reserved3 : 17;/* [31:15] */
274 } ctrl2_bit;
275 };
276
280 union
281 {
282 __IO uint32_t ctrl3;
283 struct
284 {
285 __IO uint32_t errien : 1; /* [0] */
286 __IO uint32_t irdaen : 1; /* [1] */
287 __IO uint32_t irdalp : 1; /* [2] */
288 __IO uint32_t slben : 1; /* [3] */
289 __IO uint32_t scnacken : 1; /* [4] */
290 __IO uint32_t scmen : 1; /* [5] */
291 __IO uint32_t dmaren : 1; /* [6] */
292 __IO uint32_t dmaten : 1; /* [7] */
293 __IO uint32_t rtsen : 1; /* [8] */
294 __IO uint32_t ctsen : 1; /* [9] */
295 __IO uint32_t ctscfien : 1; /* [10] */
296 __IO uint32_t reserved1 : 21;/* [31:11] */
297 } ctrl3_bit;
298 };
299
303 union
304 {
305 __IO uint32_t gdiv;
306 struct
307 {
308 __IO uint32_t isdiv : 8; /* [7:0] */
309 __IO uint32_t scgt : 8; /* [15:8] */
310 __IO uint32_t reserved1 : 16;/* [31:16] */
311 } gdiv_bit;
312 };
313} usart_type;
314
319#define USART1 ((usart_type *) USART1_BASE)
320#define USART2 ((usart_type *) USART2_BASE)
321#define USART3 ((usart_type *) USART3_BASE)
322#define UART4 ((usart_type *) UART4_BASE)
323#define UART5 ((usart_type *) UART5_BASE)
324
329void usart_reset(usart_type* usart_x);
330void usart_init(usart_type* usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit);
331void usart_parity_selection_config(usart_type* usart_x, usart_parity_selection_type parity);
332void usart_enable(usart_type* usart_x, confirm_state new_state);
333void usart_transmitter_enable(usart_type* usart_x, confirm_state new_state);
334void usart_receiver_enable(usart_type* usart_x, confirm_state new_state);
335void usart_clock_config(usart_type* usart_x, usart_clock_polarity_type clk_pol, usart_clock_phase_type clk_pha, usart_lbcp_type clk_lb);
336void usart_clock_enable(usart_type* usart_x, confirm_state new_state);
337void usart_interrupt_enable(usart_type* usart_x, uint32_t usart_int, confirm_state new_state);
338void usart_dma_transmitter_enable(usart_type* usart_x, confirm_state new_state);
339void usart_dma_receiver_enable(usart_type* usart_x, confirm_state new_state);
340void usart_wakeup_id_set(usart_type* usart_x, uint8_t usart_id);
341void usart_wakeup_mode_set(usart_type* usart_x, usart_wakeup_mode_type wakeup_mode);
342void usart_receiver_mute_enable(usart_type* usart_x, confirm_state new_state);
343void usart_break_bit_num_set(usart_type* usart_x, usart_break_bit_num_type break_bit);
344void usart_lin_mode_enable(usart_type* usart_x, confirm_state new_state);
345void usart_data_transmit(usart_type* usart_x, uint16_t data);
346uint16_t usart_data_receive(usart_type* usart_x);
347void usart_break_send(usart_type* usart_x);
348void usart_smartcard_guard_time_set(usart_type* usart_x, uint8_t guard_time_val);
349void usart_irda_smartcard_division_set(usart_type* usart_x, uint8_t div_val);
350void usart_smartcard_mode_enable(usart_type* usart_x, confirm_state new_state);
351void usart_smartcard_nack_set(usart_type* usart_x, confirm_state new_state);
352void usart_single_line_halfduplex_select(usart_type* usart_x, confirm_state new_state);
353void usart_irda_mode_enable(usart_type* usart_x, confirm_state new_state);
354void usart_irda_low_power_enable(usart_type* usart_x, confirm_state new_state);
355void usart_hardware_flow_control_set(usart_type* usart_x,usart_hardware_flow_control_type flow_state);
356 flag_status usart_flag_get(usart_type* usart_x, uint32_t flag);
357void usart_flag_clear(usart_type* usart_x, uint32_t flag);
358
371#ifdef __cplusplus
372}
373#endif
374
375#endif
at32f415.h
at32f415 header file
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
usart_clock_enable
void usart_clock_enable(usart_type *usart_x, confirm_state new_state)
usart enable the ck pin.
Definition: at32f415_usart.c:233
usart_smartcard_nack_set
void usart_smartcard_nack_set(usart_type *usart_x, confirm_state new_state)
enable or disable nack transmission in smartcard mode.
Definition: at32f415_usart.c:456
usart_clock_config
void usart_clock_config(usart_type *usart_x, usart_clock_polarity_type clk_pol, usart_clock_phase_type clk_pha, usart_lbcp_type clk_lb)
usart clock config.
Definition: at32f415_usart.c:217
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_parity_selection_config
void usart_parity_selection_config(usart_type *usart_x, usart_parity_selection_type parity)
usart parity selection config.
Definition: at32f415_usart.c:138
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_wakeup_id_set
void usart_wakeup_id_set(usart_type *usart_x, uint8_t usart_id)
set the wakeup id of the usart.
Definition: at32f415_usart.c:301
usart_reset
void usart_reset(usart_type *usart_x)
deinitialize the usart peripheral registers to their default reset values.
Definition: at32f415_usart.c:52
usart_lin_mode_enable
void usart_lin_mode_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart lin mode.
Definition: at32f415_usart.c:361
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_dma_receiver_enable
void usart_dma_receiver_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma receiver interface.
Definition: at32f415_usart.c:288
usart_irda_low_power_enable
void usart_irda_low_power_enable(usart_type *usart_x, confirm_state new_state)
configure the usart's irda low power.
Definition: at32f415_usart.c:498
usart_break_send
void usart_break_send(usart_type *usart_x)
transmit break characters.
Definition: at32f415_usart.c:398
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_irda_smartcard_division_set
void usart_irda_smartcard_division_set(usart_type *usart_x, uint8_t div_val)
config the irda/smartcard division.
Definition: at32f415_usart.c:426
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_smartcard_guard_time_set
void usart_smartcard_guard_time_set(usart_type *usart_x, uint8_t guard_time_val)
config the specified usart smartcard guard time.
Definition: at32f415_usart.c:412
usart_flag_clear
void usart_flag_clear(usart_type *usart_x, uint32_t flag)
clear the usart's pending flags.
Definition: at32f415_usart.c:592
usart_wakeup_mode_set
void usart_wakeup_mode_set(usart_type *usart_x, usart_wakeup_mode_type wakeup_mode)
select the usart wakeup method in multi-processor communication.
Definition: at32f415_usart.c:317
usart_irda_mode_enable
void usart_irda_mode_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart's irda interface.
Definition: at32f415_usart.c:484
usart_break_bit_num_set
void usart_break_bit_num_set(usart_type *usart_x, usart_break_bit_num_type break_bit)
set the usart break frame bit num.
Definition: at32f415_usart.c:347
usart_hardware_flow_control_set
void usart_hardware_flow_control_set(usart_type *usart_x, usart_hardware_flow_control_type flow_state)
configure the usart's hardware flow control.
Definition: at32f415_usart.c:516
usart_interrupt_enable
void usart_interrupt_enable(usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts.
Definition: at32f415_usart.c:257
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
usart_single_line_halfduplex_select
void usart_single_line_halfduplex_select(usart_type *usart_x, confirm_state new_state)
enable or disable the usart single line bidirectional half-duplex communication.
Definition: at32f415_usart.c:470
usart_dma_transmitter_enable
void usart_dma_transmitter_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma transmitter interface.
Definition: at32f415_usart.c:274
usart_smartcard_mode_enable
void usart_smartcard_mode_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart smart card mode.
Definition: at32f415_usart.c:441
usart_receiver_mute_enable
void usart_receiver_mute_enable(usart_type *usart_x, confirm_state new_state)
config the usart in mute mode in multi-processor communication.
Definition: at32f415_usart.c:331
usart_break_bit_num_type
usart_break_bit_num_type
usart break frame bit num type
Definition: at32f415_usart.h:121
usart_clock_polarity_type
usart_clock_polarity_type
usart polarity of the clock type
Definition: at32f415_usart.h:139
usart_hardware_flow_control_type
usart_hardware_flow_control_type
usart hardware flow control type
Definition: at32f415_usart.h:168
usart_stop_bit_num_type
usart_stop_bit_num_type
usart stop bit num type
Definition: at32f415_usart.h:157
usart_data_bit_num_type
usart_data_bit_num_type
usart data bit num type
Definition: at32f415_usart.h:112
usart_parity_selection_type
usart_parity_selection_type
usart parity selection type
Definition: at32f415_usart.h:93
usart_lbcp_type
usart_lbcp_type
usart last bit clock pulse type
Definition: at32f415_usart.h:148
usart_wakeup_mode_type
usart_wakeup_mode_type
usart wakeup mode type
Definition: at32f415_usart.h:103
usart_clock_phase_type
usart_clock_phase_type
usart phase of the clock type
Definition: at32f415_usart.h:130
USART_BREAK_11BITS
@ USART_BREAK_11BITS
Definition: at32f415_usart.h:123
USART_BREAK_10BITS
@ USART_BREAK_10BITS
Definition: at32f415_usart.h:122
USART_CLOCK_POLARITY_HIGH
@ USART_CLOCK_POLARITY_HIGH
Definition: at32f415_usart.h:141
USART_CLOCK_POLARITY_LOW
@ USART_CLOCK_POLARITY_LOW
Definition: at32f415_usart.h:140
USART_HARDWARE_FLOW_CTS
@ USART_HARDWARE_FLOW_CTS
Definition: at32f415_usart.h:171
USART_HARDWARE_FLOW_RTS
@ USART_HARDWARE_FLOW_RTS
Definition: at32f415_usart.h:170
USART_HARDWARE_FLOW_NONE
@ USART_HARDWARE_FLOW_NONE
Definition: at32f415_usart.h:169
USART_HARDWARE_FLOW_RTS_CTS
@ USART_HARDWARE_FLOW_RTS_CTS
Definition: at32f415_usart.h:172
USART_STOP_1_5_BIT
@ USART_STOP_1_5_BIT
Definition: at32f415_usart.h:161
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_STOP_0_5_BIT
@ USART_STOP_0_5_BIT
Definition: at32f415_usart.h:159
USART_STOP_2_BIT
@ USART_STOP_2_BIT
Definition: at32f415_usart.h:160
USART_DATA_9BITS
@ USART_DATA_9BITS
Definition: at32f415_usart.h:114
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_PARITY_ODD
@ USART_PARITY_ODD
Definition: at32f415_usart.h:96
USART_PARITY_EVEN
@ USART_PARITY_EVEN
Definition: at32f415_usart.h:95
USART_PARITY_NONE
@ USART_PARITY_NONE
Definition: at32f415_usart.h:94
USART_CLOCK_LAST_BIT_OUTPUT
@ USART_CLOCK_LAST_BIT_OUTPUT
Definition: at32f415_usart.h:150
USART_CLOCK_LAST_BIT_NONE
@ USART_CLOCK_LAST_BIT_NONE
Definition: at32f415_usart.h:149
USART_WAKEUP_BY_MATCHING_ID
@ USART_WAKEUP_BY_MATCHING_ID
Definition: at32f415_usart.h:105
USART_WAKEUP_BY_IDLE_FRAME
@ USART_WAKEUP_BY_IDLE_FRAME
Definition: at32f415_usart.h:104
USART_CLOCK_PHASE_1EDGE
@ USART_CLOCK_PHASE_1EDGE
Definition: at32f415_usart.h:131
USART_CLOCK_PHASE_2EDGE
@ USART_CLOCK_PHASE_2EDGE
Definition: at32f415_usart.h:132
usart_type
type define usart register all
Definition: at32f415_usart.h:179
usart_type::scmen
__IO uint32_t scmen
Definition: at32f415_usart.h:290
usart_type::ctrl2
__IO uint32_t ctrl2
Definition: at32f415_usart.h:259
usart_type::tdcien
__IO uint32_t tdcien
Definition: at32f415_usart.h:242
usart_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_usart.h:198
usart_type::ctrl3
__IO uint32_t ctrl3
Definition: at32f415_usart.h:282
usart_type::scgt
__IO uint32_t scgt
Definition: at32f415_usart.h:309
usart_type::clken
__IO uint32_t clken
Definition: at32f415_usart.h:270
usart_type::linen
__IO uint32_t linen
Definition: at32f415_usart.h:272
usart_type::rdbf
__IO uint32_t rdbf
Definition: at32f415_usart.h:193
usart_type::psel
__IO uint32_t psel
Definition: at32f415_usart.h:245
usart_type::rdbfien
__IO uint32_t rdbfien
Definition: at32f415_usart.h:241
usart_type::sbf
__IO uint32_t sbf
Definition: at32f415_usart.h:236
usart_type::slben
__IO uint32_t slben
Definition: at32f415_usart.h:288
usart_type::tdbeien
__IO uint32_t tdbeien
Definition: at32f415_usart.h:243
usart_type::isdiv
__IO uint32_t isdiv
Definition: at32f415_usart.h:308
usart_type::baudr
__IO uint32_t baudr
Definition: at32f415_usart.h:220
usart_type::ferr
__IO uint32_t ferr
Definition: at32f415_usart.h:189
usart_type::id
__IO uint32_t id
Definition: at32f415_usart.h:262
usart_type::wum
__IO uint32_t wum
Definition: at32f415_usart.h:247
usart_type::pen
__IO uint32_t pen
Definition: at32f415_usart.h:246
usart_type::scnacken
__IO uint32_t scnacken
Definition: at32f415_usart.h:289
usart_type::roerr
__IO uint32_t roerr
Definition: at32f415_usart.h:191
usart_type::ctscfien
__IO uint32_t ctscfien
Definition: at32f415_usart.h:295
usart_type::gdiv
__IO uint32_t gdiv
Definition: at32f415_usart.h:305
usart_type::ctrl1
__IO uint32_t ctrl1
Definition: at32f415_usart.h:233
usart_type::ctsen
__IO uint32_t ctsen
Definition: at32f415_usart.h:294
usart_type::uen
__IO uint32_t uen
Definition: at32f415_usart.h:249
usart_type::idlef
__IO uint32_t idlef
Definition: at32f415_usart.h:192
usart_type::dbn
__IO uint32_t dbn
Definition: at32f415_usart.h:248
usart_type::rm
__IO uint32_t rm
Definition: at32f415_usart.h:237
usart_type::tdbe
__IO uint32_t tdbe
Definition: at32f415_usart.h:195
usart_type::clkpha
__IO uint32_t clkpha
Definition: at32f415_usart.h:268
usart_type::clkpol
__IO uint32_t clkpol
Definition: at32f415_usart.h:269
usart_type::perr
__IO uint32_t perr
Definition: at32f415_usart.h:188
usart_type::rtsen
__IO uint32_t rtsen
Definition: at32f415_usart.h:293
usart_type::reserved3
__IO uint32_t reserved3
Definition: at32f415_usart.h:273
usart_type::dmaren
__IO uint32_t dmaren
Definition: at32f415_usart.h:291
usart_type::tdc
__IO uint32_t tdc
Definition: at32f415_usart.h:194
usart_type::lbcp
__IO uint32_t lbcp
Definition: at32f415_usart.h:267
usart_type::dmaten
__IO uint32_t dmaten
Definition: at32f415_usart.h:292
usart_type::sts
__IO uint32_t sts
Definition: at32f415_usart.h:185
usart_type::ren
__IO uint32_t ren
Definition: at32f415_usart.h:238
usart_type::errien
__IO uint32_t errien
Definition: at32f415_usart.h:285
usart_type::bff
__IO uint32_t bff
Definition: at32f415_usart.h:196
usart_type::irdaen
__IO uint32_t irdaen
Definition: at32f415_usart.h:286
usart_type::ten
__IO uint32_t ten
Definition: at32f415_usart.h:239
usart_type::div
__IO uint32_t div
Definition: at32f415_usart.h:223
usart_type::ctscf
__IO uint32_t ctscf
Definition: at32f415_usart.h:197
usart_type::nerr
__IO uint32_t nerr
Definition: at32f415_usart.h:190
usart_type::stopbn
__IO uint32_t stopbn
Definition: at32f415_usart.h:271
usart_type::irdalp
__IO uint32_t irdalp
Definition: at32f415_usart.h:287
usart_type::dt
__IO uint32_t dt
Definition: at32f415_usart.h:207
usart_type::perrien
__IO uint32_t perrien
Definition: at32f415_usart.h:244
usart_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_usart.h:266
usart_type::bfien
__IO uint32_t bfien
Definition: at32f415_usart.h:265
usart_type::bfbn
__IO uint32_t bfbn
Definition: at32f415_usart.h:264
usart_type::idleien
__IO uint32_t idleien
Definition: at32f415_usart.h:240


AT32F415 Firmwary Library: at32f415_usb.c Source File

  • libraries
  • drivers
  • src
at32f415_usb.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef USB_MODULE_ENABLED
39
44#ifdef OTGFS_USB_GLOBAL
53 error_status usb_global_reset(otg_global_type *usbx)
54{
55 uint32_t timeout = 0;
56 while(usbx->grstctl_bit.ahbidle == RESET)
57 {
58 if(timeout ++ > 200000)
59 {
60 break;
61 }
62 }
63 timeout = 0;
64 usbx->grstctl_bit.csftrst = TRUE;
65 while(usbx->grstctl_bit.csftrst == SET)
66 {
67 if(timeout ++ > 200000)
68 {
69 break;
70 }
71 }
72 return SUCCESS;
73}
74
83void usb_global_init(otg_global_type *usbx)
84{
85 /* reset otg moudle */
86 usb_global_reset(usbx);
87
88 /* exit power down mode */
89 usbx->gccfg_bit.pwrdown = TRUE;
90
91 usbx->gccfg_bit.avalidsesen = TRUE;
92 usbx->gccfg_bit.bvalidsesen = TRUE;
93}
94
103 otg_global_type *usb_global_select_core(uint8_t usb_id)
104{
105 /* use otg1 */
106 return OTG1_GLOBAL;
107}
108
119void usb_flush_tx_fifo(otg_global_type *usbx, uint32_t fifo_num)
120{
121 uint32_t timeout = 0;
122 /* set flush fifo number */
123 usbx->grstctl_bit.txfnum = fifo_num;
124
125 /* start flush fifo */
126 usbx->grstctl_bit.txfflsh = TRUE;
127
128 while(usbx->grstctl_bit.txfflsh == TRUE)
129 {
130 if(timeout ++ > 200000)
131 {
132 break;
133 }
134 }
135}
136
145void usb_flush_rx_fifo(otg_global_type *usbx)
146{
147 uint32_t timeout = 0;
148 usbx->grstctl_bit.rxfflsh = TRUE;
149 while(usbx->grstctl_bit.rxfflsh == TRUE)
150 {
151 if(timeout ++ > 200000)
152 {
153 break;
154 }
155 }
156}
157
191void usb_global_interrupt_enable(otg_global_type *usbx, uint16_t interrupt, confirm_state new_state)
192{
193 if(new_state == TRUE)
194 {
195 usbx->gintmsk |= interrupt;
196 }
197 else
198 {
199 usbx->gintmsk &= ~interrupt;
200 }
201}
202
211uint32_t usb_global_get_all_interrupt(otg_global_type *usbx)
212{
213 uint32_t intsts = usbx->gintsts;
214 return intsts & usbx->gintmsk;
215}
216
250void usb_global_clear_interrupt(otg_global_type *usbx, uint32_t flag)
251{
252 usbx->gintsts = flag;
253}
254
262void usb_interrupt_enable(otg_global_type *usbx)
263{
264 usbx->gahbcfg_bit.glbintmsk = TRUE;
265}
266
275void usb_interrupt_disable(otg_global_type *usbx)
276{
277 usbx->gahbcfg_bit.glbintmsk = FALSE;
278}
279
289void usb_set_rx_fifo(otg_global_type *usbx, uint16_t size)
290{
291 usbx->grxfsiz = size;
292}
293
304void usb_set_tx_fifo(otg_global_type *usbx, uint8_t txfifo, uint16_t size)
305{
306 uint8_t i_index = 0;
307 uint32_t offset = 0;
308
309 offset = usbx->grxfsiz;
310 if(txfifo == 0)
311 {
312 usbx->gnptxfsiz_ept0tx = offset | (size << 16);
313 }
314 else
315 {
316 offset += usbx->gnptxfsiz_ept0tx_bit.nptxfdep;
317 for(i_index = 0; i_index < (txfifo - 1); i_index ++)
318 {
319 offset += usbx->dieptxfn_bit[i_index].ineptxfdep;
320 }
321 usbx->dieptxfn[txfifo - 1] = offset | (size << 16);
322 }
323}
324
325
339void usb_global_set_mode(otg_global_type *usbx, uint32_t mode)
340{
341 /* set otg to device mode */
342 if(mode == OTG_DEVICE_MODE)
343 {
344 usbx->gusbcfg_bit.fhstmode = FALSE;
345 usbx->gusbcfg_bit.fdevmode = TRUE;
346 }
347
348 /* set otg to host mode */
349 if(mode == OTG_HOST_MODE)
350 {
351 usbx->gusbcfg_bit.fdevmode = FALSE;
352 usbx->gusbcfg_bit.fhstmode = TRUE;
353 }
354
355 /* set otg to default mode */
356 if(mode == OTG_DRD_MODE)
357 {
358 usbx->gusbcfg_bit.fdevmode = FALSE;
359 usbx->gusbcfg_bit.fhstmode = FALSE;
360 }
361}
362
363
372void usb_global_power_on(otg_global_type *usbx)
373{
374 /* core soft reset */
375 usbx->grstctl_bit.csftrst = TRUE;
376 while(usbx->grstctl_bit.csftrst);
377
378 /* disable power down mode */
379 usbx->gccfg_bit.pwrdown = TRUE;
380
381}
382
391void usb_stop_phy_clk(otg_global_type *usbx)
392{
393 OTG_PCGCCTL(usbx)->pcgcctl_bit.stoppclk = TRUE;
394}
395
404void usb_open_phy_clk(otg_global_type *usbx)
405{
406 OTG_PCGCCTL(usbx)->pcgcctl_bit.stoppclk = FALSE;
407}
408
409
417void usb_write_packet(otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
418{
419 uint32_t n_index;
420 uint32_t nhbytes = (nbytes + 3) / 4;
421 uint32_t *pbuf = (uint32_t *)pusr_buf;
422 for(n_index = 0; n_index < nhbytes; n_index ++)
423 {
424#if defined (__ICCARM__) && (__VER__ < 7000000)
425 USB_FIFO(usbx, num) = *(__packed uint32_t *)pbuf;
426#else
427 USB_FIFO(usbx, num) = __UNALIGNED_UINT32_READ(pbuf);
428#endif
429 pbuf ++;
430 }
431}
432
440void usb_read_packet(otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
441{
442 uint32_t n_index;
443 uint32_t nhbytes = (nbytes + 3) / 4;
444 uint32_t *pbuf = (uint32_t *)pusr_buf;
445 for(n_index = 0; n_index < nhbytes; n_index ++)
446 {
447#if defined (__ICCARM__) && (__VER__ < 7000000)
448 *(__packed uint32_t *)pbuf = USB_FIFO(usbx, 0);
449#else
450 __UNALIGNED_UINT32_WRITE(pbuf, (USB_FIFO(usbx, 0)));
451#endif
452 pbuf ++;
453 }
454}
455#endif
456
457
458#ifdef OTGFS_USB_DEVICE
468void usb_ept_open(otg_global_type *usbx, usb_ept_info *ept_info)
469{
470 uint8_t mps = USB_EPT0_MPS_64;
471 if(ept_info->eptn == USB_EPT0)
472 {
473 if(ept_info->maxpacket == 0x40)
474 {
475 mps = USB_EPT0_MPS_64;
476 }
477 else if(ept_info->maxpacket == 0x20)
478 {
479 mps = USB_EPT0_MPS_32;
480 }
481 else if(ept_info->maxpacket == 0x10)
482 {
483 mps = USB_EPT0_MPS_16;
484 }
485 else if(ept_info->maxpacket == 0x08)
486 {
487 mps = USB_EPT0_MPS_8;
488 }
489 }
490 /* endpoint direction is in */
491 if(ept_info->inout == EPT_DIR_IN)
492 {
493 OTG_DEVICE(usbx)->daintmsk |= 1 << ept_info->eptn;
494 if(ept_info->eptn == USB_EPT0)
495 {
496 USB_INEPT(usbx, ept_info->eptn)->diepctl_bit.mps = mps;
497 }
498 else
499 {
500 USB_INEPT(usbx, ept_info->eptn)->diepctl_bit.mps = ept_info->maxpacket;
501 }
502 USB_INEPT(usbx, ept_info->eptn)->diepctl_bit.eptype = ept_info->trans_type;
503 USB_INEPT(usbx, ept_info->eptn)->diepctl_bit.txfnum = ept_info->eptn;
504 USB_INEPT(usbx, ept_info->eptn)->diepctl_bit.setd0pid = TRUE;
505 USB_INEPT(usbx, ept_info->eptn)->diepctl_bit.usbacept = TRUE;
506 }
507 /* endpoint direction is out */
508 else
509 {
510 OTG_DEVICE(usbx)->daintmsk |= (1 << ept_info->eptn) << 16;
511 if(ept_info->eptn == USB_EPT0)
512 {
513 USB_OUTEPT(usbx, ept_info->eptn)->doepctl_bit.mps = mps;
514 }
515 else
516 {
517 USB_OUTEPT(usbx, ept_info->eptn)->doepctl_bit.mps = ept_info->maxpacket;
518 }
519 USB_OUTEPT(usbx, ept_info->eptn)->doepctl_bit.eptype = ept_info->trans_type;
520 USB_OUTEPT(usbx, ept_info->eptn)->doepctl_bit.setd0pid = TRUE;
521 USB_OUTEPT(usbx, ept_info->eptn)->doepctl_bit.usbacept = TRUE;
522 }
523}
524
534void usb_ept_close(otg_global_type *usbx, usb_ept_info *ept_info)
535{
536 if(ept_info->inout == EPT_DIR_IN)
537 {
538 OTG_DEVICE(usbx)->daintmsk &= ~(1 << ept_info->eptn);
539 USB_INEPT(usbx, ept_info->eptn)->diepctl_bit.usbacept = FALSE;
540 }
541 else
542 {
543 OTG_DEVICE(usbx)->daintmsk &= ~((1 << ept_info->eptn) << 16);
544 USB_OUTEPT(usbx, ept_info->eptn)->doepctl_bit.usbacept = FALSE;
545 }
546}
547
548
558void usb_ept_stall(otg_global_type *usbx, usb_ept_info *ept_info)
559{
560 if(ept_info->inout == EPT_DIR_IN)
561 {
562 if(USB_INEPT(usbx, ept_info->eptn)->diepctl_bit.eptena == RESET)
563 {
564 USB_INEPT(usbx, ept_info->eptn)->diepctl_bit.eptdis = FALSE;
565 }
566 USB_INEPT(usbx, ept_info->eptn)->diepctl_bit.stall = SET;
567 }
568 else
569 {
570 if(USB_OUTEPT(usbx, ept_info->eptn)->doepctl_bit.eptena == RESET)
571 {
572 USB_OUTEPT(usbx, ept_info->eptn)->doepctl_bit.eptdis = FALSE;
573 }
574 USB_OUTEPT(usbx, ept_info->eptn)->doepctl_bit.stall = TRUE;
575 }
576}
577
587void usb_ept_clear_stall(otg_global_type *usbx, usb_ept_info *ept_info)
588{
589 if(ept_info->inout == EPT_DIR_IN)
590 {
591 USB_INEPT(usbx, ept_info->eptn)->diepctl_bit.stall = FALSE;
592 if(ept_info->trans_type == EPT_INT_TYPE || ept_info->trans_type == EPT_BULK_TYPE)
593 {
594 USB_INEPT(usbx, ept_info->eptn)->diepctl_bit.setd0pid = TRUE;
595 }
596 }
597 else
598 {
599 USB_OUTEPT(usbx, ept_info->eptn)->doepctl_bit.stall = FALSE;
600 if(ept_info->trans_type == EPT_INT_TYPE || ept_info->trans_type == EPT_BULK_TYPE)
601 {
602 USB_OUTEPT(usbx, ept_info->eptn)->doepctl_bit.setd0pid = TRUE;
603 }
604 }
605}
606
615uint32_t usb_get_all_out_interrupt(otg_global_type *usbx)
616{
617 uint32_t intsts = OTG_DEVICE(usbx)->daint;
618 return ((intsts & (OTG_DEVICE(usbx)->daintmsk)) >> 16);
619}
620
629uint32_t usb_get_all_in_interrupt(otg_global_type *usbx)
630{
631 uint32_t intsts = OTG_DEVICE(usbx)->daint;
632 return ((intsts & (OTG_DEVICE(usbx)->daintmsk)) & 0xFFFF);
633}
634
635
645uint32_t usb_ept_out_interrupt(otg_global_type *usbx, uint32_t eptn)
646{
647 uint32_t intsts = USB_OUTEPT(usbx, eptn)->doepint;
648 return (intsts & (OTG_DEVICE(usbx)->doepmsk));
649}
650
660uint32_t usb_ept_in_interrupt(otg_global_type *usbx, uint32_t eptn)
661{
662 uint32_t intsts, mask1, mask2;
663 mask1 = OTG_DEVICE(usbx)->diepmsk;
664 mask2 = OTG_DEVICE(usbx)->diepempmsk;
665 mask1 |= ((mask2 >> eptn) & 0x1) << 7;
666 intsts = USB_INEPT(usbx, eptn)->diepint & mask1;
667 return intsts;
668}
669
685void usb_ept_out_clear(otg_global_type *usbx, uint32_t eptn, uint32_t flag)
686{
687 USB_OUTEPT(usbx, eptn)->doepint = flag;
688}
689
706void usb_ept_in_clear(otg_global_type *usbx, uint32_t eptn, uint32_t flag)
707{
708 USB_INEPT(usbx, eptn)->diepint = flag;
709}
710
711
721void usb_set_address(otg_global_type *usbx, uint8_t address)
722{
723 OTG_DEVICE(usbx)->dcfg_bit.devaddr = address;
724}
725
734void usb_ept0_start(otg_global_type *usbx)
735{
736 otg_eptout_type *usb_outept = USB_OUTEPT(usbx, 0);
737 usb_outept->doeptsiz = 0;
738 usb_outept->doeptsiz_bit.pktcnt = 1;
739 usb_outept->doeptsiz_bit.xfersize = 24;
740 usb_outept->doeptsiz_bit.rxdpid_setupcnt = 3;
741}
742
743
752void usb_ept0_setup(otg_global_type *usbx)
753{
754 USB_INEPT(usbx, 0)->diepctl_bit.mps = 0;
755 OTG_DEVICE(usbx)->dctl_bit.cgnpinak = FALSE;
756}
757
766void usb_connect(otg_global_type *usbx)
767{
768 /* D+ 1.5k pull-up enable */
769 OTG_DEVICE(usbx)->dctl_bit.sftdiscon = FALSE;
770}
771
780void usb_disconnect(otg_global_type *usbx)
781{
782 /* D+ 1.5k pull-up disable */
783 OTG_DEVICE(usbx)->dctl_bit.sftdiscon = TRUE;
784}
785
786
795void usb_remote_wkup_set(otg_global_type *usbx)
796{
797 OTG_DEVICE(usbx)->dctl_bit.rwkupsig = TRUE;
798}
799
808void usb_remote_wkup_clear(otg_global_type *usbx)
809{
810 OTG_DEVICE(usbx)->dctl_bit.rwkupsig = FALSE;
811}
812
821uint8_t usb_suspend_status_get(otg_global_type *usbx)
822{
823 return OTG_DEVICE(usbx)->dsts_bit.suspsts;
824}
825#endif
826
827#ifdef OTGFS_USB_HOST
837void usb_port_power_on(otg_global_type *usbx, confirm_state state)
838{
839 otg_host_type *usb_host = OTG_HOST(usbx);
840 uint32_t hprt_val = usb_host->hprt;
841
842 hprt_val &= ~(USB_OTG_HPRT_PRTENA | USB_OTG_HPRT_PRTENCHNG |
843 USB_OTG_HPRT_PRTOVRCACT | USB_OTG_HPRT_PRTCONDET);
844
845 if(state == TRUE)
846 {
847 usb_host->hprt = hprt_val | USB_OTG_HPRT_PRTPWR;
848 }
849 else
850 {
851 usb_host->hprt = hprt_val & (~USB_OTG_HPRT_PRTPWR);
852 }
853}
854
863uint32_t usbh_get_frame(otg_global_type *usbx)
864{
865 otg_host_type *usb_host = OTG_HOST(usbx);
866 return usb_host->hfnum & 0xFFFF;
867}
868
891void usb_hc_enable(otg_global_type *usbx,
892 uint8_t chn,
893 uint8_t ept_num,
894 uint8_t dev_address,
895 uint8_t type,
896 uint8_t maxpacket,
897 uint8_t speed)
898{
899 otg_hchannel_type *hch = USB_CHL(usbx, chn);
900 otg_host_type *usb_host = OTG_HOST(usbx);
901
902 switch(type)
903 {
904 case EPT_CONTROL_TYPE:
905 case EPT_BULK_TYPE:
906 hch->hcintmsk |= USB_OTG_HC_XFERCM_INT | USB_OTG_HC_STALLM_INT |
907 USB_OTG_HC_XACTERRM_INT | USB_OTG_HC_NAKM_INT |
908 USB_OTG_HC_DTGLERRM_INT;
909 if(ept_num & 0x80)
910 {
911 hch->hcintmsk_bit.bblerrmsk = TRUE;
912 }
913 break;
914 case EPT_INT_TYPE:
915 hch->hcintmsk |= USB_OTG_HC_XFERCM_INT | USB_OTG_HC_STALLM_INT |
916 USB_OTG_HC_XACTERRM_INT | USB_OTG_HC_NAKM_INT |
917 USB_OTG_HC_DTGLERRM_INT | USB_OTG_HC_FRMOVRRUN_INT;
918 break;
919 case EPT_ISO_TYPE:
920
921 hch->hcintmsk |= USB_OTG_HC_XFERCM_INT | USB_OTG_HC_ACKM_INT |
922 USB_OTG_HC_FRMOVRRUN_INT;
923 break;
924 }
925 usb_host->haintmsk |= 1 << chn;
926 usbx->gintmsk_bit.hchintmsk = TRUE;
927
928 hch->hcchar_bit.devaddr = dev_address;
929 hch->hcchar_bit.eptnum = ept_num & 0x7F;
930 hch->hcchar_bit.eptdir = (ept_num & 0x80)?1:0;
931 hch->hcchar_bit.lspddev = (speed == USB_PRTSPD_LOW_SPEED)?1:0;
932 hch->hcchar_bit.eptype = type;
933 hch->hcchar_bit.mps = maxpacket;
934
935 if(type == EPT_INT_TYPE)
936 {
937 hch->hcchar_bit.oddfrm = TRUE;
938 }
939}
940
949uint32_t usb_hch_read_interrupt(otg_global_type *usbx)
950{
951 otg_host_type *usb_host = OTG_HOST(usbx);
952 return usb_host->haint & 0xFFFF;
953}
954
963void usb_host_disable(otg_global_type *usbx)
964{
965 uint32_t i_index = 0, count = 0;
966 otg_hchannel_type *hch;
967 otg_host_type *usb_host = OTG_HOST(usbx);
968
969 usbx->gahbcfg_bit.glbintmsk = FALSE;
970 usb_flush_rx_fifo(usbx);
971 usb_flush_tx_fifo(usbx, 0x10);
972
973 for(i_index = 0; i_index < 16; i_index ++)
974 {
975 hch = USB_CHL(usbx, i_index);
976 hch->hcchar_bit.chdis = TRUE;
977 hch->hcchar_bit.chena = FALSE;
978 hch->hcchar_bit.eptdir = 0;
979 }
980
981 for(i_index = 0; i_index < 16; i_index ++)
982 {
983 hch = USB_CHL(usbx, i_index);
984 hch->hcchar_bit.chdis = TRUE;
985 hch->hcchar_bit.chena = TRUE;
986 hch->hcchar_bit.eptdir = 0;
987 do
988 {
989 if(count ++ > 1000)
990 break;
991 }while(hch->hcchar_bit.chena);
992 }
993 usb_host->haint = 0xFFFFFFFF;
994 usbx->gintsts = 0xFFFFFFFF;
995 usbx->gahbcfg_bit.glbintmsk = TRUE;
996}
997
1007void usb_hch_halt(otg_global_type *usbx, uint8_t chn)
1008{
1009 uint32_t count = 0;
1010 otg_hchannel_type *usb_chh = USB_CHL(usbx, chn);
1011 otg_host_type *usb_host = OTG_HOST(usbx);
1012
1013 /* endpoint type is control or bulk */
1014 if(usb_chh->hcchar_bit.eptype == EPT_CONTROL_TYPE ||
1015 usb_chh->hcchar_bit.eptype == EPT_BULK_TYPE)
1016 {
1017 usb_chh->hcchar_bit.chdis = TRUE;
1018 if((usbx->gnptxsts & 0xFFFF) == 0)
1019 {
1020 usb_chh->hcchar_bit.chena = FALSE;
1021 usb_chh->hcchar_bit.chena = TRUE;
1022 usb_chh->hcchar_bit.eptdir = 0;
1023 do
1024 {
1025 if(count ++ > 1000)
1026 break;
1027 }while(usb_chh->hcchar_bit.chena == SET);
1028 }
1029 else
1030 {
1031 usb_chh->hcchar_bit.chena = TRUE;
1032 }
1033 }
1034 else
1035 {
1036 usb_chh->hcchar_bit.chdis = TRUE;
1037 if((usb_host->hptxsts & 0xFFFF) == 0)
1038 {
1039 usb_chh->hcchar_bit.chena = FALSE;
1040 usb_chh->hcchar_bit.chena = TRUE;
1041 usb_chh->hcchar_bit.eptdir = 0;
1042 do
1043 {
1044 if(count ++ > 1000)
1045 break;
1046 }while(usb_chh->hcchar_bit.chena == SET);
1047 }
1048 else
1049 {
1050 usb_chh->hcchar_bit.chena = TRUE;
1051 }
1052 }
1053}
1063void usbh_fsls_clksel(otg_global_type *usbx, uint8_t clk)
1064{
1065 otg_host_type *usb_host = OTG_HOST(usbx);
1066
1067 usb_host->hcfg_bit.fslspclksel = clk;
1068 if(clk == USB_HCFG_CLK_6M)
1069 {
1070 usb_host->hfir = 6000;
1071 }
1072 else
1073 {
1074 usb_host->hfir = 48000;
1075 }
1076}
1077#endif
1078
1079
1084#endif
1085
error_status
error_status
error status
Definition: at32f415.h:258
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
USB_EPT0_MPS_16
#define USB_EPT0_MPS_16
Definition: at32f415_usb.h:306
USB_EPT0_MPS_64
#define USB_EPT0_MPS_64
endpoint0 maximum packet size
Definition: at32f415_usb.h:304
USB_EPT0_MPS_8
#define USB_EPT0_MPS_8
Definition: at32f415_usb.h:307
USB_EPT0_MPS_32
#define USB_EPT0_MPS_32
Definition: at32f415_usb.h:305
EPT_ISO_TYPE
@ EPT_ISO_TYPE
Definition: at32f415_usb.h:347
EPT_INT_TYPE
@ EPT_INT_TYPE
Definition: at32f415_usb.h:349
EPT_CONTROL_TYPE
@ EPT_CONTROL_TYPE
Definition: at32f415_usb.h:346
EPT_BULK_TYPE
@ EPT_BULK_TYPE
Definition: at32f415_usb.h:348
USB_EPT0
@ USB_EPT0
Definition: at32f415_usb.h:357
OTG_HOST_MODE
@ OTG_HOST_MODE
Definition: at32f415_usb.h:337
OTG_DRD_MODE
@ OTG_DRD_MODE
Definition: at32f415_usb.h:338
OTG_DEVICE_MODE
@ OTG_DEVICE_MODE
Definition: at32f415_usb.h:336
EPT_DIR_IN
@ EPT_DIR_IN
Definition: at32f415_usb.h:385
OTG_HOST
#define OTG_HOST(usbx)
Definition: at32f415_usb.h:1343
USB_FIFO
#define USB_FIFO(usbx, eptn)
Definition: at32f415_usb.h:1347
USB_CHL
#define USB_CHL(usbx, n)
Definition: at32f415_usb.h:1344
OTG_PCGCCTL
#define OTG_PCGCCTL(usbx)
Definition: at32f415_usb.h:1341
OTG_DEVICE
#define OTG_DEVICE(usbx)
Definition: at32f415_usb.h:1342
USB_OUTEPT
#define USB_OUTEPT(usbx, eptn)
Definition: at32f415_usb.h:1346
OTG1_GLOBAL
#define OTG1_GLOBAL
usb host and device register define
Definition: at32f415_usb.h:1339
USB_INEPT
#define USB_INEPT(usbx, eptn)
Definition: at32f415_usb.h:1345
USB_OTG_HC_STALLM_INT
#define USB_OTG_HC_STALLM_INT
Definition: at32f415_usb.h:216
USB_OTG_HC_FRMOVRRUN_INT
#define USB_OTG_HC_FRMOVRRUN_INT
Definition: at32f415_usb.h:222
USB_OTG_HPRT_PRTENA
#define USB_OTG_HPRT_PRTENA
Definition: at32f415_usb.h:172
USB_OTG_HC_DTGLERRM_INT
#define USB_OTG_HC_DTGLERRM_INT
Definition: at32f415_usb.h:223
USB_OTG_HC_ACKM_INT
#define USB_OTG_HC_ACKM_INT
Definition: at32f415_usb.h:218
USB_OTG_HPRT_PRTPWR
#define USB_OTG_HPRT_PRTPWR
Definition: at32f415_usb.h:180
USB_OTG_HC_NAKM_INT
#define USB_OTG_HC_NAKM_INT
Definition: at32f415_usb.h:217
USB_HCFG_CLK_6M
#define USB_HCFG_CLK_6M
Definition: at32f415_usb.h:165
USB_PRTSPD_LOW_SPEED
#define USB_PRTSPD_LOW_SPEED
Definition: at32f415_usb.h:188
USB_OTG_HPRT_PRTOVRCACT
#define USB_OTG_HPRT_PRTOVRCACT
Definition: at32f415_usb.h:174
USB_OTG_HC_XACTERRM_INT
#define USB_OTG_HC_XACTERRM_INT
Definition: at32f415_usb.h:220
USB_OTG_HPRT_PRTENCHNG
#define USB_OTG_HPRT_PRTENCHNG
Definition: at32f415_usb.h:173
USB_OTG_HC_XFERCM_INT
#define USB_OTG_HC_XFERCM_INT
usb host channel interrupt mask
Definition: at32f415_usb.h:214
USB_OTG_HPRT_PRTCONDET
#define USB_OTG_HPRT_PRTCONDET
Definition: at32f415_usb.h:171
usbh_get_frame
uint32_t usbh_get_frame(otg_global_type *usbx)
get current frame number
Definition: at32f415_usb.c:863
usb_ept_open
void usb_ept_open(otg_global_type *usbx, usb_ept_info *ept_info)
open usb endpoint
Definition: at32f415_usb.c:468
usb_connect
void usb_connect(otg_global_type *usbx)
connect usb device by enable pull-up
Definition: at32f415_usb.c:766
usb_ept_out_clear
void usb_ept_out_clear(otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear out endpoint interrupt flag
Definition: at32f415_usb.c:685
usb_ept0_setup
void usb_ept0_setup(otg_global_type *usbx)
endpoint 0 start setup
Definition: at32f415_usb.c:752
usb_ept_in_clear
void usb_ept_in_clear(otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear in endpoint interrupt flag
Definition: at32f415_usb.c:706
usb_remote_wkup_clear
void usb_remote_wkup_clear(otg_global_type *usbx)
usb remote wakeup clear
Definition: at32f415_usb.c:808
usb_port_power_on
void usb_port_power_on(otg_global_type *usbx, confirm_state state)
usb port power on
Definition: at32f415_usb.c:837
usb_set_rx_fifo
void usb_set_rx_fifo(otg_global_type *usbx, uint16_t size)
usb set rx fifo size
Definition: at32f415_usb.c:289
usb_write_packet
void usb_write_packet(otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
write data from user memory to usb buffer
Definition: at32f415_usb.c:417
usb_disconnect
void usb_disconnect(otg_global_type *usbx)
disconnect usb device by disable pull-up
Definition: at32f415_usb.c:780
usb_remote_wkup_set
void usb_remote_wkup_set(otg_global_type *usbx)
usb remote wakeup set
Definition: at32f415_usb.c:795
usb_global_set_mode
void usb_global_set_mode(otg_global_type *usbx, uint32_t mode)
set otg mode(device or host mode)
Definition: at32f415_usb.c:339
usb_set_tx_fifo
void usb_set_tx_fifo(otg_global_type *usbx, uint8_t txfifo, uint16_t size)
usb set tx fifo size
Definition: at32f415_usb.c:304
usb_flush_rx_fifo
void usb_flush_rx_fifo(otg_global_type *usbx)
flush rx fifo
Definition: at32f415_usb.c:145
usb_global_interrupt_enable
void usb_global_interrupt_enable(otg_global_type *usbx, uint16_t interrupt, confirm_state new_state)
usb interrupt mask enable
Definition: at32f415_usb.c:191
usb_global_clear_interrupt
void usb_global_clear_interrupt(otg_global_type *usbx, uint32_t flag)
clear the global interrupt flag
Definition: at32f415_usb.c:250
usb_suspend_status_get
uint8_t usb_suspend_status_get(otg_global_type *usbx)
usb suspend status get
Definition: at32f415_usb.c:821
usb_ept_clear_stall
void usb_ept_clear_stall(otg_global_type *usbx, usb_ept_info *ept_info)
clear endpoint tx or rx status to stall
Definition: at32f415_usb.c:587
usb_ept0_start
void usb_ept0_start(otg_global_type *usbx)
enable endpoint 0 out
Definition: at32f415_usb.c:734
usb_set_address
void usb_set_address(otg_global_type *usbx, uint8_t address)
set the host assignment address
Definition: at32f415_usb.c:721
usb_flush_tx_fifo
void usb_flush_tx_fifo(otg_global_type *usbx, uint32_t fifo_num)
flush tx fifo
Definition: at32f415_usb.c:119
usbh_fsls_clksel
void usbh_fsls_clksel(otg_global_type *usbx, uint8_t clk)
select full or low speed clock
Definition: at32f415_usb.c:1063
usb_ept_out_interrupt
uint32_t usb_ept_out_interrupt(otg_global_type *usbx, uint32_t eptn)
get out endpoint interrupt flag
Definition: at32f415_usb.c:645
usb_interrupt_disable
void usb_interrupt_disable(otg_global_type *usbx)
usb global interrupt disable
Definition: at32f415_usb.c:275
usb_hch_read_interrupt
uint32_t usb_hch_read_interrupt(otg_global_type *usbx)
host read channel interrupt
Definition: at32f415_usb.c:949
usb_ept_close
void usb_ept_close(otg_global_type *usbx, usb_ept_info *ept_info)
close usb endpoint
Definition: at32f415_usb.c:534
usb_stop_phy_clk
void usb_stop_phy_clk(otg_global_type *usbx)
usb stop phy clock
Definition: at32f415_usb.c:391
usb_global_get_all_interrupt
uint32_t usb_global_get_all_interrupt(otg_global_type *usbx)
get all global core interrupt flag
Definition: at32f415_usb.c:211
usb_interrupt_enable
void usb_interrupt_enable(otg_global_type *usbx)
usb global interrupt enable
Definition: at32f415_usb.c:262
usb_get_all_out_interrupt
uint32_t usb_get_all_out_interrupt(otg_global_type *usbx)
get all out endpoint interrupt bits
Definition: at32f415_usb.c:615
usb_ept_in_interrupt
uint32_t usb_ept_in_interrupt(otg_global_type *usbx, uint32_t eptn)
get in endpoint interrupt flag
Definition: at32f415_usb.c:660
usb_get_all_in_interrupt
uint32_t usb_get_all_in_interrupt(otg_global_type *usbx)
get all in endpoint interrupt bits
Definition: at32f415_usb.c:629
usb_global_power_on
void usb_global_power_on(otg_global_type *usbx)
disable the transceiver power down mode
Definition: at32f415_usb.c:372
usb_open_phy_clk
void usb_open_phy_clk(otg_global_type *usbx)
usb open phy clock
Definition: at32f415_usb.c:404
usb_hc_enable
void usb_hc_enable(otg_global_type *usbx, uint8_t chn, uint8_t ept_num, uint8_t dev_address, uint8_t type, uint8_t maxpacket, uint8_t speed)
enable one host channel
Definition: at32f415_usb.c:891
usb_global_reset
error_status usb_global_reset(otg_global_type *usbx)
usb global core soft reset
Definition: at32f415_usb.c:53
usb_ept_stall
void usb_ept_stall(otg_global_type *usbx, usb_ept_info *ept_info)
set endpoint tx or rx status to stall
Definition: at32f415_usb.c:558
usb_hch_halt
void usb_hch_halt(otg_global_type *usbx, uint8_t chn)
halt channel
Definition: at32f415_usb.c:1007
usb_read_packet
void usb_read_packet(otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
read data from usb buffer to user buffer
Definition: at32f415_usb.c:440
usb_global_select_core
otg_global_type * usb_global_select_core(uint8_t usb_id)
usb global select usb core (otg1 or otg2).
Definition: at32f415_usb.c:103
usb_global_init
void usb_global_init(otg_global_type *usbx)
usb global initialization
Definition: at32f415_usb.c:83
usb_host_disable
void usb_host_disable(otg_global_type *usbx)
disable host
Definition: at32f415_usb.c:963
otg_eptout_type
Definition: at32f415_usb.h:1235
otg_eptout_type::rxdpid_setupcnt
__IO uint32_t rxdpid_setupcnt
Definition: at32f415_usb.h:1293
otg_eptout_type::pktcnt
__IO uint32_t pktcnt
Definition: at32f415_usb.h:1292
otg_eptout_type::doeptsiz
__IO uint32_t doeptsiz
Definition: at32f415_usb.h:1288
otg_eptout_type::doeptsiz_bit
struct otg_eptout_type::@799::@803 doeptsiz_bit
otg_eptout_type::xfersize
__IO uint32_t xfersize
Definition: at32f415_usb.h:1291
otg_global_type
Definition: at32f415_usb.h:473
otg_global_type::hchintmsk
__IO uint32_t hchintmsk
Definition: at32f415_usb.h:629
otg_global_type::txfnum
__IO uint32_t txfnum
Definition: at32f415_usb.h:553
otg_global_type::bvalidsesen
__IO uint32_t bvalidsesen
Definition: at32f415_usb.h:726
otg_global_type::gnptxfsiz_ept0tx_bit
struct otg_global_type::@695::@717 gnptxfsiz_ept0tx_bit
otg_global_type::gusbcfg_bit
struct otg_global_type::@681::@710 gusbcfg_bit
otg_global_type::fhstmode
__IO uint32_t fhstmode
Definition: at32f415_usb.h:533
otg_global_type::dieptxfn
__IO uint32_t dieptxfn[7]
Definition: at32f415_usb.h:776
otg_global_type::csftrst
__IO uint32_t csftrst
Definition: at32f415_usb.h:547
otg_global_type::gahbcfg_bit
struct otg_global_type::@679::@709 gahbcfg_bit
otg_global_type::pwrdown
__IO uint32_t pwrdown
Definition: at32f415_usb.h:723
otg_global_type::nptxfdep
__IO uint32_t nptxfdep
Definition: at32f415_usb.h:694
otg_global_type::glbintmsk
__IO uint32_t glbintmsk
Definition: at32f415_usb.h:513
otg_global_type::txfflsh
__IO uint32_t txfflsh
Definition: at32f415_usb.h:552
otg_global_type::gnptxfsiz_ept0tx
__IO uint32_t gnptxfsiz_ept0tx
Definition: at32f415_usb.h:690
otg_global_type::dieptxfn_bit
struct otg_global_type::@705::@722 dieptxfn_bit[7]
otg_global_type::fdevmode
__IO uint32_t fdevmode
Definition: at32f415_usb.h:534
otg_global_type::grxfsiz
__IO uint32_t grxfsiz
Definition: at32f415_usb.h:677
otg_global_type::ineptxfdep
__IO uint32_t ineptxfdep
Definition: at32f415_usb.h:780
otg_global_type::avalidsesen
__IO uint32_t avalidsesen
Definition: at32f415_usb.h:725
otg_global_type::gccfg_bit
struct otg_global_type::@699::@719 gccfg_bit
otg_global_type::ahbidle
__IO uint32_t ahbidle
Definition: at32f415_usb.h:555
otg_global_type::gintsts
__IO uint32_t gintsts
Definition: at32f415_usb.h:564
otg_global_type::rxfflsh
__IO uint32_t rxfflsh
Definition: at32f415_usb.h:551
otg_global_type::grstctl_bit
struct otg_global_type::@683::@711 grstctl_bit
otg_global_type::gintmsk
__IO uint32_t gintmsk
Definition: at32f415_usb.h:604
otg_global_type::gintmsk_bit
struct otg_global_type::@687::@713 gintmsk_bit
otg_global_type::gnptxsts
__IO uint32_t gnptxsts
Definition: at32f415_usb.h:703
otg_hchannel_type
Definition: at32f415_usb.h:901
otg_hchannel_type::devaddr
__IO uint32_t devaddr
Definition: at32f415_usb.h:917
otg_hchannel_type::eptnum
__IO uint32_t eptnum
Definition: at32f415_usb.h:911
otg_hchannel_type::hcchar_bit
struct otg_hchannel_type::@744::@754 hcchar_bit
otg_hchannel_type::eptdir
__IO uint32_t eptdir
Definition: at32f415_usb.h:912
otg_hchannel_type::oddfrm
__IO uint32_t oddfrm
Definition: at32f415_usb.h:918
otg_hchannel_type::chena
__IO uint32_t chena
Definition: at32f415_usb.h:920
otg_hchannel_type::chdis
__IO uint32_t chdis
Definition: at32f415_usb.h:919
otg_hchannel_type::hcintmsk
__IO uint32_t hcintmsk
Definition: at32f415_usb.h:969
otg_hchannel_type::mps
__IO uint32_t mps
Definition: at32f415_usb.h:910
otg_hchannel_type::bblerrmsk
__IO uint32_t bblerrmsk
Definition: at32f415_usb.h:980
otg_hchannel_type::eptype
__IO uint32_t eptype
Definition: at32f415_usb.h:915
otg_hchannel_type::lspddev
__IO uint32_t lspddev
Definition: at32f415_usb.h:914
otg_hchannel_type::hcintmsk_bit
struct otg_hchannel_type::@750::@757 hcintmsk_bit
otg_host_type
Definition: at32f415_usb.h:787
otg_host_type::hprt
__IO uint32_t hprt
Definition: at32f415_usb.h:877
otg_host_type::haintmsk
__IO uint32_t haintmsk
Definition: at32f415_usb.h:862
otg_host_type::haint
__IO uint32_t haint
Definition: at32f415_usb.h:849
otg_host_type::fslspclksel
__IO uint32_t fslspclksel
Definition: at32f415_usb.h:796
otg_host_type::hfnum
__IO uint32_t hfnum
Definition: at32f415_usb.h:820
otg_host_type::hfir
__IO uint32_t hfir
Definition: at32f415_usb.h:807
otg_host_type::hcfg_bit
struct otg_host_type::@723::@737 hcfg_bit
otg_host_type::hptxsts
__IO uint32_t hptxsts
Definition: at32f415_usb.h:835
usb_ept_info
usb endpoint infomation structure definition
Definition: at32f415_usb.h:421
usb_ept_info::inout
uint8_t inout
Definition: at32f415_usb.h:424
usb_ept_info::maxpacket
uint32_t maxpacket
Definition: at32f415_usb.h:429
usb_ept_info::eptn
uint8_t eptn
Definition: at32f415_usb.h:422
usb_ept_info::trans_type
uint8_t trans_type
Definition: at32f415_usb.h:425
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_usb.h Source File

  • libraries
  • drivers
  • inc
at32f415_usb.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_USB_H
29#define __AT32F415_USB_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
52#define USB_OTG_MODEMIS_INT ((uint32_t)0x00000002)
53#define USB_OTG_OTGINT_INT ((uint32_t)0x00000004)
54#define USB_OTG_SOF_INT ((uint32_t)0x00000008)
55#define USB_OTG_RXFLVL_INT ((uint32_t)0x00000010)
56#define USB_OTG_NPTXFEMP_INT ((uint32_t)0x00000020)
57#define USB_OTG_GINNAKEFF_INT ((uint32_t)0x00000040)
58#define USB_OTG_GOUTNAKEFF_INT ((uint32_t)0x00000080)
59#define USB_OTG_ERLYSUSP_INT ((uint32_t)0x00000400)
60#define USB_OTG_USBSUSP_INT ((uint32_t)0x00000800)
61#define USB_OTG_USBRST_INT ((uint32_t)0x00001000)
62#define USB_OTG_ENUMDONE_INT ((uint32_t)0x00002000)
63#define USB_OTG_ISOOUTDROP_INT ((uint32_t)0x00004000)
64#define USB_OTG_EOPF_INT ((uint32_t)0x00008000)
65#define USB_OTG_IEPT_INT ((uint32_t)0x00040000)
66#define USB_OTG_OEPT_INT ((uint32_t)0x00080000)
67#define USB_OTG_INCOMISOIN_INT ((uint32_t)0x00100000)
68#define USB_OTG_INCOMPIP_INCOMPISOOUT_INT ((uint32_t)0x00200000)
69#define USB_OTG_PRT_INT ((uint32_t)0x01000000)
70#define USB_OTG_HCH_INT ((uint32_t)0x02000000)
71#define USB_OTG_PTXFEMP_INT ((uint32_t)0x04000000)
72#define USB_OTG_CONIDSCHG_INT ((uint32_t)0x10000000)
73#define USB_OTG_DISCON_INT ((uint32_t)0x20000000)
74#define USB_OTG_WKUP_INT ((uint32_t)0x80000000)
85#define USB_OTG_CURMODE ((uint32_t)0x00000001)
86#define USB_OTG_MODEMIS_FLAG ((uint32_t)0x00000002)
87#define USB_OTG_OTGINT_FLAG ((uint32_t)0x00000004)
88#define USB_OTG_SOF_FLAG ((uint32_t)0x00000008)
89#define USB_OTG_RXFLVL_FLAG ((uint32_t)0x00000010)
90#define USB_OTG_NPTXFEMP_FLAG ((uint32_t)0x00000020)
91#define USB_OTG_GINNAKEFF_FLAG ((uint32_t)0x00000040)
92#define USB_OTG_GOUTNAKEFF_FLAG ((uint32_t)0x00000080)
93#define USB_OTG_ERLYSUSP_FLAG ((uint32_t)0x00000400)
94#define USB_OTG_USBSUSP_FLAG ((uint32_t)0x00000800)
95#define USB_OTG_USBRST_FLAG ((uint32_t)0x00001000)
96#define USB_OTG_ENUMDONE_FLAG ((uint32_t)0x00002000)
97#define USB_OTG_ISOOUTDROP_FLAG ((uint32_t)0x00004000)
98#define USB_OTG_EOPF_FLAG ((uint32_t)0x00008000)
99#define USB_OTG_IEPT_FLAG ((uint32_t)0x00040000)
100#define USB_OTG_OEPT_FLAG ((uint32_t)0x00080000)
101#define USB_OTG_INCOMISOIN_FLAG ((uint32_t)0x00100000)
102#define USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG ((uint32_t)0x00200000)
103#define USB_OTG_PRT_FLAG ((uint32_t)0x01000000)
104#define USB_OTG_HCH_FLAG ((uint32_t)0x02000000)
105#define USB_OTG_PTXFEMP_FLAG ((uint32_t)0x04000000)
106#define USB_OTG_CONIDSCHG_FLAG ((uint32_t)0x10000000)
107#define USB_OTG_DISCON_FLAG ((uint32_t)0x20000000)
108#define USB_OTG_WKUP_FLAG ((uint32_t)0x80000000)
123#define USB_TRDTIM_8 0x9
124#define USB_TRDTIM_16 0x5
129#define USB_OTG_GRXSTSP_EPTNUM ((uint32_t)0x0000000F)
130#define USB_OTG_GRXSTSP_CHNUM ((uint32_t)0x0000000F)
131#define USB_OTG_GRXSTSP_BCNT ((uint32_t)0x00007FF0)
132#define USB_OTG_GRXSTSP_DPID ((uint32_t)0x00018000)
133#define USB_OTG_GRXSTSP_PKTSTS ((uint32_t)0x001E0000)
138#define PKTSTS_IN_DATA_PACKET_RECV 0x2
139#define PKTSTS_IN_TRANSFER_COMPLETE 0x3
140#define PKTSTS_DATA_BIT_ERROR 0x5
141#define PKTSTS_CHANNEL_STOP 0x7
146#define USB_OUT_STS_NAK 0x1
147#define USB_OUT_STS_DATA 0x2
148#define USB_OUT_STS_COMP 0x3
149#define USB_SETUP_STS_COMP 0x4
150#define USB_SETUP_STS_DATA 0x6
163#define USB_HCFG_CLK_60M 0
164#define USB_HCFG_CLK_48M 1
165#define USB_HCFG_CLK_6M 2
170#define USB_OTG_HPRT_PRTCONSTS ((uint32_t)0x00000001)
171#define USB_OTG_HPRT_PRTCONDET ((uint32_t)0x00000002)
172#define USB_OTG_HPRT_PRTENA ((uint32_t)0x00000004)
173#define USB_OTG_HPRT_PRTENCHNG ((uint32_t)0x00000008)
174#define USB_OTG_HPRT_PRTOVRCACT ((uint32_t)0x00000010)
175#define USB_OTG_HPRT_PRTOVRCCHNG ((uint32_t)0x00000020)
176#define USB_OTG_HPRT_PRTRES ((uint32_t)0x00000040)
177#define USB_OTG_HPRT_PRTSUSP ((uint32_t)0x00000080)
178#define USB_OTG_HPRT_PRTRST ((uint32_t)0x00000100)
179#define USB_OTG_HPRT_PRTLNSTS ((uint32_t)0x00000C00)
180#define USB_OTG_HPRT_PRTPWR ((uint32_t)0x00001000)
181#define USB_OTG_HPRT_PRTSPD ((uint32_t)0x00060000)
186#define USB_PRTSPD_HIGH_SPEED 0
187#define USB_PRTSPD_FULL_SPEED 1
188#define USB_PRTSPD_LOW_SPEED 2
193#define USB_OTG_HCCHAR_MPS ((uint32_t)0x000007FF)
194#define USB_OTG_HCCHAR_EPTNUM ((uint32_t)0x00007800)
195#define USB_OTG_HCCHAR_EPTDIR ((uint32_t)0x00008000)
196#define USB_OTG_HCCHAR_LSPDDEV ((uint32_t)0x00020000)
197#define USB_OTG_HCCHAR_EPTYPE ((uint32_t)0x000C0000)
198#define USB_OTG_HCCHAR_MC ((uint32_t)0x00300000)
199#define USB_OTG_HCCHAR_DEVADDR ((uint32_t)0x1FC00000)
200#define USB_OTG_HCCHAR_ODDFRM ((uint32_t)0x20000000)
201#define USB_OTG_HCCHAR_CHDIS ((uint32_t)0x40000000)
202#define USB_OTG_HCCHAR_CHENA ((uint32_t)0x80000000)
207#define USB_OTG_HCTSIZ_XFERSIZE ((uint32_t)0x0007FFFF)
208#define USB_OTG_HCTSIZ_PKTCNT ((uint32_t)0x1FF80000)
209#define USB_OTG_HCTSIZ_PID ((uint32_t)0x60000000)
214#define USB_OTG_HC_XFERCM_INT ((uint32_t)0x00000001)
215#define USB_OTG_HC_CHHLTDM_INT ((uint32_t)0x00000002)
216#define USB_OTG_HC_STALLM_INT ((uint32_t)0x00000008)
217#define USB_OTG_HC_NAKM_INT ((uint32_t)0x00000010)
218#define USB_OTG_HC_ACKM_INT ((uint32_t)0x00000020)
219#define USB_OTG_HC_NYETM_INT ((uint32_t)0x00000040)
220#define USB_OTG_HC_XACTERRM_INT ((uint32_t)0x00000080)
221#define USB_OTG_HC_BBLERRM_INT ((uint32_t)0x00000100)
222#define USB_OTG_HC_FRMOVRRUN_INT ((uint32_t)0x00000200)
223#define USB_OTG_HC_DTGLERRM_INT ((uint32_t)0x00000400)
228#define USB_OTG_HC_XFERC_FLAG ((uint32_t)0x00000001)
229#define USB_OTG_HC_CHHLTD_FLAG ((uint32_t)0x00000002)
230#define USB_OTG_HC_STALL_FLAG ((uint32_t)0x00000008)
231#define USB_OTG_HC_NAK_FLAG ((uint32_t)0x00000010)
232#define USB_OTG_HC_ACK_FLAG ((uint32_t)0x00000020)
233#define USB_OTG_HC_NYET_FLAG ((uint32_t)0x00000040)
234#define USB_OTG_HC_XACTERR_FLAG ((uint32_t)0x00000080)
235#define USB_OTG_HC_BBLERR_FLAG ((uint32_t)0x00000100)
236#define USB_OTG_HC_FRMOVRRUN_FLAG ((uint32_t)0x00000200)
237#define USB_OTG_HC_DTGLERR_FLAG ((uint32_t)0x00000400)
250typedef enum
251{
252 DCFG_PERFRINT_80 = 0x00,
253 DCFG_PERFRINT_85 = 0x01,
254 DCFG_PERFRINT_90 = 0x02,
255 DCFG_PERFRINT_95 = 0x03
256} dcfg_perfrint_type;
257
258
262#define USB_DCFG_FULL_SPEED 3
267#define USB_OTG_DCTL_RWKUPSIG ((uint32_t)0x00000001)
268#define USB_OTG_DCTL_SFTDISCON ((uint32_t)0x00000002)
269#define USB_OTG_DCTL_GNPINNAKSTS ((uint32_t)0x00000004)
270#define USB_OTG_DCTL_GOUTNAKSTS ((uint32_t)0x00000008)
271#define USB_OTG_DCTL_SGNPINNAK ((uint32_t)0x00000080)
272#define USB_OTG_DCTL_CGNPINNAK ((uint32_t)0x00000100)
273#define USB_OTG_DCTL_SGOUTNAK ((uint32_t)0x00000200)
274#define USB_OTG_DCTL_CGOUTNAK ((uint32_t)0x00000400)
275#define USB_OTG_DCTL_PWROPRGDNE ((uint32_t)0x00000800)
280#define USB_OTG_DIEPINT_XFERC_FLAG ((uint32_t)0x00000001)
281#define USB_OTG_DIEPINT_EPTDISD_FLAG ((uint32_t)0x00000002)
282#define USB_OTG_DIEPINT_TIMEOUT_FLAG ((uint32_t)0x00000008)
283#define USB_OTG_DIEPINT_INTKNTXFEMP_FLAG ((uint32_t)0x00000010)
284#define USB_OTG_DIEPINT_INEPTNAK_FLAG ((uint32_t)0x00000040)
285#define USB_OTG_DIEPINT_TXFEMP_FLAG ((uint32_t)0x00000080)
290#define USB_OTG_DOEPINT_XFERC_FLAG ((uint32_t)0x00000001)
291#define USB_OTG_DOEPINT_EPTDISD_FLAG ((uint32_t)0x00000002)
292#define USB_OTG_DOEPINT_SETUP_FLAG ((uint32_t)0x00000008)
293#define USB_OTG_DOEPINT_OUTTEPD_FLAG ((uint32_t)0x00000010)
294#define USB_OTG_DOEPINT_B2BSTUP_FLAG ((uint32_t)0x00000040)
299#define USB_OTG_DTXFSTS_INEPTFSAV ((uint32_t)0x0000FFFF)
304#define USB_EPT0_MPS_64 0
305#define USB_EPT0_MPS_32 1
306#define USB_EPT0_MPS_16 2
307#define USB_EPT0_MPS_8 3
316#define OTG_FIFO_SIZE 320
321#define USB_MAX_DATA_LENGTH 0x200
323#define OTGFS_USB_GLOBAL
324#define OTGFS_USB_DEVICE
325#define OTGFS_USB_HOST
326
334typedef enum
335{
336 OTG_DEVICE_MODE,
337 OTG_HOST_MODE,
338 OTG_DRD_MODE
339} otg_mode_type;
340
344typedef enum
345{
346 EPT_CONTROL_TYPE = 0x00,
347 EPT_ISO_TYPE = 0x01,
348 EPT_BULK_TYPE = 0x02,
349 EPT_INT_TYPE = 0x03
350} endpoint_trans_type;
351
355typedef enum
356{
357 USB_EPT0 = 0x00,
358 USB_EPT1 = 0x01,
359 USB_EPT2 = 0x02,
360 USB_EPT3 = 0x03,
361 USB_EPT4 = 0x04,
362 USB_EPT5 = 0x05,
363 USB_EPT6 = 0x06,
364 USB_EPT7 = 0x07
365} usb_endpoint_number_type;
366
370#ifndef USB_EPT_MAX_NUM
371#define USB_EPT_MAX_NUM 4
372#endif
376#ifndef USB_HOST_CHANNEL_NUM
377#define USB_HOST_CHANNEL_NUM 8
378#endif
379
383typedef enum
384{
385 EPT_DIR_IN = 0x00,
386 EPT_DIR_OUT = 0x01
387} endpoint_dir_type;
388
392typedef enum
393{
394 USB_OTG1_ID,
395 USB_OTG2_ID
396} otg_id_type;
397
401typedef enum
402{
403 USB_CLK_HICK,
404 USB_CLK_HEXT
405}usb_clk48_s;
406
420typedef struct
421{
422 uint8_t eptn;
423 uint8_t ept_address;
424 uint8_t inout;
425 uint8_t trans_type;
427 uint16_t tx_addr;
428 uint16_t rx_addr;
429 uint32_t maxpacket;
430 uint8_t is_double_buffer;
431 uint8_t stall;
432 uint32_t status;
433
434 /* transmission buffer and count */
435 uint8_t *trans_buf;
436 uint32_t total_len;
437 uint32_t trans_len;
439 uint32_t last_len;
440 uint32_t ept0_slen;
441} usb_ept_info;
442
443
447typedef struct
448{
449 uint8_t ch_num;
450 uint8_t address;
451 uint8_t dir;
452 uint8_t ept_num;
453 uint8_t ept_type;
454 uint32_t maxpacket;
455 uint8_t data_pid;
456 uint8_t speed;
457 uint8_t stall;
458 uint32_t status;
459 uint32_t state;
460 uint32_t urb_sts;
462 uint8_t toggle_in;
463 uint8_t toggle_out;
465 /* transmission buffer and count */
466 uint8_t *trans_buf; /* host channel buffer */
467 uint32_t trans_len; /* host channel transmission len */
468 uint32_t trans_count; /* host channel transmission count*/
469} usb_hch_type;
470
471
472typedef struct
473{
477 union
478 {
479 __IO uint32_t gotgctrl;
480 struct
481 {
482 __IO uint32_t reserved1 : 16; /* [15:0] */
483 __IO uint32_t cidsts : 1; /* [16] */
484 __IO uint32_t reserved2 : 4; /* [20:17] */
485 __IO uint32_t curmod : 1; /* [21] */
486 __IO uint32_t reserved3 : 10; /* [31:22] */
487 } gotgctrl_bit;
488 };
489
493 union
494 {
495 __IO uint32_t gotgint;
496 struct
497 {
498 __IO uint32_t reserved1 : 2; /* [1:0] */
499 __IO uint32_t sesenddet : 1; /* [2] */
500 __IO uint32_t reserved2 : 29; /* [31:3] */
501
502 } gotgint_bit;
503 };
504
508 union
509 {
510 __IO uint32_t gahbcfg;
511 struct
512 {
513 __IO uint32_t glbintmsk : 1; /* [0] */
514 __IO uint32_t reserved1 : 6; /* [6:1] */
515 __IO uint32_t nptxfemplvl : 1; /* [7] */
516 __IO uint32_t ptxfemplvl : 1; /* [8] */
517 __IO uint32_t reserved2 : 23; /* [31:9] */
518 } gahbcfg_bit;
519 };
520
524 union
525 {
526 __IO uint32_t gusbcfg;
527 struct
528 {
529 __IO uint32_t toutcal : 3; /* [2:0] */
530 __IO uint32_t reserved1 : 7; /* [9:3] */
531 __IO uint32_t usbtrdtim : 4; /* [13:10] */
532 __IO uint32_t reserved2 : 15; /* [28:14] */
533 __IO uint32_t fhstmode : 1; /* [29] */
534 __IO uint32_t fdevmode : 1; /* [30] */
535 __IO uint32_t cotxpkt : 1; /* [31] */
536 } gusbcfg_bit;
537 };
538
542 union
543 {
544 __IO uint32_t grstctl;
545 struct
546 {
547 __IO uint32_t csftrst : 1; /* [0] */
548 __IO uint32_t piusftrst : 1; /* [1] */
549 __IO uint32_t frmcntrst : 1; /* [2] */
550 __IO uint32_t reserved1 : 1; /* [3] */
551 __IO uint32_t rxfflsh : 1; /* [4] */
552 __IO uint32_t txfflsh : 1; /* [5] */
553 __IO uint32_t txfnum : 5; /* [10:6] */
554 __IO uint32_t reserved2 : 20; /* [30:11] */
555 __IO uint32_t ahbidle : 1; /* [31] */
556 } grstctl_bit;
557 };
558
562 union
563 {
564 __IO uint32_t gintsts;
565 struct
566 {
567 __IO uint32_t curmode : 1; /* [0] */
568 __IO uint32_t modemis : 1; /* [1] */
569 __IO uint32_t otgint : 1; /* [2] */
570 __IO uint32_t sof : 1; /* [3] */
571 __IO uint32_t rxflvl : 1; /* [4] */
572 __IO uint32_t nptxfemp : 1; /* [5] */
573 __IO uint32_t ginnakeff : 1; /* [6] */
574 __IO uint32_t goutnakeff : 1; /* [7] */
575 __IO uint32_t reserved1 : 2; /* [9:8]] */
576 __IO uint32_t erlysusp : 1; /* [10] */
577 __IO uint32_t usbsusp : 1; /* [11] */
578 __IO uint32_t usbrst : 1; /* [12] */
579 __IO uint32_t enumdone : 1; /* [13] */
580 __IO uint32_t isooutdrop : 1; /* [14] */
581 __IO uint32_t eopf : 1; /* [15] */
582 __IO uint32_t reserved2 : 2; /* [17:16]] */
583 __IO uint32_t ieptint : 1; /* [18] */
584 __IO uint32_t oeptint : 1; /* [19] */
585 __IO uint32_t incompisoin : 1; /* [20] */
586 __IO uint32_t incompip_incompisoout : 1; /* [21] */
587 __IO uint32_t reserved3 : 2; /* [23:22] */
588 __IO uint32_t prtint : 1; /* [24] */
589 __IO uint32_t hchint : 1; /* [25] */
590 __IO uint32_t ptxfemp : 1; /* [26] */
591 __IO uint32_t reserved4 : 1; /* [27] */
592 __IO uint32_t conidschg : 1; /* [28] */
593 __IO uint32_t disconint : 1; /* [29] */
594 __IO uint32_t reserved5 : 1; /* [30] */
595 __IO uint32_t wkupint : 1; /* [31] */
596 } gintsts_bit;
597 };
598
602 union
603 {
604 __IO uint32_t gintmsk;
605 struct
606 {
607 __IO uint32_t reserved1 : 1; /* [0] */
608 __IO uint32_t modemismsk : 1; /* [1] */
609 __IO uint32_t otgintmsk : 1; /* [2] */
610 __IO uint32_t sofmsk : 1; /* [3] */
611 __IO uint32_t rxflvlmsk : 1; /* [4] */
612 __IO uint32_t nptxfempmsk : 1; /* [5] */
613 __IO uint32_t ginnakeffmsk : 1; /* [6] */
614 __IO uint32_t goutnakeffmsk : 1; /* [7] */
615 __IO uint32_t reserved2 : 2; /* [9:8]] */
616 __IO uint32_t erlysuspmsk : 1; /* [10] */
617 __IO uint32_t usbsuspmsk : 1; /* [11] */
618 __IO uint32_t usbrstmsk : 1; /* [12] */
619 __IO uint32_t enumdonemsk : 1; /* [13] */
620 __IO uint32_t isooutdropmsk : 1; /* [14] */
621 __IO uint32_t eopfmsk : 1; /* [15] */
622 __IO uint32_t reserved3 : 2; /* [17:16]] */
623 __IO uint32_t ieptintmsk : 1; /* [18] */
624 __IO uint32_t oeptintmsk : 1; /* [19] */
625 __IO uint32_t incompisoinmsk : 1; /* [20] */
626 __IO uint32_t incompip_incompisooutmsk : 1; /* [21] */
627 __IO uint32_t reserved4 : 2; /* [23:22] */
628 __IO uint32_t prtintmsk : 1; /* [24] */
629 __IO uint32_t hchintmsk : 1; /* [25] */
630 __IO uint32_t ptxfempmsk : 1; /* [26] */
631 __IO uint32_t reserved5 : 1; /* [27] */
632 __IO uint32_t conidschgmsk : 1; /* [28] */
633 __IO uint32_t disconintmsk : 1; /* [29] */
634 __IO uint32_t reserved6 : 1; /* [30] */
635 __IO uint32_t wkupintmsk : 1; /* [31] */
636 } gintmsk_bit;
637 };
638
642 union
643 {
644 __IO uint32_t grxstsr;
645 struct
646 {
647 __IO uint32_t eptnum : 4; /* [3:0] */
648 __IO uint32_t bcnt : 11; /* [14:4] */
649 __IO uint32_t dpid : 2; /* [16:15] */
650 __IO uint32_t pktsts : 4; /* [20:17] */
651 __IO uint32_t fn : 4; /* [24:21] */
652 __IO uint32_t reserved1 : 7; /* [31:25] */
653 } grxstsr_bit;
654 };
655
659 union
660 {
661 __IO uint32_t grxstsp;
662 struct
663 {
664 __IO uint32_t chnum : 4; /* [3:0] */
665 __IO uint32_t bcnt : 11; /* [14:4] */
666 __IO uint32_t dpid : 2; /* [16:15] */
667 __IO uint32_t pktsts : 4; /* [20:17] */
668 __IO uint32_t reserved1 : 11; /* [31:21] */
669 } grxstsp_bit;
670 };
671
675 union
676 {
677 __IO uint32_t grxfsiz;
678 struct
679 {
680 __IO uint32_t rxfdep : 16; /* [15:0] */
681 __IO uint32_t reserved1 : 16; /* [31:16] */
682 } grxfsiz_bit;
683 };
684
688 union
689 {
690 __IO uint32_t gnptxfsiz_ept0tx;
691 struct
692 {
693 __IO uint32_t nptxfstaddr : 16; /* [15:0] */
694 __IO uint32_t nptxfdep : 16; /* [31:16] */
695 } gnptxfsiz_ept0tx_bit;
696 };
697
701 union
702 {
703 __IO uint32_t gnptxsts;
704 struct
705 {
706 __IO uint32_t nptxfspcavail : 16; /* [15:0] */
707 __IO uint32_t nptxqspcavail : 8; /* [23:16] */
708 __IO uint32_t nptxqtop : 7; /* [30:24] */
709 } gnptxsts_bit;
710 };
711
712 __IO uint32_t reserved2[2];
713
717 union
718 {
719 __IO uint32_t gccfg;
720 struct
721 {
722 __IO uint32_t reserved1 : 16; /* [15:0] */
723 __IO uint32_t pwrdown : 1; /* [16] */
724 __IO uint32_t reserved2 : 1; /* [17] */
725 __IO uint32_t avalidsesen : 1; /* [18] */
726 __IO uint32_t bvalidsesen : 1; /* [19] */
727 __IO uint32_t sofouten : 1; /* [20] */
728
739 __IO uint32_t vbusig : 1; /* [21] */
740 __IO uint32_t reserved3 : 10; /* [31:22] */
741 } gccfg_bit;
742 };
743
747 union
748 {
749 __IO uint32_t guid;
750 struct
751 {
752 __IO uint32_t userid : 32; /* [31:0] */
753 } guid_bit;
754 };
755
756 __IO uint32_t reserved3[48];
757
761 union
762 {
763 __IO uint32_t hptxfsiz;
764 struct
765 {
766 __IO uint32_t ptxfstaddr : 16; /* [15:0] */
767 __IO uint32_t ptxfsize : 16; /* [31:16] */
768 } hptxfsiz_bit;
769 };
770
774 union
775 {
776 __IO uint32_t dieptxfn[7];
777 struct
778 {
779 __IO uint32_t ineptxfstaddr : 16; /* [15:0] */
780 __IO uint32_t ineptxfdep : 16; /* [31:16] */
781 } dieptxfn_bit[7];
782 };
783} otg_global_type;
784
785
786typedef struct
787{
791 union
792 {
793 __IO uint32_t hcfg;
794 struct
795 {
796 __IO uint32_t fslspclksel : 2; /* [1:0] */
797 __IO uint32_t fslssupp : 1; /* [2] */
798 __IO uint32_t reserved1 : 29; /* [31:3] */
799 } hcfg_bit;
800 };
801
805 union
806 {
807 __IO uint32_t hfir;
808 struct
809 {
810 __IO uint32_t frint : 16; /* [15:0] */
811 __IO uint32_t reserved1 : 16; /* [31:15] */
812 } hfir_bit;
813 };
814
818 union
819 {
820 __IO uint32_t hfnum;
821 struct
822 {
823 __IO uint32_t frnum : 16; /* [15:0] */
824 __IO uint32_t ftrem : 16; /* [31:15] */
825 } hfnum_bit;
826 };
827
828 __IO uint32_t reserved1;
829
833 union
834 {
835 __IO uint32_t hptxsts;
836 struct
837 {
838 __IO uint32_t ptxfspcavil : 16; /* [15:0] */
839 __IO uint32_t ptxqspcavil : 8; /* [23:16] */
840 __IO uint32_t ptxqtop : 8; /* [31:24] */
841 } hptxsts_bit;
842 };
843
847 union
848 {
849 __IO uint32_t haint;
850 struct
851 {
852 __IO uint32_t haint : 16; /* [15:0] */
853 __IO uint32_t reserved1 : 16; /* [32:16] */
854 } haint_bit;
855 };
856
860 union
861 {
862 __IO uint32_t haintmsk;
863 struct
864 {
865 __IO uint32_t haintmsk : 16; /* [15:0] */
866 __IO uint32_t reserved1 : 16; /* [32:16] */
867 } haintmsk_bit;
868 };
869
870 __IO uint32_t reserved2[9];
871
875 union
876 {
877 __IO uint32_t hprt;
878 struct
879 {
880 __IO uint32_t prtconsts : 1; /* [0] */
881 __IO uint32_t prtcondet : 1; /* [1] */
882 __IO uint32_t prtena : 1; /* [2] */
883 __IO uint32_t prtenchng : 1; /* [3] */
884 __IO uint32_t prtovrcact : 1; /* [4] */
885 __IO uint32_t prtovrcchng : 1; /* [5] */
886 __IO uint32_t prtres : 1; /* [6] */
887 __IO uint32_t prtsusp : 1; /* [7] */
888 __IO uint32_t prtrst : 1; /* [8] */
889 __IO uint32_t reserved1 : 1; /* [9] */
890 __IO uint32_t prtlnsts : 2; /* [11:10] */
891 __IO uint32_t prtpwr : 1; /* [12] */
892 __IO uint32_t prttsctl : 4; /* [16:13] */
893 __IO uint32_t prtspd : 2; /* [18:17] */
894 __IO uint32_t reserved2 : 13; /* [31:19] */
895
896 } hprt_bit;
897 };
898} otg_host_type;
899
900typedef struct
901{
905 union
906 {
907 __IO uint32_t hcchar;
908 struct
909 {
910 __IO uint32_t mps : 11; /* [10:0] */
911 __IO uint32_t eptnum : 4; /* [14:11] */
912 __IO uint32_t eptdir : 1; /* [15] */
913 __IO uint32_t reserved1 : 1; /* [16] */
914 __IO uint32_t lspddev : 1; /* [17] */
915 __IO uint32_t eptype : 2; /* [19:18] */
916 __IO uint32_t mc : 2; /* [21:20] */
917 __IO uint32_t devaddr : 7; /* [28:22] */
918 __IO uint32_t oddfrm : 1; /* [29] */
919 __IO uint32_t chdis : 1; /* [30] */
920 __IO uint32_t chena : 1; /* [31] */
921 } hcchar_bit;
922 };
923
927 union
928 {
929 __IO uint32_t hcsplt;
930 struct
931 {
932 __IO uint32_t prtaddr : 7; /* [6:0] */
933 __IO uint32_t hubaddr : 7; /* [13:7] */
934 __IO uint32_t xactpos : 2; /* [15:14] */
935 __IO uint32_t compsplt : 1; /* [16] */
936 __IO uint32_t reserved1 : 14; /* [30:17] */
937 __IO uint32_t spltena : 1; /* [31] */
938 } hcsplt_bit;
939 };
940
944 union
945 {
946 __IO uint32_t hcint;
947 struct
948 {
949 __IO uint32_t xferc : 1; /* [0] */
950 __IO uint32_t chhltd : 1; /* [1] */
951 __IO uint32_t reserved1 : 1; /* [2] */
952 __IO uint32_t stall : 1; /* [3] */
953 __IO uint32_t nak : 1; /* [4] */
954 __IO uint32_t ack : 1; /* [5] */
955 __IO uint32_t reserved2 : 1; /* [6] */
956 __IO uint32_t xacterr : 1; /* [7] */
957 __IO uint32_t bblerr : 1; /* [8] */
958 __IO uint32_t frmovrun : 1; /* [9] */
959 __IO uint32_t dtglerr : 1; /* [10] */
960 __IO uint32_t reserved3 : 21; /* [31:11] */
961 } hcint_bit;
962 };
963
967 union
968 {
969 __IO uint32_t hcintmsk;
970 struct
971 {
972 __IO uint32_t xfercmsk : 1; /* [0] */
973 __IO uint32_t chhltdmsk : 1; /* [1] */
974 __IO uint32_t reserved1 : 1; /* [2] */
975 __IO uint32_t stallmsk : 1; /* [3] */
976 __IO uint32_t nakmsk : 1; /* [4] */
977 __IO uint32_t ackmsk : 1; /* [5] */
978 __IO uint32_t reserved2 : 1; /* [6] */
979 __IO uint32_t xacterrmsk : 1; /* [7] */
980 __IO uint32_t bblerrmsk : 1; /* [8] */
981 __IO uint32_t frmovrunmsk : 1; /* [9] */
982 __IO uint32_t dtglerrmsk : 1; /* [10] */
983 __IO uint32_t reserved3 : 21; /* [31:11] */
984 } hcintmsk_bit;
985 };
986
990 union
991 {
992 __IO uint32_t hctsiz;
993 struct
994 {
995 __IO uint32_t xfersize : 19; /* [18:0] */
996 __IO uint32_t pktcnt : 10; /* [28:19] */
997 __IO uint32_t pid : 2; /* [30:29] */
998 __IO uint32_t reserved1 : 1; /* [31] */
999 } hctsiz_bit;
1000 };
1001 __IO uint32_t reserved3[3];
1002
1003}otg_hchannel_type;
1004
1005
1006typedef struct
1007{
1011 union
1012 {
1013 __IO uint32_t dcfg;
1014 struct
1015 {
1016 __IO uint32_t devspd : 2; /* [1:0] */
1017 __IO uint32_t nzstsouthshk : 1; /* [2] */
1018 __IO uint32_t reserved1 : 1; /* [3] */
1019 __IO uint32_t devaddr : 7; /* [10:4] */
1020 __IO uint32_t perfrint : 2; /* [12:11] */
1021 __IO uint32_t reserved2 : 19; /* [31:13] */
1022 } dcfg_bit;
1023 };
1024
1028 union
1029 {
1030 __IO uint32_t dctl;
1031 struct
1032 {
1033 __IO uint32_t rwkupsig : 1; /* [0] */
1034 __IO uint32_t sftdiscon : 1; /* [1] */
1035 __IO uint32_t gnpinnaksts : 1; /* [2] */
1036 __IO uint32_t goutnaksts : 1; /* [3] */
1037 __IO uint32_t tstctl : 3; /* [6:4] */
1038 __IO uint32_t sgnpinak : 1; /* [7] */
1039 __IO uint32_t cgnpinak : 1; /* [8] */
1040 __IO uint32_t sgoutnak : 1; /* [9] */
1041 __IO uint32_t cgoutnak : 1; /* [10] */
1042 __IO uint32_t pwroprgdne : 1; /* [11] */
1043 __IO uint32_t reserved1 : 20; /* [31:12] */
1044 } dctl_bit;
1045 };
1046
1050 union
1051 {
1052 __IO uint32_t dsts;
1053 struct
1054 {
1055 __IO uint32_t suspsts : 1; /* [0] */
1056 __IO uint32_t enumspd : 2; /* [2:1] */
1057 __IO uint32_t eticerr : 1; /* [3] */
1058 __IO uint32_t reserved1 : 4; /* [7:4] */
1059 __IO uint32_t soffn : 14; /* [21:8] */
1060 __IO uint32_t reserved2 : 10; /* [31:22] */
1061 } dsts_bit;
1062 };
1063
1064 __IO uint32_t reserved1;
1068 union
1069 {
1070 __IO uint32_t diepmsk;
1071 struct
1072 {
1073 __IO uint32_t xfercmsk : 1; /* [0] */
1074 __IO uint32_t eptdismsk : 1; /* [1] */
1075 __IO uint32_t reserved1 : 1; /* [2] */
1076 __IO uint32_t timeoutmsk : 1; /* [3] */
1077 __IO uint32_t intkntxfempmsk : 1; /* [4] */
1078 __IO uint32_t intkneptmismsk : 1; /* [5] */
1079 __IO uint32_t ineptnakmsk : 1; /* [6] */
1080 __IO uint32_t reserved2 : 1; /* [7] */
1081 __IO uint32_t txfifoudrmsk : 1; /* [8] */
1082 __IO uint32_t bnainmsk : 1; /* [9] */
1083 __IO uint32_t reserved3 : 22; /* [31:10] */
1084 } diepmsk_bit;
1085 };
1086
1090 union
1091 {
1092 __IO uint32_t doepmsk;
1093 struct
1094 {
1095 __IO uint32_t xfercmsk : 1; /* [0] */
1096 __IO uint32_t eptdismsk : 1; /* [1] */
1097 __IO uint32_t reserved1 : 1; /* [2] */
1098 __IO uint32_t setupmsk : 1; /* [3] */
1099 __IO uint32_t outtepdmsk : 1; /* [4] */
1100 __IO uint32_t reserved2 : 1; /* [5] */
1101 __IO uint32_t b2bsetupmsk : 1; /* [6] */
1102 __IO uint32_t reserved3 : 1; /* [7] */
1103 __IO uint32_t outperrmsk : 1; /* [8] */
1104 __IO uint32_t bnaoutmsk : 1; /* [9] */
1105 __IO uint32_t reserved4 : 22; /* [31:10] */
1106 } doepmsk_bit;
1107 };
1108
1112 union
1113 {
1114 __IO uint32_t daint;
1115 struct
1116 {
1117 __IO uint32_t ineptint : 16; /* [15:0] */
1118 __IO uint32_t outeptint : 16; /* [31:16] */
1119 } daint_bit;
1120 };
1121
1125 union
1126 {
1127 __IO uint32_t daintmsk;
1128 struct
1129 {
1130 __IO uint32_t ineptmsk : 16; /* [15:0] */
1131 __IO uint32_t outeptmsk : 16; /* [31:16] */
1132 } daintmsk_bit;
1133 };
1134
1135 __IO uint32_t reserved2[5];
1136
1140 union
1141 {
1142 __IO uint32_t diepempmsk;
1143 struct
1144 {
1145 __IO uint32_t ineptxfemsk : 16; /* [15:0] */
1146 __IO uint32_t reserved1 : 16; /* [31:16] */
1147 } diepempmsk_bit;
1148 };
1149
1150} otg_device_type;
1151
1152typedef struct
1153{
1157 union
1158 {
1159 __IO uint32_t diepctl;
1160 struct
1161 {
1162 __IO uint32_t mps : 11; /* [10:0] */
1163 __IO uint32_t reserved1 : 4; /* [14:11] */
1164 __IO uint32_t usbacept : 1; /* [15] */
1165 __IO uint32_t dpid : 1; /* [16] */
1166 __IO uint32_t naksts : 1; /* [17] */
1167 __IO uint32_t eptype : 2; /* [19:18] */
1168 __IO uint32_t reserved2 : 1; /* [20] */
1169 __IO uint32_t stall : 1; /* [21] */
1170 __IO uint32_t txfnum : 4; /* [25:22] */
1171 __IO uint32_t cnak : 1; /* [26] */
1172 __IO uint32_t snak : 1; /* [27] */
1173 __IO uint32_t setd0pid : 1; /* [28] */
1174 __IO uint32_t setd1pid : 1; /* [29] */
1175 __IO uint32_t eptdis : 1; /* [30] */
1176 __IO uint32_t eptena : 1; /* [31] */
1177 } diepctl_bit;
1178 };
1179 __IO uint32_t reserved1;
1180
1184 union
1185 {
1186 __IO uint32_t diepint;
1187 struct
1188 {
1189 __IO uint32_t xferc : 1; /* [0] */
1190 __IO uint32_t epdisd : 1; /* [1] */
1191 __IO uint32_t reserved1 : 1; /* [2] */
1192 __IO uint32_t timeout : 1; /* [3] */
1193 __IO uint32_t intkntxfemp : 1; /* [4] */
1194 __IO uint32_t reserved2 : 1; /* [5] */
1195 __IO uint32_t ineptnak : 1; /* [6] */
1196 __IO uint32_t txfemp : 1; /* [7] */
1197 __IO uint32_t reserved3 : 24; /* [31:8] */
1198 } diepint_bit;
1199 };
1200 __IO uint32_t reserved2;
1201
1205 union
1206 {
1207 __IO uint32_t dieptsiz;
1208 struct
1209 {
1210 __IO uint32_t xfersize : 19; /* [18:0] */
1211 __IO uint32_t pktcnt : 10; /* [28:19] */
1212 __IO uint32_t mc : 2; /* [30:29] */
1213 __IO uint32_t reserved1 : 1; /* [31] */
1214 } dieptsiz_bit;
1215 };
1216
1217 __IO uint32_t reserved3;
1218
1222 union
1223 {
1224 __IO uint32_t dtxfsts;
1225 struct
1226 {
1227 __IO uint32_t ineptxfsav : 16; /* [15:0] */
1228 __IO uint32_t reserved1 : 16; /* [31:16] */
1229 } dtxfsts_bit;
1230 };
1231
1232} otg_eptin_type;
1233
1234typedef struct
1235{
1239 union
1240 {
1241 __IO uint32_t doepctl;
1242 struct
1243 {
1244 __IO uint32_t mps : 11; /* [10:0] */
1245 __IO uint32_t reserved1 : 4; /* [14:11] */
1246 __IO uint32_t usbacept : 1; /* [15] */
1247 __IO uint32_t dpid : 1; /* [16] */
1248 __IO uint32_t naksts : 1; /* [17] */
1249 __IO uint32_t eptype : 2; /* [19:18] */
1250 __IO uint32_t snpm : 1; /* [20] */
1251 __IO uint32_t stall : 1; /* [21] */
1252 __IO uint32_t reserved2 : 4; /* [25:22] */
1253 __IO uint32_t cnak : 1; /* [26] */
1254 __IO uint32_t snak : 1; /* [27] */
1255 __IO uint32_t setd0pid : 1; /* [28] */
1256 __IO uint32_t setd1pid : 1; /* [29] */
1257 __IO uint32_t eptdis : 1; /* [30] */
1258 __IO uint32_t eptena : 1; /* [31] */
1259 } doepctl_bit;
1260 };
1261 __IO uint32_t reserved1;
1262
1266 union
1267 {
1268 __IO uint32_t doepint;
1269 struct
1270 {
1271 __IO uint32_t xferc : 1; /* [0] */
1272 __IO uint32_t epdisd : 1; /* [1] */
1273 __IO uint32_t reserved1 : 1; /* [2] */
1274 __IO uint32_t setup : 1; /* [3] */
1275 __IO uint32_t outtepd : 1; /* [4] */
1276 __IO uint32_t reserved2 : 1; /* [5] */
1277 __IO uint32_t b2pstup : 1; /* [6] */
1278 __IO uint32_t reserved3 : 25; /* [31:7] */
1279 } doepint_bit;
1280 };
1281 __IO uint32_t reserved2;
1282
1286 union
1287 {
1288 __IO uint32_t doeptsiz;
1289 struct
1290 {
1291 __IO uint32_t xfersize : 19; /* [18:0] */
1292 __IO uint32_t pktcnt : 10; /* [28:19] */
1293 __IO uint32_t rxdpid_setupcnt : 2; /* [30:29] */
1294 __IO uint32_t reserved1 : 1; /* [31] */
1295 } doeptsiz_bit;
1296 };
1297} otg_eptout_type;
1298
1299typedef struct
1300{
1304 union
1305 {
1306 __IO uint32_t pcgcctl;
1307 struct
1308 {
1309 __IO uint32_t stoppclk : 1; /* [0] */
1310 __IO uint32_t reserved1 : 3; /* [3:1] */
1311 __IO uint32_t suspendm : 1; /* [4] */
1312 __IO uint32_t reserved2 : 27; /* [31:5] */
1313 } pcgcctl_bit;
1314 };
1315} otg_pcgcctl_type;
1316
1328#define OTG_HOST_ADDR_OFFSET 0x400
1329#define OTG_HOST_CHANNEL_ADDR_OFFSET 0x500
1330#define OTG_DEVICE_ADDR_OFFSET 0x800
1331#define OTG_DEVICE_EPTIN_ADDR_OFFSET 0x900
1332#define OTG_DEVICE_EPTOUT_ADDR_OFFSET 0xB00
1333#define OTG_PCGCCTL_ADDR_OFFSET 0xE00
1334#define OTG_FIFO_ADDR_OFFSET 0x1000
1339#define OTG1_GLOBAL ((otg_global_type *)(OTGFS1_BASE))
1340//#define OTG2_GLOBAL ((otg_global_type *)(OTGFS2_BASE)) /*!< usb otg2 global register */
1341#define OTG_PCGCCTL(usbx) ((otg_pcgcctl_type *)((uint32_t)usbx + OTG_PCGCCTL_ADDR_OFFSET))
1342#define OTG_DEVICE(usbx) ((otg_device_type *)((uint32_t)usbx + OTG_DEVICE_ADDR_OFFSET))
1343#define OTG_HOST(usbx) ((otg_host_type *)((uint32_t)usbx + OTG_HOST_ADDR_OFFSET))
1344#define USB_CHL(usbx, n) ((otg_hchannel_type *)((uint32_t)usbx + OTG_HOST_CHANNEL_ADDR_OFFSET + n * 0x20))
1345#define USB_INEPT(usbx, eptn) ((otg_eptin_type *)((uint32_t)usbx + OTG_DEVICE_EPTIN_ADDR_OFFSET + eptn * 0x20))
1346#define USB_OUTEPT(usbx, eptn) ((otg_eptout_type *)((uint32_t)usbx + OTG_DEVICE_EPTOUT_ADDR_OFFSET + eptn * 0x20))
1347#define USB_FIFO(usbx, eptn) *(__IO uint32_t *)((uint32_t)usbx + OTG_FIFO_ADDR_OFFSET + eptn * 0x1000)
1351typedef otg_global_type usb_reg_type;
1352
1357#ifdef OTGFS_USB_GLOBAL
1358 error_status usb_global_reset(otg_global_type *usbx);
1359void usb_global_init(otg_global_type *usbx);
1360 otg_global_type *usb_global_select_core(uint8_t usb_id);
1361void usb_flush_tx_fifo(otg_global_type *usbx, uint32_t fifo_num);
1362void usb_flush_rx_fifo(otg_global_type *usbx);
1363void usb_global_interrupt_enable(otg_global_type *usbx, uint16_t interrupt, confirm_state new_state);
1364uint32_t usb_global_get_all_interrupt(otg_global_type *usbx);
1365void usb_global_clear_interrupt(otg_global_type *usbx, uint32_t flag);
1366void usb_interrupt_enable(otg_global_type *usbx);
1367void usb_interrupt_disable(otg_global_type *usbx);
1368void usb_set_rx_fifo(otg_global_type *usbx, uint16_t size);
1369void usb_set_tx_fifo(otg_global_type *usbx, uint8_t txfifo, uint16_t size);
1370void usb_global_set_mode(otg_global_type *usbx, uint32_t mode);
1371void usb_global_power_on(otg_global_type *usbx);
1372void usb_write_packet(otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes);
1373void usb_read_packet(otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes);
1374void usb_stop_phy_clk(otg_global_type *usbx);
1375void usb_open_phy_clk(otg_global_type *usbx);
1376#endif
1377
1378#ifdef OTGFS_USB_DEVICE
1379void usb_ept_open(otg_global_type *usbx, usb_ept_info *ept_info);
1380void usb_ept_close(otg_global_type *usbx, usb_ept_info *ept_info);
1381void usb_ept_stall(otg_global_type *usbx, usb_ept_info *ept_info);
1382void usb_ept_clear_stall(otg_global_type *usbx, usb_ept_info *ept_info);
1383uint32_t usb_get_all_out_interrupt(otg_global_type *usbx);
1384uint32_t usb_get_all_in_interrupt(otg_global_type *usbx);
1385uint32_t usb_ept_out_interrupt(otg_global_type *usbx, uint32_t eptn);
1386uint32_t usb_ept_in_interrupt(otg_global_type *usbx, uint32_t eptn);
1387void usb_ept_out_clear(otg_global_type *usbx, uint32_t eptn, uint32_t flag);
1388void usb_ept_in_clear(otg_global_type *usbx, uint32_t eptn, uint32_t flag);
1389void usb_set_address(otg_global_type *usbx, uint8_t address);
1390void usb_ept0_start(otg_global_type *usbx);
1391void usb_ept0_setup(otg_global_type *usbx);
1392void usb_connect(otg_global_type *usbx);
1393void usb_disconnect(otg_global_type *usbx);
1394void usb_remote_wkup_set(otg_global_type *usbx);
1395void usb_remote_wkup_clear(otg_global_type *usbx);
1396uint8_t usb_suspend_status_get(otg_global_type *usbx);
1397#endif
1398
1399#ifdef OTGFS_USB_HOST
1400void usb_port_power_on(otg_global_type *usbx, confirm_state state);
1401uint32_t usbh_get_frame(otg_global_type *usbx);
1402void usb_hc_enable(otg_global_type *usbx,
1403 uint8_t chn,
1404 uint8_t ept_num,
1405 uint8_t dev_address,
1406 uint8_t type,
1407 uint8_t maxpacket,
1408 uint8_t speed);
1409uint32_t usb_hch_read_interrupt(otg_global_type *usbx);
1410void usb_host_disable(otg_global_type *usbx);
1411void usb_hch_halt(otg_global_type *usbx, uint8_t chn);
1412void usbh_fsls_clksel(otg_global_type *usbx, uint8_t clk);
1413#endif
1430#ifdef __cplusplus
1431}
1432#endif
1433
1434#endif
at32f415.h
at32f415 header file
error_status
error_status
error status
Definition: at32f415.h:258
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
dcfg_perfrint_type
dcfg_perfrint_type
usb device periodic frame interval
Definition: at32f415_usb.h:251
DCFG_PERFRINT_85
@ DCFG_PERFRINT_85
Definition: at32f415_usb.h:253
DCFG_PERFRINT_90
@ DCFG_PERFRINT_90
Definition: at32f415_usb.h:254
DCFG_PERFRINT_80
@ DCFG_PERFRINT_80
Definition: at32f415_usb.h:252
DCFG_PERFRINT_95
@ DCFG_PERFRINT_95
Definition: at32f415_usb.h:255
endpoint_trans_type
endpoint_trans_type
endpoint type define
Definition: at32f415_usb.h:345
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
usb_endpoint_number_type
usb_endpoint_number_type
usb endpoint number define type
Definition: at32f415_usb.h:356
otg_mode_type
otg_mode_type
usb mode define(device, host, drd)
Definition: at32f415_usb.h:335
endpoint_dir_type
endpoint_dir_type
usb endpoint max num define
Definition: at32f415_usb.h:384
otg_id_type
otg_id_type
otgfs1 and otgfs2 select type
Definition: at32f415_usb.h:393
EPT_ISO_TYPE
@ EPT_ISO_TYPE
Definition: at32f415_usb.h:347
EPT_INT_TYPE
@ EPT_INT_TYPE
Definition: at32f415_usb.h:349
EPT_CONTROL_TYPE
@ EPT_CONTROL_TYPE
Definition: at32f415_usb.h:346
EPT_BULK_TYPE
@ EPT_BULK_TYPE
Definition: at32f415_usb.h:348
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
USB_CLK_HICK
@ USB_CLK_HICK
Definition: at32f415_usb.h:403
USB_EPT4
@ USB_EPT4
Definition: at32f415_usb.h:361
USB_EPT6
@ USB_EPT6
Definition: at32f415_usb.h:363
USB_EPT5
@ USB_EPT5
Definition: at32f415_usb.h:362
USB_EPT7
@ USB_EPT7
Definition: at32f415_usb.h:364
USB_EPT0
@ USB_EPT0
Definition: at32f415_usb.h:357
USB_EPT2
@ USB_EPT2
Definition: at32f415_usb.h:359
USB_EPT1
@ USB_EPT1
Definition: at32f415_usb.h:358
USB_EPT3
@ USB_EPT3
Definition: at32f415_usb.h:360
OTG_HOST_MODE
@ OTG_HOST_MODE
Definition: at32f415_usb.h:337
OTG_DRD_MODE
@ OTG_DRD_MODE
Definition: at32f415_usb.h:338
OTG_DEVICE_MODE
@ OTG_DEVICE_MODE
Definition: at32f415_usb.h:336
EPT_DIR_IN
@ EPT_DIR_IN
Definition: at32f415_usb.h:385
EPT_DIR_OUT
@ EPT_DIR_OUT
Definition: at32f415_usb.h:386
USB_OTG2_ID
@ USB_OTG2_ID
Definition: at32f415_usb.h:395
USB_OTG1_ID
@ USB_OTG1_ID
Definition: at32f415_usb.h:394
usbh_get_frame
uint32_t usbh_get_frame(otg_global_type *usbx)
get current frame number
Definition: at32f415_usb.c:863
usb_ept_open
void usb_ept_open(otg_global_type *usbx, usb_ept_info *ept_info)
open usb endpoint
Definition: at32f415_usb.c:468
usb_connect
void usb_connect(otg_global_type *usbx)
connect usb device by enable pull-up
Definition: at32f415_usb.c:766
usb_ept_out_clear
void usb_ept_out_clear(otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear out endpoint interrupt flag
Definition: at32f415_usb.c:685
usb_ept0_setup
void usb_ept0_setup(otg_global_type *usbx)
endpoint 0 start setup
Definition: at32f415_usb.c:752
usb_ept_in_clear
void usb_ept_in_clear(otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear in endpoint interrupt flag
Definition: at32f415_usb.c:706
usb_remote_wkup_clear
void usb_remote_wkup_clear(otg_global_type *usbx)
usb remote wakeup clear
Definition: at32f415_usb.c:808
usb_port_power_on
void usb_port_power_on(otg_global_type *usbx, confirm_state state)
usb port power on
Definition: at32f415_usb.c:837
usb_set_rx_fifo
void usb_set_rx_fifo(otg_global_type *usbx, uint16_t size)
usb set rx fifo size
Definition: at32f415_usb.c:289
usb_write_packet
void usb_write_packet(otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
write data from user memory to usb buffer
Definition: at32f415_usb.c:417
usb_disconnect
void usb_disconnect(otg_global_type *usbx)
disconnect usb device by disable pull-up
Definition: at32f415_usb.c:780
usb_remote_wkup_set
void usb_remote_wkup_set(otg_global_type *usbx)
usb remote wakeup set
Definition: at32f415_usb.c:795
usb_global_set_mode
void usb_global_set_mode(otg_global_type *usbx, uint32_t mode)
set otg mode(device or host mode)
Definition: at32f415_usb.c:339
usb_set_tx_fifo
void usb_set_tx_fifo(otg_global_type *usbx, uint8_t txfifo, uint16_t size)
usb set tx fifo size
Definition: at32f415_usb.c:304
usb_flush_rx_fifo
void usb_flush_rx_fifo(otg_global_type *usbx)
flush rx fifo
Definition: at32f415_usb.c:145
usb_global_interrupt_enable
void usb_global_interrupt_enable(otg_global_type *usbx, uint16_t interrupt, confirm_state new_state)
usb interrupt mask enable
Definition: at32f415_usb.c:191
usb_global_clear_interrupt
void usb_global_clear_interrupt(otg_global_type *usbx, uint32_t flag)
clear the global interrupt flag
Definition: at32f415_usb.c:250
usb_suspend_status_get
uint8_t usb_suspend_status_get(otg_global_type *usbx)
usb suspend status get
Definition: at32f415_usb.c:821
usb_ept_clear_stall
void usb_ept_clear_stall(otg_global_type *usbx, usb_ept_info *ept_info)
clear endpoint tx or rx status to stall
Definition: at32f415_usb.c:587
usb_ept0_start
void usb_ept0_start(otg_global_type *usbx)
enable endpoint 0 out
Definition: at32f415_usb.c:734
usb_set_address
void usb_set_address(otg_global_type *usbx, uint8_t address)
set the host assignment address
Definition: at32f415_usb.c:721
usb_flush_tx_fifo
void usb_flush_tx_fifo(otg_global_type *usbx, uint32_t fifo_num)
flush tx fifo
Definition: at32f415_usb.c:119
usbh_fsls_clksel
void usbh_fsls_clksel(otg_global_type *usbx, uint8_t clk)
select full or low speed clock
Definition: at32f415_usb.c:1063
usb_ept_out_interrupt
uint32_t usb_ept_out_interrupt(otg_global_type *usbx, uint32_t eptn)
get out endpoint interrupt flag
Definition: at32f415_usb.c:645
usb_interrupt_disable
void usb_interrupt_disable(otg_global_type *usbx)
usb global interrupt disable
Definition: at32f415_usb.c:275
usb_hch_read_interrupt
uint32_t usb_hch_read_interrupt(otg_global_type *usbx)
host read channel interrupt
Definition: at32f415_usb.c:949
usb_ept_close
void usb_ept_close(otg_global_type *usbx, usb_ept_info *ept_info)
close usb endpoint
Definition: at32f415_usb.c:534
usb_stop_phy_clk
void usb_stop_phy_clk(otg_global_type *usbx)
usb stop phy clock
Definition: at32f415_usb.c:391
usb_global_get_all_interrupt
uint32_t usb_global_get_all_interrupt(otg_global_type *usbx)
get all global core interrupt flag
Definition: at32f415_usb.c:211
usb_reg_type
otg_global_type usb_reg_type
Definition: at32f415_usb.h:1351
usb_interrupt_enable
void usb_interrupt_enable(otg_global_type *usbx)
usb global interrupt enable
Definition: at32f415_usb.c:262
usb_get_all_out_interrupt
uint32_t usb_get_all_out_interrupt(otg_global_type *usbx)
get all out endpoint interrupt bits
Definition: at32f415_usb.c:615
usb_ept_in_interrupt
uint32_t usb_ept_in_interrupt(otg_global_type *usbx, uint32_t eptn)
get in endpoint interrupt flag
Definition: at32f415_usb.c:660
usb_get_all_in_interrupt
uint32_t usb_get_all_in_interrupt(otg_global_type *usbx)
get all in endpoint interrupt bits
Definition: at32f415_usb.c:629
usb_global_power_on
void usb_global_power_on(otg_global_type *usbx)
disable the transceiver power down mode
Definition: at32f415_usb.c:372
usb_open_phy_clk
void usb_open_phy_clk(otg_global_type *usbx)
usb open phy clock
Definition: at32f415_usb.c:404
usb_hc_enable
void usb_hc_enable(otg_global_type *usbx, uint8_t chn, uint8_t ept_num, uint8_t dev_address, uint8_t type, uint8_t maxpacket, uint8_t speed)
enable one host channel
Definition: at32f415_usb.c:891
usb_global_reset
error_status usb_global_reset(otg_global_type *usbx)
usb global core soft reset
Definition: at32f415_usb.c:53
usb_ept_stall
void usb_ept_stall(otg_global_type *usbx, usb_ept_info *ept_info)
set endpoint tx or rx status to stall
Definition: at32f415_usb.c:558
usb_hch_halt
void usb_hch_halt(otg_global_type *usbx, uint8_t chn)
halt channel
Definition: at32f415_usb.c:1007
usb_read_packet
void usb_read_packet(otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
read data from usb buffer to user buffer
Definition: at32f415_usb.c:440
usb_global_select_core
otg_global_type * usb_global_select_core(uint8_t usb_id)
usb global select usb core (otg1 or otg2).
Definition: at32f415_usb.c:103
usb_global_init
void usb_global_init(otg_global_type *usbx)
usb global initialization
Definition: at32f415_usb.c:83
usb_host_disable
void usb_host_disable(otg_global_type *usbx)
disable host
Definition: at32f415_usb.c:963
otg_device_type
Definition: at32f415_usb.h:1007
otg_device_type::diepempmsk
__IO uint32_t diepempmsk
Definition: at32f415_usb.h:1142
otg_device_type::outperrmsk
__IO uint32_t outperrmsk
Definition: at32f415_usb.h:1103
otg_device_type::pwroprgdne
__IO uint32_t pwroprgdne
Definition: at32f415_usb.h:1042
otg_device_type::outtepdmsk
__IO uint32_t outtepdmsk
Definition: at32f415_usb.h:1099
otg_device_type::tstctl
__IO uint32_t tstctl
Definition: at32f415_usb.h:1037
otg_device_type::sftdiscon
__IO uint32_t sftdiscon
Definition: at32f415_usb.h:1034
otg_device_type::txfifoudrmsk
__IO uint32_t txfifoudrmsk
Definition: at32f415_usb.h:1081
otg_device_type::outeptmsk
__IO uint32_t outeptmsk
Definition: at32f415_usb.h:1131
otg_device_type::timeoutmsk
__IO uint32_t timeoutmsk
Definition: at32f415_usb.h:1076
otg_device_type::devspd
__IO uint32_t devspd
Definition: at32f415_usb.h:1016
otg_device_type::eptdismsk
__IO uint32_t eptdismsk
Definition: at32f415_usb.h:1074
otg_device_type::eticerr
__IO uint32_t eticerr
Definition: at32f415_usb.h:1057
otg_device_type::ineptint
__IO uint32_t ineptint
Definition: at32f415_usb.h:1117
otg_device_type::dctl
__IO uint32_t dctl
Definition: at32f415_usb.h:1030
otg_device_type::bnaoutmsk
__IO uint32_t bnaoutmsk
Definition: at32f415_usb.h:1104
otg_device_type::cgnpinak
__IO uint32_t cgnpinak
Definition: at32f415_usb.h:1039
otg_device_type::perfrint
__IO uint32_t perfrint
Definition: at32f415_usb.h:1020
otg_device_type::xfercmsk
__IO uint32_t xfercmsk
Definition: at32f415_usb.h:1073
otg_device_type::sgnpinak
__IO uint32_t sgnpinak
Definition: at32f415_usb.h:1038
otg_device_type::intkneptmismsk
__IO uint32_t intkneptmismsk
Definition: at32f415_usb.h:1078
otg_device_type::reserved4
__IO uint32_t reserved4
Definition: at32f415_usb.h:1105
otg_device_type::devaddr
__IO uint32_t devaddr
Definition: at32f415_usb.h:1019
otg_device_type::suspsts
__IO uint32_t suspsts
Definition: at32f415_usb.h:1055
otg_device_type::rwkupsig
__IO uint32_t rwkupsig
Definition: at32f415_usb.h:1033
otg_device_type::intkntxfempmsk
__IO uint32_t intkntxfempmsk
Definition: at32f415_usb.h:1077
otg_device_type::dsts
__IO uint32_t dsts
Definition: at32f415_usb.h:1052
otg_device_type::ineptmsk
__IO uint32_t ineptmsk
Definition: at32f415_usb.h:1130
otg_device_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_usb.h:1021
otg_device_type::bnainmsk
__IO uint32_t bnainmsk
Definition: at32f415_usb.h:1082
otg_device_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_usb.h:1018
otg_device_type::ineptnakmsk
__IO uint32_t ineptnakmsk
Definition: at32f415_usb.h:1079
otg_device_type::nzstsouthshk
__IO uint32_t nzstsouthshk
Definition: at32f415_usb.h:1017
otg_device_type::goutnaksts
__IO uint32_t goutnaksts
Definition: at32f415_usb.h:1036
otg_device_type::enumspd
__IO uint32_t enumspd
Definition: at32f415_usb.h:1056
otg_device_type::gnpinnaksts
__IO uint32_t gnpinnaksts
Definition: at32f415_usb.h:1035
otg_device_type::setupmsk
__IO uint32_t setupmsk
Definition: at32f415_usb.h:1098
otg_device_type::b2bsetupmsk
__IO uint32_t b2bsetupmsk
Definition: at32f415_usb.h:1101
otg_device_type::dcfg
__IO uint32_t dcfg
Definition: at32f415_usb.h:1013
otg_device_type::reserved3
__IO uint32_t reserved3
Definition: at32f415_usb.h:1083
otg_device_type::soffn
__IO uint32_t soffn
Definition: at32f415_usb.h:1059
otg_device_type::doepmsk
__IO uint32_t doepmsk
Definition: at32f415_usb.h:1092
otg_device_type::cgoutnak
__IO uint32_t cgoutnak
Definition: at32f415_usb.h:1041
otg_device_type::daintmsk
__IO uint32_t daintmsk
Definition: at32f415_usb.h:1127
otg_device_type::diepmsk
__IO uint32_t diepmsk
Definition: at32f415_usb.h:1070
otg_device_type::sgoutnak
__IO uint32_t sgoutnak
Definition: at32f415_usb.h:1040
otg_device_type::daint
__IO uint32_t daint
Definition: at32f415_usb.h:1114
otg_device_type::outeptint
__IO uint32_t outeptint
Definition: at32f415_usb.h:1118
otg_device_type::ineptxfemsk
__IO uint32_t ineptxfemsk
Definition: at32f415_usb.h:1145
otg_eptin_type
Definition: at32f415_usb.h:1153
otg_eptin_type::txfnum
__IO uint32_t txfnum
Definition: at32f415_usb.h:1170
otg_eptin_type::xfersize
__IO uint32_t xfersize
Definition: at32f415_usb.h:1210
otg_eptin_type::snak
__IO uint32_t snak
Definition: at32f415_usb.h:1172
otg_eptin_type::eptena
__IO uint32_t eptena
Definition: at32f415_usb.h:1176
otg_eptin_type::setd1pid
__IO uint32_t setd1pid
Definition: at32f415_usb.h:1174
otg_eptin_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_usb.h:1163
otg_eptin_type::mps
__IO uint32_t mps
Definition: at32f415_usb.h:1162
otg_eptin_type::txfemp
__IO uint32_t txfemp
Definition: at32f415_usb.h:1196
otg_eptin_type::dpid
__IO uint32_t dpid
Definition: at32f415_usb.h:1165
otg_eptin_type::ineptnak
__IO uint32_t ineptnak
Definition: at32f415_usb.h:1195
otg_eptin_type::dieptsiz
__IO uint32_t dieptsiz
Definition: at32f415_usb.h:1207
otg_eptin_type::epdisd
__IO uint32_t epdisd
Definition: at32f415_usb.h:1190
otg_eptin_type::diepint
__IO uint32_t diepint
Definition: at32f415_usb.h:1186
otg_eptin_type::intkntxfemp
__IO uint32_t intkntxfemp
Definition: at32f415_usb.h:1193
otg_eptin_type::setd0pid
__IO uint32_t setd0pid
Definition: at32f415_usb.h:1173
otg_eptin_type::dtxfsts
__IO uint32_t dtxfsts
Definition: at32f415_usb.h:1224
otg_eptin_type::naksts
__IO uint32_t naksts
Definition: at32f415_usb.h:1166
otg_eptin_type::diepctl
__IO uint32_t diepctl
Definition: at32f415_usb.h:1159
otg_eptin_type::reserved3
__IO uint32_t reserved3
Definition: at32f415_usb.h:1197
otg_eptin_type::xferc
__IO uint32_t xferc
Definition: at32f415_usb.h:1189
otg_eptin_type::cnak
__IO uint32_t cnak
Definition: at32f415_usb.h:1171
otg_eptin_type::eptype
__IO uint32_t eptype
Definition: at32f415_usb.h:1167
otg_eptin_type::pktcnt
__IO uint32_t pktcnt
Definition: at32f415_usb.h:1211
otg_eptin_type::stall
__IO uint32_t stall
Definition: at32f415_usb.h:1169
otg_eptin_type::eptdis
__IO uint32_t eptdis
Definition: at32f415_usb.h:1175
otg_eptin_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_usb.h:1168
otg_eptin_type::mc
__IO uint32_t mc
Definition: at32f415_usb.h:1212
otg_eptin_type::usbacept
__IO uint32_t usbacept
Definition: at32f415_usb.h:1164
otg_eptin_type::timeout
__IO uint32_t timeout
Definition: at32f415_usb.h:1192
otg_eptin_type::ineptxfsav
__IO uint32_t ineptxfsav
Definition: at32f415_usb.h:1227
otg_eptout_type
Definition: at32f415_usb.h:1235
otg_eptout_type::eptype
__IO uint32_t eptype
Definition: at32f415_usb.h:1249
otg_eptout_type::rxdpid_setupcnt
__IO uint32_t rxdpid_setupcnt
Definition: at32f415_usb.h:1293
otg_eptout_type::epdisd
__IO uint32_t epdisd
Definition: at32f415_usb.h:1272
otg_eptout_type::xferc
__IO uint32_t xferc
Definition: at32f415_usb.h:1271
otg_eptout_type::setup
__IO uint32_t setup
Definition: at32f415_usb.h:1274
otg_eptout_type::dpid
__IO uint32_t dpid
Definition: at32f415_usb.h:1247
otg_eptout_type::naksts
__IO uint32_t naksts
Definition: at32f415_usb.h:1248
otg_eptout_type::eptdis
__IO uint32_t eptdis
Definition: at32f415_usb.h:1257
otg_eptout_type::pktcnt
__IO uint32_t pktcnt
Definition: at32f415_usb.h:1292
otg_eptout_type::setd1pid
__IO uint32_t setd1pid
Definition: at32f415_usb.h:1256
otg_eptout_type::eptena
__IO uint32_t eptena
Definition: at32f415_usb.h:1258
otg_eptout_type::setd0pid
__IO uint32_t setd0pid
Definition: at32f415_usb.h:1255
otg_eptout_type::cnak
__IO uint32_t cnak
Definition: at32f415_usb.h:1253
otg_eptout_type::mps
__IO uint32_t mps
Definition: at32f415_usb.h:1244
otg_eptout_type::outtepd
__IO uint32_t outtepd
Definition: at32f415_usb.h:1275
otg_eptout_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_usb.h:1252
otg_eptout_type::doeptsiz
__IO uint32_t doeptsiz
Definition: at32f415_usb.h:1288
otg_eptout_type::stall
__IO uint32_t stall
Definition: at32f415_usb.h:1251
otg_eptout_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_usb.h:1245
otg_eptout_type::snak
__IO uint32_t snak
Definition: at32f415_usb.h:1254
otg_eptout_type::doepint
__IO uint32_t doepint
Definition: at32f415_usb.h:1268
otg_eptout_type::usbacept
__IO uint32_t usbacept
Definition: at32f415_usb.h:1246
otg_eptout_type::snpm
__IO uint32_t snpm
Definition: at32f415_usb.h:1250
otg_eptout_type::b2pstup
__IO uint32_t b2pstup
Definition: at32f415_usb.h:1277
otg_eptout_type::reserved3
__IO uint32_t reserved3
Definition: at32f415_usb.h:1278
otg_eptout_type::doepctl
__IO uint32_t doepctl
Definition: at32f415_usb.h:1241
otg_eptout_type::xfersize
__IO uint32_t xfersize
Definition: at32f415_usb.h:1291
otg_global_type
Definition: at32f415_usb.h:473
otg_global_type::hchintmsk
__IO uint32_t hchintmsk
Definition: at32f415_usb.h:629
otg_global_type::otgintmsk
__IO uint32_t otgintmsk
Definition: at32f415_usb.h:609
otg_global_type::incompisoin
__IO uint32_t incompisoin
Definition: at32f415_usb.h:585
otg_global_type::gotgctrl
__IO uint32_t gotgctrl
Definition: at32f415_usb.h:479
otg_global_type::gahbcfg
__IO uint32_t gahbcfg
Definition: at32f415_usb.h:510
otg_global_type::curmod
__IO uint32_t curmod
Definition: at32f415_usb.h:485
otg_global_type::txfnum
__IO uint32_t txfnum
Definition: at32f415_usb.h:553
otg_global_type::incompip_incompisoout
__IO uint32_t incompip_incompisoout
Definition: at32f415_usb.h:586
otg_global_type::usbrst
__IO uint32_t usbrst
Definition: at32f415_usb.h:578
otg_global_type::cotxpkt
__IO uint32_t cotxpkt
Definition: at32f415_usb.h:535
otg_global_type::reserved4
__IO uint32_t reserved4
Definition: at32f415_usb.h:591
otg_global_type::bvalidsesen
__IO uint32_t bvalidsesen
Definition: at32f415_usb.h:726
otg_global_type::conidschgmsk
__IO uint32_t conidschgmsk
Definition: at32f415_usb.h:632
otg_global_type::erlysuspmsk
__IO uint32_t erlysuspmsk
Definition: at32f415_usb.h:616
otg_global_type::fhstmode
__IO uint32_t fhstmode
Definition: at32f415_usb.h:533
otg_global_type::oeptintmsk
__IO uint32_t oeptintmsk
Definition: at32f415_usb.h:624
otg_global_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_usb.h:484
otg_global_type::pktsts
__IO uint32_t pktsts
Definition: at32f415_usb.h:650
otg_global_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_usb.h:482
otg_global_type::isooutdrop
__IO uint32_t isooutdrop
Definition: at32f415_usb.h:580
otg_global_type::incompip_incompisooutmsk
__IO uint32_t incompip_incompisooutmsk
Definition: at32f415_usb.h:626
otg_global_type::piusftrst
__IO uint32_t piusftrst
Definition: at32f415_usb.h:548
otg_global_type::guid
__IO uint32_t guid
Definition: at32f415_usb.h:749
otg_global_type::csftrst
__IO uint32_t csftrst
Definition: at32f415_usb.h:547
otg_global_type::rxflvl
__IO uint32_t rxflvl
Definition: at32f415_usb.h:571
otg_global_type::vbusig
__IO uint32_t vbusig
ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) ...
Definition: at32f415_usb.h:739
otg_global_type::curmode
__IO uint32_t curmode
Definition: at32f415_usb.h:567
otg_global_type::ptxfsize
__IO uint32_t ptxfsize
Definition: at32f415_usb.h:767
otg_global_type::modemismsk
__IO uint32_t modemismsk
Definition: at32f415_usb.h:608
otg_global_type::hptxfsiz
__IO uint32_t hptxfsiz
Definition: at32f415_usb.h:763
otg_global_type::fn
__IO uint32_t fn
Definition: at32f415_usb.h:651
otg_global_type::eptnum
__IO uint32_t eptnum
Definition: at32f415_usb.h:647
otg_global_type::pwrdown
__IO uint32_t pwrdown
Definition: at32f415_usb.h:723
otg_global_type::goutnakeffmsk
__IO uint32_t goutnakeffmsk
Definition: at32f415_usb.h:614
otg_global_type::prtint
__IO uint32_t prtint
Definition: at32f415_usb.h:588
otg_global_type::gusbcfg
__IO uint32_t gusbcfg
Definition: at32f415_usb.h:526
otg_global_type::rxfdep
__IO uint32_t rxfdep
Definition: at32f415_usb.h:680
otg_global_type::conidschg
__IO uint32_t conidschg
Definition: at32f415_usb.h:592
otg_global_type::reserved3
__IO uint32_t reserved3
Definition: at32f415_usb.h:486
otg_global_type::disconint
__IO uint32_t disconint
Definition: at32f415_usb.h:593
otg_global_type::nptxfempmsk
__IO uint32_t nptxfempmsk
Definition: at32f415_usb.h:612
otg_global_type::modemis
__IO uint32_t modemis
Definition: at32f415_usb.h:568
otg_global_type::nptxfdep
__IO uint32_t nptxfdep
Definition: at32f415_usb.h:694
otg_global_type::gccfg
__IO uint32_t gccfg
Definition: at32f415_usb.h:719
otg_global_type::sofouten
__IO uint32_t sofouten
Definition: at32f415_usb.h:727
otg_global_type::glbintmsk
__IO uint32_t glbintmsk
Definition: at32f415_usb.h:513
otg_global_type::usbsuspmsk
__IO uint32_t usbsuspmsk
Definition: at32f415_usb.h:617
otg_global_type::ptxfemplvl
__IO uint32_t ptxfemplvl
Definition: at32f415_usb.h:516
otg_global_type::nptxqtop
__IO uint32_t nptxqtop
Definition: at32f415_usb.h:708
otg_global_type::txfflsh
__IO uint32_t txfflsh
Definition: at32f415_usb.h:552
otg_global_type::nptxfspcavail
__IO uint32_t nptxfspcavail
Definition: at32f415_usb.h:706
otg_global_type::dpid
__IO uint32_t dpid
Definition: at32f415_usb.h:649
otg_global_type::ptxfempmsk
__IO uint32_t ptxfempmsk
Definition: at32f415_usb.h:630
otg_global_type::gnptxfsiz_ept0tx
__IO uint32_t gnptxfsiz_ept0tx
Definition: at32f415_usb.h:690
otg_global_type::ieptintmsk
__IO uint32_t ieptintmsk
Definition: at32f415_usb.h:623
otg_global_type::sofmsk
__IO uint32_t sofmsk
Definition: at32f415_usb.h:610
otg_global_type::usbsusp
__IO uint32_t usbsusp
Definition: at32f415_usb.h:577
otg_global_type::fdevmode
__IO uint32_t fdevmode
Definition: at32f415_usb.h:534
otg_global_type::grxfsiz
__IO uint32_t grxfsiz
Definition: at32f415_usb.h:677
otg_global_type::toutcal
__IO uint32_t toutcal
Definition: at32f415_usb.h:529
otg_global_type::oeptint
__IO uint32_t oeptint
Definition: at32f415_usb.h:584
otg_global_type::ineptxfdep
__IO uint32_t ineptxfdep
Definition: at32f415_usb.h:780
otg_global_type::rxflvlmsk
__IO uint32_t rxflvlmsk
Definition: at32f415_usb.h:611
otg_global_type::eopfmsk
__IO uint32_t eopfmsk
Definition: at32f415_usb.h:621
otg_global_type::gotgint
__IO uint32_t gotgint
Definition: at32f415_usb.h:495
otg_global_type::ieptint
__IO uint32_t ieptint
Definition: at32f415_usb.h:583
otg_global_type::enumdone
__IO uint32_t enumdone
Definition: at32f415_usb.h:579
otg_global_type::grxstsr
__IO uint32_t grxstsr
Definition: at32f415_usb.h:644
otg_global_type::nptxfemp
__IO uint32_t nptxfemp
Definition: at32f415_usb.h:572
otg_global_type::chnum
__IO uint32_t chnum
Definition: at32f415_usb.h:664
otg_global_type::nptxfstaddr
__IO uint32_t nptxfstaddr
Definition: at32f415_usb.h:693
otg_global_type::avalidsesen
__IO uint32_t avalidsesen
Definition: at32f415_usb.h:725
otg_global_type::ptxfemp
__IO uint32_t ptxfemp
Definition: at32f415_usb.h:590
otg_global_type::ptxfstaddr
__IO uint32_t ptxfstaddr
Definition: at32f415_usb.h:766
otg_global_type::usbrstmsk
__IO uint32_t usbrstmsk
Definition: at32f415_usb.h:618
otg_global_type::enumdonemsk
__IO uint32_t enumdonemsk
Definition: at32f415_usb.h:619
otg_global_type::erlysusp
__IO uint32_t erlysusp
Definition: at32f415_usb.h:576
otg_global_type::sesenddet
__IO uint32_t sesenddet
Definition: at32f415_usb.h:499
otg_global_type::disconintmsk
__IO uint32_t disconintmsk
Definition: at32f415_usb.h:633
otg_global_type::reserved6
__IO uint32_t reserved6
Definition: at32f415_usb.h:634
otg_global_type::incompisoinmsk
__IO uint32_t incompisoinmsk
Definition: at32f415_usb.h:625
otg_global_type::grstctl
__IO uint32_t grstctl
Definition: at32f415_usb.h:544
otg_global_type::ahbidle
__IO uint32_t ahbidle
Definition: at32f415_usb.h:555
otg_global_type::otgint
__IO uint32_t otgint
Definition: at32f415_usb.h:569
otg_global_type::hchint
__IO uint32_t hchint
Definition: at32f415_usb.h:589
otg_global_type::usbtrdtim
__IO uint32_t usbtrdtim
Definition: at32f415_usb.h:531
otg_global_type::nptxfemplvl
__IO uint32_t nptxfemplvl
Definition: at32f415_usb.h:515
otg_global_type::wkupintmsk
__IO uint32_t wkupintmsk
Definition: at32f415_usb.h:635
otg_global_type::gintsts
__IO uint32_t gintsts
Definition: at32f415_usb.h:564
otg_global_type::frmcntrst
__IO uint32_t frmcntrst
Definition: at32f415_usb.h:549
otg_global_type::rxfflsh
__IO uint32_t rxfflsh
Definition: at32f415_usb.h:551
otg_global_type::ineptxfstaddr
__IO uint32_t ineptxfstaddr
Definition: at32f415_usb.h:779
otg_global_type::ginnakeffmsk
__IO uint32_t ginnakeffmsk
Definition: at32f415_usb.h:613
otg_global_type::prtintmsk
__IO uint32_t prtintmsk
Definition: at32f415_usb.h:628
otg_global_type::bcnt
__IO uint32_t bcnt
Definition: at32f415_usb.h:648
otg_global_type::grxstsp
__IO uint32_t grxstsp
Definition: at32f415_usb.h:661
otg_global_type::sof
__IO uint32_t sof
Definition: at32f415_usb.h:570
otg_global_type::isooutdropmsk
__IO uint32_t isooutdropmsk
Definition: at32f415_usb.h:620
otg_global_type::goutnakeff
__IO uint32_t goutnakeff
Definition: at32f415_usb.h:574
otg_global_type::eopf
__IO uint32_t eopf
Definition: at32f415_usb.h:581
otg_global_type::gintmsk
__IO uint32_t gintmsk
Definition: at32f415_usb.h:604
otg_global_type::nptxqspcavail
__IO uint32_t nptxqspcavail
Definition: at32f415_usb.h:707
otg_global_type::gnptxsts
__IO uint32_t gnptxsts
Definition: at32f415_usb.h:703
otg_global_type::wkupint
__IO uint32_t wkupint
Definition: at32f415_usb.h:595
otg_global_type::ginnakeff
__IO uint32_t ginnakeff
Definition: at32f415_usb.h:573
otg_global_type::reserved5
__IO uint32_t reserved5
Definition: at32f415_usb.h:594
otg_global_type::cidsts
__IO uint32_t cidsts
Definition: at32f415_usb.h:483
otg_global_type::userid
__IO uint32_t userid
Definition: at32f415_usb.h:752
otg_hchannel_type
Definition: at32f415_usb.h:901
otg_hchannel_type::bblerr
__IO uint32_t bblerr
Definition: at32f415_usb.h:957
otg_hchannel_type::xfersize
__IO uint32_t xfersize
Definition: at32f415_usb.h:995
otg_hchannel_type::frmovrun
__IO uint32_t frmovrun
Definition: at32f415_usb.h:958
otg_hchannel_type::xacterrmsk
__IO uint32_t xacterrmsk
Definition: at32f415_usb.h:979
otg_hchannel_type::ackmsk
__IO uint32_t ackmsk
Definition: at32f415_usb.h:977
otg_hchannel_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_usb.h:955
otg_hchannel_type::prtaddr
__IO uint32_t prtaddr
Definition: at32f415_usb.h:932
otg_hchannel_type::hcint
__IO uint32_t hcint
Definition: at32f415_usb.h:946
otg_hchannel_type::devaddr
__IO uint32_t devaddr
Definition: at32f415_usb.h:917
otg_hchannel_type::eptnum
__IO uint32_t eptnum
Definition: at32f415_usb.h:911
otg_hchannel_type::nakmsk
__IO uint32_t nakmsk
Definition: at32f415_usb.h:976
otg_hchannel_type::stallmsk
__IO uint32_t stallmsk
Definition: at32f415_usb.h:975
otg_hchannel_type::eptdir
__IO uint32_t eptdir
Definition: at32f415_usb.h:912
otg_hchannel_type::mc
__IO uint32_t mc
Definition: at32f415_usb.h:916
otg_hchannel_type::chhltdmsk
__IO uint32_t chhltdmsk
Definition: at32f415_usb.h:973
otg_hchannel_type::oddfrm
__IO uint32_t oddfrm
Definition: at32f415_usb.h:918
otg_hchannel_type::chena
__IO uint32_t chena
Definition: at32f415_usb.h:920
otg_hchannel_type::xacterr
__IO uint32_t xacterr
Definition: at32f415_usb.h:956
otg_hchannel_type::hctsiz
__IO uint32_t hctsiz
Definition: at32f415_usb.h:992
otg_hchannel_type::hcchar
__IO uint32_t hcchar
Definition: at32f415_usb.h:907
otg_hchannel_type::chhltd
__IO uint32_t chhltd
Definition: at32f415_usb.h:950
otg_hchannel_type::xfercmsk
__IO uint32_t xfercmsk
Definition: at32f415_usb.h:972
otg_hchannel_type::chdis
__IO uint32_t chdis
Definition: at32f415_usb.h:919
otg_hchannel_type::hcintmsk
__IO uint32_t hcintmsk
Definition: at32f415_usb.h:969
otg_hchannel_type::dtglerrmsk
__IO uint32_t dtglerrmsk
Definition: at32f415_usb.h:982
otg_hchannel_type::compsplt
__IO uint32_t compsplt
Definition: at32f415_usb.h:935
otg_hchannel_type::dtglerr
__IO uint32_t dtglerr
Definition: at32f415_usb.h:959
otg_hchannel_type::mps
__IO uint32_t mps
Definition: at32f415_usb.h:910
otg_hchannel_type::bblerrmsk
__IO uint32_t bblerrmsk
Definition: at32f415_usb.h:980
otg_hchannel_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_usb.h:913
otg_hchannel_type::eptype
__IO uint32_t eptype
Definition: at32f415_usb.h:915
otg_hchannel_type::xactpos
__IO uint32_t xactpos
Definition: at32f415_usb.h:934
otg_hchannel_type::nak
__IO uint32_t nak
Definition: at32f415_usb.h:953
otg_hchannel_type::pktcnt
__IO uint32_t pktcnt
Definition: at32f415_usb.h:996
otg_hchannel_type::lspddev
__IO uint32_t lspddev
Definition: at32f415_usb.h:914
otg_hchannel_type::stall
__IO uint32_t stall
Definition: at32f415_usb.h:952
otg_hchannel_type::reserved3
__IO uint32_t reserved3
Definition: at32f415_usb.h:960
otg_hchannel_type::frmovrunmsk
__IO uint32_t frmovrunmsk
Definition: at32f415_usb.h:981
otg_hchannel_type::pid
__IO uint32_t pid
Definition: at32f415_usb.h:997
otg_hchannel_type::xferc
__IO uint32_t xferc
Definition: at32f415_usb.h:949
otg_hchannel_type::hcsplt
__IO uint32_t hcsplt
Definition: at32f415_usb.h:929
otg_hchannel_type::hubaddr
__IO uint32_t hubaddr
Definition: at32f415_usb.h:933
otg_hchannel_type::spltena
__IO uint32_t spltena
Definition: at32f415_usb.h:937
otg_hchannel_type::ack
__IO uint32_t ack
Definition: at32f415_usb.h:954
otg_host_type
Definition: at32f415_usb.h:787
otg_host_type::hprt
__IO uint32_t hprt
Definition: at32f415_usb.h:877
otg_host_type::haintmsk
__IO uint32_t haintmsk
Definition: at32f415_usb.h:862
otg_host_type::prtlnsts
__IO uint32_t prtlnsts
Definition: at32f415_usb.h:890
otg_host_type::prtsusp
__IO uint32_t prtsusp
Definition: at32f415_usb.h:887
otg_host_type::haint
__IO uint32_t haint
Definition: at32f415_usb.h:849
otg_host_type::fslspclksel
__IO uint32_t fslspclksel
Definition: at32f415_usb.h:796
otg_host_type::prttsctl
__IO uint32_t prttsctl
Definition: at32f415_usb.h:892
otg_host_type::prtenchng
__IO uint32_t prtenchng
Definition: at32f415_usb.h:883
otg_host_type::prtovrcchng
__IO uint32_t prtovrcchng
Definition: at32f415_usb.h:885
otg_host_type::fslssupp
__IO uint32_t fslssupp
Definition: at32f415_usb.h:797
otg_host_type::prtena
__IO uint32_t prtena
Definition: at32f415_usb.h:882
otg_host_type::prtspd
__IO uint32_t prtspd
Definition: at32f415_usb.h:893
otg_host_type::ptxqtop
__IO uint32_t ptxqtop
Definition: at32f415_usb.h:840
otg_host_type::ptxfspcavil
__IO uint32_t ptxfspcavil
Definition: at32f415_usb.h:838
otg_host_type::hfnum
__IO uint32_t hfnum
Definition: at32f415_usb.h:820
otg_host_type::prtovrcact
__IO uint32_t prtovrcact
Definition: at32f415_usb.h:884
otg_host_type::prtpwr
__IO uint32_t prtpwr
Definition: at32f415_usb.h:891
otg_host_type::ptxqspcavil
__IO uint32_t ptxqspcavil
Definition: at32f415_usb.h:839
otg_host_type::hcfg
__IO uint32_t hcfg
Definition: at32f415_usb.h:793
otg_host_type::hfir
__IO uint32_t hfir
Definition: at32f415_usb.h:807
otg_host_type::ftrem
__IO uint32_t ftrem
Definition: at32f415_usb.h:824
otg_host_type::frint
__IO uint32_t frint
Definition: at32f415_usb.h:810
otg_host_type::prtrst
__IO uint32_t prtrst
Definition: at32f415_usb.h:888
otg_host_type::prtcondet
__IO uint32_t prtcondet
Definition: at32f415_usb.h:881
otg_host_type::prtconsts
__IO uint32_t prtconsts
Definition: at32f415_usb.h:880
otg_host_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_usb.h:798
otg_host_type::hptxsts
__IO uint32_t hptxsts
Definition: at32f415_usb.h:835
otg_host_type::prtres
__IO uint32_t prtres
Definition: at32f415_usb.h:886
otg_host_type::frnum
__IO uint32_t frnum
Definition: at32f415_usb.h:823
otg_pcgcctl_type
Definition: at32f415_usb.h:1300
otg_pcgcctl_type::reserved2
__IO uint32_t reserved2
Definition: at32f415_usb.h:1312
otg_pcgcctl_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_usb.h:1310
otg_pcgcctl_type::suspendm
__IO uint32_t suspendm
Definition: at32f415_usb.h:1311
otg_pcgcctl_type::pcgcctl
__IO uint32_t pcgcctl
Definition: at32f415_usb.h:1306
otg_pcgcctl_type::stoppclk
__IO uint32_t stoppclk
Definition: at32f415_usb.h:1309
usb_ept_info
usb endpoint infomation structure definition
Definition: at32f415_usb.h:421
usb_ept_info::ept0_slen
uint32_t ept0_slen
Definition: at32f415_usb.h:440
usb_ept_info::ept_address
uint8_t ept_address
Definition: at32f415_usb.h:423
usb_ept_info::inout
uint8_t inout
Definition: at32f415_usb.h:424
usb_ept_info::maxpacket
uint32_t maxpacket
Definition: at32f415_usb.h:429
usb_ept_info::rx_addr
uint16_t rx_addr
Definition: at32f415_usb.h:428
usb_ept_info::total_len
uint32_t total_len
Definition: at32f415_usb.h:436
usb_ept_info::trans_buf
uint8_t * trans_buf
Definition: at32f415_usb.h:435
usb_ept_info::stall
uint8_t stall
Definition: at32f415_usb.h:431
usb_ept_info::trans_len
uint32_t trans_len
Definition: at32f415_usb.h:437
usb_ept_info::is_double_buffer
uint8_t is_double_buffer
Definition: at32f415_usb.h:430
usb_ept_info::status
uint32_t status
Definition: at32f415_usb.h:432
usb_ept_info::last_len
uint32_t last_len
Definition: at32f415_usb.h:439
usb_ept_info::tx_addr
uint16_t tx_addr
Definition: at32f415_usb.h:427
usb_ept_info::eptn
uint8_t eptn
Definition: at32f415_usb.h:422
usb_ept_info::trans_type
uint8_t trans_type
Definition: at32f415_usb.h:425
usb_hch_type
usb host channel infomation structure definition
Definition: at32f415_usb.h:448
usb_hch_type::ept_type
uint8_t ept_type
Definition: at32f415_usb.h:453
usb_hch_type::speed
uint8_t speed
Definition: at32f415_usb.h:456
usb_hch_type::state
uint32_t state
Definition: at32f415_usb.h:459
usb_hch_type::address
uint8_t address
Definition: at32f415_usb.h:450
usb_hch_type::ch_num
uint8_t ch_num
Definition: at32f415_usb.h:449
usb_hch_type::status
uint32_t status
Definition: at32f415_usb.h:458
usb_hch_type::ept_num
uint8_t ept_num
Definition: at32f415_usb.h:452
usb_hch_type::trans_count
uint32_t trans_count
Definition: at32f415_usb.h:468
usb_hch_type::trans_buf
uint8_t * trans_buf
Definition: at32f415_usb.h:466
usb_hch_type::maxpacket
uint32_t maxpacket
Definition: at32f415_usb.h:454
usb_hch_type::toggle_out
uint8_t toggle_out
Definition: at32f415_usb.h:463
usb_hch_type::urb_sts
uint32_t urb_sts
Definition: at32f415_usb.h:460
usb_hch_type::trans_len
uint32_t trans_len
Definition: at32f415_usb.h:467
usb_hch_type::toggle_in
uint8_t toggle_in
Definition: at32f415_usb.h:462
usb_hch_type::dir
uint8_t dir
Definition: at32f415_usb.h:451
usb_hch_type::stall
uint8_t stall
Definition: at32f415_usb.h:457
usb_hch_type::data_pid
uint8_t data_pid
Definition: at32f415_usb.h:455


AT32F415 Firmwary Library: at32f415_wdt.c Source File

  • libraries
  • drivers
  • src
at32f415_wdt.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef WDT_MODULE_ENABLED
39
49void wdt_enable(void)
50{
51 WDT->cmd = WDT_CMD_ENABLE;
52}
53
59void wdt_counter_reload(void)
60{
61 WDT->cmd = WDT_CMD_RELOAD;
62}
63
69void wdt_reload_value_set(uint16_t reload_value)
70{
71 WDT->rld = reload_value;
72}
73
87void wdt_divider_set(wdt_division_type division)
88{
89 WDT->div_bit.div = division;
90}
91
97void wdt_register_write_enable( confirm_state new_state)
98{
99 if(new_state == FALSE)
100 {
101 WDT->cmd = WDT_CMD_LOCK;
102 }
103 else
104 {
105 WDT->cmd = WDT_CMD_UNLOCK;
106 }
107}
108
117 flag_status wdt_flag_get(uint16_t wdt_flag)
118{
119 flag_status status = RESET;
120
121 if ((WDT->sts & wdt_flag) != (uint16_t)RESET)
122 {
123 status = SET;
124 }
125 else
126 {
127 status = RESET;
128 }
129
130 return status;
131}
132
137#endif
138
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
FALSE
@ FALSE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
wdt_division_type
wdt_division_type
wdt division value type
Definition: at32f415_wdt.h:68
WDT_CMD_ENABLE
@ WDT_CMD_ENABLE
Definition: at32f415_wdt.h:85
WDT_CMD_UNLOCK
@ WDT_CMD_UNLOCK
Definition: at32f415_wdt.h:84
WDT_CMD_RELOAD
@ WDT_CMD_RELOAD
Definition: at32f415_wdt.h:86
WDT_CMD_LOCK
@ WDT_CMD_LOCK
Definition: at32f415_wdt.h:83
wdt_register_write_enable
void wdt_register_write_enable(confirm_state new_state)
enable or disable wdt cmd register write
Definition: at32f415_wdt.c:97
wdt_enable
void wdt_enable(void)
wdt enable ,the reload value will be sent to the counter
Definition: at32f415_wdt.c:49
wdt_flag_get
flag_status wdt_flag_get(uint16_t wdt_flag)
get wdt flag
Definition: at32f415_wdt.c:117
wdt_counter_reload
void wdt_counter_reload(void)
reload wdt counter
Definition: at32f415_wdt.c:59
wdt_reload_value_set
void wdt_reload_value_set(uint16_t reload_value)
set wdt counter reload value
Definition: at32f415_wdt.c:69
wdt_divider_set
void wdt_divider_set(wdt_division_type division)
set wdt division divider
Definition: at32f415_wdt.c:87
WDT
#define WDT
Definition: at32f415_wdt.h:154
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_wdt.h Source File

  • libraries
  • drivers
  • inc
at32f415_wdt.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_WDT_H
29#define __AT32F415_WDT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
53#define WDT_DIVF_UPDATE_FLAG ((uint16_t)0x0001)
54#define WDT_RLDF_UPDATE_FLAG ((uint16_t)0x0002)
67typedef enum
68{
69 WDT_CLK_DIV_4 = 0x00,
70 WDT_CLK_DIV_8 = 0x01,
71 WDT_CLK_DIV_16 = 0x02,
72 WDT_CLK_DIV_32 = 0x03,
73 WDT_CLK_DIV_64 = 0x04,
74 WDT_CLK_DIV_128 = 0x05,
75 WDT_CLK_DIV_256 = 0x06
76} wdt_division_type;
77
81typedef enum
82{
83 WDT_CMD_LOCK = 0x0000,
84 WDT_CMD_UNLOCK = 0x5555,
85 WDT_CMD_ENABLE = 0xCCCC,
86 WDT_CMD_RELOAD = 0xAAAA
87} wdt_cmd_value_type;
88
92typedef struct
93{
94
98 union
99 {
100 __IO uint32_t cmd;
101 struct
102 {
103 __IO uint32_t cmd : 16;/* [15:0] */
104 __IO uint32_t reserved1 : 16;/* [31:16] */
105 } cmd_bit;
106 };
107
111 union
112 {
113 __IO uint32_t div;
114 struct
115 {
116 __IO uint32_t div : 3; /* [2:0] */
117 __IO uint32_t reserved1 : 29;/* [31:3] */
118 } div_bit;
119 };
120
124 union
125 {
126 __IO uint32_t rld;
127 struct
128 {
129 __IO uint32_t rld : 12;/* [11:0] */
130 __IO uint32_t reserved1 : 20;/* [31:12] */
131 } rld_bit;
132 };
133
137 union
138 {
139 __IO uint32_t sts;
140 struct
141 {
142 __IO uint32_t divf : 1; /* [0] */
143 __IO uint32_t rldf : 1; /* [1] */
144 __IO uint32_t reserved1 : 30;/* [31:2] */
145 } sts_bit;
146 };
147
148} wdt_type;
149
154#define WDT ((wdt_type *) WDT_BASE)
155
160void wdt_enable(void);
161void wdt_counter_reload(void);
162void wdt_reload_value_set(uint16_t reload_value);
163void wdt_divider_set(wdt_division_type division);
164void wdt_register_write_enable( confirm_state new_state);
165 flag_status wdt_flag_get(uint16_t wdt_flag);
166
179#ifdef __cplusplus
180}
181#endif
182
183#endif
at32f415.h
at32f415 header file
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
flag_status
flag_status
flag status
Definition: at32f415.h:248
wdt_register_write_enable
void wdt_register_write_enable(confirm_state new_state)
enable or disable wdt cmd register write
Definition: at32f415_wdt.c:97
wdt_enable
void wdt_enable(void)
wdt enable ,the reload value will be sent to the counter
Definition: at32f415_wdt.c:49
wdt_flag_get
flag_status wdt_flag_get(uint16_t wdt_flag)
get wdt flag
Definition: at32f415_wdt.c:117
wdt_counter_reload
void wdt_counter_reload(void)
reload wdt counter
Definition: at32f415_wdt.c:59
wdt_reload_value_set
void wdt_reload_value_set(uint16_t reload_value)
set wdt counter reload value
Definition: at32f415_wdt.c:69
wdt_divider_set
void wdt_divider_set(wdt_division_type division)
set wdt division divider
Definition: at32f415_wdt.c:87
wdt_cmd_value_type
wdt_cmd_value_type
wdt cmd value type
Definition: at32f415_wdt.h:82
wdt_division_type
wdt_division_type
wdt division value type
Definition: at32f415_wdt.h:68
WDT_CMD_ENABLE
@ WDT_CMD_ENABLE
Definition: at32f415_wdt.h:85
WDT_CMD_UNLOCK
@ WDT_CMD_UNLOCK
Definition: at32f415_wdt.h:84
WDT_CMD_RELOAD
@ WDT_CMD_RELOAD
Definition: at32f415_wdt.h:86
WDT_CMD_LOCK
@ WDT_CMD_LOCK
Definition: at32f415_wdt.h:83
WDT_CLK_DIV_64
@ WDT_CLK_DIV_64
Definition: at32f415_wdt.h:73
WDT_CLK_DIV_8
@ WDT_CLK_DIV_8
Definition: at32f415_wdt.h:70
WDT_CLK_DIV_256
@ WDT_CLK_DIV_256
Definition: at32f415_wdt.h:75
WDT_CLK_DIV_4
@ WDT_CLK_DIV_4
Definition: at32f415_wdt.h:69
WDT_CLK_DIV_16
@ WDT_CLK_DIV_16
Definition: at32f415_wdt.h:71
WDT_CLK_DIV_32
@ WDT_CLK_DIV_32
Definition: at32f415_wdt.h:72
WDT_CLK_DIV_128
@ WDT_CLK_DIV_128
Definition: at32f415_wdt.h:74
wdt_type
type define wdt register all
Definition: at32f415_wdt.h:93
wdt_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_wdt.h:104
wdt_type::div
__IO uint32_t div
Definition: at32f415_wdt.h:113
wdt_type::divf
__IO uint32_t divf
Definition: at32f415_wdt.h:142
wdt_type::rld
__IO uint32_t rld
Definition: at32f415_wdt.h:126
wdt_type::rldf
__IO uint32_t rldf
Definition: at32f415_wdt.h:143
wdt_type::sts
__IO uint32_t sts
Definition: at32f415_wdt.h:139
wdt_type::cmd
__IO uint32_t cmd
Definition: at32f415_wdt.h:100


AT32F415 Firmwary Library: at32f415_wwdt.c Source File

  • libraries
  • drivers
  • src
at32f415_wwdt.c
Go to the documentation of this file.
1
27#include "at32f415_conf.h"
28
38#ifdef WWDT_MODULE_ENABLED
39
48void wwdt_reset(void)
49{
50 crm_periph_reset(CRM_WWDT_PERIPH_RESET, TRUE);
51 crm_periph_reset(CRM_WWDT_PERIPH_RESET, FALSE);
52}
53
64void wwdt_divider_set(wwdt_division_type division)
65{
66 WWDT->cfg_bit.div = division;
67}
68
74void wwdt_flag_clear(void)
75{
76 WWDT->sts = 0;
77}
78
84void wwdt_enable(uint8_t wwdt_cnt)
85{
86 WWDT->ctrl = wwdt_cnt | WWDT_EN_BIT;
87}
88
94void wwdt_interrupt_enable(void)
95{
96 WWDT->cfg_bit.rldien = TRUE;
97}
98
104 flag_status wwdt_flag_get(void)
105{
106 return (flag_status)WWDT->sts_bit.rldf;
107}
108
114void wwdt_counter_set(uint8_t wwdt_cnt)
115{
116 WWDT->ctrl_bit.cnt = wwdt_cnt;
117}
118
124void wwdt_window_counter_set(uint8_t window_cnt)
125{
126 WWDT->cfg_bit.win = window_cnt;
127}
128
133#endif
134
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
CRM_WWDT_PERIPH_RESET
@ CRM_WWDT_PERIPH_RESET
Definition: at32f415_crm.h:169
flag_status
flag_status
flag status
Definition: at32f415.h:248
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
WWDT_EN_BIT
#define WWDT_EN_BIT
Definition: at32f415_wwdt.h:52
wwdt_division_type
wwdt_division_type
wwdt division type
Definition: at32f415_wwdt.h:66
wwdt_counter_set
void wwdt_counter_set(uint8_t wwdt_cnt)
wwdt counter value set
Definition: at32f415_wwdt.c:114
wwdt_flag_clear
void wwdt_flag_clear(void)
wwdt reload counter interrupt flag clear
Definition: at32f415_wwdt.c:74
wwdt_interrupt_enable
void wwdt_interrupt_enable(void)
wwdt reload counter interrupt enable
Definition: at32f415_wwdt.c:94
wwdt_divider_set
void wwdt_divider_set(wwdt_division_type division)
wwdt division set
Definition: at32f415_wwdt.c:64
wwdt_reset
void wwdt_reset(void)
wwdt reset by crm reset register
Definition: at32f415_wwdt.c:48
wwdt_window_counter_set
void wwdt_window_counter_set(uint8_t window_cnt)
wwdt window counter value set
Definition: at32f415_wwdt.c:124
wwdt_flag_get
flag_status wwdt_flag_get(void)
wwdt reload counter interrupt flag get
Definition: at32f415_wwdt.c:104
wwdt_enable
void wwdt_enable(uint8_t wwdt_cnt)
wwdt enable and the counter value load
Definition: at32f415_wwdt.c:84
WWDT
#define WWDT
Definition: at32f415_wwdt.h:127
at32f415_conf.h
at32f415 config header file


AT32F415 Firmwary Library: at32f415_wwdt.h Source File

  • libraries
  • drivers
  • inc
at32f415_wwdt.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_WWDT_H
29#define __AT32F415_WWDT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
52#define WWDT_EN_BIT ((uint32_t)0x00000080)
65typedef enum
66{
67 WWDT_PCLK1_DIV_4096 = 0x00,
68 WWDT_PCLK1_DIV_8192 = 0x01,
69 WWDT_PCLK1_DIV_16384 = 0x02,
70 WWDT_PCLK1_DIV_32768 = 0x03
71} wwdt_division_type;
72
76typedef struct
77{
78
82 union
83 {
84 __IO uint32_t ctrl;
85 struct
86 {
87 __IO uint32_t cnt : 7; /* [6:0] */
88 __IO uint32_t wwdten : 1; /* [7] */
89 __IO uint32_t reserved1 : 24;/* [31:8] */
90 } ctrl_bit;
91 };
92
96 union
97 {
98 __IO uint32_t cfg;
99 struct
100 {
101 __IO uint32_t win : 7; /* [6:0] */
102 __IO uint32_t div : 2; /* [8:7] */
103 __IO uint32_t rldien : 1; /* [9] */
104 __IO uint32_t reserved1 : 22;/* [31:10] */
105 } cfg_bit;
106 };
107
111 union
112 {
113 __IO uint32_t sts;
114 struct
115 {
116 __IO uint32_t rldf : 1; /* [0] */
117 __IO uint32_t reserved1 : 31;/* [31:1] */
118 } sts_bit;
119 };
120
121} wwdt_type;
122
127#define WWDT ((wwdt_type *) WWDT_BASE)
128
133void wwdt_reset(void);
134void wwdt_divider_set(wwdt_division_type division);
135void wwdt_flag_clear(void);
136void wwdt_enable(uint8_t wwdt_cnt);
137void wwdt_interrupt_enable(void);
138 flag_status wwdt_flag_get(void);
139void wwdt_counter_set(uint8_t wwdt_cnt);
140void wwdt_window_counter_set(uint8_t window_cnt);
141
154#ifdef __cplusplus
155}
156#endif
157
158#endif
at32f415.h
at32f415 header file
flag_status
flag_status
flag status
Definition: at32f415.h:248
wwdt_counter_set
void wwdt_counter_set(uint8_t wwdt_cnt)
wwdt counter value set
Definition: at32f415_wwdt.c:114
wwdt_flag_clear
void wwdt_flag_clear(void)
wwdt reload counter interrupt flag clear
Definition: at32f415_wwdt.c:74
wwdt_interrupt_enable
void wwdt_interrupt_enable(void)
wwdt reload counter interrupt enable
Definition: at32f415_wwdt.c:94
wwdt_divider_set
void wwdt_divider_set(wwdt_division_type division)
wwdt division set
Definition: at32f415_wwdt.c:64
wwdt_reset
void wwdt_reset(void)
wwdt reset by crm reset register
Definition: at32f415_wwdt.c:48
wwdt_window_counter_set
void wwdt_window_counter_set(uint8_t window_cnt)
wwdt window counter value set
Definition: at32f415_wwdt.c:124
wwdt_flag_get
flag_status wwdt_flag_get(void)
wwdt reload counter interrupt flag get
Definition: at32f415_wwdt.c:104
wwdt_enable
void wwdt_enable(uint8_t wwdt_cnt)
wwdt enable and the counter value load
Definition: at32f415_wwdt.c:84
wwdt_division_type
wwdt_division_type
wwdt division type
Definition: at32f415_wwdt.h:66
WWDT_PCLK1_DIV_16384
@ WWDT_PCLK1_DIV_16384
Definition: at32f415_wwdt.h:69
WWDT_PCLK1_DIV_8192
@ WWDT_PCLK1_DIV_8192
Definition: at32f415_wwdt.h:68
WWDT_PCLK1_DIV_32768
@ WWDT_PCLK1_DIV_32768
Definition: at32f415_wwdt.h:70
WWDT_PCLK1_DIV_4096
@ WWDT_PCLK1_DIV_4096
Definition: at32f415_wwdt.h:67
wwdt_type
type define wwdt register all
Definition: at32f415_wwdt.h:77
wwdt_type::div
__IO uint32_t div
Definition: at32f415_wwdt.h:102
wwdt_type::win
__IO uint32_t win
Definition: at32f415_wwdt.h:101
wwdt_type::cfg
__IO uint32_t cfg
Definition: at32f415_wwdt.h:98
wwdt_type::cnt
__IO uint32_t cnt
Definition: at32f415_wwdt.h:87
wwdt_type::wwdten
__IO uint32_t wwdten
Definition: at32f415_wwdt.h:88
wwdt_type::sts
__IO uint32_t sts
Definition: at32f415_wwdt.h:113
wwdt_type::ctrl
__IO uint32_t ctrl
Definition: at32f415_wwdt.h:84
wwdt_type::reserved1
__IO uint32_t reserved1
Definition: at32f415_wwdt.h:89
wwdt_type::rldien
__IO uint32_t rldien
Definition: at32f415_wwdt.h:103
wwdt_type::rldf
__IO uint32_t rldf
Definition: at32f415_wwdt.h:116


AT32F415 Firmwary Library: audio_conf.h Source File

  • middlewares
  • usbd_class
  • audio
audio/audio_conf.h
Go to the documentation of this file.
1
27 /* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AUDIO_CONF_H
29#define __AUDIO_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
47#define AUDIO_SUPPORT_SPK 1
48#define AUDIO_SUPPORT_MIC 1
49#define AUDIO_SUPPORT_FEEDBACK 1
50
51#define AUDIO_SUPPORT_FREQ_16K 1
52#define AUDIO_SUPPORT_FREQ_48K 1
53
54
55#define AUDIO_SUPPORT_FREQ (AUDIO_SUPPORT_FREQ_16K + \
56 AUDIO_SUPPORT_FREQ_48K \
57 )
58
59#define AUDIO_FREQ_16K 16000
60#define AUDIO_FREQ_48K 48000
61#define AUDIO_BITW_16 16
62
63#define AUDIO_MIC_CHANEL_NUM 2
64#define AUDIO_MIC_DEFAULT_BITW AUDIO_BITW_16
65
66#define AUDIO_SPK_CHANEL_NUM 2
67#define AUDIO_SPK_DEFAULT_BITW AUDIO_BITW_16
68
69
70#define AUDIO_SUPPORT_MAX_FREQ 48
71#define AUDIO_DEFAULT_FREQ AUDIO_FREQ_48K
72#define AUDIO_DEFAULT_BITW AUDIO_BITW_16
73
85#ifdef __cplusplus
86}
87#endif
88
89#endif
90


AT32F415 Firmwary Library: audio_codec.h Source File

  • usb_device
  • audio
  • inc
audio/inc/audio_codec.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AUDIO_CODEC_H
29#define __AUDIO_CODEC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
44/* includes ------------------------------------------------------------------*/
45#include "usb_conf.h"
46
50#define WM8988_R0_LEFT_INPUT_VOLUME 0x00 /*Left channel PGA control*/
51#define WM8988_R1_RIGHT_INPUT_VOLUME 0x01 /*Right channel PGA control*/
52#define WM8988_R2_LOUT1_VOLUME 0x02
53#define WM8988_R3_ROUT1_VOLUME 0x03
54#define WM8988_R4_RESERVED 0x04
55#define WM8988_R5_ADC_DAC_CONTROL 0x05
56#define WM8988_R6_RESERVED 0x06
57#define WM8988_R7_AUDIO_INTERFACE 0x07
58#define WM8988_R8_SAMPLE_RATE 0x08
59#define WM8988_R9_RESERVED 0x09
60#define WM8988_R10_LEFT_DAC_VOLUME 0x0A
61#define WM8988_R11_RIGHT_DAC_VOLUME 0x0B
62#define WM8988_R12_BASS_CONTROL 0x0C
63#define WM8988_R13_TREBLE_CONTROL 0x0D
64#define WM8988_R14_
65#define WM8988_R15_RESET 0x0F
66#define WM8988_R16_3D_CONTROL 0x10
67#define WM8988_R17_ALC1 0x11
68#define WM8988_R18_ALC2 0x12
69#define WM8988_R19_ALC3 0x13
70#define WM8988_R20_NOISE_GATE 0x14
71#define WM8988_R21_LEFT_ADC_VOLUME 0x15
72#define WM8988_R22_RIGHT_ADC_VOLUME 0x16
73#define WM8988_R23_ADDITIONAL_1_CONTROL 0x17
74#define WM8988_R24_ADDITIONAL_2_CONTROL 0x18
75#define WM8988_R25_PWR_1_MGMT 0x19
76#define WM8988_R26_PWR_2_MGMT 0x1A
77#define WM8988_R27_ADDITIONAL_3_CONTROL 0x1B
78
79#define WM8988_R31_ADC_INPUT_MODE 0x1F
80#define WM8988_R32_ADC_L_SIGNAL_PATH 0x20
81#define WM8988_R33_ADC_R_SIGNAL_PATH 0x21
82#define WM8988_R34_LEFT_OUT_MIX_1 0x22
83#define WM8988_R35_LEFT_OUT_MIX_2 0x23
84#define WM8988_R36_RIGHT_OUT_MIX_1 0x24
85#define WM8988_R37_RIGHT_OUT_MIX_2 0x25
86#define WM8988_R38_RESERVED
87#define WM8988_R39_RESERVED
88#define WM8988_R40_LOUT2_VOLUME 0x28
89#define WM8988_R41_ROUT2_VOLUME 0x29
90#define WM8988_R42_RESERVED
91#define WM8988_R43_LOW_POWER_PALYBACK 0x43
92
93#define WM8988_I2C_ADDR_CSB_LOW 0x34
94#define WM8988_I2C_ADDR_CSB_HIGH 0x36
95
103#define I2S1_WS_PIN GPIO_PINS_4
104#define I2S1_CK_PIN GPIO_PINS_5
105#define I2S1_SD_PIN GPIO_PINS_7
106
107#define I2S1_GPIO GPIOA
108#define I2S1_GPIO_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
109#define I2S1_DT_ADDRESS (&(SPI1->dt))
110
111/*I2S2 Pin*/
112#define I2S2_WS_PIN GPIO_PINS_12
113#define I2S2_CK_PIN GPIO_PINS_13
114#define I2S2_SD_PIN GPIO_PINS_15
115
116
117#define I2S2_GPIO GPIOB
118#define I2S2_GPIO_CRM_CLK CRM_GPIOB_PERIPH_CLOCK
119#define I2S2_DT_ADDRESS (&(SPI2->dt))
120
121#define SPK_TX_FIFO_SIZE (1024 * 4)
122
130#define MIC_BUFFER_SIZE 1024
131#define SPK_BUFFER_SIZE 4096
132#define DMA_BUFFER_SIZE 288
133
134typedef struct
135{
136 uint32_t audio_freq;
137 uint32_t audio_bitw;
138 //spk part
139 uint16_t spk_buffer[SPK_BUFFER_SIZE];
140 uint16_t *spk_roff;
141 uint16_t *spk_woff;
142 uint16_t *spk_rend;
143 uint32_t spk_freq;
144 uint32_t spk_wtotal;
145 uint32_t spk_rtotal;
146 uint16_t spk_threshold;
147 uint16_t spk_calc;
148 uint8_t spk_stage;
149
150 //mic part
151 uint16_t mic_buffer[MIC_BUFFER_SIZE];
152 uint16_t *mic_roff;
153 uint16_t *mic_woff;
154 uint16_t *mic_wend;
155 uint32_t mic_wtotal;
156 uint32_t mic_rtotal;
157 uint32_t mic_delta;
158 uint16_t mic_calc;
159 uint16_t mic_adj_count;
160 uint8_t mic_adj_stage;
161 uint8_t mic_stage;
162
163 uint8_t mic_mute;
164 uint8_t spk_mute;
165
166 uint16_t mic_volume;
167 uint16_t spk_volume;
168
169 uint32_t spk_tx_size;
170 uint32_t mic_rx_size;
171
172 uint32_t spk_enable;
173 uint32_t mic_enable;
174
175}audio_codec_type;
176
177 error_status audio_codec_init(void);
178 error_status audio_codec_loop(void);
179void audio_codec_modify_freq(uint32_t freq);
180
184void audio_codec_spk_fifo_write(uint8_t *data, uint32_t len);
185uint32_t audio_codec_mic_get_data(uint8_t *buffer);
186uint8_t audio_codec_spk_feedback(uint8_t *feedback);
187void audio_codec_spk_alt_setting(uint32_t alt_seting);
188void audio_codec_mic_alt_setting(uint32_t alt_seting);
189void audio_codec_set_mic_mute(uint8_t mute);
190void audio_codec_set_spk_mute(uint8_t mute);
191void audio_codec_set_mic_volume(uint16_t volume);
192void audio_codec_set_spk_volume(uint16_t volume);
193void audio_codec_set_mic_freq(uint32_t freq);
194void audio_codec_set_spk_freq(uint32_t freq);
195
207#ifdef __cplusplus
208}
209#endif
210
211#endif
212
error_status
error_status
error status
Definition: at32f415.h:258
audio_codec_mic_alt_setting
void audio_codec_mic_alt_setting(uint32_t alt_seting)
audio codec microphone alt setting config
Definition: audio/src/audio_codec.c:169
audio_codec_set_spk_volume
void audio_codec_set_spk_volume(uint16_t volume)
audio codec set speaker volume
Definition: audio/src/audio_codec.c:217
audio_codec_set_spk_mute
void audio_codec_set_spk_mute(uint8_t mute)
audio codec set speaker mute
Definition: audio/src/audio_codec.c:195
MIC_BUFFER_SIZE
#define MIC_BUFFER_SIZE
Definition: audio/inc/audio_codec.h:130
audio_codec_set_mic_freq
void audio_codec_set_mic_freq(uint32_t freq)
audio codec set microphone freq
Definition: audio/src/audio_codec.c:121
audio_codec_mic_get_data
uint32_t audio_codec_mic_get_data(uint8_t *buffer)
codec microphone get data
Definition: audio/src/audio_codec.c:282
audio_codec_loop
error_status audio_codec_loop(void)
audio codec loop
Definition: audio/src/audio_codec.c:855
SPK_BUFFER_SIZE
#define SPK_BUFFER_SIZE
Definition: audio/inc/audio_codec.h:131
audio_codec_set_mic_mute
void audio_codec_set_mic_mute(uint8_t mute)
audio codec set microphone mute
Definition: audio/src/audio_codec.c:184
audio_codec_spk_fifo_write
void audio_codec_spk_fifo_write(uint8_t *data, uint32_t len)
audio codec interface
Definition: audio/src/audio_codec.c:244
audio_codec_spk_feedback
uint8_t audio_codec_spk_feedback(uint8_t *feedback)
codec speaker feedback
Definition: audio/src/audio_codec.c:228
audio_codec_modify_freq
void audio_codec_modify_freq(uint32_t freq)
audio codec modify freq
Definition: audio/src/audio_codec.c:342
audio_codec_set_mic_volume
void audio_codec_set_mic_volume(uint16_t volume)
audio codec set microphone volume
Definition: audio/src/audio_codec.c:206
audio_codec_spk_alt_setting
void audio_codec_spk_alt_setting(uint32_t alt_seting)
audio codec speaker alt setting config
Definition: audio/src/audio_codec.c:154
audio_codec_init
error_status audio_codec_init(void)
audio codec init
Definition: audio/src/audio_codec.c:796
audio_codec_set_spk_freq
void audio_codec_set_spk_freq(uint32_t freq)
audio codec set speaker freq
Definition: audio/src/audio_codec.c:137
audio_codec_type
Definition: audio/inc/audio_codec.h:135
audio_codec_type::spk_mute
uint8_t spk_mute
Definition: audio/inc/audio_codec.h:164
audio_codec_type::spk_threshold
uint16_t spk_threshold
Definition: audio/inc/audio_codec.h:146
audio_codec_type::mic_enable
uint32_t mic_enable
Definition: audio/inc/audio_codec.h:173
audio_codec_type::spk_stage
uint8_t spk_stage
Definition: audio/inc/audio_codec.h:148
audio_codec_type::mic_roff
uint16_t * mic_roff
Definition: audio/inc/audio_codec.h:152
audio_codec_type::mic_volume
uint16_t mic_volume
Definition: audio/inc/audio_codec.h:166
audio_codec_type::spk_roff
uint16_t * spk_roff
Definition: audio/inc/audio_codec.h:140
audio_codec_type::spk_rtotal
uint32_t spk_rtotal
Definition: audio/inc/audio_codec.h:145
audio_codec_type::mic_delta
uint32_t mic_delta
Definition: audio/inc/audio_codec.h:157
audio_codec_type::spk_calc
uint16_t spk_calc
Definition: audio/inc/audio_codec.h:147
audio_codec_type::mic_woff
uint16_t * mic_woff
Definition: audio/inc/audio_codec.h:153
audio_codec_type::mic_stage
uint8_t mic_stage
Definition: audio/inc/audio_codec.h:161
audio_codec_type::mic_adj_count
uint16_t mic_adj_count
Definition: audio/inc/audio_codec.h:159
audio_codec_type::spk_freq
uint32_t spk_freq
Definition: audio/inc/audio_codec.h:143
audio_codec_type::audio_bitw
uint32_t audio_bitw
Definition: audio/inc/audio_codec.h:137
audio_codec_type::mic_wend
uint16_t * mic_wend
Definition: audio/inc/audio_codec.h:154
audio_codec_type::spk_rend
uint16_t * spk_rend
Definition: audio/inc/audio_codec.h:142
audio_codec_type::mic_wtotal
uint32_t mic_wtotal
Definition: audio/inc/audio_codec.h:155
audio_codec_type::spk_enable
uint32_t spk_enable
Definition: audio/inc/audio_codec.h:172
audio_codec_type::mic_rtotal
uint32_t mic_rtotal
Definition: audio/inc/audio_codec.h:156
audio_codec_type::audio_freq
uint32_t audio_freq
Definition: audio/inc/audio_codec.h:136
audio_codec_type::mic_mute
uint8_t mic_mute
Definition: audio/inc/audio_codec.h:163
audio_codec_type::spk_volume
uint16_t spk_volume
Definition: audio/inc/audio_codec.h:167
audio_codec_type::mic_calc
uint16_t mic_calc
Definition: audio/inc/audio_codec.h:158
audio_codec_type::spk_wtotal
uint32_t spk_wtotal
Definition: audio/inc/audio_codec.h:144
audio_codec_type::mic_adj_stage
uint8_t mic_adj_stage
Definition: audio/inc/audio_codec.h:160
audio_codec_type::spk_tx_size
uint32_t spk_tx_size
Definition: audio/inc/audio_codec.h:169
audio_codec_type::mic_rx_size
uint32_t mic_rx_size
Definition: audio/inc/audio_codec.h:170
audio_codec_type::spk_woff
uint16_t * spk_woff
Definition: audio/inc/audio_codec.h:141
usb_conf.h
usb config header file


AT32F415 Firmwary Library: audio_codec.c Source File

  • usb_device
  • audio
  • src
audio/src/audio_codec.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "audio_codec.h"
29#include "i2c_application.h"
30#include "audio_conf.h"
31#include <string.h>
32
41#define I2C_TIMEOUT 0xFFFFFFFF
42
43#define I2Cx_SPEED 100000
44#define I2Cx_ADDRESS 0x00
45
46#define I2Cx_PORT I2C1
47#define I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
48
49#define I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
50#define I2Cx_SCL_GPIO_PIN GPIO_PINS_8
51#define I2Cx_SCL_GPIO_PORT GPIOB
52
53#define I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
54#define I2Cx_SDA_GPIO_PIN GPIO_PINS_9
55#define I2Cx_SDA_GPIO_PORT GPIOB
56
60#define WM8988_REG_FREQ48K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0081)
61#define WM8988_REG_FREQ16K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0095)
62
66#define WM8988_REG_BITW16 ((WM8988_R7_AUDIO_INTERFACE << 9) | 0x0042)
67
71uint16_t reg_addr_data[] =
72{
73 (WM8988_R0_LEFT_INPUT_VOLUME << 9) | 0x012F, /*Left Input Channel Volume*/
74 (WM8988_R1_RIGHT_INPUT_VOLUME << 9) | 0x012F, /*Right Input Channel Volume*/
75 (WM8988_R2_LOUT1_VOLUME << 9) | 0x0179, /*Left Output Channel Volume*/
76 (WM8988_R3_ROUT1_VOLUME << 9) | 0x0179, /*Right Output Channel Volume*/
77 (WM8988_R5_ADC_DAC_CONTROL << 9) | 0x0006, /*De-emphasis Control and Digital soft mute*/
78 (WM8988_REG_BITW16),
79 (WM8988_REG_FREQ16K),
80 (WM8988_R10_LEFT_DAC_VOLUME << 9) | 0x01FF, /*Left Digital DAC Volume Control*/
81 (WM8988_R11_RIGHT_DAC_VOLUME << 9) | 0x01FF, /*Right Digital DAC Volume Control*/
82 (WM8988_R12_BASS_CONTROL << 9) | 0x000F, /*Bass Control*/
83 (WM8988_R13_TREBLE_CONTROL << 9) | 0x000F, /*Treble Control*/
84 (WM8988_R16_3D_CONTROL << 9) | 0x0000, /*3D stereo Enhancment*/
85 (WM8988_R21_LEFT_ADC_VOLUME << 9) | 0x01C3, /*Left ADC Digital Volume*/
86 (WM8988_R22_RIGHT_ADC_VOLUME << 9) | 0x01C3, /*Right ADC Digital Volume*/
87 (WM8988_R23_ADDITIONAL_1_CONTROL << 9) | 0x00C2, /*Additional Control 1*/
88 (WM8988_R24_ADDITIONAL_2_CONTROL << 9) | 0x0000, /*Additional Control 2*/
89 (WM8988_R27_ADDITIONAL_3_CONTROL << 9) | 0x0000, /*Additional Control 3*/
90 (WM8988_R31_ADC_INPUT_MODE << 9) | 0x0000, /*ADC input mode*/
91 (WM8988_R32_ADC_L_SIGNAL_PATH << 9) | 0x0000, /*ADC Signal Path Control left*/
92 (WM8988_R33_ADC_R_SIGNAL_PATH << 9) | 0x0000, /*ADC Signal Path Control right*/
93 (WM8988_R34_LEFT_OUT_MIX_1 << 9) | 0x0152, /*Left DAC mixer Control*/
94 (WM8988_R35_LEFT_OUT_MIX_2 << 9) | 0x0050, /*Left DAC mixer Control*/
95 (WM8988_R36_RIGHT_OUT_MIX_1 << 9) | 0x0052, /*Right DAC mixer Control*/
96 (WM8988_R37_RIGHT_OUT_MIX_2 << 9) | 0x0150, /*Right DAC mixer Control*/
97 (WM8988_R40_LOUT2_VOLUME << 9) | 0x01FF, /*Output left channel volume*/
98 (WM8988_R41_ROUT2_VOLUME << 9) | 0x01FF, /*Output left channel volume*/
99 (WM8988_R43_LOW_POWER_PALYBACK << 9) | 0x0008, /*Output left channel volume*/
100 (WM8988_R25_PWR_1_MGMT << 9) | 0x017C, /*Power Management1*/
101 (WM8988_R26_PWR_2_MGMT << 9) | 0x01F8, /*Power Management2*/
102};
103
104 i2c_handle_type hi2cx;
105
106 audio_codec_type audio_codec;
107uint16_t spk_dma_buffer[DMA_BUFFER_SIZE];
108uint16_t mic_dma_buffer[DMA_BUFFER_SIZE];
109
110void memset16_buffer(uint16_t *buffer, uint32_t set, uint32_t len);
111void codec_i2s_reset(void);
112void codec_i2s_init(audio_codec_type *param);
113void mclk_tmr1_init(void);
114void copy_buff(uint16_t *dest, uint16_t *src, uint32_t len);
115
121void audio_codec_set_mic_freq(uint32_t freq)
122{
123 if(audio_codec.audio_freq != freq)
124 {
125 audio_codec.audio_freq = freq;
126 codec_i2s_reset();
127 audio_codec_modify_freq(freq);
128 codec_i2s_init(&audio_codec);
129 }
130}
131
137void audio_codec_set_spk_freq(uint32_t freq)
138{
139 if(audio_codec.audio_freq != freq)
140 {
141 audio_codec.audio_freq = freq;
142 codec_i2s_reset();
143 audio_codec_modify_freq(freq);
144 codec_i2s_init(&audio_codec);
145 }
146}
147
148
154void audio_codec_spk_alt_setting(uint32_t alt_seting)
155{
156 if(alt_seting == 0)
157 {
158 }
159 else
160 {
161 }
162}
163
169void audio_codec_mic_alt_setting(uint32_t alt_seting)
170{
171 if(alt_seting == 0)
172 {
173 }
174 else
175 {
176 }
177}
178
184void audio_codec_set_mic_mute(uint8_t mute)
185{
186 audio_codec.mic_mute = mute;
187}
188
189
195void audio_codec_set_spk_mute(uint8_t mute)
196{
197 audio_codec.spk_mute = mute;
198}
199
200
206void audio_codec_set_mic_volume(uint16_t volume)
207{
208 /* wm8988 adc have 256 steps */
209 audio_codec.mic_volume = volume;
210}
211
217void audio_codec_set_spk_volume(uint16_t volume)
218{
219 /* wm8988 dac have 80 steps */
220 audio_codec.spk_volume = (volume * 0x50) / 0x64 + 0x30 - 1;
221}
222
228uint8_t audio_codec_spk_feedback(uint8_t *feedback)
229{
230 uint32_t feedback_value = (audio_codec.spk_freq);
231 feedback_value = ((feedback_value/1000)<<14)|((feedback_value%1000)<<4);
232 feedback[0] = (uint8_t)(feedback_value);
233 feedback[1] = (uint8_t)(feedback_value >> 8);
234 feedback[2] = (uint8_t)(feedback_value >> 16);
235 return 3;
236}
237
244void audio_codec_spk_fifo_write(uint8_t *data, uint32_t len)
245{
246 uint16_t ulen = len / 2, i;
247 uint16_t *u16data = (uint16_t *)data;
248
249 switch(audio_codec.spk_stage)
250 {
251 case 0:
252 audio_codec.spk_woff = audio_codec.spk_roff = audio_codec.spk_buffer;
253 audio_codec.spk_wtotal = audio_codec.spk_rtotal = 0;
254 audio_codec.spk_stage = 1;
255 audio_codec.spk_threshold = SPK_BUFFER_SIZE/2;
256 break;
257 case 1:
258 if( audio_codec.spk_wtotal >= SPK_BUFFER_SIZE/2 )
259 {
260 audio_codec.spk_stage = 2;
261 }
262 break;
263 case 2:
264 break;
265 }
266 for( i = 0; i < ulen; ++i )
267 {
268 *audio_codec.spk_woff++ = *u16data++;
269 if( audio_codec.spk_woff >= audio_codec.spk_rend )
270 {
271 audio_codec.spk_woff = audio_codec.spk_buffer;
272 }
273 }
274 audio_codec.spk_wtotal += ulen;
275}
276
282uint32_t audio_codec_mic_get_data(uint8_t *buffer)
283{
284 //copy_buff((uint16_t *)buffer, audio_codec.mic_buffer + audio_codec.mic_hf_status, audio_codec.mic_rx_size);
285 uint16_t len = audio_codec.mic_rx_size << 1;
286 uint16_t i;
287 uint16_t* u16buf = (uint16_t*)buffer;
288 switch(audio_codec.mic_stage)
289 {
290 case 0:
291 audio_codec.mic_stage = 1;
292 memset( buffer, 0, len );
293 return len;
294 case 1:
295 if( audio_codec.mic_wtotal - audio_codec.mic_rtotal >= MIC_BUFFER_SIZE/2 )
296 {
297 audio_codec.mic_stage = 2;
298 }
299 return len;
300 }
301 switch( audio_codec.mic_adj_stage )
302 {
303 case 0:
304 break;
305 case 1:
306 if( audio_codec.mic_adj_count >= 4 ){
307 len += 4;
308 audio_codec.mic_adj_count -= 4;
309 }
310 break;
311 case 2:
312 if( audio_codec.mic_adj_count >= 4 ){
313 len -= 4;
314 audio_codec.mic_adj_count -= 4;
315 }
316 break;
317 }
318
319 for( i = 0; i < len/2; ++i )
320 {
321 *u16buf++ = *audio_codec.mic_roff++;
322 if( audio_codec.mic_roff >= audio_codec.mic_wend )
323 {
324 audio_codec.mic_roff = audio_codec.mic_buffer;
325 }
326 }
327 if( audio_codec.mic_wtotal <= audio_codec.mic_rtotal )
328 { //should not happen
329 while(1);
330 }
331
332 audio_codec.mic_rtotal += len/2;
333 audio_codec.mic_delta += len/2;
334 return len;
335}
336
342void audio_codec_modify_freq(uint32_t freq)
343{
344 uint16_t codec_cmd;
345 uint8_t i2c_cmd[2];
346 if(freq == AUDIO_FREQ_16K)
347 {
348 codec_cmd = WM8988_REG_FREQ16K;
349 }
350 else if(freq == AUDIO_FREQ_48K)
351 {
352 codec_cmd = WM8988_REG_FREQ48K;
353 }
354 i2c_cmd[0] = (uint8_t)(codec_cmd >> 8);
355 i2c_cmd[1] = (uint8_t)codec_cmd & 0xFF;
356 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
357 {
358 while(1);
359 }
360}
361
369void memset16_buffer(uint16_t *buffer, uint32_t set, uint32_t len)
370{
371 uint32_t i_index = 0;
372 for(i_index = 0; i_index < len; i_index ++)
373 {
374 buffer[i_index] = (uint16_t)set;
375 }
376}
377
385void copy_buff(uint16_t *dest, uint16_t *src, uint32_t len)
386{
387 uint16_t i_index;
388 for(i_index = 0; i_index < len; i_index ++)
389 {
390 dest[i_index] = src[i_index];
391 }
392}
393
399void i2c_lowlevel_init(i2c_handle_type* hi2c)
400{
401 gpio_init_type gpio_init_structure;
402
403 if(hi2c->i2cx == I2Cx_PORT)
404 {
405 /* i2c periph clock enable */
406 crm_periph_clock_enable(I2Cx_CLK, TRUE);
407 crm_periph_clock_enable(I2Cx_SCL_GPIO_CLK, TRUE);
408 crm_periph_clock_enable(I2Cx_SDA_GPIO_CLK, TRUE);
409 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
410 gpio_pin_remap_config(I2C1_MUX, TRUE);
411
412 /* configure i2c pins: scl */
413 gpio_init_structure.gpio_out_type = GPIO_OUTPUT_OPEN_DRAIN;
414 gpio_init_structure.gpio_pull = GPIO_PULL_UP;
415 gpio_init_structure.gpio_mode = GPIO_MODE_MUX;
416 gpio_init_structure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
417
418 gpio_init_structure.gpio_pins = I2Cx_SCL_GPIO_PIN;
419 gpio_init(I2Cx_SCL_GPIO_PORT, &gpio_init_structure);
420
421 /* configure i2c pins: sda */
422 gpio_init_structure.gpio_pins = I2Cx_SDA_GPIO_PIN;
423 gpio_init(I2Cx_SDA_GPIO_PORT, &gpio_init_structure);
424
425 /* config i2c */
426 i2c_init(hi2c->i2cx, I2C_FSMODE_DUTY_2_1, I2Cx_SPEED);
427
428 i2c_own_address1_set(hi2c->i2cx, I2C_ADDRESS_MODE_7BIT, I2Cx_ADDRESS);
429 }
430}
431
437void mclk_tmr1_init(void)
438{
439 gpio_init_type gpio_init_struct;
440 tmr_output_config_type tmr_oc_init_structure;
441 uint16_t prescaler_value = (uint16_t)(system_core_clock / 24000000) - 1;
442
443 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
444 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
445 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
446
447 gpio_default_para_init(&gpio_init_struct);
448
449
450 gpio_init_struct.gpio_pins = GPIO_PINS_8;
451 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
452 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
453 gpio_init(GPIOA, &gpio_init_struct);
454
455 tmr_base_init(TMR1, 1, prescaler_value);
456 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
457 tmr_clock_source_div_set(TMR1, TMR_CLOCK_DIV1);
458
459 tmr_output_default_para_init(&tmr_oc_init_structure);
460 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_A;
461 tmr_oc_init_structure.oc_idle_state = FALSE;
462 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
463 tmr_oc_init_structure.oc_output_state = TRUE;
464 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
465 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_1, 1);
466 tmr_output_channel_buffer_enable(TMR1, TMR_SELECT_CHANNEL_1, TRUE);
467
468 /* tmr enable counter */
469 tmr_counter_enable(TMR1, TRUE);
470 tmr_output_enable(TMR1, TRUE);
471}
472
473
479void codec_i2s_reset(void)
480{
481 i2s_enable(SPI1, FALSE);
482 i2s_enable(SPI2, FALSE);
483 dma_channel_enable(DMA1_CHANNEL3, FALSE);
484 dma_channel_enable(DMA1_CHANNEL4, FALSE);
485}
486
493void codec_i2s_init(audio_codec_type *param)
494{
495 gpio_init_type gpio_init_struct;
496 dma_init_type dma_init_struct;
497 i2s_init_type i2s_init_struct;
498 i2s_data_channel_format_type format = I2S_DATA_16BIT_CHANNEL_16BIT;
499
500 crm_periph_clock_enable(I2S1_GPIO_CRM_CLK, TRUE);
501 crm_periph_clock_enable(I2S2_GPIO_CRM_CLK, TRUE);
502 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
503 crm_periph_clock_enable(CRM_SPI1_PERIPH_CLOCK, TRUE);
504 crm_periph_clock_enable(CRM_SPI2_PERIPH_CLOCK, TRUE);
505
506 param->spk_freq = param->audio_freq;
507
508 param->spk_tx_size = (param->audio_freq / 1000) * (param->audio_bitw / 8) * AUDIO_SPK_CHANEL_NUM / 2;
509 param->mic_rx_size = (param->audio_freq / 1000) * (param->audio_bitw / 8) * AUDIO_MIC_CHANEL_NUM / 2;
510
511 memset(param->spk_buffer, 0, SPK_BUFFER_SIZE*sizeof(uint16_t));
512 memset(param->mic_buffer, 0, MIC_BUFFER_SIZE*sizeof(uint16_t));
513
514 param->mic_wend = param->mic_woff = param->mic_roff = param->mic_buffer;
515 param->spk_rend = param->spk_woff = param->spk_roff = param->spk_buffer;
516
517 while(param->mic_wend < param->mic_buffer+MIC_BUFFER_SIZE)
518 {
519 param->mic_wend += param->mic_rx_size;
520 }
521 param->mic_wend -= param->mic_rx_size;
522 while(param->spk_rend < param->spk_buffer+SPK_BUFFER_SIZE)
523 {
524 param->spk_rend += param->spk_tx_size;
525 }
526 param->spk_rend -= param->spk_tx_size;
527 if(param->audio_bitw == 16)
528 {
529 format = I2S_DATA_16BIT_CHANNEL_16BIT;
530 }
531 else
532 {
533 format = I2S_DATA_24BIT_CHANNEL_32BIT;
534 }
535
536 gpio_default_para_init(&gpio_init_struct);
537
538 /* i2s1 ws pins */
539 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
540 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
541 gpio_init_struct.gpio_pins = I2S1_WS_PIN;
542 gpio_init(I2S1_GPIO, &gpio_init_struct);
543
544 /* i2s1 ck pins */
545 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
546 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
547 gpio_init_struct.gpio_pins = I2S1_CK_PIN;
548 gpio_init(I2S1_GPIO, &gpio_init_struct);
549
550 /* i2s1 sd pins slave tx */
551 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
552 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
553 gpio_init_struct.gpio_pins = I2S1_SD_PIN;
554 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
555 gpio_init(I2S1_GPIO, &gpio_init_struct);
556
557 /* i2s2 ws pins */
558 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
559 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
560 gpio_init_struct.gpio_pins = I2S2_WS_PIN;
561 gpio_init(I2S2_GPIO, &gpio_init_struct);
562
563 /* i2s2 ck pins */
564 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
565 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
566 gpio_init_struct.gpio_pins = I2S2_CK_PIN;
567 gpio_init(I2S2_GPIO, &gpio_init_struct);
568
569 /* i2s2 sd pins slave rx */
570 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
571 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
572 gpio_init_struct.gpio_pins = I2S2_SD_PIN;
573 gpio_init(I2S2_GPIO, &gpio_init_struct);
574
575 /* dma config */
576 dma_reset(DMA1_CHANNEL3);
577 dma_reset(DMA1_CHANNEL4);
578
579 /* dma1 channel3: speaker i2s1 tx */
580 dma_default_para_init(&dma_init_struct);
581 dma_init_struct.buffer_size = param->spk_tx_size << 1;
582 dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
583 dma_init_struct.memory_base_addr = (uint32_t)spk_dma_buffer;
584 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
585 dma_init_struct.memory_inc_enable = TRUE;
586 dma_init_struct.peripheral_base_addr = (uint32_t)I2S1_DT_ADDRESS;
587 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
588 dma_init_struct.peripheral_inc_enable = FALSE;
589 dma_init_struct.priority = DMA_PRIORITY_HIGH;
590 dma_init_struct.loop_mode_enable = TRUE;
591 dma_init(DMA1_CHANNEL3, &dma_init_struct);
592 dma_interrupt_enable(DMA1_CHANNEL3, DMA_FDT_INT, TRUE);
593 dma_interrupt_enable(DMA1_CHANNEL3, DMA_HDT_INT, TRUE);
594 nvic_irq_enable(DMA1_Channel3_IRQn, 1, 0);
595
596 /* dma1 channel4: microphone i2s2 rx */
597 dma_default_para_init(&dma_init_struct);
598 dma_init_struct.buffer_size = param->mic_rx_size << 1;
599 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
600 dma_init_struct.memory_base_addr = (uint32_t)mic_dma_buffer;
601 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
602 dma_init_struct.memory_inc_enable = TRUE;
603 dma_init_struct.peripheral_base_addr = (uint32_t)I2S2_DT_ADDRESS;
604 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
605 dma_init_struct.peripheral_inc_enable = FALSE;
606 dma_init_struct.priority = DMA_PRIORITY_HIGH;
607 dma_init_struct.loop_mode_enable = TRUE;
608 dma_init(DMA1_CHANNEL4, &dma_init_struct);
609 dma_interrupt_enable(DMA1_CHANNEL4, DMA_FDT_INT, TRUE);
610 dma_interrupt_enable(DMA1_CHANNEL4, DMA_HDT_INT, TRUE);
611 nvic_irq_enable(DMA1_Channel4_IRQn, 2, 0);
612
613 /* i2s1 tx init */
614 spi_i2s_reset(SPI1);
615 i2s_default_para_init(&i2s_init_struct);
616 i2s_init_struct.audio_protocol = I2S_AUDIO_PROTOCOL_PHILLIPS;
617 i2s_init_struct.data_channel_format = format;
618 i2s_init_struct.mclk_output_enable = FALSE;
619 i2s_init_struct.audio_sampling_freq = (i2s_audio_sampling_freq_type)param->audio_freq;
620 i2s_init_struct.clock_polarity = I2S_CLOCK_POLARITY_LOW;
621 i2s_init_struct.operation_mode = I2S_MODE_SLAVE_TX;
622 i2s_init(SPI1, &i2s_init_struct);
623
624 /* i2s2 rx init */
625 spi_i2s_reset(SPI2);
626 i2s_default_para_init(&i2s_init_struct);
627 i2s_init_struct.audio_protocol = I2S_AUDIO_PROTOCOL_PHILLIPS;
628 i2s_init_struct.data_channel_format = format;
629 i2s_init_struct.mclk_output_enable = FALSE;
630 i2s_init_struct.audio_sampling_freq = (i2s_audio_sampling_freq_type)param->audio_freq;
631 i2s_init_struct.clock_polarity = I2S_CLOCK_POLARITY_LOW;
632 i2s_init_struct.operation_mode = I2S_MODE_SLAVE_RX;
633 i2s_init(SPI2, &i2s_init_struct);
634
635
636 spi_i2s_dma_transmitter_enable(SPI1, TRUE);
637 spi_i2s_dma_receiver_enable(SPI2, TRUE);
638 i2s_enable(SPI1, TRUE);
639 i2s_enable(SPI2, TRUE);
640
641 dma_channel_enable(DMA1_CHANNEL3, TRUE);
642 dma_channel_enable(DMA1_CHANNEL4, TRUE);
643
644}
645
651void DMA1_Channel3_IRQHandler(void)
652{
653 uint16_t half_size = audio_codec.spk_tx_size;
654 uint16_t *pdst;
655
656 if(dma_flag_get(DMA1_HDT3_FLAG) == SET)
657 {
658 //copy_buff(audio_codec.spk_buffer, audio_codec.spk_tx_fifo + audio_codec.r_pos, half_size);
659 pdst = spk_dma_buffer;
660 dma_flag_clear(DMA1_HDT3_FLAG);
661 }
662 else if(dma_flag_get(DMA1_FDT3_FLAG) == SET)
663 {
664 //copy_buff(&audio_codec.spk_buffer[half_size], audio_codec.spk_tx_fifo + audio_codec.r_pos, half_size);
665 pdst = spk_dma_buffer + half_size;
666 dma_flag_clear(DMA1_FDT3_FLAG);
667 }
668
669 switch( audio_codec.spk_stage )
670 {
671 case 0:
672 case 1:
673 memset( pdst, 0, half_size << 1);
674 break;
675 case 2:
676 if( audio_codec.spk_wtotal >= audio_codec.spk_rtotal + SPK_BUFFER_SIZE )
677 {
678 while(1);//should not happen;
679 }
680 if( audio_codec.spk_rtotal >= audio_codec.spk_wtotal )
681 {
682 audio_codec.spk_stage = 0;
683 audio_codec.spk_woff = audio_codec.spk_roff = audio_codec.spk_buffer;
684 audio_codec.spk_rtotal = audio_codec.spk_wtotal = 0;
685 }
686 else
687 {
688 memcpy( pdst, audio_codec.spk_roff, half_size << 1 );
689 audio_codec.spk_roff += half_size;
690 audio_codec.spk_rtotal += half_size;
691 if( audio_codec.spk_roff >= audio_codec.spk_rend )
692 {
693 audio_codec.spk_roff = audio_codec.spk_buffer;
694 }
695 if( ++audio_codec.spk_calc == 256 )
696 {
697 uint16_t delta = audio_codec.spk_wtotal - audio_codec.spk_rtotal;
698 audio_codec.spk_calc = 0;
699 if( delta < audio_codec.spk_threshold - half_size )
700 {
701 audio_codec.spk_threshold -= half_size;
702 audio_codec.spk_freq += audio_codec.audio_freq/1024;
703 }
704 else if( delta > audio_codec.spk_threshold + half_size )
705 {
706 audio_codec.spk_threshold += half_size;
707 audio_codec.spk_freq -= audio_codec.audio_freq/1024;
708 }
709 if(audio_codec.spk_rtotal > 0x20000000)
710 {
711 audio_codec.spk_rtotal -= 0x10000000;
712 audio_codec.spk_wtotal -= 0x10000000;
713 }
714 }
715 }
716 break;
717 }
718
719}
720
726void DMA1_Channel4_IRQHandler(void)
727{
728 uint16_t *psrc;
729 uint16_t len = audio_codec.mic_rx_size << 1;
730
731 if(dma_flag_get(DMA1_HDT4_FLAG) == SET)
732 {
733 dma_flag_clear(DMA1_HDT4_FLAG);
734 psrc = mic_dma_buffer;
735 }
736 else if(dma_flag_get(DMA1_FDT4_FLAG) == SET)
737 {
738 psrc = mic_dma_buffer + audio_codec.mic_rx_size;
739 dma_flag_clear(DMA1_FDT4_FLAG);
740 }
741 if( audio_codec.mic_stage )
742 {
743 memcpy( audio_codec.mic_woff, psrc, len );
744 audio_codec.mic_woff += len/2;
745 audio_codec.mic_wtotal += len/2;
746 if( audio_codec.mic_woff >= audio_codec.mic_wend )
747 {
748 audio_codec.mic_woff = audio_codec.mic_buffer;
749 }
750 if( audio_codec.mic_stage == 2 )
751 {
752 if( 1024 == ++audio_codec.mic_calc )
753 {
754 uint32_t size_estimate = 1024*audio_codec.mic_rx_size;
755 audio_codec.mic_calc = 0;
756 if( audio_codec.mic_delta > size_estimate )
757 {
758 audio_codec.mic_adj_count = audio_codec.mic_delta - size_estimate;
759 audio_codec.mic_adj_stage = 2;
760 }
761 else if( audio_codec.mic_delta < size_estimate )
762 {
763 audio_codec.mic_adj_count = size_estimate - audio_codec.mic_delta;
764 audio_codec.mic_adj_stage = 1;
765 }
766 else
767 {
768 audio_codec.mic_adj_count = 0;
769 audio_codec.mic_adj_stage = 0;
770 }
771 audio_codec.mic_delta = 0;
772 if( audio_codec.mic_rtotal >= 0x80000000 )
773 {
774 audio_codec.mic_rtotal -= 0x80000000;
775 audio_codec.mic_wtotal -= 0x80000000;
776 }
777 }
778 if( audio_codec.mic_wtotal >= audio_codec.mic_rtotal + MIC_BUFFER_SIZE )
779 {
780 audio_codec.mic_delta = audio_codec.mic_wtotal = audio_codec.mic_rtotal = 0;
781 audio_codec.mic_woff = audio_codec.mic_roff = audio_codec.mic_buffer;
782 audio_codec.mic_stage = 0;
783 audio_codec.mic_adj_stage = 0;
784 audio_codec.mic_adj_count = 0;
785 audio_codec.mic_calc = 0;
786 }
787 }
788 }
789}
790
796 error_status audio_codec_init(void)
797{
798 uint32_t reg_len = sizeof(reg_addr_data) / sizeof(uint16_t);
799 uint32_t i_index = 0;
800 uint8_t i2c_cmd[2];
801
802 if(AUDIO_DEFAULT_FREQ == AUDIO_FREQ_16K)
803 {
804 reg_addr_data[6] = WM8988_REG_FREQ16K;
805 audio_codec.audio_freq = AUDIO_FREQ_16K;
806 }
807 else if(AUDIO_DEFAULT_FREQ == AUDIO_FREQ_48K)
808 {
809 reg_addr_data[6] = WM8988_REG_FREQ48K;
810 audio_codec.audio_freq = AUDIO_FREQ_48K;
811 }
812 else
813 {
814 return ERROR;
815 }
816
817 if(AUDIO_DEFAULT_BITW == AUDIO_BITW_16)
818 {
819 reg_addr_data[5] = WM8988_REG_BITW16;
820 audio_codec.audio_bitw = AUDIO_BITW_16;
821 }
822 else
823 {
824 return ERROR;
825 }
826
827 /* i2c init */
828 hi2cx.i2cx = I2Cx_PORT;
829
830 i2c_config(&hi2cx);
831
832 for(i_index = 0; i_index < reg_len; i_index ++)
833 {
834 i2c_cmd[0] = (uint8_t)(reg_addr_data[i_index] >> 8);
835 i2c_cmd[1] = (uint8_t)reg_addr_data[i_index] & 0xFF;
836 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
837 {
838 return ERROR;
839 }
840 }
841
842 /* timer init */
843 mclk_tmr1_init();
844
845 codec_i2s_init(&audio_codec);
846
847 return SUCCESS;
848}
849
855 error_status audio_codec_loop(void)
856{
857 static uint8_t mic_mute = 0;
858 static uint16_t mic_volume = 0;
859 static uint8_t spk_mute = 0;
860 static uint16_t spk_volume = 0;
861 uint16_t audio_ctrl_l;
862 uint16_t audio_ctrl_r;
863 uint8_t i2c_cmd[2];
864
865 if(mic_mute != audio_codec.mic_mute)
866 {
867 mic_mute = audio_codec.mic_mute;
868 audio_ctrl_l = WM8988_R21_LEFT_ADC_VOLUME << 9 | 0x100;
869 audio_ctrl_r = WM8988_R22_RIGHT_ADC_VOLUME << 9 | 0x100;
870 if(audio_codec.mic_mute == 0)
871 {
872 audio_ctrl_l |= audio_codec.mic_volume;
873 audio_ctrl_r |= audio_codec.mic_volume;
874 }
875 i2c_cmd[0] = (uint8_t)(audio_ctrl_l >> 8);
876 i2c_cmd[1] = (uint8_t)audio_ctrl_l & 0xFF;
877 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
878 {
879 return ERROR;
880 }
881 i2c_cmd[0] = (uint8_t)(audio_ctrl_r >> 8);
882 i2c_cmd[1] = (uint8_t)audio_ctrl_r & 0xFF;
883 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
884 {
885 return ERROR;
886 }
887 }
888
889 if(mic_volume != audio_codec.mic_volume)
890 {
891 mic_volume = audio_codec.mic_volume;
892 audio_ctrl_l = WM8988_R21_LEFT_ADC_VOLUME << 9 | 0x100;
893 audio_ctrl_r = WM8988_R22_RIGHT_ADC_VOLUME << 9 | 0x100;
894 audio_ctrl_l |= audio_codec.mic_volume;
895 audio_ctrl_r |= audio_codec.mic_volume;
896 i2c_cmd[0] = (uint8_t)(audio_ctrl_l >> 8);
897 i2c_cmd[1] = (uint8_t)audio_ctrl_l & 0xFF;
898 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
899 {
900 return ERROR;
901 }
902 i2c_cmd[0] = (uint8_t)(audio_ctrl_r >> 8);
903 i2c_cmd[1] = (uint8_t)audio_ctrl_r & 0xFF;
904 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
905 {
906 return ERROR;
907 }
908 }
909
910 if(spk_mute != audio_codec.spk_mute)
911 {
912 spk_mute = audio_codec.spk_mute;
913 audio_ctrl_l = (WM8988_R5_ADC_DAC_CONTROL << 9) | 0x0006 | (audio_codec.spk_mute << 3);
914 i2c_cmd[0] = (uint8_t)(audio_ctrl_l >> 8);
915 i2c_cmd[1] = (uint8_t)audio_ctrl_l & 0xFF;
916 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
917 {
918 return ERROR;
919 }
920 }
921
922 if(spk_volume != audio_codec.spk_volume)
923 {
924 spk_volume = audio_codec.spk_volume;
925 audio_ctrl_l = WM8988_R2_LOUT1_VOLUME << 9 | 0x100;
926 audio_ctrl_r = WM8988_R3_ROUT1_VOLUME << 9 | 0x100;
927 audio_ctrl_l |= audio_codec.spk_volume;
928 audio_ctrl_r |= audio_codec.spk_volume;
929
930 i2c_cmd[0] = (uint8_t)(audio_ctrl_l >> 8);
931 i2c_cmd[1] = (uint8_t)audio_ctrl_l & 0xFF;
932
933 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
934 {
935 return ERROR;
936 }
937 i2c_cmd[0] = (uint8_t)(audio_ctrl_r >> 8);
938 i2c_cmd[1] = (uint8_t)audio_ctrl_r & 0xFF;
939 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
940 {
941 return ERROR;
942 }
943 }
944 return SUCCESS;
945}
946
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:38
reg_addr_data
uint16_t reg_addr_data[]
wm8988 register default value
Definition: audio/src/audio_codec.c:71
audio_codec_mic_alt_setting
void audio_codec_mic_alt_setting(uint32_t alt_seting)
audio codec microphone alt setting config
Definition: audio/src/audio_codec.c:169
codec_i2s_reset
void codec_i2s_reset(void)
audio codec i2s reset
Definition: audio/src/audio_codec.c:479
spk_dma_buffer
uint16_t spk_dma_buffer[DMA_BUFFER_SIZE]
Definition: audio/src/audio_codec.c:107
audio_codec_set_spk_volume
void audio_codec_set_spk_volume(uint16_t volume)
audio codec set speaker volume
Definition: audio/src/audio_codec.c:217
audio_codec_set_spk_mute
void audio_codec_set_spk_mute(uint8_t mute)
audio codec set speaker mute
Definition: audio/src/audio_codec.c:195
WM8988_REG_FREQ48K
#define WM8988_REG_FREQ48K
wm8988 freq
Definition: audio/src/audio_codec.c:60
audio_codec_set_mic_freq
void audio_codec_set_mic_freq(uint32_t freq)
audio codec set microphone freq
Definition: audio/src/audio_codec.c:121
I2Cx_ADDRESS
#define I2Cx_ADDRESS
Definition: audio/src/audio_codec.c:44
I2Cx_SDA_GPIO_PIN
#define I2Cx_SDA_GPIO_PIN
Definition: audio/src/audio_codec.c:54
I2Cx_CLK
#define I2Cx_CLK
Definition: audio/src/audio_codec.c:47
audio_codec_mic_get_data
uint32_t audio_codec_mic_get_data(uint8_t *buffer)
codec microphone get data
Definition: audio/src/audio_codec.c:282
WM8988_REG_BITW16
#define WM8988_REG_BITW16
wm8988 bit width
Definition: audio/src/audio_codec.c:66
audio_codec_loop
error_status audio_codec_loop(void)
audio codec loop
Definition: audio/src/audio_codec.c:855
codec_i2s_init
void codec_i2s_init(audio_codec_type *param)
audio codec i2s init
Definition: audio/src/audio_codec.c:493
audio_codec_set_mic_mute
void audio_codec_set_mic_mute(uint8_t mute)
audio codec set microphone mute
Definition: audio/src/audio_codec.c:184
audio_codec_spk_fifo_write
void audio_codec_spk_fifo_write(uint8_t *data, uint32_t len)
codec speaker write fifo
Definition: audio/src/audio_codec.c:244
mic_dma_buffer
uint16_t mic_dma_buffer[DMA_BUFFER_SIZE]
Definition: audio/src/audio_codec.c:108
audio_codec_spk_feedback
uint8_t audio_codec_spk_feedback(uint8_t *feedback)
codec speaker feedback
Definition: audio/src/audio_codec.c:228
hi2cx
i2c_handle_type hi2cx
Definition: audio/src/audio_codec.c:104
DMA1_Channel4_IRQHandler
void DMA1_Channel4_IRQHandler(void)
this function handles dma1 channel4 interrupt.
Definition: audio/src/audio_codec.c:726
audio_codec_modify_freq
void audio_codec_modify_freq(uint32_t freq)
audio codec modify freq
Definition: audio/src/audio_codec.c:342
I2Cx_SDA_GPIO_PORT
#define I2Cx_SDA_GPIO_PORT
Definition: audio/src/audio_codec.c:55
audio_codec_set_mic_volume
void audio_codec_set_mic_volume(uint16_t volume)
audio codec set microphone volume
Definition: audio/src/audio_codec.c:206
mclk_tmr1_init
void mclk_tmr1_init(void)
mclk clock conifg
Definition: audio/src/audio_codec.c:437
DMA1_Channel3_IRQHandler
void DMA1_Channel3_IRQHandler(void)
this function handles dma1 channel3 interrupt.
Definition: audio/src/audio_codec.c:651
I2Cx_SDA_GPIO_CLK
#define I2Cx_SDA_GPIO_CLK
Definition: audio/src/audio_codec.c:53
audio_codec
audio_codec_type audio_codec
Definition: audio/src/audio_codec.c:106
audio_codec_spk_alt_setting
void audio_codec_spk_alt_setting(uint32_t alt_seting)
audio codec speaker alt setting config
Definition: audio/src/audio_codec.c:154
i2c_lowlevel_init
void i2c_lowlevel_init(i2c_handle_type *hi2c)
initializes peripherals used by the i2c.
Definition: audio/src/audio_codec.c:399
I2Cx_SPEED
#define I2Cx_SPEED
Definition: audio/src/audio_codec.c:43
audio_codec_init
error_status audio_codec_init(void)
audio codec init
Definition: audio/src/audio_codec.c:796
WM8988_REG_FREQ16K
#define WM8988_REG_FREQ16K
Definition: audio/src/audio_codec.c:61
copy_buff
void copy_buff(uint16_t *dest, uint16_t *src, uint32_t len)
copy buffer
Definition: audio/src/audio_codec.c:385
memset16_buffer
void memset16_buffer(uint16_t *buffer, uint32_t set, uint32_t len)
buffer memset
Definition: audio/src/audio_codec.c:369
I2Cx_PORT
#define I2Cx_PORT
Definition: audio/src/audio_codec.c:46
audio_codec_set_spk_freq
void audio_codec_set_spk_freq(uint32_t freq)
audio codec set speaker freq
Definition: audio/src/audio_codec.c:137
I2Cx_SCL_GPIO_PIN
#define I2Cx_SCL_GPIO_PIN
Definition: audio/src/audio_codec.c:50
I2Cx_SCL_GPIO_CLK
#define I2Cx_SCL_GPIO_CLK
Definition: audio/src/audio_codec.c:49
I2Cx_SCL_GPIO_PORT
#define I2Cx_SCL_GPIO_PORT
Definition: audio/src/audio_codec.c:51
i2c_config
void i2c_config(i2c_handle_type *hi2c)
i2c peripheral initialization.
Definition: i2c_application.c:102
i2c_master_transmit
i2c_status_type i2c_master_transmit(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through polling mode.
Definition: i2c_application.c:402
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_SPI2_PERIPH_CLOCK
@ CRM_SPI2_PERIPH_CLOCK
Definition: at32f415_crm.h:129
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_SPI1_PERIPH_CLOCK
@ CRM_SPI1_PERIPH_CLOCK
Definition: at32f415_crm.h:117
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
DMA1_Channel3_IRQn
@ DMA1_Channel3_IRQn
Definition: at32f415.h:148
DMA1_Channel4_IRQn
@ DMA1_Channel4_IRQn
Definition: at32f415.h:149
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_interrupt_enable
void dma_interrupt_enable(dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt
Definition: at32f415_dma.c:165
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_HIGH
@ DMA_PRIORITY_HIGH
Definition: at32f415_dma.h:260
DMA1_HDT4_FLAG
#define DMA1_HDT4_FLAG
Definition: at32f415_dma.h:95
DMA1_HDT3_FLAG
#define DMA1_HDT3_FLAG
Definition: at32f415_dma.h:91
DMA1_FDT4_FLAG
#define DMA1_FDT4_FLAG
Definition: at32f415_dma.h:94
DMA1_FDT3_FLAG
#define DMA1_FDT3_FLAG
Definition: at32f415_dma.h:90
DMA_FDT_INT
#define DMA_FDT_INT
Definition: at32f415_dma.h:52
DMA_HDT_INT
#define DMA_HDT_INT
Definition: at32f415_dma.h:53
DMA1_CHANNEL3
#define DMA1_CHANNEL3
Definition: at32f415_dma.h:475
DMA1_CHANNEL4
#define DMA1_CHANNEL4
Definition: at32f415_dma.h:476
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_pin_remap_config
void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration.
Definition: at32f415_gpio.c:521
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_MODERATE
@ GPIO_DRIVE_STRENGTH_MODERATE
Definition: at32f415_gpio.h:240
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_OPEN_DRAIN
@ GPIO_OUTPUT_OPEN_DRAIN
Definition: at32f415_gpio.h:250
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
i2c_own_address1_set
void i2c_own_address1_set(i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address)
config own address1.
Definition: at32f415_i2c.c:185
i2c_init
void i2c_init(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed)
init i2c speed and duty cycle.
Definition: at32f415_i2c.c:90
I2C_FSMODE_DUTY_2_1
@ I2C_FSMODE_DUTY_2_1
Definition: at32f415_i2c.h:148
I2C_ADDRESS_MODE_7BIT
@ I2C_ADDRESS_MODE_7BIT
Definition: at32f415_i2c.h:157
I2C_OK
@ I2C_OK
Definition: i2c_application.h:82
I2C1_MUX
#define I2C1_MUX
Definition: at32f415_gpio.h:82
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
i2s_init
void i2s_init(spi_type *spi_x, i2s_init_type *i2s_init_struct)
i2s init config with its setting value.
Definition: at32f415_spi.c:316
spi_i2s_dma_receiver_enable
void spi_i2s_dma_receiver_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma receiver mode.
Definition: at32f415_spi.c:499
i2s_enable
void i2s_enable(spi_type *spi_x, confirm_state new_state)
enable or disable i2s.
Definition: at32f415_spi.c:445
spi_i2s_reset
void spi_i2s_reset(spi_type *spi_x)
spi reset by crm reset register
Definition: at32f415_spi.c:51
i2s_default_para_init
void i2s_default_para_init(i2s_init_type *i2s_init_struct)
i2s init config with its default value.
Definition: at32f415_spi.c:298
spi_i2s_dma_transmitter_enable
void spi_i2s_dma_transmitter_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma transmitter mode.
Definition: at32f415_spi.c:485
i2s_data_channel_format_type
i2s_data_channel_format_type
i2s data bit num and channel bit num type
Definition: at32f415_spi.h:226
i2s_audio_sampling_freq_type
i2s_audio_sampling_freq_type
i2s audio frequency type
Definition: at32f415_spi.h:209
I2S_CLOCK_POLARITY_LOW
@ I2S_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:249
I2S_DATA_16BIT_CHANNEL_16BIT
@ I2S_DATA_16BIT_CHANNEL_16BIT
Definition: at32f415_spi.h:227
I2S_DATA_24BIT_CHANNEL_32BIT
@ I2S_DATA_24BIT_CHANNEL_32BIT
Definition: at32f415_spi.h:229
I2S_AUDIO_PROTOCOL_PHILLIPS
@ I2S_AUDIO_PROTOCOL_PHILLIPS
Definition: at32f415_spi.h:198
I2S_MODE_SLAVE_RX
@ I2S_MODE_SLAVE_RX
Definition: at32f415_spi.h:239
I2S_MODE_SLAVE_TX
@ I2S_MODE_SLAVE_TX
Definition: at32f415_spi.h:238
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_output_enable
void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable
Definition: at32f415_tmr.c:1382
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_output_channel_buffer_enable
void tmr_output_channel_buffer_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
enable tmr output channel buffer
Definition: at32f415_tmr.c:587
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_PWM_MODE_A
@ TMR_OUTPUT_CONTROL_PWM_MODE_A
Definition: at32f415_tmr.h:179
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
MIC_BUFFER_SIZE
#define MIC_BUFFER_SIZE
Definition: audio/inc/audio_codec.h:130
SPK_BUFFER_SIZE
#define SPK_BUFFER_SIZE
Definition: audio/inc/audio_codec.h:131
DMA_BUFFER_SIZE
#define DMA_BUFFER_SIZE
Definition: audio/inc/audio_codec.h:132
I2S2_DT_ADDRESS
#define I2S2_DT_ADDRESS
Definition: audio/inc/audio_codec.h:119
I2S1_SD_PIN
#define I2S1_SD_PIN
Definition: audio/inc/audio_codec.h:105
I2S1_CK_PIN
#define I2S1_CK_PIN
Definition: audio/inc/audio_codec.h:104
I2S2_GPIO
#define I2S2_GPIO
Definition: audio/inc/audio_codec.h:117
I2S2_SD_PIN
#define I2S2_SD_PIN
Definition: audio/inc/audio_codec.h:114
I2S2_WS_PIN
#define I2S2_WS_PIN
Definition: audio/inc/audio_codec.h:112
I2S2_GPIO_CRM_CLK
#define I2S2_GPIO_CRM_CLK
Definition: audio/inc/audio_codec.h:118
I2S1_DT_ADDRESS
#define I2S1_DT_ADDRESS
Definition: audio/inc/audio_codec.h:109
I2S1_GPIO_CRM_CLK
#define I2S1_GPIO_CRM_CLK
Definition: audio/inc/audio_codec.h:108
I2S1_WS_PIN
#define I2S1_WS_PIN
Definition: audio/inc/audio_codec.h:103
I2S1_GPIO
#define I2S1_GPIO
Definition: audio/inc/audio_codec.h:107
I2S2_CK_PIN
#define I2S2_CK_PIN
Definition: audio/inc/audio_codec.h:113
WM8988_R27_ADDITIONAL_3_CONTROL
#define WM8988_R27_ADDITIONAL_3_CONTROL
Definition: audio/inc/audio_codec.h:77
WM8988_I2C_ADDR_CSB_LOW
#define WM8988_I2C_ADDR_CSB_LOW
Definition: audio/inc/audio_codec.h:93
WM8988_R10_LEFT_DAC_VOLUME
#define WM8988_R10_LEFT_DAC_VOLUME
Definition: audio/inc/audio_codec.h:60
WM8988_R1_RIGHT_INPUT_VOLUME
#define WM8988_R1_RIGHT_INPUT_VOLUME
Definition: audio/inc/audio_codec.h:51
WM8988_R3_ROUT1_VOLUME
#define WM8988_R3_ROUT1_VOLUME
Definition: audio/inc/audio_codec.h:53
WM8988_R36_RIGHT_OUT_MIX_1
#define WM8988_R36_RIGHT_OUT_MIX_1
Definition: audio/inc/audio_codec.h:84
WM8988_R21_LEFT_ADC_VOLUME
#define WM8988_R21_LEFT_ADC_VOLUME
Definition: audio/inc/audio_codec.h:71
WM8988_R31_ADC_INPUT_MODE
#define WM8988_R31_ADC_INPUT_MODE
Definition: audio/inc/audio_codec.h:79
WM8988_R13_TREBLE_CONTROL
#define WM8988_R13_TREBLE_CONTROL
Definition: audio/inc/audio_codec.h:63
WM8988_R16_3D_CONTROL
#define WM8988_R16_3D_CONTROL
Definition: audio/inc/audio_codec.h:66
WM8988_R22_RIGHT_ADC_VOLUME
#define WM8988_R22_RIGHT_ADC_VOLUME
Definition: audio/inc/audio_codec.h:72
WM8988_R0_LEFT_INPUT_VOLUME
#define WM8988_R0_LEFT_INPUT_VOLUME
Definition: audio/inc/audio_codec.h:50
WM8988_R23_ADDITIONAL_1_CONTROL
#define WM8988_R23_ADDITIONAL_1_CONTROL
Definition: audio/inc/audio_codec.h:73
WM8988_R35_LEFT_OUT_MIX_2
#define WM8988_R35_LEFT_OUT_MIX_2
Definition: audio/inc/audio_codec.h:83
WM8988_R43_LOW_POWER_PALYBACK
#define WM8988_R43_LOW_POWER_PALYBACK
Definition: audio/inc/audio_codec.h:91
WM8988_R32_ADC_L_SIGNAL_PATH
#define WM8988_R32_ADC_L_SIGNAL_PATH
Definition: audio/inc/audio_codec.h:80
WM8988_R26_PWR_2_MGMT
#define WM8988_R26_PWR_2_MGMT
Definition: audio/inc/audio_codec.h:76
WM8988_R11_RIGHT_DAC_VOLUME
#define WM8988_R11_RIGHT_DAC_VOLUME
Definition: audio/inc/audio_codec.h:61
WM8988_R24_ADDITIONAL_2_CONTROL
#define WM8988_R24_ADDITIONAL_2_CONTROL
Definition: audio/inc/audio_codec.h:74
WM8988_R40_LOUT2_VOLUME
#define WM8988_R40_LOUT2_VOLUME
Definition: audio/inc/audio_codec.h:88
WM8988_R34_LEFT_OUT_MIX_1
#define WM8988_R34_LEFT_OUT_MIX_1
Definition: audio/inc/audio_codec.h:82
WM8988_R5_ADC_DAC_CONTROL
#define WM8988_R5_ADC_DAC_CONTROL
Definition: audio/inc/audio_codec.h:55
WM8988_R25_PWR_1_MGMT
#define WM8988_R25_PWR_1_MGMT
Definition: audio/inc/audio_codec.h:75
WM8988_R41_ROUT2_VOLUME
#define WM8988_R41_ROUT2_VOLUME
Definition: audio/inc/audio_codec.h:89
WM8988_R2_LOUT1_VOLUME
#define WM8988_R2_LOUT1_VOLUME
Definition: audio/inc/audio_codec.h:52
WM8988_R37_RIGHT_OUT_MIX_2
#define WM8988_R37_RIGHT_OUT_MIX_2
Definition: audio/inc/audio_codec.h:85
WM8988_R33_ADC_R_SIGNAL_PATH
#define WM8988_R33_ADC_R_SIGNAL_PATH
Definition: audio/inc/audio_codec.h:81
WM8988_R12_BASS_CONTROL
#define WM8988_R12_BASS_CONTROL
Definition: audio/inc/audio_codec.h:62
AUDIO_BITW_16
#define AUDIO_BITW_16
Definition: audio/audio_conf.h:61
AUDIO_MIC_CHANEL_NUM
#define AUDIO_MIC_CHANEL_NUM
Definition: audio/audio_conf.h:63
AUDIO_DEFAULT_FREQ
#define AUDIO_DEFAULT_FREQ
Definition: audio/audio_conf.h:71
AUDIO_FREQ_16K
#define AUDIO_FREQ_16K
Definition: audio/audio_conf.h:59
AUDIO_SPK_CHANEL_NUM
#define AUDIO_SPK_CHANEL_NUM
Definition: audio/audio_conf.h:66
AUDIO_DEFAULT_BITW
#define AUDIO_DEFAULT_BITW
Definition: audio/audio_conf.h:72
AUDIO_FREQ_48K
#define AUDIO_FREQ_48K
Definition: audio/audio_conf.h:60
i2c_application.h
i2c application libray header file
audio_codec_type
Definition: audio/inc/audio_codec.h:135
audio_codec_type::spk_mute
uint8_t spk_mute
Definition: audio/inc/audio_codec.h:164
audio_codec_type::spk_threshold
uint16_t spk_threshold
Definition: audio/inc/audio_codec.h:146
audio_codec_type::spk_stage
uint8_t spk_stage
Definition: audio/inc/audio_codec.h:148
audio_codec_type::mic_roff
uint16_t * mic_roff
Definition: audio/inc/audio_codec.h:152
audio_codec_type::spk_buffer
uint16_t spk_buffer[4096]
Definition: audio/inc/audio_codec.h:139
audio_codec_type::mic_volume
uint16_t mic_volume
Definition: audio/inc/audio_codec.h:166
audio_codec_type::spk_roff
uint16_t * spk_roff
Definition: audio/inc/audio_codec.h:140
audio_codec_type::spk_rtotal
uint32_t spk_rtotal
Definition: audio/inc/audio_codec.h:145
audio_codec_type::mic_delta
uint32_t mic_delta
Definition: audio/inc/audio_codec.h:157
audio_codec_type::spk_calc
uint16_t spk_calc
Definition: audio/inc/audio_codec.h:147
audio_codec_type::mic_woff
uint16_t * mic_woff
Definition: audio/inc/audio_codec.h:153
audio_codec_type::mic_stage
uint8_t mic_stage
Definition: audio/inc/audio_codec.h:161
audio_codec_type::mic_adj_count
uint16_t mic_adj_count
Definition: audio/inc/audio_codec.h:159
audio_codec_type::spk_freq
uint32_t spk_freq
Definition: audio/inc/audio_codec.h:143
audio_codec_type::audio_bitw
uint32_t audio_bitw
Definition: audio/inc/audio_codec.h:137
audio_codec_type::mic_wend
uint16_t * mic_wend
Definition: audio/inc/audio_codec.h:154
audio_codec_type::spk_rend
uint16_t * spk_rend
Definition: audio/inc/audio_codec.h:142
audio_codec_type::mic_wtotal
uint32_t mic_wtotal
Definition: audio/inc/audio_codec.h:155
audio_codec_type::mic_rtotal
uint32_t mic_rtotal
Definition: audio/inc/audio_codec.h:156
audio_codec_type::audio_freq
uint32_t audio_freq
Definition: audio/inc/audio_codec.h:136
audio_codec_type::mic_mute
uint8_t mic_mute
Definition: audio/inc/audio_codec.h:163
audio_codec_type::spk_volume
uint16_t spk_volume
Definition: audio/inc/audio_codec.h:167
audio_codec_type::mic_calc
uint16_t mic_calc
Definition: audio/inc/audio_codec.h:158
audio_codec_type::spk_wtotal
uint32_t spk_wtotal
Definition: audio/inc/audio_codec.h:144
audio_codec_type::mic_adj_stage
uint8_t mic_adj_stage
Definition: audio/inc/audio_codec.h:160
audio_codec_type::spk_tx_size
uint32_t spk_tx_size
Definition: audio/inc/audio_codec.h:169
audio_codec_type::mic_rx_size
uint32_t mic_rx_size
Definition: audio/inc/audio_codec.h:170
audio_codec_type::spk_woff
uint16_t * spk_woff
Definition: audio/inc/audio_codec.h:141
audio_codec_type::mic_buffer
uint16_t mic_buffer[1024]
Definition: audio/inc/audio_codec.h:151
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
i2c_handle_type
Definition: i2c_application.h:114
i2c_handle_type::i2cx
i2c_type * i2cx
Definition: i2c_application.h:115
i2s_init_type
i2s init type
Definition: at32f415_spi.h:272
i2s_init_type::audio_sampling_freq
i2s_audio_sampling_freq_type audio_sampling_freq
Definition: at32f415_spi.h:275
i2s_init_type::data_channel_format
i2s_data_channel_format_type data_channel_format
Definition: at32f415_spi.h:276
i2s_init_type::mclk_output_enable
confirm_state mclk_output_enable
Definition: at32f415_spi.h:278
i2s_init_type::audio_protocol
i2s_audio_protocol_type audio_protocol
Definition: at32f415_spi.h:274
i2s_init_type::operation_mode
i2s_operation_mode_type operation_mode
Definition: at32f415_spi.h:273
i2s_init_type::clock_polarity
i2s_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:277
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402


AT32F415 Firmwary Library: audio_class.c Source File

  • middlewares
  • usbd_class
  • audio
audio_class.c
Go to the documentation of this file.
1
26#include "usbd_core.h"
27#include "audio_class.h"
28#include "audio_desc.h"
29#include "audio_codec.h"
30
44 usb_sts_type class_init_handler(void *udev);
45 usb_sts_type class_clear_handler(void *udev);
46 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup);
47 usb_sts_type class_ept0_tx_handler(void *udev);
48 usb_sts_type class_ept0_rx_handler(void *udev);
49 usb_sts_type class_in_handler(void *udev, uint8_t ept_num);
50 usb_sts_type class_out_handler(void *udev, uint8_t ept_num);
51 usb_sts_type class_sof_handler(void *udev);
52 usb_sts_type class_event_handler(void *udev, usbd_event_type event);
53
54void audio_inisoincom_event(void *udev);
55void audio_req_get_cur(void *udev, usb_setup_type *setup);
56void audio_req_set_cur(void *udev, usb_setup_type *setup);
57void audio_req_get_min(void *udev, usb_setup_type *setup);
58void audio_req_get_max(void *udev, usb_setup_type *setup);
59void audio_req_get_res(void *udev, usb_setup_type *setup);
60void audio_get_interface(void *udev, usb_setup_type *setup);
61void audio_set_interface(void *udev, usb_setup_type *setup);
62
63 usb_audio_type audio_struct = {0, 0, 0, 0, 0, 0x1400, 0, 0, 0, {0x0000, 0x1400, 0x33}, {0x0000, 0x1400, 0x33}};
64
65static __IO uint16_t audio_feedback_state = 0;
66static __IO uint8_t audio_spk_out_stage = 0;
67/* usb device class handler */
68usbd_class_handler audio_class_handler =
69{
70 class_init_handler,
71 class_clear_handler,
72 class_setup_handler,
73 class_ept0_tx_handler,
74 class_ept0_rx_handler,
75 class_in_handler,
76 class_out_handler,
77 class_sof_handler,
78 class_event_handler,
79};
80
86 usb_sts_type class_init_handler(void *udev)
87{
88 usb_sts_type status = USB_OK;
89 usbd_core_type *pudev = (usbd_core_type *)udev;
90
91 /* open microphone in endpoint */
92 usbd_ept_open(pudev, USBD_AUDIO_MIC_IN_EPT, EPT_ISO_TYPE, AUDIO_MIC_IN_MAXPACKET_SIZE);
93
94 /* open speaker out endpoint */
95 usbd_ept_open(pudev, USBD_AUDIO_SPK_OUT_EPT, EPT_ISO_TYPE, AUDIO_SPK_OUT_MAXPACKET_SIZE);
96#if AUDIO_SUPPORT_FEEDBACK
97 /* open speaker feedback endpoint */
98 usbd_ept_open(pudev, USBD_AUDIO_FEEDBACK_EPT, EPT_ISO_TYPE, AUDIO_FEEDBACK_MAXPACKET_SIZE);
99#endif
100 /* start receive speaker out data */
101 usbd_ept_recv(pudev, USBD_AUDIO_SPK_OUT_EPT, audio_struct.audio_spk_data, AUDIO_SPK_OUT_MAXPACKET_SIZE);
102
103 return status;
104}
105
111 usb_sts_type class_clear_handler(void *udev)
112{
113 usb_sts_type status = USB_OK;
114 usbd_core_type *pudev = (usbd_core_type *)udev;
115
116 /* close in endpoint */
117 usbd_ept_close(pudev, USBD_AUDIO_MIC_IN_EPT);
118
119#if AUDIO_SUPPORT_FEEDBACK
120 /* close in endpoint */
121 usbd_ept_close(pudev, USBD_AUDIO_FEEDBACK_EPT);
122#endif
123
124 /* close out endpoint */
125 usbd_ept_close(pudev, USBD_AUDIO_SPK_OUT_EPT);
126
127 return status;
128}
129
136 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
137{
138 usb_sts_type status = USB_OK;
139 usbd_core_type *pudev = (usbd_core_type *)udev;
140 uint16_t len;
141
142 switch(setup->bmRequestType & USB_REQ_TYPE_RESERVED)
143 {
144 /* class request */
145 case USB_REQ_TYPE_CLASS:
146 switch(setup->bRequest)
147 {
148 case AUDIO_REQ_GET_CUR:
149 audio_req_get_cur(pudev, setup);
150 break;
151
152 case AUDIO_REQ_SET_CUR:
153 audio_req_set_cur(pudev, setup);
154 break;
155
156 case AUDIO_REQ_GET_MIN:
157 audio_req_get_min(pudev, setup);
158 break;
159
160 case AUDIO_REQ_GET_MAX:
161 audio_req_get_max(pudev, setup);
162 break;
163
164 case AUDIO_REQ_GET_RES:
165 audio_req_get_res(pudev, setup);
166 break;
167
168 default:
169 usbd_ctrl_unsupport(pudev);
170 break;
171 }
172 break;
173 /* standard request */
174 case USB_REQ_TYPE_STANDARD:
175 switch(setup->bRequest)
176 {
177 case USB_STD_REQ_GET_DESCRIPTOR:
178 if((setup->wValue >> 8) == AUDIO_DESCRIPTOR_TYPE)
179 {
180 len = MIN(AUDIO_DESCRIPTOR_SIZE, setup->wLength);
181 usbd_ctrl_send(pudev, g_usbd_configuration+18, len);
182 }
183 else
184 {
185 usbd_ctrl_unsupport(pudev);
186 }
187 break;
188 case USB_STD_REQ_GET_INTERFACE:
189 audio_get_interface(udev, setup);
190 break;
191
192 case USB_STD_REQ_SET_INTERFACE:
193 audio_set_interface(udev, setup);
194 usbd_ctrl_send_status(pudev);
195 break;
196
197 default:
198 break;
199 }
200 break;
201
202 default:
203 usbd_ctrl_unsupport(pudev);
204 break;
205 }
206 return status;
207}
208
214 usb_sts_type class_ept0_tx_handler(void *udev)
215{
216 usb_sts_type status = USB_OK;
217
218 /* ...user code... */
219
220 return status;
221}
222
228 usb_sts_type class_ept0_rx_handler(void *udev)
229{
230 usb_sts_type status = USB_OK;
231 usbd_core_type *pudev = (usbd_core_type *)udev;
232 uint32_t recv_len = usbd_get_recv_len(pudev, 0);
233 /* ...user code... */
234 if( audio_struct.audio_cmd == AUDIO_REQ_SET_CUR)
235 {
236 /* class process */
237 switch(audio_struct.request_no)
238 {
239 case AUDIO_VOLUME_CONTROL:
240 if(audio_struct.interface == AUDIO_SPK_FEATURE_UNIT_ID)
241 {
242 audio_struct.spk_volume = (uint16_t)(audio_struct.g_audio_cur[0] |
243 (audio_struct.g_audio_cur[1] << 8));
244 /* set volume */
245 audio_codec_set_spk_volume(audio_struct.spk_volume*100/audio_struct.spk_volume_limits[1]);
246 }
247 else
248 {
249 audio_struct.mic_volume = (uint16_t)(audio_struct.g_audio_cur[0] |
250 (audio_struct.g_audio_cur[1] << 8));
251
252 audio_codec_set_mic_volume(audio_struct.mic_volume*256/audio_struct.mic_volume_limits[1]);
253 }
254 break;
255 case AUDIO_MUTE_CONTROL:
256 if(audio_struct.interface == AUDIO_SPK_FEATURE_UNIT_ID)
257 {
258 audio_struct.spk_mute = audio_struct.g_audio_cur[0];
259 audio_codec_set_spk_mute(audio_struct.spk_mute);
260 }
261 else
262 {
263 audio_struct.mic_mute = audio_struct.g_audio_cur[0];
264 audio_codec_set_mic_mute(audio_struct.mic_mute);
265 }
266
267 break;
268 case AUDIO_FREQ_SET_CONTROL:
269 if(audio_struct.enpd == USBD_AUDIO_MIC_IN_EPT)
270 {
271 audio_struct.mic_freq = (audio_struct.g_audio_cur[0] |
272 (audio_struct.g_audio_cur[1] << 8) |
273 (audio_struct.g_audio_cur[2] << 16));
274 audio_codec_set_mic_freq(audio_struct.mic_freq);
275 }
276 else
277 {
278 audio_struct.spk_freq = (audio_struct.g_audio_cur[0] |
279 (audio_struct.g_audio_cur[1] << 8) |
280 (audio_struct.g_audio_cur[2] << 16));
281 audio_codec_set_spk_freq(audio_struct.spk_freq);
282 }
283 break;
284 default:
285 break;
286 }
287 }
288
289 return status;
290}
291
298 usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
299{
300 usb_sts_type status = USB_OK;
301 uint32_t len = 0;
302
303 /* ...user code...
304 trans next packet data
305 */
306 if((ept_num & 0x7F) == (USBD_AUDIO_MIC_IN_EPT & 0x7F))
307 {
308 len = audio_codec_mic_get_data(audio_struct.audio_mic_data);
309 usbd_flush_tx_fifo(udev, USBD_AUDIO_MIC_IN_EPT);
310 usbd_ept_send(udev, USBD_AUDIO_MIC_IN_EPT, audio_struct.audio_mic_data, len);
311 }
312
313 else if((ept_num & 0x7F) == (USBD_AUDIO_FEEDBACK_EPT & 0x7F))
314 {
315 audio_feedback_state = 0;
316 }
317
318 return status;
319}
320
327 usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
328{
329 usb_sts_type status = USB_OK;
330 usbd_core_type *pudev = (usbd_core_type *)udev;
331 uint16_t g_rxlen;
332
333 /* get endpoint receive data length */
334 g_rxlen = usbd_get_recv_len(pudev, ept_num);
335
336 if((ept_num & 0x7F) == (USBD_AUDIO_SPK_OUT_EPT & 0x7F))
337 {
338 /* speaker data*/
339 audio_codec_spk_fifo_write(audio_struct.audio_spk_data, g_rxlen);
340 audio_spk_out_stage = 1;
341 /* get next data */
342 usbd_ept_recv(pudev, USBD_AUDIO_SPK_OUT_EPT, audio_struct.audio_spk_data, AUDIO_SPK_OUT_MAXPACKET_SIZE);
343 }
344
345 return status;
346}
347
353 usb_sts_type class_sof_handler(void *udev)
354{
355 usb_sts_type status = USB_OK;
356
357#if AUDIO_SUPPORT_FEEDBACK
358 if(audio_spk_out_stage & 2)
359 {
360 audio_spk_out_stage = 0;
361 }
362 else if( audio_spk_out_stage )
363 {
364 audio_spk_out_stage |= 2;
365
366 if( 0 == audio_feedback_state )
367 {
368 usbd_core_type *pudev = (usbd_core_type *)udev;
369 int len = audio_codec_spk_feedback(audio_struct.audio_feed_back);
370 usbd_ept_send(pudev, USBD_AUDIO_FEEDBACK_EPT, audio_struct.audio_feed_back, len);
371 audio_feedback_state = 1;
372 }
373 if( audio_feedback_state++ > (1<<FEEDBACK_REFRESH_TIME) ) //timeout
374 {
375 usbd_core_type *pudev = (usbd_core_type *)udev;
376 int len = audio_codec_spk_feedback(audio_struct.audio_feed_back);
377 usbd_flush_tx_fifo(pudev, USBD_AUDIO_FEEDBACK_EPT);
378 usbd_ept_send(pudev, USBD_AUDIO_FEEDBACK_EPT, audio_struct.audio_feed_back, len);
379 audio_feedback_state = 1;
380 }
381 }
382#endif
383 /* ...user code... */
384
385 return status;
386}
387
394 usb_sts_type class_event_handler(void *udev, usbd_event_type event)
395{
396 usb_sts_type status = USB_OK;
397 switch(event)
398 {
399 case USBD_RESET_EVENT:
400
401 /* ...user code... */
402
403 break;
404 case USBD_SUSPEND_EVENT:
405 audio_struct.spk_alt_setting = 0;
406 audio_codec_spk_alt_setting(audio_struct.spk_alt_setting);
407 audio_struct.mic_alt_setting = 0;
408 audio_codec_mic_alt_setting(audio_struct.spk_alt_setting);
409 /* ...user code... */
410
411 break;
412 case USBD_WAKEUP_EVENT:
413 /* ...user code... */
414
415 break;
416 case USBD_INISOINCOM_EVENT:
417 audio_inisoincom_event(udev);
418 break;
419
420 default:
421 break;
422 }
423 return status;
424}
425
431void audio_inisoincom_event(void *udev)
432{
433#if 0
434 usbd_core_type *pudev = (usbd_core_type *)udev;
435 uint32_t fnsof = OTG_DEVICE(pudev->usb_reg)->dsts_bit.soffn;
436 uint32_t epctl_fb = USB_INEPT(pudev->usb_reg, (USBD_AUDIO_FEEDBACK_EPT&0x7F))->diepctl_bit.dpid;
437 uint32_t epctl_in = USB_INEPT(pudev->usb_reg, (USBD_AUDIO_MIC_IN_EPT&0x7F))->diepctl_bit.dpid;
438 uint32_t len = 0;
439
440 if((fnsof & 0x1) == epctl_fb)
441 {
442 USB_INEPT(pudev->usb_reg, (USBD_AUDIO_FEEDBACK_EPT&0x7F))->diepctl_bit.eptdis = 1;
443 USB_INEPT(pudev->usb_reg, (USBD_AUDIO_FEEDBACK_EPT&0x7F))->diepctl_bit.snak = 1;
444 usb_flush_tx_fifo(pudev->usb_reg, USBD_AUDIO_FEEDBACK_EPT&0x7F);
445
446 usbd_ept_send(pudev, USBD_AUDIO_FEEDBACK_EPT, audio_struct.audio_feed_back, 3);
447 }
448
449 if((fnsof & 0x1) == epctl_in)
450 {
451 USB_INEPT(pudev->usb_reg, (USBD_AUDIO_MIC_IN_EPT&0x7F))->diepctl_bit.eptdis = 1;
452 USB_INEPT(pudev->usb_reg, (USBD_AUDIO_MIC_IN_EPT&0x7F))->diepctl_bit.snak = 1;
453 usb_flush_tx_fifo(pudev->usb_reg, USBD_AUDIO_MIC_IN_EPT&0x7F);
454
455 len = audio_codec_mic_get_data(audio_struct.audio_mic_data);
456 usbd_ept_send(pudev, USBD_AUDIO_MIC_IN_EPT, audio_struct.audio_mic_data, len);
457 }
458#endif
459}
460
467void audio_req_get_cur(void *udev, usb_setup_type *setup)
468{
469 usbd_core_type *pudev = (usbd_core_type *)udev;
470 if(HBYTE(setup->wIndex) == AUDIO_SPK_FEATURE_UNIT_ID)
471 {
472 if(HBYTE(setup->wValue) == AUDIO_MUTE_CONTROL)
473 {
474 audio_struct.g_audio_cur[0] = audio_struct.spk_mute;
475 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
476 }
477 else
478 {
479 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.spk_volume;
480 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
481 }
482 }
483 else
484 {
485 if(HBYTE(setup->wValue) == AUDIO_MUTE_CONTROL)
486 {
487 audio_struct.g_audio_cur[0] = audio_struct.mic_mute;
488 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
489 }
490 else
491 {
492 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.mic_volume;
493 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
494 }
495
496 }
497}
498
505void audio_req_set_cur(void *udev, usb_setup_type *setup)
506{
507 usbd_core_type *pudev = (usbd_core_type *)udev;
508 if(setup->wLength > 0)
509 {
510 usbd_ctrl_recv(pudev, audio_struct.g_audio_cur, setup->wLength);
511
512 audio_struct.audio_cmd = AUDIO_REQ_SET_CUR;
513 audio_struct.audio_cmd_len = setup->wLength;
514
515 switch(setup->bmRequestType & AUDIO_REQ_CONTROL_MASK)
516 {
517 case AUDIO_REQ_CONTROL_INTERFACE:
518 audio_struct.interface = HBYTE(setup->wIndex);
519 if(HBYTE(setup->wValue) == AUDIO_MUTE_CONTROL)
520 {
521 audio_struct.request_no = AUDIO_MUTE_CONTROL;
522 }
523 else
524 {
525 audio_struct.request_no = AUDIO_VOLUME_CONTROL;
526 }
527 break;
528 case AUDIO_REQ_CONTROL_ENDPOINT:
529 audio_struct.enpd = setup->wIndex;
530 audio_struct.request_no = AUDIO_FREQ_SET_CONTROL;
531 break;
532 default:
533 break;
534 }
535 }
536}
537
544void audio_req_get_min(void *udev, usb_setup_type *setup)
545{
546 usbd_core_type *pudev = (usbd_core_type *)udev;
547 if(HBYTE(setup->wIndex) == AUDIO_SPK_FEATURE_UNIT_ID)
548 {
549 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.spk_volume_limits[0];
550 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
551 }
552 else
553 {
554 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.mic_volume_limits[0];
555 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
556 }
557}
558
565void audio_req_get_max(void *udev, usb_setup_type *setup)
566{
567 usbd_core_type *pudev = (usbd_core_type *)udev;
568 if(HBYTE(setup->wIndex) == AUDIO_SPK_FEATURE_UNIT_ID)
569 {
570 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.spk_volume_limits[1];
571 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
572 }
573 else
574 {
575 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.mic_volume_limits[1];
576 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
577 }
578}
579
586void audio_req_get_res(void *udev, usb_setup_type *setup)
587{
588 usbd_core_type *pudev = (usbd_core_type *)udev;
589 if(HBYTE(setup->wIndex) == AUDIO_SPK_FEATURE_UNIT_ID)
590 {
591 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.spk_volume_limits[2];
592 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
593 }
594 else
595 {
596 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.mic_volume_limits[2];
597 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
598 }
599}
600
607void audio_set_interface(void *udev, usb_setup_type *setup)
608{
609 uint32_t len;
610 usbd_core_type *pudev = (usbd_core_type *)udev;
611 if(LBYTE(setup->wIndex) == AUDIO_SPK_INTERFACE_NUMBER)
612 {
613 audio_struct.spk_alt_setting = setup->wValue;
614 audio_codec_spk_alt_setting(audio_struct.spk_alt_setting);
615 if(audio_struct.spk_alt_setting )
616 {
617 usbd_ept_recv(pudev, USBD_AUDIO_SPK_OUT_EPT, audio_struct.audio_spk_data, AUDIO_SPK_OUT_MAXPACKET_SIZE);
618 }
619
620 }
621 else if(LBYTE(setup->wIndex) == AUDIO_MIC_INTERFACE_NUMBER)
622 {
623 audio_struct.mic_alt_setting = setup->wValue;
624 audio_codec_mic_alt_setting(audio_struct.mic_alt_setting);
625 if(audio_struct.mic_alt_setting)
626 {
627 len = audio_codec_mic_get_data(audio_struct.audio_mic_data);
628 usbd_ept_send(pudev, USBD_AUDIO_MIC_IN_EPT, audio_struct.audio_mic_data, len);
629 }
630 }
631
632}
633
634
641void audio_get_interface(void *udev, usb_setup_type *setup)
642{
643 usbd_core_type *pudev = (usbd_core_type *)udev;
644 if(LBYTE(setup->wIndex) == AUDIO_SPK_INTERFACE_NUMBER)
645 {
646 usbd_ctrl_send(pudev, (uint8_t *)&audio_struct.spk_alt_setting, 1);
647 }
648 else if(LBYTE(setup->wIndex) == AUDIO_MIC_INTERFACE_NUMBER)
649 {
650 usbd_ctrl_send(pudev, (uint8_t *)&audio_struct.mic_alt_setting, 1);
651 }
652
653}
654
655
audio_class.h
usb audio class file
audio_desc.h
usb audio descriptor header file
AUDIO_DESCRIPTOR_TYPE
#define AUDIO_DESCRIPTOR_TYPE
audio descriptor type
Definition: audio_class.h:83
AUDIO_MIC_IN_MAXPACKET_SIZE
#define AUDIO_MIC_IN_MAXPACKET_SIZE
Definition: audio_class.h:62
AUDIO_MUTE_CONTROL
#define AUDIO_MUTE_CONTROL
audio set cur type define
Definition: audio_class.h:76
AUDIO_REQ_CONTROL_INTERFACE
#define AUDIO_REQ_CONTROL_INTERFACE
request type define
Definition: audio_class.h:69
AUDIO_SPK_OUT_MAXPACKET_SIZE
#define AUDIO_SPK_OUT_MAXPACKET_SIZE
Definition: audio_class.h:63
AUDIO_VOLUME_CONTROL
#define AUDIO_VOLUME_CONTROL
Definition: audio_class.h:77
AUDIO_FREQ_SET_CONTROL
#define AUDIO_FREQ_SET_CONTROL
Definition: audio_class.h:78
AUDIO_REQ_CONTROL_ENDPOINT
#define AUDIO_REQ_CONTROL_ENDPOINT
Definition: audio_class.h:70
FEEDBACK_REFRESH_TIME
#define FEEDBACK_REFRESH_TIME
Definition: audio_class.h:65
AUDIO_REQ_CONTROL_MASK
#define AUDIO_REQ_CONTROL_MASK
Definition: audio_class.h:71
USBD_AUDIO_SPK_OUT_EPT
#define USBD_AUDIO_SPK_OUT_EPT
Definition: audio_class.h:55
USBD_AUDIO_MIC_IN_EPT
#define USBD_AUDIO_MIC_IN_EPT
endpoint define
Definition: audio_class.h:54
AUDIO_DESCRIPTOR_SIZE
#define AUDIO_DESCRIPTOR_SIZE
Definition: audio_class.h:84
USBD_AUDIO_FEEDBACK_EPT
#define USBD_AUDIO_FEEDBACK_EPT
Definition: audio_class.h:56
AUDIO_FEEDBACK_MAXPACKET_SIZE
#define AUDIO_FEEDBACK_MAXPACKET_SIZE
Definition: audio_class.h:64
audio_spk_out_stage
static __IO uint8_t audio_spk_out_stage
Definition: audio_class.c:66
audio_feedback_state
static __IO uint16_t audio_feedback_state
Definition: audio_class.c:65
audio_req_get_cur
void audio_req_get_cur(void *udev, usb_setup_type *setup)
usb audio request get cur
Definition: audio_class.c:467
audio_req_get_max
void audio_req_get_max(void *udev, usb_setup_type *setup)
usb audio request get max
Definition: audio_class.c:565
audio_get_interface
void audio_get_interface(void *udev, usb_setup_type *setup)
usb audio get interface
Definition: audio_class.c:641
audio_inisoincom_event
void audio_inisoincom_event(void *udev)
usb audio in iso incom event
Definition: audio_class.c:431
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: audio_class.c:394
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: audio_class.c:353
audio_class_handler
usbd_class_handler audio_class_handler
Definition: audio_class.c:68
audio_req_set_cur
void audio_req_set_cur(void *udev, usb_setup_type *setup)
usb audio request set cur
Definition: audio_class.c:505
audio_struct
usb_audio_type audio_struct
Definition: audio_class.c:63
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: audio_class.c:136
audio_set_interface
void audio_set_interface(void *udev, usb_setup_type *setup)
usb audio set interface
Definition: audio_class.c:607
audio_req_get_min
void audio_req_get_min(void *udev, usb_setup_type *setup)
usb audio request get min
Definition: audio_class.c:544
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: audio_class.c:214
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: audio_class.c:298
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb custom hid endpoint
Definition: audio_class.c:86
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: audio_class.c:228
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: audio_class.c:327
audio_req_get_res
void audio_req_get_res(void *udev, usb_setup_type *setup)
usb audio request get res
Definition: audio_class.c:586
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: audio_class.c:111
AUDIO_REQ_GET_CUR
#define AUDIO_REQ_GET_CUR
Definition: audio_desc.h:113
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112
AUDIO_SPK_INTERFACE_NUMBER
#define AUDIO_SPK_INTERFACE_NUMBER
Definition: audio_desc.h:180
AUDIO_MIC_INTERFACE_NUMBER
#define AUDIO_MIC_INTERFACE_NUMBER
audio interface number
Definition: audio_desc.h:178
AUDIO_REQ_GET_MAX
#define AUDIO_REQ_GET_MAX
Definition: audio_desc.h:117
AUDIO_REQ_GET_MIN
#define AUDIO_REQ_GET_MIN
Definition: audio_desc.h:115
AUDIO_SPK_FEATURE_UNIT_ID
#define AUDIO_SPK_FEATURE_UNIT_ID
Definition: audio_desc.h:172
AUDIO_REQ_GET_RES
#define AUDIO_REQ_GET_RES
Definition: audio_desc.h:119
AUDIO_REQ_SET_CUR
#define AUDIO_REQ_SET_CUR
Definition: audio_desc.h:112
g_rxlen
static uint16_t g_rxlen
Definition: cdc_class.c:60
audio_codec_mic_alt_setting
void audio_codec_mic_alt_setting(uint32_t alt_seting)
audio codec microphone alt setting config
Definition: audio/src/audio_codec.c:169
audio_codec_set_spk_volume
void audio_codec_set_spk_volume(uint16_t volume)
audio codec set speaker volume
Definition: audio/src/audio_codec.c:217
audio_codec_set_spk_mute
void audio_codec_set_spk_mute(uint8_t mute)
audio codec set speaker mute
Definition: audio/src/audio_codec.c:195
audio_codec_set_mic_freq
void audio_codec_set_mic_freq(uint32_t freq)
audio codec set microphone freq
Definition: audio/src/audio_codec.c:121
audio_codec_mic_get_data
uint32_t audio_codec_mic_get_data(uint8_t *buffer)
codec microphone get data
Definition: audio/src/audio_codec.c:282
audio_codec_set_mic_mute
void audio_codec_set_mic_mute(uint8_t mute)
audio codec set microphone mute
Definition: audio/src/audio_codec.c:184
audio_codec_spk_fifo_write
void audio_codec_spk_fifo_write(uint8_t *data, uint32_t len)
audio codec interface
Definition: audio/src/audio_codec.c:244
audio_codec_spk_feedback
uint8_t audio_codec_spk_feedback(uint8_t *feedback)
codec speaker feedback
Definition: audio/src/audio_codec.c:228
audio_codec_set_mic_volume
void audio_codec_set_mic_volume(uint16_t volume)
audio codec set microphone volume
Definition: audio/src/audio_codec.c:206
audio_codec_spk_alt_setting
void audio_codec_spk_alt_setting(uint32_t alt_seting)
audio codec speaker alt setting config
Definition: audio/src/audio_codec.c:154
audio_codec_set_spk_freq
void audio_codec_set_spk_freq(uint32_t freq)
audio codec set speaker freq
Definition: audio/src/audio_codec.c:137
EPT_ISO_TYPE
@ EPT_ISO_TYPE
Definition: at32f415_usb.h:347
usb_flush_tx_fifo
void usb_flush_tx_fifo(otg_global_type *usbx, uint32_t fifo_num)
flush tx fifo
Definition: at32f415_usb.c:119
OTG_DEVICE
#define OTG_DEVICE(usbx)
Definition: at32f415_usb.h:1342
USB_INEPT
#define USB_INEPT(usbx, eptn)
Definition: at32f415_usb.h:1345
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
MIN
#define MIN(a, b)
min and max define
Definition: usb_std.h:204
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
USB_STD_REQ_GET_DESCRIPTOR
#define USB_STD_REQ_GET_DESCRIPTOR
Definition: usb_std.h:81
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_STD_REQ_SET_INTERFACE
#define USB_STD_REQ_SET_INTERFACE
Definition: usb_std.h:86
USB_REQ_TYPE_RESERVED
#define USB_REQ_TYPE_RESERVED
Definition: usb_std.h:66
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_STD_REQ_GET_INTERFACE
#define USB_STD_REQ_GET_INTERFACE
Definition: usb_std.h:85
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usb_std.h:64
USB_OK
@ USB_OK
Definition: usb_std.h:218
usbd_ept_close
void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint
Definition: usbd_core.c:341
usbd_ctrl_send_status
void usbd_ctrl_send_status(usbd_core_type *udev)
usb control endpoint send in status
Definition: usbd_core.c:207
usbd_ept_recv
void usbd_ept_recv(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint receive data
Definition: usbd_core.c:529
usbd_flush_tx_fifo
void usbd_flush_tx_fifo(usbd_core_type *udev, uint8_t ept_num)
usb device flush in endpoint fifo
Definition: usbd_core.c:645
usbd_ept_open
void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint
Definition: usbd_core.c:309
usbd_ctrl_send
void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data
Definition: usbd_core.c:174
usbd_ept_send
void usbd_ept_send(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data
Definition: usbd_core.c:429
usbd_get_recv_len
uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length
Definition: usbd_core.c:295
usbd_ctrl_recv
void usbd_ctrl_recv(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint recv data
Definition: usbd_core.c:192
usbd_ctrl_unsupport
void usbd_ctrl_unsupport(usbd_core_type *udev)
un-support device request
Definition: usbd_core.c:282
usb_audio_type
usb audio control struct
Definition: audio_class.h:90
usb_audio_type::mic_alt_setting
uint32_t mic_alt_setting
Definition: audio_class.h:106
usb_audio_type::spk_volume_limits
uint16_t spk_volume_limits[3]
Definition: audio_class.h:100
usb_audio_type::enpd
uint8_t enpd
Definition: audio_class.h:91
usb_audio_type::g_audio_cur
uint8_t g_audio_cur[64]
Definition: audio_class.h:107
usb_audio_type::mic_freq
uint32_t mic_freq
Definition: audio_class.h:99
usb_audio_type::mic_volume_limits
uint16_t mic_volume_limits[3]
Definition: audio_class.h:101
usb_audio_type::audio_mic_data
uint8_t audio_mic_data[(48 *2 *(16/8)+40)]
Definition: audio_class.h:109
usb_audio_type::interface
uint8_t interface
Definition: audio_class.h:92
usb_audio_type::audio_feed_back
uint8_t audio_feed_back[0x3+1]
Definition: audio_class.h:110
usb_audio_type::audio_cmd_len
uint32_t audio_cmd_len
Definition: audio_class.h:104
usb_audio_type::spk_alt_setting
uint32_t spk_alt_setting
Definition: audio_class.h:105
usb_audio_type::spk_volume
uint16_t spk_volume
Definition: audio_class.h:96
usb_audio_type::mic_volume
uint16_t mic_volume
Definition: audio_class.h:97
usb_audio_type::audio_spk_data
uint8_t audio_spk_data[(48 *2 *(16/8)+40)]
Definition: audio_class.h:108
usb_audio_type::spk_freq
uint32_t spk_freq
Definition: audio_class.h:98
usb_audio_type::spk_mute
uint8_t spk_mute
Definition: audio_class.h:94
usb_audio_type::request_no
uint8_t request_no
Definition: audio_class.h:93
usb_audio_type::audio_cmd
uint8_t audio_cmd
Definition: audio_class.h:103
usb_audio_type::mic_mute
uint8_t mic_mute
Definition: audio_class.h:95
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_setup_type::wValue
uint16_t wValue
Definition: usb_std.h:233
usb_setup_type::wLength
uint16_t wLength
Definition: usb_std.h:236
usb_setup_type::bmRequestType
uint8_t bmRequestType
Definition: usb_std.h:231
usb_setup_type::wIndex
uint16_t wIndex
Definition: usb_std.h:234
usb_setup_type::bRequest
uint8_t bRequest
Definition: usb_std.h:232
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: audio_class.h Source File

  • middlewares
  • usbd_class
  • audio
audio_class.h
Go to the documentation of this file.
1
27 /* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AUDIO_CLASS_H
29#define __AUDIO_CLASS_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "usb_std.h"
36#include "usbd_core.h"
37#include "audio_conf.h"
38
54#define USBD_AUDIO_MIC_IN_EPT 0x81
55#define USBD_AUDIO_SPK_OUT_EPT 0x02
56#define USBD_AUDIO_FEEDBACK_EPT 0x83
57
61#define AUDIO_REMAIN_SIZE 40
62#define AUDIO_MIC_IN_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_MIC_CHANEL_NUM * (AUDIO_MIC_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)
63#define AUDIO_SPK_OUT_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_SPK_CHANEL_NUM * (AUDIO_SPK_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)
64#define AUDIO_FEEDBACK_MAXPACKET_SIZE 0x3
65#define FEEDBACK_REFRESH_TIME 0x8
69#define AUDIO_REQ_CONTROL_INTERFACE 0x01
70#define AUDIO_REQ_CONTROL_ENDPOINT 0x02
71#define AUDIO_REQ_CONTROL_MASK 0x03
72
76#define AUDIO_MUTE_CONTROL 0x01
77#define AUDIO_VOLUME_CONTROL 0x02
78#define AUDIO_FREQ_SET_CONTROL 0x03
79
83#define AUDIO_DESCRIPTOR_TYPE 0x21
84#define AUDIO_DESCRIPTOR_SIZE 0x09
85
89typedef struct
90{
91 uint8_t enpd;
92 uint8_t interface;
93 uint8_t request_no;
94 uint8_t spk_mute;
95 uint8_t mic_mute;
96 uint16_t spk_volume;
97 uint16_t mic_volume;
98 uint32_t spk_freq;
99 uint32_t mic_freq;
100 uint16_t spk_volume_limits[3]; /*[0] is mininum value, [1] is maxnum value, [2] is volume resolution */
101 uint16_t mic_volume_limits[3]; /*[0] is mininum value, [1] is maxnum value, [2] is volume resolution */
102
103 uint8_t audio_cmd;
104 uint32_t audio_cmd_len;
105 uint32_t spk_alt_setting;
106 uint32_t mic_alt_setting;
107 uint8_t g_audio_cur[64];
108 uint8_t audio_spk_data[AUDIO_SPK_OUT_MAXPACKET_SIZE];
109 uint8_t audio_mic_data[AUDIO_MIC_IN_MAXPACKET_SIZE];
110 uint8_t audio_feed_back[AUDIO_FEEDBACK_MAXPACKET_SIZE+1];
111}usb_audio_type;
112
113extern usbd_class_handler audio_class_handler;
114
126#ifdef __cplusplus
127}
128#endif
129
130#endif
audio_conf.h
usb audio config
AUDIO_MIC_IN_MAXPACKET_SIZE
#define AUDIO_MIC_IN_MAXPACKET_SIZE
Definition: audio_class.h:62
audio_class_handler
usbd_class_handler audio_class_handler
Definition: audio_class.c:68
AUDIO_SPK_OUT_MAXPACKET_SIZE
#define AUDIO_SPK_OUT_MAXPACKET_SIZE
Definition: audio_class.h:63
AUDIO_FEEDBACK_MAXPACKET_SIZE
#define AUDIO_FEEDBACK_MAXPACKET_SIZE
Definition: audio_class.h:64
usb_audio_type
usb audio control struct
Definition: audio_class.h:90
usb_audio_type::mic_alt_setting
uint32_t mic_alt_setting
Definition: audio_class.h:106
usb_audio_type::enpd
uint8_t enpd
Definition: audio_class.h:91
usb_audio_type::mic_freq
uint32_t mic_freq
Definition: audio_class.h:99
usb_audio_type::interface
uint8_t interface
Definition: audio_class.h:92
usb_audio_type::audio_cmd_len
uint32_t audio_cmd_len
Definition: audio_class.h:104
usb_audio_type::spk_alt_setting
uint32_t spk_alt_setting
Definition: audio_class.h:105
usb_audio_type::spk_volume
uint16_t spk_volume
Definition: audio_class.h:96
usb_audio_type::mic_volume
uint16_t mic_volume
Definition: audio_class.h:97
usb_audio_type::spk_freq
uint32_t spk_freq
Definition: audio_class.h:98
usb_audio_type::spk_mute
uint8_t spk_mute
Definition: audio_class.h:94
usb_audio_type::request_no
uint8_t request_no
Definition: audio_class.h:93
usb_audio_type::audio_cmd
uint8_t audio_cmd
Definition: audio_class.h:103
usb_audio_type::mic_mute
uint8_t mic_mute
Definition: audio_class.h:95
usb_std.h
usb standard header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: audio_desc.c Source File

  • middlewares
  • usbd_class
  • audio
audio_desc.c
Go to the documentation of this file.
1
26#include "usb_std.h"
27#include "usbd_sdr.h"
28#include "usbd_core.h"
29#include "audio_desc.h"
30
45usbd_desc_t *get_device_descriptor(void);
46usbd_desc_t *get_device_qualifier(void);
47usbd_desc_t *get_device_configuration(void);
48usbd_desc_t *get_device_other_speed(void);
49usbd_desc_t *get_device_lang_id(void);
50usbd_desc_t *get_device_manufacturer_string(void);
51usbd_desc_t *get_device_product_string(void);
52usbd_desc_t *get_device_serial_string(void);
53usbd_desc_t *get_device_interface_string(void);
54usbd_desc_t *get_device_config_string(void);
55
56uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf);
57static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len);
58static void get_serial_num(void);
59static uint8_t g_usbd_desc_buffer[256];
60
64usbd_desc_handler audio_desc_handler =
65{
66 get_device_descriptor,
67 get_device_qualifier,
68 get_device_configuration,
69 get_device_other_speed,
70 get_device_lang_id,
71 get_device_manufacturer_string,
72 get_device_product_string,
73 get_device_serial_string,
74 get_device_interface_string,
75 get_device_config_string,
76};
77
81#if defined ( __ICCARM__ ) /* iar compiler */
82 #pragma data_alignment=4
83#endif
84ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL =
85{
86 USB_DEVICE_DESC_LEN, /* bLength */
87 USB_DESCIPTOR_TYPE_DEVICE, /* bDescriptorType */
88 0x00, /* bcdUSB */
89 0x02,
90 0x00, /* bDeviceClass */
91 0x00, /* bDeviceSubClass */
92 0x00, /* bDeviceProtocol */
93 USB_MAX_EP0_SIZE, /* bMaxPacketSize */
94 LBYTE(USBD_VENDOR_ID), /* idVendor */
95 HBYTE(USBD_VENDOR_ID), /* idVendor */
96 LBYTE(USBD_PRODUCT_ID), /* idProduct */
97 HBYTE(USBD_PRODUCT_ID), /* idProduct */
98 0x00, /* bcdDevice rel. 2.00 */
99 0x02,
100 USB_MFC_STRING, /* Index of manufacturer string */
101 USB_PRODUCT_STRING, /* Index of product string */
102 USB_SERIAL_STRING, /* Index of serial number string */
103 0x01 /* bNumConfigurations */
104};
105
109#if defined ( __ICCARM__ ) /* iar compiler */
110 #pragma data_alignment=4
111#endif
112ALIGNED_HEAD uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE] ALIGNED_TAIL =
113{
114 USB_DEVICE_CFG_DESC_LEN, /* bLength: configuration descriptor size */
115 USB_DESCIPTOR_TYPE_CONFIGURATION, /* bDescriptorType: configuration */
116 LBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
117 HBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
118 0x1 + AUDIO_INTERFACE_NUM, /* bNumInterfaces: n interface */
119 0x01, /* bConfigurationValue: configuration value */
120 0x00, /* iConfiguration: index of string descriptor describing
121 the configuration */
122 0xC0, /* bmAttributes: self powered */
123 0x32, /* MaxPower 100 mA: this current is used for detecting vbus */
124
125 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
126 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
127 0x00, /* bInterfaceNumber: number of interface */
128 0x00, /* bAlternateSetting: alternate set */
129 0x00, /* bNumEndpoints: number of endpoints */
130 USB_CLASS_CODE_AUDIO, /* bInterfaceClass: audio class code */
131 AUDIO_SUBCLASS_AUDIOCONTROL, /* bInterfaceSubClass: audio control */
132 AUDIO_PROTOCOL_UNDEFINED, /* bInterfaceProtocol: undefined */
133 0x00, /* iInterface: index of string descriptor */
134
135 0x08+AUDIO_INTERFACE_NUM, /* bLength: size of this descriptor, in bytes 8+n */
136 AUDIO_CS_INTERFACE, /* bDescriptorType: cs interface descriptor type */
137 AUDIO_AC_HEADER, /* bDescriptorSubtype: Header function Descriptor*/
138 LBYTE(BCD_NUM),
139 HBYTE(BCD_NUM), /* bcdCDC: audio device class specification release number */
140 LBYTE(AUDIO_INTERFACE_LEN),
141 HBYTE(AUDIO_INTERFACE_LEN), /* wTotalLength: total number of bytes returned for the class-specific audio control interface */
142 AUDIO_INTERFACE_NUM, /* bInClollection: the number of audio streaming */
143#if (AUDIO_INTERFACE_NUM == 2) /* two interface */
144 0x02,
145 0x01,
146#else
147 0x01,
148#endif
149
150 /* usb microphone config */
151#if (AUDIO_SUPPORT_MIC == 1)
152 AUDIO_INPUT_TERMINAL_SIZE, /* bLength: descriptor size */
153 AUDIO_CS_INTERFACE, /* bDescriptorType: configuration */
154 AUDIO_AC_INPUT_TERMINAL, /* bDescriptorSubtype: input_terminal type*/
155 AUDIO_MIC_INPUT_TERMINAL_ID, /* bTerminalID: id of this input terminal*/
156 LBYTE(AUDIO_INPUT_TERMINAL_MICROPHONE),
157 HBYTE(AUDIO_INPUT_TERMINAL_MICROPHONE),/* wTerminalType: terminal is microphone */
158 0x00, /* bAssocTerminal: no association */
159 AUDIO_MIC_CHR, /* bNrChannels: two channel */
160#if (AUDIO_MIC_CHR == 2)
161 0x03, /* wChannelConfig: left front and right front */
162#endif
163#if (AUDIO_MIC_CHR == 1)
164 0x00, /* wChannelConfig */
165#endif
166 0x00, /* wChannelConfig */
167 0x00, /* iChannelNames: unused */
168 0x00, /* iTerminal: unused */
169
170 AUDIO_FEATURE_UNIT_SIZE, /* bLength: descriptor size */
171 AUDIO_CS_INTERFACE, /* bDescriptorType: configuration */
172 AUDIO_AC_FEATURE_UNIT, /* bDescriptorSubtype: feature unit type*/
173 AUDIO_MIC_FEATURE_UNIT_ID, /* bUnitID: id of this feature unit */
174 AUDIO_MIC_INPUT_TERMINAL_ID, /* bSourceID: from input terminal */
175 0x01, /* bControlSize: 1 byte */
176 0x01, /* bmaControls0: mute */
177 0x02, /* bmaControls1: volume */
178 0x00, /* iFeature: unused */
179
180 AUDIO_OUTPUT_TERMINAL_SIZE, /* bLength: descriptor size */
181 AUDIO_CS_INTERFACE, /* bDescriptorType: configuration */
182 AUDIO_AC_OUTPUT_TERMINAL, /* bDescriptorSubtype: output_terminal type*/
183 AUDIO_MIC_OUTPUT_TERMINAL_ID, /* bTerminalID: id of this output terminal*/
184 LBYTE(AUDIO_TERMINAL_TYPE_STREAMING),
185 HBYTE(AUDIO_TERMINAL_TYPE_STREAMING), /* wTerminalType: usb streaming */
186 0x00, /* bAssocTerminal: unused */
187 AUDIO_MIC_FEATURE_UNIT_ID, /* bSourceID: from feature unit terminal */
188 0x00, /* iTerminal: unused */
189#endif
190
191#if (AUDIO_SUPPORT_SPK == 1)
192 /* speaker config */
193 AUDIO_INPUT_TERMINAL_SIZE, /* bLength: descriptor size */
194 AUDIO_CS_INTERFACE, /* bDescriptorType: configuration */
195 AUDIO_AC_INPUT_TERMINAL, /* bDescriptorSubtype: input_terminal type*/
196 AUDIO_SPK_INPUT_TERMINAL_ID, /* bTerminalID: id of this input terminal*/
197 LBYTE(AUDIO_TERMINAL_TYPE_STREAMING), /* wTerminalType: usb streaming */
198 HBYTE(AUDIO_TERMINAL_TYPE_STREAMING), /* wTerminalType: usb streaming */
199 0x00, /* bAssocTerminal: no association */
200 AUDIO_SPK_CHR, /* bNrChannels: two channel */
201#if (AUDIO_SPK_CHR == 2)
202 0x03, /* wChannelConfig: left front and right front */
203#endif
204#if (AUDIO_SPK_CHR == 1)
205 0x00, /* wChannelConfig */
206#endif
207 0x00, /* wChannelConfig */
208 0x00, /* iChannelNames: unused */
209 0x00, /* iTerminal: unused */
210
211 AUDIO_FEATURE_UNIT_SIZE, /* bLength: descriptor size */
212 AUDIO_CS_INTERFACE, /* bDescriptorType: configuration */
213 AUDIO_AC_FEATURE_UNIT, /* bDescriptorSubtype: feature unit type*/
214 AUDIO_SPK_FEATURE_UNIT_ID, /* bUnitID: id of this feature unit */
215 AUDIO_SPK_INPUT_TERMINAL_ID, /* bSourceID: from input terminal */
216 0x01, /* bControlSize: 1 byte */
217 0x01, /* bmaControls0: mute*/
218 0x02, /* bmaControls1: volume */
219 0x00, /* iFeature: unused */
220
221 AUDIO_OUTPUT_TERMINAL_SIZE, /* bLength: descriptor size */
222 AUDIO_CS_INTERFACE, /* bDescriptorType: configuration */
223 AUDIO_AC_OUTPUT_TERMINAL, /* bDescriptorSubtype: output_terminal type*/
224 AUDIO_SPK_OUTPUT_TERMINAL_ID, /* bTerminalID: id of this output terminal*/
225 LBYTE(AUDIO_OUTPUT_TERMINAL_SPEAKER), /* wTerminalType: usb speaker */
226 HBYTE(AUDIO_OUTPUT_TERMINAL_SPEAKER), /* wTerminalType: usb speaker */
227 0x00, /* bAssocTerminal: unused */
228 AUDIO_SPK_FEATURE_UNIT_ID, /* bSourceID: from feature unit terminal */
229 0x00, /* iTerminal: unused */
230#endif
231
232#if (AUDIO_SUPPORT_MIC == 1)
233 /* microphone interface */
234 0x09, /* bLength: descriptor size */
235 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
236 AUDIO_MIC_INTERFACE_NUMBER, /* bInterfaceNumber: index of this interface */
237 0x00, /* bAlternateSetting: index of this setting */
238 0x00, /* bNumEndpoints: 0 endpoints */
239 USB_CLASS_CODE_AUDIO, /* bInterfaceClass: audio */
240 AUDIO_SUBCLASS_AUDIOSTREAMING, /* bInterfaceSubclass: audio streaming */
241 0x00, /* bInterfaceProtocol: unused */
242 0x00, /* iInterface: unused */
243
244 0x09, /* bLength: descriptor size */
245 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
246 AUDIO_MIC_INTERFACE_NUMBER, /* bInterfaceNumber: index of this interface */
247 0x01, /* bAlternateSetting: index of this setting */
248 0x01, /* bNumEndpoints: 1 endpoints */
249 USB_CLASS_CODE_AUDIO, /* bInterfaceClass: audio */
250 AUDIO_SUBCLASS_AUDIOSTREAMING, /* bInterfaceSubclass: audio streaming */
251 0x00, /* bInterfaceProtocol: unused */
252 0x00, /* iInterface: unused */
253
254 0x07, /* bLength: configuration descriptor size */
255 AUDIO_CS_INTERFACE, /* bDescriptorType: interface descriptor type */
256 AUDIO_AS_GENERAL, /* bDescriptorSubtype: general sub type*/
257 AUDIO_MIC_OUTPUT_TERMINAL_ID, /* bTerminalLink: unit id of the output terminal */
258 0x01, /* bDelay: interface delay */
259 0x01, /* wFormatTag: pcm format*/
260 0x00, /* wFormatTag: pcm format*/
261
262 0x08 + AUDIO_MIC_FREQ_SIZE * 3, /* bLength: descriptor size */
263 AUDIO_CS_INTERFACE, /* bDescriptorType: interface descriptor type */
264 AUDIO_AS_FORMAT_TYPE, /* bDescriptorSubtype: format subtype */
265 AUDIO_FORMAT_TYPE_I, /* bFormatType: format type 1 */
266 AUDIO_MIC_CHR, /* bNrChannels: channel number */
267 AUDIO_MIC_BITW / 8, /* bSubFrameSize: per audio subframe */
268 AUDIO_MIC_BITW, /* bBitResolution: n bits per sample */
269 AUDIO_MIC_FREQ_SIZE, /* bSamFreqType: n frequency supported */
270#if (AUDIO_SUPPORT_FREQ_16K == 1)
271 SAMPLE_FREQ(AT32_AUDIO_FREQ_16K), /* tSamFreq: 16000hz */
272#endif
273#if (AUDIO_SUPPORT_FREQ_48K == 1)
274 SAMPLE_FREQ(AT32_AUDIO_FREQ_48K), /* tSamFreq: 48000hz */
275#endif
276
277 0x09, /* bLength: size of endpoint descriptor in bytes */
278 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
279 USBD_AUDIO_MIC_IN_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
280 USB_EPT_DESC_ISO | USB_ETP_DESC_ASYNC, /* bmAttributes: endpoint attributes */
281 LBYTE(AUDIO_MIC_IN_MAXPACKET_SIZE),
282 HBYTE(AUDIO_MIC_IN_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
283 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
284 0x00, /* bRefresh: unused */
285 0x00, /* bSynchAddress: unused */
286
287 0x07, /* bLength: size of endpoint descriptor in bytes */
288 AUDIO_CS_ENDPOINT, /* bDescriptorType: cs endpoint descriptor type */
289 0x01, /* bDescriptorSubtype: general subtype */
290 0x01, /* bmAttributes */
291 0x00, /* bLockDelayUnits: unused */
292 0x00, /* wLockDelay: unused */
293 0x00, /* wLockDelay: unused */
294#endif
295
296#if (AUDIO_SUPPORT_SPK == 1)
297 /* speaker interface */
298 0x09, /* bLength: descriptor size */
299 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
300 AUDIO_SPK_INTERFACE_NUMBER, /* bInterfaceNumber: index of this interface */
301 0x00, /* bAlternateSetting: index of this setting */
302 0x00, /* bNumEndpoints: 0 endpoints */
303 USB_CLASS_CODE_AUDIO, /* bInterfaceClass: audio */
304 AUDIO_SUBCLASS_AUDIOSTREAMING, /* bInterfaceSubclass: audio streaming */
305 0x00, /* bInterfaceProtocol: unused */
306 0x00, /* iInterface: unused */
307
308 0x09, /* bLength: descriptor size */
309 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
310 AUDIO_SPK_INTERFACE_NUMBER, /* bInterfaceNumber: index of this interface */
311 0x01, /* bAlternateSetting: index of this setting */
312 0x01 + AUDIO_SUPPORT_FEEDBACK, /* bNumEndpoints: endpoints */
313 USB_CLASS_CODE_AUDIO, /* bInterfaceClass: audio */
314 AUDIO_SUBCLASS_AUDIOSTREAMING, /* bInterfaceSubclass: audio streaming */
315 0x00, /* bInterfaceProtocol: unused */
316 0x00, /* iInterface: unused */
317
318 0x07, /* bLength: configuration descriptor size */
319 AUDIO_CS_INTERFACE, /* bDescriptorType: interface descriptor type */
320 AUDIO_AS_GENERAL, /* bDescriptorSubtype: general sub type*/
321 AUDIO_SPK_INPUT_TERMINAL_ID, /* bTerminalLink: unit id of the input terminal */
322 0x01, /* bDelay: interface delay */
323 0x01, /* wFormatTag: pcm format*/
324 0x00, /* wFormatTag: pcm format*/
325
326 0x08 + AUDIO_SPK_FREQ_SIZE * 3, /* bLength: descriptor size */
327 AUDIO_CS_INTERFACE, /* bDescriptorType: interface descriptor type */
328 AUDIO_AS_FORMAT_TYPE, /* bDescriptorSubtype: format subtype */
329 AUDIO_FORMAT_TYPE_I, /* bFormatType: format type 1 */
330 AUDIO_SPK_CHR, /* bNrChannels: channel number */
331 AUDIO_SPK_BITW / 8, /* bSubFrameSize: per audio subframe */
332 AUDIO_SPK_BITW, /* bBitResolution: n bits per sample */
333 AUDIO_SPK_FREQ_SIZE, /* bSamFreqType: n frequency supported */
334#if (AUDIO_SUPPORT_FREQ_16K == 1)
335 SAMPLE_FREQ(AT32_AUDIO_FREQ_16K), /* tSamFreq: 16000hz */
336#endif
337#if (AUDIO_SUPPORT_FREQ_48K == 1)
338 SAMPLE_FREQ(AT32_AUDIO_FREQ_48K), /* tSamFreq: 48000hz */
339#endif
340
341 0x09, /* bLength: size of endpoint descriptor in bytes */
342 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
343 USBD_AUDIO_SPK_OUT_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
344 USB_EPT_DESC_ISO | USB_ETP_DESC_ASYNC, /* bmAttributes: endpoint attributes */
345 LBYTE(AUDIO_SPK_OUT_MAXPACKET_SIZE),
346 HBYTE(AUDIO_SPK_OUT_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
347 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
348 0x00, /* bRefresh: unused */
349#if (AUDIO_SUPPORT_FEEDBACK == 1)
350 USBD_AUDIO_FEEDBACK_EPT, /* bSynchAddress: feedback endpoint */
351#else
352 0x00, /* bSynchAddress: unused */
353#endif
354
355 0x07, /* bLength: size of endpoint descriptor in bytes */
356 AUDIO_CS_ENDPOINT, /* bDescriptorType: cs endpoint descriptor type */
357 0x01, /* bDescriptorSubtype: general subtype */
358 0x01, /* bmAttributes */
359 0x00, /* bLockDelayUnits: unused */
360 0x00, /* wLockDelay: unused */
361 0x00, /* wLockDelay: unused */
362
363#if (AUDIO_SUPPORT_FEEDBACK == 1)
364 0x09, /* bLength: size of endpoint descriptor in bytes */
365 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
366 USBD_AUDIO_FEEDBACK_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
367 0x11, /* bmAttributes: endpoint attributes */
368 LBYTE(AUDIO_FEEDBACK_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
369 HBYTE(AUDIO_FEEDBACK_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
370 1, /* bInterval: interval for polling endpoint for data transfers */
371 FEEDBACK_REFRESH_TIME, /* bRefresh: this field indicates the rate at which an iso syncronization
372 pipe provides new syncronization feedback data. this rate must be a power of
373 2, therefore only the power is reported back and the range of this field is from
374 1(2ms) to 9(512ms) */
375 0x00 /* bSynchAddress: 0x00*/
376#endif
377
378#endif
379};
380
384#if defined ( __ICCARM__ ) /* iar compiler */
385 #pragma data_alignment=4
386#endif
387ALIGNED_HEAD uint8_t g_string_lang_id[USBD_SIZ_STRING_LANGID] ALIGNED_TAIL =
388{
389 USBD_SIZ_STRING_LANGID,
390 USB_DESCIPTOR_TYPE_STRING,
391 0x09,
392 0x04,
393};
394
398#if defined ( __ICCARM__ ) /* iar compiler */
399 #pragma data_alignment=4
400#endif
401ALIGNED_HEAD uint8_t g_string_serial[USBD_SIZ_STRING_SERIAL] ALIGNED_TAIL =
402{
403 USBD_SIZ_STRING_SERIAL,
404 USB_DESCIPTOR_TYPE_STRING,
405};
406
407
408/* device descriptor */
409usbd_desc_t device_descriptor =
410{
411 USB_DEVICE_DESC_LEN,
412 g_usbd_descriptor
413};
414
415/* config descriptor */
416usbd_desc_t config_descriptor =
417{
418 USBD_CONFIG_DESC_SIZE,
419 g_usbd_configuration
420};
421
422/* langid descriptor */
423usbd_desc_t langid_descriptor =
424{
425 USBD_SIZ_STRING_LANGID,
426 g_string_lang_id
427};
428
429/* serial descriptor */
430usbd_desc_t serial_descriptor =
431{
432 USBD_SIZ_STRING_SERIAL,
433 g_string_serial
434};
435
436usbd_desc_t vp_desc;
437
444uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
445{
446 uint16_t str_len = 0, id_pos = 2;
447 uint8_t *tmp_str = string;
448
449 while(*tmp_str != '\0')
450 {
451 str_len ++;
452 unicode_buf[id_pos ++] = *tmp_str ++;
453 unicode_buf[id_pos ++] = 0x00;
454 }
455
456 str_len = str_len * 2 + 2;
457 unicode_buf[0] = str_len;
458 unicode_buf[1] = USB_DESCIPTOR_TYPE_STRING;
459
460 return str_len;
461}
462
470static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len)
471{
472 uint8_t idx = 0;
473
474 for( idx = 0 ; idx < len ; idx ++)
475 {
476 if( ((value >> 28)) < 0xA )
477 {
478 pbuf[2 * idx] = (value >> 28) + '0';
479 }
480 else
481 {
482 pbuf[2 * idx] = (value >> 28) + 'A' - 10;
483 }
484
485 value = value << 4;
486
487 pbuf[2 * idx + 1] = 0;
488 }
489}
490
496static void get_serial_num(void)
497{
498 uint32_t serial0, serial1, serial2;
499
500 serial0 = *(uint32_t*)MCU_ID1;
501 serial1 = *(uint32_t*)MCU_ID2;
502 serial2 = *(uint32_t*)MCU_ID3;
503
504 serial0 += serial2;
505
506 if (serial0 != 0)
507 {
508 usbd_int_to_unicode (serial0, &g_string_serial[2] ,8);
509 usbd_int_to_unicode (serial1, &g_string_serial[18] ,4);
510 }
511}
512
518usbd_desc_t *get_device_descriptor(void)
519{
520 return &device_descriptor;
521}
522
528usbd_desc_t * get_device_qualifier(void)
529{
530 return NULL;
531}
532
538usbd_desc_t *get_device_configuration(void)
539{
540 return &config_descriptor;
541}
542
548usbd_desc_t *get_device_other_speed(void)
549{
550 return NULL;
551}
552
558usbd_desc_t *get_device_lang_id(void)
559{
560 return &langid_descriptor;
561}
562
563
569usbd_desc_t *get_device_manufacturer_string(void)
570{
571 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_MANUFACTURER_STRING, g_usbd_desc_buffer);
572 vp_desc.descriptor = g_usbd_desc_buffer;
573 return &vp_desc;
574}
575
581usbd_desc_t *get_device_product_string(void)
582{
583 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_PRODUCT_STRING, g_usbd_desc_buffer);
584 vp_desc.descriptor = g_usbd_desc_buffer;
585 return &vp_desc;
586}
587
593usbd_desc_t *get_device_serial_string(void)
594{
595 get_serial_num();
596 return &serial_descriptor;
597}
598
604usbd_desc_t *get_device_interface_string(void)
605{
606 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_INTERFACE_STRING, g_usbd_desc_buffer);
607 vp_desc.descriptor = g_usbd_desc_buffer;
608 return &vp_desc;
609}
610
616usbd_desc_t *get_device_config_string(void)
617{
618 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_CONFIGURATION_STRING, g_usbd_desc_buffer);
619 vp_desc.descriptor = g_usbd_desc_buffer;
620 return &vp_desc;
621}
622
audio_desc.h
usb audio descriptor header file
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
AUDIO_MIC_IN_MAXPACKET_SIZE
#define AUDIO_MIC_IN_MAXPACKET_SIZE
Definition: audio_class.h:62
AUDIO_SPK_OUT_MAXPACKET_SIZE
#define AUDIO_SPK_OUT_MAXPACKET_SIZE
Definition: audio_class.h:63
FEEDBACK_REFRESH_TIME
#define FEEDBACK_REFRESH_TIME
Definition: audio_class.h:65
USBD_AUDIO_SPK_OUT_EPT
#define USBD_AUDIO_SPK_OUT_EPT
Definition: audio_class.h:55
USBD_AUDIO_MIC_IN_EPT
#define USBD_AUDIO_MIC_IN_EPT
endpoint define
Definition: audio_class.h:54
USBD_AUDIO_FEEDBACK_EPT
#define USBD_AUDIO_FEEDBACK_EPT
Definition: audio_class.h:56
AUDIO_FEEDBACK_MAXPACKET_SIZE
#define AUDIO_FEEDBACK_MAXPACKET_SIZE
Definition: audio_class.h:64
AUDIO_MIC_FEATURE_UNIT_ID
#define AUDIO_MIC_FEATURE_UNIT_ID
Definition: audio_desc.h:169
AUDIO_CS_ENDPOINT
#define AUDIO_CS_ENDPOINT
Definition: audio_desc.h:76
USBD_DESC_CONFIGURATION_STRING
#define USBD_DESC_CONFIGURATION_STRING
Definition: audio_desc.h:61
USBD_SIZ_STRING_SERIAL
#define USBD_SIZ_STRING_SERIAL
Definition: audio_desc.h:57
AUDIO_AC_HEADER
#define AUDIO_AC_HEADER
Definition: audio_desc.h:91
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112
USBD_DESC_PRODUCT_STRING
#define USBD_DESC_PRODUCT_STRING
Definition: audio_desc.h:60
AUDIO_SUBCLASS_AUDIOCONTROL
#define AUDIO_SUBCLASS_AUDIOCONTROL
Definition: audio_desc.h:68
AUDIO_INPUT_TERMINAL_SIZE
#define AUDIO_INPUT_TERMINAL_SIZE
audio interface descriptor size define
Definition: audio_desc.h:161
AUDIO_TERMINAL_TYPE_STREAMING
#define AUDIO_TERMINAL_TYPE_STREAMING
Definition: audio_desc.h:138
AUDIO_SPK_CHR
#define AUDIO_SPK_CHR
Definition: audio_desc.h:202
HID_BINTERVAL_TIME
#define HID_BINTERVAL_TIME
Definition: audio_desc.h:205
AUDIO_SPK_INTERFACE_NUMBER
#define AUDIO_SPK_INTERFACE_NUMBER
Definition: audio_desc.h:180
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: audio_desc.h:208
AUDIO_MIC_OUTPUT_TERMINAL_ID
#define AUDIO_MIC_OUTPUT_TERMINAL_ID
Definition: audio_desc.h:170
AUDIO_MIC_INTERFACE_NUMBER
#define AUDIO_MIC_INTERFACE_NUMBER
audio interface number
Definition: audio_desc.h:178
SAMPLE_FREQ
#define SAMPLE_FREQ(frq)
Definition: audio_desc.h:213
AUDIO_MIC_FREQ_SIZE
#define AUDIO_MIC_FREQ_SIZE
audio microphone freq and channel config
Definition: audio_desc.h:194
AUDIO_SPK_FREQ_SIZE
#define AUDIO_SPK_FREQ_SIZE
audio speaker freq and channel config
Definition: audio_desc.h:201
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
AT32_AUDIO_FREQ_48K
#define AT32_AUDIO_FREQ_48K
Definition: audio_desc.h:189
USBD_SIZ_STRING_LANGID
#define USBD_SIZ_STRING_LANGID
Definition: audio_desc.h:56
AUDIO_FORMAT_TYPE_I
#define AUDIO_FORMAT_TYPE_I
audio format type 1
Definition: audio_desc.h:148
MCU_ID1
#define MCU_ID1
Definition: audio_desc.h:215
AUDIO_AS_GENERAL
#define AUDIO_AS_GENERAL
Definition: audio_desc.h:104
USBD_DESC_MANUFACTURER_STRING
#define USBD_DESC_MANUFACTURER_STRING
Definition: audio_desc.h:59
AUDIO_INTERFACE_NUM
#define AUDIO_INTERFACE_NUM
audio interface config
Definition: audio_desc.h:153
AUDIO_CS_INTERFACE
#define AUDIO_CS_INTERFACE
audio class-specific descriptor types
Definition: audio_desc.h:75
AUDIO_SPK_FEATURE_UNIT_ID
#define AUDIO_SPK_FEATURE_UNIT_ID
Definition: audio_desc.h:172
AUDIO_OUTPUT_TERMINAL_SIZE
#define AUDIO_OUTPUT_TERMINAL_SIZE
Definition: audio_desc.h:162
USBD_PRODUCT_ID
#define USBD_PRODUCT_ID
Definition: audio_desc.h:54
AUDIO_SPK_OUTPUT_TERMINAL_ID
#define AUDIO_SPK_OUTPUT_TERMINAL_ID
Definition: audio_desc.h:173
BCD_NUM
#define BCD_NUM
Definition: audio_desc.h:51
USBD_DESC_INTERFACE_STRING
#define USBD_DESC_INTERFACE_STRING
Definition: audio_desc.h:62
AUDIO_AC_INPUT_TERMINAL
#define AUDIO_AC_INPUT_TERMINAL
Definition: audio_desc.h:92
AUDIO_MIC_CHR
#define AUDIO_MIC_CHR
Definition: audio_desc.h:195
AUDIO_OUTPUT_TERMINAL_SPEAKER
#define AUDIO_OUTPUT_TERMINAL_SPEAKER
Definition: audio_desc.h:143
MCU_ID2
#define MCU_ID2
Definition: audio_desc.h:216
AT32_AUDIO_FREQ_16K
#define AT32_AUDIO_FREQ_16K
audio support freq
Definition: audio_desc.h:188
USBD_VENDOR_ID
#define USBD_VENDOR_ID
Definition: audio_desc.h:53
AUDIO_AS_FORMAT_TYPE
#define AUDIO_AS_FORMAT_TYPE
Definition: audio_desc.h:105
AUDIO_MIC_INPUT_TERMINAL_ID
#define AUDIO_MIC_INPUT_TERMINAL_ID
audio terminal id define
Definition: audio_desc.h:168
AUDIO_SPK_BITW
#define AUDIO_SPK_BITW
Definition: audio_desc.h:203
MCU_ID3
#define MCU_ID3
Definition: audio_desc.h:217
AUDIO_FEATURE_UNIT_SIZE
#define AUDIO_FEATURE_UNIT_SIZE
Definition: audio_desc.h:163
AUDIO_PROTOCOL_UNDEFINED
#define AUDIO_PROTOCOL_UNDEFINED
audio interface protocol codes
Definition: audio_desc.h:85
AUDIO_MIC_BITW
#define AUDIO_MIC_BITW
Definition: audio_desc.h:196
AUDIO_AC_FEATURE_UNIT
#define AUDIO_AC_FEATURE_UNIT
Definition: audio_desc.h:96
AUDIO_SPK_INPUT_TERMINAL_ID
#define AUDIO_SPK_INPUT_TERMINAL_ID
Definition: audio_desc.h:171
AUDIO_INTERFACE_LEN
#define AUDIO_INTERFACE_LEN
Definition: audio_desc.h:154
AUDIO_SUBCLASS_AUDIOSTREAMING
#define AUDIO_SUBCLASS_AUDIOSTREAMING
Definition: audio_desc.h:69
AUDIO_AC_OUTPUT_TERMINAL
#define AUDIO_AC_OUTPUT_TERMINAL
Definition: audio_desc.h:93
AUDIO_INPUT_TERMINAL_MICROPHONE
#define AUDIO_INPUT_TERMINAL_MICROPHONE
Definition: audio_desc.h:141
serial_descriptor
usbd_desc_t serial_descriptor
Definition: audio_desc.c:430
device_descriptor
usbd_desc_t device_descriptor
Definition: audio_desc.c:409
usbd_unicode_convert
uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert
Definition: audio_desc.c:444
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: audio_desc.c:569
langid_descriptor
usbd_desc_t langid_descriptor
Definition: audio_desc.c:423
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: audio_desc.c:528
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: audio_desc.c:604
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: audio_desc.c:548
g_usbd_desc_buffer
static uint8_t g_usbd_desc_buffer[256]
Definition: audio_desc.c:59
vp_desc
usbd_desc_t vp_desc
Definition: audio_desc.c:436
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: audio_desc.c:538
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: audio_desc.c:581
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: audio_desc.c:558
get_serial_num
static void get_serial_num(void)
usb get serial number
Definition: audio_desc.c:496
config_descriptor
usbd_desc_t config_descriptor
Definition: audio_desc.c:416
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: audio_desc.c:518
ALIGNED_TAIL
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL
usb device standard descriptor
Definition: audio_desc.c:84
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: audio_desc.c:593
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: audio_desc.c:616
audio_desc_handler
usbd_desc_handler audio_desc_handler
device descriptor handler structure
Definition: audio_desc.c:64
usbd_int_to_unicode
static void usbd_int_to_unicode(uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode
Definition: audio_desc.c:470
AUDIO_SUPPORT_FEEDBACK
#define AUDIO_SUPPORT_FEEDBACK
Definition: audio/audio_conf.h:49
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_EPT_DESC_ISO
#define USB_EPT_DESC_ISO
Definition: usb_std.h:176
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
USB_DESCIPTOR_TYPE_CONFIGURATION
#define USB_DESCIPTOR_TYPE_CONFIGURATION
Definition: usb_std.h:93
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DESCIPTOR_TYPE_ENDPOINT
#define USB_DESCIPTOR_TYPE_ENDPOINT
Definition: usb_std.h:96
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_DEVICE_IF_DESC_LEN
#define USB_DEVICE_IF_DESC_LEN
Definition: usb_std.h:152
USB_DEVICE_CFG_DESC_LEN
#define USB_DEVICE_CFG_DESC_LEN
Definition: usb_std.h:151
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92
USB_DESCIPTOR_TYPE_STRING
#define USB_DESCIPTOR_TYPE_STRING
Definition: usb_std.h:94
USB_CLASS_CODE_AUDIO
#define USB_CLASS_CODE_AUDIO
usb class code
Definition: usb_std.h:161
USB_DESCIPTOR_TYPE_INTERFACE
#define USB_DESCIPTOR_TYPE_INTERFACE
Definition: usb_std.h:95
USB_ETP_DESC_ASYNC
#define USB_ETP_DESC_ASYNC
Definition: usb_std.h:181
usb_std.h
usb standard header file
usbd_core.h
usb device core header file
usbd_sdr.h


AT32F415 Firmwary Library: audio_desc.h Source File

  • middlewares
  • usbd_class
  • audio
audio_desc.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AUDIO_DESC_H
29#define __AUDIO_DESC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "audio_class.h"
36#include "usbd_core.h"
37#include "audio_conf.h"
38
51#define BCD_NUM 0x0100
52
53#define USBD_VENDOR_ID 0x2E3C
54#define USBD_PRODUCT_ID 0x5730
55
56#define USBD_SIZ_STRING_LANGID 4
57#define USBD_SIZ_STRING_SERIAL 0x1A
58
59#define USBD_DESC_MANUFACTURER_STRING "Artery"
60#define USBD_DESC_PRODUCT_STRING "AT32 Audio"
61#define USBD_DESC_CONFIGURATION_STRING "Audio Config"
62#define USBD_DESC_INTERFACE_STRING "Audio Interface"
63
67#define AUDIO_SUBCLASS_UNDEFINED 0x00
68#define AUDIO_SUBCLASS_AUDIOCONTROL 0x01
69#define AUDIO_SUBCLASS_AUDIOSTREAMING 0x02
70#define AUDIO_SUBCLASS_MIDISTREMING 0x03
71
75#define AUDIO_CS_INTERFACE 0x24
76#define AUDIO_CS_ENDPOINT 0x25
77#define AUDIO_CS_STRING 0x23
78#define AUDIO_CS_CONFIGURATION 0x22
79#define AUDIO_CS_DEVICE 0x21
80#define AUDIO_CS_UNDEFINED 0x20
81
85#define AUDIO_PROTOCOL_UNDEFINED 0x00
86
90#define AUDIO_AC_DESCRIPTOR_UNDEFINED 0x00
91#define AUDIO_AC_HEADER 0x01
92#define AUDIO_AC_INPUT_TERMINAL 0x02
93#define AUDIO_AC_OUTPUT_TERMINAL 0x03
94#define AUDIO_AC_MIXER_UNIT 0x04
95#define AUDIO_AC_SELECTOR_UNIT 0x05
96#define AUDIO_AC_FEATURE_UNIT 0x06
97#define AUDIO_AC_PROCESSING_UNIT 0x07
98#define AUDIO_AC_EXTENSION_UNIT 0x08
99
103#define AUDIO_AS_DESCRIPTOR_UNDEFINED 0x00
104#define AUDIO_AS_GENERAL 0x01
105#define AUDIO_AS_FORMAT_TYPE 0x02
106#define AUDIO_AS_FORMAT_SPECIFIC 0x03
107
111#define AUDIO_REQUEST_CODE_UNDEFINED 0x00
112#define AUDIO_REQ_SET_CUR 0x01
113#define AUDIO_REQ_GET_CUR 0x81
114#define AUDIO_REQ_SET_MIN 0x02
115#define AUDIO_REQ_GET_MIN 0x82
116#define AUDIO_REQ_SET_MAX 0x03
117#define AUDIO_REQ_GET_MAX 0x83
118#define AUDIO_REQ_SET_RES 0x04
119#define AUDIO_REQ_GET_RES 0x84
120#define AUDIO_REQ_SET_MEM 0x05
121#define AUDIO_REQ_GET_MEM 0x85
122#define AUDIO_REQ_GET_STAT 0xFF
123
127#define AUDIO_FU_CONTROL_UNDEFINED 0x00
128#define AUDIO_FU_MUTE_CONTROL 0x01
129#define AUDIO_FU_VOLUME_CONTROL 0x02
130#define AUDIO_FU_BASS_CONTROL 0x03
131#define AUDIO_FU_MID_CONTROL 0x04
132#define AUDIO_FU_TREBLE_CONTROL 0x05
133
137#define AUDIO_TERMINAL_TYPE_UNDEFINED 0x0100
138#define AUDIO_TERMINAL_TYPE_STREAMING 0x0101
139#define AUDIO_TERMINAL_TYPE_VENDOR 0x01FF
140#define AUDIO_INPUT_TERMINAL_UNDEFINED 0x0200
141#define AUDIO_INPUT_TERMINAL_MICROPHONE 0x0201
142#define AUDIO_OUTPUT_TERMINAL_UNDEFINED 0x0300
143#define AUDIO_OUTPUT_TERMINAL_SPEAKER 0x0301
144
148#define AUDIO_FORMAT_TYPE_I 0x01
149
153#define AUDIO_INTERFACE_NUM (AUDIO_SUPPORT_SPK + AUDIO_SUPPORT_MIC)
154#define AUDIO_INTERFACE_LEN ((0x08 + AUDIO_INTERFACE_NUM) + AUDIO_INTERFACE_NUM * 0x1E)
155#define AUDIO_MIC_INTERFACE 0x01
156#define AUDIO_SPK_INTERFACE 0x02
157
161#define AUDIO_INPUT_TERMINAL_SIZE 0x0C
162#define AUDIO_OUTPUT_TERMINAL_SIZE 0x09
163#define AUDIO_FEATURE_UNIT_SIZE 0x09
164
168#define AUDIO_MIC_INPUT_TERMINAL_ID 0x01
169#define AUDIO_MIC_FEATURE_UNIT_ID 0x02
170#define AUDIO_MIC_OUTPUT_TERMINAL_ID 0x03
171#define AUDIO_SPK_INPUT_TERMINAL_ID 0x04
172#define AUDIO_SPK_FEATURE_UNIT_ID 0x05
173#define AUDIO_SPK_OUTPUT_TERMINAL_ID 0x06
174
178#define AUDIO_MIC_INTERFACE_NUMBER 0x01
179#if (AUDIO_SUPPORT_MIC == 1)
180#define AUDIO_SPK_INTERFACE_NUMBER 0x02
181#else
182#define AUDIO_SPK_INTERFACE_NUMBER 0x01
183#endif
184
188#define AT32_AUDIO_FREQ_16K 16000
189#define AT32_AUDIO_FREQ_48K 48000
190
194#define AUDIO_MIC_FREQ_SIZE (AUDIO_SUPPORT_FREQ)
195#define AUDIO_MIC_CHR AUDIO_MIC_CHANEL_NUM
196#define AUDIO_MIC_BITW (AUDIO_MIC_DEFAULT_BITW)
197
201#define AUDIO_SPK_FREQ_SIZE (AUDIO_SUPPORT_FREQ)
202#define AUDIO_SPK_CHR AUDIO_SPK_CHANEL_NUM
203#define AUDIO_SPK_BITW (AUDIO_SPK_DEFAULT_BITW)
204
205#define HID_BINTERVAL_TIME 0x01
206
207
208#define USBD_CONFIG_DESC_SIZE ( 0x12 + AUDIO_INTERFACE_LEN + \
209 + (0x31 + AUDIO_SPK_FREQ_SIZE * 3) \
210 + (0x31 + AUDIO_MIC_FREQ_SIZE * 3) \
211 + (9 * AUDIO_SUPPORT_FEEDBACK) \
212 )
213#define SAMPLE_FREQ(frq) (uint8_t)(frq), (uint8_t)((frq >> 8)), (uint8_t)((frq >> 16))
214
215#define MCU_ID1 (0x1FFFF7E8)
216#define MCU_ID2 (0x1FFFF7EC)
217#define MCU_ID3 (0x1FFFF7F0)
218
219extern uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN];
220extern uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE];
221extern usbd_desc_handler audio_desc_handler;
222
234#ifdef __cplusplus
235}
236#endif
237
238#endif
239
audio_class.h
usb audio class file
audio_conf.h
usb audio config
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: audio_desc.h:208
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
audio_desc_handler
usbd_desc_handler audio_desc_handler
device descriptor handler structure
Definition: audio_desc.c:64
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: audio_conf.h Source File

  • middlewares
  • usbd_class
  • audio_hid
audio_hid/audio_conf.h
Go to the documentation of this file.
1
27 /* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AUDIO_CONF_H
29#define __AUDIO_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
47#define AUDIO_SUPPORT_SPK 1
48#define AUDIO_SUPPORT_MIC 1
49#define AUDIO_SUPPORT_FEEDBACK 1
50
51#define AUDIO_SUPPORT_FREQ_16K 0
52#define AUDIO_SUPPORT_FREQ_48K 1
53
54
55#define AUDIO_SUPPORT_FREQ (AUDIO_SUPPORT_FREQ_16K + \
56 AUDIO_SUPPORT_FREQ_48K \
57 )
58
59#define AUDIO_FREQ_16K 16000
60#define AUDIO_FREQ_48K 48000
61#define AUDIO_BITW_16 16
62
63#define AUDIO_MIC_CHANEL_NUM 2
64#define AUDIO_MIC_DEFAULT_BITW AUDIO_BITW_16
65
66#define AUDIO_SPK_CHANEL_NUM 2
67#define AUDIO_SPK_DEFAULT_BITW AUDIO_BITW_16
68
69
70#define AUDIO_SUPPORT_MAX_FREQ 48
71#define AUDIO_DEFAULT_FREQ AUDIO_FREQ_48K
72#define AUDIO_DEFAULT_BITW AUDIO_BITW_16
73
85#ifdef __cplusplus
86}
87#endif
88
89#endif
90


AT32F415 Firmwary Library: audio_hid_class.c Source File

  • middlewares
  • usbd_class
  • audio_hid
audio_hid_class.c
Go to the documentation of this file.
1
26#include "usbd_core.h"
27#include "audio_hid_class.h"
28#include "audio_hid_desc.h"
29#include "audio_codec.h"
30
44 usb_sts_type class_init_handler(void *udev);
45 usb_sts_type class_clear_handler(void *udev);
46 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup);
47 usb_sts_type class_ept0_tx_handler(void *udev);
48 usb_sts_type class_ept0_rx_handler(void *udev);
49 usb_sts_type class_in_handler(void *udev, uint8_t ept_num);
50 usb_sts_type class_out_handler(void *udev, uint8_t ept_num);
51 usb_sts_type class_sof_handler(void *udev);
52 usb_sts_type class_event_handler(void *udev, usbd_event_type event);
53
54void audio_inisoincom_event(void *udev);
55void audio_req_get_cur(void *udev, usb_setup_type *setup);
56void audio_req_set_cur(void *udev, usb_setup_type *setup);
57void audio_req_get_min(void *udev, usb_setup_type *setup);
58void audio_req_get_max(void *udev, usb_setup_type *setup);
59void audio_req_get_res(void *udev, usb_setup_type *setup);
60void audio_get_interface(void *udev, usb_setup_type *setup);
61void audio_set_interface(void *udev, usb_setup_type *setup);
62void usb_hid_buf_process(void *udev, uint8_t *report, uint16_t len);
63/* usb hid rx and tx buffer */
64static uint8_t g_rxhid_buff[USBD_OUT_MAXPACKET_SIZE];
65static uint8_t g_txhid_buff[USBD_IN_MAXPACKET_SIZE];
66
67 usb_audio_type audio_struct = {0, 0, 0, 0, 0, 0x1400, 0, 0, 0, {0x0000, 0x1400, 0x33}, {0x0000, 0x1400, 0x33}};
68/* custom hid static variable */
69static uint32_t hid_protocol = 0;
70static uint32_t hid_set_idle = 0;
71static uint32_t alt_setting = 0;
72static uint8_t hid_state;
73uint8_t hid_set_report[64];
74static __IO uint16_t audio_feedback_state = 0;
75static __IO uint8_t audio_spk_out_stage = 0;
76/* usb device class handler */
77usbd_class_handler audio_hid_class_handler =
78{
79 class_init_handler,
80 class_clear_handler,
81 class_setup_handler,
82 class_ept0_tx_handler,
83 class_ept0_rx_handler,
84 class_in_handler,
85 class_out_handler,
86 class_sof_handler,
87 class_event_handler,
88};
89
95 usb_sts_type class_init_handler(void *udev)
96{
97 usb_sts_type status = USB_OK;
98 usbd_core_type *pudev = (usbd_core_type *)udev;
99
100 /* open microphone in endpoint */
101 usbd_ept_open(pudev, USBD_AUDIO_MIC_IN_EPT, EPT_ISO_TYPE, AUDIO_MIC_IN_MAXPACKET_SIZE);
102
103 /* open speaker out endpoint */
104 usbd_ept_open(pudev, USBD_AUDIO_SPK_OUT_EPT, EPT_ISO_TYPE, AUDIO_SPK_OUT_MAXPACKET_SIZE);
105#if AUDIO_SUPPORT_FEEDBACK
106 /* open speaker feedback endpoint */
107 usbd_ept_open(pudev, USBD_AUDIO_FEEDBACK_EPT, EPT_ISO_TYPE, AUDIO_FEEDBACK_MAXPACKET_SIZE);
108#endif
109 /* start receive speaker out data */
110 usbd_ept_recv(pudev, USBD_AUDIO_SPK_OUT_EPT, audio_struct.audio_spk_data, AUDIO_SPK_OUT_MAXPACKET_SIZE);
111
112 /*open hid endpoint */
113 /* open custom hid in endpoint */
114 usbd_ept_open(pudev, USBD_HID_IN_EPT, EPT_INT_TYPE, USBD_IN_MAXPACKET_SIZE);
115
116 /* open custom hid out endpoint */
117 usbd_ept_open(pudev, USBD_HID_OUT_EPT, EPT_INT_TYPE, USBD_OUT_MAXPACKET_SIZE);
118
119 /* set out endpoint to receive status */
120 usbd_ept_recv(pudev, USBD_HID_OUT_EPT, g_rxhid_buff, USBD_OUT_MAXPACKET_SIZE);
121
122 return status;
123}
124
130 usb_sts_type class_clear_handler(void *udev)
131{
132 usb_sts_type status = USB_OK;
133 usbd_core_type *pudev = (usbd_core_type *)udev;
134
135 /* close in endpoint */
136 usbd_ept_close(pudev, USBD_AUDIO_MIC_IN_EPT);
137
138#if AUDIO_SUPPORT_FEEDBACK
139 /* close in endpoint */
140 usbd_ept_close(pudev, USBD_AUDIO_FEEDBACK_EPT);
141#endif
142
143 /* close out endpoint */
144 usbd_ept_close(pudev, USBD_AUDIO_SPK_OUT_EPT);
145
146 /* close custom hid in endpoint */
147 usbd_ept_close(pudev, USBD_HID_IN_EPT);
148
149 /* close custom hid out endpoint */
150 usbd_ept_close(pudev, USBD_HID_OUT_EPT);
151
152 return status;
153}
154
155
162 usb_sts_type class_audio_setup_handler(void *udev, usb_setup_type *setup)
163{
164 usb_sts_type status = USB_OK;
165 usbd_core_type *pudev = (usbd_core_type *)udev;
166 uint16_t len;
167 switch(setup->bmRequestType & USB_REQ_TYPE_RESERVED)
168 {
169 /* class request */
170 case USB_REQ_TYPE_CLASS:
171 switch(setup->bRequest)
172 {
173 case AUDIO_REQ_GET_CUR:
174 audio_req_get_cur(pudev, setup);
175 break;
176
177 case AUDIO_REQ_SET_CUR:
178 audio_req_set_cur(pudev, setup);
179 break;
180
181 case AUDIO_REQ_GET_MIN:
182 audio_req_get_min(pudev, setup);
183 break;
184
185 case AUDIO_REQ_GET_MAX:
186 audio_req_get_max(pudev, setup);
187 break;
188
189 case AUDIO_REQ_GET_RES:
190 audio_req_get_res(pudev, setup);
191 break;
192
193 default:
194 usbd_ctrl_unsupport(pudev);
195 break;
196 }
197 break;
198 /* standard request */
199 case USB_REQ_TYPE_STANDARD:
200 switch(setup->bRequest)
201 {
202 case USB_STD_REQ_GET_DESCRIPTOR:
203 if((setup->wValue >> 8) == AUDIO_DESCRIPTOR_TYPE)
204 {
205 len = MIN(AUDIO_DESCRIPTOR_SIZE, setup->wLength);
206 usbd_ctrl_send(pudev, g_usbd_configuration+18, len);
207 }
208 else
209 {
210 usbd_ctrl_unsupport(pudev);
211 }
212 break;
213 case USB_STD_REQ_GET_INTERFACE:
214 audio_get_interface(udev, setup);
215 break;
216
217 case USB_STD_REQ_SET_INTERFACE:
218 audio_set_interface(udev, setup);
219 usbd_ctrl_send_status(pudev);
220 break;
221
222 default:
223 break;
224 }
225 break;
226
227 default:
228 usbd_ctrl_unsupport(pudev);
229 break;
230 }
231 return status;
232
233}
234
241 usb_sts_type class_hid_setup_handler(void *udev, usb_setup_type *setup)
242{
243 usb_sts_type status = USB_OK;
244 usbd_core_type *pudev = (usbd_core_type *)udev;
245 uint16_t len;
246 uint8_t *buf;
247
248 switch(setup->bmRequestType & USB_REQ_TYPE_RESERVED)
249 {
250 /* class request */
251 case USB_REQ_TYPE_CLASS:
252 switch(setup->bRequest)
253 {
254 case HID_REQ_SET_PROTOCOL:
255 hid_protocol = (uint8_t)setup->wValue;
256 break;
257 case HID_REQ_GET_PROTOCOL:
258 usbd_ctrl_send(pudev, (uint8_t *)&hid_protocol, 1);
259 break;
260 case HID_REQ_SET_IDLE:
261 hid_set_idle = (uint8_t)(setup->wValue >> 8);
262 break;
263 case HID_REQ_GET_IDLE:
264 usbd_ctrl_send(pudev, (uint8_t *)&hid_set_idle, 1);
265 break;
266 case HID_REQ_SET_REPORT:
267 hid_state = HID_REQ_SET_REPORT;
268 usbd_ctrl_recv(pudev, hid_set_report, setup->wLength);
269 break;
270 default:
271 usbd_ctrl_unsupport(pudev);
272 break;
273 }
274 break;
275 /* standard request */
276 case USB_REQ_TYPE_STANDARD:
277 switch(setup->bRequest)
278 {
279 case USB_STD_REQ_GET_DESCRIPTOR:
280 if(setup->wValue >> 8 == HID_REPORT_DESC)
281 {
282 len = MIN(USBD_HID_SIZ_REPORT_DESC, setup->wLength);
283 buf = (uint8_t *)g_usbd_hid_report;
284 }
285 else if(setup->wValue >> 8 == HID_DESCRIPTOR_TYPE)
286 {
287 len = MIN(9, setup->wLength);
288 buf = (uint8_t *)g_hid_usb_desc;
289 }
290 usbd_ctrl_send(pudev, (uint8_t *)buf, len);
291 break;
292 case USB_STD_REQ_GET_INTERFACE:
293 usbd_ctrl_send(pudev, (uint8_t *)&alt_setting, 1);
294 break;
295 case USB_STD_REQ_SET_INTERFACE:
296 alt_setting = setup->wValue;
297 break;
298 default:
299 break;
300 }
301 break;
302 default:
303 usbd_ctrl_unsupport(pudev);
304 break;
305 }
306 return status;
307}
314 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
315{
316 usb_sts_type status = USB_OK;
317 usbd_core_type *pudev = (usbd_core_type *)udev;
318 switch(setup->bmRequestType & USB_REQ_RECIPIENT_MASK)
319 {
320 case USB_REQ_RECIPIENT_INTERFACE:
321 if(setup->wIndex == HID_INTERFACE_NUMBER)
322 {
323 class_hid_setup_handler(udev, setup);
324 }
325 else
326 {
327 class_audio_setup_handler(pudev, setup);
328 }
329 break;
330 case USB_REQ_RECIPIENT_ENDPOINT:
331 class_audio_setup_handler(pudev, setup);
332 break;
333
334 }
335 return status;
336
337
338}
339
345 usb_sts_type class_ept0_tx_handler(void *udev)
346{
347 usb_sts_type status = USB_OK;
348
349 /* ...user code... */
350
351 return status;
352}
353
359 usb_sts_type class_ept0_rx_handler(void *udev)
360{
361 usb_sts_type status = USB_OK;
362 usbd_core_type *pudev = (usbd_core_type *)udev;
363 usb_setup_type *setup = &pudev->setup;
364 uint32_t recv_len = usbd_get_recv_len(pudev, 0);
365
366 /* ...user code... */
367 if(setup->wIndex == HID_INTERFACE_NUMBER)
368 {
369 if( hid_state == HID_REQ_SET_REPORT)
370 {
371 /* hid buffer process */
372 usb_hid_buf_process(udev, hid_set_report, recv_len);
373 hid_state = 0;
374 }
375 }
376 else
377 {
378 /* ...user code... */
379 if( audio_struct.audio_cmd == AUDIO_REQ_SET_CUR)
380 {
381 /* class process */
382 switch(audio_struct.request_no)
383 {
384 case AUDIO_VOLUME_CONTROL:
385 if(audio_struct.interface == AUDIO_SPK_FEATURE_UNIT_ID)
386 {
387 audio_struct.spk_volume = (uint16_t)(audio_struct.g_audio_cur[0] |
388 (audio_struct.g_audio_cur[1] << 8));
389 /* set volume */
390 audio_codec_set_spk_volume(audio_struct.spk_volume*100/audio_struct.spk_volume_limits[1]);
391 }
392 else
393 {
394 audio_struct.mic_volume = (uint16_t)(audio_struct.g_audio_cur[0] |
395 (audio_struct.g_audio_cur[1] << 8));
396
397 audio_codec_set_mic_volume(audio_struct.mic_volume*256/audio_struct.mic_volume_limits[1]);
398 }
399 break;
400 case AUDIO_MUTE_CONTROL:
401 if(audio_struct.interface == AUDIO_SPK_FEATURE_UNIT_ID)
402 {
403 audio_struct.spk_mute = audio_struct.g_audio_cur[0];
404 audio_codec_set_spk_mute(audio_struct.spk_mute);
405 }
406 else
407 {
408 audio_struct.mic_mute = audio_struct.g_audio_cur[0];
409 audio_codec_set_mic_mute(audio_struct.mic_mute);
410 }
411
412 break;
413 case AUDIO_FREQ_SET_CONTROL:
414 if(audio_struct.enpd == USBD_AUDIO_MIC_IN_EPT)
415 {
416 audio_struct.mic_freq = (audio_struct.g_audio_cur[0] |
417 (audio_struct.g_audio_cur[1] << 8) |
418 (audio_struct.g_audio_cur[2] << 16));
419 audio_codec_set_mic_freq(audio_struct.mic_freq);
420 }
421 else
422 {
423 audio_struct.spk_freq = (audio_struct.g_audio_cur[0] |
424 (audio_struct.g_audio_cur[1] << 8) |
425 (audio_struct.g_audio_cur[2] << 16));
426 audio_codec_set_spk_freq(audio_struct.spk_freq);
427 }
428 break;
429 default:
430 break;
431 }
432 }
433 }
434
435 return status;
436}
437
444 usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
445{
446 usb_sts_type status = USB_OK;
447 uint32_t len = 0;
448
449 /* ...user code...
450 trans next packet data
451 */
452 if((ept_num & 0x7F) == (USBD_AUDIO_MIC_IN_EPT & 0x7F))
453 {
454 len = audio_codec_mic_get_data(audio_struct.audio_mic_data);
455 usbd_flush_tx_fifo(udev, USBD_AUDIO_MIC_IN_EPT);
456 usbd_ept_send(udev, USBD_AUDIO_MIC_IN_EPT, audio_struct.audio_mic_data, len);
457 }
458
459 else if((ept_num & 0x7F) == (USBD_AUDIO_FEEDBACK_EPT & 0x7F))
460 {
461 audio_feedback_state = 0;
462 }
463 else if((ept_num & 0x7F) == (USBD_HID_IN_EPT & 0x7F))
464 {
465 usbd_flush_tx_fifo(udev, USBD_HID_IN_EPT);
466 }
467
468 return status;
469}
470
477 usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
478{
479 usb_sts_type status = USB_OK;
480 usbd_core_type *pudev = (usbd_core_type *)udev;
481 uint16_t g_rxlen;
482
483 /* get endpoint receive data length */
484 g_rxlen = usbd_get_recv_len(pudev, ept_num);
485
486 if((ept_num & 0x7F) == (USBD_AUDIO_SPK_OUT_EPT & 0x7F))
487 {
488 /* speaker data*/
489 audio_codec_spk_fifo_write(audio_struct.audio_spk_data, g_rxlen);
490 audio_spk_out_stage = 1;
491 /* get next data */
492 usbd_ept_recv(pudev, USBD_AUDIO_SPK_OUT_EPT, audio_struct.audio_spk_data, AUDIO_SPK_OUT_MAXPACKET_SIZE);
493 }
494 else if((ept_num & 0x7F) == (USBD_HID_OUT_EPT & 0x7F))
495 {
496 /* hid buffer process */
497 usb_hid_buf_process(udev, g_rxhid_buff, g_rxlen);
498
499 /* start receive next packet */
500 usbd_ept_recv(pudev, USBD_HID_OUT_EPT, g_rxhid_buff, USBD_OUT_MAXPACKET_SIZE);
501 }
502 return status;
503}
504
510 usb_sts_type class_sof_handler(void *udev)
511{
512 usb_sts_type status = USB_OK;
513
514#if AUDIO_SUPPORT_FEEDBACK
515 if(audio_spk_out_stage & 2)
516 {
517 audio_spk_out_stage = 0;
518 }
519 else if( audio_spk_out_stage )
520 {
521 audio_spk_out_stage |= 2;
522
523 if( 0 == audio_feedback_state )
524 {
525 usbd_core_type *pudev = (usbd_core_type *)udev;
526 int len = audio_codec_spk_feedback(audio_struct.audio_feed_back);
527 usbd_ept_send(pudev, USBD_AUDIO_FEEDBACK_EPT, audio_struct.audio_feed_back, len);
528 audio_feedback_state = 1;
529 }
530 if( audio_feedback_state++ > (1<<FEEDBACK_REFRESH_TIME) ) //timeout
531 {
532 usbd_core_type *pudev = (usbd_core_type *)udev;
533 int len = audio_codec_spk_feedback(audio_struct.audio_feed_back);
534 usbd_flush_tx_fifo(pudev, USBD_AUDIO_FEEDBACK_EPT);
535 usbd_ept_send(pudev, USBD_AUDIO_FEEDBACK_EPT, audio_struct.audio_feed_back, len);
536 audio_feedback_state = 1;
537 }
538 }
539#endif
540 /* ...user code... */
541
542 return status;
543}
544
551 usb_sts_type class_event_handler(void *udev, usbd_event_type event)
552{
553 usb_sts_type status = USB_OK;
554 switch(event)
555 {
556 case USBD_RESET_EVENT:
557
558 /* ...user code... */
559
560 break;
561 case USBD_SUSPEND_EVENT:
562 audio_struct.spk_alt_setting = 0;
563 audio_codec_spk_alt_setting(audio_struct.spk_alt_setting);
564 audio_struct.mic_alt_setting = 0;
565 audio_codec_mic_alt_setting(audio_struct.spk_alt_setting);
566 /* ...user code... */
567
568 break;
569 case USBD_WAKEUP_EVENT:
570 /* ...user code... */
571
572 break;
573 case USBD_INISOINCOM_EVENT:
574 audio_inisoincom_event(udev);
575 break;
576
577 default:
578 break;
579 }
580 return status;
581}
582
588void audio_inisoincom_event(void *udev)
589{
590#if 0
591 usbd_core_type *pudev = (usbd_core_type *)udev;
592 uint32_t fnsof = OTG_DEVICE(pudev->usb_reg)->dsts_bit.soffn;
593 uint32_t epctl_fb = USB_INEPT(pudev->usb_reg, (USBD_AUDIO_FEEDBACK_EPT&0x7F))->diepctl_bit.dpid;
594 uint32_t epctl_in = USB_INEPT(pudev->usb_reg, (USBD_AUDIO_MIC_IN_EPT&0x7F))->diepctl_bit.dpid;
595 uint32_t len = 0;
596
597 if((fnsof & 0x1) == epctl_fb)
598 {
599 USB_INEPT(pudev->usb_reg, (USBD_AUDIO_FEEDBACK_EPT&0x7F))->diepctl_bit.eptdis = 1;
600 USB_INEPT(pudev->usb_reg, (USBD_AUDIO_FEEDBACK_EPT&0x7F))->diepctl_bit.snak = 1;
601 usb_flush_tx_fifo(pudev->usb_reg, USBD_AUDIO_FEEDBACK_EPT&0x7F);
602
603 usbd_ept_send(pudev, USBD_AUDIO_FEEDBACK_EPT, audio_struct.audio_feed_back, 3);
604 }
605
606 if((fnsof & 0x1) == epctl_in)
607 {
608 USB_INEPT(pudev->usb_reg, (USBD_AUDIO_MIC_IN_EPT&0x7F))->diepctl_bit.eptdis = 1;
609 USB_INEPT(pudev->usb_reg, (USBD_AUDIO_MIC_IN_EPT&0x7F))->diepctl_bit.snak = 1;
610 usb_flush_tx_fifo(pudev->usb_reg, USBD_AUDIO_MIC_IN_EPT&0x7F);
611
612 len = audio_codec_mic_get_data(audio_struct.audio_mic_data);
613 usbd_ept_send(pudev, USBD_AUDIO_MIC_IN_EPT, audio_struct.audio_mic_data, len);
614 }
615#endif
616}
617
624void audio_req_get_cur(void *udev, usb_setup_type *setup)
625{
626 usbd_core_type *pudev = (usbd_core_type *)udev;
627 if(HBYTE(setup->wIndex) == AUDIO_SPK_FEATURE_UNIT_ID)
628 {
629 if(HBYTE(setup->wValue) == AUDIO_MUTE_CONTROL)
630 {
631 audio_struct.g_audio_cur[0] = audio_struct.spk_mute;
632 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
633 }
634 else
635 {
636 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.spk_volume;
637 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
638 }
639 }
640 else
641 {
642 if(HBYTE(setup->wValue) == AUDIO_MUTE_CONTROL)
643 {
644 audio_struct.g_audio_cur[0] = audio_struct.mic_mute;
645 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
646 }
647 else
648 {
649 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.mic_volume;
650 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
651 }
652
653 }
654}
655
662void audio_req_set_cur(void *udev, usb_setup_type *setup)
663{
664 usbd_core_type *pudev = (usbd_core_type *)udev;
665 if(setup->wLength > 0)
666 {
667 usbd_ctrl_recv(pudev, audio_struct.g_audio_cur, setup->wLength);
668
669 audio_struct.audio_cmd = AUDIO_REQ_SET_CUR;
670 audio_struct.audio_cmd_len = setup->wLength;
671
672 switch(setup->bmRequestType & AUDIO_REQ_CONTROL_MASK)
673 {
674 case AUDIO_REQ_CONTROL_INTERFACE:
675 audio_struct.interface = HBYTE(setup->wIndex);
676 if(HBYTE(setup->wValue) == AUDIO_MUTE_CONTROL)
677 {
678 audio_struct.request_no = AUDIO_MUTE_CONTROL;
679 }
680 else
681 {
682 audio_struct.request_no = AUDIO_VOLUME_CONTROL;
683 }
684 break;
685 case AUDIO_REQ_CONTROL_ENDPOINT:
686 audio_struct.enpd = setup->wIndex;
687 audio_struct.request_no = AUDIO_FREQ_SET_CONTROL;
688 break;
689 default:
690 break;
691 }
692 }
693}
694
701void audio_req_get_min(void *udev, usb_setup_type *setup)
702{
703 usbd_core_type *pudev = (usbd_core_type *)udev;
704 if(HBYTE(setup->wIndex) == AUDIO_SPK_FEATURE_UNIT_ID)
705 {
706 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.spk_volume_limits[0];
707 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
708 }
709 else
710 {
711 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.mic_volume_limits[0];
712 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
713 }
714}
715
722void audio_req_get_max(void *udev, usb_setup_type *setup)
723{
724 usbd_core_type *pudev = (usbd_core_type *)udev;
725 if(HBYTE(setup->wIndex) == AUDIO_SPK_FEATURE_UNIT_ID)
726 {
727 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.spk_volume_limits[1];
728 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
729 }
730 else
731 {
732 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.mic_volume_limits[1];
733 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
734 }
735}
736
743void audio_req_get_res(void *udev, usb_setup_type *setup)
744{
745 usbd_core_type *pudev = (usbd_core_type *)udev;
746 if(HBYTE(setup->wIndex) == AUDIO_SPK_FEATURE_UNIT_ID)
747 {
748 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.spk_volume_limits[2];
749 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
750 }
751 else
752 {
753 *((uint16_t *)audio_struct.g_audio_cur) = audio_struct.mic_volume_limits[2];
754 usbd_ctrl_send(pudev, audio_struct.g_audio_cur, setup->wLength);
755 }
756}
757
764void audio_set_interface(void *udev, usb_setup_type *setup)
765{
766 uint32_t len;
767 usbd_core_type *pudev = (usbd_core_type *)udev;
768 if(LBYTE(setup->wIndex) == AUDIO_SPK_INTERFACE_NUMBER)
769 {
770 audio_struct.spk_alt_setting = setup->wValue;
771 audio_codec_spk_alt_setting(audio_struct.spk_alt_setting);
772 if(audio_struct.spk_alt_setting )
773 {
774 usbd_ept_recv(pudev, USBD_AUDIO_SPK_OUT_EPT, audio_struct.audio_spk_data, AUDIO_SPK_OUT_MAXPACKET_SIZE);
775 }
776
777 }
778 else if(LBYTE(setup->wIndex) == AUDIO_MIC_INTERFACE_NUMBER)
779 {
780 audio_struct.mic_alt_setting = setup->wValue;
781 audio_codec_mic_alt_setting(audio_struct.mic_alt_setting);
782 if(audio_struct.mic_alt_setting)
783 {
784 len = audio_codec_mic_get_data(audio_struct.audio_mic_data);
785 usbd_ept_send(pudev, USBD_AUDIO_MIC_IN_EPT, audio_struct.audio_mic_data, len);
786 }
787 }
788
789}
790
797void audio_get_interface(void *udev, usb_setup_type *setup)
798{
799 usbd_core_type *pudev = (usbd_core_type *)udev;
800 if(LBYTE(setup->wIndex) == AUDIO_SPK_INTERFACE_NUMBER)
801 {
802 usbd_ctrl_send(pudev, (uint8_t *)&audio_struct.spk_alt_setting, 1);
803 }
804 else if(LBYTE(setup->wIndex) == AUDIO_MIC_INTERFACE_NUMBER)
805 {
806 usbd_ctrl_send(pudev, (uint8_t *)&audio_struct.mic_alt_setting, 1);
807 }
808
809}
810
818 usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
819{
820 usb_sts_type status = USB_OK;
821 usbd_core_type *pudev = (usbd_core_type *)udev;
822
823 if(usbd_connect_state_get(pudev) == USB_CONN_STATE_CONFIGURED)
824 usbd_ept_send(pudev, USBD_HID_IN_EPT, report, len);
825
826 return status;
827}
828
829
837void usb_hid_buf_process(void *udev, uint8_t *report, uint16_t len)
838{
839 uint32_t i_index;
840 usbd_core_type *pudev = (usbd_core_type *)udev;
841
842 switch(report[0])
843 {
844 case HID_REPORT_ID_2:
845 if(g_rxhid_buff[1] == 0)
846 {
847 at32_led_off(LED2);
848 }
849 else
850 {
851 at32_led_on(LED2);
852 }
853 break;
854 case HID_REPORT_ID_3:
855 if(g_rxhid_buff[1] == 0)
856 {
857 at32_led_off(LED3);
858 }
859 else
860 {
861 at32_led_on(LED3);
862 }
863 break;
864 case HID_REPORT_ID_4:
865 if(g_rxhid_buff[1] == 0)
866 {
867 at32_led_off(LED4);
868 }
869 else
870 {
871 at32_led_on(LED4);
872 }
873 break;
874 case HID_REPORT_ID_6:
875 for(i_index = 0; i_index < len; i_index ++)
876 {
877 g_txhid_buff[i_index] = report[i_index];
878 }
879 usbd_ept_send(pudev, USBD_HID_IN_EPT, g_txhid_buff, len);
880 default:
881 break;
882 }
883
884}
885
886
audio_hid_class.h
audio_hid_desc.h
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
AUDIO_DESCRIPTOR_TYPE
#define AUDIO_DESCRIPTOR_TYPE
audio descriptor type
Definition: audio_class.h:83
AUDIO_MIC_IN_MAXPACKET_SIZE
#define AUDIO_MIC_IN_MAXPACKET_SIZE
Definition: audio_class.h:62
AUDIO_MUTE_CONTROL
#define AUDIO_MUTE_CONTROL
audio set cur type define
Definition: audio_class.h:76
AUDIO_REQ_CONTROL_INTERFACE
#define AUDIO_REQ_CONTROL_INTERFACE
request type define
Definition: audio_class.h:69
AUDIO_SPK_OUT_MAXPACKET_SIZE
#define AUDIO_SPK_OUT_MAXPACKET_SIZE
Definition: audio_class.h:63
AUDIO_VOLUME_CONTROL
#define AUDIO_VOLUME_CONTROL
Definition: audio_class.h:77
AUDIO_FREQ_SET_CONTROL
#define AUDIO_FREQ_SET_CONTROL
Definition: audio_class.h:78
AUDIO_REQ_CONTROL_ENDPOINT
#define AUDIO_REQ_CONTROL_ENDPOINT
Definition: audio_class.h:70
FEEDBACK_REFRESH_TIME
#define FEEDBACK_REFRESH_TIME
Definition: audio_class.h:65
AUDIO_REQ_CONTROL_MASK
#define AUDIO_REQ_CONTROL_MASK
Definition: audio_class.h:71
USBD_AUDIO_SPK_OUT_EPT
#define USBD_AUDIO_SPK_OUT_EPT
Definition: audio_class.h:55
USBD_AUDIO_MIC_IN_EPT
#define USBD_AUDIO_MIC_IN_EPT
endpoint define
Definition: audio_class.h:54
AUDIO_DESCRIPTOR_SIZE
#define AUDIO_DESCRIPTOR_SIZE
Definition: audio_class.h:84
USBD_AUDIO_FEEDBACK_EPT
#define USBD_AUDIO_FEEDBACK_EPT
Definition: audio_class.h:56
AUDIO_FEEDBACK_MAXPACKET_SIZE
#define AUDIO_FEEDBACK_MAXPACKET_SIZE
Definition: audio_class.h:64
AUDIO_REQ_GET_CUR
#define AUDIO_REQ_GET_CUR
Definition: audio_desc.h:113
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112
AUDIO_SPK_INTERFACE_NUMBER
#define AUDIO_SPK_INTERFACE_NUMBER
Definition: audio_desc.h:180
AUDIO_MIC_INTERFACE_NUMBER
#define AUDIO_MIC_INTERFACE_NUMBER
audio interface number
Definition: audio_desc.h:178
AUDIO_REQ_GET_MAX
#define AUDIO_REQ_GET_MAX
Definition: audio_desc.h:117
AUDIO_REQ_GET_MIN
#define AUDIO_REQ_GET_MIN
Definition: audio_desc.h:115
AUDIO_SPK_FEATURE_UNIT_ID
#define AUDIO_SPK_FEATURE_UNIT_ID
Definition: audio_desc.h:172
AUDIO_REQ_GET_RES
#define AUDIO_REQ_GET_RES
Definition: audio_desc.h:119
AUDIO_REQ_SET_CUR
#define AUDIO_REQ_SET_CUR
Definition: audio_desc.h:112
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
HID_DESCRIPTOR_TYPE
#define HID_DESCRIPTOR_TYPE
Definition: audio_hid_class.h:118
USBD_HID_OUT_EPT
#define USBD_HID_OUT_EPT
Definition: audio_hid_class.h:62
HID_REQ_GET_PROTOCOL
#define HID_REQ_GET_PROTOCOL
Definition: audio_hid_class.h:113
USBD_HID_IN_EPT
#define USBD_HID_IN_EPT
usb custom hid use endpoint define
Definition: audio_hid_class.h:61
HID_REQ_SET_PROTOCOL
#define HID_REQ_SET_PROTOCOL
usb custom hid class request code define
Definition: audio_hid_class.h:112
HID_REPORT_DESC
#define HID_REPORT_DESC
Definition: audio_hid_class.h:119
HID_REQ_SET_IDLE
#define HID_REQ_SET_IDLE
Definition: audio_hid_class.h:114
HID_REQ_GET_IDLE
#define HID_REQ_GET_IDLE
Definition: audio_hid_class.h:115
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
HID_REQ_SET_REPORT
#define HID_REQ_SET_REPORT
Definition: audio_hid_class.h:116
audio_spk_out_stage
static __IO uint8_t audio_spk_out_stage
Definition: audio_hid_class.c:75
audio_feedback_state
static __IO uint16_t audio_feedback_state
Definition: audio_hid_class.c:74
audio_req_get_cur
void audio_req_get_cur(void *udev, usb_setup_type *setup)
usb audio request get cur
Definition: audio_hid_class.c:624
audio_req_get_max
void audio_req_get_max(void *udev, usb_setup_type *setup)
usb audio request get max
Definition: audio_hid_class.c:722
audio_get_interface
void audio_get_interface(void *udev, usb_setup_type *setup)
usb audio get interface
Definition: audio_hid_class.c:797
audio_inisoincom_event
void audio_inisoincom_event(void *udev)
usb audio in iso incom event
Definition: audio_hid_class.c:588
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: audio_hid_class.c:551
audio_hid_class_handler
usbd_class_handler audio_hid_class_handler
Definition: audio_hid_class.c:77
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: audio_hid_class.c:510
hid_set_idle
static uint32_t hid_set_idle
Definition: audio_hid_class.c:70
audio_req_set_cur
void audio_req_set_cur(void *udev, usb_setup_type *setup)
usb audio request set cur
Definition: audio_hid_class.c:662
class_hid_setup_handler
usb_sts_type class_hid_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: audio_hid_class.c:241
audio_struct
usb_audio_type audio_struct
Definition: audio_hid_class.c:67
g_txhid_buff
static uint8_t g_txhid_buff[0x40]
Definition: audio_hid_class.c:65
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: audio_hid_class.c:314
hid_set_report
uint8_t hid_set_report[64]
Definition: audio_hid_class.c:73
alt_setting
static uint32_t alt_setting
Definition: audio_hid_class.c:71
audio_set_interface
void audio_set_interface(void *udev, usb_setup_type *setup)
usb audio set interface
Definition: audio_hid_class.c:764
g_rxhid_buff
static uint8_t g_rxhid_buff[0x40]
Definition: audio_hid_class.c:64
audio_req_get_min
void audio_req_get_min(void *udev, usb_setup_type *setup)
usb audio request get min
Definition: audio_hid_class.c:701
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: audio_hid_class.c:345
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: audio_hid_class.c:818
hid_protocol
static uint32_t hid_protocol
Definition: audio_hid_class.c:69
usb_hid_buf_process
void usb_hid_buf_process(void *udev, uint8_t *report, uint16_t len)
usb device report function
Definition: audio_hid_class.c:837
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: audio_hid_class.c:444
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb custom hid endpoint
Definition: audio_hid_class.c:95
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: audio_hid_class.c:359
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: audio_hid_class.c:477
hid_state
static uint8_t hid_state
Definition: audio_hid_class.c:72
audio_req_get_res
void audio_req_get_res(void *udev, usb_setup_type *setup)
usb audio request get res
Definition: audio_hid_class.c:743
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: audio_hid_class.c:130
class_audio_setup_handler
usb_sts_type class_audio_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: audio_hid_class.c:162
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
HID_REPORT_ID_2
#define HID_REPORT_ID_2
Definition: audio_hid_desc.h:224
HID_REPORT_ID_4
#define HID_REPORT_ID_4
Definition: audio_hid_desc.h:226
HID_REPORT_ID_6
#define HID_REPORT_ID_6
Definition: audio_hid_desc.h:228
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: audio_hid_desc.h:236
HID_REPORT_ID_3
#define HID_REPORT_ID_3
Definition: audio_hid_desc.h:225
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
usb hid descriptor
Definition: audio_hid_desc.c:527
HID_INTERFACE_NUMBER
#define HID_INTERFACE_NUMBER
Definition: audio_hid_desc.h:184
g_rxlen
static uint16_t g_rxlen
Definition: cdc_class.c:60
audio_codec_mic_alt_setting
void audio_codec_mic_alt_setting(uint32_t alt_seting)
audio codec microphone alt setting config
Definition: audio/src/audio_codec.c:169
audio_codec_set_spk_volume
void audio_codec_set_spk_volume(uint16_t volume)
audio codec set speaker volume
Definition: audio/src/audio_codec.c:217
audio_codec_set_spk_mute
void audio_codec_set_spk_mute(uint8_t mute)
audio codec set speaker mute
Definition: audio/src/audio_codec.c:195
audio_codec_set_mic_freq
void audio_codec_set_mic_freq(uint32_t freq)
audio codec set microphone freq
Definition: audio/src/audio_codec.c:121
audio_codec_mic_get_data
uint32_t audio_codec_mic_get_data(uint8_t *buffer)
codec microphone get data
Definition: audio/src/audio_codec.c:282
audio_codec_set_mic_mute
void audio_codec_set_mic_mute(uint8_t mute)
audio codec set microphone mute
Definition: audio/src/audio_codec.c:184
audio_codec_spk_fifo_write
void audio_codec_spk_fifo_write(uint8_t *data, uint32_t len)
audio codec interface
Definition: audio/src/audio_codec.c:244
audio_codec_spk_feedback
uint8_t audio_codec_spk_feedback(uint8_t *feedback)
codec speaker feedback
Definition: audio/src/audio_codec.c:228
audio_codec_set_mic_volume
void audio_codec_set_mic_volume(uint16_t volume)
audio codec set microphone volume
Definition: audio/src/audio_codec.c:206
audio_codec_spk_alt_setting
void audio_codec_spk_alt_setting(uint32_t alt_seting)
audio codec speaker alt setting config
Definition: audio/src/audio_codec.c:154
audio_codec_set_spk_freq
void audio_codec_set_spk_freq(uint32_t freq)
audio codec set speaker freq
Definition: audio/src/audio_codec.c:137
EPT_ISO_TYPE
@ EPT_ISO_TYPE
Definition: at32f415_usb.h:347
EPT_INT_TYPE
@ EPT_INT_TYPE
Definition: at32f415_usb.h:349
usb_flush_tx_fifo
void usb_flush_tx_fifo(otg_global_type *usbx, uint32_t fifo_num)
flush tx fifo
Definition: at32f415_usb.c:119
OTG_DEVICE
#define OTG_DEVICE(usbx)
Definition: at32f415_usb.h:1342
USB_INEPT
#define USB_INEPT(usbx, eptn)
Definition: at32f415_usb.h:1345
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
MIN
#define MIN(a, b)
min and max define
Definition: usb_std.h:204
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
USB_STD_REQ_GET_DESCRIPTOR
#define USB_STD_REQ_GET_DESCRIPTOR
Definition: usb_std.h:81
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_REQ_RECIPIENT_MASK
#define USB_REQ_RECIPIENT_MASK
Definition: usb_std.h:58
USB_STD_REQ_SET_INTERFACE
#define USB_STD_REQ_SET_INTERFACE
Definition: usb_std.h:86
USB_REQ_TYPE_RESERVED
#define USB_REQ_TYPE_RESERVED
Definition: usb_std.h:66
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_STD_REQ_GET_INTERFACE
#define USB_STD_REQ_GET_INTERFACE
Definition: usb_std.h:85
USB_REQ_RECIPIENT_ENDPOINT
#define USB_REQ_RECIPIENT_ENDPOINT
Definition: usb_std.h:56
USB_REQ_RECIPIENT_INTERFACE
#define USB_REQ_RECIPIENT_INTERFACE
Definition: usb_std.h:55
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usb_std.h:64
USB_CONN_STATE_CONFIGURED
@ USB_CONN_STATE_CONFIGURED
Definition: usb_std.h:131
USB_OK
@ USB_OK
Definition: usb_std.h:218
usbd_connect_state_get
usbd_conn_state usbd_connect_state_get(usbd_core_type *udev)
get usb connect state
Definition: usbd_core.c:592
usbd_ept_close
void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint
Definition: usbd_core.c:341
usbd_ctrl_send_status
void usbd_ctrl_send_status(usbd_core_type *udev)
usb control endpoint send in status
Definition: usbd_core.c:207
usbd_ept_recv
void usbd_ept_recv(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint receive data
Definition: usbd_core.c:529
usbd_flush_tx_fifo
void usbd_flush_tx_fifo(usbd_core_type *udev, uint8_t ept_num)
usb device flush in endpoint fifo
Definition: usbd_core.c:645
usbd_ept_open
void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint
Definition: usbd_core.c:309
usbd_ctrl_send
void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data
Definition: usbd_core.c:174
usbd_ept_send
void usbd_ept_send(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data
Definition: usbd_core.c:429
usbd_get_recv_len
uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length
Definition: usbd_core.c:295
usbd_ctrl_recv
void usbd_ctrl_recv(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint recv data
Definition: usbd_core.c:192
usbd_ctrl_unsupport
void usbd_ctrl_unsupport(usbd_core_type *udev)
un-support device request
Definition: usbd_core.c:282
usb_audio_type
usb audio control struct
Definition: audio_class.h:90
usb_audio_type::mic_alt_setting
uint32_t mic_alt_setting
Definition: audio_class.h:106
usb_audio_type::spk_volume_limits
uint16_t spk_volume_limits[3]
Definition: audio_class.h:100
usb_audio_type::enpd
uint8_t enpd
Definition: audio_class.h:91
usb_audio_type::g_audio_cur
uint8_t g_audio_cur[64]
Definition: audio_class.h:107
usb_audio_type::mic_freq
uint32_t mic_freq
Definition: audio_class.h:99
usb_audio_type::mic_volume_limits
uint16_t mic_volume_limits[3]
Definition: audio_class.h:101
usb_audio_type::audio_mic_data
uint8_t audio_mic_data[(48 *2 *(16/8)+40)]
Definition: audio_class.h:109
usb_audio_type::interface
uint8_t interface
Definition: audio_class.h:92
usb_audio_type::audio_feed_back
uint8_t audio_feed_back[0x3+1]
Definition: audio_class.h:110
usb_audio_type::audio_cmd_len
uint32_t audio_cmd_len
Definition: audio_class.h:104
usb_audio_type::spk_alt_setting
uint32_t spk_alt_setting
Definition: audio_class.h:105
usb_audio_type::spk_volume
uint16_t spk_volume
Definition: audio_class.h:96
usb_audio_type::mic_volume
uint16_t mic_volume
Definition: audio_class.h:97
usb_audio_type::audio_spk_data
uint8_t audio_spk_data[(48 *2 *(16/8)+40)]
Definition: audio_class.h:108
usb_audio_type::spk_freq
uint32_t spk_freq
Definition: audio_class.h:98
usb_audio_type::spk_mute
uint8_t spk_mute
Definition: audio_class.h:94
usb_audio_type::request_no
uint8_t request_no
Definition: audio_class.h:93
usb_audio_type::audio_cmd
uint8_t audio_cmd
Definition: audio_class.h:103
usb_audio_type::mic_mute
uint8_t mic_mute
Definition: audio_class.h:95
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_setup_type::wValue
uint16_t wValue
Definition: usb_std.h:233
usb_setup_type::wLength
uint16_t wLength
Definition: usb_std.h:236
usb_setup_type::bmRequestType
uint8_t bmRequestType
Definition: usb_std.h:231
usb_setup_type::wIndex
uint16_t wIndex
Definition: usb_std.h:234
usb_setup_type::bRequest
uint8_t bRequest
Definition: usb_std.h:232
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: audio_hid_class.h Source File

  • middlewares
  • usbd_class
  • audio_hid
audio_hid_class.h
Go to the documentation of this file.
1
27 /* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AUDIO_CLASS_H
29#define __AUDIO_CLASS_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "usb_std.h"
36#include "usbd_core.h"
37#include "audio_conf.h"
38
54#define USBD_AUDIO_MIC_IN_EPT 0x81
55#define USBD_AUDIO_SPK_OUT_EPT 0x02
56#define USBD_AUDIO_FEEDBACK_EPT 0x83
57
61#define USBD_HID_IN_EPT 0x82
62#define USBD_HID_OUT_EPT 0x01
63
67#define USBD_IN_MAXPACKET_SIZE 0x40
68#define USBD_OUT_MAXPACKET_SIZE 0x40
69
73#define AUDIO_REMAIN_SIZE 40
74#define AUDIO_MIC_IN_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_MIC_CHANEL_NUM * (AUDIO_MIC_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)
75#define AUDIO_SPK_OUT_MAXPACKET_SIZE (AUDIO_SUPPORT_MAX_FREQ * AUDIO_SPK_CHANEL_NUM * (AUDIO_SPK_DEFAULT_BITW / 8) + AUDIO_REMAIN_SIZE)
76#define AUDIO_FEEDBACK_MAXPACKET_SIZE 0x3
77#define FEEDBACK_REFRESH_TIME 0x8
81#define AUDIO_REQ_CONTROL_INTERFACE 0x01
82#define AUDIO_REQ_CONTROL_ENDPOINT 0x02
83#define AUDIO_REQ_CONTROL_MASK 0x03
84
88#define AUDIO_MUTE_CONTROL 0x01
89#define AUDIO_VOLUME_CONTROL 0x02
90#define AUDIO_FREQ_SET_CONTROL 0x03
91
99#define AUDIO_MUTE_CONTROL 0x01
100#define AUDIO_VOLUME_CONTROL 0x02
101#define AUDIO_FREQ_SET_CONTROL 0x03
102
106#define AUDIO_DESCRIPTOR_TYPE 0x21
107#define AUDIO_DESCRIPTOR_SIZE 0x09
108
112#define HID_REQ_SET_PROTOCOL 0x0B
113#define HID_REQ_GET_PROTOCOL 0x03
114#define HID_REQ_SET_IDLE 0x0A
115#define HID_REQ_GET_IDLE 0x02
116#define HID_REQ_SET_REPORT 0x09
117#define HID_REQ_GET_REPORT 0x01
118#define HID_DESCRIPTOR_TYPE 0x21
119#define HID_REPORT_DESC 0x22
120
121
125typedef struct
126{
127 uint8_t enpd;
128 uint8_t interface;
129 uint8_t request_no;
130 uint8_t spk_mute;
131 uint8_t mic_mute;
132 uint16_t spk_volume;
133 uint16_t mic_volume;
134 uint32_t spk_freq;
135 uint32_t mic_freq;
136 uint16_t spk_volume_limits[3]; /*[0] is mininum value, [1] is maxnum value, [2] is volume resolution */
137 uint16_t mic_volume_limits[3]; /*[0] is mininum value, [1] is maxnum value, [2] is volume resolution */
138
139 uint8_t audio_cmd;
140 uint32_t audio_cmd_len;
141 uint32_t spk_alt_setting;
142 uint32_t mic_alt_setting;
143 uint8_t g_audio_cur[64];
144 uint8_t audio_spk_data[AUDIO_SPK_OUT_MAXPACKET_SIZE];
145 uint8_t audio_mic_data[AUDIO_MIC_IN_MAXPACKET_SIZE];
146 uint8_t audio_feed_back[AUDIO_FEEDBACK_MAXPACKET_SIZE+1];
147}usb_audio_type;
148
149extern usbd_class_handler audio_hid_class_handler;
150
151 usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len);
152
164#ifdef __cplusplus
165}
166#endif
167
168#endif
audio_conf.h
usb audio config
AUDIO_MIC_IN_MAXPACKET_SIZE
#define AUDIO_MIC_IN_MAXPACKET_SIZE
Definition: audio_hid_class.h:74
audio_hid_class_handler
usbd_class_handler audio_hid_class_handler
Definition: audio_hid_class.c:77
AUDIO_SPK_OUT_MAXPACKET_SIZE
#define AUDIO_SPK_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:75
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: audio_hid_class.c:818
AUDIO_FEEDBACK_MAXPACKET_SIZE
#define AUDIO_FEEDBACK_MAXPACKET_SIZE
Definition: audio_hid_class.h:76
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
usb_audio_type
usb audio control struct
Definition: audio_class.h:90
usb_std.h
usb standard header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: audio_hid_desc.c Source File

  • middlewares
  • usbd_class
  • audio_hid
audio_hid_desc.c
Go to the documentation of this file.
1
26#include "usb_std.h"
27#include "usbd_sdr.h"
28#include "usbd_core.h"
29#include "audio_hid_desc.h"
30
45usbd_desc_t *get_device_descriptor(void);
46usbd_desc_t *get_device_qualifier(void);
47usbd_desc_t *get_device_configuration(void);
48usbd_desc_t *get_device_other_speed(void);
49usbd_desc_t *get_device_lang_id(void);
50usbd_desc_t *get_device_manufacturer_string(void);
51usbd_desc_t *get_device_product_string(void);
52usbd_desc_t *get_device_serial_string(void);
53usbd_desc_t *get_device_interface_string(void);
54usbd_desc_t *get_device_config_string(void);
55
56uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf);
57static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len);
58static void get_serial_num(void);
59static uint8_t g_usbd_desc_buffer[256];
60
64usbd_desc_handler audio_hid_desc_handler =
65{
66 get_device_descriptor,
67 get_device_qualifier,
68 get_device_configuration,
69 get_device_other_speed,
70 get_device_lang_id,
71 get_device_manufacturer_string,
72 get_device_product_string,
73 get_device_serial_string,
74 get_device_interface_string,
75 get_device_config_string,
76};
77
81#if defined ( __ICCARM__ ) /* iar compiler */
82 #pragma data_alignment=4
83#endif
84ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL =
85{
86 USB_DEVICE_DESC_LEN, /* bLength */
87 USB_DESCIPTOR_TYPE_DEVICE, /* bDescriptorType */
88 0x00, /* bcdUSB */
89 0x02,
90 0x00, /* bDeviceClass */
91 0x00, /* bDeviceSubClass */
92 0x00, /* bDeviceProtocol */
93 USB_MAX_EP0_SIZE, /* bMaxPacketSize */
94 LBYTE(USBD_VENDOR_ID), /* idVendor */
95 HBYTE(USBD_VENDOR_ID), /* idVendor */
96#if AUDIO_SUPPORT_FEEDBACK
97 LBYTE(USBD_PRODUCT_ID), /* idProduct */
98 HBYTE(USBD_PRODUCT_ID), /* idProduct */
99#else
100 LBYTE(USBD_PRODUCT_ID+1), /* idProduct */
101 HBYTE(USBD_PRODUCT_ID+1), /* idProduct */
102#endif
103 0x00, /* bcdDevice rel. 2.00 */
104 0x02,
105 USB_MFC_STRING, /* Index of manufacturer string */
106 USB_PRODUCT_STRING, /* Index of product string */
107 USB_SERIAL_STRING, /* Index of serial number string */
108 0x01 /* bNumConfigurations */
109};
110
114#if defined ( __ICCARM__ ) /* iar compiler */
115 #pragma data_alignment=4
116#endif
117ALIGNED_HEAD uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE] ALIGNED_TAIL =
118{
119 USB_DEVICE_CFG_DESC_LEN, /* bLength: configuration descriptor size */
120 USB_DESCIPTOR_TYPE_CONFIGURATION, /* bDescriptorType: configuration */
121 LBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
122 HBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
123 0x1 + AUDIO_INTERFACE_NUM + 0x1, /* bNumInterfaces: n interface */
124 0x01, /* bConfigurationValue: configuration value */
125 0x00, /* iConfiguration: index of string descriptor describing
126 the configuration */
127 0xC0, /* bmAttributes: self powered */
128 0x32, /* MaxPower 100 mA: this current is used for detecting vbus */
129
130 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
131 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
132 0x00, /* bInterfaceNumber: number of interface */
133 0x00, /* bAlternateSetting: alternate set */
134 0x00, /* bNumEndpoints: number of endpoints */
135 USB_CLASS_CODE_AUDIO, /* bInterfaceClass: audio class code */
136 AUDIO_SUBCLASS_AUDIOCONTROL, /* bInterfaceSubClass: audio control */
137 AUDIO_PROTOCOL_UNDEFINED, /* bInterfaceProtocol: undefined */
138 0x00, /* iInterface: index of string descriptor */
139
140 0x08+AUDIO_INTERFACE_NUM, /* bLength: size of this descriptor, in bytes 8+n */
141 AUDIO_CS_INTERFACE, /* bDescriptorType: cs interface descriptor type */
142 AUDIO_AC_HEADER, /* bDescriptorSubtype: Header function Descriptor*/
143 LBYTE(BCD_NUM),
144 HBYTE(BCD_NUM), /* bcdCDC: audio device class specification release number */
145 LBYTE(AUDIO_INTERFACE_LEN),
146 HBYTE(AUDIO_INTERFACE_LEN), /* wTotalLength: total number of bytes returned for the class-specific audio control interface */
147 AUDIO_INTERFACE_NUM, /* bInClollection: the number of audio streaming */
148#if (AUDIO_INTERFACE_NUM == 2) /* two interface */
149 0x02,
150 0x01,
151#else
152 0x01,
153#endif
154
155 /* usb microphone config */
156#if (AUDIO_SUPPORT_MIC == 1)
157 AUDIO_INPUT_TERMINAL_SIZE, /* bLength: descriptor size */
158 AUDIO_CS_INTERFACE, /* bDescriptorType: configuration */
159 AUDIO_AC_INPUT_TERMINAL, /* bDescriptorSubtype: input_terminal type*/
160 AUDIO_MIC_INPUT_TERMINAL_ID, /* bTerminalID: id of this input terminal*/
161 LBYTE(AUDIO_INPUT_TERMINAL_MICROPHONE),
162 HBYTE(AUDIO_INPUT_TERMINAL_MICROPHONE),/* wTerminalType: terminal is microphone */
163 AUDIO_MIC_OUTPUT_TERMINAL_ID, /* bAssocTerminal: no association */
164 AUDIO_MIC_CHR, /* bNrChannels: two channel */
165#if (AUDIO_MIC_CHR == 2)
166 0x03, /* wChannelConfig: left front and right front */
167#endif
168#if (AUDIO_MIC_CHR == 1)
169 0x00, /* wChannelConfig */
170#endif
171 0x00, /* wChannelConfig */
172 0x00, /* iChannelNames: unused */
173 0x00, /* iTerminal: unused */
174
175 AUDIO_FEATURE_UNIT_SIZE, /* bLength: descriptor size */
176 AUDIO_CS_INTERFACE, /* bDescriptorType: configuration */
177 AUDIO_AC_FEATURE_UNIT, /* bDescriptorSubtype: feature unit type*/
178 AUDIO_MIC_FEATURE_UNIT_ID, /* bUnitID: id of this feature unit */
179 AUDIO_MIC_INPUT_TERMINAL_ID, /* bSourceID: from input terminal */
180 0x01, /* bControlSize: 1 byte */
181 0x01, /* bmaControls0: mute */
182 0x02, /* bmaControls1: volume */
183 0x00, /* iFeature: unused */
184
185 AUDIO_OUTPUT_TERMINAL_SIZE, /* bLength: descriptor size */
186 AUDIO_CS_INTERFACE, /* bDescriptorType: configuration */
187 AUDIO_AC_OUTPUT_TERMINAL, /* bDescriptorSubtype: output_terminal type*/
188 AUDIO_MIC_OUTPUT_TERMINAL_ID, /* bTerminalID: id of this output terminal*/
189 LBYTE(AUDIO_TERMINAL_TYPE_STREAMING),
190 HBYTE(AUDIO_TERMINAL_TYPE_STREAMING), /* wTerminalType: usb streaming */
191 AUDIO_MIC_INPUT_TERMINAL_ID, /* bAssocTerminal: unused */
192 AUDIO_MIC_FEATURE_UNIT_ID, /* bSourceID: from feature unit terminal */
193 0x00, /* iTerminal: unused */
194#endif
195
196#if (AUDIO_SUPPORT_SPK == 1)
197 /* speaker config */
198 AUDIO_INPUT_TERMINAL_SIZE, /* bLength: descriptor size */
199 AUDIO_CS_INTERFACE, /* bDescriptorType: configuration */
200 AUDIO_AC_INPUT_TERMINAL, /* bDescriptorSubtype: input_terminal type*/
201 AUDIO_SPK_INPUT_TERMINAL_ID, /* bTerminalID: id of this input terminal*/
202 LBYTE(AUDIO_TERMINAL_TYPE_STREAMING), /* wTerminalType: usb streaming */
203 HBYTE(AUDIO_TERMINAL_TYPE_STREAMING), /* wTerminalType: usb streaming */
204 AUDIO_SPK_OUTPUT_TERMINAL_ID, /* bAssocTerminal: no association */
205 AUDIO_SPK_CHR, /* bNrChannels: two channel */
206#if (AUDIO_SPK_CHR == 2)
207 0x03, /* wChannelConfig: left front and right front */
208#endif
209#if (AUDIO_SPK_CHR == 1)
210 0x00, /* wChannelConfig */
211#endif
212 0x00, /* wChannelConfig */
213 0x00, /* iChannelNames: unused */
214 0x00, /* iTerminal: unused */
215
216 AUDIO_FEATURE_UNIT_SIZE, /* bLength: descriptor size */
217 AUDIO_CS_INTERFACE, /* bDescriptorType: configuration */
218 AUDIO_AC_FEATURE_UNIT, /* bDescriptorSubtype: feature unit type*/
219 AUDIO_SPK_FEATURE_UNIT_ID, /* bUnitID: id of this feature unit */
220 AUDIO_SPK_INPUT_TERMINAL_ID, /* bSourceID: from input terminal */
221 0x01, /* bControlSize: 1 byte */
222 0x01, /* bmaControls0: mute*/
223 0x02, /* bmaControls1: volume */
224 0x00, /* iFeature: unused */
225
226 AUDIO_OUTPUT_TERMINAL_SIZE, /* bLength: descriptor size */
227 AUDIO_CS_INTERFACE, /* bDescriptorType: configuration */
228 AUDIO_AC_OUTPUT_TERMINAL, /* bDescriptorSubtype: output_terminal type*/
229 AUDIO_SPK_OUTPUT_TERMINAL_ID, /* bTerminalID: id of this output terminal*/
230 LBYTE(AUDIO_OUTPUT_TERMINAL_SPEAKER), /* wTerminalType: usb speaker */
231 HBYTE(AUDIO_OUTPUT_TERMINAL_SPEAKER), /* wTerminalType: usb speaker */
232 AUDIO_SPK_INPUT_TERMINAL_ID, /* bAssocTerminal: unused */
233 AUDIO_SPK_FEATURE_UNIT_ID, /* bSourceID: from feature unit terminal */
234 0x00, /* iTerminal: unused */
235#endif
236
237#if (AUDIO_SUPPORT_MIC == 1)
238 /* microphone interface */
239 0x09, /* bLength: descriptor size */
240 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
241 AUDIO_MIC_INTERFACE_NUMBER, /* bInterfaceNumber: index of this interface */
242 0x00, /* bAlternateSetting: index of this setting */
243 0x00, /* bNumEndpoints: 0 endpoints */
244 USB_CLASS_CODE_AUDIO, /* bInterfaceClass: audio */
245 AUDIO_SUBCLASS_AUDIOSTREAMING, /* bInterfaceSubclass: audio streaming */
246 0x00, /* bInterfaceProtocol: unused */
247 0x00, /* iInterface: unused */
248
249 0x09, /* bLength: descriptor size */
250 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
251 AUDIO_MIC_INTERFACE_NUMBER, /* bInterfaceNumber: index of this interface */
252 0x01, /* bAlternateSetting: index of this setting */
253 0x01, /* bNumEndpoints: 1 endpoints */
254 USB_CLASS_CODE_AUDIO, /* bInterfaceClass: audio */
255 AUDIO_SUBCLASS_AUDIOSTREAMING, /* bInterfaceSubclass: audio streaming */
256 0x00, /* bInterfaceProtocol: unused */
257 0x00, /* iInterface: unused */
258
259 0x07, /* bLength: configuration descriptor size */
260 AUDIO_CS_INTERFACE, /* bDescriptorType: interface descriptor type */
261 AUDIO_AS_GENERAL, /* bDescriptorSubtype: general sub type*/
262 AUDIO_MIC_OUTPUT_TERMINAL_ID, /* bTerminalLink: unit id of the output terminal */
263 0x01, /* bDelay: interface delay */
264 0x01, /* wFormatTag: pcm format*/
265 0x00, /* wFormatTag: pcm format*/
266
267 0x08 + AUDIO_MIC_FREQ_SIZE * 3, /* bLength: descriptor size */
268 AUDIO_CS_INTERFACE, /* bDescriptorType: interface descriptor type */
269 AUDIO_AS_FORMAT_TYPE, /* bDescriptorSubtype: format subtype */
270 AUDIO_FORMAT_TYPE_I, /* bFormatType: format type 1 */
271 AUDIO_MIC_CHR, /* bNrChannels: channel number */
272 AUDIO_MIC_BITW / 8, /* bSubFrameSize: per audio subframe */
273 AUDIO_MIC_BITW, /* bBitResolution: n bits per sample */
274 AUDIO_MIC_FREQ_SIZE, /* bSamFreqType: n frequency supported */
275#if (AUDIO_SUPPORT_FREQ_16K == 1)
276 SAMPLE_FREQ(AT32_AUDIO_FREQ_16K), /* tSamFreq: 16000hz */
277#endif
278#if (AUDIO_SUPPORT_FREQ_48K == 1)
279 SAMPLE_FREQ(AT32_AUDIO_FREQ_48K), /* tSamFreq: 48000hz */
280#endif
281
282 0x09, /* bLength: size of endpoint descriptor in bytes */
283 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
284 USBD_AUDIO_MIC_IN_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
285 USB_EPT_DESC_ISO | USB_ETP_DESC_ASYNC, /* bmAttributes: endpoint attributes */
286 LBYTE(AUDIO_MIC_IN_MAXPACKET_SIZE),
287 HBYTE(AUDIO_MIC_IN_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
288 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
289 0x00, /* bRefresh: unused */
290 0x00, /* bSynchAddress: unused */
291
292 0x07, /* bLength: size of endpoint descriptor in bytes */
293 AUDIO_CS_ENDPOINT, /* bDescriptorType: cs endpoint descriptor type */
294 0x01, /* bDescriptorSubtype: general subtype */
295 0x01, /* bmAttributes */
296 0x00, /* bLockDelayUnits: unused */
297 0x00, /* wLockDelay: unused */
298 0x00, /* wLockDelay: unused */
299#endif
300
301#if (AUDIO_SUPPORT_SPK == 1)
302 /* speaker interface */
303 0x09, /* bLength: descriptor size */
304 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
305 AUDIO_SPK_INTERFACE_NUMBER, /* bInterfaceNumber: index of this interface */
306 0x00, /* bAlternateSetting: index of this setting */
307 0x00, /* bNumEndpoints: 0 endpoints */
308 USB_CLASS_CODE_AUDIO, /* bInterfaceClass: audio */
309 AUDIO_SUBCLASS_AUDIOSTREAMING, /* bInterfaceSubclass: audio streaming */
310 0x00, /* bInterfaceProtocol: unused */
311 0x00, /* iInterface: unused */
312
313 0x09, /* bLength: descriptor size */
314 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
315 AUDIO_SPK_INTERFACE_NUMBER, /* bInterfaceNumber: index of this interface */
316 0x01, /* bAlternateSetting: index of this setting */
317 0x01 + AUDIO_SUPPORT_FEEDBACK, /* bNumEndpoints: endpoints */
318 USB_CLASS_CODE_AUDIO, /* bInterfaceClass: audio */
319 AUDIO_SUBCLASS_AUDIOSTREAMING, /* bInterfaceSubclass: audio streaming */
320 0x00, /* bInterfaceProtocol: unused */
321 0x00, /* iInterface: unused */
322
323 0x07, /* bLength: configuration descriptor size */
324 AUDIO_CS_INTERFACE, /* bDescriptorType: interface descriptor type */
325 AUDIO_AS_GENERAL, /* bDescriptorSubtype: general sub type*/
326 AUDIO_SPK_INPUT_TERMINAL_ID, /* bTerminalLink: unit id of the input terminal */
327 0x01, /* bDelay: interface delay */
328 0x01, /* wFormatTag: pcm format*/
329 0x00, /* wFormatTag: pcm format*/
330
331 0x08 + AUDIO_SPK_FREQ_SIZE * 3, /* bLength: descriptor size */
332 AUDIO_CS_INTERFACE, /* bDescriptorType: interface descriptor type */
333 AUDIO_AS_FORMAT_TYPE, /* bDescriptorSubtype: format subtype */
334 AUDIO_FORMAT_TYPE_I, /* bFormatType: format type 1 */
335 AUDIO_SPK_CHR, /* bNrChannels: channel number */
336 AUDIO_SPK_BITW / 8, /* bSubFrameSize: per audio subframe */
337 AUDIO_SPK_BITW, /* bBitResolution: n bits per sample */
338 AUDIO_SPK_FREQ_SIZE, /* bSamFreqType: n frequency supported */
339#if (AUDIO_SUPPORT_FREQ_16K == 1)
340 SAMPLE_FREQ(AT32_AUDIO_FREQ_16K), /* tSamFreq: 16000hz */
341#endif
342#if (AUDIO_SUPPORT_FREQ_48K == 1)
343 SAMPLE_FREQ(AT32_AUDIO_FREQ_48K), /* tSamFreq: 48000hz */
344#endif
345
346 0x09, /* bLength: size of endpoint descriptor in bytes */
347 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
348 USBD_AUDIO_SPK_OUT_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
349 USB_EPT_DESC_ISO | USB_ETP_DESC_ASYNC, /* bmAttributes: endpoint attributes */
350 LBYTE(AUDIO_SPK_OUT_MAXPACKET_SIZE),
351 HBYTE(AUDIO_SPK_OUT_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
352 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
353 0x00, /* bRefresh: unused */
354#if (AUDIO_SUPPORT_FEEDBACK == 1)
355 USBD_AUDIO_FEEDBACK_EPT, /* bSynchAddress: feedback endpoint */
356#else
357 0x00, /* bSynchAddress: unused */
358#endif
359
360 0x07, /* bLength: size of endpoint descriptor in bytes */
361 AUDIO_CS_ENDPOINT, /* bDescriptorType: cs endpoint descriptor type */
362 0x01, /* bDescriptorSubtype: general subtype */
363 0x01, /* bmAttributes */
364 0x00, /* bLockDelayUnits: unused */
365 0x00, /* wLockDelay: unused */
366 0x00, /* wLockDelay: unused */
367
368#if (AUDIO_SUPPORT_FEEDBACK == 1)
369 0x09, /* bLength: size of endpoint descriptor in bytes */
370 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
371 USBD_AUDIO_FEEDBACK_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
372 0x11, /* bmAttributes: endpoint attributes */
373 LBYTE(AUDIO_FEEDBACK_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
374 HBYTE(AUDIO_FEEDBACK_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
375 1, /* bInterval: interval for polling endpoint for data transfers */
376 FEEDBACK_REFRESH_TIME, /* bRefresh: this field indicates the rate at which an iso syncronization
377 pipe provides new syncronization feedback data. this rate must be a power of
378 2, therefore only the power is reported back and the range of this field is from
379 1(2ms) to 9(512ms) */
380 0x00, /* bSynchAddress: 0x00*/
381#endif
382
383#endif
384
385 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
386 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
387 HID_INTERFACE_NUMBER, /* bInterfaceNumber: number of interface */
388 0x00, /* bAlternateSetting: alternate set */
389 0x02, /* bNumEndpoints: number of endpoints */
390 USB_CLASS_CODE_HID, /* bInterfaceClass: class code hid */
391 0x00, /* bInterfaceSubClass: subclass code */
392 0x00, /* bInterfaceProtocol: protocol code */
393 0x00, /* iInterface: index of string descriptor */
394
395 0x09, /* bLength: size of HID descriptor in bytes */
396 HID_CLASS_DESC_HID, /* bDescriptorType: HID descriptor type */
397 LBYTE(HID_BCD_NUM),
398 HBYTE(HID_BCD_NUM), /* bcdHID: HID class specification release number */
399 0x00, /* bCountryCode: hardware target conutry */
400 0x01, /* bNumDescriptors: number of HID class descriptor to follow */
401 HID_CLASS_DESC_REPORT, /* bDescriptorType: report descriptor type */
402 LBYTE(sizeof(g_usbd_hid_report)),
403 HBYTE(sizeof(g_usbd_hid_report)), /* wDescriptorLength: total length of reprot descriptor */
404
405 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
406 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
407 USBD_HID_IN_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
408 USB_EPT_DESC_INTERRUPT, /* bmAttributes: endpoint attributes */
409 LBYTE(USBD_IN_MAXPACKET_SIZE),
410 HBYTE(USBD_IN_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
411 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
412
413 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
414 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
415 USBD_HID_OUT_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
416 USB_EPT_DESC_INTERRUPT, /* bmAttributes: endpoint attributes */
417 LBYTE(USBD_OUT_MAXPACKET_SIZE),
418 HBYTE(USBD_OUT_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
419 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
420};
421
422
426#if defined ( __ICCARM__ ) /* iar compiler */
427 #pragma data_alignment=4
428#endif
429ALIGNED_HEAD uint8_t g_usbd_hid_report[USBD_HID_SIZ_REPORT_DESC] ALIGNED_TAIL =
430{
431 0x06, 0xFF, 0x00, /* USAGE_PAGE(Vendor Page:0xFF00) */
432 0x09, 0x01, /* USAGE (Demo Kit) */
433 0xa1, 0x01, /* COLLECTION (Application) */
434 /* 7 */
435
436 /* Led 2 */
437 0x85, HID_REPORT_ID_2, /* REPORT_ID 2 */
438 0x09, 0x02, /* USAGE (LED 2) */
439 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
440 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
441 0x75, 0x08, /* REPORT_SIZE (8) */
442 0x95, 0x3F, /* REPORT_COUNT (1) */
443 0xB1, 0x82, /* FEATURE (Data,Var,Abs,Vol) */
444
445 0x85, 0x02, /* REPORT_ID (2) */
446 0x09, 0x02, /* USAGE (LED 2) */
447 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */
448 /* 27 */
449
450 /* Led 3 */
451 0x85, HID_REPORT_ID_3, /* REPORT_ID (3) */
452 0x09, 0x03, /* USAGE (LED 3) */
453 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
454 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
455 0x75, 0x08, /* REPORT_SIZE (8) */
456 0x95, 0x3F, /* REPORT_COUNT (1) */
457 0xB1, 0x82, /* FEATURE (Data,Var,Abs,Vol) */
458
459 0x85, 0x03, /* REPORT_ID (3) */
460 0x09, 0x03, /* USAGE (LED 3) */
461 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */
462 /* 47 */
463
464 /* Led 4 */
465 0x85, HID_REPORT_ID_4, /* REPORT_ID 4) */
466 0x09, 0x04, /* USAGE (LED 4) */
467 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
468 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
469 0x75, 0x08, /* REPORT_SIZE (8) */
470 0x95, 0x3F, /* REPORT_COUNT (1) */
471 0xB1, 0x82, /* FEATURE (Data,Var,Abs,Vol) */
472
473 0x85, 0x04, /* REPORT_ID (4) */
474 0x09, 0x04, /* USAGE (LED 4) */
475 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */
476 /* 67 */
477
478 /* key Push Button */
479 0x85, HID_REPORT_ID_5, /* REPORT_ID (5) */
480 0x09, 0x05, /* USAGE (Push Button) */
481 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
482 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
483 0x75, 0x01, /* REPORT_SIZE (1) */
484 0x81, 0x82, /* INPUT (Data,Var,Abs,Vol) */
485
486 0x09, 0x05, /* USAGE (Push Button) */
487 0x75, 0x01, /* REPORT_SIZE (1) */
488 0xb1, 0x82, /* FEATURE (Data,Var,Abs,Vol) */
489
490 0x75, 0x07, /* REPORT_SIZE (7) */
491 0x81, 0x83, /* INPUT (Cnst,Var,Abs,Vol) */
492 0x85, 0x05, /* REPORT_ID (5) */
493
494 0x75, 0x07, /* REPORT_SIZE (7) */
495 0xb1, 0x83, /* FEATURE (Cnst,Var,Abs,Vol) */
496 /* 95 */
497
498 /* Data OUT */
499 0x85, HID_REPORT_ID_6, /* REPORT_ID (0xF0) */
500 0x09, 0x06, /* USAGE */
501 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
502 0x26, 0x00,0xff, /* LOGICAL_MAXIMUM (255) */
503 0x75, 0x08, /* REPORT_SIZE (8) */
504 0x95, 0x3F, /* REPORT_COUNT (64) */
505 0x91, 0x02, /* OUTPUT(Data,Var,Abs,Vol) */
506 /* 110 */
507
508 /* Data IN */
509 0x85, HID_REPORT_ID_6, /* REPORT_ID (0xF0) */
510 0x09, 0x07, /* USAGE */
511 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
512 0x26, 0x00,0xff, /* LOGICAL_MAXIMUM (255) */
513 0x75, 0x08, /* REPORT_SIZE (8) */
514 0x95, 0x3F, /* REPORT_COUNT (64) */
515 0x81, 0x82, /* INPUT(Data,Var,Abs,Vol) */
516
517 /* 125 */
518 0xc0 /* END_COLLECTION */
519};
520
524#if defined ( __ICCARM__ ) /* iar compiler */
525 #pragma data_alignment=4
526#endif
527ALIGNED_HEAD uint8_t g_hid_usb_desc[9] ALIGNED_TAIL =
528{
529 0x09, /* bLength: size of HID descriptor in bytes */
530 HID_CLASS_DESC_HID, /* bDescriptorType: HID descriptor type */
531 LBYTE(HID_BCD_NUM),
532 HBYTE(HID_BCD_NUM), /* bcdHID: HID class specification release number */
533 0x00, /* bCountryCode: hardware target conutry */
534 0x01, /* bNumDescriptors: number of HID class descriptor to follow */
535 HID_CLASS_DESC_REPORT, /* bDescriptorType: report descriptor type */
536 LBYTE(sizeof(g_usbd_hid_report)),
537 HBYTE(sizeof(g_usbd_hid_report)), /* wDescriptorLength: total length of reprot descriptor */
538};
539
540
544#if defined ( __ICCARM__ ) /* iar compiler */
545 #pragma data_alignment=4
546#endif
547ALIGNED_HEAD uint8_t g_string_lang_id[USBD_SIZ_STRING_LANGID] ALIGNED_TAIL =
548{
549 USBD_SIZ_STRING_LANGID,
550 USB_DESCIPTOR_TYPE_STRING,
551 0x09,
552 0x04,
553};
554
558#if defined ( __ICCARM__ ) /* iar compiler */
559 #pragma data_alignment=4
560#endif
561ALIGNED_HEAD uint8_t g_string_serial[USBD_SIZ_STRING_SERIAL] ALIGNED_TAIL =
562{
563 USBD_SIZ_STRING_SERIAL,
564 USB_DESCIPTOR_TYPE_STRING,
565};
566
567
568/* device descriptor */
569usbd_desc_t device_descriptor =
570{
571 USB_DEVICE_DESC_LEN,
572 g_usbd_descriptor
573};
574
575/* config descriptor */
576usbd_desc_t config_descriptor =
577{
578 USBD_CONFIG_DESC_SIZE,
579 g_usbd_configuration
580};
581
582/* langid descriptor */
583usbd_desc_t langid_descriptor =
584{
585 USBD_SIZ_STRING_LANGID,
586 g_string_lang_id
587};
588
589/* serial descriptor */
590usbd_desc_t serial_descriptor =
591{
592 USBD_SIZ_STRING_SERIAL,
593 g_string_serial
594};
595
596usbd_desc_t vp_desc;
597
604uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
605{
606 uint16_t str_len = 0, id_pos = 2;
607 uint8_t *tmp_str = string;
608
609 while(*tmp_str != '\0')
610 {
611 str_len ++;
612 unicode_buf[id_pos ++] = *tmp_str ++;
613 unicode_buf[id_pos ++] = 0x00;
614 }
615
616 str_len = str_len * 2 + 2;
617 unicode_buf[0] = str_len;
618 unicode_buf[1] = USB_DESCIPTOR_TYPE_STRING;
619
620 return str_len;
621}
622
630static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len)
631{
632 uint8_t idx = 0;
633
634 for( idx = 0 ; idx < len ; idx ++)
635 {
636 if( ((value >> 28)) < 0xA )
637 {
638 pbuf[2 * idx] = (value >> 28) + '0';
639 }
640 else
641 {
642 pbuf[2 * idx] = (value >> 28) + 'A' - 10;
643 }
644
645 value = value << 4;
646
647 pbuf[2 * idx + 1] = 0;
648 }
649}
650
656static void get_serial_num(void)
657{
658 uint32_t serial0, serial1, serial2;
659
660 serial0 = *(uint32_t*)MCU_ID1;
661 serial1 = *(uint32_t*)MCU_ID2;
662 serial2 = *(uint32_t*)MCU_ID3;
663
664 serial0 += serial2;
665
666 if (serial0 != 0)
667 {
668 usbd_int_to_unicode (serial0, &g_string_serial[2] ,8);
669 usbd_int_to_unicode (serial1, &g_string_serial[18] ,4);
670 }
671}
672
678usbd_desc_t *get_device_descriptor(void)
679{
680 return &device_descriptor;
681}
682
688usbd_desc_t * get_device_qualifier(void)
689{
690 return NULL;
691}
692
698usbd_desc_t *get_device_configuration(void)
699{
700 return &config_descriptor;
701}
702
708usbd_desc_t *get_device_other_speed(void)
709{
710 return NULL;
711}
712
718usbd_desc_t *get_device_lang_id(void)
719{
720 return &langid_descriptor;
721}
722
723
729usbd_desc_t *get_device_manufacturer_string(void)
730{
731 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_MANUFACTURER_STRING, g_usbd_desc_buffer);
732 vp_desc.descriptor = g_usbd_desc_buffer;
733 return &vp_desc;
734}
735
741usbd_desc_t *get_device_product_string(void)
742{
743 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_PRODUCT_STRING, g_usbd_desc_buffer);
744 vp_desc.descriptor = g_usbd_desc_buffer;
745 return &vp_desc;
746}
747
753usbd_desc_t *get_device_serial_string(void)
754{
755 get_serial_num();
756 return &serial_descriptor;
757}
758
764usbd_desc_t *get_device_interface_string(void)
765{
766 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_INTERFACE_STRING, g_usbd_desc_buffer);
767 vp_desc.descriptor = g_usbd_desc_buffer;
768 return &vp_desc;
769}
770
776usbd_desc_t *get_device_config_string(void)
777{
778 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_CONFIGURATION_STRING, g_usbd_desc_buffer);
779 vp_desc.descriptor = g_usbd_desc_buffer;
780 return &vp_desc;
781}
782
audio_hid_desc.h
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
AUDIO_MIC_IN_MAXPACKET_SIZE
#define AUDIO_MIC_IN_MAXPACKET_SIZE
Definition: audio_class.h:62
AUDIO_SPK_OUT_MAXPACKET_SIZE
#define AUDIO_SPK_OUT_MAXPACKET_SIZE
Definition: audio_class.h:63
FEEDBACK_REFRESH_TIME
#define FEEDBACK_REFRESH_TIME
Definition: audio_class.h:65
USBD_AUDIO_SPK_OUT_EPT
#define USBD_AUDIO_SPK_OUT_EPT
Definition: audio_class.h:55
USBD_AUDIO_MIC_IN_EPT
#define USBD_AUDIO_MIC_IN_EPT
endpoint define
Definition: audio_class.h:54
USBD_AUDIO_FEEDBACK_EPT
#define USBD_AUDIO_FEEDBACK_EPT
Definition: audio_class.h:56
AUDIO_FEEDBACK_MAXPACKET_SIZE
#define AUDIO_FEEDBACK_MAXPACKET_SIZE
Definition: audio_class.h:64
AUDIO_MIC_FEATURE_UNIT_ID
#define AUDIO_MIC_FEATURE_UNIT_ID
Definition: audio_desc.h:169
AUDIO_CS_ENDPOINT
#define AUDIO_CS_ENDPOINT
Definition: audio_desc.h:76
USBD_DESC_CONFIGURATION_STRING
#define USBD_DESC_CONFIGURATION_STRING
Definition: audio_desc.h:61
USBD_SIZ_STRING_SERIAL
#define USBD_SIZ_STRING_SERIAL
Definition: audio_desc.h:57
AUDIO_AC_HEADER
#define AUDIO_AC_HEADER
Definition: audio_desc.h:91
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112
USBD_DESC_PRODUCT_STRING
#define USBD_DESC_PRODUCT_STRING
Definition: audio_desc.h:60
AUDIO_SUBCLASS_AUDIOCONTROL
#define AUDIO_SUBCLASS_AUDIOCONTROL
Definition: audio_desc.h:68
AUDIO_INPUT_TERMINAL_SIZE
#define AUDIO_INPUT_TERMINAL_SIZE
audio interface descriptor size define
Definition: audio_desc.h:161
AUDIO_TERMINAL_TYPE_STREAMING
#define AUDIO_TERMINAL_TYPE_STREAMING
Definition: audio_desc.h:138
AUDIO_SPK_CHR
#define AUDIO_SPK_CHR
Definition: audio_desc.h:202
HID_BINTERVAL_TIME
#define HID_BINTERVAL_TIME
Definition: audio_desc.h:205
AUDIO_SPK_INTERFACE_NUMBER
#define AUDIO_SPK_INTERFACE_NUMBER
Definition: audio_desc.h:180
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: audio_desc.h:208
AUDIO_MIC_OUTPUT_TERMINAL_ID
#define AUDIO_MIC_OUTPUT_TERMINAL_ID
Definition: audio_desc.h:170
AUDIO_MIC_INTERFACE_NUMBER
#define AUDIO_MIC_INTERFACE_NUMBER
audio interface number
Definition: audio_desc.h:178
SAMPLE_FREQ
#define SAMPLE_FREQ(frq)
Definition: audio_desc.h:213
AUDIO_MIC_FREQ_SIZE
#define AUDIO_MIC_FREQ_SIZE
audio microphone freq and channel config
Definition: audio_desc.h:194
AUDIO_SPK_FREQ_SIZE
#define AUDIO_SPK_FREQ_SIZE
audio speaker freq and channel config
Definition: audio_desc.h:201
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
AT32_AUDIO_FREQ_48K
#define AT32_AUDIO_FREQ_48K
Definition: audio_desc.h:189
USBD_SIZ_STRING_LANGID
#define USBD_SIZ_STRING_LANGID
Definition: audio_desc.h:56
AUDIO_FORMAT_TYPE_I
#define AUDIO_FORMAT_TYPE_I
audio format type 1
Definition: audio_desc.h:148
MCU_ID1
#define MCU_ID1
Definition: audio_desc.h:215
AUDIO_AS_GENERAL
#define AUDIO_AS_GENERAL
Definition: audio_desc.h:104
USBD_DESC_MANUFACTURER_STRING
#define USBD_DESC_MANUFACTURER_STRING
Definition: audio_desc.h:59
AUDIO_INTERFACE_NUM
#define AUDIO_INTERFACE_NUM
audio interface config
Definition: audio_desc.h:153
AUDIO_CS_INTERFACE
#define AUDIO_CS_INTERFACE
audio class-specific descriptor types
Definition: audio_desc.h:75
AUDIO_SPK_FEATURE_UNIT_ID
#define AUDIO_SPK_FEATURE_UNIT_ID
Definition: audio_desc.h:172
AUDIO_OUTPUT_TERMINAL_SIZE
#define AUDIO_OUTPUT_TERMINAL_SIZE
Definition: audio_desc.h:162
USBD_PRODUCT_ID
#define USBD_PRODUCT_ID
Definition: audio_desc.h:54
AUDIO_SPK_OUTPUT_TERMINAL_ID
#define AUDIO_SPK_OUTPUT_TERMINAL_ID
Definition: audio_desc.h:173
BCD_NUM
#define BCD_NUM
Definition: audio_desc.h:51
USBD_DESC_INTERFACE_STRING
#define USBD_DESC_INTERFACE_STRING
Definition: audio_desc.h:62
AUDIO_AC_INPUT_TERMINAL
#define AUDIO_AC_INPUT_TERMINAL
Definition: audio_desc.h:92
AUDIO_MIC_CHR
#define AUDIO_MIC_CHR
Definition: audio_desc.h:195
AUDIO_OUTPUT_TERMINAL_SPEAKER
#define AUDIO_OUTPUT_TERMINAL_SPEAKER
Definition: audio_desc.h:143
MCU_ID2
#define MCU_ID2
Definition: audio_desc.h:216
AT32_AUDIO_FREQ_16K
#define AT32_AUDIO_FREQ_16K
audio support freq
Definition: audio_desc.h:188
USBD_VENDOR_ID
#define USBD_VENDOR_ID
Definition: audio_desc.h:53
AUDIO_AS_FORMAT_TYPE
#define AUDIO_AS_FORMAT_TYPE
Definition: audio_desc.h:105
AUDIO_MIC_INPUT_TERMINAL_ID
#define AUDIO_MIC_INPUT_TERMINAL_ID
audio terminal id define
Definition: audio_desc.h:168
AUDIO_SPK_BITW
#define AUDIO_SPK_BITW
Definition: audio_desc.h:203
MCU_ID3
#define MCU_ID3
Definition: audio_desc.h:217
AUDIO_FEATURE_UNIT_SIZE
#define AUDIO_FEATURE_UNIT_SIZE
Definition: audio_desc.h:163
AUDIO_PROTOCOL_UNDEFINED
#define AUDIO_PROTOCOL_UNDEFINED
audio interface protocol codes
Definition: audio_desc.h:85
AUDIO_MIC_BITW
#define AUDIO_MIC_BITW
Definition: audio_desc.h:196
AUDIO_AC_FEATURE_UNIT
#define AUDIO_AC_FEATURE_UNIT
Definition: audio_desc.h:96
AUDIO_SPK_INPUT_TERMINAL_ID
#define AUDIO_SPK_INPUT_TERMINAL_ID
Definition: audio_desc.h:171
AUDIO_INTERFACE_LEN
#define AUDIO_INTERFACE_LEN
Definition: audio_desc.h:154
AUDIO_SUBCLASS_AUDIOSTREAMING
#define AUDIO_SUBCLASS_AUDIOSTREAMING
Definition: audio_desc.h:69
AUDIO_AC_OUTPUT_TERMINAL
#define AUDIO_AC_OUTPUT_TERMINAL
Definition: audio_desc.h:93
AUDIO_INPUT_TERMINAL_MICROPHONE
#define AUDIO_INPUT_TERMINAL_MICROPHONE
Definition: audio_desc.h:141
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
USBD_HID_OUT_EPT
#define USBD_HID_OUT_EPT
Definition: audio_hid_class.h:62
USBD_HID_IN_EPT
#define USBD_HID_IN_EPT
usb custom hid use endpoint define
Definition: audio_hid_class.h:61
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
HID_REPORT_ID_2
#define HID_REPORT_ID_2
Definition: audio_hid_desc.h:224
HID_REPORT_ID_4
#define HID_REPORT_ID_4
Definition: audio_hid_desc.h:226
HID_CLASS_DESC_HID
#define HID_CLASS_DESC_HID
usb hid class descriptor define
Definition: audio_hid_desc.h:216
HID_CLASS_DESC_REPORT
#define HID_CLASS_DESC_REPORT
Definition: audio_hid_desc.h:217
HID_REPORT_ID_6
#define HID_REPORT_ID_6
Definition: audio_hid_desc.h:228
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: audio_hid_desc.h:236
HID_REPORT_ID_3
#define HID_REPORT_ID_3
Definition: audio_hid_desc.h:225
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
usb hid descriptor
Definition: audio_hid_desc.c:527
HID_BCD_NUM
#define HID_BCD_NUM
usb bcd number define
Definition: audio_hid_desc.h:211
HID_REPORT_ID_5
#define HID_REPORT_ID_5
Definition: audio_hid_desc.h:227
HID_INTERFACE_NUMBER
#define HID_INTERFACE_NUMBER
Definition: audio_hid_desc.h:184
serial_descriptor
usbd_desc_t serial_descriptor
Definition: audio_hid_desc.c:590
device_descriptor
usbd_desc_t device_descriptor
Definition: audio_hid_desc.c:569
usbd_unicode_convert
uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert
Definition: audio_hid_desc.c:604
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: audio_hid_desc.c:729
langid_descriptor
usbd_desc_t langid_descriptor
Definition: audio_hid_desc.c:583
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: audio_hid_desc.c:688
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: audio_hid_desc.c:764
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: audio_hid_desc.c:708
g_usbd_desc_buffer
static uint8_t g_usbd_desc_buffer[256]
Definition: audio_hid_desc.c:59
vp_desc
usbd_desc_t vp_desc
Definition: audio_hid_desc.c:596
audio_hid_desc_handler
usbd_desc_handler audio_hid_desc_handler
device descriptor handler structure
Definition: audio_hid_desc.c:64
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: audio_hid_desc.c:698
ALIGNED_TAIL
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL
usb device standard descriptor
Definition: audio_hid_desc.c:84
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: audio_hid_desc.c:741
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: audio_hid_desc.c:718
get_serial_num
static void get_serial_num(void)
usb get serial number
Definition: audio_hid_desc.c:656
config_descriptor
usbd_desc_t config_descriptor
Definition: audio_hid_desc.c:576
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: audio_hid_desc.c:678
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: audio_hid_desc.c:753
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: audio_hid_desc.c:776
usbd_int_to_unicode
static void usbd_int_to_unicode(uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode
Definition: audio_hid_desc.c:630
AUDIO_SUPPORT_FEEDBACK
#define AUDIO_SUPPORT_FEEDBACK
Definition: audio/audio_conf.h:49
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_DEVICE_EPT_LEN
#define USB_DEVICE_EPT_LEN
Definition: usb_std.h:153
USB_EPT_DESC_ISO
#define USB_EPT_DESC_ISO
Definition: usb_std.h:176
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
USB_DESCIPTOR_TYPE_CONFIGURATION
#define USB_DESCIPTOR_TYPE_CONFIGURATION
Definition: usb_std.h:93
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DESCIPTOR_TYPE_ENDPOINT
#define USB_DESCIPTOR_TYPE_ENDPOINT
Definition: usb_std.h:96
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_DEVICE_IF_DESC_LEN
#define USB_DEVICE_IF_DESC_LEN
Definition: usb_std.h:152
USB_DEVICE_CFG_DESC_LEN
#define USB_DEVICE_CFG_DESC_LEN
Definition: usb_std.h:151
USB_EPT_DESC_INTERRUPT
#define USB_EPT_DESC_INTERRUPT
Definition: usb_std.h:178
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92
USB_DESCIPTOR_TYPE_STRING
#define USB_DESCIPTOR_TYPE_STRING
Definition: usb_std.h:94
USB_CLASS_CODE_AUDIO
#define USB_CLASS_CODE_AUDIO
usb class code
Definition: usb_std.h:161
USB_DESCIPTOR_TYPE_INTERFACE
#define USB_DESCIPTOR_TYPE_INTERFACE
Definition: usb_std.h:95
USB_ETP_DESC_ASYNC
#define USB_ETP_DESC_ASYNC
Definition: usb_std.h:181
USB_CLASS_CODE_HID
#define USB_CLASS_CODE_HID
Definition: usb_std.h:163
usb_std.h
usb standard header file
usbd_core.h
usb device core header file
usbd_sdr.h


AT32F415 Firmwary Library: audio_hid_desc.h Source File

  • middlewares
  • usbd_class
  • audio_hid
audio_hid_desc.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AUDIO_DESC_H
29#define __AUDIO_DESC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "audio_hid_class.h"
36#include "usbd_core.h"
37#include "audio_conf.h"
38
51#define BCD_NUM 0x0100
52
53#define USBD_VENDOR_ID 0x2E3C
54#define USBD_PRODUCT_ID 0x5555
55
56#define USBD_SIZ_STRING_LANGID 4
57#define USBD_SIZ_STRING_SERIAL 0x1A
58
59#define USBD_DESC_MANUFACTURER_STRING "Artery"
60#define USBD_DESC_PRODUCT_STRING "AT32 Audio"
61#define USBD_DESC_CONFIGURATION_STRING "Audio Config"
62#define USBD_DESC_INTERFACE_STRING "Audio Interface"
63
67#define AUDIO_SUBCLASS_UNDEFINED 0x00
68#define AUDIO_SUBCLASS_AUDIOCONTROL 0x01
69#define AUDIO_SUBCLASS_AUDIOSTREAMING 0x02
70#define AUDIO_SUBCLASS_MIDISTREMING 0x03
71
75#define AUDIO_CS_INTERFACE 0x24
76#define AUDIO_CS_ENDPOINT 0x25
77#define AUDIO_CS_STRING 0x23
78#define AUDIO_CS_CONFIGURATION 0x22
79#define AUDIO_CS_DEVICE 0x21
80#define AUDIO_CS_UNDEFINED 0x20
81
85#define AUDIO_PROTOCOL_UNDEFINED 0x00
86
90#define AUDIO_AC_DESCRIPTOR_UNDEFINED 0x00
91#define AUDIO_AC_HEADER 0x01
92#define AUDIO_AC_INPUT_TERMINAL 0x02
93#define AUDIO_AC_OUTPUT_TERMINAL 0x03
94#define AUDIO_AC_MIXER_UNIT 0x04
95#define AUDIO_AC_SELECTOR_UNIT 0x05
96#define AUDIO_AC_FEATURE_UNIT 0x06
97#define AUDIO_AC_PROCESSING_UNIT 0x07
98#define AUDIO_AC_EXTENSION_UNIT 0x08
99
103#define AUDIO_AS_DESCRIPTOR_UNDEFINED 0x00
104#define AUDIO_AS_GENERAL 0x01
105#define AUDIO_AS_FORMAT_TYPE 0x02
106#define AUDIO_AS_FORMAT_SPECIFIC 0x03
107
111#define AUDIO_REQUEST_CODE_UNDEFINED 0x00
112#define AUDIO_REQ_SET_CUR 0x01
113#define AUDIO_REQ_GET_CUR 0x81
114#define AUDIO_REQ_SET_MIN 0x02
115#define AUDIO_REQ_GET_MIN 0x82
116#define AUDIO_REQ_SET_MAX 0x03
117#define AUDIO_REQ_GET_MAX 0x83
118#define AUDIO_REQ_SET_RES 0x04
119#define AUDIO_REQ_GET_RES 0x84
120#define AUDIO_REQ_SET_MEM 0x05
121#define AUDIO_REQ_GET_MEM 0x85
122#define AUDIO_REQ_GET_STAT 0xFF
123
127#define AUDIO_FU_CONTROL_UNDEFINED 0x00
128#define AUDIO_FU_MUTE_CONTROL 0x01
129#define AUDIO_FU_VOLUME_CONTROL 0x02
130#define AUDIO_FU_BASS_CONTROL 0x03
131#define AUDIO_FU_MID_CONTROL 0x04
132#define AUDIO_FU_TREBLE_CONTROL 0x05
133
137#define AUDIO_TERMINAL_TYPE_UNDEFINED 0x0100
138#define AUDIO_TERMINAL_TYPE_STREAMING 0x0101
139#define AUDIO_TERMINAL_TYPE_VENDOR 0x01FF
140#define AUDIO_INPUT_TERMINAL_UNDEFINED 0x0200
141#define AUDIO_INPUT_TERMINAL_MICROPHONE 0x0201
142#define AUDIO_OUTPUT_TERMINAL_UNDEFINED 0x0300
143#define AUDIO_OUTPUT_TERMINAL_SPEAKER 0x0301
144
148#define AUDIO_FORMAT_TYPE_I 0x01
149
153#define AUDIO_INTERFACE_NUM (AUDIO_SUPPORT_SPK + AUDIO_SUPPORT_MIC)
154#define AUDIO_INTERFACE_LEN ((0x08 + AUDIO_INTERFACE_NUM) + AUDIO_INTERFACE_NUM * 0x1E)
155#define AUDIO_MIC_INTERFACE 0x01
156#define AUDIO_SPK_INTERFACE 0x02
157
161#define AUDIO_INPUT_TERMINAL_SIZE 0x0C
162#define AUDIO_OUTPUT_TERMINAL_SIZE 0x09
163#define AUDIO_FEATURE_UNIT_SIZE 0x09
164
168#define AUDIO_MIC_INPUT_TERMINAL_ID 0x01
169#define AUDIO_MIC_FEATURE_UNIT_ID 0x02
170#define AUDIO_MIC_OUTPUT_TERMINAL_ID 0x03
171#define AUDIO_SPK_INPUT_TERMINAL_ID 0x04
172#define AUDIO_SPK_FEATURE_UNIT_ID 0x05
173#define AUDIO_SPK_OUTPUT_TERMINAL_ID 0x06
174
178#define AUDIO_MIC_INTERFACE_NUMBER 0x01
179#if (AUDIO_SUPPORT_MIC == 1)
180#define AUDIO_SPK_INTERFACE_NUMBER 0x02
181#else
182#define AUDIO_SPK_INTERFACE_NUMBER 0x01
183#endif
184#define HID_INTERFACE_NUMBER 0x03
185
189#define AT32_AUDIO_FREQ_16K 16000
190#define AT32_AUDIO_FREQ_48K 48000
191
195#define AUDIO_MIC_FREQ_SIZE (AUDIO_SUPPORT_FREQ)
196#define AUDIO_MIC_CHR AUDIO_MIC_CHANEL_NUM
197#define AUDIO_MIC_BITW (AUDIO_MIC_DEFAULT_BITW)
198
202#define AUDIO_SPK_FREQ_SIZE (AUDIO_SUPPORT_FREQ)
203#define AUDIO_SPK_CHR AUDIO_SPK_CHANEL_NUM
204#define AUDIO_SPK_BITW (AUDIO_SPK_DEFAULT_BITW)
205
206#define HID_BINTERVAL_TIME 0x01
207
211#define HID_BCD_NUM 0x0110
212
216#define HID_CLASS_DESC_HID 0x21
217#define HID_CLASS_DESC_REPORT 0x22
218#define HID_CLASS_DESC_PHYSICAL 0x23
219
223#define HID_REPORT_ID_1 0x01
224#define HID_REPORT_ID_2 0x02
225#define HID_REPORT_ID_3 0x03
226#define HID_REPORT_ID_4 0x04
227#define HID_REPORT_ID_5 0x05
228#define HID_REPORT_ID_6 0xF0
229
230#define USBD_HID_DESC_SIZE 32
231#define USBD_CONFIG_DESC_SIZE ( 0x12 + AUDIO_INTERFACE_LEN + \
232 + (0x31 + AUDIO_SPK_FREQ_SIZE * 3) \
233 + (0x31 + AUDIO_MIC_FREQ_SIZE * 3) \
234 + (9 * AUDIO_SUPPORT_FEEDBACK) \
235 + USBD_HID_DESC_SIZE)
236#define USBD_HID_SIZ_REPORT_DESC 126
237
238#define SAMPLE_FREQ(frq) (uint8_t)(frq), (uint8_t)((frq >> 8)), (uint8_t)((frq >> 16))
239
240#define MCU_ID1 (0x1FFFF7E8)
241#define MCU_ID2 (0x1FFFF7EC)
242#define MCU_ID3 (0x1FFFF7F0)
243
244extern uint8_t g_usbd_hid_report[USBD_HID_SIZ_REPORT_DESC];
245extern uint8_t g_hid_usb_desc[9];
246extern uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN];
247extern uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE];
248extern usbd_desc_handler audio_hid_desc_handler;
249
261#ifdef __cplusplus
262}
263#endif
264
265#endif
266
audio_conf.h
usb audio config
audio_hid_class.h
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: audio_hid_desc.h:231
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((0+1)) *3)+(0x31+((0+1)) *3)+(9 *1)+32)]
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
audio_hid_desc_handler
usbd_desc_handler audio_hid_desc_handler
device descriptor handler structure
Definition: audio_hid_desc.c:64
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: audio_hid_desc.h:236
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
usb hid descriptor
Definition: audio_hid_desc.c:527
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: hid_iap_user.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • inc
bootloader/inc/hid_iap_user.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __HID_IAP_USER_H
29#define __HID_IAP_USER_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "hid_iap_class.h"
36
49#define FLASH_APP_ADDRESS 0x08005000
50
59void iap_init(void);
60 iap_result_type iap_get_upgrade_flag(void);
61void iap_loop(void);
62void jump_to_app(uint32_t address);
63
76#ifdef __cplusplus
77}
78#endif
79
80#endif
81
82
iap_result_type
iap_result_type
Definition: hid_iap_class.h:98
iap_init
void iap_init(void)
iap init.
Definition: app_led3_toggle/src/iap.c:61
jump_to_app
void jump_to_app(uint32_t address)
jump to app
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c:290
iap_get_upgrade_flag
iap_result_type iap_get_upgrade_flag(void)
get iap upgrade complete flag
Definition: app_led3_toggle/src/hid_iap_user.c:79
iap_loop
void iap_loop(void)
iap loop
Definition: bootloader/src/hid_iap_user.c:476
hid_iap_class.h
usb hid iap header file


AT32F415 Firmwary Library: iap.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
bootloader/inc/iap.h
Go to the documentation of this file.
1
27#ifndef __IAP_H__
28#define __IAP_H__
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "at32f415_board.h"
35
48/* app starting address */
49#define APP_START_ADDR 0x08004000
50
51/* the previous sector of app starting address is iap upgrade flag */
52#define IAP_UPGRADE_FLAG_ADDR (APP_START_ADDR - 0x800)
53
54/* when app received cmd 0x5aa5 from pc-tool, will set up the flag,
55indicates that an app upgrade will follow, see iap application note for more details */
56#define IAP_UPGRADE_FLAG 0x41544B38
57
69typedef struct
70{
71 uint8_t cmd_head;
72 uint8_t cmd_addr[4];
73 uint8_t cmd_buf[0x800];
74 uint8_t cmd_check;
75} cmd_data_group_type;
76
80typedef enum
81{
82 CMD_DATA_IDLE,
83 CMD_DATA_ADDR,
84 CMD_DATA_BUF,
85 CMD_DATA_CHACK,
86 CMD_DATA_DONE,
87 CMD_DATA_ERR,
88} cmd_data_step_type;
89
93typedef enum
94{
95 CMD_CTR_IDLE,
96 CMD_CTR_INIT,
97 CMD_CTR_DONE,
98 CMD_CTR_ERR,
99 CMD_CTR_APP,
100} cmd_ctr_step_type;
101
105typedef enum
106{
107 UPDATE_PRE,
108 UPDATE_CLEAR_FLAG,
109 UPDATE_ING,
110 UPDATE_DONE,
111} update_status_type;
112
113typedef void (*iapfun)(void);
114
119extern cmd_data_group_type cmd_data_group_type_struct;
120extern cmd_data_step_type cmd_data_step;
121extern cmd_ctr_step_type cmd_ctr_step;
122extern update_status_type update_status;
123
128void command_handle(void);
129void back_err(void);
130void back_ok(void);
131void iap_upgrade_app_handle(void);
132void app_load(uint32_t appxaddr);
133
146#ifdef __cplusplus
147}
148#endif
149
150#endif
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
update_status
update_status_type update_status
Definition: bootloader/src/iap.c:43
cmd_data_group_type_struct
cmd_data_group_type cmd_data_group_type_struct
cmd_data_step
cmd_data_step_type cmd_data_step
Definition: bootloader/src/iap.c:40
cmd_ctr_step
cmd_ctr_step_type cmd_ctr_step
Definition: bootloader/src/iap.c:41
command_handle
void command_handle(void)
command analysis handle.
Definition: bootloader/src/iap.c:106
iap_upgrade_app_handle
void iap_upgrade_app_handle(void)
iap upgrade app handle.
Definition: bootloader/src/iap.c:344
app_load
void app_load(uint32_t appxaddr)
app load.
Definition: bootloader/src/iap.c:60
back_err
void back_err(void)
command response error.
Definition: app_led3_toggle/src/usart.c:120
back_ok
void back_ok(void)
command response ok.
Definition: app_led3_toggle/src/usart.c:107
iapfun
void(* iapfun)(void)
Definition: bootloader/inc/iap.h:113
update_status_type
update_status_type
update status type
Definition: bootloader/inc/iap.h:106
cmd_ctr_step_type
cmd_ctr_step_type
cmd ctr step type
Definition: bootloader/inc/iap.h:94
cmd_data_step_type
cmd_data_step_type
cmd data step type
Definition: bootloader/inc/iap.h:81
UPDATE_PRE
@ UPDATE_PRE
Definition: bootloader/inc/iap.h:107
UPDATE_DONE
@ UPDATE_DONE
Definition: bootloader/inc/iap.h:110
UPDATE_ING
@ UPDATE_ING
Definition: bootloader/inc/iap.h:109
UPDATE_CLEAR_FLAG
@ UPDATE_CLEAR_FLAG
Definition: bootloader/inc/iap.h:108
CMD_CTR_ERR
@ CMD_CTR_ERR
Definition: bootloader/inc/iap.h:98
CMD_CTR_DONE
@ CMD_CTR_DONE
Definition: bootloader/inc/iap.h:97
CMD_CTR_INIT
@ CMD_CTR_INIT
Definition: bootloader/inc/iap.h:96
CMD_CTR_APP
@ CMD_CTR_APP
Definition: bootloader/inc/iap.h:99
CMD_CTR_IDLE
@ CMD_CTR_IDLE
Definition: bootloader/inc/iap.h:95
CMD_DATA_DONE
@ CMD_DATA_DONE
Definition: bootloader/inc/iap.h:86
CMD_DATA_ERR
@ CMD_DATA_ERR
Definition: bootloader/inc/iap.h:87
CMD_DATA_BUF
@ CMD_DATA_BUF
Definition: bootloader/inc/iap.h:84
CMD_DATA_IDLE
@ CMD_DATA_IDLE
Definition: bootloader/inc/iap.h:82
CMD_DATA_CHACK
@ CMD_DATA_CHACK
Definition: bootloader/inc/iap.h:85
CMD_DATA_ADDR
@ CMD_DATA_ADDR
Definition: bootloader/inc/iap.h:83
cmd_data_group_type
cmd data group type
Definition: bootloader/inc/iap.h:70
cmd_data_group_type::cmd_head
uint8_t cmd_head
Definition: bootloader/inc/iap.h:71
cmd_data_group_type::cmd_check
uint8_t cmd_check
Definition: bootloader/inc/iap.h:74


AT32F415 Firmwary Library: tmr.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
bootloader/inc/tmr.h
Go to the documentation of this file.
1
27#ifndef __TMR_H
28#define __TMR_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "at32f415_board.h"
35
36extern uint8_t time_ira_cnt;
37extern uint8_t get_data_from_usart_flag;
38
51void tmr_init(void);
52
65#ifdef __cplusplus
66}
67#endif
68
69#endif
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
time_ira_cnt
uint8_t time_ira_cnt
Definition: bootloader/src/tmr.c:39
get_data_from_usart_flag
uint8_t get_data_from_usart_flag
Definition: bootloader/src/tmr.c:40
tmr_init
void tmr_init(void)
init tmr.
Definition: app_led3_toggle/src/tmr.c:44


AT32F415 Firmwary Library: usart.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
bootloader/inc/usart.h
Go to the documentation of this file.
1
27#ifndef __USART_H
28#define __USART_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "at32f415_board.h"
35
48#define USART_REC_LEN 1024
49
61typedef struct
62{
63 uint16_t buf[USART_REC_LEN];
64 uint16_t head;
65 uint16_t tail;
66 uint16_t count;
67} usart_group_type;
68
73extern usart_group_type usart_group_struct;
74
79void uart_init(uint32_t baudrate);
80
93#ifdef __cplusplus
94}
95#endif
96
97#endif
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
usart_group_struct
usart_group_type usart_group_struct
Definition: bootloader/src/usart.c:38
USART_REC_LEN
#define USART_REC_LEN
Definition: bootloader/inc/usart.h:48
uart_init
void uart_init(uint32_t baudrate)
init usart.
Definition: app_led3_toggle/src/usart.c:45
usart_group_type
usart group type
Definition: bootloader/inc/usart.h:62
usart_group_type::tail
uint16_t tail
Definition: bootloader/inc/usart.h:65
usart_group_type::count
uint16_t count
Definition: bootloader/inc/usart.h:66
usart_group_type::head
uint16_t head
Definition: bootloader/inc/usart.h:64


AT32F415 Firmwary Library: hid_iap_user.c Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • src
bootloader/src/hid_iap_user.c
Go to the documentation of this file.
1
27#include "hid_iap_user.h"
28#include "hid_iap_class.h"
29#include "string.h"
30
39void (*pftarget)(void);
40void iap_clear_upgrade_flag(void);
41void iap_set_upgrade_flag(void);
42uint32_t crc_cal(uint32_t addr, uint16_t nk);
43
44void iap_idle(void);
45void iap_start(void);
46 iap_result_type iap_address(uint8_t *pdata, uint32_t len);
47void iap_finish(void);
48 iap_result_type iap_data_write(uint8_t *pdata, uint32_t len);
49void iap_jump(void);
50void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result);
51
57void jump_to_app(uint32_t address)
58{
59 uint32_t stkptr, jumpaddr;
60 stkptr = *(uint32_t *)address;
61 jumpaddr = *(uint32_t *)(address + sizeof(uint32_t));
62
63 /* disable nvic irq and periph clock, clear pending */
64 nvic_irq_disable(OTGFS1_IRQn);
65
66 __NVIC_ClearPendingIRQ(OTGFS1_IRQn);
67
68 crm_periph_clock_enable(CRM_OTGFS1_PERIPH_CLOCK, FALSE);
69
70 crm_periph_reset(CRM_OTGFS1_PERIPH_RESET, TRUE);
71 crm_periph_reset(CRM_OTGFS1_PERIPH_RESET, FALSE);
72
73
74 __set_MSP(stkptr);
75 pftarget = (void (*) (void))jumpaddr;
76 pftarget();
77}
78
84void iap_clear_upgrade_flag(void)
85{
86 flash_unlock();
87 flash_sector_erase(iap_info.flag_address);
88 flash_lock();
89}
90
96void iap_set_upgrade_flag(void)
97{
98 flash_unlock();
99 flash_word_program(iap_info.flag_address, IAP_UPGRADE_COMPLETE_FLAG);
100 flash_lock();
101}
102
108 iap_result_type iap_get_upgrade_flag(void)
109{
110 uint32_t flag_address = iap_info.flag_address;
111 if(*((uint32_t *)flag_address) == IAP_UPGRADE_COMPLETE_FLAG)
112 {
113 return IAP_SUCCESS;
114 }
115 else
116 {
117 return IAP_FAILED;
118 }
119}
120
126void iap_erase_sector(uint32_t address)
127{
128 flash_unlock();
129 if(iap_info.sector_size == SECTOR_SIZE_1K)
130 {
131 flash_sector_erase(address);
132 }
133 else if(iap_info.sector_size == SECTOR_SIZE_2K)
134 {
135 /* check the address is sector align */
136 if((address & (SECTOR_SIZE_2K-1)) == 0)
137 {
138 flash_sector_erase(address);
139 }
140 }
141 else if(iap_info.sector_size == SECTOR_SIZE_4K)
142 {
143 if((address & (SECTOR_SIZE_4K-1)) == 0)
144 {
145 flash_sector_erase(address);
146 }
147 }
148 flash_lock();
149}
150
157uint32_t crc_cal(uint32_t addr, uint16_t nk)
158{
159 uint32_t *paddr = (uint32_t *)addr;
160 uint32_t wlen = nk * 1024 / sizeof(uint32_t);
161 uint32_t value, i_index = 0;
162 crm_periph_clock_enable(CRM_CRC_PERIPH_CLOCK, TRUE);
163 crc_data_reset();
164
165 for(i_index = 0; i_index < wlen; i_index ++)
166 {
167 value = *paddr;
168 crc_one_word_calculate(CONVERT_ENDIAN(value));
169
170 paddr ++;
171 }
172 return crc_data_get();
173}
174
180void iap_init(void)
181{
182 iap_info.flash_size = KB_TO_B(FLASH_SIZE_REG());
183 if(iap_info.flash_size < KB_TO_B(256))
184 {
185 iap_info.sector_size = SECTOR_SIZE_1K;
186 }
187 else
188 {
189 iap_info.sector_size = SECTOR_SIZE_2K;
190 }
191
192 iap_info.flash_start_address = FLASH_BASE;
193 iap_info.flash_end_address = iap_info.flash_start_address + iap_info.flash_size;
194
195 iap_info.app_address = FLASH_APP_ADDRESS;
196 iap_info.flag_address = iap_info.app_address - iap_info.sector_size;
197
198 iap_info.fifo_length = 0;
199 iap_info.iap_address = 0;
200}
201
207void iap_idle(void)
208{
209 iap_info.state = IAP_STS_START;
210 iap_init();
211 iap_respond(iap_info.iap_tx, IAP_CMD_IDLE, IAP_ACK);
212}
213
219void iap_start(void)
220{
221 iap_info.state = IAP_STS_START;
222 iap_init();
223 iap_respond(iap_info.iap_tx, IAP_CMD_START, IAP_ACK);
224}
225
232 iap_result_type iap_address(uint8_t *pdata, uint32_t len)
233{
234 iap_result_type status = IAP_SUCCESS;
235 uint16_t result = IAP_ACK;
236 uint8_t *paddr = pdata + 2; /* skip iap cmd */
237 uint32_t address;
238
239 address = (paddr[0] << 24) |
240 (paddr[1] << 16) |
241 (paddr[2] << 8) |
242 paddr[3];
243
244 /* check the address is valid */
245 if(address < iap_info.app_address || address > iap_info.flash_end_address)
246 {
247 status = IAP_FAILED;
248 result = IAP_NACK;
249 }
250 else
251 {
252 iap_info.iap_address = address;
253
254 if(iap_info.state == IAP_STS_START)
255 {
256 iap_clear_upgrade_flag();
257 }
258 iap_erase_sector(iap_info.iap_address);
259 }
260
261 iap_info.state = IAP_STS_ADDR;
262
263 iap_respond(iap_info.iap_tx, IAP_CMD_ADDR, result);
264
265 return status;
266}
267/*
268 * @brief iap data write
269 * @param pdata: data buffer pointer.
270 * @param len: buffer length
271 * @retval the result of the address parse
272 */
273 iap_result_type iap_data_write(uint8_t *pdata, uint32_t len)
274{
275 uint32_t data_len = (pdata[2] << 8 | pdata[3]);
276 uint8_t *valid_data = pdata + 4;
277 uint32_t *pbuf;
278 uint32_t i_index = 0;
279
280 if(iap_info.state == IAP_STS_ADDR)
281 {
282 if(data_len + iap_info.fifo_length <= HID_IAP_BUFFER_LEN)
283 {
284 for(i_index = 0; i_index < data_len; i_index ++)
285 {
286 iap_info.iap_fifo[iap_info.fifo_length ++] = valid_data[i_index];
287 }
288 }
289 /* buffer full */
290 if(iap_info.fifo_length == HID_IAP_BUFFER_LEN)
291 {
292 flash_unlock();
293 pbuf = (uint32_t *)iap_info.iap_fifo;
294 for(i_index = 0; i_index < iap_info.fifo_length / sizeof(uint32_t); i_index ++)
295 {
296 flash_word_program(iap_info.iap_address, *pbuf ++);
297 iap_info.iap_address += 4;
298 }
299 flash_lock();
300
301 iap_info.fifo_length = 0;
302 iap_info.iap_address = 0;
303 iap_respond(iap_info.iap_tx, IAP_CMD_DATA, IAP_ACK);
304 }
305 }
306 else
307 {
308 iap_respond(iap_info.iap_tx, IAP_CMD_ADDR, IAP_NACK);
309 }
310 return IAP_SUCCESS;
311}
312
313/*
314 * @brief iap finish
315 * @param none
316 * @retval none
317 */
318void iap_finish()
319{
320 iap_info.state = IAP_STS_FINISH;
321 iap_set_upgrade_flag();
322 iap_respond(iap_info.iap_tx, IAP_CMD_FINISH, IAP_ACK);
323}
324
325/*
326 * @brief iap crc
327 * @param pdata: data buffer pointer.
328 * @param len: buffer length
329 * @retval the result of the address parse
330 */
331void iap_crc(uint8_t *pdata, uint32_t len)
332{
333 uint8_t *paddr = pdata + 2; /* skip iap cmd */
334 uint16_t crc_nk;
335 uint32_t crc_value;
336 uint32_t address = (paddr[0] << 24) |
337 (paddr[1] << 16) |
338 (paddr[2] << 8) |
339 paddr[3];
340 paddr = pdata + 6;
341
342 crc_nk = (paddr[0] << 16) | paddr[1];
343
344 crc_value = crc_cal(address, crc_nk);
345
346 iap_respond(iap_info.iap_tx, IAP_CMD_CRC, IAP_ACK);
347 iap_info.iap_tx[4] = (uint8_t)((crc_value >> 24) & 0xFF);
348 iap_info.iap_tx[5] = (uint8_t)((crc_value >> 16) & 0xFF);
349 iap_info.iap_tx[6] = (uint8_t)((crc_value >> 8) & 0xFF);
350 iap_info.iap_tx[7] = (uint8_t)((crc_value) & 0xFF);
351
352}
353
354/*
355 * @brief iap jump
356 * @param none
357 * @retval none
358 */
359void iap_jump()
360{
361 iap_info.state = IAP_STS_JMP_WAIT;
362 iap_respond(iap_info.iap_tx, IAP_CMD_JMP, IAP_ACK);
363}
364
365/*
366 * @brief iap get
367 * @param none
368 * @retval none
369 */
370void iap_get()
371{
372 iap_respond(iap_info.iap_tx, IAP_CMD_GET, IAP_ACK);
373 iap_info.iap_tx[4] = (uint8_t)((iap_info.app_address >> 24) & 0xFF);
374 iap_info.iap_tx[5] = (uint8_t)((iap_info.app_address >> 16) & 0xFF);
375 iap_info.iap_tx[6] = (uint8_t)((iap_info.app_address >> 8) & 0xFF);
376 iap_info.iap_tx[7] = (uint8_t)((iap_info.app_address) & 0xFF);
377}
378
379
380
381/*
382 * @brief iap respond
383 * @param res_buf: data buffer pointer.
384 * @param iap_cmd: iap command
385 * @param result: iap result
386 * @retval the result of the address parse
387 */
388void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
389{
390 res_buf[0] = (uint8_t)((iap_cmd >> 8) & 0xFF);
391 res_buf[1] = (uint8_t)((iap_cmd) & 0xFF);
392 res_buf[2] = (uint8_t)((result >> 8) & 0xFF);
393 res_buf[3] = (uint8_t)((result) & 0xFF);
394
395 iap_info.respond_flag = 1;
396}
397
405 iap_result_type usbd_hid_iap_process(void *udev, uint8_t *pdata, uint16_t len)
406{
407 iap_result_type status = IAP_SUCCESS;
408 uint16_t iap_cmd;
409
410 if(len < 2)
411 {
412 return IAP_FAILED;
413 }
414
415 iap_info.respond_flag = 0;
416
417 iap_cmd = (pdata[0] << 8) | pdata[1];
418
419 switch(iap_cmd)
420 {
421 case IAP_CMD_IDLE:
422 iap_idle();
423 break;
424 case IAP_CMD_START:
425 iap_start();
426 break;
427 case IAP_CMD_ADDR:
428 iap_address(pdata, len);
429 break;
430 case IAP_CMD_DATA:
431 iap_data_write(pdata, len);
432 break;
433 case IAP_CMD_FINISH:
434 iap_finish();
435 break;
436 case IAP_CMD_CRC:
437 iap_crc(pdata, len);
438 break;
439 case IAP_CMD_JMP:
440 iap_jump();
441 break;
442 case IAP_CMD_GET:
443 iap_get();
444 break;
445 default:
446 status = IAP_FAILED;
447 break;
448 }
449
450 if(iap_info.respond_flag)
451 {
452 class_send_report(udev, iap_info.iap_tx, 64);
453 }
454
455 return status;
456}
457
463void usbd_hid_iap_in_complete(void *udev)
464{
465 if(iap_info.state == IAP_STS_JMP_WAIT)
466 {
467 iap_info.state = IAP_STS_JMP;
468 }
469}
470
476void iap_loop(void)
477{
478 if(iap_info.state == IAP_STS_JMP)
479 {
480 jump_to_app(iap_info.app_address);
481 }
482}
483
crc_value
__IO uint32_t crc_value
Definition: project/at_start_f415/examples/crc/calculation/src/main.c:64
crc_data_reset
void crc_data_reset(void)
reset the crc data register.
Definition: at32f415_crc.c:49
crc_data_get
uint32_t crc_data_get(void)
return the current crc value.
Definition: at32f415_crc.c:89
crc_one_word_calculate
uint32_t crc_one_word_calculate(uint32_t data)
compute the 32-bit crc of a given data word(32-bit).
Definition: at32f415_crc.c:60
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_OTGFS1_PERIPH_CLOCK
@ CRM_OTGFS1_PERIPH_CLOCK
Definition: at32f415_crm.h:107
CRM_CRC_PERIPH_CLOCK
@ CRM_CRC_PERIPH_CLOCK
Definition: at32f415_crm.h:105
CRM_OTGFS1_PERIPH_RESET
@ CRM_OTGFS1_PERIPH_RESET
Definition: at32f415_crm.h:147
OTGFS1_IRQn
@ OTGFS1_IRQn
Definition: at32f415.h:187
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
flash_sector_erase
flash_status_type flash_sector_erase(uint32_t sector_address)
erase a specified flash sector.
Definition: at32f415_flash.c:173
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
flash_word_program
flash_status_type flash_word_program(uint32_t address, uint32_t data)
program a word at a specified address.
Definition: at32f415_flash.c:288
flash_lock
void flash_lock(void)
lock the flash controller.
Definition: at32f415_flash.c:162
nvic_irq_disable
void nvic_irq_disable(uint32_t irqn)
disable nvic irq number
Definition: at32f415_misc.c:81
FLASH_BASE
#define FLASH_BASE
Definition: at32f415.h:285
iap_set_upgrade_flag
void iap_set_upgrade_flag(void)
set iap upgrade complete flag
Definition: bootloader/src/hid_iap_user.c:96
iap_idle
void iap_idle(void)
iap idle function
Definition: bootloader/src/hid_iap_user.c:207
iap_respond
void iap_respond(uint8_t *res_buf, uint16_t iap_cmd, uint16_t result)
Definition: bootloader/src/hid_iap_user.c:388
iap_data_write
iap_result_type iap_data_write(uint8_t *pdata, uint32_t len)
Definition: bootloader/src/hid_iap_user.c:273
iap_init
void iap_init(void)
iap init
Definition: bootloader/src/hid_iap_user.c:180
usbd_hid_iap_process
iap_result_type usbd_hid_iap_process(void *udev, uint8_t *pdata, uint16_t len)
usb device iap function
Definition: bootloader/src/hid_iap_user.c:405
jump_to_app
void jump_to_app(uint32_t address)
jump to app
Definition: bootloader/src/hid_iap_user.c:57
crc_cal
uint32_t crc_cal(uint32_t addr, uint16_t nk)
crc cal
Definition: bootloader/src/hid_iap_user.c:157
iap_get_upgrade_flag
iap_result_type iap_get_upgrade_flag(void)
get iap upgrade complete flag
Definition: bootloader/src/hid_iap_user.c:108
iap_address
iap_result_type iap_address(uint8_t *pdata, uint32_t len)
iap parse address
Definition: bootloader/src/hid_iap_user.c:232
iap_finish
void iap_finish(void)
Definition: bootloader/src/hid_iap_user.c:318
iap_loop
void iap_loop(void)
iap loop
Definition: bootloader/src/hid_iap_user.c:476
iap_start
void iap_start(void)
iap start function
Definition: bootloader/src/hid_iap_user.c:219
iap_crc
void iap_crc(uint8_t *pdata, uint32_t len)
Definition: bootloader/src/hid_iap_user.c:331
pftarget
void(* pftarget)(void)
Definition: bootloader/src/hid_iap_user.c:39
iap_erase_sector
void iap_erase_sector(uint32_t address)
set iap upgrade complete flag
Definition: bootloader/src/hid_iap_user.c:126
iap_clear_upgrade_flag
void iap_clear_upgrade_flag(void)
clear iap upgrade flag
Definition: bootloader/src/hid_iap_user.c:84
iap_get
void iap_get()
Definition: bootloader/src/hid_iap_user.c:370
iap_jump
void iap_jump(void)
Definition: bootloader/src/hid_iap_user.c:359
usbd_hid_iap_in_complete
void usbd_hid_iap_in_complete(void *udev)
usb device in transfer complete function
Definition: bootloader/src/hid_iap_user.c:463
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: audio_hid_class.c:818
HID_IAP_BUFFER_LEN
#define HID_IAP_BUFFER_LEN
Definition: hid_iap_class.h:89
IAP_CMD_DATA
#define IAP_CMD_DATA
Definition: hid_iap_class.h:83
IAP_CMD_FINISH
#define IAP_CMD_FINISH
Definition: hid_iap_class.h:84
IAP_CMD_IDLE
#define IAP_CMD_IDLE
iap command
Definition: hid_iap_class.h:80
IAP_CMD_GET
#define IAP_CMD_GET
Definition: hid_iap_class.h:87
SECTOR_SIZE_1K
#define SECTOR_SIZE_1K
Definition: hid_iap_class.h:73
iap_result_type
iap_result_type
Definition: hid_iap_class.h:98
IAP_NACK
#define IAP_NACK
Definition: hid_iap_class.h:95
IAP_ACK
#define IAP_ACK
Definition: hid_iap_class.h:94
IAP_CMD_CRC
#define IAP_CMD_CRC
Definition: hid_iap_class.h:85
SECTOR_SIZE_2K
#define SECTOR_SIZE_2K
Definition: hid_iap_class.h:74
CONVERT_ENDIAN
#define CONVERT_ENDIAN(dwValue)
Definition: hid_iap_class.h:91
IAP_CMD_ADDR
#define IAP_CMD_ADDR
Definition: hid_iap_class.h:82
SECTOR_SIZE_4K
#define SECTOR_SIZE_4K
Definition: hid_iap_class.h:75
IAP_UPGRADE_COMPLETE_FLAG
#define IAP_UPGRADE_COMPLETE_FLAG
Definition: hid_iap_class.h:90
FLASH_SIZE_REG
#define FLASH_SIZE_REG()
Definition: hid_iap_class.h:70
IAP_CMD_START
#define IAP_CMD_START
Definition: hid_iap_class.h:81
IAP_CMD_JMP
#define IAP_CMD_JMP
Definition: hid_iap_class.h:86
KB_TO_B
#define KB_TO_B(kb)
Definition: hid_iap_class.h:71
IAP_FAILED
@ IAP_FAILED
Definition: hid_iap_class.h:101
IAP_SUCCESS
@ IAP_SUCCESS
Definition: hid_iap_class.h:99
IAP_STS_START
@ IAP_STS_START
Definition: hid_iap_class.h:107
IAP_STS_JMP
@ IAP_STS_JMP
Definition: hid_iap_class.h:113
IAP_STS_JMP_WAIT
@ IAP_STS_JMP_WAIT
Definition: hid_iap_class.h:112
IAP_STS_FINISH
@ IAP_STS_FINISH
Definition: hid_iap_class.h:110
IAP_STS_ADDR
@ IAP_STS_ADDR
Definition: hid_iap_class.h:108
iap_info
iap_info_type iap_info
Definition: hid_iap_class.c:65
FLASH_APP_ADDRESS
#define FLASH_APP_ADDRESS
Definition: app_led3_toggle/inc/hid_iap_user.h:49
hid_iap_class.h
usb hid iap header file
iap_info_type::flag_address
uint32_t flag_address
Definition: hid_iap_class.h:128
iap_info_type::sector_size
uint32_t sector_size
Definition: hid_iap_class.h:133
iap_info_type::iap_address
uint32_t iap_address
Definition: hid_iap_class.h:127
iap_info_type::flash_start_address
uint32_t flash_start_address
Definition: hid_iap_class.h:130
iap_info_type::flash_end_address
uint32_t flash_end_address
Definition: hid_iap_class.h:131
iap_info_type::fifo_length
uint32_t fifo_length
Definition: hid_iap_class.h:123
iap_info_type::iap_fifo
uint8_t iap_fifo[1024]
Definition: hid_iap_class.h:119
iap_info_type::flash_size
uint32_t flash_size
Definition: hid_iap_class.h:134
iap_info_type::iap_tx
uint8_t iap_tx[0x40]
Definition: hid_iap_class.h:121
iap_info_type::app_address
uint32_t app_address
Definition: hid_iap_class.h:126
iap_info_type::respond_flag
uint8_t respond_flag
Definition: hid_iap_class.h:137
iap_info_type::state
iap_machine_state_type state
Definition: hid_iap_class.h:136


AT32F415 Firmwary Library: iap.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
bootloader/src/iap.c
Go to the documentation of this file.
1
27#include "iap.h"
28#include "usart.h"
29#include "flash.h"
30#include "tmr.h"
31
40 cmd_data_step_type cmd_data_step = CMD_DATA_IDLE;
41 cmd_ctr_step_type cmd_ctr_step = CMD_CTR_IDLE;
42 cmd_data_group_type cmd_data_group_struct;
43 update_status_type update_status = UPDATE_PRE;
44static uint8_t cmd_addr_cnt = 0;
45static uint32_t cmd_data_cnt = 0;
46 iapfun jump_to_app;
47
48/* app_load don't optimize */
49#if defined (__CC_ARM)
50 #pragma O0
51#elif defined (__ICCARM__)
52 #pragma optimize=s none
53#endif
60void app_load(uint32_t app_addr)
61{
62 /* check the address of stack */
63 if(((*(uint32_t*)app_addr) - 0x20000000) < (SRAM_SIZE * 1024))
64 {
65 /* disable periph clock */
66 crm_periph_clock_enable(CRM_TMR3_PERIPH_CLOCK, FALSE);
67 crm_periph_clock_enable(CRM_USART1_PERIPH_CLOCK, FALSE);
68 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, FALSE);
69
70 /* disable nvic irq and clear pending */
71 nvic_irq_disable(USART1_IRQn);
72 nvic_irq_disable(TMR3_GLOBAL_IRQn);
73 __NVIC_ClearPendingIRQ(USART1_IRQn);
74 __NVIC_ClearPendingIRQ(TMR3_GLOBAL_IRQn);
75
76 jump_to_app = (iapfun)*(uint32_t*)(app_addr + 4); /* code second word is reset address */
77 __set_MSP(*(uint32_t*)app_addr); /* init app stack pointer(code first word is stack address) */
78 jump_to_app(); /* jump to user app */
79 }
80}
81
89uint8_t data_take(void)
90{
91 uint8_t val;
92 usart_interrupt_enable(USART1, USART_RDBF_INT, FALSE);
93 usart_group_struct.count--;
94 usart_interrupt_enable(USART1, USART_RDBF_INT, TRUE);
95 val = usart_group_struct.buf[usart_group_struct.tail++];
96 if(usart_group_struct.tail > (USART_REC_LEN-1))
97 usart_group_struct.tail = 0;
98 return val;
99}
100
106void command_handle(void)
107{
108 uint8_t val, checksum;
109 uint16_t index;
110 /* check whether received usart data */
111 if(usart_group_struct.count > 0)
112 val = data_take();
113 else
114 return;
115
116 if(update_status == UPDATE_PRE)
117 {
118 if(cmd_ctr_step == CMD_CTR_IDLE)
119 {
120 if(val == 0x5A)
121 cmd_ctr_step = CMD_CTR_INIT;
122 }
123 else if(cmd_ctr_step == CMD_CTR_INIT)
124 {
125 if(val == 0x01)
126 {
127 cmd_ctr_step = CMD_CTR_DONE;
128 }
129 else if(val == 0xA5)
130 {
131 cmd_ctr_step = CMD_CTR_APP;
132 }
133 else
134 {
135 cmd_ctr_step = CMD_CTR_ERR;
136 }
137 }
138 }
139 else if(update_status == UPDATE_ING)
140 {
141 switch(cmd_data_step)
142 {
143 case CMD_DATA_IDLE:
144 if(val == 0x31)
145 {
146 cmd_data_step = CMD_DATA_ADDR;
147 cmd_addr_cnt = 0;
148 cmd_data_cnt = 0;
149 }
150 if(val == 0x5A)
151 {
152 if(cmd_ctr_step == CMD_CTR_IDLE)
153 {
154 cmd_ctr_step = CMD_CTR_INIT;
155 update_status = UPDATE_DONE;
156 }
157 }
158 break;
159 case CMD_DATA_ADDR:
160 cmd_data_group_struct.cmd_addr[cmd_addr_cnt] = val;
161 cmd_addr_cnt++;
162 if(cmd_addr_cnt >= 4)
163 {
164 cmd_addr_cnt = 0;
165 cmd_data_step = CMD_DATA_BUF;
166 }
167 break;
168 case CMD_DATA_BUF:
169 cmd_data_group_struct.cmd_buf[cmd_data_cnt] = val;
170 cmd_data_cnt++;
171 if(cmd_data_cnt >= 2048)
172 {
173 cmd_data_cnt = 0;
174 cmd_data_step = CMD_DATA_CHACK;
175 }
176 break;
177 case CMD_DATA_CHACK:
178 checksum = 0;
179 for(index = 0;index < 4;index++)
180 {
181 checksum += cmd_data_group_struct.cmd_addr[index];
182 }
183 for(index = 0;index < 0x800; index++)
184 {
185 checksum += cmd_data_group_struct.cmd_buf[index];
186 }
187 if(checksum == val)
188 {
189 cmd_data_step = CMD_DATA_DONE;
190 }
191 else
192 {
193 cmd_data_step = CMD_DATA_ERR;
194 }
195 break;
196 default:
197 break;
198 }
199 }
200 else if(update_status == UPDATE_DONE)
201 {
202 if(cmd_ctr_step == CMD_CTR_IDLE)
203 {
204 if(val == 0x5A)
205 {
206 cmd_ctr_step = CMD_CTR_INIT;
207 }
208 }
209 else if(cmd_ctr_step == CMD_CTR_INIT)
210 {
211 if(val == 0x02)
212 {
213 cmd_ctr_step = CMD_CTR_DONE;
214 }
215 else
216 {
217 cmd_ctr_step = CMD_CTR_ERR;
218 }
219 }
220 }
221}
222
228void back_ok(void)
229{
230 usart_data_transmit(USART1, 0xCC);
231 while(usart_flag_get(USART1, USART_TDC_FLAG) == RESET);
232 usart_data_transmit(USART1, 0xDD);
233 while(usart_flag_get(USART1, USART_TDC_FLAG) == RESET);
234}
235
241void back_err(void)
242{
243 usart_data_transmit(USART1, 0xEE);
244 while(usart_flag_get(USART1, USART_TDC_FLAG) == RESET);
245 usart_data_transmit(USART1, 0xFF);
246 while(usart_flag_get(USART1, USART_TDC_FLAG) == RESET);
247 /* reset state machine of udgrade flow */
248 cmd_data_step = CMD_DATA_IDLE;
249 cmd_ctr_step = CMD_CTR_IDLE;
250 update_status = UPDATE_PRE;
251 cmd_addr_cnt = 0;
252 cmd_data_cnt = 0;
253 time_ira_cnt = 0;
254 get_data_from_usart_flag = 0;
255}
256
262void app_update_handle(void)
263{
264 uint32_t write_addr=0;
265 if(update_status == UPDATE_PRE)
266 {
267 if(cmd_ctr_step == CMD_CTR_DONE)
268 {
269 cmd_ctr_step = CMD_CTR_IDLE;
270 update_status = UPDATE_CLEAR_FLAG;
271 }
272 else if(cmd_ctr_step == CMD_CTR_APP)
273 {
274 cmd_ctr_step = CMD_CTR_IDLE;
275 back_ok();
276 }
277 else if(cmd_ctr_step == CMD_CTR_ERR)
278 {
279 cmd_ctr_step = CMD_CTR_IDLE;
280 back_err();
281 }
282 }
283 else if(update_status == UPDATE_CLEAR_FLAG)
284 {
285 get_data_from_usart_flag = 1;
286 update_status = UPDATE_ING;
287 back_ok();
288 }
289 else if(update_status == UPDATE_ING)
290 {
291 if(cmd_data_step == CMD_DATA_DONE)
292 {
293 write_addr = (cmd_data_group_struct.cmd_addr[0] << 24) + (cmd_data_group_struct.cmd_addr[1] << 16) + \
294 (cmd_data_group_struct.cmd_addr[2] << 8) + cmd_data_group_struct.cmd_addr[3];
295 if((write_addr >= APP_START_ADDR) && (write_addr < FLASH_BASE + 1024 * FLASH_SIZE))
296 {
297 flash_2kb_write(write_addr, cmd_data_group_struct.cmd_buf);
298 cmd_data_step = CMD_DATA_IDLE;
299 back_ok();
300 }
301 else
302 {
303 cmd_data_step = CMD_DATA_IDLE;
304 back_err();
305 }
306 }
307 else if(cmd_data_step == CMD_DATA_ERR)
308 {
309 cmd_data_step = CMD_DATA_IDLE;
310 back_err();
311 }
312 }
313 else if(update_status == UPDATE_DONE)
314 {
315 if(cmd_ctr_step == CMD_CTR_DONE)
316 {
317 cmd_ctr_step = CMD_CTR_IDLE;
318 back_ok();
319 /* check app starting address whether 0x08xxxxxx */
320 if(((*(uint32_t*)(APP_START_ADDR + 4)) & 0xFF000000) == 0x08000000)
321 {
322 crm_reset();
323 /* jump and run in app */
324 app_load(APP_START_ADDR);
325 }
326 else
327 {
328 cmd_ctr_step = CMD_CTR_ERR;
329 }
330 }
331 else if(cmd_ctr_step == CMD_CTR_ERR)
332 {
333 cmd_ctr_step = CMD_CTR_IDLE;
334 back_err();
335 }
336 }
337}
338
344void iap_upgrade_app_handle(void)
345{
346 command_handle();
347 app_update_handle();
348}
349
jump_to_app
iapfun jump_to_app
jump to app
Definition: bootloader/src/iap.c:46
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR3_PERIPH_CLOCK
@ CRM_TMR3_PERIPH_CLOCK
Definition: at32f415_crm.h:124
CRM_USART1_PERIPH_CLOCK
@ CRM_USART1_PERIPH_CLOCK
Definition: at32f415_crm.h:118
TMR3_GLOBAL_IRQn
@ TMR3_GLOBAL_IRQn
Definition: at32f415.h:165
USART1_IRQn
@ USART1_IRQn
Definition: at32f415.h:173
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
nvic_irq_disable
void nvic_irq_disable(uint32_t irqn)
disable nvic irq number
Definition: at32f415_misc.c:81
FLASH_BASE
#define FLASH_BASE
Definition: at32f415.h:285
cmd_addr_cnt
static uint8_t cmd_addr_cnt
Definition: bootloader/src/iap.c:44
app_update_handle
void app_update_handle(void)
app update flow handle.
Definition: bootloader/src/iap.c:262
data_take
uint8_t data_take(void)
take data from usart buf.
Definition: bootloader/src/iap.c:89
command_handle
void command_handle(void)
command analysis handle.
Definition: bootloader/src/iap.c:106
update_status
update_status_type update_status
Definition: bootloader/src/iap.c:43
iap_upgrade_app_handle
void iap_upgrade_app_handle(void)
iap upgrade app handle.
Definition: bootloader/src/iap.c:344
cmd_data_group_struct
cmd_data_group_type cmd_data_group_struct
Definition: bootloader/src/iap.c:42
time_ira_cnt
uint8_t time_ira_cnt
Definition: bootloader/src/tmr.c:39
cmd_data_cnt
static uint32_t cmd_data_cnt
Definition: bootloader/src/iap.c:45
get_data_from_usart_flag
uint8_t get_data_from_usart_flag
Definition: bootloader/src/tmr.c:40
cmd_data_step
cmd_data_step_type cmd_data_step
Definition: bootloader/src/iap.c:40
app_load
void app_load(uint32_t app_addr)
app load.
Definition: bootloader/src/iap.c:60
cmd_ctr_step
cmd_ctr_step_type cmd_ctr_step
Definition: bootloader/src/iap.c:41
back_err
void back_err(void)
command response error.
Definition: bootloader/src/iap.c:241
usart_group_struct
usart_group_type usart_group_struct
Definition: bootloader/src/usart.c:38
back_ok
void back_ok(void)
command response ok.
Definition: bootloader/src/iap.c:228
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_interrupt_enable
void usart_interrupt_enable(usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts.
Definition: at32f415_usart.c:257
USART_TDC_FLAG
#define USART_TDC_FLAG
Definition: at32f415_usart.h:58
USART_RDBF_INT
#define USART_RDBF_INT
Definition: at32f415_usart.h:73
USART1
#define USART1
Definition: at32f415_usart.h:319
APP_START_ADDR
#define APP_START_ADDR
Definition: app_led3_toggle/inc/iap.h:49
SRAM_SIZE
#define SRAM_SIZE
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h:49
USART_REC_LEN
#define USART_REC_LEN
Definition: bootloader/inc/usart.h:48
FLASH_SIZE
#define FLASH_SIZE
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h:48
flash_2kb_write
void flash_2kb_write(uint32_t write_addr, uint8_t *pbuffer)
flash erase/program operation.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c:45
iapfun
void(* iapfun)(void)
Definition: bootloader/inc/iap.h:113
update_status_type
update_status_type
update status type
Definition: bootloader/inc/iap.h:106
cmd_ctr_step_type
cmd_ctr_step_type
cmd ctr step type
Definition: bootloader/inc/iap.h:94
cmd_data_step_type
cmd_data_step_type
cmd data step type
Definition: bootloader/inc/iap.h:81
UPDATE_PRE
@ UPDATE_PRE
Definition: bootloader/inc/iap.h:107
UPDATE_DONE
@ UPDATE_DONE
Definition: bootloader/inc/iap.h:110
UPDATE_ING
@ UPDATE_ING
Definition: bootloader/inc/iap.h:109
UPDATE_CLEAR_FLAG
@ UPDATE_CLEAR_FLAG
Definition: bootloader/inc/iap.h:108
CMD_CTR_ERR
@ CMD_CTR_ERR
Definition: bootloader/inc/iap.h:98
CMD_CTR_DONE
@ CMD_CTR_DONE
Definition: bootloader/inc/iap.h:97
CMD_CTR_INIT
@ CMD_CTR_INIT
Definition: bootloader/inc/iap.h:96
CMD_CTR_APP
@ CMD_CTR_APP
Definition: bootloader/inc/iap.h:99
CMD_CTR_IDLE
@ CMD_CTR_IDLE
Definition: bootloader/inc/iap.h:95
CMD_DATA_DONE
@ CMD_DATA_DONE
Definition: bootloader/inc/iap.h:86
CMD_DATA_ERR
@ CMD_DATA_ERR
Definition: bootloader/inc/iap.h:87
CMD_DATA_BUF
@ CMD_DATA_BUF
Definition: bootloader/inc/iap.h:84
CMD_DATA_IDLE
@ CMD_DATA_IDLE
Definition: bootloader/inc/iap.h:82
CMD_DATA_CHACK
@ CMD_DATA_CHACK
Definition: bootloader/inc/iap.h:85
CMD_DATA_ADDR
@ CMD_DATA_ADDR
Definition: bootloader/inc/iap.h:83
cmd_data_group_type
cmd data group type
Definition: bootloader/inc/iap.h:70
cmd_data_group_type::cmd_addr
uint8_t cmd_addr[4]
Definition: bootloader/inc/iap.h:72
cmd_data_group_type::cmd_buf
uint8_t cmd_buf[0x800]
Definition: bootloader/inc/iap.h:73
usart_group_type::tail
uint16_t tail
Definition: bootloader/inc/usart.h:65
usart_group_type::buf
uint16_t buf[1024]
Definition: bootloader/inc/usart.h:63
usart_group_type::count
uint16_t count
Definition: bootloader/inc/usart.h:66


AT32F415 Firmwary Library: tmr.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
bootloader/src/tmr.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "tmr.h"
29#include "iap.h"
30
39uint8_t time_ira_cnt=0;
40uint8_t get_data_from_usart_flag = 0; /* flag for timer out in upgrade flow */
41
47void tmr_init(void)
48{
49 crm_clocks_freq_type crm_clocks_freq_struct = {0};
50
51 crm_periph_clock_enable(CRM_TMR3_PERIPH_CLOCK, TRUE);
52
53 /* enable the tmr3 global interrupt */
54 nvic_irq_enable(TMR3_GLOBAL_IRQn, 1, 0);
55
56 /* get system clock */
57 crm_clocks_freq_get(&crm_clocks_freq_struct);
58
59 /* time base configuration */
60 tmr_base_init(TMR3, 10000, crm_clocks_freq_struct.ahb_freq / 10000);
61 tmr_cnt_dir_set(TMR3, TMR_COUNT_UP);
62
63 /* overflow interrupt enable */
64 tmr_interrupt_enable(TMR3, TMR_OVF_INT, TRUE);
65
66 /* enable tmr */
67 tmr_counter_enable(TMR3, TRUE);
68}
69
75void TMR3_GLOBAL_IRQHandler(void)
76{
77 if(tmr_flag_get(TMR3, TMR_OVF_FLAG) == SET)
78 {
79 tmr_flag_clear(TMR3, TMR_OVF_FLAG);
80 at32_led_toggle(LED2);
81 if(get_data_from_usart_flag)
82 {
83 if((++time_ira_cnt) == 0x00)
84 time_ira_cnt = 0xFF;
85 if(time_ira_cnt > 2)
86 back_err();
87 if(time_ira_cnt > 5)
88 crm_periph_clock_enable(LED2_GPIO_CRM_CLK, FALSE);
89 }
90 }
91}
92
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/debug/tmr1/src/main.c:39
LED2
@ LED2
Definition: at32f415_board.h:63
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_TMR3_PERIPH_CLOCK
@ CRM_TMR3_PERIPH_CLOCK
Definition: at32f415_crm.h:124
TMR3_GLOBAL_IRQn
@ TMR3_GLOBAL_IRQn
Definition: at32f415.h:165
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_OVF_FLAG
#define TMR_OVF_FLAG
Definition: at32f415_tmr.h:52
TMR_OVF_INT
#define TMR_OVF_INT
Definition: at32f415_tmr.h:74
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
time_ira_cnt
uint8_t time_ira_cnt
Definition: bootloader/src/tmr.c:39
TMR3_GLOBAL_IRQHandler
void TMR3_GLOBAL_IRQHandler(void)
tmr3 global interrupt handler.
Definition: bootloader/src/tmr.c:75
tmr_init
void tmr_init(void)
init tmr.
Definition: bootloader/src/tmr.c:47
get_data_from_usart_flag
uint8_t get_data_from_usart_flag
Definition: bootloader/src/tmr.c:40
back_err
void back_err(void)
command response error.
Definition: app_led3_toggle/src/usart.c:120
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::ahb_freq
uint32_t ahb_freq
Definition: at32f415_crm.h:473


AT32F415 Firmwary Library: usart.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
bootloader/src/usart.c
Go to the documentation of this file.
1
27#include "usart.h"
28#include "tmr.h"
29
38 usart_group_type usart_group_struct;
39
45void uart_init(uint32_t baudrate)
46{
47 gpio_init_type gpio_init_struct;
48 /* enable the usart and it's io clock */
49 crm_periph_clock_enable(CRM_USART1_PERIPH_CLOCK, TRUE);
50 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
51
52 /* set default parameter */
53 gpio_default_para_init(&gpio_init_struct);
54
55 /* configure the usart1_tx pa9 */
56 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
57 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
58 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
59 gpio_init_struct.gpio_pins = GPIO_PINS_9;
60 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
61 gpio_init(GPIOA, &gpio_init_struct);
62
63 /* configure the usart1_rx pa10 */
64 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
65 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
66 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
67 gpio_init_struct.gpio_pins = GPIO_PINS_10;
68 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
69 gpio_init(GPIOA, &gpio_init_struct);
70
71 /*configure usart nvic interrupt */
72 nvic_irq_enable(USART1_IRQn, 0, 0);
73
74 /*configure usart param*/
75 usart_init(USART1, baudrate, USART_DATA_8BITS, USART_STOP_1_BIT);
76 usart_transmitter_enable(USART1, TRUE);
77 usart_receiver_enable(USART1, TRUE);
78 usart_interrupt_enable(USART1, USART_RDBF_INT, TRUE);
79 usart_enable(USART1, TRUE);
80}
81
87void USART1_IRQHandler(void)
88{
89 uint16_t reval;
90 time_ira_cnt = 0; /* clear upgrade time out flag */
91 if(usart_flag_get(USART1, USART_RDBF_FLAG) != RESET)
92 {
93 reval = usart_data_receive(USART1);
94 if(usart_group_struct.count > (USART_REC_LEN - 1))
95 {
96 usart_group_struct.count = 0;
97 usart_group_struct.head = 0;
98 usart_group_struct.tail = 0;
99 }
100 else
101 {
102 usart_group_struct.count++;
103 usart_group_struct.buf[usart_group_struct.head++] = reval;
104 if(usart_group_struct.head > (USART_REC_LEN - 1))
105 {
106 usart_group_struct.head = 0;
107 }
108 }
109 }
110}
111
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_USART1_PERIPH_CLOCK
@ CRM_USART1_PERIPH_CLOCK
Definition: at32f415_crm.h:118
USART1_IRQn
@ USART1_IRQn
Definition: at32f415.h:173
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
time_ira_cnt
uint8_t time_ira_cnt
Definition: bootloader/src/tmr.c:39
USART1_IRQHandler
void USART1_IRQHandler(void)
usart1 interrupt handler.
Definition: bootloader/src/usart.c:87
uart_init
void uart_init(uint32_t baudrate)
init usart.
Definition: bootloader/src/usart.c:45
usart_group_struct
usart_group_type usart_group_struct
Definition: bootloader/src/usart.c:38
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_interrupt_enable
void usart_interrupt_enable(usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts.
Definition: at32f415_usart.c:257
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART_RDBF_INT
#define USART_RDBF_INT
Definition: at32f415_usart.h:73
USART1
#define USART1
Definition: at32f415_usart.h:319
USART_REC_LEN
#define USART_REC_LEN
Definition: bootloader/inc/usart.h:48
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
usart_group_type
usart group type
Definition: bootloader/inc/usart.h:62
usart_group_type::tail
uint16_t tail
Definition: bootloader/inc/usart.h:65
usart_group_type::buf
uint16_t buf[1024]
Definition: bootloader/inc/usart.h:63
usart_group_type::count
uint16_t count
Definition: bootloader/inc/usart.h:66
usart_group_type::head
uint16_t head
Definition: bootloader/inc/usart.h:64


AT32F415 Firmwary Library: cdc_class.c Source File

  • middlewares
  • usbd_class
  • cdc
cdc_class.c
Go to the documentation of this file.
1
26#include "usbd_core.h"
27#include "cdc_class.h"
28#include "cdc_desc.h"
29
43 usb_sts_type class_init_handler(void *udev);
44 usb_sts_type class_clear_handler(void *udev);
45 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup);
46 usb_sts_type class_ept0_tx_handler(void *udev);
47 usb_sts_type class_ept0_rx_handler(void *udev);
48 usb_sts_type class_in_handler(void *udev, uint8_t ept_num);
49 usb_sts_type class_out_handler(void *udev, uint8_t ept_num);
50 usb_sts_type class_sof_handler(void *udev);
51 usb_sts_type class_event_handler(void *udev, usbd_event_type event);
52
53void usb_vcp_cmd_process(void *udev, uint8_t cmd, uint8_t *buff, uint16_t len);
54/* usb rx and tx buffer */
55static uint32_t alt_setting = 0;
56static uint8_t g_rx_buff[USBD_OUT_MAXPACKET_SIZE];
57//static uint8_t g_tx_buff[USBD_IN_MAXPACKET_SIZE];
58static uint8_t g_cmd[USBD_CMD_MAXPACKET_SIZE];
59static uint8_t g_req;
60static uint16_t g_len, g_rxlen;
61__IO uint8_t g_tx_completed = 1, g_rx_completed = 0;
62
63 linecoding_type linecoding =
64{
65 115200,
66 0x00,
67 0x00,
68 0x08
69};
70
71/* static variable */
72
73
74/* usb device class handler */
75usbd_class_handler class_handler =
76{
77 class_init_handler,
78 class_clear_handler,
79 class_setup_handler,
80 class_ept0_tx_handler,
81 class_ept0_rx_handler,
82 class_in_handler,
83 class_out_handler,
84 class_sof_handler,
85 class_event_handler,
86};
87
93 usb_sts_type class_init_handler(void *udev)
94{
95 usb_sts_type status = USB_OK;
96 usbd_core_type *pudev = (usbd_core_type *)udev;
97
98 /* open in endpoint */
99 usbd_ept_open(pudev, USBD_CDC_INT_EPT, EPT_INT_TYPE, USBD_CMD_MAXPACKET_SIZE);
100
101 /* open in endpoint */
102 usbd_ept_open(pudev, USBD_CDC_BULK_IN_EPT, EPT_BULK_TYPE, USBD_IN_MAXPACKET_SIZE);
103
104 /* open out endpoint */
105 usbd_ept_open(pudev, USBD_CDC_BULK_OUT_EPT, EPT_BULK_TYPE, USBD_OUT_MAXPACKET_SIZE);
106
107 /* set out endpoint to receive status */
108 usbd_ept_recv(pudev, USBD_CDC_BULK_OUT_EPT, g_rx_buff, USBD_OUT_MAXPACKET_SIZE);
109
110 g_tx_completed = 1;
111
112 return status;
113}
114
120 usb_sts_type class_clear_handler(void *udev)
121{
122 usb_sts_type status = USB_OK;
123 usbd_core_type *pudev = (usbd_core_type *)udev;
124
125 /* close in endpoint */
126 usbd_ept_close(pudev, USBD_CDC_INT_EPT);
127
128 /* close in endpoint */
129 usbd_ept_close(pudev, USBD_CDC_BULK_IN_EPT);
130
131 /* close out endpoint */
132 usbd_ept_close(pudev, USBD_CDC_BULK_OUT_EPT);
133
134 return status;
135}
136
143 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
144{
145 usb_sts_type status = USB_OK;
146 usbd_core_type *pudev = (usbd_core_type *)udev;
147
148 switch(setup->bmRequestType & USB_REQ_TYPE_RESERVED)
149 {
150 /* class request */
151 case USB_REQ_TYPE_CLASS:
152 if(setup->wLength)
153 {
154 if(setup->bmRequestType & USB_REQ_DIR_DTH)
155 {
156 usb_vcp_cmd_process(udev, setup->bRequest, g_cmd, setup->wLength);
157 usbd_ctrl_send(pudev, g_cmd, setup->wLength);
158 }
159 else
160 {
161 g_req = setup->bRequest;
162 g_len = setup->wLength;
163 usbd_ctrl_recv(pudev, g_cmd, g_len);
164
165 }
166 }
167 break;
168 /* standard request */
169 case USB_REQ_TYPE_STANDARD:
170 switch(setup->bRequest)
171 {
172 case USB_STD_REQ_GET_DESCRIPTOR:
173 usbd_ctrl_unsupport(pudev);
174 break;
175 case USB_STD_REQ_GET_INTERFACE:
176 usbd_ctrl_send(pudev, (uint8_t *)&alt_setting, 1);
177 break;
178 case USB_STD_REQ_SET_INTERFACE:
179 alt_setting = setup->wValue;
180 break;
181 default:
182 break;
183 }
184 break;
185 default:
186 usbd_ctrl_unsupport(pudev);
187 break;
188 }
189 return status;
190}
191
197 usb_sts_type class_ept0_tx_handler(void *udev)
198{
199 usb_sts_type status = USB_OK;
200
201 /* ...user code... */
202
203 return status;
204}
205
211 usb_sts_type class_ept0_rx_handler(void *udev)
212{
213 usb_sts_type status = USB_OK;
214 usbd_core_type *pudev = (usbd_core_type *)udev;
215 uint32_t recv_len = usbd_get_recv_len(pudev, 0);
216 /* ...user code... */
217 if( g_req == SET_LINE_CODING)
218 {
219 /* class process */
220 usb_vcp_cmd_process(udev, g_req, g_cmd, recv_len);
221 }
222
223 return status;
224}
225
232 usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
233{
234 usbd_core_type *pudev = (usbd_core_type *)udev;
235 usb_sts_type status = USB_OK;
236
237 /* ...user code...
238 trans next packet data
239 */
240 usbd_flush_tx_fifo(pudev, ept_num);
241 g_tx_completed = 1;
242
243 return status;
244}
245
252 usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
253{
254 usb_sts_type status = USB_OK;
255 usbd_core_type *pudev = (usbd_core_type *)udev;
256
257 /* get endpoint receive data length */
258 g_rxlen = usbd_get_recv_len(pudev, ept_num);
259
260 /*set recv flag*/
261 g_rx_completed = 1;
262
263 return status;
264}
265
271 usb_sts_type class_sof_handler(void *udev)
272{
273 usb_sts_type status = USB_OK;
274
275 /* ...user code... */
276
277 return status;
278}
279
286 usb_sts_type class_event_handler(void *udev, usbd_event_type event)
287{
288 usb_sts_type status = USB_OK;
289 switch(event)
290 {
291 case USBD_RESET_EVENT:
292
293 /* ...user code... */
294
295 break;
296 case USBD_SUSPEND_EVENT:
297
298 /* ...user code... */
299
300 break;
301 case USBD_WAKEUP_EVENT:
302 /* ...user code... */
303
304 break;
305 case USBD_INISOINCOM_EVENT:
306 break;
307 case USBD_OUTISOINCOM_EVENT:
308 break;
309
310 default:
311 break;
312 }
313 return status;
314}
315
322uint16_t usb_vcp_get_rxdata(void *udev, uint8_t *recv_data)
323{
324 uint16_t i_index = 0;
325 uint16_t tmp_len = g_rxlen;
326 usbd_core_type *pudev = (usbd_core_type *)udev;
327
328 if(g_rx_completed == 0)
329 {
330 return 0;
331 }
332 g_rx_completed = 0;
333 tmp_len = g_rxlen;
334 for(i_index = 0; i_index < g_rxlen; i_index ++)
335 {
336 recv_data[i_index] = g_rx_buff[i_index];
337 }
338
339 usbd_ept_recv(pudev, USBD_CDC_BULK_OUT_EPT, g_rx_buff, USBD_OUT_MAXPACKET_SIZE);
340
341 return tmp_len;
342}
343
351 error_status usb_vcp_send_data(void *udev, uint8_t *send_data, uint16_t len)
352{
353 error_status status = SUCCESS;
354 usbd_core_type *pudev = (usbd_core_type *)udev;
355 if(g_tx_completed)
356 {
357 g_tx_completed = 0;
358 usbd_ept_send(pudev, USBD_CDC_BULK_IN_EPT, send_data, len);
359 }
360 else
361 {
362 status = ERROR;
363 }
364 return status;
365}
366
367
376void usb_vcp_cmd_process(void *udev, uint8_t cmd, uint8_t *buff, uint16_t len)
377{
378 switch(cmd)
379 {
380 case SET_LINE_CODING:
381 linecoding.bitrate = (uint32_t)(buff[0] | (buff[1] << 8) | (buff[2] << 16) | (buff[3] <<24));
382 linecoding.format = buff[4];
383 linecoding.parity = buff[5];
384 linecoding.data = buff[6];
385 break;
386
387 case GET_LINE_CODING:
388 buff[0] = (uint8_t)linecoding.bitrate;
389 buff[1] = (uint8_t)(linecoding.bitrate >> 8);
390 buff[2] = (uint8_t)(linecoding.bitrate >> 16);
391 buff[3] = (uint8_t)(linecoding.bitrate >> 24);
392 buff[4] = (uint8_t)(linecoding.format);
393 buff[5] = (uint8_t)(linecoding.parity);
394 buff[6] = (uint8_t)(linecoding.data);
395 break;
396
397 default:
398 break;
399 }
400}
401
cdc_class.h
usb cdc class file
cdc_desc.h
usb cdc descriptor header file
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
USBD_CMD_MAXPACKET_SIZE
#define USBD_CMD_MAXPACKET_SIZE
Definition: cdc_class.h:62
GET_LINE_CODING
#define GET_LINE_CODING
Definition: cdc_class.h:68
USBD_CDC_BULK_OUT_EPT
#define USBD_CDC_BULK_OUT_EPT
Definition: cdc_class.h:55
SET_LINE_CODING
#define SET_LINE_CODING
usb cdc class request code define
Definition: cdc_class.h:67
USBD_CDC_INT_EPT
#define USBD_CDC_INT_EPT
usb cdc use endpoint define
Definition: cdc_class.h:53
USBD_CDC_BULK_IN_EPT
#define USBD_CDC_BULK_IN_EPT
Definition: cdc_class.h:54
g_rx_completed
__IO uint8_t g_rx_completed
Definition: cdc_class.c:61
class_handler
usbd_class_handler class_handler
Definition: cdc_class.c:75
linecoding
linecoding_type linecoding
Definition: cdc_class.c:63
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: cdc_class.c:286
g_rxlen
static uint16_t g_rxlen
Definition: cdc_class.c:60
usb_vcp_get_rxdata
uint16_t usb_vcp_get_rxdata(void *udev, uint8_t *recv_data)
usb device class rx data process
Definition: cdc_class.c:322
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: cdc_class.c:271
usb_vcp_cmd_process
void usb_vcp_cmd_process(void *udev, uint8_t cmd, uint8_t *buff, uint16_t len)
usb device function
Definition: cdc_class.c:376
g_len
static uint16_t g_len
Definition: cdc_class.c:60
g_req
static uint8_t g_req
Definition: cdc_class.c:59
g_tx_completed
__IO uint8_t g_tx_completed
Definition: cdc_class.c:61
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: cdc_class.c:143
usb_vcp_send_data
error_status usb_vcp_send_data(void *udev, uint8_t *send_data, uint16_t len)
usb device class send data
Definition: cdc_class.c:351
g_cmd
static uint8_t g_cmd[0x08]
Definition: cdc_class.c:58
alt_setting
static uint32_t alt_setting
Definition: cdc_class.c:55
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: cdc_class.c:197
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: cdc_class.c:232
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb custom hid endpoint
Definition: cdc_class.c:93
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: cdc_class.c:211
g_rx_buff
static uint8_t g_rx_buff[0x40]
Definition: cdc_class.c:56
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: cdc_class.c:252
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: cdc_class.c:120
EPT_INT_TYPE
@ EPT_INT_TYPE
Definition: at32f415_usb.h:349
EPT_BULK_TYPE
@ EPT_BULK_TYPE
Definition: at32f415_usb.h:348
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
USB_STD_REQ_GET_DESCRIPTOR
#define USB_STD_REQ_GET_DESCRIPTOR
Definition: usb_std.h:81
USB_REQ_DIR_DTH
#define USB_REQ_DIR_DTH
Definition: usb_std.h:72
USB_STD_REQ_SET_INTERFACE
#define USB_STD_REQ_SET_INTERFACE
Definition: usb_std.h:86
USB_REQ_TYPE_RESERVED
#define USB_REQ_TYPE_RESERVED
Definition: usb_std.h:66
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_STD_REQ_GET_INTERFACE
#define USB_STD_REQ_GET_INTERFACE
Definition: usb_std.h:85
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usb_std.h:64
USB_OK
@ USB_OK
Definition: usb_std.h:218
usbd_ept_close
void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint
Definition: usbd_core.c:341
usbd_ept_recv
void usbd_ept_recv(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint receive data
Definition: usbd_core.c:529
usbd_flush_tx_fifo
void usbd_flush_tx_fifo(usbd_core_type *udev, uint8_t ept_num)
usb device flush in endpoint fifo
Definition: usbd_core.c:645
usbd_ept_open
void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint
Definition: usbd_core.c:309
usbd_ctrl_send
void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data
Definition: usbd_core.c:174
usbd_ept_send
void usbd_ept_send(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data
Definition: usbd_core.c:429
usbd_get_recv_len
uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length
Definition: usbd_core.c:295
usbd_ctrl_recv
void usbd_ctrl_recv(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint recv data
Definition: usbd_core.c:192
usbd_ctrl_unsupport
void usbd_ctrl_unsupport(usbd_core_type *udev)
un-support device request
Definition: usbd_core.c:282
linecoding_type
usb cdc class set line coding struct
Definition: cdc_class.h:82
linecoding_type::bitrate
uint32_t bitrate
Definition: cdc_class.h:83
linecoding_type::data
uint8_t data
Definition: cdc_class.h:86
linecoding_type::parity
uint8_t parity
Definition: cdc_class.h:85
linecoding_type::format
uint8_t format
Definition: cdc_class.h:84
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_setup_type::wValue
uint16_t wValue
Definition: usb_std.h:233
usb_setup_type::wLength
uint16_t wLength
Definition: usb_std.h:236
usb_setup_type::bmRequestType
uint8_t bmRequestType
Definition: usb_std.h:231
usb_setup_type::bRequest
uint8_t bRequest
Definition: usb_std.h:232
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: cdc_class.h Source File

  • middlewares
  • usbd_class
  • cdc
cdc_class.h
Go to the documentation of this file.
1
27 /* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __CDC_CLASS_H
29#define __CDC_CLASS_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "usb_std.h"
36#include "usbd_core.h"
37
53#define USBD_CDC_INT_EPT 0x82
54#define USBD_CDC_BULK_IN_EPT 0x81
55#define USBD_CDC_BULK_OUT_EPT 0x01
56
60#define USBD_IN_MAXPACKET_SIZE 0x40
61#define USBD_OUT_MAXPACKET_SIZE 0x40
62#define USBD_CMD_MAXPACKET_SIZE 0x08
63
67#define SET_LINE_CODING 0x20
68#define GET_LINE_CODING 0x21
69
81typedef struct
82{
83 uint32_t bitrate; /* line coding baud rate */
84 uint8_t format; /* line coding foramt */
85 uint8_t parity; /* line coding parity */
86 uint8_t data; /* line coding data bit */
87}linecoding_type;
88
96extern usbd_class_handler class_handler;
97uint16_t usb_vcp_get_rxdata(void *udev, uint8_t *recv_data);
98 error_status usb_vcp_send_data(void *udev, uint8_t *send_data, uint16_t len);
99
111#ifdef __cplusplus
112}
113#endif
114
115#endif
116
117
118
119
error_status
error_status
error status
Definition: at32f415.h:258
class_handler
usbd_class_handler class_handler
Definition: cdc_class.c:75
usb_vcp_get_rxdata
uint16_t usb_vcp_get_rxdata(void *udev, uint8_t *recv_data)
usb device class rx data process
Definition: cdc_class.c:322
usb_vcp_send_data
error_status usb_vcp_send_data(void *udev, uint8_t *send_data, uint16_t len)
usb device class send data
Definition: cdc_class.c:351
linecoding_type
usb cdc class set line coding struct
Definition: cdc_class.h:82
linecoding_type::bitrate
uint32_t bitrate
Definition: cdc_class.h:83
linecoding_type::data
uint8_t data
Definition: cdc_class.h:86
linecoding_type::parity
uint8_t parity
Definition: cdc_class.h:85
linecoding_type::format
uint8_t format
Definition: cdc_class.h:84
usb_std.h
usb standard header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: cdc_desc.c Source File

  • middlewares
  • usbd_class
  • cdc
cdc_desc.c
Go to the documentation of this file.
1
26#include "stdio.h"
27#include "usb_std.h"
28#include "usbd_sdr.h"
29#include "usbd_core.h"
30#include "cdc_desc.h"
31
45usbd_desc_t *get_device_descriptor(void);
46usbd_desc_t *get_device_qualifier(void);
47usbd_desc_t *get_device_configuration(void);
48usbd_desc_t *get_device_other_speed(void);
49usbd_desc_t *get_device_lang_id(void);
50usbd_desc_t *get_device_manufacturer_string(void);
51usbd_desc_t *get_device_product_string(void);
52usbd_desc_t *get_device_serial_string(void);
53usbd_desc_t *get_device_interface_string(void);
54usbd_desc_t *get_device_config_string(void);
55
56uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf);
57static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len);
58static void get_serial_num(void);
59static uint8_t g_usbd_desc_buffer[256];
60
64usbd_desc_handler desc_handler =
65{
66 get_device_descriptor,
67 get_device_qualifier,
68 get_device_configuration,
69 get_device_other_speed,
70 get_device_lang_id,
71 get_device_manufacturer_string,
72 get_device_product_string,
73 get_device_serial_string,
74 get_device_interface_string,
75 get_device_config_string,
76};
77
81#if defined ( __ICCARM__ ) /* iar compiler */
82 #pragma data_alignment=4
83#endif
84ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL =
85{
86 USB_DEVICE_DESC_LEN, /* bLength */
87 USB_DESCIPTOR_TYPE_DEVICE, /* bDescriptorType */
88 0x00, /* bcdUSB */
89 0x02,
90 0x02, /* bDeviceClass */
91 0x00, /* bDeviceSubClass */
92 0x00, /* bDeviceProtocol */
93 USB_MAX_EP0_SIZE, /* bMaxPacketSize */
94 LBYTE(USBD_VENDOR_ID), /* idVendor */
95 HBYTE(USBD_VENDOR_ID), /* idVendor */
96 LBYTE(USBD_PRODUCT_ID), /* idProduct */
97 HBYTE(USBD_PRODUCT_ID), /* idProduct */
98 0x00, /* bcdDevice rel. 2.00 */
99 0x02,
100 USB_MFC_STRING, /* Index of manufacturer string */
101 USB_PRODUCT_STRING, /* Index of product string */
102 USB_SERIAL_STRING, /* Index of serial number string */
103 1 /* bNumConfigurations */
104};
105
109#if defined ( __ICCARM__ ) /* iar compiler */
110 #pragma data_alignment=4
111#endif
112ALIGNED_HEAD uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE] ALIGNED_TAIL =
113{
114 USB_DEVICE_CFG_DESC_LEN, /* bLength: configuration descriptor size */
115 USB_DESCIPTOR_TYPE_CONFIGURATION, /* bDescriptorType: configuration */
116 LBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
117 HBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
118 0x02, /* bNumInterfaces: 2 interface */
119 0x01, /* bConfigurationValue: configuration value */
120 0x00, /* iConfiguration: index of string descriptor describing
121 the configuration */
122 0xC0, /* bmAttributes: self powered */
123 0x32, /* MaxPower 100 mA: this current is used for detecting vbus */
124
125 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
126 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
127 0x00, /* bInterfaceNumber: number of interface */
128 0x00, /* bAlternateSetting: alternate set */
129 0x01, /* bNumEndpoints: number of endpoints */
130 USB_CLASS_CODE_CDC, /* bInterfaceClass: CDC class code */
131 0x02, /* bInterfaceSubClass: subclass code, Abstract Control Model*/
132 0x01, /* bInterfaceProtocol: protocol code, AT Command */
133 0x00, /* iInterface: index of string descriptor */
134
135 0x05, /* bFunctionLength: size of this descriptor in bytes */
136 USBD_CDC_CS_INTERFACE, /* bDescriptorType: CDC interface descriptor type */
137 USBD_CDC_SUBTYPE_HEADER, /* bDescriptorSubtype: Header function Descriptor 0x00*/
138 LBYTE(BCD_NUM),
139 HBYTE(BCD_NUM), /* bcdCDC: USB class definitions for communications */
140
141 0x05, /* bFunctionLength: size of this descriptor in bytes */
142 USBD_CDC_CS_INTERFACE, /* bDescriptorType: CDC interface descriptor type */
143 USBD_CDC_SUBTYPE_CMF, /* bDescriptorSubtype: Call Management function descriptor subtype 0x01 */
144 0x00, /* bmCapabilities: 0x00*/
145 0x01, /* bDataInterface: interface number of data class interface optionally used for call management */
146
147 0x04, /* bFunctionLength: size of this descriptor in bytes */
148 USBD_CDC_CS_INTERFACE, /* bDescriptorType: CDC interface descriptor type */
149 USBD_CDC_SUBTYPE_ACM, /* bDescriptorSubtype: Abstract Control Management functional descriptor subtype 0x02 */
150 0x02, /* bmCapabilities: Support Set_Line_Coding and Get_Line_Coding 0x02 */
151
152 0x05, /* bFunctionLength: size of this descriptor in bytes */
153 USBD_CDC_CS_INTERFACE, /* bDescriptorType: CDC interface descriptor type */
154 USBD_CDC_SUBTYPE_UFD, /* bDescriptorSubtype: Union Function Descriptor subtype 0x06 */
155 0x00, /* bControlInterface: The interface number of the communications or data class interface 0x00 */
156 0x01, /* bSubordinateInterface0: interface number of first subordinate interface in the union */
157
158 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
159 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
160 USBD_CDC_INT_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
161 USB_EPT_DESC_INTERRUPT, /* bmAttributes: endpoint attributes */
162 LBYTE(USBD_CMD_MAXPACKET_SIZE),
163 HBYTE(USBD_CMD_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
164 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
165
166
167 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
168 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
169 0x01, /* bInterfaceNumber: number of interface */
170 0x00, /* bAlternateSetting: alternate set */
171 0x02, /* bNumEndpoints: number of endpoints */
172 USB_CLASS_CODE_CDCDATA, /* bInterfaceClass: CDC-data class code */
173 0x00, /* bInterfaceSubClass: Data interface subclass code 0x00*/
174 0x00, /* bInterfaceProtocol: data class protocol code 0x00 */
175 0x00, /* iInterface: index of string descriptor */
176
177 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
178 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
179 USBD_CDC_BULK_IN_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
180 USB_EPT_DESC_BULK, /* bmAttributes: endpoint attributes */
181 LBYTE(USBD_IN_MAXPACKET_SIZE),
182 HBYTE(USBD_IN_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
183 0x00, /* bInterval: interval for polling endpoint for data transfers */
184
185 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
186 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
187 USBD_CDC_BULK_OUT_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
188 USB_EPT_DESC_BULK, /* bmAttributes: endpoint attributes */
189 LBYTE(USBD_OUT_MAXPACKET_SIZE),
190 HBYTE(USBD_OUT_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
191 0x00, /* bInterval: interval for polling endpoint for data transfers */
192};
193
197#if defined ( __ICCARM__ ) /* iar compiler */
198 #pragma data_alignment=4
199#endif
200ALIGNED_HEAD uint8_t g_string_lang_id[USBD_SIZ_STRING_LANGID] ALIGNED_TAIL =
201{
202 USBD_SIZ_STRING_LANGID,
203 USB_DESCIPTOR_TYPE_STRING,
204 0x09,
205 0x04,
206};
207
211#if defined ( __ICCARM__ ) /* iar compiler */
212 #pragma data_alignment=4
213#endif
214ALIGNED_HEAD uint8_t g_string_serial[USBD_SIZ_STRING_SERIAL] ALIGNED_TAIL =
215{
216 USBD_SIZ_STRING_SERIAL,
217 USB_DESCIPTOR_TYPE_STRING,
218};
219
220
221/* device descriptor */
222usbd_desc_t device_descriptor =
223{
224 USB_DEVICE_DESC_LEN,
225 g_usbd_descriptor
226};
227
228/* config descriptor */
229usbd_desc_t config_descriptor =
230{
231 USBD_CONFIG_DESC_SIZE,
232 g_usbd_configuration
233};
234
235/* langid descriptor */
236usbd_desc_t langid_descriptor =
237{
238 USBD_SIZ_STRING_LANGID,
239 g_string_lang_id
240};
241
242/* serial descriptor */
243usbd_desc_t serial_descriptor =
244{
245 USBD_SIZ_STRING_SERIAL,
246 g_string_serial
247};
248
249usbd_desc_t vp_desc;
250
257uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
258{
259 uint16_t str_len = 0, id_pos = 2;
260 uint8_t *tmp_str = string;
261
262 while(*tmp_str != '\0')
263 {
264 str_len ++;
265 unicode_buf[id_pos ++] = *tmp_str ++;
266 unicode_buf[id_pos ++] = 0x00;
267 }
268
269 str_len = str_len * 2 + 2;
270 unicode_buf[0] = (uint8_t)str_len;
271 unicode_buf[1] = USB_DESCIPTOR_TYPE_STRING;
272
273 return str_len;
274}
275
283static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len)
284{
285 uint8_t idx = 0;
286
287 for( idx = 0 ; idx < len ; idx ++)
288 {
289 if( ((value >> 28)) < 0xA )
290 {
291 pbuf[ 2 * idx] = (value >> 28) + '0';
292 }
293 else
294 {
295 pbuf[2 * idx] = (value >> 28) + 'A' - 10;
296 }
297
298 value = value << 4;
299
300 pbuf[2 * idx + 1] = 0;
301 }
302}
303
309static void get_serial_num(void)
310{
311 uint32_t serial0, serial1, serial2;
312
313 serial0 = *(uint32_t*)MCU_ID1;
314 serial1 = *(uint32_t*)MCU_ID2;
315 serial2 = *(uint32_t*)MCU_ID3;
316
317 serial0 += serial2;
318
319 if (serial0 != 0)
320 {
321 usbd_int_to_unicode (serial0, &g_string_serial[2] ,8);
322 usbd_int_to_unicode (serial1, &g_string_serial[18] ,4);
323 }
324}
325
331usbd_desc_t *get_device_descriptor(void)
332{
333 return &device_descriptor;
334}
335
341usbd_desc_t * get_device_qualifier(void)
342{
343 return NULL;
344}
345
351usbd_desc_t *get_device_configuration(void)
352{
353 return &config_descriptor;
354}
355
361usbd_desc_t *get_device_other_speed(void)
362{
363 return NULL;
364}
365
371usbd_desc_t *get_device_lang_id(void)
372{
373 return &langid_descriptor;
374}
375
376
382usbd_desc_t *get_device_manufacturer_string(void)
383{
384 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_MANUFACTURER_STRING, g_usbd_desc_buffer);
385 vp_desc.descriptor = g_usbd_desc_buffer;
386 return &vp_desc;
387}
388
394usbd_desc_t *get_device_product_string(void)
395{
396 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_PRODUCT_STRING, g_usbd_desc_buffer);
397 vp_desc.descriptor = g_usbd_desc_buffer;
398 return &vp_desc;
399}
400
406usbd_desc_t *get_device_serial_string(void)
407{
408 get_serial_num();
409 return &serial_descriptor;
410}
411
417usbd_desc_t *get_device_interface_string(void)
418{
419 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_INTERFACE_STRING, g_usbd_desc_buffer);
420 vp_desc.descriptor = g_usbd_desc_buffer;
421 return &vp_desc;
422}
423
429usbd_desc_t *get_device_config_string(void)
430{
431 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_CONFIGURATION_STRING, g_usbd_desc_buffer);
432 vp_desc.descriptor = g_usbd_desc_buffer;
433 return &vp_desc;
434}
435
cdc_desc.h
usb cdc descriptor header file
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
USBD_DESC_CONFIGURATION_STRING
#define USBD_DESC_CONFIGURATION_STRING
Definition: audio_desc.h:61
USBD_SIZ_STRING_SERIAL
#define USBD_SIZ_STRING_SERIAL
Definition: audio_desc.h:57
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112
USBD_DESC_PRODUCT_STRING
#define USBD_DESC_PRODUCT_STRING
Definition: audio_desc.h:60
HID_BINTERVAL_TIME
#define HID_BINTERVAL_TIME
Definition: audio_desc.h:205
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: audio_desc.h:208
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
USBD_SIZ_STRING_LANGID
#define USBD_SIZ_STRING_LANGID
Definition: audio_desc.h:56
MCU_ID1
#define MCU_ID1
Definition: audio_desc.h:215
USBD_DESC_MANUFACTURER_STRING
#define USBD_DESC_MANUFACTURER_STRING
Definition: audio_desc.h:59
USBD_PRODUCT_ID
#define USBD_PRODUCT_ID
Definition: audio_desc.h:54
BCD_NUM
#define BCD_NUM
Definition: audio_desc.h:51
USBD_DESC_INTERFACE_STRING
#define USBD_DESC_INTERFACE_STRING
Definition: audio_desc.h:62
MCU_ID2
#define MCU_ID2
Definition: audio_desc.h:216
USBD_VENDOR_ID
#define USBD_VENDOR_ID
Definition: audio_desc.h:53
MCU_ID3
#define MCU_ID3
Definition: audio_desc.h:217
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
USBD_CMD_MAXPACKET_SIZE
#define USBD_CMD_MAXPACKET_SIZE
Definition: cdc_class.h:62
USBD_CDC_BULK_OUT_EPT
#define USBD_CDC_BULK_OUT_EPT
Definition: cdc_class.h:55
USBD_CDC_INT_EPT
#define USBD_CDC_INT_EPT
usb cdc use endpoint define
Definition: cdc_class.h:53
USBD_CDC_BULK_IN_EPT
#define USBD_CDC_BULK_IN_EPT
Definition: cdc_class.h:54
USBD_CDC_SUBTYPE_CMF
#define USBD_CDC_SUBTYPE_CMF
Definition: cdc_desc.h:91
USBD_CDC_SUBTYPE_HEADER
#define USBD_CDC_SUBTYPE_HEADER
usb hid class sub-type define
Definition: cdc_desc.h:90
USBD_CDC_CS_INTERFACE
#define USBD_CDC_CS_INTERFACE
usb hid class descriptor define
Definition: cdc_desc.h:84
USBD_CDC_SUBTYPE_UFD
#define USBD_CDC_SUBTYPE_UFD
Definition: cdc_desc.h:93
USBD_CDC_SUBTYPE_ACM
#define USBD_CDC_SUBTYPE_ACM
Definition: cdc_desc.h:92
serial_descriptor
usbd_desc_t serial_descriptor
Definition: cdc_desc.c:243
desc_handler
usbd_desc_handler desc_handler
device descriptor handler structure
Definition: cdc_desc.c:64
device_descriptor
usbd_desc_t device_descriptor
Definition: cdc_desc.c:222
usbd_unicode_convert
uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert
Definition: cdc_desc.c:257
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: cdc_desc.c:382
langid_descriptor
usbd_desc_t langid_descriptor
Definition: cdc_desc.c:236
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: cdc_desc.c:341
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: cdc_desc.c:417
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: cdc_desc.c:361
g_usbd_desc_buffer
static uint8_t g_usbd_desc_buffer[256]
Definition: cdc_desc.c:59
vp_desc
usbd_desc_t vp_desc
Definition: cdc_desc.c:249
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: cdc_desc.c:351
ALIGNED_TAIL
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL
usb device standard descriptor
Definition: cdc_desc.c:84
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: cdc_desc.c:394
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: cdc_desc.c:371
get_serial_num
static void get_serial_num(void)
usb get serial number
Definition: cdc_desc.c:309
config_descriptor
usbd_desc_t config_descriptor
Definition: cdc_desc.c:229
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: cdc_desc.c:331
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: cdc_desc.c:406
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: cdc_desc.c:429
usbd_int_to_unicode
static void usbd_int_to_unicode(uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode
Definition: cdc_desc.c:283
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_DEVICE_EPT_LEN
#define USB_DEVICE_EPT_LEN
Definition: usb_std.h:153
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
USB_DESCIPTOR_TYPE_CONFIGURATION
#define USB_DESCIPTOR_TYPE_CONFIGURATION
Definition: usb_std.h:93
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DESCIPTOR_TYPE_ENDPOINT
#define USB_DESCIPTOR_TYPE_ENDPOINT
Definition: usb_std.h:96
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_EPT_DESC_BULK
#define USB_EPT_DESC_BULK
Definition: usb_std.h:177
USB_DEVICE_IF_DESC_LEN
#define USB_DEVICE_IF_DESC_LEN
Definition: usb_std.h:152
USB_DEVICE_CFG_DESC_LEN
#define USB_DEVICE_CFG_DESC_LEN
Definition: usb_std.h:151
USB_EPT_DESC_INTERRUPT
#define USB_EPT_DESC_INTERRUPT
Definition: usb_std.h:178
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92
USB_CLASS_CODE_CDCDATA
#define USB_CLASS_CODE_CDCDATA
Definition: usb_std.h:167
USB_DESCIPTOR_TYPE_STRING
#define USB_DESCIPTOR_TYPE_STRING
Definition: usb_std.h:94
USB_DESCIPTOR_TYPE_INTERFACE
#define USB_DESCIPTOR_TYPE_INTERFACE
Definition: usb_std.h:95
USB_CLASS_CODE_CDC
#define USB_CLASS_CODE_CDC
Definition: usb_std.h:162
usb_std.h
usb standard header file
usbd_core.h
usb device core header file
usbd_sdr.h


AT32F415 Firmwary Library: cdc_desc.h Source File

  • middlewares
  • usbd_class
  • cdc
cdc_desc.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __CDC_DESC_H
29#define __CDC_DESC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "cdc_class.h"
36#include "usbd_core.h"
37
53#define BCD_NUM 0x0110
54
58#define USBD_VENDOR_ID 0x2E3C
59#define USBD_PRODUCT_ID 0x5740
60
64#define USBD_CONFIG_DESC_SIZE 67
65#define USBD_SIZ_STRING_LANGID 4
66#define USBD_SIZ_STRING_SERIAL 0x1A
67
71#define USBD_DESC_MANUFACTURER_STRING "Artery"
72#define USBD_DESC_PRODUCT_STRING "AT32 Virtual Com Port "
73#define USBD_DESC_CONFIGURATION_STRING "Virtual ComPort Config"
74#define USBD_DESC_INTERFACE_STRING "Virtual ComPort Interface"
75
79#define HID_BINTERVAL_TIME 0xFF
80
84#define USBD_CDC_CS_INTERFACE 0x24
85#define USBD_CDC_CS_ENDPOINT 0x25
86
90#define USBD_CDC_SUBTYPE_HEADER 0x00
91#define USBD_CDC_SUBTYPE_CMF 0x01
92#define USBD_CDC_SUBTYPE_ACM 0x02
93#define USBD_CDC_SUBTYPE_UFD 0x06
94
98#define MCU_ID1 (0x1FFFF7E8)
99#define MCU_ID2 (0x1FFFF7EC)
100#define MCU_ID3 (0x1FFFF7F0)
101
106extern uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN];
107extern uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE];
108extern usbd_desc_handler desc_handler;
109
110
118#ifdef __cplusplus
119}
120#endif
121
122#endif
cdc_class.h
usb cdc class file
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
usb descriptor size define
Definition: cdc_desc.h:64
desc_handler
usbd_desc_handler desc_handler
device descriptor handler structure
Definition: cdc_desc.c:64
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
g_usbd_configuration
uint8_t g_usbd_configuration[67]
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: cdc_keyboard_class.c Source File

  • middlewares
  • usbd_class
  • composite_cdc_keyboard
cdc_keyboard_class.c
Go to the documentation of this file.
1
26#include "usbd_core.h"
27#include "cdc_keyboard_class.h"
28#include "cdc_keyboard_desc.h"
29
43 usb_sts_type class_init_handler(void *udev);
44 usb_sts_type class_clear_handler(void *udev);
45 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup);
46 usb_sts_type class_ept0_tx_handler(void *udev);
47 usb_sts_type class_ept0_rx_handler(void *udev);
48 usb_sts_type class_in_handler(void *udev, uint8_t ept_num);
49 usb_sts_type class_out_handler(void *udev, uint8_t ept_num);
50 usb_sts_type class_sof_handler(void *udev);
51 usb_sts_type class_event_handler(void *udev, usbd_event_type event);
52 usb_sts_type cdc_class_setup_handler(void *udev, usb_setup_type *setup);
53 usb_sts_type keyboard_class_setup_handler(void *udev, usb_setup_type *setup);
54
55void usb_vcp_cmd_process(void *udev, uint8_t cmd, uint8_t *buff, uint16_t len);
56/* usb rx and tx buffer */
57static uint32_t alt_setting = 0;
58static uint32_t hid_protocol = 0;
59static uint32_t hid_set_idle = 0;
60static uint8_t hid_state;
61uint8_t hid_set_report[64];
62static uint8_t g_rx_buff[USBD_OUT_MAXPACKET_SIZE];
63
64static uint8_t g_cmd[USBD_CMD_MAXPACKET_SIZE];
65static uint8_t g_req;
66static uint16_t g_len, g_rxlen;
67__IO uint8_t g_tx_completed = 1, g_rx_completed = 0;
68
69__IO uint8_t g_keyboard_tx_completed = 0;
70
71#define SHIFT 0x80
72const unsigned char _asciimap[128] =
73{
74 0x00,// NUL
75 0x00,// SOH
76 0x00,// STX
77 0x00,// ETX
78 0x00,// EOT
79 0x00,// ENQ
80 0x00,// ACK
81 0x00,// BEL
82 0x2A,// BS Backspace
83 0x2B,// TAB Tab
84 0x28,// LF Enter
85 0x00,// VT
86 0x00,// FF
87 0x00,// CR
88 0x00,// SO
89 0x00,// SI
90 0x00,// DEL
91 0x00,// DC1
92 0x00,// DC2
93 0x00,// DC3
94 0x00,// DC4
95 0x00,// NAK
96 0x00,// SYN
97 0x00,// ETB
98 0x00,// CAN
99 0x00,// EM
100 0x00,// SUB
101 0x00,// ESC
102 0x00,// FS
103 0x00,// GS
104 0x00,// RS
105 0x00,// US
106
107 0x2C,// ' '
108 0x1E|SHIFT,// !
109 0x34|SHIFT,// "
110 0x20|SHIFT,// #
111 0x21|SHIFT,// $
112 0x22|SHIFT,// %
113 0x24|SHIFT,// &
114 0x34, // '
115 0x26|SHIFT,// (
116 0x27|SHIFT,// )
117 0x25|SHIFT,// *
118 0x2E|SHIFT,// +
119 0x36,// ,
120 0x2D,// -
121 0x37,// .
122 0x38,// /
123 0x27,// 0
124 0x1E,// 1
125 0x1F,// 2
126 0x20,// 3
127 0x21,// 4
128 0x22,// 5
129 0x23,// 6
130 0x24,// 7
131 0x25,// 8
132 0x26,// 9
133 0x33|SHIFT,// :
134 0x33, // ;
135 0x36|SHIFT,// <
136 0x2E, // =
137 0x37|SHIFT,// >
138 0x38|SHIFT,// ?
139 0x1F|SHIFT,// @
140 0x04|SHIFT,// A
141 0x05|SHIFT,// B
142 0x06|SHIFT,// C
143 0x07|SHIFT,// D
144 0x08|SHIFT,// E
145 0x09|SHIFT,// F
146 0x0A|SHIFT,// G
147 0x0B|SHIFT,// H
148 0x0C|SHIFT,// I
149 0x0D|SHIFT,// J
150 0x0E|SHIFT,// K
151 0x0F|SHIFT,// L
152 0x10|SHIFT,// M
153 0x11|SHIFT,// N
154 0x12|SHIFT,// O
155 0x13|SHIFT,// P
156 0x14|SHIFT,// Q
157 0x15|SHIFT,// R
158 0x16|SHIFT,// S
159 0x17|SHIFT,// T
160 0x18|SHIFT,// U
161 0x19|SHIFT,// V
162 0x1A|SHIFT,// W
163 0x1B|SHIFT,// X
164 0x1C|SHIFT,// Y
165 0x1D|SHIFT,// Z
166 0x2F, // [
167 0x31, // bslash
168 0x30, // ]
169 0x23|SHIFT,// ^
170 0x2D|SHIFT,// _
171 0x35, // `
172 0x04, // a
173 0x05, // b
174 0x06, // c
175 0x07, // d
176 0x08, // e
177 0x09, // f
178 0x0A, // g
179 0x0B, // h
180 0x0C, // i
181 0x0D, // j
182 0x0E, // k
183 0x0F, // l
184 0x10, // m
185 0x11, // n
186 0x12, // o
187 0x13, // p
188 0x14, // q
189 0x15, // r
190 0x16, // s
191 0x17, // t
192 0x18, // u
193 0x19, // v
194 0x1A, // w
195 0x1B, // x
196 0x1C, // y
197 0x1D, // z
198 0x2f|SHIFT,//
199 0x31|SHIFT,// |
200 0x30|SHIFT,// }
201 0x35|SHIFT,// ~
202 0 // DEL
203};
204
205 linecoding_type linecoding =
206{
207 115200,
208 0x00,
209 0x00,
210 0x08
211};
212
213/* static variable */
214
215
216/* usb device class handler */
217usbd_class_handler cdc_keyboard_class_handler =
218{
219 class_init_handler,
220 class_clear_handler,
221 class_setup_handler,
222 class_ept0_tx_handler,
223 class_ept0_rx_handler,
224 class_in_handler,
225 class_out_handler,
226 class_sof_handler,
227 class_event_handler,
228};
229
235 usb_sts_type class_init_handler(void *udev)
236{
237 usb_sts_type status = USB_OK;
238 usbd_core_type *pudev = (usbd_core_type *)udev;
239
240 /* open in endpoint */
241 usbd_ept_open(pudev, USBD_CDC_INT_EPT, EPT_INT_TYPE, USBD_CMD_MAXPACKET_SIZE);
242
243 /* open in endpoint */
244 usbd_ept_open(pudev, USBD_CDC_BULK_IN_EPT, EPT_BULK_TYPE, USBD_OUT_MAXPACKET_SIZE);
245
246 /* open out endpoint */
247 usbd_ept_open(pudev, USBD_CDC_BULK_OUT_EPT, EPT_BULK_TYPE, USBD_OUT_MAXPACKET_SIZE);
248
249 /* open hid in endpoint */
250 usbd_ept_open(pudev, USBD_HID_IN_EPT, EPT_INT_TYPE, USBD_OUT_MAXPACKET_SIZE);
251
252 /* set out endpoint to receive status */
253 usbd_ept_recv(pudev, USBD_CDC_BULK_OUT_EPT, g_rx_buff, USBD_OUT_MAXPACKET_SIZE);
254
255 g_tx_completed = 1;
256 g_keyboard_tx_completed = 1;
257
258 return status;
259}
260
266 usb_sts_type class_clear_handler(void *udev)
267{
268 usb_sts_type status = USB_OK;
269 usbd_core_type *pudev = (usbd_core_type *)udev;
270
271 /* close in endpoint */
272 usbd_ept_close(pudev, USBD_CDC_INT_EPT);
273
274 /* close in endpoint */
275 usbd_ept_close(pudev, USBD_CDC_BULK_IN_EPT);
276
277 /* close out endpoint */
278 usbd_ept_close(pudev, USBD_CDC_BULK_OUT_EPT);
279
280 /* close in endpoint */
281 usbd_ept_close(pudev, USBD_HID_IN_EPT);
282
283 return status;
284}
285
292 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
293{
294 usb_sts_type status = USB_OK;
295 usbd_core_type *pudev = (usbd_core_type *)udev;
296 switch(setup->bmRequestType & USB_REQ_RECIPIENT_MASK)
297 {
298 case USB_REQ_RECIPIENT_INTERFACE:
299 if(setup->wIndex == HID_KEYBOARD_INTERFACE)
300 {
301 keyboard_class_setup_handler(udev, setup);
302 }
303 else
304 {
305 cdc_class_setup_handler(pudev, setup);
306 }
307 break;
308 case USB_REQ_RECIPIENT_ENDPOINT:
309 break;
310
311 }
312 return status;
313}
314
321 usb_sts_type cdc_class_setup_handler(void *udev, usb_setup_type *setup)
322{
323 usb_sts_type status = USB_OK;
324 usbd_core_type *pudev = (usbd_core_type *)udev;
325
326 switch(setup->bmRequestType & USB_REQ_TYPE_RESERVED)
327 {
328 /* class request */
329 case USB_REQ_TYPE_CLASS:
330 if(setup->wLength)
331 {
332 if(setup->bmRequestType & USB_REQ_DIR_DTH)
333 {
334 usb_vcp_cmd_process(udev, setup->bRequest, g_cmd, setup->wLength);
335 usbd_ctrl_send(pudev, g_cmd, setup->wLength);
336 }
337 else
338 {
339 g_req = setup->bRequest;
340 g_len = setup->wLength;
341 usbd_ctrl_recv(pudev, g_cmd, g_len);
342
343 }
344 }
345 break;
346 /* standard request */
347 case USB_REQ_TYPE_STANDARD:
348 switch(setup->bRequest)
349 {
350 case USB_STD_REQ_GET_DESCRIPTOR:
351 usbd_ctrl_unsupport(pudev);
352 break;
353 case USB_STD_REQ_GET_INTERFACE:
354 usbd_ctrl_send(pudev, (uint8_t *)&alt_setting, 1);
355 break;
356 case USB_STD_REQ_SET_INTERFACE:
357 alt_setting = setup->wValue;
358 break;
359 default:
360 break;
361 }
362 break;
363 default:
364 usbd_ctrl_unsupport(pudev);
365 break;
366 }
367 return status;
368}
369
376 usb_sts_type keyboard_class_setup_handler(void *udev, usb_setup_type *setup)
377{
378 usb_sts_type status = USB_OK;
379 usbd_core_type *pudev = (usbd_core_type *)udev;
380 uint16_t len;
381 uint8_t *buf;
382
383 switch(setup->bmRequestType & USB_REQ_TYPE_RESERVED)
384 {
385 /* class request */
386 case USB_REQ_TYPE_CLASS:
387 switch(setup->bRequest)
388 {
389 case HID_REQ_SET_PROTOCOL:
390 hid_protocol = (uint8_t)setup->wValue;
391 break;
392 case HID_REQ_GET_PROTOCOL:
393 usbd_ctrl_send(pudev, (uint8_t *)&hid_protocol, 1);
394 break;
395 case HID_REQ_SET_IDLE:
396 hid_set_idle = (uint8_t)(setup->wValue >> 8);
397 break;
398 case HID_REQ_GET_IDLE:
399 usbd_ctrl_send(pudev, (uint8_t *)&hid_set_idle, 1);
400 break;
401 case HID_REQ_SET_REPORT:
402 hid_state = HID_REQ_SET_REPORT;
403 usbd_ctrl_recv(pudev, hid_set_report, setup->wLength);
404 break;
405 default:
406 usbd_ctrl_unsupport(pudev);
407 break;
408 }
409 break;
410 /* standard request */
411 case USB_REQ_TYPE_STANDARD:
412 switch(setup->bRequest)
413 {
414 case USB_STD_REQ_GET_DESCRIPTOR:
415 if(setup->wValue >> 8 == HID_REPORT_DESC)
416 {
417 len = MIN(USBD_HID_SIZ_REPORT_DESC, setup->wLength);
418 buf = (uint8_t *)g_usbd_hid_report;
419 }
420 else if(setup->wValue >> 8 == HID_DESCRIPTOR_TYPE)
421 {
422 len = MIN(9, setup->wLength);
423 buf = (uint8_t *)g_hid_usb_desc;
424 }
425 usbd_ctrl_send(pudev, (uint8_t *)buf, len);
426 break;
427 case USB_STD_REQ_GET_INTERFACE:
428 usbd_ctrl_send(pudev, (uint8_t *)&alt_setting, 1);
429 break;
430 case USB_STD_REQ_SET_INTERFACE:
431 alt_setting = setup->wValue;
432 break;
433 default:
434 break;
435 }
436 break;
437 default:
438 usbd_ctrl_unsupport(pudev);
439 break;
440 }
441 return status;
442}
443
449 usb_sts_type class_ept0_tx_handler(void *udev)
450{
451 usb_sts_type status = USB_OK;
452
453 /* ...user code... */
454
455 return status;
456}
457
463 usb_sts_type class_ept0_rx_handler(void *udev)
464{
465 usb_sts_type status = USB_OK;
466 usbd_core_type *pudev = (usbd_core_type *)udev;
467 uint32_t recv_len = usbd_get_recv_len(pudev, 0);
468 /* ...user code... */
469 if( g_req == SET_LINE_CODING)
470 {
471 /* class process */
472 usb_vcp_cmd_process(udev, g_req, g_cmd, recv_len);
473 }
474
475 if( hid_state == HID_REQ_SET_REPORT)
476 {
477 /* hid buffer process */
478 hid_state = 0;
479 }
480 return status;
481}
482
489 usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
490{
491 usb_sts_type status = USB_OK;
492
493 /* ...user code...
494 trans next packet data
495 */
496 if((ept_num & 0x7F) == (USBD_CDC_BULK_IN_EPT & 0x7F))
497 {
498 g_tx_completed = 1;
499 }
500 if((ept_num & 0x7F) == (USBD_HID_IN_EPT & 0x7F))
501 {
502 g_keyboard_tx_completed = 1;
503 }
504
505
506 return status;
507}
508
515 usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
516{
517 usb_sts_type status = USB_OK;
518 usbd_core_type *pudev = (usbd_core_type *)udev;
519
520 /* get endpoint receive data length */
521 g_rxlen = usbd_get_recv_len(pudev, ept_num);
522
523 /*set recv flag*/
524 g_rx_completed = 1;
525
526 return status;
527}
528
534 usb_sts_type class_sof_handler(void *udev)
535{
536 usb_sts_type status = USB_OK;
537
538 /* ...user code... */
539
540 return status;
541}
542
549 usb_sts_type class_event_handler(void *udev, usbd_event_type event)
550{
551 usb_sts_type status = USB_OK;
552 switch(event)
553 {
554 case USBD_RESET_EVENT:
555
556 /* ...user code... */
557
558 break;
559 case USBD_SUSPEND_EVENT:
560
561 /* ...user code... */
562
563 break;
564 case USBD_WAKEUP_EVENT:
565 /* ...user code... */
566
567 break;
568 default:
569 break;
570 }
571 return status;
572}
573
580uint16_t usb_vcp_get_rxdata(void *udev, uint8_t *recv_data)
581{
582 uint16_t i_index = 0;
583 uint16_t tmp_len = g_rxlen;
584 usbd_core_type *pudev = (usbd_core_type *)udev;
585
586 if(g_rx_completed == 0)
587 {
588 return 0;
589 }
590 g_rx_completed = 0;
591
592 tmp_len = g_rxlen;
593 for(i_index = 0; i_index < g_rxlen; i_index ++)
594 {
595 recv_data[i_index] = g_rx_buff[i_index];
596 }
597
598 usbd_ept_recv(pudev, USBD_CDC_BULK_OUT_EPT, g_rx_buff, USBD_OUT_MAXPACKET_SIZE);
599
600 return tmp_len;
601}
602
610 error_status usb_vcp_send_data(void *udev, uint8_t *send_data, uint16_t len)
611{
612 error_status status = SUCCESS;
613 usbd_core_type *pudev = (usbd_core_type *)udev;
614 if(g_tx_completed)
615 {
616 g_tx_completed = 0;
617 usbd_ept_send(pudev, USBD_CDC_BULK_IN_EPT, send_data, len);
618 }
619 else
620 {
621 status = ERROR;
622 }
623 return status;
624}
625
626
635void usb_vcp_cmd_process(void *udev, uint8_t cmd, uint8_t *buff, uint16_t len)
636{
637 switch(cmd)
638 {
639 case SET_LINE_CODING:
640 linecoding.bitrate = (uint32_t)(buff[0] | (buff[1] << 8) | (buff[2] << 16) | (buff[3] <<24));
641 linecoding.format = buff[4];
642 linecoding.parity = buff[5];
643 linecoding.data = buff[6];
644 break;
645
646 case GET_LINE_CODING:
647 buff[0] = (uint8_t)linecoding.bitrate;
648 buff[1] = (uint8_t)(linecoding.bitrate >> 8);
649 buff[2] = (uint8_t)(linecoding.bitrate >> 16);
650 buff[3] = (uint8_t)(linecoding.bitrate >> 24);
651 buff[4] = (uint8_t)(linecoding.format);
652 buff[5] = (uint8_t)(linecoding.parity);
653 buff[6] = (uint8_t)(linecoding.data);
654 break;
655
656 default:
657 break;
658 }
659}
660
668 usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
669{
670 usb_sts_type status = USB_OK;
671 usbd_core_type *pudev = (usbd_core_type *)udev;
672
673 if(usbd_connect_state_get(pudev) == USB_CONN_STATE_CONFIGURED)
674 usbd_ept_send(pudev, USBD_HID_IN_EPT, report, len);
675
676 return status;
677}
678
679
686void usb_hid_keyboard_send_char(void *udev, uint8_t ascii_code)
687{
688 uint8_t key_data = 0;
689 static uint8_t temp = 0;
690 static uint8_t keyboard_buf[8] = {0, 0, 6, 0, 0, 0, 0, 0};
691
692 if(ascii_code > 128)
693 {
694 ascii_code = 0;
695 }
696 else
697 {
698 ascii_code = _asciimap[ascii_code];
699 if(!ascii_code)
700 {
701 ascii_code = 0;
702 }
703
704 if(ascii_code & SHIFT)
705 {
706 key_data = 0x2;
707 ascii_code &= 0x7F;
708 }
709 }
710
711 if((temp == ascii_code) && (ascii_code != 0))
712 {
713 keyboard_buf[0] = 0;
714 keyboard_buf[2] = 0;
715 class_send_report(udev, keyboard_buf, 8);
716 }
717 else
718 {
719 keyboard_buf[0] = key_data;
720 keyboard_buf[2] = ascii_code;
721 class_send_report(udev, keyboard_buf, 8);
722 }
723}
724
cdc_keyboard_class.h
usb cdc and keyboard class file
cdc_keyboard_desc.h
usb cdc and keyboard descriptor header file
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
HID_DESCRIPTOR_TYPE
#define HID_DESCRIPTOR_TYPE
Definition: audio_hid_class.h:118
HID_REQ_GET_PROTOCOL
#define HID_REQ_GET_PROTOCOL
Definition: audio_hid_class.h:113
USBD_HID_IN_EPT
#define USBD_HID_IN_EPT
usb custom hid use endpoint define
Definition: audio_hid_class.h:61
HID_REQ_SET_PROTOCOL
#define HID_REQ_SET_PROTOCOL
usb custom hid class request code define
Definition: audio_hid_class.h:112
HID_REPORT_DESC
#define HID_REPORT_DESC
Definition: audio_hid_class.h:119
HID_REQ_SET_IDLE
#define HID_REQ_SET_IDLE
Definition: audio_hid_class.h:114
HID_REQ_GET_IDLE
#define HID_REQ_GET_IDLE
Definition: audio_hid_class.h:115
HID_REQ_SET_REPORT
#define HID_REQ_SET_REPORT
Definition: audio_hid_class.h:116
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: audio_hid_desc.h:236
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
usb hid descriptor
Definition: audio_hid_desc.c:527
USBD_CMD_MAXPACKET_SIZE
#define USBD_CMD_MAXPACKET_SIZE
Definition: cdc_class.h:62
GET_LINE_CODING
#define GET_LINE_CODING
Definition: cdc_class.h:68
USBD_CDC_BULK_OUT_EPT
#define USBD_CDC_BULK_OUT_EPT
Definition: cdc_class.h:55
SET_LINE_CODING
#define SET_LINE_CODING
usb cdc class request code define
Definition: cdc_class.h:67
USBD_CDC_INT_EPT
#define USBD_CDC_INT_EPT
usb cdc use endpoint define
Definition: cdc_class.h:53
USBD_CDC_BULK_IN_EPT
#define USBD_CDC_BULK_IN_EPT
Definition: cdc_class.h:54
g_rx_completed
__IO uint8_t g_rx_completed
Definition: cdc_keyboard_class.c:67
_asciimap
const unsigned char _asciimap[128]
Definition: cdc_keyboard_class.c:72
linecoding
linecoding_type linecoding
Definition: cdc_keyboard_class.c:205
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device class event handler
Definition: cdc_keyboard_class.c:549
g_rxlen
static uint16_t g_rxlen
Definition: cdc_keyboard_class.c:66
usb_hid_keyboard_send_char
void usb_hid_keyboard_send_char(void *udev, uint8_t ascii_code)
usb keyoard send char
Definition: cdc_keyboard_class.c:686
usb_vcp_get_rxdata
uint16_t usb_vcp_get_rxdata(void *udev, uint8_t *recv_data)
usb device class rx data process
Definition: cdc_keyboard_class.c:580
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device class sof handler
Definition: cdc_keyboard_class.c:534
hid_set_idle
static uint32_t hid_set_idle
Definition: cdc_keyboard_class.c:59
usb_vcp_cmd_process
void usb_vcp_cmd_process(void *udev, uint8_t cmd, uint8_t *buff, uint16_t len)
usb device class request function
Definition: cdc_keyboard_class.c:635
g_len
static uint16_t g_len
Definition: cdc_keyboard_class.c:66
g_req
static uint8_t g_req
Definition: cdc_keyboard_class.c:65
cdc_keyboard_class_handler
usbd_class_handler cdc_keyboard_class_handler
Definition: cdc_keyboard_class.c:217
g_tx_completed
__IO uint8_t g_tx_completed
Definition: cdc_keyboard_class.c:67
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: cdc_keyboard_class.c:292
usb_vcp_send_data
error_status usb_vcp_send_data(void *udev, uint8_t *send_data, uint16_t len)
usb device class send data
Definition: cdc_keyboard_class.c:610
cdc_class_setup_handler
usb_sts_type cdc_class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: cdc_keyboard_class.c:321
g_cmd
static uint8_t g_cmd[0x08]
Definition: cdc_keyboard_class.c:64
hid_set_report
uint8_t hid_set_report[64]
Definition: cdc_keyboard_class.c:61
alt_setting
static uint32_t alt_setting
Definition: cdc_keyboard_class.c:57
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device class endpoint 0 in status stage complete
Definition: cdc_keyboard_class.c:449
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: cdc_keyboard_class.c:668
SHIFT
#define SHIFT
Definition: cdc_keyboard_class.c:71
hid_protocol
static uint32_t hid_protocol
Definition: cdc_keyboard_class.c:58
keyboard_class_setup_handler
usb_sts_type keyboard_class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: cdc_keyboard_class.c:376
g_keyboard_tx_completed
__IO uint8_t g_keyboard_tx_completed
Definition: cdc_keyboard_class.c:69
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device class transmision complete handler
Definition: cdc_keyboard_class.c:489
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb endpoint
Definition: cdc_keyboard_class.c:235
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device class endpoint 0 out status stage complete
Definition: cdc_keyboard_class.c:463
g_rx_buff
static uint8_t g_rx_buff[0x40]
Definition: cdc_keyboard_class.c:62
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device class endpoint receive data
Definition: cdc_keyboard_class.c:515
hid_state
static uint8_t hid_state
Definition: cdc_keyboard_class.c:60
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: cdc_keyboard_class.c:266
HID_KEYBOARD_INTERFACE
#define HID_KEYBOARD_INTERFACE
Definition: cdc_keyboard_desc.h:113
EPT_INT_TYPE
@ EPT_INT_TYPE
Definition: at32f415_usb.h:349
EPT_BULK_TYPE
@ EPT_BULK_TYPE
Definition: at32f415_usb.h:348
MIN
#define MIN(a, b)
min and max define
Definition: usb_std.h:204
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
USB_STD_REQ_GET_DESCRIPTOR
#define USB_STD_REQ_GET_DESCRIPTOR
Definition: usb_std.h:81
USB_REQ_DIR_DTH
#define USB_REQ_DIR_DTH
Definition: usb_std.h:72
USB_REQ_RECIPIENT_MASK
#define USB_REQ_RECIPIENT_MASK
Definition: usb_std.h:58
USB_STD_REQ_SET_INTERFACE
#define USB_STD_REQ_SET_INTERFACE
Definition: usb_std.h:86
USB_REQ_TYPE_RESERVED
#define USB_REQ_TYPE_RESERVED
Definition: usb_std.h:66
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_STD_REQ_GET_INTERFACE
#define USB_STD_REQ_GET_INTERFACE
Definition: usb_std.h:85
USB_REQ_RECIPIENT_ENDPOINT
#define USB_REQ_RECIPIENT_ENDPOINT
Definition: usb_std.h:56
USB_REQ_RECIPIENT_INTERFACE
#define USB_REQ_RECIPIENT_INTERFACE
Definition: usb_std.h:55
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usb_std.h:64
USB_CONN_STATE_CONFIGURED
@ USB_CONN_STATE_CONFIGURED
Definition: usb_std.h:131
USB_OK
@ USB_OK
Definition: usb_std.h:218
usbd_connect_state_get
usbd_conn_state usbd_connect_state_get(usbd_core_type *udev)
get usb connect state
Definition: usbd_core.c:592
usbd_ept_close
void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint
Definition: usbd_core.c:341
usbd_ept_recv
void usbd_ept_recv(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint receive data
Definition: usbd_core.c:529
usbd_ept_open
void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint
Definition: usbd_core.c:309
usbd_ctrl_send
void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data
Definition: usbd_core.c:174
usbd_ept_send
void usbd_ept_send(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data
Definition: usbd_core.c:429
usbd_get_recv_len
uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length
Definition: usbd_core.c:295
usbd_ctrl_recv
void usbd_ctrl_recv(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint recv data
Definition: usbd_core.c:192
usbd_ctrl_unsupport
void usbd_ctrl_unsupport(usbd_core_type *udev)
un-support device request
Definition: usbd_core.c:282
linecoding_type
usb cdc class set line coding struct
Definition: cdc_class.h:82
linecoding_type::bitrate
uint32_t bitrate
Definition: cdc_class.h:83
linecoding_type::data
uint8_t data
Definition: cdc_class.h:86
linecoding_type::parity
uint8_t parity
Definition: cdc_class.h:85
linecoding_type::format
uint8_t format
Definition: cdc_class.h:84
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_setup_type::wValue
uint16_t wValue
Definition: usb_std.h:233
usb_setup_type::wLength
uint16_t wLength
Definition: usb_std.h:236
usb_setup_type::bmRequestType
uint8_t bmRequestType
Definition: usb_std.h:231
usb_setup_type::wIndex
uint16_t wIndex
Definition: usb_std.h:234
usb_setup_type::bRequest
uint8_t bRequest
Definition: usb_std.h:232
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: cdc_keyboard_class.h Source File

  • middlewares
  • usbd_class
  • composite_cdc_keyboard
cdc_keyboard_class.h
Go to the documentation of this file.
1
27 /* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __CDC_KEYBOARD_CLASS_H
29#define __CDC_KEYBOARD_CLASS_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "usb_std.h"
36#include "usbd_core.h"
37
53#define USBD_CDC_INT_EPT 0x82
54#define USBD_CDC_BULK_IN_EPT 0x81
55#define USBD_CDC_BULK_OUT_EPT 0x01
56#define USBD_HID_IN_EPT 0x83
57
61#define USBD_IN_MAXPACKET_SIZE 0x40
62#define USBD_OUT_MAXPACKET_SIZE 0x40
63#define USBD_CMD_MAXPACKET_SIZE 0x08
64
68#define SET_LINE_CODING 0x20
69#define GET_LINE_CODING 0x21
70
74#define HID_REQ_SET_PROTOCOL 0x0B
75#define HID_REQ_GET_PROTOCOL 0x03
76#define HID_REQ_SET_IDLE 0x0A
77#define HID_REQ_GET_IDLE 0x02
78#define HID_REQ_SET_REPORT 0x09
79#define HID_REQ_GET_REPORT 0x01
80#define HID_DESCRIPTOR_TYPE 0x21
81#define HID_REPORT_DESC 0x22
93typedef struct
94{
95 uint32_t bitrate; /* line coding baud rate */
96 uint8_t format; /* line coding foramt */
97 uint8_t parity; /* line coding parity */
98 uint8_t data; /* line coding data bit */
99}linecoding_type;
100
108extern usbd_class_handler cdc_keyboard_class_handler;
109extern __IO uint8_t g_keyboard_tx_completed;
110uint16_t usb_vcp_get_rxdata(void *udev, uint8_t *recv_data);
111 error_status usb_vcp_send_data(void *udev, uint8_t *send_data, uint16_t len);
112 usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len);
113void usb_hid_keyboard_send_char(void *udev, uint8_t ascii_code);
114
126#ifdef __cplusplus
127}
128#endif
129
130#endif
131
132
133
134
error_status
error_status
error status
Definition: at32f415.h:258
usb_hid_keyboard_send_char
void usb_hid_keyboard_send_char(void *udev, uint8_t ascii_code)
usb keyoard send char
Definition: cdc_keyboard_class.c:686
usb_vcp_get_rxdata
uint16_t usb_vcp_get_rxdata(void *udev, uint8_t *recv_data)
usb device class rx data process
Definition: cdc_class.c:322
cdc_keyboard_class_handler
usbd_class_handler cdc_keyboard_class_handler
Definition: cdc_keyboard_class.c:217
usb_vcp_send_data
error_status usb_vcp_send_data(void *udev, uint8_t *send_data, uint16_t len)
usb device class send data
Definition: cdc_class.c:351
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: audio_hid_class.c:818
g_keyboard_tx_completed
__IO uint8_t g_keyboard_tx_completed
Definition: cdc_keyboard_class.c:69
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
linecoding_type
usb cdc class set line coding struct
Definition: cdc_class.h:82
usb_std.h
usb standard header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: cdc_keyboard_desc.c Source File

  • middlewares
  • usbd_class
  • composite_cdc_keyboard
cdc_keyboard_desc.c
Go to the documentation of this file.
1
26#include "usb_std.h"
27#include "usbd_sdr.h"
28#include "usbd_core.h"
29#include "cdc_keyboard_desc.h"
43usbd_desc_t *get_device_descriptor(void);
44usbd_desc_t *get_device_qualifier(void);
45usbd_desc_t *get_device_configuration(void);
46usbd_desc_t *get_device_other_speed(void);
47usbd_desc_t *get_device_lang_id(void);
48usbd_desc_t *get_device_manufacturer_string(void);
49usbd_desc_t *get_device_product_string(void);
50usbd_desc_t *get_device_serial_string(void);
51usbd_desc_t *get_device_interface_string(void);
52usbd_desc_t *get_device_config_string(void);
53
54uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf);
55static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len);
56static void get_serial_num(void);
57static uint8_t g_usbd_desc_buffer[256];
58
62usbd_desc_handler cdc_keyboard_desc_handler =
63{
64 get_device_descriptor,
65 get_device_qualifier,
66 get_device_configuration,
67 get_device_other_speed,
68 get_device_lang_id,
69 get_device_manufacturer_string,
70 get_device_product_string,
71 get_device_serial_string,
72 get_device_interface_string,
73 get_device_config_string,
74};
75
79#if defined ( __ICCARM__ ) /* iar compiler */
80 #pragma data_alignment=4
81#endif
82ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL =
83{
84 USB_DEVICE_DESC_LEN, /* bLength */
85 USB_DESCIPTOR_TYPE_DEVICE, /* bDescriptorType */
86 0x00, /* bcdUSB */
87 0x02,
88 0xEF, /* bDeviceClass */
89 0x02, /* bDeviceSubClass */
90 0x01, /* bDeviceProtocol */
91 USB_MAX_EP0_SIZE, /* bMaxPacketSize */
92 LBYTE(USBD_VENDOR_ID), /* idVendor */
93 HBYTE(USBD_VENDOR_ID), /* idVendor */
94 LBYTE(USBD_PRODUCT_ID), /* idProduct */
95 HBYTE(USBD_PRODUCT_ID), /* idProduct */
96 0x00, /* bcdDevice rel. 2.00 */
97 0x02,
98 USB_MFC_STRING, /* Index of manufacturer string */
99 USB_PRODUCT_STRING, /* Index of product string */
100 USB_SERIAL_STRING, /* Index of serial number string */
101 1 /* bNumConfigurations */
102};
103
107#if defined ( __ICCARM__ ) /* iar compiler */
108 #pragma data_alignment=4
109#endif
110ALIGNED_HEAD uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE] ALIGNED_TAIL =
111{
112 USB_DEVICE_CFG_DESC_LEN, /* bLength: configuration descriptor size */
113 USB_DESCIPTOR_TYPE_CONFIGURATION, /* bDescriptorType: configuration */
114 LBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
115 HBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
116 0x03, /* bNumInterfaces: 2 interface */
117 0x01, /* bConfigurationValue: configuration value */
118 0x00, /* iConfiguration: index of string descriptor describing
119 the configuration */
120 0xC0, /* bmAttributes: self powered */
121 0x32, /* MaxPower 100 mA: this current is used for detecting vbus */
122
123 0x08, /* bLength */
124 0x0B, /* bDescriptorType */
125 0x00, /* bFirstInterface */
126 0x02, /* bInterfaceCount */
127 0x02, /* bFunctionClass */
128 0x02, /* bFunctionSubClass */
129 0x01, /* bFunctionProtocol */
130 0x00, /* iFunction (Index of string descriptor describing this function) */
131
132 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
133 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
134 CDC_INTERFACE, /* bInterfaceNumber: number of interface */
135 0x00, /* bAlternateSetting: alternate set */
136 0x01, /* bNumEndpoints: number of endpoints */
137 USB_CLASS_CODE_CDC, /* bInterfaceClass: CDC class code */
138 0x02, /* bInterfaceSubClass: subclass code, Abstract Control Model*/
139 0x01, /* bInterfaceProtocol: protocol code, AT Command */
140 0x00, /* iInterface: index of string descriptor */
141
142 0x05, /* bFunctionLength: size of this descriptor in bytes */
143 USBD_CDC_CS_INTERFACE, /* bDescriptorType: CDC interface descriptor type */
144 USBD_CDC_SUBTYPE_HEADER, /* bDescriptorSubtype: Header function Descriptor 0x00*/
145 LBYTE(BCD_NUM),
146 HBYTE(BCD_NUM), /* bcdCDC: USB class definitions for communications */
147
148 0x05, /* bFunctionLength: size of this descriptor in bytes */
149 USBD_CDC_CS_INTERFACE, /* bDescriptorType: CDC interface descriptor type */
150 USBD_CDC_SUBTYPE_CMF, /* bDescriptorSubtype: Call Management function descriptor subtype 0x01 */
151 0x00, /* bmCapabilities: 0x00*/
152 0x01, /* bDataInterface: interface number of data class interface optionally used for call management */
153
154 0x04, /* bFunctionLength: size of this descriptor in bytes */
155 USBD_CDC_CS_INTERFACE, /* bDescriptorType: CDC interface descriptor type */
156 USBD_CDC_SUBTYPE_ACM, /* bDescriptorSubtype: Abstract Control Management functional descriptor subtype 0x02 */
157 0x02, /* bmCapabilities: Support Set_Line_Coding and Get_Line_Coding 0x02 */
158
159 0x05, /* bFunctionLength: size of this descriptor in bytes */
160 USBD_CDC_CS_INTERFACE, /* bDescriptorType: CDC interface descriptor type */
161 USBD_CDC_SUBTYPE_UFD, /* bDescriptorSubtype: Union Function Descriptor subtype 0x06 */
162 0x00, /* bControlInterface: The interface number of the communications or data class interface 0x00 */
163 0x01, /* bSubordinateInterface0: interface number of first subordinate interface in the union */
164
165 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
166 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
167 USBD_CDC_INT_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
168 USB_EPT_DESC_INTERRUPT, /* bmAttributes: endpoint attributes */
169 LBYTE(USBD_CMD_MAXPACKET_SIZE),
170 HBYTE(USBD_CMD_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
171 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
172
173
174 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
175 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
176 CDC_DATA_INTERFACE, /* bInterfaceNumber: number of interface */
177 0x00, /* bAlternateSetting: alternate set */
178 0x02, /* bNumEndpoints: number of endpoints */
179 USB_CLASS_CODE_CDCDATA, /* bInterfaceClass: CDC-data class code */
180 0x00, /* bInterfaceSubClass: Data interface subclass code 0x00*/
181 0x00, /* bInterfaceProtocol: data class protocol code 0x00 */
182 0x00, /* iInterface: index of string descriptor */
183
184 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
185 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
186 USBD_CDC_BULK_IN_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
187 USB_EPT_DESC_BULK, /* bmAttributes: endpoint attributes */
188 LBYTE(USBD_IN_MAXPACKET_SIZE),
189 HBYTE(USBD_IN_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
190 0x00, /* bInterval: interval for polling endpoint for data transfers */
191
192 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
193 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
194 USBD_CDC_BULK_OUT_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
195 USB_EPT_DESC_BULK, /* bmAttributes: endpoint attributes */
196 LBYTE(USBD_OUT_MAXPACKET_SIZE),
197 HBYTE(USBD_OUT_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
198 0x00, /* bInterval: interval for polling endpoint for data transfers */
199
200 0x08, /* bLength */
201 0x0B, /* bDescriptorType */
202 0x02, /* bFirstInterface */
203 0x01, /* bInterfaceCount */
204 0x03, /* bFunctionClass */
205 0x00, /* bFunctionSubClass */
206 0x01, /* bFunctionProtocol */
207 0x00, /* iFunction (Index of string descriptor describing this function) */
208
209 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
210 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
211 HID_KEYBOARD_INTERFACE, /* bInterfaceNumber: number of interface */
212 0x00, /* bAlternateSetting: alternate set */
213 0x01, /* bNumEndpoints: number of endpoints */
214 USB_CLASS_CODE_HID, /* bInterfaceClass: class code hid */
215 0x01, /* bInterfaceSubClass: subclass code */
216 0x01, /* bInterfaceProtocol: protocol code */
217 0x00, /* iInterface: index of string descriptor */
218
219 0x09, /* bLength: size of HID descriptor in bytes */
220 HID_CLASS_DESC_HID, /* bDescriptorType: HID descriptor type */
221 LBYTE(HID_BCD_NUM),
222 HBYTE(HID_BCD_NUM), /* bcdHID: HID class specification release number */
223 0x00, /* bCountryCode: hardware target conutry */
224 0x01, /* bNumDescriptors: number of HID class descriptor to follow */
225 HID_CLASS_DESC_REPORT, /* bDescriptorType: report descriptor type */
226 LBYTE(sizeof(g_usbd_hid_report)),
227 HBYTE(sizeof(g_usbd_hid_report)), /* wDescriptorLength: total length of reprot descriptor */
228
229 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
230 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
231 USBD_HID_IN_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
232 USB_EPT_DESC_INTERRUPT, /* bmAttributes: endpoint attributes */
233 LBYTE(USBD_IN_MAXPACKET_SIZE),
234 HBYTE(USBD_IN_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
235 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
236};
237
241#if defined ( __ICCARM__ ) /* iar compiler */
242 #pragma data_alignment=4
243#endif
244ALIGNED_HEAD uint8_t g_hid_usb_desc[9] ALIGNED_TAIL =
245{
246 0x09, /* bLength: size of HID descriptor in bytes */
247 HID_CLASS_DESC_HID, /* bDescriptorType: HID descriptor type */
248 LBYTE(HID_BCD_NUM),
249 HBYTE(HID_BCD_NUM), /* bcdHID: HID class specification release number */
250 0x00, /* bCountryCode: hardware target conutry */
251 0x01, /* bNumDescriptors: number of HID class descriptor to follow */
252 HID_CLASS_DESC_REPORT, /* bDescriptorType: report descriptor type */
253 LBYTE(sizeof(g_usbd_hid_report)),
254 HBYTE(sizeof(g_usbd_hid_report)), /* wDescriptorLength: total length of reprot descriptor */
255};
256
260#if defined ( __ICCARM__ ) /* iar compiler */
261 #pragma data_alignment=4
262#endif
263ALIGNED_HEAD uint8_t g_usbd_hid_report[USBD_HID_SIZ_REPORT_DESC] ALIGNED_TAIL =
264{
265 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
266 0x09, 0x06, // USAGE (Keyboard)
267 0xa1, 0x01, // COLLECTION (Application)
268 0x05, 0x07, // USAGE_PAGE (Keyboard)
269 0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl)
270 0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI)
271 0x15, 0x00, // LOGICAL_MINIMUM (0)
272 0x25, 0x01, // LOGICAL_MAXIMUM (1)
273 0x75, 0x01, // REPORT_SIZE (1)
274 0x95, 0x08, // REPORT_COUNT (8)
275 0x81, 0x02, // INPUT (Data,Var,Abs)
276 0x95, 0x01, // REPORT_COUNT (1)
277 0x75, 0x08, // REPORT_SIZE (8)
278 0x81, 0x03, // INPUT (Cnst,Var,Abs)
279 0x95, 0x05, // REPORT_COUNT (5)
280 0x75, 0x01, // REPORT_SIZE (1)
281 0x05, 0x08, // USAGE_PAGE (LEDs)
282 0x19, 0x01, // USAGE_MINIMUM (Num Lock)
283 0x29, 0x05, // USAGE_MAXIMUM (Kana)
284 0x91, 0x02, // OUTPUT (Data,Var,Abs)
285 0x95, 0x01, // REPORT_COUNT (1)
286 0x75, 0x03, // REPORT_SIZE (3)
287 0x91, 0x03, // OUTPUT (Cnst,Var,Abs)
288 0x95, 0x06, // REPORT_COUNT (6)
289 0x75, 0x08, // REPORT_SIZE (8)
290 0x15, 0x00, // LOGICAL_MINIMUM (0)
291 0x25, 0xFF, // LOGICAL_MAXIMUM (255)
292 0x05, 0x07, // USAGE_PAGE (Keyboard)
293 0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))
294 0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)
295 0x81, 0x00, // INPUT (Data,Ary,Abs)
296 0xc0 // END_COLLECTION
297};
301#if defined ( __ICCARM__ ) /* iar compiler */
302 #pragma data_alignment=4
303#endif
304ALIGNED_HEAD uint8_t g_string_lang_id[USBD_SIZ_STRING_LANGID] ALIGNED_TAIL =
305{
306 USBD_SIZ_STRING_LANGID,
307 USB_DESCIPTOR_TYPE_STRING,
308 0x09,
309 0x04,
310};
311
315#if defined ( __ICCARM__ ) /* iar compiler */
316 #pragma data_alignment=4
317#endif
318ALIGNED_HEAD uint8_t g_string_serial[USBD_SIZ_STRING_SERIAL] ALIGNED_TAIL =
319{
320 USBD_SIZ_STRING_SERIAL,
321 USB_DESCIPTOR_TYPE_STRING,
322};
323
324
325/* device descriptor */
326usbd_desc_t device_descriptor =
327{
328 USB_DEVICE_DESC_LEN,
329 g_usbd_descriptor
330};
331
332/* config descriptor */
333usbd_desc_t config_descriptor =
334{
335 USBD_CONFIG_DESC_SIZE,
336 g_usbd_configuration
337};
338
339/* langid descriptor */
340usbd_desc_t langid_descriptor =
341{
342 USBD_SIZ_STRING_LANGID,
343 g_string_lang_id
344};
345
346/* serial descriptor */
347usbd_desc_t serial_descriptor =
348{
349 USBD_SIZ_STRING_SERIAL,
350 g_string_serial
351};
352
353usbd_desc_t vp_desc;
354
361uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
362{
363 uint16_t str_len = 0, id_pos = 2;
364 uint8_t *tmp_str = string;
365
366 while(*tmp_str != '\0')
367 {
368 str_len ++;
369 unicode_buf[id_pos ++] = *tmp_str ++;
370 unicode_buf[id_pos ++] = 0x00;
371 }
372
373 str_len = str_len * 2 + 2;
374 unicode_buf[0] = str_len;
375 unicode_buf[1] = USB_DESCIPTOR_TYPE_STRING;
376
377 return str_len;
378}
379
387static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len)
388{
389 uint8_t idx = 0;
390
391 for( idx = 0 ; idx < len ; idx ++)
392 {
393 if( ((value >> 28)) < 0xA )
394 {
395 pbuf[ 2 * idx] = (value >> 28) + '0';
396 }
397 else
398 {
399 pbuf[2 * idx] = (value >> 28) + 'A' - 10;
400 }
401
402 value = value << 4;
403
404 pbuf[2 * idx + 1] = 0;
405 }
406}
407
413static void get_serial_num(void)
414{
415 uint32_t serial0, serial1, serial2;
416
417 serial0 = *(uint32_t*)MCU_ID1;
418 serial1 = *(uint32_t*)MCU_ID2;
419 serial2 = *(uint32_t*)MCU_ID3;
420
421 serial0 += serial2;
422
423 if (serial0 != 0)
424 {
425 usbd_int_to_unicode (serial0, &g_string_serial[2] ,8);
426 usbd_int_to_unicode (serial1, &g_string_serial[18] ,4);
427 }
428}
429
435usbd_desc_t *get_device_descriptor(void)
436{
437 return &device_descriptor;
438}
439
445usbd_desc_t * get_device_qualifier(void)
446{
447 return NULL;
448}
449
455usbd_desc_t *get_device_configuration(void)
456{
457 return &config_descriptor;
458}
459
465usbd_desc_t *get_device_other_speed(void)
466{
467 return NULL;
468}
469
475usbd_desc_t *get_device_lang_id(void)
476{
477 return &langid_descriptor;
478}
479
480
486usbd_desc_t *get_device_manufacturer_string(void)
487{
488 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_MANUFACTURER_STRING, g_usbd_desc_buffer);
489 vp_desc.descriptor = g_usbd_desc_buffer;
490 return &vp_desc;
491}
492
498usbd_desc_t *get_device_product_string(void)
499{
500 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_PRODUCT_STRING, g_usbd_desc_buffer);
501 vp_desc.descriptor = g_usbd_desc_buffer;
502 return &vp_desc;
503}
504
510usbd_desc_t *get_device_serial_string(void)
511{
512 get_serial_num();
513 return &serial_descriptor;
514}
515
521usbd_desc_t *get_device_interface_string(void)
522{
523 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_INTERFACE_STRING, g_usbd_desc_buffer);
524 vp_desc.descriptor = g_usbd_desc_buffer;
525 return &vp_desc;
526}
527
533usbd_desc_t *get_device_config_string(void)
534{
535 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_CONFIGURATION_STRING, g_usbd_desc_buffer);
536 vp_desc.descriptor = g_usbd_desc_buffer;
537 return &vp_desc;
538}
539
cdc_keyboard_desc.h
usb cdc and keyboard descriptor header file
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
USBD_DESC_CONFIGURATION_STRING
#define USBD_DESC_CONFIGURATION_STRING
Definition: audio_desc.h:61
USBD_SIZ_STRING_SERIAL
#define USBD_SIZ_STRING_SERIAL
Definition: audio_desc.h:57
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112
USBD_DESC_PRODUCT_STRING
#define USBD_DESC_PRODUCT_STRING
Definition: audio_desc.h:60
HID_BINTERVAL_TIME
#define HID_BINTERVAL_TIME
Definition: audio_desc.h:205
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: audio_desc.h:208
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
USBD_SIZ_STRING_LANGID
#define USBD_SIZ_STRING_LANGID
Definition: audio_desc.h:56
MCU_ID1
#define MCU_ID1
Definition: audio_desc.h:215
USBD_DESC_MANUFACTURER_STRING
#define USBD_DESC_MANUFACTURER_STRING
Definition: audio_desc.h:59
USBD_PRODUCT_ID
#define USBD_PRODUCT_ID
Definition: audio_desc.h:54
BCD_NUM
#define BCD_NUM
Definition: audio_desc.h:51
USBD_DESC_INTERFACE_STRING
#define USBD_DESC_INTERFACE_STRING
Definition: audio_desc.h:62
MCU_ID2
#define MCU_ID2
Definition: audio_desc.h:216
USBD_VENDOR_ID
#define USBD_VENDOR_ID
Definition: audio_desc.h:53
MCU_ID3
#define MCU_ID3
Definition: audio_desc.h:217
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
USBD_HID_IN_EPT
#define USBD_HID_IN_EPT
usb custom hid use endpoint define
Definition: audio_hid_class.h:61
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
HID_CLASS_DESC_HID
#define HID_CLASS_DESC_HID
usb hid class descriptor define
Definition: audio_hid_desc.h:216
HID_CLASS_DESC_REPORT
#define HID_CLASS_DESC_REPORT
Definition: audio_hid_desc.h:217
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: audio_hid_desc.h:236
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
usb hid descriptor
Definition: audio_hid_desc.c:527
HID_BCD_NUM
#define HID_BCD_NUM
usb bcd number define
Definition: audio_hid_desc.h:211
USBD_CMD_MAXPACKET_SIZE
#define USBD_CMD_MAXPACKET_SIZE
Definition: cdc_class.h:62
USBD_CDC_BULK_OUT_EPT
#define USBD_CDC_BULK_OUT_EPT
Definition: cdc_class.h:55
USBD_CDC_INT_EPT
#define USBD_CDC_INT_EPT
usb cdc use endpoint define
Definition: cdc_class.h:53
USBD_CDC_BULK_IN_EPT
#define USBD_CDC_BULK_IN_EPT
Definition: cdc_class.h:54
USBD_CDC_SUBTYPE_CMF
#define USBD_CDC_SUBTYPE_CMF
Definition: cdc_desc.h:91
USBD_CDC_SUBTYPE_HEADER
#define USBD_CDC_SUBTYPE_HEADER
usb hid class sub-type define
Definition: cdc_desc.h:90
USBD_CDC_CS_INTERFACE
#define USBD_CDC_CS_INTERFACE
usb hid class descriptor define
Definition: cdc_desc.h:84
USBD_CDC_SUBTYPE_UFD
#define USBD_CDC_SUBTYPE_UFD
Definition: cdc_desc.h:93
USBD_CDC_SUBTYPE_ACM
#define USBD_CDC_SUBTYPE_ACM
Definition: cdc_desc.h:92
HID_KEYBOARD_INTERFACE
#define HID_KEYBOARD_INTERFACE
Definition: cdc_keyboard_desc.h:113
CDC_DATA_INTERFACE
#define CDC_DATA_INTERFACE
Definition: cdc_keyboard_desc.h:112
CDC_INTERFACE
#define CDC_INTERFACE
usb interface define
Definition: cdc_keyboard_desc.h:111
serial_descriptor
usbd_desc_t serial_descriptor
Definition: cdc_keyboard_desc.c:347
device_descriptor
usbd_desc_t device_descriptor
Definition: cdc_keyboard_desc.c:326
usbd_unicode_convert
uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert
Definition: cdc_keyboard_desc.c:361
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: cdc_keyboard_desc.c:486
langid_descriptor
usbd_desc_t langid_descriptor
Definition: cdc_keyboard_desc.c:340
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: cdc_keyboard_desc.c:445
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: cdc_keyboard_desc.c:521
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: cdc_keyboard_desc.c:465
g_usbd_desc_buffer
static uint8_t g_usbd_desc_buffer[256]
Definition: cdc_keyboard_desc.c:57
vp_desc
usbd_desc_t vp_desc
Definition: cdc_keyboard_desc.c:353
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: cdc_keyboard_desc.c:455
ALIGNED_TAIL
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL
usb device standard descriptor
Definition: cdc_keyboard_desc.c:82
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: cdc_keyboard_desc.c:498
cdc_keyboard_desc_handler
usbd_desc_handler cdc_keyboard_desc_handler
device descriptor handler structure
Definition: cdc_keyboard_desc.c:62
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: cdc_keyboard_desc.c:475
get_serial_num
static void get_serial_num(void)
usb get serial number
Definition: cdc_keyboard_desc.c:413
config_descriptor
usbd_desc_t config_descriptor
Definition: cdc_keyboard_desc.c:333
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: cdc_keyboard_desc.c:435
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: cdc_keyboard_desc.c:510
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: cdc_keyboard_desc.c:533
usbd_int_to_unicode
static void usbd_int_to_unicode(uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode
Definition: cdc_keyboard_desc.c:387
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_DEVICE_EPT_LEN
#define USB_DEVICE_EPT_LEN
Definition: usb_std.h:153
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
USB_DESCIPTOR_TYPE_CONFIGURATION
#define USB_DESCIPTOR_TYPE_CONFIGURATION
Definition: usb_std.h:93
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DESCIPTOR_TYPE_ENDPOINT
#define USB_DESCIPTOR_TYPE_ENDPOINT
Definition: usb_std.h:96
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_EPT_DESC_BULK
#define USB_EPT_DESC_BULK
Definition: usb_std.h:177
USB_DEVICE_IF_DESC_LEN
#define USB_DEVICE_IF_DESC_LEN
Definition: usb_std.h:152
USB_DEVICE_CFG_DESC_LEN
#define USB_DEVICE_CFG_DESC_LEN
Definition: usb_std.h:151
USB_EPT_DESC_INTERRUPT
#define USB_EPT_DESC_INTERRUPT
Definition: usb_std.h:178
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92
USB_CLASS_CODE_CDCDATA
#define USB_CLASS_CODE_CDCDATA
Definition: usb_std.h:167
USB_DESCIPTOR_TYPE_STRING
#define USB_DESCIPTOR_TYPE_STRING
Definition: usb_std.h:94
USB_DESCIPTOR_TYPE_INTERFACE
#define USB_DESCIPTOR_TYPE_INTERFACE
Definition: usb_std.h:95
USB_CLASS_CODE_CDC
#define USB_CLASS_CODE_CDC
Definition: usb_std.h:162
USB_CLASS_CODE_HID
#define USB_CLASS_CODE_HID
Definition: usb_std.h:163
usb_std.h
usb standard header file
usbd_core.h
usb device core header file
usbd_sdr.h


AT32F415 Firmwary Library: cdc_keyboard_desc.h Source File

  • middlewares
  • usbd_class
  • composite_cdc_keyboard
cdc_keyboard_desc.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __CDC_KEYBOARD_DESC_H
29#define __CDC_KEYBOARD_DESC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "cdc_keyboard_class.h"
36#include "usbd_core.h"
37
53#define BCD_NUM 0x0110
54
58#define USBD_VENDOR_ID 0x2E3C
59#define USBD_PRODUCT_ID 0x5750
60
64#define HID_BCD_NUM 0x0110
65
69#define HID_CLASS_DESC_HID 0x21
70#define HID_CLASS_DESC_REPORT 0x22
71#define HID_CLASS_DESC_PHYSICAL 0x23
72
76#define USBD_CONFIG_DESC_SIZE 108
77#define USBD_HID_SIZ_REPORT_DESC 63
78#define USBD_SIZ_STRING_LANGID 4
79#define USBD_SIZ_STRING_SERIAL 0x1A
80
84#define USBD_DESC_MANUFACTURER_STRING "Artery"
85#define USBD_DESC_PRODUCT_STRING "AT32 Composite VCP and Keyboard"
86#define USBD_DESC_CONFIGURATION_STRING "Composite VCP and Keyboard Config"
87#define USBD_DESC_INTERFACE_STRING "Composite VCP and Keyboard Interface"
88
92#define HID_BINTERVAL_TIME 0x0A
93
97#define USBD_CDC_CS_INTERFACE 0x24
98#define USBD_CDC_CS_ENDPOINT 0x25
99
103#define USBD_CDC_SUBTYPE_HEADER 0x00
104#define USBD_CDC_SUBTYPE_CMF 0x01
105#define USBD_CDC_SUBTYPE_ACM 0x02
106#define USBD_CDC_SUBTYPE_UFD 0x06
107
111#define CDC_INTERFACE 0x00
112#define CDC_DATA_INTERFACE 0x01
113#define HID_KEYBOARD_INTERFACE 0x02
114
118#define MCU_ID1 (0x1FFFF7E8)
119#define MCU_ID2 (0x1FFFF7EC)
120#define MCU_ID3 (0x1FFFF7F0)
121
126extern uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN];
127extern uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE];
128extern uint8_t g_usbd_hid_report[USBD_HID_SIZ_REPORT_DESC];
129extern uint8_t g_hid_usb_desc[9];
130extern usbd_desc_handler cdc_keyboard_desc_handler;
131
132
140#ifdef __cplusplus
141}
142#endif
143
144#endif
cdc_keyboard_class.h
usb cdc and keyboard class file
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
usb descriptor size define
Definition: cdc_keyboard_desc.h:76
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: cdc_keyboard_desc.h:77
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
g_usbd_hid_report
uint8_t g_usbd_hid_report[63]
cdc_keyboard_desc_handler
usbd_desc_handler cdc_keyboard_desc_handler
device descriptor handler structure
Definition: cdc_keyboard_desc.c:62
g_usbd_configuration
uint8_t g_usbd_configuration[108]
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: audio_codec.h Source File

  • usb_device
  • composite_audio_hid
  • inc
composite_audio_hid/inc/audio_codec.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AUDIO_CODEC_H
29#define __AUDIO_CODEC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
44/* includes ------------------------------------------------------------------*/
45#include "usb_conf.h"
46
50#define WM8988_R0_LEFT_INPUT_VOLUME 0x00 /*Left channel PGA control*/
51#define WM8988_R1_RIGHT_INPUT_VOLUME 0x01 /*Right channel PGA control*/
52#define WM8988_R2_LOUT1_VOLUME 0x02
53#define WM8988_R3_ROUT1_VOLUME 0x03
54#define WM8988_R4_RESERVED 0x04
55#define WM8988_R5_ADC_DAC_CONTROL 0x05
56#define WM8988_R6_RESERVED 0x06
57#define WM8988_R7_AUDIO_INTERFACE 0x07
58#define WM8988_R8_SAMPLE_RATE 0x08
59#define WM8988_R9_RESERVED 0x09
60#define WM8988_R10_LEFT_DAC_VOLUME 0x0A
61#define WM8988_R11_RIGHT_DAC_VOLUME 0x0B
62#define WM8988_R12_BASS_CONTROL 0x0C
63#define WM8988_R13_TREBLE_CONTROL 0x0D
64#define WM8988_R14_
65#define WM8988_R15_RESET 0x0F
66#define WM8988_R16_3D_CONTROL 0x10
67#define WM8988_R17_ALC1 0x11
68#define WM8988_R18_ALC2 0x12
69#define WM8988_R19_ALC3 0x13
70#define WM8988_R20_NOISE_GATE 0x14
71#define WM8988_R21_LEFT_ADC_VOLUME 0x15
72#define WM8988_R22_RIGHT_ADC_VOLUME 0x16
73#define WM8988_R23_ADDITIONAL_1_CONTROL 0x17
74#define WM8988_R24_ADDITIONAL_2_CONTROL 0x18
75#define WM8988_R25_PWR_1_MGMT 0x19
76#define WM8988_R26_PWR_2_MGMT 0x1A
77#define WM8988_R27_ADDITIONAL_3_CONTROL 0x1B
78
79#define WM8988_R31_ADC_INPUT_MODE 0x1F
80#define WM8988_R32_ADC_L_SIGNAL_PATH 0x20
81#define WM8988_R33_ADC_R_SIGNAL_PATH 0x21
82#define WM8988_R34_LEFT_OUT_MIX_1 0x22
83#define WM8988_R35_LEFT_OUT_MIX_2 0x23
84#define WM8988_R36_RIGHT_OUT_MIX_1 0x24
85#define WM8988_R37_RIGHT_OUT_MIX_2 0x25
86#define WM8988_R38_RESERVED
87#define WM8988_R39_RESERVED
88#define WM8988_R40_LOUT2_VOLUME 0x28
89#define WM8988_R41_ROUT2_VOLUME 0x29
90#define WM8988_R42_RESERVED
91#define WM8988_R43_LOW_POWER_PALYBACK 0x43
92
93#define WM8988_I2C_ADDR_CSB_LOW 0x34
94#define WM8988_I2C_ADDR_CSB_HIGH 0x36
95
103#define I2S1_WS_PIN GPIO_PINS_4
104#define I2S1_CK_PIN GPIO_PINS_5
105#define I2S1_SD_PIN GPIO_PINS_7
106
107#define I2S1_GPIO GPIOA
108#define I2S1_GPIO_CRM_CLK CRM_GPIOA_PERIPH_CLOCK
109#define I2S1_DT_ADDRESS (&(SPI1->dt))
110
111/*I2S2 Pin*/
112#define I2S2_WS_PIN GPIO_PINS_12
113#define I2S2_CK_PIN GPIO_PINS_13
114#define I2S2_SD_PIN GPIO_PINS_15
115
116
117#define I2S2_GPIO GPIOB
118#define I2S2_GPIO_CRM_CLK CRM_GPIOB_PERIPH_CLOCK
119#define I2S2_DT_ADDRESS (&(SPI2->dt))
120
121#define SPK_TX_FIFO_SIZE (1024 * 4)
122
130#define MIC_BUFFER_SIZE 1024
131#define SPK_BUFFER_SIZE 4096
132#define DMA_BUFFER_SIZE 288
133
134typedef struct
135{
136 uint32_t audio_freq;
137 uint32_t audio_bitw;
138 //spk part
139 uint16_t spk_buffer[SPK_BUFFER_SIZE];
140 uint16_t *spk_roff;
141 uint16_t *spk_woff;
142 uint16_t *spk_rend;
143 uint32_t spk_freq;
144 uint32_t spk_wtotal;
145 uint32_t spk_rtotal;
146 uint16_t spk_threshold;
147 uint16_t spk_calc;
148 uint8_t spk_stage;
149
150 //mic part
151 uint16_t mic_buffer[MIC_BUFFER_SIZE];
152 uint16_t *mic_roff;
153 uint16_t *mic_woff;
154 uint16_t *mic_wend;
155 uint32_t mic_wtotal;
156 uint32_t mic_rtotal;
157 uint32_t mic_delta;
158 uint16_t mic_calc;
159 uint16_t mic_adj_count;
160 uint8_t mic_adj_stage;
161 uint8_t mic_stage;
162
163 uint8_t mic_mute;
164 uint8_t spk_mute;
165
166 uint16_t mic_volume;
167 uint16_t spk_volume;
168
169 uint32_t spk_tx_size;
170 uint32_t mic_rx_size;
171
172 uint32_t spk_enable;
173 uint32_t mic_enable;
174
175}audio_codec_type;
176
177 error_status audio_codec_init(void);
178 error_status audio_codec_loop(void);
179void audio_codec_modify_freq(uint32_t freq);
180
184void audio_codec_spk_fifo_write(uint8_t *data, uint32_t len);
185uint32_t audio_codec_mic_get_data(uint8_t *buffer);
186uint8_t audio_codec_spk_feedback(uint8_t *feedback);
187void audio_codec_spk_alt_setting(uint32_t alt_seting);
188void audio_codec_mic_alt_setting(uint32_t alt_seting);
189void audio_codec_set_mic_mute(uint8_t mute);
190void audio_codec_set_spk_mute(uint8_t mute);
191void audio_codec_set_mic_volume(uint16_t volume);
192void audio_codec_set_spk_volume(uint16_t volume);
193void audio_codec_set_mic_freq(uint32_t freq);
194void audio_codec_set_spk_freq(uint32_t freq);
195
207#ifdef __cplusplus
208}
209#endif
210
211#endif
212
error_status
error_status
error status
Definition: at32f415.h:258
audio_codec_mic_alt_setting
void audio_codec_mic_alt_setting(uint32_t alt_seting)
audio codec microphone alt setting config
Definition: audio/src/audio_codec.c:169
audio_codec_set_spk_volume
void audio_codec_set_spk_volume(uint16_t volume)
audio codec set speaker volume
Definition: audio/src/audio_codec.c:217
audio_codec_set_spk_mute
void audio_codec_set_spk_mute(uint8_t mute)
audio codec set speaker mute
Definition: audio/src/audio_codec.c:195
MIC_BUFFER_SIZE
#define MIC_BUFFER_SIZE
Definition: composite_audio_hid/inc/audio_codec.h:130
audio_codec_set_mic_freq
void audio_codec_set_mic_freq(uint32_t freq)
audio codec set microphone freq
Definition: audio/src/audio_codec.c:121
audio_codec_mic_get_data
uint32_t audio_codec_mic_get_data(uint8_t *buffer)
codec microphone get data
Definition: audio/src/audio_codec.c:282
audio_codec_loop
error_status audio_codec_loop(void)
audio codec loop
Definition: audio/src/audio_codec.c:855
SPK_BUFFER_SIZE
#define SPK_BUFFER_SIZE
Definition: composite_audio_hid/inc/audio_codec.h:131
audio_codec_set_mic_mute
void audio_codec_set_mic_mute(uint8_t mute)
audio codec set microphone mute
Definition: audio/src/audio_codec.c:184
audio_codec_spk_fifo_write
void audio_codec_spk_fifo_write(uint8_t *data, uint32_t len)
audio codec interface
Definition: audio/src/audio_codec.c:244
audio_codec_spk_feedback
uint8_t audio_codec_spk_feedback(uint8_t *feedback)
codec speaker feedback
Definition: audio/src/audio_codec.c:228
audio_codec_modify_freq
void audio_codec_modify_freq(uint32_t freq)
audio codec modify freq
Definition: audio/src/audio_codec.c:342
audio_codec_set_mic_volume
void audio_codec_set_mic_volume(uint16_t volume)
audio codec set microphone volume
Definition: audio/src/audio_codec.c:206
audio_codec_spk_alt_setting
void audio_codec_spk_alt_setting(uint32_t alt_seting)
audio codec speaker alt setting config
Definition: audio/src/audio_codec.c:154
audio_codec_init
error_status audio_codec_init(void)
audio codec init
Definition: audio/src/audio_codec.c:796
audio_codec_set_spk_freq
void audio_codec_set_spk_freq(uint32_t freq)
audio codec set speaker freq
Definition: audio/src/audio_codec.c:137
audio_codec_type
Definition: audio/inc/audio_codec.h:135
usb_conf.h
usb config header file


AT32F415 Firmwary Library: audio_codec.c Source File

  • usb_device
  • composite_audio_hid
  • src
composite_audio_hid/src/audio_codec.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "audio_codec.h"
29#include "i2c_application.h"
30#include "audio_conf.h"
31#include <string.h>
32
41#define I2C_TIMEOUT 0xFFFFFFFF
42
43#define I2Cx_SPEED 100000
44#define I2Cx_ADDRESS 0x00
45
46#define I2Cx_PORT I2C1
47#define I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
48
49#define I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
50#define I2Cx_SCL_GPIO_PIN GPIO_PINS_8
51#define I2Cx_SCL_GPIO_PORT GPIOB
52
53#define I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
54#define I2Cx_SDA_GPIO_PIN GPIO_PINS_9
55#define I2Cx_SDA_GPIO_PORT GPIOB
56
60#define WM8988_REG_FREQ48K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0081)
61#define WM8988_REG_FREQ16K ((WM8988_R8_SAMPLE_RATE << 9) | 0x0095)
62
66#define WM8988_REG_BITW16 ((WM8988_R7_AUDIO_INTERFACE << 9) | 0x0042)
67
71uint16_t reg_addr_data[] =
72{
73 (WM8988_R0_LEFT_INPUT_VOLUME << 9) | 0x012F, /*Left Input Channel Volume*/
74 (WM8988_R1_RIGHT_INPUT_VOLUME << 9) | 0x012F, /*Right Input Channel Volume*/
75 (WM8988_R2_LOUT1_VOLUME << 9) | 0x0179, /*Left Output Channel Volume*/
76 (WM8988_R3_ROUT1_VOLUME << 9) | 0x0179, /*Right Output Channel Volume*/
77 (WM8988_R5_ADC_DAC_CONTROL << 9) | 0x0006, /*De-emphasis Control and Digital soft mute*/
78 (WM8988_REG_BITW16),
79 (WM8988_REG_FREQ16K),
80 (WM8988_R10_LEFT_DAC_VOLUME << 9) | 0x01FF, /*Left Digital DAC Volume Control*/
81 (WM8988_R11_RIGHT_DAC_VOLUME << 9) | 0x01FF, /*Right Digital DAC Volume Control*/
82 (WM8988_R12_BASS_CONTROL << 9) | 0x000F, /*Bass Control*/
83 (WM8988_R13_TREBLE_CONTROL << 9) | 0x000F, /*Treble Control*/
84 (WM8988_R16_3D_CONTROL << 9) | 0x0000, /*3D stereo Enhancment*/
85 (WM8988_R21_LEFT_ADC_VOLUME << 9) | 0x01C3, /*Left ADC Digital Volume*/
86 (WM8988_R22_RIGHT_ADC_VOLUME << 9) | 0x01C3, /*Right ADC Digital Volume*/
87 (WM8988_R23_ADDITIONAL_1_CONTROL << 9) | 0x00C2, /*Additional Control 1*/
88 (WM8988_R24_ADDITIONAL_2_CONTROL << 9) | 0x0000, /*Additional Control 2*/
89 (WM8988_R27_ADDITIONAL_3_CONTROL << 9) | 0x0000, /*Additional Control 3*/
90 (WM8988_R31_ADC_INPUT_MODE << 9) | 0x0000, /*ADC input mode*/
91 (WM8988_R32_ADC_L_SIGNAL_PATH << 9) | 0x0000, /*ADC Signal Path Control left*/
92 (WM8988_R33_ADC_R_SIGNAL_PATH << 9) | 0x0000, /*ADC Signal Path Control right*/
93 (WM8988_R34_LEFT_OUT_MIX_1 << 9) | 0x0152, /*Left DAC mixer Control*/
94 (WM8988_R35_LEFT_OUT_MIX_2 << 9) | 0x0050, /*Left DAC mixer Control*/
95 (WM8988_R36_RIGHT_OUT_MIX_1 << 9) | 0x0052, /*Right DAC mixer Control*/
96 (WM8988_R37_RIGHT_OUT_MIX_2 << 9) | 0x0150, /*Right DAC mixer Control*/
97 (WM8988_R40_LOUT2_VOLUME << 9) | 0x01FF, /*Output left channel volume*/
98 (WM8988_R41_ROUT2_VOLUME << 9) | 0x01FF, /*Output left channel volume*/
99 (WM8988_R43_LOW_POWER_PALYBACK << 9) | 0x0008, /*Output left channel volume*/
100 (WM8988_R25_PWR_1_MGMT << 9) | 0x017C, /*Power Management1*/
101 (WM8988_R26_PWR_2_MGMT << 9) | 0x01F8, /*Power Management2*/
102};
103
104 i2c_handle_type hi2cx;
105
106 audio_codec_type audio_codec;
107uint16_t spk_dma_buffer[DMA_BUFFER_SIZE];
108uint16_t mic_dma_buffer[DMA_BUFFER_SIZE];
109
110void memset16_buffer(uint16_t *buffer, uint32_t set, uint32_t len);
111void codec_i2s_reset(void);
112void codec_i2s_init(audio_codec_type *param);
113void mclk_tmr1_init(void);
114void copy_buff(uint16_t *dest, uint16_t *src, uint32_t len);
115
121void audio_codec_set_mic_freq(uint32_t freq)
122{
123 if(audio_codec.audio_freq != freq)
124 {
125 audio_codec.audio_freq = freq;
126 codec_i2s_reset();
127 audio_codec_modify_freq(freq);
128 codec_i2s_init(&audio_codec);
129 }
130}
131
137void audio_codec_set_spk_freq(uint32_t freq)
138{
139 if(audio_codec.audio_freq != freq)
140 {
141 audio_codec.audio_freq = freq;
142 codec_i2s_reset();
143 audio_codec_modify_freq(freq);
144 codec_i2s_init(&audio_codec);
145 }
146}
147
148
154void audio_codec_spk_alt_setting(uint32_t alt_seting)
155{
156 if(alt_seting == 0)
157 {
158 }
159 else
160 {
161 }
162}
163
169void audio_codec_mic_alt_setting(uint32_t alt_seting)
170{
171 if(alt_seting == 0)
172 {
173 }
174 else
175 {
176 }
177}
178
184void audio_codec_set_mic_mute(uint8_t mute)
185{
186 audio_codec.mic_mute = mute;
187}
188
189
195void audio_codec_set_spk_mute(uint8_t mute)
196{
197 audio_codec.spk_mute = mute;
198}
199
200
206void audio_codec_set_mic_volume(uint16_t volume)
207{
208 /* wm8988 adc have 256 steps */
209 audio_codec.mic_volume = volume;
210}
211
217void audio_codec_set_spk_volume(uint16_t volume)
218{
219 /* wm8988 dac have 80 steps */
220 audio_codec.spk_volume = (volume * 0x50) / 0x64 + 0x30 - 1;
221}
222
228uint8_t audio_codec_spk_feedback(uint8_t *feedback)
229{
230 uint32_t feedback_value = (audio_codec.spk_freq);
231 feedback_value = ((feedback_value/1000)<<14)|((feedback_value%1000)<<4);
232 feedback[0] = (uint8_t)(feedback_value);
233 feedback[1] = (uint8_t)(feedback_value >> 8);
234 feedback[2] = (uint8_t)(feedback_value >> 16);
235 return 3;
236}
237
244void audio_codec_spk_fifo_write(uint8_t *data, uint32_t len)
245{
246 uint16_t ulen = len / 2, i;
247 uint16_t *u16data = (uint16_t *)data;
248
249 switch(audio_codec.spk_stage)
250 {
251 case 0:
252 audio_codec.spk_woff = audio_codec.spk_roff = audio_codec.spk_buffer;
253 audio_codec.spk_wtotal = audio_codec.spk_rtotal = 0;
254 audio_codec.spk_stage = 1;
255 audio_codec.spk_threshold = SPK_BUFFER_SIZE/2;
256 break;
257 case 1:
258 if( audio_codec.spk_wtotal >= SPK_BUFFER_SIZE/2 )
259 {
260 audio_codec.spk_stage = 2;
261 }
262 break;
263 case 2:
264 break;
265 }
266 for( i = 0; i < ulen; ++i )
267 {
268 *audio_codec.spk_woff++ = *u16data++;
269 if( audio_codec.spk_woff >= audio_codec.spk_rend )
270 {
271 audio_codec.spk_woff = audio_codec.spk_buffer;
272 }
273 }
274 audio_codec.spk_wtotal += ulen;
275}
276
282uint32_t audio_codec_mic_get_data(uint8_t *buffer)
283{
284 //copy_buff((uint16_t *)buffer, audio_codec.mic_buffer + audio_codec.mic_hf_status, audio_codec.mic_rx_size);
285 uint16_t len = audio_codec.mic_rx_size << 1;
286 uint16_t i;
287 uint16_t* u16buf = (uint16_t*)buffer;
288 switch(audio_codec.mic_stage)
289 {
290 case 0:
291 audio_codec.mic_stage = 1;
292 memset( buffer, 0, len );
293 return len;
294 case 1:
295 if( audio_codec.mic_wtotal - audio_codec.mic_rtotal >= MIC_BUFFER_SIZE/2 )
296 {
297 audio_codec.mic_stage = 2;
298 }
299 return len;
300 }
301 switch( audio_codec.mic_adj_stage )
302 {
303 case 0:
304 break;
305 case 1:
306 if( audio_codec.mic_adj_count >= 4 ){
307 len += 4;
308 audio_codec.mic_adj_count -= 4;
309 }
310 break;
311 case 2:
312 if( audio_codec.mic_adj_count >= 4 ){
313 len -= 4;
314 audio_codec.mic_adj_count -= 4;
315 }
316 break;
317 }
318
319 for( i = 0; i < len/2; ++i )
320 {
321 *u16buf++ = *audio_codec.mic_roff++;
322 if( audio_codec.mic_roff >= audio_codec.mic_wend )
323 {
324 audio_codec.mic_roff = audio_codec.mic_buffer;
325 }
326 }
327 if( audio_codec.mic_wtotal <= audio_codec.mic_rtotal )
328 { //should not happen
329 while(1);
330 }
331
332 audio_codec.mic_rtotal += len/2;
333 audio_codec.mic_delta += len/2;
334 return len;
335}
336
342void audio_codec_modify_freq(uint32_t freq)
343{
344 uint16_t codec_cmd;
345 uint8_t i2c_cmd[2];
346 if(freq == AUDIO_FREQ_16K)
347 {
348 codec_cmd = WM8988_REG_FREQ16K;
349 }
350 else if(freq == AUDIO_FREQ_48K)
351 {
352 codec_cmd = WM8988_REG_FREQ48K;
353 }
354 i2c_cmd[0] = (uint8_t)(codec_cmd >> 8);
355 i2c_cmd[1] = (uint8_t)codec_cmd & 0xFF;
356 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
357 {
358 while(1);
359 }
360}
361
369void memset16_buffer(uint16_t *buffer, uint32_t set, uint32_t len)
370{
371 uint32_t i_index = 0;
372 for(i_index = 0; i_index < len; i_index ++)
373 {
374 buffer[i_index] = (uint16_t)set;
375 }
376}
377
385void copy_buff(uint16_t *dest, uint16_t *src, uint32_t len)
386{
387 uint16_t i_index;
388 for(i_index = 0; i_index < len; i_index ++)
389 {
390 dest[i_index] = src[i_index];
391 }
392}
393
399void i2c_lowlevel_init(i2c_handle_type* hi2c)
400{
401 gpio_init_type gpio_init_structure;
402
403 if(hi2c->i2cx == I2Cx_PORT)
404 {
405 /* i2c periph clock enable */
406 crm_periph_clock_enable(I2Cx_CLK, TRUE);
407 crm_periph_clock_enable(I2Cx_SCL_GPIO_CLK, TRUE);
408 crm_periph_clock_enable(I2Cx_SDA_GPIO_CLK, TRUE);
409 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
410 gpio_pin_remap_config(I2C1_MUX, TRUE);
411
412 /* configure i2c pins: scl */
413 gpio_init_structure.gpio_out_type = GPIO_OUTPUT_OPEN_DRAIN;
414 gpio_init_structure.gpio_pull = GPIO_PULL_UP;
415 gpio_init_structure.gpio_mode = GPIO_MODE_MUX;
416 gpio_init_structure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
417
418 gpio_init_structure.gpio_pins = I2Cx_SCL_GPIO_PIN;
419 gpio_init(I2Cx_SCL_GPIO_PORT, &gpio_init_structure);
420
421 /* configure i2c pins: sda */
422 gpio_init_structure.gpio_pins = I2Cx_SDA_GPIO_PIN;
423 gpio_init(I2Cx_SDA_GPIO_PORT, &gpio_init_structure);
424
425 /* config i2c */
426 i2c_init(hi2c->i2cx, I2C_FSMODE_DUTY_2_1, I2Cx_SPEED);
427
428 i2c_own_address1_set(hi2c->i2cx, I2C_ADDRESS_MODE_7BIT, I2Cx_ADDRESS);
429 }
430}
431
437void mclk_tmr1_init(void)
438{
439 gpio_init_type gpio_init_struct;
440 tmr_output_config_type tmr_oc_init_structure;
441 uint16_t prescaler_value = (uint16_t)(system_core_clock / 24000000) - 1;
442
443 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
444 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
445 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
446
447 gpio_default_para_init(&gpio_init_struct);
448
449
450 gpio_init_struct.gpio_pins = GPIO_PINS_8;
451 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
452 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
453 gpio_init(GPIOA, &gpio_init_struct);
454
455 tmr_base_init(TMR1, 1, prescaler_value);
456 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
457 tmr_clock_source_div_set(TMR1, TMR_CLOCK_DIV1);
458
459 tmr_output_default_para_init(&tmr_oc_init_structure);
460 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_A;
461 tmr_oc_init_structure.oc_idle_state = FALSE;
462 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
463 tmr_oc_init_structure.oc_output_state = TRUE;
464 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
465 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_1, 1);
466 tmr_output_channel_buffer_enable(TMR1, TMR_SELECT_CHANNEL_1, TRUE);
467
468 /* tmr enable counter */
469 tmr_counter_enable(TMR1, TRUE);
470 tmr_output_enable(TMR1, TRUE);
471}
472
473
479void codec_i2s_reset(void)
480{
481 i2s_enable(SPI1, FALSE);
482 i2s_enable(SPI2, FALSE);
483 dma_channel_enable(DMA1_CHANNEL3, FALSE);
484 dma_channel_enable(DMA1_CHANNEL4, FALSE);
485}
486
493void codec_i2s_init(audio_codec_type *param)
494{
495 gpio_init_type gpio_init_struct;
496 dma_init_type dma_init_struct;
497 i2s_init_type i2s_init_struct;
498 i2s_data_channel_format_type format = I2S_DATA_16BIT_CHANNEL_16BIT;
499
500 crm_periph_clock_enable(I2S1_GPIO_CRM_CLK, TRUE);
501 crm_periph_clock_enable(I2S2_GPIO_CRM_CLK, TRUE);
502 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
503 crm_periph_clock_enable(CRM_SPI1_PERIPH_CLOCK, TRUE);
504 crm_periph_clock_enable(CRM_SPI2_PERIPH_CLOCK, TRUE);
505
506 param->spk_freq = param->audio_freq;
507
508 param->spk_tx_size = (param->audio_freq / 1000) * (param->audio_bitw / 8) * AUDIO_SPK_CHANEL_NUM / 2;
509 param->mic_rx_size = (param->audio_freq / 1000) * (param->audio_bitw / 8) * AUDIO_MIC_CHANEL_NUM / 2;
510
511 memset(param->spk_buffer, 0, SPK_BUFFER_SIZE*sizeof(uint16_t));
512 memset(param->mic_buffer, 0, MIC_BUFFER_SIZE*sizeof(uint16_t));
513
514 param->mic_wend = param->mic_woff = param->mic_roff = param->mic_buffer;
515 param->spk_rend = param->spk_woff = param->spk_roff = param->spk_buffer;
516
517 while(param->mic_wend < param->mic_buffer+MIC_BUFFER_SIZE)
518 {
519 param->mic_wend += param->mic_rx_size;
520 }
521 param->mic_wend -= param->mic_rx_size;
522 while(param->spk_rend < param->spk_buffer+SPK_BUFFER_SIZE)
523 {
524 param->spk_rend += param->spk_tx_size;
525 }
526 param->spk_rend -= param->spk_tx_size;
527 if(param->audio_bitw == 16)
528 {
529 format = I2S_DATA_16BIT_CHANNEL_16BIT;
530 }
531 else
532 {
533 format = I2S_DATA_24BIT_CHANNEL_32BIT;
534 }
535
536 gpio_default_para_init(&gpio_init_struct);
537
538 /* i2s1 ws pins */
539 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
540 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
541 gpio_init_struct.gpio_pins = I2S1_WS_PIN;
542 gpio_init(I2S1_GPIO, &gpio_init_struct);
543
544 /* i2s1 ck pins */
545 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
546 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
547 gpio_init_struct.gpio_pins = I2S1_CK_PIN;
548 gpio_init(I2S1_GPIO, &gpio_init_struct);
549
550 /* i2s1 sd pins slave tx */
551 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
552 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
553 gpio_init_struct.gpio_pins = I2S1_SD_PIN;
554 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
555 gpio_init(I2S1_GPIO, &gpio_init_struct);
556
557 /* i2s2 ws pins */
558 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
559 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
560 gpio_init_struct.gpio_pins = I2S2_WS_PIN;
561 gpio_init(I2S2_GPIO, &gpio_init_struct);
562
563 /* i2s2 ck pins */
564 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
565 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
566 gpio_init_struct.gpio_pins = I2S2_CK_PIN;
567 gpio_init(I2S2_GPIO, &gpio_init_struct);
568
569 /* i2s2 sd pins slave rx */
570 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
571 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
572 gpio_init_struct.gpio_pins = I2S2_SD_PIN;
573 gpio_init(I2S2_GPIO, &gpio_init_struct);
574
575 /* dma config */
576 dma_reset(DMA1_CHANNEL3);
577 dma_reset(DMA1_CHANNEL4);
578
579 /* dma1 channel3: speaker i2s1 tx */
580 dma_default_para_init(&dma_init_struct);
581 dma_init_struct.buffer_size = param->spk_tx_size << 1;
582 dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
583 dma_init_struct.memory_base_addr = (uint32_t)spk_dma_buffer;
584 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
585 dma_init_struct.memory_inc_enable = TRUE;
586 dma_init_struct.peripheral_base_addr = (uint32_t)I2S1_DT_ADDRESS;
587 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
588 dma_init_struct.peripheral_inc_enable = FALSE;
589 dma_init_struct.priority = DMA_PRIORITY_HIGH;
590 dma_init_struct.loop_mode_enable = TRUE;
591 dma_init(DMA1_CHANNEL3, &dma_init_struct);
592 dma_interrupt_enable(DMA1_CHANNEL3, DMA_FDT_INT, TRUE);
593 dma_interrupt_enable(DMA1_CHANNEL3, DMA_HDT_INT, TRUE);
594 nvic_irq_enable(DMA1_Channel3_IRQn, 1, 0);
595
596 /* dma1 channel4: microphone i2s2 rx */
597 dma_default_para_init(&dma_init_struct);
598 dma_init_struct.buffer_size = param->mic_rx_size << 1;
599 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
600 dma_init_struct.memory_base_addr = (uint32_t)mic_dma_buffer;
601 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
602 dma_init_struct.memory_inc_enable = TRUE;
603 dma_init_struct.peripheral_base_addr = (uint32_t)I2S2_DT_ADDRESS;
604 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
605 dma_init_struct.peripheral_inc_enable = FALSE;
606 dma_init_struct.priority = DMA_PRIORITY_HIGH;
607 dma_init_struct.loop_mode_enable = TRUE;
608 dma_init(DMA1_CHANNEL4, &dma_init_struct);
609 dma_interrupt_enable(DMA1_CHANNEL4, DMA_FDT_INT, TRUE);
610 dma_interrupt_enable(DMA1_CHANNEL4, DMA_HDT_INT, TRUE);
611 nvic_irq_enable(DMA1_Channel4_IRQn, 2, 0);
612
613 /* i2s1 tx init */
614 spi_i2s_reset(SPI1);
615 i2s_default_para_init(&i2s_init_struct);
616 i2s_init_struct.audio_protocol = I2S_AUDIO_PROTOCOL_PHILLIPS;
617 i2s_init_struct.data_channel_format = format;
618 i2s_init_struct.mclk_output_enable = FALSE;
619 i2s_init_struct.audio_sampling_freq = (i2s_audio_sampling_freq_type)param->audio_freq;
620 i2s_init_struct.clock_polarity = I2S_CLOCK_POLARITY_LOW;
621 i2s_init_struct.operation_mode = I2S_MODE_SLAVE_TX;
622 i2s_init(SPI1, &i2s_init_struct);
623
624 /* i2s2 rx init */
625 spi_i2s_reset(SPI2);
626 i2s_default_para_init(&i2s_init_struct);
627 i2s_init_struct.audio_protocol = I2S_AUDIO_PROTOCOL_PHILLIPS;
628 i2s_init_struct.data_channel_format = format;
629 i2s_init_struct.mclk_output_enable = FALSE;
630 i2s_init_struct.audio_sampling_freq = (i2s_audio_sampling_freq_type)param->audio_freq;
631 i2s_init_struct.clock_polarity = I2S_CLOCK_POLARITY_LOW;
632 i2s_init_struct.operation_mode = I2S_MODE_SLAVE_RX;
633 i2s_init(SPI2, &i2s_init_struct);
634
635
636 spi_i2s_dma_transmitter_enable(SPI1, TRUE);
637 spi_i2s_dma_receiver_enable(SPI2, TRUE);
638 i2s_enable(SPI1, TRUE);
639 i2s_enable(SPI2, TRUE);
640
641 dma_channel_enable(DMA1_CHANNEL3, TRUE);
642 dma_channel_enable(DMA1_CHANNEL4, TRUE);
643
644}
645
651void DMA1_Channel3_IRQHandler(void)
652{
653 uint16_t half_size = audio_codec.spk_tx_size;
654 uint16_t *pdst;
655
656 if(dma_flag_get(DMA1_HDT3_FLAG) == SET)
657 {
658 //copy_buff(audio_codec.spk_buffer, audio_codec.spk_tx_fifo + audio_codec.r_pos, half_size);
659 pdst = spk_dma_buffer;
660 dma_flag_clear(DMA1_HDT3_FLAG);
661 }
662 else if(dma_flag_get(DMA1_FDT3_FLAG) == SET)
663 {
664 //copy_buff(&audio_codec.spk_buffer[half_size], audio_codec.spk_tx_fifo + audio_codec.r_pos, half_size);
665 pdst = spk_dma_buffer + half_size;
666 dma_flag_clear(DMA1_FDT3_FLAG);
667 }
668
669 switch( audio_codec.spk_stage )
670 {
671 case 0:
672 case 1:
673 memset( pdst, 0, half_size << 1);
674 break;
675 case 2:
676 if( audio_codec.spk_wtotal >= audio_codec.spk_rtotal + SPK_BUFFER_SIZE )
677 {
678 while(1);//should not happen;
679 }
680 if( audio_codec.spk_rtotal >= audio_codec.spk_wtotal )
681 {
682 audio_codec.spk_stage = 0;
683 audio_codec.spk_woff = audio_codec.spk_roff = audio_codec.spk_buffer;
684 audio_codec.spk_rtotal = audio_codec.spk_wtotal = 0;
685 }
686 else
687 {
688 memcpy( pdst, audio_codec.spk_roff, half_size << 1 );
689 audio_codec.spk_roff += half_size;
690 audio_codec.spk_rtotal += half_size;
691 if( audio_codec.spk_roff >= audio_codec.spk_rend )
692 {
693 audio_codec.spk_roff = audio_codec.spk_buffer;
694 }
695 if( ++audio_codec.spk_calc == 256 )
696 {
697 uint16_t delta = audio_codec.spk_wtotal - audio_codec.spk_rtotal;
698 audio_codec.spk_calc = 0;
699 if( delta < audio_codec.spk_threshold - half_size )
700 {
701 audio_codec.spk_threshold -= half_size;
702 audio_codec.spk_freq += audio_codec.audio_freq/1024;
703 }
704 else if( delta > audio_codec.spk_threshold + half_size )
705 {
706 audio_codec.spk_threshold += half_size;
707 audio_codec.spk_freq -= audio_codec.audio_freq/1024;
708 }
709 if(audio_codec.spk_rtotal > 0x20000000)
710 {
711 audio_codec.spk_rtotal -= 0x10000000;
712 audio_codec.spk_wtotal -= 0x10000000;
713 }
714 }
715 }
716 break;
717 }
718
719}
720
726void DMA1_Channel4_IRQHandler(void)
727{
728 uint16_t *psrc;
729 uint16_t len = audio_codec.mic_rx_size << 1;
730
731 if(dma_flag_get(DMA1_HDT4_FLAG) == SET)
732 {
733 dma_flag_clear(DMA1_HDT4_FLAG);
734 psrc = mic_dma_buffer;
735 }
736 else if(dma_flag_get(DMA1_FDT4_FLAG) == SET)
737 {
738 psrc = mic_dma_buffer + audio_codec.mic_rx_size;
739 dma_flag_clear(DMA1_FDT4_FLAG);
740 }
741 if( audio_codec.mic_stage )
742 {
743 memcpy( audio_codec.mic_woff, psrc, len );
744 audio_codec.mic_woff += len/2;
745 audio_codec.mic_wtotal += len/2;
746 if( audio_codec.mic_woff >= audio_codec.mic_wend )
747 {
748 audio_codec.mic_woff = audio_codec.mic_buffer;
749 }
750 if( audio_codec.mic_stage == 2 )
751 {
752 if( 1024 == ++audio_codec.mic_calc )
753 {
754 uint32_t size_estimate = 1024*audio_codec.mic_rx_size;
755 audio_codec.mic_calc = 0;
756 if( audio_codec.mic_delta > size_estimate )
757 {
758 audio_codec.mic_adj_count = audio_codec.mic_delta - size_estimate;
759 audio_codec.mic_adj_stage = 2;
760 }
761 else if( audio_codec.mic_delta < size_estimate )
762 {
763 audio_codec.mic_adj_count = size_estimate - audio_codec.mic_delta;
764 audio_codec.mic_adj_stage = 1;
765 }
766 else
767 {
768 audio_codec.mic_adj_count = 0;
769 audio_codec.mic_adj_stage = 0;
770 }
771 audio_codec.mic_delta = 0;
772 if( audio_codec.mic_rtotal >= 0x80000000 )
773 {
774 audio_codec.mic_rtotal -= 0x80000000;
775 audio_codec.mic_wtotal -= 0x80000000;
776 }
777 }
778 if( audio_codec.mic_wtotal >= audio_codec.mic_rtotal + MIC_BUFFER_SIZE )
779 {
780 audio_codec.mic_delta = audio_codec.mic_wtotal = audio_codec.mic_rtotal = 0;
781 audio_codec.mic_woff = audio_codec.mic_roff = audio_codec.mic_buffer;
782 audio_codec.mic_stage = 0;
783 audio_codec.mic_adj_stage = 0;
784 audio_codec.mic_adj_count = 0;
785 audio_codec.mic_calc = 0;
786 }
787 }
788 }
789}
790
796 error_status audio_codec_init(void)
797{
798 uint32_t reg_len = sizeof(reg_addr_data) / sizeof(uint16_t);
799 uint32_t i_index = 0;
800 uint8_t i2c_cmd[2];
801
802 if(AUDIO_DEFAULT_FREQ == AUDIO_FREQ_16K)
803 {
804 reg_addr_data[6] = WM8988_REG_FREQ16K;
805 audio_codec.audio_freq = AUDIO_FREQ_16K;
806 }
807 else if(AUDIO_DEFAULT_FREQ == AUDIO_FREQ_48K)
808 {
809 reg_addr_data[6] = WM8988_REG_FREQ48K;
810 audio_codec.audio_freq = AUDIO_FREQ_48K;
811 }
812 else
813 {
814 return ERROR;
815 }
816
817 if(AUDIO_DEFAULT_BITW == AUDIO_BITW_16)
818 {
819 reg_addr_data[5] = WM8988_REG_BITW16;
820 audio_codec.audio_bitw = AUDIO_BITW_16;
821 }
822 else
823 {
824 return ERROR;
825 }
826
827 /* i2c init */
828 hi2cx.i2cx = I2Cx_PORT;
829
830 i2c_config(&hi2cx);
831
832 for(i_index = 0; i_index < reg_len; i_index ++)
833 {
834 i2c_cmd[0] = (uint8_t)(reg_addr_data[i_index] >> 8);
835 i2c_cmd[1] = (uint8_t)reg_addr_data[i_index] & 0xFF;
836 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
837 {
838 return ERROR;
839 }
840 }
841
842 /* timer init */
843 mclk_tmr1_init();
844
845 codec_i2s_init(&audio_codec);
846
847 return SUCCESS;
848}
849
855 error_status audio_codec_loop(void)
856{
857 static uint8_t mic_mute = 0;
858 static uint16_t mic_volume = 0;
859 static uint8_t spk_mute = 0;
860 static uint16_t spk_volume = 0;
861 uint16_t audio_ctrl_l;
862 uint16_t audio_ctrl_r;
863 uint8_t i2c_cmd[2];
864
865 if(mic_mute != audio_codec.mic_mute)
866 {
867 mic_mute = audio_codec.mic_mute;
868 audio_ctrl_l = WM8988_R21_LEFT_ADC_VOLUME << 9 | 0x100;
869 audio_ctrl_r = WM8988_R22_RIGHT_ADC_VOLUME << 9 | 0x100;
870 if(audio_codec.mic_mute == 0)
871 {
872 audio_ctrl_l |= audio_codec.mic_volume;
873 audio_ctrl_r |= audio_codec.mic_volume;
874 }
875 i2c_cmd[0] = (uint8_t)(audio_ctrl_l >> 8);
876 i2c_cmd[1] = (uint8_t)audio_ctrl_l & 0xFF;
877 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
878 {
879 return ERROR;
880 }
881 i2c_cmd[0] = (uint8_t)(audio_ctrl_r >> 8);
882 i2c_cmd[1] = (uint8_t)audio_ctrl_r & 0xFF;
883 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
884 {
885 return ERROR;
886 }
887 }
888
889 if(mic_volume != audio_codec.mic_volume)
890 {
891 mic_volume = audio_codec.mic_volume;
892 audio_ctrl_l = WM8988_R21_LEFT_ADC_VOLUME << 9 | 0x100;
893 audio_ctrl_r = WM8988_R22_RIGHT_ADC_VOLUME << 9 | 0x100;
894 audio_ctrl_l |= audio_codec.mic_volume;
895 audio_ctrl_r |= audio_codec.mic_volume;
896 i2c_cmd[0] = (uint8_t)(audio_ctrl_l >> 8);
897 i2c_cmd[1] = (uint8_t)audio_ctrl_l & 0xFF;
898 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
899 {
900 return ERROR;
901 }
902 i2c_cmd[0] = (uint8_t)(audio_ctrl_r >> 8);
903 i2c_cmd[1] = (uint8_t)audio_ctrl_r & 0xFF;
904 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
905 {
906 return ERROR;
907 }
908 }
909
910 if(spk_mute != audio_codec.spk_mute)
911 {
912 spk_mute = audio_codec.spk_mute;
913 audio_ctrl_l = (WM8988_R5_ADC_DAC_CONTROL << 9) | 0x0006 | (audio_codec.spk_mute << 3);
914 i2c_cmd[0] = (uint8_t)(audio_ctrl_l >> 8);
915 i2c_cmd[1] = (uint8_t)audio_ctrl_l & 0xFF;
916 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
917 {
918 return ERROR;
919 }
920 }
921
922 if(spk_volume != audio_codec.spk_volume)
923 {
924 spk_volume = audio_codec.spk_volume;
925 audio_ctrl_l = WM8988_R2_LOUT1_VOLUME << 9 | 0x100;
926 audio_ctrl_r = WM8988_R3_ROUT1_VOLUME << 9 | 0x100;
927 audio_ctrl_l |= audio_codec.spk_volume;
928 audio_ctrl_r |= audio_codec.spk_volume;
929
930 i2c_cmd[0] = (uint8_t)(audio_ctrl_l >> 8);
931 i2c_cmd[1] = (uint8_t)audio_ctrl_l & 0xFF;
932
933 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
934 {
935 return ERROR;
936 }
937 i2c_cmd[0] = (uint8_t)(audio_ctrl_r >> 8);
938 i2c_cmd[1] = (uint8_t)audio_ctrl_r & 0xFF;
939 if(i2c_master_transmit(&hi2cx, WM8988_I2C_ADDR_CSB_LOW, (uint8_t *)i2c_cmd, 2, 0xFFFF) != I2C_OK)
940 {
941 return ERROR;
942 }
943 }
944 return SUCCESS;
945}
946
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:38
reg_addr_data
uint16_t reg_addr_data[]
wm8988 register default value
Definition: composite_audio_hid/src/audio_codec.c:71
audio_codec_mic_alt_setting
void audio_codec_mic_alt_setting(uint32_t alt_seting)
audio codec microphone alt setting config
Definition: composite_audio_hid/src/audio_codec.c:169
codec_i2s_reset
void codec_i2s_reset(void)
audio codec i2s reset
Definition: composite_audio_hid/src/audio_codec.c:479
spk_dma_buffer
uint16_t spk_dma_buffer[DMA_BUFFER_SIZE]
Definition: composite_audio_hid/src/audio_codec.c:107
audio_codec_set_spk_volume
void audio_codec_set_spk_volume(uint16_t volume)
audio codec set speaker volume
Definition: composite_audio_hid/src/audio_codec.c:217
audio_codec_set_spk_mute
void audio_codec_set_spk_mute(uint8_t mute)
audio codec set speaker mute
Definition: composite_audio_hid/src/audio_codec.c:195
WM8988_REG_FREQ48K
#define WM8988_REG_FREQ48K
wm8988 freq
Definition: composite_audio_hid/src/audio_codec.c:60
audio_codec_set_mic_freq
void audio_codec_set_mic_freq(uint32_t freq)
audio codec set microphone freq
Definition: composite_audio_hid/src/audio_codec.c:121
I2Cx_ADDRESS
#define I2Cx_ADDRESS
Definition: composite_audio_hid/src/audio_codec.c:44
I2Cx_SDA_GPIO_PIN
#define I2Cx_SDA_GPIO_PIN
Definition: composite_audio_hid/src/audio_codec.c:54
I2Cx_CLK
#define I2Cx_CLK
Definition: composite_audio_hid/src/audio_codec.c:47
audio_codec_mic_get_data
uint32_t audio_codec_mic_get_data(uint8_t *buffer)
codec microphone get data
Definition: composite_audio_hid/src/audio_codec.c:282
WM8988_REG_BITW16
#define WM8988_REG_BITW16
wm8988 bit width
Definition: composite_audio_hid/src/audio_codec.c:66
audio_codec_loop
error_status audio_codec_loop(void)
audio codec loop
Definition: composite_audio_hid/src/audio_codec.c:855
codec_i2s_init
void codec_i2s_init(audio_codec_type *param)
audio codec i2s init
Definition: composite_audio_hid/src/audio_codec.c:493
audio_codec_set_mic_mute
void audio_codec_set_mic_mute(uint8_t mute)
audio codec set microphone mute
Definition: composite_audio_hid/src/audio_codec.c:184
audio_codec_spk_fifo_write
void audio_codec_spk_fifo_write(uint8_t *data, uint32_t len)
codec speaker write fifo
Definition: composite_audio_hid/src/audio_codec.c:244
mic_dma_buffer
uint16_t mic_dma_buffer[DMA_BUFFER_SIZE]
Definition: composite_audio_hid/src/audio_codec.c:108
audio_codec_spk_feedback
uint8_t audio_codec_spk_feedback(uint8_t *feedback)
codec speaker feedback
Definition: composite_audio_hid/src/audio_codec.c:228
hi2cx
i2c_handle_type hi2cx
Definition: composite_audio_hid/src/audio_codec.c:104
DMA1_Channel4_IRQHandler
void DMA1_Channel4_IRQHandler(void)
this function handles dma1 channel4 interrupt.
Definition: composite_audio_hid/src/audio_codec.c:726
audio_codec_modify_freq
void audio_codec_modify_freq(uint32_t freq)
audio codec modify freq
Definition: composite_audio_hid/src/audio_codec.c:342
I2Cx_SDA_GPIO_PORT
#define I2Cx_SDA_GPIO_PORT
Definition: composite_audio_hid/src/audio_codec.c:55
audio_codec_set_mic_volume
void audio_codec_set_mic_volume(uint16_t volume)
audio codec set microphone volume
Definition: composite_audio_hid/src/audio_codec.c:206
mclk_tmr1_init
void mclk_tmr1_init(void)
mclk clock conifg
Definition: composite_audio_hid/src/audio_codec.c:437
DMA1_Channel3_IRQHandler
void DMA1_Channel3_IRQHandler(void)
this function handles dma1 channel3 interrupt.
Definition: composite_audio_hid/src/audio_codec.c:651
I2Cx_SDA_GPIO_CLK
#define I2Cx_SDA_GPIO_CLK
Definition: composite_audio_hid/src/audio_codec.c:53
audio_codec
audio_codec_type audio_codec
Definition: composite_audio_hid/src/audio_codec.c:106
audio_codec_spk_alt_setting
void audio_codec_spk_alt_setting(uint32_t alt_seting)
audio codec speaker alt setting config
Definition: composite_audio_hid/src/audio_codec.c:154
i2c_lowlevel_init
void i2c_lowlevel_init(i2c_handle_type *hi2c)
initializes peripherals used by the i2c.
Definition: composite_audio_hid/src/audio_codec.c:399
I2Cx_SPEED
#define I2Cx_SPEED
Definition: composite_audio_hid/src/audio_codec.c:43
audio_codec_init
error_status audio_codec_init(void)
audio codec init
Definition: composite_audio_hid/src/audio_codec.c:796
WM8988_REG_FREQ16K
#define WM8988_REG_FREQ16K
Definition: composite_audio_hid/src/audio_codec.c:61
copy_buff
void copy_buff(uint16_t *dest, uint16_t *src, uint32_t len)
copy buffer
Definition: composite_audio_hid/src/audio_codec.c:385
memset16_buffer
void memset16_buffer(uint16_t *buffer, uint32_t set, uint32_t len)
buffer memset
Definition: composite_audio_hid/src/audio_codec.c:369
I2Cx_PORT
#define I2Cx_PORT
Definition: composite_audio_hid/src/audio_codec.c:46
audio_codec_set_spk_freq
void audio_codec_set_spk_freq(uint32_t freq)
audio codec set speaker freq
Definition: composite_audio_hid/src/audio_codec.c:137
I2Cx_SCL_GPIO_PIN
#define I2Cx_SCL_GPIO_PIN
Definition: composite_audio_hid/src/audio_codec.c:50
I2Cx_SCL_GPIO_CLK
#define I2Cx_SCL_GPIO_CLK
Definition: composite_audio_hid/src/audio_codec.c:49
I2Cx_SCL_GPIO_PORT
#define I2Cx_SCL_GPIO_PORT
Definition: composite_audio_hid/src/audio_codec.c:51
i2c_config
void i2c_config(i2c_handle_type *hi2c)
i2c peripheral initialization.
Definition: i2c_application.c:102
i2c_master_transmit
i2c_status_type i2c_master_transmit(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through polling mode.
Definition: i2c_application.c:402
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_SPI2_PERIPH_CLOCK
@ CRM_SPI2_PERIPH_CLOCK
Definition: at32f415_crm.h:129
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_SPI1_PERIPH_CLOCK
@ CRM_SPI1_PERIPH_CLOCK
Definition: at32f415_crm.h:117
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
DMA1_Channel3_IRQn
@ DMA1_Channel3_IRQn
Definition: at32f415.h:148
DMA1_Channel4_IRQn
@ DMA1_Channel4_IRQn
Definition: at32f415.h:149
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_interrupt_enable
void dma_interrupt_enable(dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt
Definition: at32f415_dma.c:165
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_HIGH
@ DMA_PRIORITY_HIGH
Definition: at32f415_dma.h:260
DMA1_HDT4_FLAG
#define DMA1_HDT4_FLAG
Definition: at32f415_dma.h:95
DMA1_HDT3_FLAG
#define DMA1_HDT3_FLAG
Definition: at32f415_dma.h:91
DMA1_FDT4_FLAG
#define DMA1_FDT4_FLAG
Definition: at32f415_dma.h:94
DMA1_FDT3_FLAG
#define DMA1_FDT3_FLAG
Definition: at32f415_dma.h:90
DMA_FDT_INT
#define DMA_FDT_INT
Definition: at32f415_dma.h:52
DMA_HDT_INT
#define DMA_HDT_INT
Definition: at32f415_dma.h:53
DMA1_CHANNEL3
#define DMA1_CHANNEL3
Definition: at32f415_dma.h:475
DMA1_CHANNEL4
#define DMA1_CHANNEL4
Definition: at32f415_dma.h:476
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_pin_remap_config
void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration.
Definition: at32f415_gpio.c:521
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_MODERATE
@ GPIO_DRIVE_STRENGTH_MODERATE
Definition: at32f415_gpio.h:240
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_OPEN_DRAIN
@ GPIO_OUTPUT_OPEN_DRAIN
Definition: at32f415_gpio.h:250
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
i2c_own_address1_set
void i2c_own_address1_set(i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address)
config own address1.
Definition: at32f415_i2c.c:185
i2c_init
void i2c_init(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed)
init i2c speed and duty cycle.
Definition: at32f415_i2c.c:90
I2C_FSMODE_DUTY_2_1
@ I2C_FSMODE_DUTY_2_1
Definition: at32f415_i2c.h:148
I2C_ADDRESS_MODE_7BIT
@ I2C_ADDRESS_MODE_7BIT
Definition: at32f415_i2c.h:157
I2C_OK
@ I2C_OK
Definition: i2c_application.h:82
I2C1_MUX
#define I2C1_MUX
Definition: at32f415_gpio.h:82
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
i2s_init
void i2s_init(spi_type *spi_x, i2s_init_type *i2s_init_struct)
i2s init config with its setting value.
Definition: at32f415_spi.c:316
spi_i2s_dma_receiver_enable
void spi_i2s_dma_receiver_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma receiver mode.
Definition: at32f415_spi.c:499
i2s_enable
void i2s_enable(spi_type *spi_x, confirm_state new_state)
enable or disable i2s.
Definition: at32f415_spi.c:445
spi_i2s_reset
void spi_i2s_reset(spi_type *spi_x)
spi reset by crm reset register
Definition: at32f415_spi.c:51
i2s_default_para_init
void i2s_default_para_init(i2s_init_type *i2s_init_struct)
i2s init config with its default value.
Definition: at32f415_spi.c:298
spi_i2s_dma_transmitter_enable
void spi_i2s_dma_transmitter_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma transmitter mode.
Definition: at32f415_spi.c:485
i2s_data_channel_format_type
i2s_data_channel_format_type
i2s data bit num and channel bit num type
Definition: at32f415_spi.h:226
i2s_audio_sampling_freq_type
i2s_audio_sampling_freq_type
i2s audio frequency type
Definition: at32f415_spi.h:209
I2S_CLOCK_POLARITY_LOW
@ I2S_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:249
I2S_DATA_16BIT_CHANNEL_16BIT
@ I2S_DATA_16BIT_CHANNEL_16BIT
Definition: at32f415_spi.h:227
I2S_DATA_24BIT_CHANNEL_32BIT
@ I2S_DATA_24BIT_CHANNEL_32BIT
Definition: at32f415_spi.h:229
I2S_AUDIO_PROTOCOL_PHILLIPS
@ I2S_AUDIO_PROTOCOL_PHILLIPS
Definition: at32f415_spi.h:198
I2S_MODE_SLAVE_RX
@ I2S_MODE_SLAVE_RX
Definition: at32f415_spi.h:239
I2S_MODE_SLAVE_TX
@ I2S_MODE_SLAVE_TX
Definition: at32f415_spi.h:238
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_output_enable
void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable
Definition: at32f415_tmr.c:1382
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_output_channel_buffer_enable
void tmr_output_channel_buffer_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
enable tmr output channel buffer
Definition: at32f415_tmr.c:587
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_PWM_MODE_A
@ TMR_OUTPUT_CONTROL_PWM_MODE_A
Definition: at32f415_tmr.h:179
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
MIC_BUFFER_SIZE
#define MIC_BUFFER_SIZE
Definition: audio/inc/audio_codec.h:130
SPK_BUFFER_SIZE
#define SPK_BUFFER_SIZE
Definition: audio/inc/audio_codec.h:131
DMA_BUFFER_SIZE
#define DMA_BUFFER_SIZE
Definition: audio/inc/audio_codec.h:132
I2S2_DT_ADDRESS
#define I2S2_DT_ADDRESS
Definition: audio/inc/audio_codec.h:119
I2S1_SD_PIN
#define I2S1_SD_PIN
Definition: audio/inc/audio_codec.h:105
I2S1_CK_PIN
#define I2S1_CK_PIN
Definition: audio/inc/audio_codec.h:104
I2S2_GPIO
#define I2S2_GPIO
Definition: audio/inc/audio_codec.h:117
I2S2_SD_PIN
#define I2S2_SD_PIN
Definition: audio/inc/audio_codec.h:114
I2S2_WS_PIN
#define I2S2_WS_PIN
Definition: audio/inc/audio_codec.h:112
I2S2_GPIO_CRM_CLK
#define I2S2_GPIO_CRM_CLK
Definition: audio/inc/audio_codec.h:118
I2S1_DT_ADDRESS
#define I2S1_DT_ADDRESS
Definition: audio/inc/audio_codec.h:109
I2S1_GPIO_CRM_CLK
#define I2S1_GPIO_CRM_CLK
Definition: audio/inc/audio_codec.h:108
I2S1_WS_PIN
#define I2S1_WS_PIN
Definition: audio/inc/audio_codec.h:103
I2S1_GPIO
#define I2S1_GPIO
Definition: audio/inc/audio_codec.h:107
I2S2_CK_PIN
#define I2S2_CK_PIN
Definition: audio/inc/audio_codec.h:113
WM8988_R27_ADDITIONAL_3_CONTROL
#define WM8988_R27_ADDITIONAL_3_CONTROL
Definition: audio/inc/audio_codec.h:77
WM8988_I2C_ADDR_CSB_LOW
#define WM8988_I2C_ADDR_CSB_LOW
Definition: audio/inc/audio_codec.h:93
WM8988_R10_LEFT_DAC_VOLUME
#define WM8988_R10_LEFT_DAC_VOLUME
Definition: audio/inc/audio_codec.h:60
WM8988_R1_RIGHT_INPUT_VOLUME
#define WM8988_R1_RIGHT_INPUT_VOLUME
Definition: audio/inc/audio_codec.h:51
WM8988_R3_ROUT1_VOLUME
#define WM8988_R3_ROUT1_VOLUME
Definition: audio/inc/audio_codec.h:53
WM8988_R36_RIGHT_OUT_MIX_1
#define WM8988_R36_RIGHT_OUT_MIX_1
Definition: audio/inc/audio_codec.h:84
WM8988_R21_LEFT_ADC_VOLUME
#define WM8988_R21_LEFT_ADC_VOLUME
Definition: audio/inc/audio_codec.h:71
WM8988_R31_ADC_INPUT_MODE
#define WM8988_R31_ADC_INPUT_MODE
Definition: audio/inc/audio_codec.h:79
WM8988_R13_TREBLE_CONTROL
#define WM8988_R13_TREBLE_CONTROL
Definition: audio/inc/audio_codec.h:63
WM8988_R16_3D_CONTROL
#define WM8988_R16_3D_CONTROL
Definition: audio/inc/audio_codec.h:66
WM8988_R22_RIGHT_ADC_VOLUME
#define WM8988_R22_RIGHT_ADC_VOLUME
Definition: audio/inc/audio_codec.h:72
WM8988_R0_LEFT_INPUT_VOLUME
#define WM8988_R0_LEFT_INPUT_VOLUME
Definition: audio/inc/audio_codec.h:50
WM8988_R23_ADDITIONAL_1_CONTROL
#define WM8988_R23_ADDITIONAL_1_CONTROL
Definition: audio/inc/audio_codec.h:73
WM8988_R35_LEFT_OUT_MIX_2
#define WM8988_R35_LEFT_OUT_MIX_2
Definition: audio/inc/audio_codec.h:83
WM8988_R43_LOW_POWER_PALYBACK
#define WM8988_R43_LOW_POWER_PALYBACK
Definition: audio/inc/audio_codec.h:91
WM8988_R32_ADC_L_SIGNAL_PATH
#define WM8988_R32_ADC_L_SIGNAL_PATH
Definition: audio/inc/audio_codec.h:80
WM8988_R26_PWR_2_MGMT
#define WM8988_R26_PWR_2_MGMT
Definition: audio/inc/audio_codec.h:76
WM8988_R11_RIGHT_DAC_VOLUME
#define WM8988_R11_RIGHT_DAC_VOLUME
Definition: audio/inc/audio_codec.h:61
WM8988_R24_ADDITIONAL_2_CONTROL
#define WM8988_R24_ADDITIONAL_2_CONTROL
Definition: audio/inc/audio_codec.h:74
WM8988_R40_LOUT2_VOLUME
#define WM8988_R40_LOUT2_VOLUME
Definition: audio/inc/audio_codec.h:88
WM8988_R34_LEFT_OUT_MIX_1
#define WM8988_R34_LEFT_OUT_MIX_1
Definition: audio/inc/audio_codec.h:82
WM8988_R5_ADC_DAC_CONTROL
#define WM8988_R5_ADC_DAC_CONTROL
Definition: audio/inc/audio_codec.h:55
WM8988_R25_PWR_1_MGMT
#define WM8988_R25_PWR_1_MGMT
Definition: audio/inc/audio_codec.h:75
WM8988_R41_ROUT2_VOLUME
#define WM8988_R41_ROUT2_VOLUME
Definition: audio/inc/audio_codec.h:89
WM8988_R2_LOUT1_VOLUME
#define WM8988_R2_LOUT1_VOLUME
Definition: audio/inc/audio_codec.h:52
WM8988_R37_RIGHT_OUT_MIX_2
#define WM8988_R37_RIGHT_OUT_MIX_2
Definition: audio/inc/audio_codec.h:85
WM8988_R33_ADC_R_SIGNAL_PATH
#define WM8988_R33_ADC_R_SIGNAL_PATH
Definition: audio/inc/audio_codec.h:81
WM8988_R12_BASS_CONTROL
#define WM8988_R12_BASS_CONTROL
Definition: audio/inc/audio_codec.h:62
AUDIO_BITW_16
#define AUDIO_BITW_16
Definition: audio/audio_conf.h:61
AUDIO_MIC_CHANEL_NUM
#define AUDIO_MIC_CHANEL_NUM
Definition: audio/audio_conf.h:63
AUDIO_DEFAULT_FREQ
#define AUDIO_DEFAULT_FREQ
Definition: audio/audio_conf.h:71
AUDIO_FREQ_16K
#define AUDIO_FREQ_16K
Definition: audio/audio_conf.h:59
AUDIO_SPK_CHANEL_NUM
#define AUDIO_SPK_CHANEL_NUM
Definition: audio/audio_conf.h:66
AUDIO_DEFAULT_BITW
#define AUDIO_DEFAULT_BITW
Definition: audio/audio_conf.h:72
AUDIO_FREQ_48K
#define AUDIO_FREQ_48K
Definition: audio/audio_conf.h:60
i2c_application.h
i2c application libray header file
audio_codec_type
Definition: audio/inc/audio_codec.h:135
audio_codec_type::spk_mute
uint8_t spk_mute
Definition: audio/inc/audio_codec.h:164
audio_codec_type::spk_threshold
uint16_t spk_threshold
Definition: audio/inc/audio_codec.h:146
audio_codec_type::spk_stage
uint8_t spk_stage
Definition: audio/inc/audio_codec.h:148
audio_codec_type::mic_roff
uint16_t * mic_roff
Definition: audio/inc/audio_codec.h:152
audio_codec_type::spk_buffer
uint16_t spk_buffer[4096]
Definition: audio/inc/audio_codec.h:139
audio_codec_type::mic_volume
uint16_t mic_volume
Definition: audio/inc/audio_codec.h:166
audio_codec_type::spk_roff
uint16_t * spk_roff
Definition: audio/inc/audio_codec.h:140
audio_codec_type::spk_rtotal
uint32_t spk_rtotal
Definition: audio/inc/audio_codec.h:145
audio_codec_type::mic_delta
uint32_t mic_delta
Definition: audio/inc/audio_codec.h:157
audio_codec_type::spk_calc
uint16_t spk_calc
Definition: audio/inc/audio_codec.h:147
audio_codec_type::mic_woff
uint16_t * mic_woff
Definition: audio/inc/audio_codec.h:153
audio_codec_type::mic_stage
uint8_t mic_stage
Definition: audio/inc/audio_codec.h:161
audio_codec_type::mic_adj_count
uint16_t mic_adj_count
Definition: audio/inc/audio_codec.h:159
audio_codec_type::spk_freq
uint32_t spk_freq
Definition: audio/inc/audio_codec.h:143
audio_codec_type::audio_bitw
uint32_t audio_bitw
Definition: audio/inc/audio_codec.h:137
audio_codec_type::mic_wend
uint16_t * mic_wend
Definition: audio/inc/audio_codec.h:154
audio_codec_type::spk_rend
uint16_t * spk_rend
Definition: audio/inc/audio_codec.h:142
audio_codec_type::mic_wtotal
uint32_t mic_wtotal
Definition: audio/inc/audio_codec.h:155
audio_codec_type::mic_rtotal
uint32_t mic_rtotal
Definition: audio/inc/audio_codec.h:156
audio_codec_type::audio_freq
uint32_t audio_freq
Definition: audio/inc/audio_codec.h:136
audio_codec_type::mic_mute
uint8_t mic_mute
Definition: audio/inc/audio_codec.h:163
audio_codec_type::spk_volume
uint16_t spk_volume
Definition: audio/inc/audio_codec.h:167
audio_codec_type::mic_calc
uint16_t mic_calc
Definition: audio/inc/audio_codec.h:158
audio_codec_type::spk_wtotal
uint32_t spk_wtotal
Definition: audio/inc/audio_codec.h:144
audio_codec_type::mic_adj_stage
uint8_t mic_adj_stage
Definition: audio/inc/audio_codec.h:160
audio_codec_type::spk_tx_size
uint32_t spk_tx_size
Definition: audio/inc/audio_codec.h:169
audio_codec_type::mic_rx_size
uint32_t mic_rx_size
Definition: audio/inc/audio_codec.h:170
audio_codec_type::spk_woff
uint16_t * spk_woff
Definition: audio/inc/audio_codec.h:141
audio_codec_type::mic_buffer
uint16_t mic_buffer[1024]
Definition: audio/inc/audio_codec.h:151
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
i2c_handle_type
Definition: i2c_application.h:114
i2c_handle_type::i2cx
i2c_type * i2cx
Definition: i2c_application.h:115
i2s_init_type
i2s init type
Definition: at32f415_spi.h:272
i2s_init_type::audio_sampling_freq
i2s_audio_sampling_freq_type audio_sampling_freq
Definition: at32f415_spi.h:275
i2s_init_type::data_channel_format
i2s_data_channel_format_type data_channel_format
Definition: at32f415_spi.h:276
i2s_init_type::mclk_output_enable
confirm_state mclk_output_enable
Definition: at32f415_spi.h:278
i2s_init_type::audio_protocol
i2s_audio_protocol_type audio_protocol
Definition: at32f415_spi.h:274
i2s_init_type::operation_mode
i2s_operation_mode_type operation_mode
Definition: at32f415_spi.h:273
i2s_init_type::clock_polarity
i2s_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:277
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402


AT32F415 Firmwary Library: custom_hid_class.c Source File

  • middlewares
  • usbd_class
  • custom_hid
custom_hid_class.c
Go to the documentation of this file.
1
26#include "usbd_core.h"
27#include "custom_hid_class.h"
28#include "custom_hid_desc.h"
29
43 usb_sts_type class_init_handler(void *udev);
44 usb_sts_type class_clear_handler(void *udev);
45 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup);
46 usb_sts_type class_ept0_tx_handler(void *udev);
47 usb_sts_type class_ept0_rx_handler(void *udev);
48 usb_sts_type class_in_handler(void *udev, uint8_t ept_num);
49 usb_sts_type class_out_handler(void *udev, uint8_t ept_num);
50 usb_sts_type class_sof_handler(void *udev);
51 usb_sts_type class_event_handler(void *udev, usbd_event_type event);
52
53void usb_hid_buf_process(void *udev, uint8_t *report, uint16_t len);
54/* usb hid rx and tx buffer */
55static uint8_t g_rxhid_buff[USBD_OUT_MAXPACKET_SIZE];
56static uint8_t g_txhid_buff[USBD_IN_MAXPACKET_SIZE];
57
58/* custom hid static variable */
59static uint32_t hid_protocol = 0;
60static uint32_t hid_set_idle = 0;
61static uint32_t alt_setting = 0;
62static uint8_t hid_state;
63uint8_t hid_set_report[64];
64
65/* usb device class handler */
66usbd_class_handler custom_hid_class_handler =
67{
68 class_init_handler,
69 class_clear_handler,
70 class_setup_handler,
71 class_ept0_tx_handler,
72 class_ept0_rx_handler,
73 class_in_handler,
74 class_out_handler,
75 class_sof_handler,
76 class_event_handler,
77};
78
84 usb_sts_type class_init_handler(void *udev)
85{
86 usb_sts_type status = USB_OK;
87 usbd_core_type *pudev = (usbd_core_type *)udev;
88
89 /* open custom hid in endpoint */
90 usbd_ept_open(pudev, USBD_HID_IN_EPT, EPT_INT_TYPE, USBD_IN_MAXPACKET_SIZE);
91
92 /* open custom hid out endpoint */
93 usbd_ept_open(pudev, USBD_HID_OUT_EPT, EPT_INT_TYPE, USBD_OUT_MAXPACKET_SIZE);
94
95 /* set out endpoint to receive status */
96 usbd_ept_recv(pudev, USBD_HID_OUT_EPT, g_rxhid_buff, USBD_OUT_MAXPACKET_SIZE);
97
98 return status;
99}
100
106 usb_sts_type class_clear_handler(void *udev)
107{
108 usb_sts_type status = USB_OK;
109 usbd_core_type *pudev = (usbd_core_type *)udev;
110
111 /* close custom hid in endpoint */
112 usbd_ept_close(pudev, USBD_HID_IN_EPT);
113
114 /* close custom hid out endpoint */
115 usbd_ept_close(pudev, USBD_HID_OUT_EPT);
116
117 return status;
118}
119
126 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
127{
128 usb_sts_type status = USB_OK;
129 usbd_core_type *pudev = (usbd_core_type *)udev;
130 uint16_t len;
131 uint8_t *buf;
132
133 switch(setup->bmRequestType & USB_REQ_TYPE_RESERVED)
134 {
135 /* class request */
136 case USB_REQ_TYPE_CLASS:
137 switch(setup->bRequest)
138 {
139 case HID_REQ_SET_PROTOCOL:
140 hid_protocol = (uint8_t)setup->wValue;
141 break;
142 case HID_REQ_GET_PROTOCOL:
143 usbd_ctrl_send(pudev, (uint8_t *)&hid_protocol, 1);
144 break;
145 case HID_REQ_SET_IDLE:
146 hid_set_idle = (uint8_t)(setup->wValue >> 8);
147 break;
148 case HID_REQ_GET_IDLE:
149 usbd_ctrl_send(pudev, (uint8_t *)&hid_set_idle, 1);
150 break;
151 case HID_REQ_SET_REPORT:
152 hid_state = HID_REQ_SET_REPORT;
153 usbd_ctrl_recv(pudev, hid_set_report, setup->wLength);
154 break;
155 default:
156 usbd_ctrl_unsupport(pudev);
157 break;
158 }
159 break;
160 /* standard request */
161 case USB_REQ_TYPE_STANDARD:
162 switch(setup->bRequest)
163 {
164 case USB_STD_REQ_GET_DESCRIPTOR:
165 if(setup->wValue >> 8 == HID_REPORT_DESC)
166 {
167 len = MIN(USBD_HID_SIZ_REPORT_DESC, setup->wLength);
168 buf = (uint8_t *)g_usbd_hid_report;
169 }
170 else if(setup->wValue >> 8 == HID_DESCRIPTOR_TYPE)
171 {
172 len = MIN(9, setup->wLength);
173 buf = (uint8_t *)g_hid_usb_desc;
174 }
175 usbd_ctrl_send(pudev, (uint8_t *)buf, len);
176 break;
177 case USB_STD_REQ_GET_INTERFACE:
178 usbd_ctrl_send(pudev, (uint8_t *)&alt_setting, 1);
179 break;
180 case USB_STD_REQ_SET_INTERFACE:
181 alt_setting = setup->wValue;
182 break;
183 default:
184 break;
185 }
186 break;
187 default:
188 usbd_ctrl_unsupport(pudev);
189 break;
190 }
191 return status;
192}
193
199 usb_sts_type class_ept0_tx_handler(void *udev)
200{
201 usb_sts_type status = USB_OK;
202
203 /* ...user code... */
204
205 return status;
206}
207
213 usb_sts_type class_ept0_rx_handler(void *udev)
214{
215 usb_sts_type status = USB_OK;
216 usbd_core_type *pudev = (usbd_core_type *)udev;
217 uint32_t recv_len = usbd_get_recv_len(pudev, 0);
218 /* ...user code... */
219 if( hid_state == HID_REQ_SET_REPORT)
220 {
221 /* hid buffer process */
222 usb_hid_buf_process(udev, hid_set_report, recv_len);
223 hid_state = 0;
224 }
225
226 return status;
227}
228
235 usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
236{
237 usb_sts_type status = USB_OK;
238
239 /* ...user code...
240 trans next packet data
241 */
242
243 return status;
244}
245
252 usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
253{
254 usb_sts_type status = USB_OK;
255 usbd_core_type *pudev = (usbd_core_type *)udev;
256
257 /* get endpoint receive data length */
258 uint32_t recv_len = usbd_get_recv_len(pudev, ept_num);
259
260 /* hid buffer process */
261 usb_hid_buf_process(udev, g_rxhid_buff, recv_len);
262
263 /* start receive next packet */
264 usbd_ept_recv(pudev, USBD_HID_OUT_EPT, g_rxhid_buff, recv_len);
265
266 return status;
267}
268
274 usb_sts_type class_sof_handler(void *udev)
275{
276 usb_sts_type status = USB_OK;
277
278 /* ...user code... */
279
280 return status;
281}
282
289 usb_sts_type class_event_handler(void *udev, usbd_event_type event)
290{
291 usb_sts_type status = USB_OK;
292 switch(event)
293 {
294 case USBD_RESET_EVENT:
295
296 /* ...user code... */
297
298 break;
299 case USBD_SUSPEND_EVENT:
300
301 /* ...user code... */
302
303 break;
304 case USBD_WAKEUP_EVENT:
305 /* ...user code... */
306
307 break;
308 default:
309 break;
310 }
311 return status;
312}
313
321 usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
322{
323 usb_sts_type status = USB_OK;
324 usbd_core_type *pudev = (usbd_core_type *)udev;
325
326 if(usbd_connect_state_get(pudev) == USB_CONN_STATE_CONFIGURED)
327 usbd_ept_send(pudev, USBD_HID_IN_EPT, report, len);
328
329 return status;
330}
331
339void usb_hid_buf_process(void *udev, uint8_t *report, uint16_t len)
340{
341 uint32_t i_index;
342 usbd_core_type *pudev = (usbd_core_type *)udev;
343
344 switch(report[0])
345 {
346 case HID_REPORT_ID_2:
347 if(g_rxhid_buff[1] == 0)
348 {
349 at32_led_off(LED2);
350 }
351 else
352 {
353 at32_led_on(LED2);
354 }
355 break;
356 case HID_REPORT_ID_3:
357 if(g_rxhid_buff[1] == 0)
358 {
359 at32_led_off(LED3);
360 }
361 else
362 {
363 at32_led_on(LED3);
364 }
365 break;
366 case HID_REPORT_ID_4:
367 if(g_rxhid_buff[1] == 0)
368 {
369 at32_led_off(LED4);
370 }
371 else
372 {
373 at32_led_on(LED4);
374 }
375 break;
376 case HID_REPORT_ID_6:
377 for(i_index = 0; i_index < len; i_index ++)
378 {
379 g_txhid_buff[i_index] = report[i_index];
380 }
381 usbd_ept_send(pudev, USBD_HID_IN_EPT, g_txhid_buff, len);
382 default:
383 break;
384 }
385
386}
387
custom_hid_class.h
usb hid header file
custom_hid_desc.h
usb custom hid descriptor header file
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
HID_DESCRIPTOR_TYPE
#define HID_DESCRIPTOR_TYPE
Definition: audio_hid_class.h:118
USBD_HID_OUT_EPT
#define USBD_HID_OUT_EPT
Definition: audio_hid_class.h:62
HID_REQ_GET_PROTOCOL
#define HID_REQ_GET_PROTOCOL
Definition: audio_hid_class.h:113
USBD_HID_IN_EPT
#define USBD_HID_IN_EPT
usb custom hid use endpoint define
Definition: audio_hid_class.h:61
HID_REQ_SET_PROTOCOL
#define HID_REQ_SET_PROTOCOL
usb custom hid class request code define
Definition: audio_hid_class.h:112
HID_REPORT_DESC
#define HID_REPORT_DESC
Definition: audio_hid_class.h:119
HID_REQ_SET_IDLE
#define HID_REQ_SET_IDLE
Definition: audio_hid_class.h:114
HID_REQ_GET_IDLE
#define HID_REQ_GET_IDLE
Definition: audio_hid_class.h:115
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
HID_REQ_SET_REPORT
#define HID_REQ_SET_REPORT
Definition: audio_hid_class.h:116
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
HID_REPORT_ID_2
#define HID_REPORT_ID_2
Definition: audio_hid_desc.h:224
HID_REPORT_ID_4
#define HID_REPORT_ID_4
Definition: audio_hid_desc.h:226
HID_REPORT_ID_6
#define HID_REPORT_ID_6
Definition: audio_hid_desc.h:228
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: audio_hid_desc.h:236
HID_REPORT_ID_3
#define HID_REPORT_ID_3
Definition: audio_hid_desc.h:225
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
usb hid descriptor
Definition: audio_hid_desc.c:527
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: custom_hid_class.c:289
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: custom_hid_class.c:274
hid_set_idle
static uint32_t hid_set_idle
Definition: custom_hid_class.c:60
g_txhid_buff
static uint8_t g_txhid_buff[0x40]
Definition: custom_hid_class.c:56
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: custom_hid_class.c:126
hid_set_report
uint8_t hid_set_report[64]
Definition: custom_hid_class.c:63
alt_setting
static uint32_t alt_setting
Definition: custom_hid_class.c:61
g_rxhid_buff
static uint8_t g_rxhid_buff[0x40]
Definition: custom_hid_class.c:55
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: custom_hid_class.c:199
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: custom_hid_class.c:321
hid_protocol
static uint32_t hid_protocol
Definition: custom_hid_class.c:59
usb_hid_buf_process
void usb_hid_buf_process(void *udev, uint8_t *report, uint16_t len)
usb device report function
Definition: custom_hid_class.c:339
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: custom_hid_class.c:235
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb custom hid endpoint
Definition: custom_hid_class.c:84
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: custom_hid_class.c:213
custom_hid_class_handler
usbd_class_handler custom_hid_class_handler
Definition: custom_hid_class.c:66
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: custom_hid_class.c:252
hid_state
static uint8_t hid_state
Definition: custom_hid_class.c:62
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: custom_hid_class.c:106
EPT_INT_TYPE
@ EPT_INT_TYPE
Definition: at32f415_usb.h:349
MIN
#define MIN(a, b)
min and max define
Definition: usb_std.h:204
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
USB_STD_REQ_GET_DESCRIPTOR
#define USB_STD_REQ_GET_DESCRIPTOR
Definition: usb_std.h:81
USB_STD_REQ_SET_INTERFACE
#define USB_STD_REQ_SET_INTERFACE
Definition: usb_std.h:86
USB_REQ_TYPE_RESERVED
#define USB_REQ_TYPE_RESERVED
Definition: usb_std.h:66
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_STD_REQ_GET_INTERFACE
#define USB_STD_REQ_GET_INTERFACE
Definition: usb_std.h:85
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usb_std.h:64
USB_CONN_STATE_CONFIGURED
@ USB_CONN_STATE_CONFIGURED
Definition: usb_std.h:131
USB_OK
@ USB_OK
Definition: usb_std.h:218
usbd_connect_state_get
usbd_conn_state usbd_connect_state_get(usbd_core_type *udev)
get usb connect state
Definition: usbd_core.c:592
usbd_ept_close
void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint
Definition: usbd_core.c:341
usbd_ept_recv
void usbd_ept_recv(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint receive data
Definition: usbd_core.c:529
usbd_ept_open
void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint
Definition: usbd_core.c:309
usbd_ctrl_send
void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data
Definition: usbd_core.c:174
usbd_ept_send
void usbd_ept_send(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data
Definition: usbd_core.c:429
usbd_get_recv_len
uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length
Definition: usbd_core.c:295
usbd_ctrl_recv
void usbd_ctrl_recv(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint recv data
Definition: usbd_core.c:192
usbd_ctrl_unsupport
void usbd_ctrl_unsupport(usbd_core_type *udev)
un-support device request
Definition: usbd_core.c:282
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_setup_type::wValue
uint16_t wValue
Definition: usb_std.h:233
usb_setup_type::wLength
uint16_t wLength
Definition: usb_std.h:236
usb_setup_type::bmRequestType
uint8_t bmRequestType
Definition: usb_std.h:231
usb_setup_type::bRequest
uint8_t bRequest
Definition: usb_std.h:232
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: custom_hid_class.h Source File

  • middlewares
  • usbd_class
  • custom_hid
custom_hid_class.h
Go to the documentation of this file.
1
27 /* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __CUSTOM_HID_CLASS_H
29#define __CUSTOM_HID_CLASS_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "usb_std.h"
36#include "usbd_core.h"
37
53#define USBD_HID_IN_EPT 0x81
54#define USBD_HID_OUT_EPT 0x01
55
59#define USBD_IN_MAXPACKET_SIZE 0x40
60#define USBD_OUT_MAXPACKET_SIZE 0x40
61
73#define HID_REQ_SET_PROTOCOL 0x0B
74#define HID_REQ_GET_PROTOCOL 0x03
75#define HID_REQ_SET_IDLE 0x0A
76#define HID_REQ_GET_IDLE 0x02
77#define HID_REQ_SET_REPORT 0x09
78#define HID_REQ_GET_REPORT 0x01
79#define HID_DESCRIPTOR_TYPE 0x21
80#define HID_REPORT_DESC 0x22
81
89extern usbd_class_handler custom_hid_class_handler;
90 usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len);
101#ifdef __cplusplus
102}
103#endif
104
105#endif
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: audio_hid_class.c:818
custom_hid_class_handler
usbd_class_handler custom_hid_class_handler
Definition: custom_hid_class.c:66
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
usb_std.h
usb standard header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: custom_hid_desc.c Source File

  • middlewares
  • usbd_class
  • custom_hid
custom_hid_desc.c
Go to the documentation of this file.
1
26#include "usb_std.h"
27#include "usbd_sdr.h"
28#include "usbd_core.h"
29#include "custom_hid_desc.h"
30
44usbd_desc_t *get_device_descriptor(void);
45usbd_desc_t *get_device_qualifier(void);
46usbd_desc_t *get_device_configuration(void);
47usbd_desc_t *get_device_other_speed(void);
48usbd_desc_t *get_device_lang_id(void);
49usbd_desc_t *get_device_manufacturer_string(void);
50usbd_desc_t *get_device_product_string(void);
51usbd_desc_t *get_device_serial_string(void);
52usbd_desc_t *get_device_interface_string(void);
53usbd_desc_t *get_device_config_string(void);
54
55uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf);
56static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len);
57static void get_serial_num(void);
58static uint8_t g_usbd_desc_buffer[256];
59
63usbd_desc_handler hid_desc_handler =
64{
65 get_device_descriptor,
66 get_device_qualifier,
67 get_device_configuration,
68 get_device_other_speed,
69 get_device_lang_id,
70 get_device_manufacturer_string,
71 get_device_product_string,
72 get_device_serial_string,
73 get_device_interface_string,
74 get_device_config_string,
75};
76
80#if defined ( __ICCARM__ ) /* iar compiler */
81 #pragma data_alignment=4
82#endif
83ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL =
84{
85 USB_DEVICE_DESC_LEN, /* bLength */
86 USB_DESCIPTOR_TYPE_DEVICE, /* bDescriptorType */
87 0x00, /* bcdUSB */
88 0x02,
89 0x00, /* bDeviceClass */
90 0x00, /* bDeviceSubClass */
91 0x00, /* bDeviceProtocol */
92 USB_MAX_EP0_SIZE, /* bMaxPacketSize */
93 LBYTE(USBD_VENDOR_ID), /* idVendor */
94 HBYTE(USBD_VENDOR_ID), /* idVendor */
95 LBYTE(USBD_PRODUCT_ID), /* idProduct */
96 HBYTE(USBD_PRODUCT_ID), /* idProduct */
97 0x00, /* bcdDevice rel. 2.00 */
98 0x02,
99 USB_MFC_STRING, /* Index of manufacturer string */
100 USB_PRODUCT_STRING, /* Index of product string */
101 USB_SERIAL_STRING, /* Index of serial number string */
102 1 /* bNumConfigurations */
103};
104
108#if defined ( __ICCARM__ ) /* iar compiler */
109 #pragma data_alignment=4
110#endif
111ALIGNED_HEAD uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE] ALIGNED_TAIL =
112{
113 USB_DEVICE_CFG_DESC_LEN, /* bLength: configuration descriptor size */
114 USB_DESCIPTOR_TYPE_CONFIGURATION, /* bDescriptorType: configuration */
115 LBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
116 HBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
117 0x01, /* bNumInterfaces: 1 interface */
118 0x01, /* bConfigurationValue: configuration value */
119 0x00, /* iConfiguration: index of string descriptor describing
120 the configuration */
121 0xE0, /* bmAttributes: self powered and support remote wakeup */
122 0x32, /* MaxPower 100 mA: this current is used for detecting vbus */
123
124 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
125 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
126 0x00, /* bInterfaceNumber: number of interface */
127 0x00, /* bAlternateSetting: alternate set */
128 0x02, /* bNumEndpoints: number of endpoints */
129 USB_CLASS_CODE_HID, /* bInterfaceClass: class code hid */
130 0x00, /* bInterfaceSubClass: subclass code */
131 0x00, /* bInterfaceProtocol: protocol code */
132 0x00, /* iInterface: index of string descriptor */
133
134 0x09, /* bLength: size of HID descriptor in bytes */
135 HID_CLASS_DESC_HID, /* bDescriptorType: HID descriptor type */
136 LBYTE(HID_BCD_NUM),
137 HBYTE(HID_BCD_NUM), /* bcdHID: HID class specification release number */
138 0x00, /* bCountryCode: hardware target conutry */
139 0x01, /* bNumDescriptors: number of HID class descriptor to follow */
140 HID_CLASS_DESC_REPORT, /* bDescriptorType: report descriptor type */
141 LBYTE(sizeof(g_usbd_hid_report)),
142 HBYTE(sizeof(g_usbd_hid_report)), /* wDescriptorLength: total length of reprot descriptor */
143
144 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
145 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
146 USBD_HID_IN_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
147 USB_EPT_DESC_INTERRUPT, /* bmAttributes: endpoint attributes */
148 LBYTE(USBD_IN_MAXPACKET_SIZE),
149 HBYTE(USBD_IN_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
150 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
151
152 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
153 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
154 USBD_HID_OUT_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
155 USB_EPT_DESC_INTERRUPT, /* bmAttributes: endpoint attributes */
156 LBYTE(USBD_OUT_MAXPACKET_SIZE),
157 HBYTE(USBD_OUT_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
158 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
159};
160
164#if defined ( __ICCARM__ ) /* iar compiler */
165 #pragma data_alignment=4
166#endif
167ALIGNED_HEAD uint8_t g_usbd_hid_report[USBD_HID_SIZ_REPORT_DESC] ALIGNED_TAIL =
168{
169 0x06, 0xFF, 0x00, /* USAGE_PAGE(Vendor Page:0xFF00) */
170 0x09, 0x01, /* USAGE (Demo Kit) */
171 0xa1, 0x01, /* COLLECTION (Application) */
172 /* 7 */
173
174 /* Led 2 */
175 0x85, HID_REPORT_ID_2, /* REPORT_ID 2 */
176 0x09, 0x02, /* USAGE (LED 2) */
177 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
178 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
179 0x75, 0x08, /* REPORT_SIZE (8) */
180 0x95, 0x3F, /* REPORT_COUNT (1) */
181 0xB1, 0x82, /* FEATURE (Data,Var,Abs,Vol) */
182
183 0x85, 0x02, /* REPORT_ID (2) */
184 0x09, 0x02, /* USAGE (LED 2) */
185 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */
186 /* 27 */
187
188 /* Led 3 */
189 0x85, HID_REPORT_ID_3, /* REPORT_ID (3) */
190 0x09, 0x03, /* USAGE (LED 3) */
191 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
192 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
193 0x75, 0x08, /* REPORT_SIZE (8) */
194 0x95, 0x3F, /* REPORT_COUNT (1) */
195 0xB1, 0x82, /* FEATURE (Data,Var,Abs,Vol) */
196
197 0x85, 0x03, /* REPORT_ID (3) */
198 0x09, 0x03, /* USAGE (LED 3) */
199 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */
200 /* 47 */
201
202 /* Led 4 */
203 0x85, HID_REPORT_ID_4, /* REPORT_ID 4) */
204 0x09, 0x04, /* USAGE (LED 4) */
205 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
206 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
207 0x75, 0x08, /* REPORT_SIZE (8) */
208 0x95, 0x3F, /* REPORT_COUNT (1) */
209 0xB1, 0x82, /* FEATURE (Data,Var,Abs,Vol) */
210
211 0x85, 0x04, /* REPORT_ID (4) */
212 0x09, 0x04, /* USAGE (LED 4) */
213 0x91, 0x82, /* OUTPUT (Data,Var,Abs,Vol) */
214 /* 67 */
215
216 /* key Push Button */
217 0x85, HID_REPORT_ID_5, /* REPORT_ID (5) */
218 0x09, 0x05, /* USAGE (Push Button) */
219 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
220 0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
221 0x75, 0x01, /* REPORT_SIZE (1) */
222 0x81, 0x82, /* INPUT (Data,Var,Abs,Vol) */
223
224 0x09, 0x05, /* USAGE (Push Button) */
225 0x75, 0x01, /* REPORT_SIZE (1) */
226 0xb1, 0x82, /* FEATURE (Data,Var,Abs,Vol) */
227
228 0x75, 0x07, /* REPORT_SIZE (7) */
229 0x81, 0x83, /* INPUT (Cnst,Var,Abs,Vol) */
230 0x85, 0x05, /* REPORT_ID (5) */
231
232 0x75, 0x07, /* REPORT_SIZE (7) */
233 0xb1, 0x83, /* FEATURE (Cnst,Var,Abs,Vol) */
234 /* 95 */
235
236 /* Data OUT */
237 0x85, HID_REPORT_ID_6, /* REPORT_ID (0xF0) */
238 0x09, 0x06, /* USAGE */
239 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
240 0x26, 0x00,0xff, /* LOGICAL_MAXIMUM (255) */
241 0x75, 0x08, /* REPORT_SIZE (8) */
242 0x95, 0x3F, /* REPORT_COUNT (64) */
243 0x91, 0x02, /* OUTPUT(Data,Var,Abs,Vol) */
244 /* 110 */
245
246 /* Data IN */
247 0x85, HID_REPORT_ID_6, /* REPORT_ID (0xF0) */
248 0x09, 0x07, /* USAGE */
249 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
250 0x26, 0x00,0xff, /* LOGICAL_MAXIMUM (255) */
251 0x75, 0x08, /* REPORT_SIZE (8) */
252 0x95, 0x3F, /* REPORT_COUNT (64) */
253 0x81, 0x82, /* INPUT(Data,Var,Abs,Vol) */
254
255 /* 125 */
256 0xc0 /* END_COLLECTION */
257};
258
262#if defined ( __ICCARM__ ) /* iar compiler */
263 #pragma data_alignment=4
264#endif
265ALIGNED_HEAD uint8_t g_hid_usb_desc[9] ALIGNED_TAIL =
266{
267 0x09, /* bLength: size of HID descriptor in bytes */
268 HID_CLASS_DESC_HID, /* bDescriptorType: HID descriptor type */
269 LBYTE(HID_BCD_NUM),
270 HBYTE(HID_BCD_NUM), /* bcdHID: HID class specification release number */
271 0x00, /* bCountryCode: hardware target conutry */
272 0x01, /* bNumDescriptors: number of HID class descriptor to follow */
273 HID_CLASS_DESC_REPORT, /* bDescriptorType: report descriptor type */
274 LBYTE(sizeof(g_usbd_hid_report)),
275 HBYTE(sizeof(g_usbd_hid_report)), /* wDescriptorLength: total length of reprot descriptor */
276};
277
278
282#if defined ( __ICCARM__ ) /* iar compiler */
283 #pragma data_alignment=4
284#endif
285ALIGNED_HEAD uint8_t g_string_lang_id[USBD_SIZ_STRING_LANGID] ALIGNED_TAIL =
286{
287 USBD_SIZ_STRING_LANGID,
288 USB_DESCIPTOR_TYPE_STRING,
289 0x09,
290 0x04,
291};
292
296#if defined ( __ICCARM__ ) /* iar compiler */
297 #pragma data_alignment=4
298#endif
299ALIGNED_HEAD uint8_t g_string_serial[USBD_SIZ_STRING_SERIAL] ALIGNED_TAIL =
300{
301 USBD_SIZ_STRING_SERIAL,
302 USB_DESCIPTOR_TYPE_STRING,
303};
304
305
306/* device descriptor */
307usbd_desc_t device_descriptor =
308{
309 USB_DEVICE_DESC_LEN,
310 g_usbd_descriptor
311};
312
313/* config descriptor */
314usbd_desc_t config_descriptor =
315{
316 USBD_CONFIG_DESC_SIZE,
317 g_usbd_configuration
318};
319
320/* langid descriptor */
321usbd_desc_t langid_descriptor =
322{
323 USBD_SIZ_STRING_LANGID,
324 g_string_lang_id
325};
326
327/* serial descriptor */
328usbd_desc_t serial_descriptor =
329{
330 USBD_SIZ_STRING_SERIAL,
331 g_string_serial
332};
333
334usbd_desc_t vp_desc;
335
342uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
343{
344 uint16_t str_len = 0, id_pos = 2;
345 uint8_t *tmp_str = string;
346
347 while(*tmp_str != '\0')
348 {
349 str_len ++;
350 unicode_buf[id_pos ++] = *tmp_str ++;
351 unicode_buf[id_pos ++] = 0x00;
352 }
353
354 str_len = str_len * 2 + 2;
355 unicode_buf[0] = str_len;
356 unicode_buf[1] = USB_DESCIPTOR_TYPE_STRING;
357
358 return str_len;
359}
360
368static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len)
369{
370 uint8_t idx = 0;
371
372 for( idx = 0 ; idx < len ; idx ++)
373 {
374 if( ((value >> 28)) < 0xA )
375 {
376 pbuf[ 2 * idx] = (value >> 28) + '0';
377 }
378 else
379 {
380 pbuf[2 * idx] = (value >> 28) + 'A' - 10;
381 }
382
383 value = value << 4;
384
385 pbuf[2 * idx + 1] = 0;
386 }
387}
388
394static void get_serial_num(void)
395{
396 uint32_t serial0, serial1, serial2;
397
398 serial0 = *(uint32_t*)MCU_ID1;
399 serial1 = *(uint32_t*)MCU_ID2;
400 serial2 = *(uint32_t*)MCU_ID3;
401
402 serial0 += serial2;
403
404 if (serial0 != 0)
405 {
406 usbd_int_to_unicode (serial0, &g_string_serial[2] ,8);
407 usbd_int_to_unicode (serial1, &g_string_serial[18] ,4);
408 }
409}
410
416usbd_desc_t *get_device_descriptor(void)
417{
418 return &device_descriptor;
419}
420
426usbd_desc_t * get_device_qualifier(void)
427{
428 return NULL;
429}
430
436usbd_desc_t *get_device_configuration(void)
437{
438 return &config_descriptor;
439}
440
446usbd_desc_t *get_device_other_speed(void)
447{
448 return NULL;
449}
450
456usbd_desc_t *get_device_lang_id(void)
457{
458 return &langid_descriptor;
459}
460
461
467usbd_desc_t *get_device_manufacturer_string(void)
468{
469 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_MANUFACTURER_STRING, g_usbd_desc_buffer);
470 vp_desc.descriptor = g_usbd_desc_buffer;
471 return &vp_desc;
472}
473
479usbd_desc_t *get_device_product_string(void)
480{
481 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_PRODUCT_STRING, g_usbd_desc_buffer);
482 vp_desc.descriptor = g_usbd_desc_buffer;
483 return &vp_desc;
484}
485
491usbd_desc_t *get_device_serial_string(void)
492{
493 get_serial_num();
494 return &serial_descriptor;
495}
496
502usbd_desc_t *get_device_interface_string(void)
503{
504 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_INTERFACE_STRING, g_usbd_desc_buffer);
505 vp_desc.descriptor = g_usbd_desc_buffer;
506 return &vp_desc;
507}
508
514usbd_desc_t *get_device_config_string(void)
515{
516 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_CONFIGURATION_STRING, g_usbd_desc_buffer);
517 vp_desc.descriptor = g_usbd_desc_buffer;
518 return &vp_desc;
519}
520
custom_hid_desc.h
usb custom hid descriptor header file
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
USBD_DESC_CONFIGURATION_STRING
#define USBD_DESC_CONFIGURATION_STRING
Definition: audio_desc.h:61
USBD_SIZ_STRING_SERIAL
#define USBD_SIZ_STRING_SERIAL
Definition: audio_desc.h:57
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112
USBD_DESC_PRODUCT_STRING
#define USBD_DESC_PRODUCT_STRING
Definition: audio_desc.h:60
HID_BINTERVAL_TIME
#define HID_BINTERVAL_TIME
Definition: audio_desc.h:205
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: audio_desc.h:208
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
USBD_SIZ_STRING_LANGID
#define USBD_SIZ_STRING_LANGID
Definition: audio_desc.h:56
MCU_ID1
#define MCU_ID1
Definition: audio_desc.h:215
USBD_DESC_MANUFACTURER_STRING
#define USBD_DESC_MANUFACTURER_STRING
Definition: audio_desc.h:59
USBD_PRODUCT_ID
#define USBD_PRODUCT_ID
Definition: audio_desc.h:54
USBD_DESC_INTERFACE_STRING
#define USBD_DESC_INTERFACE_STRING
Definition: audio_desc.h:62
MCU_ID2
#define MCU_ID2
Definition: audio_desc.h:216
USBD_VENDOR_ID
#define USBD_VENDOR_ID
Definition: audio_desc.h:53
MCU_ID3
#define MCU_ID3
Definition: audio_desc.h:217
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
USBD_HID_OUT_EPT
#define USBD_HID_OUT_EPT
Definition: audio_hid_class.h:62
USBD_HID_IN_EPT
#define USBD_HID_IN_EPT
usb custom hid use endpoint define
Definition: audio_hid_class.h:61
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
HID_REPORT_ID_2
#define HID_REPORT_ID_2
Definition: audio_hid_desc.h:224
HID_REPORT_ID_4
#define HID_REPORT_ID_4
Definition: audio_hid_desc.h:226
HID_CLASS_DESC_HID
#define HID_CLASS_DESC_HID
usb hid class descriptor define
Definition: audio_hid_desc.h:216
HID_CLASS_DESC_REPORT
#define HID_CLASS_DESC_REPORT
Definition: audio_hid_desc.h:217
HID_REPORT_ID_6
#define HID_REPORT_ID_6
Definition: audio_hid_desc.h:228
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: audio_hid_desc.h:236
HID_REPORT_ID_3
#define HID_REPORT_ID_3
Definition: audio_hid_desc.h:225
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
usb hid descriptor
Definition: audio_hid_desc.c:527
HID_BCD_NUM
#define HID_BCD_NUM
usb bcd number define
Definition: audio_hid_desc.h:211
HID_REPORT_ID_5
#define HID_REPORT_ID_5
Definition: audio_hid_desc.h:227
serial_descriptor
usbd_desc_t serial_descriptor
Definition: custom_hid_desc.c:328
device_descriptor
usbd_desc_t device_descriptor
Definition: custom_hid_desc.c:307
usbd_unicode_convert
uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert
Definition: custom_hid_desc.c:342
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: custom_hid_desc.c:467
langid_descriptor
usbd_desc_t langid_descriptor
Definition: custom_hid_desc.c:321
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: custom_hid_desc.c:426
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: custom_hid_desc.c:502
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: custom_hid_desc.c:446
g_usbd_desc_buffer
static uint8_t g_usbd_desc_buffer[256]
Definition: custom_hid_desc.c:58
vp_desc
usbd_desc_t vp_desc
Definition: custom_hid_desc.c:334
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: custom_hid_desc.c:436
ALIGNED_TAIL
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL
usb device standard descriptor
Definition: custom_hid_desc.c:83
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: custom_hid_desc.c:479
hid_desc_handler
usbd_desc_handler hid_desc_handler
custom hid device descriptor handler structure
Definition: custom_hid_desc.c:63
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: custom_hid_desc.c:456
get_serial_num
static void get_serial_num(void)
usb get serial number
Definition: custom_hid_desc.c:394
config_descriptor
usbd_desc_t config_descriptor
Definition: custom_hid_desc.c:314
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: custom_hid_desc.c:416
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: custom_hid_desc.c:491
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: custom_hid_desc.c:514
usbd_int_to_unicode
static void usbd_int_to_unicode(uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode
Definition: custom_hid_desc.c:368
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_DEVICE_EPT_LEN
#define USB_DEVICE_EPT_LEN
Definition: usb_std.h:153
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
USB_DESCIPTOR_TYPE_CONFIGURATION
#define USB_DESCIPTOR_TYPE_CONFIGURATION
Definition: usb_std.h:93
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DESCIPTOR_TYPE_ENDPOINT
#define USB_DESCIPTOR_TYPE_ENDPOINT
Definition: usb_std.h:96
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_DEVICE_IF_DESC_LEN
#define USB_DEVICE_IF_DESC_LEN
Definition: usb_std.h:152
USB_DEVICE_CFG_DESC_LEN
#define USB_DEVICE_CFG_DESC_LEN
Definition: usb_std.h:151
USB_EPT_DESC_INTERRUPT
#define USB_EPT_DESC_INTERRUPT
Definition: usb_std.h:178
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92
USB_DESCIPTOR_TYPE_STRING
#define USB_DESCIPTOR_TYPE_STRING
Definition: usb_std.h:94
USB_DESCIPTOR_TYPE_INTERFACE
#define USB_DESCIPTOR_TYPE_INTERFACE
Definition: usb_std.h:95
USB_CLASS_CODE_HID
#define USB_CLASS_CODE_HID
Definition: usb_std.h:163
usb_std.h
usb standard header file
usbd_core.h
usb device core header file
usbd_sdr.h


AT32F415 Firmwary Library: custom_hid_desc.h Source File

  • middlewares
  • usbd_class
  • custom_hid
custom_hid_desc.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __CUSTOM_HID_DESC_H
29#define __CUSTOM_HID_DESC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "custom_hid_class.h"
36#include "usbd_core.h"
37
53#define HID_BCD_NUM 0x0110
54
58#define HID_CLASS_DESC_HID 0x21
59#define HID_CLASS_DESC_REPORT 0x22
60#define HID_CLASS_DESC_PHYSICAL 0x23
61
65#define USBD_VENDOR_ID 0x2E3C
66#define USBD_PRODUCT_ID 0x5745
67
71#define USBD_CONFIG_DESC_SIZE 41
72#define USBD_HID_SIZ_REPORT_DESC 126
73#define USBD_SIZ_STRING_LANGID 4
74#define USBD_SIZ_STRING_SERIAL 0x1A
75
79#define USBD_DESC_MANUFACTURER_STRING "Artery"
80#define USBD_DESC_PRODUCT_STRING "Custom HID"
81#define USBD_DESC_CONFIGURATION_STRING "Custom HID Config"
82#define USBD_DESC_INTERFACE_STRING "Custom HID Interface"
83
87#define HID_BINTERVAL_TIME 0x0A
88
92#define HID_REPORT_ID_1 0x01
93#define HID_REPORT_ID_2 0x02
94#define HID_REPORT_ID_3 0x03
95#define HID_REPORT_ID_4 0x04
96#define HID_REPORT_ID_5 0x05
97#define HID_REPORT_ID_6 0xF0
98
102#define MCU_ID1 (0x1FFFF7E8)
103#define MCU_ID2 (0x1FFFF7EC)
104#define MCU_ID3 (0x1FFFF7F0)
105
110extern uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN];
111extern uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE];
112extern uint8_t g_usbd_hid_report[USBD_HID_SIZ_REPORT_DESC];
113extern uint8_t g_hid_usb_desc[9];
114extern usbd_desc_handler hid_desc_handler;
115
123#ifdef __cplusplus
124}
125#endif
126
127#endif
128
129
custom_hid_class.h
usb hid header file
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
usb descriptor size define
Definition: custom_hid_desc.h:71
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: custom_hid_desc.h:72
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
hid_desc_handler
usbd_desc_handler hid_desc_handler
custom hid device descriptor handler structure
Definition: custom_hid_desc.c:63
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
g_usbd_configuration
uint8_t g_usbd_configuration[41]
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: hang_mode Directory Reference

  • tmr
  • hang_mode
hang_mode Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • gpio
  • swjtag_remap
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/gpio/swjtag_remap/src/main.c [code]
main program


AT32F415 Firmwary Library: standby_ertc_alarm Directory Reference

  • pwc
  • standby_ertc_alarm
standby_ertc_alarm Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • 7_pwm_output
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: power_voltage_monitor Directory Reference

  • pwc
  • power_voltage_monitor
power_voltage_monitor Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: i2c_application_library Directory Reference

  • middlewares
  • i2c_application_library
i2c_application_library Directory Reference

Files

file | i2c_application.c [code]
the driver library of the i2c peripheral
file | i2c_application.h [code]
i2c application libray header file


AT32F415 Firmwary Library: inc Directory Reference

  • usb_device
  • composite_audio_hid
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | composite_audio_hid/inc/audio_codec.h [code]
audio codec header file
file | project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h [code]
usb config header file


AT32F415 Firmwary Library: inc Directory Reference

  • usart
  • receiver_mute
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: templates Directory Reference

  • templates
templates Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • cortex_m4
  • systick_interrupt
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • templates
  • src
src Directory Reference

Files

file | project/at_start_f415/templates/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/templates/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/templates/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • utilities
  • at32f415_gen_random_number_demo
  • src
src Directory Reference

Files

file | utilities/at32f415_gen_random_number_demo/src/at32f415_clock.c [code]
system clock config program
file | utilities/at32f415_gen_random_number_demo/src/at32f415_int.c [code]
main interrupt service routines.
file | utilities/at32f415_gen_random_number_demo/src/main.c [code]
main program
file | random.c [code]
set of firmware functions to random function


AT32F415 Firmwary Library: src Directory Reference

  • i2s
  • halfduplex_dma
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • inc
inc Directory Reference

Files

file | utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h [code]
header file of clock program
file | utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h [code]
at32f415 config header file
file | utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | app_led4_toggle/inc/hid_iap_user.h [code]
usb config header file
file | utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h [code]
usb config header file


AT32F415 Firmwary Library: inc Directory Reference

  • dma
  • flash_to_sram
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: usb_device Directory Reference

  • usb_device
usb_device Directory Reference

Directories

directory | audio
directory | composite_audio_hid
directory | composite_vcp_keyboard
directory | custom_hid
directory | keyboard
directory | mouse
directory | msc
directory | printer
directory | vcp_loopback
directory | virtual_msc_iap


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • dma_burst
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/dma_burst/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/dma_burst/src/main.c [code]
main program


AT32F415 Firmwary Library: hid_demo Directory Reference

  • usb_host
  • hid_demo
hid_demo Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • can
  • loopback_mode
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/can/loopback_mode/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: software_trigger_repeat Directory Reference

  • adc
  • software_trigger_repeat
software_trigger_repeat Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • usb_device
  • custom_hid
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h [code]
usb config header file


AT32F415 Firmwary Library: src Directory Reference

  • usb_device
  • keyboard
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usb_device/keyboard/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usb_device/keyboard/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • usb_device
  • mouse
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usb_device/mouse/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usb_device/mouse/src/main.c [code]
main program


AT32F415 Firmwary Library: source_code Directory Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
source_code Directory Reference

Directories

directory | app_led3_toggle
directory | app_led4_toggle
directory | bootloader


AT32F415 Firmwary Library: dma_burst Directory Reference

  • tmr
  • dma_burst
dma_burst Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • debug
  • tmr1
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/debug/tmr1/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/debug/tmr1/src/main.c [code]
main program


AT32F415 Firmwary Library: usb_drivers Directory Reference

  • middlewares
  • usb_drivers
usb_drivers Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: exint_trigger_partitioned Directory Reference

  • adc
  • exint_trigger_partitioned
exint_trigger_partitioned Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: data_to_gpio_flexible Directory Reference

  • dma
  • data_to_gpio_flexible
data_to_gpio_flexible Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: virtual_msc_iap Directory Reference

  • usb_device
  • virtual_msc_iap
virtual_msc_iap Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: parallel_synchro Directory Reference

  • tmr
  • parallel_synchro
parallel_synchro Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: timer_base Directory Reference

  • tmr
  • timer_base
timer_base Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: crm Directory Reference

  • crm
crm Directory Reference

Directories

directory | clock_failure_detection
directory | pll_config2
directory | sysclk_switch


AT32F415 Firmwary Library: tmr2_32bit Directory Reference

  • tmr
  • tmr2_32bit
tmr2_32bit Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: pwm_output_simulate Directory Reference

  • tmr
  • pwm_output_simulate
pwm_output_simulate Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: communication_dma Directory Reference

  • i2c
  • communication_dma
communication_dma Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • pwm_output_simulate
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • cmp
  • deep_sleep_mode
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • encoder_tmr2
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • usart
  • synchronous
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usart/synchronous/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • spi
  • halfduplex_interrupt
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • pwm_output_tmr3
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: spi Directory Reference

  • spi
spi Directory Reference

Directories

directory | crc_transfer_polling
directory | fullduplex_polling
directory | halfduplex_interrupt
directory | halfduplex_transceiver_switch
directory | only_receive_mode_polling
directory | use_jtagpin_hardwarecs_dma
directory | w25q_flash


AT32F415 Firmwary Library: sleep_tmr2 Directory Reference

  • pwc
  • sleep_tmr2
sleep_tmr2 Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • middlewares
  • usb_drivers
  • src
src Directory Reference

Files

file | usb_core.c [code]
usb driver
file | usbd_core.c [code]
usb device driver
file | usbd_int.c [code]
usb interrupt request
file | usbd_sdr.c [code]
usb standard device request
file | usbh_core.c [code]
usb host driver
file | usbh_ctrl.c [code]
usb host control request
file | usbh_int.c [code]
usb host interrupt request


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • external_clock
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/external_clock/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/external_clock/src/main.c [code]
main program


AT32F415 Firmwary Library: bootloader Directory Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
bootloader Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • wdt
  • wdt_reset
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: middlewares Directory Reference

  • middlewares
middlewares Directory Reference

Directories

directory | i2c_application_library
directory | usb_drivers
directory | usbd_class
directory | usbh_class


AT32F415 Firmwary Library: 6_steps Directory Reference

  • tmr
  • 6_steps
6_steps Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: synchronous Directory Reference

  • usart
  • synchronous
synchronous Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: composite_cdc_keyboard Directory Reference

  • middlewares
  • usbd_class
  • composite_cdc_keyboard
composite_cdc_keyboard Directory Reference

Files

file | cdc_keyboard_class.c [code]
usb cdc and keyboard class type
file | cdc_keyboard_class.h [code]
usb cdc and keyboard class file
file | cdc_keyboard_desc.c [code]
usb cdc and keyboard device descriptor
file | cdc_keyboard_desc.h [code]
usb cdc and keyboard descriptor header file


AT32F415 Firmwary Library: inc Directory Reference

  • crm
  • pll_config2
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/crm/pll_config2/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • can
  • communication_mode
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/can/communication_mode/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • inc
inc Directory Reference

Files

file | utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_clock.h [code]
header file of clock program
file | utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h [code]
at32f415 config header file
file | utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: pwm_output_tmr3 Directory Reference

  • tmr
  • pwm_output_tmr3
pwm_output_tmr3 Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: vcp_loopback Directory Reference

  • usb_device
  • vcp_loopback
vcp_loopback Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • usb_host
  • msc_only_fat32
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c [code]
main program
file | usbh_msc_diskio.c [code]
usb mass storage disk io
file | msc_only_fat32/src/usbh_user.c [code]
usb user function


AT32F415 Firmwary Library: app_led4_toggle Directory Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
app_led4_toggle Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • usb_device
  • mouse
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usb_device/mouse/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h [code]
usb config header file


AT32F415 Firmwary Library: half_duplex Directory Reference

  • usart
  • half_duplex
half_duplex Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: run_in_boot_memory Directory Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
run_in_boot_memory Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: calendar Directory Reference

  • ertc
  • calendar
calendar Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • pwm_output_tmr10
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • ertc
  • tamper
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/ertc/tamper/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • usb_device
  • printer
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usb_device/printer/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h [code]
usb config header file


AT32F415 Firmwary Library: current_vref_value_check Directory Reference

  • adc
  • current_vref_value_check
current_vref_value_check Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: msc_only_fat32 Directory Reference

  • usb_host
  • msc_only_fat32
msc_only_fat32 Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: communication_mode Directory Reference

  • can
  • communication_mode
communication_mode Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: read_write_boot_memory Directory Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
read_write_boot_memory Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • crc
  • calculation
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/crc/calculation/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/crc/calculation/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/crc/calculation/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • pwc
  • deepsleep_ertc_tamper
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: one_cycle Directory Reference

  • tmr
  • one_cycle
one_cycle Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: hall_xor_tmr2 Directory Reference

  • tmr
  • hall_xor_tmr2
hall_xor_tmr2 Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • cascade_synchro
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/cascade_synchro/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • encoder_tmr2
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • src
src Directory Reference

Files

file | utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c [code]
system clock config program
file | utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c [code]
main interrupt service routines.
file | app_led4_toggle/src/hid_iap_user.c [code]
usb hid iap user file
file | utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • usart
  • smartcard
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usart/smartcard/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usart/smartcard/src/main.c [code]
main program


AT32F415 Firmwary Library: audio_hid Directory Reference

  • middlewares
  • usbd_class
  • audio_hid
audio_hid Directory Reference

Files

file | audio_hid/audio_conf.h [code]
usb audio config
file | audio_hid_class.c [code]
file | audio_hid_class.h [code]
file | audio_hid_desc.c [code]
file | audio_hid_desc.h [code]


AT32F415 Firmwary Library: cdc Directory Reference

  • middlewares
  • usbd_class
  • cdc
cdc Directory Reference

Files

file | cdc_class.c [code]
usb cdc class type
file | cdc_class.h [code]
usb cdc class file
file | cdc_desc.c [code]
usb cdc device descriptor
file | cdc_desc.h [code]
usb cdc descriptor header file


AT32F415 Firmwary Library: adc Directory Reference

  • adc
adc Directory Reference

Directories

directory | current_vref_value_check
directory | exint_trigger_partitioned
directory | internal_temperature_sensor
directory | software_trigger_repeat
directory | tmr_trigger_automatic_preempted
directory | voltage_monitoring


AT32F415 Firmwary Library: inc Directory Reference

  • usart
  • polling
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usart/polling/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usart/polling/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • parallel_synchro
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: crc_transfer_polling Directory Reference

  • spi
  • crc_transfer_polling
crc_transfer_polling Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • ertc
  • lick_calibration
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: hw_flow_control Directory Reference

  • usart
  • hw_flow_control
hw_flow_control Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • cascade_synchro
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • usart
  • hw_flow_control
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usart/hw_flow_control/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • templates
  • inc
inc Directory Reference

Files

file | project/at_start_f415/templates/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/templates/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/templates/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: project Directory Reference

  • project
project Directory Reference

Directories

directory | at32f415_board
directory | at_start_f415


AT32F415 Firmwary Library: src Directory Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • src
src Directory Reference

Files

file | utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c [code]
system clock config program
file | utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c [code]
main interrupt service routines.
file | app_led4_toggle/src/iap.c [code]
iap program
file | utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/main.c [code]
main program
file | app_led4_toggle/src/tmr.c [code]
tmr program
file | app_led4_toggle/src/usart.c [code]
usart program


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • dma
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/dma/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/dma/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/dma/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • spi
  • crc_transfer_polling
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • flash
  • flash_write_read
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | project/at_start_f415/examples/flash/flash_write_read/inc/flash.h [code]
flash header file


AT32F415 Firmwary Library: inc Directory Reference

  • i2c
  • communication_dma
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: calculation Directory Reference

  • crc
  • calculation
calculation Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • ertc
  • bpr_domain
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • oc_high
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/oc_high/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/oc_high/src/main.c [code]
main program


AT32F415 Firmwary Library: source_code Directory Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
source_code Directory Reference

Directories

directory | app_led3_toggle
directory | app_led4_toggle
directory | bootloader


AT32F415 Firmwary Library: libraries Directory Reference

  • libraries
libraries Directory Reference

Directories

directory | cmsis
directory | drivers


AT32F415 Firmwary Library: src Directory Reference

  • adc
  • tmr_trigger_automatic_preempted
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c [code]
main program


AT32F415 Firmwary Library: mouse Directory Reference

  • usb_device
  • mouse
mouse Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: device_support Directory Reference

  • libraries
  • cmsis
  • cm4
  • device_support
device_support Directory Reference

Files

file | at32f415.h [code]
at32f415 header file
file | system_at32f415.c [code]
contains all the functions for cmsis cortex-m4 system source file
file | system_at32f415.h [code]
cmsis cortex-m4 system header file.


AT32F415 Firmwary Library: inc Directory Reference

  • pwc
  • power_voltage_monitor
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • dma
  • flash_to_sram
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/dma/flash_to_sram/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • adc
  • current_vref_value_check
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: bootloader Directory Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
bootloader Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • i2c
  • eeprom
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/i2c/eeprom/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/i2c/eeprom/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • utilities
  • at32f415_slib_demo
  • project_l1
  • inc
inc Directory Reference

Files

file | utilities/at32f415_slib_demo/project_l1/inc/at32f415_clock.h [code]
header file of clock program
file | utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h [code]
at32f415 config header file
file | utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | project_l1/inc/fir_filter.h [code]
file | project_l1/inc/math_helper.h [code]


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • oc_low
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/oc_low/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • ertc
  • bpr_domain
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/ertc/bpr_domain/src/main.c [code]
main program


AT32F415 Firmwary Library: encoder_tmr2 Directory Reference

  • tmr
  • encoder_tmr2
encoder_tmr2 Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: flash_to_sram Directory Reference

  • dma
  • flash_to_sram
flash_to_sram Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • wwdt
  • wwdt_reset
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/wwdt/wwdt_reset/src/main.c [code]
main program


AT32F415 Firmwary Library: spii2s_switch_halfduplex_polling Directory Reference

  • i2s
  • spii2s_switch_halfduplex_polling
spii2s_switch_halfduplex_polling Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: sdio_fatfs Directory Reference

  • sdio
  • sdio_fatfs
sdio_fatfs Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • parallel_synchro
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/parallel_synchro/src/main.c [code]
main program


AT32F415 Firmwary Library: crc Directory Reference

  • crc
crc Directory Reference

Directories

directory calculation


AT32F415 Firmwary Library: inc Directory Reference

  • gpio
  • swjtag_remap
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • inc
inc Directory Reference

Files

file | utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h [code]
header file of clock program
file | utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h [code]
at32f415 config header file
file | utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | app_led4_toggle/inc/iap.h [code]
iap header file
file | app_led4_toggle/inc/tmr.h [code]
tmr header file
file | app_led4_toggle/inc/usart.h [code]
usart header file


AT32F415 Firmwary Library: app_led3_toggle Directory Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
app_led3_toggle Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • usart
  • hw_flow_control
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • pwc
  • power_voltage_monitor
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/pwc/power_voltage_monitor/src/main.c [code]
main program


AT32F415 Firmwary Library: time_stamp Directory Reference

  • ertc
  • time_stamp
time_stamp Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: flash_write_read Directory Reference

  • flash
  • flash_write_read
flash_write_read Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • spi
  • halfduplex_transceiver_switch
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • oc_low
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/oc_low/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/oc_low/src/main.c [code]
main program


AT32F415 Firmwary Library: deepsleep_ertc_alarm Directory Reference

  • pwc
  • deepsleep_ertc_alarm
deepsleep_ertc_alarm Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
src Directory Reference

Files

file | project_l0/src/arm_fir_data.c [code]
file | arm_fir_init_f32.c [code]
file | utilities/at32f415_slib_demo/project_l0/src/at32f415_clock.c [code]
system clock config program
file | utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c [code]
main interrupt service routines.
file | fir_coefficient.c [code]
file | fir_filter.c [code]
file | utilities/at32f415_slib_demo/project_l0/src/main.c [code]
main program
file | project_l0/src/math_helper.c [code]


AT32F415 Firmwary Library: usbh_class Directory Reference

  • middlewares
  • usbh_class
usbh_class Directory Reference

Directories

directory | usbh_hid
directory | usbh_msc


AT32F415 Firmwary Library: inc Directory Reference

  • usart
  • irda
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usart/irda/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usart/irda/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • cortex_m4
  • systick_interrupt
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • one_cycle
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/one_cycle/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/one_cycle/src/main.c [code]
main program


AT32F415 Firmwary Library: at32f415_boot_memory_ap_demo Directory Reference

  • utilities
  • at32f415_boot_memory_ap_demo
at32f415_boot_memory_ap_demo Directory Reference

Directories

directory | read_write_boot_memory
directory | run_in_boot_memory


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • 7_pwm_output
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/7_pwm_output/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • can
  • communication_mode
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/can/communication_mode/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/can/communication_mode/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • utilities
  • at32f415_gen_random_number_demo
  • inc
inc Directory Reference

Files

file | utilities/at32f415_gen_random_number_demo/inc/at32f415_clock.h [code]
header file of clock program
file | utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h [code]
at32f415 config header file
file | utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | random.h [code]
at32f415 random header file


AT32F415 Firmwary Library: src Directory Reference

  • usb_device
  • composite_audio_hid
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c [code]
main interrupt service routines.
file | composite_audio_hid/src/audio_codec.c [code]
audio codec function
file | project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • usb_device
  • audio
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usb_device/audio/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | audio/inc/audio_codec.h [code]
audio codec header file
file | project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h [code]
usb config header file


AT32F415 Firmwary Library: custom_hid Directory Reference

  • usb_device
  • custom_hid
custom_hid Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: use_jtagpin_hardwarecs_dma Directory Reference

  • spi
  • use_jtagpin_hardwarecs_dma
use_jtagpin_hardwarecs_dma Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: project_l0 Directory Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
project_l0 Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: keyboard Directory Reference

  • usb_device
  • keyboard
keyboard Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • exint
  • exint_config
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/exint/exint_config/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/exint/exint_config/src/main.c [code]
main program


AT32F415 Firmwary Library: can Directory Reference

  • can
can Directory Reference

Directories

directory | communication_mode
directory | filter
directory | loopback_mode


AT32F415 Firmwary Library: src Directory Reference

  • usb_host
  • hid_demo
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usb_host/hid_demo/src/main.c [code]
main program
file | hid_demo/src/usbh_user.c [code]
usb user function


AT32F415 Firmwary Library: src Directory Reference

  • usart
  • idle_detection
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usart/idle_detection/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usart/idle_detection/src/main.c [code]
main program


AT32F415 Firmwary Library: cm4 Directory Reference

  • libraries
  • cmsis
  • cm4
cm4 Directory Reference

Directories

directory device_support


AT32F415 Firmwary Library: usart Directory Reference

  • usart
usart Directory Reference

Directories

directory | half_duplex
directory | hw_flow_control
directory | idle_detection
directory | interrupt
directory | irda
directory | polling
directory | printf
directory | receiver_mute
directory | smartcard
directory | synchronous
directory | transfer_by_dma_interrupt
directory | transfer_by_dma_polling


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • oc_toggle_tmr3
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • inc
inc Directory Reference

Files

file | utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h [code]
header file of clock program
file | utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h [code]
at32f415 config header file
file | utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | app_led3_toggle/inc/iap.h [code]
iap header file
file | app_led3_toggle/inc/tmr.h [code]
tmr header file
file | app_led3_toggle/inc/usart.h [code]
usart header file


AT32F415 Firmwary Library: sysclk_switch Directory Reference

  • crm
  • sysclk_switch
sysclk_switch Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • inc
inc Directory Reference

Files

file | utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_clock.h [code]
header file of clock program
file | utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h [code]
at32f415 config header file
file | utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | run_in_boot_memory.h [code]
run in boot memory file


AT32F415 Firmwary Library: src Directory Reference

  • exint
  • exint_software_trigger
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/exint/exint_software_trigger/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • crc
  • calculation
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/crc/calculation/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • i2c
  • communication_int
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/i2c/communication_int/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/i2c/communication_int/src/main.c [code]
main program


AT32F415 Firmwary Library: communication_int Directory Reference

  • i2c
  • communication_int
communication_int Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • pwc
  • standby_ertc_alarm
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • i2c
  • communication_dma
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/i2c/communication_dma/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/i2c/communication_dma/src/main.c [code]
main program


AT32F415 Firmwary Library: msc Directory Reference

  • usb_device
  • msc
msc Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • adc
  • internal_temperature_sensor
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • usart
  • receiver_mute
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usart/receiver_mute/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usart/receiver_mute/src/main.c [code]
main program


AT32F415 Firmwary Library: debug Directory Reference

  • debug
debug Directory Reference

Directories

directory tmr1


AT32F415 Firmwary Library: at32f415_usb_iap_demo Directory Reference

  • utilities
  • at32f415_usb_iap_demo
at32f415_usb_iap_demo Directory Reference

Directories

directory source_code


AT32F415 Firmwary Library: inc Directory Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • inc
inc Directory Reference

Files

file | utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_clock.h [code]
header file of clock program
file | utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h [code]
at32f415 config header file
file | utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | bootloader/inc/hid_iap_user.h [code]
usb config header file
file | utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h [code]
usb config header file


AT32F415 Firmwary Library: gpio Directory Reference

  • gpio
gpio Directory Reference

Directories

directory | led_toggle
directory | swjtag_remap


AT32F415 Firmwary Library: dma Directory Reference

  • tmr
  • dma
dma Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: oc_toggle_tmr9 Directory Reference

  • tmr
  • oc_toggle_tmr9
oc_toggle_tmr9 Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • i2s
  • spii2s_switch_halfduplex_polling
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • pwm_input_dma
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c [code]
main program


AT32F415 Firmwary Library: eeprom Directory Reference

  • i2c
  • eeprom
eeprom Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • src
src Directory Reference

Files

file | utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_clock.c [code]
system clock config program
file | utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c [code]
main interrupt service routines.
file | bootloader/src/hid_iap_user.c [code]
usb hid iap user file
file | utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • gpio
  • led_toggle
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: cmp Directory Reference

  • cmp
cmp Directory Reference

Directories

directory | deep_sleep_mode
directory | output


AT32F415 Firmwary Library: printer Directory Reference

  • usb_device
  • printer
printer Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
inc Directory Reference

Files

file | utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_clock.h [code]
header file of clock program
file | utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h [code]
at32f415 config header file
file | utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h [code]
flash header file
file | bootloader/inc/iap.h [code]
iap header file
file | bootloader/inc/tmr.h [code]
tmr header file
file | bootloader/inc/usart.h [code]
usart header file


AT32F415 Firmwary Library: external_clock Directory Reference

  • tmr
  • external_clock
external_clock Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • pwm_input
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: utilities Directory Reference

  • utilities
utilities Directory Reference

Directories

directory | at32f415_boot_memory_ap_demo
directory | at32f415_freertos_demo
directory | at32f415_gen_random_number_demo
directory | at32f415_slib_demo
directory | at32f415_usart_iap_demo
directory | at32f415_usb_iap_demo


AT32F415 Firmwary Library: inc Directory Reference

  • adc
  • tmr_trigger_automatic_preempted
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: dma Directory Reference

  • dma
dma Directory Reference

Directories

directory | data_to_gpio_flexible
directory | flash_to_sram


AT32F415 Firmwary Library: at32f415_freertos_demo Directory Reference

  • utilities
  • at32f415_freertos_demo
at32f415_freertos_demo Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • cmp
  • output
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/cmp/output/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/cmp/output/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • spi
  • fullduplex_polling
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • one_cycle
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • adc
  • current_vref_value_check
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/adc/current_vref_value_check/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • usart
  • half_duplex
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usart/half_duplex/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • usb_device
  • composite_vcp_keyboard
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h [code]
usb config header file


AT32F415 Firmwary Library: pwm_output_tmr10 Directory Reference

  • tmr
  • pwm_output_tmr10
pwm_output_tmr10 Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • utilities
  • at32f415_slib_demo
  • project_l0
  • inc
inc Directory Reference

Files

file | utilities/at32f415_slib_demo/project_l0/inc/at32f415_clock.h [code]
header file of clock program
file | utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h [code]
at32f415 config header file
file | utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | project_l0/inc/fir_filter.h [code]
file | project_l0/inc/math_helper.h [code]


AT32F415 Firmwary Library: inc Directory Reference

  • crm
  • sysclk_switch
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: tmr1_synchro Directory Reference

  • tmr
  • tmr1_synchro
tmr1_synchro Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • dma
  • data_to_gpio_flexible
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c [code]
main program


AT32F415 Firmwary Library: AT32F415_Firmware_Library Directory Reference

AT32F415_Firmware_Library Directory Reference

Directories

directory | libraries
directory | main_page
directory | middlewares
directory | project
directory | utilities


AT32F415 Firmwary Library: cortex_m4 Directory Reference

  • cortex_m4
cortex_m4 Directory Reference

Directories

directory | bit_band
directory | systick_interrupt


AT32F415 Firmwary Library: src Directory Reference

  • ertc
  • tamper
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/ertc/tamper/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/ertc/tamper/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • flash
  • flash_write_read
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/flash/flash_write_read/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/flash/flash_write_read/src/flash.c [code]
flash program
file | project/at_start_f415/examples/flash/flash_write_read/src/main.c [code]
main program


AT32F415 Firmwary Library: examples Directory Reference

examples Directory Reference

Directories

directory | adc
directory | can
directory | cmp
directory | cortex_m4
directory | crc
directory | crm
directory | debug
directory | dma
directory | ertc
directory | exint
directory | flash
directory | gpio
directory | i2c
directory | i2s
directory | pwc
directory | sdio
directory | spi
directory | tmr
directory | usart
directory | usb_device
directory | usb_host
directory | wdt
directory | wwdt


AT32F415 Firmwary Library: src Directory Reference

  • usart
  • transfer_by_dma_interrupt
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • i2c
  • communication_poll
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/i2c/communication_poll/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/i2c/communication_poll/src/main.c [code]
main program


AT32F415 Firmwary Library: complementary_signals Directory Reference

  • tmr
  • complementary_signals
complementary_signals Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: oc_toggle_tmr3 Directory Reference

  • tmr
  • oc_toggle_tmr3
oc_toggle_tmr3 Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: tmr_trigger_automatic_preempted Directory Reference

  • adc
  • tmr_trigger_automatic_preempted
tmr_trigger_automatic_preempted Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • i2c
  • eeprom
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/i2c/eeprom/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: halfduplex_transceiver_switch Directory Reference

  • spi
  • halfduplex_transceiver_switch
halfduplex_transceiver_switch Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • sdio
  • sdio_fatfs
  • inc
inc Directory Reference

Files

file | sdio_fatfs/inc/at32_sdio.h [code]
this file contains all the functions prototypes for the sd/mmc card at32_sdio driver firmware library.
file | project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | sdio/sdio_fatfs/inc/ffconf.h [code]


AT32F415 Firmwary Library: src Directory Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
src Directory Reference

Files

file | utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_clock.c [code]
system clock config program
file | utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c [code]
main interrupt service routines.
file | utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c [code]
flash program
file | bootloader/src/iap.c [code]
iap program
file | utilities/at32f415_usart_iap_demo/source_code/bootloader/src/main.c [code]
main program
file | bootloader/src/tmr.c [code]
tmr program
file | bootloader/src/usart.c [code]
usart program


AT32F415 Firmwary Library: src Directory Reference

  • wdt
  • wdt_reset
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/wdt/wdt_reset/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • complementary_signals
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/complementary_signals/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • 6_steps
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/6_steps/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/6_steps/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • exint
  • exint_config
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/exint/exint_config/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: printf Directory Reference

  • usart
  • printf
printf Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: keyboard Directory Reference

  • middlewares
  • usbd_class
  • keyboard
keyboard Directory Reference

Files

file | keyboard_class.c [code]
usb hid keyboard class type
file | keyboard_class.h [code]
usb hid keyboard header file
file | keyboard_desc.c [code]
usb hid keyboard device descriptor
file | keyboard_desc.h [code]
usb keyboard descriptor header file


AT32F415 Firmwary Library: inc Directory Reference

  • can
  • filter
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/can/filter/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/can/filter/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/can/filter/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • tmr1_synchro
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • usb_device
  • vcp_loopback
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • usb_device
  • custom_hid
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usb_device/custom_hid/src/main.c [code]
main program


AT32F415 Firmwary Library: at32f415_slib_demo Directory Reference

  • utilities
  • at32f415_slib_demo
at32f415_slib_demo Directory Reference

Directories

directory | project_l0
directory | project_l1


AT32F415 Firmwary Library: inc Directory Reference

  • exint
  • exint_software_trigger
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • spi
  • only_receive_mode_polling
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • pwc
  • standby_wakeup_pin
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • usb_device
  • msc
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usb_device/msc/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usb_device/msc/src/main.c [code]
main program
file | msc/src/msc_diskio.c [code]
usb mass storage disk function


AT32F415 Firmwary Library: src Directory Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • src
src Directory Reference

Files

file | utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c [code]
system clock config program
file | utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c [code]
main interrupt service routines.
file | app_led3_toggle/src/hid_iap_user.c [code]
usb hid iap user file
file | utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c [code]
main program


AT32F415 Firmwary Library: internal_temperature_sensor Directory Reference

  • adc
  • internal_temperature_sensor
internal_temperature_sensor Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: custom_hid Directory Reference

  • middlewares
  • usbd_class
  • custom_hid
custom_hid Directory Reference

Files

file | custom_hid_class.c [code]
usb custom hid class type
file | custom_hid_class.h [code]
usb hid header file
file | custom_hid_desc.c [code]
usb hid device descriptor
file | custom_hid_desc.h [code]
usb custom hid descriptor header file


AT32F415 Firmwary Library: src Directory Reference

  • i2s
  • spii2s_switch_halfduplex_polling
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • utilities
  • at32f415_slib_demo
  • project_l1
  • src
src Directory Reference

Files

file | project_l1/src/arm_fir_data.c [code]
file | utilities/at32f415_slib_demo/project_l1/src/at32f415_clock.c [code]
system clock config program
file | utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c [code]
main interrupt service routines.
file | utilities/at32f415_slib_demo/project_l1/src/main.c [code]
main program
file | project_l1/src/math_helper.c [code]


AT32F415 Firmwary Library: src Directory Reference

  • usb_device
  • composite_vcp_keyboard
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c [code]
main program


AT32F415 Firmwary Library: main_page Directory Reference

  • main_page
main_page Directory Reference

Files

file main_page.h [code]


AT32F415 Firmwary Library: inc Directory Reference

  • i2s
  • halfduplex_dma
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • spi
  • halfduplex_transceiver_switch
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • tmr2_32bit
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • sdio
  • sdio_fatfs
  • src
src Directory Reference

Files

file | sdio_fatfs/src/at32_sdio.c [code]
this file provides a set of functions needed to manage the sdio/mmc card memory.
file | project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c [code]
main interrupt service routines.
file | diskio.c [code]
file | project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c [code]
main program


AT32F415 Firmwary Library: wwdt_reset Directory Reference

  • wwdt
  • wwdt_reset
wwdt_reset Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • pwc
  • deepsleep_ertc_alarm
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c [code]
main program


AT32F415 Firmwary Library: pwm_input_dma Directory Reference

  • tmr
  • pwm_input_dma
pwm_input_dma Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • dma
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/dma/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • i2c
  • communication_int
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/i2c/communication_int/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: msc Directory Reference

  • middlewares
  • usbd_class
  • msc
msc Directory Reference

Files

file | msc_bot_scsi.c [code]
usb mass storage bulk-only transport and scsi command
file | msc_bot_scsi.h [code]
usb mass storage bulk-only transport and scsi command header file
file | msc_class.c [code]
usb msc class type
file | msc_class.h [code]
usb msc class file
file | msc_desc.c [code]
usb msc device descriptor
file | msc_desc.h [code]
usb msc descriptor header file


AT32F415 Firmwary Library: inc Directory Reference

  • spi
  • use_jtagpin_hardwarecs_dma
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • input_capture
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/input_capture/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/input_capture/src/main.c [code]
main program


AT32F415 Firmwary Library: wwdt Directory Reference

  • wwdt
wwdt Directory Reference

Directories

directory wwdt_reset


AT32F415 Firmwary Library: inc Directory Reference

  • spi
  • w25q_flash
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | spi_flash.h [code]
header file of spi_flash


AT32F415 Firmwary Library: src Directory Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • src
src Directory Reference

Files

file | utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_clock.c [code]
system clock config program
file | utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c [code]
main interrupt service routines.
file | utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c [code]
main program


AT32F415 Firmwary Library: tmr Directory Reference

  • tmr
tmr Directory Reference

Directories

directory | 6_steps
directory | 7_pwm_output
directory | cascade_synchro
directory | complementary_signals
directory | dma
directory | dma_burst
directory | encoder_tmr2
directory | external_clock
directory | hall_xor_tmr2
directory | hang_mode
directory | input_capture
directory | oc_high
directory | oc_low
directory | oc_toggle_tmr3
directory | oc_toggle_tmr9
directory | one_cycle
directory | parallel_synchro
directory | pwm_input
directory | pwm_input_dma
directory | pwm_output_simulate
directory | pwm_output_tmr10
directory | pwm_output_tmr3
directory | timer_base
directory | tmr1_synchro
directory | tmr2_32bit


AT32F415 Firmwary Library: inc Directory Reference

  • usb_device
  • keyboard
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h [code]
usb config header file


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • oc_toggle_tmr9
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • complementary_signals
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • spi
  • use_jtagpin_hardwarecs_dma
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c [code]
main program


AT32F415 Firmwary Library: printer Directory Reference

  • middlewares
  • usbd_class
  • printer
printer Directory Reference

Files

file | printer_class.c [code]
usb printer class type
file | printer_class.h [code]
usb cdc class file
file | printer_desc.c [code]
usb printer device descriptor
file | printer_desc.h [code]
usb printer descriptor header file


AT32F415 Firmwary Library: src Directory Reference

  • utilities
  • at32f415_freertos_demo
  • src
src Directory Reference

Files

file | utilities/at32f415_freertos_demo/src/at32f415_clock.c [code]
system clock config program
file | utilities/at32f415_freertos_demo/src/at32f415_int.c [code]
main interrupt service routines.
file | utilities/at32f415_freertos_demo/src/main.c [code]
main program


AT32F415 Firmwary Library: drivers Directory Reference

  • libraries
  • drivers
drivers Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • libraries
  • drivers
  • inc
inc Directory Reference

Files

file | at32f415_adc.h [code]
at32f415 adc header file
file | at32f415_can.h [code]
at32f415 can header file
file | at32f415_cmp.h [code]
at32f415 cmp header file
file | at32f415_crc.h [code]
at32f415 crc header file
file | at32f415_crm.h [code]
at32f415 crm header file
file | at32f415_debug.h [code]
at32f415 debug header file
file | at32f415_def.h [code]
at32f415 macros header file
file | at32f415_dma.h [code]
at32f415 dma header file
file | at32f415_ertc.h [code]
at32f415 ertc header file
file | at32f415_exint.h [code]
at32f415 exint header file
file | at32f415_flash.h [code]
at32f415 flash header file
file | at32f415_gpio.h [code]
at32f415 gpio header file
file | at32f415_i2c.h [code]
at32f415 i2c header file
file | at32f415_misc.h [code]
at32f415 misc header file
file | at32f415_pwc.h [code]
at32f415 pwc header file
file | at32f415_sdio.h [code]
at32f415 sdio header file
file | at32f415_spi.h [code]
at32f415 spi header file
file | at32f415_tmr.h [code]
at32f415 tmr header file
file | at32f415_usart.h [code]
at32f415 usart header file
file | at32f415_usb.h [code]
at32f415 usb header file
file | at32f415_wdt.h [code]
at32f415 wdt header file
file | at32f415_wwdt.h [code]
at32f415 wwdt header file


AT32F415 Firmwary Library: ertc Directory Reference

  • ertc
ertc Directory Reference

Directories

directory | bpr_domain
directory | calendar
directory | lick_calibration
directory | tamper
directory | time_stamp
directory | wakeup_timer


AT32F415 Firmwary Library: transfer_by_dma_interrupt Directory Reference

  • usart
  • transfer_by_dma_interrupt
transfer_by_dma_interrupt Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • pwm_input
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/pwm_input/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/pwm_input/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • pwc
  • standby_wakeup_pin
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/pwc/standby_wakeup_pin/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • usart
  • interrupt
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usart/interrupt/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • ertc
  • calendar
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/ertc/calendar/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/ertc/calendar/src/main.c [code]
main program


AT32F415 Firmwary Library: pwc Directory Reference

  • pwc
pwc Directory Reference

Directories

directory | deepsleep_ertc_alarm
directory | deepsleep_ertc_tamper
directory | power_voltage_monitor
directory | sleep_tmr2
directory | sleep_usart1
directory | standby_ertc_alarm
directory | standby_wakeup_pin


AT32F415 Firmwary Library: 7_pwm_output Directory Reference

  • tmr
  • 7_pwm_output
7_pwm_output Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • 6_steps
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/6_steps/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • hall_xor_tmr2
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • i2s
  • halfduplex_interrupt
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: bpr_domain Directory Reference

  • ertc
  • bpr_domain
bpr_domain Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: exint_software_trigger Directory Reference

  • exint
  • exint_software_trigger
exint_software_trigger Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • ertc
  • wakeup_timer
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: usbh_hid Directory Reference

  • middlewares
  • usbh_class
  • usbh_hid
usbh_hid Directory Reference

Files

file | usbh_hid_class.c [code]
usb host hid class type
file | usbh_hid_class.h [code]
usb host hid class header file
file | usbh_hid_keyboard.c [code]
usb host hid keyboard type
file | usbh_hid_keyboard.h [code]
usb host hid keyboard header file
file | usbh_hid_mouse.c [code]
usb host hid mouse type
file | usbh_hid_mouse.h [code]
usb host hid mouse header file


AT32F415 Firmwary Library: inc Directory Reference

  • adc
  • internal_temperature_sensor
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: audio Directory Reference

  • usb_device
  • audio
audio Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: transfer_by_dma_polling Directory Reference

  • usart
  • transfer_by_dma_polling
transfer_by_dma_polling Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • external_clock
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/external_clock/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: idle_detection Directory Reference

  • usart
  • idle_detection
idle_detection Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • spi
  • w25q_flash
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/spi/w25q_flash/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/spi/w25q_flash/src/main.c [code]
main program
file | spi_flash.c [code]
spi_flash source code


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • oc_toggle_tmr9
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: cmsis Directory Reference

  • libraries
  • cmsis
cmsis Directory Reference

Directories

directory cm4


AT32F415 Firmwary Library: inc Directory Reference

  • usart
  • transfer_by_dma_interrupt
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • ertc
  • calendar
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/ertc/calendar/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • usb_host
  • hid_demo
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h [code]
usb config header file
file | hid_demo/inc/usbh_user.h [code]
usb host user header file


AT32F415 Firmwary Library: app_led3_toggle Directory Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
app_led3_toggle Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: fullduplex_polling Directory Reference

  • spi
  • fullduplex_polling
fullduplex_polling Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • pwc
  • deepsleep_ertc_tamper
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • i2s
  • halfduplex_interrupt
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • ertc
  • lick_calibration
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/ertc/lick_calibration/src/main.c [code]
main program


AT32F415 Firmwary Library: wdt Directory Reference

  • wdt
wdt Directory Reference

Directories

directory wdt_reset


AT32F415 Firmwary Library: lick_calibration Directory Reference

  • ertc
  • lick_calibration
lick_calibration Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: at32f415_gen_random_number_demo Directory Reference

  • utilities
  • at32f415_gen_random_number_demo
at32f415_gen_random_number_demo Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: bit_band Directory Reference

  • cortex_m4
  • bit_band
bit_band Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: deep_sleep_mode Directory Reference

  • cmp
  • deep_sleep_mode
deep_sleep_mode Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • dma_burst
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • hall_xor_tmr2
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c [code]
main program


AT32F415 Firmwary Library: halfduplex_dma Directory Reference

  • i2s
  • halfduplex_dma
halfduplex_dma Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: i2c Directory Reference

  • i2c
i2c Directory Reference

Directories

directory | communication_dma
directory | communication_int
directory | communication_poll
directory | eeprom


AT32F415 Firmwary Library: filter Directory Reference

  • can
  • filter
filter Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • oc_high
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/oc_high/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • middlewares
  • usb_drivers
  • inc
inc Directory Reference

Files

file | usb_core.h [code]
usb core header file
file | usb_std.h [code]
usb standard header file
file | usbd_core.h [code]
usb device core header file
file | usbd_int.h [code]
usb interrupt header file
file | usbd_sdr.h [code]
file | usbh_core.h [code]
usb host core header file
file | usbh_ctrl.h [code]
usb header file
file | usbh_int.h [code]
usb header file


AT32F415 Firmwary Library: systick_interrupt Directory Reference

  • cortex_m4
  • systick_interrupt
systick_interrupt Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: halfduplex_interrupt Directory Reference

  • spi
  • halfduplex_interrupt
halfduplex_interrupt Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • crm
  • clock_failure_detection
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/crm/clock_failure_detection/src/main.c [code]
main program


AT32F415 Firmwary Library: tmr1 Directory Reference

  • debug
  • tmr1
tmr1 Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: led_toggle Directory Reference

  • gpio
  • led_toggle
led_toggle Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: input_capture Directory Reference

  • tmr
  • input_capture
input_capture Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • spi
  • fullduplex_polling
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/spi/fullduplex_polling/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • usart
  • transfer_by_dma_polling
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • ertc
  • wakeup_timer
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/ertc/wakeup_timer/src/main.c [code]
main program


AT32F415 Firmwary Library: interrupt Directory Reference

  • usart
  • interrupt
interrupt Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • ertc
  • time_stamp
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/ertc/time_stamp/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/ertc/time_stamp/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • pwc
  • sleep_tmr2
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/pwc/sleep_tmr2/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • pwc
  • sleep_tmr2
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • usart
  • irda
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usart/irda/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usart/irda/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usart/irda/src/main.c [code]
main program


AT32F415 Firmwary Library: composite_audio_hid Directory Reference

  • usb_device
  • composite_audio_hid
composite_audio_hid Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: deepsleep_ertc_tamper Directory Reference

  • pwc
  • deepsleep_ertc_tamper
deepsleep_ertc_tamper Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • timer_base
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/timer_base/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/timer_base/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • usart
  • interrupt
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usart/interrupt/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usart/interrupt/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • input_capture
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/input_capture/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: voltage_monitoring Directory Reference

  • adc
  • voltage_monitoring
voltage_monitoring Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: oc_low Directory Reference

  • tmr
  • oc_low
oc_low Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: clock_failure_detection Directory Reference

  • crm
  • clock_failure_detection
clock_failure_detection Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • usart
  • synchronous
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usart/synchronous/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usart/synchronous/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • tmr1_synchro
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: only_receive_mode_polling Directory Reference

  • spi
  • only_receive_mode_polling
only_receive_mode_polling Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: receiver_mute Directory Reference

  • usart
  • receiver_mute
receiver_mute Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: polling Directory Reference

  • usart
  • polling
polling Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: smartcard Directory Reference

  • usart
  • smartcard
smartcard Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • spi
  • only_receive_mode_polling
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • adc
  • exint_trigger_partitioned
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c [code]
main program


AT32F415 Firmwary Library: audio Directory Reference

  • middlewares
  • usbd_class
  • audio
audio Directory Reference

Files

file | audio_class.c [code]
usb audio class type
file | audio_class.h [code]
usb audio class file
file | audio/audio_conf.h [code]
usb audio config
file | audio_desc.c [code]
usb audio device descriptor
file | audio_desc.h [code]
usb audio descriptor header file


AT32F415 Firmwary Library: inc Directory Reference

  • utilities
  • at32f415_freertos_demo
  • inc
inc Directory Reference

Files

file | utilities/at32f415_freertos_demo/inc/at32f415_clock.h [code]
header file of clock program
file | utilities/at32f415_freertos_demo/inc/at32f415_conf.h [code]
at32f415 config header file
file | utilities/at32f415_freertos_demo/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | FreeRTOSConfig.h [code]


AT32F415 Firmwary Library: src Directory Reference

  • crm
  • sysclk_switch
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/crm/sysclk_switch/src/main.c [code]
main program


AT32F415 Firmwary Library: flash Directory Reference

  • flash
flash Directory Reference

Directories

directory flash_write_read


AT32F415 Firmwary Library: inc Directory Reference

  • adc
  • voltage_monitoring
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • dma
  • data_to_gpio_flexible
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • usart
  • half_duplex
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usart/half_duplex/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usart/half_duplex/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • pwc
  • sleep_usart1
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: swjtag_remap Directory Reference

  • gpio
  • swjtag_remap
swjtag_remap Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: w25q_flash Directory Reference

  • spi
  • w25q_flash
w25q_flash Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • usb_device
  • printer
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usb_device/printer/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usb_device/printer/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • wwdt
  • wwdt_reset
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: sd_mmc_card Directory Reference

  • sdio
  • sd_mmc_card
sd_mmc_card Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • sdio
  • sd_mmc_card
  • inc
inc Directory Reference

Files

file | sd_mmc_card/inc/at32_sdio.h [code]
this file contains all the functions prototypes for the sd/mmc card at32_sdio driver firmware library.
file | project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: halfduplex_interrupt Directory Reference

  • i2s
  • halfduplex_interrupt
halfduplex_interrupt Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: mouse Directory Reference

  • middlewares
  • usbd_class
  • mouse
mouse Directory Reference

Files

file | mouse_class.c [code]
usb hid mouse class type
file | mouse_class.h [code]
usb hid mouse header file
file | mouse_desc.c [code]
usb hid mouse device descriptor
file | mouse_desc.h [code]
usb mouse descriptor header file


AT32F415 Firmwary Library: exint Directory Reference

  • exint
exint Directory Reference

Directories

directory | exint_config
directory | exint_software_trigger


AT32F415 Firmwary Library: irda Directory Reference

  • usart
  • irda
irda Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • pwm_output_tmr10
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: output Directory Reference

  • cmp
  • output
output Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • tmr2_32bit
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: at_start_f415 Directory Reference

at_start_f415 Directory Reference

Directories

directory | examples
directory | templates


AT32F415 Firmwary Library: src Directory Reference

  • gpio
  • led_toggle
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/gpio/led_toggle/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/gpio/led_toggle/src/main.c [code]
main program


AT32F415 Firmwary Library: wdt_reset Directory Reference

  • wdt
  • wdt_reset
wdt_reset Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • usart
  • printf
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usart/printf/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usart/printf/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • adc
  • software_trigger_repeat
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c [code]
main program


AT32F415 Firmwary Library: pll_config2 Directory Reference

  • crm
  • pll_config2
pll_config2 Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • cmp
  • output
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/cmp/output/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/cmp/output/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/cmp/output/src/main.c [code]
main program


AT32F415 Firmwary Library: standby_wakeup_pin Directory Reference

  • pwc
  • standby_wakeup_pin
standby_wakeup_pin Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • crm
  • clock_failure_detection
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: at32f415_usart_iap_demo Directory Reference

  • utilities
  • at32f415_usart_iap_demo
at32f415_usart_iap_demo Directory Reference

Directories

directory source_code


AT32F415 Firmwary Library: sleep_usart1 Directory Reference

  • pwc
  • sleep_usart1
sleep_usart1 Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • pwm_output_simulate
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • cortex_m4
  • bit_band
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • src
src Directory Reference

Files

file | utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c [code]
system clock config program
file | utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c [code]
main interrupt service routines.
file | app_led3_toggle/src/iap.c [code]
iap program
file | utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/main.c [code]
main program
file | app_led3_toggle/src/tmr.c [code]
tmr program
file | app_led3_toggle/src/usart.c [code]
usart program


AT32F415 Firmwary Library: inc Directory Reference

  • usb_device
  • msc
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usb_device/msc/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | msc/inc/msc_diskio.h [code]
usb mass storage disk interface header file
file | project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h [code]
usb config header file


AT32F415 Firmwary Library: src Directory Reference

  • usart
  • polling
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usart/polling/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usart/polling/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usart/polling/src/main.c [code]
main program


AT32F415 Firmwary Library: pwm_input Directory Reference

  • tmr
  • pwm_input
pwm_input Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • usart
  • idle_detection
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usart/idle_detection/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • debug
  • tmr1
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/debug/tmr1/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • libraries
  • drivers
  • src
src Directory Reference

Files

file | at32f415_adc.c [code]
contains all the functions for the adc firmware library
file | at32f415_can.c [code]
contains all the functions for the can firmware library
file | at32f415_cmp.c [code]
contains all the functions for the gpio firmware library
file | at32f415_crc.c [code]
contains all the functions for the crc firmware library
file | at32f415_crm.c [code]
contains all the functions for the crm firmware library
file | at32f415_debug.c [code]
contains all the functions for the debug firmware library
file | at32f415_dma.c [code]
contains all the functions for the dma firmware library
file | at32f415_ertc.c [code]
contains all the functions for the ertc firmware library
file | at32f415_exint.c [code]
contains all the functions for the exint firmware library
file | at32f415_flash.c [code]
contains all the functions for the flash firmware library
file | at32f415_gpio.c [code]
contains all the functions for the gpio firmware library
file | at32f415_i2c.c [code]
contains all the functions for the i2c firmware library
file | at32f415_misc.c [code]
contains all the functions for the misc firmware library
file | at32f415_pwc.c [code]
contains all the functions for the pwc firmware library
file | at32f415_sdio.c [code]
contains all the functions for the sdio firmware library
file | at32f415_spi.c [code]
contains all the functions for the spi firmware library
file | at32f415_tmr.c [code]
contains all the functions for the tmr firmware library
file | at32f415_usart.c [code]
contains all the functions for the usart firmware library
file | at32f415_usb.c [code]
contains all the functions for the usb firmware library
file | at32f415_wdt.c [code]
contains all the functions for the wdt firmware library
file | at32f415_wwdt.c [code]
contains all the functions for the wwdt firmware library


AT32F415 Firmwary Library: app_led4_toggle Directory Reference

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
app_led4_toggle Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • hang_mode
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/hang_mode/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/hang_mode/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • usb_device
  • virtual_msc_iap
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | flash_fat16.h [code]
fat16 file system header file
file | virtual_msc_iap/inc/msc_diskio.h [code]
usb mass storage disk interface header file
file | project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h [code]
usb config header file


AT32F415 Firmwary Library: tamper Directory Reference

  • ertc
  • tamper
tamper Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: loopback_mode Directory Reference

  • can
  • loopback_mode
loopback_mode Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: i2s Directory Reference

  • i2s
i2s Directory Reference

Directories

directory | halfduplex_dma
directory | halfduplex_interrupt
directory | spii2s_switch_halfduplex_polling


AT32F415 Firmwary Library: src Directory Reference

  • usart
  • printf
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usart/printf/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usart/printf/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usart/printf/src/main.c [code]
main program


AT32F415 Firmwary Library: oc_high Directory Reference

  • tmr
  • oc_high
oc_high Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • pwc
  • sleep_usart1
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/pwc/sleep_usart1/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • usb_device
  • virtual_msc_iap
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c [code]
main interrupt service routines.
file | flash_fat16.c [code]
fat16 file system
file | project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c [code]
main program
file | virtual_msc_iap/src/msc_diskio.c [code]
usb mass storage disk function


AT32F415 Firmwary Library: usb_host Directory Reference

  • usb_host
usb_host Directory Reference

Directories

directory | hid_demo
directory | msc_only_fat32


AT32F415 Firmwary Library: inc Directory Reference

  • adc
  • exint_trigger_partitioned
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: at32f415_board Directory Reference

  • at32f415_board
at32f415_board Directory Reference

Files

file | at32f415_board.c [code]
set of firmware functions to manage leds and push-button. initialize delay function.
file | at32f415_board.h [code]
header file for at-start board. set of firmware functions to manage leds and push-button. initialize delay function.


AT32F415 Firmwary Library: inc Directory Reference

  • pwc
  • deepsleep_ertc_alarm
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • can
  • filter
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/can/filter/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/can/filter/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/can/filter/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • pwm_output_tmr3
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • pwm_input_dma
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • adc
  • voltage_monitoring
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/adc/voltage_monitoring/src/main.c [code]
main program


AT32F415 Firmwary Library: hid_iap Directory Reference

  • middlewares
  • usbd_class
  • hid_iap
hid_iap Directory Reference

Files

file | hid_iap_class.c [code]
usb hid iap class type
file | hid_iap_class.h [code]
usb hid iap header file
file | hid_iap_desc.c [code]
usb hid iap device descriptor
file | hid_iap_desc.h [code]
usb hid iap descriptor header file


AT32F415 Firmwary Library: inc Directory Reference

  • i2c
  • communication_poll
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: src Directory Reference

  • usart
  • transfer_by_dma_polling
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • spi
  • crc_transfer_polling
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c [code]
main program


AT32F415 Firmwary Library: cascade_synchro Directory Reference

  • tmr
  • cascade_synchro
cascade_synchro Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: communication_poll Directory Reference

  • i2c
  • communication_poll
communication_poll Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • pwc
  • standby_ertc_alarm
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: project_l1 Directory Reference

  • utilities
  • at32f415_slib_demo
  • project_l1
project_l1 Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • timer_base
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/timer_base/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: inc Directory Reference

  • usart
  • smartcard
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usart/smartcard/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | smartcard_config.h [code]
header file of clock program


AT32F415 Firmwary Library: inc Directory Reference

  • usb_device
  • vcp_loopback
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h [code]
usb config header file


AT32F415 Firmwary Library: inc Directory Reference

  • usb_host
  • msc_only_fat32
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | usb_host/msc_only_fat32/inc/ffconf.h [code]
file | project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h [code]
usb config header file
file | msc_only_fat32/inc/usbh_user.h [code]
usb host user header file


AT32F415 Firmwary Library: exint_config Directory Reference

  • exint
  • exint_config
exint_config Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: src Directory Reference

  • cmp
  • deep_sleep_mode
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • adc
  • software_trigger_repeat
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: usbh_msc Directory Reference

  • middlewares
  • usbh_class
  • usbh_msc
usbh_msc Directory Reference

Files

file | usbh_msc_bot_scsi.c [code]
usb host msc bulk-only transfer and scsi type
file | usbh_msc_bot_scsi.h [code]
usb host msc bulk-only transfer and scsi header file
file | usbh_msc_class.c [code]
usb host msc class type
file | usbh_msc_class.h [code]
usb host msc class header file


AT32F415 Firmwary Library: src Directory Reference

  • tmr
  • oc_toggle_tmr3
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • can
  • loopback_mode
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/can/loopback_mode/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/can/loopback_mode/src/main.c [code]
main program


AT32F415 Firmwary Library: sdio Directory Reference

  • sdio
sdio Directory Reference

Directories

directory | sd_mmc_card
directory | sdio_fatfs


AT32F415 Firmwary Library: src Directory Reference

  • spi
  • halfduplex_interrupt
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • src
src Directory Reference

Files

file | utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_clock.c [code]
system clock config program
file | utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c [code]
main interrupt service routines.
file | utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/main.c [code]
main program
file | run_in_boot_memory.c [code]
code for run in boot memory


AT32F415 Firmwary Library: src Directory Reference

  • crm
  • pll_config2
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/crm/pll_config2/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/crm/pll_config2/src/main.c [code]
main program


AT32F415 Firmwary Library: wakeup_timer Directory Reference

  • ertc
  • wakeup_timer
wakeup_timer Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: inc Directory Reference

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • inc
inc Directory Reference

Files

file | utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h [code]
header file of clock program
file | utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h [code]
at32f415 config header file
file | utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h [code]
header file of main interrupt service routines.
file | app_led3_toggle/inc/hid_iap_user.h [code]
usb config header file
file | utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h [code]
usb config header file


AT32F415 Firmwary Library: inc Directory Reference

  • ertc
  • time_stamp
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: composite_vcp_keyboard Directory Reference

  • usb_device
  • composite_vcp_keyboard
composite_vcp_keyboard Directory Reference

Directories

directory | inc
directory | src


AT32F415 Firmwary Library: usbd_class Directory Reference

  • middlewares
  • usbd_class
usbd_class Directory Reference

Directories

directory | audio
directory | audio_hid
directory | cdc
directory | composite_cdc_keyboard
directory | custom_hid
directory | hid_iap
directory | keyboard
directory | mouse
directory | msc
directory | printer


AT32F415 Firmwary Library: src Directory Reference

  • cortex_m4
  • bit_band
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/cortex_m4/bit_band/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • usb_device
  • audio
  • src
src Directory Reference

Files

file | project/at_start_f415/examples/usb_device/audio/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c [code]
main interrupt service routines.
file | audio/src/audio_codec.c [code]
audio codec function
file | project/at_start_f415/examples/usb_device/audio/src/main.c [code]
main program


AT32F415 Firmwary Library: src Directory Reference

  • sdio
  • sd_mmc_card
  • src
src Directory Reference

Files

file | sd_mmc_card/src/at32_sdio.c [code]
this file provides a set of functions needed to manage the sdio/mmc card memory.
file | project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_clock.c [code]
system clock config program
file | project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c [code]
main interrupt service routines.
file | project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c [code]
main program


AT32F415 Firmwary Library: inc Directory Reference

  • tmr
  • hang_mode
  • inc
inc Directory Reference

Files

file | project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_clock.h [code]
header file of clock program
file | project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h [code]
at32f415 config header file
file | project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h [code]
header file of main interrupt service routines.


AT32F415 Firmwary Library: diskio.c Source File

  • sdio
  • sdio_fatfs
  • src
diskio.c
Go to the documentation of this file.
1/*-----------------------------------------------------------------------*/
2/* Low level disk I/O module SKELETON for FatFs (C)ChaN, 2019 */
3/*-----------------------------------------------------------------------*/
4/* If a working storage control module is available, it should be */
5/* attached to the FatFs via a glue function rather than modifying it. */
6/* This is an example of glue functions to attach various exsisting */
7/* storage control modules to the FatFs module with a defined API. */
8/*-----------------------------------------------------------------------*/
9
10
11#include "ff.h" /* Obtains integer types */
12#include "diskio.h" /* Declarations of disk functions */
13
14#include <string.h>
15#include "at32_sdio.h" /* Example: Header file of existing MMC/SDC contorl module */
16
17/* Definitions of physical drive number for each drive */
18#define DEV_RAM 0 /* Example: Map Ramdisk to physical drive 0 */
19#define DEV_MMC 1 /* Example: Map MMC/SD card to physical drive 1 */
20#define DEV_USB 2 /* Example: Map USB MSD to physical drive 2 */
21
22 __align(4) uint8_t sdio_data_buffer[512]; /* buf for sd_read_disk/sd_write_disk function used. */
23
24 sd_error_status_type sd_read_disk(uint8_t *buf, uint32_t sector, uint8_t cnt);
25 sd_error_status_type sd_write_disk(const uint8_t *buf, uint32_t sector, uint8_t cnt);
26
34 sd_error_status_type sd_read_disk(uint8_t *buf, uint32_t sector, uint8_t cnt)
35{
36 sd_error_status_type sta = SD_OK;
37 long long lsector = sector;
38 uint8_t n;
39
40 /* data address is in block (512 byte) units. */
41 lsector <<= 9;
42
43 if((uint32_t)buf % 4 != 0)
44 {
45 for(n = 0; n < cnt; n++)
46 {
47 sta = sd_block_read(sdio_data_buffer, lsector + 512 * n, 512);
48 memcpy(buf, sdio_data_buffer, 512);
49 buf += 512;
50 }
51 }
52 else
53 {
54 if(cnt == 1)
55 {
56 sta = sd_block_read(buf, lsector, 512);
57 }
58 else
59 {
60 sta = sd_mult_blocks_read(buf, lsector, 512, cnt);
61 }
62 }
63
64 return sta;
65}
66
74 sd_error_status_type sd_write_disk(const uint8_t *buf, uint32_t sector, uint8_t cnt)
75{
76 sd_error_status_type sta = SD_OK;
77 uint8_t n;
78 long long lsector = sector;
79
80 /* data address is in block (512 byte) units. */
81 lsector <<= 9;
82
83 if((uint32_t)buf % 4 != 0)
84 {
85 for(n = 0; n < cnt; n++)
86 {
87 memcpy(sdio_data_buffer, buf, 512);
88 sta = sd_block_write(sdio_data_buffer, lsector + 512*n, 512);
89 buf += 512;
90 }
91 }
92 else
93 {
94 if(cnt == 1)
95 {
96 sta = sd_block_write(buf, lsector, 512);
97 }
98 else
99 {
100 sta = sd_mult_blocks_write(buf, lsector, 512, cnt);
101 }
102 }
103
104 return sta;
105}
106
107/*-----------------------------------------------------------------------*/
108/* Get Drive Status */
109/*-----------------------------------------------------------------------*/
110DSTATUS disk_status (
111 BYTE pdrv /* Physical drive nmuber to identify the drive */
112)
113{
114 DSTATUS stat;
115 int result;
116
117 switch (pdrv) {
118 case DEV_RAM :
119 result = 1;
120 stat = (DSTATUS)result;
121 return stat;
122
123 case DEV_MMC :
124 result = 0;
125 stat = (DSTATUS)result;
126 return stat;
127
128 case DEV_USB :
129 result = 1;
130 stat = (DSTATUS)result;
131 return stat;
132 }
133 return STA_NOINIT;
134}
135
136
137
138/*-----------------------------------------------------------------------*/
139/* Inidialize a Drive */
140/*-----------------------------------------------------------------------*/
141DSTATUS disk_initialize (
142 BYTE pdrv /* Physical drive nmuber to identify the drive */
143)
144{
145 DSTATUS stat;
146 int result;
147
148 switch (pdrv) {
149 case DEV_RAM :
150 result = 1;
151 stat = (DSTATUS)result;
152 return stat;
153
154 case DEV_MMC :
155 result = sd_init();
156 stat = (DSTATUS)result;
157 return stat;
158
159 case DEV_USB :
160 result = 1;
161 stat = (DSTATUS)result;
162 return stat;
163 }
164 return STA_NOINIT;
165}
166
167
168
169/*-----------------------------------------------------------------------*/
170/* Read Sector(s) */
171/*-----------------------------------------------------------------------*/
172DRESULT disk_read (
173 BYTE pdrv, /* Physical drive nmuber to identify the drive */
174 BYTE *buff, /* Data buffer to store read data */
175 LBA_t sector, /* Start sector in LBA */
176 UINT count /* Number of sectors to read */
177)
178{
179 DRESULT res;
180 int result;
181
182 switch (pdrv) {
183 case DEV_RAM :
184 result = 1;
185 res = (DRESULT)result;
186 return res;
187
188 case DEV_MMC :
189 result = sd_read_disk(buff, sector, count);
190 res = (DRESULT)result;
191 return res;
192
193 case DEV_USB :
194 result = 1;
195 res = (DRESULT)result;
196 return res;
197 }
198
199 return RES_PARERR;
200}
201
202
203
204/*-----------------------------------------------------------------------*/
205/* Write Sector(s) */
206/*-----------------------------------------------------------------------*/
207#if FF_FS_READONLY == 0
208
209DRESULT disk_write (
210 BYTE pdrv, /* Physical drive nmuber to identify the drive */
211 const BYTE *buff, /* Data to be written */
212 LBA_t sector, /* Start sector in LBA */
213 UINT count /* Number of sectors to write */
214)
215{
216 DRESULT res;
217 int result;
218
219 switch (pdrv) {
220 case DEV_RAM :
221 result = 1;
222 res = (DRESULT)result;
223 return res;
224
225 case DEV_MMC :
226 result = sd_write_disk(buff, sector, count);
227 res = (DRESULT)result;
228 return res;
229
230 case DEV_USB :
231 result = 1;
232 res = (DRESULT)result;
233 return res;
234 }
235
236 return RES_PARERR;
237}
238
239#endif
240
241
242/*-----------------------------------------------------------------------*/
243/* Miscellaneous Functions */
244/*-----------------------------------------------------------------------*/
245DRESULT disk_ioctl (
246 BYTE pdrv, /* Physical drive nmuber (0..) */
247 BYTE cmd, /* Control code */
248 void *buff /* Buffer to send/receive control data */
249)
250{
251 DRESULT res;
252 int result;
253
254 switch (pdrv) {
255 case DEV_RAM :
256 result = 1;
257 res = (DRESULT)result;
258 return res;
259
260 case DEV_MMC :
261 switch(cmd){
262 case CTRL_SYNC:
263 result = RES_OK;
264 break;
265 case GET_SECTOR_SIZE:
266 *(DWORD*)buff = 512;
267 result = RES_OK;
268 break;
269 case GET_SECTOR_COUNT:
270 *(DWORD*)buff = sd_card_info.card_capacity/512;
271 result = RES_OK;
272 break;
273 case GET_BLOCK_SIZE:
274 *(DWORD*)buff = sd_card_info.card_blk_size;
275 result = RES_OK;
276 break;
277 default:
278 result = RES_PARERR;
279 break;
280 }
281 res = (DRESULT)result;
282 return res;
283
284 case DEV_USB :
285 result = 1;
286 res = (DRESULT)result;
287 return res;
288 }
289
290 return RES_PARERR;
291}
disk_read
DRESULT disk_read(BYTE pdrv, BYTE *buff, LBA_t sector, UINT count)
Definition: diskio.c:172
disk_initialize
DSTATUS disk_initialize(BYTE pdrv)
Definition: diskio.c:141
__align
__align(4)
Definition: diskio.c:22
DEV_USB
#define DEV_USB
Definition: diskio.c:20
DEV_RAM
#define DEV_RAM
Definition: diskio.c:18
disk_status
DSTATUS disk_status(BYTE pdrv)
Definition: diskio.c:110
disk_ioctl
DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void *buff)
Definition: diskio.c:245
disk_write
DRESULT disk_write(BYTE pdrv, const BYTE *buff, LBA_t sector, UINT count)
Definition: diskio.c:209
DEV_MMC
#define DEV_MMC
Definition: diskio.c:19
sd_write_disk
sd_error_status_type sd_write_disk(const uint8_t *buf, uint32_t sector, uint8_t cnt)
write sd card sector
Definition: diskio.c:74
sd_card_info
sd_card_info_struct_type sd_card_info
Definition: sd_mmc_card/src/at32_sdio.c:47
sd_block_read
sd_error_status_type sd_block_read(uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma ...
Definition: sd_mmc_card/src/at32_sdio.c:1180
sd_mult_blocks_write
sd_error_status_type sd_mult_blocks_write(const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed ...
Definition: sd_mmc_card/src/at32_sdio.c:1482
sd_block_write
sd_error_status_type sd_block_write(const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be manag...
Definition: sd_mmc_card/src/at32_sdio.c:1360
sd_init
sd_error_status_type sd_init(void)
initializes the sd card and put it into standby state (ready for data transfer).
Definition: sd_mmc_card/src/at32_sdio.c:71
sd_mult_blocks_read
sd_error_status_type sd_mult_blocks_read(uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mod...
Definition: sdio_fatfs/src/at32_sdio.c:1276
sd_error_status_type
sd_error_status_type
Definition: sd_mmc_card/inc/at32_sdio.h:74
SD_OK
@ SD_OK
Definition: sd_mmc_card/inc/at32_sdio.h:119
sd_card_info_struct_type::card_capacity
long long card_capacity
Definition: sd_mmc_card/inc/at32_sdio.h:241
sd_card_info_struct_type::card_blk_size
uint32_t card_blk_size
Definition: sd_mmc_card/inc/at32_sdio.h:242


AT32F415 Firmwary Library: fir_coefficient.c Source File

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
fir_coefficient.c
Go to the documentation of this file.
1/* ----------------------------------------------------------------------
2 * Copyright (C) 2010-2012 ARM Limited. All rights reserved.
3 *
4* $Date: 17. January 2013
5* $Revision: V1.4.0
6*
7* Project: CMSIS DSP Library
8 * Title: arm_fir_example_f32.c
9 *
10 * Description: Example code demonstrating how an FIR filter can be used
11 * as a low pass filter.
12 *
13 * Target Processor: Cortex-M4/Cortex-M3
14 *
15* Redistribution and use in source and binary forms, with or without
16* modification, are permitted provided that the following conditions
17* are met:
18* - Redistributions of source code must retain the above copyright
19* notice, this list of conditions and the following disclaimer.
20* - Redistributions in binary form must reproduce the above copyright
21* notice, this list of conditions and the following disclaimer in
22* the documentation and/or other materials provided with the
23* distribution.
24* - Neither the name of ARM LIMITED nor the names of its contributors
25* may be used to endorse or promote products derived from this
26* software without specific prior written permission.
27*
28* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39* POSSIBILITY OF SUCH DAMAGE.
40* -------------------------------------------------------------------- */
41/* ----------------------------------------------------------------------
42** Include Files
43** ------------------------------------------------------------------- */
44#include "at32f415.h"
45#include "arm_math.h"
46#include "fir_filter.h"
47/* ----------------------------------------------------------------------
48** Macro Defines
49** ------------------------------------------------------------------- */
50
51#define NUM_TAPS 29
52
53/* ----------------------------------------------------------------------
54** FIR Coefficients buffer generated using fir1() MATLAB function.
55** fir1(28, 6/24)
56** ------------------------------------------------------------------- */
57//#if defined ( __ICCARM__ )
58//const float32_t firCoeffs32[NUM_TAPS] @ 0x08002000 ={
59//#elif defined ( __CC_ARM )
60//const float32_t firCoeffs32[NUM_TAPS] __attribute__((at(0x08002000))) = {
61//#endif
62const float32_t firCoeffs32[NUM_TAPS] = {
63 -0.0018225230f, -0.0015879294f, +0.0000000000f, +0.0036977508f, +0.0080754303f, +0.0085302217f, -0.0000000000f, -0.0173976984f,
64 -0.0341458607f, -0.0333591565f, +0.0000000000f, +0.0676308395f, +0.1522061835f, +0.2229246956f, +0.2504960933f, +0.2229246956f,
65 +0.1522061835f, +0.0676308395f, +0.0000000000f, -0.0333591565f, -0.0341458607f, -0.0173976984f, -0.0000000000f, +0.0085302217f,
66 +0.0080754303f, +0.0036977508f, +0.0000000000f, -0.0015879294f, -0.0018225230f
67};
68
at32f415.h
at32f415 header file
firCoeffs32
const float32_t firCoeffs32[29]
Definition: fir_coefficient.c:62
NUM_TAPS
#define NUM_TAPS
Definition: fir_coefficient.c:51


AT32F415 Firmwary Library: fir_filter.c Source File

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
fir_filter.c
Go to the documentation of this file.
1/* ----------------------------------------------------------------------
2 * Copyright (C) 2010-2012 ARM Limited. All rights reserved.
3 *
4* $Date: 17. January 2013
5* $Revision: V1.4.0
6*
7* Project: CMSIS DSP Library
8 * Title: arm_fir_example_f32.c
9 *
10 * Description: Example code demonstrating how an FIR filter can be used
11 * as a low pass filter.
12 *
13 * Target Processor: Cortex-M4/Cortex-M3
14 *
15* Redistribution and use in source and binary forms, with or without
16* modification, are permitted provided that the following conditions
17* are met:
18* - Redistributions of source code must retain the above copyright
19* notice, this list of conditions and the following disclaimer.
20* - Redistributions in binary form must reproduce the above copyright
21* notice, this list of conditions and the following disclaimer in
22* the documentation and/or other materials provided with the
23* distribution.
24* - Neither the name of ARM LIMITED nor the names of its contributors
25* may be used to endorse or promote products derived from this
26* software without specific prior written permission.
27*
28* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39* POSSIBILITY OF SUCH DAMAGE.
40* -------------------------------------------------------------------- */
41/* ----------------------------------------------------------------------
42** Include Files
43** ------------------------------------------------------------------- */
44#include "at32f415.h"
45#include "arm_math.h"
46#include "fir_filter.h"
47
48extern const float32_t firCoeffs32[];
49
50/* ----------------------------------------------------------------------
51** Macro Defines
52** ------------------------------------------------------------------- */
53#define BLOCK_SIZE 32
54#define NUM_TAPS 29
55
56/* -------------------------------------------------------------------
57 * Declare State buffer of size (numTaps + blockSize - 1)
58 * ------------------------------------------------------------------- */
59
60
61//#if defined ( __ICCARM__ )
62//static float32_t firStateF32[BLOCK_SIZE + NUM_TAPS - 1] @ 0x20017000 ;
63//#elif defined ( __CC_ARM )
64//static float32_t firStateF32[BLOCK_SIZE + NUM_TAPS - 1] __attribute__((at(0x20017000)));
65//#endif
66static float32_t firStateF32[BLOCK_SIZE + NUM_TAPS - 1] ;
67
68/* ----------------------------------------------------------------------
69** FIR Coefficients buffer generated using fir1() MATLAB function.
70** fir1(28, 6/24)
71** ------------------------------------------------------------------- */
72
73/* ----------------------------------------------------------------------
74 * FIR LPF Example
75 * ------------------------------------------------------------------- */
76void FIR_lowpass_filter(float32_t * pSrc, float32_t * pDst, uint32_t testlengthsamples)
77{
78 uint32_t i;
79 uint32_t blockSize = BLOCK_SIZE;
80 uint32_t numBlocks = testlengthsamples/BLOCK_SIZE;
81 arm_fir_instance_f32 S;
82
83
84 /* Call FIR init function to initialize the instance structure. */
85 arm_fir_init_f32(&S, NUM_TAPS, (float32_t *)&firCoeffs32[0], &firStateF32[0], blockSize);
86 /* ----------------------------------------------------------------------
87 ** Call the FIR process function for every blockSize samples
88 ** ------------------------------------------------------------------- */
89 for(i=0; i < numBlocks; i++)
90 {
91 arm_fir_f32(&S, pSrc + (i * blockSize), pDst + (i * blockSize), blockSize);
92 }
93
94}
at32f415.h
at32f415 header file
firCoeffs32
const float32_t firCoeffs32[]
Definition: fir_coefficient.c:62
firStateF32
static float32_t firStateF32[32+29 - 1]
Definition: fir_filter.c:66
NUM_TAPS
#define NUM_TAPS
Definition: fir_filter.c:54
BLOCK_SIZE
#define BLOCK_SIZE
Definition: fir_filter.c:53
FIR_lowpass_filter
void FIR_lowpass_filter(float32_t *pSrc, float32_t *pDst, uint32_t testlengthsamples)
Definition: fir_filter.c:76
arm_fir_f32
void arm_fir_f32(const arm_fir_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
arm_fir_init_f32
void arm_fir_init_f32(arm_fir_instance_f32 *S, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR filter.
Definition: arm_fir_init_f32.c:57


AT32F415 Firmwary Library: flash_fat16.c Source File

  • usb_device
  • virtual_msc_iap
  • src
flash_fat16.c
Go to the documentation of this file.
1
26#include "flash_fat16.h"
27#include "usb_conf.h"
28
36#define FAT16_SECTOR_SIZE 62
37static uint8_t fat16_sector[FAT16_SECTOR_SIZE] =
38{
39 0xEB, /*00 - BS_jmpBoot */
40 0x3C, /*01 - BS_jmpBoot */
41 0x90, /*02 - BS_jmpBoot */
42 'M','S','D','O','S','5','.','0', /* 03-10 - BS_OEMName */
43 0x00, /*11 - BPB_BytesPerSec = 2048 */
44 0x08, /*11 - BPB_BytesPerSec = 2048 */
45 0x04, /*13 - BPB_Sec_PerClus = 2K*4 = 8K*/
46 2, /*14 - BPB_RsvdSecCnt = 2 */
47 0, /*15 - BPB_RsvdSecCnt = 2 */
48 2, /*16 - BPB_NumFATs = 2 */
49 0x0, /*17 - BPB_RootEntCnt = 512 */
50 0x2, /*18 - BPB_RootEntCnt = 512 */
51 0, /*19 - BPB_TotSec16 = 0 */
52 0, /*20 - BPB_TotSec16 = 0 */
53 0xF8, /*21 - BPB_Media = 0xF8 */
54 0x0D, /*22 - BPBFATSz16 = 0x000D */
55 0, /*23 - BPBFATSz16 = 0x000D */
56 0x3F, /*24 - BPB_SecPerTrk = 0x003F */
57 0, /*25 - BPB_SecPerTrk = 0x003F */
58 0xFF, /*26 - BPB_NumHeads = 255 */
59 0, /*27 - BPB_NumHeads = 255 */
60 0, /*28 - BPB_HiddSec = 0 */
61 0, /*29 - BPB_HiddSec = 0 */
62 0, /*30 - BPB_HiddSec = 0 */
63 0, /*31 - BPB_HiddSec = 0 */
64 0x00, /*32 - BPB_TotSec32 = */
65 0xC8, /*33 - BPB_TotSec32 = 0x0000C800 100Mb*/
66 0x00, /*34 - BPB_TotSec32 = */
67 0x00, /*35 - BPB_TotSec32 = */
68 0x80, /*36 - BS_DrvNum = 0x80 */
69 0, /*37 - BS_Reserved1 = 0 , dirty bit = 0*/ /* Updated from FSL*/
70 0x29, /*38 - BS_BootSig = 0x29 */
71 0xBD, /*39 - BS_VolID = 0x02DDA5BD */
72 0xA5, /*40 - BS_VolID = 0x02DDA5BD */
73 0xDD, /*41 - BS_VolID = 0x02DDA5BD */
74 0x02, /*42 - BS_VolID = 0x02DDA5BD */
75 'N','O',' ','N','A','M','E',' ',' ',' ',' ',/*43-53 - BS_VolLab */
76 'F','A','T','1','6',' ',' ',' ' /*54-61 - BS_FilSysType */
77};
78
79
80const uint8_t fat16_root_dir_sector[FAT16_DIR_SIZE]=
81{
82 0x20, /*11 - Archive Attribute set */
83 0x00, /*12 - Reserved */
84 0x4B, /*13 - Create Time Tenth */
85 0x9C, /*14 - Create Time */
86 0x42, /*15 - Create Time */
87 0x92, /*16 - Create Date */
88 0x38, /*17 - Create Date */
89 0x92, /*18 - Last Access Date */
90 0x38, /*19 - Last Access Date */
91 0x00, /*20 - Not used in FAT16 */
92 0x00, /*21 - Not used in FAT16 */
93 0x9D, /*22 - Write Time */
94 0x42, /*23 - Write Time */
95 0x92, /*24 - Write Date */
96 0x38, /*25 - Write Date */
97 0x00, /*26 - First Cluster (none, because file is empty) */
98 0x00, /*27 - First Cluster (none, because file is empty) */
99 0x00, /*28 - File Size */
100 0x00, /*29 - File Size */
101 0x00, /*30 - File Size */
102 0x00, /*31 - File Size */
103 'A','T','3','2',' ','I','A','P',' ',' ',' ', /*32-42 - Volume label */
104 0x08, /*43 - File attribute = Volume label */
105 0x00, /*44 - Reserved */
106 0x00, /*45 - Create Time Tenth */
107 0x00, /*46 - Create Time */
108 0x00, /*47 - Create Time */
109 0x00, /*48 - Create Date */
110 0x00, /*49 - Create Date */
111 0x00, /*50 - Last Access Date */
112 0x00, /*51 - Last Access Date */
113 0x00, /*52 - Not used in FAT16 */
114 0x00, /*53 - Not used in FAT16 */
115 0x9D, /*54 - Write Time */
116 0x42, /*55 - Write Time */
117 0x92, /*56 - Write Date */
118 0x38, /*57 - Write Date */
119};
120
121const uint8_t fat16_table_sector0[FAT16_TABLE_SIZE] =
122{
123 0xF8,
124 0xFF,
125 0xFF,
126 0xFF
127};
128
129uint8_t fat16_file_name[FAT16_FILENAME_SIZE] =
130{
131 'R',
132 'e',
133 'a',
134 'd',
135 'y',
136 ' ',
137 ' ',
138 ' ',
139 'T',
140 'X',
141 'T'
142};
143
144 fat_dir_type g_file_attr;
145 flash_iap_type flash_iap;
146uint32_t file_write_nr = 0;
147
148
149uint32_t flash_fat16_boot_sector_addr = 0x00;
150uint32_t flash_fat16_1_addr = 0x1000;
151uint32_t flash_fat16_2_addr = 0x7800;
152uint32_t flash_fat16_root_addr = 0xE000;
153uint32_t flash_fat16_file_start_addr = 0x12000;
154
155uint32_t flash_fat16_boot_dir_write(uint32_t fat_lbk, uint8_t *data, uint32_t len);
156uint32_t flash_fat16_sector_write(uint32_t fat_lbk, uint8_t *data, uint32_t len);
157uint32_t fat16_memory_copy(uint8_t *dst, const uint8_t *src, uint32_t len);
158uint32_t fat16_memory_memset(uint8_t *dst, uint32_t set, uint32_t len);
159uint32_t flash_write_data(uint32_t address, uint8_t *data, uint32_t len);
160uint32_t flash_read_data(uint32_t address, uint8_t *data, uint32_t len);
161uint32_t fat16_memory_cmp(uint8_t *dst, uint8_t *src, uint32_t len);
162uint32_t flash_crc_check(uint32_t address, uint8_t *data, uint32_t len);
163void flash_fat16_clear_upgrade_flag(void);
164void flash_fat16_set_upgrade_flag(void);
165
173uint32_t fat16_memory_copy(uint8_t *dst, const uint8_t *src, uint32_t len)
174{
175 uint32_t i_index;
176 for(i_index = 0; i_index < len; i_index ++)
177 {
178 dst[i_index] = src[i_index];
179 }
180 return i_index;
181}
182
190uint32_t fat16_memory_memset(uint8_t *dst, uint32_t set, uint32_t len)
191{
192 uint32_t i_index;
193 for(i_index = 0; i_index < len; i_index ++)
194 {
195 dst[i_index] = (uint8_t)set;
196 }
197 return i_index;
198}
199
207uint32_t fat16_memory_cmp(uint8_t *dst, uint8_t *src, uint32_t len)
208{
209 uint32_t i_index;
210 for(i_index = 0; i_index < len; i_index ++)
211 {
212 if(dst[i_index] != src[i_index])
213 return 1;
214 }
215 return 0;
216}
217
223void flash_fat16_clear_upgrade_flag(void)
224{
225 flash_unlock();
226 flash_sector_erase(flash_iap.flash_app_addr - flash_iap.sector_size);
227 flash_lock();
228}
229
235void flash_fat16_set_upgrade_flag(void)
236{
237 flash_unlock();
238 flash_word_program(flash_iap.flash_app_addr - flash_iap.sector_size,
239 IAP_UPGRADE_COMPLETE_FLAG);
240 flash_lock();
241}
242
248uint8_t flash_fat16_get_upgrade_flag(void)
249{
250 uint32_t flag_address = flash_iap.flash_app_addr - flash_iap.sector_size;
251 if(*((uint32_t *)flag_address) == IAP_UPGRADE_COMPLETE_FLAG)
252 {
253 return IAP_SUCCESS;
254 }
255 else
256 {
257 return IAP_ERROR;
258 }
259}
260
261
269uint32_t flash_fat16_read(uint32_t fat_lbk, uint8_t *data, uint32_t len)
270{
271 uint32_t i_index = 0;
272 if(fat_lbk == flash_fat16_boot_sector_addr)
273 {
274 i_index += fat16_memory_copy(data, fat16_sector, FAT16_SECTOR_SIZE);
275 i_index += 2;
276
277 fat16_memory_memset(data+i_index, 0, FAT16_BYTE_PER_SIZE-i_index);
278 }
279 else if((fat_lbk == flash_fat16_1_addr) ||
280 (fat_lbk == flash_fat16_2_addr))
281 {
282 i_index += fat16_memory_copy(data, fat16_table_sector0, FAT16_TABLE_SIZE);
283
284 fat16_memory_memset(data+i_index, 0, FAT16_BYTE_PER_SIZE-i_index);
285 }
286 else if(fat_lbk == flash_fat16_root_addr)
287 {
288 i_index += fat16_memory_copy(data, fat16_file_name, FAT16_FILENAME_SIZE);
289 i_index += fat16_memory_copy(data + i_index, fat16_root_dir_sector, FAT16_DIR_SIZE);
290
291 fat16_memory_memset(data+i_index, 0, FAT16_BYTE_PER_SIZE-i_index);
292 }
293 else
294 {
295 i_index = 0;
296 fat16_memory_memset(data+i_index, 0, FAT16_BYTE_PER_SIZE-i_index);
297 }
298 return FAT16_BYTE_PER_SIZE;
299}
300
308uint32_t flash_fat16_write(uint32_t fat_lbk, uint8_t *data, uint32_t len)
309{
310 if(fat_lbk == flash_fat16_root_addr)
311 {
312 flash_fat16_boot_dir_write(fat_lbk, data, len);
313 }
314 else
315 {
316 if(fat_lbk >= flash_fat16_file_start_addr)
317 {
318 flash_fat16_sector_write(fat_lbk, data, len);
319 }
320 }
321
322 return len;
323}
324
331uint32_t flash_fat16_set_name(const uint8_t *file_name, uint8_t len)
332{
333 uint8_t i_index = 0;
334 for(i_index = 0; i_index < len && i_index < 8; i_index ++)
335 {
336 fat16_file_name[i_index] = file_name[i_index];
337 }
338
339 for(; i_index < 8; i_index ++)
340 {
341 fat16_file_name[i_index] = ' ';
342 }
343 return i_index;
344}
345
353uint32_t flash_fat16_boot_dir_write(uint32_t fat_lbk, uint8_t *data, uint32_t len)
354{
355 fat_dir_type *pdir = (fat_dir_type *)data;
356 uint32_t i_index = 2, loop_len = 0;
357
358 pdir ++;
359 pdir ++;
360 loop_len += 64;
361
362 while(i_index ++ < 512 && loop_len < len)
363 {
364 if((pdir->attr == 0x20) && ((pdir + 1)->attr == 0x00))
365 {
366 break;
367 }
368 else
369 {
370 pdir ++;
371 }
372 loop_len += 32;
373 }
374
375 if(i_index <= 512 && loop_len < len)
376 {
377 fat16_memory_copy((uint8_t *)&g_file_attr, (const uint8_t *)pdir, 32);
378 g_file_attr.write_data = 0;
379 g_file_attr.write_time = 0;
380 flash_iap.file_write_nr = 0;
381 }
382 else
383 {
384 fat16_memory_memset((uint8_t *)&g_file_attr, 0, 32);
385 }
386 return len;
387}
388
394uint32_t flash_fat16_addr_offset(uint8_t *file_name)
395{
396 uint8_t i_index = 0, offset_shift = 20;
397 uint32_t offset = 0;
398 uint8_t *pfile = file_name;
399
400 if(*pfile != 'A')
401 {
402 return INVAILD_OFFSET_ADDR;
403 }
404 pfile += 1;
405
406 for(i_index = 0; i_index < 6; i_index ++)
407 {
408 if(*pfile >= '0' && *pfile <= '9')
409 {
410 offset |= (*pfile - '0') << offset_shift;
411 }
412 else if(*pfile >= 'A' && *pfile <= 'F')
413 {
414 offset |= (*pfile - 'A' + 0xA) << offset_shift;
415 }
416 else if(*pfile >= 'a' && *pfile <= 'f')
417 {
418 offset |= (*pfile - 'a' + 0xA) << offset_shift;
419 }
420 else
421 {
422 return INVAILD_OFFSET_ADDR;
423 }
424 pfile ++;
425 offset_shift -= 4;
426 }
427
428 if((offset < (flash_iap.flash_app_addr - flash_iap.flash_base_addr)) ||
429 (offset > flash_iap.flash_size ))
430 {
431 return INVAILD_OFFSET_ADDR;
432 }
433 return offset;
434}
435
443uint32_t flash_fat16_sector_write(uint32_t fat_lbk, uint8_t *data, uint32_t len)
444{
445 uint32_t file_size = g_file_attr.file_size;
446 uint32_t flash_offset = 0;
447 uint32_t status;
448
449 /* check the suffix is .bin or .BIN*/
450 if((fat16_memory_cmp((uint8_t *)&g_file_attr.file_name[8],
451 (uint8_t *)FILE_SUFFIX1_NAME, FILE_SUFFIX1_LEN) == 0) ||
452 (fat16_memory_cmp((uint8_t *)&g_file_attr.file_name[8],
453 (uint8_t *)FILE_SUFFIX2_NAME, FILE_SUFFIX2_LEN) == 0))
454 {
455 /* check the upgrade status */
456 if(flash_iap.msc_up_status == UPGRADE_DONE || flash_iap.msc_up_status == UPGRADE_SUCCESS)
457 {
458 return 0;
459 }
460
461 if(flash_iap.msc_up_status == UPGRADE_READY)
462 {
463 /* get offset address from filename */
464 flash_offset = flash_fat16_addr_offset(g_file_attr.file_name);
465
466 if(flash_offset == INVAILD_OFFSET_ADDR)
467 {
468 /* use default app address */
469 flash_iap.write_addr = FLASH_APP_START_ADDR;
470 }
471 else
472 {
473 flash_iap.write_addr = flash_offset + flash_iap.flash_base_addr;
474 }
475 /* clear upgrade flag */
476 flash_fat16_clear_upgrade_flag();
477
478 flash_iap.msc_up_status = UPGRAGE_ONGOING;
479 }
480
481 if(flash_iap.flash_app_size >= g_file_attr.file_size)
482 {
483 if((flash_iap.file_write_nr + len) >= file_size)
484 {
485 len = file_size - flash_iap.file_write_nr;
486 }
487 /* write data to flash and check crc */
488 status = flash_write_data(flash_iap.write_addr + flash_iap.file_write_nr, data, len);
489
490 flash_iap.file_write_nr += len;
491
492 if(status == 0)
493 {
494 if(flash_iap.file_write_nr >= file_size)
495 {
496 /* upgrade finish */
497 flash_iap.file_write_nr = 0;
498 flash_iap.msc_up_status = UPGRADE_SUCCESS;
499
500 /* set the upgrade done flag to flash */
501 flash_fat16_set_upgrade_flag();
502 }
503 }
504 else
505 {
506 /* upgrade error */
507 flash_iap.file_write_nr = 0;
508 flash_iap.msc_up_status = UPGRADE_ERROR;
509 }
510 }
511 else
512 {
513 /* upgrade file is large than flash size */
514 flash_iap.msc_up_status = UPGRADE_LARGE;
515 }
516
517 }
518 else if((fat16_memory_cmp((uint8_t *)&g_file_attr.file_name[0],
519 (uint8_t *)"JUMP", 4) == 0))
520 {
521 /* receive jump command file */
522 flash_iap.msc_up_status = UPGRADE_JUMP;
523 }
524 else
525 {
526 /* unkonw upgrade status */
527 flash_iap.msc_up_status = UPGRADE_UNKNOWN;
528 }
529
530 return len;
531}
532
540uint32_t flash_crc_check(uint32_t address, uint8_t *data, uint32_t len)
541{
542 uint32_t flash_crc = 0;
543 uint32_t data_crc = 0;
544 uint32_t i_index = 0;
545 uint32_t wlen = len / sizeof(uint32_t);
546 uint32_t remain_len = len % sizeof(uint32_t);
547 uint32_t *u32data = (uint32_t *)data;
548 uint32_t *flash_addr = (uint32_t *)address;
549
550 /* enable crc clock */
551 crm_periph_clock_enable(CRM_CRC_PERIPH_CLOCK, TRUE);
552
553 if(remain_len)
554 {
555 wlen += 1;
556 for(i_index = 0; i_index < remain_len; i_index ++)
557 {
558 data[len+i_index] = 0xFF;
559 }
560 }
561
562 /* calculate write buffer */
563 crc_data_reset();
564 for(i_index = 0; i_index < wlen; i_index ++)
565 {
566 data_crc = crc_one_word_calculate(u32data[i_index]);
567 }
568
569 /* calculate flash data */
570 crc_data_reset();
571 for(i_index = 0; i_index < wlen; i_index ++)
572 {
573 flash_crc = crc_one_word_calculate(*flash_addr++);
574 }
575 crm_periph_clock_enable(CRM_CRC_PERIPH_CLOCK, FALSE);
576
577 if(data_crc != flash_crc)
578 return 1;
579
580 return 0;
581
582}
583
591uint32_t flash_read_data(uint32_t address, uint8_t *data, uint32_t len)
592{
593 uint32_t i_index;
594 for(i_index = 0; i_index < len; i_index ++)
595 {
596 data[i_index] = *(uint8_t *)address;
597 address += 1;
598 }
599 return i_index;
600}
601
602
610uint32_t flash_write_data(uint32_t address, uint8_t *data, uint32_t len)
611{
612 uint32_t waddr = address;
613 uint32_t wlength = len;
614 uint32_t i_index = 0;
615 if((address + len) > flash_iap.flash_base_addr + flash_iap.flash_size)
616 {
617 return 1;
618 }
619
620 if((waddr & flash_iap.sector_mask) == 0)
621 {
622 flash_unlock();
623 if(len > flash_iap.sector_size)
624 {
625 for(; wlength >= flash_iap.sector_size; wlength -= flash_iap.sector_size)
626 {
627 flash_sector_erase(waddr);
628 waddr += flash_iap.sector_size;
629 }
630 if(wlength > 0)
631 {
632 flash_sector_erase(waddr);
633 }
634 }
635 else
636 {
637 flash_sector_erase(waddr);
638 }
639
640 flash_lock();
641 }
642
643 waddr = address;
644 flash_unlock();
645 for(i_index = 0; i_index < len; i_index ++)
646 {
647 flash_byte_program(waddr+i_index, data[i_index]);
648 }
649 flash_lock();
650
651 return flash_crc_check(address, data, len);
652}
653
659void flash_fat16_init(void)
660{
661 uint32_t flash_size = *(uint32_t *)0x1FFFF7E0;
662
663 if(flash_size < 0x100)
664 {
665 flash_iap.sector_size = FLASH_SECTOR_1K_SIZE;
666 flash_iap.sector_mask = FLASH_SECTOR_1K_ALLGNED;
667 }
668 else
669 {
670 flash_iap.sector_size = FLASH_SECTOR_2K_SIZE;
671 flash_iap.sector_mask = FLASH_SECTOR_2K_ALLGNED;
672 }
673
674 flash_iap.flash_base_addr = FLASH_BASE;
675 flash_iap.flash_app_addr = FLASH_APP_START_ADDR;
676 flash_iap.write_addr = FLASH_APP_START_ADDR;
677 flash_iap.flash_size = flash_size << 10;
678
679 flash_iap.flash_app_size = flash_iap.flash_size -
680 (flash_iap.flash_app_addr -
681 flash_iap.flash_base_addr);
682
683 flash_fat16_1_addr = flash_iap.sector_size * 2;
684 flash_fat16_2_addr = flash_iap.sector_size * 15;
685 flash_fat16_root_addr = flash_iap.sector_size * 28;
686 flash_fat16_file_start_addr = flash_iap.sector_size * 32;
687
688 fat16_sector[11] = (uint8_t)(flash_iap.sector_size & 0xFF);
689 fat16_sector[12] = (uint8_t)((flash_iap.sector_size >> 8) & 0xFF);
690
691}
692
693
694
flash_fat16.h
fat16 file system header file
flash_fat16_file_start_addr
uint32_t flash_fat16_file_start_addr
Definition: flash_fat16.c:153
flash_fat16_set_name
uint32_t flash_fat16_set_name(const uint8_t *file_name, uint8_t len)
set file name
Definition: flash_fat16.c:331
FAT16_SECTOR_SIZE
#define FAT16_SECTOR_SIZE
Definition: flash_fat16.c:36
g_file_attr
fat_dir_type g_file_attr
Definition: flash_fat16.c:144
flash_fat16_root_addr
uint32_t flash_fat16_root_addr
Definition: flash_fat16.c:152
fat16_sector
static uint8_t fat16_sector[62]
Definition: flash_fat16.c:37
flash_read_data
uint32_t flash_read_data(uint32_t address, uint8_t *data, uint32_t len)
read data from flash
Definition: flash_fat16.c:591
fat16_root_dir_sector
const uint8_t fat16_root_dir_sector[FAT16_DIR_SIZE]
Definition: flash_fat16.c:80
file_write_nr
uint32_t file_write_nr
Definition: flash_fat16.c:146
flash_fat16_boot_sector_addr
uint32_t flash_fat16_boot_sector_addr
Definition: flash_fat16.c:149
flash_fat16_addr_offset
uint32_t flash_fat16_addr_offset(uint8_t *file_name)
get offset address
Definition: flash_fat16.c:394
fat16_table_sector0
const uint8_t fat16_table_sector0[FAT16_TABLE_SIZE]
Definition: flash_fat16.c:121
flash_fat16_clear_upgrade_flag
void flash_fat16_clear_upgrade_flag(void)
clear iap upgrade flag
Definition: flash_fat16.c:223
flash_fat16_get_upgrade_flag
uint8_t flash_fat16_get_upgrade_flag(void)
get iap upgrade complete flag
Definition: flash_fat16.c:248
fat16_memory_memset
uint32_t fat16_memory_memset(uint8_t *dst, uint32_t set, uint32_t len)
memset function
Definition: flash_fat16.c:190
flash_fat16_1_addr
uint32_t flash_fat16_1_addr
Definition: flash_fat16.c:150
flash_iap
flash_iap_type flash_iap
Definition: flash_fat16.c:145
flash_crc_check
uint32_t flash_crc_check(uint32_t address, uint8_t *data, uint32_t len)
crc check
Definition: flash_fat16.c:540
flash_fat16_write
uint32_t flash_fat16_write(uint32_t fat_lbk, uint8_t *data, uint32_t len)
write a logical block address
Definition: flash_fat16.c:308
fat16_memory_cmp
uint32_t fat16_memory_cmp(uint8_t *dst, uint8_t *src, uint32_t len)
memory compare function
Definition: flash_fat16.c:207
flash_fat16_sector_write
uint32_t flash_fat16_sector_write(uint32_t fat_lbk, uint8_t *data, uint32_t len)
write sector
Definition: flash_fat16.c:443
flash_fat16_set_upgrade_flag
void flash_fat16_set_upgrade_flag(void)
set iap upgrade complete flag
Definition: flash_fat16.c:235
flash_write_data
uint32_t flash_write_data(uint32_t address, uint8_t *data, uint32_t len)
write data to flash
Definition: flash_fat16.c:610
flash_fat16_2_addr
uint32_t flash_fat16_2_addr
Definition: flash_fat16.c:151
fat16_memory_copy
uint32_t fat16_memory_copy(uint8_t *dst, const uint8_t *src, uint32_t len)
memory copy function
Definition: flash_fat16.c:173
flash_fat16_init
void flash_fat16_init(void)
flash fat16 iap init
Definition: flash_fat16.c:659
flash_fat16_boot_dir_write
uint32_t flash_fat16_boot_dir_write(uint32_t fat_lbk, uint8_t *data, uint32_t len)
boot dir write
Definition: flash_fat16.c:353
flash_fat16_read
uint32_t flash_fat16_read(uint32_t fat_lbk, uint8_t *data, uint32_t len)
read a logical block address
Definition: flash_fat16.c:269
fat16_file_name
uint8_t fat16_file_name[FAT16_FILENAME_SIZE]
Definition: flash_fat16.c:129
crc_data_reset
void crc_data_reset(void)
reset the crc data register.
Definition: at32f415_crc.c:49
crc_one_word_calculate
uint32_t crc_one_word_calculate(uint32_t data)
compute the 32-bit crc of a given data word(32-bit).
Definition: at32f415_crc.c:60
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_CRC_PERIPH_CLOCK
@ CRM_CRC_PERIPH_CLOCK
Definition: at32f415_crm.h:105
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
flash_sector_erase
flash_status_type flash_sector_erase(uint32_t sector_address)
erase a specified flash sector.
Definition: at32f415_flash.c:173
flash_byte_program
flash_status_type flash_byte_program(uint32_t address, uint8_t data)
program a byte at a specified address.
Definition: at32f415_flash.c:342
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
flash_word_program
flash_status_type flash_word_program(uint32_t address, uint32_t data)
program a word at a specified address.
Definition: at32f415_flash.c:288
flash_lock
void flash_lock(void)
lock the flash controller.
Definition: at32f415_flash.c:162
FLASH_BASE
#define FLASH_BASE
Definition: at32f415.h:285
FLASH_APP_START_ADDR
#define FLASH_APP_START_ADDR
Definition: flash_fat16.h:60
FLASH_SECTOR_1K_ALLGNED
#define FLASH_SECTOR_1K_ALLGNED
Definition: flash_fat16.h:66
FAT16_TABLE_SIZE
#define FAT16_TABLE_SIZE
Definition: flash_fat16.h:49
INVAILD_OFFSET_ADDR
#define INVAILD_OFFSET_ADDR
Definition: flash_fat16.h:75
FAT16_DIR_SIZE
#define FAT16_DIR_SIZE
Definition: flash_fat16.h:52
FLASH_SECTOR_2K_SIZE
#define FLASH_SECTOR_2K_SIZE
Definition: flash_fat16.h:63
FILE_SUFFIX1_NAME
#define FILE_SUFFIX1_NAME
Definition: flash_fat16.h:72
FILE_SUFFIX2_LEN
#define FILE_SUFFIX2_LEN
Definition: flash_fat16.h:71
FLASH_SECTOR_2K_ALLGNED
#define FLASH_SECTOR_2K_ALLGNED
Definition: flash_fat16.h:67
FILE_SUFFIX1_LEN
#define FILE_SUFFIX1_LEN
Definition: flash_fat16.h:70
IAP_ERROR
#define IAP_ERROR
Definition: flash_fat16.h:78
FAT16_BYTE_PER_SIZE
#define FAT16_BYTE_PER_SIZE
Definition: flash_fat16.h:50
FILE_SUFFIX2_NAME
#define FILE_SUFFIX2_NAME
Definition: flash_fat16.h:73
FAT16_FILENAME_SIZE
#define FAT16_FILENAME_SIZE
Definition: flash_fat16.h:51
FLASH_SECTOR_1K_SIZE
#define FLASH_SECTOR_1K_SIZE
Definition: flash_fat16.h:62
UPGRADE_ERROR
@ UPGRADE_ERROR
Definition: flash_fat16.h:85
UPGRADE_LARGE
@ UPGRADE_LARGE
Definition: flash_fat16.h:86
UPGRADE_UNKNOWN
@ UPGRADE_UNKNOWN
Definition: flash_fat16.h:87
UPGRADE_JUMP
@ UPGRADE_JUMP
Definition: flash_fat16.h:89
UPGRADE_SUCCESS
@ UPGRADE_SUCCESS
Definition: flash_fat16.h:84
UPGRADE_READY
@ UPGRADE_READY
Definition: flash_fat16.h:82
UPGRAGE_ONGOING
@ UPGRAGE_ONGOING
Definition: flash_fat16.h:83
UPGRADE_DONE
@ UPGRADE_DONE
Definition: flash_fat16.h:88
IAP_UPGRADE_COMPLETE_FLAG
#define IAP_UPGRADE_COMPLETE_FLAG
Definition: hid_iap_class.h:90
IAP_SUCCESS
@ IAP_SUCCESS
Definition: hid_iap_class.h:99
fat_dir_type
Definition: flash_fat16.h:93
fat_dir_type::write_data
uint16_t write_data
Definition: flash_fat16.h:103
fat_dir_type::file_size
uint32_t file_size
Definition: flash_fat16.h:105
fat_dir_type::write_time
uint16_t write_time
Definition: flash_fat16.h:102
fat_dir_type::file_name
uint8_t file_name[11]
Definition: flash_fat16.h:94
fat_dir_type::attr
uint8_t attr
Definition: flash_fat16.h:95
flash_iap_type
Definition: flash_fat16.h:109
flash_iap_type::flash_size
uint32_t flash_size
Definition: flash_fat16.h:112
flash_iap_type::msc_up_status
upgrade_status_type msc_up_status
Definition: flash_fat16.h:122
flash_iap_type::flash_base_addr
uint32_t flash_base_addr
Definition: flash_fat16.h:110
flash_iap_type::sector_size
uint32_t sector_size
Definition: flash_fat16.h:114
flash_iap_type::sector_mask
uint32_t sector_mask
Definition: flash_fat16.h:115
flash_iap_type::file_write_nr
uint32_t file_write_nr
Definition: flash_fat16.h:121
flash_iap_type::flash_app_size
uint32_t flash_app_size
Definition: flash_fat16.h:113
flash_iap_type::write_addr
uint32_t write_addr
Definition: flash_fat16.h:120
flash_iap_type::flash_app_addr
uint32_t flash_app_addr
Definition: flash_fat16.h:111


AT32F415 Firmwary Library: flash_fat16.h Source File

  • usb_device
  • virtual_msc_iap
  • inc
flash_fat16.h
Go to the documentation of this file.
1
26/* Define to prevent recursive inclusion -------------------------------------*/
27#ifndef __FLASH_FAT16_H
28#define __FLASH_FAT16_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34
35#include "usb_conf.h"
36
48#define FAT16_SECTOR_SIZE 62
49#define FAT16_TABLE_SIZE 4
50#define FAT16_BYTE_PER_SIZE 2048
51#define FAT16_FILENAME_SIZE 11
52#define FAT16_DIR_SIZE 47
53
54#define FLASH_FAT16_BOOT_SECTOR_ADDR 0x00
55#define FLASH_FAT16_1_ADDR 0x1000
56#define FLASH_FAT16_2_ADDR 0x7800
57#define FLASH_FAT16_ROOT_ADDR 0xE000
58#define FLASH_FAT16_FILE_START_ADDR 0x12000
59
60#define FLASH_APP_START_ADDR 0x08006000
61
62#define FLASH_SECTOR_1K_SIZE 0x400
63#define FLASH_SECTOR_2K_SIZE 0x800
64#define FLASH_SECTOR_4K_SIZE 0x1000
65
66#define FLASH_SECTOR_1K_ALLGNED 0x3FF
67#define FLASH_SECTOR_2K_ALLGNED 0x7FF
68#define FLASH_SECTOR_4K_ALLGNED 0xFFF
69
70#define FILE_SUFFIX1_LEN 3
71#define FILE_SUFFIX2_LEN 3
72#define FILE_SUFFIX1_NAME "BIN"
73#define FILE_SUFFIX2_NAME "bin"
74
75#define INVAILD_OFFSET_ADDR 0xFFFFFFFF
76#define IAP_UPGRADE_COMPLETE_FLAG 0x41544B38
77#define IAP_SUCCESS 0
78#define IAP_ERROR 1
79
80typedef enum
81{
82 UPGRADE_READY = 0,
83 UPGRAGE_ONGOING,
84 UPGRADE_SUCCESS,
85 UPGRADE_ERROR,
86 UPGRADE_LARGE,
87 UPGRADE_UNKNOWN,
88 UPGRADE_DONE,
89 UPGRADE_JUMP
90}upgrade_status_type;
91
92typedef struct
93{
94 uint8_t file_name[11];
95 uint8_t attr;
96 uint8_t res;
97 uint8_t create_time_tenth;
98 uint16_t create_time;
99 uint16_t create_data;
100 uint16_t last_access_data;
101 uint16_t clus_high;
102 uint16_t write_time;
103 uint16_t write_data;
104 uint16_t clus_low;
105 uint32_t file_size;
106}fat_dir_type;
107
108typedef struct
109{
110 uint32_t flash_base_addr;
111 uint32_t flash_app_addr;
112 uint32_t flash_size;
113 uint32_t flash_app_size;
114 uint32_t sector_size;
115 uint32_t sector_mask;
116 uint32_t firmware_length;
117 uint32_t write_crc;
118 uint32_t read_crc;
119
120 uint32_t write_addr;
121 uint32_t file_write_nr;
122 upgrade_status_type msc_up_status;
123}flash_iap_type;
124
125
126extern flash_iap_type flash_iap;
127
128uint32_t flash_fat16_write(uint32_t fat_lbk, uint8_t *data, uint32_t len);
129uint32_t flash_fat16_read(uint32_t fat_lbk, uint8_t *data, uint32_t len);
130
131void flash_fat16_init(void);
132void flash_fat16_loop_status(void);
133uint32_t flash_fat16_set_name(const uint8_t *file_name, uint8_t len);
134uint8_t flash_fat16_get_upgrade_flag(void);
135
148#ifdef __cplusplus
149}
150#endif
151
152#endif
153
154
upgrade_status_type
upgrade_status_type
Definition: flash_fat16.h:81
flash_fat16_set_name
uint32_t flash_fat16_set_name(const uint8_t *file_name, uint8_t len)
set file name
Definition: flash_fat16.c:331
flash_fat16_get_upgrade_flag
uint8_t flash_fat16_get_upgrade_flag(void)
get iap upgrade complete flag
Definition: flash_fat16.c:248
flash_fat16_loop_status
void flash_fat16_loop_status(void)
loop status
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c:233
flash_iap
flash_iap_type flash_iap
Definition: flash_fat16.c:145
flash_fat16_write
uint32_t flash_fat16_write(uint32_t fat_lbk, uint8_t *data, uint32_t len)
write a logical block address
Definition: flash_fat16.c:308
flash_fat16_init
void flash_fat16_init(void)
flash fat16 iap init
Definition: flash_fat16.c:659
flash_fat16_read
uint32_t flash_fat16_read(uint32_t fat_lbk, uint8_t *data, uint32_t len)
read a logical block address
Definition: flash_fat16.c:269
UPGRADE_ERROR
@ UPGRADE_ERROR
Definition: flash_fat16.h:85
UPGRADE_LARGE
@ UPGRADE_LARGE
Definition: flash_fat16.h:86
UPGRADE_UNKNOWN
@ UPGRADE_UNKNOWN
Definition: flash_fat16.h:87
UPGRADE_JUMP
@ UPGRADE_JUMP
Definition: flash_fat16.h:89
UPGRADE_SUCCESS
@ UPGRADE_SUCCESS
Definition: flash_fat16.h:84
UPGRADE_READY
@ UPGRADE_READY
Definition: flash_fat16.h:82
UPGRAGE_ONGOING
@ UPGRAGE_ONGOING
Definition: flash_fat16.h:83
UPGRADE_DONE
@ UPGRADE_DONE
Definition: flash_fat16.h:88
fat_dir_type
Definition: flash_fat16.h:93
fat_dir_type::clus_low
uint16_t clus_low
Definition: flash_fat16.h:104
fat_dir_type::write_data
uint16_t write_data
Definition: flash_fat16.h:103
fat_dir_type::file_size
uint32_t file_size
Definition: flash_fat16.h:105
fat_dir_type::last_access_data
uint16_t last_access_data
Definition: flash_fat16.h:100
fat_dir_type::write_time
uint16_t write_time
Definition: flash_fat16.h:102
fat_dir_type::create_time
uint16_t create_time
Definition: flash_fat16.h:98
fat_dir_type::create_time_tenth
uint8_t create_time_tenth
Definition: flash_fat16.h:97
fat_dir_type::create_data
uint16_t create_data
Definition: flash_fat16.h:99
fat_dir_type::clus_high
uint16_t clus_high
Definition: flash_fat16.h:101
fat_dir_type::res
uint8_t res
Definition: flash_fat16.h:96
fat_dir_type::attr
uint8_t attr
Definition: flash_fat16.h:95
flash_iap_type
Definition: flash_fat16.h:109
flash_iap_type::flash_size
uint32_t flash_size
Definition: flash_fat16.h:112
flash_iap_type::read_crc
uint32_t read_crc
Definition: flash_fat16.h:118
flash_iap_type::msc_up_status
upgrade_status_type msc_up_status
Definition: flash_fat16.h:122
flash_iap_type::flash_base_addr
uint32_t flash_base_addr
Definition: flash_fat16.h:110
flash_iap_type::write_crc
uint32_t write_crc
Definition: flash_fat16.h:117
flash_iap_type::sector_size
uint32_t sector_size
Definition: flash_fat16.h:114
flash_iap_type::firmware_length
uint32_t firmware_length
Definition: flash_fat16.h:116
flash_iap_type::sector_mask
uint32_t sector_mask
Definition: flash_fat16.h:115
flash_iap_type::file_write_nr
uint32_t file_write_nr
Definition: flash_fat16.h:121
flash_iap_type::flash_app_size
uint32_t flash_app_size
Definition: flash_fat16.h:113
flash_iap_type::write_addr
uint32_t write_addr
Definition: flash_fat16.h:120
flash_iap_type::flash_app_addr
uint32_t flash_app_addr
Definition: flash_fat16.h:111
usb_conf.h
usb config header file


AT32F415 Firmwary Library: usbh_user.h Source File

  • usb_host
  • hid_demo
  • inc
hid_demo/inc/usbh_user.h
Go to the documentation of this file.
1
26/* define to prevent recursive inclusion -------------------------------------*/
27#ifndef __USBH_USER_H
28#define __USBH_USER_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "usbh_core.h"
35
36extern usbh_user_handler_type usbh_user_handle;
37#ifdef __cplusplus
38}
39#endif
40
41#endif
42
43
usbh_user_handle
usbh_user_handler_type usbh_user_handle
Definition: hid_demo/src/usbh_user.c:50
usbh_core.h
usb host core header file


AT32F415 Firmwary Library: usbh_user.c Source File

  • usb_host
  • hid_demo
  • src
hid_demo/src/usbh_user.c
Go to the documentation of this file.
1
26#include "usbh_user.h"
27
36static usb_sts_type usbh_user_init(void);
37static usb_sts_type usbh_user_reset(void);
38static usb_sts_type usbh_user_attached(void);
39static usb_sts_type usbh_user_disconnect(void);
40static usb_sts_type usbh_user_speed(uint8_t speed);
41static usb_sts_type usbh_user_mfc_string(void *string);
42static usb_sts_type usbh_user_product_string(void *string);
43static usb_sts_type usbh_user_serial_string(void *string);
44static usb_sts_type usbh_user_enumeration_done(void);
45static usb_sts_type usbh_user_application(void);
46static usb_sts_type usbh_user_active_vbus(void *uhost, confirm_state state);
47static usb_sts_type usbh_user_not_support(void);
48
49
50usbh_user_handler_type usbh_user_handle =
51{
52 usbh_user_init,
53 usbh_user_reset,
54 usbh_user_attached,
55 usbh_user_disconnect,
56 usbh_user_speed,
57 usbh_user_mfc_string,
58 usbh_user_product_string,
59 usbh_user_serial_string,
60 usbh_user_enumeration_done,
61 usbh_user_application,
62 usbh_user_active_vbus,
63 usbh_user_not_support,
64};
65
71static usb_sts_type usbh_user_init(void)
72{
73 usb_sts_type status = USB_OK;
74
75 return status;
76}
77
83static usb_sts_type usbh_user_reset(void)
84{
85 usb_sts_type status = USB_OK;
86
87 return status;
88}
89
95static usb_sts_type usbh_user_attached(void)
96{
97 usb_sts_type status = USB_OK;
98 USBH_DEBUG("USB Device Attached");
99 return status;
100}
101
107static usb_sts_type usbh_user_disconnect(void)
108{
109 usb_sts_type status = USB_OK;
110 USBH_DEBUG("Device Disconnect");
111 return status;
112}
113
119static usb_sts_type usbh_user_speed(uint8_t speed)
120{
121 usb_sts_type status = USB_OK;
122 if(speed == USB_PRTSPD_FULL_SPEED)
123 {
124 USBH_DEBUG("This is a Full-Speed device");
125 }
126 else if(speed == USB_PRTSPD_LOW_SPEED)
127 {
128 USBH_DEBUG("This is a Low-Speed device");
129 }
130 return status;
131}
132
138static usb_sts_type usbh_user_mfc_string(void *string)
139{
140 usb_sts_type status = USB_OK;
141 USBH_DEBUG("Manufacturer: %s", (uint8_t *)string);
142 return status;
143}
144
150static usb_sts_type usbh_user_product_string(void *string)
151{
152 usb_sts_type status = USB_OK;
153 USBH_DEBUG("Product: %s", (uint8_t *)string);
154 return status;
155}
156
162static usb_sts_type usbh_user_serial_string(void *string)
163{
164 usb_sts_type status = USB_OK;
165 USBH_DEBUG("Serial: %s", (uint8_t *)string);
166 return status;
167}
168
174static usb_sts_type usbh_user_enumeration_done(void)
175{
176 usb_sts_type status = USB_OK;
177 USBH_DEBUG("Enumeration done");
178 return status;
179}
180
186static usb_sts_type usbh_user_application(void)
187{
188 usb_sts_type status = USB_OK;
189
190 return status;
191}
192
193
202static usb_sts_type usbh_user_active_vbus(void *uhost, confirm_state state)
203{
204 usb_sts_type status = USB_OK;
205#ifdef USBH_5V_POWER_SWITCH
206 if(state == TRUE)
207 {
208 /* active vbus */
209 gpio_bits_reset(OTG_PIN_POWER_SWITCH_GPIO, OTG_PIN_POWER_SWITCH);
210 }
211 else
212 {
213 /* deactive vubs */
214 gpio_bits_set(OTG_PIN_POWER_SWITCH_GPIO, OTG_PIN_POWER_SWITCH);
215 }
216#endif
217 return status;
218}
219
225static usb_sts_type usbh_user_not_support(void)
226{
227 usb_sts_type status = USB_OK;
228
229 return status;
230}
231
usbh_user_init
static usb_sts_type usbh_user_init(void)
usb host init user handler
Definition: hid_demo/src/usbh_user.c:71
OTG_PIN_POWER_SWITCH_GPIO
#define OTG_PIN_POWER_SWITCH_GPIO
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:78
OTG_PIN_POWER_SWITCH
#define OTG_PIN_POWER_SWITCH
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:80
usbh_user_disconnect
static usb_sts_type usbh_user_disconnect(void)
usb host discconet user handler
Definition: hid_demo/src/usbh_user.c:107
usbh_user_not_support
static usb_sts_type usbh_user_not_support(void)
usb host not support user handler
Definition: hid_demo/src/usbh_user.c:225
usbh_user_application
static usb_sts_type usbh_user_application(void)
usb host application user handler
Definition: hid_demo/src/usbh_user.c:186
usbh_user_speed
static usb_sts_type usbh_user_speed(uint8_t speed)
usb host speed user handler
Definition: hid_demo/src/usbh_user.c:119
usbh_user_active_vbus
static usb_sts_type usbh_user_active_vbus(void *uhost, confirm_state state)
usb host active vbus user handler
Definition: hid_demo/src/usbh_user.c:202
usbh_user_handle
usbh_user_handler_type usbh_user_handle
Definition: hid_demo/src/usbh_user.c:50
usbh_user_serial_string
static usb_sts_type usbh_user_serial_string(void *string)
usb host serial string user handler
Definition: hid_demo/src/usbh_user.c:162
usbh_user_reset
static usb_sts_type usbh_user_reset(void)
usb host reset user handler
Definition: hid_demo/src/usbh_user.c:83
usbh_user_mfc_string
static usb_sts_type usbh_user_mfc_string(void *string)
usb host manufacturer string user handler
Definition: hid_demo/src/usbh_user.c:138
usbh_user_enumeration_done
static usb_sts_type usbh_user_enumeration_done(void)
usb host enumeration done user handler
Definition: hid_demo/src/usbh_user.c:174
usbh_user_attached
static usb_sts_type usbh_user_attached(void)
usb host check device attached
Definition: hid_demo/src/usbh_user.c:95
USBH_DEBUG
#define USBH_DEBUG(...)
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:152
usbh_user_product_string
static usb_sts_type usbh_user_product_string(void *string)
usb host product string user handler
Definition: hid_demo/src/usbh_user.c:150
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_bits_reset
void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins)
clear the selected data port bits.
Definition: at32f415_gpio.c:341
gpio_bits_set
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins)
set the selected data port bits.
Definition: at32f415_gpio.c:310
USB_PRTSPD_LOW_SPEED
#define USB_PRTSPD_LOW_SPEED
Definition: at32f415_usb.h:188
USB_PRTSPD_FULL_SPEED
#define USB_PRTSPD_FULL_SPEED
Definition: at32f415_usb.h:187
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_OK
@ USB_OK
Definition: usb_std.h:218


AT32F415 Firmwary Library: hid_iap_class.c Source File

  • middlewares
  • usbd_class
  • hid_iap
hid_iap_class.c
Go to the documentation of this file.
1
26#include "usbd_core.h"
27#include "hid_iap_class.h"
28#include "hid_iap_desc.h"
29
44 usb_sts_type class_init_handler(void *udev);
45 usb_sts_type class_clear_handler(void *udev);
46 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup);
47 usb_sts_type class_ept0_tx_handler(void *udev);
48 usb_sts_type class_ept0_rx_handler(void *udev);
49 usb_sts_type class_in_handler(void *udev, uint8_t ept_num);
50 usb_sts_type class_out_handler(void *udev, uint8_t ept_num);
51 usb_sts_type class_sof_handler(void *udev);
52 usb_sts_type class_event_handler(void *udev, usbd_event_type event);
53
54void usb_hid_buf_process(void *udev, uint8_t *report, uint16_t len);
55/* usb hid rx and tx buffer */
56static uint8_t g_rxhid_buff[USBD_OUT_MAXPACKET_SIZE];
57
58/* custom hid static variable */
59static uint32_t hid_protocol = 0;
60static uint32_t hid_set_idle = 0;
61static uint32_t alt_setting = 0;
62static uint8_t hid_state;
63uint8_t hid_set_report[64];
64
65 iap_info_type iap_info;
66
67/* usb device class handler */
68usbd_class_handler hid_iap_class_handler =
69{
70 class_init_handler,
71 class_clear_handler,
72 class_setup_handler,
73 class_ept0_tx_handler,
74 class_ept0_rx_handler,
75 class_in_handler,
76 class_out_handler,
77 class_sof_handler,
78 class_event_handler,
79};
80
86 usb_sts_type class_init_handler(void *udev)
87{
88 usb_sts_type status = USB_OK;
89 usbd_core_type *pudev = (usbd_core_type *)udev;
90
91 /* open hid iap in endpoint */
92 usbd_ept_open(pudev, USBD_HID_IN_EPT, EPT_INT_TYPE, USBD_IN_MAXPACKET_SIZE);
93
94 /* open hid iap out endpoint */
95 usbd_ept_open(pudev, USBD_HID_OUT_EPT, EPT_INT_TYPE, USBD_OUT_MAXPACKET_SIZE);
96
97 /* set out endpoint to receive status */
98 usbd_ept_recv(pudev, USBD_HID_OUT_EPT, g_rxhid_buff, USBD_OUT_MAXPACKET_SIZE);
99
100 return status;
101}
102
108 usb_sts_type class_clear_handler(void *udev)
109{
110 usb_sts_type status = USB_OK;
111 usbd_core_type *pudev = (usbd_core_type *)udev;
112
113 /* close hid iap in endpoint */
114 usbd_ept_close(pudev, USBD_HID_IN_EPT);
115
116 /* close hid iap out endpoint */
117 usbd_ept_close(pudev, USBD_HID_OUT_EPT);
118
119 return status;
120}
121
128 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
129{
130 usb_sts_type status = USB_OK;
131 usbd_core_type *pudev = (usbd_core_type *)udev;
132 uint16_t len;
133 uint8_t *buf;
134
135 switch(setup->bmRequestType & USB_REQ_TYPE_RESERVED)
136 {
137 /* class request */
138 case USB_REQ_TYPE_CLASS:
139 switch(setup->bRequest)
140 {
141 case HID_REQ_SET_PROTOCOL:
142 hid_protocol = (uint8_t)setup->wValue;
143 break;
144 case HID_REQ_GET_PROTOCOL:
145 usbd_ctrl_send(pudev, (uint8_t *)&hid_protocol, 1);
146 break;
147 case HID_REQ_SET_IDLE:
148 hid_set_idle = (uint8_t)(setup->wValue >> 8);
149 break;
150 case HID_REQ_GET_IDLE:
151 usbd_ctrl_send(pudev, (uint8_t *)&hid_set_idle, 1);
152 break;
153 case HID_REQ_SET_REPORT:
154 hid_state = HID_REQ_SET_REPORT;
155 usbd_ctrl_recv(pudev, hid_set_report, setup->wLength);
156 break;
157 default:
158 usbd_ctrl_unsupport(pudev);
159 break;
160 }
161 break;
162 /* standard request */
163 case USB_REQ_TYPE_STANDARD:
164 switch(setup->bRequest)
165 {
166 case USB_STD_REQ_GET_DESCRIPTOR:
167 if(setup->wValue >> 8 == HID_REPORT_DESC)
168 {
169 len = MIN(USBD_HID_SIZ_REPORT_DESC, setup->wLength);
170 buf = (uint8_t *)g_usbd_hid_report;
171 }
172 else if(setup->wValue >> 8 == HID_DESCRIPTOR_TYPE)
173 {
174 len = MIN(9, setup->wLength);
175 buf = (uint8_t *)g_hid_usb_desc;
176 }
177 usbd_ctrl_send(pudev, (uint8_t *)buf, len);
178 break;
179 case USB_STD_REQ_GET_INTERFACE:
180 usbd_ctrl_send(pudev, (uint8_t *)&alt_setting, 1);
181 break;
182 case USB_STD_REQ_SET_INTERFACE:
183 alt_setting = setup->wValue;
184 break;
185 default:
186 break;
187 }
188 break;
189 default:
190 usbd_ctrl_unsupport(pudev);
191 break;
192 }
193 return status;
194}
195
201 usb_sts_type class_ept0_tx_handler(void *udev)
202{
203 usb_sts_type status = USB_OK;
204
205 /* ...user code... */
206
207 return status;
208}
209
215 usb_sts_type class_ept0_rx_handler(void *udev)
216{
217 usb_sts_type status = USB_OK;
218 usbd_core_type *pudev = (usbd_core_type *)udev;
219 uint32_t recv_len = usbd_get_recv_len(pudev, 0);
220 /* ...user code... */
221 if( hid_state == HID_REQ_SET_REPORT)
222 {
223 /* hid buffer process */
224 hid_state = 0;
225 }
226
227 return status;
228}
229
236 usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
237{
238 usb_sts_type status = USB_OK;
239
240 /* ...user code...
241 trans next packet data
242 */
243 usbd_hid_iap_in_complete(udev);
244
245 return status;
246}
247
254 usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
255{
256 usb_sts_type status = USB_OK;
257 usbd_core_type *pudev = (usbd_core_type *)udev;
258
259 /* get endpoint receive data length */
260 uint32_t recv_len = usbd_get_recv_len(pudev, ept_num);
261
262 /* hid iap process */
263 usbd_hid_iap_process(udev, g_rxhid_buff, recv_len);
264
265 /* start receive next packet */
266 usbd_ept_recv(pudev, USBD_HID_OUT_EPT, g_rxhid_buff, USBD_OUT_MAXPACKET_SIZE);
267
268 return status;
269}
270
276 usb_sts_type class_sof_handler(void *udev)
277{
278 usb_sts_type status = USB_OK;
279
280 /* ...user code... */
281
282 return status;
283}
284
291 usb_sts_type class_event_handler(void *udev, usbd_event_type event)
292{
293 usb_sts_type status = USB_OK;
294 switch(event)
295 {
296 case USBD_RESET_EVENT:
297
298 /* ...user code... */
299
300 break;
301 case USBD_SUSPEND_EVENT:
302
303 /* ...user code... */
304
305 break;
306 case USBD_WAKEUP_EVENT:
307 /* ...user code... */
308
309 break;
310 default:
311 break;
312 }
313 return status;
314}
315
323 usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
324{
325 usb_sts_type status = USB_OK;
326 usbd_core_type *pudev = (usbd_core_type *)udev;
327
328 if(usbd_connect_state_get(pudev) == USB_CONN_STATE_CONFIGURED)
329 usbd_ept_send(pudev, USBD_HID_IN_EPT, report, len);
330
331 return status;
332}
333
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
HID_DESCRIPTOR_TYPE
#define HID_DESCRIPTOR_TYPE
Definition: audio_hid_class.h:118
USBD_HID_OUT_EPT
#define USBD_HID_OUT_EPT
Definition: audio_hid_class.h:62
HID_REQ_GET_PROTOCOL
#define HID_REQ_GET_PROTOCOL
Definition: audio_hid_class.h:113
USBD_HID_IN_EPT
#define USBD_HID_IN_EPT
usb custom hid use endpoint define
Definition: audio_hid_class.h:61
HID_REQ_SET_PROTOCOL
#define HID_REQ_SET_PROTOCOL
usb custom hid class request code define
Definition: audio_hid_class.h:112
HID_REPORT_DESC
#define HID_REPORT_DESC
Definition: audio_hid_class.h:119
HID_REQ_SET_IDLE
#define HID_REQ_SET_IDLE
Definition: audio_hid_class.h:114
HID_REQ_GET_IDLE
#define HID_REQ_GET_IDLE
Definition: audio_hid_class.h:115
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
HID_REQ_SET_REPORT
#define HID_REQ_SET_REPORT
Definition: audio_hid_class.h:116
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: audio_hid_desc.h:236
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
usb hid descriptor
Definition: audio_hid_desc.c:527
EPT_INT_TYPE
@ EPT_INT_TYPE
Definition: at32f415_usb.h:349
usbd_hid_iap_process
iap_result_type usbd_hid_iap_process(void *udev, uint8_t *report, uint16_t len)
usb device iap function
Definition: app_led3_toggle/src/hid_iap_user.c:194
usbd_hid_iap_in_complete
void usbd_hid_iap_in_complete(void *udev)
usb device in transfer complete function
Definition: app_led3_toggle/src/hid_iap_user.c:240
iap_info
iap_info_type iap_info
Definition: hid_iap_class.c:65
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: hid_iap_class.c:291
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: hid_iap_class.c:276
hid_set_idle
static uint32_t hid_set_idle
Definition: hid_iap_class.c:60
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: hid_iap_class.c:128
hid_iap_class_handler
usbd_class_handler hid_iap_class_handler
Definition: hid_iap_class.c:68
hid_set_report
uint8_t hid_set_report[64]
Definition: hid_iap_class.c:63
alt_setting
static uint32_t alt_setting
Definition: hid_iap_class.c:61
g_rxhid_buff
static uint8_t g_rxhid_buff[0x40]
Definition: hid_iap_class.c:56
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: hid_iap_class.c:201
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: hid_iap_class.c:323
hid_protocol
static uint32_t hid_protocol
Definition: hid_iap_class.c:59
usb_hid_buf_process
void usb_hid_buf_process(void *udev, uint8_t *report, uint16_t len)
usb device report function
Definition: audio_hid_class.c:837
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: hid_iap_class.c:236
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb custom hid endpoint
Definition: hid_iap_class.c:86
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: hid_iap_class.c:215
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: hid_iap_class.c:254
hid_state
static uint8_t hid_state
Definition: hid_iap_class.c:62
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: hid_iap_class.c:108
MIN
#define MIN(a, b)
min and max define
Definition: usb_std.h:204
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
USB_STD_REQ_GET_DESCRIPTOR
#define USB_STD_REQ_GET_DESCRIPTOR
Definition: usb_std.h:81
USB_STD_REQ_SET_INTERFACE
#define USB_STD_REQ_SET_INTERFACE
Definition: usb_std.h:86
USB_REQ_TYPE_RESERVED
#define USB_REQ_TYPE_RESERVED
Definition: usb_std.h:66
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_STD_REQ_GET_INTERFACE
#define USB_STD_REQ_GET_INTERFACE
Definition: usb_std.h:85
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usb_std.h:64
USB_CONN_STATE_CONFIGURED
@ USB_CONN_STATE_CONFIGURED
Definition: usb_std.h:131
USB_OK
@ USB_OK
Definition: usb_std.h:218
usbd_connect_state_get
usbd_conn_state usbd_connect_state_get(usbd_core_type *udev)
get usb connect state
Definition: usbd_core.c:592
usbd_ept_close
void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint
Definition: usbd_core.c:341
usbd_ept_recv
void usbd_ept_recv(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint receive data
Definition: usbd_core.c:529
usbd_ept_open
void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint
Definition: usbd_core.c:309
usbd_ctrl_send
void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data
Definition: usbd_core.c:174
usbd_ept_send
void usbd_ept_send(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data
Definition: usbd_core.c:429
usbd_get_recv_len
uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length
Definition: usbd_core.c:295
usbd_ctrl_recv
void usbd_ctrl_recv(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint recv data
Definition: usbd_core.c:192
usbd_ctrl_unsupport
void usbd_ctrl_unsupport(usbd_core_type *udev)
un-support device request
Definition: usbd_core.c:282
hid_iap_class.h
usb hid iap header file
hid_iap_desc.h
usb hid iap descriptor header file
iap_info_type
Definition: hid_iap_class.h:117
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_setup_type::wValue
uint16_t wValue
Definition: usb_std.h:233
usb_setup_type::wLength
uint16_t wLength
Definition: usb_std.h:236
usb_setup_type::bmRequestType
uint8_t bmRequestType
Definition: usb_std.h:231
usb_setup_type::bRequest
uint8_t bRequest
Definition: usb_std.h:232
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: hid_iap_class.h Source File

  • middlewares
  • usbd_class
  • hid_iap
hid_iap_class.h
Go to the documentation of this file.
1
27 /* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __HID_IAP_CLASS_H
29#define __HID_IAP_CLASS_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "usb_std.h"
36#include "usbd_core.h"
37
38
52#define USBD_HID_IN_EPT 0x81
53#define USBD_HID_OUT_EPT 0x01
54
55#define USBD_IN_MAXPACKET_SIZE 0x40
56#define USBD_OUT_MAXPACKET_SIZE 0x40
57
58#define HID_REQ_SET_PROTOCOL 0x0B
59#define HID_REQ_GET_PROTOCOL 0x03
60
61#define HID_REQ_SET_IDLE 0x0A
62#define HID_REQ_GET_IDLE 0x02
63
64#define HID_REQ_SET_REPORT 0x09
65#define HID_REQ_GET_REPORT 0x01
66
67#define HID_DESCRIPTOR_TYPE 0x21
68#define HID_REPORT_DESC 0x22
69
70#define FLASH_SIZE_REG() ((*(uint32_t *)0x1FFFF7E0) & 0xFFFF) /*Get Flash size*/
71#define KB_TO_B(kb) ((kb) << 10)
72
73#define SECTOR_SIZE_1K 0x400
74#define SECTOR_SIZE_2K 0x800
75#define SECTOR_SIZE_4K 0x1000
76
80#define IAP_CMD_IDLE 0x5AA0
81#define IAP_CMD_START 0x5AA1
82#define IAP_CMD_ADDR 0x5AA2
83#define IAP_CMD_DATA 0x5AA3
84#define IAP_CMD_FINISH 0x5AA4
85#define IAP_CMD_CRC 0x5AA5
86#define IAP_CMD_JMP 0x5AA6
87#define IAP_CMD_GET 0x5AA7
88
89#define HID_IAP_BUFFER_LEN 1024
90#define IAP_UPGRADE_COMPLETE_FLAG 0x41544B38
91#define CONVERT_ENDIAN(dwValue) ((dwValue >> 24) | ((dwValue >> 8) & 0xFF00) | \
92 ((dwValue << 8) & 0xFF0000) | (dwValue << 24) )
93
94#define IAP_ACK 0xFF00
95#define IAP_NACK 0x00FF
96
97typedef enum
98{
99 IAP_SUCCESS,
100 IAP_WAIT,
101 IAP_FAILED
102}iap_result_type;
103
104typedef enum
105{
106 IAP_STS_IDLE,
107 IAP_STS_START,
108 IAP_STS_ADDR,
109 IAP_STS_DATA,
110 IAP_STS_FINISH,
111 IAP_STS_CRC,
112 IAP_STS_JMP_WAIT,
113 IAP_STS_JMP,
114}iap_machine_state_type;
115
116typedef struct
117{
118
119 uint8_t iap_fifo[HID_IAP_BUFFER_LEN];
120 uint8_t iap_rx[USBD_OUT_MAXPACKET_SIZE];
121 uint8_t iap_tx[USBD_IN_MAXPACKET_SIZE];
122
123 uint32_t fifo_length;
124 uint32_t tx_length;
125
126 uint32_t app_address;
127 uint32_t iap_address;
128 uint32_t flag_address;
129
130 uint32_t flash_start_address;
131 uint32_t flash_end_address;
132
133 uint32_t sector_size;
134 uint32_t flash_size;
135
136 iap_machine_state_type state;
137 uint8_t respond_flag;
138}iap_info_type;
139
140extern usbd_class_handler hid_iap_class_handler;
141extern iap_info_type iap_info;
142 usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len);
143
144 iap_result_type usbd_hid_iap_process(void *udev, uint8_t *report, uint16_t len);
145void usbd_hid_iap_in_complete(void *udev);
146
158#ifdef __cplusplus
159}
160#endif
161
162#endif
163
164
iap_info
iap_info_type iap_info
Definition: hid_iap_class.c:65
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: hid_iap_class.h:56
HID_IAP_BUFFER_LEN
#define HID_IAP_BUFFER_LEN
Definition: hid_iap_class.h:89
iap_result_type
iap_result_type
Definition: hid_iap_class.h:98
usbd_hid_iap_process
iap_result_type usbd_hid_iap_process(void *udev, uint8_t *report, uint16_t len)
usb device iap function
Definition: app_led3_toggle/src/hid_iap_user.c:194
hid_iap_class_handler
usbd_class_handler hid_iap_class_handler
Definition: hid_iap_class.c:68
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
Definition: hid_iap_class.h:55
iap_machine_state_type
iap_machine_state_type
Definition: hid_iap_class.h:105
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: audio_hid_class.c:818
usbd_hid_iap_in_complete
void usbd_hid_iap_in_complete(void *udev)
usb device in transfer complete function
Definition: app_led3_toggle/src/hid_iap_user.c:240
IAP_WAIT
@ IAP_WAIT
Definition: hid_iap_class.h:100
IAP_FAILED
@ IAP_FAILED
Definition: hid_iap_class.h:101
IAP_SUCCESS
@ IAP_SUCCESS
Definition: hid_iap_class.h:99
IAP_STS_START
@ IAP_STS_START
Definition: hid_iap_class.h:107
IAP_STS_JMP
@ IAP_STS_JMP
Definition: hid_iap_class.h:113
IAP_STS_DATA
@ IAP_STS_DATA
Definition: hid_iap_class.h:109
IAP_STS_JMP_WAIT
@ IAP_STS_JMP_WAIT
Definition: hid_iap_class.h:112
IAP_STS_IDLE
@ IAP_STS_IDLE
Definition: hid_iap_class.h:106
IAP_STS_FINISH
@ IAP_STS_FINISH
Definition: hid_iap_class.h:110
IAP_STS_ADDR
@ IAP_STS_ADDR
Definition: hid_iap_class.h:108
IAP_STS_CRC
@ IAP_STS_CRC
Definition: hid_iap_class.h:111
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
iap_info_type
Definition: hid_iap_class.h:117
iap_info_type::flag_address
uint32_t flag_address
Definition: hid_iap_class.h:128
iap_info_type::sector_size
uint32_t sector_size
Definition: hid_iap_class.h:133
iap_info_type::iap_address
uint32_t iap_address
Definition: hid_iap_class.h:127
iap_info_type::flash_start_address
uint32_t flash_start_address
Definition: hid_iap_class.h:130
iap_info_type::flash_end_address
uint32_t flash_end_address
Definition: hid_iap_class.h:131
iap_info_type::fifo_length
uint32_t fifo_length
Definition: hid_iap_class.h:123
iap_info_type::tx_length
uint32_t tx_length
Definition: hid_iap_class.h:124
iap_info_type::flash_size
uint32_t flash_size
Definition: hid_iap_class.h:134
iap_info_type::app_address
uint32_t app_address
Definition: hid_iap_class.h:126
iap_info_type::respond_flag
uint8_t respond_flag
Definition: hid_iap_class.h:137
iap_info_type::state
iap_machine_state_type state
Definition: hid_iap_class.h:136
usb_std.h
usb standard header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: hid_iap_desc.c Source File

  • middlewares
  • usbd_class
  • hid_iap
hid_iap_desc.c
Go to the documentation of this file.
1
26#include "usb_std.h"
27#include "usbd_sdr.h"
28#include "usbd_core.h"
29#include "hid_iap_desc.h"
30
31
46usbd_desc_t *get_device_descriptor(void);
47usbd_desc_t *get_device_qualifier(void);
48usbd_desc_t *get_device_configuration(void);
49usbd_desc_t *get_device_other_speed(void);
50usbd_desc_t *get_device_lang_id(void);
51usbd_desc_t *get_device_manufacturer_string(void);
52usbd_desc_t *get_device_product_string(void);
53usbd_desc_t *get_device_serial_string(void);
54usbd_desc_t *get_device_interface_string(void);
55usbd_desc_t *get_device_config_string(void);
56
57uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf);
58static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len);
59static void get_serial_num(void);
60static uint8_t g_usbd_desc_buffer[256];
61
65usbd_desc_handler hid_iap_desc_handler =
66{
67 get_device_descriptor,
68 get_device_qualifier,
69 get_device_configuration,
70 get_device_other_speed,
71 get_device_lang_id,
72 get_device_manufacturer_string,
73 get_device_product_string,
74 get_device_serial_string,
75 get_device_interface_string,
76 get_device_config_string,
77};
78
82#if defined ( __ICCARM__ ) /* iar compiler */
83 #pragma data_alignment=4
84#endif
85ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL =
86{
87 USB_DEVICE_DESC_LEN, /* bLength */
88 USB_DESCIPTOR_TYPE_DEVICE, /* bDescriptorType */
89 0x00, /* bcdUSB */
90 0x02,
91 0x00, /* bDeviceClass */
92 0x00, /* bDeviceSubClass */
93 0x00, /* bDeviceProtocol */
94 USB_MAX_EP0_SIZE, /* bMaxPacketSize */
95 LBYTE(USBD_VENDOR_ID), /* idVendor */
96 HBYTE(USBD_VENDOR_ID), /* idVendor */
97 LBYTE(USBD_PRODUCT_ID), /* idProduct */
98 HBYTE(USBD_PRODUCT_ID), /* idProduct */
99 0x00, /* bcdDevice rel. 2.00 */
100 0x02,
101 USB_MFC_STRING, /* Index of manufacturer string */
102 USB_PRODUCT_STRING, /* Index of product string */
103 USB_SERIAL_STRING, /* Index of serial number string */
104 1 /* bNumConfigurations */
105};
106
110#if defined ( __ICCARM__ ) /* iar compiler */
111 #pragma data_alignment=4
112#endif
113ALIGNED_HEAD uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE] ALIGNED_TAIL =
114{
115 USB_DEVICE_CFG_DESC_LEN, /* bLength: configuration descriptor size */
116 USB_DESCIPTOR_TYPE_CONFIGURATION, /* bDescriptorType: configuration */
117 LBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
118 HBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
119 0x01, /* bNumInterfaces: 1 interface */
120 0x01, /* bConfigurationValue: configuration value */
121 0x00, /* iConfiguration: index of string descriptor describing
122 the configuration */
123 0xC0, /* bmAttributes: self powered */
124 0x32, /* MaxPower 100 mA: this current is used for detecting vbus */
125
126 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
127 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
128 0x00, /* bInterfaceNumber: number of interface */
129 0x00, /* bAlternateSetting: alternate set */
130 0x02, /* bNumEndpoints: number of endpoints */
131 USB_CLASS_CODE_HID, /* bInterfaceClass: class code hid */
132 0x00, /* bInterfaceSubClass: subclass code */
133 0x00, /* bInterfaceProtocol: protocol code */
134 0x00, /* iInterface: index of string descriptor */
135
136 0x09, /* bLength: size of HID descriptor in bytes */
137 HID_CLASS_DESC_HID, /* bDescriptorType: HID descriptor type */
138 LBYTE(HID_BCD_NUM),
139 HBYTE(HID_BCD_NUM), /* bcdHID: HID class specification release number */
140 0x00, /* bCountryCode: hardware target conutry */
141 0x01, /* bNumDescriptors: number of HID class descriptor to follow */
142 HID_CLASS_DESC_REPORT, /* bDescriptorType: report descriptor type */
143 LBYTE(sizeof(g_usbd_hid_report)),
144 HBYTE(sizeof(g_usbd_hid_report)), /* wDescriptorLength: total length of reprot descriptor */
145
146 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
147 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
148 USBD_HID_IN_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
149 USB_EPT_DESC_INTERRUPT, /* bmAttributes: endpoint attributes */
150 LBYTE(USBD_IN_MAXPACKET_SIZE),
151 HBYTE(USBD_IN_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
152 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
153
154 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
155 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
156 USBD_HID_OUT_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
157 USB_EPT_DESC_INTERRUPT, /* bmAttributes: endpoint attributes */
158 LBYTE(USBD_OUT_MAXPACKET_SIZE),
159 HBYTE(USBD_OUT_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
160 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
161};
162
166#if defined ( __ICCARM__ ) /* iar compiler */
167 #pragma data_alignment=4
168#endif
169ALIGNED_HEAD uint8_t g_usbd_hid_report[USBD_HID_SIZ_REPORT_DESC] ALIGNED_TAIL =
170{
171 0x06, 0xFF, 0x00, /* USAGE_PAGE(Vendor Page:0xFF00) */
172 0x09, 0x01, /* USAGE (Demo Kit) */
173 0xa1, 0x01, /* COLLECTION (Application) */
174
175 /* 6 */
176 0x15, 0x00, /* LOGICAL_MINIMUM (0) */
177 0x25, 0xFF, /* LOGICAL_MAXIMUM (255) */
178 0x75, 0x08, /* REPORT_SIZE (8) */
179 0x95, 0x40, /* REPORT_COUNT (64) */
180
181 0x09, 0x01,
182 0x81, 0x02,
183 0x95, 0x40,
184
185 0x09, 0x01,
186 0x91, 0x02,
187 0x95, 0x01,
188
189 0x09, 0x01,
190 0xB1, 0x02,
191 0xC0
192};
193
197#if defined ( __ICCARM__ ) /* iar compiler */
198 #pragma data_alignment=4
199#endif
200ALIGNED_HEAD uint8_t g_hid_usb_desc[9] ALIGNED_TAIL =
201{
202 0x09, /* bLength: size of HID descriptor in bytes */
203 HID_CLASS_DESC_HID, /* bDescriptorType: HID descriptor type */
204 LBYTE(HID_BCD_NUM),
205 HBYTE(HID_BCD_NUM), /* bcdHID: HID class specification release number */
206 0x00, /* bCountryCode: hardware target conutry */
207 0x01, /* bNumDescriptors: number of HID class descriptor to follow */
208 HID_CLASS_DESC_REPORT, /* bDescriptorType: report descriptor type */
209 LBYTE(sizeof(g_usbd_hid_report)),
210 HBYTE(sizeof(g_usbd_hid_report)), /* wDescriptorLength: total length of reprot descriptor */
211};
212
213
217#if defined ( __ICCARM__ ) /* iar compiler */
218 #pragma data_alignment=4
219#endif
220ALIGNED_HEAD uint8_t g_string_lang_id[USBD_SIZ_STRING_LANGID] ALIGNED_TAIL =
221{
222 USBD_SIZ_STRING_LANGID,
223 USB_DESCIPTOR_TYPE_STRING,
224 0x09,
225 0x04,
226};
227
231#if defined ( __ICCARM__ ) /* iar compiler */
232 #pragma data_alignment=4
233#endif
234ALIGNED_HEAD uint8_t g_string_serial[USBD_SIZ_STRING_SERIAL] ALIGNED_TAIL =
235{
236 USBD_SIZ_STRING_SERIAL,
237 USB_DESCIPTOR_TYPE_STRING,
238};
239
240
241/* device descriptor */
242usbd_desc_t device_descriptor =
243{
244 USB_DEVICE_DESC_LEN,
245 g_usbd_descriptor
246};
247
248/* config descriptor */
249usbd_desc_t config_descriptor =
250{
251 USBD_CONFIG_DESC_SIZE,
252 g_usbd_configuration
253};
254
255/* langid descriptor */
256usbd_desc_t langid_descriptor =
257{
258 USBD_SIZ_STRING_LANGID,
259 g_string_lang_id
260};
261
262/* serial descriptor */
263usbd_desc_t serial_descriptor =
264{
265 USBD_SIZ_STRING_SERIAL,
266 g_string_serial
267};
268
269usbd_desc_t vp_desc;
270
277uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
278{
279 uint16_t str_len = 0, id_pos = 2;
280 uint8_t *tmp_str = string;
281
282 while(*tmp_str != '\0')
283 {
284 str_len ++;
285 unicode_buf[id_pos ++] = *tmp_str ++;
286 unicode_buf[id_pos ++] = 0x00;
287 }
288
289 str_len = str_len * 2 + 2;
290 unicode_buf[0] = str_len;
291 unicode_buf[1] = USB_DESCIPTOR_TYPE_STRING;
292
293 return str_len;
294}
295
303static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len)
304{
305 uint8_t idx = 0;
306
307 for( idx = 0 ; idx < len ; idx ++)
308 {
309 if( ((value >> 28)) < 0xA )
310 {
311 pbuf[ 2 * idx] = (value >> 28) + '0';
312 }
313 else
314 {
315 pbuf[2 * idx] = (value >> 28) + 'A' - 10;
316 }
317
318 value = value << 4;
319
320 pbuf[2 * idx + 1] = 0;
321 }
322}
323
329static void get_serial_num(void)
330{
331 uint32_t serial0, serial1, serial2;
332
333 serial0 = *(uint32_t*)MCU_ID1;
334 serial1 = *(uint32_t*)MCU_ID2;
335 serial2 = *(uint32_t*)MCU_ID3;
336
337 serial0 += serial2;
338
339 if (serial0 != 0)
340 {
341 usbd_int_to_unicode (serial0, &g_string_serial[2] ,8);
342 usbd_int_to_unicode (serial1, &g_string_serial[18] ,4);
343 }
344}
345
351usbd_desc_t *get_device_descriptor(void)
352{
353 return &device_descriptor;
354}
355
361usbd_desc_t * get_device_qualifier(void)
362{
363 return NULL;
364}
365
371usbd_desc_t *get_device_configuration(void)
372{
373 return &config_descriptor;
374}
375
381usbd_desc_t *get_device_other_speed(void)
382{
383 return NULL;
384}
385
391usbd_desc_t *get_device_lang_id(void)
392{
393 return &langid_descriptor;
394}
395
396
402usbd_desc_t *get_device_manufacturer_string(void)
403{
404 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_MANUFACTURER_STRING, g_usbd_desc_buffer);
405 vp_desc.descriptor = g_usbd_desc_buffer;
406 return &vp_desc;
407}
408
414usbd_desc_t *get_device_product_string(void)
415{
416 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_PRODUCT_STRING, g_usbd_desc_buffer);
417 vp_desc.descriptor = g_usbd_desc_buffer;
418 return &vp_desc;
419}
420
426usbd_desc_t *get_device_serial_string(void)
427{
428 get_serial_num();
429 return &serial_descriptor;
430}
431
437usbd_desc_t *get_device_interface_string(void)
438{
439 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_INTERFACE_STRING, g_usbd_desc_buffer);
440 vp_desc.descriptor = g_usbd_desc_buffer;
441 return &vp_desc;
442}
443
449usbd_desc_t *get_device_config_string(void)
450{
451 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_CONFIGURATION_STRING, g_usbd_desc_buffer);
452 vp_desc.descriptor = g_usbd_desc_buffer;
453 return &vp_desc;
454}
455
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
USBD_DESC_CONFIGURATION_STRING
#define USBD_DESC_CONFIGURATION_STRING
Definition: audio_desc.h:61
USBD_SIZ_STRING_SERIAL
#define USBD_SIZ_STRING_SERIAL
Definition: audio_desc.h:57
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112
USBD_DESC_PRODUCT_STRING
#define USBD_DESC_PRODUCT_STRING
Definition: audio_desc.h:60
HID_BINTERVAL_TIME
#define HID_BINTERVAL_TIME
Definition: audio_desc.h:205
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: audio_desc.h:208
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
USBD_SIZ_STRING_LANGID
#define USBD_SIZ_STRING_LANGID
Definition: audio_desc.h:56
MCU_ID1
#define MCU_ID1
Definition: audio_desc.h:215
USBD_DESC_MANUFACTURER_STRING
#define USBD_DESC_MANUFACTURER_STRING
Definition: audio_desc.h:59
USBD_PRODUCT_ID
#define USBD_PRODUCT_ID
Definition: audio_desc.h:54
USBD_DESC_INTERFACE_STRING
#define USBD_DESC_INTERFACE_STRING
Definition: audio_desc.h:62
MCU_ID2
#define MCU_ID2
Definition: audio_desc.h:216
USBD_VENDOR_ID
#define USBD_VENDOR_ID
Definition: audio_desc.h:53
MCU_ID3
#define MCU_ID3
Definition: audio_desc.h:217
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
USBD_HID_OUT_EPT
#define USBD_HID_OUT_EPT
Definition: audio_hid_class.h:62
USBD_HID_IN_EPT
#define USBD_HID_IN_EPT
usb custom hid use endpoint define
Definition: audio_hid_class.h:61
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
HID_CLASS_DESC_HID
#define HID_CLASS_DESC_HID
usb hid class descriptor define
Definition: audio_hid_desc.h:216
HID_CLASS_DESC_REPORT
#define HID_CLASS_DESC_REPORT
Definition: audio_hid_desc.h:217
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: audio_hid_desc.h:236
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
usb hid descriptor
Definition: audio_hid_desc.c:527
HID_BCD_NUM
#define HID_BCD_NUM
usb bcd number define
Definition: audio_hid_desc.h:211
serial_descriptor
usbd_desc_t serial_descriptor
Definition: hid_iap_desc.c:263
device_descriptor
usbd_desc_t device_descriptor
Definition: hid_iap_desc.c:242
usbd_unicode_convert
uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert
Definition: hid_iap_desc.c:277
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: hid_iap_desc.c:402
langid_descriptor
usbd_desc_t langid_descriptor
Definition: hid_iap_desc.c:256
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: hid_iap_desc.c:361
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: hid_iap_desc.c:437
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: hid_iap_desc.c:381
g_usbd_desc_buffer
static uint8_t g_usbd_desc_buffer[256]
Definition: hid_iap_desc.c:60
vp_desc
usbd_desc_t vp_desc
Definition: hid_iap_desc.c:269
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: hid_iap_desc.c:371
ALIGNED_TAIL
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL
usb device standard descriptor
Definition: hid_iap_desc.c:85
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: hid_iap_desc.c:414
hid_iap_desc_handler
usbd_desc_handler hid_iap_desc_handler
hid device descriptor handler structure
Definition: hid_iap_desc.c:65
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: hid_iap_desc.c:391
get_serial_num
static void get_serial_num(void)
usb get serial number
Definition: hid_iap_desc.c:329
config_descriptor
usbd_desc_t config_descriptor
Definition: hid_iap_desc.c:249
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: hid_iap_desc.c:351
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: hid_iap_desc.c:426
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: hid_iap_desc.c:449
usbd_int_to_unicode
static void usbd_int_to_unicode(uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode
Definition: hid_iap_desc.c:303
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_DEVICE_EPT_LEN
#define USB_DEVICE_EPT_LEN
Definition: usb_std.h:153
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
USB_DESCIPTOR_TYPE_CONFIGURATION
#define USB_DESCIPTOR_TYPE_CONFIGURATION
Definition: usb_std.h:93
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DESCIPTOR_TYPE_ENDPOINT
#define USB_DESCIPTOR_TYPE_ENDPOINT
Definition: usb_std.h:96
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_DEVICE_IF_DESC_LEN
#define USB_DEVICE_IF_DESC_LEN
Definition: usb_std.h:152
USB_DEVICE_CFG_DESC_LEN
#define USB_DEVICE_CFG_DESC_LEN
Definition: usb_std.h:151
USB_EPT_DESC_INTERRUPT
#define USB_EPT_DESC_INTERRUPT
Definition: usb_std.h:178
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92
USB_DESCIPTOR_TYPE_STRING
#define USB_DESCIPTOR_TYPE_STRING
Definition: usb_std.h:94
USB_DESCIPTOR_TYPE_INTERFACE
#define USB_DESCIPTOR_TYPE_INTERFACE
Definition: usb_std.h:95
USB_CLASS_CODE_HID
#define USB_CLASS_CODE_HID
Definition: usb_std.h:163
hid_iap_desc.h
usb hid iap descriptor header file
usb_std.h
usb standard header file
usbd_core.h
usb device core header file
usbd_sdr.h


AT32F415 Firmwary Library: hid_iap_desc.h Source File

  • middlewares
  • usbd_class
  • hid_iap
hid_iap_desc.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __HID_IAP_DESC_H
29#define __HID_IAP_DESC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "hid_iap_class.h"
36#include "usbd_core.h"
37
51#define HID_BCD_NUM 0x0110
52
53#define HID_CLASS_DESC_HID 0x21
54#define HID_CLASS_DESC_REPORT 0x22
55#define HID_CLASS_DESC_PHYSICAL 0x23
56
57
58#define USBD_VENDOR_ID 0x2E3C
59#define USBD_PRODUCT_ID 0xAF01
60
61#define USBD_CONFIG_DESC_SIZE 41
62#define USBD_HID_SIZ_REPORT_DESC 32
63#define USBD_SIZ_STRING_LANGID 4
64#define USBD_SIZ_STRING_SERIAL 0x1A
65
66#define USBD_DESC_MANUFACTURER_STRING "Artery"
67#define USBD_DESC_PRODUCT_STRING "HID IAP"
68#define USBD_DESC_CONFIGURATION_STRING "HID IAP Config"
69#define USBD_DESC_INTERFACE_STRING "HID IAP Interface"
70
71#define HID_BINTERVAL_TIME 0x01
72
73#define MCU_ID1 (0x1FFFF7E8)
74#define MCU_ID2 (0x1FFFF7EC)
75#define MCU_ID3 (0x1FFFF7F0)
76
77extern uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN];
78extern uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE];
79extern uint8_t g_usbd_hid_report[USBD_HID_SIZ_REPORT_DESC];
80extern uint8_t g_hid_usb_desc[9];
81
82extern usbd_desc_handler hid_iap_desc_handler;
83
84
97#ifdef __cplusplus
98}
99#endif
100
101#endif
102
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: hid_iap_desc.h:61
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
g_usbd_hid_report
uint8_t g_usbd_hid_report[32]
hid_iap_desc_handler
usbd_desc_handler hid_iap_desc_handler
hid device descriptor handler structure
Definition: hid_iap_desc.c:65
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: hid_iap_desc.h:62
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
g_usbd_configuration
uint8_t g_usbd_configuration[41]
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
hid_iap_class.h
usb hid iap header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: i2c_application.c Source File

  • middlewares
  • i2c_application_library
i2c_application.c
Go to the documentation of this file.
1
27#include "i2c_application.h"
28
37#define DMA_GET_TC_FLAG(DMA_CHANNEL) \
38(((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL1))? DMA1_FDT1_FLAG : \
39 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL2))? DMA1_FDT2_FLAG : \
40 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL3))? DMA1_FDT3_FLAG : \
41 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL4))? DMA1_FDT4_FLAG : \
42 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL5))? DMA1_FDT5_FLAG : \
43 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL6))? DMA1_FDT6_FLAG : \
44 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL7))? DMA1_FDT7_FLAG : \
45 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL1))? DMA2_FDT1_FLAG : \
46 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL2))? DMA2_FDT2_FLAG : \
47 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL3))? DMA2_FDT3_FLAG : \
48 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL4))? DMA2_FDT4_FLAG : \
49 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL5))? DMA2_FDT5_FLAG : \
50 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL6))? DMA2_FDT6_FLAG : \
51 DMA2_FDT7_FLAG)
52
56#define DMA_GET_HT_FLAG(DMA_CHANNEL) \
57(((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL1))? DMA1_HDT1_FLAG : \
58 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL2))? DMA1_HDT2_FLAG : \
59 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL3))? DMA1_HDT3_FLAG : \
60 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL4))? DMA1_HDT4_FLAG : \
61 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL5))? DMA1_HDT5_FLAG : \
62 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL6))? DMA1_HDT6_FLAG : \
63 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL7))? DMA1_HDT7_FLAG : \
64 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL1))? DMA2_HDT1_FLAG : \
65 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL2))? DMA2_HDT2_FLAG : \
66 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL3))? DMA2_HDT3_FLAG : \
67 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL4))? DMA2_HDT4_FLAG : \
68 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL5))? DMA2_HDT5_FLAG : \
69 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL6))? DMA2_HDT6_FLAG : \
70 DMA2_HDT7_FLAG)
71
75#define DMA_GET_TERR_FLAG(DMA_CHANNEL) \
76(((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL1))? DMA1_DTERR1_FLAG : \
77 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL2))? DMA1_DTERR2_FLAG : \
78 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL3))? DMA1_DTERR3_FLAG : \
79 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL4))? DMA1_DTERR4_FLAG : \
80 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL5))? DMA1_DTERR5_FLAG : \
81 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL6))? DMA1_DTERR6_FLAG : \
82 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA1_CHANNEL7))? DMA1_DTERR7_FLAG : \
83 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL1))? DMA2_DTERR1_FLAG : \
84 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL2))? DMA2_DTERR2_FLAG : \
85 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL3))? DMA2_DTERR3_FLAG : \
86 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL4))? DMA2_DTERR4_FLAG : \
87 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL5))? DMA2_DTERR5_FLAG : \
88 ((uint32_t)(DMA_CHANNEL) == ((uint32_t)DMA2_CHANNEL6))? DMA2_DTERR6_FLAG : \
89 DMA2_DTERR7_FLAG)
90
94#define I2C_START 0
95#define I2C_END 1
96
102void i2c_config(i2c_handle_type* hi2c)
103{
104 /* reset i2c peripheral */
105 i2c_reset(hi2c->i2cx);
106
107 /* i2c peripheral initialization */
108 i2c_lowlevel_init(hi2c);
109
110 /* i2c peripheral enable */
111 i2c_enable(hi2c->i2cx, TRUE);
112}
113
119void i2c_addr_flag_clear(i2c_handle_type* hi2c)
120{
121 __IO uint32_t tmpreg;
122
123 tmpreg = hi2c->i2cx->sts1;
124
125 tmpreg = hi2c->i2cx->sts2;
126}
127
133void i2c_stop_flag_clear(i2c_handle_type* hi2c)
134{
135 __IO uint32_t tmpreg;
136
137 tmpreg = hi2c->i2cx->sts1;
138
139 tmpreg = hi2c->i2cx->ctrl1_bit.i2cen = TRUE;
140}
141
148 i2c_status_type i2c_wait_end(i2c_handle_type* hi2c, uint32_t timeout)
149{
150 while(hi2c->status != I2C_END)
151 {
152 /* check timeout */
153 if((timeout--) == 0)
154 {
155 return I2C_ERR_TIMEOUT;
156 }
157 }
158
159 if(hi2c->error_code != I2C_OK)
160 {
161 return hi2c->error_code;
162 }
163 else
164 {
165 return I2C_OK;
166 }
167}
168
182 i2c_status_type i2c_wait_flag(i2c_handle_type* hi2c, uint32_t flag, flag_status status, uint32_t event_check, uint32_t timeout)
183{
184 while(i2c_flag_get(hi2c->i2cx, flag) == status)
185 {
186 /* check the ack fail flag */
187 if(event_check & I2C_EVENT_CHECK_ACKFAIL)
188 {
189 if(i2c_flag_get(hi2c->i2cx, I2C_ACKFAIL_FLAG) != RESET)
190 {
191 /* generate stop condtion */
192 i2c_stop_generate(hi2c->i2cx);
193
194 /* clear ack fail flag */
195 i2c_flag_clear(hi2c->i2cx, I2C_ACKFAIL_FLAG);
196
197 hi2c->error_code = I2C_ERR_ACKFAIL;
198
199 return I2C_ERR_ACKFAIL;
200 }
201 }
202
203 /* check the stop flag */
204 if(event_check & I2C_EVENT_CHECK_STOP)
205 {
206 if(i2c_flag_get(hi2c->i2cx, I2C_STOPF_FLAG) != RESET)
207 {
208 /* clear stop flag */
209 i2c_stop_flag_clear(hi2c);
210
211 hi2c->error_code = I2C_ERR_STOP;
212
213 return I2C_ERR_STOP;
214 }
215 }
216
217 /* check timeout */
218 if((timeout--) == 0)
219 {
220 hi2c->error_code = I2C_ERR_TIMEOUT;
221
222 return I2C_ERR_TIMEOUT;
223 }
224 }
225
226 return I2C_OK;
227}
228
237void i2c_dma_config(i2c_handle_type* hi2c, dma_channel_type* dma_channelx, uint8_t* pdata, uint16_t size)
238{
239 /* disable the dma channel */
240 dma_channel_enable(dma_channelx, FALSE);
241
242 /* disable the transfer complete interrupt */
243 dma_interrupt_enable(dma_channelx, DMA_FDT_INT , FALSE);
244
245 /* configure buffer address and buffer size */
246 hi2c->dma_init_struct.memory_base_addr = (uint32_t)pdata;
247 hi2c->dma_init_struct.direction = (dma_channelx == hi2c->dma_tx_channel) ? DMA_DIR_MEMORY_TO_PERIPHERAL : DMA_DIR_PERIPHERAL_TO_MEMORY;
248 hi2c->dma_init_struct.peripheral_base_addr = (uint32_t)&hi2c->i2cx->dt;
249 hi2c->dma_init_struct.buffer_size = (uint32_t)size;
250 dma_init(dma_channelx, &hi2c->dma_init_struct);
251
252 /* enable the transfer complete interrupt */
253 dma_interrupt_enable(dma_channelx, DMA_FDT_INT , TRUE);
254
255 /* enable the dma channel */
256 dma_channel_enable(dma_channelx, TRUE);
257}
258
266 i2c_status_type i2c_master_write_addr(i2c_handle_type *hi2c, uint16_t address, uint32_t timeout)
267{
268 /* generate start condtion */
269 i2c_start_generate(hi2c->i2cx);
270
271 /* wait for the start falg to be set */
272 if(i2c_wait_flag(hi2c, I2C_STARTF_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
273 {
274 hi2c->error_code = I2C_ERR_START;
275
276 return I2C_ERR_START;
277 }
278
279 if(hi2c->i2cx->oaddr1_bit.addr1mode == I2C_ADDRESS_MODE_7BIT)
280 {
281 /* send slave address */
282 i2c_7bit_address_send(hi2c->i2cx, address, I2C_DIRECTION_TRANSMIT);
283 }
284 else
285 {
286 /* send slave 10-bit address header */
287 i2c_data_send(hi2c->i2cx, (uint8_t)((address & 0x0300) >> 7) | 0xF0);
288
289 /* wait for the addrh falg to be set */
290 if(i2c_wait_flag(hi2c, I2C_ADDRHF_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
291 {
292 hi2c->error_code = I2C_ERR_ADDR10;
293
294 return I2C_ERR_ADDR10;
295 }
296
297 /* send slave address */
298 i2c_data_send(hi2c->i2cx, (uint8_t)(address & 0x00FF));
299 }
300
301 /* wait for the addr7 falg to be set */
302 if(i2c_wait_flag(hi2c, I2C_ADDR7F_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
303 {
304 hi2c->error_code = I2C_ERR_ADDR;
305
306 return I2C_ERR_ADDR;
307 }
308
309 return I2C_OK;
310}
311
319 i2c_status_type i2c_master_read_addr(i2c_handle_type *hi2c, uint16_t address, uint32_t timeout)
320{
321 /* enable ack */
322 i2c_ack_enable(hi2c->i2cx, TRUE);
323
324 /* generate start condtion */
325 i2c_start_generate(hi2c->i2cx);
326
327 /* wait for the start falg to be set */
328 if(i2c_wait_flag(hi2c, I2C_STARTF_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
329 {
330 hi2c->error_code = I2C_ERR_START;
331
332 return I2C_ERR_START;
333 }
334
335 if(hi2c->i2cx->oaddr1_bit.addr1mode == I2C_ADDRESS_MODE_7BIT)
336 {
337 /* send slave address */
338 i2c_7bit_address_send(hi2c->i2cx, address, I2C_DIRECTION_RECEIVE);
339 }
340 else
341 {
342 /* send slave 10-bit address header */
343 i2c_data_send(hi2c->i2cx, (uint8_t)((address & 0x0300) >> 7) | 0xF0);
344
345 /* wait for the addrh falg to be set */
346 if(i2c_wait_flag(hi2c, I2C_ADDRHF_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
347 {
348 hi2c->error_code = I2C_ERR_ADDR10;
349
350 return I2C_ERR_ADDR10;
351 }
352
353 /* send slave address */
354 i2c_data_send(hi2c->i2cx, (uint8_t)(address & 0x00FF));
355
356 /* wait for the addr7 falg to be set */
357 if(i2c_wait_flag(hi2c, I2C_ADDR7F_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
358 {
359 hi2c->error_code = I2C_ERR_ADDR;
360
361 return I2C_ERR_ADDR;
362 }
363
364 /* clear addr flag */
365 i2c_addr_flag_clear(hi2c);
366
367 /* generate restart condtion */
368 i2c_start_generate(hi2c->i2cx);
369
370 /* wait for the start falg to be set */
371 if(i2c_wait_flag(hi2c, I2C_STARTF_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
372 {
373 hi2c->error_code = I2C_ERR_START;
374
375 return I2C_ERR_START;
376 }
377
378 /* send slave 10-bit address header */
379 i2c_data_send(hi2c->i2cx, (uint8_t)((address & 0x0300) >> 7) | 0xF1);
380 }
381
382 /* wait for the addr7 falg to be set */
383 if(i2c_wait_flag(hi2c, I2C_ADDR7F_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
384 {
385 hi2c->error_code = I2C_ERR_ADDR;
386
387 return I2C_ERR_ADDR;
388 }
389
390 return I2C_OK;
391}
392
402 i2c_status_type i2c_master_transmit(i2c_handle_type* hi2c, uint16_t address, uint8_t* pdata, uint16_t size, uint32_t timeout)
403{
404 /* initialization parameters */
405 hi2c->pbuff = pdata;
406 hi2c->pcount = size;
407
408 hi2c->error_code = I2C_OK;
409
410 /* wait for the busy falg to be reset */
411 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
412 {
413 return I2C_ERR_STEP_1;
414 }
415
416 /* ack acts on the current byte */
417 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
418
419 /* send slave address */
420 if(i2c_master_write_addr(hi2c, address, timeout) != I2C_OK)
421 {
422 /* generate stop condtion */
423 i2c_stop_generate(hi2c->i2cx);
424
425 return I2C_ERR_STEP_2;
426 }
427
428 /* clear addr flag */
429 i2c_addr_flag_clear(hi2c);
430
431 while(size > 0)
432 {
433 /* wait for the tdbe falg to be set */
434 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
435 {
436 /* generate stop condtion */
437 i2c_stop_generate(hi2c->i2cx);
438
439 return I2C_ERR_STEP_3;
440 }
441
442 /* write data */
443 i2c_data_send(hi2c->i2cx, (*pdata++));
444 size--;
445 }
446
447 /* wait for the tdc falg to be set */
448 if(i2c_wait_flag(hi2c, I2C_TDC_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
449 {
450 /* generate stop condtion */
451 i2c_stop_generate(hi2c->i2cx);
452
453 return I2C_ERR_STEP_4;
454 }
455
456 /* generate stop condtion */
457 i2c_stop_generate(hi2c->i2cx);
458
459 return I2C_OK;
460}
461
470 i2c_status_type i2c_slave_receive(i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout)
471{
472 /* initialization parameters */
473 hi2c->pbuff = pdata;
474 hi2c->pcount = size;
475
476 hi2c->error_code = I2C_OK;
477
478 /* wait for the busy falg to be reset */
479 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
480 {
481 return I2C_ERR_STEP_1;
482 }
483
484 /* ack acts on the current byte */
485 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
486
487 /* enable ack */
488 i2c_ack_enable(hi2c->i2cx, TRUE);
489
490 /* wait for the addr7 falg to be set */
491 if(i2c_wait_flag(hi2c, I2C_ADDR7F_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
492 {
493 /* disable ack */
494 i2c_ack_enable(hi2c->i2cx, FALSE);
495
496 return I2C_ERR_STEP_2;
497 }
498
499 /* clear addr flag */
500 i2c_addr_flag_clear(hi2c);
501
502 while(size > 0)
503 {
504 /* wait for the rdbf falg to be set */
505 if(i2c_wait_flag(hi2c, I2C_RDBF_FLAG, RESET, I2C_EVENT_CHECK_STOP, timeout) != I2C_OK)
506 {
507 /* disable ack */
508 i2c_ack_enable(hi2c->i2cx, FALSE);
509
510 return I2C_ERR_STEP_3;
511 }
512
513 /* read data */
514 (*pdata++) = i2c_data_receive(hi2c->i2cx);
515 size--;
516 }
517
518 /* wait for the stop falg to be set */
519 if(i2c_wait_flag(hi2c, I2C_STOPF_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
520 {
521 /* disable ack */
522 i2c_ack_enable(hi2c->i2cx, FALSE);
523
524 return I2C_ERR_STEP_4;
525 }
526
527 /* clear stop flag */
528 i2c_stop_flag_clear(hi2c);
529
530 /* disable ack */
531 i2c_ack_enable(hi2c->i2cx, FALSE);
532
533 return I2C_OK;
534}
535
545 i2c_status_type i2c_master_receive(i2c_handle_type* hi2c, uint16_t address, uint8_t* pdata, uint16_t size, uint32_t timeout)
546{
547 /* initialization parameters */
548 hi2c->pbuff = pdata;
549 hi2c->pcount = size;
550
551 hi2c->error_code = I2C_OK;
552
553 /* wait for the busy falg to be reset */
554 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
555 {
556 return I2C_ERR_STEP_1;
557 }
558
559 /* ack acts on the current byte */
560 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
561
562 /* enable ack */
563 i2c_ack_enable(hi2c->i2cx, TRUE);
564
565 /* send slave address */
566 if(i2c_master_read_addr(hi2c, address, timeout) != I2C_OK)
567 {
568 /* generate stop condtion */
569 i2c_stop_generate(hi2c->i2cx);
570
571 return I2C_ERR_STEP_2;
572 }
573
574 if(size == 1)
575 {
576 /* disable ack */
577 i2c_ack_enable(hi2c->i2cx, FALSE);
578
579 /* clear addr flag */
580 i2c_addr_flag_clear(hi2c);
581
582 /* generate stop condtion */
583 i2c_stop_generate(hi2c->i2cx);
584 }
585 else if(size == 2)
586 {
587 /* ack acts on the next byte */
588 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_NEXT);
589
590 /* disable ack */
591 i2c_ack_enable(hi2c->i2cx, FALSE);
592
593 /* clear addr flag */
594 i2c_addr_flag_clear(hi2c);
595 }
596 else
597 {
598 /* enable ack */
599 i2c_ack_enable(hi2c->i2cx, TRUE);
600
601 /* clear addr flag */
602 i2c_addr_flag_clear(hi2c);
603 }
604
605 while(size > 0)
606 {
607 if(size <= 3)
608 {
609 /* 1 byte */
610 if(size == 1)
611 {
612 /* wait for the rdbf falg to be set */
613 if(i2c_wait_flag(hi2c, I2C_RDBF_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
614 {
615 /* generate stop condtion */
616 i2c_stop_generate(hi2c->i2cx);
617
618 return I2C_ERR_STEP_3;
619 }
620
621 /* read data */
622 (*pdata++) = i2c_data_receive(hi2c->i2cx);
623 size--;
624 }
625 /* 2 bytes */
626 else if(size == 2)
627 {
628 /* wait for the tdc falg to be set */
629 if(i2c_wait_flag(hi2c, I2C_TDC_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
630 {
631 /* generate stop condtion */
632 i2c_stop_generate(hi2c->i2cx);
633
634 return I2C_ERR_STEP_4;
635 }
636
637 /* generate stop condtion */
638 i2c_stop_generate(hi2c->i2cx);
639
640 /* read data */
641 (*pdata++) = i2c_data_receive(hi2c->i2cx);
642 size--;
643
644 /* read data */
645 (*pdata++) = i2c_data_receive(hi2c->i2cx);
646 size--;
647 }
648 /* 3 last bytes */
649 else
650 {
651 /* wait for the tdc falg to be set */
652 if(i2c_wait_flag(hi2c, I2C_TDC_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
653 {
654 /* generate stop condtion */
655 i2c_stop_generate(hi2c->i2cx);
656
657 return I2C_ERR_STEP_5;
658 }
659
660 /* disable ack */
661 i2c_ack_enable(hi2c->i2cx, FALSE);
662
663 /* read data */
664 (*pdata++) = i2c_data_receive(hi2c->i2cx);
665 size--;
666
667 /* wait for the tdc falg to be set */
668 if(i2c_wait_flag(hi2c, I2C_TDC_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
669 {
670 /* generate stop condtion */
671 i2c_stop_generate(hi2c->i2cx);
672
673 return I2C_ERR_STEP_6;
674 }
675
676 /* generate stop condtion */
677 i2c_stop_generate(hi2c->i2cx);
678
679 /* read data */
680 (*pdata++) = i2c_data_receive(hi2c->i2cx);
681 size--;
682
683 /* read data */
684 (*pdata++) = i2c_data_receive(hi2c->i2cx);
685 size--;
686 }
687 }
688 else
689 {
690 /* wait for the rdbf falg to be set */
691 if(i2c_wait_flag(hi2c, I2C_RDBF_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
692 {
693 /* generate stop condtion */
694 i2c_stop_generate(hi2c->i2cx);
695
696 return I2C_ERR_STEP_7;
697 }
698
699 /* read data */
700 (*pdata++) = i2c_data_receive(hi2c->i2cx);
701 size--;
702 }
703 }
704
705 return I2C_OK;
706}
707
716 i2c_status_type i2c_slave_transmit(i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout)
717{
718 /* initialization parameters */
719 hi2c->pbuff = pdata;
720 hi2c->pcount = size;
721
722 hi2c->error_code = I2C_OK;
723
724 /* wait for the busy falg to be reset */
725 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
726 {
727 return I2C_ERR_STEP_1;
728 }
729
730 /* ack acts on the current byte */
731 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
732
733 /* enable ack */
734 i2c_ack_enable(hi2c->i2cx, TRUE);
735
736 /* wait for the addr7 falg to be set */
737 if(i2c_wait_flag(hi2c, I2C_ADDR7F_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
738 {
739 /* disable ack */
740 i2c_ack_enable(hi2c->i2cx, FALSE);
741
742 return I2C_ERR_STEP_2;
743 }
744
745 /* clear addr flag */
746 i2c_addr_flag_clear(hi2c);
747
748 if(hi2c->i2cx->oaddr1_bit.addr1mode == I2C_ADDRESS_MODE_10BIT)
749 {
750 /* wait for the addr7 falg to be set */
751 if(i2c_wait_flag(hi2c, I2C_ADDR7F_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
752 {
753 /* disable ack */
754 i2c_ack_enable(hi2c->i2cx, FALSE);
755
756 return I2C_ERR_STEP_3;
757 }
758
759 /* clear addr flag */
760 i2c_addr_flag_clear(hi2c);
761 }
762
763 while(size > 0)
764 {
765 /* wait for the tdbe falg to be set */
766 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
767 {
768 /* disable ack */
769 i2c_ack_enable(hi2c->i2cx, FALSE);
770
771 return I2C_ERR_STEP_4;
772 }
773
774 /* write data */
775 i2c_data_send(hi2c->i2cx, *pdata++);
776 size--;
777 }
778
779 /* wait for the ackfail falg to be set */
780 if(i2c_wait_flag(hi2c, I2C_ACKFAIL_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
781 {
782 return I2C_ERR_STEP_5;
783 }
784
785 /* clear ackfail flag */
786 i2c_flag_clear(hi2c->i2cx, I2C_ACKFAIL_FLAG);
787
788 /* disable ack */
789 i2c_ack_enable(hi2c->i2cx, FALSE);
790
791 return I2C_OK;
792}
793
803 i2c_status_type i2c_master_transmit_int(i2c_handle_type* hi2c, uint16_t address, uint8_t* pdata, uint16_t size, uint32_t timeout)
804{
805 /* initialization parameters */
806 hi2c->mode = I2C_INT_MA_TX;
807 hi2c->status = I2C_START;
808
809 hi2c->pbuff = pdata;
810 hi2c->pcount = size;
811
812 hi2c->timeout = timeout;
813 hi2c->error_code = I2C_OK;
814
815 /* wait for the busy falg to be reset */
816 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
817 {
818 return I2C_ERR_STEP_1;
819 }
820
821 /* ack acts on the current byte */
822 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
823
824 /* send slave address */
825 if(i2c_master_write_addr(hi2c, address, timeout) != I2C_OK)
826 {
827 /* generate stop condtion */
828 i2c_stop_generate(hi2c->i2cx);
829
830 return I2C_ERR_STEP_2;
831 }
832
833 /* clear addr flag */
834 i2c_addr_flag_clear(hi2c);
835
836 /* enable interrupt */
837 i2c_interrupt_enable(I2C1, I2C_EVT_INT | I2C_DATA_INT | I2C_ERR_INT, TRUE);
838
839 return I2C_OK;
840}
841
850 i2c_status_type i2c_slave_receive_int(i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout)
851{
852 /* initialization parameters */
853 hi2c->mode = I2C_INT_SLA_RX;
854 hi2c->status = I2C_START;
855
856 hi2c->pbuff = pdata;
857 hi2c->pcount = size;
858
859 hi2c->timeout = timeout;
860 hi2c->error_code = I2C_OK;
861
862 /* wait for the busy falg to be reset */
863 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
864 {
865 return I2C_ERR_STEP_1;
866 }
867
868 /* ack acts on the current byte */
869 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
870
871 /* enable ack */
872 i2c_ack_enable(hi2c->i2cx, TRUE);
873
874 /* wait for the addr7 falg to be set */
875 if(i2c_wait_flag(hi2c, I2C_ADDR7F_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
876 {
877 return I2C_ERR_STEP_2;
878 }
879
880 /* clear addr flag */
881 i2c_addr_flag_clear(hi2c);
882
883 /* enable interrupt */
884 i2c_interrupt_enable(I2C1, I2C_EVT_INT | I2C_DATA_INT | I2C_ERR_INT, TRUE);
885
886 return I2C_OK;
887}
888
898 i2c_status_type i2c_master_receive_int(i2c_handle_type* hi2c, uint16_t address, uint8_t* pdata, uint16_t size, uint32_t timeout)
899{
900 /* initialization parameters */
901 hi2c->mode = I2C_INT_MA_RX;
902 hi2c->status = I2C_START;
903
904 hi2c->pbuff = pdata;
905 hi2c->pcount = size;
906
907 hi2c->timeout = timeout;
908 hi2c->error_code = I2C_OK;
909
910 /* wait for the busy falg to be reset */
911 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
912 {
913 return I2C_ERR_STEP_1;
914 }
915
916 /* ack acts on the current byte */
917 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
918
919 /* enable ack */
920 i2c_ack_enable(hi2c->i2cx, TRUE);
921
922 /* send slave address */
923 if(i2c_master_read_addr(hi2c, address, timeout) != I2C_OK)
924 {
925 /* generate stop condtion */
926 i2c_stop_generate(hi2c->i2cx);
927
928 return I2C_ERR_STEP_2;
929 }
930
931 if(hi2c->pcount == 1)
932 {
933 /* disable ack */
934 i2c_ack_enable(hi2c->i2cx, FALSE);
935
936 /* clear addr flag */
937 i2c_addr_flag_clear(hi2c);
938
939 /* generate stop condtion */
940 i2c_stop_generate(hi2c->i2cx);
941 }
942 else if(hi2c->pcount == 2)
943 {
944 /* ack acts on the next byte */
945 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_NEXT);
946
947 /* clear addr flag */
948 i2c_addr_flag_clear(hi2c);
949
950 /* disable ack */
951 i2c_ack_enable(hi2c->i2cx, FALSE);
952 }
953 else
954 {
955 /* enable ack */
956 i2c_ack_enable(hi2c->i2cx, TRUE);
957
958 /* clear addr flag */
959 i2c_addr_flag_clear(hi2c);
960 }
961
962 /* enable interrupt */
963 i2c_interrupt_enable(I2C1, I2C_EVT_INT | I2C_DATA_INT | I2C_ERR_INT, TRUE);
964
965 return I2C_OK;
966}
967
976 i2c_status_type i2c_slave_transmit_int(i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout)
977{
978 /* initialization parameters */
979 hi2c->mode = I2C_INT_SLA_TX;
980 hi2c->status = I2C_START;
981
982 hi2c->pbuff = pdata;
983 hi2c->pcount = size;
984
985 hi2c->timeout = timeout;
986 hi2c->error_code = I2C_OK;
987
988 /* wait for the busy falg to be reset */
989 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
990 {
991 return I2C_ERR_STEP_1;
992 }
993
994 /* ack acts on the current byte */
995 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
996
997 /* enable ack */
998 i2c_ack_enable(hi2c->i2cx, TRUE);
999
1000 /* wait for the addr7 falg to be set */
1001 if(i2c_wait_flag(hi2c, I2C_ADDR7F_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1002 {
1003 return I2C_ERR_STEP_2;
1004 }
1005
1006 /* clear addr flag */
1007 i2c_addr_flag_clear(hi2c);
1008
1009 if(hi2c->i2cx->oaddr1_bit.addr1mode == I2C_ADDRESS_MODE_10BIT)
1010 {
1011 /* wait for the addr7 falg to be set */
1012 if(i2c_wait_flag(hi2c, I2C_ADDR7F_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1013 {
1014 /* disable ack */
1015 i2c_ack_enable(hi2c->i2cx, FALSE);
1016
1017 return I2C_ERR_STEP_3;
1018 }
1019
1020 /* clear addr flag */
1021 i2c_addr_flag_clear(hi2c);
1022 }
1023
1024 /* enable interrupt */
1025 i2c_interrupt_enable(I2C1, I2C_EVT_INT | I2C_DATA_INT | I2C_ERR_INT, TRUE);
1026
1027 return I2C_OK;
1028}
1029
1039 i2c_status_type i2c_master_transmit_dma(i2c_handle_type* hi2c, uint16_t address, uint8_t* pdata, uint16_t size, uint32_t timeout)
1040{
1041 /* initialization parameters */
1042 hi2c->mode = I2C_DMA_MA_TX;
1043 hi2c->status = I2C_START;
1044
1045 hi2c->pbuff = pdata;
1046 hi2c->pcount = size;
1047
1048 hi2c->timeout = timeout;
1049 hi2c->error_code = I2C_OK;
1050
1051 /* wait for the busy falg to be reset */
1052 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1053 {
1054 return I2C_ERR_STEP_1;
1055 }
1056
1057 /* ack acts on the current byte */
1058 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
1059
1060 /* disable dma request */
1061 i2c_dma_enable(hi2c->i2cx, FALSE);
1062
1063 /* configure the dma channel */
1064 i2c_dma_config(hi2c, hi2c->dma_tx_channel, pdata, size);
1065
1066 /* send slave address */
1067 if(i2c_master_write_addr(hi2c, address, timeout) != I2C_OK)
1068 {
1069 /* generate stop condtion */
1070 i2c_stop_generate(hi2c->i2cx);
1071
1072 return I2C_ERR_STEP_2;
1073 }
1074
1075 /* clear addr flag */
1076 i2c_addr_flag_clear(hi2c);
1077
1078 /* enable dma request */
1079 i2c_dma_enable(hi2c->i2cx, TRUE);
1080
1081 return I2C_OK;
1082}
1083
1092 i2c_status_type i2c_slave_receive_dma(i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout)
1093{
1094 /* initialization parameters */
1095 hi2c->mode = I2C_DMA_SLA_RX;
1096 hi2c->status = I2C_START;
1097
1098 hi2c->pbuff = pdata;
1099 hi2c->pcount = size;
1100
1101 hi2c->timeout = timeout;
1102 hi2c->error_code = I2C_OK;
1103
1104 /* wait for the busy falg to be reset */
1105 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1106 {
1107 return I2C_ERR_STEP_1;
1108 }
1109
1110 /* ack acts on the current byte */
1111 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
1112
1113 /* enable ack */
1114 i2c_ack_enable(hi2c->i2cx, TRUE);
1115
1116 /* disable dma request */
1117 i2c_dma_enable(hi2c->i2cx, FALSE);
1118
1119 /* configure the dma channel */
1120 i2c_dma_config(hi2c, hi2c->dma_rx_channel, pdata, size);
1121
1122 /* wait for the addr7 falg to be set */
1123 if(i2c_wait_flag(hi2c, I2C_ADDR7F_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1124 {
1125 /* disable ack */
1126 i2c_ack_enable(hi2c->i2cx, FALSE);
1127
1128 return I2C_ERR_STEP_2;
1129 }
1130
1131 /* enable dma request */
1132 i2c_dma_enable(hi2c->i2cx, TRUE);
1133
1134 /* clear addr flag */
1135 i2c_addr_flag_clear(hi2c);
1136
1137 return I2C_OK;
1138}
1139
1149 i2c_status_type i2c_master_receive_dma(i2c_handle_type* hi2c, uint16_t address, uint8_t* pdata, uint16_t size, uint32_t timeout)
1150{
1151 /* initialization parameters */
1152 hi2c->mode = I2C_DMA_MA_RX;
1153 hi2c->status = I2C_START;
1154
1155 hi2c->pbuff = pdata;
1156 hi2c->pcount = size;
1157
1158 hi2c->timeout = timeout;
1159 hi2c->error_code = I2C_OK;
1160
1161 /* wait for the busy falg to be reset */
1162 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1163 {
1164 return I2C_ERR_STEP_1;
1165 }
1166
1167 /* ack acts on the current byte */
1168 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
1169
1170 /* enable ack */
1171 i2c_ack_enable(hi2c->i2cx, TRUE);
1172
1173 /* disable dma request */
1174 i2c_dma_enable(hi2c->i2cx, FALSE);
1175
1176 /* configure the dma channel */
1177 i2c_dma_config(hi2c, hi2c->dma_rx_channel, pdata, size);
1178
1179 /* send slave address */
1180 if(i2c_master_read_addr(hi2c, address, timeout) != I2C_OK)
1181 {
1182 /* generate stop condtion */
1183 i2c_stop_generate(hi2c->i2cx);
1184
1185 return I2C_ERR_STEP_2;
1186 }
1187
1188 if(size == 1)
1189 {
1190 /* clear addr flag */
1191 i2c_addr_flag_clear(hi2c);
1192
1193 /* disable ack */
1194 i2c_ack_enable(hi2c->i2cx, FALSE);
1195
1196 /* generate stop condtion */
1197 i2c_stop_generate(hi2c->i2cx);
1198
1199 /* enable dma request */
1200 i2c_dma_enable(hi2c->i2cx, TRUE);
1201 }
1202 else
1203 {
1204 /* enable dma end transfer */
1205 i2c_dma_end_transfer_set(hi2c->i2cx, TRUE);
1206
1207 /* enable dma request */
1208 i2c_dma_enable(hi2c->i2cx, TRUE);
1209
1210 /* clear addr flag */
1211 i2c_addr_flag_clear(hi2c);
1212 }
1213
1214 return I2C_OK;
1215}
1216
1225 i2c_status_type i2c_slave_transmit_dma(i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout)
1226{
1227 /* initialization parameters */
1228 hi2c->mode = I2C_DMA_SLA_TX;
1229 hi2c->status = I2C_START;
1230
1231 hi2c->pbuff = pdata;
1232 hi2c->pcount = size;
1233
1234 hi2c->timeout = timeout;
1235 hi2c->error_code = I2C_OK;
1236
1237 /* wait for the busy falg to be reset */
1238 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1239 {
1240 return I2C_ERR_STEP_1;
1241 }
1242
1243 /* ack acts on the current byte */
1244 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
1245
1246 /* enable ack */
1247 i2c_ack_enable(hi2c->i2cx, TRUE);
1248
1249 /* disable dma request */
1250 i2c_dma_enable(hi2c->i2cx, FALSE);
1251
1252 /* configure the dma channel */
1253 i2c_dma_config(hi2c, hi2c->dma_tx_channel, pdata, size);
1254
1255
1256 /* wait for the addr7 falg to be set */
1257 if(i2c_wait_flag(hi2c, I2C_ADDR7F_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1258 {
1259 /* disable ack */
1260 i2c_ack_enable(hi2c->i2cx, FALSE);
1261
1262 return I2C_ERR_STEP_2;
1263 }
1264
1265 if(hi2c->i2cx->oaddr1_bit.addr1mode == I2C_ADDRESS_MODE_10BIT)
1266 {
1267 /* clear addr flag */
1268 i2c_addr_flag_clear(hi2c);
1269
1270 /* wait for the addr7 falg to be set */
1271 if(i2c_wait_flag(hi2c, I2C_ADDR7F_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1272 {
1273 /* disable ack */
1274 i2c_ack_enable(hi2c->i2cx, FALSE);
1275
1276 return I2C_ERR_STEP_3;
1277 }
1278 }
1279
1280 /* clear addr flag */
1281 i2c_addr_flag_clear(hi2c);
1282
1283 /* enable dma request */
1284 i2c_dma_enable(hi2c->i2cx, TRUE);
1285
1286 return I2C_OK;
1287}
1288
1299 i2c_status_type i2c_memory_write(i2c_handle_type* hi2c, uint16_t address, uint16_t memaddress, uint8_t* pdata, uint16_t size, uint32_t timeout)
1300{
1301 /* initialization parameters */
1302 hi2c->pbuff = pdata;
1303 hi2c->pcount = size;
1304
1305 hi2c->error_code = I2C_OK;
1306
1307 /* wait for the busy falg to be reset */
1308 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1309 {
1310 return I2C_ERR_STEP_1;
1311 }
1312
1313 /* ack acts on the current byte */
1314 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
1315
1316 /* send slave address */
1317 if(i2c_master_write_addr(hi2c, address, timeout) != I2C_OK)
1318 {
1319 /* generate stop condtion */
1320 i2c_stop_generate(hi2c->i2cx);
1321
1322 return I2C_ERR_STEP_2;
1323 }
1324
1325 /* clear addr flag */
1326 i2c_addr_flag_clear(hi2c);
1327
1328 /* wait for the tdbe falg to be set */
1329 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
1330 {
1331 /* generate stop condtion */
1332 i2c_stop_generate(hi2c->i2cx);
1333
1334 return I2C_ERR_STEP_3;
1335 }
1336
1337 /* send memory address */
1338 i2c_data_send(hi2c->i2cx, memaddress);
1339
1340 while(size > 0)
1341 {
1342 /* wait for the tdbe falg to be set */
1343 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
1344 {
1345 /* generate stop condtion */
1346 i2c_stop_generate(hi2c->i2cx);
1347
1348 return I2C_ERR_STEP_4;
1349 }
1350
1351 /* write data */
1352 i2c_data_send(hi2c->i2cx, (*pdata++));
1353 size--;
1354 }
1355
1356 /* wait for the tdc falg to be set */
1357 if(i2c_wait_flag(hi2c, I2C_TDC_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
1358 {
1359 /* generate stop condtion */
1360 i2c_stop_generate(hi2c->i2cx);
1361
1362 return I2C_ERR_STEP_5;
1363 }
1364
1365 /* generate stop condtion */
1366 i2c_stop_generate(hi2c->i2cx);
1367
1368 return I2C_OK;
1369}
1370
1381 i2c_status_type i2c_memory_read(i2c_handle_type* hi2c, uint16_t address, uint16_t memaddress, uint8_t* pdata, uint16_t size, uint32_t timeout)
1382{
1383 /* initialization parameters */
1384 hi2c->pbuff = pdata;
1385 hi2c->pcount = size;
1386
1387 hi2c->error_code = I2C_OK;
1388
1389 /* wait for the busy falg to be reset */
1390 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1391 {
1392 return I2C_ERR_STEP_1;
1393 }
1394
1395 /* ack acts on the current byte */
1396 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
1397
1398 /* enable ack */
1399 i2c_ack_enable(hi2c->i2cx, TRUE);
1400
1401 /* send slave address */
1402 if(i2c_master_write_addr(hi2c, address, timeout) != I2C_OK)
1403 {
1404 /* generate stop condtion */
1405 i2c_stop_generate(hi2c->i2cx);
1406
1407 return I2C_ERR_STEP_2;
1408 }
1409
1410 /* clear addr flag */
1411 i2c_addr_flag_clear(hi2c);
1412
1413 /* wait for the tdbe falg to be set */
1414 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
1415 {
1416 /* generate stop condtion */
1417 i2c_stop_generate(hi2c->i2cx);
1418
1419 return I2C_ERR_STEP_3;
1420 }
1421
1422 /* send memory address */
1423 i2c_data_send(hi2c->i2cx, memaddress);
1424
1425 /* wait for the tdbe falg to be set */
1426 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
1427 {
1428 /* generate stop condtion */
1429 i2c_stop_generate(hi2c->i2cx);
1430
1431 return I2C_ERR_STEP_4;
1432 }
1433
1434 /* send slave address */
1435 if(i2c_master_read_addr(hi2c, address, timeout) != I2C_OK)
1436 {
1437 /* generate stop condtion */
1438 i2c_stop_generate(hi2c->i2cx);
1439
1440 return I2C_ERR_STEP_5;
1441 }
1442
1443 if(size == 1)
1444 {
1445 /* disable ack */
1446 i2c_ack_enable(hi2c->i2cx, FALSE);
1447
1448 /* clear addr flag */
1449 i2c_addr_flag_clear(hi2c);
1450
1451 /* generate stop condtion */
1452 i2c_stop_generate(hi2c->i2cx);
1453 }
1454 else if(size == 2)
1455 {
1456 /* ack acts on the next byte */
1457 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_NEXT);
1458
1459 /* clear addr flag */
1460 i2c_addr_flag_clear(hi2c);
1461
1462 /* disable ack */
1463 i2c_ack_enable(hi2c->i2cx, FALSE);
1464 }
1465 else
1466 {
1467 /* enable ack */
1468 i2c_ack_enable(hi2c->i2cx, TRUE);
1469
1470 /* clear addr flag */
1471 i2c_addr_flag_clear(hi2c);
1472 }
1473
1474 while(size > 0)
1475 {
1476 if(size <= 3)
1477 {
1478 /* 1 byte */
1479 if(size == 1)
1480 {
1481 /* wait for the rdbf falg to be set */
1482 if(i2c_wait_flag(hi2c, I2C_RDBF_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1483 {
1484 /* generate stop condtion */
1485 i2c_stop_generate(hi2c->i2cx);
1486
1487 return I2C_ERR_STEP_6;
1488 }
1489
1490 /* read data */
1491 (*pdata++) = i2c_data_receive(hi2c->i2cx);
1492 size--;
1493 }
1494 /* 2 bytes */
1495 else if(size == 2)
1496 {
1497 /* wait for the tdc falg to be set */
1498 if(i2c_wait_flag(hi2c, I2C_TDC_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1499 {
1500 /* generate stop condtion */
1501 i2c_stop_generate(hi2c->i2cx);
1502
1503 return I2C_ERR_STEP_7;
1504 }
1505
1506 /* generate stop condtion */
1507 i2c_stop_generate(hi2c->i2cx);
1508
1509 /* read data */
1510 (*pdata++) = i2c_data_receive(hi2c->i2cx);
1511 size--;
1512
1513 /* read data */
1514 (*pdata++) = i2c_data_receive(hi2c->i2cx);
1515 size--;
1516 }
1517 /* 3 last bytes */
1518 else
1519 {
1520 /* wait for the tdc falg to be set */
1521 if(i2c_wait_flag(hi2c, I2C_TDC_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1522 {
1523 /* generate stop condtion */
1524 i2c_stop_generate(hi2c->i2cx);
1525
1526 return I2C_ERR_STEP_8;
1527 }
1528
1529 /* disable ack */
1530 i2c_ack_enable(hi2c->i2cx, FALSE);
1531
1532 /* read data */
1533 (*pdata++) = i2c_data_receive(hi2c->i2cx);
1534 size--;
1535
1536 /* wait for the tdc falg to be set */
1537 if(i2c_wait_flag(hi2c, I2C_TDC_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1538 {
1539 /* generate stop condtion */
1540 i2c_stop_generate(hi2c->i2cx);
1541
1542 return I2C_ERR_STEP_9;
1543 }
1544
1545 /* generate stop condtion */
1546 i2c_stop_generate(hi2c->i2cx);
1547
1548 /* read data */
1549 (*pdata++) = i2c_data_receive(hi2c->i2cx);
1550 size--;
1551
1552 /* read data */
1553 (*pdata++) = i2c_data_receive(hi2c->i2cx);
1554 size--;
1555 }
1556 }
1557 else
1558 {
1559 /* wait for the rdbf falg to be set */
1560 if(i2c_wait_flag(hi2c, I2C_RDBF_FLAG, RESET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1561 {
1562 /* generate stop condtion */
1563 i2c_stop_generate(hi2c->i2cx);
1564
1565 return I2C_ERR_STEP_10;
1566 }
1567
1568 /* read data */
1569 (*pdata++) = i2c_data_receive(hi2c->i2cx);
1570 size--;
1571 }
1572 }
1573
1574 return I2C_OK;
1575}
1576
1587 i2c_status_type i2c_memory_write_int(i2c_handle_type* hi2c, uint16_t address, uint16_t memaddress, uint8_t* pdata, uint16_t size, uint32_t timeout)
1588{
1589 /* initialization parameters */
1590 hi2c->mode = I2C_INT_MA_TX;
1591 hi2c->status = I2C_START;
1592
1593 hi2c->pbuff = pdata;
1594 hi2c->pcount = size;
1595
1596 hi2c->timeout = timeout;
1597 hi2c->error_code = I2C_OK;
1598
1599 /* wait for the busy falg to be reset */
1600 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1601 {
1602 return I2C_ERR_STEP_1;
1603 }
1604
1605 /* ack acts on the current byte */
1606 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
1607
1608 /* send slave address */
1609 if(i2c_master_write_addr(hi2c, address, timeout) != I2C_OK)
1610 {
1611 /* generate stop condtion */
1612 i2c_stop_generate(hi2c->i2cx);
1613
1614 return I2C_ERR_STEP_2;
1615 }
1616
1617 /* clear addr flag */
1618 i2c_addr_flag_clear(hi2c);
1619
1620 /* wait for the tdbe falg to be set */
1621 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
1622 {
1623 /* generate stop condtion */
1624 i2c_stop_generate(hi2c->i2cx);
1625
1626 return I2C_ERR_STEP_3;
1627 }
1628
1629 /* send memory address */
1630 i2c_data_send(hi2c->i2cx, memaddress);
1631
1632 /* wait for the tdbe falg to be set */
1633 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
1634 {
1635 /* generate stop condtion */
1636 i2c_stop_generate(hi2c->i2cx);
1637
1638 return I2C_ERR_STEP_4;
1639 }
1640
1641 /* enable interrupt */
1642 i2c_interrupt_enable(I2C1, I2C_EVT_INT | I2C_DATA_INT | I2C_ERR_INT, TRUE);
1643
1644 return I2C_OK;
1645}
1646
1657 i2c_status_type i2c_memory_read_int(i2c_handle_type* hi2c, uint16_t address, uint16_t memaddress, uint8_t* pdata, uint16_t size, uint32_t timeout)
1658{
1659 /* initialization parameters */
1660 hi2c->mode = I2C_INT_MA_RX;
1661 hi2c->status = I2C_START;
1662
1663 hi2c->pbuff = pdata;
1664 hi2c->pcount = size;
1665
1666 hi2c->timeout = timeout;
1667 hi2c->error_code = I2C_OK;
1668
1669 /* wait for the busy falg to be reset */
1670 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1671 {
1672 return I2C_ERR_STEP_1;
1673 }
1674
1675 /* ack acts on the current byte */
1676 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
1677
1678 /* send slave address */
1679 if(i2c_master_write_addr(hi2c, address, timeout) != I2C_OK)
1680 {
1681 /* generate stop condtion */
1682 i2c_stop_generate(hi2c->i2cx);
1683
1684 return I2C_ERR_STEP_2;
1685 }
1686
1687 /* clear addr flag */
1688 i2c_addr_flag_clear(hi2c);
1689
1690 /* wait for the tdbe falg to be set */
1691 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
1692 {
1693 /* generate stop condtion */
1694 i2c_stop_generate(hi2c->i2cx);
1695
1696 return I2C_ERR_STEP_3;
1697 }
1698
1699 /* send memory address */
1700 i2c_data_send(hi2c->i2cx, memaddress);
1701
1702 /* wait for the tdbe falg to be set */
1703 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
1704 {
1705 /* generate stop condtion */
1706 i2c_stop_generate(hi2c->i2cx);
1707
1708 return I2C_ERR_STEP_4;
1709 }
1710
1711 /* send slave address */
1712 if(i2c_master_read_addr(hi2c, address, timeout) != I2C_OK)
1713 {
1714 /* generate stop condtion */
1715 i2c_stop_generate(hi2c->i2cx);
1716
1717 return I2C_ERR_STEP_5;
1718 }
1719
1720 if(hi2c->pcount == 1)
1721 {
1722 /* disable ack */
1723 i2c_ack_enable(hi2c->i2cx, FALSE);
1724
1725 /* clear addr flag */
1726 i2c_addr_flag_clear(hi2c);
1727
1728 /* generate stop condtion */
1729 i2c_stop_generate(hi2c->i2cx);
1730 }
1731 else if(hi2c->pcount == 2)
1732 {
1733 /* ack acts on the next byte */
1734 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_NEXT);
1735
1736 /* clear addr flag */
1737 i2c_addr_flag_clear(hi2c);
1738
1739 /* disable ack */
1740 i2c_ack_enable(hi2c->i2cx, FALSE);
1741 }
1742 else
1743 {
1744 /* enable ack */
1745 i2c_ack_enable(hi2c->i2cx, TRUE);
1746
1747 /* clear addr flag */
1748 i2c_addr_flag_clear(hi2c);
1749 }
1750
1751 /* enable interrupt */
1752 i2c_interrupt_enable(I2C1, I2C_EVT_INT | I2C_DATA_INT | I2C_ERR_INT, TRUE);
1753
1754 return I2C_OK;
1755}
1756
1767 i2c_status_type i2c_memory_write_dma(i2c_handle_type* hi2c, uint16_t address, uint16_t memaddress, uint8_t* pdata, uint16_t size, uint32_t timeout)
1768{
1769 /* initialization parameters */
1770 hi2c->mode = I2C_DMA_MA_TX;
1771 hi2c->status = I2C_START;
1772
1773 hi2c->pbuff = pdata;
1774 hi2c->pcount = size;
1775
1776 hi2c->timeout = timeout;
1777 hi2c->error_code = I2C_OK;
1778
1779 /* wait for the busy falg to be reset */
1780 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1781 {
1782 return I2C_ERR_STEP_1;
1783 }
1784
1785 /* ack acts on the current byte */
1786 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
1787
1788 /* disable dma request */
1789 i2c_dma_enable(hi2c->i2cx, FALSE);
1790
1791 /* configure the dma channel */
1792 i2c_dma_config(hi2c, hi2c->dma_tx_channel, pdata, size);
1793
1794 /* send slave address */
1795 if(i2c_master_write_addr(hi2c, address, timeout) != I2C_OK)
1796 {
1797 /* generate stop condtion */
1798 i2c_stop_generate(hi2c->i2cx);
1799
1800 return I2C_ERR_STEP_2;
1801 }
1802
1803 /* clear addr flag */
1804 i2c_addr_flag_clear(hi2c);
1805
1806 /* wait for the tdbe falg to be set */
1807 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
1808 {
1809 /* generate stop condtion */
1810 i2c_stop_generate(hi2c->i2cx);
1811
1812 return I2C_ERR_STEP_3;
1813 }
1814
1815 /* send memory address */
1816 i2c_data_send(hi2c->i2cx, memaddress);
1817
1818 /* wait for the tdbe falg to be set */
1819 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
1820 {
1821 /* generate stop condtion */
1822 i2c_stop_generate(hi2c->i2cx);
1823
1824 return I2C_ERR_STEP_4;
1825 }
1826
1827 /* enable dma request */
1828 i2c_dma_enable(hi2c->i2cx, TRUE);
1829
1830 return I2C_OK;
1831}
1832
1843 i2c_status_type i2c_memory_read_dma(i2c_handle_type* hi2c, uint16_t address, uint16_t memaddress, uint8_t* pdata, uint16_t size, uint32_t timeout)
1844{
1845 /* initialization parameters */
1846 hi2c->mode = I2C_DMA_MA_RX;
1847 hi2c->status = I2C_START;
1848
1849 hi2c->pbuff = pdata;
1850 hi2c->pcount = size;
1851
1852 hi2c->timeout = timeout;
1853 hi2c->error_code = I2C_OK;
1854
1855 /* wait for the busy falg to be reset */
1856 if(i2c_wait_flag(hi2c, I2C_BUSYF_FLAG, SET, I2C_EVENT_CHECK_NONE, timeout) != I2C_OK)
1857 {
1858 return I2C_ERR_STEP_1;
1859 }
1860
1861 /* ack acts on the current byte */
1862 i2c_master_receive_ack_set(hi2c->i2cx, I2C_MASTER_ACK_CURRENT);
1863
1864 /* enable ack */
1865 i2c_ack_enable(hi2c->i2cx, TRUE);
1866
1867 /* disable dma request */
1868 i2c_dma_enable(hi2c->i2cx, FALSE);
1869
1870 /* configure the dma channel */
1871 i2c_dma_config(hi2c, hi2c->dma_rx_channel, pdata, size);
1872
1873 /* send slave address */
1874 if(i2c_master_write_addr(hi2c, address, timeout) != I2C_OK)
1875 {
1876 /* generate stop condtion */
1877 i2c_stop_generate(hi2c->i2cx);
1878
1879 return I2C_ERR_STEP_2;
1880 }
1881
1882 /* clear addr flag */
1883 i2c_addr_flag_clear(hi2c);
1884
1885 /* wait for the tdbe falg to be set */
1886 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
1887 {
1888 /* generate stop condtion */
1889 i2c_stop_generate(hi2c->i2cx);
1890
1891 return I2C_ERR_STEP_3;
1892 }
1893
1894 /* send memory address */
1895 i2c_data_send(hi2c->i2cx, memaddress);
1896
1897 /* wait for the tdbe falg to be set */
1898 if(i2c_wait_flag(hi2c, I2C_TDBE_FLAG, RESET, I2C_EVENT_CHECK_ACKFAIL, timeout) != I2C_OK)
1899 {
1900 /* generate stop condtion */
1901 i2c_stop_generate(hi2c->i2cx);
1902
1903 return I2C_ERR_STEP_4;
1904 }
1905
1906 /* send slave address */
1907 if(i2c_master_read_addr(hi2c, address, timeout) != I2C_OK)
1908 {
1909 /* generate stop condtion */
1910 i2c_stop_generate(hi2c->i2cx);
1911
1912 return I2C_ERR_STEP_5;
1913 }
1914
1915 if(size == 1)
1916 {
1917 /* clear addr flag */
1918 i2c_addr_flag_clear(hi2c);
1919
1920 /* disable ack */
1921 i2c_ack_enable(hi2c->i2cx, FALSE);
1922
1923 /* generate stop condtion */
1924 i2c_stop_generate(hi2c->i2cx);
1925
1926 /* enable dma request */
1927 i2c_dma_enable(hi2c->i2cx, TRUE);
1928 }
1929 else
1930 {
1931 /* enable dma end transfer */
1932 i2c_dma_end_transfer_set(hi2c->i2cx, TRUE);
1933
1934 /* enable dma request */
1935 i2c_dma_enable(hi2c->i2cx, TRUE);
1936
1937 /* clear addr flag */
1938 i2c_addr_flag_clear(hi2c);
1939 }
1940
1941 return I2C_OK;
1942}
1943
1949void i2c_master_tx_isr_int(i2c_handle_type* hi2c)
1950{
1951 /* step 1: transfer data */
1952 if(i2c_flag_get(hi2c->i2cx, I2C_TDBE_FLAG) != RESET)
1953 {
1954 if(hi2c->pcount == 0)
1955 {
1956 /* transfer complete */
1957 hi2c->status = I2C_END;
1958
1959 /* disable interrupt */
1960 i2c_interrupt_enable(hi2c->i2cx, I2C_EVT_INT | I2C_DATA_INT | I2C_ERR_INT, FALSE);
1961
1962 /* generate stop condtion */
1963 i2c_stop_generate(hi2c->i2cx);
1964 }
1965 else
1966 {
1967 /* write data */
1968 i2c_data_send(hi2c->i2cx, *hi2c->pbuff++);
1969 hi2c->pcount--;
1970 }
1971 }
1972}
1973
1979void i2c_master_rx_isr_int(i2c_handle_type* hi2c)
1980{
1981 if(i2c_flag_get(hi2c->i2cx, I2C_TDC_FLAG) != RESET)
1982 {
1983 if(hi2c->pcount == 3)
1984 {
1985 /* disable ack */
1986 i2c_ack_enable(hi2c->i2cx, FALSE);
1987
1988 /* read data */
1989 (*hi2c->pbuff++) = i2c_data_receive(hi2c->i2cx);
1990 hi2c->pcount--;
1991 }
1992 else if(hi2c->pcount == 2)
1993 {
1994 /* generate stop condtion */
1995 i2c_stop_generate(hi2c->i2cx);
1996
1997 /* read data */
1998 (*hi2c->pbuff++) = i2c_data_receive(hi2c->i2cx);
1999 hi2c->pcount--;
2000
2001 /* read data */
2002 (*hi2c->pbuff++) = i2c_data_receive(hi2c->i2cx);
2003 hi2c->pcount--;
2004
2005 /* transfer complete */
2006 hi2c->status = I2C_END;
2007
2008 /* disable interrupt */
2009 i2c_interrupt_enable(hi2c->i2cx, I2C_EVT_INT | I2C_DATA_INT | I2C_ERR_INT, FALSE);
2010 }
2011 else
2012 {
2013 /* read data */
2014 (*hi2c->pbuff++) = i2c_data_receive(hi2c->i2cx);
2015 hi2c->pcount--;
2016 }
2017 }
2018
2019 else if(i2c_flag_get(hi2c->i2cx, I2C_RDBF_FLAG) != RESET)
2020 {
2021 if(hi2c->pcount > 3)
2022 {
2023 /* read data */
2024 (*hi2c->pbuff++) = i2c_data_receive(hi2c->i2cx);
2025 hi2c->pcount--;
2026 }
2027 else if((hi2c->pcount == 3) || (hi2c->pcount == 2))
2028 {
2029 /* disable rdbf interrupt */
2030 i2c_interrupt_enable(hi2c->i2cx, I2C_DATA_INT, FALSE);
2031 }
2032 else
2033 {
2034 /* read data */
2035 (*hi2c->pbuff++) = i2c_data_receive(hi2c->i2cx);
2036 hi2c->pcount--;
2037
2038 /* transfer complete */
2039 hi2c->status = I2C_END;
2040
2041 /* disable interrupt */
2042 i2c_interrupt_enable(hi2c->i2cx, I2C_EVT_INT | I2C_DATA_INT | I2C_ERR_INT, FALSE);
2043 }
2044 }
2045}
2046
2052void i2c_slave_tx_isr_int(i2c_handle_type* hi2c)
2053{
2054 /* transfer data */
2055 if(i2c_flag_get(hi2c->i2cx, I2C_TDBE_FLAG) != RESET)
2056 {
2057 if(hi2c->pcount)
2058 {
2059 /* send data */
2060 i2c_data_send(hi2c->i2cx, (*hi2c->pbuff++));
2061 hi2c->pcount--;
2062
2063 if(hi2c->pcount == 0)
2064 {
2065 /* disable interrupt */
2066 i2c_interrupt_enable(hi2c->i2cx, I2C_DATA_INT | I2C_EVT_INT | I2C_ERR_INT, FALSE);
2067
2068 /* wait for the ackfail falg to be set */
2069 hi2c->status = i2c_wait_flag(hi2c, I2C_ACKFAIL_FLAG, RESET, I2C_EVENT_CHECK_NONE, hi2c->timeout);
2070
2071 /* clear ackfail flag */
2072 i2c_flag_clear(hi2c->i2cx, I2C_ACKFAIL_FLAG);
2073
2074 /* transfer complete */
2075 hi2c->status = I2C_END;
2076 }
2077 }
2078 }
2079}
2080
2086void i2c_slave_rx_isr_int(i2c_handle_type* hi2c)
2087{
2088 /* receive data */
2089 if(i2c_flag_get(hi2c->i2cx, I2C_RDBF_FLAG) != RESET)
2090 {
2091 if(hi2c->pcount)
2092 {
2093 /* read data */
2094 (*hi2c->pbuff++) = i2c_data_receive(hi2c->i2cx);
2095
2096 hi2c->pcount--;
2097 }
2098 }
2099
2100 /* step 2: received stop conditon */
2101 else if(i2c_flag_get(hi2c->i2cx, I2C_STOPF_FLAG) != RESET)
2102 {
2103 /* clear stop flag */
2104 i2c_stop_flag_clear(hi2c);
2105
2106 /* transfer complete */
2107 hi2c->status = I2C_END;
2108
2109 /* disable interrupt */
2110 i2c_interrupt_enable(hi2c->i2cx, I2C_EVT_INT | I2C_DATA_INT | I2C_ERR_INT, FALSE);
2111 }
2112}
2113
2119void i2c_evt_irq_handler(i2c_handle_type* hi2c)
2120{
2121 switch(hi2c->mode)
2122 {
2123 case I2C_INT_MA_TX:
2124 i2c_master_tx_isr_int(hi2c);
2125 break;
2126 case I2C_INT_MA_RX:
2127 i2c_master_rx_isr_int(hi2c);
2128 break;
2129 case I2C_INT_SLA_TX:
2130 i2c_slave_tx_isr_int(hi2c);
2131 break;
2132 case I2C_INT_SLA_RX:
2133 i2c_slave_rx_isr_int(hi2c);
2134 break;
2135 default:
2136 break;
2137 }
2138}
2139
2145void i2c_dma_tx_irq_handler(i2c_handle_type* hi2c)
2146{
2147 /* transfer complete */
2148 if(dma_flag_get(DMA_GET_TC_FLAG(hi2c->dma_tx_channel)) != RESET)
2149 {
2150 /* disable the transfer complete interrupt */
2151 dma_interrupt_enable(hi2c->dma_tx_channel, DMA_FDT_INT, FALSE);
2152
2153 /* clear the transfer complete flag */
2154 dma_flag_clear(DMA_GET_TC_FLAG(hi2c->dma_tx_channel));
2155
2156 switch(hi2c->mode)
2157 {
2158 case I2C_DMA_MA_TX:
2159 /* wait for the tdc falg to be set */
2160 hi2c->status = i2c_wait_flag(hi2c, I2C_TDC_FLAG, RESET, I2C_EVENT_CHECK_NONE, hi2c->timeout);
2161
2162 /* generate stop condtion */
2163 i2c_stop_generate(hi2c->i2cx);
2164 break;
2165 case I2C_DMA_SLA_TX:
2166 /* wait for the ackfail falg to be set */
2167 hi2c->status = i2c_wait_flag(hi2c, I2C_ACKFAIL_FLAG, RESET, I2C_EVENT_CHECK_NONE, hi2c->timeout);
2168
2169 /* clear ackfail flag */
2170 i2c_flag_clear(hi2c->i2cx, I2C_ACKFAIL_FLAG);
2171
2172 /* disable ack */
2173 i2c_ack_enable(hi2c->i2cx, FALSE);
2174 break;
2175 default:
2176 break;
2177 }
2178
2179 hi2c->pcount = 0;
2180
2181 /* disable dma request */
2182 i2c_dma_enable(hi2c->i2cx, FALSE);
2183
2184 /* transfer complete */
2185 hi2c->status = I2C_END;
2186 }
2187}
2188
2194void i2c_dma_rx_irq_handler(i2c_handle_type* hi2c)
2195{
2196 /* transfer complete */
2197 if(dma_flag_get(DMA_GET_TC_FLAG(hi2c->dma_rx_channel)) != RESET)
2198 {
2199 /* disable the transfer complete interrupt */
2200 dma_interrupt_enable(hi2c->dma_rx_channel, DMA_FDT_INT, FALSE);
2201
2202 /* clear the transfer complete flag */
2203 dma_flag_clear(DMA_GET_TC_FLAG(hi2c->dma_rx_channel));
2204
2205 switch(hi2c->mode)
2206 {
2207 case I2C_DMA_MA_RX:
2208 /* clear ackfail flag */
2209 i2c_flag_clear(hi2c->i2cx, I2C_ACKFAIL_FLAG);
2210
2211 if(hi2c->pcount != 1)
2212 {
2213 /* generate stop condtion */
2214 i2c_stop_generate(hi2c->i2cx);
2215 }
2216 break;
2217 case I2C_DMA_SLA_RX:
2218 /* wait for the stop falg to be set */
2219 hi2c->status = i2c_wait_flag(hi2c, I2C_STOPF_FLAG, RESET, I2C_EVENT_CHECK_NONE, hi2c->timeout);
2220
2221 /* clear stop flag */
2222 i2c_stop_flag_clear(hi2c);
2223 break;
2224 default:
2225 break;
2226 }
2227
2228 hi2c->pcount = 0;
2229
2230 /* disable dma request */
2231 i2c_dma_enable(hi2c->i2cx, FALSE);
2232
2233 /* transfer complete */
2234 hi2c->status = I2C_END;
2235 }
2236}
2237
2243void i2c_err_irq_handler(i2c_handle_type* hi2c)
2244{
2245 hi2c->error_code = I2C_ERR_INTERRUPT;
2246
2247 /* buserr */
2248 if(i2c_flag_get(hi2c->i2cx, I2C_BUSERR_FLAG) != RESET)
2249 {
2250 i2c_flag_clear(hi2c->i2cx, I2C_BUSERR_FLAG);
2251 }
2252
2253 /* arlost */
2254 if(i2c_flag_get(hi2c->i2cx, I2C_ARLOST_FLAG) != RESET)
2255 {
2256 i2c_flag_clear(hi2c->i2cx, I2C_ARLOST_FLAG);
2257 }
2258
2259 /* ackfail */
2260 if(i2c_flag_get(hi2c->i2cx, I2C_ACKFAIL_FLAG) != RESET)
2261 {
2262 i2c_flag_clear(hi2c->i2cx, I2C_ACKFAIL_FLAG);
2263 }
2264
2265 /* ouf */
2266 if(i2c_flag_get(hi2c->i2cx, I2C_OUF_FLAG) != RESET)
2267 {
2268 i2c_flag_clear(hi2c->i2cx, I2C_OUF_FLAG);
2269 }
2270
2271 /* pecerr */
2272 if(i2c_flag_get(hi2c->i2cx, I2C_PECERR_FLAG) != RESET)
2273 {
2274 i2c_flag_clear(hi2c->i2cx, I2C_PECERR_FLAG);
2275 }
2276
2277 /* tmout */
2278 if(i2c_flag_get(hi2c->i2cx, I2C_TMOUT_FLAG) != RESET)
2279 {
2280 i2c_flag_clear(hi2c->i2cx, I2C_TMOUT_FLAG);
2281 }
2282
2283 /* alertf */
2284 if(i2c_flag_get(hi2c->i2cx, I2C_ALERTF_FLAG) != RESET)
2285 {
2286 i2c_flag_clear(hi2c->i2cx, I2C_ALERTF_FLAG);
2287 }
2288
2289 /* disable all interrupts */
2290 i2c_interrupt_enable(hi2c->i2cx, I2C_ERR_INT, FALSE);
2291}
2292
i2c_master_rx_isr_int
void i2c_master_rx_isr_int(i2c_handle_type *hi2c)
master receive mode interrupt procession function
Definition: i2c_application.c:1979
i2c_memory_write_dma
i2c_status_type i2c_memory_write_dma(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through dma mode.
Definition: i2c_application.c:1767
i2c_slave_rx_isr_int
void i2c_slave_rx_isr_int(i2c_handle_type *hi2c)
slave receive mode interrupt procession function
Definition: i2c_application.c:2086
i2c_wait_end
i2c_status_type i2c_wait_end(i2c_handle_type *hi2c, uint32_t timeout)
wait for the transfer to end.
Definition: i2c_application.c:148
i2c_evt_irq_handler
void i2c_evt_irq_handler(i2c_handle_type *hi2c)
interrupt procession function.
Definition: i2c_application.c:2119
i2c_master_tx_isr_int
void i2c_master_tx_isr_int(i2c_handle_type *hi2c)
master transfer mode interrupt procession function
Definition: i2c_application.c:1949
i2c_slave_transmit_int
i2c_status_type i2c_slave_transmit_int(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through interrupt mode.
Definition: i2c_application.c:976
i2c_err_irq_handler
void i2c_err_irq_handler(i2c_handle_type *hi2c)
i2c error interrupt function.
Definition: i2c_application.c:2243
i2c_wait_flag
i2c_status_type i2c_wait_flag(i2c_handle_type *hi2c, uint32_t flag, flag_status status, uint32_t event_check, uint32_t timeout)
wait for the flag.
Definition: i2c_application.c:182
i2c_dma_rx_irq_handler
void i2c_dma_rx_irq_handler(i2c_handle_type *hi2c)
dma reveive complete interrupt function.
Definition: i2c_application.c:2194
i2c_master_write_addr
i2c_status_type i2c_master_write_addr(i2c_handle_type *hi2c, uint16_t address, uint32_t timeout)
send address in master transmits mode.
Definition: i2c_application.c:266
I2C_START
#define I2C_START
i2c transmission status
Definition: i2c_application.c:94
i2c_slave_receive
i2c_status_type i2c_slave_receive(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through polling mode.
Definition: i2c_application.c:470
i2c_slave_transmit_dma
i2c_status_type i2c_slave_transmit_dma(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through dma mode.
Definition: i2c_application.c:1225
i2c_master_receive_int
i2c_status_type i2c_master_receive_int(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through interrupt mode.
Definition: i2c_application.c:898
i2c_addr_flag_clear
void i2c_addr_flag_clear(i2c_handle_type *hi2c)
clear the addr flag.
Definition: i2c_application.c:119
i2c_slave_tx_isr_int
void i2c_slave_tx_isr_int(i2c_handle_type *hi2c)
slave transfer mode interrupt procession function
Definition: i2c_application.c:2052
i2c_memory_read_dma
i2c_status_type i2c_memory_read_dma(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode.
Definition: i2c_application.c:1843
i2c_master_read_addr
i2c_status_type i2c_master_read_addr(i2c_handle_type *hi2c, uint16_t address, uint32_t timeout)
send address in master receive mode.
Definition: i2c_application.c:319
I2C_END
#define I2C_END
Definition: i2c_application.c:95
i2c_stop_flag_clear
void i2c_stop_flag_clear(i2c_handle_type *hi2c)
clear the stop flag.
Definition: i2c_application.c:133
i2c_memory_write
i2c_status_type i2c_memory_write(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through polling mode.
Definition: i2c_application.c:1299
i2c_master_transmit_dma
i2c_status_type i2c_master_transmit_dma(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through dma mode.
Definition: i2c_application.c:1039
i2c_memory_read
i2c_status_type i2c_memory_read(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode.
Definition: i2c_application.c:1381
i2c_config
void i2c_config(i2c_handle_type *hi2c)
i2c peripheral initialization.
Definition: i2c_application.c:102
DMA_GET_TC_FLAG
#define DMA_GET_TC_FLAG(DMA_CHANNEL)
get the dma transfer complete flag through the channel
Definition: i2c_application.c:37
i2c_dma_config
void i2c_dma_config(i2c_handle_type *hi2c, dma_channel_type *dma_channelx, uint8_t *pdata, uint16_t size)
dma transfer cofiguration.
Definition: i2c_application.c:237
i2c_dma_tx_irq_handler
void i2c_dma_tx_irq_handler(i2c_handle_type *hi2c)
dma transmission complete interrupt function.
Definition: i2c_application.c:2145
i2c_slave_receive_dma
i2c_status_type i2c_slave_receive_dma(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through dma mode.
Definition: i2c_application.c:1092
i2c_memory_read_int
i2c_status_type i2c_memory_read_int(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through interrupt mode.
Definition: i2c_application.c:1657
i2c_master_transmit_int
i2c_status_type i2c_master_transmit_int(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through interrupt mode.
Definition: i2c_application.c:803
i2c_master_receive
i2c_status_type i2c_master_receive(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through polling mode.
Definition: i2c_application.c:545
i2c_master_receive_dma
i2c_status_type i2c_master_receive_dma(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through dma mode.
Definition: i2c_application.c:1149
i2c_slave_receive_int
i2c_status_type i2c_slave_receive_int(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through interrupt mode.
Definition: i2c_application.c:850
i2c_master_transmit
i2c_status_type i2c_master_transmit(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through polling mode.
Definition: i2c_application.c:402
i2c_slave_transmit
i2c_status_type i2c_slave_transmit(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through polling mode.
Definition: i2c_application.c:716
i2c_memory_write_int
i2c_status_type i2c_memory_write_int(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through interrupt mode.
Definition: i2c_application.c:1587
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_interrupt_enable
void dma_interrupt_enable(dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt
Definition: at32f415_dma.c:165
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_FDT_INT
#define DMA_FDT_INT
Definition: at32f415_dma.h:52
flag_status
flag_status
flag status
Definition: at32f415.h:248
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
i2c_data_receive
uint8_t i2c_data_receive(i2c_type *i2c_x)
receive a byte through the i2c periph.
Definition: at32f415_i2c.c:535
i2c_reset
void i2c_reset(i2c_type *i2c_x)
reset the i2c register
Definition: at32f415_i2c.c:51
i2c_ack_enable
void i2c_ack_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable acknowledge.
Definition: at32f415_i2c.c:283
i2c_7bit_address_send
void i2c_7bit_address_send(i2c_type *i2c_x, uint8_t address, i2c_direction_type direction)
transmit the slave address.
Definition: at32f415_i2c.c:503
i2c_dma_end_transfer_set
void i2c_dma_end_transfer_set(i2c_type *i2c_x, confirm_state new_state)
enable or disable if the next dma transfer will be the last one.
Definition: at32f415_i2c.c:424
i2c_stop_generate
void i2c_stop_generate(i2c_type *i2c_x)
generate stop condition.
Definition: at32f415_i2c.c:486
i2c_enable
void i2c_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable i2c periph
Definition: at32f415_i2c.c:241
i2c_flag_get
flag_status i2c_flag_get(i2c_type *i2c_x, uint32_t flag)
get flag status
Definition: at32f415_i2c.c:570
i2c_interrupt_enable
void i2c_interrupt_enable(i2c_type *i2c_x, uint16_t source, confirm_state new_state)
enable or disable interrupt
Definition: at32f415_i2c.c:455
i2c_flag_clear
void i2c_flag_clear(i2c_type *i2c_x, uint32_t flag)
clear flag status
Definition: at32f415_i2c.c:615
i2c_dma_enable
void i2c_dma_enable(i2c_type *i2c_x, confirm_state new_state)
enable or disable dma requests.
Definition: at32f415_i2c.c:437
i2c_data_send
void i2c_data_send(i2c_type *i2c_x, uint8_t data)
send a byte through the i2c periph.
Definition: at32f415_i2c.c:523
i2c_master_receive_ack_set
void i2c_master_receive_ack_set(i2c_type *i2c_x, i2c_master_ack_type pos)
master receiving mode acknowledge control.
Definition: at32f415_i2c.c:299
i2c_start_generate
void i2c_start_generate(i2c_type *i2c_x)
generate start condition.
Definition: at32f415_i2c.c:474
I2C_DIRECTION_RECEIVE
@ I2C_DIRECTION_RECEIVE
Definition: at32f415_i2c.h:167
I2C_DIRECTION_TRANSMIT
@ I2C_DIRECTION_TRANSMIT
Definition: at32f415_i2c.h:166
I2C_MASTER_ACK_CURRENT
@ I2C_MASTER_ACK_CURRENT
Definition: at32f415_i2c.h:110
I2C_MASTER_ACK_NEXT
@ I2C_MASTER_ACK_NEXT
Definition: at32f415_i2c.h:111
I2C_ADDRESS_MODE_7BIT
@ I2C_ADDRESS_MODE_7BIT
Definition: at32f415_i2c.h:157
I2C_ADDRESS_MODE_10BIT
@ I2C_ADDRESS_MODE_10BIT
Definition: at32f415_i2c.h:158
I2C_EVT_INT
#define I2C_EVT_INT
Definition: at32f415_i2c.h:94
I2C_ERR_INT
#define I2C_ERR_INT
Definition: at32f415_i2c.h:95
I2C_DATA_INT
#define I2C_DATA_INT
Definition: at32f415_i2c.h:93
I2C_EVENT_CHECK_STOP
#define I2C_EVENT_CHECK_STOP
Definition: i2c_application.h:49
I2C_EVENT_CHECK_NONE
#define I2C_EVENT_CHECK_NONE
Definition: i2c_application.h:47
I2C_EVENT_CHECK_ACKFAIL
#define I2C_EVENT_CHECK_ACKFAIL
Definition: i2c_application.h:48
i2c_lowlevel_init
void i2c_lowlevel_init(i2c_handle_type *hi2c)
initializes peripherals used by the i2c.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:117
i2c_status_type
i2c_status_type
Definition: i2c_application.h:81
I2C_ERR_STEP_1
@ I2C_ERR_STEP_1
Definition: i2c_application.h:83
I2C_ERR_TIMEOUT
@ I2C_ERR_TIMEOUT
Definition: i2c_application.h:100
I2C_ERR_ADDR10
@ I2C_ERR_ADDR10
Definition: i2c_application.h:96
I2C_ERR_START
@ I2C_ERR_START
Definition: i2c_application.h:95
I2C_ERR_INTERRUPT
@ I2C_ERR_INTERRUPT
Definition: i2c_application.h:101
I2C_ERR_STEP_3
@ I2C_ERR_STEP_3
Definition: i2c_application.h:85
I2C_ERR_STEP_6
@ I2C_ERR_STEP_6
Definition: i2c_application.h:88
I2C_ERR_STEP_5
@ I2C_ERR_STEP_5
Definition: i2c_application.h:87
I2C_ERR_STEP_9
@ I2C_ERR_STEP_9
Definition: i2c_application.h:91
I2C_ERR_STEP_7
@ I2C_ERR_STEP_7
Definition: i2c_application.h:89
I2C_ERR_STOP
@ I2C_ERR_STOP
Definition: i2c_application.h:98
I2C_ERR_STEP_8
@ I2C_ERR_STEP_8
Definition: i2c_application.h:90
I2C_ERR_ACKFAIL
@ I2C_ERR_ACKFAIL
Definition: i2c_application.h:99
I2C_ERR_ADDR
@ I2C_ERR_ADDR
Definition: i2c_application.h:97
I2C_ERR_STEP_2
@ I2C_ERR_STEP_2
Definition: i2c_application.h:84
I2C_OK
@ I2C_OK
Definition: i2c_application.h:82
I2C_ERR_STEP_10
@ I2C_ERR_STEP_10
Definition: i2c_application.h:92
I2C_ERR_STEP_4
@ I2C_ERR_STEP_4
Definition: i2c_application.h:86
I2C_DMA_MA_RX
@ I2C_DMA_MA_RX
Definition: i2c_application.h:66
I2C_DMA_SLA_RX
@ I2C_DMA_SLA_RX
Definition: i2c_application.h:68
I2C_INT_SLA_RX
@ I2C_INT_SLA_RX
Definition: i2c_application.h:64
I2C_DMA_MA_TX
@ I2C_DMA_MA_TX
Definition: i2c_application.h:65
I2C_INT_MA_RX
@ I2C_INT_MA_RX
Definition: i2c_application.h:62
I2C_INT_SLA_TX
@ I2C_INT_SLA_TX
Definition: i2c_application.h:63
I2C_INT_MA_TX
@ I2C_INT_MA_TX
Definition: i2c_application.h:61
I2C_DMA_SLA_TX
@ I2C_DMA_SLA_TX
Definition: i2c_application.h:67
I2C_STARTF_FLAG
#define I2C_STARTF_FLAG
Definition: at32f415_i2c.h:52
I2C_TMOUT_FLAG
#define I2C_TMOUT_FLAG
Definition: at32f415_i2c.h:64
I2C_ADDR7F_FLAG
#define I2C_ADDR7F_FLAG
Definition: at32f415_i2c.h:53
I2C_ALERTF_FLAG
#define I2C_ALERTF_FLAG
Definition: at32f415_i2c.h:65
I2C_BUSERR_FLAG
#define I2C_BUSERR_FLAG
Definition: at32f415_i2c.h:59
I2C_ACKFAIL_FLAG
#define I2C_ACKFAIL_FLAG
Definition: at32f415_i2c.h:61
I2C_OUF_FLAG
#define I2C_OUF_FLAG
Definition: at32f415_i2c.h:62
I2C_ARLOST_FLAG
#define I2C_ARLOST_FLAG
Definition: at32f415_i2c.h:60
I2C_STOPF_FLAG
#define I2C_STOPF_FLAG
Definition: at32f415_i2c.h:56
I2C_TDC_FLAG
#define I2C_TDC_FLAG
Definition: at32f415_i2c.h:54
I2C_ADDRHF_FLAG
#define I2C_ADDRHF_FLAG
Definition: at32f415_i2c.h:55
I2C_TDBE_FLAG
#define I2C_TDBE_FLAG
Definition: at32f415_i2c.h:58
I2C_RDBF_FLAG
#define I2C_RDBF_FLAG
Definition: at32f415_i2c.h:57
I2C_PECERR_FLAG
#define I2C_PECERR_FLAG
Definition: at32f415_i2c.h:63
I2C_BUSYF_FLAG
#define I2C_BUSYF_FLAG
Definition: at32f415_i2c.h:77
I2C1
#define I2C1
Definition: at32f415_i2c.h:347
i2c_application.h
i2c application libray header file
dma_channel_type
type define dma channel register all
Definition: at32f415_dma.h:405
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
i2c_handle_type
Definition: i2c_application.h:114
i2c_handle_type::dma_rx_channel
dma_channel_type * dma_rx_channel
Definition: i2c_application.h:124
i2c_handle_type::i2cx
i2c_type * i2cx
Definition: i2c_application.h:115
i2c_handle_type::status
__IO uint32_t status
Definition: i2c_application.h:121
i2c_handle_type::pbuff
uint8_t * pbuff
Definition: i2c_application.h:116
i2c_handle_type::mode
__IO uint32_t mode
Definition: i2c_application.h:119
i2c_handle_type::timeout
__IO uint32_t timeout
Definition: i2c_application.h:120
i2c_handle_type::dma_init_struct
dma_init_type dma_init_struct
Definition: i2c_application.h:125
i2c_handle_type::error_code
__IO i2c_status_type error_code
Definition: i2c_application.h:122
i2c_handle_type::dma_tx_channel
dma_channel_type * dma_tx_channel
Definition: i2c_application.h:123
i2c_handle_type::pcount
__IO uint16_t pcount
Definition: i2c_application.h:118
i2c_type::ctrl1_bit
struct i2c_type::@478::@496 ctrl1_bit
i2c_type::oaddr1_bit
struct i2c_type::@482::@498 oaddr1_bit
i2c_type::sts1
__IO uint32_t sts1
Definition: at32f415_i2c.h:268
i2c_type::addr1mode
__IO uint32_t addr1mode
Definition: at32f415_i2c.h:231
i2c_type::dt
__IO uint32_t dt
Definition: at32f415_i2c.h:255
i2c_type::i2cen
__IO uint32_t i2cen
Definition: at32f415_i2c.h:183
i2c_type::sts2
__IO uint32_t sts2
Definition: at32f415_i2c.h:296


AT32F415 Firmwary Library: i2c_application.h Source File

  • middlewares
  • i2c_application_library
i2c_application.h
Go to the documentation of this file.
1
28#ifndef __I2C_APPLICATION_H
29#define __I2C_APPLICATION_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
47#define I2C_EVENT_CHECK_NONE ((uint32_t)0x00000000)
48#define I2C_EVENT_CHECK_ACKFAIL ((uint32_t)0x00000001)
49#define I2C_EVENT_CHECK_STOP ((uint32_t)0x00000002)
59typedef enum
60{
61 I2C_INT_MA_TX = 0,
62 I2C_INT_MA_RX,
63 I2C_INT_SLA_TX,
64 I2C_INT_SLA_RX,
65 I2C_DMA_MA_TX,
66 I2C_DMA_MA_RX,
67 I2C_DMA_SLA_TX,
68 I2C_DMA_SLA_RX,
69} i2c_mode_type;
70
71
80typedef enum
81{
82 I2C_OK = 0,
83 I2C_ERR_STEP_1,
84 I2C_ERR_STEP_2,
85 I2C_ERR_STEP_3,
86 I2C_ERR_STEP_4,
87 I2C_ERR_STEP_5,
88 I2C_ERR_STEP_6,
89 I2C_ERR_STEP_7,
90 I2C_ERR_STEP_8,
91 I2C_ERR_STEP_9,
92 I2C_ERR_STEP_10,
93 I2C_ERR_STEP_11,
94 I2C_ERR_STEP_12,
95 I2C_ERR_START,
96 I2C_ERR_ADDR10,
97 I2C_ERR_ADDR,
98 I2C_ERR_STOP,
99 I2C_ERR_ACKFAIL,
100 I2C_ERR_TIMEOUT,
101 I2C_ERR_INTERRUPT,
103} i2c_status_type;
104
113typedef struct
114{
115 i2c_type *i2cx;
116 uint8_t *pbuff;
117 __IO uint16_t psize;
118 __IO uint16_t pcount;
119 __IO uint32_t mode;
120 __IO uint32_t timeout;
121 __IO uint32_t status;
122 __IO i2c_status_type error_code;
123 dma_channel_type *dma_tx_channel;
124 dma_channel_type *dma_rx_channel;
125 dma_init_type dma_init_struct;
126} i2c_handle_type;
127
136void i2c_config (i2c_handle_type* hi2c);
137void i2c_lowlevel_init (i2c_handle_type* hi2c);
138 i2c_status_type i2c_wait_end (i2c_handle_type* hi2c, uint32_t timeout);
139
140 i2c_status_type i2c_master_transmit (i2c_handle_type* hi2c, uint16_t address, uint8_t* pdata, uint16_t size, uint32_t timeout);
141 i2c_status_type i2c_master_receive (i2c_handle_type* hi2c, uint16_t address, uint8_t* pdata, uint16_t size, uint32_t timeout);
142 i2c_status_type i2c_slave_transmit (i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout);
143 i2c_status_type i2c_slave_receive (i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout);
144
145 i2c_status_type i2c_master_transmit_int (i2c_handle_type* hi2c, uint16_t address, uint8_t* pdata, uint16_t size, uint32_t timeout);
146 i2c_status_type i2c_master_receive_int (i2c_handle_type* hi2c, uint16_t address, uint8_t* pdata, uint16_t size, uint32_t timeout);
147 i2c_status_type i2c_slave_transmit_int (i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout);
148 i2c_status_type i2c_slave_receive_int (i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout);
149
150 i2c_status_type i2c_master_transmit_dma (i2c_handle_type* hi2c, uint16_t address, uint8_t* pdata, uint16_t size, uint32_t timeout);
151 i2c_status_type i2c_master_receive_dma (i2c_handle_type* hi2c, uint16_t address, uint8_t* pdata, uint16_t size, uint32_t timeout);
152 i2c_status_type i2c_slave_transmit_dma (i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout);
153 i2c_status_type i2c_slave_receive_dma (i2c_handle_type* hi2c, uint8_t* pdata, uint16_t size, uint32_t timeout);
154
155 i2c_status_type i2c_memory_write (i2c_handle_type* hi2c, uint16_t address, uint16_t memaddress, uint8_t* pdata, uint16_t size, uint32_t timeout);
156 i2c_status_type i2c_memory_write_int (i2c_handle_type* hi2c, uint16_t address, uint16_t memaddress, uint8_t* pdata, uint16_t size, uint32_t timeout);
157 i2c_status_type i2c_memory_write_dma (i2c_handle_type* hi2c, uint16_t address, uint16_t memaddress, uint8_t* pdata, uint16_t size, uint32_t timeout);
158 i2c_status_type i2c_memory_read (i2c_handle_type* hi2c, uint16_t address, uint16_t memaddress, uint8_t* pdata, uint16_t size, uint32_t timeout);
159 i2c_status_type i2c_memory_read_int (i2c_handle_type* hi2c, uint16_t address, uint16_t memaddress, uint8_t* pdata, uint16_t size, uint32_t timeout);
160 i2c_status_type i2c_memory_read_dma (i2c_handle_type* hi2c, uint16_t address, uint16_t memaddress, uint8_t* pdata, uint16_t size, uint32_t timeout);
161
162void i2c_evt_irq_handler (i2c_handle_type* hi2c);
163void i2c_err_irq_handler (i2c_handle_type* hi2c);
164void i2c_dma_tx_irq_handler (i2c_handle_type* hi2c);
165void i2c_dma_rx_irq_handler (i2c_handle_type* hi2c);
166
175#ifdef __cplusplus
176}
177#endif
178
179#endif
at32f415.h
at32f415 header file
i2c_memory_write_dma
i2c_status_type i2c_memory_write_dma(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through dma mode.
Definition: i2c_application.c:1767
i2c_wait_end
i2c_status_type i2c_wait_end(i2c_handle_type *hi2c, uint32_t timeout)
wait for the transfer to end.
Definition: i2c_application.c:148
i2c_evt_irq_handler
void i2c_evt_irq_handler(i2c_handle_type *hi2c)
interrupt procession function.
Definition: i2c_application.c:2119
i2c_slave_transmit_int
i2c_status_type i2c_slave_transmit_int(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through interrupt mode.
Definition: i2c_application.c:976
i2c_err_irq_handler
void i2c_err_irq_handler(i2c_handle_type *hi2c)
i2c error interrupt function.
Definition: i2c_application.c:2243
i2c_dma_rx_irq_handler
void i2c_dma_rx_irq_handler(i2c_handle_type *hi2c)
dma reveive complete interrupt function.
Definition: i2c_application.c:2194
i2c_slave_receive
i2c_status_type i2c_slave_receive(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through polling mode.
Definition: i2c_application.c:470
i2c_slave_transmit_dma
i2c_status_type i2c_slave_transmit_dma(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through dma mode.
Definition: i2c_application.c:1225
i2c_master_receive_int
i2c_status_type i2c_master_receive_int(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through interrupt mode.
Definition: i2c_application.c:898
i2c_memory_read_dma
i2c_status_type i2c_memory_read_dma(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode.
Definition: i2c_application.c:1843
i2c_memory_write
i2c_status_type i2c_memory_write(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through polling mode.
Definition: i2c_application.c:1299
i2c_master_transmit_dma
i2c_status_type i2c_master_transmit_dma(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through dma mode.
Definition: i2c_application.c:1039
i2c_memory_read
i2c_status_type i2c_memory_read(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode.
Definition: i2c_application.c:1381
i2c_config
void i2c_config(i2c_handle_type *hi2c)
i2c peripheral initialization.
Definition: i2c_application.c:102
i2c_dma_tx_irq_handler
void i2c_dma_tx_irq_handler(i2c_handle_type *hi2c)
dma transmission complete interrupt function.
Definition: i2c_application.c:2145
i2c_lowlevel_init
void i2c_lowlevel_init(i2c_handle_type *hi2c)
initializes peripherals used by the i2c.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:117
i2c_slave_receive_dma
i2c_status_type i2c_slave_receive_dma(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through dma mode.
Definition: i2c_application.c:1092
i2c_memory_read_int
i2c_status_type i2c_memory_read_int(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through interrupt mode.
Definition: i2c_application.c:1657
i2c_master_transmit_int
i2c_status_type i2c_master_transmit_int(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through interrupt mode.
Definition: i2c_application.c:803
i2c_master_receive
i2c_status_type i2c_master_receive(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through polling mode.
Definition: i2c_application.c:545
i2c_master_receive_dma
i2c_status_type i2c_master_receive_dma(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through dma mode.
Definition: i2c_application.c:1149
i2c_slave_receive_int
i2c_status_type i2c_slave_receive_int(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through interrupt mode.
Definition: i2c_application.c:850
i2c_master_transmit
i2c_status_type i2c_master_transmit(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through polling mode.
Definition: i2c_application.c:402
i2c_slave_transmit
i2c_status_type i2c_slave_transmit(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through polling mode.
Definition: i2c_application.c:716
i2c_memory_write_int
i2c_status_type i2c_memory_write_int(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through interrupt mode.
Definition: i2c_application.c:1587
i2c_status_type
i2c_status_type
Definition: i2c_application.h:81
I2C_ERR_STEP_1
@ I2C_ERR_STEP_1
Definition: i2c_application.h:83
I2C_ERR_TIMEOUT
@ I2C_ERR_TIMEOUT
Definition: i2c_application.h:100
I2C_ERR_ADDR10
@ I2C_ERR_ADDR10
Definition: i2c_application.h:96
I2C_ERR_START
@ I2C_ERR_START
Definition: i2c_application.h:95
I2C_ERR_STEP_11
@ I2C_ERR_STEP_11
Definition: i2c_application.h:93
I2C_ERR_INTERRUPT
@ I2C_ERR_INTERRUPT
Definition: i2c_application.h:101
I2C_ERR_STEP_3
@ I2C_ERR_STEP_3
Definition: i2c_application.h:85
I2C_ERR_STEP_6
@ I2C_ERR_STEP_6
Definition: i2c_application.h:88
I2C_ERR_STEP_5
@ I2C_ERR_STEP_5
Definition: i2c_application.h:87
I2C_ERR_STEP_9
@ I2C_ERR_STEP_9
Definition: i2c_application.h:91
I2C_ERR_STEP_7
@ I2C_ERR_STEP_7
Definition: i2c_application.h:89
I2C_ERR_STOP
@ I2C_ERR_STOP
Definition: i2c_application.h:98
I2C_ERR_STEP_8
@ I2C_ERR_STEP_8
Definition: i2c_application.h:90
I2C_ERR_ACKFAIL
@ I2C_ERR_ACKFAIL
Definition: i2c_application.h:99
I2C_ERR_ADDR
@ I2C_ERR_ADDR
Definition: i2c_application.h:97
I2C_ERR_STEP_12
@ I2C_ERR_STEP_12
Definition: i2c_application.h:94
I2C_ERR_STEP_2
@ I2C_ERR_STEP_2
Definition: i2c_application.h:84
I2C_OK
@ I2C_OK
Definition: i2c_application.h:82
I2C_ERR_STEP_10
@ I2C_ERR_STEP_10
Definition: i2c_application.h:92
I2C_ERR_STEP_4
@ I2C_ERR_STEP_4
Definition: i2c_application.h:86
i2c_mode_type
i2c_mode_type
Definition: i2c_application.h:60
I2C_DMA_MA_RX
@ I2C_DMA_MA_RX
Definition: i2c_application.h:66
I2C_DMA_SLA_RX
@ I2C_DMA_SLA_RX
Definition: i2c_application.h:68
I2C_INT_SLA_RX
@ I2C_INT_SLA_RX
Definition: i2c_application.h:64
I2C_DMA_MA_TX
@ I2C_DMA_MA_TX
Definition: i2c_application.h:65
I2C_INT_MA_RX
@ I2C_INT_MA_RX
Definition: i2c_application.h:62
I2C_INT_SLA_TX
@ I2C_INT_SLA_TX
Definition: i2c_application.h:63
I2C_INT_MA_TX
@ I2C_INT_MA_TX
Definition: i2c_application.h:61
I2C_DMA_SLA_TX
@ I2C_DMA_SLA_TX
Definition: i2c_application.h:67
dma_channel_type
type define dma channel register all
Definition: at32f415_dma.h:405
dma_init_type
dma init type
Definition: at32f415_dma.h:268
i2c_handle_type
Definition: i2c_application.h:114
i2c_handle_type::dma_rx_channel
dma_channel_type * dma_rx_channel
Definition: i2c_application.h:124
i2c_handle_type::i2cx
i2c_type * i2cx
Definition: i2c_application.h:115
i2c_handle_type::status
__IO uint32_t status
Definition: i2c_application.h:121
i2c_handle_type::psize
__IO uint16_t psize
Definition: i2c_application.h:117
i2c_handle_type::pbuff
uint8_t * pbuff
Definition: i2c_application.h:116
i2c_handle_type::mode
__IO uint32_t mode
Definition: i2c_application.h:119
i2c_handle_type::timeout
__IO uint32_t timeout
Definition: i2c_application.h:120
i2c_handle_type::dma_init_struct
dma_init_type dma_init_struct
Definition: i2c_application.h:125
i2c_handle_type::error_code
__IO i2c_status_type error_code
Definition: i2c_application.h:122
i2c_handle_type::dma_tx_channel
dma_channel_type * dma_tx_channel
Definition: i2c_application.h:123
i2c_handle_type::pcount
__IO uint16_t pcount
Definition: i2c_application.h:118
i2c_type
type define i2c register all
Definition: at32f415_i2c.h:174


AT32F415 Firmwary Library: keyboard_class.c Source File

  • middlewares
  • usbd_class
  • keyboard
keyboard_class.c
Go to the documentation of this file.
1
26#include "usbd_core.h"
27#include "keyboard_class.h"
28#include "keyboard_desc.h"
29
43 usb_sts_type class_init_handler(void *udev);
44 usb_sts_type class_clear_handler(void *udev);
45 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup);
46 usb_sts_type class_ept0_tx_handler(void *udev);
47 usb_sts_type class_ept0_rx_handler(void *udev);
48 usb_sts_type class_in_handler(void *udev, uint8_t ept_num);
49 usb_sts_type class_out_handler(void *udev, uint8_t ept_num);
50 usb_sts_type class_sof_handler(void *udev);
51 usb_sts_type class_event_handler(void *udev, usbd_event_type event);
52
53/* hid static variable */
54static uint32_t hid_protocol = 0;
55static uint32_t hid_set_idle = 0;
56static uint32_t alt_setting = 0;
57static uint8_t hid_state;
58uint8_t hid_set_report[64];
59__IO uint8_t hid_suspend_flag = 0;
60__IO uint8_t g_u8tx_completed = 0;
61
62#define SHIFT 0x80
63const unsigned char _asciimap[128] =
64{
65 0x00,// NUL
66 0x00,// SOH
67 0x00,// STX
68 0x00,// ETX
69 0x00,// EOT
70 0x00,// ENQ
71 0x00,// ACK
72 0x00,// BEL
73 0x2A,// BS Backspace
74 0x2B,// TAB Tab
75 0x28,// LF Enter
76 0x00,// VT
77 0x00,// FF
78 0x00,// CR
79 0x00,// SO
80 0x00,// SI
81 0x00,// DEL
82 0x00,// DC1
83 0x00,// DC2
84 0x00,// DC3
85 0x00,// DC4
86 0x00,// NAK
87 0x00,// SYN
88 0x00,// ETB
89 0x00,// CAN
90 0x00,// EM
91 0x00,// SUB
92 0x00,// ESC
93 0x00,// FS
94 0x00,// GS
95 0x00,// RS
96 0x00,// US
97
98 0x2C,// ' '
99 0x1E|SHIFT,// !
100 0x34|SHIFT,// "
101 0x20|SHIFT,// #
102 0x21|SHIFT,// $
103 0x22|SHIFT,// %
104 0x24|SHIFT,// &
105 0x34, // '
106 0x26|SHIFT,// (
107 0x27|SHIFT,// )
108 0x25|SHIFT,// *
109 0x2E|SHIFT,// +
110 0x36,// ,
111 0x2D,// -
112 0x37,// .
113 0x38,// /
114 0x27,// 0
115 0x1E,// 1
116 0x1F,// 2
117 0x20,// 3
118 0x21,// 4
119 0x22,// 5
120 0x23,// 6
121 0x24,// 7
122 0x25,// 8
123 0x26,// 9
124 0x33|SHIFT,// :
125 0x33, // ;
126 0x36|SHIFT,// <
127 0x2E, // =
128 0x37|SHIFT,// >
129 0x38|SHIFT,// ?
130 0x1F|SHIFT,// @
131 0x04|SHIFT,// A
132 0x05|SHIFT,// B
133 0x06|SHIFT,// C
134 0x07|SHIFT,// D
135 0x08|SHIFT,// E
136 0x09|SHIFT,// F
137 0x0A|SHIFT,// G
138 0x0B|SHIFT,// H
139 0x0C|SHIFT,// I
140 0x0D|SHIFT,// J
141 0x0E|SHIFT,// K
142 0x0F|SHIFT,// L
143 0x10|SHIFT,// M
144 0x11|SHIFT,// N
145 0x12|SHIFT,// O
146 0x13|SHIFT,// P
147 0x14|SHIFT,// Q
148 0x15|SHIFT,// R
149 0x16|SHIFT,// S
150 0x17|SHIFT,// T
151 0x18|SHIFT,// U
152 0x19|SHIFT,// V
153 0x1A|SHIFT,// W
154 0x1B|SHIFT,// X
155 0x1C|SHIFT,// Y
156 0x1D|SHIFT,// Z
157 0x2F, // [
158 0x31, // bslash
159 0x30, // ]
160 0x23|SHIFT,// ^
161 0x2D|SHIFT,// _
162 0x35, // `
163 0x04, // a
164 0x05, // b
165 0x06, // c
166 0x07, // d
167 0x08, // e
168 0x09, // f
169 0x0A, // g
170 0x0B, // h
171 0x0C, // i
172 0x0D, // j
173 0x0E, // k
174 0x0F, // l
175 0x10, // m
176 0x11, // n
177 0x12, // o
178 0x13, // p
179 0x14, // q
180 0x15, // r
181 0x16, // s
182 0x17, // t
183 0x18, // u
184 0x19, // v
185 0x1A, // w
186 0x1B, // x
187 0x1C, // y
188 0x1D, // z
189 0x2f|SHIFT,//
190 0x31|SHIFT,// |
191 0x30|SHIFT,// }
192 0x35|SHIFT,// ~
193 0 // DEL
194};
195
196/* usb device class handler */
197usbd_class_handler keyboard_class_handler =
198{
199 class_init_handler,
200 class_clear_handler,
201 class_setup_handler,
202 class_ept0_tx_handler,
203 class_ept0_rx_handler,
204 class_in_handler,
205 class_out_handler,
206 class_sof_handler,
207 class_event_handler,
208};
209
215 usb_sts_type class_init_handler(void *udev)
216{
217 usb_sts_type status = USB_OK;
218 usbd_core_type *pudev = (usbd_core_type *)udev;
219
220 /* open hid in endpoint */
221 usbd_ept_open(pudev, USBD_HID_IN_EPT, EPT_INT_TYPE, USBD_IN_MAXPACKET_SIZE);
222
223 g_u8tx_completed = 1;
224
225 return status;
226}
227
233 usb_sts_type class_clear_handler(void *udev)
234{
235 usb_sts_type status = USB_OK;
236 usbd_core_type *pudev = (usbd_core_type *)udev;
237
238 /* close hid in endpoint */
239 usbd_ept_close(pudev, USBD_HID_IN_EPT);
240
241 return status;
242}
243
250 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
251{
252 usb_sts_type status = USB_OK;
253 usbd_core_type *pudev = (usbd_core_type *)udev;
254 uint16_t len;
255 uint8_t *buf;
256
257 switch(setup->bmRequestType & USB_REQ_TYPE_RESERVED)
258 {
259 /* class request */
260 case USB_REQ_TYPE_CLASS:
261 switch(setup->bRequest)
262 {
263 case HID_REQ_SET_PROTOCOL:
264 hid_protocol = (uint8_t)setup->wValue;
265 break;
266 case HID_REQ_GET_PROTOCOL:
267 usbd_ctrl_send(pudev, (uint8_t *)&hid_protocol, 1);
268 break;
269 case HID_REQ_SET_IDLE:
270 hid_set_idle = (uint8_t)(setup->wValue >> 8);
271 break;
272 case HID_REQ_GET_IDLE:
273 usbd_ctrl_send(pudev, (uint8_t *)&hid_set_idle, 1);
274 break;
275 case HID_REQ_SET_REPORT:
276 hid_state = HID_REQ_SET_REPORT;
277 usbd_ctrl_recv(pudev, hid_set_report, setup->wLength);
278 break;
279 default:
280 usbd_ctrl_unsupport(pudev);
281 break;
282 }
283 break;
284 /* standard request */
285 case USB_REQ_TYPE_STANDARD:
286 switch(setup->bRequest)
287 {
288 case USB_STD_REQ_GET_DESCRIPTOR:
289 if(setup->wValue >> 8 == HID_REPORT_DESC)
290 {
291 len = MIN(USBD_HID_SIZ_REPORT_DESC, setup->wLength);
292 buf = (uint8_t *)g_usbd_hid_report;
293 }
294 else if(setup->wValue >> 8 == HID_DESCRIPTOR_TYPE)
295 {
296 len = MIN(9, setup->wLength);
297 buf = (uint8_t *)g_hid_usb_desc;
298 }
299 usbd_ctrl_send(pudev, (uint8_t *)buf, len);
300 break;
301 case USB_STD_REQ_GET_INTERFACE:
302 usbd_ctrl_send(pudev, (uint8_t *)&alt_setting, 1);
303 break;
304 case USB_STD_REQ_SET_INTERFACE:
305 alt_setting = setup->wValue;
306 break;
307 default:
308 break;
309 }
310 break;
311 default:
312 usbd_ctrl_unsupport(pudev);
313 break;
314 }
315 return status;
316}
317
323 usb_sts_type class_ept0_tx_handler(void *udev)
324{
325 usb_sts_type status = USB_OK;
326
327 /* ...user code... */
328
329 return status;
330}
331
337 usb_sts_type class_ept0_rx_handler(void *udev)
338{
339 usb_sts_type status = USB_OK;
340 usbd_core_type *pudev = (usbd_core_type *)udev;
341 uint32_t recv_len = usbd_get_recv_len(pudev, 0);
342 /* ...user code... */
343 if( hid_state == HID_REQ_SET_REPORT)
344 {
345 /* hid buffer process */
346 hid_state = 0;
347 }
348
349 return status;
350}
351
358 usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
359{
360 usb_sts_type status = USB_OK;
361
362 /* ...user code...
363 trans next packet data
364 */
365 g_u8tx_completed = 1;
366
367 return status;
368}
369
376 usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
377{
378 usb_sts_type status = USB_OK;
379
380 return status;
381}
382
388 usb_sts_type class_sof_handler(void *udev)
389{
390 usb_sts_type status = USB_OK;
391
392 /* ...user code... */
393
394 return status;
395}
396
403 usb_sts_type class_event_handler(void *udev, usbd_event_type event)
404{
405 usb_sts_type status = USB_OK;
406 switch(event)
407 {
408 case USBD_RESET_EVENT:
409
410 /* ...user code... */
411
412 break;
413 case USBD_SUSPEND_EVENT:
414 hid_suspend_flag = 1;
415 /* ...user code... */
416
417 break;
418 case USBD_WAKEUP_EVENT:
419 /* ...user code... */
420
421 break;
422 default:
423 break;
424 }
425 return status;
426}
427
435 usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
436{
437 usb_sts_type status = USB_OK;
438 usbd_core_type *pudev = (usbd_core_type *)udev;
439
440 if(usbd_connect_state_get(pudev) == USB_CONN_STATE_CONFIGURED)
441 usbd_ept_send(pudev, USBD_HID_IN_EPT, report, len);
442
443 return status;
444}
445
446
453void usb_hid_keyboard_send_char(void *udev, uint8_t ascii_code)
454{
455 uint8_t key_data = 0;
456 static uint8_t temp = 0;
457 static uint8_t keyboard_buf[8] = {0, 0, 6, 0, 0, 0, 0, 0};
458
459 if(ascii_code > 128)
460 {
461 ascii_code = 0;
462 }
463 else
464 {
465 ascii_code = _asciimap[ascii_code];
466 if(!ascii_code)
467 {
468 ascii_code = 0;
469 }
470
471 if(ascii_code & SHIFT)
472 {
473 key_data = 0x2;
474 ascii_code &= 0x7F;
475 }
476 }
477
478 if((temp == ascii_code) && (ascii_code != 0))
479 {
480 keyboard_buf[0] = 0;
481 keyboard_buf[2] = 0;
482 class_send_report(udev, keyboard_buf, 8);
483 }
484 else
485 {
486 keyboard_buf[0] = key_data;
487 keyboard_buf[2] = ascii_code;
488 class_send_report(udev, keyboard_buf, 8);
489 }
490}
491
492
HID_DESCRIPTOR_TYPE
#define HID_DESCRIPTOR_TYPE
Definition: audio_hid_class.h:118
HID_REQ_GET_PROTOCOL
#define HID_REQ_GET_PROTOCOL
Definition: audio_hid_class.h:113
USBD_HID_IN_EPT
#define USBD_HID_IN_EPT
usb custom hid use endpoint define
Definition: audio_hid_class.h:61
HID_REQ_SET_PROTOCOL
#define HID_REQ_SET_PROTOCOL
usb custom hid class request code define
Definition: audio_hid_class.h:112
HID_REPORT_DESC
#define HID_REPORT_DESC
Definition: audio_hid_class.h:119
HID_REQ_SET_IDLE
#define HID_REQ_SET_IDLE
Definition: audio_hid_class.h:114
HID_REQ_GET_IDLE
#define HID_REQ_GET_IDLE
Definition: audio_hid_class.h:115
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
HID_REQ_SET_REPORT
#define HID_REQ_SET_REPORT
Definition: audio_hid_class.h:116
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: audio_hid_desc.h:236
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
usb hid descriptor
Definition: audio_hid_desc.c:527
EPT_INT_TYPE
@ EPT_INT_TYPE
Definition: at32f415_usb.h:349
_asciimap
const unsigned char _asciimap[128]
Definition: keyboard_class.c:63
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device class event handler
Definition: keyboard_class.c:403
usb_hid_keyboard_send_char
void usb_hid_keyboard_send_char(void *udev, uint8_t ascii_code)
usb device class report function
Definition: keyboard_class.c:453
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device class sof handler
Definition: keyboard_class.c:388
hid_set_idle
static uint32_t hid_set_idle
Definition: keyboard_class.c:55
hid_suspend_flag
__IO uint8_t hid_suspend_flag
Definition: keyboard_class.c:59
g_u8tx_completed
__IO uint8_t g_u8tx_completed
Definition: keyboard_class.c:60
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: keyboard_class.c:250
hid_set_report
uint8_t hid_set_report[64]
Definition: keyboard_class.c:58
alt_setting
static uint32_t alt_setting
Definition: keyboard_class.c:56
keyboard_class_handler
usbd_class_handler keyboard_class_handler
Definition: keyboard_class.c:197
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device class endpoint 0 in status stage complete
Definition: keyboard_class.c:323
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: keyboard_class.c:435
SHIFT
#define SHIFT
Definition: keyboard_class.c:62
hid_protocol
static uint32_t hid_protocol
Definition: keyboard_class.c:54
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device class transmision complete handler
Definition: keyboard_class.c:358
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb endpoint
Definition: keyboard_class.c:215
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device class endpoint 0 out status stage complete
Definition: keyboard_class.c:337
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device class endpoint receive data
Definition: keyboard_class.c:376
hid_state
static uint8_t hid_state
Definition: keyboard_class.c:57
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: keyboard_class.c:233
MIN
#define MIN(a, b)
min and max define
Definition: usb_std.h:204
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
USB_STD_REQ_GET_DESCRIPTOR
#define USB_STD_REQ_GET_DESCRIPTOR
Definition: usb_std.h:81
USB_STD_REQ_SET_INTERFACE
#define USB_STD_REQ_SET_INTERFACE
Definition: usb_std.h:86
USB_REQ_TYPE_RESERVED
#define USB_REQ_TYPE_RESERVED
Definition: usb_std.h:66
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_STD_REQ_GET_INTERFACE
#define USB_STD_REQ_GET_INTERFACE
Definition: usb_std.h:85
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usb_std.h:64
USB_CONN_STATE_CONFIGURED
@ USB_CONN_STATE_CONFIGURED
Definition: usb_std.h:131
USB_OK
@ USB_OK
Definition: usb_std.h:218
usbd_connect_state_get
usbd_conn_state usbd_connect_state_get(usbd_core_type *udev)
get usb connect state
Definition: usbd_core.c:592
usbd_ept_close
void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint
Definition: usbd_core.c:341
usbd_ept_open
void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint
Definition: usbd_core.c:309
usbd_ctrl_send
void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data
Definition: usbd_core.c:174
usbd_ept_send
void usbd_ept_send(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data
Definition: usbd_core.c:429
usbd_get_recv_len
uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length
Definition: usbd_core.c:295
usbd_ctrl_recv
void usbd_ctrl_recv(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint recv data
Definition: usbd_core.c:192
usbd_ctrl_unsupport
void usbd_ctrl_unsupport(usbd_core_type *udev)
un-support device request
Definition: usbd_core.c:282
keyboard_class.h
usb hid keyboard header file
keyboard_desc.h
usb keyboard descriptor header file
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_setup_type::wValue
uint16_t wValue
Definition: usb_std.h:233
usb_setup_type::wLength
uint16_t wLength
Definition: usb_std.h:236
usb_setup_type::bmRequestType
uint8_t bmRequestType
Definition: usb_std.h:231
usb_setup_type::bRequest
uint8_t bRequest
Definition: usb_std.h:232
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: keyboard_class.h Source File

  • middlewares
  • usbd_class
  • keyboard
keyboard_class.h
Go to the documentation of this file.
1
27 /* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __KEYBOARD_CLASS_H
29#define __KEYBOARD_CLASS_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "usb_std.h"
36#include "usbd_core.h"
37
53#define USBD_HID_IN_EPT 0x81
54
58#define USBD_IN_MAXPACKET_SIZE 0x40
59#define USBD_OUT_MAXPACKET_SIZE 0x40
60
72#define HID_REQ_SET_PROTOCOL 0x0B
73#define HID_REQ_GET_PROTOCOL 0x03
74#define HID_REQ_SET_IDLE 0x0A
75#define HID_REQ_GET_IDLE 0x02
76#define HID_REQ_SET_REPORT 0x09
77#define HID_REQ_GET_REPORT 0x01
78#define HID_DESCRIPTOR_TYPE 0x21
79#define HID_REPORT_DESC 0x22
80
88extern usbd_class_handler keyboard_class_handler;
89extern __IO uint8_t g_u8tx_completed;
90
91 usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len);
92void usb_hid_keyboard_send_char(void *udev, uint8_t ascii_code);
104#ifdef __cplusplus
105}
106#endif
107
108#endif
usb_hid_keyboard_send_char
void usb_hid_keyboard_send_char(void *udev, uint8_t ascii_code)
usb keyoard send char
Definition: cdc_keyboard_class.c:686
g_u8tx_completed
__IO uint8_t g_u8tx_completed
Definition: keyboard_class.c:60
keyboard_class_handler
usbd_class_handler keyboard_class_handler
Definition: keyboard_class.c:197
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: audio_hid_class.c:818
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
usb_std.h
usb standard header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: keyboard_desc.c Source File

  • middlewares
  • usbd_class
  • keyboard
keyboard_desc.c
Go to the documentation of this file.
1
26#include "usb_std.h"
27#include "usbd_sdr.h"
28#include "usbd_core.h"
29#include "keyboard_desc.h"
30
44usbd_desc_t *get_device_descriptor(void);
45usbd_desc_t *get_device_qualifier(void);
46usbd_desc_t *get_device_configuration(void);
47usbd_desc_t *get_device_other_speed(void);
48usbd_desc_t *get_device_lang_id(void);
49usbd_desc_t *get_device_manufacturer_string(void);
50usbd_desc_t *get_device_product_string(void);
51usbd_desc_t *get_device_serial_string(void);
52usbd_desc_t *get_device_interface_string(void);
53usbd_desc_t *get_device_config_string(void);
54
55uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf);
56static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len);
57static void get_serial_num(void);
58static uint8_t g_usbd_desc_buffer[256];
59
63usbd_desc_handler keyboard_desc_handler =
64{
65 get_device_descriptor,
66 get_device_qualifier,
67 get_device_configuration,
68 get_device_other_speed,
69 get_device_lang_id,
70 get_device_manufacturer_string,
71 get_device_product_string,
72 get_device_serial_string,
73 get_device_interface_string,
74 get_device_config_string,
75};
76
80#if defined ( __ICCARM__ ) /* iar compiler */
81 #pragma data_alignment=4
82#endif
83ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL =
84{
85 USB_DEVICE_DESC_LEN, /* bLength */
86 USB_DESCIPTOR_TYPE_DEVICE, /* bDescriptorType */
87 0x00, /* bcdUSB */
88 0x02,
89 0x00, /* bDeviceClass */
90 0x00, /* bDeviceSubClass */
91 0x00, /* bDeviceProtocol */
92 USB_MAX_EP0_SIZE, /* bMaxPacketSize */
93 LBYTE(USBD_VENDOR_ID), /* idVendor */
94 HBYTE(USBD_VENDOR_ID), /* idVendor */
95 LBYTE(USBD_PRODUCT_ID), /* idProduct */
96 HBYTE(USBD_PRODUCT_ID), /* idProduct */
97 0x00, /* bcdDevice rel. 2.00 */
98 0x02,
99 USB_MFC_STRING, /* Index of manufacturer string */
100 USB_PRODUCT_STRING, /* Index of product string */
101 USB_SERIAL_STRING, /* Index of serial number string */
102 1 /* bNumConfigurations */
103};
104
108#if defined ( __ICCARM__ ) /* iar compiler */
109 #pragma data_alignment=4
110#endif
111ALIGNED_HEAD uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE] ALIGNED_TAIL =
112{
113 USB_DEVICE_CFG_DESC_LEN, /* bLength: configuration descriptor size */
114 USB_DESCIPTOR_TYPE_CONFIGURATION, /* bDescriptorType: configuration */
115 LBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
116 HBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
117 0x01, /* bNumInterfaces: 1 interface */
118 0x01, /* bConfigurationValue: configuration value */
119 0x00, /* iConfiguration: index of string descriptor describing
120 the configuration */
121 0xE0, /* bmAttributes: self powered and support remote wakeup*/
122 0x32, /* MaxPower 100 mA: this current is used for detecting vbus */
123
124 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
125 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
126 0x00, /* bInterfaceNumber: number of interface */
127 0x00, /* bAlternateSetting: alternate set */
128 0x01, /* bNumEndpoints: number of endpoints */
129 USB_CLASS_CODE_HID, /* bInterfaceClass: class code hid */
130 0x01, /* bInterfaceSubClass: subclass code */
131 0x01, /* bInterfaceProtocol: protocol code */
132 0x00, /* iInterface: index of string descriptor */
133
134 0x09, /* bLength: size of HID descriptor in bytes */
135 HID_CLASS_DESC_HID, /* bDescriptorType: HID descriptor type */
136 LBYTE(HID_BCD_NUM),
137 HBYTE(HID_BCD_NUM), /* bcdHID: HID class specification release number */
138 0x00, /* bCountryCode: hardware target conutry */
139 0x01, /* bNumDescriptors: number of HID class descriptor to follow */
140 HID_CLASS_DESC_REPORT, /* bDescriptorType: report descriptor type */
141 LBYTE(sizeof(g_usbd_hid_report)),
142 HBYTE(sizeof(g_usbd_hid_report)), /* wDescriptorLength: total length of reprot descriptor */
143
144 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
145 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
146 USBD_HID_IN_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
147 USB_EPT_DESC_INTERRUPT, /* bmAttributes: endpoint attributes */
148 LBYTE(USBD_IN_MAXPACKET_SIZE),
149 HBYTE(USBD_IN_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
150 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
151};
152
156#if defined ( __ICCARM__ ) /* iar compiler */
157 #pragma data_alignment=4
158#endif
159ALIGNED_HEAD uint8_t g_usbd_hid_report[USBD_HID_SIZ_REPORT_DESC] ALIGNED_TAIL =
160{
161 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
162 0x09, 0x06, // USAGE (Keyboard)
163 0xa1, 0x01, // COLLECTION (Application)
164 0x05, 0x07, // USAGE_PAGE (Keyboard)
165 0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl)
166 0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI)
167 0x15, 0x00, // LOGICAL_MINIMUM (0)
168 0x25, 0x01, // LOGICAL_MAXIMUM (1)
169 0x75, 0x01, // REPORT_SIZE (1)
170 0x95, 0x08, // REPORT_COUNT (8)
171 0x81, 0x02, // INPUT (Data,Var,Abs)
172 0x95, 0x01, // REPORT_COUNT (1)
173 0x75, 0x08, // REPORT_SIZE (8)
174 0x81, 0x03, // INPUT (Cnst,Var,Abs)
175 0x95, 0x05, // REPORT_COUNT (5)
176 0x75, 0x01, // REPORT_SIZE (1)
177 0x05, 0x08, // USAGE_PAGE (LEDs)
178 0x19, 0x01, // USAGE_MINIMUM (Num Lock)
179 0x29, 0x05, // USAGE_MAXIMUM (Kana)
180 0x91, 0x02, // OUTPUT (Data,Var,Abs)
181 0x95, 0x01, // REPORT_COUNT (1)
182 0x75, 0x03, // REPORT_SIZE (3)
183 0x91, 0x03, // OUTPUT (Cnst,Var,Abs)
184 0x95, 0x06, // REPORT_COUNT (6)
185 0x75, 0x08, // REPORT_SIZE (8)
186 0x15, 0x00, // LOGICAL_MINIMUM (0)
187 0x25, 0xFF, // LOGICAL_MAXIMUM (255)
188 0x05, 0x07, // USAGE_PAGE (Keyboard)
189 0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))
190 0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)
191 0x81, 0x00, // INPUT (Data,Ary,Abs)
192 0xc0 // END_COLLECTION
193};
194
198#if defined ( __ICCARM__ ) /* iar compiler */
199 #pragma data_alignment=4
200#endif
201ALIGNED_HEAD uint8_t g_hid_usb_desc[9] ALIGNED_TAIL =
202{
203 0x09, /* bLength: size of HID descriptor in bytes */
204 HID_CLASS_DESC_HID, /* bDescriptorType: HID descriptor type */
205 LBYTE(HID_BCD_NUM),
206 HBYTE(HID_BCD_NUM), /* bcdHID: HID class specification release number */
207 0x00, /* bCountryCode: hardware target conutry */
208 0x01, /* bNumDescriptors: number of HID class descriptor to follow */
209 HID_CLASS_DESC_REPORT, /* bDescriptorType: report descriptor type */
210 LBYTE(sizeof(g_usbd_hid_report)),
211 HBYTE(sizeof(g_usbd_hid_report)), /* wDescriptorLength: total length of reprot descriptor */
212};
213
214
218#if defined ( __ICCARM__ ) /* iar compiler */
219 #pragma data_alignment=4
220#endif
221ALIGNED_HEAD uint8_t g_string_lang_id[USBD_SIZ_STRING_LANGID] ALIGNED_TAIL =
222{
223 USBD_SIZ_STRING_LANGID,
224 USB_DESCIPTOR_TYPE_STRING,
225 0x09,
226 0x04,
227};
228
232#if defined ( __ICCARM__ ) /* iar compiler */
233 #pragma data_alignment=4
234#endif
235ALIGNED_HEAD uint8_t g_string_serial[USBD_SIZ_STRING_SERIAL] ALIGNED_TAIL =
236{
237 USBD_SIZ_STRING_SERIAL,
238 USB_DESCIPTOR_TYPE_STRING,
239};
240
241
242/* device descriptor */
243usbd_desc_t device_descriptor =
244{
245 USB_DEVICE_DESC_LEN,
246 g_usbd_descriptor
247};
248
249/* config descriptor */
250usbd_desc_t config_descriptor =
251{
252 USBD_CONFIG_DESC_SIZE,
253 g_usbd_configuration
254};
255
256/* langid descriptor */
257usbd_desc_t langid_descriptor =
258{
259 USBD_SIZ_STRING_LANGID,
260 g_string_lang_id
261};
262
263/* serial descriptor */
264usbd_desc_t serial_descriptor =
265{
266 USBD_SIZ_STRING_SERIAL,
267 g_string_serial
268};
269
270usbd_desc_t vp_desc;
271
278uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
279{
280 uint16_t str_len = 0, id_pos = 2;
281 uint8_t *tmp_str = string;
282
283 while(*tmp_str != '\0')
284 {
285 str_len ++;
286 unicode_buf[id_pos ++] = *tmp_str ++;
287 unicode_buf[id_pos ++] = 0x00;
288 }
289
290 str_len = str_len * 2 + 2;
291 unicode_buf[0] = str_len;
292 unicode_buf[1] = USB_DESCIPTOR_TYPE_STRING;
293
294 return str_len;
295}
296
304static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len)
305{
306 uint8_t idx = 0;
307
308 for( idx = 0 ; idx < len ; idx ++)
309 {
310 if( ((value >> 28)) < 0xA )
311 {
312 pbuf[ 2 * idx] = (value >> 28) + '0';
313 }
314 else
315 {
316 pbuf[2 * idx] = (value >> 28) + 'A' - 10;
317 }
318
319 value = value << 4;
320
321 pbuf[2 * idx + 1] = 0;
322 }
323}
324
330static void get_serial_num(void)
331{
332 uint32_t serial0, serial1, serial2;
333
334 serial0 = *(uint32_t*)MCU_ID1;
335 serial1 = *(uint32_t*)MCU_ID2;
336 serial2 = *(uint32_t*)MCU_ID3;
337
338 serial0 += serial2;
339
340 if (serial0 != 0)
341 {
342 usbd_int_to_unicode (serial0, &g_string_serial[2] ,8);
343 usbd_int_to_unicode (serial1, &g_string_serial[18] ,4);
344 }
345}
346
352usbd_desc_t *get_device_descriptor(void)
353{
354 return &device_descriptor;
355}
356
362usbd_desc_t * get_device_qualifier(void)
363{
364 return NULL;
365}
366
372usbd_desc_t *get_device_configuration(void)
373{
374 return &config_descriptor;
375}
376
382usbd_desc_t *get_device_other_speed(void)
383{
384 return NULL;
385}
386
392usbd_desc_t *get_device_lang_id(void)
393{
394 return &langid_descriptor;
395}
396
397
403usbd_desc_t *get_device_manufacturer_string(void)
404{
405 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_MANUFACTURER_STRING, g_usbd_desc_buffer);
406 vp_desc.descriptor = g_usbd_desc_buffer;
407 return &vp_desc;
408}
409
415usbd_desc_t *get_device_product_string(void)
416{
417 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_PRODUCT_STRING, g_usbd_desc_buffer);
418 vp_desc.descriptor = g_usbd_desc_buffer;
419 return &vp_desc;
420}
421
427usbd_desc_t *get_device_serial_string(void)
428{
429 get_serial_num();
430 return &serial_descriptor;
431}
432
438usbd_desc_t *get_device_interface_string(void)
439{
440 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_INTERFACE_STRING, g_usbd_desc_buffer);
441 vp_desc.descriptor = g_usbd_desc_buffer;
442 return &vp_desc;
443}
444
450usbd_desc_t *get_device_config_string(void)
451{
452 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_CONFIGURATION_STRING, g_usbd_desc_buffer);
453 vp_desc.descriptor = g_usbd_desc_buffer;
454 return &vp_desc;
455}
456
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
USBD_DESC_CONFIGURATION_STRING
#define USBD_DESC_CONFIGURATION_STRING
Definition: audio_desc.h:61
USBD_SIZ_STRING_SERIAL
#define USBD_SIZ_STRING_SERIAL
Definition: audio_desc.h:57
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112
USBD_DESC_PRODUCT_STRING
#define USBD_DESC_PRODUCT_STRING
Definition: audio_desc.h:60
HID_BINTERVAL_TIME
#define HID_BINTERVAL_TIME
Definition: audio_desc.h:205
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: audio_desc.h:208
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
USBD_SIZ_STRING_LANGID
#define USBD_SIZ_STRING_LANGID
Definition: audio_desc.h:56
MCU_ID1
#define MCU_ID1
Definition: audio_desc.h:215
USBD_DESC_MANUFACTURER_STRING
#define USBD_DESC_MANUFACTURER_STRING
Definition: audio_desc.h:59
USBD_PRODUCT_ID
#define USBD_PRODUCT_ID
Definition: audio_desc.h:54
USBD_DESC_INTERFACE_STRING
#define USBD_DESC_INTERFACE_STRING
Definition: audio_desc.h:62
MCU_ID2
#define MCU_ID2
Definition: audio_desc.h:216
USBD_VENDOR_ID
#define USBD_VENDOR_ID
Definition: audio_desc.h:53
MCU_ID3
#define MCU_ID3
Definition: audio_desc.h:217
USBD_HID_IN_EPT
#define USBD_HID_IN_EPT
usb custom hid use endpoint define
Definition: audio_hid_class.h:61
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
HID_CLASS_DESC_HID
#define HID_CLASS_DESC_HID
usb hid class descriptor define
Definition: audio_hid_desc.h:216
HID_CLASS_DESC_REPORT
#define HID_CLASS_DESC_REPORT
Definition: audio_hid_desc.h:217
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: audio_hid_desc.h:236
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
usb hid descriptor
Definition: audio_hid_desc.c:527
HID_BCD_NUM
#define HID_BCD_NUM
usb bcd number define
Definition: audio_hid_desc.h:211
serial_descriptor
usbd_desc_t serial_descriptor
Definition: keyboard_desc.c:264
device_descriptor
usbd_desc_t device_descriptor
Definition: keyboard_desc.c:243
usbd_unicode_convert
uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert
Definition: keyboard_desc.c:278
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: keyboard_desc.c:403
langid_descriptor
usbd_desc_t langid_descriptor
Definition: keyboard_desc.c:257
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: keyboard_desc.c:362
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: keyboard_desc.c:438
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: keyboard_desc.c:382
g_usbd_desc_buffer
static uint8_t g_usbd_desc_buffer[256]
Definition: keyboard_desc.c:58
vp_desc
usbd_desc_t vp_desc
Definition: keyboard_desc.c:270
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: keyboard_desc.c:372
ALIGNED_TAIL
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL
usb device standard descriptor
Definition: keyboard_desc.c:83
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: keyboard_desc.c:415
keyboard_desc_handler
usbd_desc_handler keyboard_desc_handler
keyboard device descriptor handler structure
Definition: keyboard_desc.c:63
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: keyboard_desc.c:392
get_serial_num
static void get_serial_num(void)
usb get serial number
Definition: keyboard_desc.c:330
config_descriptor
usbd_desc_t config_descriptor
Definition: keyboard_desc.c:250
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: keyboard_desc.c:352
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: keyboard_desc.c:427
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: keyboard_desc.c:450
usbd_int_to_unicode
static void usbd_int_to_unicode(uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode
Definition: keyboard_desc.c:304
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_DEVICE_EPT_LEN
#define USB_DEVICE_EPT_LEN
Definition: usb_std.h:153
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
USB_DESCIPTOR_TYPE_CONFIGURATION
#define USB_DESCIPTOR_TYPE_CONFIGURATION
Definition: usb_std.h:93
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DESCIPTOR_TYPE_ENDPOINT
#define USB_DESCIPTOR_TYPE_ENDPOINT
Definition: usb_std.h:96
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_DEVICE_IF_DESC_LEN
#define USB_DEVICE_IF_DESC_LEN
Definition: usb_std.h:152
USB_DEVICE_CFG_DESC_LEN
#define USB_DEVICE_CFG_DESC_LEN
Definition: usb_std.h:151
USB_EPT_DESC_INTERRUPT
#define USB_EPT_DESC_INTERRUPT
Definition: usb_std.h:178
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92
USB_DESCIPTOR_TYPE_STRING
#define USB_DESCIPTOR_TYPE_STRING
Definition: usb_std.h:94
USB_DESCIPTOR_TYPE_INTERFACE
#define USB_DESCIPTOR_TYPE_INTERFACE
Definition: usb_std.h:95
USB_CLASS_CODE_HID
#define USB_CLASS_CODE_HID
Definition: usb_std.h:163
keyboard_desc.h
usb keyboard descriptor header file
usb_std.h
usb standard header file
usbd_core.h
usb device core header file
usbd_sdr.h


AT32F415 Firmwary Library: keyboard_desc.h Source File

  • middlewares
  • usbd_class
  • keyboard
keyboard_desc.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __KEYBOARD_DESC_H
29#define __KEYBOARD_DESC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "keyboard_class.h"
36#include "usbd_core.h"
37
53#define HID_BCD_NUM 0x0110
54
58#define HID_CLASS_DESC_HID 0x21
59#define HID_CLASS_DESC_REPORT 0x22
60#define HID_CLASS_DESC_PHYSICAL 0x23
61
65#define USBD_VENDOR_ID 0x2E3C
66#define USBD_PRODUCT_ID 0x6040
67
71#define USBD_CONFIG_DESC_SIZE 34
72#define USBD_HID_SIZ_REPORT_DESC 63
73#define USBD_SIZ_STRING_LANGID 4
74#define USBD_SIZ_STRING_SERIAL 0x1A
75
79#define USBD_DESC_MANUFACTURER_STRING "Artery"
80#define USBD_DESC_PRODUCT_STRING "Keyboard"
81#define USBD_DESC_CONFIGURATION_STRING "Keyboard Config"
82#define USBD_DESC_INTERFACE_STRING "Keyboard Interface"
83
87#define HID_BINTERVAL_TIME 0x0A
88
92#define MCU_ID1 (0x1FFFF7E8)
93#define MCU_ID2 (0x1FFFF7EC)
94#define MCU_ID3 (0x1FFFF7F0)
95
100extern uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN];
101extern uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE];
102extern uint8_t g_usbd_hid_report[USBD_HID_SIZ_REPORT_DESC];
103extern uint8_t g_hid_usb_desc[9];
104extern usbd_desc_handler keyboard_desc_handler;
105
113#ifdef __cplusplus
114}
115#endif
116
117#endif
118
119
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
usb descriptor size define
Definition: keyboard_desc.h:71
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: keyboard_desc.h:72
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
g_usbd_hid_report
uint8_t g_usbd_hid_report[63]
keyboard_desc_handler
usbd_desc_handler keyboard_desc_handler
keyboard device descriptor handler structure
Definition: keyboard_desc.c:63
g_usbd_configuration
uint8_t g_usbd_configuration[34]
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
keyboard_class.h
usb hid keyboard header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: main_page.h Source File

  • main_page
main_page.h
Go to the documentation of this file.
1


AT32F415 Firmwary Library: mouse_class.c Source File

  • middlewares
  • usbd_class
  • mouse
mouse_class.c
Go to the documentation of this file.
1
26#include "usbd_core.h"
27#include "mouse_class.h"
28#include "mouse_desc.h"
29
43 usb_sts_type class_init_handler(void *udev);
44 usb_sts_type class_clear_handler(void *udev);
45 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup);
46 usb_sts_type class_ept0_tx_handler(void *udev);
47 usb_sts_type class_ept0_rx_handler(void *udev);
48 usb_sts_type class_in_handler(void *udev, uint8_t ept_num);
49 usb_sts_type class_out_handler(void *udev, uint8_t ept_num);
50 usb_sts_type class_sof_handler(void *udev);
51 usb_sts_type class_event_handler(void *udev, usbd_event_type event);
52
53/* hid static variable */
54static uint32_t hid_protocol = 0;
55static uint32_t hid_set_idle = 0;
56static uint32_t alt_setting = 0;
57static uint8_t hid_state;
58__IO uint8_t hid_suspend_flag = 0;
59uint8_t hid_set_report[64];
60
61/* usb device class handler */
62usbd_class_handler mouse_class_handler =
63{
64 class_init_handler,
65 class_clear_handler,
66 class_setup_handler,
67 class_ept0_tx_handler,
68 class_ept0_rx_handler,
69 class_in_handler,
70 class_out_handler,
71 class_sof_handler,
72 class_event_handler,
73};
74
80 usb_sts_type class_init_handler(void *udev)
81{
82 usb_sts_type status = USB_OK;
83 usbd_core_type *pudev = (usbd_core_type *)udev;
84
85 /* open hid in endpoint */
86 usbd_ept_open(pudev, USBD_HID_IN_EPT, EPT_INT_TYPE, USBD_IN_MAXPACKET_SIZE);
87
88 return status;
89}
90
96 usb_sts_type class_clear_handler(void *udev)
97{
98 usb_sts_type status = USB_OK;
99 usbd_core_type *pudev = (usbd_core_type *)udev;
100
101 /* close hid in endpoint */
102 usbd_ept_close(pudev, USBD_HID_IN_EPT);
103
104 return status;
105}
106
113 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
114{
115 usb_sts_type status = USB_OK;
116 usbd_core_type *pudev = (usbd_core_type *)udev;
117 uint16_t len;
118 uint8_t *buf;
119
120 switch(setup->bmRequestType & USB_REQ_TYPE_RESERVED)
121 {
122 /* class request */
123 case USB_REQ_TYPE_CLASS:
124 switch(setup->bRequest)
125 {
126 case HID_REQ_SET_PROTOCOL:
127 hid_protocol = (uint8_t)setup->wValue;
128 break;
129 case HID_REQ_GET_PROTOCOL:
130 usbd_ctrl_send(pudev, (uint8_t *)&hid_protocol, 1);
131 break;
132 case HID_REQ_SET_IDLE:
133 hid_set_idle = (uint8_t)(setup->wValue >> 8);
134 break;
135 case HID_REQ_GET_IDLE:
136 usbd_ctrl_send(pudev, (uint8_t *)&hid_set_idle, 1);
137 break;
138 case HID_REQ_SET_REPORT:
139 hid_state = HID_REQ_SET_REPORT;
140 usbd_ctrl_recv(pudev, hid_set_report, setup->wLength);
141 break;
142 default:
143 usbd_ctrl_unsupport(pudev);
144 break;
145 }
146 break;
147 /* standard request */
148 case USB_REQ_TYPE_STANDARD:
149 switch(setup->bRequest)
150 {
151 case USB_STD_REQ_GET_DESCRIPTOR:
152 if(setup->wValue >> 8 == HID_REPORT_DESC)
153 {
154 len = MIN(USBD_HID_SIZ_REPORT_DESC, setup->wLength);
155 buf = (uint8_t *)g_usbd_hid_report;
156 }
157 else if(setup->wValue >> 8 == HID_DESCRIPTOR_TYPE)
158 {
159 len = MIN(9, setup->wLength);
160 buf = (uint8_t *)g_hid_usb_desc;
161 }
162 usbd_ctrl_send(pudev, (uint8_t *)buf, len);
163 break;
164 case USB_STD_REQ_GET_INTERFACE:
165 usbd_ctrl_send(pudev, (uint8_t *)&alt_setting, 1);
166 break;
167 case USB_STD_REQ_SET_INTERFACE:
168 alt_setting = setup->wValue;
169 break;
170 }
171 break;
172 default:
173 usbd_ctrl_unsupport(pudev);
174 break;
175 }
176 return status;
177}
178
184 usb_sts_type class_ept0_tx_handler(void *udev)
185{
186 usb_sts_type status = USB_OK;
187
188 /* ...user code... */
189
190 return status;
191}
192
198 usb_sts_type class_ept0_rx_handler(void *udev)
199{
200 usb_sts_type status = USB_OK;
201 usbd_core_type *pudev = (usbd_core_type *)udev;
202 uint32_t recv_len = usbd_get_recv_len(pudev, 0);
203 /* ...user code... */
204 if( hid_state == HID_REQ_SET_REPORT)
205 {
206 /* hid buffer process */
207 hid_state = 0;
208 }
209
210 return status;
211}
212
219 usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
220{
221 usb_sts_type status = USB_OK;
222
223 /* ...user code...
224 trans next packet data
225 */
226
227 return status;
228}
229
236 usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
237{
238 usb_sts_type status = USB_OK;
239
240 return status;
241}
242
248 usb_sts_type class_sof_handler(void *udev)
249{
250 usb_sts_type status = USB_OK;
251
252 /* ...user code... */
253
254 return status;
255}
256
263 usb_sts_type class_event_handler(void *udev, usbd_event_type event)
264{
265 usb_sts_type status = USB_OK;
266 switch(event)
267 {
268 case USBD_RESET_EVENT:
269
270 /* ...user code... */
271
272 break;
273 case USBD_SUSPEND_EVENT:
274 hid_suspend_flag = 1;
275 /* ...user code... */
276
277 break;
278 case USBD_WAKEUP_EVENT:
279 /* ...user code... */
280
281 break;
282 default:
283 break;
284 }
285 return status;
286}
287
295 usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
296{
297 usb_sts_type status = USB_OK;
298 usbd_core_type *pudev = (usbd_core_type *)udev;
299
300 if(usbd_connect_state_get(pudev) == USB_CONN_STATE_CONFIGURED)
301 {
302 usbd_flush_tx_fifo(pudev, USBD_HID_IN_EPT);
303 usbd_ept_send(pudev, USBD_HID_IN_EPT, report, len);
304 }
305
306 return status;
307}
308
315void usb_hid_mouse_send(void *udev, uint8_t op)
316{
317 static uint8_t mouse_buffer[4] = {0, 0, 0, 0};
318 int8_t posx = 0, posy = 0, button = 0;
319 switch(op)
320 {
321 case LEFT_BUTTON:
322 button = 0x01;
323 break;
324
325 case RIGHT_BUTTON:
326 button = 0x2;
327 break;
328
329 case UP_MOVE:
330 posy -= MOVE_STEP;
331 break;
332
333 case DOWN_MOVE:
334 posy += MOVE_STEP;
335 break;
336
337 case LEFT_MOVE:
338 posx -= MOVE_STEP;
339 break;
340
341 case RIGHT_MOVE:
342 posx += MOVE_STEP;
343 break;
344
345 default:
346 break;
347 }
348 mouse_buffer[0] = button;
349 mouse_buffer[1] = posx;
350 mouse_buffer[2] = posy;
351
352 class_send_report(udev, mouse_buffer, 4);
353}
354
HID_DESCRIPTOR_TYPE
#define HID_DESCRIPTOR_TYPE
Definition: audio_hid_class.h:118
HID_REQ_GET_PROTOCOL
#define HID_REQ_GET_PROTOCOL
Definition: audio_hid_class.h:113
USBD_HID_IN_EPT
#define USBD_HID_IN_EPT
usb custom hid use endpoint define
Definition: audio_hid_class.h:61
HID_REQ_SET_PROTOCOL
#define HID_REQ_SET_PROTOCOL
usb custom hid class request code define
Definition: audio_hid_class.h:112
HID_REPORT_DESC
#define HID_REPORT_DESC
Definition: audio_hid_class.h:119
HID_REQ_SET_IDLE
#define HID_REQ_SET_IDLE
Definition: audio_hid_class.h:114
HID_REQ_GET_IDLE
#define HID_REQ_GET_IDLE
Definition: audio_hid_class.h:115
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
HID_REQ_SET_REPORT
#define HID_REQ_SET_REPORT
Definition: audio_hid_class.h:116
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: audio_hid_desc.h:236
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
usb hid descriptor
Definition: audio_hid_desc.c:527
EPT_INT_TYPE
@ EPT_INT_TYPE
Definition: at32f415_usb.h:349
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device class event handler
Definition: mouse_class.c:263
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device class sof handler
Definition: mouse_class.c:248
hid_set_idle
static uint32_t hid_set_idle
Definition: mouse_class.c:55
hid_suspend_flag
__IO uint8_t hid_suspend_flag
Definition: mouse_class.c:58
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: mouse_class.c:113
hid_set_report
uint8_t hid_set_report[64]
Definition: mouse_class.c:59
alt_setting
static uint32_t alt_setting
Definition: mouse_class.c:56
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device class endpoint 0 in status stage complete
Definition: mouse_class.c:184
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: mouse_class.c:295
hid_protocol
static uint32_t hid_protocol
Definition: mouse_class.c:54
mouse_class_handler
usbd_class_handler mouse_class_handler
Definition: mouse_class.c:62
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device class transmision complete handler
Definition: mouse_class.c:219
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb endpoint
Definition: mouse_class.c:80
usb_hid_mouse_send
void usb_hid_mouse_send(void *udev, uint8_t op)
usb device class report function
Definition: mouse_class.c:315
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device class endpoint 0 out status stage complete
Definition: mouse_class.c:198
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device class endpoint receive data
Definition: mouse_class.c:236
hid_state
static uint8_t hid_state
Definition: mouse_class.c:57
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: mouse_class.c:96
MOVE_STEP
#define MOVE_STEP
usb hid mouse operation
Definition: mouse_class.h:83
LEFT_MOVE
#define LEFT_MOVE
Definition: mouse_class.h:88
DOWN_MOVE
#define DOWN_MOVE
Definition: mouse_class.h:91
RIGHT_MOVE
#define RIGHT_MOVE
Definition: mouse_class.h:89
LEFT_BUTTON
#define LEFT_BUTTON
Definition: mouse_class.h:86
RIGHT_BUTTON
#define RIGHT_BUTTON
Definition: mouse_class.h:87
UP_MOVE
#define UP_MOVE
Definition: mouse_class.h:90
MIN
#define MIN(a, b)
min and max define
Definition: usb_std.h:204
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
USB_STD_REQ_GET_DESCRIPTOR
#define USB_STD_REQ_GET_DESCRIPTOR
Definition: usb_std.h:81
USB_STD_REQ_SET_INTERFACE
#define USB_STD_REQ_SET_INTERFACE
Definition: usb_std.h:86
USB_REQ_TYPE_RESERVED
#define USB_REQ_TYPE_RESERVED
Definition: usb_std.h:66
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_STD_REQ_GET_INTERFACE
#define USB_STD_REQ_GET_INTERFACE
Definition: usb_std.h:85
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usb_std.h:64
USB_CONN_STATE_CONFIGURED
@ USB_CONN_STATE_CONFIGURED
Definition: usb_std.h:131
USB_OK
@ USB_OK
Definition: usb_std.h:218
usbd_connect_state_get
usbd_conn_state usbd_connect_state_get(usbd_core_type *udev)
get usb connect state
Definition: usbd_core.c:592
usbd_ept_close
void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint
Definition: usbd_core.c:341
usbd_flush_tx_fifo
void usbd_flush_tx_fifo(usbd_core_type *udev, uint8_t ept_num)
usb device flush in endpoint fifo
Definition: usbd_core.c:645
usbd_ept_open
void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint
Definition: usbd_core.c:309
usbd_ctrl_send
void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data
Definition: usbd_core.c:174
usbd_ept_send
void usbd_ept_send(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data
Definition: usbd_core.c:429
usbd_get_recv_len
uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length
Definition: usbd_core.c:295
usbd_ctrl_recv
void usbd_ctrl_recv(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint recv data
Definition: usbd_core.c:192
usbd_ctrl_unsupport
void usbd_ctrl_unsupport(usbd_core_type *udev)
un-support device request
Definition: usbd_core.c:282
mouse_class.h
usb hid mouse header file
mouse_desc.h
usb mouse descriptor header file
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_setup_type::wValue
uint16_t wValue
Definition: usb_std.h:233
usb_setup_type::wLength
uint16_t wLength
Definition: usb_std.h:236
usb_setup_type::bmRequestType
uint8_t bmRequestType
Definition: usb_std.h:231
usb_setup_type::bRequest
uint8_t bRequest
Definition: usb_std.h:232
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: mouse_class.h Source File

  • middlewares
  • usbd_class
  • mouse
mouse_class.h
Go to the documentation of this file.
1
27 /* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __MOUSE_CLASS_H
29#define __MOUSE_CLASS_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "usb_std.h"
36#include "usbd_core.h"
37
53#define USBD_HID_IN_EPT 0x81
54
58#define USBD_IN_MAXPACKET_SIZE 0x40
59
71#define HID_REQ_SET_PROTOCOL 0x0B
72#define HID_REQ_GET_PROTOCOL 0x03
73#define HID_REQ_SET_IDLE 0x0A
74#define HID_REQ_GET_IDLE 0x02
75#define HID_REQ_SET_REPORT 0x09
76#define HID_REQ_GET_REPORT 0x01
77#define HID_DESCRIPTOR_TYPE 0x21
78#define HID_REPORT_DESC 0x22
79
83#define MOVE_STEP 20
84
85#define BUTTON_RELEASE 0
86#define LEFT_BUTTON 1
87#define RIGHT_BUTTON 2
88#define LEFT_MOVE 3
89#define RIGHT_MOVE 4
90#define UP_MOVE 5
91#define DOWN_MOVE 6
92
100extern usbd_class_handler mouse_class_handler;
101 usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len);
102void usb_hid_mouse_send(void *udev, uint8_t op);
114#ifdef __cplusplus
115}
116#endif
117
118#endif
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: audio_hid_class.c:818
mouse_class_handler
usbd_class_handler mouse_class_handler
Definition: mouse_class.c:62
usb_hid_mouse_send
void usb_hid_mouse_send(void *udev, uint8_t op)
usb device class report function
Definition: mouse_class.c:315
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
usb_std.h
usb standard header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: mouse_desc.c Source File

  • middlewares
  • usbd_class
  • mouse
mouse_desc.c
Go to the documentation of this file.
1
26#include "usb_std.h"
27#include "usbd_sdr.h"
28#include "usbd_core.h"
29#include "mouse_desc.h"
30
44usbd_desc_t *get_device_descriptor(void);
45usbd_desc_t *get_device_qualifier(void);
46usbd_desc_t *get_device_configuration(void);
47usbd_desc_t *get_device_other_speed(void);
48usbd_desc_t *get_device_lang_id(void);
49usbd_desc_t *get_device_manufacturer_string(void);
50usbd_desc_t *get_device_product_string(void);
51usbd_desc_t *get_device_serial_string(void);
52usbd_desc_t *get_device_interface_string(void);
53usbd_desc_t *get_device_config_string(void);
54
55uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf);
56static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len);
57static void get_serial_num(void);
58static uint8_t g_usbd_desc_buffer[256];
59
63usbd_desc_handler mouse_desc_handler =
64{
65 get_device_descriptor,
66 get_device_qualifier,
67 get_device_configuration,
68 get_device_other_speed,
69 get_device_lang_id,
70 get_device_manufacturer_string,
71 get_device_product_string,
72 get_device_serial_string,
73 get_device_interface_string,
74 get_device_config_string,
75};
76
80#if defined ( __ICCARM__ ) /* iar compiler */
81 #pragma data_alignment=4
82#endif
83ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL =
84{
85 USB_DEVICE_DESC_LEN, /* bLength */
86 USB_DESCIPTOR_TYPE_DEVICE, /* bDescriptorType */
87 0x00, /* bcdUSB */
88 0x02,
89 0x00, /* bDeviceClass */
90 0x00, /* bDeviceSubClass */
91 0x00, /* bDeviceProtocol */
92 USB_MAX_EP0_SIZE, /* bMaxPacketSize */
93 LBYTE(USBD_VENDOR_ID), /* idVendor */
94 HBYTE(USBD_VENDOR_ID), /* idVendor */
95 LBYTE(USBD_PRODUCT_ID), /* idProduct */
96 HBYTE(USBD_PRODUCT_ID), /* idProduct */
97 0x00, /* bcdDevice rel. 2.00 */
98 0x02,
99 USB_MFC_STRING, /* Index of manufacturer string */
100 USB_PRODUCT_STRING, /* Index of product string */
101 USB_SERIAL_STRING, /* Index of serial number string */
102 1 /* bNumConfigurations */
103};
104
108#if defined ( __ICCARM__ ) /* iar compiler */
109 #pragma data_alignment=4
110#endif
111ALIGNED_HEAD uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE] ALIGNED_TAIL =
112{
113 USB_DEVICE_CFG_DESC_LEN, /* bLength: configuration descriptor size */
114 USB_DESCIPTOR_TYPE_CONFIGURATION, /* bDescriptorType: configuration */
115 LBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
116 HBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
117 0x01, /* bNumInterfaces: 1 interface */
118 0x01, /* bConfigurationValue: configuration value */
119 0x00, /* iConfiguration: index of string descriptor describing
120 the configuration */
121 0xE0, /* bmAttributes: self powered and support remote wakeup*/
122 0x32, /* MaxPower 100 mA: this current is used for detecting vbus */
123
124 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
125 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
126 0x00, /* bInterfaceNumber: number of interface */
127 0x00, /* bAlternateSetting: alternate set */
128 0x01, /* bNumEndpoints: number of endpoints */
129 USB_CLASS_CODE_HID, /* bInterfaceClass: class code hid */
130 0x01, /* bInterfaceSubClass: subclass code */
131 0x02, /* bInterfaceProtocol: protocol code */
132 0x00, /* iInterface: index of string descriptor */
133
134 0x09, /* bLength: size of HID descriptor in bytes */
135 HID_CLASS_DESC_HID, /* bDescriptorType: HID descriptor type */
136 LBYTE(HID_BCD_NUM),
137 HBYTE(HID_BCD_NUM), /* bcdHID: HID class specification release number */
138 0x00, /* bCountryCode: hardware target conutry */
139 0x01, /* bNumDescriptors: number of HID class descriptor to follow */
140 HID_CLASS_DESC_REPORT, /* bDescriptorType: report descriptor type */
141 LBYTE(sizeof(g_usbd_hid_report)),
142 HBYTE(sizeof(g_usbd_hid_report)), /* wDescriptorLength: total length of reprot descriptor */
143
144 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
145 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
146 USBD_HID_IN_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
147 USB_EPT_DESC_INTERRUPT, /* bmAttributes: endpoint attributes */
148 LBYTE(USBD_IN_MAXPACKET_SIZE),
149 HBYTE(USBD_IN_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
150 HID_BINTERVAL_TIME, /* bInterval: interval for polling endpoint for data transfers */
151};
152
156#if defined ( __ICCARM__ ) /* iar compiler */
157 #pragma data_alignment=4
158#endif
159ALIGNED_HEAD uint8_t g_usbd_hid_report[USBD_HID_SIZ_REPORT_DESC] ALIGNED_TAIL =
160{
161 0x05,0x01,
162 0x09,0x02,
163 0xA1,0x01,
164 0x09,0x01,
165
166 0xA1,0x00,
167 0x05,0x09,
168 0x19,0x01,
169 0x29,0x03,
170
171 0x15,0x00,
172 0x25,0x01,
173 0x95,0x03,
174 0x75,0x01,
175
176 0x81,0x02,
177 0x95,0x01,
178 0x75,0x05,
179 0x81,0x01,
180
181 0x05,0x01,
182 0x09,0x30,
183 0x09,0x31,
184 0x09,0x38,
185
186 0x15,0x81,
187 0x25,0x7F,
188 0x75,0x08,
189 0x95,0x03,
190
191 0x81,0x06,
192 0xC0,0x09,
193 0x3c,0x05,
194 0xff,0x09,
195
196 0x01,0x15,
197 0x00,0x25,
198 0x01,0x75,
199 0x01,0x95,
200
201 0x02,0xb1,
202 0x22,0x75,
203 0x06,0x95,
204 0x01,0xb1,
205
206 0x01,0xc0
207};
208
212#if defined ( __ICCARM__ ) /* iar compiler */
213 #pragma data_alignment=4
214#endif
215ALIGNED_HEAD uint8_t g_hid_usb_desc[9] ALIGNED_TAIL =
216{
217 0x09, /* bLength: size of HID descriptor in bytes */
218 HID_CLASS_DESC_HID, /* bDescriptorType: HID descriptor type */
219 LBYTE(HID_BCD_NUM),
220 HBYTE(HID_BCD_NUM), /* bcdHID: HID class specification release number */
221 0x00, /* bCountryCode: hardware target conutry */
222 0x01, /* bNumDescriptors: number of HID class descriptor to follow */
223 HID_CLASS_DESC_REPORT, /* bDescriptorType: report descriptor type */
224 LBYTE(sizeof(g_usbd_hid_report)),
225 HBYTE(sizeof(g_usbd_hid_report)), /* wDescriptorLength: total length of reprot descriptor */
226};
227
228
232#if defined ( __ICCARM__ ) /* iar compiler */
233 #pragma data_alignment=4
234#endif
235ALIGNED_HEAD uint8_t g_string_lang_id[USBD_SIZ_STRING_LANGID] ALIGNED_TAIL =
236{
237 USBD_SIZ_STRING_LANGID,
238 USB_DESCIPTOR_TYPE_STRING,
239 0x09,
240 0x04,
241};
242
246#if defined ( __ICCARM__ ) /* iar compiler */
247 #pragma data_alignment=4
248#endif
249ALIGNED_HEAD uint8_t g_string_serial[USBD_SIZ_STRING_SERIAL] ALIGNED_TAIL =
250{
251 USBD_SIZ_STRING_SERIAL,
252 USB_DESCIPTOR_TYPE_STRING,
253};
254
255
256/* device descriptor */
257usbd_desc_t device_descriptor =
258{
259 USB_DEVICE_DESC_LEN,
260 g_usbd_descriptor
261};
262
263/* config descriptor */
264usbd_desc_t config_descriptor =
265{
266 USBD_CONFIG_DESC_SIZE,
267 g_usbd_configuration
268};
269
270/* langid descriptor */
271usbd_desc_t langid_descriptor =
272{
273 USBD_SIZ_STRING_LANGID,
274 g_string_lang_id
275};
276
277/* serial descriptor */
278usbd_desc_t serial_descriptor =
279{
280 USBD_SIZ_STRING_SERIAL,
281 g_string_serial
282};
283
284usbd_desc_t vp_desc;
285
292uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
293{
294 uint16_t str_len = 0, id_pos = 2;
295 uint8_t *tmp_str = string;
296
297 while(*tmp_str != '\0')
298 {
299 str_len ++;
300 unicode_buf[id_pos ++] = *tmp_str ++;
301 unicode_buf[id_pos ++] = 0x00;
302 }
303
304 str_len = str_len * 2 + 2;
305 unicode_buf[0] = str_len;
306 unicode_buf[1] = USB_DESCIPTOR_TYPE_STRING;
307
308 return str_len;
309}
310
318static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len)
319{
320 uint8_t idx = 0;
321
322 for( idx = 0 ; idx < len ; idx ++)
323 {
324 if( ((value >> 28)) < 0xA )
325 {
326 pbuf[ 2 * idx] = (value >> 28) + '0';
327 }
328 else
329 {
330 pbuf[2 * idx] = (value >> 28) + 'A' - 10;
331 }
332
333 value = value << 4;
334
335 pbuf[2 * idx + 1] = 0;
336 }
337}
338
344static void get_serial_num(void)
345{
346 uint32_t serial0, serial1, serial2;
347
348 serial0 = *(uint32_t*)MCU_ID1;
349 serial1 = *(uint32_t*)MCU_ID2;
350 serial2 = *(uint32_t*)MCU_ID3;
351
352 serial0 += serial2;
353
354 if (serial0 != 0)
355 {
356 usbd_int_to_unicode (serial0, &g_string_serial[2] ,8);
357 usbd_int_to_unicode (serial1, &g_string_serial[18] ,4);
358 }
359}
360
366usbd_desc_t *get_device_descriptor(void)
367{
368 return &device_descriptor;
369}
370
376usbd_desc_t * get_device_qualifier(void)
377{
378 return NULL;
379}
380
386usbd_desc_t *get_device_configuration(void)
387{
388 return &config_descriptor;
389}
390
396usbd_desc_t *get_device_other_speed(void)
397{
398 return NULL;
399}
400
406usbd_desc_t *get_device_lang_id(void)
407{
408 return &langid_descriptor;
409}
410
411
417usbd_desc_t *get_device_manufacturer_string(void)
418{
419 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_MANUFACTURER_STRING, g_usbd_desc_buffer);
420 vp_desc.descriptor = g_usbd_desc_buffer;
421 return &vp_desc;
422}
423
429usbd_desc_t *get_device_product_string(void)
430{
431 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_PRODUCT_STRING, g_usbd_desc_buffer);
432 vp_desc.descriptor = g_usbd_desc_buffer;
433 return &vp_desc;
434}
435
441usbd_desc_t *get_device_serial_string(void)
442{
443 get_serial_num();
444 return &serial_descriptor;
445}
446
452usbd_desc_t *get_device_interface_string(void)
453{
454 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_INTERFACE_STRING, g_usbd_desc_buffer);
455 vp_desc.descriptor = g_usbd_desc_buffer;
456 return &vp_desc;
457}
458
464usbd_desc_t *get_device_config_string(void)
465{
466 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_CONFIGURATION_STRING, g_usbd_desc_buffer);
467 vp_desc.descriptor = g_usbd_desc_buffer;
468 return &vp_desc;
469}
470
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
USBD_DESC_CONFIGURATION_STRING
#define USBD_DESC_CONFIGURATION_STRING
Definition: audio_desc.h:61
USBD_SIZ_STRING_SERIAL
#define USBD_SIZ_STRING_SERIAL
Definition: audio_desc.h:57
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112
USBD_DESC_PRODUCT_STRING
#define USBD_DESC_PRODUCT_STRING
Definition: audio_desc.h:60
HID_BINTERVAL_TIME
#define HID_BINTERVAL_TIME
Definition: audio_desc.h:205
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: audio_desc.h:208
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
USBD_SIZ_STRING_LANGID
#define USBD_SIZ_STRING_LANGID
Definition: audio_desc.h:56
MCU_ID1
#define MCU_ID1
Definition: audio_desc.h:215
USBD_DESC_MANUFACTURER_STRING
#define USBD_DESC_MANUFACTURER_STRING
Definition: audio_desc.h:59
USBD_PRODUCT_ID
#define USBD_PRODUCT_ID
Definition: audio_desc.h:54
USBD_DESC_INTERFACE_STRING
#define USBD_DESC_INTERFACE_STRING
Definition: audio_desc.h:62
MCU_ID2
#define MCU_ID2
Definition: audio_desc.h:216
USBD_VENDOR_ID
#define USBD_VENDOR_ID
Definition: audio_desc.h:53
MCU_ID3
#define MCU_ID3
Definition: audio_desc.h:217
USBD_HID_IN_EPT
#define USBD_HID_IN_EPT
usb custom hid use endpoint define
Definition: audio_hid_class.h:61
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
g_usbd_hid_report
uint8_t g_usbd_hid_report[126]
usb hid report descriptor
Definition: audio_hid_desc.c:429
HID_CLASS_DESC_HID
#define HID_CLASS_DESC_HID
usb hid class descriptor define
Definition: audio_hid_desc.h:216
HID_CLASS_DESC_REPORT
#define HID_CLASS_DESC_REPORT
Definition: audio_hid_desc.h:217
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: audio_hid_desc.h:236
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
usb hid descriptor
Definition: audio_hid_desc.c:527
HID_BCD_NUM
#define HID_BCD_NUM
usb bcd number define
Definition: audio_hid_desc.h:211
serial_descriptor
usbd_desc_t serial_descriptor
Definition: mouse_desc.c:278
device_descriptor
usbd_desc_t device_descriptor
Definition: mouse_desc.c:257
usbd_unicode_convert
uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert
Definition: mouse_desc.c:292
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: mouse_desc.c:417
mouse_desc_handler
usbd_desc_handler mouse_desc_handler
mouse device descriptor handler structure
Definition: mouse_desc.c:63
langid_descriptor
usbd_desc_t langid_descriptor
Definition: mouse_desc.c:271
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: mouse_desc.c:376
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: mouse_desc.c:452
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: mouse_desc.c:396
g_usbd_desc_buffer
static uint8_t g_usbd_desc_buffer[256]
Definition: mouse_desc.c:58
vp_desc
usbd_desc_t vp_desc
Definition: mouse_desc.c:284
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: mouse_desc.c:386
ALIGNED_TAIL
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL
usb device standard descriptor
Definition: mouse_desc.c:83
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: mouse_desc.c:429
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: mouse_desc.c:406
get_serial_num
static void get_serial_num(void)
usb get serial number
Definition: mouse_desc.c:344
config_descriptor
usbd_desc_t config_descriptor
Definition: mouse_desc.c:264
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: mouse_desc.c:366
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: mouse_desc.c:441
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: mouse_desc.c:464
usbd_int_to_unicode
static void usbd_int_to_unicode(uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode
Definition: mouse_desc.c:318
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_DEVICE_EPT_LEN
#define USB_DEVICE_EPT_LEN
Definition: usb_std.h:153
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
USB_DESCIPTOR_TYPE_CONFIGURATION
#define USB_DESCIPTOR_TYPE_CONFIGURATION
Definition: usb_std.h:93
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DESCIPTOR_TYPE_ENDPOINT
#define USB_DESCIPTOR_TYPE_ENDPOINT
Definition: usb_std.h:96
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_DEVICE_IF_DESC_LEN
#define USB_DEVICE_IF_DESC_LEN
Definition: usb_std.h:152
USB_DEVICE_CFG_DESC_LEN
#define USB_DEVICE_CFG_DESC_LEN
Definition: usb_std.h:151
USB_EPT_DESC_INTERRUPT
#define USB_EPT_DESC_INTERRUPT
Definition: usb_std.h:178
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92
USB_DESCIPTOR_TYPE_STRING
#define USB_DESCIPTOR_TYPE_STRING
Definition: usb_std.h:94
USB_DESCIPTOR_TYPE_INTERFACE
#define USB_DESCIPTOR_TYPE_INTERFACE
Definition: usb_std.h:95
USB_CLASS_CODE_HID
#define USB_CLASS_CODE_HID
Definition: usb_std.h:163
mouse_desc.h
usb mouse descriptor header file
usb_std.h
usb standard header file
usbd_core.h
usb device core header file
usbd_sdr.h


AT32F415 Firmwary Library: mouse_desc.h Source File

  • middlewares
  • usbd_class
  • mouse
mouse_desc.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __MOUSE_DESC_H
29#define __MOUSE_DESC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "mouse_class.h"
36#include "usbd_core.h"
37
53#define HID_BCD_NUM 0x0110
54
58#define HID_CLASS_DESC_HID 0x21
59#define HID_CLASS_DESC_REPORT 0x22
60#define HID_CLASS_DESC_PHYSICAL 0x23
61
65#define USBD_VENDOR_ID 0x2E3C
66#define USBD_PRODUCT_ID 0x5710
67
71#define USBD_CONFIG_DESC_SIZE 34
72#define USBD_HID_SIZ_REPORT_DESC 74
73#define USBD_SIZ_STRING_LANGID 4
74#define USBD_SIZ_STRING_SERIAL 0x1A
75
79#define USBD_DESC_MANUFACTURER_STRING "Artery"
80#define USBD_DESC_PRODUCT_STRING "Mouse"
81#define USBD_DESC_CONFIGURATION_STRING "Mouse Config"
82#define USBD_DESC_INTERFACE_STRING "Mouse Interface"
83
87#define HID_BINTERVAL_TIME 0x0A
88
92#define MCU_ID1 (0x1FFFF7E8)
93#define MCU_ID2 (0x1FFFF7EC)
94#define MCU_ID3 (0x1FFFF7F0)
95
100extern uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN];
101extern uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE];
102extern uint8_t g_usbd_hid_report[USBD_HID_SIZ_REPORT_DESC];
103extern uint8_t g_hid_usb_desc[9];
104extern usbd_desc_handler mouse_desc_handler;
105
113#ifdef __cplusplus
114}
115#endif
116
117#endif
118
119
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
usb descriptor size define
Definition: mouse_desc.h:71
USBD_HID_SIZ_REPORT_DESC
#define USBD_HID_SIZ_REPORT_DESC
Definition: mouse_desc.h:72
g_usbd_hid_report
uint8_t g_usbd_hid_report[74]
mouse_desc_handler
usbd_desc_handler mouse_desc_handler
mouse device descriptor handler structure
Definition: mouse_desc.c:63
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
g_usbd_configuration
uint8_t g_usbd_configuration[34]
g_hid_usb_desc
uint8_t g_hid_usb_desc[9]
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
mouse_class.h
usb hid mouse header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: msc_diskio.h Source File

  • usb_device
  • msc
  • inc
msc/inc/msc_diskio.h
Go to the documentation of this file.
1
26/* Define to prevent recursive inclusion -------------------------------------*/
27#ifndef __MSC_DISKIO_H
28#define __MSC_DISKIO_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34
35#include "usb_conf.h"
36#include "usb_std.h"
37
45#define INTERNAL_FLASH_LUN 0
46#define SPI_FLASH_LUN 1
47#define SD_LUN 2
48
49#define USB_FLASH_ADDR_OFFSET 0x08005000
50
51#define SECTOR_SIZE_1K 1024
52#define SECTOR_SIZE_2K 2048
53#define SECTOR_SIZE_4K 4096
54
55uint8_t *get_inquiry(uint8_t lun);
56 usb_sts_type msc_disk_read(uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len);
57 usb_sts_type msc_disk_write(uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len);
58 usb_sts_type msc_disk_capacity(uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size);
59
68#ifdef __cplusplus
69}
70#endif
71
72#endif
73
74
msc_disk_write
usb_sts_type msc_disk_write(uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len)
disk write
Definition: msc/src/msc_diskio.c:106
msc_disk_read
usb_sts_type msc_disk_read(uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len)
disk read
Definition: msc/src/msc_diskio.c:75
msc_disk_capacity
usb_sts_type msc_disk_capacity(uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size)
disk capacity
Definition: msc/src/msc_diskio.c:144
get_inquiry
uint8_t * get_inquiry(uint8_t lun)
get disk inquiry
Definition: msc/src/msc_diskio.c:59
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
usb_std.h
usb standard header file
usb_conf.h
usb config header file


AT32F415 Firmwary Library: msc_diskio.c Source File

  • usb_device
  • msc
  • src
msc/src/msc_diskio.c
Go to the documentation of this file.
1
26#include "msc_diskio.h"
27#include "msc_bot_scsi.h"
28
36uint32_t sector_size = 2048;
37uint32_t msc_flash_size;
38uint8_t scsi_inquiry[MSC_SUPPORT_MAX_LUN][SCSI_INQUIRY_DATA_LENGTH] =
39{
40 /* lun = 0 */
41 {
42 0x00, /* peripheral device type (direct-access device) */
43 0x80, /* removable media bit */
44 0x00, /* ansi version, ecma version, iso version */
45 0x01, /* respond data format */
46 SCSI_INQUIRY_DATA_LENGTH - 5, /* additional length */
47 0x00, 0x00, 0x00, /* reserved */
48 'A', 'T', '3', '2', ' ', ' ', ' ', ' ', /* vendor information "AT32" */
49 'D', 'i', 's', 'k', '0', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', /* Product identification "Disk" */
50 '2', '.', '0', '0' /* product revision level */
51 }
52};
53
59uint8_t *get_inquiry(uint8_t lun)
60{
61 if(lun < MSC_SUPPORT_MAX_LUN)
62 return (uint8_t *)scsi_inquiry[lun];
63 else
64 return NULL;
65}
66
75 usb_sts_type msc_disk_read(uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len)
76{
77 uint32_t i = 0;
78 uint32_t flash_addr = addr + USB_FLASH_ADDR_OFFSET;
79 switch(lun)
80 {
81 case INTERNAL_FLASH_LUN:
82 for(i = 0; i < len; i ++)
83 {
84 read_buf[i] = *((uint8_t *)flash_addr);
85 flash_addr += 1;
86 }
87 break;
88 case SPI_FLASH_LUN:
89 break;
90 case SD_LUN:
91 break;
92 default:
93 break;
94 }
95 return USB_OK;
96}
97
106 usb_sts_type msc_disk_write(uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len)
107{
108 uint32_t flash_addr = addr + USB_FLASH_ADDR_OFFSET;
109 uint32_t i = 0, tolen = len;
110 uint32_t erase_addr = flash_addr;
111 switch(lun)
112 {
113 case INTERNAL_FLASH_LUN:
114 flash_unlock();
115 while(tolen >= sector_size)
116 {
117 flash_sector_erase(erase_addr);
118 tolen -= sector_size;
119 erase_addr += sector_size;
120 }
121 for(i = 0; i < len; i ++)
122 {
123 flash_byte_program(flash_addr+i, buf[i]);
124 }
125 flash_lock();
126 break;
127 case SPI_FLASH_LUN:
128 break;
129 case SD_LUN:
130 break;
131 default:
132 break;;
133 }
134 return USB_OK;
135}
136
144 usb_sts_type msc_disk_capacity(uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size)
145{
146 uint32_t flash_s = *((uint32_t *)0x1FFFF7E0);
147 msc_flash_size = (flash_s << 10) - (USB_FLASH_ADDR_OFFSET - FLASH_BASE);
148
149 if(flash_s < 256)
150 {
151 sector_size = SECTOR_SIZE_1K;
152 }
153 else
154 {
155 sector_size = SECTOR_SIZE_2K;
156 }
157 switch(lun)
158 {
159 case INTERNAL_FLASH_LUN:
160 *blk_nbr = msc_flash_size / sector_size;
161 *blk_size = sector_size;
162 break;
163 case SPI_FLASH_LUN:
164 break;
165 case SD_LUN:
166 break;
167 default:
168 break;
169 }
170 return USB_OK;
171}
172
msc_disk_write
usb_sts_type msc_disk_write(uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len)
disk write
Definition: msc/src/msc_diskio.c:106
msc_disk_read
usb_sts_type msc_disk_read(uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len)
disk read
Definition: msc/src/msc_diskio.c:75
USB_FLASH_ADDR_OFFSET
#define USB_FLASH_ADDR_OFFSET
Definition: msc/inc/msc_diskio.h:49
INTERNAL_FLASH_LUN
#define INTERNAL_FLASH_LUN
Definition: msc/inc/msc_diskio.h:45
msc_disk_capacity
usb_sts_type msc_disk_capacity(uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size)
disk capacity
Definition: msc/src/msc_diskio.c:144
msc_flash_size
uint32_t msc_flash_size
Definition: msc/src/msc_diskio.c:37
sector_size
uint32_t sector_size
Definition: msc/src/msc_diskio.c:36
SD_LUN
#define SD_LUN
Definition: msc/inc/msc_diskio.h:47
scsi_inquiry
uint8_t scsi_inquiry[MSC_SUPPORT_MAX_LUN][SCSI_INQUIRY_DATA_LENGTH]
Definition: msc/src/msc_diskio.c:38
SPI_FLASH_LUN
#define SPI_FLASH_LUN
Definition: msc/inc/msc_diskio.h:46
get_inquiry
uint8_t * get_inquiry(uint8_t lun)
get disk inquiry
Definition: msc/src/msc_diskio.c:59
flash_sector_erase
flash_status_type flash_sector_erase(uint32_t sector_address)
erase a specified flash sector.
Definition: at32f415_flash.c:173
flash_byte_program
flash_status_type flash_byte_program(uint32_t address, uint8_t data)
program a byte at a specified address.
Definition: at32f415_flash.c:342
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
flash_lock
void flash_lock(void)
lock the flash controller.
Definition: at32f415_flash.c:162
FLASH_BASE
#define FLASH_BASE
Definition: at32f415.h:285
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
SECTOR_SIZE_1K
#define SECTOR_SIZE_1K
Definition: hid_iap_class.h:73
SECTOR_SIZE_2K
#define SECTOR_SIZE_2K
Definition: hid_iap_class.h:74
SCSI_INQUIRY_DATA_LENGTH
#define SCSI_INQUIRY_DATA_LENGTH
Definition: msc_bot_scsi.h:123
MSC_SUPPORT_MAX_LUN
#define MSC_SUPPORT_MAX_LUN
Definition: msc_bot_scsi.h:49
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_OK
@ USB_OK
Definition: usb_std.h:218
msc_bot_scsi.h
usb mass storage bulk-only transport and scsi command header file


AT32F415 Firmwary Library: msc_bot_scsi.c Source File

  • middlewares
  • usbd_class
  • msc
msc_bot_scsi.c
Go to the documentation of this file.
1
26#include "msc_bot_scsi.h"
27#include "msc_diskio.h"
28
42 msc_type msc_struct;
43 cbw_type cbw_struct;
44 csw_type csw_struct =
45{
46 CSW_DCSWSIGNATURE,
47 0x00,
48 0x00,
49 CSW_BCSWSTATUS_PASS,
50};
51
52#if defined ( __ICCARM__ ) /* iar compiler */
53 #pragma data_alignment=4
54#endif
55ALIGNED_HEAD uint8_t page00_inquiry_data[] ALIGNED_TAIL = {
56 0x00,
57 0x00,
58 0x00,
59 0x00,
60 0x00,
61
62};
63#if defined ( __ICCARM__ ) /* iar compiler */
64 #pragma data_alignment=4
65#endif
66ALIGNED_HEAD sense_type sense_data ALIGNED_TAIL =
67{
68 0x70,
69 0x00,
70 SENSE_KEY_ILLEGAL_REQUEST,
71 0x00000000,
72 0x0A,
73 0x00000000,
74 0x20,
75 0x00,
76 0x00000000
77};
78
79#if defined ( __ICCARM__ ) /* iar compiler */
80 #pragma data_alignment=4
81#endif
82ALIGNED_HEAD uint8_t mode_sense6_data[8] ALIGNED_TAIL =
83{
84 0x00,
85 0x00,
86 0x00,
87 0x00,
88 0x00,
89 0x00,
90 0x00,
91 0x00
92};
93
94#if defined ( __ICCARM__ ) /* iar compiler */
95 #pragma data_alignment=4
96#endif
97ALIGNED_HEAD uint8_t mode_sense10_data[8] ALIGNED_TAIL =
98{
99 0x00,
100 0x06,
101 0x00,
102 0x00,
103 0x00,
104 0x00,
105 0x00,
106 0x00
107};
113void bot_scsi_init(void *udev)
114{
115 usbd_core_type *pudev = (usbd_core_type *)udev;
116 msc_struct.msc_state = MSC_STATE_MACHINE_IDLE;
117 msc_struct.bot_status = MSC_BOT_STATE_IDLE;
118 msc_struct.max_lun = MSC_SUPPORT_MAX_LUN - 1;
119
120 usb_flush_tx_fifo(pudev->usb_reg, USBD_MSC_BULK_IN_EPT&0x7F);
121
122 /* set out endpoint to receive status */
123 usbd_ept_recv(pudev, USBD_MSC_BULK_OUT_EPT, (uint8_t *)&cbw_struct, CBW_CMD_LENGTH);
124}
125
131void bot_scsi_reset(void *udev)
132{
133 usbd_core_type *pudev = (usbd_core_type *)udev;
134 msc_struct.msc_state = MSC_STATE_MACHINE_IDLE;
135 msc_struct.bot_status = MSC_BOT_STATE_RECOVERY;
136 msc_struct.max_lun = MSC_SUPPORT_MAX_LUN - 1;
137 usb_flush_tx_fifo(pudev->usb_reg, USBD_MSC_BULK_IN_EPT&0x7F);
138
139 /* set out endpoint to receive status */
140 usbd_ept_recv(pudev, USBD_MSC_BULK_OUT_EPT, (uint8_t *)&cbw_struct, CBW_CMD_LENGTH);
141}
142
149void bot_scsi_datain_handler(void *udev, uint8_t ept_num)
150{
151 switch(msc_struct.msc_state)
152 {
153 case MSC_STATE_MACHINE_DATA_IN:
154 if(bot_scsi_cmd_process(udev) != USB_OK)
155 {
156 bot_scsi_send_csw(udev, CSW_BCSWSTATUS_FAILED);
157 }
158 break;
159
160 case MSC_STATE_MACHINE_LAST_DATA:
161 case MSC_STATE_MACHINE_SEND_DATA:
162 bot_scsi_send_csw(udev, CSW_BCSWSTATUS_PASS);
163 break;
164
165 default:
166 break;
167 }
168}
169
176void bot_scsi_dataout_handler(void *udev, uint8_t ept_num)
177{
178 switch(msc_struct.msc_state)
179 {
180 case MSC_STATE_MACHINE_IDLE:
181 bot_cbw_decode(udev);
182 break;
183
184 case MSC_STATE_MACHINE_DATA_OUT:
185 if(bot_scsi_cmd_process(udev) != USB_OK)
186 {
187 bot_scsi_send_csw(udev, CSW_BCSWSTATUS_FAILED);
188 }
189 break;
190 }
191}
192
198void bot_cbw_decode(void *udev)
199{
200 usbd_core_type *pudev = (usbd_core_type *)udev;
201
202 csw_struct.dCSWTag = cbw_struct.dCBWTage;
203 csw_struct.dCSWDataResidue = cbw_struct.dCBWDataTransferLength;
204
205 /* check param */
206 if((cbw_struct.dCBWSignature != CBW_DCBWSIGNATURE) ||
207 (usbd_get_recv_len(pudev, USBD_MSC_BULK_OUT_EPT) != CBW_CMD_LENGTH)
208 || (cbw_struct.bCBWLUN > MSC_SUPPORT_MAX_LUN) ||
209 (cbw_struct.bCBWCBLength < 1) || (cbw_struct.bCBWCBLength > 16))
210 {
211 bot_scsi_sense_code(udev, SENSE_KEY_ILLEGAL_REQUEST, INVALID_COMMAND);
212 msc_struct.bot_status = MSC_BOT_STATE_ERROR;
213 bot_scsi_stall(udev);
214 }
215 else
216 {
217 if(bot_scsi_cmd_process(udev) != USB_OK)
218 {
219 bot_scsi_stall(udev);
220 }
221 else if((msc_struct.msc_state != MSC_STATE_MACHINE_DATA_IN) &&
222 (msc_struct.msc_state != MSC_STATE_MACHINE_DATA_OUT) &&
223 (msc_struct.msc_state != MSC_STATE_MACHINE_LAST_DATA))
224 {
225 if(msc_struct.data_len == 0)
226 {
227 bot_scsi_send_csw(udev, CSW_BCSWSTATUS_PASS);
228 }
229 else if(msc_struct.data_len > 0)
230 {
231 bot_scsi_send_data(udev, msc_struct.data, msc_struct.data_len);
232 }
233 }
234 }
235}
236
244void bot_scsi_send_data(void *udev, uint8_t *buffer, uint32_t len)
245{
246 usbd_core_type *pudev = (usbd_core_type *)udev;
247 uint32_t data_len = MIN(len, cbw_struct.dCBWDataTransferLength);
248
249 csw_struct.dCSWDataResidue -= data_len;
250 csw_struct.bCSWStatus = CSW_BCSWSTATUS_PASS;
251
252 msc_struct.msc_state = MSC_STATE_MACHINE_SEND_DATA;
253
254 usbd_ept_send(pudev, USBD_MSC_BULK_IN_EPT,
255 buffer, data_len);
256}
257
264void bot_scsi_send_csw(void *udev, uint8_t status)
265{
266 usbd_core_type *pudev = (usbd_core_type *)udev;
267
268 csw_struct.bCSWStatus = status;
269 csw_struct.dCSWSignature = CSW_DCSWSIGNATURE;
270 msc_struct.msc_state = MSC_STATE_MACHINE_IDLE;
271
272 usbd_ept_send(pudev, USBD_MSC_BULK_IN_EPT,
273 (uint8_t *)&csw_struct, CSW_CMD_LENGTH);
274
275 usbd_ept_recv(pudev, USBD_MSC_BULK_OUT_EPT,
276 (uint8_t *)&cbw_struct, CBW_CMD_LENGTH);
277}
278
279
287void bot_scsi_sense_code(void *udev, uint8_t sense_key, uint8_t asc)
288{
289 sense_data.sense_key = sense_key;
290 sense_data.asc = asc;
291}
292
293
302 usb_sts_type bot_scsi_check_address(void *udev, uint8_t lun, uint32_t blk_offset, uint32_t blk_count)
303{
304 if((blk_offset + blk_count) > msc_struct.blk_nbr[lun])
305 {
306 bot_scsi_sense_code(udev, SENSE_KEY_ILLEGAL_REQUEST, ADDRESS_OUT_OF_RANGE);
307 return USB_FAIL;
308 }
309 return USB_OK;
310}
311
317void bot_scsi_stall(void *udev)
318{
319 usbd_core_type *pudev = (usbd_core_type *)udev;
320 if((cbw_struct.dCBWDataTransferLength != 0) &&
321 (cbw_struct.bmCBWFlags == 0) &&
322 msc_struct.bot_status == MSC_BOT_STATE_IDLE)
323 {
324 usbd_set_stall(pudev, USBD_MSC_BULK_OUT_EPT);
325 }
326 usbd_set_stall(pudev, USBD_MSC_BULK_IN_EPT);
327
328 if(msc_struct.bot_status == MSC_BOT_STATE_ERROR)
329 {
330 usbd_ept_recv(pudev, USBD_MSC_BULK_OUT_EPT,
331 (uint8_t *)&cbw_struct, CBW_CMD_LENGTH);
332 }
333}
334
341 usb_sts_type bot_scsi_test_unit(void *udev, uint8_t lun)
342{
343 usb_sts_type status = USB_OK;
344 if(cbw_struct.dCBWDataTransferLength != 0)
345 {
346 bot_scsi_sense_code(udev, SENSE_KEY_ILLEGAL_REQUEST, INVALID_COMMAND);
347 return USB_FAIL;
348 }
349
350 msc_struct.data_len = 0;
351 return status;
352}
353
360 usb_sts_type bot_scsi_inquiry(void *udev, uint8_t lun)
361{
362 uint8_t *pdata;
363 uint32_t trans_len = 0;
364 usb_sts_type status = USB_OK;
365
366 if(cbw_struct.CBWCB[1] & 0x01)
367 {
368 pdata = page00_inquiry_data;
369 trans_len = 5;
370 }
371 else
372 {
373 pdata = get_inquiry(lun);
374 if(cbw_struct.dCBWDataTransferLength < SCSI_INQUIRY_DATA_LENGTH)
375 {
376 trans_len = cbw_struct.dCBWDataTransferLength;
377 }
378 else
379 {
380 trans_len = SCSI_INQUIRY_DATA_LENGTH;
381 }
382 }
383
384 msc_struct.data_len = trans_len;
385 while(trans_len)
386 {
387 trans_len --;
388 msc_struct.data[trans_len] = pdata[trans_len];
389 }
390 return status;
391}
392
399 usb_sts_type bot_scsi_start_stop(void *udev, uint8_t lun)
400{
401 msc_struct.data_len = 0;
402 return USB_OK;
403}
404
411 usb_sts_type bot_scsi_allow_medium_removal(void *udev, uint8_t lun)
412{
413 msc_struct.data_len = 0;
414 return USB_OK;
415}
416
423 usb_sts_type bot_scsi_mode_sense6(void *udev, uint8_t lun)
424{
425 uint8_t data_len = 8;
426 msc_struct.data_len = 8;
427 while(data_len)
428 {
429 data_len --;
430 msc_struct.data[data_len] = mode_sense6_data[data_len];
431 };
432 return USB_OK;
433}
434
441 usb_sts_type bot_scsi_mode_sense10(void *udev, uint8_t lun)
442{
443 uint8_t data_len = 8;
444 msc_struct.data_len = 8;
445 while(data_len)
446 {
447 data_len --;
448 msc_struct.data[data_len] = mode_sense10_data[data_len];
449 };
450 return USB_OK;
451}
452
459 usb_sts_type bot_scsi_capacity(void *udev, uint8_t lun)
460{
461 uint8_t *pdata = msc_struct.data;
462
463 msc_disk_capacity(lun, &msc_struct.blk_nbr[lun], &msc_struct.blk_size[lun]);
464
465 pdata[0] = (uint8_t)((msc_struct.blk_nbr[lun] - 1) >> 24);
466 pdata[1] = (uint8_t)((msc_struct.blk_nbr[lun] - 1) >> 16);
467 pdata[2] = (uint8_t)((msc_struct.blk_nbr[lun] - 1) >> 8);
468 pdata[3] = (uint8_t)((msc_struct.blk_nbr[lun] - 1));
469
470 pdata[4] = (uint8_t)((msc_struct.blk_size[lun]) >> 24);
471 pdata[5] = (uint8_t)((msc_struct.blk_size[lun]) >> 16);
472 pdata[6] = (uint8_t)((msc_struct.blk_size[lun]) >> 8);
473 pdata[7] = (uint8_t)((msc_struct.blk_size[lun]));
474
475 msc_struct.data_len = 8;
476 return USB_OK;
477}
478
485 usb_sts_type bot_scsi_format_capacity(void *udev, uint8_t lun)
486{
487 uint8_t *pdata = msc_struct.data;
488
489 pdata[0] = 0;
490 pdata[1] = 0;
491 pdata[2] = 0;
492 pdata[3] = 0x08;
493
494 msc_disk_capacity(lun, &msc_struct.blk_nbr[lun], &msc_struct.blk_size[lun]);
495
496 pdata[4] = (uint8_t)((msc_struct.blk_nbr[lun] - 1) >> 24);
497 pdata[5] = (uint8_t)((msc_struct.blk_nbr[lun] - 1) >> 16);
498 pdata[6] = (uint8_t)((msc_struct.blk_nbr[lun] - 1) >> 8);
499 pdata[7] = (uint8_t)((msc_struct.blk_nbr[lun] - 1));
500
501 pdata[8] = 0x02;
502
503 pdata[9] = (uint8_t)((msc_struct.blk_size[lun]) >> 16);
504 pdata[10] = (uint8_t)((msc_struct.blk_size[lun]) >> 8);
505 pdata[11] = (uint8_t)((msc_struct.blk_size[lun]));
506
507 msc_struct.data_len = 12;
508
509 return USB_OK;
510}
511
518 usb_sts_type bot_scsi_request_sense(void *udev, uint8_t lun)
519{
520 uint32_t trans_len = 0x12;
521 uint8_t *pdata = msc_struct.data;
522 uint8_t *sdata = (uint8_t *)&sense_data;
523
524 while(trans_len)
525 {
526 trans_len --;
527 pdata[trans_len] = sdata[trans_len];
528 }
529
530 if(cbw_struct.dCBWDataTransferLength < REQ_SENSE_STANDARD_DATA_LEN)
531 {
532 msc_struct.data_len = cbw_struct.dCBWDataTransferLength;
533 }
534 else
535 {
536 msc_struct.data_len = REQ_SENSE_STANDARD_DATA_LEN;
537 }
538 return USB_OK;
539}
540
547 usb_sts_type bot_scsi_verify(void *udev, uint8_t lun)
548{
549 uint8_t *cmd = cbw_struct.CBWCB;
550 if((cbw_struct.CBWCB[1] & 0x02) == 0x02)
551 {
552 bot_scsi_sense_code(udev, SENSE_KEY_ILLEGAL_REQUEST, INVALID_FIELED_IN_COMMAND);
553 return USB_FAIL;
554 }
555
556 msc_struct.blk_addr = cmd[2] << 24 | cmd[3] << 16 | cmd[4] << 8 | cmd[5];
557 msc_struct.blk_len = cmd[7] << 8 | cmd[8];
558
559 if(bot_scsi_check_address(udev, lun, msc_struct.blk_addr, msc_struct.blk_len) != USB_OK)
560 {
561 return USB_FAIL;
562 }
563 msc_struct.data_len = 0;
564 return USB_OK;
565}
566
573 usb_sts_type bot_scsi_read10(void *udev, uint8_t lun)
574{
575 uint8_t *cmd = cbw_struct.CBWCB;
576 usbd_core_type *pudev = (usbd_core_type *)udev;
577 uint32_t len;
578
579 if(msc_struct.msc_state == MSC_STATE_MACHINE_IDLE)
580 {
581 if((cbw_struct.bmCBWFlags & 0x80) != 0x80)
582 {
583 bot_scsi_sense_code(udev, SENSE_KEY_ILLEGAL_REQUEST, INVALID_COMMAND);
584 return USB_FAIL;
585 }
586
587 msc_struct.blk_addr = cmd[2] << 24 | cmd[3] << 16 | cmd[4] << 8 | cmd[5];
588 msc_struct.blk_len = cmd[7] << 8 | cmd[8];
589
590 if(bot_scsi_check_address(udev, lun, msc_struct.blk_addr, msc_struct.blk_len) != USB_OK)
591 {
592 return USB_FAIL;
593 }
594
595 msc_struct.blk_addr *= msc_struct.blk_size[lun];
596 msc_struct.blk_len *= msc_struct.blk_size[lun];
597
598 if(cbw_struct.dCBWDataTransferLength != msc_struct.blk_len)
599 {
600 bot_scsi_sense_code(udev, SENSE_KEY_ILLEGAL_REQUEST, INVALID_COMMAND);
601 return USB_FAIL;
602 }
603 msc_struct.msc_state = MSC_STATE_MACHINE_DATA_IN;
604 }
605 msc_struct.data_len = MSC_MAX_DATA_BUF_LEN;
606
607 len = MIN(msc_struct.blk_len, MSC_MAX_DATA_BUF_LEN);
608 if( msc_disk_read(lun, msc_struct.blk_addr, msc_struct.data, len) != USB_OK)
609 {
610 bot_scsi_sense_code(udev, SENSE_KEY_HARDWARE_ERROR, MEDIUM_NOT_PRESENT);
611 return USB_FAIL;
612 }
613 usbd_ept_send(pudev, USBD_MSC_BULK_IN_EPT, msc_struct.data, len);
614 msc_struct.blk_addr += len;
615 msc_struct.blk_len -= len;
616
617 csw_struct.dCSWDataResidue -= len;
618 if(msc_struct.blk_len == 0)
619 {
620 msc_struct.msc_state = MSC_STATE_MACHINE_LAST_DATA;
621 }
622
623 return USB_OK;
624}
625
626
633 usb_sts_type bot_scsi_write10(void *udev, uint8_t lun)
634{
635 uint8_t *cmd = cbw_struct.CBWCB;
636 usbd_core_type *pudev = (usbd_core_type *)udev;
637 uint32_t len;
638
639 if(msc_struct.msc_state == MSC_STATE_MACHINE_IDLE)
640 {
641 if((cbw_struct.bmCBWFlags & 0x80) == 0x80)
642 {
643 bot_scsi_sense_code(udev, SENSE_KEY_ILLEGAL_REQUEST, INVALID_COMMAND);
644 return USB_FAIL;
645 }
646
647 msc_struct.blk_addr = cmd[2] << 24 | cmd[3] << 16 | cmd[4] << 8 | cmd[5];
648 msc_struct.blk_len = cmd[7] << 8 | cmd[8];
649
650 if(bot_scsi_check_address(udev, lun, msc_struct.blk_addr, msc_struct.blk_len) != USB_OK)
651 {
652 return USB_FAIL;
653 }
654
655 msc_struct.blk_addr *= msc_struct.blk_size[lun];
656 msc_struct.blk_len *= msc_struct.blk_size[lun];
657
658 if(cbw_struct.dCBWDataTransferLength != msc_struct.blk_len)
659 {
660 bot_scsi_sense_code(udev, SENSE_KEY_ILLEGAL_REQUEST, INVALID_COMMAND);
661 return USB_FAIL;
662 }
663
664 msc_struct.msc_state = MSC_STATE_MACHINE_DATA_OUT;
665 len = MIN(msc_struct.blk_len, MSC_MAX_DATA_BUF_LEN);
666 usbd_ept_recv(pudev, USBD_MSC_BULK_OUT_EPT, (uint8_t *)msc_struct.data, len);
667
668 }
669 else
670 {
671 len = MIN(msc_struct.blk_len, MSC_MAX_DATA_BUF_LEN);
672 if(msc_disk_write(lun, msc_struct.blk_addr, msc_struct.data, len) != USB_OK)
673 {
674 bot_scsi_sense_code(udev, SENSE_KEY_HARDWARE_ERROR, MEDIUM_NOT_PRESENT);
675 return USB_FAIL;
676 }
677
678 msc_struct.blk_addr += len;
679 msc_struct.blk_len -= len;
680
681 csw_struct.dCSWDataResidue -= len;
682
683 if(msc_struct.blk_len == 0)
684 {
685 bot_scsi_send_csw(udev, CSW_BCSWSTATUS_PASS);
686 }
687 else
688 {
689 len = MIN(msc_struct.blk_len, MSC_MAX_DATA_BUF_LEN);
690 usbd_ept_recv(pudev, USBD_MSC_BULK_OUT_EPT, (uint8_t *)msc_struct.data, len);
691 }
692 }
693 return USB_OK;
694}
695
702void bot_scsi_clear_feature(void *udev, uint8_t ept_num)
703{
704 usbd_core_type *pudev = (usbd_core_type *)udev;
705
706 if(msc_struct.bot_status == MSC_BOT_STATE_ERROR)
707 {
708 usbd_set_stall(pudev, USBD_MSC_BULK_IN_EPT);
709 msc_struct.bot_status = MSC_BOT_STATE_IDLE;
710 }
711 else if(((ept_num & 0x80) == 0x80) && (msc_struct.bot_status != MSC_BOT_STATE_RECOVERY))
712 {
713 bot_scsi_send_csw(udev, CSW_BCSWSTATUS_FAILED);
714 }
715}
716
722 usb_sts_type bot_scsi_cmd_process(void *udev)
723{
724 usb_sts_type status = USB_FAIL;
725 switch(cbw_struct.CBWCB[0])
726 {
727 case MSC_CMD_INQUIRY:
728 status = bot_scsi_inquiry(udev, cbw_struct.bCBWLUN);
729 break;
730
731 case MSC_CMD_START_STOP:
732 status = bot_scsi_start_stop(udev, cbw_struct.bCBWLUN);
733 break;
734
735 case MSC_CMD_MODE_SENSE6:
736 status = bot_scsi_mode_sense6(udev, cbw_struct.bCBWLUN);
737 break;
738
739 case MSC_CMD_MODE_SENSE10:
740 status = bot_scsi_mode_sense10(udev, cbw_struct.bCBWLUN);
741 break;
742
743 case MSC_CMD_ALLOW_MEDIUM_REMOVAL:
744 status = bot_scsi_allow_medium_removal(udev, cbw_struct.bCBWLUN);
745 break;
746
747 case MSC_CMD_READ_10:
748 status = bot_scsi_read10(udev, cbw_struct.bCBWLUN);
749 break;
750
751 case MSC_CMD_READ_CAPACITY:
752 status = bot_scsi_capacity(udev, cbw_struct.bCBWLUN);
753 break;
754
755 case MSC_CMD_REQUEST_SENSE:
756 status = bot_scsi_request_sense(udev, cbw_struct.bCBWLUN);
757 break;
758
759 case MSC_CMD_TEST_UNIT:
760 status = bot_scsi_test_unit(udev, cbw_struct.bCBWLUN);
761 break;
762
763 case MSC_CMD_VERIFY:
764 status = bot_scsi_verify(udev, cbw_struct.bCBWLUN);
765 break;
766
767 case MSC_CMD_WRITE_10:
768 status = bot_scsi_write10(udev, cbw_struct.bCBWLUN);
769 break;
770
771 case MSC_CMD_READ_FORMAT_CAPACITY:
772 status = bot_scsi_format_capacity(udev, cbw_struct.bCBWLUN);
773 break;
774
775 default:
776 bot_scsi_sense_code(udev, SENSE_KEY_ILLEGAL_REQUEST, INVALID_COMMAND);
777 status = USB_FAIL;
778 break;
779 }
780 return status;
781}
782
msc_disk_write
usb_sts_type msc_disk_write(uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len)
disk write
Definition: msc/src/msc_diskio.c:106
msc_disk_read
usb_sts_type msc_disk_read(uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len)
disk read
Definition: msc/src/msc_diskio.c:75
msc_disk_capacity
usb_sts_type msc_disk_capacity(uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size)
disk capacity
Definition: msc/src/msc_diskio.c:144
get_inquiry
uint8_t * get_inquiry(uint8_t lun)
get disk inquiry
Definition: msc/src/msc_diskio.c:59
usb_flush_tx_fifo
void usb_flush_tx_fifo(otg_global_type *usbx, uint32_t fifo_num)
flush tx fifo
Definition: at32f415_usb.c:119
bot_scsi_format_capacity
usb_sts_type bot_scsi_format_capacity(void *udev, uint8_t lun)
bulk-only transport scsi command format capacity
Definition: msc_bot_scsi.c:485
msc_struct
msc_type msc_struct
Definition: msc_bot_scsi.c:42
bot_scsi_datain_handler
void bot_scsi_datain_handler(void *udev, uint8_t ept_num)
bulk-only transport data in handler
Definition: msc_bot_scsi.c:149
bot_scsi_start_stop
usb_sts_type bot_scsi_start_stop(void *udev, uint8_t lun)
bulk-only transport scsi command start stop
Definition: msc_bot_scsi.c:399
csw_struct
csw_type csw_struct
Definition: msc_bot_scsi.c:44
bot_scsi_request_sense
usb_sts_type bot_scsi_request_sense(void *udev, uint8_t lun)
bulk-only transport scsi command request sense
Definition: msc_bot_scsi.c:518
bot_scsi_read10
usb_sts_type bot_scsi_read10(void *udev, uint8_t lun)
bulk-only transport scsi command read10
Definition: msc_bot_scsi.c:573
bot_scsi_check_address
usb_sts_type bot_scsi_check_address(void *udev, uint8_t lun, uint32_t blk_offset, uint32_t blk_count)
check address
Definition: msc_bot_scsi.c:302
bot_scsi_write10
usb_sts_type bot_scsi_write10(void *udev, uint8_t lun)
bulk-only transport scsi command write10
Definition: msc_bot_scsi.c:633
bot_scsi_reset
void bot_scsi_reset(void *udev)
reset bulk-only transport and scsi
Definition: msc_bot_scsi.c:131
bot_scsi_mode_sense10
usb_sts_type bot_scsi_mode_sense10(void *udev, uint8_t lun)
bulk-only transport scsi command mode sense10
Definition: msc_bot_scsi.c:441
bot_scsi_sense_code
void bot_scsi_sense_code(void *udev, uint8_t sense_key, uint8_t asc)
send scsi sense code
Definition: msc_bot_scsi.c:287
bot_cbw_decode
void bot_cbw_decode(void *udev)
bulk-only cbw decode
Definition: msc_bot_scsi.c:198
bot_scsi_verify
usb_sts_type bot_scsi_verify(void *udev, uint8_t lun)
bulk-only transport scsi command verify
Definition: msc_bot_scsi.c:547
bot_scsi_allow_medium_removal
usb_sts_type bot_scsi_allow_medium_removal(void *udev, uint8_t lun)
bulk-only transport scsi command meidum removal
Definition: msc_bot_scsi.c:411
ALIGNED_TAIL
ALIGNED_HEAD uint8_t page00_inquiry_data[] ALIGNED_TAIL
Definition: msc_bot_scsi.c:55
bot_scsi_init
void bot_scsi_init(void *udev)
initialize bulk-only transport and scsi
Definition: msc_bot_scsi.c:113
bot_scsi_cmd_process
usb_sts_type bot_scsi_cmd_process(void *udev)
bulk-only transport scsi command process
Definition: msc_bot_scsi.c:722
bot_scsi_dataout_handler
void bot_scsi_dataout_handler(void *udev, uint8_t ept_num)
bulk-only transport data out handler
Definition: msc_bot_scsi.c:176
cbw_struct
cbw_type cbw_struct
Definition: msc_bot_scsi.c:43
bot_scsi_mode_sense6
usb_sts_type bot_scsi_mode_sense6(void *udev, uint8_t lun)
bulk-only transport scsi command mode sense6
Definition: msc_bot_scsi.c:423
bot_scsi_stall
void bot_scsi_stall(void *udev)
bot endpoint stall
Definition: msc_bot_scsi.c:317
bot_scsi_send_data
void bot_scsi_send_data(void *udev, uint8_t *buffer, uint32_t len)
send bot data
Definition: msc_bot_scsi.c:244
bot_scsi_test_unit
usb_sts_type bot_scsi_test_unit(void *udev, uint8_t lun)
bulk-only transport scsi command test unit
Definition: msc_bot_scsi.c:341
bot_scsi_inquiry
usb_sts_type bot_scsi_inquiry(void *udev, uint8_t lun)
bulk-only transport scsi command inquiry
Definition: msc_bot_scsi.c:360
bot_scsi_capacity
usb_sts_type bot_scsi_capacity(void *udev, uint8_t lun)
bulk-only transport scsi command capacity
Definition: msc_bot_scsi.c:459
bot_scsi_clear_feature
void bot_scsi_clear_feature(void *udev, uint8_t ept_num)
clear feature
Definition: msc_bot_scsi.c:702
bot_scsi_send_csw
void bot_scsi_send_csw(void *udev, uint8_t status)
send command status
Definition: msc_bot_scsi.c:264
MSC_STATE_MACHINE_DATA_IN
#define MSC_STATE_MACHINE_DATA_IN
Definition: msc_bot_scsi.h:87
MSC_CMD_START_STOP
#define MSC_CMD_START_STOP
Definition: msc_bot_scsi.h:54
MSC_CMD_VERIFY
#define MSC_CMD_VERIFY
Definition: msc_bot_scsi.h:64
ADDRESS_OUT_OF_RANGE
#define ADDRESS_OUT_OF_RANGE
Definition: msc_bot_scsi.h:119
SENSE_KEY_HARDWARE_ERROR
#define SENSE_KEY_HARDWARE_ERROR
Definition: msc_bot_scsi.h:104
MEDIUM_NOT_PRESENT
#define MEDIUM_NOT_PRESENT
Definition: msc_bot_scsi.h:120
MSC_CMD_MODE_SENSE6
#define MSC_CMD_MODE_SENSE6
Definition: msc_bot_scsi.h:55
SCSI_INQUIRY_DATA_LENGTH
#define SCSI_INQUIRY_DATA_LENGTH
Definition: msc_bot_scsi.h:123
MSC_CMD_ALLOW_MEDIUM_REMOVAL
#define MSC_CMD_ALLOW_MEDIUM_REMOVAL
Definition: msc_bot_scsi.h:57
CSW_CMD_LENGTH
#define CSW_CMD_LENGTH
Definition: msc_bot_scsi.h:80
MSC_BOT_STATE_IDLE
#define MSC_BOT_STATE_IDLE
Definition: msc_bot_scsi.h:95
MSC_MAX_DATA_BUF_LEN
#define MSC_MAX_DATA_BUF_LEN
Definition: msc_bot_scsi.h:50
CSW_DCSWSIGNATURE
#define CSW_DCSWSIGNATURE
Definition: msc_bot_scsi.h:81
MSC_CMD_INQUIRY
#define MSC_CMD_INQUIRY
Definition: msc_bot_scsi.h:53
MSC_SUPPORT_MAX_LUN
#define MSC_SUPPORT_MAX_LUN
Definition: msc_bot_scsi.h:49
INVALID_COMMAND
#define INVALID_COMMAND
Definition: msc_bot_scsi.h:115
MSC_CMD_WRITE_10
#define MSC_CMD_WRITE_10
Definition: msc_bot_scsi.h:65
MSC_STATE_MACHINE_IDLE
#define MSC_STATE_MACHINE_IDLE
Definition: msc_bot_scsi.h:93
MSC_CMD_READ_FORMAT_CAPACITY
#define MSC_CMD_READ_FORMAT_CAPACITY
Definition: msc_bot_scsi.h:61
MSC_CMD_MODE_SENSE10
#define MSC_CMD_MODE_SENSE10
Definition: msc_bot_scsi.h:56
SENSE_KEY_ILLEGAL_REQUEST
#define SENSE_KEY_ILLEGAL_REQUEST
Definition: msc_bot_scsi.h:105
MSC_STATE_MACHINE_DATA_OUT
#define MSC_STATE_MACHINE_DATA_OUT
Definition: msc_bot_scsi.h:88
CSW_BCSWSTATUS_PASS
#define CSW_BCSWSTATUS_PASS
Definition: msc_bot_scsi.h:82
INVALID_FIELED_IN_COMMAND
#define INVALID_FIELED_IN_COMMAND
Definition: msc_bot_scsi.h:116
REQ_SENSE_STANDARD_DATA_LEN
#define REQ_SENSE_STANDARD_DATA_LEN
Definition: msc_bot_scsi.h:99
MSC_STATE_MACHINE_SEND_DATA
#define MSC_STATE_MACHINE_SEND_DATA
Definition: msc_bot_scsi.h:89
CBW_DCBWSIGNATURE
#define CBW_DCBWSIGNATURE
Definition: msc_bot_scsi.h:76
MSC_CMD_READ_10
#define MSC_CMD_READ_10
Definition: msc_bot_scsi.h:58
MSC_BOT_STATE_RECOVERY
#define MSC_BOT_STATE_RECOVERY
Definition: msc_bot_scsi.h:96
CBW_CMD_LENGTH
#define CBW_CMD_LENGTH
Definition: msc_bot_scsi.h:75
MSC_STATE_MACHINE_LAST_DATA
#define MSC_STATE_MACHINE_LAST_DATA
Definition: msc_bot_scsi.h:90
MSC_CMD_TEST_UNIT
#define MSC_CMD_TEST_UNIT
Definition: msc_bot_scsi.h:63
CSW_BCSWSTATUS_FAILED
#define CSW_BCSWSTATUS_FAILED
Definition: msc_bot_scsi.h:83
MSC_CMD_READ_CAPACITY
#define MSC_CMD_READ_CAPACITY
Definition: msc_bot_scsi.h:60
MSC_BOT_STATE_ERROR
#define MSC_BOT_STATE_ERROR
Definition: msc_bot_scsi.h:97
MSC_CMD_REQUEST_SENSE
#define MSC_CMD_REQUEST_SENSE
Definition: msc_bot_scsi.h:62
USBD_MSC_BULK_IN_EPT
#define USBD_MSC_BULK_IN_EPT
Definition: msc_class.h:49
USBD_MSC_BULK_OUT_EPT
#define USBD_MSC_BULK_OUT_EPT
Definition: msc_class.h:50
MIN
#define MIN(a, b)
min and max define
Definition: usb_std.h:204
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_OK
@ USB_OK
Definition: usb_std.h:218
USB_FAIL
@ USB_FAIL
Definition: usb_std.h:219
usbd_set_stall
void usbd_set_stall(usbd_core_type *udev, uint8_t ept_addr)
usb set endpoint to stall status
Definition: usbd_core.c:257
usbd_ept_recv
void usbd_ept_recv(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint receive data
Definition: usbd_core.c:529
usbd_ept_send
void usbd_ept_send(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data
Definition: usbd_core.c:429
usbd_get_recv_len
uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length
Definition: usbd_core.c:295
msc_bot_scsi.h
usb mass storage bulk-only transport and scsi command header file
cbw_type
command block wrapper
Definition: msc_bot_scsi.h:155
cbw_type::bCBWLUN
uint8_t bCBWLUN
Definition: msc_bot_scsi.h:160
cbw_type::bCBWCBLength
uint8_t bCBWCBLength
Definition: msc_bot_scsi.h:161
cbw_type::CBWCB
uint8_t CBWCB[16]
Definition: msc_bot_scsi.h:162
cbw_type::dCBWDataTransferLength
uint32_t dCBWDataTransferLength
Definition: msc_bot_scsi.h:158
cbw_type::dCBWTage
uint32_t dCBWTage
Definition: msc_bot_scsi.h:157
cbw_type::dCBWSignature
uint32_t dCBWSignature
Definition: msc_bot_scsi.h:156
cbw_type::bmCBWFlags
uint8_t bmCBWFlags
Definition: msc_bot_scsi.h:159
csw_type
command block wrapper
Definition: msc_bot_scsi.h:169
csw_type::dCSWSignature
uint32_t dCSWSignature
Definition: msc_bot_scsi.h:170
csw_type::bCSWStatus
uint32_t bCSWStatus
Definition: msc_bot_scsi.h:173
csw_type::dCSWTag
uint32_t dCSWTag
Definition: msc_bot_scsi.h:171
csw_type::dCSWDataResidue
uint32_t dCSWDataResidue
Definition: msc_bot_scsi.h:172
msc_type
Definition: msc_bot_scsi.h:194
msc_type::data
uint8_t data[4096]
Definition: msc_bot_scsi.h:206
msc_type::blk_nbr
uint32_t blk_nbr[1]
Definition: msc_bot_scsi.h:199
msc_type::blk_size
uint32_t blk_size[1]
Definition: msc_bot_scsi.h:200
msc_type::blk_len
uint32_t blk_len
Definition: msc_bot_scsi.h:203
msc_type::blk_addr
uint32_t blk_addr
Definition: msc_bot_scsi.h:202
msc_type::max_lun
uint32_t max_lun
Definition: msc_bot_scsi.h:197
msc_type::bot_status
uint8_t bot_status
Definition: msc_bot_scsi.h:196
msc_type::msc_state
uint8_t msc_state
Definition: msc_bot_scsi.h:195
msc_type::data_len
uint32_t data_len
Definition: msc_bot_scsi.h:205
sense_type
request sense standard data
Definition: msc_bot_scsi.h:180


AT32F415 Firmwary Library: msc_bot_scsi.h Source File

  • middlewares
  • usbd_class
  • msc
msc_bot_scsi.h
Go to the documentation of this file.
1
26/* define to prevent recursive inclusion -------------------------------------*/
27#ifndef __MSC_BOT_SCSI_H
28#define __MSC_BOT_SCSI_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "msc_class.h"
35#include "usbd_core.h"
36
49#define MSC_SUPPORT_MAX_LUN 1
50#define MSC_MAX_DATA_BUF_LEN 4096
51
52#define MSC_CMD_FORMAT_UNIT 0x04
53#define MSC_CMD_INQUIRY 0x12
54#define MSC_CMD_START_STOP 0x1B
55#define MSC_CMD_MODE_SENSE6 0x1A
56#define MSC_CMD_MODE_SENSE10 0x5A
57#define MSC_CMD_ALLOW_MEDIUM_REMOVAL 0x1E
58#define MSC_CMD_READ_10 0x28
59#define MSC_CMD_READ_12 0xA8
60#define MSC_CMD_READ_CAPACITY 0x25
61#define MSC_CMD_READ_FORMAT_CAPACITY 0x23
62#define MSC_CMD_REQUEST_SENSE 0x03
63#define MSC_CMD_TEST_UNIT 0x00
64#define MSC_CMD_VERIFY 0x2F
65#define MSC_CMD_WRITE_10 0x2A
66#define MSC_CMD_WRITE_12 0xAA
67#define MSC_CMD_WRITE_VERIFY 0x2E
68
69#define MSC_REQ_GET_MAX_LUN 0xFE
70#define MSC_REQ_BO_RESET 0xFF
72#define SET_LINE_CODING 0x20
73#define GET_LINE_CODING 0x21
74
75#define CBW_CMD_LENGTH 31
76#define CBW_DCBWSIGNATURE 0x43425355
77#define CBW_BMCBWFLAGS_DIR_OUT 0x00
78#define CBW_BMCBWFLAGS_DIR_IN 0x80
79
80#define CSW_CMD_LENGTH 13
81#define CSW_DCSWSIGNATURE 0x53425355
82#define CSW_BCSWSTATUS_PASS 0x00
83#define CSW_BCSWSTATUS_FAILED 0x01
84#define CSW_BCSWSTATUS_PHASE_ERR 0x02
85
86#define MSC_STATE_MACHINE_CMD 0x00
87#define MSC_STATE_MACHINE_DATA_IN 0x01
88#define MSC_STATE_MACHINE_DATA_OUT 0x02
89#define MSC_STATE_MACHINE_SEND_DATA 0x03
90#define MSC_STATE_MACHINE_LAST_DATA 0x04
91#define MSC_STATE_MACHINE_STATUS 0x05
92#define MSC_STATE_MACHINE_FAILED 0x06
93#define MSC_STATE_MACHINE_IDLE 0x07
94
95#define MSC_BOT_STATE_IDLE 0x00
96#define MSC_BOT_STATE_RECOVERY 0x01
97#define MSC_BOT_STATE_ERROR 0x02
98
99#define REQ_SENSE_STANDARD_DATA_LEN 0x12
100#define SENSE_KEY_NO_SENSE 0x00
101#define SENSE_KEY_RECOVERED_ERROR 0x01
102#define SENSE_KEY_NOT_READY 0x02
103#define SENSE_KEY_MEDIUM_ERROR 0x03
104#define SENSE_KEY_HARDWARE_ERROR 0x04
105#define SENSE_KEY_ILLEGAL_REQUEST 0x05
106#define SENSE_KEY_UNIT_ATTENTION 0x06
107#define SENSE_KEY_DATA_PROTECT 0x07
108#define SENSE_KEY_BLANK_CHECK 0x08
109#define SENSE_KEY_VENDERO_SPECIFIC 0x09
110#define SENSE_KEY_ABORTED_COMMAND 0x0B
111#define SENSE_KEY_VOLUME_OVERFLOW 0x0D
112#define SENSE_KEY_MISCOMPARE 0x0E
113
114
115#define INVALID_COMMAND 0x20
116#define INVALID_FIELED_IN_COMMAND 0x24
117#define PARAMETER_LIST_LENGTH_ERROR 0x1A
118#define INVALID_FIELD_IN_PARAMETER_LIST 0x26
119#define ADDRESS_OUT_OF_RANGE 0x21
120#define MEDIUM_NOT_PRESENT 0x3A
121#define MEDIUM_HAVE_CHANGED 0x28
122
123#define SCSI_INQUIRY_DATA_LENGTH 36
124
128typedef struct
129{
130 uint8_t opcode;
131 uint8_t lun;
132 uint32_t address;
133 uint8_t reserved1;
134 uint32_t alloc_length;
135 uint16_t reserved2;
136}cbd_typical_type;
137
141typedef struct
142{
143 uint8_t opcode;
144 uint8_t lun;
145 uint32_t address;
146 uint8_t reserved1;
147 uint32_t alloc_length;
148 uint16_t reserved2;
149}cbd_extended_type;
150
154typedef struct
155{
156 uint32_t dCBWSignature;
157 uint32_t dCBWTage;
158 uint32_t dCBWDataTransferLength;
159 uint8_t bmCBWFlags;
160 uint8_t bCBWLUN;
161 uint8_t bCBWCBLength;
162 uint8_t CBWCB[16];
163}cbw_type;
164
168typedef struct
169{
170 uint32_t dCSWSignature;
171 uint32_t dCSWTag;
172 uint32_t dCSWDataResidue;
173 uint32_t bCSWStatus;
174}csw_type;
175
179typedef struct
180{
181 uint8_t err_code;
182 uint8_t reserved1;
183 uint8_t sense_key;
184 uint32_t information;
185 uint8_t as_length;
186 uint32_t reserved2;
187 uint8_t asc;
188 uint8_t ascq;
189 uint32_t reserved3;
190}sense_type;
191
192
193typedef struct
194{
195 uint8_t msc_state;
196 uint8_t bot_status;
197 uint32_t max_lun;
198
199 uint32_t blk_nbr[MSC_SUPPORT_MAX_LUN];
200 uint32_t blk_size[MSC_SUPPORT_MAX_LUN];
201
202 uint32_t blk_addr;
203 uint32_t blk_len;
204
205 uint32_t data_len;
206 uint8_t data[MSC_MAX_DATA_BUF_LEN];
207}msc_type;
208
209void bot_scsi_init(void *udev);
210void bot_scsi_reset(void *udev);
211void bot_scsi_datain_handler(void *pudev, uint8_t ept_num);
212void bot_scsi_dataout_handler(void *pudev, uint8_t ept_num);
213void bot_cbw_decode(void *udev);
214void bot_scsi_send_data(void *udev, uint8_t *buffer, uint32_t len);
215void bot_scsi_send_csw(void *udev, uint8_t status);
216void bot_scsi_sense_code(void *udev, uint8_t sense_key, uint8_t asc);
217 usb_sts_type bot_scsi_check_address(void *udev, uint8_t lun, uint32_t blk_offset, uint32_t blk_count);
218void bot_scsi_stall(void *udev);
219 usb_sts_type bot_scsi_cmd_process(void *udev);
220
221 usb_sts_type bot_scsi_test_unit(void *udev, uint8_t lun);
222 usb_sts_type bot_scsi_inquiry(void *udev, uint8_t lun);
223 usb_sts_type bot_scsi_start_stop(void *udev, uint8_t lun);
224 usb_sts_type bot_scsi_allow_medium_removal(void *udev, uint8_t lun);
225 usb_sts_type bot_scsi_mode_sense6(void *udev, uint8_t lun);
226 usb_sts_type bot_scsi_mode_sense10(void *udev, uint8_t lun);
227 usb_sts_type bot_scsi_read10(void *udev, uint8_t lun);
228 usb_sts_type bot_scsi_capacity(void *udev, uint8_t lun);
229 usb_sts_type bot_scsi_format_capacity(void *udev, uint8_t lun);
230 usb_sts_type bot_scsi_request_sense(void *udev, uint8_t lun);
231 usb_sts_type bot_scsi_verify(void *udev, uint8_t lun);
232 usb_sts_type bot_scsi_write10(void *udev, uint8_t lun);
233void bot_scsi_clear_feature(void *udev, uint8_t ept_num);
234
246#ifdef __cplusplus
247}
248#endif
249
250#endif
bot_scsi_format_capacity
usb_sts_type bot_scsi_format_capacity(void *udev, uint8_t lun)
bulk-only transport scsi command format capacity
Definition: msc_bot_scsi.c:485
bot_scsi_start_stop
usb_sts_type bot_scsi_start_stop(void *udev, uint8_t lun)
bulk-only transport scsi command start stop
Definition: msc_bot_scsi.c:399
bot_scsi_request_sense
usb_sts_type bot_scsi_request_sense(void *udev, uint8_t lun)
bulk-only transport scsi command request sense
Definition: msc_bot_scsi.c:518
bot_scsi_dataout_handler
void bot_scsi_dataout_handler(void *pudev, uint8_t ept_num)
bulk-only transport data out handler
Definition: msc_bot_scsi.c:176
MSC_MAX_DATA_BUF_LEN
#define MSC_MAX_DATA_BUF_LEN
Definition: msc_bot_scsi.h:50
bot_scsi_read10
usb_sts_type bot_scsi_read10(void *udev, uint8_t lun)
bulk-only transport scsi command read10
Definition: msc_bot_scsi.c:573
bot_scsi_check_address
usb_sts_type bot_scsi_check_address(void *udev, uint8_t lun, uint32_t blk_offset, uint32_t blk_count)
check address
Definition: msc_bot_scsi.c:302
MSC_SUPPORT_MAX_LUN
#define MSC_SUPPORT_MAX_LUN
Definition: msc_bot_scsi.h:49
bot_scsi_write10
usb_sts_type bot_scsi_write10(void *udev, uint8_t lun)
bulk-only transport scsi command write10
Definition: msc_bot_scsi.c:633
bot_scsi_reset
void bot_scsi_reset(void *udev)
reset bulk-only transport and scsi
Definition: msc_bot_scsi.c:131
bot_scsi_mode_sense10
usb_sts_type bot_scsi_mode_sense10(void *udev, uint8_t lun)
bulk-only transport scsi command mode sense10
Definition: msc_bot_scsi.c:441
bot_scsi_sense_code
void bot_scsi_sense_code(void *udev, uint8_t sense_key, uint8_t asc)
send scsi sense code
Definition: msc_bot_scsi.c:287
bot_cbw_decode
void bot_cbw_decode(void *udev)
bulk-only cbw decode
Definition: msc_bot_scsi.c:198
bot_scsi_verify
usb_sts_type bot_scsi_verify(void *udev, uint8_t lun)
bulk-only transport scsi command verify
Definition: msc_bot_scsi.c:547
bot_scsi_allow_medium_removal
usb_sts_type bot_scsi_allow_medium_removal(void *udev, uint8_t lun)
bulk-only transport scsi command meidum removal
Definition: msc_bot_scsi.c:411
bot_scsi_init
void bot_scsi_init(void *udev)
initialize bulk-only transport and scsi
Definition: msc_bot_scsi.c:113
bot_scsi_cmd_process
usb_sts_type bot_scsi_cmd_process(void *udev)
bulk-only transport scsi command process
Definition: msc_bot_scsi.c:722
bot_scsi_datain_handler
void bot_scsi_datain_handler(void *pudev, uint8_t ept_num)
bulk-only transport data in handler
Definition: msc_bot_scsi.c:149
bot_scsi_mode_sense6
usb_sts_type bot_scsi_mode_sense6(void *udev, uint8_t lun)
bulk-only transport scsi command mode sense6
Definition: msc_bot_scsi.c:423
bot_scsi_stall
void bot_scsi_stall(void *udev)
bot endpoint stall
Definition: msc_bot_scsi.c:317
bot_scsi_send_data
void bot_scsi_send_data(void *udev, uint8_t *buffer, uint32_t len)
send bot data
Definition: msc_bot_scsi.c:244
bot_scsi_test_unit
usb_sts_type bot_scsi_test_unit(void *udev, uint8_t lun)
bulk-only transport scsi command test unit
Definition: msc_bot_scsi.c:341
bot_scsi_inquiry
usb_sts_type bot_scsi_inquiry(void *udev, uint8_t lun)
bulk-only transport scsi command inquiry
Definition: msc_bot_scsi.c:360
bot_scsi_capacity
usb_sts_type bot_scsi_capacity(void *udev, uint8_t lun)
bulk-only transport scsi command capacity
Definition: msc_bot_scsi.c:459
bot_scsi_clear_feature
void bot_scsi_clear_feature(void *udev, uint8_t ept_num)
clear feature
Definition: msc_bot_scsi.c:702
bot_scsi_send_csw
void bot_scsi_send_csw(void *udev, uint8_t status)
send command status
Definition: msc_bot_scsi.c:264
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
msc_class.h
usb msc class file
cbd_extended_type
extended command block description
Definition: msc_bot_scsi.h:142
cbd_extended_type::alloc_length
uint32_t alloc_length
Definition: msc_bot_scsi.h:147
cbd_extended_type::opcode
uint8_t opcode
Definition: msc_bot_scsi.h:143
cbd_extended_type::address
uint32_t address
Definition: msc_bot_scsi.h:145
cbd_extended_type::reserved1
uint8_t reserved1
Definition: msc_bot_scsi.h:146
cbd_extended_type::reserved2
uint16_t reserved2
Definition: msc_bot_scsi.h:148
cbd_extended_type::lun
uint8_t lun
Definition: msc_bot_scsi.h:144
cbd_typical_type
typical command block description
Definition: msc_bot_scsi.h:129
cbd_typical_type::opcode
uint8_t opcode
Definition: msc_bot_scsi.h:130
cbd_typical_type::address
uint32_t address
Definition: msc_bot_scsi.h:132
cbd_typical_type::alloc_length
uint32_t alloc_length
Definition: msc_bot_scsi.h:134
cbd_typical_type::reserved1
uint8_t reserved1
Definition: msc_bot_scsi.h:133
cbd_typical_type::lun
uint8_t lun
Definition: msc_bot_scsi.h:131
cbd_typical_type::reserved2
uint16_t reserved2
Definition: msc_bot_scsi.h:135
cbw_type
command block wrapper
Definition: msc_bot_scsi.h:155
cbw_type::bCBWLUN
uint8_t bCBWLUN
Definition: msc_bot_scsi.h:160
cbw_type::bCBWCBLength
uint8_t bCBWCBLength
Definition: msc_bot_scsi.h:161
cbw_type::dCBWDataTransferLength
uint32_t dCBWDataTransferLength
Definition: msc_bot_scsi.h:158
cbw_type::dCBWTage
uint32_t dCBWTage
Definition: msc_bot_scsi.h:157
cbw_type::dCBWSignature
uint32_t dCBWSignature
Definition: msc_bot_scsi.h:156
cbw_type::bmCBWFlags
uint8_t bmCBWFlags
Definition: msc_bot_scsi.h:159
csw_type
command block wrapper
Definition: msc_bot_scsi.h:169
csw_type::dCSWSignature
uint32_t dCSWSignature
Definition: msc_bot_scsi.h:170
csw_type::bCSWStatus
uint32_t bCSWStatus
Definition: msc_bot_scsi.h:173
csw_type::dCSWTag
uint32_t dCSWTag
Definition: msc_bot_scsi.h:171
csw_type::dCSWDataResidue
uint32_t dCSWDataResidue
Definition: msc_bot_scsi.h:172
msc_type
Definition: msc_bot_scsi.h:194
msc_type::blk_len
uint32_t blk_len
Definition: msc_bot_scsi.h:203
msc_type::blk_addr
uint32_t blk_addr
Definition: msc_bot_scsi.h:202
msc_type::max_lun
uint32_t max_lun
Definition: msc_bot_scsi.h:197
msc_type::bot_status
uint8_t bot_status
Definition: msc_bot_scsi.h:196
msc_type::msc_state
uint8_t msc_state
Definition: msc_bot_scsi.h:195
msc_type::data_len
uint32_t data_len
Definition: msc_bot_scsi.h:205
sense_type
request sense standard data
Definition: msc_bot_scsi.h:180
sense_type::err_code
uint8_t err_code
Definition: msc_bot_scsi.h:181
sense_type::ascq
uint8_t ascq
Definition: msc_bot_scsi.h:188
sense_type::reserved3
uint32_t reserved3
Definition: msc_bot_scsi.h:189
sense_type::asc
uint8_t asc
Definition: msc_bot_scsi.h:187
sense_type::as_length
uint8_t as_length
Definition: msc_bot_scsi.h:185
sense_type::reserved2
uint32_t reserved2
Definition: msc_bot_scsi.h:186
sense_type::sense_key
uint8_t sense_key
Definition: msc_bot_scsi.h:183
sense_type::reserved1
uint8_t reserved1
Definition: msc_bot_scsi.h:182
sense_type::information
uint32_t information
Definition: msc_bot_scsi.h:184
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: msc_class.c Source File

  • middlewares
  • usbd_class
  • msc
msc_class.c
Go to the documentation of this file.
1
26#include "usbd_core.h"
27#include "msc_class.h"
28#include "msc_desc.h"
29#include "msc_bot_scsi.h"
30
44 usb_sts_type class_init_handler(void *udev);
45 usb_sts_type class_clear_handler(void *udev);
46 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup);
47 usb_sts_type class_ept0_tx_handler(void *udev);
48 usb_sts_type class_ept0_rx_handler(void *udev);
49 usb_sts_type class_in_handler(void *udev, uint8_t ept_num);
50 usb_sts_type class_out_handler(void *udev, uint8_t ept_num);
51 usb_sts_type class_sof_handler(void *udev);
52 usb_sts_type class_event_handler(void *udev, usbd_event_type event);
53
54/* usb rx and tx buffer */
55static uint32_t alt_setting = 0;
56
57extern msc_type msc_struct;
58extern cbw_type cbw_struct;
59extern csw_type csw_struct;
60
61/* usb device class handler */
62usbd_class_handler msc_class_handler =
63{
64 class_init_handler,
65 class_clear_handler,
66 class_setup_handler,
67 class_ept0_tx_handler,
68 class_ept0_rx_handler,
69 class_in_handler,
70 class_out_handler,
71 class_sof_handler,
72 class_event_handler,
73};
74
80 usb_sts_type class_init_handler(void *udev)
81{
82 usb_sts_type status = USB_OK;
83 usbd_core_type *pudev = (usbd_core_type *)udev;
84
85 /* open in endpoint */
86 usbd_ept_open(pudev, USBD_MSC_BULK_IN_EPT, EPT_BULK_TYPE, USBD_OUT_MAXPACKET_SIZE);
87
88 /* open out endpoint */
89 usbd_ept_open(pudev, USBD_MSC_BULK_OUT_EPT, EPT_BULK_TYPE, USBD_OUT_MAXPACKET_SIZE);
90
91 bot_scsi_init(udev);
92
93 return status;
94}
95
101 usb_sts_type class_clear_handler(void *udev)
102{
103 usb_sts_type status = USB_OK;
104 usbd_core_type *pudev = (usbd_core_type *)udev;
105
106 /* close in endpoint */
107 usbd_ept_close(pudev, USBD_MSC_BULK_IN_EPT);
108
109 /* close out endpoint */
110 usbd_ept_close(pudev, USBD_MSC_BULK_OUT_EPT);
111
112 return status;
113}
114
121 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
122{
123 usb_sts_type status = USB_OK;
124 usbd_core_type *pudev = (usbd_core_type *)udev;
125 switch(setup->bmRequestType & USB_REQ_TYPE_RESERVED)
126 {
127 /* class request */
128 case USB_REQ_TYPE_CLASS:
129
130 switch(setup->bRequest)
131 {
132 case MSC_REQ_GET_MAX_LUN:
133 usbd_ctrl_send(pudev, (uint8_t *)&msc_struct.max_lun, 1);
134 break;
135 case MSC_REQ_BO_RESET:
136 bot_scsi_reset(udev);
137 usbd_ctrl_send_status(pudev);
138 break;
139 default:
140 usbd_ctrl_unsupport(pudev);
141 break;
142
143 }
144 break;
145 /* standard request */
146 case USB_REQ_TYPE_STANDARD:
147
148 switch(setup->bRequest)
149 {
150 case USB_STD_REQ_GET_DESCRIPTOR:
151 usbd_ctrl_unsupport(pudev);
152 break;
153 case USB_STD_REQ_GET_INTERFACE:
154 usbd_ctrl_send(pudev, (uint8_t *)&alt_setting, 1);
155 break;
156 case USB_STD_REQ_SET_INTERFACE:
157 alt_setting = setup->wValue;
158 break;
159 case USB_STD_REQ_CLEAR_FEATURE:
160 usbd_ept_close(pudev, (uint8_t)setup->wIndex);
161
162 if((setup->wIndex & 0x80) == 0x80)
163 {
164 usb_flush_tx_fifo(pudev->usb_reg, setup->wIndex & 0x7F);
165 usbd_ept_open(pudev, (uint8_t)setup->wIndex, EPT_BULK_TYPE, USBD_IN_MAXPACKET_SIZE);
166 }
167 else
168 {
169 usbd_ept_open(pudev, (uint8_t)setup->wIndex, EPT_BULK_TYPE, USBD_OUT_MAXPACKET_SIZE);
170 }
171 bot_scsi_clear_feature(udev, setup->wIndex);
172 break;
173 default:
174 break;
175 }
176 break;
177 default:
178 usbd_ctrl_unsupport(pudev);
179 break;
180 }
181 return status;
182}
183
189 usb_sts_type class_ept0_tx_handler(void *udev)
190{
191 usb_sts_type status = USB_OK;
192
193 /* ...user code... */
194
195 return status;
196}
197
203 usb_sts_type class_ept0_rx_handler(void *udev)
204{
205 usb_sts_type status = USB_OK;
206 usbd_core_type *pudev = (usbd_core_type *)udev;
207 uint32_t recv_len = usbd_get_recv_len(pudev, 0);
208 /* ...user code... */
209 return status;
210}
211
218 usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
219{
220 usb_sts_type status = USB_OK;
221 usbd_core_type *pudev = (usbd_core_type *)udev;
222 usb_flush_tx_fifo(pudev->usb_reg, ept_num&0x7F);
223 bot_scsi_datain_handler(udev, ept_num);
224 return status;
225}
226
233 usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
234{
235 usb_sts_type status = USB_OK;
236 bot_scsi_dataout_handler(udev, ept_num);
237 return status;
238}
239
245 usb_sts_type class_sof_handler(void *udev)
246{
247 usb_sts_type status = USB_OK;
248
249 /* ...user code... */
250
251 return status;
252}
253
260 usb_sts_type class_event_handler(void *udev, usbd_event_type event)
261{
262 usb_sts_type status = USB_OK;
263 switch(event)
264 {
265 case USBD_RESET_EVENT:
266
267 /* ...user code... */
268
269 break;
270 case USBD_SUSPEND_EVENT:
271
272 /* ...user code... */
273
274 break;
275 case USBD_WAKEUP_EVENT:
276 /* ...user code... */
277
278 break;
279
280 default:
281 break;
282 }
283 return status;
284}
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
EPT_BULK_TYPE
@ EPT_BULK_TYPE
Definition: at32f415_usb.h:348
usb_flush_tx_fifo
void usb_flush_tx_fifo(otg_global_type *usbx, uint32_t fifo_num)
flush tx fifo
Definition: at32f415_usb.c:119
bot_scsi_datain_handler
void bot_scsi_datain_handler(void *udev, uint8_t ept_num)
bulk-only transport data in handler
Definition: msc_bot_scsi.c:149
bot_scsi_reset
void bot_scsi_reset(void *udev)
reset bulk-only transport and scsi
Definition: msc_bot_scsi.c:131
bot_scsi_init
void bot_scsi_init(void *udev)
initialize bulk-only transport and scsi
Definition: msc_bot_scsi.c:113
bot_scsi_dataout_handler
void bot_scsi_dataout_handler(void *udev, uint8_t ept_num)
bulk-only transport data out handler
Definition: msc_bot_scsi.c:176
bot_scsi_clear_feature
void bot_scsi_clear_feature(void *udev, uint8_t ept_num)
clear feature
Definition: msc_bot_scsi.c:702
MSC_REQ_BO_RESET
#define MSC_REQ_BO_RESET
Definition: msc_bot_scsi.h:70
MSC_REQ_GET_MAX_LUN
#define MSC_REQ_GET_MAX_LUN
Definition: msc_bot_scsi.h:69
USBD_MSC_BULK_IN_EPT
#define USBD_MSC_BULK_IN_EPT
Definition: msc_class.h:49
USBD_MSC_BULK_OUT_EPT
#define USBD_MSC_BULK_OUT_EPT
Definition: msc_class.h:50
msc_struct
msc_type msc_struct
Definition: msc_bot_scsi.c:42
csw_struct
csw_type csw_struct
Definition: msc_bot_scsi.c:44
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: msc_class.c:260
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: msc_class.c:245
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: msc_class.c:121
alt_setting
static uint32_t alt_setting
Definition: msc_class.c:55
msc_class_handler
usbd_class_handler msc_class_handler
Definition: msc_class.c:62
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: msc_class.c:189
cbw_struct
cbw_type cbw_struct
Definition: msc_bot_scsi.c:43
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: msc_class.c:218
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb endpoint
Definition: msc_class.c:80
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: msc_class.c:203
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: msc_class.c:233
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: msc_class.c:101
USB_STD_REQ_CLEAR_FEATURE
#define USB_STD_REQ_CLEAR_FEATURE
Definition: usb_std.h:78
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
USB_STD_REQ_GET_DESCRIPTOR
#define USB_STD_REQ_GET_DESCRIPTOR
Definition: usb_std.h:81
USB_STD_REQ_SET_INTERFACE
#define USB_STD_REQ_SET_INTERFACE
Definition: usb_std.h:86
USB_REQ_TYPE_RESERVED
#define USB_REQ_TYPE_RESERVED
Definition: usb_std.h:66
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_STD_REQ_GET_INTERFACE
#define USB_STD_REQ_GET_INTERFACE
Definition: usb_std.h:85
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usb_std.h:64
USB_OK
@ USB_OK
Definition: usb_std.h:218
usbd_ept_close
void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint
Definition: usbd_core.c:341
usbd_ctrl_send_status
void usbd_ctrl_send_status(usbd_core_type *udev)
usb control endpoint send in status
Definition: usbd_core.c:207
usbd_ept_open
void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint
Definition: usbd_core.c:309
usbd_ctrl_send
void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data
Definition: usbd_core.c:174
usbd_get_recv_len
uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length
Definition: usbd_core.c:295
usbd_ctrl_unsupport
void usbd_ctrl_unsupport(usbd_core_type *udev)
un-support device request
Definition: usbd_core.c:282
msc_bot_scsi.h
usb mass storage bulk-only transport and scsi command header file
msc_class.h
usb msc class file
msc_desc.h
usb msc descriptor header file
cbw_type
command block wrapper
Definition: msc_bot_scsi.h:155
csw_type
command block wrapper
Definition: msc_bot_scsi.h:169
msc_type
Definition: msc_bot_scsi.h:194
msc_type::max_lun
uint32_t max_lun
Definition: msc_bot_scsi.h:197
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_setup_type::wValue
uint16_t wValue
Definition: usb_std.h:233
usb_setup_type::bmRequestType
uint8_t bmRequestType
Definition: usb_std.h:231
usb_setup_type::wIndex
uint16_t wIndex
Definition: usb_std.h:234
usb_setup_type::bRequest
uint8_t bRequest
Definition: usb_std.h:232
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: msc_class.h Source File

  • middlewares
  • usbd_class
  • msc
msc_class.h
Go to the documentation of this file.
1
26 /* define to prevent recursive inclusion -------------------------------------*/
27#ifndef __MSC_CLASS_H
28#define __MSC_CLASS_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "usb_std.h"
35#include "usbd_core.h"
36
49#define USBD_MSC_BULK_IN_EPT 0x81
50#define USBD_MSC_BULK_OUT_EPT 0x01
51
52#define USBD_IN_MAXPACKET_SIZE 0x40
53#define USBD_OUT_MAXPACKET_SIZE 0x40
54
55
56extern usbd_class_handler msc_class_handler;
68#ifdef __cplusplus
69}
70#endif
71
72#endif
msc_class_handler
usbd_class_handler msc_class_handler
Definition: msc_class.c:62
usb_std.h
usb standard header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: msc_desc.c Source File

  • middlewares
  • usbd_class
  • msc
msc_desc.c
Go to the documentation of this file.
1
26#include "stdio.h"
27#include "usb_std.h"
28#include "usbd_sdr.h"
29#include "usbd_core.h"
30#include "msc_desc.h"
31
45usbd_desc_t *get_device_descriptor(void);
46usbd_desc_t *get_device_qualifier(void);
47usbd_desc_t *get_device_configuration(void);
48usbd_desc_t *get_device_other_speed(void);
49usbd_desc_t *get_device_lang_id(void);
50usbd_desc_t *get_device_manufacturer_string(void);
51usbd_desc_t *get_device_product_string(void);
52usbd_desc_t *get_device_serial_string(void);
53usbd_desc_t *get_device_interface_string(void);
54usbd_desc_t *get_device_config_string(void);
55
56uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf);
57static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len);
58static void get_serial_num(void);
59static uint8_t g_usbd_desc_buffer[256];
60
64usbd_desc_handler msc_desc_handler =
65{
66 get_device_descriptor,
67 get_device_qualifier,
68 get_device_configuration,
69 get_device_other_speed,
70 get_device_lang_id,
71 get_device_manufacturer_string,
72 get_device_product_string,
73 get_device_serial_string,
74 get_device_interface_string,
75 get_device_config_string,
76};
77
81#if defined ( __ICCARM__ ) /* iar compiler */
82 #pragma data_alignment=4
83#endif
84ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL =
85{
86 USB_DEVICE_DESC_LEN, /* bLength */
87 USB_DESCIPTOR_TYPE_DEVICE, /* bDescriptorType */
88 0x00, /* bcdUSB */
89 0x02,
90 0x00, /* bDeviceClass */
91 0x00, /* bDeviceSubClass */
92 0x00, /* bDeviceProtocol */
93 USB_MAX_EP0_SIZE, /* bMaxPacketSize */
94 LBYTE(USBD_VENDOR_ID), /* idVendor */
95 HBYTE(USBD_VENDOR_ID), /* idVendor */
96 LBYTE(USBD_PRODUCT_ID), /* idProduct */
97 HBYTE(USBD_PRODUCT_ID), /* idProduct */
98 0x00, /* bcdDevice rel. 2.00 */
99 0x02,
100 USB_MFC_STRING, /* Index of manufacturer string */
101 USB_PRODUCT_STRING, /* Index of product string */
102 USB_SERIAL_STRING, /* Index of serial number string */
103 1 /* bNumConfigurations */
104};
105
109#if defined ( __ICCARM__ ) /* iar compiler */
110 #pragma data_alignment=4
111#endif
112ALIGNED_HEAD uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE] ALIGNED_TAIL =
113{
114 USB_DEVICE_CFG_DESC_LEN, /* bLength: configuration descriptor size */
115 USB_DESCIPTOR_TYPE_CONFIGURATION, /* bDescriptorType: configuration */
116 LBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
117 HBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
118 0x01, /* bNumInterfaces: 2 interface */
119 0x01, /* bConfigurationValue: configuration value */
120 0x04, /* iConfiguration: index of string descriptor describing
121 the configuration */
122 0xC0, /* bmAttributes: self powered */
123 0x32, /* MaxPower 100 mA: this current is used for detecting vbus */
124
125 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
126 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
127 0x00, /* bInterfaceNumber: number of interface */
128 0x00, /* bAlternateSetting: alternate set */
129 0x02, /* bNumEndpoints: number of endpoints */
130 USB_CLASS_CODE_MSC, /* bInterfaceClass: msc class code */
131 0x06, /* bInterfaceSubClass: subclass code scsi */
132 0x50, /* bInterfaceProtocol: protocol code BBB */
133 0x05, /* iInterface: index of string descriptor */
134
135 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
136 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
137 USBD_MSC_BULK_IN_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
138 USB_EPT_DESC_BULK, /* bmAttributes: endpoint attributes */
139 LBYTE(USBD_IN_MAXPACKET_SIZE),
140 HBYTE(USBD_IN_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
141 0x00, /* bInterval: interval for polling endpoint for data transfers */
142
143 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
144 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
145 USBD_MSC_BULK_OUT_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
146 USB_EPT_DESC_BULK, /* bmAttributes: endpoint attributes */
147 LBYTE(USBD_OUT_MAXPACKET_SIZE),
148 HBYTE(USBD_OUT_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
149 0x00, /* bInterval: interval for polling endpoint for data transfers */
150};
151
155#if defined ( __ICCARM__ ) /* iar compiler */
156 #pragma data_alignment=4
157#endif
158ALIGNED_HEAD uint8_t g_string_lang_id[USBD_SIZ_STRING_LANGID] ALIGNED_TAIL =
159{
160 USBD_SIZ_STRING_LANGID,
161 USB_DESCIPTOR_TYPE_STRING,
162 0x09,
163 0x04,
164};
165
169#if defined ( __ICCARM__ ) /* iar compiler */
170 #pragma data_alignment=4
171#endif
172ALIGNED_HEAD uint8_t g_string_serial[USBD_SIZ_STRING_SERIAL] ALIGNED_TAIL =
173{
174 USBD_SIZ_STRING_SERIAL,
175 USB_DESCIPTOR_TYPE_STRING,
176};
177
178
179/* device descriptor */
180usbd_desc_t device_descriptor =
181{
182 USB_DEVICE_DESC_LEN,
183 g_usbd_descriptor
184};
185
186/* config descriptor */
187usbd_desc_t config_descriptor =
188{
189 USBD_CONFIG_DESC_SIZE,
190 g_usbd_configuration
191};
192
193/* langid descriptor */
194usbd_desc_t langid_descriptor =
195{
196 USBD_SIZ_STRING_LANGID,
197 g_string_lang_id
198};
199
200/* serial descriptor */
201usbd_desc_t serial_descriptor =
202{
203 USBD_SIZ_STRING_SERIAL,
204 g_string_serial
205};
206
207usbd_desc_t vp_desc;
208
215uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
216{
217 uint16_t str_len = 0, id_pos = 2;
218 uint8_t *tmp_str = string;
219
220 while(*tmp_str != '\0')
221 {
222 str_len ++;
223 unicode_buf[id_pos ++] = *tmp_str ++;
224 unicode_buf[id_pos ++] = 0x00;
225 }
226
227 str_len = str_len * 2 + 2;
228 unicode_buf[0] = (uint8_t)str_len;
229 unicode_buf[1] = USB_DESCIPTOR_TYPE_STRING;
230
231 return str_len;
232}
233
241static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len)
242{
243 uint8_t idx = 0;
244
245 for( idx = 0 ; idx < len ; idx ++)
246 {
247 if( ((value >> 28)) < 0xA )
248 {
249 pbuf[ 2 * idx] = (value >> 28) + '0';
250 }
251 else
252 {
253 pbuf[2 * idx] = (value >> 28) + 'A' - 10;
254 }
255
256 value = value << 4;
257
258 pbuf[2 * idx + 1] = 0;
259 }
260}
261
267static void get_serial_num(void)
268{
269 uint32_t serial0, serial1, serial2;
270
271 serial0 = *(uint32_t*)MCU_ID1;
272 serial1 = *(uint32_t*)MCU_ID2;
273 serial2 = *(uint32_t*)MCU_ID3;
274
275 serial0 += serial2;
276
277 if (serial0 != 0)
278 {
279 usbd_int_to_unicode (serial0, &g_string_serial[2] ,8);
280 usbd_int_to_unicode (serial1, &g_string_serial[18] ,4);
281 }
282}
283
289usbd_desc_t *get_device_descriptor(void)
290{
291 return &device_descriptor;
292}
293
299usbd_desc_t * get_device_qualifier(void)
300{
301 return NULL;
302}
303
309usbd_desc_t *get_device_configuration(void)
310{
311 return &config_descriptor;
312}
313
319usbd_desc_t *get_device_other_speed(void)
320{
321 return NULL;
322}
323
329usbd_desc_t *get_device_lang_id(void)
330{
331 return &langid_descriptor;
332}
333
334
340usbd_desc_t *get_device_manufacturer_string(void)
341{
342 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_MANUFACTURER_STRING, g_usbd_desc_buffer);
343 vp_desc.descriptor = g_usbd_desc_buffer;
344 return &vp_desc;
345}
346
352usbd_desc_t *get_device_product_string(void)
353{
354 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_PRODUCT_STRING, g_usbd_desc_buffer);
355 vp_desc.descriptor = g_usbd_desc_buffer;
356 return &vp_desc;
357}
358
364usbd_desc_t *get_device_serial_string(void)
365{
366 get_serial_num();
367 return &serial_descriptor;
368}
369
375usbd_desc_t *get_device_interface_string(void)
376{
377 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_INTERFACE_STRING, g_usbd_desc_buffer);
378 vp_desc.descriptor = g_usbd_desc_buffer;
379 return &vp_desc;
380}
381
387usbd_desc_t *get_device_config_string(void)
388{
389 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_CONFIGURATION_STRING, g_usbd_desc_buffer);
390 vp_desc.descriptor = g_usbd_desc_buffer;
391 return &vp_desc;
392}
393
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
USBD_DESC_CONFIGURATION_STRING
#define USBD_DESC_CONFIGURATION_STRING
Definition: audio_desc.h:61
USBD_SIZ_STRING_SERIAL
#define USBD_SIZ_STRING_SERIAL
Definition: audio_desc.h:57
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112
USBD_DESC_PRODUCT_STRING
#define USBD_DESC_PRODUCT_STRING
Definition: audio_desc.h:60
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: audio_desc.h:208
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
USBD_SIZ_STRING_LANGID
#define USBD_SIZ_STRING_LANGID
Definition: audio_desc.h:56
MCU_ID1
#define MCU_ID1
Definition: audio_desc.h:215
USBD_DESC_MANUFACTURER_STRING
#define USBD_DESC_MANUFACTURER_STRING
Definition: audio_desc.h:59
USBD_PRODUCT_ID
#define USBD_PRODUCT_ID
Definition: audio_desc.h:54
USBD_DESC_INTERFACE_STRING
#define USBD_DESC_INTERFACE_STRING
Definition: audio_desc.h:62
MCU_ID2
#define MCU_ID2
Definition: audio_desc.h:216
USBD_VENDOR_ID
#define USBD_VENDOR_ID
Definition: audio_desc.h:53
MCU_ID3
#define MCU_ID3
Definition: audio_desc.h:217
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
USBD_MSC_BULK_IN_EPT
#define USBD_MSC_BULK_IN_EPT
Definition: msc_class.h:49
USBD_MSC_BULK_OUT_EPT
#define USBD_MSC_BULK_OUT_EPT
Definition: msc_class.h:50
serial_descriptor
usbd_desc_t serial_descriptor
Definition: msc_desc.c:201
device_descriptor
usbd_desc_t device_descriptor
Definition: msc_desc.c:180
usbd_unicode_convert
uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert
Definition: msc_desc.c:215
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: msc_desc.c:340
langid_descriptor
usbd_desc_t langid_descriptor
Definition: msc_desc.c:194
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: msc_desc.c:299
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: msc_desc.c:375
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: msc_desc.c:319
g_usbd_desc_buffer
static uint8_t g_usbd_desc_buffer[256]
Definition: msc_desc.c:59
vp_desc
usbd_desc_t vp_desc
Definition: msc_desc.c:207
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: msc_desc.c:309
ALIGNED_TAIL
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL
usb device standard descriptor
Definition: msc_desc.c:84
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: msc_desc.c:352
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: msc_desc.c:329
get_serial_num
static void get_serial_num(void)
usb get serial number
Definition: msc_desc.c:267
config_descriptor
usbd_desc_t config_descriptor
Definition: msc_desc.c:187
msc_desc_handler
usbd_desc_handler msc_desc_handler
device descriptor handler structure
Definition: msc_desc.c:64
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: msc_desc.c:289
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: msc_desc.c:364
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: msc_desc.c:387
usbd_int_to_unicode
static void usbd_int_to_unicode(uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode
Definition: msc_desc.c:241
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_DEVICE_EPT_LEN
#define USB_DEVICE_EPT_LEN
Definition: usb_std.h:153
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
USB_DESCIPTOR_TYPE_CONFIGURATION
#define USB_DESCIPTOR_TYPE_CONFIGURATION
Definition: usb_std.h:93
USB_CLASS_CODE_MSC
#define USB_CLASS_CODE_MSC
Definition: usb_std.h:165
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DESCIPTOR_TYPE_ENDPOINT
#define USB_DESCIPTOR_TYPE_ENDPOINT
Definition: usb_std.h:96
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_EPT_DESC_BULK
#define USB_EPT_DESC_BULK
Definition: usb_std.h:177
USB_DEVICE_IF_DESC_LEN
#define USB_DEVICE_IF_DESC_LEN
Definition: usb_std.h:152
USB_DEVICE_CFG_DESC_LEN
#define USB_DEVICE_CFG_DESC_LEN
Definition: usb_std.h:151
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92
USB_DESCIPTOR_TYPE_STRING
#define USB_DESCIPTOR_TYPE_STRING
Definition: usb_std.h:94
USB_DESCIPTOR_TYPE_INTERFACE
#define USB_DESCIPTOR_TYPE_INTERFACE
Definition: usb_std.h:95
msc_desc.h
usb msc descriptor header file
usb_std.h
usb standard header file
usbd_core.h
usb device core header file
usbd_sdr.h


AT32F415 Firmwary Library: msc_desc.h Source File

  • middlewares
  • usbd_class
  • msc
msc_desc.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __MSC_DESC_H
29#define __MSC_DESC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "msc_class.h"
36#include "usbd_core.h"
37
50#define BCD_NUM 0x0110
51
52#define USBD_VENDOR_ID 0x2E3C
53#define USBD_PRODUCT_ID 0x5720
54
55#define USBD_CONFIG_DESC_SIZE 32
56#define USBD_SIZ_STRING_LANGID 4
57#define USBD_SIZ_STRING_SERIAL 0x1A
58
59#define USBD_DESC_MANUFACTURER_STRING "Artery"
60#define USBD_DESC_PRODUCT_STRING "AT32 Mass Storage"
61#define USBD_DESC_CONFIGURATION_STRING "Mass Storage Config"
62#define USBD_DESC_INTERFACE_STRING "Mass Storage Interface"
63
64#define HID_BINTERVAL_TIME 0xFF
65
66#define USBD_CDC_CS_INTERFACE 0x24
67#define USBD_CDC_CS_ENDPOINT 0x25
68
69#define USBD_CDC_SUBTYPE_HEADER 0x00
70#define USBD_CDC_SUBTYPE_CMF 0x01
71#define USBD_CDC_SUBTYPE_ACM 0x02
72#define USBD_CDC_SUBTYPE_UFD 0x06
73
74
75#define MCU_ID1 (0x1FFFF7E8)
76#define MCU_ID2 (0x1FFFF7EC)
77#define MCU_ID3 (0x1FFFF7F0)
78
79extern uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN];
80extern uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE];
81extern usbd_desc_handler msc_desc_handler;
82
94#ifdef __cplusplus
95}
96#endif
97
98#endif
g_usbd_configuration
uint8_t g_usbd_configuration[32]
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: msc_desc.h:55
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
msc_desc_handler
usbd_desc_handler msc_desc_handler
device descriptor handler structure
Definition: msc_desc.c:64
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
msc_class.h
usb msc class file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: usbh_user.h Source File

  • usb_host
  • msc_only_fat32
  • inc
msc_only_fat32/inc/usbh_user.h
Go to the documentation of this file.
1
26/* define to prevent recursive inclusion -------------------------------------*/
27#ifndef __USBH_USER_H
28#define __USBH_USER_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "usbh_core.h"
35
36extern usbh_user_handler_type usbh_user_handle;
37#ifdef __cplusplus
38}
39#endif
40
41#endif
42
43
usbh_user_handle
usbh_user_handler_type usbh_user_handle
Definition: hid_demo/src/usbh_user.c:50
usbh_core.h
usb host core header file


AT32F415 Firmwary Library: usbh_user.c Source File

  • usb_host
  • msc_only_fat32
  • src
msc_only_fat32/src/usbh_user.c
Go to the documentation of this file.
1
26#include "usbh_user.h"
27#include "ff.h"
28
37static usb_sts_type usbh_user_init(void);
38static usb_sts_type usbh_user_reset(void);
39static usb_sts_type usbh_user_attached(void);
40static usb_sts_type usbh_user_disconnect(void);
41static usb_sts_type usbh_user_speed(uint8_t speed);
42static usb_sts_type usbh_user_mfc_string(void *string);
43static usb_sts_type usbh_user_product_string(void *string);
44static usb_sts_type usbh_user_serial_string(void *string);
45static usb_sts_type usbh_user_enumeration_done(void);
46static usb_sts_type usbh_user_application(void);
47static usb_sts_type usbh_user_active_vbus(void *uhost, confirm_state state);
48static usb_sts_type usbh_user_not_support(void);
49
50
51usbh_user_handler_type usbh_user_handle =
52{
53 usbh_user_init,
54 usbh_user_reset,
55 usbh_user_attached,
56 usbh_user_disconnect,
57 usbh_user_speed,
58 usbh_user_mfc_string,
59 usbh_user_product_string,
60 usbh_user_serial_string,
61 usbh_user_enumeration_done,
62 usbh_user_application,
63 usbh_user_active_vbus,
64 usbh_user_not_support,
65};
66
72static usb_sts_type usbh_user_init(void)
73{
74 usb_sts_type status = USB_OK;
75
76 return status;
77}
78
84static usb_sts_type usbh_user_reset(void)
85{
86 usb_sts_type status = USB_OK;
87
88 return status;
89}
90
96static usb_sts_type usbh_user_attached(void)
97{
98 usb_sts_type status = USB_OK;
99 USBH_DEBUG("USB Device Attached");
100 return status;
101}
102
108static usb_sts_type usbh_user_disconnect(void)
109{
110 usb_sts_type status = USB_OK;
111 USBH_DEBUG("Device Disconnect");
112 return status;
113}
114
120static usb_sts_type usbh_user_speed(uint8_t speed)
121{
122 usb_sts_type status = USB_OK;
123 if(speed == USB_PRTSPD_FULL_SPEED)
124 {
125 USBH_DEBUG("This is a Full-Speed device");
126 }
127 else if(speed == USB_PRTSPD_LOW_SPEED)
128 {
129 USBH_DEBUG("This is a Low-Speed device");
130 }
131 return status;
132}
133
139static usb_sts_type usbh_user_mfc_string(void *string)
140{
141 usb_sts_type status = USB_OK;
142 USBH_DEBUG("Manufacturer: %s", (uint8_t *)string);
143 return status;
144}
145
151static usb_sts_type usbh_user_product_string(void *string)
152{
153 usb_sts_type status = USB_OK;
154 USBH_DEBUG("Product: %s", (uint8_t *)string);
155 return status;
156}
157
163static usb_sts_type usbh_user_serial_string(void *string)
164{
165 usb_sts_type status = USB_OK;
166 USBH_DEBUG("Serial: %s", (uint8_t *)string);
167 return status;
168}
169
175static usb_sts_type usbh_user_enumeration_done(void)
176{
177 usb_sts_type status = USB_OK;
178 USBH_DEBUG("Enumeration done");
179 return status;
180}
181
187FIL file;
188FATFS fs;
189static usb_sts_type usbh_user_application(void)
190{
191 usb_sts_type status = USB_OK;
192 FRESULT res;
193
194 uint32_t len;
195 uint8_t write_data[] = "usb host msc demo";
196 uint8_t read_data[32] = {0};
197// return 0;
198 res = f_mount(&fs, "", 0);
199 if(res == FR_OK)
200 {
201 /* start write data */
202 if(f_open(&file, "0:AT32.txt", FA_CREATE_ALWAYS | FA_WRITE) != FR_OK)
203 {
204 // error
205 USBH_DEBUG("Open AT32.txt failed");
206 }
207 else
208 {
209 res = f_write(&file, write_data, sizeof(write_data), &len);
210 if(res != FR_OK || len == 0)
211 {
212 //write error
213 USBH_DEBUG("Write AT32.txt failed");
214 }
215 else
216 {
217 //write success
218 USBH_DEBUG("Write AT32.txt Success");
219 }
220 f_close(&file);
221 }
222
223 /* start read file */
224 if(f_open(&file, "0:AT32.txt", FA_READ) != FR_OK)
225 {
226 // error
227 USBH_DEBUG("Open AT32.txt failed");
228 }
229 else
230 {
231 res = f_read(&file, read_data, sizeof(read_data), &len);
232 if(res != FR_OK || len == 0)
233 {
234 //read error
235 USBH_DEBUG("Read AT32.txt failed");
236 }
237 else
238 {
239 //read success
240 USBH_DEBUG("Read AT32.txt Success");
241 }
242 f_close(&file);
243 }
244 f_mount(NULL, "", 0);
245 }
246
247 return status;
248}
249
258static usb_sts_type usbh_user_active_vbus(void *uhost, confirm_state state)
259{
260 usb_sts_type status = USB_OK;
261#ifdef USBH_5V_POWER_SWITCH
262 if(state == TRUE)
263 {
264 /* active vbus */
265 gpio_bits_reset(OTG_PIN_POWER_SWITCH_GPIO, OTG_PIN_POWER_SWITCH);
266 }
267 else
268 {
269 /* deactive vubs */
270 gpio_bits_set(OTG_PIN_POWER_SWITCH_GPIO, OTG_PIN_POWER_SWITCH);
271 }
272#endif
273 return status;
274}
275
281static usb_sts_type usbh_user_not_support(void)
282{
283 usb_sts_type status = USB_OK;
284
285 return status;
286}
287
OTG_PIN_POWER_SWITCH_GPIO
#define OTG_PIN_POWER_SWITCH_GPIO
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:78
OTG_PIN_POWER_SWITCH
#define OTG_PIN_POWER_SWITCH
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:80
USBH_DEBUG
#define USBH_DEBUG(...)
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:152
usbh_user_init
static usb_sts_type usbh_user_init(void)
usb host init user handler
Definition: msc_only_fat32/src/usbh_user.c:72
file
FIL file
usb host application user handler
Definition: msc_only_fat32/src/usbh_user.c:187
usbh_user_disconnect
static usb_sts_type usbh_user_disconnect(void)
usb host discconet user handler
Definition: msc_only_fat32/src/usbh_user.c:108
usbh_user_not_support
static usb_sts_type usbh_user_not_support(void)
usb host not support user handler
Definition: msc_only_fat32/src/usbh_user.c:281
usbh_user_application
static usb_sts_type usbh_user_application(void)
Definition: msc_only_fat32/src/usbh_user.c:189
usbh_user_speed
static usb_sts_type usbh_user_speed(uint8_t speed)
usb host speed user handler
Definition: msc_only_fat32/src/usbh_user.c:120
usbh_user_active_vbus
static usb_sts_type usbh_user_active_vbus(void *uhost, confirm_state state)
usb host active vbus user handler
Definition: msc_only_fat32/src/usbh_user.c:258
usbh_user_handle
usbh_user_handler_type usbh_user_handle
Definition: msc_only_fat32/src/usbh_user.c:51
usbh_user_serial_string
static usb_sts_type usbh_user_serial_string(void *string)
usb host serial string user handler
Definition: msc_only_fat32/src/usbh_user.c:163
usbh_user_reset
static usb_sts_type usbh_user_reset(void)
usb host reset user handler
Definition: msc_only_fat32/src/usbh_user.c:84
usbh_user_mfc_string
static usb_sts_type usbh_user_mfc_string(void *string)
usb host manufacturer string user handler
Definition: msc_only_fat32/src/usbh_user.c:139
usbh_user_enumeration_done
static usb_sts_type usbh_user_enumeration_done(void)
usb host enumeration done user handler
Definition: msc_only_fat32/src/usbh_user.c:175
usbh_user_attached
static usb_sts_type usbh_user_attached(void)
usb host check device attached
Definition: msc_only_fat32/src/usbh_user.c:96
fs
FATFS fs
Definition: msc_only_fat32/src/usbh_user.c:188
usbh_user_product_string
static usb_sts_type usbh_user_product_string(void *string)
usb host product string user handler
Definition: msc_only_fat32/src/usbh_user.c:151
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_bits_reset
void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins)
clear the selected data port bits.
Definition: at32f415_gpio.c:341
gpio_bits_set
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins)
set the selected data port bits.
Definition: at32f415_gpio.c:310
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
USB_PRTSPD_LOW_SPEED
#define USB_PRTSPD_LOW_SPEED
Definition: at32f415_usb.h:188
USB_PRTSPD_FULL_SPEED
#define USB_PRTSPD_FULL_SPEED
Definition: at32f415_usb.h:187
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_OK
@ USB_OK
Definition: usb_std.h:218


AT32F415 Firmwary Library: printer_class.c Source File

  • middlewares
  • usbd_class
  • printer
printer_class.c
Go to the documentation of this file.
1
26#include "usbd_core.h"
27#include "printer_class.h"
28#include "printer_desc.h"
29
43 usb_sts_type class_init_handler(void *udev);
44 usb_sts_type class_clear_handler(void *udev);
45 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup);
46 usb_sts_type class_ept0_tx_handler(void *udev);
47 usb_sts_type class_ept0_rx_handler(void *udev);
48 usb_sts_type class_in_handler(void *udev, uint8_t ept_num);
49 usb_sts_type class_out_handler(void *udev, uint8_t ept_num);
50 usb_sts_type class_sof_handler(void *udev);
51 usb_sts_type class_event_handler(void *udev, usbd_event_type event);
52
53/* usb rx and tx buffer */
54static uint32_t alt_setting = 0;
55static uint8_t g_rx_buff[USBD_OUT_MAXPACKET_SIZE];
56__IO uint8_t g_tx_completed = 1, g_rx_completed = 0;
57
58uint8_t PRINTER_DEVICE_ID[PRINTER_DEVICE_ID_LEN] =
59{
60 0x00, 0x16,
61 'M', 'F', 'G',':','A','r','t','e', 'r', 'y' ,' ',
62 'C','M', 'D', ':', 'E', 'S', 'C', 'P', 'O', 'S',' ',
63};
64static uint32_t g_printer_port_status = 0x18;
65uint8_t g_printer_data[USBD_OUT_MAXPACKET_SIZE];
66
67/* static variable */
68
69
70/* usb device class handler */
71usbd_class_handler class_handler =
72{
73 class_init_handler,
74 class_clear_handler,
75 class_setup_handler,
76 class_ept0_tx_handler,
77 class_ept0_rx_handler,
78 class_in_handler,
79 class_out_handler,
80 class_sof_handler,
81 class_event_handler,
82};
83
89 usb_sts_type class_init_handler(void *udev)
90{
91 usb_sts_type status = USB_OK;
92 usbd_core_type *pudev = (usbd_core_type *)udev;
93
94 /* open in endpoint */
95 usbd_ept_open(pudev, USBD_PRINTER_BULK_IN_EPT, EPT_BULK_TYPE, USBD_OUT_MAXPACKET_SIZE);
96
97 /* open out endpoint */
98 usbd_ept_open(pudev, USBD_PRINTER_BULK_OUT_EPT, EPT_BULK_TYPE, USBD_OUT_MAXPACKET_SIZE);
99
100 /* set out endpoint to receive status */
101 usbd_ept_recv(pudev, USBD_PRINTER_BULK_OUT_EPT, g_rx_buff, USBD_OUT_MAXPACKET_SIZE);
102
103 g_tx_completed = 1;
104
105 return status;
106}
107
113 usb_sts_type class_clear_handler(void *udev)
114{
115 usb_sts_type status = USB_OK;
116 usbd_core_type *pudev = (usbd_core_type *)udev;
117
118 /* close in endpoint */
119 usbd_ept_close(pudev, USBD_PRINTER_BULK_IN_EPT);
120
121 /* close out endpoint */
122 usbd_ept_close(pudev, USBD_PRINTER_BULK_OUT_EPT);
123
124 return status;
125}
126
133 usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
134{
135 usb_sts_type status = USB_OK;
136 usbd_core_type *pudev = (usbd_core_type *)udev;
137
138 switch(setup->bmRequestType & USB_REQ_TYPE_RESERVED)
139 {
140 /* class request */
141 case USB_REQ_TYPE_CLASS:
142 switch(setup->bRequest)
143 {
144 case PRINTER_REQ_GET_DEVICE_ID:
145 usbd_ctrl_send(pudev, PRINTER_DEVICE_ID, PRINTER_DEVICE_ID_LEN);
146 break;
147 case PRINTER_REQ_GET_PORT_STATUS:
148 usbd_ctrl_send(pudev, (uint8_t *)&g_printer_port_status, 1);
149 break;
150 case PRINTER_REQ_GET_SOFT_RESET:
151 usbd_ctrl_recv(pudev, g_printer_data, USBD_OUT_MAXPACKET_SIZE);
152 break;
153 default:
154 usbd_ctrl_unsupport(pudev);
155 break;
156 }
157 break;
158 /* standard request */
159 case USB_REQ_TYPE_STANDARD:
160 switch(setup->bRequest)
161 {
162 case USB_STD_REQ_GET_DESCRIPTOR:
163 usbd_ctrl_unsupport(pudev);
164 break;
165 case USB_STD_REQ_GET_INTERFACE:
166 usbd_ctrl_send(pudev, (uint8_t *)&alt_setting, 1);
167 break;
168 case USB_STD_REQ_SET_INTERFACE:
169 alt_setting = setup->wValue;
170 break;
171 default:
172 break;
173 }
174 break;
175 default:
176 usbd_ctrl_unsupport(pudev);
177 break;
178 }
179 return status;
180}
181
187 usb_sts_type class_ept0_tx_handler(void *udev)
188{
189 usb_sts_type status = USB_OK;
190
191 /* ...user code... */
192
193 return status;
194}
195
201 usb_sts_type class_ept0_rx_handler(void *udev)
202{
203 usb_sts_type status = USB_OK;
204
205 /* ...user code... */
206
207 return status;
208}
209
216 usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
217{
218 usbd_core_type *pudev = (usbd_core_type *)udev;
219 usb_sts_type status = USB_OK;
220
221 /* ...user code...
222 trans next packet data
223 */
224 usbd_flush_tx_fifo(pudev, ept_num);
225 g_tx_completed = 1;
226
227 return status;
228}
229
236 usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
237{
238 usb_sts_type status = USB_OK;
239
240 /*set recv flag*/
241 g_rx_completed = 1;
242
243 return status;
244}
245
251 usb_sts_type class_sof_handler(void *udev)
252{
253 usb_sts_type status = USB_OK;
254
255 /* ...user code... */
256
257 return status;
258}
259
266 usb_sts_type class_event_handler(void *udev, usbd_event_type event)
267{
268 usb_sts_type status = USB_OK;
269 switch(event)
270 {
271 case USBD_RESET_EVENT:
272
273 /* ...user code... */
274
275 break;
276 case USBD_SUSPEND_EVENT:
277
278 /* ...user code... */
279
280 break;
281 case USBD_WAKEUP_EVENT:
282 /* ...user code... */
283
284 break;
285 case USBD_INISOINCOM_EVENT:
286 break;
287 case USBD_OUTISOINCOM_EVENT:
288 break;
289
290 default:
291 break;
292 }
293 return status;
294}
295
303 error_status usb_printer_send_data(void *udev, uint8_t *send_data, uint16_t len)
304{
305 error_status status = SUCCESS;
306 usbd_core_type *pudev = (usbd_core_type *)udev;
307 if(g_tx_completed)
308 {
309 g_tx_completed = 0;
310 usbd_ept_send(pudev, USBD_PRINTER_BULK_IN_EPT, send_data, len);
311 }
312 else
313 {
314 status = ERROR;
315 }
316 return status;
317}
318
319
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
EPT_BULK_TYPE
@ EPT_BULK_TYPE
Definition: at32f415_usb.h:348
PRINTER_DEVICE_ID_LEN
#define PRINTER_DEVICE_ID_LEN
Definition: printer_class.h:57
USBD_PRINTER_BULK_OUT_EPT
#define USBD_PRINTER_BULK_OUT_EPT
Definition: printer_class.h:51
USBD_PRINTER_BULK_IN_EPT
#define USBD_PRINTER_BULK_IN_EPT
Definition: printer_class.h:50
PRINTER_REQ_GET_SOFT_RESET
@ PRINTER_REQ_GET_SOFT_RESET
Definition: printer_class.h:63
PRINTER_REQ_GET_PORT_STATUS
@ PRINTER_REQ_GET_PORT_STATUS
Definition: printer_class.h:62
PRINTER_REQ_GET_DEVICE_ID
@ PRINTER_REQ_GET_DEVICE_ID
Definition: printer_class.h:61
g_rx_completed
__IO uint8_t g_rx_completed
Definition: printer_class.c:56
class_handler
usbd_class_handler class_handler
Definition: printer_class.c:71
class_event_handler
usb_sts_type class_event_handler(void *udev, usbd_event_type event)
usb device event handler
Definition: printer_class.c:266
class_sof_handler
usb_sts_type class_sof_handler(void *udev)
usb device sof handler
Definition: printer_class.c:251
g_printer_port_status
static uint32_t g_printer_port_status
Definition: printer_class.c:64
g_tx_completed
__IO uint8_t g_tx_completed
Definition: printer_class.c:56
class_setup_handler
usb_sts_type class_setup_handler(void *udev, usb_setup_type *setup)
usb device class setup request handler
Definition: printer_class.c:133
usb_printer_send_data
error_status usb_printer_send_data(void *udev, uint8_t *send_data, uint16_t len)
usb device class send data
Definition: printer_class.c:303
alt_setting
static uint32_t alt_setting
Definition: printer_class.c:54
PRINTER_DEVICE_ID
uint8_t PRINTER_DEVICE_ID[24]
Definition: printer_class.c:58
class_ept0_tx_handler
usb_sts_type class_ept0_tx_handler(void *udev)
usb device endpoint 0 in status stage complete
Definition: printer_class.c:187
g_printer_data
uint8_t g_printer_data[0x40]
Definition: printer_class.c:65
class_in_handler
usb_sts_type class_in_handler(void *udev, uint8_t ept_num)
usb device transmision complete handler
Definition: printer_class.c:216
class_init_handler
usb_sts_type class_init_handler(void *udev)
initialize usb custom hid endpoint
Definition: printer_class.c:89
class_ept0_rx_handler
usb_sts_type class_ept0_rx_handler(void *udev)
usb device endpoint 0 out status stage complete
Definition: printer_class.c:201
g_rx_buff
static uint8_t g_rx_buff[0x40]
Definition: printer_class.c:55
class_out_handler
usb_sts_type class_out_handler(void *udev, uint8_t ept_num)
usb device endpoint receive data
Definition: printer_class.c:236
class_clear_handler
usb_sts_type class_clear_handler(void *udev)
clear endpoint or other state
Definition: printer_class.c:113
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
USB_STD_REQ_GET_DESCRIPTOR
#define USB_STD_REQ_GET_DESCRIPTOR
Definition: usb_std.h:81
USB_STD_REQ_SET_INTERFACE
#define USB_STD_REQ_SET_INTERFACE
Definition: usb_std.h:86
USB_REQ_TYPE_RESERVED
#define USB_REQ_TYPE_RESERVED
Definition: usb_std.h:66
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_STD_REQ_GET_INTERFACE
#define USB_STD_REQ_GET_INTERFACE
Definition: usb_std.h:85
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usb_std.h:64
USB_OK
@ USB_OK
Definition: usb_std.h:218
usbd_ept_close
void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint
Definition: usbd_core.c:341
usbd_ept_recv
void usbd_ept_recv(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint receive data
Definition: usbd_core.c:529
usbd_flush_tx_fifo
void usbd_flush_tx_fifo(usbd_core_type *udev, uint8_t ept_num)
usb device flush in endpoint fifo
Definition: usbd_core.c:645
usbd_ept_open
void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint
Definition: usbd_core.c:309
usbd_ctrl_send
void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data
Definition: usbd_core.c:174
usbd_ept_send
void usbd_ept_send(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data
Definition: usbd_core.c:429
usbd_ctrl_recv
void usbd_ctrl_recv(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint recv data
Definition: usbd_core.c:192
usbd_ctrl_unsupport
void usbd_ctrl_unsupport(usbd_core_type *udev)
un-support device request
Definition: usbd_core.c:282
printer_class.h
usb cdc class file
printer_desc.h
usb printer descriptor header file
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_setup_type::wValue
uint16_t wValue
Definition: usb_std.h:233
usb_setup_type::bmRequestType
uint8_t bmRequestType
Definition: usb_std.h:231
usb_setup_type::bRequest
uint8_t bRequest
Definition: usb_std.h:232
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: printer_class.h Source File

  • middlewares
  • usbd_class
  • printer
printer_class.h
Go to the documentation of this file.
1
27 /* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __PRINTER_CLASS_H
29#define __PRINTER_CLASS_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "usb_std.h"
36#include "usbd_core.h"
37
50#define USBD_PRINTER_BULK_IN_EPT 0x81
51#define USBD_PRINTER_BULK_OUT_EPT 0x01
52
53
54#define USBD_IN_MAXPACKET_SIZE 0x40
55#define USBD_OUT_MAXPACKET_SIZE 0x40
56
57#define PRINTER_DEVICE_ID_LEN 24
58
59typedef enum
60{
61 PRINTER_REQ_GET_DEVICE_ID = 0x00,
62 PRINTER_REQ_GET_PORT_STATUS = 0x01,
63 PRINTER_REQ_GET_SOFT_RESET = 0x02
64}printer_req_type;
65
66
67#define SET_LINE_CODING 0x20
68#define GET_LINE_CODING 0x21
69
70typedef struct
71{
72 uint32_t bitrate;
73 uint8_t format;
74 uint8_t parity;
75 uint8_t data;
76}linecoding_type;
77
78extern usbd_class_handler class_handler;
79uint16_t usb_printer_get_rxdata(void *udev, uint8_t *recv_data);
80 error_status usb_printer_send_data(void *udev, uint8_t *send_data, uint16_t len);
92#ifdef __cplusplus
93}
94#endif
95
96#endif
error_status
error_status
error status
Definition: at32f415.h:258
printer_req_type
printer_req_type
Definition: printer_class.h:60
class_handler
usbd_class_handler class_handler
Definition: cdc_class.c:75
usb_printer_get_rxdata
uint16_t usb_printer_get_rxdata(void *udev, uint8_t *recv_data)
usb_printer_send_data
error_status usb_printer_send_data(void *udev, uint8_t *send_data, uint16_t len)
usb device class send data
Definition: printer_class.c:303
PRINTER_REQ_GET_SOFT_RESET
@ PRINTER_REQ_GET_SOFT_RESET
Definition: printer_class.h:63
PRINTER_REQ_GET_PORT_STATUS
@ PRINTER_REQ_GET_PORT_STATUS
Definition: printer_class.h:62
PRINTER_REQ_GET_DEVICE_ID
@ PRINTER_REQ_GET_DEVICE_ID
Definition: printer_class.h:61
linecoding_type
usb cdc class set line coding struct
Definition: cdc_class.h:82
usb_std.h
usb standard header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: printer_desc.c Source File

  • middlewares
  • usbd_class
  • printer
printer_desc.c
Go to the documentation of this file.
1
26#include "stdio.h"
27#include "usb_std.h"
28#include "usbd_sdr.h"
29#include "usbd_core.h"
30#include "printer_desc.h"
31
45usbd_desc_t *get_device_descriptor(void);
46usbd_desc_t *get_device_qualifier(void);
47usbd_desc_t *get_device_configuration(void);
48usbd_desc_t *get_device_other_speed(void);
49usbd_desc_t *get_device_lang_id(void);
50usbd_desc_t *get_device_manufacturer_string(void);
51usbd_desc_t *get_device_product_string(void);
52usbd_desc_t *get_device_serial_string(void);
53usbd_desc_t *get_device_interface_string(void);
54usbd_desc_t *get_device_config_string(void);
55
56uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf);
57static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len);
58static void get_serial_num(void);
59static uint8_t g_usbd_desc_buffer[256];
60
64usbd_desc_handler desc_handler =
65{
66 get_device_descriptor,
67 get_device_qualifier,
68 get_device_configuration,
69 get_device_other_speed,
70 get_device_lang_id,
71 get_device_manufacturer_string,
72 get_device_product_string,
73 get_device_serial_string,
74 get_device_interface_string,
75 get_device_config_string,
76};
77
81#if defined ( __ICCARM__ ) /* iar compiler */
82 #pragma data_alignment=4
83#endif
84ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL =
85{
86 USB_DEVICE_DESC_LEN, /* bLength */
87 USB_DESCIPTOR_TYPE_DEVICE, /* bDescriptorType */
88 0x00, /* bcdUSB */
89 0x02,
90 0x00, /* bDeviceClass */
91 0x00, /* bDeviceSubClass */
92 0x00, /* bDeviceProtocol */
93 USB_MAX_EP0_SIZE, /* bMaxPacketSize */
94 LBYTE(USBD_VENDOR_ID), /* idVendor */
95 HBYTE(USBD_VENDOR_ID), /* idVendor */
96 LBYTE(USBD_PRODUCT_ID), /* idProduct */
97 HBYTE(USBD_PRODUCT_ID), /* idProduct */
98 0x00, /* bcdDevice rel. 2.00 */
99 0x02,
100 USB_MFC_STRING, /* Index of manufacturer string */
101 USB_PRODUCT_STRING, /* Index of product string */
102 USB_SERIAL_STRING, /* Index of serial number string */
103 1 /* bNumConfigurations */
104};
105
109#if defined ( __ICCARM__ ) /* iar compiler */
110 #pragma data_alignment=4
111#endif
112ALIGNED_HEAD uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE] ALIGNED_TAIL =
113{
114 USB_DEVICE_CFG_DESC_LEN, /* bLength: configuration descriptor size */
115 USB_DESCIPTOR_TYPE_CONFIGURATION, /* bDescriptorType: configuration */
116 LBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
117 HBYTE(USBD_CONFIG_DESC_SIZE), /* wTotalLength: bytes returned */
118 0x01, /* bNumInterfaces: 1 interface */
119 0x01, /* bConfigurationValue: configuration value */
120 0x00, /* iConfiguration: index of string descriptor describing
121 the configuration */
122 0xC0, /* bmAttributes: self powered */
123 0x32, /* MaxPower 100 mA: this current is used for detecting vbus */
124
125 USB_DEVICE_IF_DESC_LEN, /* bLength: interface descriptor size */
126 USB_DESCIPTOR_TYPE_INTERFACE, /* bDescriptorType: interface descriptor type */
127 0x00, /* bInterfaceNumber: number of interface */
128 0x00, /* bAlternateSetting: alternate set */
129 0x02, /* bNumEndpoints: number of endpoints */
130 USB_CLASS_CODE_PRINTER, /* bInterfaceClass: printer class code */
131 0x01, /* bInterfaceSubClass: subclass code*/
132 PRINTER_PROTOCOL_BI_DIRECTIONAL, /* bInterfaceProtocol: printer interface type */
133 0x00, /* iInterface: index of string descriptor */
134
135 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
136 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
137 USBD_PRINTER_BULK_IN_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
138 USB_EPT_DESC_BULK, /* bmAttributes: endpoint attributes */
139 LBYTE(USBD_IN_MAXPACKET_SIZE),
140 HBYTE(USBD_IN_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
141 0x00, /* bInterval: interval for polling endpoint for data transfers */
142
143 USB_DEVICE_EPT_LEN, /* bLength: size of endpoint descriptor in bytes */
144 USB_DESCIPTOR_TYPE_ENDPOINT, /* bDescriptorType: endpoint descriptor type */
145 USBD_PRINTER_BULK_OUT_EPT, /* bEndpointAddress: the address of endpoint on usb device described by this descriptor */
146 USB_EPT_DESC_BULK, /* bmAttributes: endpoint attributes */
147 LBYTE(USBD_OUT_MAXPACKET_SIZE),
148 HBYTE(USBD_OUT_MAXPACKET_SIZE), /* wMaxPacketSize: maximum packe size this endpoint */
149 0x00, /* bInterval: interval for polling endpoint for data transfers */
150};
151
155#if defined ( __ICCARM__ ) /* iar compiler */
156 #pragma data_alignment=4
157#endif
158ALIGNED_HEAD uint8_t g_string_lang_id[USBD_SIZ_STRING_LANGID] ALIGNED_TAIL =
159{
160 USBD_SIZ_STRING_LANGID,
161 USB_DESCIPTOR_TYPE_STRING,
162 0x09,
163 0x04,
164};
165
169#if defined ( __ICCARM__ ) /* iar compiler */
170 #pragma data_alignment=4
171#endif
172ALIGNED_HEAD uint8_t g_string_serial[USBD_SIZ_STRING_SERIAL] ALIGNED_TAIL =
173{
174 USBD_SIZ_STRING_SERIAL,
175 USB_DESCIPTOR_TYPE_STRING,
176};
177
178
179/* device descriptor */
180usbd_desc_t device_descriptor =
181{
182 USB_DEVICE_DESC_LEN,
183 g_usbd_descriptor
184};
185
186/* config descriptor */
187usbd_desc_t config_descriptor =
188{
189 USBD_CONFIG_DESC_SIZE,
190 g_usbd_configuration
191};
192
193/* langid descriptor */
194usbd_desc_t langid_descriptor =
195{
196 USBD_SIZ_STRING_LANGID,
197 g_string_lang_id
198};
199
200/* serial descriptor */
201usbd_desc_t serial_descriptor =
202{
203 USBD_SIZ_STRING_SERIAL,
204 g_string_serial
205};
206
207usbd_desc_t vp_desc;
208
215uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
216{
217 uint16_t str_len = 0, id_pos = 2;
218 uint8_t *tmp_str = string;
219
220 while(*tmp_str != '\0')
221 {
222 str_len ++;
223 unicode_buf[id_pos ++] = *tmp_str ++;
224 unicode_buf[id_pos ++] = 0x00;
225 }
226
227 str_len = str_len * 2 + 2;
228 unicode_buf[0] = (uint8_t)str_len;
229 unicode_buf[1] = USB_DESCIPTOR_TYPE_STRING;
230
231 return str_len;
232}
233
241static void usbd_int_to_unicode (uint32_t value , uint8_t *pbuf , uint8_t len)
242{
243 uint8_t idx = 0;
244
245 for( idx = 0 ; idx < len ; idx ++)
246 {
247 if( ((value >> 28)) < 0xA )
248 {
249 pbuf[ 2 * idx] = (value >> 28) + '0';
250 }
251 else
252 {
253 pbuf[2 * idx] = (value >> 28) + 'A' - 10;
254 }
255
256 value = value << 4;
257
258 pbuf[2 * idx + 1] = 0;
259 }
260}
261
267static void get_serial_num(void)
268{
269 uint32_t serial0, serial1, serial2;
270
271 serial0 = *(uint32_t*)MCU_ID1;
272 serial1 = *(uint32_t*)MCU_ID2;
273 serial2 = *(uint32_t*)MCU_ID3;
274
275 serial0 += serial2;
276
277 if (serial0 != 0)
278 {
279 usbd_int_to_unicode (serial0, &g_string_serial[2] ,8);
280 usbd_int_to_unicode (serial1, &g_string_serial[18] ,4);
281 }
282}
283
289usbd_desc_t *get_device_descriptor(void)
290{
291 return &device_descriptor;
292}
293
299usbd_desc_t * get_device_qualifier(void)
300{
301 return NULL;
302}
303
309usbd_desc_t *get_device_configuration(void)
310{
311 return &config_descriptor;
312}
313
319usbd_desc_t *get_device_other_speed(void)
320{
321 return NULL;
322}
323
329usbd_desc_t *get_device_lang_id(void)
330{
331 return &langid_descriptor;
332}
333
334
340usbd_desc_t *get_device_manufacturer_string(void)
341{
342 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_MANUFACTURER_STRING, g_usbd_desc_buffer);
343 vp_desc.descriptor = g_usbd_desc_buffer;
344 return &vp_desc;
345}
346
352usbd_desc_t *get_device_product_string(void)
353{
354 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_PRODUCT_STRING, g_usbd_desc_buffer);
355 vp_desc.descriptor = g_usbd_desc_buffer;
356 return &vp_desc;
357}
358
364usbd_desc_t *get_device_serial_string(void)
365{
366 get_serial_num();
367 return &serial_descriptor;
368}
369
375usbd_desc_t *get_device_interface_string(void)
376{
377 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_INTERFACE_STRING, g_usbd_desc_buffer);
378 vp_desc.descriptor = g_usbd_desc_buffer;
379 return &vp_desc;
380}
381
387usbd_desc_t *get_device_config_string(void)
388{
389 vp_desc.length = usbd_unicode_convert((uint8_t *)USBD_DESC_CONFIGURATION_STRING, g_usbd_desc_buffer);
390 vp_desc.descriptor = g_usbd_desc_buffer;
391 return &vp_desc;
392}
393
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
USBD_DESC_CONFIGURATION_STRING
#define USBD_DESC_CONFIGURATION_STRING
Definition: audio_desc.h:61
USBD_SIZ_STRING_SERIAL
#define USBD_SIZ_STRING_SERIAL
Definition: audio_desc.h:57
g_usbd_configuration
uint8_t g_usbd_configuration[(0x12+((0x08+(1+1))+(1+1) *0x1E)++(0x31+((1+1)) *3)+(0x31+((1+1)) *3)+(9 *1))]
usb configuration standard descriptor
Definition: audio_desc.c:112
USBD_DESC_PRODUCT_STRING
#define USBD_DESC_PRODUCT_STRING
Definition: audio_desc.h:60
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: audio_desc.h:208
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
USBD_SIZ_STRING_LANGID
#define USBD_SIZ_STRING_LANGID
Definition: audio_desc.h:56
MCU_ID1
#define MCU_ID1
Definition: audio_desc.h:215
USBD_DESC_MANUFACTURER_STRING
#define USBD_DESC_MANUFACTURER_STRING
Definition: audio_desc.h:59
USBD_PRODUCT_ID
#define USBD_PRODUCT_ID
Definition: audio_desc.h:54
USBD_DESC_INTERFACE_STRING
#define USBD_DESC_INTERFACE_STRING
Definition: audio_desc.h:62
MCU_ID2
#define MCU_ID2
Definition: audio_desc.h:216
USBD_VENDOR_ID
#define USBD_VENDOR_ID
Definition: audio_desc.h:53
MCU_ID3
#define MCU_ID3
Definition: audio_desc.h:217
USBD_OUT_MAXPACKET_SIZE
#define USBD_OUT_MAXPACKET_SIZE
Definition: audio_hid_class.h:68
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
USBD_PRINTER_BULK_OUT_EPT
#define USBD_PRINTER_BULK_OUT_EPT
Definition: printer_class.h:51
USBD_PRINTER_BULK_IN_EPT
#define USBD_PRINTER_BULK_IN_EPT
Definition: printer_class.h:50
PRINTER_PROTOCOL_BI_DIRECTIONAL
#define PRINTER_PROTOCOL_BI_DIRECTIONAL
Definition: printer_desc.h:65
serial_descriptor
usbd_desc_t serial_descriptor
Definition: printer_desc.c:201
desc_handler
usbd_desc_handler desc_handler
device descriptor handler structure
Definition: printer_desc.c:64
device_descriptor
usbd_desc_t device_descriptor
Definition: printer_desc.c:180
usbd_unicode_convert
uint16_t usbd_unicode_convert(uint8_t *string, uint8_t *unicode_buf)
standard usb unicode convert
Definition: printer_desc.c:215
get_device_manufacturer_string
usbd_desc_t * get_device_manufacturer_string(void)
get manufacturer descriptor
Definition: printer_desc.c:340
langid_descriptor
usbd_desc_t langid_descriptor
Definition: printer_desc.c:194
get_device_qualifier
usbd_desc_t * get_device_qualifier(void)
get device qualifier
Definition: printer_desc.c:299
get_device_interface_string
usbd_desc_t * get_device_interface_string(void)
get interface descriptor
Definition: printer_desc.c:375
get_device_other_speed
usbd_desc_t * get_device_other_speed(void)
get other speed descriptor
Definition: printer_desc.c:319
g_usbd_desc_buffer
static uint8_t g_usbd_desc_buffer[256]
Definition: printer_desc.c:59
vp_desc
usbd_desc_t vp_desc
Definition: printer_desc.c:207
get_device_configuration
usbd_desc_t * get_device_configuration(void)
get config descriptor
Definition: printer_desc.c:309
ALIGNED_TAIL
ALIGNED_HEAD uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN] ALIGNED_TAIL
usb device standard descriptor
Definition: printer_desc.c:84
get_device_product_string
usbd_desc_t * get_device_product_string(void)
get product descriptor
Definition: printer_desc.c:352
get_device_lang_id
usbd_desc_t * get_device_lang_id(void)
get lang id descriptor
Definition: printer_desc.c:329
get_serial_num
static void get_serial_num(void)
usb get serial number
Definition: printer_desc.c:267
config_descriptor
usbd_desc_t config_descriptor
Definition: printer_desc.c:187
get_device_descriptor
usbd_desc_t * get_device_descriptor(void)
get device descriptor
Definition: printer_desc.c:289
get_device_serial_string
usbd_desc_t * get_device_serial_string(void)
get serial descriptor
Definition: printer_desc.c:364
get_device_config_string
usbd_desc_t * get_device_config_string(void)
get device config descriptor
Definition: printer_desc.c:387
usbd_int_to_unicode
static void usbd_int_to_unicode(uint32_t value, uint8_t *pbuf, uint8_t len)
usb int convert to unicode
Definition: printer_desc.c:241
USB_CLASS_CODE_PRINTER
#define USB_CLASS_CODE_PRINTER
Definition: usb_std.h:164
HBYTE
#define HBYTE(x)
Definition: usb_std.h:211
USB_DEVICE_EPT_LEN
#define USB_DEVICE_EPT_LEN
Definition: usb_std.h:153
USB_MAX_EP0_SIZE
#define USB_MAX_EP0_SIZE
endpoint 0 max size
Definition: usb_std.h:192
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
USB_DESCIPTOR_TYPE_CONFIGURATION
#define USB_DESCIPTOR_TYPE_CONFIGURATION
Definition: usb_std.h:93
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_DESCIPTOR_TYPE_ENDPOINT
#define USB_DESCIPTOR_TYPE_ENDPOINT
Definition: usb_std.h:96
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_EPT_DESC_BULK
#define USB_EPT_DESC_BULK
Definition: usb_std.h:177
USB_DEVICE_IF_DESC_LEN
#define USB_DEVICE_IF_DESC_LEN
Definition: usb_std.h:152
USB_DEVICE_CFG_DESC_LEN
#define USB_DEVICE_CFG_DESC_LEN
Definition: usb_std.h:151
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92
USB_DESCIPTOR_TYPE_STRING
#define USB_DESCIPTOR_TYPE_STRING
Definition: usb_std.h:94
USB_DESCIPTOR_TYPE_INTERFACE
#define USB_DESCIPTOR_TYPE_INTERFACE
Definition: usb_std.h:95
printer_desc.h
usb printer descriptor header file
usb_std.h
usb standard header file
usbd_core.h
usb device core header file
usbd_sdr.h


AT32F415 Firmwary Library: printer_desc.h Source File

  • middlewares
  • usbd_class
  • printer
printer_desc.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __PRINTER_DESC_H
29#define __PRINTER_DESC_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "printer_class.h"
36#include "usbd_core.h"
37
50#define BCD_NUM 0x0110
51
52#define USBD_VENDOR_ID 0x2E3C
53#define USBD_PRODUCT_ID 0x57FF
54
55#define USBD_CONFIG_DESC_SIZE 32
56#define USBD_SIZ_STRING_LANGID 4
57#define USBD_SIZ_STRING_SERIAL 0x1A
58
59#define USBD_DESC_MANUFACTURER_STRING "Artery"
60#define USBD_DESC_PRODUCT_STRING "AT32 Printer"
61#define USBD_DESC_CONFIGURATION_STRING "Printer Config"
62#define USBD_DESC_INTERFACE_STRING "Printer Interface"
63
64#define PRINTER_PROTOCOL_UNIDIRECTIONAL 0x01
65#define PRINTER_PROTOCOL_BI_DIRECTIONAL 0x02
66#define PRINTER_PROTOCOL_1284_4 0x03
67#define PRINTER_PROTOCOL_VENDOR_SPECIFIC 0xFF
68
69#define HID_BINTERVAL_TIME 0xFF
70
71#define MCU_ID1 (0x1FFFF7E8)
72#define MCU_ID2 (0x1FFFF7EC)
73#define MCU_ID3 (0x1FFFF7F0)
74
75extern uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN];
76extern uint8_t g_usbd_configuration[USBD_CONFIG_DESC_SIZE];
77
78extern usbd_desc_handler desc_handler;
79
91#ifdef __cplusplus
92}
93#endif
94
95#endif
desc_handler
usbd_desc_handler desc_handler
device descriptor handler structure
Definition: cdc_desc.c:64
g_usbd_configuration
uint8_t g_usbd_configuration[32]
USBD_CONFIG_DESC_SIZE
#define USBD_CONFIG_DESC_SIZE
Definition: printer_desc.h:55
g_usbd_descriptor
uint8_t g_usbd_descriptor[USB_DEVICE_DESC_LEN]
USB_DEVICE_DESC_LEN
#define USB_DEVICE_DESC_LEN
Definition: usb_std.h:150
printer_class.h
usb cdc class file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • adc
  • current_vref_value_check
  • inc
project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • adc
  • current_vref_value_check
  • inc
project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • adc
  • current_vref_value_check
  • inc
project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:113


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • adc
  • current_vref_value_check
  • src
project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • adc
  • current_vref_value_check
  • src
project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31
45void NMI_Handler(void)
46{
47}
48
54void HardFault_Handler(void)
55{
56 /* go to infinite loop when hard fault exception occurs */
57 while(1)
58 {
59 }
60}
61
67void MemManage_Handler(void)
68{
69 /* go to infinite loop when memory manage exception occurs */
70 while(1)
71 {
72 }
73}
74
80void BusFault_Handler(void)
81{
82 /* go to infinite loop when bus fault exception occurs */
83 while(1)
84 {
85 }
86}
87
93void UsageFault_Handler(void)
94{
95 /* go to infinite loop when usage fault exception occurs */
96 while(1)
97 {
98 }
99}
100
106void SVC_Handler(void)
107{
108}
109
115void DebugMon_Handler(void)
116{
117}
118
124void PendSV_Handler(void)
125{
126}
127
133void SysTick_Handler(void)
134{
135}
136
137
138
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • adc
  • current_vref_value_check
  • src
project/at_start_f415/examples/adc/current_vref_value_check/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38__IO uint16_t adc1_ordinary_value = 0;
39
40static void dma_config(void);
41static void adc_config(void);
42
48static void dma_config(void)
49{
50 dma_init_type dma_init_struct;
51 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
52 dma_reset(DMA1_CHANNEL1);
53 dma_default_para_init(&dma_init_struct);
54 dma_init_struct.buffer_size = 1;
55 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
56 dma_init_struct.memory_base_addr = (uint32_t)&adc1_ordinary_value;
57 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
58 dma_init_struct.memory_inc_enable = FALSE;
59 dma_init_struct.peripheral_base_addr = (uint32_t)&(ADC1->odt);
60 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
61 dma_init_struct.peripheral_inc_enable = FALSE;
62 dma_init_struct.priority = DMA_PRIORITY_HIGH;
63 dma_init_struct.loop_mode_enable = TRUE;
64 dma_init(DMA1_CHANNEL1, &dma_init_struct);
65
66 dma_channel_enable(DMA1_CHANNEL1, TRUE);
67}
68
74static void adc_config(void)
75{
76 adc_base_config_type adc_base_struct;
77 crm_periph_clock_enable(CRM_ADC1_PERIPH_CLOCK, TRUE);
78 crm_adc_clock_div_set(CRM_ADC_DIV_6);
79
80 /* select combine mode */
81 adc_combine_mode_select(ADC_INDEPENDENT_MODE);
82 adc_base_default_para_init(&adc_base_struct);
83 adc_base_struct.sequence_mode = FALSE;
84 adc_base_struct.repeat_mode = FALSE;
85 adc_base_struct.data_align = ADC_RIGHT_ALIGNMENT;
86 adc_base_struct.ordinary_channel_length = 1;
87 adc_base_config(ADC1, &adc_base_struct);
88 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_17, 1, ADC_SAMPLETIME_239_5);
89 adc_ordinary_conversion_trigger_set(ADC1, ADC12_ORDINARY_TRIG_SOFTWARE, TRUE);
90 adc_dma_mode_enable(ADC1, TRUE);
91 adc_tempersensor_vintrv_enable(TRUE);
92
93 adc_enable(ADC1, TRUE);
94 adc_calibration_init(ADC1);
95 while(adc_calibration_init_status_get(ADC1));
96 adc_calibration_start(ADC1);
97 while(adc_calibration_status_get(ADC1));
98}
99
105int main(void)
106{
107 __IO uint32_t index = 0;
108 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
109 system_clock_config();
110 at32_board_init();
111 at32_led_off(LED2);
112 at32_led_off(LED3);
113 at32_led_off(LED4);
114 uart_print_init(115200);
115 dma_config();
116 adc_config();
117 printf("adc1_vref_check \r\n");
118 while(1)
119 {
120 at32_led_on(LED2);
121 delay_sec(1);
122 adc_ordinary_software_trigger_enable(ADC1, TRUE);
123 while(dma_flag_get(DMA1_FDT1_FLAG) == RESET);
124 dma_flag_clear(DMA1_FDT1_FLAG);
125 printf("vref_value = %f V\r\n", ((double)1.2 * 4095) / adc1_ordinary_value);
126 }
127}
128
129
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
dma_config
static void dma_config(void)
dma configuration.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/main.c:48
adc1_ordinary_value
__IO uint16_t adc1_ordinary_value
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/main.c:38
adc_config
static void adc_config(void)
adc configuration.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/main.c:74
main
int main(void)
main function.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/main.c:105
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
adc_ordinary_software_trigger_enable
void adc_ordinary_software_trigger_enable(adc_type *adc_x, confirm_state new_state)
enable or disable ordinary software start conversion of the specified adc peripheral.
Definition: at32f415_adc.c:755
adc_base_config
void adc_base_config(adc_type *adc_x, adc_base_config_type *adc_base_struct)
initialize the adc peripheral according to the specified parameters.
Definition: at32f415_adc.c:137
adc_tempersensor_vintrv_enable
void adc_tempersensor_vintrv_enable(confirm_state new_state)
enable or disable the temperature sensor and vintrv channel.
Definition: at32f415_adc.c:741
adc_enable
void adc_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the specified adc peripheral.
Definition: at32f415_adc.c:70
adc_base_default_para_init
void adc_base_default_para_init(adc_base_config_type *adc_base_struct)
adc base default para init.
Definition: at32f415_adc.c:111
adc_calibration_start
void adc_calibration_start(adc_type *adc_x)
start calibration process of the specified adc peripheral.
Definition: at32f415_adc.c:223
adc_calibration_status_get
flag_status adc_calibration_status_get(adc_type *adc_x)
get calibration status of the specified adc peripheral.
Definition: at32f415_adc.c:235
adc_ordinary_conversion_trigger_set
void adc_ordinary_conversion_trigger_set(adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state)
enable or disable the ordinary channel's external trigger and set external trigger event of the speci...
Definition: at32f415_adc.c:592
adc_calibration_init
void adc_calibration_init(adc_type *adc_x)
initialize calibration register of the specified adc peripheral.
Definition: at32f415_adc.c:192
adc_calibration_init_status_get
flag_status adc_calibration_init_status_get(adc_type *adc_x)
get calibration register's initialize status of the specified adc peripheral.
Definition: at32f415_adc.c:204
adc_dma_mode_enable
void adc_dma_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the adc dma transfer.
Definition: at32f415_adc.c:154
adc_combine_mode_select
void adc_combine_mode_select(adc_combine_mode_type combine_mode)
select combine mode of the specified adc peripheral.
Definition: at32f415_adc.c:91
adc_ordinary_channel_set
void adc_ordinary_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc perip...
Definition: at32f415_adc.c:336
ADC_RIGHT_ALIGNMENT
@ ADC_RIGHT_ALIGNMENT
Definition: at32f415_adc.h:101
ADC_CHANNEL_17
@ ADC_CHANNEL_17
Definition: at32f415_adc.h:127
ADC_SAMPLETIME_239_5
@ ADC_SAMPLETIME_239_5
Definition: at32f415_adc.h:142
ADC_INDEPENDENT_MODE
@ ADC_INDEPENDENT_MODE
Definition: at32f415_adc.h:84
ADC12_ORDINARY_TRIG_SOFTWARE
@ ADC12_ORDINARY_TRIG_SOFTWARE
Definition: at32f415_adc.h:158
ADC1
#define ADC1
Definition: at32f415_adc.h:555
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
crm_adc_clock_div_set
void crm_adc_clock_div_set(crm_adc_div_type div_value)
set crm adc division
Definition: at32f415_crm.c:456
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_ADC1_PERIPH_CLOCK
@ CRM_ADC1_PERIPH_CLOCK
Definition: at32f415_crm.h:115
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_ADC_DIV_6
@ CRM_ADC_DIV_6
Definition: at32f415_crm.h:357
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_HIGH
@ DMA_PRIORITY_HIGH
Definition: at32f415_dma.h:260
DMA1_FDT1_FLAG
#define DMA1_FDT1_FLAG
Definition: at32f415_dma.h:82
DMA1_CHANNEL1
#define DMA1_CHANNEL1
Definition: at32f415_dma.h:473
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
adc_base_config_type
adc base config type
Definition: at32f415_adc.h:208
adc_base_config_type::data_align
adc_data_align_type data_align
Definition: at32f415_adc.h:211
adc_base_config_type::repeat_mode
confirm_state repeat_mode
Definition: at32f415_adc.h:210
adc_base_config_type::sequence_mode
confirm_state sequence_mode
Definition: at32f415_adc.h:209
adc_base_config_type::ordinary_channel_length
uint8_t ordinary_channel_length
Definition: at32f415_adc.h:212
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • adc
  • exint_trigger_partitioned
  • inc
project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • adc
  • exint_trigger_partitioned
  • inc
project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • adc
  • exint_trigger_partitioned
  • inc
project/at_start_f415/examples/adc/exint_trigger_partitioned/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • adc
  • exint_trigger_partitioned
  • src
project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • adc
  • exint_trigger_partitioned
  • src
project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31extern __IO uint16_t adc1_preempt_valuetab[3][3];
32extern __IO uint16_t dma_trans_complete_flag;
33extern __IO uint16_t preempt_trigger_count;
34
48void NMI_Handler(void)
49{
50}
51
57void HardFault_Handler(void)
58{
59 /* go to infinite loop when hard fault exception occurs */
60 while(1)
61 {
62 }
63}
64
70void MemManage_Handler(void)
71{
72 /* go to infinite loop when memory manage exception occurs */
73 while(1)
74 {
75 }
76}
77
83void BusFault_Handler(void)
84{
85 /* go to infinite loop when bus fault exception occurs */
86 while(1)
87 {
88 }
89}
90
96void UsageFault_Handler(void)
97{
98 /* go to infinite loop when usage fault exception occurs */
99 while(1)
100 {
101 }
102}
103
109void SVC_Handler(void)
110{
111}
112
118void DebugMon_Handler(void)
119{
120}
121
127void PendSV_Handler(void)
128{
129}
130
136void SysTick_Handler(void)
137{
138}
139
145void DMA1_Channel1_IRQHandler(void)
146{
147 if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
148 {
149 dma_flag_clear(DMA1_FDT1_FLAG);
150 dma_trans_complete_flag = 1;
151 }
152}
153
159void ADC1_IRQHandler(void)
160{
161 if(adc_flag_get(ADC1, ADC_PCCE_FLAG) != RESET)
162 {
163 adc_flag_clear(ADC1, ADC_PCCE_FLAG);
164 if(preempt_trigger_count < 3)
165 {
166 adc1_preempt_valuetab[preempt_trigger_count][0] = adc_preempt_conversion_data_get(ADC1, ADC_PREEMPT_CHANNEL_1);
167 adc1_preempt_valuetab[preempt_trigger_count][1] = adc_preempt_conversion_data_get(ADC1, ADC_PREEMPT_CHANNEL_2);
168 adc1_preempt_valuetab[preempt_trigger_count][2] = adc_preempt_conversion_data_get(ADC1, ADC_PREEMPT_CHANNEL_3);
169 preempt_trigger_count++;
170 }
171 }
172}
173
174
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
adc1_preempt_valuetab
__IO uint16_t adc1_preempt_valuetab[3][3]
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:40
dma_trans_complete_flag
__IO uint16_t dma_trans_complete_flag
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:41
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c:96
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c:57
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c:70
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c:109
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c:127
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c:48
preempt_trigger_count
__IO uint16_t preempt_trigger_count
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:42
DMA1_Channel1_IRQHandler
void DMA1_Channel1_IRQHandler(void)
this function handles dma1_channel1 handler.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c:145
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c:83
ADC1_IRQHandler
void ADC1_IRQHandler(void)
this function handles adc1_2 handler.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c:159
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c:136
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/at32f415_int.c:118
adc_preempt_conversion_data_get
uint16_t adc_preempt_conversion_data_get(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel)
return the conversion data for selection preempt channel of the specified adc peripheral.
Definition: at32f415_adc.c:846
adc_flag_clear
void adc_flag_clear(adc_type *adc_x, uint32_t adc_flag)
clear flag of the specified adc peripheral.
Definition: at32f415_adc.c:912
adc_flag_get
flag_status adc_flag_get(adc_type *adc_x, uint8_t adc_flag)
get flag of the specified adc peripheral.
Definition: at32f415_adc.c:883
ADC_PREEMPT_CHANNEL_3
@ ADC_PREEMPT_CHANNEL_3
Definition: at32f415_adc.h:186
ADC_PREEMPT_CHANNEL_2
@ ADC_PREEMPT_CHANNEL_2
Definition: at32f415_adc.h:185
ADC_PREEMPT_CHANNEL_1
@ ADC_PREEMPT_CHANNEL_1
Definition: at32f415_adc.h:184
ADC_PCCE_FLAG
#define ADC_PCCE_FLAG
Definition: at32f415_adc.h:67
ADC1
#define ADC1
Definition: at32f415_adc.h:555
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
DMA1_FDT1_FLAG
#define DMA1_FDT1_FLAG
Definition: at32f415_dma.h:82
RESET
@ RESET
Definition: at32f415.h:248
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • adc
  • exint_trigger_partitioned
  • src
project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
39__IO uint16_t adc1_ordinary_valuetab[3][3] = {0};
40__IO uint16_t adc1_preempt_valuetab[3][3] = {0};
41__IO uint16_t dma_trans_complete_flag = 0;
42__IO uint16_t preempt_trigger_count = 0;
43
44static void gpio_config(void);
45static void exint_config(void);
46static void dma_config(void);
47static void adc_config(void);
48
54static void gpio_config(void)
55{
56 gpio_init_type gpio_initstructure;
57 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
58 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
59
60 gpio_default_para_init(&gpio_initstructure);
61 gpio_initstructure.gpio_mode = GPIO_MODE_ANALOG;
62 gpio_initstructure.gpio_pins = GPIO_PINS_4 | GPIO_PINS_5 | GPIO_PINS_6 | GPIO_PINS_7;
63 gpio_init(GPIOA, &gpio_initstructure);
64
65 gpio_initstructure.gpio_mode = GPIO_MODE_ANALOG;
66 gpio_initstructure.gpio_pins = GPIO_PINS_0 | GPIO_PINS_1;
67 gpio_init(GPIOB, &gpio_initstructure);
68}
69
75static void exint_config(void)
76{
77 gpio_init_type gpio_initstructure;
78 exint_init_type exint_init_struct;
79
80 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
81 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
82 crm_periph_clock_enable(CRM_GPIOC_PERIPH_CLOCK, TRUE);
83
84 gpio_default_para_init(&gpio_initstructure);
85 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
86 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
87 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
88 gpio_initstructure.gpio_pins = GPIO_PINS_11;
89 gpio_init(GPIOC, &gpio_initstructure);
90 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
91 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
92 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
93 gpio_initstructure.gpio_pins = GPIO_PINS_15;
94 gpio_init(GPIOA, &gpio_initstructure);
95
96 gpio_exint_line_config(GPIO_PORT_SOURCE_GPIOC, GPIO_PINS_SOURCE11);
97 gpio_exint_line_config(GPIO_PORT_SOURCE_GPIOA, GPIO_PINS_SOURCE15);
98
99 exint_default_para_init(&exint_init_struct);
100 exint_init_struct.line_enable = TRUE;
101 exint_init_struct.line_mode = EXINT_LINE_EVENT;
102 exint_init_struct.line_select = EXINT_LINE_11;
103 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
104 exint_init(&exint_init_struct);
105
106 exint_init_struct.line_select = EXINT_LINE_15;
107 exint_init(&exint_init_struct);
108}
109
115static void dma_config(void)
116{
117 dma_init_type dma_init_struct;
118 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
119 nvic_irq_enable(DMA1_Channel1_IRQn, 0, 0);
120 dma_reset(DMA1_CHANNEL1);
121 dma_default_para_init(&dma_init_struct);
122 dma_init_struct.buffer_size = 9;
123 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
124 dma_init_struct.memory_base_addr = (uint32_t)adc1_ordinary_valuetab;
125 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
126 dma_init_struct.memory_inc_enable = TRUE;
127 dma_init_struct.peripheral_base_addr = (uint32_t)&(ADC1->odt);
128 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
129 dma_init_struct.peripheral_inc_enable = FALSE;
130 dma_init_struct.priority = DMA_PRIORITY_HIGH;
131 dma_init_struct.loop_mode_enable = FALSE;
132 dma_init(DMA1_CHANNEL1, &dma_init_struct);
133
134 dma_interrupt_enable(DMA1_CHANNEL1, DMA_FDT_INT, TRUE);
135 dma_channel_enable(DMA1_CHANNEL1, TRUE);
136}
137
143static void adc_config(void)
144{
145 adc_base_config_type adc_base_struct;
146 crm_periph_clock_enable(CRM_ADC1_PERIPH_CLOCK, TRUE);
147 crm_adc_clock_div_set(CRM_ADC_DIV_6);
148 nvic_irq_enable(ADC1_IRQn, 0, 0);
149
150 /* select combine mode */
151 adc_combine_mode_select(ADC_INDEPENDENT_MODE);
152 adc_base_default_para_init(&adc_base_struct);
153 adc_base_struct.sequence_mode = TRUE;
154 adc_base_struct.repeat_mode = FALSE;
155 adc_base_struct.data_align = ADC_RIGHT_ALIGNMENT;
156 adc_base_struct.ordinary_channel_length = 3;
157 adc_base_config(ADC1, &adc_base_struct);
158 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_4, 1, ADC_SAMPLETIME_239_5);
159 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_5, 2, ADC_SAMPLETIME_239_5);
160 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_6, 3, ADC_SAMPLETIME_239_5);
161 adc_ordinary_conversion_trigger_set(ADC1, ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT, TRUE);
162 adc_dma_mode_enable(ADC1, TRUE);
163 adc_ordinary_part_count_set(ADC1, 1);
164 adc_ordinary_part_mode_enable(ADC1, TRUE);
165
166 adc_preempt_channel_length_set(ADC1, 3);
167 adc_preempt_channel_set(ADC1, ADC_CHANNEL_7, 1, ADC_SAMPLETIME_239_5);
168 adc_preempt_channel_set(ADC1, ADC_CHANNEL_8, 2, ADC_SAMPLETIME_239_5);
169 adc_preempt_channel_set(ADC1, ADC_CHANNEL_9, 3, ADC_SAMPLETIME_239_5);
170 adc_preempt_conversion_trigger_set(ADC1, ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4, TRUE);
171 adc_interrupt_enable(ADC1, ADC_PCCE_INT, TRUE);
172
173 adc_enable(ADC1, TRUE);
174 adc_calibration_init(ADC1);
175 while(adc_calibration_init_status_get(ADC1));
176 adc_calibration_start(ADC1);
177 while(adc_calibration_status_get(ADC1));
178}
179
185int main(void)
186{
187 __IO uint32_t index = 0;
188 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
189 system_clock_config();
190 at32_board_init();
191 at32_led_off(LED2);
192 at32_led_off(LED3);
193 at32_led_off(LED4);
194 uart_print_init(115200);
195 gpio_config();
196 exint_config();
197 dma_config();
198 adc_config();
199 printf("exint_trigger_partitioned \r\n");
200 while(dma_trans_complete_flag == 0);
201 while(preempt_trigger_count != 3);
202 for(index = 0; index < 3; index++)
203 {
204 printf("adc1_ordinary_valuetab[%d][0] = 0x%x\r\n",index, adc1_ordinary_valuetab[index][0]);
205 printf("adc1_ordinary_valuetab[%d][1] = 0x%x\r\n",index, adc1_ordinary_valuetab[index][1]);
206 printf("adc1_ordinary_valuetab[%d][2] = 0x%x\r\n",index, adc1_ordinary_valuetab[index][2]);
207 printf("adc1_preempt_valuetab[%d][0] = 0x%x\r\n",index, adc1_preempt_valuetab[index][0]);
208 printf("adc1_preempt_valuetab[%d][1] = 0x%x\r\n",index, adc1_preempt_valuetab[index][1]);
209 printf("adc1_preempt_valuetab[%d][2] = 0x%x\r\n",index, adc1_preempt_valuetab[index][2]);
210 printf("\r\n");
211 }
212 at32_led_on(LED2);
213 while(1)
214 {
215 }
216}
217
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
adc1_preempt_valuetab
__IO uint16_t adc1_preempt_valuetab[3][3]
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:40
dma_trans_complete_flag
__IO uint16_t dma_trans_complete_flag
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:41
dma_config
static void dma_config(void)
dma configuration.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:115
exint_config
static void exint_config(void)
exint configuration.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:75
adc_config
static void adc_config(void)
adc configuration.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:143
adc1_ordinary_valuetab
__IO uint16_t adc1_ordinary_valuetab[3][3]
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:39
preempt_trigger_count
__IO uint16_t preempt_trigger_count
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:42
main
int main(void)
main function.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:185
gpio_config
static void gpio_config(void)
gpio configuration.
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:54
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
adc_base_config
void adc_base_config(adc_type *adc_x, adc_base_config_type *adc_base_struct)
initialize the adc peripheral according to the specified parameters.
Definition: at32f415_adc.c:137
adc_enable
void adc_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the specified adc peripheral.
Definition: at32f415_adc.c:70
adc_ordinary_part_count_set
void adc_ordinary_part_count_set(adc_type *adc_x, uint8_t adc_channel_count)
set partitioned mode channel count of the specified adc peripheral.
Definition: at32f415_adc.c:686
adc_interrupt_enable
void adc_interrupt_enable(adc_type *adc_x, uint32_t adc_int, confirm_state new_state)
enable or disable the specified adc interrupts.
Definition: at32f415_adc.c:173
adc_base_default_para_init
void adc_base_default_para_init(adc_base_config_type *adc_base_struct)
adc base default para init.
Definition: at32f415_adc.c:111
adc_calibration_start
void adc_calibration_start(adc_type *adc_x)
start calibration process of the specified adc peripheral.
Definition: at32f415_adc.c:223
adc_calibration_status_get
flag_status adc_calibration_status_get(adc_type *adc_x)
get calibration status of the specified adc peripheral.
Definition: at32f415_adc.c:235
adc_ordinary_conversion_trigger_set
void adc_ordinary_conversion_trigger_set(adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state)
enable or disable the ordinary channel's external trigger and set external trigger event of the speci...
Definition: at32f415_adc.c:592
adc_preempt_conversion_trigger_set
void adc_preempt_conversion_trigger_set(adc_type *adc_x, adc_preempt_trig_select_type adc_preempt_trig, confirm_state new_state)
enable or disable the preempt channel's external trigger and set external trigger event of the specif...
Definition: at32f415_adc.c:623
adc_calibration_init
void adc_calibration_init(adc_type *adc_x)
initialize calibration register of the specified adc peripheral.
Definition: at32f415_adc.c:192
adc_preempt_channel_set
void adc_preempt_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
configure preempt channel's corresponding rank in the sequencer and sample time of the specified adc ...
Definition: at32f415_adc.c:494
adc_calibration_init_status_get
flag_status adc_calibration_init_status_get(adc_type *adc_x)
get calibration register's initialize status of the specified adc peripheral.
Definition: at32f415_adc.c:204
adc_ordinary_part_mode_enable
void adc_ordinary_part_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the partitioned mode on ordinary channel of the specified adc peripheral.
Definition: at32f415_adc.c:701
adc_dma_mode_enable
void adc_dma_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the adc dma transfer.
Definition: at32f415_adc.c:154
adc_combine_mode_select
void adc_combine_mode_select(adc_combine_mode_type combine_mode)
select combine mode of the specified adc peripheral.
Definition: at32f415_adc.c:91
adc_preempt_channel_length_set
void adc_preempt_channel_length_set(adc_type *adc_x, uint8_t adc_channel_lenght)
set preempt channel lenghth of the specified adc peripheral.
Definition: at32f415_adc.c:462
adc_ordinary_channel_set
void adc_ordinary_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc perip...
Definition: at32f415_adc.c:336
ADC_RIGHT_ALIGNMENT
@ ADC_RIGHT_ALIGNMENT
Definition: at32f415_adc.h:101
ADC_CHANNEL_9
@ ADC_CHANNEL_9
Definition: at32f415_adc.h:119
ADC_CHANNEL_8
@ ADC_CHANNEL_8
Definition: at32f415_adc.h:118
ADC_CHANNEL_4
@ ADC_CHANNEL_4
Definition: at32f415_adc.h:114
ADC_CHANNEL_6
@ ADC_CHANNEL_6
Definition: at32f415_adc.h:116
ADC_CHANNEL_7
@ ADC_CHANNEL_7
Definition: at32f415_adc.h:117
ADC_CHANNEL_5
@ ADC_CHANNEL_5
Definition: at32f415_adc.h:115
ADC_SAMPLETIME_239_5
@ ADC_SAMPLETIME_239_5
Definition: at32f415_adc.h:142
ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4
@ ADC12_PREEMPT_TRIG_EXINT15_TMR1CH4
Definition: at32f415_adc.h:174
ADC_INDEPENDENT_MODE
@ ADC_INDEPENDENT_MODE
Definition: at32f415_adc.h:84
ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT
@ ADC12_ORDINARY_TRIG_EXINT11_TMR1TRGOUT
Definition: at32f415_adc.h:157
ADC_PCCE_INT
#define ADC_PCCE_INT
Definition: at32f415_adc.h:54
ADC1
#define ADC1
Definition: at32f415_adc.h:555
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_adc_clock_div_set
void crm_adc_clock_div_set(crm_adc_div_type div_value)
set crm adc division
Definition: at32f415_crm.c:456
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOC_PERIPH_CLOCK
@ CRM_GPIOC_PERIPH_CLOCK
Definition: at32f415_crm.h:112
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_ADC1_PERIPH_CLOCK
@ CRM_ADC1_PERIPH_CLOCK
Definition: at32f415_crm.h:115
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_ADC_DIV_6
@ CRM_ADC_DIV_6
Definition: at32f415_crm.h:357
ADC1_IRQn
@ ADC1_IRQn
Definition: at32f415.h:154
DMA1_Channel1_IRQn
@ DMA1_Channel1_IRQn
Definition: at32f415.h:146
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_interrupt_enable
void dma_interrupt_enable(dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt
Definition: at32f415_dma.c:165
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_HIGH
@ DMA_PRIORITY_HIGH
Definition: at32f415_dma.h:260
DMA_FDT_INT
#define DMA_FDT_INT
Definition: at32f415_dma.h:52
DMA1_CHANNEL1
#define DMA1_CHANNEL1
Definition: at32f415_dma.h:473
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_EVENT
@ EXINT_LINE_EVENT
Definition: at32f415_exint.h:90
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_15
#define EXINT_LINE_15
Definition: at32f415_exint.h:67
EXINT_LINE_11
#define EXINT_LINE_11
Definition: at32f415_exint.h:63
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_exint_line_config
void gpio_exint_line_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line.
Definition: at32f415_gpio.c:577
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_ANALOG
@ GPIO_MODE_ANALOG
Definition: at32f415_gpio.h:231
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PINS_SOURCE11
@ GPIO_PINS_SOURCE11
Definition: at32f415_gpio.h:279
GPIO_PINS_SOURCE15
@ GPIO_PINS_SOURCE15
Definition: at32f415_gpio.h:283
GPIO_PORT_SOURCE_GPIOA
@ GPIO_PORT_SOURCE_GPIOA
Definition: at32f415_gpio.h:291
GPIO_PORT_SOURCE_GPIOC
@ GPIO_PORT_SOURCE_GPIOC
Definition: at32f415_gpio.h:293
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIO_PINS_11
#define GPIO_PINS_11
Definition: at32f415_gpio.h:62
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_4
#define GPIO_PINS_4
Definition: at32f415_gpio.h:55
GPIO_PINS_1
#define GPIO_PINS_1
Definition: at32f415_gpio.h:52
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOC
#define GPIOC
Definition: at32f415_gpio.h:772
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
adc_base_config_type
adc base config type
Definition: at32f415_adc.h:208
adc_base_config_type::data_align
adc_data_align_type data_align
Definition: at32f415_adc.h:211
adc_base_config_type::repeat_mode
confirm_state repeat_mode
Definition: at32f415_adc.h:210
adc_base_config_type::sequence_mode
confirm_state sequence_mode
Definition: at32f415_adc.h:209
adc_base_config_type::ordinary_channel_length
uint8_t ordinary_channel_length
Definition: at32f415_adc.h:212
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • adc
  • internal_temperature_sensor
  • inc
project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • adc
  • internal_temperature_sensor
  • inc
project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • adc
  • internal_temperature_sensor
  • inc
project/at_start_f415/examples/adc/internal_temperature_sensor/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • adc
  • internal_temperature_sensor
  • src
project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • adc
  • internal_temperature_sensor
  • src
project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31
46void NMI_Handler(void)
47{
48}
49
55void HardFault_Handler(void)
56{
57 /* go to infinite loop when hard fault exception occurs */
58 while(1)
59 {
60 }
61}
62
68void MemManage_Handler(void)
69{
70 /* go to infinite loop when memory manage exception occurs */
71 while(1)
72 {
73 }
74}
75
81void BusFault_Handler(void)
82{
83 /* go to infinite loop when bus fault exception occurs */
84 while(1)
85 {
86 }
87}
88
94void UsageFault_Handler(void)
95{
96 /* go to infinite loop when usage fault exception occurs */
97 while(1)
98 {
99 }
100}
101
107void SVC_Handler(void)
108{
109}
110
116void DebugMon_Handler(void)
117{
118}
119
125void PendSV_Handler(void)
126{
127}
128
134void SysTick_Handler(void)
135{
136}
137
138
139
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c:94
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c:55
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c:68
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c:107
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c:125
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c:46
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c:81
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c:134
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/at32f415_int.c:116
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • adc
  • internal_temperature_sensor
  • src
project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
39#define ADC_VREF (3.3)
40#define ADC_TEMP_BASE (1.26)
41#define ADC_TEMP_SLOPE (-0.00423)
42
43__IO uint16_t adc1_ordinary_value = 0;
44
45static void dma_config(void);
46static void adc_config(void);
47
53static void dma_config(void)
54{
55 dma_init_type dma_init_struct;
56 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
57 dma_reset(DMA1_CHANNEL1);
58 dma_default_para_init(&dma_init_struct);
59 dma_init_struct.buffer_size = 1;
60 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
61 dma_init_struct.memory_base_addr = (uint32_t)&adc1_ordinary_value;
62 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
63 dma_init_struct.memory_inc_enable = FALSE;
64 dma_init_struct.peripheral_base_addr = (uint32_t)&(ADC1->odt);
65 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
66 dma_init_struct.peripheral_inc_enable = FALSE;
67 dma_init_struct.priority = DMA_PRIORITY_HIGH;
68 dma_init_struct.loop_mode_enable = TRUE;
69 dma_init(DMA1_CHANNEL1, &dma_init_struct);
70
71 dma_channel_enable(DMA1_CHANNEL1, TRUE);
72}
73
79static void adc_config(void)
80{
81 adc_base_config_type adc_base_struct;
82 crm_periph_clock_enable(CRM_ADC1_PERIPH_CLOCK, TRUE);
83 crm_adc_clock_div_set(CRM_ADC_DIV_6);
84
85 /* select combine mode */
86 adc_combine_mode_select(ADC_INDEPENDENT_MODE);
87 adc_base_default_para_init(&adc_base_struct);
88 adc_base_struct.sequence_mode = FALSE;
89 adc_base_struct.repeat_mode = TRUE;
90 adc_base_struct.data_align = ADC_RIGHT_ALIGNMENT;
91 adc_base_struct.ordinary_channel_length = 1;
92 adc_base_config(ADC1, &adc_base_struct);
93 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_16, 1, ADC_SAMPLETIME_239_5);
94 adc_ordinary_conversion_trigger_set(ADC1, ADC12_ORDINARY_TRIG_SOFTWARE, TRUE);
95 adc_dma_mode_enable(ADC1, TRUE);
96 adc_tempersensor_vintrv_enable(TRUE);
97
98 adc_enable(ADC1, TRUE);
99 adc_calibration_init(ADC1);
100 while(adc_calibration_init_status_get(ADC1));
101 adc_calibration_start(ADC1);
102 while(adc_calibration_status_get(ADC1));
103}
104
110int main(void)
111{
112 __IO uint32_t index = 0;
113 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
114 system_clock_config();
115 at32_board_init();
116 at32_led_off(LED2);
117 at32_led_off(LED3);
118 at32_led_off(LED4);
119 uart_print_init(115200);
120 dma_config();
121 adc_config();
122 printf("internal_temperature_sensor \r\n");
123 adc_ordinary_software_trigger_enable(ADC1, TRUE);
124 while(1)
125 {
126 at32_led_on(LED2);
127 delay_sec(1);
128 while(dma_flag_get(DMA1_FDT1_FLAG) == RESET);
129 dma_flag_clear(DMA1_FDT1_FLAG);
130 printf("internal_temperature = %f deg C\r\n",(ADC_TEMP_BASE - (double)adc1_ordinary_value * ADC_VREF / 4096) / ADC_TEMP_SLOPE + 25);
131 }
132}
133
134
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
dma_config
static void dma_config(void)
dma configuration.
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c:53
adc1_ordinary_value
__IO uint16_t adc1_ordinary_value
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c:43
adc_config
static void adc_config(void)
adc configuration.
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c:79
ADC_VREF
#define ADC_VREF
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c:39
main
int main(void)
main function.
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c:110
ADC_TEMP_SLOPE
#define ADC_TEMP_SLOPE
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c:41
ADC_TEMP_BASE
#define ADC_TEMP_BASE
Definition: project/at_start_f415/examples/adc/internal_temperature_sensor/src/main.c:40
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
adc_ordinary_software_trigger_enable
void adc_ordinary_software_trigger_enable(adc_type *adc_x, confirm_state new_state)
enable or disable ordinary software start conversion of the specified adc peripheral.
Definition: at32f415_adc.c:755
adc_base_config
void adc_base_config(adc_type *adc_x, adc_base_config_type *adc_base_struct)
initialize the adc peripheral according to the specified parameters.
Definition: at32f415_adc.c:137
adc_tempersensor_vintrv_enable
void adc_tempersensor_vintrv_enable(confirm_state new_state)
enable or disable the temperature sensor and vintrv channel.
Definition: at32f415_adc.c:741
adc_enable
void adc_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the specified adc peripheral.
Definition: at32f415_adc.c:70
adc_base_default_para_init
void adc_base_default_para_init(adc_base_config_type *adc_base_struct)
adc base default para init.
Definition: at32f415_adc.c:111
adc_calibration_start
void adc_calibration_start(adc_type *adc_x)
start calibration process of the specified adc peripheral.
Definition: at32f415_adc.c:223
adc_calibration_status_get
flag_status adc_calibration_status_get(adc_type *adc_x)
get calibration status of the specified adc peripheral.
Definition: at32f415_adc.c:235
adc_ordinary_conversion_trigger_set
void adc_ordinary_conversion_trigger_set(adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state)
enable or disable the ordinary channel's external trigger and set external trigger event of the speci...
Definition: at32f415_adc.c:592
adc_calibration_init
void adc_calibration_init(adc_type *adc_x)
initialize calibration register of the specified adc peripheral.
Definition: at32f415_adc.c:192
adc_calibration_init_status_get
flag_status adc_calibration_init_status_get(adc_type *adc_x)
get calibration register's initialize status of the specified adc peripheral.
Definition: at32f415_adc.c:204
adc_dma_mode_enable
void adc_dma_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the adc dma transfer.
Definition: at32f415_adc.c:154
adc_combine_mode_select
void adc_combine_mode_select(adc_combine_mode_type combine_mode)
select combine mode of the specified adc peripheral.
Definition: at32f415_adc.c:91
adc_ordinary_channel_set
void adc_ordinary_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc perip...
Definition: at32f415_adc.c:336
ADC_RIGHT_ALIGNMENT
@ ADC_RIGHT_ALIGNMENT
Definition: at32f415_adc.h:101
ADC_CHANNEL_16
@ ADC_CHANNEL_16
Definition: at32f415_adc.h:126
ADC_SAMPLETIME_239_5
@ ADC_SAMPLETIME_239_5
Definition: at32f415_adc.h:142
ADC_INDEPENDENT_MODE
@ ADC_INDEPENDENT_MODE
Definition: at32f415_adc.h:84
ADC12_ORDINARY_TRIG_SOFTWARE
@ ADC12_ORDINARY_TRIG_SOFTWARE
Definition: at32f415_adc.h:158
ADC1
#define ADC1
Definition: at32f415_adc.h:555
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
crm_adc_clock_div_set
void crm_adc_clock_div_set(crm_adc_div_type div_value)
set crm adc division
Definition: at32f415_crm.c:456
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_ADC1_PERIPH_CLOCK
@ CRM_ADC1_PERIPH_CLOCK
Definition: at32f415_crm.h:115
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_ADC_DIV_6
@ CRM_ADC_DIV_6
Definition: at32f415_crm.h:357
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_HIGH
@ DMA_PRIORITY_HIGH
Definition: at32f415_dma.h:260
DMA1_FDT1_FLAG
#define DMA1_FDT1_FLAG
Definition: at32f415_dma.h:82
DMA1_CHANNEL1
#define DMA1_CHANNEL1
Definition: at32f415_dma.h:473
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
adc_base_config_type
adc base config type
Definition: at32f415_adc.h:208
adc_base_config_type::data_align
adc_data_align_type data_align
Definition: at32f415_adc.h:211
adc_base_config_type::repeat_mode
confirm_state repeat_mode
Definition: at32f415_adc.h:210
adc_base_config_type::sequence_mode
confirm_state sequence_mode
Definition: at32f415_adc.h:209
adc_base_config_type::ordinary_channel_length
uint8_t ordinary_channel_length
Definition: at32f415_adc.h:212
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • adc
  • software_trigger_repeat
  • inc
project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • adc
  • software_trigger_repeat
  • inc
project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • adc
  • software_trigger_repeat
  • inc
project/at_start_f415/examples/adc/software_trigger_repeat/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • adc
  • software_trigger_repeat
  • src
project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • adc
  • software_trigger_repeat
  • src
project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31extern __IO uint16_t dma_trans_complete_flag;
32
46void NMI_Handler(void)
47{
48}
49
55void HardFault_Handler(void)
56{
57 /* go to infinite loop when hard fault exception occurs */
58 while(1)
59 {
60 }
61}
62
68void MemManage_Handler(void)
69{
70 /* go to infinite loop when memory manage exception occurs */
71 while(1)
72 {
73 }
74}
75
81void BusFault_Handler(void)
82{
83 /* go to infinite loop when bus fault exception occurs */
84 while(1)
85 {
86 }
87}
88
94void UsageFault_Handler(void)
95{
96 /* go to infinite loop when usage fault exception occurs */
97 while(1)
98 {
99 }
100}
101
107void SVC_Handler(void)
108{
109}
110
116void DebugMon_Handler(void)
117{
118}
119
125void PendSV_Handler(void)
126{
127}
128
134void SysTick_Handler(void)
135{
136}
137
143void DMA1_Channel1_IRQHandler(void)
144{
145 if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
146 {
147 dma_flag_clear(DMA1_FDT1_FLAG);
148 dma_trans_complete_flag = 1;
149 }
150}
151
152
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
dma_trans_complete_flag
__IO uint16_t dma_trans_complete_flag
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:41
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c:94
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c:55
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c:68
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c:107
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c:125
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c:46
DMA1_Channel1_IRQHandler
void DMA1_Channel1_IRQHandler(void)
this function handles dma1_channel1 handler.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c:143
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c:81
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c:134
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/at32f415_int.c:116
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
DMA1_FDT1_FLAG
#define DMA1_FDT1_FLAG
Definition: at32f415_dma.h:82
RESET
@ RESET
Definition: at32f415.h:248
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • adc
  • software_trigger_repeat
  • src
project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38__IO uint16_t adc1_ordinary_valuetab[10][3] = {0};
39__IO uint16_t dma_trans_complete_flag = 0;
40
41static void gpio_config(void);
42static void dma_config(void);
43static void adc_config(void);
44
50static void gpio_config(void)
51{
52 gpio_init_type gpio_initstructure;
53 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
54
55 gpio_default_para_init(&gpio_initstructure);
56 gpio_initstructure.gpio_mode = GPIO_MODE_ANALOG;
57 gpio_initstructure.gpio_pins = GPIO_PINS_4 | GPIO_PINS_5 | GPIO_PINS_6;
58 gpio_init(GPIOA, &gpio_initstructure);
59}
60
66static void dma_config(void)
67{
68 dma_init_type dma_init_struct;
69 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
70 nvic_irq_enable(DMA1_Channel1_IRQn, 0, 0);
71 dma_reset(DMA1_CHANNEL1);
72 dma_default_para_init(&dma_init_struct);
73 dma_init_struct.buffer_size = 30;
74 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
75 dma_init_struct.memory_base_addr = (uint32_t)adc1_ordinary_valuetab;
76 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
77 dma_init_struct.memory_inc_enable = TRUE;
78 dma_init_struct.peripheral_base_addr = (uint32_t)&(ADC1->odt);
79 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
80 dma_init_struct.peripheral_inc_enable = FALSE;
81 dma_init_struct.priority = DMA_PRIORITY_HIGH;
82 dma_init_struct.loop_mode_enable = FALSE;
83 dma_init(DMA1_CHANNEL1, &dma_init_struct);
84
85 dma_interrupt_enable(DMA1_CHANNEL1, DMA_FDT_INT, TRUE);
86 dma_channel_enable(DMA1_CHANNEL1, TRUE);
87}
88
94static void adc_config(void)
95{
96 adc_base_config_type adc_base_struct;
97 crm_periph_clock_enable(CRM_ADC1_PERIPH_CLOCK, TRUE);
98 crm_adc_clock_div_set(CRM_ADC_DIV_6);
99
100 /* select combine mode */
101 adc_combine_mode_select(ADC_INDEPENDENT_MODE);
102 adc_base_default_para_init(&adc_base_struct);
103 adc_base_struct.sequence_mode = TRUE;
104 adc_base_struct.repeat_mode = TRUE;
105 adc_base_struct.data_align = ADC_RIGHT_ALIGNMENT;
106 adc_base_struct.ordinary_channel_length = 3;
107 adc_base_config(ADC1, &adc_base_struct);
108 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_4, 1, ADC_SAMPLETIME_239_5);
109 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_5, 2, ADC_SAMPLETIME_239_5);
110 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_6, 3, ADC_SAMPLETIME_239_5);
111 adc_ordinary_conversion_trigger_set(ADC1, ADC12_ORDINARY_TRIG_SOFTWARE, TRUE);
112 adc_dma_mode_enable(ADC1, TRUE);
113
114 adc_enable(ADC1, TRUE);
115 adc_calibration_init(ADC1);
116 while(adc_calibration_init_status_get(ADC1));
117 adc_calibration_start(ADC1);
118 while(adc_calibration_status_get(ADC1));
119}
120
126int main(void)
127{
128 __IO uint32_t index = 0;
129 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
130 system_clock_config();
131 at32_board_init();
132 at32_led_off(LED2);
133 at32_led_off(LED3);
134 at32_led_off(LED4);
135 uart_print_init(115200);
136 gpio_config();
137 dma_config();
138 adc_config();
139 printf("software_trigger_repeat \r\n");
140 adc_ordinary_software_trigger_enable(ADC1, TRUE);
141 while(dma_trans_complete_flag == 0);
142 for(index = 0; index < 10; index++)
143 {
144 printf("adc1_ordinary_valuetab[%d][0] = 0x%x\r\n", index, adc1_ordinary_valuetab[index][0]);
145 printf("adc1_ordinary_valuetab[%d][1] = 0x%x\r\n", index, adc1_ordinary_valuetab[index][1]);
146 printf("adc1_ordinary_valuetab[%d][2] = 0x%x\r\n", index, adc1_ordinary_valuetab[index][2]);
147 }
148 at32_led_on(LED2);
149 while(1)
150 {
151 }
152}
153
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
dma_trans_complete_flag
__IO uint16_t dma_trans_complete_flag
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c:39
dma_config
static void dma_config(void)
dma configuration.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c:66
adc_config
static void adc_config(void)
adc configuration.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c:94
main
int main(void)
main function.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c:126
adc1_ordinary_valuetab
__IO uint16_t adc1_ordinary_valuetab[10][3]
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c:38
gpio_config
static void gpio_config(void)
gpio configuration.
Definition: project/at_start_f415/examples/adc/software_trigger_repeat/src/main.c:50
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
adc_ordinary_software_trigger_enable
void adc_ordinary_software_trigger_enable(adc_type *adc_x, confirm_state new_state)
enable or disable ordinary software start conversion of the specified adc peripheral.
Definition: at32f415_adc.c:755
adc_base_config
void adc_base_config(adc_type *adc_x, adc_base_config_type *adc_base_struct)
initialize the adc peripheral according to the specified parameters.
Definition: at32f415_adc.c:137
adc_enable
void adc_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the specified adc peripheral.
Definition: at32f415_adc.c:70
adc_base_default_para_init
void adc_base_default_para_init(adc_base_config_type *adc_base_struct)
adc base default para init.
Definition: at32f415_adc.c:111
adc_calibration_start
void adc_calibration_start(adc_type *adc_x)
start calibration process of the specified adc peripheral.
Definition: at32f415_adc.c:223
adc_calibration_status_get
flag_status adc_calibration_status_get(adc_type *adc_x)
get calibration status of the specified adc peripheral.
Definition: at32f415_adc.c:235
adc_ordinary_conversion_trigger_set
void adc_ordinary_conversion_trigger_set(adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state)
enable or disable the ordinary channel's external trigger and set external trigger event of the speci...
Definition: at32f415_adc.c:592
adc_calibration_init
void adc_calibration_init(adc_type *adc_x)
initialize calibration register of the specified adc peripheral.
Definition: at32f415_adc.c:192
adc_calibration_init_status_get
flag_status adc_calibration_init_status_get(adc_type *adc_x)
get calibration register's initialize status of the specified adc peripheral.
Definition: at32f415_adc.c:204
adc_dma_mode_enable
void adc_dma_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the adc dma transfer.
Definition: at32f415_adc.c:154
adc_combine_mode_select
void adc_combine_mode_select(adc_combine_mode_type combine_mode)
select combine mode of the specified adc peripheral.
Definition: at32f415_adc.c:91
adc_ordinary_channel_set
void adc_ordinary_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc perip...
Definition: at32f415_adc.c:336
ADC_RIGHT_ALIGNMENT
@ ADC_RIGHT_ALIGNMENT
Definition: at32f415_adc.h:101
ADC_CHANNEL_4
@ ADC_CHANNEL_4
Definition: at32f415_adc.h:114
ADC_CHANNEL_6
@ ADC_CHANNEL_6
Definition: at32f415_adc.h:116
ADC_CHANNEL_5
@ ADC_CHANNEL_5
Definition: at32f415_adc.h:115
ADC_SAMPLETIME_239_5
@ ADC_SAMPLETIME_239_5
Definition: at32f415_adc.h:142
ADC_INDEPENDENT_MODE
@ ADC_INDEPENDENT_MODE
Definition: at32f415_adc.h:84
ADC12_ORDINARY_TRIG_SOFTWARE
@ ADC12_ORDINARY_TRIG_SOFTWARE
Definition: at32f415_adc.h:158
ADC1
#define ADC1
Definition: at32f415_adc.h:555
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_adc_clock_div_set
void crm_adc_clock_div_set(crm_adc_div_type div_value)
set crm adc division
Definition: at32f415_crm.c:456
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_ADC1_PERIPH_CLOCK
@ CRM_ADC1_PERIPH_CLOCK
Definition: at32f415_crm.h:115
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_ADC_DIV_6
@ CRM_ADC_DIV_6
Definition: at32f415_crm.h:357
DMA1_Channel1_IRQn
@ DMA1_Channel1_IRQn
Definition: at32f415.h:146
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_interrupt_enable
void dma_interrupt_enable(dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt
Definition: at32f415_dma.c:165
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_HIGH
@ DMA_PRIORITY_HIGH
Definition: at32f415_dma.h:260
DMA_FDT_INT
#define DMA_FDT_INT
Definition: at32f415_dma.h:52
DMA1_CHANNEL1
#define DMA1_CHANNEL1
Definition: at32f415_dma.h:473
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_ANALOG
@ GPIO_MODE_ANALOG
Definition: at32f415_gpio.h:231
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_4
#define GPIO_PINS_4
Definition: at32f415_gpio.h:55
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
adc_base_config_type
adc base config type
Definition: at32f415_adc.h:208
adc_base_config_type::data_align
adc_data_align_type data_align
Definition: at32f415_adc.h:211
adc_base_config_type::repeat_mode
confirm_state repeat_mode
Definition: at32f415_adc.h:210
adc_base_config_type::sequence_mode
confirm_state sequence_mode
Definition: at32f415_adc.h:209
adc_base_config_type::ordinary_channel_length
uint8_t ordinary_channel_length
Definition: at32f415_adc.h:212
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • adc
  • tmr_trigger_automatic_preempted
  • inc
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • adc
  • tmr_trigger_automatic_preempted
  • inc
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • adc
  • tmr_trigger_automatic_preempted
  • inc
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • adc
  • tmr_trigger_automatic_preempted
  • src
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • adc
  • tmr_trigger_automatic_preempted
  • src
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31extern __IO uint16_t adc1_ordinary_valuetab[5][3];
32extern __IO uint16_t adc1_preempt_valuetab[5][3];
33extern __IO uint16_t dma_trans_complete_flag;
34extern __IO uint16_t preempt_conversion_count;
35
49void NMI_Handler(void)
50{
51}
52
58void HardFault_Handler(void)
59{
60 /* go to infinite loop when hard fault exception occurs */
61 while(1)
62 {
63 }
64}
65
71void MemManage_Handler(void)
72{
73 /* go to infinite loop when memory manage exception occurs */
74 while(1)
75 {
76 }
77}
78
84void BusFault_Handler(void)
85{
86 /* go to infinite loop when bus fault exception occurs */
87 while(1)
88 {
89 }
90}
91
97void UsageFault_Handler(void)
98{
99 /* go to infinite loop when usage fault exception occurs */
100 while(1)
101 {
102 }
103}
104
110void SVC_Handler(void)
111{
112}
113
119void DebugMon_Handler(void)
120{
121}
122
128void PendSV_Handler(void)
129{
130}
131
137void SysTick_Handler(void)
138{
139}
140
146void DMA1_Channel1_IRQHandler(void)
147{
148 if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
149 {
150 dma_flag_clear(DMA1_FDT1_FLAG);
151 dma_trans_complete_flag = 1;
152 }
153}
154
160void ADC1_IRQHandler(void)
161{
162 if(adc_flag_get(ADC1, ADC_PCCE_FLAG) != RESET)
163 {
164 adc_flag_clear(ADC1, ADC_PCCE_FLAG);
165 if(preempt_conversion_count < 5)
166 {
167 adc1_preempt_valuetab[preempt_conversion_count][0] = adc_preempt_conversion_data_get(ADC1, ADC_PREEMPT_CHANNEL_1);
168 adc1_preempt_valuetab[preempt_conversion_count][1] = adc_preempt_conversion_data_get(ADC1, ADC_PREEMPT_CHANNEL_2);
169 adc1_preempt_valuetab[preempt_conversion_count][2] = adc_preempt_conversion_data_get(ADC1, ADC_PREEMPT_CHANNEL_3);
170 preempt_conversion_count++;
171 }
172 at32_led_toggle(LED3);
173 }
174}
175
176
177
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
adc1_preempt_valuetab
__IO uint16_t adc1_preempt_valuetab[5][3]
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:40
dma_trans_complete_flag
__IO uint16_t dma_trans_complete_flag
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:41
adc1_ordinary_valuetab
__IO uint16_t adc1_ordinary_valuetab[5][3]
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:39
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c:97
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c:58
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c:71
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c:110
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c:128
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c:49
DMA1_Channel1_IRQHandler
void DMA1_Channel1_IRQHandler(void)
this function handles dma1_channel1 handler.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c:146
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c:84
ADC1_IRQHandler
void ADC1_IRQHandler(void)
this function handles adc1_2 handler.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c:160
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c:137
preempt_conversion_count
__IO uint16_t preempt_conversion_count
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c:42
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/at32f415_int.c:119
adc_preempt_conversion_data_get
uint16_t adc_preempt_conversion_data_get(adc_type *adc_x, adc_preempt_channel_type adc_preempt_channel)
return the conversion data for selection preempt channel of the specified adc peripheral.
Definition: at32f415_adc.c:846
adc_flag_clear
void adc_flag_clear(adc_type *adc_x, uint32_t adc_flag)
clear flag of the specified adc peripheral.
Definition: at32f415_adc.c:912
adc_flag_get
flag_status adc_flag_get(adc_type *adc_x, uint8_t adc_flag)
get flag of the specified adc peripheral.
Definition: at32f415_adc.c:883
ADC_PREEMPT_CHANNEL_3
@ ADC_PREEMPT_CHANNEL_3
Definition: at32f415_adc.h:186
ADC_PREEMPT_CHANNEL_2
@ ADC_PREEMPT_CHANNEL_2
Definition: at32f415_adc.h:185
ADC_PREEMPT_CHANNEL_1
@ ADC_PREEMPT_CHANNEL_1
Definition: at32f415_adc.h:184
ADC_PCCE_FLAG
#define ADC_PCCE_FLAG
Definition: at32f415_adc.h:67
ADC1
#define ADC1
Definition: at32f415_adc.h:555
LED3
@ LED3
Definition: at32f415_board.h:64
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
DMA1_FDT1_FLAG
#define DMA1_FDT1_FLAG
Definition: at32f415_dma.h:82
RESET
@ RESET
Definition: at32f415.h:248
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • adc
  • tmr_trigger_automatic_preempted
  • src
project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
39__IO uint16_t adc1_ordinary_valuetab[5][3] = {0};
40__IO uint16_t adc1_preempt_valuetab[5][3] = {0};
41__IO uint16_t dma_trans_complete_flag = 0;
42__IO uint16_t preempt_conversion_count = 0;
43
44static void gpio_config(void);
45static void dma_config(void);
46static void tmr1_config(void);
47static void adc_config(void);
48
54static void gpio_config(void)
55{
56 gpio_init_type gpio_initstructure;
57 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
58 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
59
60 gpio_default_para_init(&gpio_initstructure);
61 gpio_initstructure.gpio_mode = GPIO_MODE_ANALOG;
62 gpio_initstructure.gpio_pins = GPIO_PINS_4 | GPIO_PINS_5 | GPIO_PINS_6 | GPIO_PINS_7;
63 gpio_init(GPIOA, &gpio_initstructure);
64
65 gpio_initstructure.gpio_mode = GPIO_MODE_ANALOG;
66 gpio_initstructure.gpio_pins = GPIO_PINS_0 | GPIO_PINS_1;
67 gpio_init(GPIOB, &gpio_initstructure);
68}
69
75static void dma_config(void)
76{
77 dma_init_type dma_init_struct;
78 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
79 nvic_irq_enable(DMA1_Channel1_IRQn, 0, 0);
80 dma_reset(DMA1_CHANNEL1);
81 dma_default_para_init(&dma_init_struct);
82 dma_init_struct.buffer_size = 15;
83 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
84 dma_init_struct.memory_base_addr = (uint32_t)adc1_ordinary_valuetab;
85 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
86 dma_init_struct.memory_inc_enable = TRUE;
87 dma_init_struct.peripheral_base_addr = (uint32_t)&(ADC1->odt);
88 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
89 dma_init_struct.peripheral_inc_enable = FALSE;
90 dma_init_struct.priority = DMA_PRIORITY_HIGH;
91 dma_init_struct.loop_mode_enable = FALSE;
92 dma_init(DMA1_CHANNEL1, &dma_init_struct);
93
94 dma_interrupt_enable(DMA1_CHANNEL1, DMA_FDT_INT, TRUE);
95 dma_channel_enable(DMA1_CHANNEL1, TRUE);
96}
97
103static void tmr1_config(void)
104{
105 gpio_init_type gpio_initstructure;
106 tmr_output_config_type tmr_oc_init_structure;
107 crm_clocks_freq_type crm_clocks_freq_struct = {0};
108 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
109
110 gpio_default_para_init(&gpio_initstructure);
111 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
112 gpio_initstructure.gpio_pins = GPIO_PINS_8;
113 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
114 gpio_initstructure.gpio_pull = GPIO_PULL_NONE;
115 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
116 gpio_init(GPIOA, &gpio_initstructure);
117
118 /* get system clock */
119 crm_clocks_freq_get(&crm_clocks_freq_struct);
120
121 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
122
123 /* (systemclock/(systemclock/10000))/1000 = 10Hz(100ms) */
124 tmr_base_init(TMR1, 999, (crm_clocks_freq_struct.sclk_freq/10000 - 1));
125 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
126 tmr_clock_source_div_set(TMR1, TMR_CLOCK_DIV1);
127
128 tmr_output_default_para_init(&tmr_oc_init_structure);
129 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_A;
130 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_LOW;
131 tmr_oc_init_structure.oc_output_state = TRUE;
132 tmr_oc_init_structure.oc_idle_state = FALSE;
133 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
134 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_1, 500);
135}
136
142static void adc_config(void)
143{
144 adc_base_config_type adc_base_struct;
145 crm_periph_clock_enable(CRM_ADC1_PERIPH_CLOCK, TRUE);
146 crm_adc_clock_div_set(CRM_ADC_DIV_6);
147 nvic_irq_enable(ADC1_IRQn, 0, 0);
148
149 /* select combine mode */
150 adc_combine_mode_select(ADC_INDEPENDENT_MODE);
151 adc_base_default_para_init(&adc_base_struct);
152 adc_base_struct.sequence_mode = TRUE;
153 adc_base_struct.repeat_mode = FALSE;
154 adc_base_struct.data_align = ADC_RIGHT_ALIGNMENT;
155 adc_base_struct.ordinary_channel_length = 3;
156 adc_base_config(ADC1, &adc_base_struct);
157 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_4, 1, ADC_SAMPLETIME_239_5);
158 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_5, 2, ADC_SAMPLETIME_239_5);
159 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_6, 3, ADC_SAMPLETIME_239_5);
160 adc_ordinary_conversion_trigger_set(ADC1, ADC12_ORDINARY_TRIG_TMR1CH1, TRUE);
161 adc_dma_mode_enable(ADC1, TRUE);
162
163 adc_preempt_channel_length_set(ADC1, 3);
164 adc_preempt_channel_set(ADC1, ADC_CHANNEL_7, 1, ADC_SAMPLETIME_239_5);
165 adc_preempt_channel_set(ADC1, ADC_CHANNEL_8, 2, ADC_SAMPLETIME_239_5);
166 adc_preempt_channel_set(ADC1, ADC_CHANNEL_9, 3, ADC_SAMPLETIME_239_5);
167 adc_preempt_conversion_trigger_set(ADC1, ADC12_PREEMPT_TRIG_SOFTWARE, TRUE);
168 adc_preempt_auto_mode_enable(ADC1, TRUE);
169 adc_interrupt_enable(ADC1, ADC_PCCE_INT, TRUE);
170
171 adc_enable(ADC1, TRUE);
172 adc_calibration_init(ADC1);
173 while(adc_calibration_init_status_get(ADC1));
174 adc_calibration_start(ADC1);
175 while(adc_calibration_status_get(ADC1));
176}
177
178
179
180
186int main(void)
187{
188 __IO uint32_t index = 0;
189 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
190 system_clock_config();
191 at32_board_init();
192 at32_led_off(LED2);
193 at32_led_off(LED3);
194 at32_led_off(LED4);
195 uart_print_init(115200);
196 gpio_config();
197 tmr1_config();
198 dma_config();
199 adc_config();
200 printf("tmr_trigger_automatic_preempted \r\n");
201 tmr_counter_enable(TMR1, TRUE);
202 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_1, TRUE);
203 tmr_output_enable(TMR1, TRUE);
204 while(preempt_conversion_count < 5);
205 while(dma_trans_complete_flag == 0);
206 tmr_counter_enable(TMR1, FALSE);
207 for(index = 0; index < 5; index++)
208 {
209 printf("adc1_ordinary_valuetab[%d][0] = 0x%x\r\n", index, adc1_ordinary_valuetab[index][0]);
210 printf("adc1_ordinary_valuetab[%d][1] = 0x%x\r\n", index, adc1_ordinary_valuetab[index][1]);
211 printf("adc1_ordinary_valuetab[%d][2] = 0x%x\r\n", index, adc1_ordinary_valuetab[index][2]);
212 printf("adc1_preempted_valuetab[%d][0] = 0x%x\r\n", index, adc1_preempt_valuetab[index][0]);
213 printf("adc1_preempted_valuetab[%d][1] = 0x%x\r\n", index, adc1_preempt_valuetab[index][1]);
214 printf("adc1_preempted_valuetab[%d][2] = 0x%x\r\n", index, adc1_preempt_valuetab[index][2]);
215 printf("\r\n");
216 }
217 at32_led_on(LED2);
218 while(1)
219 {
220 }
221}
222
223
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
dma_trans_complete_flag
__IO uint16_t dma_trans_complete_flag
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c:41
dma_config
static void dma_config(void)
dma configuration.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c:75
adc1_preempt_valuetab
__IO uint16_t adc1_preempt_valuetab[5][3]
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c:40
adc1_ordinary_valuetab
__IO uint16_t adc1_ordinary_valuetab[5][3]
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c:39
adc_config
static void adc_config(void)
adc configuration.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c:142
main
int main(void)
main function.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c:186
tmr1_config
static void tmr1_config(void)
tmr1 configuration.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c:103
preempt_conversion_count
__IO uint16_t preempt_conversion_count
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c:42
gpio_config
static void gpio_config(void)
gpio configuration.
Definition: project/at_start_f415/examples/adc/tmr_trigger_automatic_preempted/src/main.c:54
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/debug/tmr1/src/main.c:39
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:38
adc_base_config
void adc_base_config(adc_type *adc_x, adc_base_config_type *adc_base_struct)
initialize the adc peripheral according to the specified parameters.
Definition: at32f415_adc.c:137
adc_preempt_auto_mode_enable
void adc_preempt_auto_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable automatic preempt group conversion of the specified adc peripheral.
Definition: at32f415_adc.c:729
adc_enable
void adc_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the specified adc peripheral.
Definition: at32f415_adc.c:70
adc_interrupt_enable
void adc_interrupt_enable(adc_type *adc_x, uint32_t adc_int, confirm_state new_state)
enable or disable the specified adc interrupts.
Definition: at32f415_adc.c:173
adc_base_default_para_init
void adc_base_default_para_init(adc_base_config_type *adc_base_struct)
adc base default para init.
Definition: at32f415_adc.c:111
adc_calibration_start
void adc_calibration_start(adc_type *adc_x)
start calibration process of the specified adc peripheral.
Definition: at32f415_adc.c:223
adc_calibration_status_get
flag_status adc_calibration_status_get(adc_type *adc_x)
get calibration status of the specified adc peripheral.
Definition: at32f415_adc.c:235
adc_ordinary_conversion_trigger_set
void adc_ordinary_conversion_trigger_set(adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state)
enable or disable the ordinary channel's external trigger and set external trigger event of the speci...
Definition: at32f415_adc.c:592
adc_preempt_conversion_trigger_set
void adc_preempt_conversion_trigger_set(adc_type *adc_x, adc_preempt_trig_select_type adc_preempt_trig, confirm_state new_state)
enable or disable the preempt channel's external trigger and set external trigger event of the specif...
Definition: at32f415_adc.c:623
adc_calibration_init
void adc_calibration_init(adc_type *adc_x)
initialize calibration register of the specified adc peripheral.
Definition: at32f415_adc.c:192
adc_preempt_channel_set
void adc_preempt_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
configure preempt channel's corresponding rank in the sequencer and sample time of the specified adc ...
Definition: at32f415_adc.c:494
adc_calibration_init_status_get
flag_status adc_calibration_init_status_get(adc_type *adc_x)
get calibration register's initialize status of the specified adc peripheral.
Definition: at32f415_adc.c:204
adc_dma_mode_enable
void adc_dma_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the adc dma transfer.
Definition: at32f415_adc.c:154
adc_combine_mode_select
void adc_combine_mode_select(adc_combine_mode_type combine_mode)
select combine mode of the specified adc peripheral.
Definition: at32f415_adc.c:91
adc_preempt_channel_length_set
void adc_preempt_channel_length_set(adc_type *adc_x, uint8_t adc_channel_lenght)
set preempt channel lenghth of the specified adc peripheral.
Definition: at32f415_adc.c:462
adc_ordinary_channel_set
void adc_ordinary_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc perip...
Definition: at32f415_adc.c:336
ADC_RIGHT_ALIGNMENT
@ ADC_RIGHT_ALIGNMENT
Definition: at32f415_adc.h:101
ADC_CHANNEL_9
@ ADC_CHANNEL_9
Definition: at32f415_adc.h:119
ADC_CHANNEL_8
@ ADC_CHANNEL_8
Definition: at32f415_adc.h:118
ADC_CHANNEL_4
@ ADC_CHANNEL_4
Definition: at32f415_adc.h:114
ADC_CHANNEL_6
@ ADC_CHANNEL_6
Definition: at32f415_adc.h:116
ADC_CHANNEL_7
@ ADC_CHANNEL_7
Definition: at32f415_adc.h:117
ADC_CHANNEL_5
@ ADC_CHANNEL_5
Definition: at32f415_adc.h:115
ADC_SAMPLETIME_239_5
@ ADC_SAMPLETIME_239_5
Definition: at32f415_adc.h:142
ADC12_PREEMPT_TRIG_SOFTWARE
@ ADC12_PREEMPT_TRIG_SOFTWARE
Definition: at32f415_adc.h:175
ADC_INDEPENDENT_MODE
@ ADC_INDEPENDENT_MODE
Definition: at32f415_adc.h:84
ADC12_ORDINARY_TRIG_TMR1CH1
@ ADC12_ORDINARY_TRIG_TMR1CH1
Definition: at32f415_adc.h:151
ADC_PCCE_INT
#define ADC_PCCE_INT
Definition: at32f415_adc.h:54
ADC1
#define ADC1
Definition: at32f415_adc.h:555
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_adc_clock_div_set
void crm_adc_clock_div_set(crm_adc_div_type div_value)
set crm adc division
Definition: at32f415_crm.c:456
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_ADC1_PERIPH_CLOCK
@ CRM_ADC1_PERIPH_CLOCK
Definition: at32f415_crm.h:115
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
CRM_ADC_DIV_6
@ CRM_ADC_DIV_6
Definition: at32f415_crm.h:357
ADC1_IRQn
@ ADC1_IRQn
Definition: at32f415.h:154
DMA1_Channel1_IRQn
@ DMA1_Channel1_IRQn
Definition: at32f415.h:146
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_interrupt_enable
void dma_interrupt_enable(dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt
Definition: at32f415_dma.c:165
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_HIGH
@ DMA_PRIORITY_HIGH
Definition: at32f415_dma.h:260
DMA_FDT_INT
#define DMA_FDT_INT
Definition: at32f415_dma.h:52
DMA1_CHANNEL1
#define DMA1_CHANNEL1
Definition: at32f415_dma.h:473
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_ANALOG
@ GPIO_MODE_ANALOG
Definition: at32f415_gpio.h:231
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_4
#define GPIO_PINS_4
Definition: at32f415_gpio.h:55
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIO_PINS_1
#define GPIO_PINS_1
Definition: at32f415_gpio.h:52
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_output_enable
void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable
Definition: at32f415_tmr.c:1382
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_enable
void tmr_channel_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
tmr channel enable
Definition: at32f415_tmr.c:847
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_PWM_MODE_A
@ TMR_OUTPUT_CONTROL_PWM_MODE_A
Definition: at32f415_tmr.h:179
TMR_OUTPUT_ACTIVE_LOW
@ TMR_OUTPUT_ACTIVE_LOW
Definition: at32f415_tmr.h:198
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
adc_base_config_type
adc base config type
Definition: at32f415_adc.h:208
adc_base_config_type::data_align
adc_data_align_type data_align
Definition: at32f415_adc.h:211
adc_base_config_type::repeat_mode
confirm_state repeat_mode
Definition: at32f415_adc.h:210
adc_base_config_type::sequence_mode
confirm_state sequence_mode
Definition: at32f415_adc.h:209
adc_base_config_type::ordinary_channel_length
uint8_t ordinary_channel_length
Definition: at32f415_adc.h:212
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::sclk_freq
uint32_t sclk_freq
Definition: at32f415_crm.h:472
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • adc
  • voltage_monitoring
  • inc
project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • adc
  • voltage_monitoring
  • inc
project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • adc
  • voltage_monitoring
  • inc
project/at_start_f415/examples/adc/voltage_monitoring/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • adc
  • voltage_monitoring
  • src
project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • adc
  • voltage_monitoring
  • src
project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31extern __IO uint16_t adc1_ordinary_valuetab[3];
32extern __IO uint16_t vmor_flag_index;
33
48void NMI_Handler(void)
49{
50}
51
57void HardFault_Handler(void)
58{
59 /* go to infinite loop when hard fault exception occurs */
60 while(1)
61 {
62 }
63}
64
70void MemManage_Handler(void)
71{
72 /* go to infinite loop when memory manage exception occurs */
73 while(1)
74 {
75 }
76}
77
83void BusFault_Handler(void)
84{
85 /* go to infinite loop when bus fault exception occurs */
86 while(1)
87 {
88 }
89}
90
96void UsageFault_Handler(void)
97{
98 /* go to infinite loop when usage fault exception occurs */
99 while(1)
100 {
101 }
102}
103
109void SVC_Handler(void)
110{
111}
112
118void DebugMon_Handler(void)
119{
120}
121
127void PendSV_Handler(void)
128{
129}
130
136void SysTick_Handler(void)
137{
138}
139
145void ADC1_IRQHandler(void)
146{
147 if(adc_flag_get(ADC1, ADC_VMOR_FLAG) != RESET)
148 {
149 at32_led_toggle(LED3);
150 adc_flag_clear(ADC1, ADC_VMOR_FLAG);
151 vmor_flag_index = 1;
152 }
153}
154
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
adc1_ordinary_valuetab
__IO uint16_t adc1_ordinary_valuetab[3]
Definition: project/at_start_f415/examples/adc/exint_trigger_partitioned/src/main.c:39
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c:96
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c:57
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c:70
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c:109
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c:127
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c:48
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c:83
ADC1_IRQHandler
void ADC1_IRQHandler(void)
this function handles adc1_2 handler.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c:145
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c:136
vmor_flag_index
__IO uint16_t vmor_flag_index
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/main.c:39
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/at32f415_int.c:118
adc_flag_clear
void adc_flag_clear(adc_type *adc_x, uint32_t adc_flag)
clear flag of the specified adc peripheral.
Definition: at32f415_adc.c:912
adc_flag_get
flag_status adc_flag_get(adc_type *adc_x, uint8_t adc_flag)
get flag of the specified adc peripheral.
Definition: at32f415_adc.c:883
ADC_VMOR_FLAG
#define ADC_VMOR_FLAG
Definition: at32f415_adc.h:65
ADC1
#define ADC1
Definition: at32f415_adc.h:555
LED3
@ LED3
Definition: at32f415_board.h:64
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
RESET
@ RESET
Definition: at32f415.h:248
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • adc
  • voltage_monitoring
  • src
project/at_start_f415/examples/adc/voltage_monitoring/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38__IO uint16_t adc1_ordinary_valuetab[3] = {0};
39__IO uint16_t vmor_flag_index = 0;
40
41static void gpio_config(void);
42static void dma_config(void);
43static void adc_config(void);
44
50static void gpio_config(void)
51{
52 gpio_init_type gpio_initstructure;
53 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
54
55 gpio_default_para_init(&gpio_initstructure);
56 gpio_initstructure.gpio_mode = GPIO_MODE_ANALOG;
57 gpio_initstructure.gpio_pins = GPIO_PINS_4 | GPIO_PINS_5 | GPIO_PINS_6;
58 gpio_init(GPIOA, &gpio_initstructure);
59}
60
66static void dma_config(void)
67{
68 dma_init_type dma_init_struct;
69 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
70 dma_reset(DMA1_CHANNEL1);
71 dma_default_para_init(&dma_init_struct);
72 dma_init_struct.buffer_size = 3;
73 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
74 dma_init_struct.memory_base_addr = (uint32_t)adc1_ordinary_valuetab;
75 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
76 dma_init_struct.memory_inc_enable = TRUE;
77 dma_init_struct.peripheral_base_addr = (uint32_t)&(ADC1->odt);
78 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
79 dma_init_struct.peripheral_inc_enable = FALSE;
80 dma_init_struct.priority = DMA_PRIORITY_HIGH;
81 dma_init_struct.loop_mode_enable = TRUE;
82 dma_init(DMA1_CHANNEL1, &dma_init_struct);
83
84 dma_channel_enable(DMA1_CHANNEL1, TRUE);
85}
86
92static void adc_config(void)
93{
94 adc_base_config_type adc_base_struct;
95 crm_periph_clock_enable(CRM_ADC1_PERIPH_CLOCK, TRUE);
96 crm_adc_clock_div_set(CRM_ADC_DIV_6);
97 nvic_irq_enable(ADC1_IRQn, 0, 0);
98
99 /* select combine mode */
100 adc_combine_mode_select(ADC_INDEPENDENT_MODE);
101 adc_base_default_para_init(&adc_base_struct);
102 adc_base_struct.sequence_mode = TRUE;
103 adc_base_struct.repeat_mode = FALSE;
104 adc_base_struct.data_align = ADC_RIGHT_ALIGNMENT;
105 adc_base_struct.ordinary_channel_length = 3;
106 adc_base_config(ADC1, &adc_base_struct);
107 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_4, 1, ADC_SAMPLETIME_239_5);
108 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_5, 2, ADC_SAMPLETIME_239_5);
109 adc_ordinary_channel_set(ADC1, ADC_CHANNEL_6, 3, ADC_SAMPLETIME_239_5);
110 adc_ordinary_conversion_trigger_set(ADC1, ADC12_ORDINARY_TRIG_SOFTWARE, TRUE);
111 adc_dma_mode_enable(ADC1, TRUE);
112 adc_voltage_monitor_enable(ADC1, ADC_VMONITOR_SINGLE_ORDINARY);
113 adc_voltage_monitor_threshold_value_set(ADC1, 0xBBB, 0xAAA);
114 adc_voltage_monitor_single_channel_select(ADC1, ADC_CHANNEL_5);
115 adc_interrupt_enable(ADC1, ADC_VMOR_INT, TRUE);
116
117 adc_enable(ADC1, TRUE);
118 adc_calibration_init(ADC1);
119 while(adc_calibration_init_status_get(ADC1));
120 adc_calibration_start(ADC1);
121 while(adc_calibration_status_get(ADC1));
122}
123
129int main(void)
130{
131 __IO uint32_t index = 0;
132 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
133 system_clock_config();
134 at32_board_init();
135 at32_led_off(LED2);
136 at32_led_off(LED3);
137 at32_led_off(LED4);
138 uart_print_init(115200);
139 gpio_config();
140 dma_config();
141 adc_config();
142 printf("voltage_monitoring \r\n");
143 while(1)
144 {
145 at32_led_toggle(LED2);
146 delay_sec(1);
147 if(vmor_flag_index == 1)
148 {
149 vmor_flag_index = 0;
150 printf("out of range:adc1_channel_5 value is = %x!\r\n", adc1_ordinary_valuetab[1]);
151 }
152 adc_ordinary_software_trigger_enable(ADC1, TRUE);
153 }
154}
155
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
dma_config
static void dma_config(void)
dma configuration.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/main.c:66
adc_config
static void adc_config(void)
adc configuration.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/main.c:92
main
int main(void)
main function.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/main.c:129
adc1_ordinary_valuetab
__IO uint16_t adc1_ordinary_valuetab[3]
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/main.c:38
vmor_flag_index
__IO uint16_t vmor_flag_index
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/main.c:39
gpio_config
static void gpio_config(void)
gpio configuration.
Definition: project/at_start_f415/examples/adc/voltage_monitoring/src/main.c:50
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
adc_ordinary_software_trigger_enable
void adc_ordinary_software_trigger_enable(adc_type *adc_x, confirm_state new_state)
enable or disable ordinary software start conversion of the specified adc peripheral.
Definition: at32f415_adc.c:755
adc_voltage_monitor_enable
void adc_voltage_monitor_enable(adc_type *adc_x, adc_voltage_monitoring_type adc_voltage_monitoring)
enable or disable the voltage monitoring on single/all ordinary or preempt channels of the specified ...
Definition: at32f415_adc.c:263
adc_voltage_monitor_single_channel_select
void adc_voltage_monitor_single_channel_select(adc_type *adc_x, adc_channel_select_type adc_channel)
select the voltage monitoring's channel of the specified adc peripheral.
Definition: at32f415_adc.c:304
adc_base_config
void adc_base_config(adc_type *adc_x, adc_base_config_type *adc_base_struct)
initialize the adc peripheral according to the specified parameters.
Definition: at32f415_adc.c:137
adc_enable
void adc_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the specified adc peripheral.
Definition: at32f415_adc.c:70
adc_interrupt_enable
void adc_interrupt_enable(adc_type *adc_x, uint32_t adc_int, confirm_state new_state)
enable or disable the specified adc interrupts.
Definition: at32f415_adc.c:173
adc_base_default_para_init
void adc_base_default_para_init(adc_base_config_type *adc_base_struct)
adc base default para init.
Definition: at32f415_adc.c:111
adc_calibration_start
void adc_calibration_start(adc_type *adc_x)
start calibration process of the specified adc peripheral.
Definition: at32f415_adc.c:223
adc_calibration_status_get
flag_status adc_calibration_status_get(adc_type *adc_x)
get calibration status of the specified adc peripheral.
Definition: at32f415_adc.c:235
adc_voltage_monitor_threshold_value_set
void adc_voltage_monitor_threshold_value_set(adc_type *adc_x, uint16_t adc_high_threshold, uint16_t adc_low_threshold)
set voltage monitoring's high and low thresholds value of the specified adc peripheral.
Definition: at32f415_adc.c:284
adc_ordinary_conversion_trigger_set
void adc_ordinary_conversion_trigger_set(adc_type *adc_x, adc_ordinary_trig_select_type adc_ordinary_trig, confirm_state new_state)
enable or disable the ordinary channel's external trigger and set external trigger event of the speci...
Definition: at32f415_adc.c:592
adc_calibration_init
void adc_calibration_init(adc_type *adc_x)
initialize calibration register of the specified adc peripheral.
Definition: at32f415_adc.c:192
adc_calibration_init_status_get
flag_status adc_calibration_init_status_get(adc_type *adc_x)
get calibration register's initialize status of the specified adc peripheral.
Definition: at32f415_adc.c:204
adc_dma_mode_enable
void adc_dma_mode_enable(adc_type *adc_x, confirm_state new_state)
enable or disable the adc dma transfer.
Definition: at32f415_adc.c:154
adc_combine_mode_select
void adc_combine_mode_select(adc_combine_mode_type combine_mode)
select combine mode of the specified adc peripheral.
Definition: at32f415_adc.c:91
adc_ordinary_channel_set
void adc_ordinary_channel_set(adc_type *adc_x, adc_channel_select_type adc_channel, uint8_t adc_sequence, adc_sampletime_select_type adc_sampletime)
set ordinary channel's corresponding rank in the sequencer and sample time of the specified adc perip...
Definition: at32f415_adc.c:336
ADC_VMONITOR_SINGLE_ORDINARY
@ ADC_VMONITOR_SINGLE_ORDINARY
Definition: at32f415_adc.h:195
ADC_RIGHT_ALIGNMENT
@ ADC_RIGHT_ALIGNMENT
Definition: at32f415_adc.h:101
ADC_CHANNEL_4
@ ADC_CHANNEL_4
Definition: at32f415_adc.h:114
ADC_CHANNEL_6
@ ADC_CHANNEL_6
Definition: at32f415_adc.h:116
ADC_CHANNEL_5
@ ADC_CHANNEL_5
Definition: at32f415_adc.h:115
ADC_SAMPLETIME_239_5
@ ADC_SAMPLETIME_239_5
Definition: at32f415_adc.h:142
ADC_INDEPENDENT_MODE
@ ADC_INDEPENDENT_MODE
Definition: at32f415_adc.h:84
ADC12_ORDINARY_TRIG_SOFTWARE
@ ADC12_ORDINARY_TRIG_SOFTWARE
Definition: at32f415_adc.h:158
ADC_VMOR_INT
#define ADC_VMOR_INT
Definition: at32f415_adc.h:53
ADC1
#define ADC1
Definition: at32f415_adc.h:555
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
crm_adc_clock_div_set
void crm_adc_clock_div_set(crm_adc_div_type div_value)
set crm adc division
Definition: at32f415_crm.c:456
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_ADC1_PERIPH_CLOCK
@ CRM_ADC1_PERIPH_CLOCK
Definition: at32f415_crm.h:115
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_ADC_DIV_6
@ CRM_ADC_DIV_6
Definition: at32f415_crm.h:357
ADC1_IRQn
@ ADC1_IRQn
Definition: at32f415.h:154
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_HIGH
@ DMA_PRIORITY_HIGH
Definition: at32f415_dma.h:260
DMA1_CHANNEL1
#define DMA1_CHANNEL1
Definition: at32f415_dma.h:473
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_ANALOG
@ GPIO_MODE_ANALOG
Definition: at32f415_gpio.h:231
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_4
#define GPIO_PINS_4
Definition: at32f415_gpio.h:55
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
adc_base_config_type
adc base config type
Definition: at32f415_adc.h:208
adc_base_config_type::data_align
adc_data_align_type data_align
Definition: at32f415_adc.h:211
adc_base_config_type::repeat_mode
confirm_state repeat_mode
Definition: at32f415_adc.h:210
adc_base_config_type::sequence_mode
confirm_state sequence_mode
Definition: at32f415_adc.h:209
adc_base_config_type::ordinary_channel_length
uint8_t ordinary_channel_length
Definition: at32f415_adc.h:212
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • can
  • communication_mode
  • inc
project/at_start_f415/examples/can/communication_mode/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • can
  • communication_mode
  • inc
project/at_start_f415/examples/can/communication_mode/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • can
  • communication_mode
  • inc
project/at_start_f415/examples/can/communication_mode/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • can
  • communication_mode
  • src
project/at_start_f415/examples/can/communication_mode/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/can/communication_mode/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • can
  • communication_mode
  • src
project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
136
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/can/communication_mode/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • can
  • communication_mode
  • src
project/at_start_f415/examples/can/communication_mode/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
43static void can_gpio_config(void)
44{
45 gpio_init_type gpio_init_struct;
46
47 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
48 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
49 gpio_pin_remap_config(CAN1_GMUX_0010,TRUE);
50
51 gpio_default_para_init(&gpio_init_struct);
52 /* can tx pin */
53 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
54 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
55 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
56 gpio_init_struct.gpio_pins = GPIO_PINS_9;
57 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
58 gpio_init(GPIOB, &gpio_init_struct);
59 /* can rx pin */
60 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
61 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
62 gpio_init_struct.gpio_pins = GPIO_PINS_8;
63 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
64 gpio_init(GPIOB, &gpio_init_struct);
65}
66
72static void can_configuration(void)
73{
74 can_base_type can_base_struct;
75 can_baudrate_type can_baudrate_struct;
76 can_filter_init_type can_filter_init_struct;
77
78 crm_periph_clock_enable(CRM_CAN1_PERIPH_CLOCK, TRUE);
79 /* can base init */
80 can_default_para_init(&can_base_struct);
81 can_base_struct.mode_selection = CAN_MODE_COMMUNICATE;
82 can_base_struct.ttc_enable = FALSE;
83 can_base_struct.aebo_enable = TRUE;
84 can_base_struct.aed_enable = TRUE;
85 can_base_struct.prsf_enable = FALSE;
86 can_base_struct.mdrsel_selection = CAN_DISCARDING_FIRST_RECEIVED;
87 can_base_struct.mmssr_selection = CAN_SENDING_BY_ID;
88 can_base_init(CAN1, &can_base_struct);
89
90 /* can baudrate, set baudrate = pclk/(baudrate_div *(3 + bts1_size + bts2_size)) */
91 can_baudrate_struct.baudrate_div = 10;
92 can_baudrate_struct.rsaw_size = CAN_RSAW_1TQ;
93 can_baudrate_struct.bts1_size = CAN_BTS1_8TQ;
94 can_baudrate_struct.bts2_size = CAN_BTS2_3TQ;
95 can_baudrate_set(CAN1, &can_baudrate_struct);
96
97 /* can filter init */
98 can_filter_init_struct.filter_activate_enable = TRUE;
99 can_filter_init_struct.filter_mode = CAN_FILTER_MODE_ID_MASK;
100 can_filter_init_struct.filter_fifo = CAN_FILTER_FIFO0;
101 can_filter_init_struct.filter_number = 0;
102 can_filter_init_struct.filter_bit = CAN_FILTER_32BIT;
103 can_filter_init_struct.filter_id_high = 0;
104 can_filter_init_struct.filter_id_low = 0;
105 can_filter_init_struct.filter_mask_high = 0;
106 can_filter_init_struct.filter_mask_low = 0;
107 can_filter_init(CAN1, &can_filter_init_struct);
108
109 /* can interrupt config */
110 nvic_irq_enable(CAN1_SE_IRQn, 0x00, 0x00);
111 nvic_irq_enable(CAN1_RX0_IRQn, 0x00, 0x00);
112 can_interrupt_enable(CAN1, CAN_RF0MIEN_INT, TRUE);
113 can_interrupt_enable(CAN1, CAN_ETRIEN_INT, TRUE);
114 can_interrupt_enable(CAN1, CAN_EOIEN_INT, TRUE);
115}
116
122static void can_transmit_data(void)
123{
124 uint8_t transmit_mailbox;
125 can_tx_message_type tx_message_struct;
126 tx_message_struct.standard_id = 0x400;
127 tx_message_struct.extended_id = 0;
128 tx_message_struct.id_type = CAN_ID_STANDARD;
129 tx_message_struct.frame_type = CAN_TFT_DATA;
130 tx_message_struct.dlc = 8;
131 tx_message_struct.data[0] = 0x11;
132 tx_message_struct.data[1] = 0x22;
133 tx_message_struct.data[2] = 0x33;
134 tx_message_struct.data[3] = 0x44;
135 tx_message_struct.data[4] = 0x55;
136 tx_message_struct.data[5] = 0x66;
137 tx_message_struct.data[6] = 0x77;
138 tx_message_struct.data[7] = 0x88;
139 transmit_mailbox = can_message_transmit(CAN1, &tx_message_struct);
140 while(can_transmit_status_get(CAN1, (can_tx_mailbox_num_type)transmit_mailbox) != CAN_TX_STATUS_SUCCESSFUL);
141}
142
148void CAN1_RX0_IRQHandler(void)
149{
150 can_rx_message_type rx_message_struct;
151 if(can_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
152 {
153 can_message_receive(CAN1, CAN_RX_FIFO0, &rx_message_struct);
154 if(rx_message_struct.standard_id == 0x400)
155 at32_led_toggle(LED2);
156 else
157 at32_led_toggle(LED3);
158 }
159}
160
166void CAN1_SE_IRQHandler(void)
167{
168 __IO uint32_t err_index = 0;
169 if(can_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
170 {
171 err_index = CAN1->ests & 0x70;
172 can_flag_clear(CAN1, CAN_ETR_FLAG);
173 if(err_index == 0x00000010)
174 {
175 can_reset(CAN1);
176 can_configuration();
177 }
178 }
179}
180
186int main(void)
187{
188 system_clock_config();
189 at32_board_init();
190 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
191 can_gpio_config();
192 can_configuration();
193 while(1)
194 {
195 can_transmit_data();
196 at32_led_toggle(LED4);
197 delay_sec(1);
198 }
199}
200
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
CAN1_SE_IRQHandler
void CAN1_SE_IRQHandler(void)
can1 interrupt function se
Definition: project/at_start_f415/examples/can/communication_mode/src/main.c:166
CAN1_RX0_IRQHandler
void CAN1_RX0_IRQHandler(void)
can1 interrupt function rx0
Definition: project/at_start_f415/examples/can/communication_mode/src/main.c:148
can_transmit_data
static void can_transmit_data(void)
can transmit data
Definition: project/at_start_f415/examples/can/communication_mode/src/main.c:122
main
int main(void)
main function.
Definition: project/at_start_f415/examples/can/communication_mode/src/main.c:186
can_gpio_config
static void can_gpio_config(void)
can gpio config
Definition: project/at_start_f415/examples/can/communication_mode/src/main.c:43
can_configuration
static void can_configuration(void)
can configiguration.
Definition: project/at_start_f415/examples/can/communication_mode/src/main.c:72
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
can_base_init
error_status can_base_init(can_type *can_x, can_base_type *can_base_struct)
initialize the can peripheral according to the specified parameters in the can_init_struct.
Definition: at32f415_can.c:186
can_reset
void can_reset(can_type *can_x)
deinitialize the can peripheral registers to their default reset values.
Definition: at32f415_can.c:51
can_transmit_status_get
can_transmit_status_type can_transmit_status_get(can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
check the transmission state of the specified can peripheral.
Definition: at32f415_can.c:506
can_message_transmit
uint8_t can_message_transmit(can_type *can_x, can_tx_message_type *tx_message_struct)
fill the transmission message and transmit of the specified can peripheral.
Definition: at32f415_can.c:432
can_message_receive
void can_message_receive(can_type *can_x, can_rx_fifo_num_type fifo_number, can_rx_message_type *rx_message_struct)
receive message of the specified can peripheral.
Definition: at32f415_can.c:611
can_interrupt_enable
void can_interrupt_enable(can_type *can_x, uint32_t can_int, confirm_state new_state)
enable or disable the interrupt of the specified can peripheral.
Definition: at32f415_can.c:916
can_flag_get
flag_status can_flag_get(can_type *can_x, uint32_t can_flag)
get flag of the specified can peripheral.
Definition: at32f415_can.c:956
can_flag_clear
void can_flag_clear(can_type *can_x, uint32_t can_flag)
clear flag of the specified can peripheral.
Definition: at32f415_can.c:1079
can_baudrate_set
error_status can_baudrate_set(can_type *can_x, can_baudrate_type *can_baudrate_struct)
set the baudrate of the can peripheral
Definition: at32f415_can.c:91
can_filter_init
void can_filter_init(can_type *can_x, can_filter_init_type *can_filter_init_struct)
initialize the can peripheral according to the specified parameters in the can_filter_init_struct.
Definition: at32f415_can.c:296
can_default_para_init
void can_default_para_init(can_base_type *can_base_struct)
fill each can_init_struct member with its default value.
Definition: at32f415_can.c:149
can_tx_mailbox_num_type
can_tx_mailbox_num_type
can tx mailboxes
Definition: at32f415_can.h:252
CAN_FILTER_FIFO0
@ CAN_FILTER_FIFO0
Definition: at32f415_can.h:138
CAN_TX_STATUS_SUCCESSFUL
@ CAN_TX_STATUS_SUCCESSFUL
Definition: at32f415_can.h:273
CAN_DISCARDING_FIRST_RECEIVED
@ CAN_DISCARDING_FIRST_RECEIVED
Definition: at32f415_can.h:301
CAN_BTS2_3TQ
@ CAN_BTS2_3TQ
Definition: at32f415_can.h:222
CAN_TFT_DATA
@ CAN_TFT_DATA
Definition: at32f415_can.h:244
CAN_BTS1_8TQ
@ CAN_BTS1_8TQ
Definition: at32f415_can.h:204
CAN_FILTER_MODE_ID_MASK
@ CAN_FILTER_MODE_ID_MASK
Definition: at32f415_can.h:147
CAN_SENDING_BY_ID
@ CAN_SENDING_BY_ID
Definition: at32f415_can.h:310
CAN_FILTER_32BIT
@ CAN_FILTER_32BIT
Definition: at32f415_can.h:157
CAN_RX_FIFO0
@ CAN_RX_FIFO0
Definition: at32f415_can.h:263
CAN_ID_STANDARD
@ CAN_ID_STANDARD
Definition: at32f415_can.h:235
CAN_MODE_COMMUNICATE
@ CAN_MODE_COMMUNICATE
Definition: at32f415_can.h:165
CAN_RSAW_1TQ
@ CAN_RSAW_1TQ
Definition: at32f415_can.h:186
CAN_RF0MN_FLAG
#define CAN_RF0MN_FLAG
Definition: at32f415_can.h:72
CAN_ETR_FLAG
#define CAN_ETR_FLAG
Definition: at32f415_can.h:67
CAN_RF0MIEN_INT
#define CAN_RF0MIEN_INT
Definition: at32f415_can.h:92
CAN_EOIEN_INT
#define CAN_EOIEN_INT
Definition: at32f415_can.h:102
CAN_ETRIEN_INT
#define CAN_ETRIEN_INT
Definition: at32f415_can.h:101
CAN1
#define CAN1
Definition: at32f415_can.h:938
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_CAN1_PERIPH_CLOCK
@ CRM_CAN1_PERIPH_CLOCK
Definition: at32f415_crm.h:136
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CAN1_RX0_IRQn
@ CAN1_RX0_IRQn
Definition: at32f415.h:156
CAN1_SE_IRQn
@ CAN1_SE_IRQn
Definition: at32f415.h:158
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_pin_remap_config
void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration.
Definition: at32f415_gpio.c:521
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
CAN1_GMUX_0010
#define CAN1_GMUX_0010
Definition: at32f415_gpio.h:171
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
can_base_type
can init structure definition
Definition: at32f415_can.h:333
can_base_type::prsf_enable
confirm_state prsf_enable
Definition: at32f415_can.h:342
can_base_type::mdrsel_selection
can_msg_discarding_rule_type mdrsel_selection
Definition: at32f415_can.h:344
can_base_type::aed_enable
confirm_state aed_enable
Definition: at32f415_can.h:340
can_base_type::mmssr_selection
can_msg_sending_rule_type mmssr_selection
Definition: at32f415_can.h:346
can_base_type::ttc_enable
confirm_state ttc_enable
Definition: at32f415_can.h:336
can_base_type::mode_selection
can_mode_type mode_selection
Definition: at32f415_can.h:334
can_base_type::aebo_enable
confirm_state aebo_enable
Definition: at32f415_can.h:338
can_baudrate_type
can baudrate structure definition
Definition: at32f415_can.h:354
can_baudrate_type::baudrate_div
uint16_t baudrate_div
Definition: at32f415_can.h:355
can_baudrate_type::rsaw_size
can_rsaw_type rsaw_size
Definition: at32f415_can.h:357
can_baudrate_type::bts2_size
can_bts2_type bts2_size
Definition: at32f415_can.h:361
can_baudrate_type::bts1_size
can_bts1_type bts1_size
Definition: at32f415_can.h:359
can_filter_init_type
can filter init structure definition
Definition: at32f415_can.h:369
can_filter_init_type::filter_mask_low
uint16_t filter_mask_low
Definition: at32f415_can.h:389
can_filter_init_type::filter_number
uint8_t filter_number
Definition: at32f415_can.h:376
can_filter_init_type::filter_fifo
can_filter_fifo_type filter_fifo
Definition: at32f415_can.h:374
can_filter_init_type::filter_bit
can_filter_bit_width_type filter_bit
Definition: at32f415_can.h:378
can_filter_init_type::filter_mode
can_filter_mode_type filter_mode
Definition: at32f415_can.h:372
can_filter_init_type::filter_activate_enable
confirm_state filter_activate_enable
Definition: at32f415_can.h:370
can_filter_init_type::filter_mask_high
uint16_t filter_mask_high
Definition: at32f415_can.h:386
can_filter_init_type::filter_id_high
uint16_t filter_id_high
Definition: at32f415_can.h:380
can_filter_init_type::filter_id_low
uint16_t filter_id_low
Definition: at32f415_can.h:383
can_rx_message_type
can rx message structure definition
Definition: at32f415_can.h:419
can_rx_message_type::standard_id
uint32_t standard_id
Definition: at32f415_can.h:420
can_tx_message_type
can tx message structure definition
Definition: at32f415_can.h:397
can_tx_message_type::extended_id
uint32_t extended_id
Definition: at32f415_can.h:401
can_tx_message_type::frame_type
can_trans_frame_type frame_type
Definition: at32f415_can.h:406
can_tx_message_type::data
uint8_t data[8]
Definition: at32f415_can.h:411
can_tx_message_type::dlc
uint8_t dlc
Definition: at32f415_can.h:408
can_tx_message_type::id_type
can_identifier_type id_type
Definition: at32f415_can.h:404
can_tx_message_type::standard_id
uint32_t standard_id
Definition: at32f415_can.h:398
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • can
  • filter
  • inc
project/at_start_f415/examples/can/filter/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • can
  • filter
  • inc
project/at_start_f415/examples/can/filter/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • can
  • filter
  • inc
project/at_start_f415/examples/can/filter/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • can
  • filter
  • src
project/at_start_f415/examples/can/filter/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/can/filter/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • can
  • filter
  • src
project/at_start_f415/examples/can/filter/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
136
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/can/filter/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/can/filter/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/can/filter/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/can/filter/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/can/filter/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/can/filter/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/can/filter/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/can/filter/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/can/filter/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • can
  • filter
  • src
project/at_start_f415/examples/can/filter/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38/* extended identifier */
39#define FILTER_EXT_ID1 ((uint32_t)0x18F5F100)
40#define FILTER_EXT_ID2 ((uint32_t)0x18F5F200)
41#define FILTER_EXT_ID3 ((uint32_t)0x18F5F300)
42
43/* standard identifier */
44#define FILTER_STD_ID1 ((uint16_t)0x04F6)
45#define FILTER_STD_ID2 ((uint16_t)0x04F7)
46#define FILTER_STD_ID3 ((uint16_t)0x04F8)
47
48uint8_t test_result = 0;
54static void can_gpio_config(void)
55{
56 gpio_init_type gpio_init_struct;
57
58 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
59 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
60 gpio_pin_remap_config(CAN1_GMUX_0010,TRUE);
61
62 gpio_default_para_init(&gpio_init_struct);
63
64 /* can tx pin */
65 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
66 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
67 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
68 gpio_init_struct.gpio_pins = GPIO_PINS_9;
69 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
70 gpio_init(GPIOB, &gpio_init_struct);
71
72 /* can rx pin */
73 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
74 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
75 gpio_init_struct.gpio_pins = GPIO_PINS_8;
76 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
77 gpio_init(GPIOB, &gpio_init_struct);
78}
79
85static void can_configuration(void)
86{
87 can_base_type can_base_struct;
88 can_baudrate_type can_baudrate_struct;
89 can_filter_init_type can_filter_init_struct;
90
91 crm_periph_clock_enable(CRM_CAN1_PERIPH_CLOCK, TRUE);
92 /* can base init */
93 can_default_para_init(&can_base_struct);
94 can_base_struct.mode_selection = CAN_MODE_COMMUNICATE;
95 can_base_struct.ttc_enable = FALSE;
96 can_base_struct.aebo_enable = TRUE;
97 can_base_struct.aed_enable = TRUE;
98 can_base_struct.prsf_enable = FALSE;
99 can_base_struct.mdrsel_selection = CAN_DISCARDING_FIRST_RECEIVED;
100 can_base_struct.mmssr_selection = CAN_SENDING_BY_ID;
101 can_base_init(CAN1, &can_base_struct);
102
103 /* can baudrate, set baudrate = pclk/(baudrate_div *(3 + bts1_size + bts2_size)) */
104 can_baudrate_struct.baudrate_div = 10;
105 can_baudrate_struct.rsaw_size = CAN_RSAW_1TQ;
106 can_baudrate_struct.bts1_size = CAN_BTS1_8TQ;
107 can_baudrate_struct.bts2_size = CAN_BTS2_3TQ;
108 can_baudrate_set(CAN1, &can_baudrate_struct);
109
110 /* can filter 0 config */
111 can_filter_init_struct.filter_activate_enable = TRUE;
112 can_filter_init_struct.filter_mode = CAN_FILTER_MODE_ID_LIST;
113 can_filter_init_struct.filter_fifo = CAN_FILTER_FIFO0;
114 can_filter_init_struct.filter_number = 0;
115 can_filter_init_struct.filter_bit = CAN_FILTER_32BIT;
116 can_filter_init_struct.filter_id_high = (((FILTER_EXT_ID1 << 3) >> 16) & 0xFFFF); /* extended identifier is 29 bit */
117 can_filter_init_struct.filter_id_low = ((FILTER_EXT_ID1 << 3) & 0xFFFF) | 0x04;
118 can_filter_init_struct.filter_mask_high = ((FILTER_EXT_ID2 << 3) >> 16) & 0xFFFF; /* extended identifier is 29 bit */
119 can_filter_init_struct.filter_mask_low = ((FILTER_EXT_ID2 << 3) & 0xFFFF) | 0x04;
120 can_filter_init(CAN1, &can_filter_init_struct);
121
122 /* can filter 1 config */
123 can_filter_init_struct.filter_activate_enable = TRUE;
124 can_filter_init_struct.filter_mode = CAN_FILTER_MODE_ID_LIST;
125 can_filter_init_struct.filter_fifo = CAN_FILTER_FIFO0;
126 can_filter_init_struct.filter_number = 1;
127 can_filter_init_struct.filter_bit = CAN_FILTER_32BIT;
128 can_filter_init_struct.filter_id_high = FILTER_STD_ID1 << 5; /* standard identifier is 11 bit */
129 can_filter_init_struct.filter_id_low = 0;
130 can_filter_init_struct.filter_mask_high = FILTER_STD_ID2 << 5;/* standard identifier is 11 bit */
131 can_filter_init_struct.filter_mask_low = 0;
132 can_filter_init(CAN1, &can_filter_init_struct);
133
134 /* can interrupt config */
135 nvic_irq_enable(CAN1_SE_IRQn, 0x00, 0x00);
136 nvic_irq_enable(CAN1_RX0_IRQn, 0x00, 0x00);
137 can_interrupt_enable(CAN1, CAN_RF0MIEN_INT, TRUE);
138 can_interrupt_enable(CAN1, CAN_ETRIEN_INT, TRUE);
139 can_interrupt_enable(CAN1, CAN_EOIEN_INT, TRUE);
140}
141
147static void can_transmit_data(void)
148{
149 uint8_t transmit_mailbox;
150 can_tx_message_type tx_message_struct;
151
152 /* transmit FILTER_STD_ID1 */
153 tx_message_struct.standard_id = FILTER_STD_ID1;
154 tx_message_struct.extended_id = 0;
155 tx_message_struct.id_type = CAN_ID_STANDARD;
156 tx_message_struct.frame_type = CAN_TFT_DATA;
157 tx_message_struct.dlc = 8;
158 tx_message_struct.data[0] = 0x11;
159 tx_message_struct.data[1] = 0x22;
160 tx_message_struct.data[2] = 0x33;
161 tx_message_struct.data[3] = 0x44;
162 tx_message_struct.data[4] = 0x55;
163 tx_message_struct.data[5] = 0x66;
164 tx_message_struct.data[6] = 0x77;
165 tx_message_struct.data[7] = 0x88;
166 transmit_mailbox = can_message_transmit(CAN1, &tx_message_struct);
167 while(can_transmit_status_get(CAN1, (can_tx_mailbox_num_type)transmit_mailbox) != CAN_TX_STATUS_SUCCESSFUL);
168
169 /* transmit FILTER_STD_ID2 */
170 tx_message_struct.standard_id = FILTER_STD_ID2;
171 tx_message_struct.extended_id = 0;
172 tx_message_struct.id_type = CAN_ID_STANDARD;
173 tx_message_struct.frame_type = CAN_TFT_DATA;
174 tx_message_struct.dlc = 8;
175 tx_message_struct.data[0] = 0x11;
176 tx_message_struct.data[1] = 0x22;
177 tx_message_struct.data[2] = 0x33;
178 tx_message_struct.data[3] = 0x44;
179 tx_message_struct.data[4] = 0x55;
180 tx_message_struct.data[5] = 0x66;
181 tx_message_struct.data[6] = 0x77;
182 tx_message_struct.data[7] = 0x88;
183 transmit_mailbox = can_message_transmit(CAN1, &tx_message_struct);
184 while(can_transmit_status_get(CAN1, (can_tx_mailbox_num_type)transmit_mailbox) != CAN_TX_STATUS_SUCCESSFUL);
185
186 /* transmit FILTER_STD_ID3 */
187 tx_message_struct.standard_id = FILTER_STD_ID3;
188 tx_message_struct.extended_id = 0;
189 tx_message_struct.id_type = CAN_ID_STANDARD;
190 tx_message_struct.frame_type = CAN_TFT_DATA;
191 tx_message_struct.dlc = 8;
192 tx_message_struct.data[0] = 0x11;
193 tx_message_struct.data[1] = 0x22;
194 tx_message_struct.data[2] = 0x33;
195 tx_message_struct.data[3] = 0x44;
196 tx_message_struct.data[4] = 0x55;
197 tx_message_struct.data[5] = 0x66;
198 tx_message_struct.data[6] = 0x77;
199 tx_message_struct.data[7] = 0x88;
200 transmit_mailbox = can_message_transmit(CAN1, &tx_message_struct);
201 while(can_transmit_status_get(CAN1, (can_tx_mailbox_num_type)transmit_mailbox) != CAN_TX_STATUS_SUCCESSFUL);
202
203 /* transmit FILTER_EXT_ID1 */
204 tx_message_struct.standard_id = 0;
205 tx_message_struct.extended_id = FILTER_EXT_ID1;
206 tx_message_struct.id_type = CAN_ID_EXTENDED;
207 tx_message_struct.frame_type = CAN_TFT_DATA;
208 tx_message_struct.dlc = 8;
209 tx_message_struct.data[0] = 0x11;
210 tx_message_struct.data[1] = 0x22;
211 tx_message_struct.data[2] = 0x33;
212 tx_message_struct.data[3] = 0x44;
213 tx_message_struct.data[4] = 0x55;
214 tx_message_struct.data[5] = 0x66;
215 tx_message_struct.data[6] = 0x77;
216 tx_message_struct.data[7] = 0x88;
217 transmit_mailbox = can_message_transmit(CAN1, &tx_message_struct);
218 while(can_transmit_status_get(CAN1, (can_tx_mailbox_num_type)transmit_mailbox) != CAN_TX_STATUS_SUCCESSFUL);
219
220 /* transmit FILTER_EXT_ID2 */
221 tx_message_struct.standard_id = 0;
222 tx_message_struct.extended_id = FILTER_EXT_ID2;
223 tx_message_struct.id_type = CAN_ID_EXTENDED;
224 tx_message_struct.frame_type = CAN_TFT_DATA;
225 tx_message_struct.dlc = 8;
226 tx_message_struct.data[0] = 0x11;
227 tx_message_struct.data[1] = 0x22;
228 tx_message_struct.data[2] = 0x33;
229 tx_message_struct.data[3] = 0x44;
230 tx_message_struct.data[4] = 0x55;
231 tx_message_struct.data[5] = 0x66;
232 tx_message_struct.data[6] = 0x77;
233 tx_message_struct.data[7] = 0x88;
234 transmit_mailbox = can_message_transmit(CAN1, &tx_message_struct);
235 while(can_transmit_status_get(CAN1, (can_tx_mailbox_num_type)transmit_mailbox) != CAN_TX_STATUS_SUCCESSFUL);
236
237 /* transmit FILTER_EXT_ID3 */
238 tx_message_struct.standard_id = 0;
239 tx_message_struct.extended_id = FILTER_EXT_ID3;
240 tx_message_struct.id_type = CAN_ID_EXTENDED;
241 tx_message_struct.frame_type = CAN_TFT_DATA;
242 tx_message_struct.dlc = 8;
243 tx_message_struct.data[0] = 0x11;
244 tx_message_struct.data[1] = 0x22;
245 tx_message_struct.data[2] = 0x33;
246 tx_message_struct.data[3] = 0x44;
247 tx_message_struct.data[4] = 0x55;
248 tx_message_struct.data[5] = 0x66;
249 tx_message_struct.data[6] = 0x77;
250 tx_message_struct.data[7] = 0x88;
251 transmit_mailbox = can_message_transmit(CAN1, &tx_message_struct);
252 while(can_transmit_status_get(CAN1, (can_tx_mailbox_num_type)transmit_mailbox) != CAN_TX_STATUS_SUCCESSFUL);
253}
254
260void CAN1_RX0_IRQHandler(void)
261{
262 can_rx_message_type rx_message_struct;
263 if(can_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
264 {
265 if(test_result == 4)
266 {
267 test_result = 0;
268 }
269
270 can_message_receive(CAN1, CAN_RX_FIFO0, &rx_message_struct);
271
272 if((rx_message_struct.id_type == CAN_ID_STANDARD) && (rx_message_struct.standard_id == FILTER_STD_ID1))
273 test_result++;
274 else if((rx_message_struct.id_type == CAN_ID_STANDARD) && (rx_message_struct.standard_id == FILTER_STD_ID2))
275 test_result++;
276 else if((rx_message_struct.id_type == CAN_ID_EXTENDED) && (rx_message_struct.extended_id == FILTER_EXT_ID1))
277 test_result++;
278 else if((rx_message_struct.id_type == CAN_ID_EXTENDED) && (rx_message_struct.extended_id == FILTER_EXT_ID2))
279 test_result++;
280 }
281}
282
288void CAN1_SE_IRQHandler(void)
289{
290 __IO uint32_t err_index = 0;
291 if(can_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
292 {
293 err_index = CAN1->ests & 0x70;
294 can_flag_clear(CAN1, CAN_ETR_FLAG);
295 if(err_index == 0x00000010)
296 {
297 can_reset(CAN1);
298 can_configuration();
299 }
300 }
301}
302
308int main(void)
309{
310 system_clock_config();
311 at32_board_init();
312 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
313 can_gpio_config();
314 can_configuration();
315 can_transmit_data();
316 while(1)
317 {
318 if(test_result == 4)
319 {
320 at32_led_toggle(LED2);
321 at32_led_toggle(LED3);
322 at32_led_toggle(LED4);
323 delay_sec(1);
324 }
325 }
326}
327
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
CAN1_SE_IRQHandler
void CAN1_SE_IRQHandler(void)
can1 interrupt function se
Definition: project/at_start_f415/examples/can/filter/src/main.c:288
FILTER_EXT_ID3
#define FILTER_EXT_ID3
Definition: project/at_start_f415/examples/can/filter/src/main.c:41
FILTER_EXT_ID1
#define FILTER_EXT_ID1
Definition: project/at_start_f415/examples/can/filter/src/main.c:39
FILTER_STD_ID2
#define FILTER_STD_ID2
Definition: project/at_start_f415/examples/can/filter/src/main.c:45
CAN1_RX0_IRQHandler
void CAN1_RX0_IRQHandler(void)
can1 interrupt function rx0
Definition: project/at_start_f415/examples/can/filter/src/main.c:260
can_transmit_data
static void can_transmit_data(void)
can transmit data
Definition: project/at_start_f415/examples/can/filter/src/main.c:147
main
int main(void)
main function.
Definition: project/at_start_f415/examples/can/filter/src/main.c:308
FILTER_EXT_ID2
#define FILTER_EXT_ID2
Definition: project/at_start_f415/examples/can/filter/src/main.c:40
FILTER_STD_ID3
#define FILTER_STD_ID3
Definition: project/at_start_f415/examples/can/filter/src/main.c:46
FILTER_STD_ID1
#define FILTER_STD_ID1
Definition: project/at_start_f415/examples/can/filter/src/main.c:44
can_gpio_config
static void can_gpio_config(void)
can gpio config
Definition: project/at_start_f415/examples/can/filter/src/main.c:54
can_configuration
static void can_configuration(void)
can configiguration.
Definition: project/at_start_f415/examples/can/filter/src/main.c:85
test_result
uint8_t test_result
Definition: project/at_start_f415/examples/can/filter/src/main.c:48
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
can_base_init
error_status can_base_init(can_type *can_x, can_base_type *can_base_struct)
initialize the can peripheral according to the specified parameters in the can_init_struct.
Definition: at32f415_can.c:186
can_reset
void can_reset(can_type *can_x)
deinitialize the can peripheral registers to their default reset values.
Definition: at32f415_can.c:51
can_transmit_status_get
can_transmit_status_type can_transmit_status_get(can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
check the transmission state of the specified can peripheral.
Definition: at32f415_can.c:506
can_message_transmit
uint8_t can_message_transmit(can_type *can_x, can_tx_message_type *tx_message_struct)
fill the transmission message and transmit of the specified can peripheral.
Definition: at32f415_can.c:432
can_message_receive
void can_message_receive(can_type *can_x, can_rx_fifo_num_type fifo_number, can_rx_message_type *rx_message_struct)
receive message of the specified can peripheral.
Definition: at32f415_can.c:611
can_interrupt_enable
void can_interrupt_enable(can_type *can_x, uint32_t can_int, confirm_state new_state)
enable or disable the interrupt of the specified can peripheral.
Definition: at32f415_can.c:916
can_flag_get
flag_status can_flag_get(can_type *can_x, uint32_t can_flag)
get flag of the specified can peripheral.
Definition: at32f415_can.c:956
can_flag_clear
void can_flag_clear(can_type *can_x, uint32_t can_flag)
clear flag of the specified can peripheral.
Definition: at32f415_can.c:1079
can_baudrate_set
error_status can_baudrate_set(can_type *can_x, can_baudrate_type *can_baudrate_struct)
set the baudrate of the can peripheral
Definition: at32f415_can.c:91
can_filter_init
void can_filter_init(can_type *can_x, can_filter_init_type *can_filter_init_struct)
initialize the can peripheral according to the specified parameters in the can_filter_init_struct.
Definition: at32f415_can.c:296
can_default_para_init
void can_default_para_init(can_base_type *can_base_struct)
fill each can_init_struct member with its default value.
Definition: at32f415_can.c:149
can_tx_mailbox_num_type
can_tx_mailbox_num_type
can tx mailboxes
Definition: at32f415_can.h:252
CAN_FILTER_FIFO0
@ CAN_FILTER_FIFO0
Definition: at32f415_can.h:138
CAN_TX_STATUS_SUCCESSFUL
@ CAN_TX_STATUS_SUCCESSFUL
Definition: at32f415_can.h:273
CAN_DISCARDING_FIRST_RECEIVED
@ CAN_DISCARDING_FIRST_RECEIVED
Definition: at32f415_can.h:301
CAN_BTS2_3TQ
@ CAN_BTS2_3TQ
Definition: at32f415_can.h:222
CAN_TFT_DATA
@ CAN_TFT_DATA
Definition: at32f415_can.h:244
CAN_BTS1_8TQ
@ CAN_BTS1_8TQ
Definition: at32f415_can.h:204
CAN_FILTER_MODE_ID_LIST
@ CAN_FILTER_MODE_ID_LIST
Definition: at32f415_can.h:148
CAN_SENDING_BY_ID
@ CAN_SENDING_BY_ID
Definition: at32f415_can.h:310
CAN_FILTER_32BIT
@ CAN_FILTER_32BIT
Definition: at32f415_can.h:157
CAN_RX_FIFO0
@ CAN_RX_FIFO0
Definition: at32f415_can.h:263
CAN_ID_STANDARD
@ CAN_ID_STANDARD
Definition: at32f415_can.h:235
CAN_ID_EXTENDED
@ CAN_ID_EXTENDED
Definition: at32f415_can.h:236
CAN_MODE_COMMUNICATE
@ CAN_MODE_COMMUNICATE
Definition: at32f415_can.h:165
CAN_RSAW_1TQ
@ CAN_RSAW_1TQ
Definition: at32f415_can.h:186
CAN_RF0MN_FLAG
#define CAN_RF0MN_FLAG
Definition: at32f415_can.h:72
CAN_ETR_FLAG
#define CAN_ETR_FLAG
Definition: at32f415_can.h:67
CAN_RF0MIEN_INT
#define CAN_RF0MIEN_INT
Definition: at32f415_can.h:92
CAN_EOIEN_INT
#define CAN_EOIEN_INT
Definition: at32f415_can.h:102
CAN_ETRIEN_INT
#define CAN_ETRIEN_INT
Definition: at32f415_can.h:101
CAN1
#define CAN1
Definition: at32f415_can.h:938
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_CAN1_PERIPH_CLOCK
@ CRM_CAN1_PERIPH_CLOCK
Definition: at32f415_crm.h:136
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CAN1_RX0_IRQn
@ CAN1_RX0_IRQn
Definition: at32f415.h:156
CAN1_SE_IRQn
@ CAN1_SE_IRQn
Definition: at32f415.h:158
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_pin_remap_config
void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration.
Definition: at32f415_gpio.c:521
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
CAN1_GMUX_0010
#define CAN1_GMUX_0010
Definition: at32f415_gpio.h:171
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
can_base_type
can init structure definition
Definition: at32f415_can.h:333
can_base_type::prsf_enable
confirm_state prsf_enable
Definition: at32f415_can.h:342
can_base_type::mdrsel_selection
can_msg_discarding_rule_type mdrsel_selection
Definition: at32f415_can.h:344
can_base_type::aed_enable
confirm_state aed_enable
Definition: at32f415_can.h:340
can_base_type::mmssr_selection
can_msg_sending_rule_type mmssr_selection
Definition: at32f415_can.h:346
can_base_type::ttc_enable
confirm_state ttc_enable
Definition: at32f415_can.h:336
can_base_type::mode_selection
can_mode_type mode_selection
Definition: at32f415_can.h:334
can_base_type::aebo_enable
confirm_state aebo_enable
Definition: at32f415_can.h:338
can_baudrate_type
can baudrate structure definition
Definition: at32f415_can.h:354
can_baudrate_type::baudrate_div
uint16_t baudrate_div
Definition: at32f415_can.h:355
can_baudrate_type::rsaw_size
can_rsaw_type rsaw_size
Definition: at32f415_can.h:357
can_baudrate_type::bts2_size
can_bts2_type bts2_size
Definition: at32f415_can.h:361
can_baudrate_type::bts1_size
can_bts1_type bts1_size
Definition: at32f415_can.h:359
can_filter_init_type
can filter init structure definition
Definition: at32f415_can.h:369
can_filter_init_type::filter_mask_low
uint16_t filter_mask_low
Definition: at32f415_can.h:389
can_filter_init_type::filter_number
uint8_t filter_number
Definition: at32f415_can.h:376
can_filter_init_type::filter_fifo
can_filter_fifo_type filter_fifo
Definition: at32f415_can.h:374
can_filter_init_type::filter_bit
can_filter_bit_width_type filter_bit
Definition: at32f415_can.h:378
can_filter_init_type::filter_mode
can_filter_mode_type filter_mode
Definition: at32f415_can.h:372
can_filter_init_type::filter_activate_enable
confirm_state filter_activate_enable
Definition: at32f415_can.h:370
can_filter_init_type::filter_mask_high
uint16_t filter_mask_high
Definition: at32f415_can.h:386
can_filter_init_type::filter_id_high
uint16_t filter_id_high
Definition: at32f415_can.h:380
can_filter_init_type::filter_id_low
uint16_t filter_id_low
Definition: at32f415_can.h:383
can_rx_message_type
can rx message structure definition
Definition: at32f415_can.h:419
can_rx_message_type::standard_id
uint32_t standard_id
Definition: at32f415_can.h:420
can_rx_message_type::id_type
can_identifier_type id_type
Definition: at32f415_can.h:426
can_rx_message_type::extended_id
uint32_t extended_id
Definition: at32f415_can.h:423
can_tx_message_type
can tx message structure definition
Definition: at32f415_can.h:397
can_tx_message_type::extended_id
uint32_t extended_id
Definition: at32f415_can.h:401
can_tx_message_type::frame_type
can_trans_frame_type frame_type
Definition: at32f415_can.h:406
can_tx_message_type::data
uint8_t data[8]
Definition: at32f415_can.h:411
can_tx_message_type::dlc
uint8_t dlc
Definition: at32f415_can.h:408
can_tx_message_type::id_type
can_identifier_type id_type
Definition: at32f415_can.h:404
can_tx_message_type::standard_id
uint32_t standard_id
Definition: at32f415_can.h:398
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • can
  • loopback_mode
  • inc
project/at_start_f415/examples/can/loopback_mode/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • can
  • loopback_mode
  • inc
project/at_start_f415/examples/can/loopback_mode/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • can
  • loopback_mode
  • inc
project/at_start_f415/examples/can/loopback_mode/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • can
  • loopback_mode
  • src
project/at_start_f415/examples/can/loopback_mode/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/can/loopback_mode/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • can
  • loopback_mode
  • src
project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
136
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/can/loopback_mode/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • can
  • loopback_mode
  • src
project/at_start_f415/examples/can/loopback_mode/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
43static void can_gpio_config(void)
44{
45 gpio_init_type gpio_init_struct;
46
47 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
48 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
49 gpio_pin_remap_config(CAN1_GMUX_0010,TRUE);
50
51 gpio_default_para_init(&gpio_init_struct);
52 /* can tx pin */
53 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
54 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
55 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
56 gpio_init_struct.gpio_pins = GPIO_PINS_9;
57 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
58 gpio_init(GPIOB, &gpio_init_struct);
59 /* can rx pin */
60 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
61 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
62 gpio_init_struct.gpio_pins = GPIO_PINS_8;
63 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
64 gpio_init(GPIOB, &gpio_init_struct);
65}
66
72static void can_configuration(void)
73{
74 can_base_type can_base_struct;
75 can_baudrate_type can_baudrate_struct;
76 can_filter_init_type can_filter_init_struct;
77
78 crm_periph_clock_enable(CRM_CAN1_PERIPH_CLOCK, TRUE);
79 /* can base init */
80 can_default_para_init(&can_base_struct);
81 can_base_struct.mode_selection = CAN_MODE_LOOPBACK;
82 can_base_struct.ttc_enable = FALSE;
83 can_base_struct.aebo_enable = TRUE;
84 can_base_struct.aed_enable = TRUE;
85 can_base_struct.prsf_enable = FALSE;
86 can_base_struct.mdrsel_selection = CAN_DISCARDING_FIRST_RECEIVED;
87 can_base_struct.mmssr_selection = CAN_SENDING_BY_ID;
88 can_base_init(CAN1, &can_base_struct);
89
90 /* can baudrate, set baudrate = pclk/(baudrate_div *(3 + bts1_size + bts2_size)) */
91 can_baudrate_struct.baudrate_div = 10;
92 can_baudrate_struct.rsaw_size = CAN_RSAW_1TQ;
93 can_baudrate_struct.bts1_size = CAN_BTS1_8TQ;
94 can_baudrate_struct.bts2_size = CAN_BTS2_3TQ;
95 can_baudrate_set(CAN1, &can_baudrate_struct);
96
97 /* can filter init */
98 can_filter_init_struct.filter_activate_enable = TRUE;
99 can_filter_init_struct.filter_mode = CAN_FILTER_MODE_ID_MASK;
100 can_filter_init_struct.filter_fifo = CAN_FILTER_FIFO0;
101 can_filter_init_struct.filter_number = 0;
102 can_filter_init_struct.filter_bit = CAN_FILTER_32BIT;
103 can_filter_init_struct.filter_id_high = 0;
104 can_filter_init_struct.filter_id_low = 0;
105 can_filter_init_struct.filter_mask_high = 0;
106 can_filter_init_struct.filter_mask_low = 0;
107 can_filter_init(CAN1, &can_filter_init_struct);
108
109 /* can interrupt config */
110 nvic_irq_enable(CAN1_SE_IRQn, 0x00, 0x00);
111 nvic_irq_enable(CAN1_RX0_IRQn, 0x00, 0x00);
112 can_interrupt_enable(CAN1, CAN_RF0MIEN_INT, TRUE);
113 can_interrupt_enable(CAN1, CAN_ETRIEN_INT, TRUE);
114 can_interrupt_enable(CAN1, CAN_EOIEN_INT, TRUE);
115}
116
122static void can_transmit_data(void)
123{
124 uint8_t transmit_mailbox;
125 can_tx_message_type tx_message_struct;
126 tx_message_struct.standard_id = 0x400;
127 tx_message_struct.extended_id = 0;
128 tx_message_struct.id_type = CAN_ID_STANDARD;
129 tx_message_struct.frame_type = CAN_TFT_DATA;
130 tx_message_struct.dlc = 8;
131 tx_message_struct.data[0] = 0x11;
132 tx_message_struct.data[1] = 0x22;
133 tx_message_struct.data[2] = 0x33;
134 tx_message_struct.data[3] = 0x44;
135 tx_message_struct.data[4] = 0x55;
136 tx_message_struct.data[5] = 0x66;
137 tx_message_struct.data[6] = 0x77;
138 tx_message_struct.data[7] = 0x88;
139 transmit_mailbox = can_message_transmit(CAN1, &tx_message_struct);
140 while(can_transmit_status_get(CAN1, (can_tx_mailbox_num_type)transmit_mailbox) != CAN_TX_STATUS_SUCCESSFUL);
141}
142
148void CAN1_RX0_IRQHandler(void)
149{
150 can_rx_message_type rx_message_struct;
151 if(can_flag_get(CAN1,CAN_RF0MN_FLAG) != RESET)
152 {
153 can_message_receive(CAN1, CAN_RX_FIFO0, &rx_message_struct);
154 if(rx_message_struct.standard_id == 0x400)
155 at32_led_toggle(LED2);
156 }
157}
158
164void CAN1_SE_IRQHandler(void)
165{
166 __IO uint32_t err_index = 0;
167 if(can_flag_get(CAN1,CAN_ETR_FLAG) != RESET)
168 {
169 err_index = CAN1->ests & 0x70;
170 can_flag_clear(CAN1, CAN_ETR_FLAG);
171 if(err_index == 0x00000010)
172 {
173 can_reset(CAN1);
174 can_configuration();
175 }
176 }
177}
178
184int main(void)
185{
186 system_clock_config();
187 at32_board_init();
188 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
189 can_gpio_config();
190 can_configuration();
191 while(1)
192 {
193 can_transmit_data();
194 at32_led_toggle(LED4);
195 delay_sec(1);
196 }
197}
198
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
CAN1_SE_IRQHandler
void CAN1_SE_IRQHandler(void)
can1 interrupt function se
Definition: project/at_start_f415/examples/can/loopback_mode/src/main.c:164
CAN1_RX0_IRQHandler
void CAN1_RX0_IRQHandler(void)
can1 interrupt function rx0
Definition: project/at_start_f415/examples/can/loopback_mode/src/main.c:148
can_transmit_data
static void can_transmit_data(void)
can transmit data
Definition: project/at_start_f415/examples/can/loopback_mode/src/main.c:122
main
int main(void)
main function.
Definition: project/at_start_f415/examples/can/loopback_mode/src/main.c:184
can_gpio_config
static void can_gpio_config(void)
can gpio config
Definition: project/at_start_f415/examples/can/loopback_mode/src/main.c:43
can_configuration
static void can_configuration(void)
can configiguration.
Definition: project/at_start_f415/examples/can/loopback_mode/src/main.c:72
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
can_base_init
error_status can_base_init(can_type *can_x, can_base_type *can_base_struct)
initialize the can peripheral according to the specified parameters in the can_init_struct.
Definition: at32f415_can.c:186
can_reset
void can_reset(can_type *can_x)
deinitialize the can peripheral registers to their default reset values.
Definition: at32f415_can.c:51
can_transmit_status_get
can_transmit_status_type can_transmit_status_get(can_type *can_x, can_tx_mailbox_num_type transmit_mailbox)
check the transmission state of the specified can peripheral.
Definition: at32f415_can.c:506
can_message_transmit
uint8_t can_message_transmit(can_type *can_x, can_tx_message_type *tx_message_struct)
fill the transmission message and transmit of the specified can peripheral.
Definition: at32f415_can.c:432
can_message_receive
void can_message_receive(can_type *can_x, can_rx_fifo_num_type fifo_number, can_rx_message_type *rx_message_struct)
receive message of the specified can peripheral.
Definition: at32f415_can.c:611
can_interrupt_enable
void can_interrupt_enable(can_type *can_x, uint32_t can_int, confirm_state new_state)
enable or disable the interrupt of the specified can peripheral.
Definition: at32f415_can.c:916
can_flag_get
flag_status can_flag_get(can_type *can_x, uint32_t can_flag)
get flag of the specified can peripheral.
Definition: at32f415_can.c:956
can_flag_clear
void can_flag_clear(can_type *can_x, uint32_t can_flag)
clear flag of the specified can peripheral.
Definition: at32f415_can.c:1079
can_baudrate_set
error_status can_baudrate_set(can_type *can_x, can_baudrate_type *can_baudrate_struct)
set the baudrate of the can peripheral
Definition: at32f415_can.c:91
can_filter_init
void can_filter_init(can_type *can_x, can_filter_init_type *can_filter_init_struct)
initialize the can peripheral according to the specified parameters in the can_filter_init_struct.
Definition: at32f415_can.c:296
can_default_para_init
void can_default_para_init(can_base_type *can_base_struct)
fill each can_init_struct member with its default value.
Definition: at32f415_can.c:149
can_tx_mailbox_num_type
can_tx_mailbox_num_type
can tx mailboxes
Definition: at32f415_can.h:252
CAN_FILTER_FIFO0
@ CAN_FILTER_FIFO0
Definition: at32f415_can.h:138
CAN_TX_STATUS_SUCCESSFUL
@ CAN_TX_STATUS_SUCCESSFUL
Definition: at32f415_can.h:273
CAN_DISCARDING_FIRST_RECEIVED
@ CAN_DISCARDING_FIRST_RECEIVED
Definition: at32f415_can.h:301
CAN_BTS2_3TQ
@ CAN_BTS2_3TQ
Definition: at32f415_can.h:222
CAN_TFT_DATA
@ CAN_TFT_DATA
Definition: at32f415_can.h:244
CAN_BTS1_8TQ
@ CAN_BTS1_8TQ
Definition: at32f415_can.h:204
CAN_FILTER_MODE_ID_MASK
@ CAN_FILTER_MODE_ID_MASK
Definition: at32f415_can.h:147
CAN_SENDING_BY_ID
@ CAN_SENDING_BY_ID
Definition: at32f415_can.h:310
CAN_FILTER_32BIT
@ CAN_FILTER_32BIT
Definition: at32f415_can.h:157
CAN_RX_FIFO0
@ CAN_RX_FIFO0
Definition: at32f415_can.h:263
CAN_ID_STANDARD
@ CAN_ID_STANDARD
Definition: at32f415_can.h:235
CAN_MODE_LOOPBACK
@ CAN_MODE_LOOPBACK
Definition: at32f415_can.h:166
CAN_RSAW_1TQ
@ CAN_RSAW_1TQ
Definition: at32f415_can.h:186
CAN_RF0MN_FLAG
#define CAN_RF0MN_FLAG
Definition: at32f415_can.h:72
CAN_ETR_FLAG
#define CAN_ETR_FLAG
Definition: at32f415_can.h:67
CAN_RF0MIEN_INT
#define CAN_RF0MIEN_INT
Definition: at32f415_can.h:92
CAN_EOIEN_INT
#define CAN_EOIEN_INT
Definition: at32f415_can.h:102
CAN_ETRIEN_INT
#define CAN_ETRIEN_INT
Definition: at32f415_can.h:101
CAN1
#define CAN1
Definition: at32f415_can.h:938
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_CAN1_PERIPH_CLOCK
@ CRM_CAN1_PERIPH_CLOCK
Definition: at32f415_crm.h:136
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CAN1_RX0_IRQn
@ CAN1_RX0_IRQn
Definition: at32f415.h:156
CAN1_SE_IRQn
@ CAN1_SE_IRQn
Definition: at32f415.h:158
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_pin_remap_config
void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration.
Definition: at32f415_gpio.c:521
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
CAN1_GMUX_0010
#define CAN1_GMUX_0010
Definition: at32f415_gpio.h:171
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
can_base_type
can init structure definition
Definition: at32f415_can.h:333
can_base_type::prsf_enable
confirm_state prsf_enable
Definition: at32f415_can.h:342
can_base_type::mdrsel_selection
can_msg_discarding_rule_type mdrsel_selection
Definition: at32f415_can.h:344
can_base_type::aed_enable
confirm_state aed_enable
Definition: at32f415_can.h:340
can_base_type::mmssr_selection
can_msg_sending_rule_type mmssr_selection
Definition: at32f415_can.h:346
can_base_type::ttc_enable
confirm_state ttc_enable
Definition: at32f415_can.h:336
can_base_type::mode_selection
can_mode_type mode_selection
Definition: at32f415_can.h:334
can_base_type::aebo_enable
confirm_state aebo_enable
Definition: at32f415_can.h:338
can_baudrate_type
can baudrate structure definition
Definition: at32f415_can.h:354
can_baudrate_type::baudrate_div
uint16_t baudrate_div
Definition: at32f415_can.h:355
can_baudrate_type::rsaw_size
can_rsaw_type rsaw_size
Definition: at32f415_can.h:357
can_baudrate_type::bts2_size
can_bts2_type bts2_size
Definition: at32f415_can.h:361
can_baudrate_type::bts1_size
can_bts1_type bts1_size
Definition: at32f415_can.h:359
can_filter_init_type
can filter init structure definition
Definition: at32f415_can.h:369
can_filter_init_type::filter_mask_low
uint16_t filter_mask_low
Definition: at32f415_can.h:389
can_filter_init_type::filter_number
uint8_t filter_number
Definition: at32f415_can.h:376
can_filter_init_type::filter_fifo
can_filter_fifo_type filter_fifo
Definition: at32f415_can.h:374
can_filter_init_type::filter_bit
can_filter_bit_width_type filter_bit
Definition: at32f415_can.h:378
can_filter_init_type::filter_mode
can_filter_mode_type filter_mode
Definition: at32f415_can.h:372
can_filter_init_type::filter_activate_enable
confirm_state filter_activate_enable
Definition: at32f415_can.h:370
can_filter_init_type::filter_mask_high
uint16_t filter_mask_high
Definition: at32f415_can.h:386
can_filter_init_type::filter_id_high
uint16_t filter_id_high
Definition: at32f415_can.h:380
can_filter_init_type::filter_id_low
uint16_t filter_id_low
Definition: at32f415_can.h:383
can_rx_message_type
can rx message structure definition
Definition: at32f415_can.h:419
can_rx_message_type::standard_id
uint32_t standard_id
Definition: at32f415_can.h:420
can_tx_message_type
can tx message structure definition
Definition: at32f415_can.h:397
can_tx_message_type::extended_id
uint32_t extended_id
Definition: at32f415_can.h:401
can_tx_message_type::frame_type
can_trans_frame_type frame_type
Definition: at32f415_can.h:406
can_tx_message_type::data
uint8_t data[8]
Definition: at32f415_can.h:411
can_tx_message_type::dlc
uint8_t dlc
Definition: at32f415_can.h:408
can_tx_message_type::id_type
can_identifier_type id_type
Definition: at32f415_can.h:404
can_tx_message_type::standard_id
uint32_t standard_id
Definition: at32f415_can.h:398
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • cmp
  • deep_sleep_mode
  • inc
project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • cmp
  • deep_sleep_mode
  • inc
project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • cmp
  • deep_sleep_mode
  • inc
project/at_start_f415/examples/cmp/deep_sleep_mode/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • cmp
  • deep_sleep_mode
  • src
project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • cmp
  • deep_sleep_mode
  • src
project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
141void CMP1_IRQHandler(void)
142{
143 if(exint_flag_get(EXINT_LINE_19) != RESET)
144 {
145 /* clear exint21 flag */
146 exint_flag_clear(EXINT_LINE_19);
147 }
148}
149
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c:65
CMP1_IRQHandler
void CMP1_IRQHandler(void)
this function handles cmp1 handler.
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c:141
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/at32f415_int.c:113
exint_flag_get
flag_status exint_flag_get(uint32_t exint_line)
get exint flag
Definition: at32f415_exint.c:142
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
EXINT_LINE_19
#define EXINT_LINE_19
Definition: at32f415_exint.h:71
RESET
@ RESET
Definition: at32f415.h:248
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • cmp
  • deep_sleep_mode
  • src
project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39__IO uint32_t capture = 0;
40__IO uint32_t tmr1freq;
41extern __IO uint16_t capturenumber;
42extern __IO uint32_t ic1readvalue1;
43extern __IO uint32_t ic1readvalue2;
44
45void cmp_exint_init(void)
46{
47 exint_init_type exint_init_struct;
48
49 exint_default_para_init(&exint_init_struct);
50 exint_init_struct.line_enable = TRUE;
51 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
52 exint_init_struct.line_select = EXINT_LINE_19;
53 exint_init_struct.line_polarity = EXINT_TRIGGER_FALLING_EDGE;
54 exint_init(&exint_init_struct);
55
56 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
57 nvic_irq_enable(CMP1_IRQn, 1, 0);
58}
59
66void cmp_config(void)
67{
68 cmp_init_type cmp_init_struct;
69 /* gpioa peripheral clock enable */
70 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
71
72 /* configure pa1: pa1 is used as cmp1 non inveting input */
73 gpio_init_struct.gpio_pins = GPIO_PINS_1;
74 gpio_init_struct.gpio_mode = GPIO_MODE_ANALOG;
75 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
76 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
77 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
78 gpio_init(GPIOA, &gpio_init_struct);
79
80 gpio_init_struct.gpio_pins = GPIO_PINS_6;
81 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
82 gpio_init(GPIOA, &gpio_init_struct);
83
84 /* cmp peripheral clock enable */
85 crm_periph_clock_enable(CRM_CMP_PERIPH_CLOCK, TRUE);
86
87 /* cmp1 init: pa1 is used cmp1 inverting input */
88 cmp_default_para_init(&cmp_init_struct);
89 cmp_init_struct.cmp_inverting = CMP_INVERTING_VREFINT;
90 cmp_init_struct.cmp_output = CMP_OUTPUT_NONE;
91 cmp_init_struct.cmp_polarity = CMP_POL_NON_INVERTING;
92 cmp_init_struct.cmp_speed = CMP_SPEED_FAST;
93 cmp_init_struct.cmp_hysteresis = CMP_HYSTERESIS_NONE;
94 cmp_init(CMP1_SELECTION, &cmp_init_struct);
95
96 /* enable cmp1 */
97 cmp_enable(CMP1_SELECTION, TRUE);
98
99 cmp_exint_init();
100}
101
102void sysclk_config_deep_sleep(void)
103{
104 /* enable external high-speed crystal oscillator - hext */
105 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
106
107 /* wait till hext is ready */
108 while(crm_hext_stable_wait() == ERROR);
109
110 /* enable pll */
111 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
112
113 /* wait till pll is ready */
114 while(crm_flag_get(CRM_PLL_STABLE_FLAG) == RESET);
115
116 /* enable auto step mode */
117 crm_auto_step_mode_enable(TRUE);
118
119 /* select pll as system clock source */
120 crm_sysclk_switch(CRM_SCLK_PLL);
121
122 /* wait till pll is used as system clock source */
123 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL);
124}
125
131int main(void)
132{
133 __IO uint32_t index = 0;
134
135 system_clock_config();
136
137 at32_board_init();
138
139 uart_print_init(115200);
140
141 /* cmp1 configuration */
142 cmp_config();
143
144 while (1)
145 {
146 printf("\r\nenter deep sleep mode...\r\n");
147 /* enter deep sleep mode */
148 pwc_deep_sleep_mode_enter(PWC_DEEP_SLEEP_ENTER_WFI);
149
150 /* wait clock stable */
151 for(index = 0; index < 600; index++)
152 {
153 __NOP();
154 }
155
156 sysclk_config_deep_sleep();
157 printf("\r\nwakeup from deep sleep mode by cmp, mcu is running...\r\n");
158 delay_sec(1);
159 }
160}
161
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
tmr1freq
__IO uint32_t tmr1freq
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:40
cmp_config
void cmp_config(void)
configures cmp: pa1 to cmp inverting input and cmp output to tmr1 ch1.
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:66
ic1readvalue2
__IO uint32_t ic1readvalue2
sysclk_config_deep_sleep
void sysclk_config_deep_sleep(void)
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:102
capturenumber
__IO uint16_t capturenumber
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:135
cmp_exint_init
void cmp_exint_init(void)
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:45
main
int main(void)
main function.
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:131
ic1readvalue1
__IO uint32_t ic1readvalue1
capture
__IO uint32_t capture
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
cmp_init
void cmp_init(cmp_sel_type cmp_sel, cmp_init_type *cmp_init_struct)
initialize the cmp peripheral
Definition: at32f415_cmp.c:67
cmp_enable
void cmp_enable(cmp_sel_type cmp_sel, confirm_state new_state)
enable or disable cmp
Definition: at32f415_cmp.c:113
cmp_default_para_init
void cmp_default_para_init(cmp_init_type *cmp_init_struct)
fill each cmp_init_type member with its default value.
Definition: at32f415_cmp.c:95
CMP1_SELECTION
@ CMP1_SELECTION
Definition: at32f415_cmp.h:127
CMP_POL_NON_INVERTING
@ CMP_POL_NON_INVERTING
Definition: at32f415_cmp.h:107
CMP_SPEED_FAST
@ CMP_SPEED_FAST
Definition: at32f415_cmp.h:81
CMP_INVERTING_VREFINT
@ CMP_INVERTING_VREFINT
Definition: at32f415_cmp.h:69
CMP_OUTPUT_NONE
@ CMP_OUTPUT_NONE
Definition: at32f415_cmp.h:92
CMP_HYSTERESIS_NONE
@ CMP_HYSTERESIS_NONE
Definition: at32f415_cmp.h:116
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_CMP_PERIPH_CLOCK
@ CRM_CMP_PERIPH_CLOCK
Definition: at32f415_crm.h:127
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
CMP1_IRQn
@ CMP1_IRQn
Definition: at32f415.h:188
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_FALLING_EDGE
@ EXINT_TRIGGER_FALLING_EDGE
Definition: at32f415_exint.h:99
EXINT_LINE_19
#define EXINT_LINE_19
Definition: at32f415_exint.h:71
ERROR
@ ERROR
Definition: at32f415.h:258
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_ANALOG
@ GPIO_MODE_ANALOG
Definition: at32f415_gpio.h:231
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_1
#define GPIO_PINS_1
Definition: at32f415_gpio.h:52
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_deep_sleep_mode_enter
void pwc_deep_sleep_mode_enter(pwc_deep_sleep_enter_type pwc_deep_sleep_enter)
enter pwc deep-sleep mode
Definition: at32f415_pwc.c:189
PWC_DEEP_SLEEP_ENTER_WFI
@ PWC_DEEP_SLEEP_ENTER_WFI
Definition: at32f415_pwc.h:97
cmp_init_type
cmp init type
Definition: at32f415_cmp.h:135
cmp_init_type::cmp_output
cmp_output_type cmp_output
Definition: at32f415_cmp.h:139
cmp_init_type::cmp_polarity
cmp_polarity_type cmp_polarity
Definition: at32f415_cmp.h:140
cmp_init_type::cmp_speed
cmp_speed_type cmp_speed
Definition: at32f415_cmp.h:138
cmp_init_type::cmp_inverting
cmp_inverting_type cmp_inverting
Definition: at32f415_cmp.h:137
cmp_init_type::cmp_hysteresis
cmp_hysteresis_type cmp_hysteresis
Definition: at32f415_cmp.h:141
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • cmp
  • output
  • inc
project/at_start_f415/examples/cmp/output/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • cmp
  • output
  • inc
project/at_start_f415/examples/cmp/output/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • cmp
  • output
  • inc
project/at_start_f415/examples/cmp/output/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • cmp
  • output
  • src
project/at_start_f415/examples/cmp/output/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • cmp
  • output
  • src
project/at_start_f415/examples/cmp/output/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
135__IO uint16_t capturenumber = 0;
136__IO uint32_t ch1readvalue1 = 0, ch1readvalue2 = 0;
137void TMR1_CH_IRQHandler(void)
138{
139 TMR1->ists=0;
140 switch(capturenumber)
141 {
142
143 case 0:
144 ch1readvalue1=TMR1->c1dt;
145 capturenumber = 1;
146 break;
147 case 1:
148 ch1readvalue2=TMR1->c1dt;
149 capturenumber = 2;
150 break;
151 default:
152 TMR1->ists=0;
153 break;
154 }
155}
156
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:91
TMR1_CH_IRQHandler
void TMR1_CH_IRQHandler(void)
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:137
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:122
capturenumber
__IO uint16_t capturenumber
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:135
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:131
ch1readvalue2
__IO uint32_t ch1readvalue2
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:136
ch1readvalue1
__IO uint32_t ch1readvalue1
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:136
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:113
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • cmp
  • output
  • src
project/at_start_f415/examples/cmp/output/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39__IO uint32_t capture = 0;
40__IO uint32_t tmr1freq;
41extern __IO uint16_t capturenumber;
42extern __IO uint32_t ch1readvalue1;
43extern __IO uint32_t ch1readvalue2;
44
50void cmp_config(void)
51{
52 cmp_init_type cmp_init_struct;
53 /* gpioa peripheral clock enable */
54 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
55 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
56
57 /* configure pa1: pa1 is used as cmp1 non inveting input */
58 gpio_init_struct.gpio_pins = GPIO_PINS_1;
59 gpio_init_struct.gpio_mode = GPIO_MODE_ANALOG;
60 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
61 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
62 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
63 gpio_init(GPIOA, &gpio_init_struct);
64
65 gpio_init_struct.gpio_pins = GPIO_PINS_0;
66 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
67 gpio_init(GPIOA, &gpio_init_struct);
68
69 gpio_pin_remap_config(TMR1_CH1_CMP_GMUX_10, TRUE);
70
71 /* cmp peripheral clock enable */
72 crm_periph_clock_enable(CRM_CMP_PERIPH_CLOCK, TRUE);
73
74 /* cmp1 init: pa1 is used cmp1 inverting input */
75 cmp_default_para_init(&cmp_init_struct);
76 cmp_init_struct.cmp_inverting = CMP_INVERTING_1_4VREFINT;
77 cmp_init_struct.cmp_output = CMP_OUTPUT_TMR1CH1;
78 cmp_init_struct.cmp_polarity = CMP_POL_NON_INVERTING;
79 cmp_init_struct.cmp_speed = CMP_SPEED_FAST;
80 cmp_init_struct.cmp_hysteresis = CMP_HYSTERESIS_NONE;
81 cmp_init(CMP1_SELECTION, &cmp_init_struct);
82
83 /* enable cmp1 */
84 cmp_enable(CMP1_SELECTION, TRUE);
85}
86
92void tmr1_init(void)
93{
94 tmr_input_config_type tmr_ic_init_structure;
95
96 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
97 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
98
99 gpio_default_para_init(&gpio_init_struct);
100 gpio_init_struct.gpio_pins = GPIO_PINS_8;
101 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
102 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
103 gpio_init(GPIOA, &gpio_init_struct);
104
105 nvic_irq_enable(TMR1_CH_IRQn, 0, 1);
106
107 /* tmr1 time base configuration */
108 tmr_base_init(TMR1, 0xffff, 0);
109 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
110 tmr_clock_source_div_set(TMR1, TMR_CLOCK_DIV1);
111
112 /* channel 4 configuration in pwm mode */
113 tmr_input_default_para_init(&tmr_ic_init_structure);
114 tmr_ic_init_structure.input_channel_select = TMR_SELECT_CHANNEL_1;
115 tmr_ic_init_structure.input_filter_value = 0x00;
116 tmr_ic_init_structure.input_mapped_select = TMR_CC_CHANNEL_MAPPED_DIRECT;
117 tmr_ic_init_structure.input_polarity_select = TMR_INPUT_RISING_EDGE;
118 tmr_input_channel_init(TMR1, &tmr_ic_init_structure, TMR_CHANNEL_INPUT_DIV_1);
119 tmr_interrupt_enable(TMR1, TMR_C1_INT, TRUE);
120
121 /* tmr1 counter enable */
122 tmr_counter_enable(TMR1, TRUE);
123
124 /* reset the flags */
125 TMR1->ists &= 0 ;
126}
127
133int main(void)
134{
135 system_clock_config();
136
137 at32_board_init();
138
139 uart_print_init(115200);
140
141 /* cmp1 configuration */
142 cmp_config();
143
144 /* tmr1 configuration in input capture mode */
145 tmr1_init();
146
147 printf("cmp output test..\r\n");
148
149 while (1)
150 {
151 if(capturenumber > 1)
152 {
153 /* capture computation */
154 if (ch1readvalue2 > ch1readvalue1)
155 {
156 capture = (ch1readvalue2 - ch1readvalue1);
157 }
158 else
159 {
160 capture = ((0xffff - ch1readvalue1) + ch1readvalue2);
161 }
162 /* frequency computation */
163 tmr1freq = (uint32_t)system_core_clock / capture;
164 printf("f1=%d\r\n",tmr1freq);
165 capturenumber=0;
166 }
167 }
168}
169
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/output/src/main.c:38
tmr1freq
__IO uint32_t tmr1freq
Definition: project/at_start_f415/examples/cmp/output/src/main.c:40
cmp_config
void cmp_config(void)
configures cmp
Definition: project/at_start_f415/examples/cmp/output/src/main.c:50
capturenumber
__IO uint16_t capturenumber
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:135
main
int main(void)
main function.
Definition: project/at_start_f415/examples/cmp/output/src/main.c:133
ch1readvalue2
__IO uint32_t ch1readvalue2
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:136
ch1readvalue1
__IO uint32_t ch1readvalue1
Definition: project/at_start_f415/examples/cmp/output/src/at32f415_int.c:136
tmr1_init
void tmr1_init(void)
configures tmr1_ch1 as input
Definition: project/at_start_f415/examples/cmp/output/src/main.c:92
capture
__IO uint32_t capture
Definition: project/at_start_f415/examples/cmp/output/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
tmr_ic_init_structure
tmr_input_config_type tmr_ic_init_structure
Definition: project/at_start_f415/examples/tmr/one_cycle/src/main.c:39
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
cmp_init
void cmp_init(cmp_sel_type cmp_sel, cmp_init_type *cmp_init_struct)
initialize the cmp peripheral
Definition: at32f415_cmp.c:67
cmp_enable
void cmp_enable(cmp_sel_type cmp_sel, confirm_state new_state)
enable or disable cmp
Definition: at32f415_cmp.c:113
cmp_default_para_init
void cmp_default_para_init(cmp_init_type *cmp_init_struct)
fill each cmp_init_type member with its default value.
Definition: at32f415_cmp.c:95
CMP1_SELECTION
@ CMP1_SELECTION
Definition: at32f415_cmp.h:127
CMP_POL_NON_INVERTING
@ CMP_POL_NON_INVERTING
Definition: at32f415_cmp.h:107
CMP_SPEED_FAST
@ CMP_SPEED_FAST
Definition: at32f415_cmp.h:81
CMP_INVERTING_1_4VREFINT
@ CMP_INVERTING_1_4VREFINT
Definition: at32f415_cmp.h:66
CMP_OUTPUT_TMR1CH1
@ CMP_OUTPUT_TMR1CH1
Definition: at32f415_cmp.h:94
CMP_HYSTERESIS_NONE
@ CMP_HYSTERESIS_NONE
Definition: at32f415_cmp.h:116
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_CMP_PERIPH_CLOCK
@ CRM_CMP_PERIPH_CLOCK
Definition: at32f415_crm.h:127
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
TMR1_CH_IRQn
@ TMR1_CH_IRQn
Definition: at32f415.h:163
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_pin_remap_config
void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration.
Definition: at32f415_gpio.c:521
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_ANALOG
@ GPIO_MODE_ANALOG
Definition: at32f415_gpio.h:231
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIO_PINS_1
#define GPIO_PINS_1
Definition: at32f415_gpio.h:52
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
TMR1_CH1_CMP_GMUX_10
#define TMR1_CH1_CMP_GMUX_10
Definition: at32f415_gpio.h:208
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_input_channel_init
void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
init tmr input channel
Definition: at32f415_tmr.c:780
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_input_default_para_init
void tmr_input_default_para_init(tmr_input_config_type *tmr_input_struct)
init tmr input default para
Definition: at32f415_tmr.c:132
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_INPUT_RISING_EDGE
@ TMR_INPUT_RISING_EDGE
Definition: at32f415_tmr.h:206
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_CC_CHANNEL_MAPPED_DIRECT
@ TMR_CC_CHANNEL_MAPPED_DIRECT
Definition: at32f415_tmr.h:239
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_CHANNEL_INPUT_DIV_1
@ TMR_CHANNEL_INPUT_DIV_1
Definition: at32f415_tmr.h:249
TMR_C1_INT
#define TMR_C1_INT
Definition: at32f415_tmr.h:75
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
cmp_init_type
cmp init type
Definition: at32f415_cmp.h:135
cmp_init_type::cmp_output
cmp_output_type cmp_output
Definition: at32f415_cmp.h:139
cmp_init_type::cmp_polarity
cmp_polarity_type cmp_polarity
Definition: at32f415_cmp.h:140
cmp_init_type::cmp_speed
cmp_speed_type cmp_speed
Definition: at32f415_cmp.h:138
cmp_init_type::cmp_inverting
cmp_inverting_type cmp_inverting
Definition: at32f415_cmp.h:137
cmp_init_type::cmp_hysteresis
cmp_hysteresis_type cmp_hysteresis
Definition: at32f415_cmp.h:141
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_input_config_type
tmr input capture config type
Definition: at32f415_tmr.h:412
tmr_input_config_type::input_mapped_select
tmr_input_direction_mapped_type input_mapped_select
Definition: at32f415_tmr.h:415
tmr_input_config_type::input_filter_value
uint8_t input_filter_value
Definition: at32f415_tmr.h:416
tmr_input_config_type::input_polarity_select
tmr_input_polarity_type input_polarity_select
Definition: at32f415_tmr.h:414
tmr_input_config_type::input_channel_select
tmr_channel_select_type input_channel_select
Definition: at32f415_tmr.h:413
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • cortex_m4
  • bit_band
  • inc
project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • cortex_m4
  • bit_band
  • inc
project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • cortex_m4
  • bit_band
  • inc
project/at_start_f415/examples/cortex_m4/bit_band/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • cortex_m4
  • bit_band
  • src
project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • cortex_m4
  • bit_band
  • src
project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • cortex_m4
  • bit_band
  • src
project/at_start_f415/examples/cortex_m4/bit_band/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
39/* bit band for sram */
40#define RAM_BASE 0x20000000
41#define RAM_BITBAND_BASE 0x22000000
42
43#define VARIABLES_RESET_BIT(variables_addr, bit_number) \
44 (*(uint32_t *)(RAM_BITBAND_BASE + ((variables_addr - RAM_BASE) * 32) + ((bit_number) * 4)) = 0)
45
46#define VARIABLES_SET_BIT(variables_addr, bit_number) \
47 (*(uint32_t *)(RAM_BITBAND_BASE + ((variables_addr - RAM_BASE) * 32) + ((bit_number) * 4)) = 1)
48
49#define VARIABLES_GET_BIT(variables_addr, bit_number) \
50 (*(uint32_t *)(RAM_BITBAND_BASE + ((variables_addr - RAM_BASE) * 32) + ((bit_number) * 4)))
51
52/* bit band for peripheral */
53#define PERIPHERAL_BASE 0x40000000
54#define PERIPHERAL_BITBAND_BASE 0x42000000
55
56#define PERIPHERAL_RESET_BIT(peripheral_addr, bit_number) \
57 (*(uint32_t *)(PERIPHERAL_BITBAND_BASE + ((peripheral_addr - PERIPHERAL_BASE) * 32) + ((bit_number) * 4)) = 0)
58
59#define PERIPHERAL_SET_BIT(peripheral_addr, bit_number) \
60 (*(uint32_t *)(PERIPHERAL_BITBAND_BASE + ((peripheral_addr - PERIPHERAL_BASE) * 32) + ((bit_number) * 4)) = 1)
61
62__IO uint32_t variables, variables_addr = 0, variables_bit_val = 0;
63
69void result_error(void)
70{
71 while(1)
72 {
73 at32_led_toggle(LED4);
74 delay_sec(1);
75 }
76}
77
83int main(void)
84{
85 system_clock_config();
86 at32_board_init();
87 variables = 0xA5A5A5A5;
88
89 /* get the variables address */
90 variables_addr = (uint32_t)&variables;
91
92 /* modify variables bit0 and check result */
93 VARIABLES_RESET_BIT(variables_addr, 0);
94 if((variables != 0xA5A5A5A4) || (VARIABLES_GET_BIT(variables_addr, 0) != 0))
95 {
96 result_error();
97 }
98
99 /* modify variables bit0 and check result */
100 VARIABLES_SET_BIT(variables_addr, 0);
101 if((variables != 0xA5A5A5A5) || (VARIABLES_GET_BIT(variables_addr, 0) != 1))
102 {
103 result_error();
104 }
105
106 /* modify variables bit16 and check result */
107 VARIABLES_RESET_BIT(variables_addr, 16);
108 if((variables != 0xA5A4A5A5) || (VARIABLES_GET_BIT(variables_addr, 16) != 0))
109 {
110 result_error();
111 }
112
113 /* modify variables bit16 and check result */
114 VARIABLES_SET_BIT(variables_addr, 16);
115 if((variables != 0xA5A5A5A5) || (VARIABLES_GET_BIT(variables_addr, 16) != 1))
116 {
117 result_error();
118 }
119
120 /* modify variables bit31 and check result */
121 VARIABLES_RESET_BIT(variables_addr, 31);
122 if((variables != 0x25A5A5A5) || (VARIABLES_GET_BIT(variables_addr, 31) != 0))
123 {
124 result_error();
125 }
126
127 /* modify variables bit31 and check result */
128 VARIABLES_SET_BIT(variables_addr, 31);
129 if((variables != 0xA5A5A5A5) || (VARIABLES_GET_BIT(variables_addr, 31) != 1))
130 {
131 result_error();
132 }
133
134 while(1)
135 {
136 /* led2 toggle */
137 PERIPHERAL_RESET_BIT((uint32_t)&LED2_GPIO->odt, 2);
138 delay_ms(500);
139 PERIPHERAL_SET_BIT((uint32_t)&LED2_GPIO->odt, 2);
140 delay_ms(500);
141 }
142}
143
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
variables
__IO uint32_t variables
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/main.c:62
variables_addr
__IO uint32_t variables_addr
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/main.c:62
variables_bit_val
__IO uint32_t variables_bit_val
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/main.c:62
PERIPHERAL_SET_BIT
#define PERIPHERAL_SET_BIT(peripheral_addr, bit_number)
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/main.c:59
main
int main(void)
main function.
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/main.c:83
result_error
void result_error(void)
led4 flick for error.
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/main.c:69
VARIABLES_SET_BIT
#define VARIABLES_SET_BIT(variables_addr, bit_number)
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/main.c:46
PERIPHERAL_RESET_BIT
#define PERIPHERAL_RESET_BIT(peripheral_addr, bit_number)
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/main.c:56
VARIABLES_RESET_BIT
#define VARIABLES_RESET_BIT(variables_addr, bit_number)
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/main.c:43
VARIABLES_GET_BIT
#define VARIABLES_GET_BIT(variables_addr, bit_number)
Definition: project/at_start_f415/examples/cortex_m4/bit_band/src/main.c:49
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED4
@ LED4
Definition: at32f415_board.h:65
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • cortex_m4
  • systick_interrupt
  • inc
project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • cortex_m4
  • systick_interrupt
  • inc
project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • cortex_m4
  • systick_interrupt
  • inc
project/at_start_f415/examples/cortex_m4/systick_interrupt/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • cortex_m4
  • systick_interrupt
  • src
project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • cortex_m4
  • systick_interrupt
  • src
project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
30extern void systick_handler(void);
31
45void NMI_Handler(void)
46{
47}
48
54void HardFault_Handler(void)
55{
56 /* go to infinite loop when hard fault exception occurs */
57 while(1)
58 {
59 }
60}
61
67void MemManage_Handler(void)
68{
69 /* go to infinite loop when memory manage exception occurs */
70 while(1)
71 {
72 }
73}
74
80void BusFault_Handler(void)
81{
82 /* go to infinite loop when bus fault exception occurs */
83 while(1)
84 {
85 }
86}
87
93void UsageFault_Handler(void)
94{
95 /* go to infinite loop when usage fault exception occurs */
96 while(1)
97 {
98 }
99}
100
106void SVC_Handler(void)
107{
108}
109
115void DebugMon_Handler(void)
116{
117}
118
124void PendSV_Handler(void)
125{
126}
127
133void SysTick_Handler(void)
134{
135 systick_handler();
136}
137
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c:80
systick_handler
void systick_handler(void)
systick interrupt handler.
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c:46
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/at32f415_int.c:115
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • cortex_m4
  • systick_interrupt
  • src
project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define MS_TICK (system_core_clock / 1000U)
39#define DELAY 200 /* 200 ms ticks */
40
46void systick_handler(void)
47{
48 static uint32_t ticks = 0;
49
50 ticks ++;
51
52 /* toggle led */
53 if(ticks > DELAY)
54 {
55 at32_led_toggle(LED2);
56 ticks = 0;
57 }
58}
59
65int main(void)
66{
67 system_clock_config();
68
69 /* config systick clock source */
70 systick_clock_source_config(SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV);
71
72 /* config systick reload value and enable interrupt */
73 SysTick_Config(MS_TICK);
74
75 /* configure led */
76 at32_led_init(LED2);
77
78 while(1)
79 {
80 }
81}
82
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
MS_TICK
#define MS_TICK
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c:38
DELAY
#define DELAY
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c:39
main
int main(void)
main function.
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c:65
systick_handler
void systick_handler(void)
systick interrupt handler.
Definition: project/at_start_f415/examples/cortex_m4/systick_interrupt/src/main.c:46
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED2
@ LED2
Definition: at32f415_board.h:63
at32_led_init
void at32_led_init(led_type led)
configure led gpio
Definition: at32f415_board.c:216
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
systick_clock_source_config
void systick_clock_source_config(systick_clock_source_type source)
config systick clock source
Definition: at32f415_misc.c:147
SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV
@ SYSTICK_CLOCK_SOURCE_AHBCLK_NODIV
Definition: at32f415_misc.h:90
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • crc
  • calculation
  • inc
project/at_start_f415/examples/crc/calculation/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • crc
  • calculation
  • inc
project/at_start_f415/examples/crc/calculation/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • crc
  • calculation
  • inc
project/at_start_f415/examples/crc/calculation/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • crc
  • calculation
  • src
project/at_start_f415/examples/crc/calculation/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/crc/calculation/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • crc
  • calculation
  • src
project/at_start_f415/examples/crc/calculation/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/crc/calculation/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/crc/calculation/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/crc/calculation/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/crc/calculation/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/crc/calculation/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/crc/calculation/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/crc/calculation/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/crc/calculation/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/crc/calculation/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • crc
  • calculation
  • src
project/at_start_f415/examples/crc/calculation/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define BUFFER_SIZE 120
39
40static const uint32_t data_buffer[BUFFER_SIZE] =
41{
42 0xc33dd31c, 0xe37ff35e, 0x129022f3, 0x32d24235, 0x52146277, 0x7256b5ea,
43 0x4a755a54, 0x6a377a16, 0x0af11ad0, 0x2ab33a92, 0xed0fdd6c, 0xcd4dbdaa,
44 0xbb3bab1a, 0x6ca67c87, 0x5cc52c22, 0x3c030c60, 0x1c41edae, 0xfd8fcdec,
45 0xad8b9de8, 0x8dc97c26, 0x5c644c45, 0x3ca22c83, 0x1ce00cc1, 0xef1fff3e,
46 0x95a88589, 0xf56ee54f, 0xd52cc50d, 0x34e224c3, 0x04817466, 0x64475424,
47 0x78066827, 0x18c008e1, 0x28a3cb7d, 0xdb5ceb3f, 0xfb1e8bf9, 0x9bd8abbb,
48 0xdf7caf9b, 0xbfba8fd9, 0x9ff86e17, 0x7e364e55, 0x2e933eb2, 0x0ed11ef0,
49 0xa35ad3bd, 0xc39cf3ff, 0xe3de2462, 0x34430420, 0x64e674c7, 0x44a45485,
50 0xad2abd0b, 0x8d689d49, 0x7e976eb6, 0x5ed54ef4, 0x2e321e51, 0x0e70ff9f,
51 0xefbedfdd, 0xcffcbf1b, 0x9f598f78, 0x918881a9, 0xb1caa1eb, 0xd10cc12d,
52 0xe16f1080, 0x00a130c2, 0x20e35004, 0x40257046, 0x83b99398, 0xa3fbb3da,
53 0x00001021, 0x20423063, 0x408450a5, 0x60c670e7, 0x9129a14a, 0xb16bc18c,
54 0x569546b4, 0xb75ba77a, 0x97198738, 0xf7dfe7fe, 0xc7bc48c4, 0x58e56886,
55 0x4405a7db, 0xb7fa8799, 0xe75ff77e, 0xc71dd73c, 0x26d336f2, 0x069116b0,
56 0x76764615, 0x5634d94c, 0xc96df90e, 0xe92f99c8, 0xb98aa9ab, 0x58444865,
57 0x78a70840, 0x18612802, 0xc9ccd9ed, 0xe98ef9af, 0x89489969, 0xa90ab92b,
58 0xd1ade1ce, 0xf1ef1231, 0x32732252, 0x52b54294, 0x72f762d6, 0x93398318,
59 0xa56ab54b, 0x85289509, 0xf5cfc5ac, 0xd58d3653, 0x26721611, 0x063076d7,
60 0x8d689d49, 0xf7dfe7fe, 0xe98ef9af, 0x063076d7, 0x93398318, 0xb98aa9ab,
61 0x4ad47ab7, 0x6a961a71, 0x0a503a33, 0x2a12dbfd, 0xfbbfeb9e, 0x9b798b58
62};
63
64__IO uint32_t crc_value = 0;
65
71int main(void)
72{
73 system_clock_config();
74
75 at32_board_init();
76
77 /* enable crc clock */
78 crm_periph_clock_enable(CRM_CRC_PERIPH_CLOCK, TRUE);
79
80 crc_data_reset();
81
82 /* compute the crc of "data_buffer" */
83 crc_value = crc_block_calculate((uint32_t *)data_buffer, BUFFER_SIZE);
84
85 if(crc_value == 0xE5DFCF6D)
86 {
87 /* turn on led3 */
88 at32_led_on(LED3);
89 }
90 else
91 {
92 /* turn on led4 */
93 at32_led_on(LED4);
94 }
95
96 while(1)
97 {
98 }
99}
100
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
BUFFER_SIZE
#define BUFFER_SIZE
Definition: project/at_start_f415/examples/crc/calculation/src/main.c:38
data_buffer
static const uint32_t data_buffer[120]
Definition: project/at_start_f415/examples/crc/calculation/src/main.c:40
main
int main(void)
main function.
Definition: project/at_start_f415/examples/crc/calculation/src/main.c:71
crc_value
__IO uint32_t crc_value
Definition: project/at_start_f415/examples/crc/calculation/src/main.c:64
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crc_block_calculate
uint32_t crc_block_calculate(uint32_t *pbuffer, uint32_t length)
compute the 32-bit crc of a given buffer of data word(32-bit).
Definition: at32f415_crc.c:72
crc_data_reset
void crc_data_reset(void)
reset the crc data register.
Definition: at32f415_crc.c:49
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_CRC_PERIPH_CLOCK
@ CRM_CRC_PERIPH_CLOCK
Definition: at32f415_crm.h:105
TRUE
@ TRUE
Definition: at32f415.h:253
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • crm
  • clock_failure_detection
  • inc
project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • crm
  • clock_failure_detection
  • inc
project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • crm
  • clock_failure_detection
  • inc
project/at_start_f415/examples/crm/clock_failure_detection/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • crm
  • clock_failure_detection
  • src
project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • crm
  • clock_failure_detection
  • src
project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
30extern void clock_failure_detection_handler(void);
31
45void NMI_Handler(void)
46{
47 clock_failure_detection_handler();
48}
49
55void HardFault_Handler(void)
56{
57 /* go to infinite loop when hard fault exception occurs */
58 while(1)
59 {
60 }
61}
62
68void MemManage_Handler(void)
69{
70 /* go to infinite loop when memory manage exception occurs */
71 while(1)
72 {
73 }
74}
75
81void BusFault_Handler(void)
82{
83 /* go to infinite loop when bus fault exception occurs */
84 while(1)
85 {
86 }
87}
88
94void UsageFault_Handler(void)
95{
96 /* go to infinite loop when usage fault exception occurs */
97 while(1)
98 {
99 }
100}
101
107void SVC_Handler(void)
108{
109}
110
116void DebugMon_Handler(void)
117{
118}
119
125void PendSV_Handler(void)
126{
127}
128
134void SysTick_Handler(void)
135{
136}
137
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c:94
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c:55
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c:68
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c:107
clock_failure_detection_handler
void clock_failure_detection_handler(void)
clock failure detection handler.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/main.c:76
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c:125
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c:81
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c:134
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/at32f415_int.c:116
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • crm
  • clock_failure_detection
  • src
project/at_start_f415/examples/crm/clock_failure_detection/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38static void clkout_config(void);
39static void sclk_144m_hick_config(void);
40void clock_failure_detection_handler(void);
41
47static void clkout_config(void)
48{
49 gpio_init_type gpio_init_struct;
50
51 /* enable gpio port clock */
52 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
53
54 /* set default parameter */
55 gpio_default_para_init(&gpio_init_struct);
56
57 /* clkout gpio init */
58 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
59 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
60 gpio_init_struct.gpio_pins = GPIO_PINS_8;
61 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
62 gpio_init(GPIOA, &gpio_init_struct);
63
64 /* config clkout division */
65 crm_clkout_div_set(CRM_CLKOUT_DIV_1);
66
67 /* config clkout clock */
68 crm_clock_out_set(CRM_CLKOUT_PLL_DIV_4);
69}
70
76void clock_failure_detection_handler(void)
77{
78 /* check clock failure detection flag */
79 if(crm_flag_get(CRM_CLOCK_FAILURE_INT_FLAG) != RESET)
80 {
81 /* disable clock failure detection */
82 crm_clock_failure_detection_enable(FALSE);
83
84 /* config system clock */
85 sclk_144m_hick_config();
86
87 /* clear clock failure detection flag */
88 crm_flag_clear(CRM_CLOCK_FAILURE_INT_FLAG);
89 }
90}
91
110static void sclk_144m_hick_config(void)
111{
112 /* config flash psr register */
113 flash_psr_set(FLASH_WAIT_CYCLE_4);
114
115 /* reset crm */
116 crm_reset();
117
118 crm_clock_source_enable(CRM_CLOCK_SOURCE_HICK, TRUE);
119
120 /* wait till hick is ready */
121 while(crm_flag_get(CRM_HICK_STABLE_FLAG) != SET)
122 {
123 }
124
125 /* config pll clock resource */
126 crm_pll_config(CRM_PLL_SOURCE_HICK, CRM_PLL_MULT_36);
127
128 /* enable pll */
129 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
130
131 /* wait till pll is ready */
132 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
133 {
134 }
135
136 /* config ahbclk */
137 crm_ahb_div_set(CRM_AHB_DIV_1);
138
139 /* config apb2clk */
140 crm_apb2_div_set(CRM_APB2_DIV_2);
141
142 /* config apb1clk */
143 crm_apb1_div_set(CRM_APB1_DIV_2);
144
145 /* enable auto step mode */
146 crm_auto_step_mode_enable(TRUE);
147
148 /* select pll as system clock source */
149 crm_sysclk_switch(CRM_SCLK_PLL);
150
151 /* wait till pll is used as system clock source */
152 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
153 {
154 }
155
156 /* disable auto step mode */
157 crm_auto_step_mode_enable(FALSE);
158
159 /* update system_core_clock global variable */
160 system_core_clock_update();
161
162 /* config systick delay */
163 delay_init();
164
165 /* config clkout */
166 clkout_config();
167}
168
174int main(void)
175{
176 system_clock_config();
177
178 at32_board_init();
179
180 /* clkout config */
181 clkout_config();
182
183 /* enable clock failure detection */
184 crm_clock_failure_detection_enable(TRUE);
185
186 while(1)
187 {
188 at32_led_toggle(LED2);
189 delay_ms(200);
190 }
191}
192
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
clkout_config
static void clkout_config(void)
clkout configuration.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/main.c:47
clock_failure_detection_handler
void clock_failure_detection_handler(void)
clock failure detection handler.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/main.c:76
main
int main(void)
main function.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/main.c:174
sclk_144m_hick_config
static void sclk_144m_hick_config(void)
config sclk 144 mhz with hick clock source.
Definition: project/at_start_f415/examples/crm/clock_failure_detection/src/main.c:110
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
LED2
@ LED2
Definition: at32f415_board.h:63
delay_init
void delay_init()
initialize delay function
Definition: at32f415_board.c:291
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_clkout_div_set
void crm_clkout_div_set(crm_clkout_div_type clkout_div)
set crm clkout division
Definition: at32f415_crm.c:901
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_flag_clear
void crm_flag_clear(uint32_t flag)
clear the crm reset flags
Definition: at32f415_crm.c:333
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_clock_out_set
void crm_clock_out_set(crm_clkout_select_type clkout)
set crm clkout
Definition: at32f415_crm.c:803
crm_clock_failure_detection_enable
void crm_clock_failure_detection_enable(confirm_state new_state)
enable or disable clock failure detection
Definition: at32f415_crm.c:486
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_HICK
@ CRM_CLOCK_SOURCE_HICK
Definition: at32f415_crm.h:303
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLKOUT_DIV_1
@ CRM_CLKOUT_DIV_1
Definition: at32f415_crm.h:429
CRM_PLL_SOURCE_HICK
@ CRM_PLL_SOURCE_HICK
Definition: at32f415_crm.h:280
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_CLKOUT_PLL_DIV_4
@ CRM_CLKOUT_PLL_DIV_4
Definition: at32f415_crm.h:419
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
CRM_CLOCK_FAILURE_INT_FLAG
#define CRM_CLOCK_FAILURE_INT_FLAG
Definition: at32f415_crm.h:71
CRM_HICK_STABLE_FLAG
#define CRM_HICK_STABLE_FLAG
Definition: at32f415_crm.h:55
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • crm
  • pll_config2
  • inc
project/at_start_f415/examples/crm/pll_config2/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • crm
  • pll_config2
  • inc
project/at_start_f415/examples/crm/pll_config2/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • crm
  • pll_config2
  • inc
project/at_start_f415/examples/crm/pll_config2/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • crm
  • pll_config2
  • src
project/at_start_f415/examples/crm/pll_config2/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
50void system_clock_config(void)
51{
52 /* config flash psr register */
53 flash_psr_set(FLASH_WAIT_CYCLE_4);
54
55 /* reset crm */
56 crm_reset();
57
58 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
59
60 /* wait till hext is ready */
61 while(crm_hext_stable_wait() == ERROR)
62 {
63 }
64
65 /* config pll clock resource */
66 crm_pll_config2(CRM_PLL_SOURCE_HEXT, 75, 1, CRM_PLL_FR_4);
67
68 /* enable pll */
69 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
70
71 /* wait till pll is ready */
72 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
73 {
74 }
75
76 /* config ahbclk */
77 crm_ahb_div_set(CRM_AHB_DIV_1);
78
79 /* config apb2clk */
80 crm_apb2_div_set(CRM_APB2_DIV_2);
81
82 /* config apb1clk */
83 crm_apb1_div_set(CRM_APB1_DIV_2);
84
85 /* enable auto step mode */
86 crm_auto_step_mode_enable(TRUE);
87
88 /* select pll as system clock source */
89 crm_sysclk_switch(CRM_SCLK_PLL);
90
91 /* wait till pll is used as system clock source */
92 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
93 {
94 }
95
96 /* disable auto step mode */
97 crm_auto_step_mode_enable(FALSE);
98
99 /* update system_core_clock global variable */
100 system_core_clock_update();
101}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_pll_config2
void crm_pll_config2(crm_pll_clock_source_type clock_source, uint16_t pll_ns, uint16_t pll_ms, crm_pll_fr_type pll_fr)
config crm pll function2, another method. pll_rcs_freq * pll_ns pll clock = -------------------------...
Definition: at32f415_crm.c:603
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT
@ CRM_PLL_SOURCE_HEXT
Definition: at32f415_crm.h:281
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_FR_4
@ CRM_PLL_FR_4
Definition: at32f415_crm.h:292
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/crm/pll_config2/src/at32f415_clock.c:50
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • crm
  • pll_config2
  • src
project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/crm/pll_config2/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • crm
  • pll_config2
  • src
project/at_start_f415/examples/crm/pll_config2/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38static void clkout_config(void);
39
45void clkout_config(void)
46{
47 gpio_init_type gpio_init_struct;
48
49 /* enable gpio port clock */
50 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
51
52 /* set default parameter */
53 gpio_default_para_init(&gpio_init_struct);
54
55 /* clkout gpio init */
56 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
57 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
58 gpio_init_struct.gpio_pins = GPIO_PINS_8;
59 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
60 gpio_init(GPIOA, &gpio_init_struct);
61
62 /* config clkout division */
63 crm_clkout_div_set(CRM_CLKOUT_DIV_1);
64
65 /* config clkout clock */
66 crm_clock_out_set(CRM_CLKOUT_PLL_DIV_4);
67}
68
74int main(void)
75{
76 system_clock_config();
77
78 at32_board_init();
79
80 clkout_config();
81
82 while(1)
83 {
84 at32_led_toggle(LED2);
85 delay_ms(100);
86 }
87}
88
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
clkout_config
static void clkout_config(void)
clkout configuration.
Definition: project/at_start_f415/examples/crm/pll_config2/src/main.c:45
main
int main(void)
main function.
Definition: project/at_start_f415/examples/crm/pll_config2/src/main.c:74
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED2
@ LED2
Definition: at32f415_board.h:63
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_clkout_div_set
void crm_clkout_div_set(crm_clkout_div_type clkout_div)
set crm clkout division
Definition: at32f415_crm.c:901
crm_clock_out_set
void crm_clock_out_set(crm_clkout_select_type clkout)
set crm clkout
Definition: at32f415_crm.c:803
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_CLKOUT_DIV_1
@ CRM_CLKOUT_DIV_1
Definition: at32f415_crm.h:429
CRM_CLKOUT_PLL_DIV_4
@ CRM_CLKOUT_PLL_DIV_4
Definition: at32f415_crm.h:419
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • crm
  • sysclk_switch
  • inc
project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • crm
  • sysclk_switch
  • inc
project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • crm
  • sysclk_switch
  • inc
project/at_start_f415/examples/crm/sysclk_switch/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • crm
  • sysclk_switch
  • src
project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • crm
  • sysclk_switch
  • src
project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • crm
  • sysclk_switch
  • src
project/at_start_f415/examples/crm/sysclk_switch/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38static void clkout_config(void);
39static void sclk_64m_hick_config(void);
40static void sclk_96m_hext_config(void);
41static void switch_system_clock(void);
42
48void clkout_config(void)
49{
50 gpio_init_type gpio_init_struct;
51
52 /* enable gpio port clock */
53 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
54
55 /* set default parameter */
56 gpio_default_para_init(&gpio_init_struct);
57
58 /* clkout gpio init */
59 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
60 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
61 gpio_init_struct.gpio_pins = GPIO_PINS_8;
62 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
63 gpio_init(GPIOA, &gpio_init_struct);
64
65 /* config clkout division */
66 crm_clkout_div_set(CRM_CLKOUT_DIV_1);
67
68 /* config clkout clock */
69 crm_clock_out_set(CRM_CLKOUT_PLL_DIV_4);
70}
71
77static void switch_system_clock(void)
78{
79 if(CRM->cfg_bit.pllrcs == RESET)
80 {
81 sclk_96m_hext_config();
82 }
83 else
84 {
85 sclk_64m_hick_config();
86 }
87}
88
107static void sclk_64m_hick_config(void)
108{
109 /* config flash psr register */
110 flash_psr_set(FLASH_WAIT_CYCLE_1);
111
112 /* reset crm */
113 crm_reset();
114
115 crm_clock_source_enable(CRM_CLOCK_SOURCE_HICK, TRUE);
116
117 /* wait till hick is ready */
118 while(crm_flag_get(CRM_HICK_STABLE_FLAG) != SET)
119 {
120 }
121
122 /* config pll clock resource */
123 crm_pll_config(CRM_PLL_SOURCE_HICK, CRM_PLL_MULT_16);
124
125 /* enable pll */
126 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
127
128 /* wait till pll is ready */
129 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
130 {
131 }
132
133 /* config ahbclk */
134 crm_ahb_div_set(CRM_AHB_DIV_1);
135
136 /* config apb2clk */
137 crm_apb2_div_set(CRM_APB2_DIV_2);
138
139 /* config apb1clk */
140 crm_apb1_div_set(CRM_APB1_DIV_2);
141
142 /* enable auto step mode */
143 crm_auto_step_mode_enable(TRUE);
144
145 /* select pll as system clock source */
146 crm_sysclk_switch(CRM_SCLK_PLL);
147
148 /* wait till pll is used as system clock source */
149 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
150 {
151 }
152
153 /* disable auto step mode */
154 crm_auto_step_mode_enable(FALSE);
155
156 /* update system_core_clock global variable */
157 system_core_clock_update();
158
159 /* config systick delay */
160 delay_init();
161
162 /* config clkout */
163 clkout_config();
164}
165
184static void sclk_96m_hext_config(void)
185{
186 /* config flash psr register */
187 flash_psr_set(FLASH_WAIT_CYCLE_2);
188
189 /* reset crm */
190 crm_reset();
191
192 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
193
194 /* wait till hext is ready */
195 while(crm_hext_stable_wait() == ERROR)
196 {
197 }
198
199 /* config pll clock resource */
200 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_24);
201
202 /* enable pll */
203 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
204
205 /* wait till pll is ready */
206 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
207 {
208 }
209
210 /* config ahbclk */
211 crm_ahb_div_set(CRM_AHB_DIV_1);
212
213 /* config apb2clk */
214 crm_apb2_div_set(CRM_APB2_DIV_2);
215
216 /* config apb1clk */
217 crm_apb1_div_set(CRM_APB1_DIV_2);
218
219 /* enable auto step mode */
220 crm_auto_step_mode_enable(TRUE);
221
222 /* select pll as system clock source */
223 crm_sysclk_switch(CRM_SCLK_PLL);
224
225 /* wait till pll is used as system clock source */
226 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
227 {
228 }
229
230 /* disable auto step mode */
231 crm_auto_step_mode_enable(FALSE);
232
233 /* update system_core_clock global variable */
234 system_core_clock_update();
235
236 /* config systick delay */
237 delay_init();
238
239 /* config clkout */
240 clkout_config();
241}
242
248int main(void)
249{
250 system_clock_config();
251
252 at32_board_init();
253
254 clkout_config();
255
256 while(1)
257 {
258 if(at32_button_press() == USER_BUTTON)
259 {
260 switch_system_clock();
261 at32_led_toggle(LED4);
262 }
263 at32_led_toggle(LED2);
264 delay_ms(100);
265 }
266}
267
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
main
int main(void)
main function.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/main.c:105
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
sclk_96m_hext_config
static void sclk_96m_hext_config(void)
config sclk 96 mhz with hext clock source.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/main.c:184
sclk_64m_hick_config
static void sclk_64m_hick_config(void)
config sclk 64 mhz with hick clock source.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/main.c:107
switch_system_clock
static void switch_system_clock(void)
sclk switch function.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/main.c:77
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
clkout_config
static void clkout_config(void)
clkout configuration.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/main.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
delay_init
void delay_init()
initialize delay function
Definition: at32f415_board.c:291
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_clkout_div_set
void crm_clkout_div_set(crm_clkout_div_type clkout_div)
set crm clkout division
Definition: at32f415_crm.c:901
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_clock_out_set
void crm_clock_out_set(crm_clkout_select_type clkout)
set crm clkout
Definition: at32f415_crm.c:803
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_HICK
@ CRM_CLOCK_SOURCE_HICK
Definition: at32f415_crm.h:303
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_CLKOUT_DIV_1
@ CRM_CLKOUT_DIV_1
Definition: at32f415_crm.h:429
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_SOURCE_HICK
@ CRM_PLL_SOURCE_HICK
Definition: at32f415_crm.h:280
CRM_PLL_MULT_24
@ CRM_PLL_MULT_24
Definition: at32f415_crm.h:219
CRM_PLL_MULT_16
@ CRM_PLL_MULT_16
Definition: at32f415_crm.h:211
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_CLKOUT_PLL_DIV_4
@ CRM_CLKOUT_PLL_DIV_4
Definition: at32f415_crm.h:419
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
CRM_HICK_STABLE_FLAG
#define CRM_HICK_STABLE_FLAG
Definition: at32f415_crm.h:55
CRM
#define CRM
Definition: at32f415_crm.h:858
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_1
@ FLASH_WAIT_CYCLE_1
Definition: at32f415_flash.h:168
FLASH_WAIT_CYCLE_2
@ FLASH_WAIT_CYCLE_2
Definition: at32f415_flash.h:169
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • debug
  • tmr1
  • inc
project/at_start_f415/examples/debug/tmr1/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • debug
  • tmr1
  • inc
project/at_start_f415/examples/debug/tmr1/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • debug
  • tmr1
  • inc
project/at_start_f415/examples/debug/tmr1/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • debug
  • tmr1
  • src
project/at_start_f415/examples/debug/tmr1/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/debug/tmr1/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • debug
  • tmr1
  • src
project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
135
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/debug/tmr1/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • debug
  • tmr1
  • src
project/at_start_f415/examples/debug/tmr1/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
30
39 crm_clocks_freq_type crm_clocks_freq_struct = {0};
40uint16_t counter = 0;
41
47void TMR1_OVF_TMR10_IRQHandler(void)
48{
49 if(tmr_flag_get(TMR1, TMR_OVF_FLAG) != RESET)
50 {
51 /* add user code... */
52 at32_led_toggle(LED3);
53 tmr_flag_clear(TMR1, TMR_OVF_FLAG);
54 }
55}
56
62int main(void)
63{
64 system_clock_config();
65
66 at32_board_init();
67
68 /* get system clock */
69 crm_clocks_freq_get(&crm_clocks_freq_struct);
70
71 /* turn led2/led3/led4 on */
72 at32_led_on(LED2);
73 at32_led_on(LED3);
74 at32_led_on(LED4);
75
76 /* enable tmr1 clock */
77 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
78
79 /* enable tmr1 debug mode */
80 debug_periph_mode_set(DEBUG_TMR1_PAUSE, TRUE);
81
82 /* tmr1 configuration */
83 tmr_base_init(TMR1, 10000, 0);
84 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
85
86 /* overflow interrupt enable */
87 tmr_interrupt_enable(TMR1, TMR_OVF_INT, TRUE);
88
89 /* tmr1 interrupt nvic init */
90 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
91 nvic_irq_enable(TMR1_OVF_TMR10_IRQn, 1, 0);
92
93 /* enable tmr1 */
94 tmr_counter_enable(TMR1, TRUE);
95
96 while(1)
97 {
98 /* in debug mode,tmr1 counter will pause */
99 counter = tmr_counter_value_get(TMR1);
100 counter = tmr_counter_value_get(TMR1);
101 counter = tmr_counter_value_get(TMR1);
102 counter = tmr_counter_value_get(TMR1);
103 counter = tmr_counter_value_get(TMR1);
104 }
105}
106
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
main
int main(void)
main function.
Definition: project/at_start_f415/examples/debug/tmr1/src/main.c:62
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/debug/tmr1/src/main.c:39
TMR1_OVF_TMR10_IRQHandler
void TMR1_OVF_TMR10_IRQHandler(void)
this function handles tmr1 overflow handler.
Definition: project/at_start_f415/examples/debug/tmr1/src/main.c:47
counter
uint16_t counter
Definition: project/at_start_f415/examples/debug/tmr1/src/main.c:40
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
TMR1_OVF_TMR10_IRQn
@ TMR1_OVF_TMR10_IRQn
Definition: at32f415.h:161
debug_periph_mode_set
void debug_periph_mode_set(uint32_t periph_debug_mode, confirm_state new_state)
set periph debug mode
Definition: at32f415_debug.c:76
DEBUG_TMR1_PAUSE
#define DEBUG_TMR1_PAUSE
Definition: at32f415_debug.h:55
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_counter_value_get
uint32_t tmr_counter_value_get(tmr_type *tmr_x)
get tmr counter value
Definition: at32f415_tmr.c:257
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_OVF_FLAG
#define TMR_OVF_FLAG
Definition: at32f415_tmr.h:52
TMR_OVF_INT
#define TMR_OVF_INT
Definition: at32f415_tmr.h:74
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • dma
  • data_to_gpio_flexible
  • inc
project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • dma
  • data_to_gpio_flexible
  • inc
project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • dma
  • data_to_gpio_flexible
  • inc
project/at_start_f415/examples/dma/data_to_gpio_flexible/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • dma
  • data_to_gpio_flexible
  • src
project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • dma
  • data_to_gpio_flexible
  • src
project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • dma
  • data_to_gpio_flexible
  • src
project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39 dma_init_type dma_init_struct = {0};
40
41#define BUFFER_SIZE 16
42uint16_t src_buffer[BUFFER_SIZE] = {0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008,
43 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010};
44
50void DMA2_Channel1_IRQHandler(void)
51{
52 if(dma_flag_get(DMA2_FDT1_FLAG) != RESET)
53 {
54 /* turn led2/led3/led4 on */
55 at32_led_on(LED2);
56 at32_led_on(LED3);
57 at32_led_on(LED4);
58 dma_flag_clear(DMA2_FDT1_FLAG);
59 }
60}
61
67int main(void)
68{
69 system_clock_config();
70
71 at32_board_init();
72
73 /* enable dma2/gpiob/tmr2 clock */
74 crm_periph_clock_enable(CRM_DMA2_PERIPH_CLOCK, TRUE);
75 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
76 crm_periph_clock_enable(CRM_TMR2_PERIPH_CLOCK, TRUE);
77 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
78 gpio_pin_remap_config(SWJTAG_MUX_010, TRUE);
79 /* config gpioc pin for output mode */
80 gpio_init_struct.gpio_pins = GPIO_PINS_ALL;
81 gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
82 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
83 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
84 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
85 gpio_init(GPIOB, &gpio_init_struct);
86
87 tmr_base_init(TMR2, 0xFF, 0);
88 tmr_cnt_dir_set(TMR2, TMR_COUNT_UP);
89
90 /* enable tmr2 overflow dma request */
91 tmr_dma_request_enable(TMR2, TMR_OVERFLOW_DMA_REQUEST, TRUE);
92
93 /* dma2 channel1 configuration */
94 dma_reset(DMA2_CHANNEL1);
95 dma_init_struct.buffer_size = BUFFER_SIZE;
96 dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
97 dma_init_struct.memory_base_addr = (uint32_t)src_buffer;
98 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
99 dma_init_struct.memory_inc_enable = TRUE;
100 dma_init_struct.peripheral_base_addr = (uint32_t)&GPIOB->odt;
101 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
102 dma_init_struct.peripheral_inc_enable = FALSE;
103 dma_init_struct.priority = DMA_PRIORITY_MEDIUM;
104 dma_init_struct.loop_mode_enable = FALSE;
105 dma_init(DMA2_CHANNEL1, &dma_init_struct);
106
107 /* enable transfer full data intterrupt */
108 dma_interrupt_enable(DMA2_CHANNEL1, DMA_FDT_INT, TRUE);
109
110 /* dma2 channel1 interrupt nvic init */
111 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
112 nvic_irq_enable(DMA2_Channel1_IRQn, 1, 0);
113
114 /* tmr2 flexible function enable */
115 dma_flexible_config(DMA2, FLEX_CHANNEL1, DMA_FLEXIBLE_TMR2_OVERFLOW);
116
117 /* enable dma channel */
118 dma_channel_enable(DMA2_CHANNEL1, TRUE);
119
120 /* enable tmr2 */
121 tmr_counter_enable(TMR2, TRUE);
122
123 while(1)
124 {
125 }
126}
127
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:38
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
DMA2_Channel1_IRQHandler
void DMA2_Channel1_IRQHandler(void)
this function handles DMA2 channel1 handler.
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:50
BUFFER_SIZE
#define BUFFER_SIZE
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:41
main
int main(void)
main function.
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:67
src_buffer
uint16_t src_buffer[16]
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:42
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_TMR2_PERIPH_CLOCK
@ CRM_TMR2_PERIPH_CLOCK
Definition: at32f415_crm.h:123
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_DMA2_PERIPH_CLOCK
@ CRM_DMA2_PERIPH_CLOCK
Definition: at32f415_crm.h:104
DMA2_Channel1_IRQn
@ DMA2_Channel1_IRQn
Definition: at32f415.h:183
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_flexible_config
void dma_flexible_config(dma_type *dma_x, uint8_t flex_channelx, dma_flexible_request_type flexible_request)
initialize the dma_x flexible function according to the specified parameters.
Definition: at32f415_dma.c:236
dma_interrupt_enable
void dma_interrupt_enable(dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt
Definition: at32f415_dma.c:165
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_FLEXIBLE_TMR2_OVERFLOW
@ DMA_FLEXIBLE_TMR2_OVERFLOW
Definition: at32f415_dma.h:180
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_MEDIUM
@ DMA_PRIORITY_MEDIUM
Definition: at32f415_dma.h:259
DMA2_FDT1_FLAG
#define DMA2_FDT1_FLAG
Definition: at32f415_dma.h:111
FLEX_CHANNEL1
#define FLEX_CHANNEL1
Definition: at32f415_dma.h:64
DMA_FDT_INT
#define DMA_FDT_INT
Definition: at32f415_dma.h:52
DMA2
#define DMA2
Definition: at32f415_dma.h:481
DMA2_CHANNEL1
#define DMA2_CHANNEL1
Definition: at32f415_dma.h:482
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_pin_remap_config
void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration.
Definition: at32f415_gpio.c:521
GPIO_MODE_OUTPUT
@ GPIO_MODE_OUTPUT
Definition: at32f415_gpio.h:229
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_ALL
#define GPIO_PINS_ALL
Definition: at32f415_gpio.h:67
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
SWJTAG_MUX_010
#define SWJTAG_MUX_010
Definition: at32f415_gpio.h:98
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_dma_request_enable
void tmr_dma_request_enable(tmr_type *tmr_x, tmr_dma_request_type dma_request, confirm_state new_state)
enable or disable tmr dma request
Definition: at32f415_tmr.c:1247
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
TMR_OVERFLOW_DMA_REQUEST
@ TMR_OVERFLOW_DMA_REQUEST
Definition: at32f415_tmr.h:269
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • dma
  • flash_to_sram
  • inc
project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • dma
  • flash_to_sram
  • inc
project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • dma
  • flash_to_sram
  • inc
project/at_start_f415/examples/dma/flash_to_sram/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • dma
  • flash_to_sram
  • src
project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • dma
  • flash_to_sram
  • src
project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
30
45void NMI_Handler(void)
46{
47}
48
54void HardFault_Handler(void)
55{
56 /* go to infinite loop when hard fault exception occurs */
57 while(1)
58 {
59 }
60}
61
67void MemManage_Handler(void)
68{
69 /* go to infinite loop when memory manage exception occurs */
70 while(1)
71 {
72 }
73}
74
80void BusFault_Handler(void)
81{
82 /* go to infinite loop when bus fault exception occurs */
83 while(1)
84 {
85 }
86}
87
93void UsageFault_Handler(void)
94{
95 /* go to infinite loop when usage fault exception occurs */
96 while(1)
97 {
98 }
99}
100
106void SVC_Handler(void)
107{
108}
109
115void DebugMon_Handler(void)
116{
117}
118
124void PendSV_Handler(void)
125{
126}
127
133void SysTick_Handler(void)
134{
135}
136
137
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/at32f415_int.c:115
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • dma
  • flash_to_sram
  • src
project/at_start_f415/examples/dma/flash_to_sram/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
39#define BUFFER_SIZE 32
40
41const uint32_t src_const_buffer[BUFFER_SIZE]= {0x01020304, 0x05060708, 0x090A0B0C, 0x0D0E0F10,
42 0x11121314, 0x15161718, 0x191A1B1C, 0x1D1E1F20,
43 0x21222324, 0x25262728, 0x292A2B2C, 0x2D2E2F30,
44 0x31323334, 0x35363738, 0x393A3B3C, 0x3D3E3F40,
45 0x41424344, 0x45464748, 0x494A4B4C, 0x4D4E4F50,
46 0x51525354, 0x55565758, 0x595A5B5C, 0x5D5E5F60,
47 0x61626364, 0x65666768, 0x696A6B6C, 0x6D6E6F70,
48 0x71727374, 0x75767778, 0x797A7B7C, 0x7D7E7F80};
49uint32_t dst_buffer[BUFFER_SIZE];
50 gpio_init_type gpio_init_struct = {0};
51 dma_init_type dma_init_struct = {0};
52__IO uint32_t data_counter_end = 0x01; /* this variable should not be initialized to 0 */
53 error_status transfer_status = ERROR;
54
55 error_status buffer_compare(const uint32_t* pbuffer, uint32_t* pbuffer1, uint16_t buffer_length);
56
62void DMA1_Channel1_IRQHandler(void)
63{
64 if(dma_flag_get(DMA1_FDT1_FLAG) != RESET)
65 {
66 data_counter_end = 0;
67 dma_flag_clear(DMA1_FDT1_FLAG);
68 }
69}
70
78 error_status buffer_compare(const uint32_t* pbuffer, uint32_t* pbuffer1, uint16_t buffer_length)
79{
80 while(buffer_length--)
81 {
82 if(*pbuffer != *pbuffer1)
83 {
84 return ERROR;
85 }
86
87 pbuffer++;
88 pbuffer1++;
89 }
90
91 return SUCCESS;
92}
93
99int main(void)
100{
101 system_clock_config();
102
103 at32_board_init();
104
105 /* enable dma1 clock */
106 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
107
108 /* dma1 channel1 configuration */
109 dma_reset(DMA1_CHANNEL1);
110 dma_init_struct.buffer_size = BUFFER_SIZE;
111 dma_init_struct.direction = DMA_DIR_MEMORY_TO_MEMORY;
112 dma_init_struct.memory_base_addr = (uint32_t)dst_buffer;
113 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_WORD;
114 dma_init_struct.memory_inc_enable = TRUE;
115 dma_init_struct.peripheral_base_addr = (uint32_t)src_const_buffer;
116 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_WORD;
117 dma_init_struct.peripheral_inc_enable = TRUE;
118 dma_init_struct.priority = DMA_PRIORITY_MEDIUM;
119 dma_init_struct.loop_mode_enable = FALSE;
120 dma_init(DMA1_CHANNEL1, &dma_init_struct);
121
122 /* enable transfer full data intterrupt */
123 dma_interrupt_enable(DMA1_CHANNEL1, DMA_FDT_INT, TRUE);
124
125 /* dma1 channel1 interrupt nvic init */
126 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
127 nvic_irq_enable(DMA1_Channel1_IRQn, 1, 0);
128
129 dma_channel_enable(DMA1_CHANNEL1, TRUE);
130
131 /* wait the end of transmission */
132 while(data_counter_end != 0)
133 {
134 }
135
136 /* check if the transmitted and received data are equal */
137 transfer_status = buffer_compare(src_const_buffer, dst_buffer, BUFFER_SIZE);
138
139 /* transfer_status = passed, if the transmitted and received data are the same
140 transfer_status = failed, if the transmitted and received data are different */
141 if(transfer_status == SUCCESS)
142 {
143 /* turn led2/led3/led4 on */
144 at32_led_on(LED2);
145 at32_led_on(LED3);
146 at32_led_on(LED4);
147 }
148
149 while(1)
150 {
151 }
152}
153
154
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/main.c:50
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/main.c:51
src_const_buffer
const uint32_t src_const_buffer[32]
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/main.c:41
data_counter_end
__IO uint32_t data_counter_end
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/main.c:52
BUFFER_SIZE
#define BUFFER_SIZE
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/main.c:39
DMA1_Channel1_IRQHandler
void DMA1_Channel1_IRQHandler(void)
this function handles dma1 channel1 handler.
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/main.c:62
main
int main(void)
main function.
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/main.c:99
dst_buffer
uint32_t dst_buffer[32]
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/main.c:49
buffer_compare
error_status buffer_compare(const uint32_t *pbuffer, uint32_t *pbuffer1, uint16_t buffer_length)
compares two buffers.
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/main.c:78
transfer_status
error_status transfer_status
Definition: project/at_start_f415/examples/dma/flash_to_sram/src/main.c:53
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
DMA1_Channel1_IRQn
@ DMA1_Channel1_IRQn
Definition: at32f415.h:146
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_interrupt_enable
void dma_interrupt_enable(dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt
Definition: at32f415_dma.c:165
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_WORD
@ DMA_PERIPHERAL_DATA_WIDTH_WORD
Definition: at32f415_dma.h:240
DMA_DIR_MEMORY_TO_MEMORY
@ DMA_DIR_MEMORY_TO_MEMORY
Definition: at32f415_dma.h:212
DMA_MEMORY_DATA_WIDTH_WORD
@ DMA_MEMORY_DATA_WIDTH_WORD
Definition: at32f415_dma.h:250
DMA_PRIORITY_MEDIUM
@ DMA_PRIORITY_MEDIUM
Definition: at32f415_dma.h:259
DMA1_FDT1_FLAG
#define DMA1_FDT1_FLAG
Definition: at32f415_dma.h:82
DMA_FDT_INT
#define DMA_FDT_INT
Definition: at32f415_dma.h:52
DMA1_CHANNEL1
#define DMA1_CHANNEL1
Definition: at32f415_dma.h:473
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • ertc
  • bpr_domain
  • inc
project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • ertc
  • bpr_domain
  • inc
project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • ertc
  • bpr_domain
  • inc
project/at_start_f415/examples/ertc/bpr_domain/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • ertc
  • bpr_domain
  • src
project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • ertc
  • bpr_domain
  • src
project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • ertc
  • bpr_domain
  • src
project/at_start_f415/examples/ertc/bpr_domain/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define ERTC_BPR_DT_NUMBER 20
39
40 ertc_dt_type bpr_addr_tab[ERTC_BPR_DT_NUMBER] =
41{
42 ERTC_DT1, ERTC_DT2, ERTC_DT3, ERTC_DT4, ERTC_DT5,
43 ERTC_DT6, ERTC_DT7, ERTC_DT8, ERTC_DT9, ERTC_DT10,
44 ERTC_DT11, ERTC_DT12, ERTC_DT13, ERTC_DT14, ERTC_DT15,
45 ERTC_DT16, ERTC_DT17, ERTC_DT18, ERTC_DT19, ERTC_DT20
46};
47
48void ertc_config(void);
49void bpr_reg_write(void);
50uint32_t bpr_reg_check(void);
51
57int main(void)
58{
59 uint32_t temp = 0;
60 ertc_time_type time;
61
62 /* initial system clock */
63 system_clock_config();
64
65 /* initial the nvic priority group */
66 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
67
68 /* initialize uart */
69 uart_print_init(115200);
70
71 printf("\r\nertc bpr domain example\r\n\r\n");
72
73 /* enable the pwc clock interface */
74 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
75
76 /* allow access to bpr domain */
77 pwc_battery_powered_domain_access(TRUE);
78
79 /* check data from bpr dt register */
80 if(bpr_reg_check() == FALSE)
81 {
82 printf("bpr reg => reset\r\n\r\n");
83
84 /* ertc configuration */
85 ertc_config();
86
87 /* write to ertc bpr data registers */
88 bpr_reg_write();
89 }
90 else
91 {
92 printf("bpr reg => none reset\r\n\r\n");
93
94 /* wait for ertc registers update */
95 ertc_wait_update();
96 }
97
98 while(1)
99 {
100 /* get the current time */
101 ertc_calendar_get(&time);
102
103 if(temp != time.sec)
104 {
105 temp = time.sec;
106
107 /* display date format : year-month-day */
108 printf("%02d-%02d-%02d ",time.year, time.month, time.day);
109
110 /* display time format : hour:min:sec */
111 printf("%02d:%02d:%02d\r\n",time.hour, time.min, time.sec);
112 }
113 }
114}
115
121void ertc_config(void)
122{
123 /* allow access to ertc */
124 pwc_battery_powered_domain_access(TRUE);
125
126 /* reset ertc domain */
127 crm_battery_powered_domain_reset(TRUE);
128 crm_battery_powered_domain_reset(FALSE);
129
130 /* enable the lext osc */
131 crm_clock_source_enable(CRM_CLOCK_SOURCE_LEXT, TRUE);
132
133 /* wait till lext is ready */
134 while(crm_flag_get(CRM_LEXT_STABLE_FLAG) == RESET)
135 {
136 }
137
138 /* select the ertc clock source */
139 crm_ertc_clock_select(CRM_ERTC_CLOCK_LEXT);
140
141 /* enable the ertc clock */
142 crm_ertc_clock_enable(TRUE);
143
144 /* deinitializes the ertc registers */
145 ertc_reset();
146
147 /* wait for ertc apb registers update */
148 ertc_wait_update();
149
150 /* configure the ertc divider */
151 /* ertc second(1hz) = ertc_clk / (div_a + 1) * (div_b + 1) */
152 ertc_divider_set(127, 255);
153
154 /* configure the ertc hour mode */
155 ertc_hour_mode_set(ERTC_HOUR_MODE_24);
156
157 /* set date: 2021-05-01 */
158 ertc_date_set(21, 5, 1, 5);
159
160 /* set time: 12:00:00 */
161 ertc_time_set(12, 0, 0, ERTC_AM);
162}
163
169void bpr_reg_write(void)
170{
171 uint32_t index = 0;
172
173 for (index = 0; index < ERTC_BPR_DT_NUMBER; index++)
174 {
175 ertc_bpr_data_write(bpr_addr_tab[index], 0x5A00 + (index * 0x5A));
176 }
177}
178
187uint32_t bpr_reg_check(void)
188{
189 uint32_t index = 0;
190
191 for (index = 0; index < ERTC_BPR_DT_NUMBER; index++)
192 {
193 if (ertc_bpr_data_read(bpr_addr_tab[index]) != (0x5A00 + (index * 0x5A)))
194 {
195 return FALSE;
196 }
197 }
198
199 return TRUE;
200}
201
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
ERTC_BPR_DT_NUMBER
#define ERTC_BPR_DT_NUMBER
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/main.c:38
bpr_addr_tab
ertc_dt_type bpr_addr_tab[20]
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/main.c:40
bpr_reg_write
void bpr_reg_write(void)
write data to bpr dt register.
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/main.c:169
main
int main(void)
main function.
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/main.c:57
bpr_reg_check
uint32_t bpr_reg_check(void)
checks if the bpr dt register values are correct or not.
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/main.c:187
ertc_config
void ertc_config(void)
configure the ertc peripheral.
Definition: project/at_start_f415/examples/ertc/bpr_domain/src/main.c:121
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_ertc_clock_select
void crm_ertc_clock_select(crm_ertc_clock_type value)
select ertc clock
Definition: at32f415_crm.c:377
crm_ertc_clock_enable
void crm_ertc_clock_enable(confirm_state new_state)
enable or disable ertc
Definition: at32f415_crm.c:387
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_battery_powered_domain_reset
void crm_battery_powered_domain_reset(confirm_state new_state)
battery powered domain software reset
Definition: at32f415_crm.c:496
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_CLOCK_SOURCE_LEXT
@ CRM_CLOCK_SOURCE_LEXT
Definition: at32f415_crm.h:306
CRM_ERTC_CLOCK_LEXT
@ CRM_ERTC_CLOCK_LEXT
Definition: at32f415_crm.h:383
CRM_LEXT_STABLE_FLAG
#define CRM_LEXT_STABLE_FLAG
Definition: at32f415_crm.h:58
ertc_hour_mode_set
error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode)
ertc hour mode set.
Definition: at32f415_ertc.c:283
ertc_wait_update
error_status ertc_wait_update(void)
ertc wait register update finish.
Definition: at32f415_ertc.c:97
ertc_time_set
error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time.
Definition: at32f415_ertc.c:363
ertc_reset
error_status ertc_reset(void)
ertc reset all register.
Definition: at32f415_ertc.c:207
ertc_date_set
error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date.
Definition: at32f415_ertc.c:314
ertc_bpr_data_read
uint32_t ertc_bpr_data_read(ertc_dt_type dt)
read data from bpr register.
Definition: at32f415_ertc.c:1510
ertc_calendar_get
void ertc_calendar_get(ertc_time_type *time)
get calendar
Definition: at32f415_ertc.c:404
ertc_divider_set
error_status ertc_divider_set(uint16_t div_a, uint16_t div_b)
ertc division set.
Definition: at32f415_ertc.c:251
ertc_bpr_data_write
void ertc_bpr_data_write(ertc_dt_type dt, uint32_t data)
write data to the bpr register.
Definition: at32f415_ertc.c:1484
ertc_dt_type
ertc_dt_type
ertc bpr register
Definition: at32f415_ertc.h:344
ERTC_HOUR_MODE_24
@ ERTC_HOUR_MODE_24
Definition: at32f415_ertc.h:105
ERTC_DT11
@ ERTC_DT11
Definition: at32f415_ertc.h:355
ERTC_DT13
@ ERTC_DT13
Definition: at32f415_ertc.h:357
ERTC_DT2
@ ERTC_DT2
Definition: at32f415_ertc.h:346
ERTC_DT1
@ ERTC_DT1
Definition: at32f415_ertc.h:345
ERTC_DT15
@ ERTC_DT15
Definition: at32f415_ertc.h:359
ERTC_DT18
@ ERTC_DT18
Definition: at32f415_ertc.h:362
ERTC_DT19
@ ERTC_DT19
Definition: at32f415_ertc.h:363
ERTC_DT6
@ ERTC_DT6
Definition: at32f415_ertc.h:350
ERTC_DT7
@ ERTC_DT7
Definition: at32f415_ertc.h:351
ERTC_DT20
@ ERTC_DT20
Definition: at32f415_ertc.h:364
ERTC_DT17
@ ERTC_DT17
Definition: at32f415_ertc.h:361
ERTC_DT3
@ ERTC_DT3
Definition: at32f415_ertc.h:347
ERTC_DT4
@ ERTC_DT4
Definition: at32f415_ertc.h:348
ERTC_DT8
@ ERTC_DT8
Definition: at32f415_ertc.h:352
ERTC_DT5
@ ERTC_DT5
Definition: at32f415_ertc.h:349
ERTC_DT10
@ ERTC_DT10
Definition: at32f415_ertc.h:354
ERTC_DT9
@ ERTC_DT9
Definition: at32f415_ertc.h:353
ERTC_DT16
@ ERTC_DT16
Definition: at32f415_ertc.h:360
ERTC_DT12
@ ERTC_DT12
Definition: at32f415_ertc.h:356
ERTC_DT14
@ ERTC_DT14
Definition: at32f415_ertc.h:358
ERTC_AM
@ ERTC_AM
Definition: at32f415_ertc.h:115
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
time
ertc_time_type * time
Definition: random.c:42
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_battery_powered_domain_access
void pwc_battery_powered_domain_access(confirm_state new_state)
enable or disable access to the battery powered domain.
Definition: at32f415_pwc.c:61
ertc_time_type
ertc time
Definition: at32f415_ertc.h:371
ertc_time_type::year
uint8_t year
Definition: at32f415_ertc.h:372
ertc_time_type::day
uint8_t day
Definition: at32f415_ertc.h:374
ertc_time_type::hour
uint8_t hour
Definition: at32f415_ertc.h:375
ertc_time_type::min
uint8_t min
Definition: at32f415_ertc.h:376
ertc_time_type::month
uint8_t month
Definition: at32f415_ertc.h:373
ertc_time_type::sec
uint8_t sec
Definition: at32f415_ertc.h:377
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • ertc
  • calendar
  • inc
project/at_start_f415/examples/ertc/calendar/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • ertc
  • calendar
  • inc
project/at_start_f415/examples/ertc/calendar/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • ertc
  • calendar
  • inc
project/at_start_f415/examples/ertc/calendar/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • ertc
  • calendar
  • src
project/at_start_f415/examples/ertc/calendar/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/ertc/calendar/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • ertc
  • calendar
  • src
project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
39extern void ertc_alarm_show(void);
40
46void NMI_Handler(void)
47{
48}
49
55void HardFault_Handler(void)
56{
57 /* go to infinite loop when hard fault exception occurs */
58 while(1)
59 {
60 }
61}
62
68void MemManage_Handler(void)
69{
70 /* go to infinite loop when memory manage exception occurs */
71 while(1)
72 {
73 }
74}
75
81void BusFault_Handler(void)
82{
83 /* go to infinite loop when bus fault exception occurs */
84 while(1)
85 {
86 }
87}
88
94void UsageFault_Handler(void)
95{
96 /* go to infinite loop when usage fault exception occurs */
97 while(1)
98 {
99 }
100}
101
107void SVC_Handler(void)
108{
109}
110
116void DebugMon_Handler(void)
117{
118}
119
125void PendSV_Handler(void)
126{
127}
128
134void SysTick_Handler(void)
135{
136}
137
143void ERTCAlarm_IRQHandler(void)
144{
145 if(ertc_flag_get(ERTC_ALAF_FLAG) != RESET)
146 {
147 /* display the alarm */
148 ertc_alarm_show();
149
150 at32_led_on(LED2);
151
152 /* clear alarm flag */
153 ertc_flag_clear(ERTC_ALAF_FLAG);
154
155 /* clear exint flag */
156 exint_flag_clear(EXINT_LINE_17);
157 }
158}
159
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c:94
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c:55
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c:68
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c:107
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c:125
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c:46
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c:81
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c:134
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c:116
ERTCAlarm_IRQHandler
void ERTCAlarm_IRQHandler(void)
this function handles ertc alarms interrupt request.
Definition: project/at_start_f415/examples/ertc/calendar/src/at32f415_int.c:143
ertc_alarm_show
void ertc_alarm_show(void)
display the current alarm.
Definition: project/at_start_f415/examples/ertc/calendar/src/main.c:250
LED2
@ LED2
Definition: at32f415_board.h:63
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
ertc_flag_get
flag_status ertc_flag_get(uint32_t flag)
get flag status.
Definition: at32f415_ertc.c:1428
ertc_flag_clear
void ertc_flag_clear(uint32_t flag)
clear flag status
Definition: at32f415_ertc.c:1461
ERTC_ALAF_FLAG
#define ERTC_ALAF_FLAG
Definition: at32f415_ertc.h:74
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
EXINT_LINE_17
#define EXINT_LINE_17
Definition: at32f415_exint.h:69
RESET
@ RESET
Definition: at32f415.h:248
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • ertc
  • calendar
  • src
project/at_start_f415/examples/ertc/calendar/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38/* select the ertc clock source */
39#define ERTC_CLOCK_SOURCE_LEXT /* select lext as the ertc clock */
40//#define ERTC_CLOCK_SOURCE_LICK /* select lick as the ertc clock */
41
42__IO uint16_t ertc_clk_div_a = 0;
43__IO uint16_t ertc_clk_div_b = 0;
44
45void ertc_config(void);
46void ertc_alarm_show(void);
47void ertc_time_show(void);
48
54int main(void)
55{
56 exint_init_type exint_init_struct;
57 ertc_time_type time;
58 uint32_t temp = 0;
59
60 /* initial system clock */
61 system_clock_config();
62
63 /* initial the nvic priority group */
64 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
65
66 /* at board initial */
67 at32_board_init();
68
69 /* initialize uart */
70 uart_print_init(115200);
71
72 /* enable the pwc clock interface */
73 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
74
75 /* allow access to ertc */
76 pwc_battery_powered_domain_access(TRUE);
77
78 if (ertc_bpr_data_read(ERTC_DT1) != 0x1234)
79 {
80 /* printf ertc status */
81 printf("ertc has not been initialized\r\n\r\n");
82
83 /* ertc configuration */
84 ertc_config();
85 }
86 else
87 {
88 /* printf ertc status */
89 printf("ertc has been initialized\r\n\r\n");
90
91 /* wait for ertc registers update */
92 ertc_wait_update();
93
94 /* clear the ertc alarm flag */
95 ertc_flag_clear(ERTC_ALAF_FLAG);
96
97 /* clear the exint line 17 pending bit */
98 exint_flag_clear(EXINT_LINE_17);
99 }
100
101 /* display the ertc alarm and time */
102 ertc_time_show();
103 ertc_alarm_show();
104
105 printf("\r\n");
106
107 /* ertc alarm interrupt configuration */
108 exint_default_para_init(&exint_init_struct);
109 exint_init_struct.line_enable = TRUE;
110 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
111 exint_init_struct.line_select = EXINT_LINE_17;
112 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
113 exint_init(&exint_init_struct);
114
115 /* enable the ertc interrupt */
116 nvic_irq_enable(ERTCAlarm_IRQn, 0, 1);
117
118 while(1)
119 {
120 /* get the current time */
121 ertc_calendar_get(&time);
122
123 if(temp != time.sec)
124 {
125 temp = time.sec;
126
127 /* wait for the alarm interrupt print the information */
128 delay_us(40);
129
130 /* display date format : year-month-day */
131 printf("%02d-%02d-%02d ",time.year, time.month, time.day);
132
133 /* display time format : hour:min:sec */
134 printf("%02d:%02d:%02d\r\n",time.hour, time.min, time.sec);
135 }
136 }
137}
138
144void ertc_config(void)
145{
146 /* enable the pwc clock interface */
147 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
148
149 /* allow access to ertc */
150 pwc_battery_powered_domain_access(TRUE);
151
152 /* reset ertc domain */
153 crm_battery_powered_domain_reset(TRUE);
154 crm_battery_powered_domain_reset(FALSE);
155
156#if defined (ERTC_CLOCK_SOURCE_LICK)
157 /* enable the lick osc */
158 crm_clock_source_enable(CRM_CLOCK_SOURCE_LICK, TRUE);
159
160 /* wait till lick is ready */
161 while(crm_flag_get(CRM_LICK_STABLE_FLAG) == RESET)
162 {
163 }
164
165 /* select the ertc clock source */
166 crm_ertc_clock_select(CRM_ERTC_CLOCK_LICK);
167
168 /* ertc second(1hz) = ertc_clk(lick) / (ertc_clk_div_a + 1) * (ertc_clk_div_b + 1) */
169 ertc_clk_div_b = 255;
170 ertc_clk_div_a = 127;
171#elif defined (ERTC_CLOCK_SOURCE_LEXT)
172 /* enable the lext osc */
173 crm_clock_source_enable(CRM_CLOCK_SOURCE_LEXT, TRUE);
174
175 /* wait till lext is ready */
176 while(crm_flag_get(CRM_LEXT_STABLE_FLAG) == RESET)
177 {
178 }
179
180 /* select the ertc clock source */
181 crm_ertc_clock_select(CRM_ERTC_CLOCK_LEXT);
182
183 /* ertc second(1hz) = ertc_clk / (ertc_clk_div_a + 1) * (ertc_clk_div_b + 1) */
184 ertc_clk_div_b = 255;
185 ertc_clk_div_a = 127;
186#endif
187
188 /* enable the ertc clock */
189 crm_ertc_clock_enable(TRUE);
190
191 /* deinitializes the ertc registers */
192 ertc_reset();
193
194 /* wait for ertc registers update */
195 ertc_wait_update();
196
197 /* configure the ertc divider */
198 ertc_divider_set(ertc_clk_div_a, ertc_clk_div_b);
199
200 /* configure the ertc hour mode */
201 ertc_hour_mode_set(ERTC_HOUR_MODE_24);
202
203 /* set date: 2021-05-01 */
204 ertc_date_set(21, 5, 1, 5);
205
206 /* set time: 12:00:00 */
207 ertc_time_set(12, 0, 0, ERTC_AM);
208
209 /* set the alarm 12:00:10 */
210 ertc_alarm_mask_set(ERTC_ALA, ERTC_ALARM_MASK_DATE_WEEK);
211 ertc_alarm_week_date_select(ERTC_ALA, ERTC_SLECT_DATE);
212 ertc_alarm_set(ERTC_ALA, 1, 12, 0, 10, ERTC_AM);
213
214 /* enable ertc alarm a interrupt */
215 ertc_interrupt_enable(ERTC_ALA_INT, TRUE);
216
217 /* enable the alarm */
218 ertc_alarm_enable(ERTC_ALA, TRUE);
219
220 ertc_flag_clear(ERTC_ALAF_FLAG);
221
222 /* indicator for the ertc configuration */
223 ertc_bpr_data_write(ERTC_DT1, 0x1234);
224}
225
231void ertc_time_show(void)
232{
233 ertc_time_type time;
234
235 /* get the current time */
236 ertc_calendar_get(&time);
237
238 /* display date format : year-month-day */
239 printf("Time: %02d-%02d-%02d ",time.year, time.month, time.day);
240
241 /* display time format : hour:min:sec */
242 printf("%02d:%02d:%02d\r\n",time.hour, time.min, time.sec);
243}
244
250void ertc_alarm_show(void)
251{
252 ertc_alarm_value_type alarm;
253
254 /* get the current alarm */
255 ertc_alarm_get(ERTC_ALA, &alarm);
256
257 /* display alarm format : hour:min:sec */
258 printf("Alarm: %02d:%02d:%02d\r\n",alarm.hour, alarm.min, alarm.sec);
259}
260
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
ertc_time_show
void ertc_time_show(void)
display the current time.
Definition: project/at_start_f415/examples/ertc/calendar/src/main.c:231
ertc_clk_div_a
__IO uint16_t ertc_clk_div_a
Definition: project/at_start_f415/examples/ertc/calendar/src/main.c:42
main
int main(void)
main program
Definition: project/at_start_f415/examples/ertc/calendar/src/main.c:54
ertc_config
void ertc_config(void)
configure the ertc peripheral by selecting the clock source.
Definition: project/at_start_f415/examples/ertc/calendar/src/main.c:144
ertc_clk_div_b
__IO uint16_t ertc_clk_div_b
Definition: project/at_start_f415/examples/ertc/calendar/src/main.c:43
ertc_alarm_show
void ertc_alarm_show(void)
display the current alarm.
Definition: project/at_start_f415/examples/ertc/calendar/src/main.c:250
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_ertc_clock_select
void crm_ertc_clock_select(crm_ertc_clock_type value)
select ertc clock
Definition: at32f415_crm.c:377
crm_ertc_clock_enable
void crm_ertc_clock_enable(confirm_state new_state)
enable or disable ertc
Definition: at32f415_crm.c:387
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_battery_powered_domain_reset
void crm_battery_powered_domain_reset(confirm_state new_state)
battery powered domain software reset
Definition: at32f415_crm.c:496
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_CLOCK_SOURCE_LEXT
@ CRM_CLOCK_SOURCE_LEXT
Definition: at32f415_crm.h:306
CRM_CLOCK_SOURCE_LICK
@ CRM_CLOCK_SOURCE_LICK
Definition: at32f415_crm.h:307
CRM_ERTC_CLOCK_LICK
@ CRM_ERTC_CLOCK_LICK
Definition: at32f415_crm.h:384
CRM_ERTC_CLOCK_LEXT
@ CRM_ERTC_CLOCK_LEXT
Definition: at32f415_crm.h:383
CRM_LICK_STABLE_FLAG
#define CRM_LICK_STABLE_FLAG
Definition: at32f415_crm.h:59
CRM_LEXT_STABLE_FLAG
#define CRM_LEXT_STABLE_FLAG
Definition: at32f415_crm.h:58
ERTCAlarm_IRQn
@ ERTCAlarm_IRQn
Definition: at32f415.h:177
ertc_alarm_get
void ertc_alarm_get(ertc_alarm_type alarm_x, ertc_alarm_value_type *alarm)
get alarm value.
Definition: at32f415_ertc.c:674
ertc_hour_mode_set
error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode)
ertc hour mode set.
Definition: at32f415_ertc.c:283
ertc_wait_update
error_status ertc_wait_update(void)
ertc wait register update finish.
Definition: at32f415_ertc.c:97
ertc_time_set
error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time.
Definition: at32f415_ertc.c:363
ertc_reset
error_status ertc_reset(void)
ertc reset all register.
Definition: at32f415_ertc.c:207
ertc_alarm_mask_set
void ertc_alarm_mask_set(ertc_alarm_type alarm_x, uint32_t mask)
set which bits are irrelevant to the alarm match.
Definition: at32f415_ertc.c:458
ertc_interrupt_enable
void ertc_interrupt_enable(uint32_t source, confirm_state new_state)
enable or disable interrupt.
Definition: at32f415_ertc.c:1340
ertc_alarm_week_date_select
void ertc_alarm_week_date_select(ertc_alarm_type alarm_x, ertc_week_date_select_type wk)
alarm week or date mode select.
Definition: at32f415_ertc.c:500
ertc_date_set
error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date.
Definition: at32f415_ertc.c:314
ertc_flag_clear
void ertc_flag_clear(uint32_t flag)
clear flag status
Definition: at32f415_ertc.c:1461
ertc_bpr_data_read
uint32_t ertc_bpr_data_read(ertc_dt_type dt)
read data from bpr register.
Definition: at32f415_ertc.c:1510
ertc_alarm_set
void ertc_alarm_set(ertc_alarm_type alarm_x, uint8_t week_date, uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set alarm.
Definition: at32f415_ertc.c:538
ertc_calendar_get
void ertc_calendar_get(ertc_time_type *time)
get calendar
Definition: at32f415_ertc.c:404
ertc_divider_set
error_status ertc_divider_set(uint16_t div_a, uint16_t div_b)
ertc division set.
Definition: at32f415_ertc.c:251
ertc_bpr_data_write
void ertc_bpr_data_write(ertc_dt_type dt, uint32_t data)
write data to the bpr register.
Definition: at32f415_ertc.c:1484
ertc_alarm_enable
error_status ertc_alarm_enable(ertc_alarm_type alarm_x, confirm_state new_state)
enable or disable alarm clock.
Definition: at32f415_ertc.c:629
ERTC_SLECT_DATE
@ ERTC_SLECT_DATE
Definition: at32f415_ertc.h:124
ERTC_HOUR_MODE_24
@ ERTC_HOUR_MODE_24
Definition: at32f415_ertc.h:105
ERTC_DT1
@ ERTC_DT1
Definition: at32f415_ertc.h:345
ERTC_ALA
@ ERTC_ALA
Definition: at32f415_ertc.h:133
ERTC_AM
@ ERTC_AM
Definition: at32f415_ertc.h:115
ERTC_ALARM_MASK_DATE_WEEK
#define ERTC_ALARM_MASK_DATE_WEEK
Definition: at32f415_ertc.h:89
ERTC_ALAF_FLAG
#define ERTC_ALAF_FLAG
Definition: at32f415_ertc.h:74
ERTC_ALA_INT
#define ERTC_ALA_INT
Definition: at32f415_ertc.h:53
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_17
#define EXINT_LINE_17
Definition: at32f415_exint.h:69
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
time
ertc_time_type * time
Definition: random.c:42
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_battery_powered_domain_access
void pwc_battery_powered_domain_access(confirm_state new_state)
enable or disable access to the battery powered domain.
Definition: at32f415_pwc.c:61
ertc_alarm_value_type
ertc alarm
Definition: at32f415_ertc.h:386
ertc_alarm_value_type::min
uint8_t min
Definition: at32f415_ertc.h:389
ertc_alarm_value_type::sec
uint8_t sec
Definition: at32f415_ertc.h:390
ertc_alarm_value_type::hour
uint8_t hour
Definition: at32f415_ertc.h:388
ertc_time_type
ertc time
Definition: at32f415_ertc.h:371
ertc_time_type::year
uint8_t year
Definition: at32f415_ertc.h:372
ertc_time_type::day
uint8_t day
Definition: at32f415_ertc.h:374
ertc_time_type::hour
uint8_t hour
Definition: at32f415_ertc.h:375
ertc_time_type::min
uint8_t min
Definition: at32f415_ertc.h:376
ertc_time_type::month
uint8_t month
Definition: at32f415_ertc.h:373
ertc_time_type::sec
uint8_t sec
Definition: at32f415_ertc.h:377
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • ertc
  • lick_calibration
  • inc
project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • ertc
  • lick_calibration
  • inc
project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • ertc
  • lick_calibration
  • inc
project/at_start_f415/examples/ertc/lick_calibration/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • ertc
  • lick_calibration
  • src
project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • ertc
  • lick_calibration
  • src
project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30#include "stdio.h"
31
40extern __IO uint32_t period_value;
41extern __IO uint32_t capture_number;
42uint16_t tmp_c4[2] = {0, 0};
43
49void NMI_Handler(void)
50{
51}
52
58void HardFault_Handler(void)
59{
60 /* go to infinite loop when hard fault exception occurs */
61 while(1)
62 {
63 }
64}
65
71void MemManage_Handler(void)
72{
73 /* go to infinite loop when memory manage exception occurs */
74 while(1)
75 {
76 }
77}
78
84void BusFault_Handler(void)
85{
86 /* go to infinite loop when bus fault exception occurs */
87 while(1)
88 {
89 }
90}
91
97void UsageFault_Handler(void)
98{
99 /* go to infinite loop when usage fault exception occurs */
100 while(1)
101 {
102 }
103}
104
110void SVC_Handler(void)
111{
112}
113
119void DebugMon_Handler(void)
120{
121}
122
128void PendSV_Handler(void)
129{
130}
131
137void SysTick_Handler(void)
138{
139}
140
146void TMR5_GLOBAL_IRQHandler(void)
147{
148 if (tmr_flag_get(TMR5, TMR_C4_FLAG) != RESET)
149 {
150 /* get the input capture value */
151 tmp_c4[capture_number++] = tmr_channel_value_get(TMR5, TMR_SELECT_CHANNEL_4);
152
153 /* clear c4 interrupt pending bit */
154 tmr_flag_clear(TMR5, TMR_C4_FLAG);
155
156 if (capture_number >= 2)
157 {
158 /* compute the period length */
159 period_value = (uint16_t)(0xFFFF - tmp_c4[0] + tmp_c4[1] + 1);
160 }
161 }
162}
163
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c:97
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c:58
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c:71
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c:110
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c:128
capture_number
__IO uint32_t capture_number
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/main.c:39
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c:49
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c:84
TMR5_GLOBAL_IRQHandler
void TMR5_GLOBAL_IRQHandler(void)
this function handles tmr5 global interrupt request.
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c:146
period_value
__IO uint32_t period_value
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/main.c:40
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c:137
tmp_c4
uint16_t tmp_c4[2]
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c:42
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/at32f415_int.c:119
RESET
@ RESET
Definition: at32f415.h:248
tmr_channel_value_get
uint32_t tmr_channel_value_get(tmr_type *tmr_x, tmr_channel_select_type tmr_channel)
get tmr channel value
Definition: at32f415_tmr.c:527
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
TMR_SELECT_CHANNEL_4
@ TMR_SELECT_CHANNEL_4
Definition: at32f415_tmr.h:222
TMR_C4_FLAG
#define TMR_C4_FLAG
Definition: at32f415_tmr.h:56
TMR5
#define TMR5
Definition: at32f415_tmr.h:836
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • ertc
  • lick_calibration
  • src
project/at_start_f415/examples/ertc/lick_calibration/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38__IO uint32_t lick_freq = 0;
39__IO uint32_t capture_number = 0;
40__IO uint32_t period_value = 0;
41
42void ertc_config(void);
43uint32_t lick_frequency_get(void);
44
50int main(void)
51{
52 ertc_time_type time;
53 uint32_t temp = 0;
54
55 /* initial system clock */
56 system_clock_config();
57
58 /* initial the nvic priority group */
59 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
60
61 /* at board initial */
62 at32_board_init();
63
64 /* initialize uart */
65 uart_print_init(115200);
66
67 /* ertc configuration */
68 ertc_config();
69
70 /* get the lick frequency: tmr5 is used to measure the lick frequency */
71 lick_freq = lick_frequency_get();
72
73 /* configure the ertc divider */
74 /* ertc second(1hz) = ertc_clk(lick) / (div_a + 1) * (div_b + 1) */
75 ertc_divider_set(127, (lick_freq / 128) - 1);
76
77 printf("lick_freq = %d\r\n", lick_freq);
78 printf("div_a = %d\r\n", 127);
79 printf("div_b = %d\r\n", (lick_freq / 128) - 1);
80 printf("\r\n");
81
82 while(1)
83 {
84 /* get the current time */
85 ertc_calendar_get(&time);
86
87 if(temp != time.sec)
88 {
89 temp = time.sec;
90
91 /* display date format : year-month-day */
92 printf("%02d-%02d-%02d ",time.year, time.month, time.day);
93
94 /* display time format : hour:min:sec */
95 printf("%02d:%02d:%02d\r\n",time.hour, time.min, time.sec);
96 }
97 }
98}
99
105void ertc_config(void)
106{
107 /* enable the pwc clock */
108 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
109
110 /* allow access to ertc */
111 pwc_battery_powered_domain_access(TRUE);
112
113 /* reset ertc domain */
114 crm_battery_powered_domain_reset(TRUE);
115 crm_battery_powered_domain_reset(FALSE);
116
117 /* enable the lick osc */
118 crm_clock_source_enable(CRM_CLOCK_SOURCE_LICK, TRUE);
119
120 /* wait till lick is ready */
121 while(crm_flag_get(CRM_LICK_STABLE_FLAG) == RESET)
122 {
123 }
124
125 /* select the ertc clock source */
126 crm_ertc_clock_select(CRM_ERTC_CLOCK_LICK);
127
128 /* enable the ertc clock */
129 crm_ertc_clock_enable(TRUE);
130
131 /* deinitializes the ertc registers */
132 ertc_reset();
133
134 /* wait for ertc apb registers update */
135 ertc_wait_update();
136
137 /* configure the ertc divider */
138 ertc_divider_set(0x7F, 0xFF);
139
140 /* configure the ertc hour mode */
141 ertc_hour_mode_set(ERTC_HOUR_MODE_24);
142
143 /* set date: 2021-05-01 */
144 ertc_date_set(21, 5, 1, 5);
145
146 /* set time: 12:00:00 */
147 ertc_time_set(12, 0, 0, ERTC_AM);
148}
149
155uint32_t lick_frequency_get(void)
156{
157 tmr_input_config_type tmr_input_config_struct;
158 crm_clocks_freq_type crm_clock_freq;
159
160 /* enable tmr5 apb1 clocks */
161 crm_periph_clock_enable(CRM_TMR5_PERIPH_CLOCK, TRUE);
162 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
163
164 /* connect internally the tmr5_ch4 to the lick clock output */
165 gpio_pin_remap_config(TMR5CH4_MUX, TRUE);
166
167 /* configure tmr5 divider */
168 tmr_div_value_set(TMR5, 0);
169 tmr_event_sw_trigger(TMR5, TMR_OVERFLOW_SWTRIG);
170
171 /* tmr5 channel4 input capture mode configuration */
172 tmr_input_config_struct.input_channel_select = TMR_SELECT_CHANNEL_4;
173 tmr_input_config_struct.input_mapped_select = TMR_CC_CHANNEL_MAPPED_DIRECT;
174 tmr_input_config_struct.input_polarity_select = TMR_INPUT_RISING_EDGE;
175 tmr_input_config_struct.input_filter_value = 0;
176 tmr_input_channel_init(TMR5, &tmr_input_config_struct, TMR_CHANNEL_INPUT_DIV_1);
177 tmr_input_channel_divider_set(TMR5, TMR_SELECT_CHANNEL_4, TMR_CHANNEL_INPUT_DIV_8);
178
179 /* enable tmr5 interrupt channel */
180 nvic_irq_enable(TMR5_GLOBAL_IRQn, 0, 0);
181
182 /* enable tmr5 counter */
183 tmr_counter_enable(TMR5, TRUE);
184
185 /* reset the flags */
186 TMR5->swevt = 0;
187
188 /* enable the cc4 interrupt request */
189 tmr_interrupt_enable(TMR5, TMR_C4_INT, TRUE);
190
191 /* wait the tmr5 measuring operation to be completed */
192 while(capture_number != 2);
193
194 /* deinitialize the tmr5 peripheral */
195 tmr_reset(TMR5);
196
197 /* get the frequency value */
198 crm_clocks_freq_get(&crm_clock_freq);
199
200 /* get pclk1 divider */
201 if ((CRM->cfg_bit.apb1div) > 0)
202 {
203 /* pclk1 divider different from 1 => timclk = 2 * pclk1 */
204 return (((2 * crm_clock_freq.apb1_freq) / period_value) * 8) ;
205 }
206 else
207 {
208 /* pclk1 divider equal to 1 => timclk = pclk1 */
209 return ((crm_clock_freq.apb1_freq / period_value) * 8);
210 }
211}
212
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
capture_number
__IO uint32_t capture_number
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/main.c:39
main
int main(void)
main program
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/main.c:50
lick_freq
__IO uint32_t lick_freq
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/main.c:38
ertc_config
void ertc_config(void)
configures the ertc peripheral by selecting the clock source.
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/main.c:105
period_value
__IO uint32_t period_value
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/main.c:40
lick_frequency_get
uint32_t lick_frequency_get(void)
configures tmr5 to measure the lick oscillator frequency.
Definition: project/at_start_f415/examples/ertc/lick_calibration/src/main.c:155
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
tmr_input_config_struct
tmr_input_config_type tmr_input_config_struct
Definition: project/at_start_f415/examples/tmr/external_clock/src/main.c:41
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_ertc_clock_select
void crm_ertc_clock_select(crm_ertc_clock_type value)
select ertc clock
Definition: at32f415_crm.c:377
crm_ertc_clock_enable
void crm_ertc_clock_enable(confirm_state new_state)
enable or disable ertc
Definition: at32f415_crm.c:387
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_battery_powered_domain_reset
void crm_battery_powered_domain_reset(confirm_state new_state)
battery powered domain software reset
Definition: at32f415_crm.c:496
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_TMR5_PERIPH_CLOCK
@ CRM_TMR5_PERIPH_CLOCK
Definition: at32f415_crm.h:126
CRM_CLOCK_SOURCE_LICK
@ CRM_CLOCK_SOURCE_LICK
Definition: at32f415_crm.h:307
CRM_ERTC_CLOCK_LICK
@ CRM_ERTC_CLOCK_LICK
Definition: at32f415_crm.h:384
CRM_LICK_STABLE_FLAG
#define CRM_LICK_STABLE_FLAG
Definition: at32f415_crm.h:59
CRM
#define CRM
Definition: at32f415_crm.h:858
TMR5_GLOBAL_IRQn
@ TMR5_GLOBAL_IRQn
Definition: at32f415.h:180
ertc_hour_mode_set
error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode)
ertc hour mode set.
Definition: at32f415_ertc.c:283
ertc_wait_update
error_status ertc_wait_update(void)
ertc wait register update finish.
Definition: at32f415_ertc.c:97
ertc_time_set
error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time.
Definition: at32f415_ertc.c:363
ertc_reset
error_status ertc_reset(void)
ertc reset all register.
Definition: at32f415_ertc.c:207
ertc_date_set
error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date.
Definition: at32f415_ertc.c:314
ertc_calendar_get
void ertc_calendar_get(ertc_time_type *time)
get calendar
Definition: at32f415_ertc.c:404
ertc_divider_set
error_status ertc_divider_set(uint16_t div_a, uint16_t div_b)
ertc division set.
Definition: at32f415_ertc.c:251
ERTC_HOUR_MODE_24
@ ERTC_HOUR_MODE_24
Definition: at32f415_ertc.h:105
ERTC_AM
@ ERTC_AM
Definition: at32f415_ertc.h:115
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
time
ertc_time_type * time
Definition: random.c:42
gpio_pin_remap_config
void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration.
Definition: at32f415_gpio.c:521
TMR5CH4_MUX
#define TMR5CH4_MUX
Definition: at32f415_gpio.h:94
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_battery_powered_domain_access
void pwc_battery_powered_domain_access(confirm_state new_state)
enable or disable access to the battery powered domain.
Definition: at32f415_pwc.c:61
tmr_input_channel_divider_set
void tmr_input_channel_divider_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_channel_input_divider_type divider_factor)
set tmr input channel divider
Definition: at32f415_tmr.c:1079
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_input_channel_init
void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
init tmr input channel
Definition: at32f415_tmr.c:780
tmr_div_value_set
void tmr_div_value_set(tmr_type *tmr_x, uint32_t tmr_div_value)
set tmr div value
Definition: at32f415_tmr.c:271
tmr_event_sw_trigger
void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event
Definition: at32f415_tmr.c:1369
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_reset
void tmr_reset(tmr_type *tmr_x)
tmr reset by crm reset register
Definition: at32f415_tmr.c:51
TMR_INPUT_RISING_EDGE
@ TMR_INPUT_RISING_EDGE
Definition: at32f415_tmr.h:206
TMR_SELECT_CHANNEL_4
@ TMR_SELECT_CHANNEL_4
Definition: at32f415_tmr.h:222
TMR_CC_CHANNEL_MAPPED_DIRECT
@ TMR_CC_CHANNEL_MAPPED_DIRECT
Definition: at32f415_tmr.h:239
TMR_OVERFLOW_SWTRIG
@ TMR_OVERFLOW_SWTRIG
Definition: at32f415_tmr.h:283
TMR_CHANNEL_INPUT_DIV_8
@ TMR_CHANNEL_INPUT_DIV_8
Definition: at32f415_tmr.h:252
TMR_CHANNEL_INPUT_DIV_1
@ TMR_CHANNEL_INPUT_DIV_1
Definition: at32f415_tmr.h:249
TMR_C4_INT
#define TMR_C4_INT
Definition: at32f415_tmr.h:78
TMR5
#define TMR5
Definition: at32f415_tmr.h:836
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::apb1_freq
uint32_t apb1_freq
Definition: at32f415_crm.h:475
ertc_time_type
ertc time
Definition: at32f415_ertc.h:371
ertc_time_type::year
uint8_t year
Definition: at32f415_ertc.h:372
ertc_time_type::day
uint8_t day
Definition: at32f415_ertc.h:374
ertc_time_type::hour
uint8_t hour
Definition: at32f415_ertc.h:375
ertc_time_type::min
uint8_t min
Definition: at32f415_ertc.h:376
ertc_time_type::month
uint8_t month
Definition: at32f415_ertc.h:373
ertc_time_type::sec
uint8_t sec
Definition: at32f415_ertc.h:377
tmr_input_config_type
tmr input capture config type
Definition: at32f415_tmr.h:412
tmr_input_config_type::input_mapped_select
tmr_input_direction_mapped_type input_mapped_select
Definition: at32f415_tmr.h:415
tmr_input_config_type::input_filter_value
uint8_t input_filter_value
Definition: at32f415_tmr.h:416
tmr_input_config_type::input_polarity_select
tmr_input_polarity_type input_polarity_select
Definition: at32f415_tmr.h:414
tmr_input_config_type::input_channel_select
tmr_channel_select_type input_channel_select
Definition: at32f415_tmr.h:413
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • ertc
  • tamper
  • inc
project/at_start_f415/examples/ertc/tamper/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • ertc
  • tamper
  • inc
project/at_start_f415/examples/ertc/tamper/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • ertc
  • tamper
  • inc
project/at_start_f415/examples/ertc/tamper/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • ertc
  • tamper
  • src
project/at_start_f415/examples/ertc/tamper/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/ertc/tamper/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • ertc
  • tamper
  • src
project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30#include "stdio.h"
31
40extern uint32_t is_bpr_reg_reset(void);
41
47void NMI_Handler(void)
48{
49}
50
56void HardFault_Handler(void)
57{
58 /* go to infinite loop when hard fault exception occurs */
59 while(1)
60 {
61 }
62}
63
69void MemManage_Handler(void)
70{
71 /* go to infinite loop when memory manage exception occurs */
72 while(1)
73 {
74 }
75}
76
82void BusFault_Handler(void)
83{
84 /* go to infinite loop when bus fault exception occurs */
85 while(1)
86 {
87 }
88}
89
95void UsageFault_Handler(void)
96{
97 /* go to infinite loop when usage fault exception occurs */
98 while(1)
99 {
100 }
101}
102
108void SVC_Handler(void)
109{
110}
111
117void DebugMon_Handler(void)
118{
119}
120
126void PendSV_Handler(void)
127{
128}
129
135void SysTick_Handler(void)
136{
137}
138
144void TAMP_STAMP_IRQHandler(void)
145{
146 if(ertc_flag_get(ERTC_TP1F_FLAG) != RESET)
147 {
148 /* check if ertc backup data registers are cleared */
149 if(is_bpr_reg_reset() == 0)
150 {
151 printf("tamper: bpr data registers are cleared\r\n");
152 }
153 else
154 {
155 printf("tamper: bpr data registers are not reset\r\n");
156 }
157
158 /* clear tamper 1 pin event pending flag */
159 ertc_flag_clear(ERTC_TP1F_FLAG);
160
161 /* clear exint flag */
162 exint_flag_clear(EXINT_LINE_21);
163 }
164}
165
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c:95
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c:56
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c:69
is_bpr_reg_reset
uint32_t is_bpr_reg_reset(void)
checks if the ertc bpr dtx registers are reset or not.
Definition: project/at_start_f415/examples/ertc/tamper/src/main.c:232
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c:108
TAMP_STAMP_IRQHandler
void TAMP_STAMP_IRQHandler(void)
this function handles ertc tamper and time stamp interrupts requests.
Definition: project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c:144
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c:126
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c:47
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c:82
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c:135
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/ertc/tamper/src/at32f415_int.c:117
ertc_flag_get
flag_status ertc_flag_get(uint32_t flag)
get flag status.
Definition: at32f415_ertc.c:1428
ertc_flag_clear
void ertc_flag_clear(uint32_t flag)
clear flag status
Definition: at32f415_ertc.c:1461
ERTC_TP1F_FLAG
#define ERTC_TP1F_FLAG
Definition: at32f415_ertc.h:79
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
EXINT_LINE_21
#define EXINT_LINE_21
Definition: at32f415_exint.h:73
RESET
@ RESET
Definition: at32f415.h:248
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • ertc
  • tamper
  • src
project/at_start_f415/examples/ertc/tamper/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define ERTC_BPR_DT_NUMBER 20
39
40 ertc_dt_type bpr_addr_tab[ERTC_BPR_DT_NUMBER] =
41{
42 ERTC_DT1, ERTC_DT2, ERTC_DT3, ERTC_DT4, ERTC_DT5,
43 ERTC_DT6, ERTC_DT7, ERTC_DT8, ERTC_DT9, ERTC_DT10,
44 ERTC_DT11, ERTC_DT12, ERTC_DT13, ERTC_DT14, ERTC_DT15,
45 ERTC_DT16, ERTC_DT17, ERTC_DT18, ERTC_DT19, ERTC_DT20,
46};
47
48void ertc_config(void);
49void bpr_reg_write(void);
50uint32_t bpr_reg_check(void);
51uint32_t is_bpr_reg_reset(void);
52void ertc_tamper_config(void);
53
59int main(void)
60{
61 /* initial system clock */
62 system_clock_config();
63
64 /* initial the nvic priority group */
65 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
66
67 /* at board initial */
68 at32_board_init();
69
70 /* initialize uart */
71 uart_print_init(115200);
72
73 /* ertc configuration */
74 ertc_config();
75
76 /* ertc tamper configuration */
77 ertc_tamper_config();
78
79 /* write to ertc bpr data registers */
80 bpr_reg_write();
81
82 /* check if the written data are correct */
83 if(bpr_reg_check() == TRUE)
84 {
85 printf("init: bpr data registers are not reset\r\n");
86 }
87 else
88 {
89 printf("init: bpr data registers are cleared\r\n");
90 }
91
92 while(1)
93 {
94 }
95}
96
102void ertc_config(void)
103{
104 /* enable the pwc clock */
105 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
106
107 /* allow access to ertc */
108 pwc_battery_powered_domain_access(TRUE);
109
110 /* reset bpr domain */
111 crm_battery_powered_domain_reset(TRUE);
112 crm_battery_powered_domain_reset(FALSE);
113
114 /* enable the lext osc */
115 crm_clock_source_enable(CRM_CLOCK_SOURCE_LEXT, TRUE);
116
117 /* wait till lext is ready */
118 while(crm_flag_get(CRM_LEXT_STABLE_FLAG) == RESET)
119 {
120 }
121
122 /* select the ertc clock source */
123 crm_ertc_clock_select(CRM_ERTC_CLOCK_LEXT);
124
125 /* enable the ertc clock */
126 crm_ertc_clock_enable(TRUE);
127
128 /* deinitializes the ertc registers */
129 ertc_reset();
130
131 /* wait for ertc apb registers update */
132 ertc_wait_update();
133
134 /* configure the ertc divider */
135 /* ertc second(1hz) = ertc_clk / (div_a + 1) * (div_b + 1) */
136 ertc_divider_set(127, 255);
137
138 /* configure the ertc hour mode */
139 ertc_hour_mode_set(ERTC_HOUR_MODE_24);
140
141 /* set date: 2021-05-01 */
142 ertc_date_set(21, 5, 1, 5);
143
144 /* set time: 12:00:00 */
145 ertc_time_set(12, 0, 0, ERTC_AM);
146}
147
153void ertc_tamper_config(void)
154{
155 exint_init_type exint_init_struct;
156
157 /* enable the external line 21 interrupt */
158 exint_default_para_init(&exint_init_struct);
159 exint_init_struct.line_enable = TRUE;
160 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
161 exint_init_struct.line_select = EXINT_LINE_21;
162 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
163 exint_init(&exint_init_struct);
164
165 /* enable tamper interrupt */
166 nvic_irq_enable(TAMP_STAMP_IRQn, 0, 0);
167
168 /* disable the tamper 1 detection */
169 ertc_tamper_enable(ERTC_TAMPER_1, FALSE);
170
171 /* clear tamper 1 pin event(tamp1f) pending flag */
172 ertc_flag_clear(ERTC_TP1F_FLAG);
173
174 /* configure the tamper 1 trigger */
175 ertc_tamper_valid_edge_set(ERTC_TAMPER_1, ERTC_TAMPER_EDGE_RISING);
176
177 /* enable the tamper interrupt */
178 ertc_interrupt_enable(ERTC_TP_INT, TRUE);
179
180 /* clear tamper 1 pin interrupt pending bit */
181 ertc_flag_clear(ERTC_TP1F_FLAG);
182
183 /* enable the tamper 1 detection */
184 ertc_tamper_enable(ERTC_TAMPER_1, TRUE);
185}
186
192void bpr_reg_write(void)
193{
194 uint32_t index = 0;
195
196 for (index = 0; index < ERTC_BPR_DT_NUMBER; index++)
197 {
198 ertc_bpr_data_write(bpr_addr_tab[index], 0x5A00 + (index * 0x5A));
199 }
200}
201
210uint32_t bpr_reg_check(void)
211{
212 uint32_t index = 0;
213
214 for (index = 0; index < ERTC_BPR_DT_NUMBER; index++)
215 {
216 if (ertc_bpr_data_read(bpr_addr_tab[index]) != (0x5A00 + (index * 0x5A)))
217 {
218 return FALSE;
219 }
220 }
221
222 return TRUE;
223}
224
232uint32_t is_bpr_reg_reset(void)
233{
234 uint32_t index = 0;
235
236 for (index = 0; index < ERTC_BPR_DT_NUMBER; index++)
237 {
238 /* read from bpr data register */
239 if (ertc_bpr_data_read(bpr_addr_tab[index]) != 0)
240 {
241 return (index + 1);
242 }
243 }
244 return 0;
245}
246
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
ERTC_BPR_DT_NUMBER
#define ERTC_BPR_DT_NUMBER
Definition: project/at_start_f415/examples/ertc/tamper/src/main.c:38
is_bpr_reg_reset
uint32_t is_bpr_reg_reset(void)
checks if the ertc bpr dtx registers are reset or not.
Definition: project/at_start_f415/examples/ertc/tamper/src/main.c:232
bpr_addr_tab
ertc_dt_type bpr_addr_tab[20]
Definition: project/at_start_f415/examples/ertc/tamper/src/main.c:40
ertc_tamper_config
void ertc_tamper_config(void)
configure the ertc tamper.
Definition: project/at_start_f415/examples/ertc/tamper/src/main.c:153
bpr_reg_write
void bpr_reg_write(void)
write data to bpr dt register.
Definition: project/at_start_f415/examples/ertc/tamper/src/main.c:192
main
int main(void)
main program
Definition: project/at_start_f415/examples/ertc/tamper/src/main.c:59
bpr_reg_check
uint32_t bpr_reg_check(void)
checks if the bpr dt register values are correct or not.
Definition: project/at_start_f415/examples/ertc/tamper/src/main.c:210
ertc_config
void ertc_config(void)
configure the ertc peripheral by selecting the clock source.
Definition: project/at_start_f415/examples/ertc/tamper/src/main.c:102
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_ertc_clock_select
void crm_ertc_clock_select(crm_ertc_clock_type value)
select ertc clock
Definition: at32f415_crm.c:377
crm_ertc_clock_enable
void crm_ertc_clock_enable(confirm_state new_state)
enable or disable ertc
Definition: at32f415_crm.c:387
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_battery_powered_domain_reset
void crm_battery_powered_domain_reset(confirm_state new_state)
battery powered domain software reset
Definition: at32f415_crm.c:496
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_CLOCK_SOURCE_LEXT
@ CRM_CLOCK_SOURCE_LEXT
Definition: at32f415_crm.h:306
CRM_ERTC_CLOCK_LEXT
@ CRM_ERTC_CLOCK_LEXT
Definition: at32f415_crm.h:383
CRM_LEXT_STABLE_FLAG
#define CRM_LEXT_STABLE_FLAG
Definition: at32f415_crm.h:58
TAMP_STAMP_IRQn
@ TAMP_STAMP_IRQn
Definition: at32f415.h:137
ertc_hour_mode_set
error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode)
ertc hour mode set.
Definition: at32f415_ertc.c:283
ertc_wait_update
error_status ertc_wait_update(void)
ertc wait register update finish.
Definition: at32f415_ertc.c:97
ertc_time_set
error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time.
Definition: at32f415_ertc.c:363
ertc_reset
error_status ertc_reset(void)
ertc reset all register.
Definition: at32f415_ertc.c:207
ertc_interrupt_enable
void ertc_interrupt_enable(uint32_t source, confirm_state new_state)
enable or disable interrupt.
Definition: at32f415_ertc.c:1340
ertc_date_set
error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date.
Definition: at32f415_ertc.c:314
ertc_tamper_enable
void ertc_tamper_enable(ertc_tamper_select_type tamper_x, confirm_state new_state)
enable or disable tamper.
Definition: at32f415_ertc.c:1314
ertc_flag_clear
void ertc_flag_clear(uint32_t flag)
clear flag status
Definition: at32f415_ertc.c:1461
ertc_bpr_data_read
uint32_t ertc_bpr_data_read(ertc_dt_type dt)
read data from bpr register.
Definition: at32f415_ertc.c:1510
ertc_tamper_valid_edge_set
void ertc_tamper_valid_edge_set(ertc_tamper_select_type tamper_x, ertc_tamper_valid_edge_type trigger)
set the tamper trigger.
Definition: at32f415_ertc.c:1275
ertc_divider_set
error_status ertc_divider_set(uint16_t div_a, uint16_t div_b)
ertc division set.
Definition: at32f415_ertc.c:251
ertc_bpr_data_write
void ertc_bpr_data_write(ertc_dt_type dt, uint32_t data)
write data to the bpr register.
Definition: at32f415_ertc.c:1484
ertc_dt_type
ertc_dt_type
ertc bpr register
Definition: at32f415_ertc.h:344
ERTC_TAMPER_EDGE_RISING
@ ERTC_TAMPER_EDGE_RISING
Definition: at32f415_ertc.h:334
ERTC_HOUR_MODE_24
@ ERTC_HOUR_MODE_24
Definition: at32f415_ertc.h:105
ERTC_TAMPER_1
@ ERTC_TAMPER_1
Definition: at32f415_ertc.h:289
ERTC_DT11
@ ERTC_DT11
Definition: at32f415_ertc.h:355
ERTC_DT13
@ ERTC_DT13
Definition: at32f415_ertc.h:357
ERTC_DT2
@ ERTC_DT2
Definition: at32f415_ertc.h:346
ERTC_DT1
@ ERTC_DT1
Definition: at32f415_ertc.h:345
ERTC_DT15
@ ERTC_DT15
Definition: at32f415_ertc.h:359
ERTC_DT18
@ ERTC_DT18
Definition: at32f415_ertc.h:362
ERTC_DT19
@ ERTC_DT19
Definition: at32f415_ertc.h:363
ERTC_DT6
@ ERTC_DT6
Definition: at32f415_ertc.h:350
ERTC_DT7
@ ERTC_DT7
Definition: at32f415_ertc.h:351
ERTC_DT20
@ ERTC_DT20
Definition: at32f415_ertc.h:364
ERTC_DT17
@ ERTC_DT17
Definition: at32f415_ertc.h:361
ERTC_DT3
@ ERTC_DT3
Definition: at32f415_ertc.h:347
ERTC_DT4
@ ERTC_DT4
Definition: at32f415_ertc.h:348
ERTC_DT8
@ ERTC_DT8
Definition: at32f415_ertc.h:352
ERTC_DT5
@ ERTC_DT5
Definition: at32f415_ertc.h:349
ERTC_DT10
@ ERTC_DT10
Definition: at32f415_ertc.h:354
ERTC_DT9
@ ERTC_DT9
Definition: at32f415_ertc.h:353
ERTC_DT16
@ ERTC_DT16
Definition: at32f415_ertc.h:360
ERTC_DT12
@ ERTC_DT12
Definition: at32f415_ertc.h:356
ERTC_DT14
@ ERTC_DT14
Definition: at32f415_ertc.h:358
ERTC_AM
@ ERTC_AM
Definition: at32f415_ertc.h:115
ERTC_TP1F_FLAG
#define ERTC_TP1F_FLAG
Definition: at32f415_ertc.h:79
ERTC_TP_INT
#define ERTC_TP_INT
Definition: at32f415_ertc.h:52
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_21
#define EXINT_LINE_21
Definition: at32f415_exint.h:73
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_battery_powered_domain_access
void pwc_battery_powered_domain_access(confirm_state new_state)
enable or disable access to the battery powered domain.
Definition: at32f415_pwc.c:61
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • ertc
  • time_stamp
  • inc
project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • ertc
  • time_stamp
  • inc
project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • ertc
  • time_stamp
  • inc
project/at_start_f415/examples/ertc/time_stamp/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • ertc
  • time_stamp
  • src
project/at_start_f415/examples/ertc/time_stamp/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/ertc/time_stamp/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • ertc
  • time_stamp
  • src
project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30#include "stdio.h"
31
40extern void ertc_time_show(void);
41extern void ertc_timestamp_show(void);
42
48void NMI_Handler(void)
49{
50}
51
57void HardFault_Handler(void)
58{
59 /* go to infinite loop when hard fault exception occurs */
60 while(1)
61 {
62 }
63}
64
70void MemManage_Handler(void)
71{
72 /* go to infinite loop when memory manage exception occurs */
73 while(1)
74 {
75 }
76}
77
83void BusFault_Handler(void)
84{
85 /* go to infinite loop when bus fault exception occurs */
86 while(1)
87 {
88 }
89}
90
96void UsageFault_Handler(void)
97{
98 /* go to infinite loop when usage fault exception occurs */
99 while(1)
100 {
101 }
102}
103
109void SVC_Handler(void)
110{
111}
112
118void DebugMon_Handler(void)
119{
120}
121
127void PendSV_Handler(void)
128{
129}
130
136void SysTick_Handler(void)
137{
138}
139
145void TAMP_STAMP_IRQHandler(void)
146{
147 if(ertc_flag_get(ERTC_TSF_FLAG))
148 {
149 /* display the timestamp */
150 ertc_timestamp_show();
151
152 /* display the date / time */
153 ertc_time_show();
154
155 /* clear exint flag */
156 exint_flag_clear(EXINT_LINE_21);
157
158 /* clear timestamp flag */
159 ertc_flag_clear(ERTC_TSF_FLAG);
160 }
161}
162
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c:96
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c:57
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c:70
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c:109
TAMP_STAMP_IRQHandler
void TAMP_STAMP_IRQHandler(void)
this function handles external lines 15 to 10 interrupt request.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c:145
ertc_time_show
void ertc_time_show(void)
display the current date.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/main.c:161
ertc_timestamp_show
void ertc_timestamp_show(void)
display the current timestamp.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/main.c:183
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c:127
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c:48
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c:83
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c:136
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/at32f415_int.c:118
ertc_flag_get
flag_status ertc_flag_get(uint32_t flag)
get flag status.
Definition: at32f415_ertc.c:1428
ertc_flag_clear
void ertc_flag_clear(uint32_t flag)
clear flag status
Definition: at32f415_ertc.c:1461
ERTC_TSF_FLAG
#define ERTC_TSF_FLAG
Definition: at32f415_ertc.h:77
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
EXINT_LINE_21
#define EXINT_LINE_21
Definition: at32f415_exint.h:73
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • ertc
  • time_stamp
  • src
project/at_start_f415/examples/ertc/time_stamp/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38void ertc_time_show(void);
39void ertc_timestamp_show(void);
40void ertc_config(void);
41void ertc_timestamp_config(void);
42
48int main(void)
49{
50 /* initial system clock */
51 system_clock_config();
52
53 /* initial the nvic priority group */
54 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
55
56 /* at board initial */
57 at32_board_init();
58
59 /* initialize uart */
60 uart_print_init(115200);
61
62 /* ertc configuration */
63 ertc_config();
64
65 /* configure the timestamp register */
66 ertc_timestamp_config();
67
68 /* display the date and time */
69 ertc_time_show();
70
71 while(1)
72 {
73
74 }
75}
76
82void ertc_config(void)
83{
84 /* enable the pwc clock */
85 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
86
87 /* allow access to ertc */
88 pwc_battery_powered_domain_access(TRUE);
89
90 /* reset ertc bpr domain */
91 crm_battery_powered_domain_reset(TRUE);
92 crm_battery_powered_domain_reset(FALSE);
93
94 /* enable the lext osc */
95 crm_clock_source_enable(CRM_CLOCK_SOURCE_LEXT, TRUE);
96
97 /* wait till lext is ready */
98 while(crm_flag_get(CRM_LEXT_STABLE_FLAG) == RESET)
99 {
100 }
101
102 /* select the ertc clock source */
103 crm_ertc_clock_select(CRM_ERTC_CLOCK_LEXT);
104
105 /* enable the ertc clock */
106 crm_ertc_clock_enable(TRUE);
107
108 /* deinitializes the ertc registers */
109 ertc_reset();
110
111 /* wait for ertc apb registers update */
112 ertc_wait_update();
113
114 /* configure the ertc divider */
115 /* ertc second(1hz) = ertc_clk / (div_a + 1) * (div_b + 1) */
116 ertc_divider_set(127, 255);
117
118 /* configure the ertc hour mode */
119 ertc_hour_mode_set(ERTC_HOUR_MODE_24);
120
121 /* set date: 2021-05-01 */
122 ertc_date_set(21, 5, 1, 5);
123
124 /* set time: 12:00:00 */
125 ertc_time_set(12, 0, 0, ERTC_AM);
126}
127
133void ertc_timestamp_config(void)
134{
135 exint_init_type exint_init_struct;
136
137 /* configure nvic */
138 nvic_irq_enable(TAMP_STAMP_IRQn, 0, 0);
139
140 /* configure exint */
141 exint_default_para_init(&exint_init_struct);
142 exint_init_struct.line_enable = TRUE;
143 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
144 exint_init_struct.line_select = EXINT_LINE_21;
145 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
146 exint_init(&exint_init_struct);
147
148 /* enable the timestamp */
149 ertc_timestamp_valid_edge_set(ERTC_TIMESTAMP_EDGE_FALLING);
150 ertc_timestamp_enable(TRUE);
151
152 /* enable the timestamp int */
153 ertc_interrupt_enable(ERTC_TS_INT, TRUE);
154}
155
161void ertc_time_show(void)
162{
163 ertc_time_type time;
164
165 /* get the current time */
166 ertc_calendar_get(&time);
167
168 /* display the curent time */
169 printf("current time: ");
170
171 /* display date format : year-month-day */
172 printf("%02d-%02d-%02d ",time.year, time.month, time.day);
173
174 /* display time format : hour:min:sec */
175 printf("%02d:%02d:%02d\r\n\r\n",time.hour, time.min, time.sec);
176}
177
183void ertc_timestamp_show(void)
184{
185 ertc_time_type time;
186
187 /* get the current timestamp */
188 ertc_timestamp_get(&time);
189
190 /* display the current timestamp */
191 printf("timestamp: ");
192
193 /* display date format : month-day */
194 printf(" %02d-%02d ", time.month, time.day);
195
196 /* display time format : hour:min:sec */
197 printf("%02d:%02d:%02d\r\n", time.hour, time.min, time.sec);
198}
199
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
ertc_time_show
void ertc_time_show(void)
display the current time.
Definition: project/at_start_f415/examples/ertc/calendar/src/main.c:231
ertc_timestamp_show
void ertc_timestamp_show(void)
display the current timestamp.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/main.c:183
ertc_timestamp_config
void ertc_timestamp_config(void)
configure the ertc timestamp.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/main.c:133
main
int main(void)
main program
Definition: project/at_start_f415/examples/ertc/time_stamp/src/main.c:48
ertc_config
void ertc_config(void)
configure the ertc peripheral by selecting the clock source.
Definition: project/at_start_f415/examples/ertc/time_stamp/src/main.c:82
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_ertc_clock_select
void crm_ertc_clock_select(crm_ertc_clock_type value)
select ertc clock
Definition: at32f415_crm.c:377
crm_ertc_clock_enable
void crm_ertc_clock_enable(confirm_state new_state)
enable or disable ertc
Definition: at32f415_crm.c:387
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_battery_powered_domain_reset
void crm_battery_powered_domain_reset(confirm_state new_state)
battery powered domain software reset
Definition: at32f415_crm.c:496
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_CLOCK_SOURCE_LEXT
@ CRM_CLOCK_SOURCE_LEXT
Definition: at32f415_crm.h:306
CRM_ERTC_CLOCK_LEXT
@ CRM_ERTC_CLOCK_LEXT
Definition: at32f415_crm.h:383
CRM_LEXT_STABLE_FLAG
#define CRM_LEXT_STABLE_FLAG
Definition: at32f415_crm.h:58
TAMP_STAMP_IRQn
@ TAMP_STAMP_IRQn
Definition: at32f415.h:137
ertc_hour_mode_set
error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode)
ertc hour mode set.
Definition: at32f415_ertc.c:283
ertc_wait_update
error_status ertc_wait_update(void)
ertc wait register update finish.
Definition: at32f415_ertc.c:97
ertc_timestamp_valid_edge_set
void ertc_timestamp_valid_edge_set(ertc_timestamp_valid_edge_type edge)
set the timestamp valid edge.
Definition: at32f415_ertc.c:1116
ertc_time_set
error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time.
Definition: at32f415_ertc.c:363
ertc_reset
error_status ertc_reset(void)
ertc reset all register.
Definition: at32f415_ertc.c:207
ertc_interrupt_enable
void ertc_interrupt_enable(uint32_t source, confirm_state new_state)
enable or disable interrupt.
Definition: at32f415_ertc.c:1340
ertc_date_set
error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date.
Definition: at32f415_ertc.c:314
ertc_timestamp_get
void ertc_timestamp_get(ertc_time_type *time)
get the timestamp.
Definition: at32f415_ertc.c:1149
ertc_timestamp_enable
void ertc_timestamp_enable(confirm_state new_state)
enable or disable timestamp.
Definition: at32f415_ertc.c:1132
ertc_calendar_get
void ertc_calendar_get(ertc_time_type *time)
get calendar
Definition: at32f415_ertc.c:404
ertc_divider_set
error_status ertc_divider_set(uint16_t div_a, uint16_t div_b)
ertc division set.
Definition: at32f415_ertc.c:251
ERTC_HOUR_MODE_24
@ ERTC_HOUR_MODE_24
Definition: at32f415_ertc.h:105
ERTC_TIMESTAMP_EDGE_FALLING
@ ERTC_TIMESTAMP_EDGE_FALLING
Definition: at32f415_ertc.h:281
ERTC_AM
@ ERTC_AM
Definition: at32f415_ertc.h:115
ERTC_TS_INT
#define ERTC_TS_INT
Definition: at32f415_ertc.h:56
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_21
#define EXINT_LINE_21
Definition: at32f415_exint.h:73
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
time
ertc_time_type * time
Definition: random.c:42
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_battery_powered_domain_access
void pwc_battery_powered_domain_access(confirm_state new_state)
enable or disable access to the battery powered domain.
Definition: at32f415_pwc.c:61
ertc_time_type
ertc time
Definition: at32f415_ertc.h:371
ertc_time_type::year
uint8_t year
Definition: at32f415_ertc.h:372
ertc_time_type::day
uint8_t day
Definition: at32f415_ertc.h:374
ertc_time_type::hour
uint8_t hour
Definition: at32f415_ertc.h:375
ertc_time_type::min
uint8_t min
Definition: at32f415_ertc.h:376
ertc_time_type::month
uint8_t month
Definition: at32f415_ertc.h:373
ertc_time_type::sec
uint8_t sec
Definition: at32f415_ertc.h:377
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • ertc
  • wakeup_timer
  • inc
project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • ertc
  • wakeup_timer
  • inc
project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • ertc
  • wakeup_timer
  • inc
project/at_start_f415/examples/ertc/wakeup_timer/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • ertc
  • wakeup_timer
  • src
project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • ertc
  • wakeup_timer
  • src
project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30#include "stdio.h"
31
40extern void ertc_wakeup_show(void);
41
47void NMI_Handler(void)
48{
49}
50
56void HardFault_Handler(void)
57{
58 /* go to infinite loop when hard fault exception occurs */
59 while(1)
60 {
61 }
62}
63
69void MemManage_Handler(void)
70{
71 /* go to infinite loop when memory manage exception occurs */
72 while(1)
73 {
74 }
75}
76
82void BusFault_Handler(void)
83{
84 /* go to infinite loop when bus fault exception occurs */
85 while(1)
86 {
87 }
88}
89
95void UsageFault_Handler(void)
96{
97 /* go to infinite loop when usage fault exception occurs */
98 while(1)
99 {
100 }
101}
102
108void SVC_Handler(void)
109{
110}
111
117void DebugMon_Handler(void)
118{
119}
120
126void PendSV_Handler(void)
127{
128}
129
135void SysTick_Handler(void)
136{
137}
138
144void ERTC_WKUP_IRQHandler(void)
145{
146 if(ertc_flag_get(ERTC_WATF_FLAG) != RESET)
147 {
148 printf("wakeup\r\n");
149
150 at32_led_on(LED2);
151
152 /* clear wakeup timer flag */
153 ertc_flag_clear(ERTC_WATF_FLAG);
154
155 /* clear exint flag */
156 exint_flag_clear(EXINT_LINE_22);
157 }
158}
159
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c:95
ertc_wakeup_show
void ertc_wakeup_show(void)
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c:56
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c:69
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c:108
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c:126
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c:47
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c:82
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c:135
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c:117
ERTC_WKUP_IRQHandler
void ERTC_WKUP_IRQHandler(void)
this function handles ertc wakeup timer interrupt request.
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/at32f415_int.c:144
LED2
@ LED2
Definition: at32f415_board.h:63
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
ertc_flag_get
flag_status ertc_flag_get(uint32_t flag)
get flag status.
Definition: at32f415_ertc.c:1428
ertc_flag_clear
void ertc_flag_clear(uint32_t flag)
clear flag status
Definition: at32f415_ertc.c:1461
ERTC_WATF_FLAG
#define ERTC_WATF_FLAG
Definition: at32f415_ertc.h:76
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
EXINT_LINE_22
#define EXINT_LINE_22
Definition: at32f415_exint.h:74
RESET
@ RESET
Definition: at32f415.h:248
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • ertc
  • wakeup_timer
  • src
project/at_start_f415/examples/ertc/wakeup_timer/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38void ertc_config(void);
39void wakeup_timer_config(void);
40
46int main(void)
47{
48 ertc_time_type time;
49 uint32_t temp = 0;
50
51 /* initial system clock */
52 system_clock_config();
53
54 /* initial the nvic priority group */
55 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
56
57 /* at board initial */
58 at32_board_init();
59
60 /* initialize uart */
61 uart_print_init(115200);
62
63 /* ertc configuration */
64 ertc_config();
65
66 /* ertc wakeup timer configuration */
67 wakeup_timer_config();
68
69 while(1)
70 {
71 /* get the current time */
72 ertc_calendar_get(&time);
73
74 if(temp != time.sec)
75 {
76 temp = time.sec;
77
78 /* display date format : year-month-day */
79 printf("%02d-%02d-%02d ",time.year, time.month, time.day);
80
81 /* display time format : hour:min:sec */
82 printf("%02d:%02d:%02d\r\n",time.hour, time.min, time.sec);
83 }
84 }
85}
86
92void ertc_config(void)
93{
94 /* enable the pwc clock interface */
95 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
96
97 /* allow access to ertc */
98 pwc_battery_powered_domain_access(TRUE);
99
100 /* reset ertc domain */
101 crm_battery_powered_domain_reset(TRUE);
102 crm_battery_powered_domain_reset(FALSE);
103
104 /* enable the lext osc */
105 crm_clock_source_enable(CRM_CLOCK_SOURCE_LEXT, TRUE);
106
107 /* wait till lext is ready */
108 while(crm_flag_get(CRM_LEXT_STABLE_FLAG) == RESET)
109 {
110 }
111
112 /* select the ertc clock source */
113 crm_ertc_clock_select(CRM_ERTC_CLOCK_LEXT);
114
115 /* enable the ertc clock */
116 crm_ertc_clock_enable(TRUE);
117
118 /* deinitializes the ertc registers */
119 ertc_reset();
120
121 /* wait for ertc apb registers update */
122 ertc_wait_update();
123
124 /* configure the ertc divider */
125 /* ertc second(1hz) = ertc_clk / (div_a + 1) * (div_b + 1) */
126 ertc_divider_set(127, 255);
127
128 /* configure the ertc hour mode */
129 ertc_hour_mode_set(ERTC_HOUR_MODE_24);
130
131 /* set date: 2021-05-01 */
132 ertc_date_set(21, 5, 1, 5);
133
134 /* set time: 12:00:00 */
135 ertc_time_set(12, 0, 0, ERTC_AM);
136}
137
138
144void wakeup_timer_config(void)
145{
146 exint_init_type exint_init_struct;
147
148 /* select the wakeup timer clock source */
149 ertc_wakeup_clock_set(ERTC_WAT_CLK_CK_A_16BITS);
150
151 /* set wakeup time: 5s */
152 ertc_wakeup_counter_set(5 - 1);
153
154 /* enable ertc wakeup timer interrupt */
155 ertc_interrupt_enable(ERTC_WAT_INT, TRUE);
156
157 /* enable the wakeup timer */
158 ertc_wakeup_enable(TRUE);
159
160 /* ertc wakeup timer interrupt configuration */
161 /* exint configuration */
162 exint_default_para_init(&exint_init_struct);
163 exint_init_struct.line_enable = TRUE;
164 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
165 exint_init_struct.line_select = EXINT_LINE_22;
166 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
167 exint_init(&exint_init_struct);
168
169 /* enable the ertc interrupt */
170 nvic_irq_enable(ERTC_WKUP_IRQn, 0, 1);
171}
172
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
wakeup_timer_config
void wakeup_timer_config(void)
configure the ertc peripheral by selecting the clock source.
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/main.c:144
main
int main(void)
main program
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/main.c:46
ertc_config
void ertc_config(void)
configure the ertc peripheral by selecting the clock source.
Definition: project/at_start_f415/examples/ertc/wakeup_timer/src/main.c:92
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_ertc_clock_select
void crm_ertc_clock_select(crm_ertc_clock_type value)
select ertc clock
Definition: at32f415_crm.c:377
crm_ertc_clock_enable
void crm_ertc_clock_enable(confirm_state new_state)
enable or disable ertc
Definition: at32f415_crm.c:387
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_battery_powered_domain_reset
void crm_battery_powered_domain_reset(confirm_state new_state)
battery powered domain software reset
Definition: at32f415_crm.c:496
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_CLOCK_SOURCE_LEXT
@ CRM_CLOCK_SOURCE_LEXT
Definition: at32f415_crm.h:306
CRM_ERTC_CLOCK_LEXT
@ CRM_ERTC_CLOCK_LEXT
Definition: at32f415_crm.h:383
CRM_LEXT_STABLE_FLAG
#define CRM_LEXT_STABLE_FLAG
Definition: at32f415_crm.h:58
ERTC_WKUP_IRQn
@ ERTC_WKUP_IRQn
Definition: at32f415.h:138
ertc_hour_mode_set
error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode)
ertc hour mode set.
Definition: at32f415_ertc.c:283
ertc_wakeup_clock_set
void ertc_wakeup_clock_set(ertc_wakeup_clock_type clock)
set wakeup timer clock.
Definition: at32f415_ertc.c:731
ertc_wait_update
error_status ertc_wait_update(void)
ertc wait register update finish.
Definition: at32f415_ertc.c:97
ertc_wakeup_counter_set
void ertc_wakeup_counter_set(uint32_t counter)
set wakeup counter.
Definition: at32f415_ertc.c:747
ertc_time_set
error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time.
Definition: at32f415_ertc.c:363
ertc_reset
error_status ertc_reset(void)
ertc reset all register.
Definition: at32f415_ertc.c:207
ertc_interrupt_enable
void ertc_interrupt_enable(uint32_t source, confirm_state new_state)
enable or disable interrupt.
Definition: at32f415_ertc.c:1340
ertc_wakeup_enable
error_status ertc_wakeup_enable(confirm_state new_state)
enable or disable wakeup timer.
Definition: at32f415_ertc.c:773
ertc_date_set
error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date.
Definition: at32f415_ertc.c:314
ertc_calendar_get
void ertc_calendar_get(ertc_time_type *time)
get calendar
Definition: at32f415_ertc.c:404
ertc_divider_set
error_status ertc_divider_set(uint16_t div_a, uint16_t div_b)
ertc division set.
Definition: at32f415_ertc.c:251
ERTC_HOUR_MODE_24
@ ERTC_HOUR_MODE_24
Definition: at32f415_ertc.h:105
ERTC_WAT_CLK_CK_A_16BITS
@ ERTC_WAT_CLK_CK_A_16BITS
Definition: at32f415_ertc.h:169
ERTC_AM
@ ERTC_AM
Definition: at32f415_ertc.h:115
ERTC_WAT_INT
#define ERTC_WAT_INT
Definition: at32f415_ertc.h:55
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_22
#define EXINT_LINE_22
Definition: at32f415_exint.h:74
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
time
ertc_time_type * time
Definition: random.c:42
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_battery_powered_domain_access
void pwc_battery_powered_domain_access(confirm_state new_state)
enable or disable access to the battery powered domain.
Definition: at32f415_pwc.c:61
ertc_time_type
ertc time
Definition: at32f415_ertc.h:371
ertc_time_type::year
uint8_t year
Definition: at32f415_ertc.h:372
ertc_time_type::day
uint8_t day
Definition: at32f415_ertc.h:374
ertc_time_type::hour
uint8_t hour
Definition: at32f415_ertc.h:375
ertc_time_type::min
uint8_t min
Definition: at32f415_ertc.h:376
ertc_time_type::month
uint8_t month
Definition: at32f415_ertc.h:373
ertc_time_type::sec
uint8_t sec
Definition: at32f415_ertc.h:377
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • exint
  • exint_config
  • inc
project/at_start_f415/examples/exint/exint_config/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • exint
  • exint_config
  • inc
project/at_start_f415/examples/exint/exint_config/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • exint
  • exint_config
  • inc
project/at_start_f415/examples/exint/exint_config/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • exint
  • exint_config
  • src
project/at_start_f415/examples/exint/exint_config/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/exint/exint_config/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • exint
  • exint_config
  • src
project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/exint/exint_config/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • exint
  • exint_config
  • src
project/at_start_f415/examples/exint/exint_config/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
30
40void exint_line0_config(void);
41
47int main(void)
48{
49 system_clock_config();
50
51 at32_board_init();
52
53 /* turn led2/led3/led4 on */
54 at32_led_on(LED2);
55 at32_led_on(LED3);
56 at32_led_on(LED4);
57
58 /* configure pa0 in interrupt mode */
59 exint_line0_config();
60
61 while(1)
62 {
63 }
64}
65
71void exint_line0_config(void)
72{
73 exint_init_type exint_init_struct;
74
75 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
76 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
77
78 gpio_exint_line_config(GPIO_PORT_SOURCE_GPIOA, GPIO_PINS_SOURCE0);
79
80 exint_default_para_init(&exint_init_struct);
81 exint_init_struct.line_enable = TRUE;
82 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
83 exint_init_struct.line_select = EXINT_LINE_0;
84 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
85 exint_init(&exint_init_struct);
86
87 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
88 nvic_irq_enable(EXINT0_IRQn, 1, 0);
89}
90
96void EXINT0_IRQHandler(void)
97{
98 if(exint_flag_get(EXINT_LINE_0) != RESET)
99 {
100 at32_led_toggle(LED2);
101 at32_led_toggle(LED3);
102 at32_led_toggle(LED4);
103 exint_flag_clear(EXINT_LINE_0);
104 }
105}
106
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
main
int main(void)
main function.
Definition: project/at_start_f415/examples/exint/exint_config/src/main.c:47
EXINT0_IRQHandler
void EXINT0_IRQHandler(void)
exint0 interrupt handler
Definition: project/at_start_f415/examples/exint/exint_config/src/main.c:96
exint_line0_config
void exint_line0_config(void)
exint line0 config. configure pa0 in interrupt mode
Definition: project/at_start_f415/examples/exint/exint_config/src/main.c:71
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
EXINT0_IRQn
@ EXINT0_IRQn
Definition: at32f415.h:141
exint_flag_get
flag_status exint_flag_get(uint32_t exint_line)
get exint flag
Definition: at32f415_exint.c:142
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_0
#define EXINT_LINE_0
Definition: at32f415_exint.h:52
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_exint_line_config
void gpio_exint_line_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line.
Definition: at32f415_gpio.c:577
GPIO_PINS_SOURCE0
@ GPIO_PINS_SOURCE0
Definition: at32f415_gpio.h:268
GPIO_PORT_SOURCE_GPIOA
@ GPIO_PORT_SOURCE_GPIOA
Definition: at32f415_gpio.h:291
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • exint
  • exint_software_trigger
  • inc
project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • exint
  • exint_software_trigger
  • inc
project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • exint
  • exint_software_trigger
  • inc
project/at_start_f415/examples/exint/exint_software_trigger/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • exint
  • exint_software_trigger
  • src
project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • exint
  • exint_software_trigger
  • src
project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • exint
  • exint_software_trigger
  • src
project/at_start_f415/examples/exint/exint_software_trigger/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
30
40void exint_line4_config(void);
41static void tmr1_config(void);
42
48void exint_line4_config(void)
49{
50 exint_init_type exint_init_struct;
51
52 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
53
54 exint_default_para_init(&exint_init_struct);
55 exint_init_struct.line_enable = TRUE;
56 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
57 exint_init_struct.line_select = EXINT_LINE_4;
58 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
59 exint_init(&exint_init_struct);
60
61 nvic_irq_enable(EXINT4_IRQn, 1, 0);
62}
63
69static void tmr1_config(void)
70{
71 crm_clocks_freq_type crm_clocks_freq_struct = {0};
72
73 /* get system clock */
74 crm_clocks_freq_get(&crm_clocks_freq_struct);
75
76 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
77
78 /* (systemclock / 24000) / 10000 = 1Hz(1s) */
79 tmr_base_init(TMR1, 10000, 14400);
80 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
81 tmr_clock_source_div_set(TMR1, TMR_CLOCK_DIV1);
82 tmr_interrupt_enable(TMR1, TMR_OVF_INT, TRUE);
83 nvic_irq_enable(TMR1_OVF_TMR10_IRQn, 0, 0);
84}
85
91void TMR1_OVF_TMR10_IRQHandler(void)
92{
93 if(tmr_flag_get(TMR1,TMR_OVF_FLAG) != RESET)
94 {
95 at32_led_toggle(LED2);
96 exint_software_interrupt_event_generate(EXINT_LINE_4);
97 tmr_flag_clear(TMR1,TMR_OVF_FLAG);
98 }
99}
100
106void EXINT4_IRQHandler(void)
107{
108 if(exint_flag_get(EXINT_LINE_4) != RESET)
109 {
110 at32_led_toggle(LED3);
111 at32_led_toggle(LED4);
112 exint_flag_clear(EXINT_LINE_4);
113 }
114}
115
121int main(void)
122{
123 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
124 system_clock_config();
125
126 at32_board_init();
127
128 /* turn led2/led3/led4 on */
129 at32_led_on(LED2);
130 at32_led_on(LED3);
131 at32_led_on(LED4);
132 tmr1_config();
133 /* configure pa0 in interrupt mode */
134 exint_line4_config();
135 tmr_counter_enable(TMR1, TRUE);
136 while(1)
137 {
138 }
139}
140
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/debug/tmr1/src/main.c:39
exint_line4_config
void exint_line4_config(void)
exint line4 config. configure pa0 in interrupt mode
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/main.c:48
main
int main(void)
main function.
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/main.c:121
tmr1_config
static void tmr1_config(void)
tmr1 configuration.
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/main.c:69
EXINT4_IRQHandler
void EXINT4_IRQHandler(void)
exint4 interrupt handler
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/main.c:106
TMR1_OVF_TMR10_IRQHandler
void TMR1_OVF_TMR10_IRQHandler(void)
tmr1 interrupt handler
Definition: project/at_start_f415/examples/exint/exint_software_trigger/src/main.c:91
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
TMR1_OVF_TMR10_IRQn
@ TMR1_OVF_TMR10_IRQn
Definition: at32f415.h:161
EXINT4_IRQn
@ EXINT4_IRQn
Definition: at32f415.h:145
exint_flag_get
flag_status exint_flag_get(uint32_t exint_line)
get exint flag
Definition: at32f415_exint.c:142
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_software_interrupt_event_generate
void exint_software_interrupt_event_generate(uint32_t exint_line)
generate exint software interrupt event
Definition: at32f415_exint.c:169
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_4
#define EXINT_LINE_4
Definition: at32f415_exint.h:56
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OVF_FLAG
#define TMR_OVF_FLAG
Definition: at32f415_tmr.h:52
TMR_OVF_INT
#define TMR_OVF_INT
Definition: at32f415_tmr.h:74
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • flash
  • flash_write_read
  • inc
project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • flash
  • flash_write_read
  • inc
project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • flash
  • flash_write_read
  • inc
project/at_start_f415/examples/flash/flash_write_read/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: flash.h Source File

  • flash
  • flash_write_read
  • inc
project/at_start_f415/examples/flash/flash_write_read/inc/flash.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __FLASH_H__
29#define __FLASH_H__
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_board.h"
36
50void flash_read(uint32_t read_addr, uint16_t *p_buffer, uint16_t num_read);
51void flash_write_nocheck(uint32_t write_addr, uint16_t *p_buffer, uint16_t num_write);
52void flash_write(uint32_t write_addr,uint16_t *p_Buffer, uint16_t num_write);
53
66#ifdef __cplusplus
67}
68#endif
69
70#endif
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
flash_write
void flash_write(uint32_t write_addr, uint16_t *p_Buffer, uint16_t num_write)
write data using halfword mode with checking
Definition: project/at_start_f415/examples/flash/flash_write_read/src/flash.c:83
flash_write_nocheck
void flash_write_nocheck(uint32_t write_addr, uint16_t *p_buffer, uint16_t num_write)
write data using halfword mode without checking
Definition: project/at_start_f415/examples/flash/flash_write_read/src/flash.c:66
flash_read
void flash_read(uint32_t read_addr, uint16_t *p_buffer, uint16_t num_read)
read data using halfword mode
Definition: project/at_start_f415/examples/flash/flash_write_read/src/flash.c:49


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • flash
  • flash_write_read
  • src
project/at_start_f415/examples/flash/flash_write_read/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/flash/flash_write_read/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • flash
  • flash_write_read
  • src
project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/flash/flash_write_read/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: flash.c Source File

  • flash
  • flash_write_read
  • src
project/at_start_f415/examples/flash/flash_write_read/src/flash.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "flash.h"
29
38#define SECTOR_SIZE 2048
39
40uint16_t flash_buf[SECTOR_SIZE / 2];
41
49void flash_read(uint32_t read_addr, uint16_t *p_buffer, uint16_t num_read)
50{
51 uint16_t i;
52 for(i = 0; i < num_read; i++)
53 {
54 p_buffer[i] = *(uint16_t*)(read_addr);
55 read_addr += 2;
56 }
57}
58
66void flash_write_nocheck(uint32_t write_addr, uint16_t *p_buffer, uint16_t num_write)
67{
68 uint16_t i;
69 for(i = 0; i < num_write; i++)
70 {
71 flash_halfword_program(write_addr, p_buffer[i]);
72 write_addr += 2;
73 }
74}
75
83void flash_write(uint32_t write_addr, uint16_t *p_buffer, uint16_t num_write)
84{
85 uint32_t offset_addr;
86 uint32_t sector_position;
87 uint16_t sector_offset;
88 uint16_t sector_remain;
89 uint16_t i;
90
91 flash_unlock();
92 offset_addr = write_addr - FLASH_BASE;
93 sector_position = offset_addr / SECTOR_SIZE;
94 sector_offset = (offset_addr % SECTOR_SIZE) / 2;
95 sector_remain = SECTOR_SIZE / 2 - sector_offset;
96 if(num_write <= sector_remain)
97 sector_remain = num_write;
98 while(1)
99 {
100 flash_read(sector_position * SECTOR_SIZE + FLASH_BASE, flash_buf, SECTOR_SIZE / 2);
101 for(i = 0; i < sector_remain; i++)
102 {
103 if(flash_buf[sector_offset + i] != 0xFFFF)
104 break;
105 }
106 if(i < sector_remain)
107 {
108 flash_sector_erase(sector_position * SECTOR_SIZE + FLASH_BASE);
109 for(i = 0; i < sector_remain; i++)
110 {
111 flash_buf[i + sector_offset] = p_buffer[i];
112 }
113 flash_write_nocheck(sector_position * SECTOR_SIZE + FLASH_BASE, flash_buf, SECTOR_SIZE / 2);
114 }
115 else
116 {
117 flash_write_nocheck(write_addr, p_buffer, sector_remain);
118 }
119 if(num_write == sector_remain)
120 break;
121 else
122 {
123 sector_position++;
124 sector_offset = 0;
125 p_buffer += sector_remain;
126 write_addr += (sector_remain * 2);
127 num_write -= sector_remain;
128 if(num_write > (SECTOR_SIZE / 2))
129 sector_remain = SECTOR_SIZE / 2;
130 else
131 sector_remain = num_write;
132 }
133 }
134 flash_lock();
135}
136
137
138
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
flash_buf
uint16_t flash_buf[2048/2]
Definition: project/at_start_f415/examples/flash/flash_write_read/src/flash.c:40
flash_write_nocheck
void flash_write_nocheck(uint32_t write_addr, uint16_t *p_buffer, uint16_t num_write)
write data using halfword mode without checking
Definition: project/at_start_f415/examples/flash/flash_write_read/src/flash.c:66
SECTOR_SIZE
#define SECTOR_SIZE
Definition: project/at_start_f415/examples/flash/flash_write_read/src/flash.c:38
flash_read
void flash_read(uint32_t read_addr, uint16_t *p_buffer, uint16_t num_read)
read data using halfword mode
Definition: project/at_start_f415/examples/flash/flash_write_read/src/flash.c:49
flash_write
void flash_write(uint32_t write_addr, uint16_t *p_buffer, uint16_t num_write)
write data using halfword mode with checking
Definition: project/at_start_f415/examples/flash/flash_write_read/src/flash.c:83
flash_sector_erase
flash_status_type flash_sector_erase(uint32_t sector_address)
erase a specified flash sector.
Definition: at32f415_flash.c:173
flash_halfword_program
flash_status_type flash_halfword_program(uint32_t address, uint16_t data)
program a halfword at a specified address.
Definition: at32f415_flash.c:315
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
flash_lock
void flash_lock(void)
lock the flash controller.
Definition: at32f415_flash.c:162
FLASH_BASE
#define FLASH_BASE
Definition: at32f415.h:285


AT32F415 Firmwary Library: main.c Source File

  • flash
  • flash_write_read
  • src
project/at_start_f415/examples/flash/flash_write_read/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "flash.h"
30
39#define TEST_BUFEER_SIZE 3000
40#define TEST_FLASH_ADDRESS_START (0x08000000 + 1024 * 10)
41
42uint16_t buffer_write[TEST_BUFEER_SIZE];
43uint16_t buffer_read[TEST_BUFEER_SIZE];
44
45 error_status buffer_compare(uint16_t* p_buffer1, uint16_t* p_buffer2, uint16_t buffer_length);
46
54 error_status buffer_compare(uint16_t* p_buffer1, uint16_t* p_buffer2, uint16_t buffer_length)
55{
56 while(buffer_length--)
57 {
58 if(*p_buffer1 != *p_buffer2)
59 {
60 return ERROR;
61 }
62 p_buffer1++;
63 p_buffer2++;
64 }
65 return SUCCESS;
66}
67
73int main(void)
74{
75 uint32_t index=0;
76 system_clock_config();
77 at32_board_init();
78 /* fill buffer_write data to test */
79 for(index = 0; index < TEST_BUFEER_SIZE; index++)
80 {
81 buffer_write[index] = index;
82 }
83
84 /* write data to flash */
85 flash_write(TEST_FLASH_ADDRESS_START, buffer_write, TEST_BUFEER_SIZE);
86
87 /* read data from flash */
88 flash_read(TEST_FLASH_ADDRESS_START, buffer_read, TEST_BUFEER_SIZE);
89
90 /* compare the buffer */
91 if(buffer_compare(buffer_write, buffer_read, TEST_BUFEER_SIZE) == SUCCESS)
92 {
93 at32_led_on(LED2);
94 at32_led_on(LED3);
95 at32_led_on(LED4);
96 }
97
98 while(1)
99 {
100 }
101}
102
103
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
TEST_BUFEER_SIZE
#define TEST_BUFEER_SIZE
Definition: project/at_start_f415/examples/flash/flash_write_read/src/main.c:39
buffer_read
uint16_t buffer_read[3000]
Definition: project/at_start_f415/examples/flash/flash_write_read/src/main.c:43
TEST_FLASH_ADDRESS_START
#define TEST_FLASH_ADDRESS_START
Definition: project/at_start_f415/examples/flash/flash_write_read/src/main.c:40
buffer_compare
error_status buffer_compare(uint16_t *p_buffer1, uint16_t *p_buffer2, uint16_t buffer_length)
compares two buffers.
Definition: project/at_start_f415/examples/flash/flash_write_read/src/main.c:54
main
int main(void)
main function.
Definition: project/at_start_f415/examples/flash/flash_write_read/src/main.c:73
buffer_write
uint16_t buffer_write[3000]
Definition: project/at_start_f415/examples/flash/flash_write_read/src/main.c:42
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
flash_write
void flash_write(uint32_t write_addr, uint16_t *p_Buffer, uint16_t num_write)
write data using halfword mode with checking
Definition: project/at_start_f415/examples/flash/flash_write_read/src/flash.c:83
flash_read
void flash_read(uint32_t read_addr, uint16_t *p_buffer, uint16_t num_read)
read data using halfword mode
Definition: project/at_start_f415/examples/flash/flash_write_read/src/flash.c:49
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • gpio
  • led_toggle
  • inc
project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • gpio
  • led_toggle
  • inc
project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • gpio
  • led_toggle
  • inc
project/at_start_f415/examples/gpio/led_toggle/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • gpio
  • led_toggle
  • src
project/at_start_f415/examples/gpio/led_toggle/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/gpio/led_toggle/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • gpio
  • led_toggle
  • src
project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
135
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/gpio/led_toggle/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • gpio
  • led_toggle
  • src
project/at_start_f415/examples/gpio/led_toggle/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
30
44int main(void)
45{
46 system_clock_config();
47
48 at32_board_init();
49
50 while(1)
51 {
52 at32_led_toggle(LED2);
53 delay_ms(200);
54 at32_led_toggle(LED3);
55 delay_ms(200);
56 at32_led_toggle(LED4);
57 delay_ms(200);
58 }
59}
60
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
main
int main(void)
main function.
Definition: project/at_start_f415/examples/gpio/led_toggle/src/main.c:44
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • gpio
  • swjtag_remap
  • inc
project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • gpio
  • swjtag_remap
  • inc
project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • gpio
  • swjtag_remap
  • inc
project/at_start_f415/examples/gpio/swjtag_remap/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • gpio
  • swjtag_remap
  • src
project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • gpio
  • swjtag_remap
  • src
project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/gpio/swjtag_remap/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • gpio
  • swjtag_remap
  • src
project/at_start_f415/examples/gpio/swjtag_remap/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
30
39void swj_dp_config(void);
40void gpio_pins_toggle(gpio_type* gpio_x, uint16_t gpio_pin);
41
47void swj_dp_config(void)
48{
49 gpio_init_type gpio_init_struct;
50
51 /* configure pa13 (jtms/swdat), pa14 (jtck/swclk) and pa15 (jtdi) as output push-pull */
52 gpio_init_struct.gpio_pins = GPIO_PINS_13 | GPIO_PINS_14 | GPIO_PINS_15;
53 gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
54 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
55 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
56 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
57 gpio_init(GPIOA, &gpio_init_struct);
58
59 /* configure pb3 (jtdo) and pb4 (jtrst) as output push-pull */
60 gpio_init_struct.gpio_pins = GPIO_PINS_3 | GPIO_PINS_4;
61 gpio_init(GPIOB, &gpio_init_struct);
62}
63
70void gpio_pins_toggle(gpio_type* gpio_x, uint16_t gpio_pin)
71{
72 gpio_x->odt ^= gpio_pin;
73}
74
80int main(void)
81{
82 system_clock_config();
83
84 at32_board_init();
85
86 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
87 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
88 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
89
90 swj_dp_config();
91
92 while(1)
93 {
94 if(USER_BUTTON == at32_button_press())
95 {
96 /* disable the serial wire jtag debug port swj-dp */
97 gpio_pin_remap_config(SWJTAG_MUX_100, TRUE);
98
99 /* turn on led3 */
100 at32_led_on(LED3);
101 }
102
103 /* toggle jtms/swdat pin */
104 gpio_pins_toggle(GPIOA, GPIO_PINS_13);
105 delay_us(200);
106
107 /* toggle jtck/swclk pin */
108 gpio_pins_toggle(GPIOA, GPIO_PINS_14);
109 delay_us(200);
110
111 /* toggle jtdi pin */
112 gpio_pins_toggle(GPIOA, GPIO_PINS_15);
113 delay_us(200);
114
115 /* toggle jtdo pin */
116 gpio_pins_toggle(GPIOB, GPIO_PINS_3);
117 delay_us(200);
118
119 /* toggle jtrst pin */
120 gpio_pins_toggle(GPIOB, GPIO_PINS_4);
121 delay_us(200);
122 }
123}
124
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
gpio_pins_toggle
void gpio_pins_toggle(gpio_type *gpio_x, uint16_t gpio_pin)
toggles the specified gpio pin
Definition: project/at_start_f415/examples/gpio/swjtag_remap/src/main.c:70
main
int main(void)
main function.
Definition: project/at_start_f415/examples/gpio/swjtag_remap/src/main.c:80
swj_dp_config
void swj_dp_config(void)
configure the gpio of swj-dp.
Definition: project/at_start_f415/examples/gpio/swjtag_remap/src/main.c:47
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_pin_remap_config
void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration.
Definition: at32f415_gpio.c:521
GPIO_MODE_OUTPUT
@ GPIO_MODE_OUTPUT
Definition: at32f415_gpio.h:229
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIO_PINS_14
#define GPIO_PINS_14
Definition: at32f415_gpio.h:65
GPIO_PINS_4
#define GPIO_PINS_4
Definition: at32f415_gpio.h:55
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
SWJTAG_MUX_100
#define SWJTAG_MUX_100
Definition: at32f415_gpio.h:99
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
gpio_type
type define gpio register all
Definition: at32f415_gpio.h:314
gpio_type::odt
__IO uint32_t odt
Definition: at32f415_gpio.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • i2c
  • communication_dma
  • inc
project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • i2c
  • communication_dma
  • inc
project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • i2c
  • communication_dma
  • inc
project/at_start_f415/examples/i2c/communication_dma/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • i2c
  • communication_dma
  • src
project/at_start_f415/examples/i2c/communication_dma/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/i2c/communication_dma/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • i2c
  • communication_dma
  • src
project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "i2c_application.h"
30
31extern i2c_handle_type hi2cx;
32
33#define I2Cx_DMA_TX_IRQHandler DMA1_Channel6_IRQHandler
34#define I2Cx_DMA_RX_IRQHandler DMA1_Channel7_IRQHandler
35#define I2Cx_EVT_IRQHandler I2C1_EVT_IRQHandler
36#define I2Cx_ERR_IRQHandler I2C1_ERR_IRQHandler
37
51void NMI_Handler(void)
52{
53}
54
60void HardFault_Handler(void)
61{
62 /* go to infinite loop when hard fault exception occurs */
63 while(1)
64 {
65 }
66}
67
73void MemManage_Handler(void)
74{
75 /* go to infinite loop when memory manage exception occurs */
76 while(1)
77 {
78 }
79}
80
86void BusFault_Handler(void)
87{
88 /* go to infinite loop when bus fault exception occurs */
89 while(1)
90 {
91 }
92}
93
99void UsageFault_Handler(void)
100{
101 /* go to infinite loop when usage fault exception occurs */
102 while(1)
103 {
104 }
105}
106
112void SVC_Handler(void)
113{
114}
115
121void DebugMon_Handler(void)
122{
123}
124
130void PendSV_Handler(void)
131{
132}
133
139void SysTick_Handler(void)
140{
141}
142
148void I2Cx_DMA_RX_IRQHandler(void)
149{
150 i2c_dma_rx_irq_handler(&hi2cx);
151}
152
158void I2Cx_DMA_TX_IRQHandler(void)
159{
160 i2c_dma_tx_irq_handler(&hi2cx);
161}
162
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c:99
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c:60
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c:73
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c:112
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c:130
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c:51
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c:86
hi2cx
i2c_handle_type hi2cx
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:71
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c:139
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c:121
i2c_dma_rx_irq_handler
void i2c_dma_rx_irq_handler(i2c_handle_type *hi2c)
dma reveive complete interrupt function.
Definition: i2c_application.c:2194
i2c_dma_tx_irq_handler
void i2c_dma_tx_irq_handler(i2c_handle_type *hi2c)
dma transmission complete interrupt function.
Definition: i2c_application.c:2145
i2c_application.h
i2c application libray header file
I2Cx_DMA_TX_IRQHandler
#define I2Cx_DMA_TX_IRQHandler
Definition: project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c:33
I2Cx_DMA_RX_IRQHandler
#define I2Cx_DMA_RX_IRQHandler
Definition: project/at_start_f415/examples/i2c/communication_dma/src/at32f415_int.c:34
i2c_handle_type
Definition: i2c_application.h:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • i2c
  • communication_dma
  • src
project/at_start_f415/examples/i2c/communication_dma/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "i2c_application.h"
30
39#define I2C_TIMEOUT 0xFFFFFFFF
40
41#define I2Cx_SPEED 100000
42#define I2Cx_ADDRESS 0xA0
43
44#define I2Cx_PORT I2C1
45#define I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
46
47#define I2Cx_SCL_PIN GPIO_PINS_6
48#define I2Cx_SCL_GPIO_PORT GPIOB
49#define I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
50
51#define I2Cx_SDA_PIN GPIO_PINS_7
52#define I2Cx_SDA_GPIO_PORT GPIOB
53#define I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
54
55#define I2Cx_DMA_CLK CRM_DMA1_PERIPH_CLOCK
56#define I2Cx_DMA_TX_CHANNEL DMA1_CHANNEL6
57#define I2Cx_DMA_TX_IRQn DMA1_Channel6_IRQn
58
59#define I2Cx_DMA_RX_CHANNEL DMA1_CHANNEL7
60#define I2Cx_DMA_RX_IRQn DMA1_Channel7_IRQn
61
62#define I2Cx_EVT_IRQn I2C1_EVT_IRQn
63#define I2Cx_ERR_IRQn I2C1_ERR_IRQn
64
65#define BUF_SIZE 8
66#define MASTER_BOARD
67
68uint8_t tx_buf[BUF_SIZE] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
69uint8_t rx_buf[BUF_SIZE] = {0};
70
71 i2c_handle_type hi2cx;
72
73uint32_t buffer_compare(uint8_t* buffer1, uint8_t* buffer2, uint32_t len);
74void i2c_lowlevel_init(i2c_handle_type* hi2c);
75
81void error_handler(uint32_t error_code)
82{
83 while(1)
84 {
85 at32_led_toggle(LED2);
86 delay_ms(500);
87 }
88}
89
97uint32_t buffer_compare(uint8_t* buffer1, uint8_t* buffer2, uint32_t len)
98{
99 uint32_t i;
100
101 for(i = 0; i < len; i++)
102 {
103 if(buffer1[i] != buffer2[i])
104 {
105 return 1;
106 }
107 }
108
109 return 0;
110}
111
117void i2c_lowlevel_init(i2c_handle_type* hi2c)
118{
119 gpio_init_type gpio_initstructure;
120
121 if(hi2c->i2cx == I2Cx_PORT)
122 {
123 /* i2c periph clock enable */
124 crm_periph_clock_enable(I2Cx_CLK, TRUE);
125 crm_periph_clock_enable(I2Cx_SCL_GPIO_CLK, TRUE);
126 crm_periph_clock_enable(I2Cx_SDA_GPIO_CLK, TRUE);
127
128 /* gpio configuration */
129 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_OPEN_DRAIN;
130 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
131 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
132 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
133
134 /* configure i2c pins: scl */
135 gpio_initstructure.gpio_pins = I2Cx_SCL_PIN;
136 gpio_init(I2Cx_SCL_GPIO_PORT, &gpio_initstructure);
137
138 /* configure i2c pins: sda */
139 gpio_initstructure.gpio_pins = I2Cx_SDA_PIN;
140 gpio_init(I2Cx_SDA_GPIO_PORT, &gpio_initstructure);
141
142 /* configure and enable i2c dma channel interrupt */
143 nvic_irq_enable(I2Cx_DMA_TX_IRQn, 0, 0);
144 nvic_irq_enable(I2Cx_DMA_RX_IRQn, 0, 0);
145
146 /* i2c dma tx and rx channels configuration */
147 /* enable the dma clock */
148 crm_periph_clock_enable(I2Cx_DMA_CLK, TRUE);
149
150 /* i2c dma channel configuration */
151 dma_reset(hi2c->dma_tx_channel);
152 dma_reset(hi2c->dma_rx_channel);
153
154 hi2c->dma_tx_channel = I2Cx_DMA_TX_CHANNEL;
155 hi2c->dma_rx_channel = I2Cx_DMA_RX_CHANNEL;
156
157 dma_default_para_init(&hi2c->dma_init_struct);
158 hi2c->dma_init_struct.peripheral_inc_enable = FALSE;
159 hi2c->dma_init_struct.memory_inc_enable = TRUE;
160 hi2c->dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
161 hi2c->dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
162 hi2c->dma_init_struct.loop_mode_enable = FALSE;
163 hi2c->dma_init_struct.priority = DMA_PRIORITY_LOW;
164 hi2c->dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
165
166 dma_init(hi2c->dma_tx_channel, &hi2c->dma_init_struct);
167 dma_init(hi2c->dma_rx_channel, &hi2c->dma_init_struct);
168
169 i2c_init(hi2c->i2cx, I2C_FSMODE_DUTY_2_1, I2Cx_SPEED);
170
171 i2c_own_address1_set(hi2c->i2cx, I2C_ADDRESS_MODE_7BIT, I2Cx_ADDRESS);
172 }
173}
174
180int main(void)
181{
182 i2c_status_type i2c_status;
183
184 /* config nvic priority group */
185 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
186
187 system_clock_config();
188
189 at32_board_init();
190
191 hi2cx.i2cx = I2Cx_PORT;
192
193 i2c_config(&hi2cx);
194
195 while(1)
196 {
197
198#if defined (MASTER_BOARD)
199
200 /* wait for key USER_BUTTON press before starting the communication */
201 while(at32_button_press() != USER_BUTTON)
202 {
203 }
204
205 /* start the request reception process */
206 if((i2c_status = i2c_master_transmit_dma(&hi2cx, I2Cx_ADDRESS, tx_buf, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
207 {
208 error_handler(i2c_status);
209 }
210
211 /* wait for the communication to end */
212 if(i2c_wait_end(&hi2cx, I2C_TIMEOUT) != I2C_OK)
213 {
214 error_handler(i2c_status);
215 }
216
217 delay_ms(10);
218
219 /* start the request reception process */
220 if((i2c_status = i2c_master_receive_dma(&hi2cx, I2Cx_ADDRESS, rx_buf, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
221 {
222 error_handler(i2c_status);
223 }
224
225 /* wait for the communication to end */
226 if(i2c_wait_end(&hi2cx, I2C_TIMEOUT) != I2C_OK)
227 {
228 error_handler(i2c_status);
229 }
230
231 if(buffer_compare(tx_buf, rx_buf, BUF_SIZE) == 0)
232 {
233 at32_led_on(LED3);
234 }
235 else
236 {
237 error_handler(i2c_status);
238 }
239
240#else
241
242 /* wait for key USER_BUTTON press before starting the communication */
243 while(at32_button_press() != USER_BUTTON)
244 {
245 }
246
247 /* start the transmission process */
248 if((i2c_status = i2c_slave_receive_dma(&hi2cx, rx_buf, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
249 {
250 error_handler(i2c_status);
251 }
252
253 /* wait for the communication to end */
254 if(i2c_wait_end(&hi2cx, I2C_TIMEOUT) != I2C_OK)
255 {
256 error_handler(i2c_status);
257 }
258
259 if((i2c_status = i2c_slave_transmit_dma(&hi2cx, tx_buf, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
260 {
261 error_handler(i2c_status);
262 }
263
264 /* wait for the communication to end */
265 if(i2c_wait_end(&hi2cx, I2C_TIMEOUT) != I2C_OK)
266 {
267 error_handler(i2c_status);
268 }
269
270 if(buffer_compare(tx_buf, rx_buf, BUF_SIZE) == 0)
271 {
272 at32_led_on(LED3);
273 }
274 else
275 {
276 error_handler(i2c_status);
277 }
278
279#endif
280
281 }
282}
283
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
rx_buf
uint8_t rx_buf[8]
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:69
tx_buf
uint8_t tx_buf[8]
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:68
I2Cx_ADDRESS
#define I2Cx_ADDRESS
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:42
I2Cx_DMA_RX_IRQn
#define I2Cx_DMA_RX_IRQn
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:60
I2Cx_CLK
#define I2Cx_CLK
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:45
I2Cx_DMA_TX_CHANNEL
#define I2Cx_DMA_TX_CHANNEL
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:56
BUF_SIZE
#define BUF_SIZE
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:65
I2Cx_SDA_PIN
#define I2Cx_SDA_PIN
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:51
main
int main(void)
main function.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:180
I2Cx_SCL_PIN
#define I2Cx_SCL_PIN
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:47
hi2cx
i2c_handle_type hi2cx
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:71
I2Cx_SDA_GPIO_PORT
#define I2Cx_SDA_GPIO_PORT
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:52
buffer_compare
uint32_t buffer_compare(uint8_t *buffer1, uint8_t *buffer2, uint32_t len)
compare whether the valus of buffer 1 and buffer 2 are equal.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:97
I2Cx_DMA_CLK
#define I2Cx_DMA_CLK
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:55
I2Cx_SDA_GPIO_CLK
#define I2Cx_SDA_GPIO_CLK
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:53
error_handler
void error_handler(uint32_t error_code)
error handler program
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:81
i2c_lowlevel_init
void i2c_lowlevel_init(i2c_handle_type *hi2c)
initializes peripherals used by the i2c.
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:117
I2Cx_SPEED
#define I2Cx_SPEED
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:41
I2Cx_PORT
#define I2Cx_PORT
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:44
I2Cx_SCL_GPIO_CLK
#define I2Cx_SCL_GPIO_CLK
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:49
I2Cx_DMA_RX_CHANNEL
#define I2Cx_DMA_RX_CHANNEL
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:59
I2Cx_DMA_TX_IRQn
#define I2Cx_DMA_TX_IRQn
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:57
I2Cx_SCL_GPIO_PORT
#define I2Cx_SCL_GPIO_PORT
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:48
I2C_TIMEOUT
#define I2C_TIMEOUT
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
i2c_wait_end
i2c_status_type i2c_wait_end(i2c_handle_type *hi2c, uint32_t timeout)
wait for the transfer to end.
Definition: i2c_application.c:148
i2c_slave_transmit_dma
i2c_status_type i2c_slave_transmit_dma(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through dma mode.
Definition: i2c_application.c:1225
i2c_master_transmit_dma
i2c_status_type i2c_master_transmit_dma(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through dma mode.
Definition: i2c_application.c:1039
i2c_config
void i2c_config(i2c_handle_type *hi2c)
i2c peripheral initialization.
Definition: i2c_application.c:102
i2c_slave_receive_dma
i2c_status_type i2c_slave_receive_dma(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through dma mode.
Definition: i2c_application.c:1092
i2c_master_receive_dma
i2c_status_type i2c_master_receive_dma(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through dma mode.
Definition: i2c_application.c:1149
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_BYTE
@ DMA_PERIPHERAL_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:238
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_MEMORY_DATA_WIDTH_BYTE
@ DMA_MEMORY_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:248
DMA_PRIORITY_LOW
@ DMA_PRIORITY_LOW
Definition: at32f415_dma.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_MODERATE
@ GPIO_DRIVE_STRENGTH_MODERATE
Definition: at32f415_gpio.h:240
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_OPEN_DRAIN
@ GPIO_OUTPUT_OPEN_DRAIN
Definition: at32f415_gpio.h:250
i2c_own_address1_set
void i2c_own_address1_set(i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address)
config own address1.
Definition: at32f415_i2c.c:185
i2c_init
void i2c_init(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed)
init i2c speed and duty cycle.
Definition: at32f415_i2c.c:90
I2C_FSMODE_DUTY_2_1
@ I2C_FSMODE_DUTY_2_1
Definition: at32f415_i2c.h:148
I2C_ADDRESS_MODE_7BIT
@ I2C_ADDRESS_MODE_7BIT
Definition: at32f415_i2c.h:157
i2c_status_type
i2c_status_type
Definition: i2c_application.h:81
I2C_OK
@ I2C_OK
Definition: i2c_application.h:82
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
i2c_application.h
i2c application libray header file
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
i2c_handle_type
Definition: i2c_application.h:114
i2c_handle_type::dma_rx_channel
dma_channel_type * dma_rx_channel
Definition: i2c_application.h:124
i2c_handle_type::i2cx
i2c_type * i2cx
Definition: i2c_application.h:115
i2c_handle_type::dma_init_struct
dma_init_type dma_init_struct
Definition: i2c_application.h:125
i2c_handle_type::dma_tx_channel
dma_channel_type * dma_tx_channel
Definition: i2c_application.h:123
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • i2c
  • communication_int
  • inc
project/at_start_f415/examples/i2c/communication_int/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • i2c
  • communication_int
  • inc
project/at_start_f415/examples/i2c/communication_int/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • i2c
  • communication_int
  • inc
project/at_start_f415/examples/i2c/communication_int/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • i2c
  • communication_int
  • src
project/at_start_f415/examples/i2c/communication_int/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/i2c/communication_int/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • i2c
  • communication_int
  • src
project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "i2c_application.h"
30
31extern i2c_handle_type hi2cx;
32
33#define I2Cx_EVT_IRQHandler I2C1_EVT_IRQHandler
34#define I2Cx_ERR_IRQHandler I2C1_ERR_IRQHandler
35
49void NMI_Handler(void)
50{
51}
52
58void HardFault_Handler(void)
59{
60 /* go to infinite loop when hard fault exception occurs */
61 while(1)
62 {
63 }
64}
65
71void MemManage_Handler(void)
72{
73 /* go to infinite loop when memory manage exception occurs */
74 while(1)
75 {
76 }
77}
78
84void BusFault_Handler(void)
85{
86 /* go to infinite loop when bus fault exception occurs */
87 while(1)
88 {
89 }
90}
91
97void UsageFault_Handler(void)
98{
99 /* go to infinite loop when usage fault exception occurs */
100 while(1)
101 {
102 }
103}
104
110void SVC_Handler(void)
111{
112}
113
119void DebugMon_Handler(void)
120{
121}
122
128void PendSV_Handler(void)
129{
130}
131
137void SysTick_Handler(void)
138{
139}
140
146void I2Cx_EVT_IRQHandler(void)
147{
148 i2c_evt_irq_handler(&hi2cx);
149}
150
156void I2Cx_ERR_IRQHandler(void)
157{
158 i2c_err_irq_handler(&hi2cx);
159}
160
hi2cx
i2c_handle_type hi2cx
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:71
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c:97
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c:58
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c:71
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c:110
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c:128
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c:49
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c:84
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c:137
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c:119
i2c_evt_irq_handler
void i2c_evt_irq_handler(i2c_handle_type *hi2c)
interrupt procession function.
Definition: i2c_application.c:2119
i2c_err_irq_handler
void i2c_err_irq_handler(i2c_handle_type *hi2c)
i2c error interrupt function.
Definition: i2c_application.c:2243
i2c_application.h
i2c application libray header file
I2Cx_EVT_IRQHandler
#define I2Cx_EVT_IRQHandler
Definition: project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c:33
I2Cx_ERR_IRQHandler
#define I2Cx_ERR_IRQHandler
Definition: project/at_start_f415/examples/i2c/communication_int/src/at32f415_int.c:34
i2c_handle_type
Definition: i2c_application.h:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • i2c
  • communication_int
  • src
project/at_start_f415/examples/i2c/communication_int/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "i2c_application.h"
30
39#define I2C_TIMEOUT 0xFFFFFFFF
40
41#define I2Cx_SPEED 100000
42#define I2Cx_ADDRESS 0xA0
43
44#define I2Cx_PORT I2C1
45#define I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
46
47#define I2Cx_SCL_PIN GPIO_PINS_6
48#define I2Cx_SCL_GPIO_PORT GPIOB
49#define I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
50
51#define I2Cx_SDA_PIN GPIO_PINS_7
52#define I2Cx_SDA_GPIO_PORT GPIOB
53#define I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
54
55#define I2Cx_EVT_IRQn I2C1_EVT_IRQn
56#define I2Cx_ERR_IRQn I2C1_ERR_IRQn
57
58#define BUF_SIZE 8
59#define MASTER_BOARD
60
61uint8_t tx_buf[BUF_SIZE] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
62uint8_t rx_buf[BUF_SIZE] = {0};
63
64 i2c_handle_type hi2cx;
65
66uint32_t buffer_compare(uint8_t* buffer1, uint8_t* buffer2, uint32_t len);
67void error_handler(uint32_t error_code);
68void i2c_lowlevel_init(i2c_handle_type* hi2c);
69
75void error_handler(uint32_t error_code)
76{
77 while(1)
78 {
79 at32_led_toggle(LED2);
80 delay_ms(500);
81 }
82}
83
91uint32_t buffer_compare(uint8_t* buffer1, uint8_t* buffer2, uint32_t len)
92{
93 uint32_t i;
94
95 for(i = 0; i < len; i++)
96 {
97 if(buffer1[i] != buffer2[i])
98 {
99 return 1;
100 }
101 }
102
103 return 0;
104}
105
111void i2c_lowlevel_init(i2c_handle_type* hi2c)
112{
113 gpio_init_type gpio_initstructure;
114
115 if(hi2c->i2cx == I2Cx_PORT)
116 {
117 /* i2c periph clock enable */
118 crm_periph_clock_enable(I2Cx_CLK, TRUE);
119 crm_periph_clock_enable(I2Cx_SCL_GPIO_CLK, TRUE);
120 crm_periph_clock_enable(I2Cx_SDA_GPIO_CLK, TRUE);
121
122 /* gpio configuration */
123 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_OPEN_DRAIN;
124 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
125 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
126 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
127
128 /* configure i2c pins: scl */
129 gpio_initstructure.gpio_pins = I2Cx_SCL_PIN;
130 gpio_init(I2Cx_SCL_GPIO_PORT, &gpio_initstructure);
131
132 /* configure i2c pins: sda */
133 gpio_initstructure.gpio_pins = I2Cx_SDA_PIN;
134 gpio_init(I2Cx_SDA_GPIO_PORT, &gpio_initstructure);
135
136 /* configure and enable i2c interrupt */
137 nvic_irq_enable(I2Cx_EVT_IRQn, 0, 0);
138 nvic_irq_enable(I2Cx_ERR_IRQn, 0, 0);
139
140 i2c_init(hi2c->i2cx, I2C_FSMODE_DUTY_2_1, I2Cx_SPEED);
141
142 i2c_own_address1_set(hi2c->i2cx, I2C_ADDRESS_MODE_7BIT, I2Cx_ADDRESS);
143 }
144}
145
151int main(void)
152{
153 i2c_status_type i2c_status;
154
155 /* config nvic priority group */
156 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
157
158 system_clock_config();
159
160 at32_board_init();
161
162 hi2cx.i2cx = I2Cx_PORT;
163
164 i2c_config(&hi2cx);
165
166 while(1)
167 {
168
169#if defined (MASTER_BOARD)
170
171 /* wait for key USER_BUTTON press before starting the communication */
172 while(at32_button_press() != USER_BUTTON)
173 {
174 }
175
176 /* start the request reception process */
177 if((i2c_status = i2c_master_transmit_int(&hi2cx, I2Cx_ADDRESS, tx_buf, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
178 {
179 error_handler(i2c_status);
180 }
181
182 /* wait for the communication to end */
183 if(i2c_wait_end(&hi2cx, I2C_TIMEOUT) != I2C_OK)
184 {
185 error_handler(i2c_status);
186 }
187
188 delay_ms(10);
189
190 /* start the request reception process */
191 if((i2c_status = i2c_master_receive_int(&hi2cx, I2Cx_ADDRESS, rx_buf, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
192 {
193 error_handler(i2c_status);
194 }
195
196 /* wait for the communication to end */
197 if(i2c_wait_end(&hi2cx, I2C_TIMEOUT) != I2C_OK)
198 {
199 error_handler(i2c_status);
200 }
201
202 if(buffer_compare(tx_buf, rx_buf, BUF_SIZE) == 0)
203 {
204 at32_led_on(LED3);
205 }
206 else
207 {
208 error_handler(i2c_status);
209 }
210
211#else
212
213 /* wait for key USER_BUTTON press before starting the communication */
214 while(at32_button_press() != USER_BUTTON)
215 {
216 }
217
218 /* start the transmission process */
219 if((i2c_status = i2c_slave_receive_int(&hi2cx, rx_buf, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
220 {
221 error_handler(i2c_status);
222 }
223
224 /* wait for the communication to end */
225 if(i2c_wait_end(&hi2cx, I2C_TIMEOUT) != I2C_OK)
226 {
227 error_handler(i2c_status);
228 }
229
230 if((i2c_status = i2c_slave_transmit_int(&hi2cx, tx_buf, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
231 {
232 error_handler(i2c_status);
233 }
234
235 /* wait for the communication to end */
236 if(i2c_wait_end(&hi2cx, I2C_TIMEOUT) != I2C_OK)
237 {
238 error_handler(i2c_status);
239 }
240
241 if(buffer_compare(tx_buf, rx_buf, BUF_SIZE) == 0)
242 {
243 at32_led_on(LED3);
244 }
245 else
246 {
247 error_handler(i2c_status);
248 }
249#endif
250
251 }
252}
253
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
rx_buf
uint8_t rx_buf[8]
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:62
tx_buf
uint8_t tx_buf[8]
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:61
I2Cx_ADDRESS
#define I2Cx_ADDRESS
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:42
I2Cx_CLK
#define I2Cx_CLK
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:45
BUF_SIZE
#define BUF_SIZE
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:58
I2Cx_SDA_PIN
#define I2Cx_SDA_PIN
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:51
main
int main(void)
main function.
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:151
I2Cx_SCL_PIN
#define I2Cx_SCL_PIN
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:47
hi2cx
i2c_handle_type hi2cx
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:64
I2Cx_SDA_GPIO_PORT
#define I2Cx_SDA_GPIO_PORT
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:52
buffer_compare
uint32_t buffer_compare(uint8_t *buffer1, uint8_t *buffer2, uint32_t len)
compare whether the valus of buffer 1 and buffer 2 are equal.
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:91
I2Cx_SDA_GPIO_CLK
#define I2Cx_SDA_GPIO_CLK
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:53
I2Cx_ERR_IRQn
#define I2Cx_ERR_IRQn
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:56
error_handler
void error_handler(uint32_t error_code)
error handler program
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:75
i2c_lowlevel_init
void i2c_lowlevel_init(i2c_handle_type *hi2c)
initializes peripherals used by the i2c.
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:111
I2Cx_SPEED
#define I2Cx_SPEED
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:41
I2Cx_PORT
#define I2Cx_PORT
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:44
I2Cx_SCL_GPIO_CLK
#define I2Cx_SCL_GPIO_CLK
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:49
I2Cx_EVT_IRQn
#define I2Cx_EVT_IRQn
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:55
I2Cx_SCL_GPIO_PORT
#define I2Cx_SCL_GPIO_PORT
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:48
I2C_TIMEOUT
#define I2C_TIMEOUT
Definition: project/at_start_f415/examples/i2c/communication_int/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
i2c_wait_end
i2c_status_type i2c_wait_end(i2c_handle_type *hi2c, uint32_t timeout)
wait for the transfer to end.
Definition: i2c_application.c:148
i2c_slave_transmit_int
i2c_status_type i2c_slave_transmit_int(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through interrupt mode.
Definition: i2c_application.c:976
i2c_master_receive_int
i2c_status_type i2c_master_receive_int(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through interrupt mode.
Definition: i2c_application.c:898
i2c_config
void i2c_config(i2c_handle_type *hi2c)
i2c peripheral initialization.
Definition: i2c_application.c:102
i2c_master_transmit_int
i2c_status_type i2c_master_transmit_int(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through interrupt mode.
Definition: i2c_application.c:803
i2c_slave_receive_int
i2c_status_type i2c_slave_receive_int(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through interrupt mode.
Definition: i2c_application.c:850
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_MODERATE
@ GPIO_DRIVE_STRENGTH_MODERATE
Definition: at32f415_gpio.h:240
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_OPEN_DRAIN
@ GPIO_OUTPUT_OPEN_DRAIN
Definition: at32f415_gpio.h:250
i2c_own_address1_set
void i2c_own_address1_set(i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address)
config own address1.
Definition: at32f415_i2c.c:185
i2c_init
void i2c_init(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed)
init i2c speed and duty cycle.
Definition: at32f415_i2c.c:90
I2C_FSMODE_DUTY_2_1
@ I2C_FSMODE_DUTY_2_1
Definition: at32f415_i2c.h:148
I2C_ADDRESS_MODE_7BIT
@ I2C_ADDRESS_MODE_7BIT
Definition: at32f415_i2c.h:157
i2c_status_type
i2c_status_type
Definition: i2c_application.h:81
I2C_OK
@ I2C_OK
Definition: i2c_application.h:82
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
i2c_application.h
i2c application libray header file
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
i2c_handle_type
Definition: i2c_application.h:114
i2c_handle_type::i2cx
i2c_type * i2cx
Definition: i2c_application.h:115
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • i2c
  • communication_poll
  • inc
project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • i2c
  • communication_poll
  • inc
project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • i2c
  • communication_poll
  • inc
project/at_start_f415/examples/i2c/communication_poll/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • i2c
  • communication_poll
  • src
project/at_start_f415/examples/i2c/communication_poll/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/i2c/communication_poll/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • i2c
  • communication_poll
  • src
project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/i2c/communication_poll/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • i2c
  • communication_poll
  • src
project/at_start_f415/examples/i2c/communication_poll/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "i2c_application.h"
30
39#define I2C_TIMEOUT 0xFFFFFFFF
40
41#define I2Cx_SPEED 100000
42#define I2Cx_ADDRESS 0xA0
43
44#define I2Cx_PORT I2C1
45#define I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
46
47#define I2Cx_SCL_PIN GPIO_PINS_6
48#define I2Cx_SCL_GPIO_PORT GPIOB
49#define I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
50
51#define I2Cx_SDA_PIN GPIO_PINS_7
52#define I2Cx_SDA_GPIO_PORT GPIOB
53#define I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
54
55#define BUF_SIZE 8
56#define MASTER_BOARD
57
58uint8_t tx_buf[BUF_SIZE] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
59uint8_t rx_buf[BUF_SIZE] = {0};
60
61 i2c_handle_type hi2cx;
62
63void error_handler(uint32_t error_code);
64uint32_t buffer_compare(uint8_t* buffer1, uint8_t* buffer2, uint32_t len);
65void i2c_lowlevel_init(i2c_handle_type* hi2c);
66
72void error_handler(uint32_t error_code)
73{
74 while(1)
75 {
76 at32_led_toggle(LED2);
77 delay_ms(500);
78 }
79}
80
88uint32_t buffer_compare(uint8_t* buffer1, uint8_t* buffer2, uint32_t len)
89{
90 uint32_t i;
91
92 for(i = 0; i < len; i++)
93 {
94 if(buffer1[i] != buffer2[i])
95 {
96 return 1;
97 }
98 }
99
100 return 0;
101}
102
108void i2c_lowlevel_init(i2c_handle_type* hi2c)
109{
110 gpio_init_type gpio_initstructure;
111
112 if(hi2c->i2cx == I2Cx_PORT)
113 {
114 /* i2c periph clock enable */
115 crm_periph_clock_enable(I2Cx_CLK, TRUE);
116 crm_periph_clock_enable(I2Cx_SCL_GPIO_CLK, TRUE);
117 crm_periph_clock_enable(I2Cx_SDA_GPIO_CLK, TRUE);
118
119 /* gpio configuration */
120 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_OPEN_DRAIN;
121 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
122 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
123 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
124
125 /* configure i2c pins: scl */
126 gpio_initstructure.gpio_pins = I2Cx_SCL_PIN;
127 gpio_init(I2Cx_SCL_GPIO_PORT, &gpio_initstructure);
128
129 /* configure i2c pins: sda */
130 gpio_initstructure.gpio_pins = I2Cx_SDA_PIN;
131 gpio_init(I2Cx_SDA_GPIO_PORT, &gpio_initstructure);
132
133 i2c_init(hi2c->i2cx, I2C_FSMODE_DUTY_2_1, I2Cx_SPEED);
134
135 i2c_own_address1_set(hi2c->i2cx, I2C_ADDRESS_MODE_7BIT, I2Cx_ADDRESS);
136 }
137}
138
144int main(void)
145{
146 i2c_status_type i2c_status;
147
148 system_clock_config();
149
150 at32_board_init();
151
152 hi2cx.i2cx = I2Cx_PORT;
153
154 i2c_config(&hi2cx);
155
156 while(1)
157 {
158
159#if defined (MASTER_BOARD)
160
161 /* wait for key USER_BUTTON press before starting the communication */
162 while(at32_button_press() != USER_BUTTON)
163 {
164 }
165
166 /* start the request reception process */
167 if((i2c_status = i2c_master_transmit(&hi2cx, I2Cx_ADDRESS, tx_buf, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
168 {
169 error_handler(i2c_status);
170 }
171
172 delay_ms(10);
173
174 /* start the request reception process */
175 if((i2c_status = i2c_master_receive(&hi2cx, I2Cx_ADDRESS, rx_buf, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
176 {
177 error_handler(i2c_status);
178 }
179
180 if(buffer_compare(tx_buf, rx_buf, BUF_SIZE) == 0)
181 {
182 at32_led_on(LED3);
183 }
184 else
185 {
186 error_handler(i2c_status);
187 }
188#else
189
190 /* wait for key USER_BUTTON press before starting the communication */
191 while(at32_button_press() != USER_BUTTON)
192 {
193 }
194
195 /* start the transmission process */
196 if((i2c_status = i2c_slave_receive(&hi2cx, rx_buf, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
197 {
198 error_handler(i2c_status);
199 }
200
201 if((i2c_status = i2c_slave_transmit(&hi2cx, tx_buf, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
202 {
203 error_handler(i2c_status);
204 }
205
206 if(buffer_compare(tx_buf, rx_buf, BUF_SIZE) == 0)
207 {
208 at32_led_on(LED3);
209 }
210 else
211 {
212 error_handler(i2c_status);
213 }
214#endif
215
216 }
217}
218
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
rx_buf
uint8_t rx_buf[8]
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:59
tx_buf
uint8_t tx_buf[8]
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:58
I2Cx_ADDRESS
#define I2Cx_ADDRESS
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:42
I2Cx_CLK
#define I2Cx_CLK
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:45
BUF_SIZE
#define BUF_SIZE
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:55
I2Cx_SDA_PIN
#define I2Cx_SDA_PIN
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:51
main
int main(void)
main function.
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:144
I2Cx_SCL_PIN
#define I2Cx_SCL_PIN
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:47
hi2cx
i2c_handle_type hi2cx
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:61
I2Cx_SDA_GPIO_PORT
#define I2Cx_SDA_GPIO_PORT
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:52
buffer_compare
uint32_t buffer_compare(uint8_t *buffer1, uint8_t *buffer2, uint32_t len)
compare whether the valus of buffer 1 and buffer 2 are equal.
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:88
I2Cx_SDA_GPIO_CLK
#define I2Cx_SDA_GPIO_CLK
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:53
error_handler
void error_handler(uint32_t error_code)
error handler program
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:72
i2c_lowlevel_init
void i2c_lowlevel_init(i2c_handle_type *hi2c)
initializes peripherals used by the i2c.
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:108
I2Cx_SPEED
#define I2Cx_SPEED
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:41
I2Cx_PORT
#define I2Cx_PORT
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:44
I2Cx_SCL_GPIO_CLK
#define I2Cx_SCL_GPIO_CLK
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:49
I2Cx_SCL_GPIO_PORT
#define I2Cx_SCL_GPIO_PORT
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:48
I2C_TIMEOUT
#define I2C_TIMEOUT
Definition: project/at_start_f415/examples/i2c/communication_poll/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
i2c_slave_receive
i2c_status_type i2c_slave_receive(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave receive data through polling mode.
Definition: i2c_application.c:470
i2c_config
void i2c_config(i2c_handle_type *hi2c)
i2c peripheral initialization.
Definition: i2c_application.c:102
i2c_master_receive
i2c_status_type i2c_master_receive(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master receive data through polling mode.
Definition: i2c_application.c:545
i2c_master_transmit
i2c_status_type i2c_master_transmit(i2c_handle_type *hi2c, uint16_t address, uint8_t *pdata, uint16_t size, uint32_t timeout)
the master transmits data through polling mode.
Definition: i2c_application.c:402
i2c_slave_transmit
i2c_status_type i2c_slave_transmit(i2c_handle_type *hi2c, uint8_t *pdata, uint16_t size, uint32_t timeout)
the slave transmits data through polling mode.
Definition: i2c_application.c:716
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_MODERATE
@ GPIO_DRIVE_STRENGTH_MODERATE
Definition: at32f415_gpio.h:240
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_OPEN_DRAIN
@ GPIO_OUTPUT_OPEN_DRAIN
Definition: at32f415_gpio.h:250
i2c_own_address1_set
void i2c_own_address1_set(i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address)
config own address1.
Definition: at32f415_i2c.c:185
i2c_init
void i2c_init(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed)
init i2c speed and duty cycle.
Definition: at32f415_i2c.c:90
I2C_FSMODE_DUTY_2_1
@ I2C_FSMODE_DUTY_2_1
Definition: at32f415_i2c.h:148
I2C_ADDRESS_MODE_7BIT
@ I2C_ADDRESS_MODE_7BIT
Definition: at32f415_i2c.h:157
i2c_status_type
i2c_status_type
Definition: i2c_application.h:81
I2C_OK
@ I2C_OK
Definition: i2c_application.h:82
i2c_application.h
i2c application libray header file
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
i2c_handle_type
Definition: i2c_application.h:114
i2c_handle_type::i2cx
i2c_type * i2cx
Definition: i2c_application.h:115
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • i2c
  • eeprom
  • inc
project/at_start_f415/examples/i2c/eeprom/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • i2c
  • eeprom
  • inc
project/at_start_f415/examples/i2c/eeprom/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • i2c
  • eeprom
  • inc
project/at_start_f415/examples/i2c/eeprom/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • i2c
  • eeprom
  • src
project/at_start_f415/examples/i2c/eeprom/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • i2c
  • eeprom
  • src
project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "i2c_application.h"
30
31extern i2c_handle_type hi2cx;
32
33#define I2Cx_DMA_TX_IRQHandler DMA1_Channel6_IRQHandler
34#define I2Cx_DMA_RX_IRQHandler DMA1_Channel7_IRQHandler
35#define I2Cx_EVT_IRQHandler I2C1_EVT_IRQHandler
36#define I2Cx_ERR_IRQHandler I2C1_ERR_IRQHandler
37
51void NMI_Handler(void)
52{
53}
54
60void HardFault_Handler(void)
61{
62 /* go to infinite loop when hard fault exception occurs */
63 while(1)
64 {
65 }
66}
67
73void MemManage_Handler(void)
74{
75 /* go to infinite loop when memory manage exception occurs */
76 while(1)
77 {
78 }
79}
80
86void BusFault_Handler(void)
87{
88 /* go to infinite loop when bus fault exception occurs */
89 while(1)
90 {
91 }
92}
93
99void UsageFault_Handler(void)
100{
101 /* go to infinite loop when usage fault exception occurs */
102 while(1)
103 {
104 }
105}
106
112void SVC_Handler(void)
113{
114}
115
121void DebugMon_Handler(void)
122{
123}
124
130void PendSV_Handler(void)
131{
132}
133
139void SysTick_Handler(void)
140{
141}
142
148void I2Cx_DMA_RX_IRQHandler(void)
149{
150 i2c_dma_rx_irq_handler(&hi2cx);
151}
152
158void I2Cx_DMA_TX_IRQHandler(void)
159{
160 i2c_dma_tx_irq_handler(&hi2cx);
161}
162
168void I2Cx_EVT_IRQHandler(void)
169{
170 i2c_evt_irq_handler(&hi2cx);
171}
172
178void I2Cx_ERR_IRQHandler(void)
179{
180 i2c_err_irq_handler(&hi2cx);
181}
182
hi2cx
i2c_handle_type hi2cx
Definition: project/at_start_f415/examples/i2c/communication_dma/src/main.c:71
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c:99
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c:60
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c:73
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c:112
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c:130
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c:51
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c:86
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c:139
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c:121
i2c_evt_irq_handler
void i2c_evt_irq_handler(i2c_handle_type *hi2c)
interrupt procession function.
Definition: i2c_application.c:2119
i2c_err_irq_handler
void i2c_err_irq_handler(i2c_handle_type *hi2c)
i2c error interrupt function.
Definition: i2c_application.c:2243
i2c_dma_rx_irq_handler
void i2c_dma_rx_irq_handler(i2c_handle_type *hi2c)
dma reveive complete interrupt function.
Definition: i2c_application.c:2194
i2c_dma_tx_irq_handler
void i2c_dma_tx_irq_handler(i2c_handle_type *hi2c)
dma transmission complete interrupt function.
Definition: i2c_application.c:2145
i2c_application.h
i2c application libray header file
I2Cx_EVT_IRQHandler
#define I2Cx_EVT_IRQHandler
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c:35
I2Cx_ERR_IRQHandler
#define I2Cx_ERR_IRQHandler
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c:36
I2Cx_DMA_TX_IRQHandler
#define I2Cx_DMA_TX_IRQHandler
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c:33
I2Cx_DMA_RX_IRQHandler
#define I2Cx_DMA_RX_IRQHandler
Definition: project/at_start_f415/examples/i2c/eeprom/src/at32f415_int.c:34
i2c_handle_type
Definition: i2c_application.h:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • i2c
  • eeprom
  • src
project/at_start_f415/examples/i2c/eeprom/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "i2c_application.h"
30
39#define I2C_TIMEOUT 0xFFFFFFFF
40
41#define I2Cx_SPEED 100000
42#define I2Cx_ADDRESS 0xA0
43
44#define I2Cx_PORT I2C1
45#define I2Cx_CLK CRM_I2C1_PERIPH_CLOCK
46
47#define I2Cx_SCL_PIN GPIO_PINS_6
48#define I2Cx_SCL_GPIO_PORT GPIOB
49#define I2Cx_SCL_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
50
51#define I2Cx_SDA_PIN GPIO_PINS_7
52#define I2Cx_SDA_GPIO_PORT GPIOB
53#define I2Cx_SDA_GPIO_CLK CRM_GPIOB_PERIPH_CLOCK
54
55#define I2Cx_DMA_CLK CRM_DMA1_PERIPH_CLOCK
56#define I2Cx_DMA_TX_CHANNEL DMA1_CHANNEL6
57#define I2Cx_DMA_TX_IRQn DMA1_Channel6_IRQn
58
59#define I2Cx_DMA_RX_CHANNEL DMA1_CHANNEL7
60#define I2Cx_DMA_RX_IRQn DMA1_Channel7_IRQn
61
62#define I2Cx_EVT_IRQn I2C1_EVT_IRQn
63#define I2Cx_ERR_IRQn I2C1_ERR_IRQn
64
65#define BUF_SIZE 8
66
67uint8_t tx_buf1[BUF_SIZE] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
68uint8_t tx_buf2[BUF_SIZE] = {0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x70, 0x80};
69uint8_t tx_buf3[BUF_SIZE] = {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88};
70uint8_t rx_buf1[BUF_SIZE] = {0};
71uint8_t rx_buf2[BUF_SIZE] = {0};
72uint8_t rx_buf3[BUF_SIZE] = {0};
73
74 i2c_handle_type hi2cx;
75
76void error_handler(uint32_t error_code);
77uint32_t buffer_compare(uint8_t* buffer1, uint8_t* buffer2, uint32_t len);
78void i2c_lowlevel_init(i2c_handle_type* hi2c);
79
85void error_handler(uint32_t error_code)
86{
87 while(1)
88 {
89 at32_led_toggle(LED2);
90 delay_ms(500);
91 }
92}
93
101uint32_t buffer_compare(uint8_t* buffer1, uint8_t* buffer2, uint32_t len)
102{
103 uint32_t i;
104
105 for(i = 0; i < len; i++)
106 {
107 if(buffer1[i] != buffer2[i])
108 {
109 return 1;
110 }
111 }
112
113 return 0;
114}
115
121void i2c_lowlevel_init(i2c_handle_type* hi2c)
122{
123 gpio_init_type gpio_initstructure;
124
125 if(hi2c->i2cx == I2Cx_PORT)
126 {
127 /* i2c periph clock enable */
128 crm_periph_clock_enable(I2Cx_CLK, TRUE);
129 crm_periph_clock_enable(I2Cx_SCL_GPIO_CLK, TRUE);
130 crm_periph_clock_enable(I2Cx_SDA_GPIO_CLK, TRUE);
131
132 /* gpio configuration */
133 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_OPEN_DRAIN;
134 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
135 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
136 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_MODERATE;
137
138 /* configure i2c pins: scl */
139 gpio_initstructure.gpio_pins = I2Cx_SCL_PIN;
140 gpio_init(I2Cx_SCL_GPIO_PORT, &gpio_initstructure);
141
142 /* configure i2c pins: sda */
143 gpio_initstructure.gpio_pins = I2Cx_SDA_PIN;
144 gpio_init(I2Cx_SDA_GPIO_PORT, &gpio_initstructure);
145
146 /* configure and enable i2c dma channel interrupt */
147 nvic_irq_enable(I2Cx_DMA_TX_IRQn, 0, 0);
148 nvic_irq_enable(I2Cx_DMA_RX_IRQn, 0, 0);
149
150 /* configure and enable i2c interrupt */
151 nvic_irq_enable(I2Cx_EVT_IRQn, 0, 0);
152 nvic_irq_enable(I2Cx_ERR_IRQn, 0, 0);
153
154 /* i2c dma tx and rx channels configuration */
155 /* enable the dma clock */
156 crm_periph_clock_enable(I2Cx_DMA_CLK, TRUE);
157
158 /* i2c dma channel configuration */
159 dma_reset(hi2c->dma_tx_channel);
160 dma_reset(hi2c->dma_rx_channel);
161
162 hi2c->dma_tx_channel = I2Cx_DMA_TX_CHANNEL;
163 hi2c->dma_rx_channel = I2Cx_DMA_RX_CHANNEL;
164
165 dma_default_para_init(&hi2c->dma_init_struct);
166 hi2c->dma_init_struct.peripheral_inc_enable = FALSE;
167 hi2c->dma_init_struct.memory_inc_enable = TRUE;
168 hi2c->dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
169 hi2c->dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
170 hi2c->dma_init_struct.loop_mode_enable = FALSE;
171 hi2c->dma_init_struct.priority = DMA_PRIORITY_LOW;
172 hi2c->dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
173
174 dma_init(hi2c->dma_tx_channel, &hi2c->dma_init_struct);
175 dma_init(hi2c->dma_rx_channel, &hi2c->dma_init_struct);
176
177 i2c_init(hi2c->i2cx, I2C_FSMODE_DUTY_2_1, I2Cx_SPEED);
178
179 i2c_own_address1_set(hi2c->i2cx, I2C_ADDRESS_MODE_7BIT, I2Cx_ADDRESS);
180 }
181}
182
188int main(void)
189{
190 i2c_status_type i2c_status;
191
192 /* config nvic priority group */
193 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
194
195 system_clock_config();
196
197 at32_board_init();
198
199 hi2cx.i2cx = I2Cx_PORT;
200
201 i2c_config(&hi2cx);
202
203 while(1)
204 {
205 /* wait for key USER_BUTTON press before starting the communication */
206 while(at32_button_press() != USER_BUTTON)
207 {
208 }
209
210 /* write data to memory device */
211 if((i2c_status = i2c_memory_write(&hi2cx, I2Cx_ADDRESS, 0, tx_buf1, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
212 {
213 error_handler(i2c_status);
214 }
215
216 delay_ms(5);
217
218 /* read data from memory device */
219 if((i2c_status = i2c_memory_read(&hi2cx, I2Cx_ADDRESS, 0, rx_buf1, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
220 {
221 error_handler(i2c_status);
222 }
223
224 /* write data to memory device */
225 if((i2c_status = i2c_memory_write_int(&hi2cx, I2Cx_ADDRESS, 0, tx_buf2, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
226 {
227 error_handler(i2c_status);
228 }
229
230 /* wait for the communication to end */
231 if(i2c_wait_end(&hi2cx, I2C_TIMEOUT) != I2C_OK)
232 {
233 error_handler(i2c_status);
234 }
235
236 delay_ms(5);
237
238 /* read data from memory device */
239 if((i2c_status = i2c_memory_read_int(&hi2cx, I2Cx_ADDRESS, 0, rx_buf2, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
240 {
241 error_handler(i2c_status);
242 }
243
244 /* wait for the communication to end */
245 if(i2c_wait_end(&hi2cx, I2C_TIMEOUT) != I2C_OK)
246 {
247 error_handler(i2c_status);
248 }
249
250 /* write data to memory device */
251 if((i2c_status = i2c_memory_write_dma(&hi2cx, I2Cx_ADDRESS, 0, tx_buf3, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
252 {
253 error_handler(i2c_status);
254 }
255
256 /* wait for the communication to end */
257 if(i2c_wait_end(&hi2cx, I2C_TIMEOUT) != I2C_OK)
258 {
259 error_handler(i2c_status);
260 }
261
262 delay_ms(5);
263
264 /* read data from memory device */
265 if((i2c_status = i2c_memory_read_dma(&hi2cx, I2Cx_ADDRESS, 0, rx_buf3, BUF_SIZE, I2C_TIMEOUT)) != I2C_OK)
266 {
267 error_handler(i2c_status);
268 }
269
270 /* wait for the communication to end */
271 if(i2c_wait_end(&hi2cx, I2C_TIMEOUT) != I2C_OK)
272 {
273 error_handler(i2c_status);
274 }
275
276 if((buffer_compare(tx_buf1, rx_buf1, BUF_SIZE) == 0) &&
277 (buffer_compare(tx_buf2, rx_buf2, BUF_SIZE) == 0) &&
278 (buffer_compare(tx_buf3, rx_buf3, BUF_SIZE) == 0))
279 {
280 at32_led_on(LED3);
281 }
282 else
283 {
284 error_handler(i2c_status);
285 }
286
287 }
288}
289
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
I2Cx_ADDRESS
#define I2Cx_ADDRESS
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:42
I2Cx_DMA_RX_IRQn
#define I2Cx_DMA_RX_IRQn
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:60
I2Cx_CLK
#define I2Cx_CLK
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:45
tx_buf3
uint8_t tx_buf3[8]
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:69
I2Cx_DMA_TX_CHANNEL
#define I2Cx_DMA_TX_CHANNEL
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:56
BUF_SIZE
#define BUF_SIZE
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:65
rx_buf1
uint8_t rx_buf1[8]
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:70
I2Cx_SDA_PIN
#define I2Cx_SDA_PIN
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:51
main
int main(void)
main function.
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:188
I2Cx_SCL_PIN
#define I2Cx_SCL_PIN
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:47
hi2cx
i2c_handle_type hi2cx
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:74
I2Cx_SDA_GPIO_PORT
#define I2Cx_SDA_GPIO_PORT
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:52
buffer_compare
uint32_t buffer_compare(uint8_t *buffer1, uint8_t *buffer2, uint32_t len)
compare whether the valus of buffer 1 and buffer 2 are equal.
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:101
I2Cx_DMA_CLK
#define I2Cx_DMA_CLK
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:55
I2Cx_SDA_GPIO_CLK
#define I2Cx_SDA_GPIO_CLK
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:53
rx_buf2
uint8_t rx_buf2[8]
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:71
I2Cx_ERR_IRQn
#define I2Cx_ERR_IRQn
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:63
error_handler
void error_handler(uint32_t error_code)
error handler program
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:85
i2c_lowlevel_init
void i2c_lowlevel_init(i2c_handle_type *hi2c)
initializes peripherals used by the i2c.
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:121
I2Cx_SPEED
#define I2Cx_SPEED
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:41
I2Cx_PORT
#define I2Cx_PORT
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:44
rx_buf3
uint8_t rx_buf3[8]
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:72
tx_buf2
uint8_t tx_buf2[8]
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:68
I2Cx_SCL_GPIO_CLK
#define I2Cx_SCL_GPIO_CLK
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:49
I2Cx_DMA_RX_CHANNEL
#define I2Cx_DMA_RX_CHANNEL
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:59
I2Cx_DMA_TX_IRQn
#define I2Cx_DMA_TX_IRQn
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:57
tx_buf1
uint8_t tx_buf1[8]
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:67
I2Cx_EVT_IRQn
#define I2Cx_EVT_IRQn
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:62
I2Cx_SCL_GPIO_PORT
#define I2Cx_SCL_GPIO_PORT
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:48
I2C_TIMEOUT
#define I2C_TIMEOUT
Definition: project/at_start_f415/examples/i2c/eeprom/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
i2c_memory_write_dma
i2c_status_type i2c_memory_write_dma(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through dma mode.
Definition: i2c_application.c:1767
i2c_wait_end
i2c_status_type i2c_wait_end(i2c_handle_type *hi2c, uint32_t timeout)
wait for the transfer to end.
Definition: i2c_application.c:148
i2c_memory_read_dma
i2c_status_type i2c_memory_read_dma(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode.
Definition: i2c_application.c:1843
i2c_memory_write
i2c_status_type i2c_memory_write(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through polling mode.
Definition: i2c_application.c:1299
i2c_memory_read
i2c_status_type i2c_memory_read(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through polling mode.
Definition: i2c_application.c:1381
i2c_config
void i2c_config(i2c_handle_type *hi2c)
i2c peripheral initialization.
Definition: i2c_application.c:102
i2c_memory_read_int
i2c_status_type i2c_memory_read_int(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
read data from memory device through interrupt mode.
Definition: i2c_application.c:1657
i2c_memory_write_int
i2c_status_type i2c_memory_write_int(i2c_handle_type *hi2c, uint16_t address, uint16_t memaddress, uint8_t *pdata, uint16_t size, uint32_t timeout)
write data to the memory device through interrupt mode.
Definition: i2c_application.c:1587
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_BYTE
@ DMA_PERIPHERAL_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:238
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_MEMORY_DATA_WIDTH_BYTE
@ DMA_MEMORY_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:248
DMA_PRIORITY_LOW
@ DMA_PRIORITY_LOW
Definition: at32f415_dma.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_MODERATE
@ GPIO_DRIVE_STRENGTH_MODERATE
Definition: at32f415_gpio.h:240
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_OPEN_DRAIN
@ GPIO_OUTPUT_OPEN_DRAIN
Definition: at32f415_gpio.h:250
i2c_own_address1_set
void i2c_own_address1_set(i2c_type *i2c_x, i2c_address_mode_type mode, uint16_t address)
config own address1.
Definition: at32f415_i2c.c:185
i2c_init
void i2c_init(i2c_type *i2c_x, i2c_fsmode_duty_cycle_type duty, uint32_t speed)
init i2c speed and duty cycle.
Definition: at32f415_i2c.c:90
I2C_FSMODE_DUTY_2_1
@ I2C_FSMODE_DUTY_2_1
Definition: at32f415_i2c.h:148
I2C_ADDRESS_MODE_7BIT
@ I2C_ADDRESS_MODE_7BIT
Definition: at32f415_i2c.h:157
i2c_status_type
i2c_status_type
Definition: i2c_application.h:81
I2C_OK
@ I2C_OK
Definition: i2c_application.h:82
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
i2c_application.h
i2c application libray header file
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
i2c_handle_type
Definition: i2c_application.h:114
i2c_handle_type::dma_rx_channel
dma_channel_type * dma_rx_channel
Definition: i2c_application.h:124
i2c_handle_type::i2cx
i2c_type * i2cx
Definition: i2c_application.h:115
i2c_handle_type::dma_init_struct
dma_init_type dma_init_struct
Definition: i2c_application.h:125
i2c_handle_type::dma_tx_channel
dma_channel_type * dma_tx_channel
Definition: i2c_application.h:123
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • i2s
  • halfduplex_dma
  • inc
project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • i2s
  • halfduplex_dma
  • inc
project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • i2s
  • halfduplex_dma
  • inc
project/at_start_f415/examples/i2s/halfduplex_dma/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • i2s
  • halfduplex_dma
  • src
project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • i2s
  • halfduplex_dma
  • src
project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • i2s
  • halfduplex_dma
  • src
project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include <stdio.h>
30
31
40uint16_t i2s1_buffer_tx[32] = {0x0102, 0x0304, 0x0506, 0x0708, 0x090A, 0x0B0C,
41 0x0D0E, 0x0F10, 0x1112, 0x1314, 0x1516, 0x1718,
42 0x191A, 0x1B1C, 0x1D1E, 0x1F20, 0x2122, 0x2324,
43 0x2526, 0x2728, 0x292A, 0x2B2C, 0x2D2E, 0x2F30,
44 0x3132, 0x3334, 0x3536, 0x3738, 0x393A, 0x3B3C,
45 0x3D3E, 0x3F40};
46uint16_t i2s2_buffer_rx[32];
47volatile error_status transfer_status = ERROR;
48
49static void gpio_config(void);
50static void i2s_config(void);
51 error_status buffer_compare(uint16_t* pbuffer1, uint16_t* pbuffer2, uint16_t buffer_length);
52
58 error_status buffer_compare(uint16_t* pbuffer1, uint16_t* pbuffer2, uint16_t buffer_length)
59{
60 while(buffer_length--)
61 {
62 if(*pbuffer1 != *pbuffer2)
63 {
64 return ERROR;
65 }
66
67 pbuffer1++;
68 pbuffer2++;
69 }
70 return SUCCESS;
71}
72
78static void i2s_config(void)
79{
80 dma_init_type dma_init_struct;
81 i2s_init_type i2s_init_struct;
82
83 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
84 dma_reset(DMA1_CHANNEL4);
85 dma_reset(DMA1_CHANNEL3);
86 dma_default_para_init(&dma_init_struct);
87 dma_init_struct.buffer_size = 32;
88 dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
89 dma_init_struct.memory_base_addr = (uint32_t)i2s1_buffer_tx;
90 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
91 dma_init_struct.memory_inc_enable = TRUE;
92 dma_init_struct.peripheral_base_addr = (uint32_t)0x4001300C;
93 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
94 dma_init_struct.peripheral_inc_enable = FALSE;
95 dma_init_struct.priority = DMA_PRIORITY_HIGH;
96 dma_init_struct.loop_mode_enable = FALSE;
97 dma_init(DMA1_CHANNEL3, &dma_init_struct);
98
99 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
100 dma_init_struct.memory_base_addr = (uint32_t)i2s2_buffer_rx;
101 dma_init_struct.peripheral_base_addr = (uint32_t)0x4000380C;
102 dma_init(DMA1_CHANNEL4, &dma_init_struct);
103
104 crm_periph_clock_enable(CRM_SPI1_PERIPH_CLOCK, TRUE);
105 crm_periph_clock_enable(CRM_SPI2_PERIPH_CLOCK, TRUE);
106 i2s_default_para_init(&i2s_init_struct);
107 i2s_init_struct.audio_protocol = I2S_AUDIO_PROTOCOL_PHILLIPS;
108 i2s_init_struct.data_channel_format = I2S_DATA_16BIT_CHANNEL_32BIT;
109 i2s_init_struct.mclk_output_enable = TRUE;
110 i2s_init_struct.audio_sampling_freq = I2S_AUDIO_FREQUENCY_48K;
111 i2s_init_struct.clock_polarity = I2S_CLOCK_POLARITY_LOW;
112 i2s_init_struct.operation_mode = I2S_MODE_MASTER_TX;
113 i2s_init(SPI1, &i2s_init_struct);
114
115 i2s_init_struct.operation_mode =I2S_MODE_SLAVE_RX;
116 i2s_init(SPI2, &i2s_init_struct);
117
118 dma_channel_enable(DMA1_CHANNEL3, TRUE);
119 dma_channel_enable(DMA1_CHANNEL4, TRUE);
120 spi_i2s_dma_receiver_enable(SPI2, TRUE);
121 i2s_enable(SPI1, TRUE);
122 i2s_enable(SPI2, TRUE);
123}
124
130static void gpio_config(void)
131{
132 gpio_init_type gpio_initstructure;
133 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
134 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
135
136 /* master ws pin */
137 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
138 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
139 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
140 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
141 gpio_initstructure.gpio_pins = GPIO_PINS_4;
142 gpio_init(GPIOA, &gpio_initstructure);
143
144 /* master ck pin */
145 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
146 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
147 gpio_initstructure.gpio_pins = GPIO_PINS_5;
148 gpio_init(GPIOA, &gpio_initstructure);
149
150 /* master sd pin */
151 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
152 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
153 gpio_initstructure.gpio_pins = GPIO_PINS_7;
154 gpio_init(GPIOA, &gpio_initstructure);
155
156 /* master mck pin */
157 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
158 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
159 gpio_initstructure.gpio_pins = GPIO_PINS_0;
160 gpio_init(GPIOB, &gpio_initstructure);
161
162 /* slave ws pin */
163 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
164 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
165 gpio_initstructure.gpio_pins = GPIO_PINS_12;
166 gpio_init(GPIOB, &gpio_initstructure);
167
168 /* slave ck pin */
169 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
170 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
171 gpio_initstructure.gpio_pins = GPIO_PINS_13;
172 gpio_init(GPIOB, &gpio_initstructure);
173
174 /* slave sd pin */
175 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
176 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
177 gpio_initstructure.gpio_pins = GPIO_PINS_15;
178 gpio_init(GPIOB, &gpio_initstructure);
179}
180
186int main(void)
187{
188 system_clock_config();
189 at32_board_init();
190 at32_led_off(LED2);
191 at32_led_off(LED3);
192 at32_led_off(LED4);
193 gpio_config();
194 i2s_config();
195 spi_i2s_dma_transmitter_enable(SPI1, TRUE);
196
197 while(dma_flag_get(DMA1_FDT4_FLAG) == RESET);
198
199 /* test result:the data check */
200 transfer_status = buffer_compare(i2s2_buffer_rx, i2s1_buffer_tx, 32);
201
202 /* test result indicate:if passed ,led2 lights */
203 if(transfer_status==SUCCESS)
204 {
205 at32_led_on(LED2);
206 }
207 else
208 {
209 at32_led_off(LED2);
210 }
211 while(1)
212 {
213 }
214}
215
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
buffer_compare
error_status buffer_compare(uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer_compare function.
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c:58
i2s_config
static void i2s_config(void)
i2s configuration.
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c:78
i2s1_buffer_tx
uint16_t i2s1_buffer_tx[32]
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c:40
main
int main(void)
main function.
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c:186
gpio_config
static void gpio_config(void)
gpio configuration.
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c:130
transfer_status
volatile error_status transfer_status
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c:47
i2s2_buffer_rx
uint16_t i2s2_buffer_rx[32]
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c:46
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_SPI2_PERIPH_CLOCK
@ CRM_SPI2_PERIPH_CLOCK
Definition: at32f415_crm.h:129
CRM_SPI1_PERIPH_CLOCK
@ CRM_SPI1_PERIPH_CLOCK
Definition: at32f415_crm.h:117
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_HIGH
@ DMA_PRIORITY_HIGH
Definition: at32f415_dma.h:260
DMA1_FDT4_FLAG
#define DMA1_FDT4_FLAG
Definition: at32f415_dma.h:94
DMA1_CHANNEL3
#define DMA1_CHANNEL3
Definition: at32f415_dma.h:475
DMA1_CHANNEL4
#define DMA1_CHANNEL4
Definition: at32f415_dma.h:476
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_12
#define GPIO_PINS_12
Definition: at32f415_gpio.h:63
GPIO_PINS_4
#define GPIO_PINS_4
Definition: at32f415_gpio.h:55
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
i2s_init
void i2s_init(spi_type *spi_x, i2s_init_type *i2s_init_struct)
i2s init config with its setting value.
Definition: at32f415_spi.c:316
spi_i2s_dma_receiver_enable
void spi_i2s_dma_receiver_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma receiver mode.
Definition: at32f415_spi.c:499
i2s_enable
void i2s_enable(spi_type *spi_x, confirm_state new_state)
enable or disable i2s.
Definition: at32f415_spi.c:445
i2s_default_para_init
void i2s_default_para_init(i2s_init_type *i2s_init_struct)
i2s init config with its default value.
Definition: at32f415_spi.c:298
spi_i2s_dma_transmitter_enable
void spi_i2s_dma_transmitter_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma transmitter mode.
Definition: at32f415_spi.c:485
I2S_CLOCK_POLARITY_LOW
@ I2S_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:249
I2S_DATA_16BIT_CHANNEL_32BIT
@ I2S_DATA_16BIT_CHANNEL_32BIT
Definition: at32f415_spi.h:228
I2S_AUDIO_FREQUENCY_48K
@ I2S_AUDIO_FREQUENCY_48K
Definition: at32f415_spi.h:217
I2S_AUDIO_PROTOCOL_PHILLIPS
@ I2S_AUDIO_PROTOCOL_PHILLIPS
Definition: at32f415_spi.h:198
I2S_MODE_MASTER_TX
@ I2S_MODE_MASTER_TX
Definition: at32f415_spi.h:240
I2S_MODE_SLAVE_RX
@ I2S_MODE_SLAVE_RX
Definition: at32f415_spi.h:239
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
i2s_init_type
i2s init type
Definition: at32f415_spi.h:272
i2s_init_type::audio_sampling_freq
i2s_audio_sampling_freq_type audio_sampling_freq
Definition: at32f415_spi.h:275
i2s_init_type::data_channel_format
i2s_data_channel_format_type data_channel_format
Definition: at32f415_spi.h:276
i2s_init_type::mclk_output_enable
confirm_state mclk_output_enable
Definition: at32f415_spi.h:278
i2s_init_type::audio_protocol
i2s_audio_protocol_type audio_protocol
Definition: at32f415_spi.h:274
i2s_init_type::operation_mode
i2s_operation_mode_type operation_mode
Definition: at32f415_spi.h:273
i2s_init_type::clock_polarity
i2s_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:277
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • i2s
  • halfduplex_interrupt
  • inc
project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • i2s
  • halfduplex_interrupt
  • inc
project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • i2s
  • halfduplex_interrupt
  • inc
project/at_start_f415/examples/i2s/halfduplex_interrupt/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • i2s
  • halfduplex_interrupt
  • src
project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • i2s
  • halfduplex_interrupt
  • src
project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31extern uint16_t i2s1_buffer_tx[];
32extern uint16_t i2s2_buffer_rx[];
33extern __IO uint32_t tx_index, rx_index;
34
48void NMI_Handler(void)
49{
50}
51
57void HardFault_Handler(void)
58{
59 /* go to infinite loop when hard fault exception occurs */
60 while(1)
61 {
62 }
63}
64
70void MemManage_Handler(void)
71{
72 /* go to infinite loop when memory manage exception occurs */
73 while(1)
74 {
75 }
76}
77
83void BusFault_Handler(void)
84{
85 /* go to infinite loop when bus fault exception occurs */
86 while(1)
87 {
88 }
89}
90
96void UsageFault_Handler(void)
97{
98 /* go to infinite loop when usage fault exception occurs */
99 while(1)
100 {
101 }
102}
103
109void SVC_Handler(void)
110{
111}
112
118void DebugMon_Handler(void)
119{
120}
121
127void PendSV_Handler(void)
128{
129}
130
136void SysTick_Handler(void)
137{
138}
139
140
146 void SPI2_IRQHandler(void)
147{
148 if(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) != RESET)
149 {
150 i2s2_buffer_rx[rx_index++] = spi_i2s_data_receive(SPI2);
151 }
152}
153
159void SPI1_IRQHandler(void)
160{
161 if(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) != RESET)
162 {
163 spi_i2s_data_transmit(SPI1, i2s1_buffer_tx[tx_index++]);
164 if(tx_index == 32)
165 {
166 spi_i2s_interrupt_enable(SPI1, SPI_I2S_TDBE_INT, FALSE);
167 }
168 }
169}
170
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
i2s1_buffer_tx
uint16_t i2s1_buffer_tx[]
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c:40
i2s2_buffer_rx
uint16_t i2s2_buffer_rx[]
Definition: project/at_start_f415/examples/i2s/halfduplex_dma/src/main.c:46
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:96
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:57
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:70
tx_index
__IO uint32_t tx_index
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:46
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:109
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:127
SPI2_IRQHandler
void SPI2_IRQHandler(void)
This function handles the spi2 interrupt request.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:146
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:48
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:83
SPI1_IRQHandler
void SPI1_IRQHandler(void)
This function handles the spi1 interrupt request.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:159
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:136
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:118
FALSE
@ FALSE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SPI_I2S_TDBE_FLAG
#define SPI_I2S_TDBE_FLAG
Definition: at32f415_spi.h:54
SPI_I2S_RDBF_FLAG
#define SPI_I2S_RDBF_FLAG
Definition: at32f415_spi.h:53
SPI_I2S_TDBE_INT
#define SPI_I2S_TDBE_INT
Definition: at32f415_spi.h:74
spi_i2s_interrupt_enable
void spi_i2s_interrupt_enable(spi_type *spi_x, uint32_t spi_i2s_int, confirm_state new_state)
enable or disable the specified spi/i2s interrupts.
Definition: at32f415_spi.c:464
spi_i2s_data_transmit
void spi_i2s_data_transmit(spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit
Definition: at32f415_spi.c:514
spi_i2s_flag_get
flag_status spi_i2s_flag_get(spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:548
spi_i2s_data_receive
uint16_t spi_i2s_data_receive(spi_type *spi_x)
spi/i2s data receive
Definition: at32f415_spi.c:526
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
rx_index
__IO uint32_t rx_index
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:33
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • i2s
  • halfduplex_interrupt
  • src
project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include <stdio.h>
30
39uint16_t i2s1_buffer_tx[32] = {0x0102, 0x0304, 0x0506, 0x0708, 0x090A, 0x0B0C,
40 0x0D0E, 0x0F10, 0x1112, 0x1314, 0x1516, 0x1718,
41 0x191A, 0x1B1C, 0x1D1E, 0x1F20, 0x2122, 0x2324,
42 0x2526, 0x2728, 0x292A, 0x2B2C, 0x2D2E, 0x2F30,
43 0x3132, 0x3334, 0x3536, 0x3738, 0x393A, 0x3B3C,
44 0x3D3E, 0x3F40};
45uint16_t i2s2_buffer_rx[32];
46__IO uint32_t tx_index = 0, rx_index = 0;
47volatile error_status transfer_status1 = ERROR, transfer_status2 = ERROR;
48
49static void gpio_config(void);
50static void i2s_config(i2s_data_channel_format_type format, i2s_audio_sampling_freq_type freq);
51 error_status buffer_compare(uint16_t* pbuffer1, uint16_t* pbuffer2, uint16_t buffer_length);
52 error_status buffer_compare_24bits(uint16_t* pbuffer1, uint16_t* pbuffer2, uint16_t buffer_length);
53
59 error_status buffer_compare(uint16_t* pbuffer1, uint16_t* pbuffer2, uint16_t buffer_length)
60{
61 while(buffer_length--)
62 {
63 if(*pbuffer1 != *pbuffer2)
64 {
65 return ERROR;
66 }
67
68 pbuffer1++;
69 pbuffer2++;
70 }
71 return SUCCESS;
72}
73
79 error_status buffer_compare_24bits(uint16_t* pbuffer1, uint16_t* pbuffer2, uint16_t buffer_length)
80{
81 while(buffer_length--)
82 {
83 if(*pbuffer1 != *pbuffer2)
84 {
85 if(*pbuffer1 != (*pbuffer2 & 0xFF00))
86 {
87 return ERROR;
88 }
89 }
90
91 pbuffer1++;
92 pbuffer2++;
93 }
94 return SUCCESS;
95}
96
102static void i2s_config(i2s_data_channel_format_type format, i2s_audio_sampling_freq_type freq)
103{
104 i2s_init_type i2s_init_struct;
105
106 crm_periph_clock_enable(CRM_SPI1_PERIPH_CLOCK, TRUE);
107 crm_periph_clock_enable(CRM_SPI2_PERIPH_CLOCK, TRUE);
108
109 nvic_irq_enable(SPI1_IRQn, 0, 0);
110 nvic_irq_enable(SPI2_IRQn, 0, 0);
111 spi_i2s_reset(SPI2);
112 spi_i2s_reset(SPI1);
113 i2s_default_para_init(&i2s_init_struct);
114 i2s_init_struct.audio_protocol = I2S_AUDIO_PROTOCOL_PHILLIPS;
115 i2s_init_struct.data_channel_format = format;
116 i2s_init_struct.mclk_output_enable = TRUE;
117 i2s_init_struct.audio_sampling_freq = freq;
118 i2s_init_struct.clock_polarity = I2S_CLOCK_POLARITY_LOW;
119 i2s_init_struct.operation_mode = I2S_MODE_MASTER_TX;
120 i2s_init(SPI1, &i2s_init_struct);
121
122 i2s_init_struct.operation_mode =I2S_MODE_SLAVE_RX;
123 i2s_init(SPI2, &i2s_init_struct);
124
125 spi_i2s_interrupt_enable(SPI2, SPI_I2S_RDBF_INT, TRUE);
126 spi_i2s_interrupt_enable(SPI1, SPI_I2S_TDBE_INT, TRUE);
127 i2s_enable(SPI2, TRUE);
128 i2s_enable(SPI1, TRUE);
129}
130
136static void gpio_config(void)
137{
138 gpio_init_type gpio_initstructure;
139 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
140 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
141
142 /* master ws pin */
143 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
144 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
145 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
146 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
147 gpio_initstructure.gpio_pins = GPIO_PINS_4;
148 gpio_init(GPIOA, &gpio_initstructure);
149
150 /* master ck pin */
151 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
152 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
153 gpio_initstructure.gpio_pins = GPIO_PINS_5;
154 gpio_init(GPIOA, &gpio_initstructure);
155
156 /* master sd pin */
157 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
158 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
159 gpio_initstructure.gpio_pins = GPIO_PINS_7;
160 gpio_init(GPIOA, &gpio_initstructure);
161
162 /* master mck pin */
163 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
164 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
165 gpio_initstructure.gpio_pins = GPIO_PINS_0;
166 gpio_init(GPIOB, &gpio_initstructure);
167
168 /* slave ws pin */
169 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
170 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
171 gpio_initstructure.gpio_pins = GPIO_PINS_12;
172 gpio_init(GPIOB, &gpio_initstructure);
173
174 /* slave ck pin */
175 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
176 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
177 gpio_initstructure.gpio_pins = GPIO_PINS_13;
178 gpio_init(GPIOB, &gpio_initstructure);
179
180 /* slave sd pin */
181 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
182 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
183 gpio_initstructure.gpio_pins = GPIO_PINS_15;
184 gpio_init(GPIOB, &gpio_initstructure);
185}
186
192int main(void)
193{
194 __IO uint32_t index = 0;
195 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
196 system_clock_config();
197 at32_board_init();
198 at32_led_off(LED2);
199 at32_led_off(LED3);
200 at32_led_off(LED4);
201 gpio_config();
202 i2s_config(I2S_DATA_16BIT_CHANNEL_32BIT, I2S_AUDIO_FREQUENCY_48K);
203 while(rx_index < 32);
204
205 /* test result:the data check */
206 transfer_status1 = buffer_compare(i2s2_buffer_rx, i2s1_buffer_tx, 32);
207
208 for(index = 0; index < 32; index++) i2s2_buffer_rx[index] = 0;
209 tx_index = 0;
210 rx_index = 0;
211
212 i2s_config(I2S_DATA_24BIT_CHANNEL_32BIT, I2S_AUDIO_FREQUENCY_16K);
213 while(rx_index < 32);
214
215 /* test result:the data check */
216 transfer_status2 = buffer_compare_24bits(i2s2_buffer_rx, i2s1_buffer_tx, 32);
217
218 /* test result indicate:if passed ,led2 lights */
219 if((transfer_status1 == SUCCESS) && (transfer_status2 == SUCCESS))
220 {
221 at32_led_on(LED2);
222 }
223 else
224 {
225 at32_led_off(LED2);
226 }
227
228 while(1)
229 {
230 }
231}
232
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
buffer_compare
error_status buffer_compare(uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer_compare function.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:59
tx_index
__IO uint32_t tx_index
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:46
transfer_status1
volatile error_status transfer_status1
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:47
i2s1_buffer_tx
uint16_t i2s1_buffer_tx[32]
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:39
i2s_config
static void i2s_config(i2s_data_channel_format_type format, i2s_audio_sampling_freq_type freq)
i2s configuration.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:102
transfer_status2
volatile error_status transfer_status2
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:47
main
int main(void)
main function.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:192
gpio_config
static void gpio_config(void)
gpio configuration.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:136
buffer_compare_24bits
error_status buffer_compare_24bits(uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer_compare_24bits function.
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:79
rx_index
__IO uint32_t rx_index
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:46
i2s2_buffer_rx
uint16_t i2s2_buffer_rx[32]
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:45
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_SPI2_PERIPH_CLOCK
@ CRM_SPI2_PERIPH_CLOCK
Definition: at32f415_crm.h:129
CRM_SPI1_PERIPH_CLOCK
@ CRM_SPI1_PERIPH_CLOCK
Definition: at32f415_crm.h:117
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
SPI2_IRQn
@ SPI2_IRQn
Definition: at32f415.h:172
SPI1_IRQn
@ SPI1_IRQn
Definition: at32f415.h:171
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_12
#define GPIO_PINS_12
Definition: at32f415_gpio.h:63
GPIO_PINS_4
#define GPIO_PINS_4
Definition: at32f415_gpio.h:55
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
SPI_I2S_TDBE_INT
#define SPI_I2S_TDBE_INT
Definition: at32f415_spi.h:74
SPI_I2S_RDBF_INT
#define SPI_I2S_RDBF_INT
Definition: at32f415_spi.h:73
spi_i2s_interrupt_enable
void spi_i2s_interrupt_enable(spi_type *spi_x, uint32_t spi_i2s_int, confirm_state new_state)
enable or disable the specified spi/i2s interrupts.
Definition: at32f415_spi.c:464
i2s_init
void i2s_init(spi_type *spi_x, i2s_init_type *i2s_init_struct)
i2s init config with its setting value.
Definition: at32f415_spi.c:316
i2s_enable
void i2s_enable(spi_type *spi_x, confirm_state new_state)
enable or disable i2s.
Definition: at32f415_spi.c:445
spi_i2s_reset
void spi_i2s_reset(spi_type *spi_x)
spi reset by crm reset register
Definition: at32f415_spi.c:51
i2s_default_para_init
void i2s_default_para_init(i2s_init_type *i2s_init_struct)
i2s init config with its default value.
Definition: at32f415_spi.c:298
i2s_data_channel_format_type
i2s_data_channel_format_type
i2s data bit num and channel bit num type
Definition: at32f415_spi.h:226
i2s_audio_sampling_freq_type
i2s_audio_sampling_freq_type
i2s audio frequency type
Definition: at32f415_spi.h:209
I2S_CLOCK_POLARITY_LOW
@ I2S_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:249
I2S_DATA_24BIT_CHANNEL_32BIT
@ I2S_DATA_24BIT_CHANNEL_32BIT
Definition: at32f415_spi.h:229
I2S_DATA_16BIT_CHANNEL_32BIT
@ I2S_DATA_16BIT_CHANNEL_32BIT
Definition: at32f415_spi.h:228
I2S_AUDIO_FREQUENCY_48K
@ I2S_AUDIO_FREQUENCY_48K
Definition: at32f415_spi.h:217
I2S_AUDIO_FREQUENCY_16K
@ I2S_AUDIO_FREQUENCY_16K
Definition: at32f415_spi.h:213
I2S_AUDIO_PROTOCOL_PHILLIPS
@ I2S_AUDIO_PROTOCOL_PHILLIPS
Definition: at32f415_spi.h:198
I2S_MODE_MASTER_TX
@ I2S_MODE_MASTER_TX
Definition: at32f415_spi.h:240
I2S_MODE_SLAVE_RX
@ I2S_MODE_SLAVE_RX
Definition: at32f415_spi.h:239
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
i2s_init_type
i2s init type
Definition: at32f415_spi.h:272
i2s_init_type::audio_sampling_freq
i2s_audio_sampling_freq_type audio_sampling_freq
Definition: at32f415_spi.h:275
i2s_init_type::data_channel_format
i2s_data_channel_format_type data_channel_format
Definition: at32f415_spi.h:276
i2s_init_type::mclk_output_enable
confirm_state mclk_output_enable
Definition: at32f415_spi.h:278
i2s_init_type::audio_protocol
i2s_audio_protocol_type audio_protocol
Definition: at32f415_spi.h:274
i2s_init_type::operation_mode
i2s_operation_mode_type operation_mode
Definition: at32f415_spi.h:273
i2s_init_type::clock_polarity
i2s_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:277
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • i2s
  • spii2s_switch_halfduplex_polling
  • inc
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • i2s
  • spii2s_switch_halfduplex_polling
  • inc
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • i2s
  • spii2s_switch_halfduplex_polling
  • inc
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • i2s
  • spii2s_switch_halfduplex_polling
  • src
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • i2s
  • spii2s_switch_halfduplex_polling
  • src
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • i2s
  • spii2s_switch_halfduplex_polling
  • src
project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include <stdio.h>
30
39uint16_t i2s1_buffer_tx[32] = {0x0102, 0x0304, 0x0506, 0x0708, 0x090A, 0x0B0C,
40 0x0D0E, 0x0F10, 0x1112, 0x1314, 0x1516, 0x1718,
41 0x191A, 0x1B1C, 0x1D1E, 0x1F20, 0x2122, 0x2324,
42 0x2526, 0x2728, 0x292A, 0x2B2C, 0x2D2E, 0x2F30,
43 0x3132, 0x3334, 0x3536, 0x3738, 0x393A, 0x3B3C,
44 0x3D3E, 0x3F40
45 };
46uint16_t SPI1_buffer_tx[32] = {0x5152, 0x5354, 0x5556, 0x5758, 0x595A, 0x5B5C,
47 0x5D5E, 0x5F60, 0x6162, 0x6364, 0x6566, 0x6768,
48 0x696A, 0x6B6C, 0x6D6E, 0x6F70, 0x7172, 0x7374,
49 0x7576, 0x7778, 0x797A, 0x7B7C, 0x7D7E, 0x7F80,
50 0x8182, 0x8384, 0x8586, 0x8788, 0x898A, 0x8B8C,
51 0x8D8E, 0x8F90
52 };
53uint16_t i2s2_buffer_rx[32];
54uint16_t spi2_buffer_rx[32];
55__IO uint32_t tx_index = 0, rx_index = 0;
56volatile error_status transfer_status1 = ERROR, transfer_status2 = ERROR, transfer_status3 = ERROR;
57
58static void gpio_config(void);
59static void spi_config(void);
60static void i2s_config(i2s_operation_mode_type i2s1_mode, i2s_operation_mode_type i2s2_mode);
61 error_status buffer_compare(uint16_t* pbuffer1, uint16_t* pbuffer2, uint16_t buffer_length);
62
68 error_status buffer_compare(uint16_t* pbuffer1, uint16_t* pbuffer2, uint16_t buffer_length)
69{
70 while(buffer_length--)
71 {
72 if(*pbuffer1 != *pbuffer2)
73 {
74 return ERROR;
75 }
76
77 pbuffer1++;
78 pbuffer2++;
79 }
80 return SUCCESS;
81}
82
88static void i2s_config(i2s_operation_mode_type i2s1_mode, i2s_operation_mode_type i2s2_mode)
89{
90 i2s_init_type i2s_init_struct;
91
92 crm_periph_clock_enable(CRM_SPI1_PERIPH_CLOCK, TRUE);
93 crm_periph_clock_enable(CRM_SPI2_PERIPH_CLOCK, TRUE);
94
95 spi_i2s_reset(SPI2);
96 spi_i2s_reset(SPI1);
97 i2s_default_para_init(&i2s_init_struct);
98 i2s_init_struct.audio_protocol = I2S_AUDIO_PROTOCOL_PHILLIPS;
99 i2s_init_struct.data_channel_format = I2S_DATA_16BIT_CHANNEL_32BIT;
100 i2s_init_struct.mclk_output_enable = FALSE;
101 i2s_init_struct.audio_sampling_freq = I2S_AUDIO_FREQUENCY_48K;
102 i2s_init_struct.clock_polarity = I2S_CLOCK_POLARITY_LOW;
103 i2s_init_struct.operation_mode = i2s1_mode;
104 i2s_init(SPI1, &i2s_init_struct);
105
106 i2s_init_struct.operation_mode =i2s2_mode;
107 i2s_init(SPI2, &i2s_init_struct);
108}
109
115static void spi_config(void)
116{
117 spi_init_type spi_init_struct;
118 crm_periph_clock_enable(CRM_SPI1_PERIPH_CLOCK, TRUE);
119 crm_periph_clock_enable(CRM_SPI2_PERIPH_CLOCK, TRUE);
120
121 spi_i2s_reset(SPI2);
122 spi_i2s_reset(SPI1);
123 spi_default_para_init(&spi_init_struct);
124 spi_init_struct.transmission_mode = SPI_TRANSMIT_HALF_DUPLEX_TX;
125 spi_init_struct.master_slave_mode =SPI_MODE_MASTER;
126 spi_init_struct.mclk_freq_division = SPI_MCLK_DIV_8;
127 spi_init_struct.first_bit_transmission = SPI_FIRST_BIT_MSB;
128 spi_init_struct.frame_bit_num = SPI_FRAME_16BIT;
129 spi_init_struct.clock_polarity = SPI_CLOCK_POLARITY_LOW;
130 spi_init_struct.clock_phase = SPI_CLOCK_PHASE_2EDGE;
131 spi_init_struct.cs_mode_selection = SPI_CS_SOFTWARE_MODE;
132 spi_init(SPI1, &spi_init_struct);
133
134 spi_init_struct.transmission_mode = SPI_TRANSMIT_SIMPLEX_RX;
135 spi_init_struct.master_slave_mode =SPI_MODE_SLAVE;
136 spi_init(SPI2, &spi_init_struct);
137
138 spi_enable(SPI2, TRUE);
139 spi_enable(SPI1, TRUE);
140}
141
147static void gpio_config(void)
148{
149 gpio_init_type gpio_initstructure;
150 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
151 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
152
153 /* master ws pin */
154 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
155 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
156 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
157 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
158 gpio_initstructure.gpio_pins = GPIO_PINS_4;
159 gpio_init(GPIOA, &gpio_initstructure);
160
161 /* master ck pin */
162 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
163 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
164 gpio_initstructure.gpio_pins = GPIO_PINS_5;
165 gpio_init(GPIOA, &gpio_initstructure);
166
167 /* master sd pin */
168 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
169 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
170 gpio_initstructure.gpio_pins = GPIO_PINS_7;
171 gpio_init(GPIOA, &gpio_initstructure);
172
173 /* master mck pin */
174 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
175 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
176 gpio_initstructure.gpio_pins = GPIO_PINS_0;
177 gpio_init(GPIOB, &gpio_initstructure);
178
179 /* slave ws pin */
180 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
181 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
182 gpio_initstructure.gpio_pins = GPIO_PINS_12;
183 gpio_init(GPIOB, &gpio_initstructure);
184
185 /* slave ck pin */
186 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
187 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
188 gpio_initstructure.gpio_pins = GPIO_PINS_13;
189 gpio_init(GPIOB, &gpio_initstructure);
190
191 /* slave sd pin */
192 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
193 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
194 gpio_initstructure.gpio_pins = GPIO_PINS_15;
195 gpio_init(GPIOB, &gpio_initstructure);
196}
197
203int main(void)
204{
205 __IO uint32_t index = 0;
206 system_clock_config();
207 at32_board_init();
208 at32_led_off(LED2);
209 at32_led_off(LED3);
210 at32_led_off(LED4);
211 gpio_config();
212 i2s_config(I2S_MODE_MASTER_TX, I2S_MODE_SLAVE_RX);
213 i2s_enable(SPI2, TRUE);
214 i2s_enable(SPI1, TRUE);
215 while(rx_index < 32)
216 {
217 while(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) == RESET);
218 spi_i2s_data_transmit(SPI1, i2s1_buffer_tx[tx_index++]);
219 while(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) == RESET);
220 i2s2_buffer_rx[rx_index++] = spi_i2s_data_receive(SPI2);
221 }
222
223 /* test result:the data check */
224 transfer_status1 = buffer_compare(i2s2_buffer_rx, i2s1_buffer_tx, 32);
225
226 tx_index = 0;
227 rx_index = 0;
228 spi_config();
229 while(rx_index < 32)
230 {
231 while(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) == RESET);
232 spi_i2s_data_transmit(SPI1, SPI1_buffer_tx[tx_index++]);
233 while(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) == RESET);
234 spi2_buffer_rx[rx_index++] = spi_i2s_data_receive(SPI2);
235 }
236
237 /* test result:the data check */
238 transfer_status2 = buffer_compare(spi2_buffer_rx, SPI1_buffer_tx, 32);
239
240 for(index = 0; index < 32; index++) i2s2_buffer_rx[index] = 0;
241 tx_index = 0;
242 rx_index = 0;
243 i2s_config(I2S_MODE_SLAVE_TX, I2S_MODE_MASTER_RX);
244 while(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) == RESET);
245 spi_i2s_data_transmit(SPI1, i2s1_buffer_tx[tx_index++]);
246 i2s_enable(SPI1, TRUE);
247 i2s_enable(SPI2, TRUE);
248 while(rx_index < 32)
249 {
250 while(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) == RESET);
251 i2s2_buffer_rx[rx_index++] = spi_i2s_data_receive(SPI2);
252 while(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) == RESET);
253 spi_i2s_data_transmit(SPI1, i2s1_buffer_tx[tx_index++]);
254 }
255
256 /* test result:the data check */
257 transfer_status3 = buffer_compare(i2s2_buffer_rx, i2s1_buffer_tx, 32);
258
259 /* test result indicate:if passed ,led2 lights */
260 if((transfer_status1 == SUCCESS) && (transfer_status2 == SUCCESS) && (transfer_status3 == SUCCESS))
261 {
262 at32_led_on(LED2);
263 }
264 else
265 {
266 at32_led_off(LED2);
267 }
268 while(1)
269 {
270 }
271}
272
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
buffer_compare
error_status buffer_compare(uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer_compare function.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:68
tx_index
__IO uint32_t tx_index
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:55
transfer_status3
volatile error_status transfer_status3
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:56
spi_config
static void spi_config(void)
spi configuration.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:115
transfer_status1
volatile error_status transfer_status1
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:56
i2s1_buffer_tx
uint16_t i2s1_buffer_tx[32]
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:39
transfer_status2
volatile error_status transfer_status2
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:56
main
int main(void)
main function.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:203
i2s_config
static void i2s_config(i2s_operation_mode_type i2s1_mode, i2s_operation_mode_type i2s2_mode)
i2s configuration.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:88
spi2_buffer_rx
uint16_t spi2_buffer_rx[32]
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:54
gpio_config
static void gpio_config(void)
gpio configuration.
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:147
SPI1_buffer_tx
uint16_t SPI1_buffer_tx[32]
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:46
rx_index
__IO uint32_t rx_index
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:55
i2s2_buffer_rx
uint16_t i2s2_buffer_rx[32]
Definition: project/at_start_f415/examples/i2s/spii2s_switch_halfduplex_polling/src/main.c:53
spi_init_struct
spi_init_type spi_init_struct
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:40
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_SPI2_PERIPH_CLOCK
@ CRM_SPI2_PERIPH_CLOCK
Definition: at32f415_crm.h:129
CRM_SPI1_PERIPH_CLOCK
@ CRM_SPI1_PERIPH_CLOCK
Definition: at32f415_crm.h:117
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_12
#define GPIO_PINS_12
Definition: at32f415_gpio.h:63
GPIO_PINS_4
#define GPIO_PINS_4
Definition: at32f415_gpio.h:55
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
SPI_I2S_TDBE_FLAG
#define SPI_I2S_TDBE_FLAG
Definition: at32f415_spi.h:54
SPI_I2S_RDBF_FLAG
#define SPI_I2S_RDBF_FLAG
Definition: at32f415_spi.h:53
i2s_init
void i2s_init(spi_type *spi_x, i2s_init_type *i2s_init_struct)
i2s init config with its setting value.
Definition: at32f415_spi.c:316
spi_i2s_data_transmit
void spi_i2s_data_transmit(spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit
Definition: at32f415_spi.c:514
spi_i2s_flag_get
flag_status spi_i2s_flag_get(spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:548
i2s_enable
void i2s_enable(spi_type *spi_x, confirm_state new_state)
enable or disable i2s.
Definition: at32f415_spi.c:445
spi_init
void spi_init(spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value.
Definition: at32f415_spi.c:91
spi_default_para_init
void spi_default_para_init(spi_init_type *spi_init_struct)
spi init config with its default value.
Definition: at32f415_spi.c:71
spi_i2s_data_receive
uint16_t spi_i2s_data_receive(spi_type *spi_x)
spi/i2s data receive
Definition: at32f415_spi.c:526
spi_i2s_reset
void spi_i2s_reset(spi_type *spi_x)
spi reset by crm reset register
Definition: at32f415_spi.c:51
i2s_default_para_init
void i2s_default_para_init(i2s_init_type *i2s_init_struct)
i2s init config with its default value.
Definition: at32f415_spi.c:298
spi_enable
void spi_enable(spi_type *spi_x, confirm_state new_state)
enable or disable spi.
Definition: at32f415_spi.c:287
i2s_operation_mode_type
i2s_operation_mode_type
i2s operation mode type
Definition: at32f415_spi.h:237
I2S_CLOCK_POLARITY_LOW
@ I2S_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:249
SPI_MODE_SLAVE
@ SPI_MODE_SLAVE
Definition: at32f415_spi.h:98
SPI_MODE_MASTER
@ SPI_MODE_MASTER
Definition: at32f415_spi.h:99
I2S_DATA_16BIT_CHANNEL_32BIT
@ I2S_DATA_16BIT_CHANNEL_32BIT
Definition: at32f415_spi.h:228
SPI_CLOCK_PHASE_2EDGE
@ SPI_CLOCK_PHASE_2EDGE
Definition: at32f415_spi.h:117
I2S_AUDIO_FREQUENCY_48K
@ I2S_AUDIO_FREQUENCY_48K
Definition: at32f415_spi.h:217
SPI_CS_SOFTWARE_MODE
@ SPI_CS_SOFTWARE_MODE
Definition: at32f415_spi.h:126
SPI_FIRST_BIT_MSB
@ SPI_FIRST_BIT_MSB
Definition: at32f415_spi.h:151
SPI_CLOCK_POLARITY_LOW
@ SPI_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:107
SPI_TRANSMIT_HALF_DUPLEX_TX
@ SPI_TRANSMIT_HALF_DUPLEX_TX
Definition: at32f415_spi.h:163
SPI_TRANSMIT_SIMPLEX_RX
@ SPI_TRANSMIT_SIMPLEX_RX
Definition: at32f415_spi.h:161
I2S_AUDIO_PROTOCOL_PHILLIPS
@ I2S_AUDIO_PROTOCOL_PHILLIPS
Definition: at32f415_spi.h:198
SPI_MCLK_DIV_8
@ SPI_MCLK_DIV_8
Definition: at32f415_spi.h:136
SPI_FRAME_16BIT
@ SPI_FRAME_16BIT
Definition: at32f415_spi.h:90
I2S_MODE_MASTER_TX
@ I2S_MODE_MASTER_TX
Definition: at32f415_spi.h:240
I2S_MODE_MASTER_RX
@ I2S_MODE_MASTER_RX
Definition: at32f415_spi.h:241
I2S_MODE_SLAVE_RX
@ I2S_MODE_SLAVE_RX
Definition: at32f415_spi.h:239
I2S_MODE_SLAVE_TX
@ I2S_MODE_SLAVE_TX
Definition: at32f415_spi.h:238
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
i2s_init_type
i2s init type
Definition: at32f415_spi.h:272
i2s_init_type::audio_sampling_freq
i2s_audio_sampling_freq_type audio_sampling_freq
Definition: at32f415_spi.h:275
i2s_init_type::data_channel_format
i2s_data_channel_format_type data_channel_format
Definition: at32f415_spi.h:276
i2s_init_type::mclk_output_enable
confirm_state mclk_output_enable
Definition: at32f415_spi.h:278
i2s_init_type::audio_protocol
i2s_audio_protocol_type audio_protocol
Definition: at32f415_spi.h:274
i2s_init_type::operation_mode
i2s_operation_mode_type operation_mode
Definition: at32f415_spi.h:273
i2s_init_type::clock_polarity
i2s_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:277
spi_init_type
spi init type
Definition: at32f415_spi.h:257
spi_init_type::master_slave_mode
spi_master_slave_mode_type master_slave_mode
Definition: at32f415_spi.h:259
spi_init_type::first_bit_transmission
spi_first_bit_type first_bit_transmission
Definition: at32f415_spi.h:261
spi_init_type::frame_bit_num
spi_frame_bit_num_type frame_bit_num
Definition: at32f415_spi.h:262
spi_init_type::clock_polarity
spi_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:263
spi_init_type::cs_mode_selection
spi_cs_mode_type cs_mode_selection
Definition: at32f415_spi.h:265
spi_init_type::mclk_freq_division
spi_mclk_freq_div_type mclk_freq_division
Definition: at32f415_spi.h:260
spi_init_type::transmission_mode
spi_transmission_mode_type transmission_mode
Definition: at32f415_spi.h:258
spi_init_type::clock_phase
spi_clock_phase_type clock_phase
Definition: at32f415_spi.h:264
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • pwc
  • deepsleep_ertc_alarm
  • inc
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • pwc
  • deepsleep_ertc_alarm
  • inc
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • pwc
  • deepsleep_ertc_alarm
  • inc
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • pwc
  • deepsleep_ertc_alarm
  • src
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • pwc
  • deepsleep_ertc_alarm
  • src
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31
46void NMI_Handler(void)
47{
48}
49
55void HardFault_Handler(void)
56{
57 /* go to infinite loop when hard fault exception occurs */
58 while(1)
59 {
60 }
61}
62
68void MemManage_Handler(void)
69{
70 /* go to infinite loop when memory manage exception occurs */
71 while(1)
72 {
73 }
74}
75
81void BusFault_Handler(void)
82{
83 /* go to infinite loop when bus fault exception occurs */
84 while(1)
85 {
86 }
87}
88
94void UsageFault_Handler(void)
95{
96 /* go to infinite loop when usage fault exception occurs */
97 while(1)
98 {
99 }
100}
101
107void SVC_Handler(void)
108{
109}
110
116void DebugMon_Handler(void)
117{
118}
119
125void PendSV_Handler(void)
126{
127}
128
134void SysTick_Handler(void)
135{
136}
137
143void ERTCAlarm_IRQHandler(void)
144{
145 if(ertc_flag_get(ERTC_ALAF_FLAG) != RESET)
146 {
147 /* clear ertc alarm flag */
148 ertc_flag_clear(ERTC_ALAF_FLAG);
149
150 /* clear exint line flag */
151 exint_flag_clear(EXINT_LINE_17);
152
153 /* toggle led */
154 at32_led_toggle(LED4);
155 }
156}
157
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c:94
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c:55
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c:68
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c:107
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c:125
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c:46
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c:81
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c:134
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c:116
ERTCAlarm_IRQHandler
void ERTCAlarm_IRQHandler(void)
this function handles the rtc alarm through exint line interrupt request.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/at32f415_int.c:143
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
ertc_flag_get
flag_status ertc_flag_get(uint32_t flag)
get flag status.
Definition: at32f415_ertc.c:1428
ertc_flag_clear
void ertc_flag_clear(uint32_t flag)
clear flag status
Definition: at32f415_ertc.c:1461
ERTC_ALAF_FLAG
#define ERTC_ALAF_FLAG
Definition: at32f415_ertc.h:74
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
EXINT_LINE_17
#define EXINT_LINE_17
Definition: at32f415_exint.h:69
RESET
@ RESET
Definition: at32f415.h:248
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • pwc
  • deepsleep_ertc_alarm
  • src
project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include <stdio.h>
30
31
45void ertc_config(void)
46{
47 /* allow access to ertc */
48 pwc_battery_powered_domain_access(TRUE);
49
50 /* reset ertc domain */
51 crm_battery_powered_domain_reset(TRUE);
52 crm_battery_powered_domain_reset(FALSE);
53
54 /* enable the lext osc */
55 crm_clock_source_enable(CRM_CLOCK_SOURCE_LEXT, TRUE);
56
57 /* wait till lext is ready */
58 while(crm_flag_get(CRM_LEXT_STABLE_FLAG) == RESET);
59
60 /* select the ertc clock source */
61 crm_ertc_clock_select(CRM_ERTC_CLOCK_LEXT);
62
63 /* enable the ertc clock */
64 crm_ertc_clock_enable(TRUE);
65
66 /* deinitializes the ertc registers */
67 ertc_reset();
68
69 /* wait for ertc apb registers synchronisation */
70 ertc_wait_update();
71
72 /* configure the ertc data register and ertc prescaler
73 ck_spre(1hz) = ertcclk(lext) /(ertc_clk_div_a + 1)*(ertc_clk_div_b + 1)*/
74 ertc_divider_set(127, 255);
75
76 /* configure the hour format is 24-hour format*/
77 ertc_hour_mode_set(ERTC_HOUR_MODE_24);
78
79 /* set the date: friday june 11th 2021 */
80 ertc_date_set(21, 6, 11, 5);
81
82 /* set the time to 06h 20mn 00s am */
83 ertc_time_set(6, 20, 0, ERTC_AM);
84}
85
91void ertc_alarm_config(void)
92{
93 exint_init_type exint_init_struct;
94
95 /* config the exint line of the ertc alarm */
96 exint_init_struct.line_select = EXINT_LINE_17;
97 exint_init_struct.line_enable = TRUE;
98 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
99 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
100 exint_init(&exint_init_struct);
101
102 /* set the alarm 05h:20min:10s */
103 ertc_alarm_mask_set(ERTC_ALA, ERTC_ALARM_MASK_DATE_WEEK | ERTC_ALARM_MASK_HOUR | ERTC_ALARM_MASK_MIN);
104 ertc_alarm_week_date_select(ERTC_ALA, ERTC_SLECT_DATE);
105 ertc_alarm_set(ERTC_ALA, 31, 6, 20, 5, ERTC_AM);
106
107 /* enable the ertc interrupt */
108 nvic_irq_enable(ERTCAlarm_IRQn, 0, 0);
109
110 /* enable ertc alarm a interrupt */
111 ertc_interrupt_enable(ERTC_ALA_INT, TRUE);
112
113 /* enable the alarm */
114 ertc_alarm_enable(ERTC_ALA, TRUE);
115}
116
122void ertc_alarm_value_set(uint32_t alam_index)
123{
124 ertc_time_type ertc_time_struct;
125
126 /* disable the alarm */
127 ertc_alarm_enable(ERTC_ALA, FALSE);
128 ertc_calendar_get(&ertc_time_struct);
129 ertc_alarm_set(ERTC_ALA, ertc_time_struct.day, ertc_time_struct.hour, ertc_time_struct.min, (ertc_time_struct.sec + alam_index)% 60, ertc_time_struct.ampm);
130
131 /* disable the alarm */
132 ertc_alarm_enable(ERTC_ALA, TRUE);
133}
134
140void system_clock_recover(void)
141{
142 /* enable external high-speed crystal oscillator - hext */
143 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
144
145 /* wait till hext is ready */
146 while(crm_hext_stable_wait() == ERROR);
147
148 /* enable pll */
149 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
150
151 /* wait till pll is ready */
152 while(crm_flag_get(CRM_PLL_STABLE_FLAG) == RESET);
153
154 /* enable auto step mode */
155 crm_auto_step_mode_enable(TRUE);
156
157 /* select pll as system clock source */
158 crm_sysclk_switch(CRM_SCLK_PLL);
159
160 /* wait till pll is used as system clock source */
161 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL);
162
163 /* disable auto step mode */
164 crm_auto_step_mode_enable(FALSE);
165}
166
172int main(void)
173{
174 __IO uint32_t delay_index = 0;
175 __IO uint32_t systick_index = 0;
176
177 /* congfig the system clock */
178 system_clock_config();
179
180 /* init at start board */
181 at32_board_init();
182
183 /* config priority group */
184 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
185
186 /* turn on the led light */
187 at32_led_on(LED2);
188 at32_led_on(LED3);
189 at32_led_on(LED4);
190
191 /* enable pwc and bpr clock */
192 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
193
194 /* config ertc */
195 ertc_config();
196
197 /* set the wakeup time: 06h:20min:5s */
198 ertc_alarm_config();
199
200 while(1)
201 {
202 at32_led_off(LED2);
203
204 /* save systick register configuration */
205 systick_index = SysTick->CTRL;
206 systick_index &= ~((uint32_t)0xFFFFFFFE);
207
208 /* disable systick */
209 SysTick->CTRL &= (uint32_t)0xFFFFFFFE;
210
211 ertc_alarm_value_set(1);
212
213 /* congfig the voltage regulator mode */
214 pwc_voltage_regulate_set(PWC_REGULATOR_LOW_POWER);
215
216 /* enter deep sleep mode */
217 pwc_deep_sleep_mode_enter(PWC_DEEP_SLEEP_ENTER_WFI);
218
219 /* restore systick register configuration */
220 SysTick->CTRL |= systick_index;
221
222 at32_led_on(LED2);
223
224 /* wait clock stable */
225 for(delay_index = 0; delay_index < 600; delay_index++)
226 {
227 __NOP();
228 }
229
230 /* wake up from deep sleep mode, congfig the system clock */
231 system_clock_recover();
232
233 delay_ms(500);
234 }
235}
236
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
main
int main(void)
main function.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c:172
ertc_config
void ertc_config(void)
ertc configuration.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c:45
ertc_alarm_value_set
void ertc_alarm_value_set(uint32_t alam_index)
ertc alarm value set.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c:122
system_clock_recover
void system_clock_recover(void)
systemclock recover.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c:140
ertc_alarm_config
void ertc_alarm_config(void)
ertc alarm configuration.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c:91
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_ertc_clock_select
void crm_ertc_clock_select(crm_ertc_clock_type value)
select ertc clock
Definition: at32f415_crm.c:377
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_ertc_clock_enable
void crm_ertc_clock_enable(confirm_state new_state)
enable or disable ertc
Definition: at32f415_crm.c:387
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
crm_battery_powered_domain_reset
void crm_battery_powered_domain_reset(confirm_state new_state)
battery powered domain software reset
Definition: at32f415_crm.c:496
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_LEXT
@ CRM_CLOCK_SOURCE_LEXT
Definition: at32f415_crm.h:306
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_ERTC_CLOCK_LEXT
@ CRM_ERTC_CLOCK_LEXT
Definition: at32f415_crm.h:383
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
CRM_LEXT_STABLE_FLAG
#define CRM_LEXT_STABLE_FLAG
Definition: at32f415_crm.h:58
ERTCAlarm_IRQn
@ ERTCAlarm_IRQn
Definition: at32f415.h:177
ertc_hour_mode_set
error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode)
ertc hour mode set.
Definition: at32f415_ertc.c:283
ertc_wait_update
error_status ertc_wait_update(void)
ertc wait register update finish.
Definition: at32f415_ertc.c:97
ertc_time_set
error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time.
Definition: at32f415_ertc.c:363
ertc_reset
error_status ertc_reset(void)
ertc reset all register.
Definition: at32f415_ertc.c:207
ertc_alarm_mask_set
void ertc_alarm_mask_set(ertc_alarm_type alarm_x, uint32_t mask)
set which bits are irrelevant to the alarm match.
Definition: at32f415_ertc.c:458
ertc_interrupt_enable
void ertc_interrupt_enable(uint32_t source, confirm_state new_state)
enable or disable interrupt.
Definition: at32f415_ertc.c:1340
ertc_alarm_week_date_select
void ertc_alarm_week_date_select(ertc_alarm_type alarm_x, ertc_week_date_select_type wk)
alarm week or date mode select.
Definition: at32f415_ertc.c:500
ertc_date_set
error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date.
Definition: at32f415_ertc.c:314
ertc_alarm_set
void ertc_alarm_set(ertc_alarm_type alarm_x, uint8_t week_date, uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set alarm.
Definition: at32f415_ertc.c:538
ertc_calendar_get
void ertc_calendar_get(ertc_time_type *time)
get calendar
Definition: at32f415_ertc.c:404
ertc_divider_set
error_status ertc_divider_set(uint16_t div_a, uint16_t div_b)
ertc division set.
Definition: at32f415_ertc.c:251
ertc_alarm_enable
error_status ertc_alarm_enable(ertc_alarm_type alarm_x, confirm_state new_state)
enable or disable alarm clock.
Definition: at32f415_ertc.c:629
ERTC_SLECT_DATE
@ ERTC_SLECT_DATE
Definition: at32f415_ertc.h:124
ERTC_HOUR_MODE_24
@ ERTC_HOUR_MODE_24
Definition: at32f415_ertc.h:105
ERTC_ALA
@ ERTC_ALA
Definition: at32f415_ertc.h:133
ERTC_AM
@ ERTC_AM
Definition: at32f415_ertc.h:115
ERTC_ALARM_MASK_DATE_WEEK
#define ERTC_ALARM_MASK_DATE_WEEK
Definition: at32f415_ertc.h:89
ERTC_ALARM_MASK_HOUR
#define ERTC_ALARM_MASK_HOUR
Definition: at32f415_ertc.h:88
ERTC_ALARM_MASK_MIN
#define ERTC_ALARM_MASK_MIN
Definition: at32f415_ertc.h:87
ERTC_ALA_INT
#define ERTC_ALA_INT
Definition: at32f415_ertc.h:53
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_17
#define EXINT_LINE_17
Definition: at32f415_exint.h:69
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_battery_powered_domain_access
void pwc_battery_powered_domain_access(confirm_state new_state)
enable or disable access to the battery powered domain.
Definition: at32f415_pwc.c:61
pwc_voltage_regulate_set
void pwc_voltage_regulate_set(pwc_regulator_type pwc_regulator)
regulate low power consumption in the deep sleep mode
Definition: at32f415_pwc.c:213
pwc_deep_sleep_mode_enter
void pwc_deep_sleep_mode_enter(pwc_deep_sleep_enter_type pwc_deep_sleep_enter)
enter pwc deep-sleep mode
Definition: at32f415_pwc.c:189
PWC_REGULATOR_LOW_POWER
@ PWC_REGULATOR_LOW_POWER
Definition: at32f415_pwc.h:107
PWC_DEEP_SLEEP_ENTER_WFI
@ PWC_DEEP_SLEEP_ENTER_WFI
Definition: at32f415_pwc.h:97
ertc_time_type
ertc time
Definition: at32f415_ertc.h:371
ertc_time_type::ampm
ertc_am_pm_type ampm
Definition: at32f415_ertc.h:379
ertc_time_type::day
uint8_t day
Definition: at32f415_ertc.h:374
ertc_time_type::hour
uint8_t hour
Definition: at32f415_ertc.h:375
ertc_time_type::min
uint8_t min
Definition: at32f415_ertc.h:376
ertc_time_type::sec
uint8_t sec
Definition: at32f415_ertc.h:377
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • pwc
  • deepsleep_ertc_tamper
  • inc
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • pwc
  • deepsleep_ertc_tamper
  • inc
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • pwc
  • deepsleep_ertc_tamper
  • inc
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • pwc
  • deepsleep_ertc_tamper
  • src
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • pwc
  • deepsleep_ertc_tamper
  • src
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31
46void NMI_Handler(void)
47{
48}
49
55void HardFault_Handler(void)
56{
57 /* go to infinite loop when hard fault exception occurs */
58 while(1)
59 {
60 }
61}
62
68void MemManage_Handler(void)
69{
70 /* go to infinite loop when memory manage exception occurs */
71 while(1)
72 {
73 }
74}
75
81void BusFault_Handler(void)
82{
83 /* go to infinite loop when bus fault exception occurs */
84 while(1)
85 {
86 }
87}
88
94void UsageFault_Handler(void)
95{
96 /* go to infinite loop when usage fault exception occurs */
97 while(1)
98 {
99 }
100}
101
107void SVC_Handler(void)
108{
109}
110
116void DebugMon_Handler(void)
117{
118}
119
125void PendSV_Handler(void)
126{
127}
128
134void SysTick_Handler(void)
135{
136}
137
143void TAMP_STAMP_IRQHandler(void)
144{
145 if(ertc_flag_get(ERTC_TP1F_FLAG) != RESET)
146 {
147 /* clear ertc alarm flag */
148 ertc_flag_clear(ERTC_TP1F_FLAG);
149
150 /* clear exint line flag */
151 exint_flag_clear(EXINT_LINE_21);
152
153 /* toggle led */
154 at32_led_toggle(LED4);
155 }
156}
157
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c:94
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c:55
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c:68
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c:107
TAMP_STAMP_IRQHandler
void TAMP_STAMP_IRQHandler(void)
this function handles the rtc alarm through exint line interrupt request.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c:143
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c:125
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c:46
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c:81
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c:134
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/at32f415_int.c:116
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
ertc_flag_get
flag_status ertc_flag_get(uint32_t flag)
get flag status.
Definition: at32f415_ertc.c:1428
ertc_flag_clear
void ertc_flag_clear(uint32_t flag)
clear flag status
Definition: at32f415_ertc.c:1461
ERTC_TP1F_FLAG
#define ERTC_TP1F_FLAG
Definition: at32f415_ertc.h:79
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
EXINT_LINE_21
#define EXINT_LINE_21
Definition: at32f415_exint.h:73
RESET
@ RESET
Definition: at32f415.h:248
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • pwc
  • deepsleep_ertc_tamper
  • src
project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include <stdio.h>
30
31
45void ertc_config(void)
46{
47 /* allow access to ertc */
48 pwc_battery_powered_domain_access(TRUE);
49
50 /* reset ertc domain */
51 crm_battery_powered_domain_reset(TRUE);
52 crm_battery_powered_domain_reset(FALSE);
53
54 /* enable the lext osc */
55 crm_clock_source_enable(CRM_CLOCK_SOURCE_LEXT, TRUE);
56
57 /* wait till lext is ready */
58 while(crm_flag_get(CRM_LEXT_STABLE_FLAG) == RESET);
59
60 /* select the ertc clock source */
61 crm_ertc_clock_select(CRM_ERTC_CLOCK_LEXT);
62
63 /* enable the ertc clock */
64 crm_ertc_clock_enable(TRUE);
65
66 /* deinitializes the ertc registers */
67 ertc_reset();
68}
69
75void ertc_tamper_config(void)
76{
77 exint_init_type exint_init_struct;
78
79 /* config the exint line of the ertc tamper */
80 exint_init_struct.line_select = EXINT_LINE_21;
81 exint_init_struct.line_enable = TRUE;
82 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
83 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
84 exint_init(&exint_init_struct);
85
86 /* enable tamper irqchannel */
87 nvic_irq_enable(TAMP_STAMP_IRQn, 0, 0);
88
89 /* disable the tamper 1 detection */
90 ertc_tamper_enable(ERTC_TAMPER_1, FALSE);
91
92 /* clear tamper 1 pin event(tamp1f) pending flag */
93 ertc_flag_clear(ERTC_TP1F_FLAG);
94
95 /* configure the tamper 1 trigger */
96 ertc_tamper_valid_edge_set(ERTC_TAMPER_1, ERTC_TAMPER_EDGE_RISING);
97
98 /* enable the tamper interrupt */
99 ertc_interrupt_enable(ERTC_TP_INT, TRUE);
100
101 /* enable the tamper 1 detection */
102 ertc_tamper_enable(ERTC_TAMPER_1, TRUE);
103}
104
110void system_clock_recover(void)
111{
112 /* enable external high-speed crystal oscillator - hext */
113 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
114
115 /* wait till hext is ready */
116 while(crm_hext_stable_wait() == ERROR);
117
118 /* enable pll */
119 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
120
121 /* wait till pll is ready */
122 while(crm_flag_get(CRM_PLL_STABLE_FLAG) == RESET);
123
124 /* enable auto step mode */
125 crm_auto_step_mode_enable(TRUE);
126
127 /* select pll as system clock source */
128 crm_sysclk_switch(CRM_SCLK_PLL);
129
130 /* wait till pll is used as system clock source */
131 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL);
132
133 /* disable auto step mode */
134 crm_auto_step_mode_enable(FALSE);
135}
136
142int main(void)
143{
144 __IO uint32_t delay_index = 0;
145 __IO uint32_t systick_index = 0;
146
147 /* congfig the system clock */
148 system_clock_config();
149
150 /* init at start board */
151 at32_board_init();
152
153 /* config priority group */
154 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
155
156 /* turn on the led light */
157 at32_led_on(LED2);
158 at32_led_on(LED3);
159 at32_led_on(LED4);
160
161 /* enable pwc and bpr clock */
162 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
163
164 /* config ertc */
165 ertc_config();
166
167 /* set the wakeup time: 06h:20min:5s */
168 ertc_tamper_config();
169
170 while(1)
171 {
172 at32_led_off(LED2);
173
174 /* save systick register configuration */
175 systick_index = SysTick->CTRL;
176 systick_index &= ~((uint32_t)0xFFFFFFFE);
177
178 /* disable systick */
179 SysTick->CTRL &= (uint32_t)0xFFFFFFFE;
180
181 /* congfig the voltage regulator mode */
182 pwc_voltage_regulate_set(PWC_REGULATOR_LOW_POWER);
183
184 /* enter deep sleep mode */
185 pwc_deep_sleep_mode_enter(PWC_DEEP_SLEEP_ENTER_WFI);
186
187 /* restore systick register configuration */
188 SysTick->CTRL |= systick_index;
189
190 at32_led_on(LED2);
191
192 /* wait clock stable */
193 for(delay_index = 0; delay_index < 600; delay_index++)
194 {
195 __NOP();
196 }
197
198 /* wake up from deep sleep mode, congfig the system clock */
199 system_clock_recover();
200
201 delay_ms(500);
202 }
203}
204
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
ertc_tamper_config
void ertc_tamper_config(void)
ertc tamper configuration.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c:75
main
int main(void)
main function.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c:142
ertc_config
void ertc_config(void)
ertc configuration.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c:45
system_clock_recover
void system_clock_recover(void)
systemclock recover.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_tamper/src/main.c:110
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_ertc_clock_select
void crm_ertc_clock_select(crm_ertc_clock_type value)
select ertc clock
Definition: at32f415_crm.c:377
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_ertc_clock_enable
void crm_ertc_clock_enable(confirm_state new_state)
enable or disable ertc
Definition: at32f415_crm.c:387
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
crm_battery_powered_domain_reset
void crm_battery_powered_domain_reset(confirm_state new_state)
battery powered domain software reset
Definition: at32f415_crm.c:496
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_LEXT
@ CRM_CLOCK_SOURCE_LEXT
Definition: at32f415_crm.h:306
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_ERTC_CLOCK_LEXT
@ CRM_ERTC_CLOCK_LEXT
Definition: at32f415_crm.h:383
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
CRM_LEXT_STABLE_FLAG
#define CRM_LEXT_STABLE_FLAG
Definition: at32f415_crm.h:58
TAMP_STAMP_IRQn
@ TAMP_STAMP_IRQn
Definition: at32f415.h:137
ertc_reset
error_status ertc_reset(void)
ertc reset all register.
Definition: at32f415_ertc.c:207
ertc_interrupt_enable
void ertc_interrupt_enable(uint32_t source, confirm_state new_state)
enable or disable interrupt.
Definition: at32f415_ertc.c:1340
ertc_tamper_enable
void ertc_tamper_enable(ertc_tamper_select_type tamper_x, confirm_state new_state)
enable or disable tamper.
Definition: at32f415_ertc.c:1314
ertc_flag_clear
void ertc_flag_clear(uint32_t flag)
clear flag status
Definition: at32f415_ertc.c:1461
ertc_tamper_valid_edge_set
void ertc_tamper_valid_edge_set(ertc_tamper_select_type tamper_x, ertc_tamper_valid_edge_type trigger)
set the tamper trigger.
Definition: at32f415_ertc.c:1275
ERTC_TAMPER_EDGE_RISING
@ ERTC_TAMPER_EDGE_RISING
Definition: at32f415_ertc.h:334
ERTC_TAMPER_1
@ ERTC_TAMPER_1
Definition: at32f415_ertc.h:289
ERTC_TP1F_FLAG
#define ERTC_TP1F_FLAG
Definition: at32f415_ertc.h:79
ERTC_TP_INT
#define ERTC_TP_INT
Definition: at32f415_ertc.h:52
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_21
#define EXINT_LINE_21
Definition: at32f415_exint.h:73
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_battery_powered_domain_access
void pwc_battery_powered_domain_access(confirm_state new_state)
enable or disable access to the battery powered domain.
Definition: at32f415_pwc.c:61
pwc_voltage_regulate_set
void pwc_voltage_regulate_set(pwc_regulator_type pwc_regulator)
regulate low power consumption in the deep sleep mode
Definition: at32f415_pwc.c:213
pwc_deep_sleep_mode_enter
void pwc_deep_sleep_mode_enter(pwc_deep_sleep_enter_type pwc_deep_sleep_enter)
enter pwc deep-sleep mode
Definition: at32f415_pwc.c:189
PWC_REGULATOR_LOW_POWER
@ PWC_REGULATOR_LOW_POWER
Definition: at32f415_pwc.h:107
PWC_DEEP_SLEEP_ENTER_WFI
@ PWC_DEEP_SLEEP_ENTER_WFI
Definition: at32f415_pwc.h:97
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • pwc
  • power_voltage_monitor
  • inc
project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • pwc
  • power_voltage_monitor
  • inc
project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • pwc
  • power_voltage_monitor
  • inc
project/at_start_f415/examples/pwc/power_voltage_monitor/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • pwc
  • power_voltage_monitor
  • src
project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • pwc
  • power_voltage_monitor
  • src
project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31
46void NMI_Handler(void)
47{
48}
49
55void HardFault_Handler(void)
56{
57 /* go to infinite loop when hard fault exception occurs */
58 while(1)
59 {
60 }
61}
62
68void MemManage_Handler(void)
69{
70 /* go to infinite loop when memory manage exception occurs */
71 while(1)
72 {
73 }
74}
75
81void BusFault_Handler(void)
82{
83 /* go to infinite loop when bus fault exception occurs */
84 while(1)
85 {
86 }
87}
88
94void UsageFault_Handler(void)
95{
96 /* go to infinite loop when usage fault exception occurs */
97 while(1)
98 {
99 }
100}
101
107void SVC_Handler(void)
108{
109}
110
116void DebugMon_Handler(void)
117{
118}
119
125void PendSV_Handler(void)
126{
127}
128
134void SysTick_Handler(void)
135{
136}
137
143void PVM_IRQHandler(void)
144{
145 if(exint_flag_get(EXINT_LINE_16) != RESET)
146 {
147 /* clear exint line flag */
148 exint_flag_clear(EXINT_LINE_16);
149
150 /* toggle led */
151 at32_led_toggle(LED2);
152 at32_led_toggle(LED3);
153 at32_led_toggle(LED4);
154 }
155}
156
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c:94
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c:55
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c:68
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c:107
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c:125
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c:46
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c:81
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c:134
PVM_IRQHandler
void PVM_IRQHandler(void)
this function handles the power voltage monitoring output interrupt request.
Definition: project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c:143
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/pwc/power_voltage_monitor/src/at32f415_int.c:116
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
exint_flag_get
flag_status exint_flag_get(uint32_t exint_line)
get exint flag
Definition: at32f415_exint.c:142
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
EXINT_LINE_16
#define EXINT_LINE_16
Definition: at32f415_exint.h:68
RESET
@ RESET
Definition: at32f415.h:248
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • pwc
  • power_voltage_monitor
  • src
project/at_start_f415/examples/pwc/power_voltage_monitor/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
30
45void pvm_exint_config(void)
46{
47 exint_init_type exint_init_struct;
48
49 /* config the exint line of the power voltage monitor */
50 exint_init_struct.line_select = EXINT_LINE_16;
51 exint_init_struct.line_enable = TRUE;
52 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
53 exint_init_struct.line_polarity = EXINT_TRIGGER_BOTH_EDGE;
54 exint_init(&exint_init_struct);
55}
56
62int main(void)
63{
64 __IO uint32_t index = 0;
65
66 /* congfig the system clock */
67 system_clock_config();
68
69 /* init at start board */
70 at32_board_init();
71
72 /* config priority group */
73 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
74
75 /* turn on the led light */
76 at32_led_on(LED2);
77 at32_led_on(LED3);
78 at32_led_on(LED4);
79
80 /* enable pwc clock */
81 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
82
83 /* set the threshold voltage to 2.9v */
84 pwc_pvm_level_select(PWC_PVM_VOLTAGE_2V9);
85
86 /* enable power voltage monitor */
87 pwc_power_voltage_monitor_enable(TRUE);
88
89 /* config the exint line of the power voltage monitor */
90 pvm_exint_config();
91
92 /* when power voltage monitor enable,exint line16 flag will be set */
93 while(exint_flag_get(EXINT_LINE_16) == RESET);
94
95 /* clear the unexpected exint line flag */
96 exint_flag_clear(EXINT_LINE_16);
97
98 /* clear the unexpected nvic pending flag */
99 NVIC_ClearPendingIRQ(PVM_IRQn);
100
101 /* enable power voltage monitor interrupt */
102 nvic_irq_enable(PVM_IRQn, 0, 0);
103
104 while(1)
105 {
106 }
107}
108
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
pvm_exint_config
void pvm_exint_config(void)
power voltage monitor exint configuration.
Definition: project/at_start_f415/examples/pwc/power_voltage_monitor/src/main.c:45
main
int main(void)
main function.
Definition: project/at_start_f415/examples/pwc/power_voltage_monitor/src/main.c:62
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
PVM_IRQn
@ PVM_IRQn
Definition: at32f415.h:136
exint_flag_get
flag_status exint_flag_get(uint32_t exint_line)
get exint flag
Definition: at32f415_exint.c:142
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_BOTH_EDGE
@ EXINT_TRIGGER_BOTH_EDGE
Definition: at32f415_exint.h:100
EXINT_LINE_16
#define EXINT_LINE_16
Definition: at32f415_exint.h:68
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_power_voltage_monitor_enable
void pwc_power_voltage_monitor_enable(confirm_state new_state)
enable or disable pwc power voltage monitor (pvm)
Definition: at32f415_pwc.c:90
pwc_pvm_level_select
void pwc_pvm_level_select(pwc_pvm_voltage_type pvm_voltage)
select the voltage threshold detected by the power voltage detector.
Definition: at32f415_pwc.c:79
PWC_PVM_VOLTAGE_2V9
@ PWC_PVM_VOLTAGE_2V9
Definition: at32f415_pwc.h:80
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • pwc
  • sleep_tmr2
  • inc
project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • pwc
  • sleep_tmr2
  • inc
project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • pwc
  • sleep_tmr2
  • inc
project/at_start_f415/examples/pwc/sleep_tmr2/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • pwc
  • sleep_tmr2
  • src
project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • pwc
  • sleep_tmr2
  • src
project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
45void NMI_Handler(void)
46{
47}
48
54void HardFault_Handler(void)
55{
56 /* go to infinite loop when hard fault exception occurs */
57 while(1)
58 {
59 }
60}
61
67void MemManage_Handler(void)
68{
69 /* go to infinite loop when memory manage exception occurs */
70 while(1)
71 {
72 }
73}
74
80void BusFault_Handler(void)
81{
82 /* go to infinite loop when bus fault exception occurs */
83 while(1)
84 {
85 }
86}
87
93void UsageFault_Handler(void)
94{
95 /* go to infinite loop when usage fault exception occurs */
96 while(1)
97 {
98 }
99}
100
106void SVC_Handler(void)
107{
108}
109
115void DebugMon_Handler(void)
116{
117}
118
124void PendSV_Handler(void)
125{
126}
127
133void SysTick_Handler(void)
134{
135}
136
142void TMR2_GLOBAL_IRQHandler(void)
143{
144 if(tmr_flag_get(TMR2, TMR_OVF_FLAG) != RESET)
145 {
146 /* clear timer 2 ovf flag */
147 tmr_flag_clear(TMR2, TMR_OVF_FLAG);
148
149 /* toggle led */
150 at32_led_toggle(LED4);
151 }
152}
153
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c:106
TMR2_GLOBAL_IRQHandler
void TMR2_GLOBAL_IRQHandler(void)
this function handles the timer interrupt request.
Definition: project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c:142
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/pwc/sleep_tmr2/src/at32f415_int.c:115
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
RESET
@ RESET
Definition: at32f415.h:248
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
TMR_OVF_FLAG
#define TMR_OVF_FLAG
Definition: at32f415_tmr.h:52
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • pwc
  • sleep_tmr2
  • src
project/at_start_f415/examples/pwc/sleep_tmr2/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
30
45void tmr2_config(void)
46{
47 /* enable tmr 2 clock */
48 crm_periph_clock_enable(CRM_TMR2_PERIPH_CLOCK, TRUE);
49
50 /* config the period value and divider value */
51 tmr_base_init(TMR2, 65535, 5860);
52
53 /* config the counting direction */
54 tmr_cnt_dir_set(TMR2, TMR_COUNT_UP);
55
56 /* config the clock divider value */
57 tmr_clock_source_div_set(TMR2, TMR_CLOCK_DIV1);
58
59 /* enable tmr 2 interrupt */
60 tmr_interrupt_enable(TMR2, TMR_OVF_INT, TRUE);
61
62 /* config tmr 2 nvic */
63 nvic_irq_enable(TMR2_GLOBAL_IRQn, 0, 0);
64
65 /* enable tmr 2 */
66 tmr_counter_enable(TMR2, TRUE);
67}
68
74int main(void)
75{
76 __IO uint32_t index = 0;
77 __IO uint32_t systick_index = 0;
78
79 /* congfig the system clock */
80 system_clock_config();
81
82 /* init at start board */
83 at32_board_init();
84
85 /* config priority group */
86 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
87
88 /* turn on the led light */
89 at32_led_on(LED2);
90 at32_led_on(LED3);
91 at32_led_on(LED4);
92
93 /* enable pwc clock */
94 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
95
96 /* config tmr 2 */
97 tmr2_config();
98
99 while(1)
100 {
101 at32_led_off(LED2);
102
103 /* save systick register configuration */
104 systick_index = SysTick->CTRL;
105 systick_index &= ~((uint32_t)0xFFFFFFFE);
106
107 /* disable systick */
108 SysTick->CTRL &= (uint32_t)0xFFFFFFFE;
109
110 /* enter sleep mode */
111 pwc_sleep_mode_enter(PWC_SLEEP_ENTER_WFI);
112
113 /* restore systick register configuration */
114 SysTick->CTRL |= systick_index;
115
116 /* wake up from sleep mode */
117 at32_led_on(LED2);
118 for(index = 0; index < 500000; index++);
119 }
120}
121
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
tmr2_config
void tmr2_config(void)
tmr2 configuration.
Definition: project/at_start_f415/examples/pwc/sleep_tmr2/src/main.c:45
main
int main(void)
main function.
Definition: project/at_start_f415/examples/pwc/sleep_tmr2/src/main.c:74
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_TMR2_PERIPH_CLOCK
@ CRM_TMR2_PERIPH_CLOCK
Definition: at32f415_crm.h:123
TMR2_GLOBAL_IRQn
@ TMR2_GLOBAL_IRQn
Definition: at32f415.h:164
TRUE
@ TRUE
Definition: at32f415.h:253
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_sleep_mode_enter
void pwc_sleep_mode_enter(pwc_sleep_enter_type pwc_sleep_enter)
enter pwc sleep mode
Definition: at32f415_pwc.c:166
PWC_SLEEP_ENTER_WFI
@ PWC_SLEEP_ENTER_WFI
Definition: at32f415_pwc.h:88
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OVF_INT
#define TMR_OVF_INT
Definition: at32f415_tmr.h:74
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • pwc
  • sleep_usart1
  • inc
project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • pwc
  • sleep_usart1
  • inc
project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • pwc
  • sleep_usart1
  • inc
project/at_start_f415/examples/pwc/sleep_usart1/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • pwc
  • sleep_usart1
  • src
project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • pwc
  • sleep_usart1
  • src
project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31
41uint16_t usart1_index = 0;
47void NMI_Handler(void)
48{
49}
50
56void HardFault_Handler(void)
57{
58 /* go to infinite loop when hard fault exception occurs */
59 while(1)
60 {
61 }
62}
63
69void MemManage_Handler(void)
70{
71 /* go to infinite loop when memory manage exception occurs */
72 while(1)
73 {
74 }
75}
76
82void BusFault_Handler(void)
83{
84 /* go to infinite loop when bus fault exception occurs */
85 while(1)
86 {
87 }
88}
89
95void UsageFault_Handler(void)
96{
97 /* go to infinite loop when usage fault exception occurs */
98 while(1)
99 {
100 }
101}
102
108void SVC_Handler(void)
109{
110}
111
117void DebugMon_Handler(void)
118{
119}
120
126void PendSV_Handler(void)
127{
128}
129
135void SysTick_Handler(void)
136{
137}
138
144void USART1_IRQHandler(void)
145{
146 if(usart_flag_get(USART1, USART_RDBF_FLAG) != RESET)
147 {
148 /* clear rdbf flag */
149 usart1_index = usart_data_receive(USART1);
150
151 /* toggle led */
152 at32_led_toggle(LED4);
153 }
154}
155
156
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c:95
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c:56
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c:69
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c:108
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c:126
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c:47
USART1_IRQHandler
void USART1_IRQHandler(void)
this function handles the usatt interrupt request.
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c:144
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c:82
usart1_index
uint16_t usart1_index
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c:41
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c:135
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/at32f415_int.c:117
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
RESET
@ RESET
Definition: at32f415.h:248
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART1
#define USART1
Definition: at32f415_usart.h:319
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • pwc
  • sleep_usart1
  • src
project/at_start_f415/examples/pwc/sleep_usart1/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
43void usart1_config(uint32_t baudrate)
44{
45 gpio_init_type gpio_init_struct;
46
47 /* enable the uart1 and gpio clock */
48 crm_periph_clock_enable(CRM_USART1_PERIPH_CLOCK, TRUE);
49 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
50
51 gpio_default_para_init(&gpio_init_struct);
52
53 /* configure the uart1 tx pin */
54 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
55 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
56 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
57 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
58 gpio_init_struct.gpio_pins = GPIO_PINS_9;
59 gpio_init(GPIOA, &gpio_init_struct);
60
61 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
62 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
63 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
64 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
65 gpio_init_struct.gpio_pins = GPIO_PINS_10;
66 gpio_init(GPIOA, &gpio_init_struct);
67
68 /* configure uart param */
69 nvic_irq_enable(USART1_IRQn, 0, 0);
70
71 usart_init(USART1, baudrate, USART_DATA_8BITS, USART_STOP_1_BIT);
72 usart_parity_selection_config(USART1, USART_PARITY_NONE);
73 usart_transmitter_enable(USART1, TRUE);
74 usart_receiver_enable(USART1, TRUE);
75 usart_hardware_flow_control_set(USART1,USART_HARDWARE_FLOW_NONE);
76 usart_interrupt_enable(USART1, USART_RDBF_INT, TRUE);
77 usart_enable(USART1, TRUE);
78}
79
85int main(void)
86{
87 __IO uint32_t index = 0;
88 __IO uint32_t systick_index = 0;
89
90 /* congfig the system clock */
91 system_clock_config();
92
93 /* init at start board */
94 at32_board_init();
95
96 /* config priority group */
97 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
98
99 /* turn on the led light */
100 at32_led_on(LED2);
101 at32_led_on(LED3);
102 at32_led_on(LED4);
103
104 /* enable pwc clock */
105 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
106
107 /* config usart1 */
108 usart1_config(115200);
109
110 printf("exit sleep mode by usart1 rdbf interrupt \r\n");
111
112 while(1)
113 {
114 at32_led_off(LED2);
115 at32_led_off(LED3);
116 printf("now enter sleep mode \r\n");
117
118 /* save systick register configuration */
119 systick_index = SysTick->CTRL;
120 systick_index &= ~((uint32_t)0xFFFFFFFE);
121
122 /* disable systick */
123 SysTick->CTRL &= (uint32_t)0xFFFFFFFE;
124
125 /* enter sleep mode */
126 pwc_sleep_mode_enter(PWC_SLEEP_ENTER_WFI);
127
128 /* restore systick register configuration */
129 SysTick->CTRL |= systick_index;
130
131 /* wake up from sleep mode */
132 printf("now exit sleep mode by usart1 rdbf interrupt \r\n");
133
134 at32_led_on(LED2);
135 for(index = 0; index < 500000; index++);
136 }
137}
138
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
main
int main(void)
main function.
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/main.c:85
usart1_config
void usart1_config(uint32_t baudrate)
usart1 configuration.
Definition: project/at_start_f415/examples/pwc/sleep_usart1/src/main.c:43
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_USART1_PERIPH_CLOCK
@ CRM_USART1_PERIPH_CLOCK
Definition: at32f415_crm.h:118
USART1_IRQn
@ USART1_IRQn
Definition: at32f415.h:173
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_sleep_mode_enter
void pwc_sleep_mode_enter(pwc_sleep_enter_type pwc_sleep_enter)
enter pwc sleep mode
Definition: at32f415_pwc.c:166
PWC_SLEEP_ENTER_WFI
@ PWC_SLEEP_ENTER_WFI
Definition: at32f415_pwc.h:88
usart_parity_selection_config
void usart_parity_selection_config(usart_type *usart_x, usart_parity_selection_type parity)
usart parity selection config.
Definition: at32f415_usart.c:138
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_hardware_flow_control_set
void usart_hardware_flow_control_set(usart_type *usart_x, usart_hardware_flow_control_type flow_state)
configure the usart's hardware flow control.
Definition: at32f415_usart.c:516
usart_interrupt_enable
void usart_interrupt_enable(usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts.
Definition: at32f415_usart.c:257
USART_HARDWARE_FLOW_NONE
@ USART_HARDWARE_FLOW_NONE
Definition: at32f415_usart.h:169
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_PARITY_NONE
@ USART_PARITY_NONE
Definition: at32f415_usart.h:94
USART_RDBF_INT
#define USART_RDBF_INT
Definition: at32f415_usart.h:73
USART1
#define USART1
Definition: at32f415_usart.h:319
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • pwc
  • standby_ertc_alarm
  • inc
project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • pwc
  • standby_ertc_alarm
  • inc
project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • pwc
  • standby_ertc_alarm
  • inc
project/at_start_f415/examples/pwc/standby_ertc_alarm/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • pwc
  • standby_ertc_alarm
  • src
project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • pwc
  • standby_ertc_alarm
  • src
project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31
46void NMI_Handler(void)
47{
48}
49
55void HardFault_Handler(void)
56{
57 /* go to infinite loop when hard fault exception occurs */
58 while(1)
59 {
60 }
61}
62
68void MemManage_Handler(void)
69{
70 /* go to infinite loop when memory manage exception occurs */
71 while(1)
72 {
73 }
74}
75
81void BusFault_Handler(void)
82{
83 /* go to infinite loop when bus fault exception occurs */
84 while(1)
85 {
86 }
87}
88
94void UsageFault_Handler(void)
95{
96 /* go to infinite loop when usage fault exception occurs */
97 while(1)
98 {
99 }
100}
101
107void SVC_Handler(void)
108{
109}
110
116void DebugMon_Handler(void)
117{
118}
119
125void PendSV_Handler(void)
126{
127}
128
134void SysTick_Handler(void)
135{
136}
137
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c:94
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c:55
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c:68
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c:107
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c:125
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c:46
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c:81
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c:134
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/at32f415_int.c:116
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • pwc
  • standby_ertc_alarm
  • src
project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include <stdio.h>
30
31
46void ertc_config(void)
47{
48 /* allow access to ertc */
49 pwc_battery_powered_domain_access(TRUE);
50
51 /* reset ertc domain */
52 crm_battery_powered_domain_reset(TRUE);
53 crm_battery_powered_domain_reset(FALSE);
54
55 /* enable the lext osc */
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_LEXT, TRUE);
57
58 /* wait till lext is ready */
59 while(crm_flag_get(CRM_LEXT_STABLE_FLAG) == RESET);
60
61 /* select the ertc clock source */
62 crm_ertc_clock_select(CRM_ERTC_CLOCK_LEXT);
63
64 /* enable the ertc clock */
65 crm_ertc_clock_enable(TRUE);
66
67 /* deinitializes the ertc registers */
68 ertc_reset();
69
70 /* wait for ertc apb registers synchronisation */
71 ertc_wait_update();
72
73 /* configure the ertc data register and ertc prescaler
74 ck_spre(1hz) = ertcclk(lext) /(ertc_clk_div_a + 1)*(ertc_clk_div_b + 1)*/
75 ertc_divider_set(127, 255);
76
77 /* configure the hour format is 24-hour format*/
78 ertc_hour_mode_set(ERTC_HOUR_MODE_24);
79
80 /* set the date: friday june 11th 2021 */
81 ertc_date_set(21, 6, 11, 5);
82
83 /* set the time to 06h 20mn 00s am */
84 ertc_time_set(6, 20, 0, ERTC_AM);
85}
86
92void ertc_alarm_config(void)
93{
94 /* set the alarm 05h:20min:10s */
95 ertc_alarm_mask_set(ERTC_ALA, ERTC_ALARM_MASK_DATE_WEEK | ERTC_ALARM_MASK_HOUR | ERTC_ALARM_MASK_MIN);
96 ertc_alarm_week_date_select(ERTC_ALA, ERTC_SLECT_DATE);
97
98 /* enable ertc alarm a interrupt */
99 ertc_interrupt_enable(ERTC_ALA_INT, TRUE);
100}
101
107void ertc_alarm_value_set(uint32_t alam_index)
108{
109 ertc_time_type ertc_time_struct;
110
111 /* disable the alarm */
112 ertc_alarm_enable(ERTC_ALA, FALSE);
113 ertc_calendar_get(&ertc_time_struct);
114 ertc_alarm_set(ERTC_ALA, ertc_time_struct.day, ertc_time_struct.hour, ertc_time_struct.min, (ertc_time_struct.sec + alam_index)% 60, ertc_time_struct.ampm);
115
116 /* disable the alarm */
117 ertc_alarm_enable(ERTC_ALA, TRUE);
118}
119
125int main(void)
126{
127 __IO uint32_t index = 0;
128
129 /* congfig the system clock */
130 system_clock_config();
131
132 /* init at start board */
133 at32_board_init();
134
135 /* config priority group */
136 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
137
138 /* turn on the led light */
139 at32_led_off(LED2);
140 at32_led_off(LED3);
141 at32_led_off(LED4);
142
143 /* enable pwc clock */
144 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
145
146 if(pwc_flag_get(PWC_STANDBY_FLAG) != RESET)
147 {
148 /* wakeup from standby */
149 pwc_flag_clear(PWC_STANDBY_FLAG);
150 at32_led_on(LED2);
151 }
152
153 if(pwc_flag_get(PWC_WAKEUP_FLAG) != RESET)
154 {
155 /* wakeup event occurs */
156 pwc_flag_clear(PWC_WAKEUP_FLAG);
157 at32_led_on(LED3);
158 }
159
160 /* config ertc */
161 ertc_config();
162
163 at32_led_on(LED4);
164 ertc_alarm_config();
165 for(index = 0; index < 0xFFFFFF; index++);
166
167 /* set the wakeup time to 3 seconds */
168 ertc_alarm_value_set(3);
169
170 /* enter standby mode */
171 pwc_standby_mode_enter();
172
173 while(1)
174 {
175 }
176}
177
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
main
int main(void)
main function.
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c:125
ertc_config
void ertc_config(void)
ertc configuration.
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c:46
ertc_alarm_value_set
void ertc_alarm_value_set(uint32_t alam_index)
ertc alarm value set.
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c:107
ertc_alarm_config
void ertc_alarm_config(void)
ertc alarm configuration.
Definition: project/at_start_f415/examples/pwc/standby_ertc_alarm/src/main.c:92
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_ertc_clock_select
void crm_ertc_clock_select(crm_ertc_clock_type value)
select ertc clock
Definition: at32f415_crm.c:377
crm_ertc_clock_enable
void crm_ertc_clock_enable(confirm_state new_state)
enable or disable ertc
Definition: at32f415_crm.c:387
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_battery_powered_domain_reset
void crm_battery_powered_domain_reset(confirm_state new_state)
battery powered domain software reset
Definition: at32f415_crm.c:496
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_CLOCK_SOURCE_LEXT
@ CRM_CLOCK_SOURCE_LEXT
Definition: at32f415_crm.h:306
CRM_ERTC_CLOCK_LEXT
@ CRM_ERTC_CLOCK_LEXT
Definition: at32f415_crm.h:383
CRM_LEXT_STABLE_FLAG
#define CRM_LEXT_STABLE_FLAG
Definition: at32f415_crm.h:58
ertc_hour_mode_set
error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode)
ertc hour mode set.
Definition: at32f415_ertc.c:283
ertc_wait_update
error_status ertc_wait_update(void)
ertc wait register update finish.
Definition: at32f415_ertc.c:97
ertc_time_set
error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time.
Definition: at32f415_ertc.c:363
ertc_reset
error_status ertc_reset(void)
ertc reset all register.
Definition: at32f415_ertc.c:207
ertc_alarm_mask_set
void ertc_alarm_mask_set(ertc_alarm_type alarm_x, uint32_t mask)
set which bits are irrelevant to the alarm match.
Definition: at32f415_ertc.c:458
ertc_interrupt_enable
void ertc_interrupt_enable(uint32_t source, confirm_state new_state)
enable or disable interrupt.
Definition: at32f415_ertc.c:1340
ertc_alarm_week_date_select
void ertc_alarm_week_date_select(ertc_alarm_type alarm_x, ertc_week_date_select_type wk)
alarm week or date mode select.
Definition: at32f415_ertc.c:500
ertc_date_set
error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date.
Definition: at32f415_ertc.c:314
ertc_alarm_set
void ertc_alarm_set(ertc_alarm_type alarm_x, uint8_t week_date, uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set alarm.
Definition: at32f415_ertc.c:538
ertc_calendar_get
void ertc_calendar_get(ertc_time_type *time)
get calendar
Definition: at32f415_ertc.c:404
ertc_divider_set
error_status ertc_divider_set(uint16_t div_a, uint16_t div_b)
ertc division set.
Definition: at32f415_ertc.c:251
ertc_alarm_enable
error_status ertc_alarm_enable(ertc_alarm_type alarm_x, confirm_state new_state)
enable or disable alarm clock.
Definition: at32f415_ertc.c:629
ERTC_SLECT_DATE
@ ERTC_SLECT_DATE
Definition: at32f415_ertc.h:124
ERTC_HOUR_MODE_24
@ ERTC_HOUR_MODE_24
Definition: at32f415_ertc.h:105
ERTC_ALA
@ ERTC_ALA
Definition: at32f415_ertc.h:133
ERTC_AM
@ ERTC_AM
Definition: at32f415_ertc.h:115
ERTC_ALARM_MASK_DATE_WEEK
#define ERTC_ALARM_MASK_DATE_WEEK
Definition: at32f415_ertc.h:89
ERTC_ALARM_MASK_HOUR
#define ERTC_ALARM_MASK_HOUR
Definition: at32f415_ertc.h:88
ERTC_ALARM_MASK_MIN
#define ERTC_ALARM_MASK_MIN
Definition: at32f415_ertc.h:87
ERTC_ALA_INT
#define ERTC_ALA_INT
Definition: at32f415_ertc.h:53
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_battery_powered_domain_access
void pwc_battery_powered_domain_access(confirm_state new_state)
enable or disable access to the battery powered domain.
Definition: at32f415_pwc.c:61
pwc_standby_mode_enter
void pwc_standby_mode_enter(void)
enter pwc standby mode
Definition: at32f415_pwc.c:223
pwc_flag_get
flag_status pwc_flag_get(uint32_t pwc_flag)
get flag of pwc
Definition: at32f415_pwc.c:144
pwc_flag_clear
void pwc_flag_clear(uint32_t pwc_flag)
clear flag of pwc
Definition: at32f415_pwc.c:127
PWC_STANDBY_FLAG
#define PWC_STANDBY_FLAG
Definition: at32f415_pwc.h:53
PWC_WAKEUP_FLAG
#define PWC_WAKEUP_FLAG
Definition: at32f415_pwc.h:52
ertc_time_type
ertc time
Definition: at32f415_ertc.h:371
ertc_time_type::ampm
ertc_am_pm_type ampm
Definition: at32f415_ertc.h:379
ertc_time_type::day
uint8_t day
Definition: at32f415_ertc.h:374
ertc_time_type::hour
uint8_t hour
Definition: at32f415_ertc.h:375
ertc_time_type::min
uint8_t min
Definition: at32f415_ertc.h:376
ertc_time_type::sec
uint8_t sec
Definition: at32f415_ertc.h:377
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • pwc
  • standby_wakeup_pin
  • inc
project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • pwc
  • standby_wakeup_pin
  • inc
project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • pwc
  • standby_wakeup_pin
  • inc
project/at_start_f415/examples/pwc/standby_wakeup_pin/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • pwc
  • standby_wakeup_pin
  • src
project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • pwc
  • standby_wakeup_pin
  • src
project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/pwc/standby_wakeup_pin/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • pwc
  • standby_wakeup_pin
  • src
project/at_start_f415/examples/pwc/standby_wakeup_pin/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include <stdio.h>
30
44int main(void)
45{
46 __IO uint32_t index = 0;
47
48 /* congfig the system clock */
49 system_clock_config();
50
51 /* init at start board */
52 at32_board_init();
53
54 /* config priority group */
55 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
56
57 /* turn on the led light */
58 at32_led_off(LED2);
59 at32_led_off(LED3);
60 at32_led_off(LED4);
61
62 /* enable pwc clock */
63 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
64
65 if(pwc_flag_get(PWC_STANDBY_FLAG) != RESET)
66 {
67 /* wakeup from standby */
68 pwc_flag_clear(PWC_STANDBY_FLAG);
69 at32_led_on(LED2);
70 }
71
72 if(pwc_flag_get(PWC_WAKEUP_FLAG) != RESET)
73 {
74 /* wakeup event occurs */
75 pwc_flag_clear(PWC_WAKEUP_FLAG);
76 at32_led_on(LED3);
77 }
78
79 at32_led_on(LED4);
80 for(index = 0; index < 0xFFFFFF; index++);
81
82 /* enable wakeup pin - pa0 */
83 pwc_wakeup_pin_enable(PWC_WAKEUP_PIN_1, TRUE);
84
85 /* enter standby mode */
86 pwc_standby_mode_enter();
87 while(1)
88 {
89 }
90}
91
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
main
int main(void)
main function.
Definition: project/at_start_f415/examples/pwc/standby_wakeup_pin/src/main.c:44
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_standby_mode_enter
void pwc_standby_mode_enter(void)
enter pwc standby mode
Definition: at32f415_pwc.c:223
pwc_flag_get
flag_status pwc_flag_get(uint32_t pwc_flag)
get flag of pwc
Definition: at32f415_pwc.c:144
pwc_flag_clear
void pwc_flag_clear(uint32_t pwc_flag)
clear flag of pwc
Definition: at32f415_pwc.c:127
pwc_wakeup_pin_enable
void pwc_wakeup_pin_enable(uint32_t pin_num, confirm_state new_state)
enable or disable pwc standby wakeup pin
Definition: at32f415_pwc.c:106
PWC_STANDBY_FLAG
#define PWC_STANDBY_FLAG
Definition: at32f415_pwc.h:53
PWC_WAKEUP_FLAG
#define PWC_WAKEUP_FLAG
Definition: at32f415_pwc.h:52
PWC_WAKEUP_PIN_1
#define PWC_WAKEUP_PIN_1
pwc wakeup pin num definition
Definition: at32f415_pwc.h:63
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • sdio
  • sd_mmc_card
  • inc
project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • sdio
  • sd_mmc_card
  • inc
project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • sdio
  • sd_mmc_card
  • inc
project/at_start_f415/examples/sdio/sd_mmc_card/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • sdio
  • sd_mmc_card
  • src
project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • sdio
  • sd_mmc_card
  • src
project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • sdio
  • sd_mmc_card
  • src
project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c
Go to the documentation of this file.
1
27#include <stdbool.h>
28#include <string.h>
29#include "at32_sdio.h"
30#include "at32f415_board.h"
31#include "at32f415_clock.h"
32
41#define BLOCK_SIZE (512)
42#define BLOCKS_NUMBER (8)
43#define MULTI_BUFFER_SIZE (BLOCK_SIZE * BLOCKS_NUMBER)
44#define STREAM_BUFFER_SIZE (1024)
45
46static uint8_t sblock_tbuffer[BLOCK_SIZE], sblock_rbuffer[BLOCK_SIZE];
47static uint8_t mblock_tbuffer[MULTI_BUFFER_SIZE], mblock_rbuffer[MULTI_BUFFER_SIZE];
48static uint8_t stream_tbuffer[STREAM_BUFFER_SIZE], stream_rbuffer[STREAM_BUFFER_SIZE];
49
50static error_status sd_single_block_test(void);
51static error_status sd_multiple_blocks_test(void);
52uint8_t buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length);
53static void sd_test_error(void);
54static void nvic_configuration(void);
55
62static error_status sd_single_block_test(void)
63{
64 sd_error_status_type status = SD_OK;
65 uint8_t bus_width;
66
67 /* test 1-bit and 4-bit width */
68 for(bus_width = 0; bus_width < 2; bus_width++)
69 {
70 memset(sblock_tbuffer, bus_width + 0xAB, BLOCK_SIZE);
71 memset(sblock_rbuffer, 0, BLOCK_SIZE);
72
73 /* set data width */
74 status = sd_wide_bus_operation_config((sdio_bus_width_type)bus_width);
75 if(status != SD_OK)
76 {
77 return ERROR;
78 }
79
80 /* write block of 512 bytes on address 0 */
81 status = sd_block_write(sblock_tbuffer, 0x00, BLOCK_SIZE);
82 if(status != SD_OK)
83 {
84 return ERROR;
85 }
86
87 /* read block of 512 bytes from address 0 */
88 status = sd_block_read(sblock_rbuffer, 0x00, BLOCK_SIZE);
89 if(status != SD_OK)
90 {
91 return ERROR;
92 }
93
94 if(!buffer_compare(sblock_tbuffer, sblock_rbuffer, BLOCK_SIZE))
95 {
96 return ERROR;
97 }
98 }
99
100 return SUCCESS;
101}
102
109static error_status sd_multiple_blocks_test(void)
110{
111 sd_error_status_type status = SD_OK;
112 uint8_t bus_width;
113
114 /* test 1-bit and 4-bit width */
115 for(bus_width = 0; bus_width < 2; bus_width++)
116 {
117 memset(mblock_tbuffer, bus_width + 0x3C, MULTI_BUFFER_SIZE);
118 memset(mblock_rbuffer, 0, MULTI_BUFFER_SIZE);
119
120 /* set data width */
121 status = sd_wide_bus_operation_config((sdio_bus_width_type)bus_width);
122 if(status != SD_OK)
123 {
124 return ERROR;
125 }
126
127 /* write multiple block of many bytes on address 0 */
128 status = sd_mult_blocks_write(mblock_tbuffer, 0x00, BLOCK_SIZE, BLOCKS_NUMBER);
129 if(status != SD_OK)
130 {
131 return ERROR;
132 }
133
134 /* read block of many bytes from address 0 */
135 status = sd_mult_blocks_read(mblock_rbuffer, 0x00, BLOCK_SIZE, BLOCKS_NUMBER);
136 if(status != SD_OK)
137 {
138 return ERROR;
139 }
140
141 /* check the correctness of written data */
142 if(!buffer_compare(mblock_tbuffer, mblock_rbuffer, MULTI_BUFFER_SIZE))
143 {
144 return ERROR;
145 }
146 }
147
148 return SUCCESS;
149}
150
157static error_status mmc_stream_test(void)
158{
159 sd_error_status_type status = SD_OK;
160 uint8_t bus_width;
161
162 /* only test 1-bit width */
163 for(bus_width = 0; bus_width < 1; bus_width++)
164 {
165 memset(stream_tbuffer, bus_width+0x5A, STREAM_BUFFER_SIZE);
166 memset(stream_rbuffer, 0, STREAM_BUFFER_SIZE);
167
168 /* set data width */
169 status = sd_wide_bus_operation_config((sdio_bus_width_type)bus_width);
170 if(status != SD_OK)
171 {
172 return ERROR;
173 }
174
175 /* write stream of many bytes on address 0 */
176 status = mmc_stream_write(stream_tbuffer, 0x00, STREAM_BUFFER_SIZE);
177 if (status != SD_OK)
178 {
179 return ERROR;
180 }
181
182 /* read stream of many bytes from address 0 */
183 status = mmc_stream_read(stream_rbuffer, 0x00, STREAM_BUFFER_SIZE);
184 if (status != SD_OK)
185 {
186 return ERROR;
187 }
188
189 /* check the correctness of written data */
190 if(!buffer_compare(stream_tbuffer, stream_rbuffer, STREAM_BUFFER_SIZE))
191 {
192 return ERROR;
193 }
194 }
195
196 return SUCCESS;
197}
198
206uint8_t buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length)
207{
208 while(buffer_length--)
209 {
210 if(*pbuffer1 != *pbuffer2)
211 {
212 return 0;
213 }
214 pbuffer1++;
215 pbuffer2++;
216 }
217 return 1;
218}
219
225static void sd_test_error(void)
226{
227 at32_led_on(LED2);
228 delay_ms(300);
229 at32_led_off(LED2);
230 delay_ms(300);
231}
232
238static void nvic_configuration(void)
239{
240 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
241 nvic_irq_enable(SDIO1_IRQn, 0, 0);
242}
243
249void show_card_info(void)
250{
251 printf("---------------------\r\n");
252 switch(sd_card_info.card_type)
253 {
254 case SDIO_STD_CAPACITY_SD_CARD_V1_1: printf("card type: SDSC V1.1\r\n");break;
255 case SDIO_STD_CAPACITY_SD_CARD_V2_0: printf("card type: SDSC V2.0\r\n");break;
256 case SDIO_HIGH_CAPACITY_SD_CARD: printf("card type: SDHC V2.0\r\n");break;
257 case SDIO_MULTIMEDIA_CARD: printf("card type: MMC Card\r\n");break;
258 }
259 printf("card manufacturer_id: %d\r\n", sd_card_info.sd_cid_reg.manufacturer_id);
260 printf("card rca: 0x%X\r\n", sd_card_info.rca);
261 printf("card c_size = %u\r\n", sd_card_info.sd_csd_reg.device_size);
262 printf("card capacity: %uMB %uKB\r\n", (uint32_t)(sd_card_info.card_capacity>>20), (uint32_t)(sd_card_info.card_capacity>>10));
263 printf("card block_size: %d\r\n", sd_card_info.card_blk_size);
264 printf("---------------------\r\n");
265}
266
267/* gloable functions ---------------------------------------------------------*/
273int main(void)
274{
275 system_clock_config();
276
277 at32_board_init();
278
279 nvic_configuration();
280
281 uart_print_init(115200);
282 printf("start test..\r\n");
283
284 /* sdio init */
285 if(SD_OK != sd_init())
286 {
287 printf("sdio init fail\r\n");
288 while(1)
289 {
290 sd_test_error();
291 }
292 }
293 printf("sdio init ok\r\n");
294 show_card_info();
295
296 /* sd card single block test */
297 if(SUCCESS != sd_single_block_test())
298 {
299 printf("sd card single block test fail\r\n");
300 /* single block test fail, led2 fresh */
301 while(1)
302 {
303 sd_test_error();
304 }
305 }
306 printf("sd card single block test ok\r\n");
307
308 /* sd card multiple blocks test */
309 if(SUCCESS != sd_multiple_blocks_test())
310 {
311 printf("sd card multiple blocks test fail\r\n");
312 /* multiple blocks test fail, led2 fresh */
313 while(1)
314 {
315 sd_test_error();
316 }
317 }
318 printf("sd card multiple blocks test ok\r\n");
319
320 /* mmc card stream data transfer test */
321 if(sd_card_info.card_type == SDIO_MULTIMEDIA_CARD)
322 {
323 if(SUCCESS != mmc_stream_test())
324 {
325 printf("mmc card stream data test fail\r\n");
326 /* mmc card stream data test fail, led2 fresh */
327 while(1)
328 {
329 sd_test_error();
330 }
331 }
332 printf("mmc card stream data test ok\r\n");
333 }
334
335 /* all tests pass, led3 and led4 fresh */
336 while(1)
337 {
338 at32_led_toggle(LED3);
339 at32_led_toggle(LED4);
340 delay_ms(300);
341 }
342}
343
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
sd_card_info
sd_card_info_struct_type sd_card_info
Definition: sd_mmc_card/src/at32_sdio.c:47
STREAM_BUFFER_SIZE
#define STREAM_BUFFER_SIZE
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:44
buffer_compare
uint8_t buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:206
stream_tbuffer
static uint8_t stream_tbuffer[(1024)]
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:48
sd_test_error
static void sd_test_error(void)
LED2 on off every 300ms for sd test failed.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:225
mmc_stream_test
static error_status mmc_stream_test(void)
mmc card data stream read/write test.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:157
BLOCKS_NUMBER
#define BLOCKS_NUMBER
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:42
sd_single_block_test
static error_status sd_single_block_test(void)
sd card single block read/write test.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:62
stream_rbuffer
static uint8_t stream_rbuffer[(1024)]
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:48
sblock_rbuffer
static uint8_t sblock_rbuffer[(512)]
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:46
sd_multiple_blocks_test
static error_status sd_multiple_blocks_test(void)
sd card multiple blocks read/write test.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:109
show_card_info
void show_card_info(void)
show sd/mmc card info.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:249
mblock_tbuffer
static uint8_t mblock_tbuffer[((512) *(8))]
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:47
sblock_tbuffer
static uint8_t sblock_tbuffer[(512)]
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:46
MULTI_BUFFER_SIZE
#define MULTI_BUFFER_SIZE
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:43
nvic_configuration
static void nvic_configuration(void)
configures sdio1 irq channel.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:238
main
int main(void)
main function.
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:273
BLOCK_SIZE
#define BLOCK_SIZE
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:41
mblock_rbuffer
static uint8_t mblock_rbuffer[((512) *(8))]
Definition: project/at_start_f415/examples/sdio/sd_mmc_card/src/main.c:47
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
SDIO1_IRQn
@ SDIO1_IRQn
Definition: at32f415.h:179
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
sdio_bus_width_type
sdio_bus_width_type
sdio bus width
Definition: at32f415_sdio.h:139
mmc_stream_write
sd_error_status_type mmc_stream_write(uint8_t *buf, long long addr, uint32_t len)
write mmc card data stream.
Definition: sd_mmc_card/src/at32_sdio.c:1693
sd_block_read
sd_error_status_type sd_block_read(uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma ...
Definition: sd_mmc_card/src/at32_sdio.c:1180
sd_mult_blocks_write
sd_error_status_type sd_mult_blocks_write(const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed ...
Definition: sd_mmc_card/src/at32_sdio.c:1482
sd_block_write
sd_error_status_type sd_block_write(const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be manag...
Definition: sd_mmc_card/src/at32_sdio.c:1360
sd_init
sd_error_status_type sd_init(void)
initializes the sd card and put it into standby state (ready for data transfer).
Definition: sd_mmc_card/src/at32_sdio.c:71
mmc_stream_read
sd_error_status_type mmc_stream_read(uint8_t *buf, long long addr, uint32_t len)
read mmc card data stream.
Definition: sd_mmc_card/src/at32_sdio.c:1646
sd_mult_blocks_read
sd_error_status_type sd_mult_blocks_read(uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mod...
Definition: sdio_fatfs/src/at32_sdio.c:1276
sd_wide_bus_operation_config
sd_error_status_type sd_wide_bus_operation_config(sdio_bus_width_type mode)
enable wide bus opeartion for the requeseted card if supported by card.
Definition: sd_mmc_card/src/at32_sdio.c:735
sd_error_status_type
sd_error_status_type
Definition: sd_mmc_card/inc/at32_sdio.h:74
SD_OK
@ SD_OK
Definition: sd_mmc_card/inc/at32_sdio.h:119
SDIO_HIGH_CAPACITY_SD_CARD
@ SDIO_HIGH_CAPACITY_SD_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:206
SDIO_STD_CAPACITY_SD_CARD_V1_1
@ SDIO_STD_CAPACITY_SD_CARD_V1_1
Definition: sd_mmc_card/inc/at32_sdio.h:204
SDIO_STD_CAPACITY_SD_CARD_V2_0
@ SDIO_STD_CAPACITY_SD_CARD_V2_0
Definition: sd_mmc_card/inc/at32_sdio.h:205
SDIO_MULTIMEDIA_CARD
@ SDIO_MULTIMEDIA_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:207
sd_card_info_struct_type::card_capacity
long long card_capacity
Definition: sd_mmc_card/inc/at32_sdio.h:241
sd_card_info_struct_type::sd_cid_reg
sd_cid_struct_type sd_cid_reg
Definition: sd_mmc_card/inc/at32_sdio.h:239
sd_card_info_struct_type::sd_csd_reg
sd_csd_struct_type sd_csd_reg
Definition: sd_mmc_card/inc/at32_sdio.h:238
sd_card_info_struct_type::card_blk_size
uint32_t card_blk_size
Definition: sd_mmc_card/inc/at32_sdio.h:242
sd_card_info_struct_type::rca
uint16_t rca
Definition: sd_mmc_card/inc/at32_sdio.h:243
sd_card_info_struct_type::card_type
uint8_t card_type
Definition: sd_mmc_card/inc/at32_sdio.h:244
sd_cid_struct_type::manufacturer_id
uint8_t manufacturer_id
Definition: sd_mmc_card/inc/at32_sdio.h:171
sd_csd_struct_type::device_size
uint32_t device_size
Definition: sd_mmc_card/inc/at32_sdio.h:140
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • sdio
  • sdio_fatfs
  • inc
project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • sdio
  • sdio_fatfs
  • inc
project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • sdio
  • sdio_fatfs
  • inc
project/at_start_f415/examples/sdio/sdio_fatfs/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • sdio
  • sdio_fatfs
  • src
project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • sdio
  • sdio_fatfs
  • src
project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • sdio
  • sdio_fatfs
  • src
project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c
Go to the documentation of this file.
1
27#include <stdbool.h>
28#include <string.h>
29#include "at32_sdio.h"
30#include "at32f415_board.h"
31#include "at32f415_clock.h"
32#include "ff.h"
33
42FATFS fs;
43FIL file;
44BYTE work[FF_MAX_SS];
45
46uint8_t buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length);
47static void sd_test_error(void);
48static void nvic_configuration(void);
49
57uint8_t buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length)
58{
59 while(buffer_length--)
60 {
61 if(*pbuffer1 != *pbuffer2)
62 {
63 return 0;
64 }
65 pbuffer1++;
66 pbuffer2++;
67 }
68 return 1;
69}
70
76static void sd_test_error(void)
77{
78 at32_led_on(LED2);
79 delay_ms(300);
80 at32_led_off(LED2);
81 delay_ms(300);
82}
83
89static void nvic_configuration(void)
90{
91 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
92 nvic_irq_enable(SDIO1_IRQn, 0, 0);
93}
94
101static error_status fatfs_test(void)
102{
103 FRESULT ret;
104 char filename[] = "1:/test1.txt";
105 const char wbuf[] = "this is my file for test fatfs!\r\n";
106 char rbuf[50];
107 UINT bytes_written = 0;
108 UINT bytes_read = 0;
109 DWORD fre_clust, fre_sect, tot_sect;
110 FATFS* pt_fs;
111
112 ret = f_mount(&fs, "1:", 1);
113 if(ret){
114 printf("fs mount err:%d.\r\n", ret);
115 if(ret == FR_NO_FILESYSTEM){
116 printf("create fatfs..\r\n");
117 ret = f_mkfs("1:", 0, work, sizeof(work));
118 if(ret){
119 printf("creates fatfs err:%d.\r\n", ret);
120 return ERROR;
121 }
122 else{
123 printf("creates fatfs ok.\r\n");
124 }
125 ret = f_mount(NULL, "1:", 1);
126 ret = f_mount(&fs, "1:", 1);
127 if(ret){
128 printf("fs mount err:%d.\r\n", ret);
129 return ERROR;
130 }
131 else{
132 printf("fs mount ok.\r\n");
133 }
134 }
135 else{
136 return ERROR;
137 }
138 }
139 else{
140 printf("fs mount ok.\r\n");
141 }
142
143 ret = f_open(&file, filename, FA_READ | FA_WRITE | FA_CREATE_ALWAYS);
144 if(ret){
145 printf("open file err:%d.\r\n", ret);
146 }
147 else{
148 printf("open file ok.\r\n");
149 }
150 ret = f_write(&file, wbuf, sizeof(wbuf), &bytes_written);
151 if(ret){
152 printf("write file err:%d.\r\n", ret);
153 }
154 else{
155 printf("write file ok, byte:%u.\r\n", bytes_written);
156 }
157 f_lseek(&file, 0);
158 ret = f_read(&file, rbuf, sizeof(rbuf), &bytes_read);
159 if(ret){
160 printf("read file err:%d.\r\n", ret);
161 }
162 else{
163 printf("read file ok, byte:%u.\r\n", bytes_read);
164 }
165 ret = f_close(&file);
166 if(ret){
167 printf("close file err:%d.\r\n", ret);
168 }
169 else{
170 printf("close file ok.\r\n");
171 }
172
173 pt_fs = &fs;
174 /* get volume information and free clusters of drive 1 */
175 ret = f_getfree("1:", &fre_clust, &pt_fs);
176 if(ret == FR_OK)
177 {
178 /* get total sectors and free sectors */
179 tot_sect = (pt_fs->n_fatent - 2) * pt_fs->csize;
180 fre_sect = fre_clust * pt_fs->csize;
181
182 /* print the free space (assuming 512 bytes/sector) */
183 printf("%10u KiB total drive space.\r\n%10u KiB available.\r\n", tot_sect / 2, fre_sect / 2);
184 }
185
186 ret = f_mount(NULL, "1:", 1);
187
188 if(1 == buffer_compare((uint8_t*)rbuf, (uint8_t*)wbuf, sizeof(wbuf))){
189 printf("r/w file data test ok.\r\n");
190 }
191 else{
192 printf("r/w file data test fail.\r\n");
193 return ERROR;
194 }
195
196 return SUCCESS;
197}
198
199/* gloable functions ---------------------------------------------------------*/
205int main(void)
206{
207 system_clock_config();
208
209 at32_board_init();
210
211 nvic_configuration();
212
213 uart_print_init(115200);
214 printf("start test fatfs r0.14b..\r\n");
215
216 if(SUCCESS != fatfs_test())
217 {
218 while(1)
219 {
220 sd_test_error();
221 }
222 }
223
224 /* all tests pass, led3 and led4 fresh */
225 while(1)
226 {
227 at32_led_toggle(LED3);
228 at32_led_toggle(LED4);
229 delay_ms(300);
230 }
231}
232
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
buffer_compare
uint8_t buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c:57
file
FIL file
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c:43
sd_test_error
static void sd_test_error(void)
led2 on off every 300ms for sd test failed.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c:76
work
BYTE work[FF_MAX_SS]
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c:44
nvic_configuration
static void nvic_configuration(void)
configures sdio1 irq channel.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c:89
main
int main(void)
main function.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c:205
fatfs_test
static error_status fatfs_test(void)
fatfs file read/write test.
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c:101
fs
FATFS fs
Definition: project/at_start_f415/examples/sdio/sdio_fatfs/src/main.c:42
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
SDIO1_IRQn
@ SDIO1_IRQn
Definition: at32f415.h:179
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
FF_MAX_SS
#define FF_MAX_SS
Definition: sdio/sdio_fatfs/inc/ffconf.h:197
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • spi
  • crc_transfer_polling
  • inc
project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • spi
  • crc_transfer_polling
  • inc
project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • spi
  • crc_transfer_polling
  • inc
project/at_start_f415/examples/spi/crc_transfer_polling/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • spi
  • crc_transfer_polling
  • src
project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • spi
  • crc_transfer_polling
  • src
project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • spi
  • crc_transfer_polling
  • src
project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define BUFFER_SIZE 32
39
40uint16_t spi1_tx_buffer[BUFFER_SIZE] = {0x0102, 0x0304, 0x0506, 0x0708, 0x090A, 0x0B0C, 0x0D0E, 0x0F10,
41 0x1112, 0x1314, 0x1516, 0x1718, 0x191A, 0x1B1C, 0x1D1E, 0x1F20,
42 0x2122, 0x2324, 0x2526, 0x2728, 0x292A, 0x2B2C, 0x2D2E, 0x2F30,
43 0x3132, 0x3334, 0x3536, 0x3738, 0x393A, 0x3B3C, 0x3D3E, 0x3F40};
44uint16_t spi2_tx_buffer[BUFFER_SIZE] = {0x5152, 0x5354, 0x5556, 0x5758, 0x595A, 0x5B5C, 0x5D5E, 0x5F60,
45 0x6162, 0x6364, 0x6566, 0x6768, 0x696A, 0x6B6C, 0x6D6E, 0x6F70,
46 0x7172, 0x7374, 0x7576, 0x7778, 0x797A, 0x7B7C, 0x7D7E, 0x7F80,
47 0x8182, 0x8384, 0x8586, 0x8788, 0x898A, 0x8B8C, 0x8D8E, 0x8F90};
48uint16_t spi1_rx_buffer[BUFFER_SIZE], spi2_rx_buffer[BUFFER_SIZE];
49uint32_t tx_index = 0, rx_index = 0;
50__IO uint16_t crc1_value = 0, crc2_value = 0;
51volatile error_status transfer_status1 = ERROR, transfer_status2 = ERROR;
52
53static void gpio_config(void);
54static void spi_config(void);
55 error_status buffer_compare(uint16_t* pbuffer1, uint16_t* pbuffer2, uint16_t buffer_length);
56
63 error_status buffer_compare(uint16_t* pbuffer1, uint16_t* pbuffer2, uint16_t buffer_length)
64{
65 while(buffer_length--)
66 {
67 if(*pbuffer1 != *pbuffer2)
68 {
69 return ERROR;
70 }
71 pbuffer1++;
72 pbuffer2++;
73 }
74 return SUCCESS;
75}
76
82static void spi_config(void)
83{
84 spi_init_type spi_init_struct;
85 crm_periph_clock_enable(CRM_SPI1_PERIPH_CLOCK, TRUE);
86 crm_periph_clock_enable(CRM_SPI2_PERIPH_CLOCK, TRUE);
87 spi_default_para_init(&spi_init_struct);
88 spi_init_struct.transmission_mode = SPI_TRANSMIT_FULL_DUPLEX;
89 spi_init_struct.master_slave_mode = SPI_MODE_MASTER;
90 spi_init_struct.mclk_freq_division = SPI_MCLK_DIV_8;
91 spi_init_struct.first_bit_transmission = SPI_FIRST_BIT_MSB;
92 spi_init_struct.frame_bit_num = SPI_FRAME_16BIT;
93 spi_init_struct.clock_polarity = SPI_CLOCK_POLARITY_LOW;
94 spi_init_struct.clock_phase = SPI_CLOCK_PHASE_2EDGE;
95 spi_init_struct.cs_mode_selection = SPI_CS_SOFTWARE_MODE;
96 spi_init(SPI1, &spi_init_struct);
97
98 spi_init_struct.master_slave_mode = SPI_MODE_SLAVE;
99 spi_init(SPI2, &spi_init_struct);
100
101 spi_crc_polynomial_set(SPI1, 7);
102 spi_crc_polynomial_set(SPI2, 7);
103 spi_crc_enable(SPI1, TRUE);
104 spi_crc_enable(SPI2, TRUE);
105 spi_enable(SPI1, TRUE);
106 spi_enable(SPI2, TRUE);
107}
108
114static void gpio_config(void)
115{
116 gpio_init_type gpio_initstructure;
117 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
118 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
119
120 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
121 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
122 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
123 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
124 gpio_initstructure.gpio_pins = GPIO_PINS_5;
125 gpio_init(GPIOA, &gpio_initstructure);
126
127 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
128 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
129 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
130 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
131 gpio_initstructure.gpio_pins = GPIO_PINS_6;
132 gpio_init(GPIOA, &gpio_initstructure);
133
134 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
135 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
136 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
137 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
138 gpio_initstructure.gpio_pins = GPIO_PINS_7;
139 gpio_init(GPIOA, &gpio_initstructure);
140
141 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
142 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
143 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
144 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
145 gpio_initstructure.gpio_pins = GPIO_PINS_13;
146 gpio_init(GPIOB, &gpio_initstructure);
147
148 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
149 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
150 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
151 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
152 gpio_initstructure.gpio_pins = GPIO_PINS_14;
153 gpio_init(GPIOB, &gpio_initstructure);
154
155 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
156 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
157 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
158 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
159 gpio_initstructure.gpio_pins = GPIO_PINS_15;
160 gpio_init(GPIOB, &gpio_initstructure);
161}
162
168int main(void)
169{
170 system_clock_config();
171 at32_board_init();
172 gpio_config();
173 spi_config();
174
175 /* transfer procedure:the "BUFFER_SIZE-1" data transfer */
176 while(tx_index < BUFFER_SIZE - 1)
177 {
178 while(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) == RESET);
179 spi_i2s_data_transmit(SPI2, spi2_tx_buffer[tx_index]);
180 spi_i2s_data_transmit(SPI1, spi1_tx_buffer[tx_index++]);
181 while(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) == RESET);
182 spi2_rx_buffer[rx_index] = spi_i2s_data_receive(SPI2);
183 while(spi_i2s_flag_get(SPI1, SPI_I2S_RDBF_FLAG) == RESET);
184 spi1_rx_buffer[rx_index++] = spi_i2s_data_receive(SPI1);
185 }
186 while(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) == RESET);
187 while(spi_i2s_flag_get(SPI2, SPI_I2S_TDBE_FLAG) == RESET);
188
189 /* transfer procedure:the last data and crc transfer */
190 spi_i2s_data_transmit(SPI2, spi2_tx_buffer[tx_index]);
191 spi_crc_next_transmit(SPI2);
192 spi_i2s_data_transmit(SPI1, spi1_tx_buffer[tx_index]);
193 spi_crc_next_transmit(SPI1);
194 while(spi_i2s_flag_get(SPI1, SPI_I2S_RDBF_FLAG) == RESET);
195 spi1_rx_buffer[rx_index] = spi_i2s_data_receive(SPI1);
196 while(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) == RESET);
197 spi2_rx_buffer[rx_index] = spi_i2s_data_receive(SPI2);
198 while(spi_i2s_flag_get(SPI1, SPI_I2S_RDBF_FLAG) == RESET);
199 while(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) == RESET);
200
201 /* test result:the data and crc check */
202 transfer_status1 = buffer_compare(spi2_rx_buffer, spi1_tx_buffer, BUFFER_SIZE);
203 transfer_status2 = buffer_compare(spi1_rx_buffer, spi2_tx_buffer, BUFFER_SIZE);
204 if((spi_i2s_flag_get(SPI1, SPI_CCERR_FLAG)) != RESET)
205 {
206 spi_i2s_flag_clear(SPI1, SPI_CCERR_FLAG);
207 transfer_status2 = ERROR;
208 }
209 if((spi_i2s_flag_get(SPI2, SPI_CCERR_FLAG)) != RESET)
210 {
211 spi_i2s_flag_clear(SPI2, SPI_CCERR_FLAG);
212 transfer_status1 = ERROR;
213 }
214 crc1_value = spi_i2s_data_receive(SPI1);
215 crc2_value = spi_i2s_data_receive(SPI2);
216
217 /* test result indicate:if success ,led2 lights */
218 if((transfer_status1 == SUCCESS) && (transfer_status2 == SUCCESS))
219 {
220 at32_led_on(LED2);
221 }
222 else
223 {
224 at32_led_off(LED2);
225 }
226 while(1)
227 {
228 }
229}
230
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
spi1_tx_buffer
uint16_t spi1_tx_buffer[32]
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:40
buffer_compare
error_status buffer_compare(uint16_t *pbuffer1, uint16_t *pbuffer2, uint16_t buffer_length)
buffer compare function.
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:63
spi_config
static void spi_config(void)
spi configuration.
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:82
transfer_status1
volatile error_status transfer_status1
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:51
spi2_tx_buffer
uint16_t spi2_tx_buffer[32]
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:44
spi1_rx_buffer
uint16_t spi1_rx_buffer[32]
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:48
BUFFER_SIZE
#define BUFFER_SIZE
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:38
crc2_value
__IO uint16_t crc2_value
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:50
transfer_status2
volatile error_status transfer_status2
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:51
main
int main(void)
main function.
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:168
rx_index
uint32_t rx_index
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:49
tx_index
uint32_t tx_index
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:49
spi2_rx_buffer
uint16_t spi2_rx_buffer[32]
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:48
crc1_value
__IO uint16_t crc1_value
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:50
gpio_config
static void gpio_config(void)
gpio configuration.
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:114
spi_init_struct
spi_init_type spi_init_struct
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:40
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED2
@ LED2
Definition: at32f415_board.h:63
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_SPI2_PERIPH_CLOCK
@ CRM_SPI2_PERIPH_CLOCK
Definition: at32f415_crm.h:129
CRM_SPI1_PERIPH_CLOCK
@ CRM_SPI1_PERIPH_CLOCK
Definition: at32f415_crm.h:117
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_14
#define GPIO_PINS_14
Definition: at32f415_gpio.h:65
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
SPI_CCERR_FLAG
#define SPI_CCERR_FLAG
Definition: at32f415_spi.h:57
SPI_I2S_TDBE_FLAG
#define SPI_I2S_TDBE_FLAG
Definition: at32f415_spi.h:54
SPI_I2S_RDBF_FLAG
#define SPI_I2S_RDBF_FLAG
Definition: at32f415_spi.h:53
spi_i2s_data_transmit
void spi_i2s_data_transmit(spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit
Definition: at32f415_spi.c:514
spi_crc_enable
void spi_crc_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the hardware crc calculation for the spi peripheral.
Definition: at32f415_spi.c:191
spi_i2s_flag_get
flag_status spi_i2s_flag_get(spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:548
spi_crc_next_transmit
void spi_crc_next_transmit(spi_type *spi_x)
spi next transmit crc for the spi peripheral.
Definition: at32f415_spi.c:152
spi_init
void spi_init(spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value.
Definition: at32f415_spi.c:91
spi_default_para_init
void spi_default_para_init(spi_init_type *spi_init_struct)
spi init config with its default value.
Definition: at32f415_spi.c:71
spi_crc_polynomial_set
void spi_crc_polynomial_set(spi_type *spi_x, uint16_t crc_poly)
set the crc polynomial value for the spi peripheral.
Definition: at32f415_spi.c:165
spi_i2s_data_receive
uint16_t spi_i2s_data_receive(spi_type *spi_x)
spi/i2s data receive
Definition: at32f415_spi.c:526
spi_i2s_flag_clear
void spi_i2s_flag_clear(spi_type *spi_x, uint32_t spi_i2s_flag)
clear flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:580
spi_enable
void spi_enable(spi_type *spi_x, confirm_state new_state)
enable or disable spi.
Definition: at32f415_spi.c:287
SPI_MODE_SLAVE
@ SPI_MODE_SLAVE
Definition: at32f415_spi.h:98
SPI_MODE_MASTER
@ SPI_MODE_MASTER
Definition: at32f415_spi.h:99
SPI_CLOCK_PHASE_2EDGE
@ SPI_CLOCK_PHASE_2EDGE
Definition: at32f415_spi.h:117
SPI_CS_SOFTWARE_MODE
@ SPI_CS_SOFTWARE_MODE
Definition: at32f415_spi.h:126
SPI_FIRST_BIT_MSB
@ SPI_FIRST_BIT_MSB
Definition: at32f415_spi.h:151
SPI_CLOCK_POLARITY_LOW
@ SPI_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:107
SPI_TRANSMIT_FULL_DUPLEX
@ SPI_TRANSMIT_FULL_DUPLEX
Definition: at32f415_spi.h:160
SPI_MCLK_DIV_8
@ SPI_MCLK_DIV_8
Definition: at32f415_spi.h:136
SPI_FRAME_16BIT
@ SPI_FRAME_16BIT
Definition: at32f415_spi.h:90
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
spi_init_type
spi init type
Definition: at32f415_spi.h:257
spi_init_type::master_slave_mode
spi_master_slave_mode_type master_slave_mode
Definition: at32f415_spi.h:259
spi_init_type::first_bit_transmission
spi_first_bit_type first_bit_transmission
Definition: at32f415_spi.h:261
spi_init_type::frame_bit_num
spi_frame_bit_num_type frame_bit_num
Definition: at32f415_spi.h:262
spi_init_type::clock_polarity
spi_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:263
spi_init_type::cs_mode_selection
spi_cs_mode_type cs_mode_selection
Definition: at32f415_spi.h:265
spi_init_type::mclk_freq_division
spi_mclk_freq_div_type mclk_freq_division
Definition: at32f415_spi.h:260
spi_init_type::transmission_mode
spi_transmission_mode_type transmission_mode
Definition: at32f415_spi.h:258
spi_init_type::clock_phase
spi_clock_phase_type clock_phase
Definition: at32f415_spi.h:264
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • spi
  • fullduplex_polling
  • inc
project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • spi
  • fullduplex_polling
  • inc
project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • spi
  • fullduplex_polling
  • inc
project/at_start_f415/examples/spi/fullduplex_polling/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • spi
  • fullduplex_polling
  • src
project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • spi
  • fullduplex_polling
  • src
project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • spi
  • fullduplex_polling
  • src
project/at_start_f415/examples/spi/fullduplex_polling/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define BUFFER_SIZE 32
39
40 spi_init_type spi_init_struct;
41uint8_t spi1_tx_buffer[BUFFER_SIZE] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
42 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
43 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
44 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20};
45uint8_t spi2_tx_buffer[BUFFER_SIZE] = {0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
46 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60,
47 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
48 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70};
49uint8_t spi1_rx_buffer[BUFFER_SIZE], spi2_rx_buffer[BUFFER_SIZE];
50uint32_t tx_index = 0, rx_index = 0;
51volatile error_status transfer_status1 = ERROR, transfer_status2 = ERROR;
52volatile error_status transfer_status3 = ERROR, transfer_status4 = ERROR;
53
54static void gpio_config(uint16_t spi1_mode, uint16_t spi2_mode);
55static void spi_config(void);
56 error_status buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t bufferlength);
57
64 error_status buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t bufferlength)
65{
66 while(bufferlength--)
67 {
68 if(*pbuffer1 != *pbuffer2)
69 {
70 return ERROR;
71 }
72
73 pbuffer1++;
74 pbuffer2++;
75 }
76 return SUCCESS;
77}
78
84static void spi_config(void)
85{
86 crm_periph_clock_enable(CRM_SPI1_PERIPH_CLOCK, TRUE);
87 crm_periph_clock_enable(CRM_SPI2_PERIPH_CLOCK, TRUE);
88 spi_default_para_init(&spi_init_struct);
89 spi_init_struct.transmission_mode = SPI_TRANSMIT_FULL_DUPLEX;
90 spi_init_struct.master_slave_mode = SPI_MODE_MASTER;
91 spi_init_struct.mclk_freq_division = SPI_MCLK_DIV_8;
92 spi_init_struct.first_bit_transmission = SPI_FIRST_BIT_LSB;
93 spi_init_struct.frame_bit_num = SPI_FRAME_8BIT;
94 spi_init_struct.clock_polarity = SPI_CLOCK_POLARITY_LOW;
95 spi_init_struct.clock_phase = SPI_CLOCK_PHASE_2EDGE;
96 spi_init_struct.cs_mode_selection = SPI_CS_SOFTWARE_MODE;
97 spi_init(SPI1, &spi_init_struct);
98
99 spi_init_struct.master_slave_mode = SPI_MODE_SLAVE;
100 spi_init(SPI2, &spi_init_struct);
101
102 spi_enable(SPI1, TRUE);
103 spi_enable(SPI2, TRUE);
104}
105
111static void gpio_config(uint16_t spi1_mode, uint16_t spi2_mode)
112{
113 gpio_init_type gpio_initstructure;
114 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
115 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
116 gpio_default_para_init(&gpio_initstructure);
117 /* spi1 sck pin */
118 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
119 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
120 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
121 if(spi1_mode == SPI_MODE_MASTER)
122 {
123 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
124 }
125 else
126 {
127 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
128 }
129 gpio_initstructure.gpio_pins = GPIO_PINS_5;
130 gpio_init(GPIOA, &gpio_initstructure);
131
132 /* spi1 miso pin */
133 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
134 if(spi1_mode == SPI_MODE_MASTER)
135 {
136 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
137 }
138 else
139 {
140 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
141 }
142 gpio_initstructure.gpio_pins = GPIO_PINS_6;
143 gpio_init(GPIOA, &gpio_initstructure);
144
145 /* spi1 mosi pin */
146 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
147 if(spi1_mode == SPI_MODE_MASTER)
148 {
149 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
150 }
151 else
152 {
153 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
154 }
155 gpio_initstructure.gpio_pins = GPIO_PINS_7;
156 gpio_init(GPIOA, &gpio_initstructure);
157
158 /* spi2 sck pin */
159 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
160 if(spi2_mode == SPI_MODE_SLAVE)
161 {
162 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
163 }
164 else
165 {
166 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
167 }
168 gpio_initstructure.gpio_pins = GPIO_PINS_13;
169 gpio_init(GPIOB, &gpio_initstructure);
170
171 /* spi2 miso pin */
172 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
173 if(spi2_mode == SPI_MODE_SLAVE)
174 {
175 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
176 }
177 else
178 {
179 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
180 }
181 gpio_initstructure.gpio_pins = GPIO_PINS_14;
182 gpio_init(GPIOB, &gpio_initstructure);
183
184 /* spi2 mosi pin */
185 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
186 if(spi2_mode == SPI_MODE_SLAVE)
187 {
188 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
189 }
190 else
191 {
192 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
193 }
194 gpio_initstructure.gpio_pins = GPIO_PINS_15;
195 gpio_init(GPIOB, &gpio_initstructure);
196}
197
203int main(void)
204{
205 __IO uint32_t index = 0;
206 system_clock_config();
207 at32_board_init();
208 gpio_config(SPI_MODE_MASTER, SPI_MODE_SLAVE);
209 spi_config();
210
211 /* transfer procedure:the "BUFFER_SIZE" data transfer */
212 while(tx_index < BUFFER_SIZE)
213 {
214 while(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) == RESET);
215 spi_i2s_data_transmit(SPI2, spi2_tx_buffer[tx_index]);
216 spi_i2s_data_transmit(SPI1, spi1_tx_buffer[tx_index++]);
217 while(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) == RESET);
218 spi2_rx_buffer[rx_index] = spi_i2s_data_receive(SPI2);
219 while(spi_i2s_flag_get(SPI1, SPI_I2S_RDBF_FLAG) == RESET);
220 spi1_rx_buffer[rx_index++] = spi_i2s_data_receive(SPI1);
221 }
222
223 /* test result:the data check */
224 transfer_status1 = buffer_compare(spi2_rx_buffer, spi1_tx_buffer, BUFFER_SIZE);
225 transfer_status2 = buffer_compare(spi1_rx_buffer, spi2_tx_buffer, BUFFER_SIZE);
226
227 /* master &slave mode switch */
228 spi_enable(SPI1, FALSE);
229 spi_enable(SPI2, FALSE);
230 gpio_config(SPI_MODE_SLAVE, SPI_MODE_MASTER);
231 spi_init_struct.master_slave_mode =SPI_MODE_SLAVE;
232 spi_init(SPI1, &spi_init_struct);
233
234 spi_init_struct.master_slave_mode =SPI_MODE_MASTER;
235 spi_init(SPI2, &spi_init_struct);
236
237 tx_index = 0;
238 rx_index = 0;
239 for(index = 0; index < BUFFER_SIZE; index++)
240 spi1_rx_buffer[index] = 0;
241 for(index = 0; index < BUFFER_SIZE; index++)
242 spi2_rx_buffer[index] = 0;
243
244 spi_enable(SPI2, TRUE);
245 spi_enable(SPI1, TRUE);
246
247 /* transfer procedure:the "BUFFER_SIZE" data transfer */
248 while(tx_index < BUFFER_SIZE)
249 {
250 while(spi_i2s_flag_get(SPI2, SPI_I2S_TDBE_FLAG) == RESET);
251 spi_i2s_data_transmit(SPI1, spi1_tx_buffer[tx_index]);
252 spi_i2s_data_transmit(SPI2, spi2_tx_buffer[tx_index++]);
253 while(spi_i2s_flag_get(SPI1, SPI_I2S_RDBF_FLAG) == RESET);
254 spi1_rx_buffer[rx_index] = spi_i2s_data_receive(SPI1);
255 while(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) == RESET);
256 spi2_rx_buffer[rx_index++] = spi_i2s_data_receive(SPI2);
257 }
258
259 /* test result:the data check */
260 transfer_status3 = buffer_compare(spi2_rx_buffer, spi1_tx_buffer, BUFFER_SIZE);
261 transfer_status4 = buffer_compare(spi1_rx_buffer, spi2_tx_buffer, BUFFER_SIZE);
262
263 /* test result indicate:if success ,led2 lights */
264 if((transfer_status1 == SUCCESS) && (transfer_status2 == SUCCESS) && \
265 (transfer_status3 == SUCCESS) && (transfer_status4 == SUCCESS))
266 {
267 at32_led_on(LED2);
268 }
269 else
270 {
271 at32_led_off(LED2);
272 }
273 while(1)
274 {
275 }
276}
277
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
buffer_compare
error_status buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t bufferlength)
buffer compare function.
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:64
transfer_status3
volatile error_status transfer_status3
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:52
spi_config
static void spi_config(void)
spi configuration.
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:84
transfer_status1
volatile error_status transfer_status1
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:51
transfer_status4
volatile error_status transfer_status4
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:52
BUFFER_SIZE
#define BUFFER_SIZE
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:38
transfer_status2
volatile error_status transfer_status2
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:51
main
int main(void)
main function.
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:203
gpio_config
static void gpio_config(uint16_t spi1_mode, uint16_t spi2_mode)
gpio configuration.
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:111
spi2_rx_buffer
uint8_t spi2_rx_buffer[32]
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:49
spi_init_struct
spi_init_type spi_init_struct
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:40
spi1_rx_buffer
uint8_t spi1_rx_buffer[32]
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:49
spi2_tx_buffer
uint8_t spi2_tx_buffer[32]
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:45
rx_index
uint32_t rx_index
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:50
tx_index
uint32_t tx_index
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:50
spi1_tx_buffer
uint8_t spi1_tx_buffer[32]
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:41
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED2
@ LED2
Definition: at32f415_board.h:63
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_SPI2_PERIPH_CLOCK
@ CRM_SPI2_PERIPH_CLOCK
Definition: at32f415_crm.h:129
CRM_SPI1_PERIPH_CLOCK
@ CRM_SPI1_PERIPH_CLOCK
Definition: at32f415_crm.h:117
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_14
#define GPIO_PINS_14
Definition: at32f415_gpio.h:65
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
SPI_I2S_TDBE_FLAG
#define SPI_I2S_TDBE_FLAG
Definition: at32f415_spi.h:54
SPI_I2S_RDBF_FLAG
#define SPI_I2S_RDBF_FLAG
Definition: at32f415_spi.h:53
spi_i2s_data_transmit
void spi_i2s_data_transmit(spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit
Definition: at32f415_spi.c:514
spi_i2s_flag_get
flag_status spi_i2s_flag_get(spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:548
spi_init
void spi_init(spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value.
Definition: at32f415_spi.c:91
spi_default_para_init
void spi_default_para_init(spi_init_type *spi_init_struct)
spi init config with its default value.
Definition: at32f415_spi.c:71
spi_i2s_data_receive
uint16_t spi_i2s_data_receive(spi_type *spi_x)
spi/i2s data receive
Definition: at32f415_spi.c:526
spi_enable
void spi_enable(spi_type *spi_x, confirm_state new_state)
enable or disable spi.
Definition: at32f415_spi.c:287
SPI_MODE_SLAVE
@ SPI_MODE_SLAVE
Definition: at32f415_spi.h:98
SPI_MODE_MASTER
@ SPI_MODE_MASTER
Definition: at32f415_spi.h:99
SPI_CLOCK_PHASE_2EDGE
@ SPI_CLOCK_PHASE_2EDGE
Definition: at32f415_spi.h:117
SPI_CS_SOFTWARE_MODE
@ SPI_CS_SOFTWARE_MODE
Definition: at32f415_spi.h:126
SPI_FIRST_BIT_LSB
@ SPI_FIRST_BIT_LSB
Definition: at32f415_spi.h:152
SPI_CLOCK_POLARITY_LOW
@ SPI_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:107
SPI_TRANSMIT_FULL_DUPLEX
@ SPI_TRANSMIT_FULL_DUPLEX
Definition: at32f415_spi.h:160
SPI_MCLK_DIV_8
@ SPI_MCLK_DIV_8
Definition: at32f415_spi.h:136
SPI_FRAME_8BIT
@ SPI_FRAME_8BIT
Definition: at32f415_spi.h:89
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
spi_init_type
spi init type
Definition: at32f415_spi.h:257
spi_init_type::master_slave_mode
spi_master_slave_mode_type master_slave_mode
Definition: at32f415_spi.h:259
spi_init_type::first_bit_transmission
spi_first_bit_type first_bit_transmission
Definition: at32f415_spi.h:261
spi_init_type::frame_bit_num
spi_frame_bit_num_type frame_bit_num
Definition: at32f415_spi.h:262
spi_init_type::clock_polarity
spi_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:263
spi_init_type::cs_mode_selection
spi_cs_mode_type cs_mode_selection
Definition: at32f415_spi.h:265
spi_init_type::mclk_freq_division
spi_mclk_freq_div_type mclk_freq_division
Definition: at32f415_spi.h:260
spi_init_type::transmission_mode
spi_transmission_mode_type transmission_mode
Definition: at32f415_spi.h:258
spi_init_type::clock_phase
spi_clock_phase_type clock_phase
Definition: at32f415_spi.h:264
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • spi
  • halfduplex_interrupt
  • inc
project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • spi
  • halfduplex_interrupt
  • inc
project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • spi
  • halfduplex_interrupt
  • inc
project/at_start_f415/examples/spi/halfduplex_interrupt/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • spi
  • halfduplex_interrupt
  • src
project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • spi
  • halfduplex_interrupt
  • src
project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31extern uint8_t spi1_tx_buffer[];
32extern uint8_t spi2_rx_buffer[];
33extern uint32_t tx_index;
34extern uint32_t rx_index;
35
44#define BUFFERSIZE 32
45
51void NMI_Handler(void)
52{
53}
54
60void HardFault_Handler(void)
61{
62 /* go to infinite loop when hard fault exception occurs */
63 while(1)
64 {
65 }
66}
67
73void MemManage_Handler(void)
74{
75 /* go to infinite loop when memory manage exception occurs */
76 while(1)
77 {
78 }
79}
80
86void BusFault_Handler(void)
87{
88 /* go to infinite loop when bus fault exception occurs */
89 while(1)
90 {
91 }
92}
93
99void UsageFault_Handler(void)
100{
101 /* go to infinite loop when usage fault exception occurs */
102 while(1)
103 {
104 }
105}
106
112void SVC_Handler(void)
113{
114}
115
121void DebugMon_Handler(void)
122{
123}
124
130void PendSV_Handler(void)
131{
132}
133
139void SysTick_Handler(void)
140{
141}
142
148 void SPI1_IRQHandler(void)
149{
150 if(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) != RESET)
151 {
152 spi_i2s_data_transmit(SPI1, spi1_tx_buffer[tx_index++]);
153 if(tx_index == BUFFERSIZE)
154 {
155 spi_i2s_interrupt_enable(SPI1, SPI_I2S_TDBE_INT, FALSE);
156 }
157 }
158}
159
165 void SPI2_IRQHandler(void)
166{
167 if(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) != RESET)
168 {
169 spi2_rx_buffer[rx_index++] = spi_i2s_data_receive(SPI2);
170 }
171}
172
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
tx_index
uint32_t tx_index
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:46
rx_index
uint32_t rx_index
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:33
spi1_tx_buffer
uint8_t spi1_tx_buffer[]
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:40
spi2_rx_buffer
uint8_t spi2_rx_buffer[]
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:48
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c:99
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c:60
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c:73
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c:112
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c:130
SPI2_IRQHandler
void SPI2_IRQHandler(void)
This function handles the spi2 interrupt request.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c:165
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c:51
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c:86
SPI1_IRQHandler
void SPI1_IRQHandler(void)
This function handles the spi1 interrupt request.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c:148
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c:139
BUFFERSIZE
#define BUFFERSIZE
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c:44
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/at32f415_int.c:121
FALSE
@ FALSE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SPI_I2S_TDBE_FLAG
#define SPI_I2S_TDBE_FLAG
Definition: at32f415_spi.h:54
SPI_I2S_RDBF_FLAG
#define SPI_I2S_RDBF_FLAG
Definition: at32f415_spi.h:53
SPI_I2S_TDBE_INT
#define SPI_I2S_TDBE_INT
Definition: at32f415_spi.h:74
spi_i2s_interrupt_enable
void spi_i2s_interrupt_enable(spi_type *spi_x, uint32_t spi_i2s_int, confirm_state new_state)
enable or disable the specified spi/i2s interrupts.
Definition: at32f415_spi.c:464
spi_i2s_data_transmit
void spi_i2s_data_transmit(spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit
Definition: at32f415_spi.c:514
spi_i2s_flag_get
flag_status spi_i2s_flag_get(spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:548
spi_i2s_data_receive
uint16_t spi_i2s_data_receive(spi_type *spi_x)
spi/i2s data receive
Definition: at32f415_spi.c:526
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • spi
  • halfduplex_interrupt
  • src
project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define BUFFER_SIZE 32
39
40 spi_init_type spi_init_struct;
41
42uint8_t spi1_tx_buffer[BUFFER_SIZE] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
43 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
44 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
45 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20};
46uint8_t spi2_rx_buffer[BUFFER_SIZE];
47volatile uint32_t tx_index = 0, rx_index = 0;
48volatile error_status transfer_status = ERROR;
49
50static void gpio_config(void);
51static void spi_config(void);
52 error_status buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length);
53
60 error_status buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length)
61{
62 while(buffer_length--)
63 {
64 if(*pbuffer1 != *pbuffer2)
65 {
66 return ERROR;
67 }
68
69 pbuffer1++;
70 pbuffer2++;
71 }
72 return SUCCESS;
73}
74
80static void spi_config(void)
81{
82 crm_periph_clock_enable(CRM_SPI1_PERIPH_CLOCK, TRUE);
83 crm_periph_clock_enable(CRM_SPI2_PERIPH_CLOCK, TRUE);
84 spi_default_para_init(&spi_init_struct);
85 spi_init_struct.transmission_mode = SPI_TRANSMIT_HALF_DUPLEX_TX;
86 spi_init_struct.master_slave_mode =SPI_MODE_MASTER;
87 spi_init_struct.mclk_freq_division = SPI_MCLK_DIV_8;
88 spi_init_struct.first_bit_transmission = SPI_FIRST_BIT_MSB;
89 spi_init_struct.frame_bit_num = SPI_FRAME_8BIT;
90 spi_init_struct.clock_polarity = SPI_CLOCK_POLARITY_LOW;
91 spi_init_struct.clock_phase = SPI_CLOCK_PHASE_2EDGE;
92 spi_init_struct.cs_mode_selection = SPI_CS_SOFTWARE_MODE;
93 spi_init(SPI1, &spi_init_struct);
94
95 spi_init_struct.transmission_mode = SPI_TRANSMIT_HALF_DUPLEX_RX;
96 spi_init_struct.master_slave_mode =SPI_MODE_SLAVE;
97 spi_init(SPI2, &spi_init_struct);
98
99 nvic_irq_enable(SPI1_IRQn, 0, 0);
100 nvic_irq_enable(SPI2_IRQn, 0, 0);
101 spi_i2s_interrupt_enable(SPI1, SPI_I2S_TDBE_INT, TRUE);
102 spi_i2s_interrupt_enable(SPI2, SPI_I2S_RDBF_INT, TRUE);
103
104 spi_enable(SPI2, TRUE);
105 spi_enable(SPI1, TRUE);
106}
107
113static void gpio_config(void)
114{
115 gpio_init_type gpio_initstructure;
116 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
117 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
118 gpio_default_para_init(&gpio_initstructure);
119
120 /* spi1 sck pin */
121 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
122 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
123 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
124 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
125 gpio_initstructure.gpio_pins = GPIO_PINS_5;
126 gpio_init(GPIOA, &gpio_initstructure);
127
128 /* spi1 mosi pin */
129 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
130 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
131 gpio_initstructure.gpio_pins = GPIO_PINS_7;
132 gpio_init(GPIOA, &gpio_initstructure);
133
134 /* spi2 sck pin */
135 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
136 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
137 gpio_initstructure.gpio_pins = GPIO_PINS_13;
138 gpio_init(GPIOB, &gpio_initstructure);
139
140 /* spi2 miso pin */
141 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
142 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
143 gpio_initstructure.gpio_pins = GPIO_PINS_14;
144 gpio_init(GPIOB, &gpio_initstructure);
145
146 while(gpio_input_data_bit_read(GPIOB, GPIO_PINS_13)!=RESET);
147}
148
154int main(void)
155{
156 system_clock_config();
157 at32_board_init();
158 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
159 gpio_config();
160 /* config spi1 send spi2 receive */
161 spi_config();
162 while(rx_index < BUFFER_SIZE);
163
164 /* test result:the data check */
165 transfer_status = buffer_compare(spi2_rx_buffer, spi1_tx_buffer, BUFFER_SIZE);
166
167 /* test result indicate:if success ,led2 lights */
168 if(transfer_status==SUCCESS)
169 {
170 at32_led_on(LED2);
171 }
172 else
173 {
174 at32_led_off(LED2);
175 }
176 while(1)
177 {
178 }
179}
180
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
buffer_compare
error_status buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c:60
tx_index
volatile uint32_t tx_index
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c:47
spi_config
static void spi_config(void)
spi configuration.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c:80
BUFFER_SIZE
#define BUFFER_SIZE
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c:38
main
int main(void)
main function.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c:154
spi2_rx_buffer
uint8_t spi2_rx_buffer[32]
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c:46
spi_init_struct
spi_init_type spi_init_struct
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c:40
rx_index
volatile uint32_t rx_index
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c:47
gpio_config
static void gpio_config(void)
gpio configuration.
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c:113
transfer_status
volatile error_status transfer_status
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c:48
spi1_tx_buffer
uint8_t spi1_tx_buffer[32]
Definition: project/at_start_f415/examples/spi/halfduplex_interrupt/src/main.c:42
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED2
@ LED2
Definition: at32f415_board.h:63
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_SPI2_PERIPH_CLOCK
@ CRM_SPI2_PERIPH_CLOCK
Definition: at32f415_crm.h:129
CRM_SPI1_PERIPH_CLOCK
@ CRM_SPI1_PERIPH_CLOCK
Definition: at32f415_crm.h:117
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
SPI2_IRQn
@ SPI2_IRQn
Definition: at32f415.h:172
SPI1_IRQn
@ SPI1_IRQn
Definition: at32f415.h:171
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_input_data_bit_read
flag_status gpio_input_data_bit_read(gpio_type *gpio_x, uint16_t pins)
read the specified input port pin.
Definition: at32f415_gpio.c:203
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_14
#define GPIO_PINS_14
Definition: at32f415_gpio.h:65
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
SPI_I2S_TDBE_INT
#define SPI_I2S_TDBE_INT
Definition: at32f415_spi.h:74
SPI_I2S_RDBF_INT
#define SPI_I2S_RDBF_INT
Definition: at32f415_spi.h:73
spi_i2s_interrupt_enable
void spi_i2s_interrupt_enable(spi_type *spi_x, uint32_t spi_i2s_int, confirm_state new_state)
enable or disable the specified spi/i2s interrupts.
Definition: at32f415_spi.c:464
spi_init
void spi_init(spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value.
Definition: at32f415_spi.c:91
spi_default_para_init
void spi_default_para_init(spi_init_type *spi_init_struct)
spi init config with its default value.
Definition: at32f415_spi.c:71
spi_enable
void spi_enable(spi_type *spi_x, confirm_state new_state)
enable or disable spi.
Definition: at32f415_spi.c:287
SPI_MODE_SLAVE
@ SPI_MODE_SLAVE
Definition: at32f415_spi.h:98
SPI_MODE_MASTER
@ SPI_MODE_MASTER
Definition: at32f415_spi.h:99
SPI_CLOCK_PHASE_2EDGE
@ SPI_CLOCK_PHASE_2EDGE
Definition: at32f415_spi.h:117
SPI_CS_SOFTWARE_MODE
@ SPI_CS_SOFTWARE_MODE
Definition: at32f415_spi.h:126
SPI_FIRST_BIT_MSB
@ SPI_FIRST_BIT_MSB
Definition: at32f415_spi.h:151
SPI_CLOCK_POLARITY_LOW
@ SPI_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:107
SPI_TRANSMIT_HALF_DUPLEX_RX
@ SPI_TRANSMIT_HALF_DUPLEX_RX
Definition: at32f415_spi.h:162
SPI_TRANSMIT_HALF_DUPLEX_TX
@ SPI_TRANSMIT_HALF_DUPLEX_TX
Definition: at32f415_spi.h:163
SPI_MCLK_DIV_8
@ SPI_MCLK_DIV_8
Definition: at32f415_spi.h:136
SPI_FRAME_8BIT
@ SPI_FRAME_8BIT
Definition: at32f415_spi.h:89
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
spi_init_type
spi init type
Definition: at32f415_spi.h:257
spi_init_type::master_slave_mode
spi_master_slave_mode_type master_slave_mode
Definition: at32f415_spi.h:259
spi_init_type::first_bit_transmission
spi_first_bit_type first_bit_transmission
Definition: at32f415_spi.h:261
spi_init_type::frame_bit_num
spi_frame_bit_num_type frame_bit_num
Definition: at32f415_spi.h:262
spi_init_type::clock_polarity
spi_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:263
spi_init_type::cs_mode_selection
spi_cs_mode_type cs_mode_selection
Definition: at32f415_spi.h:265
spi_init_type::mclk_freq_division
spi_mclk_freq_div_type mclk_freq_division
Definition: at32f415_spi.h:260
spi_init_type::transmission_mode
spi_transmission_mode_type transmission_mode
Definition: at32f415_spi.h:258
spi_init_type::clock_phase
spi_clock_phase_type clock_phase
Definition: at32f415_spi.h:264
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • spi
  • halfduplex_transceiver_switch
  • inc
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • spi
  • halfduplex_transceiver_switch
  • inc
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • spi
  • halfduplex_transceiver_switch
  • inc
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • spi
  • halfduplex_transceiver_switch
  • src
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • spi
  • halfduplex_transceiver_switch
  • src
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
31extern uint8_t spi1_tx_buffer[];
32extern uint8_t spi2_tx_buffer[];
33extern uint8_t spi1_rx_buffer[];
34extern uint8_t spi2_rx_buffer[];
35extern uint32_t tx_index;
36extern uint32_t rx_index;
37
46#define BUFFERSIZE 32
47
53void NMI_Handler(void)
54{
55}
56
62void HardFault_Handler(void)
63{
64 /* go to infinite loop when hard fault exception occurs */
65 while(1)
66 {
67 }
68}
69
75void MemManage_Handler(void)
76{
77 /* go to infinite loop when memory manage exception occurs */
78 while(1)
79 {
80 }
81}
82
88void BusFault_Handler(void)
89{
90 /* go to infinite loop when bus fault exception occurs */
91 while(1)
92 {
93 }
94}
95
101void UsageFault_Handler(void)
102{
103 /* go to infinite loop when usage fault exception occurs */
104 while(1)
105 {
106 }
107}
108
114void SVC_Handler(void)
115{
116}
117
123void DebugMon_Handler(void)
124{
125}
126
132void PendSV_Handler(void)
133{
134}
135
141void SysTick_Handler(void)
142{
143}
144
150 void SPI1_IRQHandler(void)
151{
152 if(SPI1->ctrl2_bit.tdbeie != RESET)
153 {
154 if(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) != RESET)
155 {
156 spi_i2s_data_transmit(SPI1, spi1_tx_buffer[tx_index++]);
157 if(tx_index == BUFFERSIZE)
158 {
159 spi_i2s_interrupt_enable(SPI1, SPI_I2S_TDBE_INT, FALSE);
160 }
161 }
162 }
163 if(SPI1->ctrl2_bit.rdbfie != RESET)
164 {
165 if(spi_i2s_flag_get(SPI1, SPI_I2S_RDBF_FLAG) != RESET)
166 {
167 spi_enable(SPI1, FALSE);
168 spi1_rx_buffer[rx_index++] = spi_i2s_data_receive(SPI1);
169 spi_enable(SPI1, TRUE);
170 if(rx_index == BUFFERSIZE)
171 {
172 spi_i2s_interrupt_enable(SPI1, SPI_I2S_RDBF_FLAG, FALSE);
173 }
174 }
175 }
176}
177
183 void SPI2_IRQHandler(void)
184{
185 if(SPI2->ctrl2_bit.tdbeie != RESET)
186 {
187 if(spi_i2s_flag_get(SPI2, SPI_I2S_TDBE_FLAG) != RESET)
188 {
189 spi_i2s_data_transmit(SPI2, spi2_tx_buffer[tx_index++]);
190 if(tx_index == BUFFERSIZE)
191 {
192 spi_i2s_interrupt_enable(SPI2, SPI_I2S_TDBE_INT, FALSE);
193 }
194 }
195 }
196 if(SPI2->ctrl2_bit.rdbfie != RESET)
197 {
198 if(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) != RESET)
199 {
200 spi2_rx_buffer[rx_index++] = spi_i2s_data_receive(SPI2);
201 }
202 }
203}
204
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
tx_index
uint32_t tx_index
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/main.c:46
rx_index
uint32_t rx_index
Definition: project/at_start_f415/examples/i2s/halfduplex_interrupt/src/at32f415_int.c:33
spi1_tx_buffer
uint8_t spi1_tx_buffer[]
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:40
spi2_tx_buffer
uint8_t spi2_tx_buffer[]
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:44
spi1_rx_buffer
uint8_t spi1_rx_buffer[]
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:48
spi2_rx_buffer
uint8_t spi2_rx_buffer[]
Definition: project/at_start_f415/examples/spi/crc_transfer_polling/src/main.c:48
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c:101
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c:62
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c:75
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c:114
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c:132
SPI2_IRQHandler
void SPI2_IRQHandler(void)
This function handles the spi2 interrupt request.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c:183
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c:53
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c:88
SPI1_IRQHandler
void SPI1_IRQHandler(void)
This function handles the spi1 interrupt request.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c:150
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c:141
BUFFERSIZE
#define BUFFERSIZE
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c:46
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/at32f415_int.c:123
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SPI_I2S_TDBE_FLAG
#define SPI_I2S_TDBE_FLAG
Definition: at32f415_spi.h:54
SPI_I2S_RDBF_FLAG
#define SPI_I2S_RDBF_FLAG
Definition: at32f415_spi.h:53
SPI_I2S_TDBE_INT
#define SPI_I2S_TDBE_INT
Definition: at32f415_spi.h:74
spi_i2s_interrupt_enable
void spi_i2s_interrupt_enable(spi_type *spi_x, uint32_t spi_i2s_int, confirm_state new_state)
enable or disable the specified spi/i2s interrupts.
Definition: at32f415_spi.c:464
spi_i2s_data_transmit
void spi_i2s_data_transmit(spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit
Definition: at32f415_spi.c:514
spi_i2s_flag_get
flag_status spi_i2s_flag_get(spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:548
spi_i2s_data_receive
uint16_t spi_i2s_data_receive(spi_type *spi_x)
spi/i2s data receive
Definition: at32f415_spi.c:526
spi_enable
void spi_enable(spi_type *spi_x, confirm_state new_state)
enable or disable spi.
Definition: at32f415_spi.c:287
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • spi
  • halfduplex_transceiver_switch
  • src
project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define BUFFER_SIZE 32
39
40
41 spi_init_type spi_init_struct;
42uint8_t spi1_tx_buffer[BUFFER_SIZE] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
43 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
44 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
45 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20};
46uint8_t spi2_tx_buffer[BUFFER_SIZE] = {0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
47 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60,
48 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
49 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70};
50uint8_t spi1_rx_buffer[BUFFER_SIZE], spi2_rx_buffer[BUFFER_SIZE];
51volatile uint32_t tx_index = 0, rx_index = 0;
52volatile error_status transfer_status1 = ERROR, transfer_status2 = ERROR;
53
54static void gpio_config(void);
55static void spi_config(void);
56 error_status buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length);
57
64 error_status buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length)
65{
66 while(buffer_length--)
67 {
68 if(*pbuffer1 != *pbuffer2)
69 {
70 return ERROR;
71 }
72
73 pbuffer1++;
74 pbuffer2++;
75 }
76 return SUCCESS;
77}
78
84static void spi_config(void)
85{
86 crm_periph_clock_enable(CRM_SPI1_PERIPH_CLOCK, TRUE);
87 crm_periph_clock_enable(CRM_SPI2_PERIPH_CLOCK, TRUE);
88 spi_default_para_init(&spi_init_struct);
89 spi_init_struct.transmission_mode = SPI_TRANSMIT_HALF_DUPLEX_TX;
90 spi_init_struct.master_slave_mode = SPI_MODE_MASTER;
91 spi_init_struct.mclk_freq_division = SPI_MCLK_DIV_256;
92 spi_init_struct.first_bit_transmission = SPI_FIRST_BIT_MSB;
93 spi_init_struct.frame_bit_num = SPI_FRAME_8BIT;
94 spi_init_struct.clock_polarity = SPI_CLOCK_POLARITY_LOW;
95 spi_init_struct.clock_phase = SPI_CLOCK_PHASE_2EDGE;
96 spi_init_struct.cs_mode_selection = SPI_CS_SOFTWARE_MODE;
97 spi_init(SPI1, &spi_init_struct);
98
99 spi_init_struct.transmission_mode = SPI_TRANSMIT_HALF_DUPLEX_RX;
100 spi_init_struct.master_slave_mode = SPI_MODE_SLAVE;
101 spi_init(SPI2, &spi_init_struct);
102
103 nvic_irq_enable(SPI1_IRQn, 0, 0);
104 nvic_irq_enable(SPI2_IRQn, 0, 0);
105 spi_i2s_interrupt_enable(SPI1, SPI_I2S_TDBE_INT, TRUE);
106 spi_i2s_interrupt_enable(SPI2, SPI_I2S_RDBF_INT, TRUE);
107
108 spi_enable(SPI1, TRUE);
109 spi_enable(SPI2, TRUE);
110}
111
117static void gpio_config(void)
118{
119 gpio_init_type gpio_initstructure;
120 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
121 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
122 gpio_default_para_init(&gpio_initstructure);
123
124 /* spi1 sck pin */
125 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
126 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
127 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
128 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
129 gpio_initstructure.gpio_pins = GPIO_PINS_5;
130 gpio_init(GPIOA, &gpio_initstructure);
131
132 /* spi1 mosi pin */
133 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
134 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
135 gpio_initstructure.gpio_pins = GPIO_PINS_7;
136 gpio_init(GPIOA, &gpio_initstructure);
137
138 /* spi2 sck pin */
139 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
140 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
141 gpio_initstructure.gpio_pins = GPIO_PINS_13;
142 gpio_init(GPIOB, &gpio_initstructure);
143
144 /* spi2 miso pin */
145 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
146 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
147 gpio_initstructure.gpio_pins = GPIO_PINS_14;
148 gpio_init(GPIOB, &gpio_initstructure);
149
150 while(gpio_input_data_bit_read(GPIOB, GPIO_PINS_13)!=RESET);
151}
152
158int main(void)
159{
160 system_clock_config();
161 at32_board_init();
162 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
163 gpio_config();
164 /* config spi1 send spi2 receive */
165 spi_config();
166 while(rx_index < BUFFER_SIZE);
167
168 /* test result:the data check */
169 transfer_status1 = buffer_compare(spi2_rx_buffer, spi1_tx_buffer, BUFFER_SIZE);
170
171 /* config spi2 send spi1 receive */
172 spi_enable(SPI1, FALSE);
173 spi_enable(SPI2, FALSE);
174 rx_index = 0;
175 tx_index = 0;
176 spi_i2s_interrupt_enable(SPI1, SPI_I2S_TDBE_INT, FALSE);
177 spi_i2s_interrupt_enable(SPI2, SPI_I2S_RDBF_INT, FALSE);
178
179 spi_init_struct.transmission_mode = SPI_TRANSMIT_HALF_DUPLEX_RX;
180 spi_init_struct.master_slave_mode = SPI_MODE_MASTER;
181 spi_init(SPI1, &spi_init_struct);
182
183 spi_init_struct.transmission_mode = SPI_TRANSMIT_HALF_DUPLEX_TX;
184 spi_init_struct.master_slave_mode = SPI_MODE_SLAVE;
185 spi_init(SPI2, &spi_init_struct);
186
187 spi_i2s_interrupt_enable(SPI1, SPI_I2S_RDBF_INT, TRUE);
188 spi_i2s_interrupt_enable(SPI2, SPI_I2S_TDBE_INT, TRUE);
189 spi_enable(SPI2, TRUE);
190 spi_enable(SPI1, TRUE);
191 while(rx_index < BUFFER_SIZE);
192
193 /* test result:the data check */
194 transfer_status2 = buffer_compare(spi1_rx_buffer, spi2_tx_buffer, BUFFER_SIZE);
195
196 /* test result indicate:if passed ,led2 lights */
197 if((transfer_status1 == SUCCESS) && (transfer_status2 == SUCCESS))
198 {
199 at32_led_on(LED2);
200 }
201 else
202 {
203 at32_led_off(LED2);
204 }
205 while(1)
206 {
207 }
208}
209
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
buffer_compare
error_status buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:64
tx_index
volatile uint32_t tx_index
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:51
spi_config
static void spi_config(void)
spi configuration.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:84
transfer_status1
volatile error_status transfer_status1
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:52
BUFFER_SIZE
#define BUFFER_SIZE
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:38
transfer_status2
volatile error_status transfer_status2
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:52
main
int main(void)
main function.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:158
spi2_rx_buffer
uint8_t spi2_rx_buffer[32]
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:50
spi_init_struct
spi_init_type spi_init_struct
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:41
spi1_rx_buffer
uint8_t spi1_rx_buffer[32]
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:50
spi2_tx_buffer
uint8_t spi2_tx_buffer[32]
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:46
rx_index
volatile uint32_t rx_index
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:51
gpio_config
static void gpio_config(void)
gpio configuration.
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:117
spi1_tx_buffer
uint8_t spi1_tx_buffer[32]
Definition: project/at_start_f415/examples/spi/halfduplex_transceiver_switch/src/main.c:42
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED2
@ LED2
Definition: at32f415_board.h:63
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_SPI2_PERIPH_CLOCK
@ CRM_SPI2_PERIPH_CLOCK
Definition: at32f415_crm.h:129
CRM_SPI1_PERIPH_CLOCK
@ CRM_SPI1_PERIPH_CLOCK
Definition: at32f415_crm.h:117
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
SPI2_IRQn
@ SPI2_IRQn
Definition: at32f415.h:172
SPI1_IRQn
@ SPI1_IRQn
Definition: at32f415.h:171
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_input_data_bit_read
flag_status gpio_input_data_bit_read(gpio_type *gpio_x, uint16_t pins)
read the specified input port pin.
Definition: at32f415_gpio.c:203
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_14
#define GPIO_PINS_14
Definition: at32f415_gpio.h:65
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
SPI_I2S_TDBE_INT
#define SPI_I2S_TDBE_INT
Definition: at32f415_spi.h:74
SPI_I2S_RDBF_INT
#define SPI_I2S_RDBF_INT
Definition: at32f415_spi.h:73
spi_i2s_interrupt_enable
void spi_i2s_interrupt_enable(spi_type *spi_x, uint32_t spi_i2s_int, confirm_state new_state)
enable or disable the specified spi/i2s interrupts.
Definition: at32f415_spi.c:464
spi_init
void spi_init(spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value.
Definition: at32f415_spi.c:91
spi_default_para_init
void spi_default_para_init(spi_init_type *spi_init_struct)
spi init config with its default value.
Definition: at32f415_spi.c:71
spi_enable
void spi_enable(spi_type *spi_x, confirm_state new_state)
enable or disable spi.
Definition: at32f415_spi.c:287
SPI_MODE_SLAVE
@ SPI_MODE_SLAVE
Definition: at32f415_spi.h:98
SPI_MODE_MASTER
@ SPI_MODE_MASTER
Definition: at32f415_spi.h:99
SPI_CLOCK_PHASE_2EDGE
@ SPI_CLOCK_PHASE_2EDGE
Definition: at32f415_spi.h:117
SPI_CS_SOFTWARE_MODE
@ SPI_CS_SOFTWARE_MODE
Definition: at32f415_spi.h:126
SPI_FIRST_BIT_MSB
@ SPI_FIRST_BIT_MSB
Definition: at32f415_spi.h:151
SPI_CLOCK_POLARITY_LOW
@ SPI_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:107
SPI_TRANSMIT_HALF_DUPLEX_RX
@ SPI_TRANSMIT_HALF_DUPLEX_RX
Definition: at32f415_spi.h:162
SPI_TRANSMIT_HALF_DUPLEX_TX
@ SPI_TRANSMIT_HALF_DUPLEX_TX
Definition: at32f415_spi.h:163
SPI_MCLK_DIV_256
@ SPI_MCLK_DIV_256
Definition: at32f415_spi.h:141
SPI_FRAME_8BIT
@ SPI_FRAME_8BIT
Definition: at32f415_spi.h:89
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
spi_init_type
spi init type
Definition: at32f415_spi.h:257
spi_init_type::master_slave_mode
spi_master_slave_mode_type master_slave_mode
Definition: at32f415_spi.h:259
spi_init_type::first_bit_transmission
spi_first_bit_type first_bit_transmission
Definition: at32f415_spi.h:261
spi_init_type::frame_bit_num
spi_frame_bit_num_type frame_bit_num
Definition: at32f415_spi.h:262
spi_init_type::clock_polarity
spi_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:263
spi_init_type::cs_mode_selection
spi_cs_mode_type cs_mode_selection
Definition: at32f415_spi.h:265
spi_init_type::mclk_freq_division
spi_mclk_freq_div_type mclk_freq_division
Definition: at32f415_spi.h:260
spi_init_type::transmission_mode
spi_transmission_mode_type transmission_mode
Definition: at32f415_spi.h:258
spi_init_type::clock_phase
spi_clock_phase_type clock_phase
Definition: at32f415_spi.h:264
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • spi
  • only_receive_mode_polling
  • inc
project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • spi
  • only_receive_mode_polling
  • inc
project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • spi
  • only_receive_mode_polling
  • inc
project/at_start_f415/examples/spi/only_receive_mode_polling/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • spi
  • only_receive_mode_polling
  • src
project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • spi
  • only_receive_mode_polling
  • src
project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • spi
  • only_receive_mode_polling
  • src
project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define BUFFER_SIZE 32
39
40 spi_init_type spi_init_struct;
41uint8_t spi1_tx_buffer[BUFFER_SIZE] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
42 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
43 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
44 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20};
45uint8_t spi2_rx_buffer[BUFFER_SIZE];
46uint32_t tx_index = 0, rx_index = 0;
47volatile error_status transfer_status = ERROR;
48
49static void gpio_config(void);
50static void spi_config(void);
51 error_status buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length);
52
59 error_status buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length)
60{
61 while(buffer_length--)
62 {
63 if(*pbuffer1 != *pbuffer2)
64 {
65 return ERROR;
66 }
67
68 pbuffer1++;
69 pbuffer2++;
70 }
71 return SUCCESS;
72}
73
79static void spi_config(void)
80{
81 crm_periph_clock_enable(CRM_SPI1_PERIPH_CLOCK, TRUE);
82 crm_periph_clock_enable(CRM_SPI2_PERIPH_CLOCK, TRUE);
83 spi_default_para_init(&spi_init_struct);
84 spi_init_struct.transmission_mode = SPI_TRANSMIT_FULL_DUPLEX;
85 spi_init_struct.master_slave_mode = SPI_MODE_MASTER;
86 spi_init_struct.mclk_freq_division = SPI_MCLK_DIV_8;
87 spi_init_struct.first_bit_transmission = SPI_FIRST_BIT_LSB;
88 spi_init_struct.frame_bit_num = SPI_FRAME_8BIT;
89 spi_init_struct.clock_polarity = SPI_CLOCK_POLARITY_LOW;
90 spi_init_struct.clock_phase = SPI_CLOCK_PHASE_2EDGE;
91 spi_init_struct.cs_mode_selection = SPI_CS_SOFTWARE_MODE;
92 spi_init(SPI1, &spi_init_struct);
93
94 spi_init_struct.transmission_mode = SPI_TRANSMIT_SIMPLEX_RX;
95 spi_init_struct.master_slave_mode = SPI_MODE_SLAVE;
96 spi_init(SPI2, &spi_init_struct);
97
98 spi_enable(SPI1, TRUE);
99 spi_enable(SPI2, TRUE);
100}
101
107static void gpio_config(void)
108{
109 gpio_init_type gpio_initstructure;
110 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
111 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
112 gpio_default_para_init(&gpio_initstructure);
113
114 /* spi1 sck pin */
115 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
116 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
117 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
118 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
119 gpio_initstructure.gpio_pins = GPIO_PINS_5;
120 gpio_init(GPIOA, &gpio_initstructure);
121
122 /* spi1 mosi pin */
123 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
124 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
125 gpio_initstructure.gpio_pins = GPIO_PINS_7;
126 gpio_init(GPIOA, &gpio_initstructure);
127
128 /* spi2 sck pin */
129 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
130 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
131 gpio_initstructure.gpio_pins = GPIO_PINS_13;
132 gpio_init(GPIOB, &gpio_initstructure);
133
134 /* spi2 mosi pin */
135 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
136 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
137 gpio_initstructure.gpio_pins = GPIO_PINS_15;
138 gpio_init(GPIOB, &gpio_initstructure);
139
140 while(gpio_input_data_bit_read(GPIOB, GPIO_PINS_13) != RESET);
141}
142
148int main(void)
149{
150 system_clock_config();
151 at32_board_init();
152 gpio_config();
153 spi_config();
154
155 /* transfer procedure:the "BUFFER_SIZE" data transfer */
156 while(tx_index < BUFFER_SIZE)
157 {
158 while(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) == RESET);
159 spi_i2s_data_transmit(SPI1, spi1_tx_buffer[tx_index++]);
160 while(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) == RESET);
161 spi2_rx_buffer[rx_index++] = spi_i2s_data_receive(SPI2);
162 }
163
164 /* test result:the data check */
165 transfer_status = buffer_compare(spi2_rx_buffer, spi1_tx_buffer, BUFFER_SIZE);
166
167 /* test result indicate:if success ,led2 lights */
168 if(transfer_status == SUCCESS)
169 {
170 at32_led_on(LED2);
171 }
172 else
173 {
174 at32_led_off(LED2);
175 }
176 while(1)
177 {
178 }
179}
180
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
buffer_compare
error_status buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function.
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c:59
spi_config
static void spi_config(void)
spi configuration.
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c:79
BUFFER_SIZE
#define BUFFER_SIZE
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c:38
main
int main(void)
main function.
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c:148
spi2_rx_buffer
uint8_t spi2_rx_buffer[32]
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c:45
spi_init_struct
spi_init_type spi_init_struct
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c:40
rx_index
uint32_t rx_index
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c:46
tx_index
uint32_t tx_index
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c:46
gpio_config
static void gpio_config(void)
gpio configuration.
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c:107
transfer_status
volatile error_status transfer_status
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c:47
spi1_tx_buffer
uint8_t spi1_tx_buffer[32]
Definition: project/at_start_f415/examples/spi/only_receive_mode_polling/src/main.c:41
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED2
@ LED2
Definition: at32f415_board.h:63
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_SPI2_PERIPH_CLOCK
@ CRM_SPI2_PERIPH_CLOCK
Definition: at32f415_crm.h:129
CRM_SPI1_PERIPH_CLOCK
@ CRM_SPI1_PERIPH_CLOCK
Definition: at32f415_crm.h:117
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_input_data_bit_read
flag_status gpio_input_data_bit_read(gpio_type *gpio_x, uint16_t pins)
read the specified input port pin.
Definition: at32f415_gpio.c:203
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
SPI_I2S_TDBE_FLAG
#define SPI_I2S_TDBE_FLAG
Definition: at32f415_spi.h:54
SPI_I2S_RDBF_FLAG
#define SPI_I2S_RDBF_FLAG
Definition: at32f415_spi.h:53
spi_i2s_data_transmit
void spi_i2s_data_transmit(spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit
Definition: at32f415_spi.c:514
spi_i2s_flag_get
flag_status spi_i2s_flag_get(spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:548
spi_init
void spi_init(spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value.
Definition: at32f415_spi.c:91
spi_default_para_init
void spi_default_para_init(spi_init_type *spi_init_struct)
spi init config with its default value.
Definition: at32f415_spi.c:71
spi_i2s_data_receive
uint16_t spi_i2s_data_receive(spi_type *spi_x)
spi/i2s data receive
Definition: at32f415_spi.c:526
spi_enable
void spi_enable(spi_type *spi_x, confirm_state new_state)
enable or disable spi.
Definition: at32f415_spi.c:287
SPI_MODE_SLAVE
@ SPI_MODE_SLAVE
Definition: at32f415_spi.h:98
SPI_MODE_MASTER
@ SPI_MODE_MASTER
Definition: at32f415_spi.h:99
SPI_CLOCK_PHASE_2EDGE
@ SPI_CLOCK_PHASE_2EDGE
Definition: at32f415_spi.h:117
SPI_CS_SOFTWARE_MODE
@ SPI_CS_SOFTWARE_MODE
Definition: at32f415_spi.h:126
SPI_FIRST_BIT_LSB
@ SPI_FIRST_BIT_LSB
Definition: at32f415_spi.h:152
SPI_CLOCK_POLARITY_LOW
@ SPI_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:107
SPI_TRANSMIT_FULL_DUPLEX
@ SPI_TRANSMIT_FULL_DUPLEX
Definition: at32f415_spi.h:160
SPI_TRANSMIT_SIMPLEX_RX
@ SPI_TRANSMIT_SIMPLEX_RX
Definition: at32f415_spi.h:161
SPI_MCLK_DIV_8
@ SPI_MCLK_DIV_8
Definition: at32f415_spi.h:136
SPI_FRAME_8BIT
@ SPI_FRAME_8BIT
Definition: at32f415_spi.h:89
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
spi_init_type
spi init type
Definition: at32f415_spi.h:257
spi_init_type::master_slave_mode
spi_master_slave_mode_type master_slave_mode
Definition: at32f415_spi.h:259
spi_init_type::first_bit_transmission
spi_first_bit_type first_bit_transmission
Definition: at32f415_spi.h:261
spi_init_type::frame_bit_num
spi_frame_bit_num_type frame_bit_num
Definition: at32f415_spi.h:262
spi_init_type::clock_polarity
spi_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:263
spi_init_type::cs_mode_selection
spi_cs_mode_type cs_mode_selection
Definition: at32f415_spi.h:265
spi_init_type::mclk_freq_division
spi_mclk_freq_div_type mclk_freq_division
Definition: at32f415_spi.h:260
spi_init_type::transmission_mode
spi_transmission_mode_type transmission_mode
Definition: at32f415_spi.h:258
spi_init_type::clock_phase
spi_clock_phase_type clock_phase
Definition: at32f415_spi.h:264
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • spi
  • use_jtagpin_hardwarecs_dma
  • inc
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • spi
  • use_jtagpin_hardwarecs_dma
  • inc
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • spi
  • use_jtagpin_hardwarecs_dma
  • inc
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • spi
  • use_jtagpin_hardwarecs_dma
  • src
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • spi
  • use_jtagpin_hardwarecs_dma
  • src
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • spi
  • use_jtagpin_hardwarecs_dma
  • src
project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define BUFFER_SIZE 32
39
40uint8_t spi1_tx_buffer[BUFFER_SIZE] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
41 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
42 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
43 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20};
44uint8_t spi2_rx_buffer[BUFFER_SIZE];
45__IO uint8_t tx_index = 0;
46volatile error_status transfer_status = ERROR;
47
48static void gpio_config(void);
49static void spi_config(void);
50 error_status buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length);
51
58 error_status buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length)
59{
60 while(buffer_length--)
61 {
62 if(*pbuffer1 != *pbuffer2)
63 {
64 return ERROR;
65 }
66
67 pbuffer1++;
68 pbuffer2++;
69 }
70 return SUCCESS;
71}
72
78static void spi_config(void)
79{
80 dma_init_type dma_init_struct;
81 spi_init_type spi_init_struct;
82
83 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
84 dma_reset(DMA1_CHANNEL4);
85 dma_default_para_init(&dma_init_struct);
86 dma_init_struct.buffer_size = BUFFER_SIZE;
87 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
88 dma_init_struct.memory_base_addr = (uint32_t)spi2_rx_buffer;
89 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
90 dma_init_struct.memory_inc_enable = TRUE;
91 dma_init_struct.peripheral_base_addr = (uint32_t)0x4000380C;
92 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
93 dma_init_struct.peripheral_inc_enable = FALSE;
94 dma_init_struct.priority = DMA_PRIORITY_MEDIUM;
95 dma_init_struct.loop_mode_enable = FALSE;
96 dma_init(DMA1_CHANNEL4, &dma_init_struct);
97
98 crm_periph_clock_enable(CRM_SPI1_PERIPH_CLOCK, TRUE);
99 crm_periph_clock_enable(CRM_SPI2_PERIPH_CLOCK, TRUE);
100 spi_default_para_init(&spi_init_struct);
101 spi_init_struct.transmission_mode = SPI_TRANSMIT_HALF_DUPLEX_TX;
102 spi_init_struct.master_slave_mode = SPI_MODE_MASTER;
103 spi_init_struct.mclk_freq_division = SPI_MCLK_DIV_8;
104 spi_init_struct.first_bit_transmission = SPI_FIRST_BIT_MSB;
105 spi_init_struct.frame_bit_num = SPI_FRAME_8BIT;
106 spi_init_struct.clock_polarity = SPI_CLOCK_POLARITY_LOW;
107 spi_init_struct.clock_phase = SPI_CLOCK_PHASE_2EDGE;
108 spi_init_struct.cs_mode_selection = SPI_CS_HARDWARE_MODE;
109 spi_init(SPI1, &spi_init_struct);
110
111 spi_init_struct.master_slave_mode = SPI_MODE_SLAVE;
112 spi_init_struct.transmission_mode = SPI_TRANSMIT_HALF_DUPLEX_RX;
113 spi_init(SPI2, &spi_init_struct);
114
115 spi_hardware_cs_output_enable(SPI1, TRUE);
116 spi_i2s_dma_receiver_enable(SPI2, TRUE);
117 spi_enable(SPI1, TRUE);
118 spi_enable(SPI2, TRUE);
119}
120
126static void gpio_config(void)
127{
128 gpio_init_type gpio_initstructure;
129 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
130 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
131 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
132 gpio_pin_remap_config(SWJTAG_GMUX_010, TRUE);
133 gpio_pin_remap_config(SPI1_MUX_01, TRUE);
134
135 /* master sck pin */
136 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
137 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
138 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
139 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
140 gpio_initstructure.gpio_pins = GPIO_PINS_3;
141 gpio_init(GPIOB, &gpio_initstructure);
142
143 /* master miso pin */
144 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
145 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
146 gpio_initstructure.gpio_pins = GPIO_PINS_4;
147 gpio_init(GPIOB, &gpio_initstructure);
148
149 /* master mosi pin */
150 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
151 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
152 gpio_initstructure.gpio_pins = GPIO_PINS_5;
153 gpio_init(GPIOB, &gpio_initstructure);
154
155 /* master cs pin */
156 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
157 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
158 gpio_initstructure.gpio_pins = GPIO_PINS_15;
159 gpio_init(GPIOA, &gpio_initstructure);
160
161 /* slave sck pin */
162 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
163 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
164 gpio_initstructure.gpio_pins = GPIO_PINS_13;
165 gpio_init(GPIOB, &gpio_initstructure);
166
167 /* slave miso pin */
168 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
169 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
170 gpio_initstructure.gpio_pins = GPIO_PINS_14;
171 gpio_init(GPIOB, &gpio_initstructure);
172
173 /* slave mosi pin */
174 gpio_initstructure.gpio_pull = GPIO_PULL_DOWN;
175 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
176 gpio_initstructure.gpio_pins = GPIO_PINS_15;
177 gpio_init(GPIOB, &gpio_initstructure);
178
179 /* slave cs pin */
180 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
181 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
182 gpio_initstructure.gpio_pins = GPIO_PINS_12;
183 gpio_init(GPIOB, &gpio_initstructure);
184}
185
191int main(void)
192{
193 system_clock_config();
194 at32_board_init();
195 gpio_config();
196 spi_config();
197 dma_channel_enable(DMA1_CHANNEL4, TRUE);
198
199 /* transfer procedure:the "BUFFER_SIZE" data transfer */
200 while(tx_index < BUFFER_SIZE)
201 {
202 while(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) == RESET);
203 spi_i2s_data_transmit(SPI1, spi1_tx_buffer[tx_index++]);
204 }
205 while(!dma_flag_get(DMA1_FDT4_FLAG));
206
207 /* test result:the data check */
208 transfer_status = buffer_compare(spi2_rx_buffer, spi1_tx_buffer, BUFFER_SIZE);
209
210 /* test result indicate:if success ,led2 lights */
211 if(transfer_status == SUCCESS)
212 {
213 at32_led_on(LED2);
214 }
215 else
216 {
217 at32_led_off(LED2);
218 }
219 while(1)
220 {
221 }
222}
223
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
spi_init_struct
spi_init_type spi_init_struct
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:40
buffer_compare
error_status buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function.
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c:58
spi_config
static void spi_config(void)
spi configuration.
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c:78
BUFFER_SIZE
#define BUFFER_SIZE
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c:38
tx_index
__IO uint8_t tx_index
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c:45
main
int main(void)
main function.
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c:191
spi2_rx_buffer
uint8_t spi2_rx_buffer[32]
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c:44
gpio_config
static void gpio_config(void)
gpio configuration.
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c:126
transfer_status
volatile error_status transfer_status
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c:46
spi1_tx_buffer
uint8_t spi1_tx_buffer[32]
Definition: project/at_start_f415/examples/spi/use_jtagpin_hardwarecs_dma/src/main.c:40
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED2
@ LED2
Definition: at32f415_board.h:63
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_SPI2_PERIPH_CLOCK
@ CRM_SPI2_PERIPH_CLOCK
Definition: at32f415_crm.h:129
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_SPI1_PERIPH_CLOCK
@ CRM_SPI1_PERIPH_CLOCK
Definition: at32f415_crm.h:117
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_BYTE
@ DMA_PERIPHERAL_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:238
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_BYTE
@ DMA_MEMORY_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:248
DMA_PRIORITY_MEDIUM
@ DMA_PRIORITY_MEDIUM
Definition: at32f415_dma.h:259
DMA1_FDT4_FLAG
#define DMA1_FDT4_FLAG
Definition: at32f415_dma.h:94
DMA1_CHANNEL4
#define DMA1_CHANNEL4
Definition: at32f415_dma.h:476
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_pin_remap_config
void gpio_pin_remap_config(uint32_t gpio_remap, confirm_state new_state)
iomux remap and debug i/o configuration.
Definition: at32f415_gpio.c:521
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIO_PINS_12
#define GPIO_PINS_12
Definition: at32f415_gpio.h:63
GPIO_PINS_14
#define GPIO_PINS_14
Definition: at32f415_gpio.h:65
GPIO_PINS_4
#define GPIO_PINS_4
Definition: at32f415_gpio.h:55
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
SWJTAG_GMUX_010
#define SWJTAG_GMUX_010
Definition: at32f415_gpio.h:193
SPI1_MUX_01
#define SPI1_MUX_01
Definition: at32f415_gpio.h:81
SPI_I2S_TDBE_FLAG
#define SPI_I2S_TDBE_FLAG
Definition: at32f415_spi.h:54
spi_i2s_data_transmit
void spi_i2s_data_transmit(spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit
Definition: at32f415_spi.c:514
spi_i2s_dma_receiver_enable
void spi_i2s_dma_receiver_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma receiver mode.
Definition: at32f415_spi.c:499
spi_i2s_flag_get
flag_status spi_i2s_flag_get(spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:548
spi_init
void spi_init(spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value.
Definition: at32f415_spi.c:91
spi_default_para_init
void spi_default_para_init(spi_init_type *spi_init_struct)
spi init config with its default value.
Definition: at32f415_spi.c:71
spi_hardware_cs_output_enable
void spi_hardware_cs_output_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the hardware cs output for the spi peripheral.
Definition: at32f415_spi.c:224
spi_enable
void spi_enable(spi_type *spi_x, confirm_state new_state)
enable or disable spi.
Definition: at32f415_spi.c:287
SPI_MODE_SLAVE
@ SPI_MODE_SLAVE
Definition: at32f415_spi.h:98
SPI_MODE_MASTER
@ SPI_MODE_MASTER
Definition: at32f415_spi.h:99
SPI_CLOCK_PHASE_2EDGE
@ SPI_CLOCK_PHASE_2EDGE
Definition: at32f415_spi.h:117
SPI_CS_HARDWARE_MODE
@ SPI_CS_HARDWARE_MODE
Definition: at32f415_spi.h:125
SPI_FIRST_BIT_MSB
@ SPI_FIRST_BIT_MSB
Definition: at32f415_spi.h:151
SPI_CLOCK_POLARITY_LOW
@ SPI_CLOCK_POLARITY_LOW
Definition: at32f415_spi.h:107
SPI_TRANSMIT_HALF_DUPLEX_RX
@ SPI_TRANSMIT_HALF_DUPLEX_RX
Definition: at32f415_spi.h:162
SPI_TRANSMIT_HALF_DUPLEX_TX
@ SPI_TRANSMIT_HALF_DUPLEX_TX
Definition: at32f415_spi.h:163
SPI_MCLK_DIV_8
@ SPI_MCLK_DIV_8
Definition: at32f415_spi.h:136
SPI_FRAME_8BIT
@ SPI_FRAME_8BIT
Definition: at32f415_spi.h:89
SPI1
#define SPI1
Definition: at32f415_spi.h:448
SPI2
#define SPI2
Definition: at32f415_spi.h:449
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
spi_init_type
spi init type
Definition: at32f415_spi.h:257
spi_init_type::master_slave_mode
spi_master_slave_mode_type master_slave_mode
Definition: at32f415_spi.h:259
spi_init_type::first_bit_transmission
spi_first_bit_type first_bit_transmission
Definition: at32f415_spi.h:261
spi_init_type::frame_bit_num
spi_frame_bit_num_type frame_bit_num
Definition: at32f415_spi.h:262
spi_init_type::clock_polarity
spi_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:263
spi_init_type::cs_mode_selection
spi_cs_mode_type cs_mode_selection
Definition: at32f415_spi.h:265
spi_init_type::mclk_freq_division
spi_mclk_freq_div_type mclk_freq_division
Definition: at32f415_spi.h:260
spi_init_type::transmission_mode
spi_transmission_mode_type transmission_mode
Definition: at32f415_spi.h:258
spi_init_type::clock_phase
spi_clock_phase_type clock_phase
Definition: at32f415_spi.h:264
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • spi
  • w25q_flash
  • inc
project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • spi
  • w25q_flash
  • inc
project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • spi
  • w25q_flash
  • inc
project/at_start_f415/examples/spi/w25q_flash/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • spi
  • w25q_flash
  • src
project/at_start_f415/examples/spi/w25q_flash/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/spi/w25q_flash/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • spi
  • w25q_flash
  • src
project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/spi/w25q_flash/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • spi
  • w25q_flash
  • src
project/at_start_f415/examples/spi/w25q_flash/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "spi_flash.h"
30
39#define FLASH_TEST_ADDR 0x1000
40#define BUF_SIZE 0x256
41
42uint8_t tx_buffer[BUF_SIZE];
43uint8_t rx_buffer[BUF_SIZE];
44volatile error_status transfer_status = ERROR;
45
46void tx_data_fill(void);
47 error_status buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length);
48
54void tx_data_fill(void)
55{
56 uint32_t data_index = 0;
57 for(data_index = 0; data_index < BUF_SIZE; data_index++)
58 {
59 tx_buffer[data_index] = data_index;
60 }
61}
62
69 error_status buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length)
70{
71 while(buffer_length--)
72 {
73 if(*pbuffer1 != *pbuffer2)
74 {
75 return ERROR;
76 }
77
78 pbuffer1++;
79 pbuffer2++;
80 }
81 return SUCCESS;
82}
83
89int main(void)
90{
91 __IO uint32_t index = 0;
92 __IO uint32_t flash_id_index = 0;
93 system_clock_config();
94 at32_board_init();
95 tx_data_fill();
96 uart_print_init(115200);
97 spiflash_init();
98 flash_id_index = spiflash_read_id();
99 if(flash_id_index != W25Q128)
100 {
101 printf("flash id check error!\r\n");
102 for(index = 0; index < 50; index++)
103 {
104 at32_led_toggle(LED2);
105 at32_led_toggle(LED3);
106 delay_ms(200);
107 }
108 return 1;
109 }
110 else
111 {
112 printf("flash id check success! id: %x\r\n", flash_id_index);
113 }
114
115 /* erase sector */
116 spiflash_sector_erase(FLASH_TEST_ADDR / SPIF_SECTOR_SIZE);
117
118 /* write data */
119 spiflash_write(tx_buffer, FLASH_TEST_ADDR, BUF_SIZE);
120
121 /* read data */
122 spiflash_read(rx_buffer, FLASH_TEST_ADDR, BUF_SIZE);
123
124 /* printf read data */
125 printf("Read Data: ");
126 for(index = 0; index < BUF_SIZE; index++)
127 {
128 printf("%x ", rx_buffer[index]);
129 }
130
131 /* test result:the data check */
132 transfer_status = buffer_compare(rx_buffer, tx_buffer, BUF_SIZE);
133
134 /* test result indicate:if success ,led2 lights */
135 if(transfer_status == SUCCESS)
136 {
137 printf("\r\nflash data read write success!\r\n");
138 at32_led_on(LED2);
139 }
140 else
141 {
142 printf("\r\nflash data read write ERROR!\r\n");
143 at32_led_off(LED2);
144 }
145
146 while(1)
147 {
148 }
149}
150
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
buffer_compare
error_status buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
buffer compare function.
Definition: project/at_start_f415/examples/spi/w25q_flash/src/main.c:69
FLASH_TEST_ADDR
#define FLASH_TEST_ADDR
Definition: project/at_start_f415/examples/spi/w25q_flash/src/main.c:39
BUF_SIZE
#define BUF_SIZE
Definition: project/at_start_f415/examples/spi/w25q_flash/src/main.c:40
main
int main(void)
main function.
Definition: project/at_start_f415/examples/spi/w25q_flash/src/main.c:89
rx_buffer
uint8_t rx_buffer[0x256]
Definition: project/at_start_f415/examples/spi/w25q_flash/src/main.c:43
tx_data_fill
void tx_data_fill(void)
transfer data fill.
Definition: project/at_start_f415/examples/spi/w25q_flash/src/main.c:54
tx_buffer
uint8_t tx_buffer[0x256]
Definition: project/at_start_f415/examples/spi/w25q_flash/src/main.c:42
transfer_status
volatile error_status transfer_status
Definition: project/at_start_f415/examples/spi/w25q_flash/src/main.c:44
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
spiflash_init
void spiflash_init(void)
spi configuration.
Definition: spi_flash.c:44
spiflash_write
void spiflash_write(uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write data to flash
Definition: spi_flash.c:99
spiflash_sector_erase
void spiflash_sector_erase(uint32_t erase_addr)
erase a sector data
Definition: spi_flash.c:203
spiflash_read
void spiflash_read(uint8_t *pbuffer, uint32_t read_addr, uint32_t length)
read data from flash
Definition: spi_flash.c:187
spiflash_read_id
uint16_t spiflash_read_id(void)
read device id
Definition: spi_flash.c:468
W25Q128
#define W25Q128
Definition: spi_flash.h:71
SPIF_SECTOR_SIZE
#define SPIF_SECTOR_SIZE
Definition: spi_flash.h:82
spi_flash.h
header file of spi_flash
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • cascade_synchro
  • inc
project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • cascade_synchro
  • inc
project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • cascade_synchro
  • inc
project/at_start_f415/examples/tmr/cascade_synchro/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • cascade_synchro
  • src
project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • cascade_synchro
  • src
project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133 /* trigger TMR1 hall event */
134 tmr_event_sw_trigger(TMR1, TMR_HALL_SWTRIG);
135}
136
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/cascade_synchro/src/at32f415_int.c:113
tmr_event_sw_trigger
void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event
Definition: at32f415_tmr.c:1369
TMR_HALL_SWTRIG
@ TMR_HALL_SWTRIG
Definition: at32f415_tmr.h:288
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • cascade_synchro
  • src
project/at_start_f415/examples/tmr/cascade_synchro/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39 tmr_output_config_type tmr_output_struct;
40
46int main(void)
47{
48 system_clock_config();
49
50 at32_board_init();
51
52 /* turn led2/led3/led4 on */
53 at32_led_on(LED2);
54 at32_led_on(LED3);
55 at32_led_on(LED4);
56
57 /* enable tmr2/tmr3/tmr4/gpioa/gpiob clock */
58 crm_periph_clock_enable(CRM_TMR2_PERIPH_CLOCK, TRUE);
59 crm_periph_clock_enable(CRM_TMR3_PERIPH_CLOCK, TRUE);
60 crm_periph_clock_enable(CRM_TMR4_PERIPH_CLOCK, TRUE);
61 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
62 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
63
64 /* timer1 output pin Configuration */
65 gpio_init_struct.gpio_pins = GPIO_PINS_6 | GPIO_PINS_0;
66 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
67 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
68 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
69 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
70 gpio_init(GPIOA, &gpio_init_struct);
71
72 gpio_init_struct.gpio_pins = GPIO_PINS_6;
73 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
74 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
75 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
76 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
77 gpio_init(GPIOB, &gpio_init_struct);
78
79
80 /* timers synchronisation in cascade mode
81 1/tmr2 is configured as primary timer:
82 - pwm mode is used
83 - the tmr2 update event is used as trigger output
84
85 2/tmr3 is sub for tmr2 and primary for tmr4,
86 - pwm mode is used
87 - the itr1(tmr2) is used as input trigger
88 - gated mode is used, so start and stop of sub counter
89 are controlled by the master trigger output signal(tmr2 update event).
90 - the tmr3 update event is used as trigger output.
91
92 3/tmr4 is slave for tmr3,
93 - pwm mode is used
94 - the itr2(tmr3) is used as input trigger
95 - gated mode is used, so start and stop of sub counter
96 are controlled by the master trigger output signal(tmr3 overflow event).
97
98 the primary timer tmr2 is running at tmr2 frequency :
99 tim2 frequency = (tmr2 counter clock)/ (tmr2 period + 1) = 1 mhz
100 and the duty cycle = tmr2_c1dt/(tmr2_pr + 1) = 50%.
101
102 the tmr3 is running at:
103 (tmr2 frequency)/ (tmr3 period + 1) = 100 khz and a duty cycle equal
104 to tmr3_c1dt/(tmr3_pr + 1) = 50%
105
106 the tmr4 is running at:
107 (tmr3 frequency)/ (tmr4 period + 1) = 100 khz and a duty cycle equal
108 to tmr4_c1dt/(tmr4_pr + 1) = 50%
109
110 tmr2 pwm frequency = 1mhz, tmr3 pwm frequency = 100 khz,
111 and tmr4 pwm frequency = 10 khz */
112
113 tmr_base_init(TMR2, 143, 0);
114 tmr_cnt_dir_set(TMR2, TMR_COUNT_UP);
115
116 tmr_base_init(TMR3, 9, 0);
117 tmr_cnt_dir_set(TMR3, TMR_COUNT_UP);
118
119 tmr_base_init(TMR4, 9, 0);
120 tmr_cnt_dir_set(TMR4, TMR_COUNT_UP);
121
122 /* channelx Configuration in output mode */
123 tmr_output_default_para_init(&tmr_output_struct);
124 tmr_output_struct.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_A;
125 tmr_output_struct.oc_output_state = TRUE;
126 tmr_output_struct.oc_polarity = TMR_OUTPUT_ACTIVE_LOW;
127 tmr_output_struct.oc_idle_state = TRUE;
128 tmr_output_struct.occ_output_state = FALSE;
129 tmr_output_struct.occ_polarity = TMR_OUTPUT_ACTIVE_HIGH;
130 tmr_output_struct.occ_idle_state = FALSE;
131
132 /* timer2 channel 1 */
133 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_1, &tmr_output_struct);
134 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_1, 72);
135
136 /* timer2 select enable signal to sub timer */
137 tmr_primary_mode_select(TMR2, TMR_PRIMARY_SEL_OVERFLOW);
138 tmr_sub_sync_mode_set(TMR2, TRUE);
139
140 /* timer3 channel 1 */
141 tmr_output_channel_config(TMR3, TMR_SELECT_CHANNEL_1, &tmr_output_struct);
142 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_1, 5);
143
144 /* sub mode selection: tmr3 */
145 tmr_sub_mode_select(TMR3, TMR_SUB_HANG_MODE);
146 tmr_trigger_input_select(TMR3, TMR_SUB_INPUT_SEL_IS1);
147
148 /* timer3 select enable signal to sub timer */
149 tmr_primary_mode_select(TMR3, TMR_PRIMARY_SEL_OVERFLOW);
150 tmr_sub_sync_mode_set(TMR3, TRUE);
151
152 /* timer4 channel 1 */
153 tmr_output_channel_config(TMR4, TMR_SELECT_CHANNEL_1, &tmr_output_struct);
154 tmr_channel_value_set(TMR4, TMR_SELECT_CHANNEL_1, 5);
155
156 /* sub mode selection: tmr4 */
157 tmr_sub_mode_select(TMR4, TMR_SUB_HANG_MODE);
158 tmr_trigger_input_select(TMR4, TMR_SUB_INPUT_SEL_IS2);
159
160 /* enable tmr2/tmr3/tmr4 */
161 tmr_counter_enable(TMR2, TRUE);
162 tmr_counter_enable(TMR3, TRUE);
163 tmr_counter_enable(TMR4, TRUE);
164
165 while(1)
166 {
167 }
168}
169
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/tmr/cascade_synchro/src/main.c:38
tmr_output_struct
tmr_output_config_type tmr_output_struct
Definition: project/at_start_f415/examples/tmr/cascade_synchro/src/main.c:39
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/cascade_synchro/src/main.c:46
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR2_PERIPH_CLOCK
@ CRM_TMR2_PERIPH_CLOCK
Definition: at32f415_crm.h:123
CRM_TMR4_PERIPH_CLOCK
@ CRM_TMR4_PERIPH_CLOCK
Definition: at32f415_crm.h:125
CRM_TMR3_PERIPH_CLOCK
@ CRM_TMR3_PERIPH_CLOCK
Definition: at32f415_crm.h:124
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_sub_mode_select
void tmr_sub_mode_select(tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode
Definition: at32f415_tmr.c:1148
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_sub_sync_mode_set
void tmr_sub_sync_mode_set(tmr_type *tmr_x, confirm_state new_state)
set tmr subordinate synchronization mode
Definition: at32f415_tmr.c:1225
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_trigger_input_select
void tmr_trigger_input_select(tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger
Definition: at32f415_tmr.c:1212
tmr_primary_mode_select
void tmr_primary_mode_select(tmr_type *tmr_x, tmr_primary_select_type primary_mode)
select tmr primary mode
Definition: at32f415_tmr.c:1126
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_OUTPUT_CONTROL_PWM_MODE_A
@ TMR_OUTPUT_CONTROL_PWM_MODE_A
Definition: at32f415_tmr.h:179
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR_OUTPUT_ACTIVE_LOW
@ TMR_OUTPUT_ACTIVE_LOW
Definition: at32f415_tmr.h:198
TMR_SUB_INPUT_SEL_IS2
@ TMR_SUB_INPUT_SEL_IS2
Definition: at32f415_tmr.h:135
TMR_SUB_INPUT_SEL_IS1
@ TMR_SUB_INPUT_SEL_IS1
Definition: at32f415_tmr.h:134
TMR_SUB_HANG_MODE
@ TMR_SUB_HANG_MODE
Definition: at32f415_tmr.h:153
TMR_PRIMARY_SEL_OVERFLOW
@ TMR_PRIMARY_SEL_OVERFLOW
Definition: at32f415_tmr.h:120
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
TMR4
#define TMR4
Definition: at32f415_tmr.h:835
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::occ_output_state
confirm_state occ_output_state
Definition: at32f415_tmr.h:405
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::occ_polarity
tmr_output_polarity_type occ_polarity
Definition: at32f415_tmr.h:403
tmr_output_config_type::occ_idle_state
confirm_state occ_idle_state
Definition: at32f415_tmr.h:401
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • complementary_signals
  • inc
project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • complementary_signals
  • inc
project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • complementary_signals
  • inc
project/at_start_f415/examples/tmr/complementary_signals/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • complementary_signals
  • src
project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • complementary_signals
  • src
project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133 /* trigger TMR1 hall event */
134 tmr_event_sw_trigger(TMR1, TMR_HALL_SWTRIG);
135}
136
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/at32f415_int.c:113
tmr_event_sw_trigger
void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event
Definition: at32f415_tmr.c:1369
TMR_HALL_SWTRIG
@ TMR_HALL_SWTRIG
Definition: at32f415_tmr.h:288
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • complementary_signals
  • src
project/at_start_f415/examples/tmr/complementary_signals/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39 tmr_output_config_type tmr_output_struct;
40 crm_clocks_freq_type crm_clocks_freq_struct = {0};
41 tmr_brkdt_config_type tmr_brkdt_config_struct = {0};
42
43uint16_t timer_period = 0;
44uint16_t channel1_pulse = 0, channel2_pulse = 0, channel3_pulse = 0;
45
51int main(void)
52{
53 system_clock_config();
54
55 at32_board_init();
56
57 /* get system clock */
58 crm_clocks_freq_get(&crm_clocks_freq_struct);
59
60 /* turn led2/led3/led4 on */
61 at32_led_on(LED2);
62 at32_led_on(LED3);
63 at32_led_on(LED4);
64
65 /* enable tmr1/gpioa/gpiob clock */
66 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
67 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
68 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
69
70 /* timer1 output pin configuration */
71 gpio_init_struct.gpio_pins = GPIO_PINS_8 | GPIO_PINS_9 | GPIO_PINS_10;
72 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
73 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
74 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
75 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
76 gpio_init(GPIOA, &gpio_init_struct);
77
78 gpio_init_struct.gpio_pins = GPIO_PINS_13 | GPIO_PINS_14 | GPIO_PINS_15;
79 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
80 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
81 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
82 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
83 gpio_init(GPIOB, &gpio_init_struct);
84
85 gpio_init_struct.gpio_pins = GPIO_PINS_12;
86 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
87 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
88 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
89 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
90 gpio_init(GPIOB, &gpio_init_struct);
91
92 /* tmr1 configuration to:
93
94 1/ generate 3 complementary pwm signals with 3 different duty cycles:
95 tmr1clk is fixed to system_core_clock, the tmr1 prescaler is equal to 0 so the
96 tmr1 counter clock used is system_core_clock.
97
98 the objective is to generate pwm signal at 17.57 khz:
99 - tmr1_period = (system_core_clock / 17570) - 1
100
101 the three duty cycles are computed as the following description:
102
103 the channel 1 duty cycle is set to 50% so channel 1c is set to 50%.
104 the channel 2 duty cycle is set to 25% so channel 2c is set to 75%.
105 the channel 3 duty cycle is set to 12.5% so channel 3c is set to 87.5%.
106 the timer pulse is calculated as follows:
107 - channelxpulse = duty_cycle * (tmr1_period - 1) / 100
108
109 2/ insert a dead time equal to 11/system_core_clock ns
110 3/ configure the break feature, active at high level, and using the automatic
111 output enable feature
112 4/ use the locking parameters level1. */
113
114 /* compute the value to be set in arr regiter to generate signal frequency at 17.57 khz */
115 timer_period = (crm_clocks_freq_struct.sclk_freq / 17570 ) - 1;
116
117 /* compute c1dt value to generate a duty cycle at 50% for channel 1 and 1c */
118 channel1_pulse = (uint16_t) (((uint32_t) 5 * (timer_period - 1)) / 10);
119
120 /* compute c2dt value to generate a duty cycle at 25% for channel 2 and 2c */
121 channel2_pulse = (uint16_t) (((uint32_t) 25 * (timer_period - 1)) / 100);
122
123 /* compute c3dt value to generate a duty cycle at 12.5% for channel 3 and 3c */
124 channel3_pulse = (uint16_t) (((uint32_t) 125 * (timer_period - 1)) / 1000);
125
126 tmr_base_init(TMR1, timer_period, 0);
127 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
128
129 /* channel 1, 2, 3 and 4 Configuration in output mode */
130 tmr_output_default_para_init(&tmr_output_struct);
131 tmr_output_struct.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_B;
132 tmr_output_struct.oc_output_state = TRUE;
133 tmr_output_struct.oc_polarity = TMR_OUTPUT_ACTIVE_LOW;
134 tmr_output_struct.oc_idle_state = TRUE;
135 tmr_output_struct.occ_output_state = TRUE;
136 tmr_output_struct.occ_polarity = TMR_OUTPUT_ACTIVE_LOW;
137 tmr_output_struct.occ_idle_state = FALSE;
138
139 /* channel 1 */
140 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_1, &tmr_output_struct);
141 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_1, channel1_pulse);
142
143 /* channel 2 */
144 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_2, &tmr_output_struct);
145 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_2, channel2_pulse);
146
147 /* channel 3 */
148 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_3, &tmr_output_struct);
149 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_3, channel3_pulse);
150
151 /* automatic output enable, stop, dead time and lock configuration */
152 tmr_brkdt_default_para_init(&tmr_brkdt_config_struct);
153 tmr_brkdt_config_struct.brk_enable = TRUE;
154 tmr_brkdt_config_struct.auto_output_enable = TRUE;
155 tmr_brkdt_config_struct.deadtime = 11;
156 tmr_brkdt_config_struct.fcsodis_state = TRUE;
157 tmr_brkdt_config_struct.fcsoen_state = TRUE;
158 tmr_brkdt_config_struct.brk_polarity = TMR_BRK_INPUT_ACTIVE_HIGH;
159 tmr_brkdt_config_struct.wp_level = TMR_WP_LEVEL_3;
160 tmr_brkdt_config(TMR1, &tmr_brkdt_config_struct);
161
162 /* output enable */
163 tmr_output_enable(TMR1, TRUE);
164
165 /* enable tmr1 */
166 tmr_counter_enable(TMR1, TRUE);
167
168 while(1)
169 {
170 }
171}
172
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/main.c:38
channel1_pulse
uint16_t channel1_pulse
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/main.c:44
tmr_output_struct
tmr_output_config_type tmr_output_struct
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/main.c:39
timer_period
uint16_t timer_period
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/main.c:43
channel2_pulse
uint16_t channel2_pulse
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/main.c:44
channel3_pulse
uint16_t channel3_pulse
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/main.c:44
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/main.c:51
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/main.c:40
tmr_brkdt_config_struct
tmr_brkdt_config_type tmr_brkdt_config_struct
Definition: project/at_start_f415/examples/tmr/complementary_signals/src/main.c:41
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_12
#define GPIO_PINS_12
Definition: at32f415_gpio.h:63
GPIO_PINS_14
#define GPIO_PINS_14
Definition: at32f415_gpio.h:65
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_brkdt_default_para_init
void tmr_brkdt_default_para_init(tmr_brkdt_config_type *tmr_brkdt_struct)
init tmr brkdt default para
Definition: at32f415_tmr.c:146
tmr_brkdt_config
void tmr_brkdt_config(tmr_type *tmr_x, tmr_brkdt_config_type *brkdt_struct)
config tmr break mode and dead-time
Definition: at32f415_tmr.c:1677
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_output_enable
void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable
Definition: at32f415_tmr.c:1382
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_WP_LEVEL_3
@ TMR_WP_LEVEL_3
Definition: at32f415_tmr.h:389
TMR_BRK_INPUT_ACTIVE_HIGH
@ TMR_BRK_INPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:380
TMR_OUTPUT_CONTROL_PWM_MODE_B
@ TMR_OUTPUT_CONTROL_PWM_MODE_B
Definition: at32f415_tmr.h:180
TMR_OUTPUT_ACTIVE_LOW
@ TMR_OUTPUT_ACTIVE_LOW
Definition: at32f415_tmr.h:198
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::sclk_freq
uint32_t sclk_freq
Definition: at32f415_crm.h:472
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_brkdt_config_type
tmr brkdt config type
Definition: at32f415_tmr.h:423
tmr_brkdt_config_type::brk_enable
confirm_state brk_enable
Definition: at32f415_tmr.h:430
tmr_brkdt_config_type::deadtime
uint8_t deadtime
Definition: at32f415_tmr.h:424
tmr_brkdt_config_type::auto_output_enable
confirm_state auto_output_enable
Definition: at32f415_tmr.h:427
tmr_brkdt_config_type::wp_level
tmr_wp_level_type wp_level
Definition: at32f415_tmr.h:426
tmr_brkdt_config_type::fcsoen_state
confirm_state fcsoen_state
Definition: at32f415_tmr.h:428
tmr_brkdt_config_type::fcsodis_state
confirm_state fcsodis_state
Definition: at32f415_tmr.h:429
tmr_brkdt_config_type::brk_polarity
tmr_brk_polarity_type brk_polarity
Definition: at32f415_tmr.h:425
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::occ_output_state
confirm_state occ_output_state
Definition: at32f415_tmr.h:405
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::occ_polarity
tmr_output_polarity_type occ_polarity
Definition: at32f415_tmr.h:403
tmr_output_config_type::occ_idle_state
confirm_state occ_idle_state
Definition: at32f415_tmr.h:401
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • dma
  • inc
project/at_start_f415/examples/tmr/dma/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • dma
  • inc
project/at_start_f415/examples/tmr/dma/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • dma
  • inc
project/at_start_f415/examples/tmr/dma/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • dma
  • src
project/at_start_f415/examples/tmr/dma/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/dma/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • dma
  • src
project/at_start_f415/examples/tmr/dma/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133 /* trigger TMR1 hall event */
134 tmr_event_sw_trigger(TMR1, TMR_HALL_SWTRIG);
135}
136
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/dma/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/dma/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/dma/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/dma/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/dma/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/dma/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/dma/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/dma/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/dma/src/at32f415_int.c:113
tmr_event_sw_trigger
void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event
Definition: at32f415_tmr.c:1369
TMR_HALL_SWTRIG
@ TMR_HALL_SWTRIG
Definition: at32f415_tmr.h:288
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • dma
  • src
project/at_start_f415/examples/tmr/dma/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39 tmr_output_config_type tmr_output_struct;
40 dma_init_type dma_init_struct = {0};
41 crm_clocks_freq_type crm_clocks_freq_struct = {0};
42
43uint16_t timer_period = 0;
44uint16_t src_buffer[3] = {0, 0, 0};
45
51int main(void)
52{
53 system_clock_config();
54
55 at32_board_init();
56
57 /* get system clock */
58 crm_clocks_freq_get(&crm_clocks_freq_struct);
59
60 /* turn led2/led3/led4 on */
61 at32_led_on(LED2);
62 at32_led_on(LED3);
63 at32_led_on(LED4);
64
65 /* enable tmr1/gpioa/gpiob/dma clock */
66 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
67 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
68 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
69 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
70
71 /* timer1 output pin Configuration */
72 gpio_init_struct.gpio_pins = GPIO_PINS_10;
73 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
74 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
75 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
76 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
77 gpio_init(GPIOA, &gpio_init_struct);
78
79 gpio_init_struct.gpio_pins = GPIO_PINS_15;
80 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
81 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
82 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
83 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
84 gpio_init(GPIOB, &gpio_init_struct);
85
86 /* tmr1 dma transfer example
87 tmr1clk = system_core_clock, prescaler = 0, tmr1 counter clock = system_core_clock
88
89 the objective is to configure tmr1 channel 3 to generate complementary pwm
90 signal with a frequency equal to 17.57 khz:
91 - tmr1_period = (system_core_clock / 17570) - 1
92 and a variable duty cycle that is changed by the dma after a specific number of
93 update dma request.
94
95 the number of this repetitive requests is defined by the tmr1 repetition counter,
96 each 3 update requests, the tmr1 channel 3 duty cycle changes to the next new
97 value defined by the src_buffer. */
98 /* compute the value to be set in arr regiter to generate signal frequency at 17.57 khz */
99 timer_period = (crm_clocks_freq_struct.sclk_freq / 17570 ) - 1;
100 /* compute c1dt value to generate a duty cycle at 50% */
101 src_buffer[0] = (uint16_t) (((uint32_t) 5 * (timer_period - 1)) / 10);
102 /* compute c1dt value to generate a duty cycle at 37.5% */
103 src_buffer[1] = (uint16_t) (((uint32_t) 375 * (timer_period - 1)) / 1000);
104 /* compute c1dt value to generate a duty cycle at 25% */
105 src_buffer[2] = (uint16_t) (((uint32_t) 25 * (timer_period - 1)) / 100);
106
107 tmr_base_init(TMR1, timer_period, 0);
108 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
109
110 /* channel 3 configuration in output mode */
111 tmr_output_default_para_init(&tmr_output_struct);
112 tmr_output_struct.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_B;
113 tmr_output_struct.oc_output_state = TRUE;
114 tmr_output_struct.oc_polarity = TMR_OUTPUT_ACTIVE_LOW;
115 tmr_output_struct.oc_idle_state = TRUE;
116 tmr_output_struct.occ_output_state = TRUE;
117 tmr_output_struct.occ_polarity = TMR_OUTPUT_ACTIVE_LOW;
118 tmr_output_struct.occ_idle_state = FALSE;
119 /* channel 3 */
120 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_3, &tmr_output_struct);
121 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_3, src_buffer[0]);
122
123 /* enable tmr1 overflow dma request */
124 tmr_dma_request_enable(TMR1, TMR_OVERFLOW_DMA_REQUEST, TRUE);
125
126 /* dma config for tmr1 overflow dma request */
127 /* dma1 channel5 configuration */
128 dma_reset(DMA1_CHANNEL5);
129 dma_init_struct.buffer_size = 3;
130 dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
131 dma_init_struct.memory_base_addr = (uint32_t)src_buffer;
132 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
133 dma_init_struct.memory_inc_enable = TRUE;
134 dma_init_struct.peripheral_base_addr = (uint32_t)0x40012C3C;
135 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
136 dma_init_struct.peripheral_inc_enable = FALSE;
137 dma_init_struct.priority = DMA_PRIORITY_MEDIUM;
138 dma_init_struct.loop_mode_enable = TRUE;
139 dma_init(DMA1_CHANNEL5, &dma_init_struct);
140
141 dma_channel_enable(DMA1_CHANNEL5, TRUE);
142
143 /* output enable */
144 tmr_output_enable(TMR1, TRUE);
145 /* enable tmr1 */
146 tmr_counter_enable(TMR1, TRUE);
147
148 while(1)
149 {
150 }
151}
152
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/tmr/dma/src/main.c:38
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/tmr/dma/src/main.c:40
tmr_output_struct
tmr_output_config_type tmr_output_struct
Definition: project/at_start_f415/examples/tmr/dma/src/main.c:39
src_buffer
uint16_t src_buffer[3]
Definition: project/at_start_f415/examples/tmr/dma/src/main.c:44
timer_period
uint16_t timer_period
Definition: project/at_start_f415/examples/tmr/dma/src/main.c:43
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/dma/src/main.c:51
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/tmr/dma/src/main.c:41
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_MEDIUM
@ DMA_PRIORITY_MEDIUM
Definition: at32f415_dma.h:259
DMA1_CHANNEL5
#define DMA1_CHANNEL5
Definition: at32f415_dma.h:477
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
tmr_dma_request_enable
void tmr_dma_request_enable(tmr_type *tmr_x, tmr_dma_request_type dma_request, confirm_state new_state)
enable or disable tmr dma request
Definition: at32f415_tmr.c:1247
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_output_enable
void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable
Definition: at32f415_tmr.c:1382
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_OVERFLOW_DMA_REQUEST
@ TMR_OVERFLOW_DMA_REQUEST
Definition: at32f415_tmr.h:269
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_OUTPUT_CONTROL_PWM_MODE_B
@ TMR_OUTPUT_CONTROL_PWM_MODE_B
Definition: at32f415_tmr.h:180
TMR_OUTPUT_ACTIVE_LOW
@ TMR_OUTPUT_ACTIVE_LOW
Definition: at32f415_tmr.h:198
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::sclk_freq
uint32_t sclk_freq
Definition: at32f415_crm.h:472
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::occ_output_state
confirm_state occ_output_state
Definition: at32f415_tmr.h:405
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::occ_polarity
tmr_output_polarity_type occ_polarity
Definition: at32f415_tmr.h:403
tmr_output_config_type::occ_idle_state
confirm_state occ_idle_state
Definition: at32f415_tmr.h:401
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • dma_burst
  • inc
project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • dma_burst
  • inc
project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • dma_burst
  • inc
project/at_start_f415/examples/tmr/dma_burst/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • dma_burst
  • src
project/at_start_f415/examples/tmr/dma_burst/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/dma_burst/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • dma_burst
  • src
project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133 /* trigger TMR1 hall event */
134 tmr_event_sw_trigger(TMR1, TMR_HALL_SWTRIG);
135}
136
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/dma_burst/src/at32f415_int.c:113
tmr_event_sw_trigger
void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event
Definition: at32f415_tmr.c:1369
TMR_HALL_SWTRIG
@ TMR_HALL_SWTRIG
Definition: at32f415_tmr.h:288
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • dma_burst
  • src
project/at_start_f415/examples/tmr/dma_burst/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39 tmr_output_config_type tmr_output_struct;
40 dma_init_type dma_init_struct = {0};
41 crm_clocks_freq_type crm_clocks_freq_struct = {0};
42
43uint16_t timer_period = 0;
44uint16_t src_buffer[3] = {0x0FFF, 0x0000, 0x0555};
45
51int main(void)
52{
53 system_clock_config();
54
55 at32_board_init();
56
57 /* get system clock */
58 crm_clocks_freq_get(&crm_clocks_freq_struct);
59
60 /* turn led2/led3/led4 on */
61 at32_led_on(LED2);
62 at32_led_on(LED3);
63 at32_led_on(LED4);
64
65 /* enable tmr1/gpioa/gpiob/dma clock */
66 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
67 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
68 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
69 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
70
71 /* timer1 output pin Configuration */
72 gpio_init_struct.gpio_pins = GPIO_PINS_8;
73 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
74 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
75 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
76 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
77 gpio_init(GPIOA, &gpio_init_struct);
78
79 /* tmr1 configuration: generate 1 pwm signal using the dma burst mode:
80 the tmr1clk frequency is set to system_core_clock (hz), to get tmr1 counter
81 clock at 24 mhz the prescaler is computed as following:
82 - div = (tim1clk / tmr1 counter clock) - 1
83 the tmr1 period is 5.86 khz: tmr1 frequency = tmr1 counter clock/(pr + 1)
84 = 24 mhz / 4096 = 5.86khz
85 tmr1 channel1 duty cycle = (tim1_c1dt/ tmr1_pr)* 100 = 33.33% */
86
87 tmr_base_init(TMR1, 0xFFFF, (crm_clocks_freq_struct.sclk_freq/24000000)-1);
88 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
89
90 /* channel 3 configuration in output mode */
91 tmr_output_default_para_init(&tmr_output_struct);
92 tmr_output_struct.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_B;
93 tmr_output_struct.oc_output_state = TRUE;
94 tmr_output_struct.oc_polarity = TMR_OUTPUT_ACTIVE_LOW;
95 tmr_output_struct.oc_idle_state = TRUE;
96 tmr_output_struct.occ_output_state = FALSE;
97 tmr_output_struct.occ_polarity = TMR_OUTPUT_ACTIVE_LOW;
98 tmr_output_struct.occ_idle_state = FALSE;
99 /* channel 3 */
100 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_1, &tmr_output_struct);
101 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_1, 0xFFF);
102
103 /* enable tmr1 overflow dma request */
104 tmr_dma_request_enable(TMR1, TMR_OVERFLOW_DMA_REQUEST, TRUE);
105 tmr_dma_control_config(TMR1, TMR_DMA_TRANSFER_3BYTES, TMR_PR_ADDRESS);
106
107 /* dma config for tmr1 overflow dma request */
108 /* dma1 channel5 configuration */
109 dma_reset(DMA1_CHANNEL5);
110 dma_init_struct.buffer_size = 3;
111 dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
112 dma_init_struct.memory_base_addr = (uint32_t)src_buffer;
113 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
114 dma_init_struct.memory_inc_enable = TRUE;
115 dma_init_struct.peripheral_base_addr = (uint32_t)0x40012C4C;
116 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
117 dma_init_struct.peripheral_inc_enable = FALSE;
118 dma_init_struct.priority = DMA_PRIORITY_MEDIUM;
119 dma_init_struct.loop_mode_enable = TRUE;
120 dma_init(DMA1_CHANNEL5, &dma_init_struct);
121
122 dma_channel_enable(DMA1_CHANNEL5, TRUE);
123
124 /* output enable */
125 tmr_output_enable(TMR1, TRUE);
126 /* enable tmr1 */
127 tmr_counter_enable(TMR1, TRUE);
128
129 while(1)
130 {
131 }
132}
133
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/tmr/dma_burst/src/main.c:38
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/tmr/dma_burst/src/main.c:40
tmr_output_struct
tmr_output_config_type tmr_output_struct
Definition: project/at_start_f415/examples/tmr/dma_burst/src/main.c:39
src_buffer
uint16_t src_buffer[3]
Definition: project/at_start_f415/examples/tmr/dma_burst/src/main.c:44
timer_period
uint16_t timer_period
Definition: project/at_start_f415/examples/tmr/dma_burst/src/main.c:43
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/dma_burst/src/main.c:51
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/tmr/dma_burst/src/main.c:41
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_MEDIUM
@ DMA_PRIORITY_MEDIUM
Definition: at32f415_dma.h:259
DMA1_CHANNEL5
#define DMA1_CHANNEL5
Definition: at32f415_dma.h:477
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
tmr_dma_control_config
void tmr_dma_control_config(tmr_type *tmr_x, tmr_dma_transfer_length_type dma_length, tmr_dma_address_type dma_base_address)
config tmr dma control
Definition: at32f415_tmr.c:1661
tmr_dma_request_enable
void tmr_dma_request_enable(tmr_type *tmr_x, tmr_dma_request_type dma_request, confirm_state new_state)
enable or disable tmr dma request
Definition: at32f415_tmr.c:1247
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_output_enable
void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable
Definition: at32f415_tmr.c:1382
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_OVERFLOW_DMA_REQUEST
@ TMR_OVERFLOW_DMA_REQUEST
Definition: at32f415_tmr.h:269
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_PR_ADDRESS
@ TMR_PR_ADDRESS
Definition: at32f415_tmr.h:364
TMR_OUTPUT_CONTROL_PWM_MODE_B
@ TMR_OUTPUT_CONTROL_PWM_MODE_B
Definition: at32f415_tmr.h:180
TMR_OUTPUT_ACTIVE_LOW
@ TMR_OUTPUT_ACTIVE_LOW
Definition: at32f415_tmr.h:198
TMR_DMA_TRANSFER_3BYTES
@ TMR_DMA_TRANSFER_3BYTES
Definition: at32f415_tmr.h:330
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::sclk_freq
uint32_t sclk_freq
Definition: at32f415_crm.h:472
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::occ_output_state
confirm_state occ_output_state
Definition: at32f415_tmr.h:405
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::occ_polarity
tmr_output_polarity_type occ_polarity
Definition: at32f415_tmr.h:403
tmr_output_config_type::occ_idle_state
confirm_state occ_idle_state
Definition: at32f415_tmr.h:401
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • encoder_tmr2
  • inc
project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • encoder_tmr2
  • inc
project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • encoder_tmr2
  • inc
project/at_start_f415/examples/tmr/encoder_tmr2/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • encoder_tmr2
  • src
project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • encoder_tmr2
  • src
project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133 /* trigger TMR1 hall event */
134 tmr_event_sw_trigger(TMR1, TMR_HALL_SWTRIG);
135}
136
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/at32f415_int.c:113
tmr_event_sw_trigger
void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event
Definition: at32f415_tmr.c:1369
TMR_HALL_SWTRIG
@ TMR_HALL_SWTRIG
Definition: at32f415_tmr.h:288
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • encoder_tmr2
  • src
project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39 crm_clocks_freq_type crm_clocks_freq_struct = {0};
40
41void delay(uint32_t time);
42uint32_t counter;
43
49int main(void)
50{
51 system_clock_config();
52
53 at32_board_init();
54
55 /* get system clock */
56 crm_clocks_freq_get(&crm_clocks_freq_struct);
57
58 /* turn led2/led3/led4 on */
59 at32_led_on(LED2);
60 at32_led_on(LED3);
61 at32_led_on(LED4);
62
63 /* enable tmr2/gpioa clock */
64 crm_periph_clock_enable(CRM_TMR2_PERIPH_CLOCK, TRUE);
65 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
66
67 /* timer1 output pin Configuration */
68 gpio_init_struct.gpio_pins = GPIO_PINS_0 | GPIO_PINS_1;
69 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
70 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
71 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
72 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
73 gpio_init(GPIOA, &gpio_init_struct);
74
75 gpio_init_struct.gpio_pins = GPIO_PINS_2 | GPIO_PINS_3;
76 gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
77 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
78 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
79 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
80 gpio_init(GPIOA, &gpio_init_struct);
81
82 /* tmr2 encoder mode configuration
83 tmr2 c1ifp1 ,c2ifp2 as encoder input pin, tmr2 counter
84 changed each signal edge. */
85
86 /* enable tmr2 32bit function */
87 tmr_32_bit_function_enable(TMR2, TRUE);
88
89 tmr_base_init(TMR2, 0xFFFFFFFF, 0);
90 tmr_cnt_dir_set(TMR2, TMR_COUNT_UP);
91
92 /* config encoder mode */
93 tmr_encoder_mode_config(TMR2, TMR_ENCODER_MODE_C, TMR_INPUT_RISING_EDGE, TMR_INPUT_RISING_EDGE);
94
95 /* enable tmr2 */
96 tmr_counter_enable(TMR2, TRUE);
97
98 while(1)
99 {
100 /* generate encoder signal */
101 gpio_bits_set(GPIOA, GPIO_PINS_2);
102 delay(150);
103 gpio_bits_set(GPIOA, GPIO_PINS_3);
104 delay(150);
105 gpio_bits_reset(GPIOA, GPIO_PINS_2);
106 delay(150);
107 gpio_bits_reset(GPIOA, GPIO_PINS_3);
108 delay(150);
109
110 /* get current counter value */
111 counter = tmr_counter_value_get(TMR2);
112 }
113}
114
120void delay(uint32_t time)
121{
122 uint32_t i;
123
124 for(i = 0; i < time; i++);
125}
126
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c:38
delay
void delay(uint32_t time)
delay function
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c:120
counter
uint32_t counter
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c:42
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c:49
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/tmr/encoder_tmr2/src/main.c:39
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR2_PERIPH_CLOCK
@ CRM_TMR2_PERIPH_CLOCK
Definition: at32f415_crm.h:123
TRUE
@ TRUE
Definition: at32f415.h:253
time
ertc_time_type * time
Definition: random.c:42
gpio_bits_reset
void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins)
clear the selected data port bits.
Definition: at32f415_gpio.c:341
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_bits_set
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins)
set the selected data port bits.
Definition: at32f415_gpio.c:310
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_MODE_OUTPUT
@ GPIO_MODE_OUTPUT
Definition: at32f415_gpio.h:229
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIO_PINS_1
#define GPIO_PINS_1
Definition: at32f415_gpio.h:52
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_counter_value_get
uint32_t tmr_counter_value_get(tmr_type *tmr_x)
get tmr counter value
Definition: at32f415_tmr.c:257
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_32_bit_function_enable
void tmr_32_bit_function_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr 32 bit function(plus mode)
Definition: at32f415_tmr.c:730
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_encoder_mode_config
void tmr_encoder_mode_config(tmr_type *tmr_x, tmr_encoder_mode_type encoder_mode, tmr_input_polarity_type ic1_polarity, tmr_input_polarity_type ic2_polarity)
config tmr encoder mode
Definition: at32f415_tmr.c:1560
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_INPUT_RISING_EDGE
@ TMR_INPUT_RISING_EDGE
Definition: at32f415_tmr.h:206
TMR_ENCODER_MODE_C
@ TMR_ENCODER_MODE_C
Definition: at32f415_tmr.h:165
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • external_clock
  • inc
project/at_start_f415/examples/tmr/external_clock/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • external_clock
  • inc
project/at_start_f415/examples/tmr/external_clock/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • external_clock
  • inc
project/at_start_f415/examples/tmr/external_clock/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • external_clock
  • src
project/at_start_f415/examples/tmr/external_clock/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/external_clock/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • external_clock
  • src
project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133 /* trigger TMR1 hall event */
134 tmr_event_sw_trigger(TMR1, TMR_HALL_SWTRIG);
135}
136
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/external_clock/src/at32f415_int.c:113
tmr_event_sw_trigger
void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event
Definition: at32f415_tmr.c:1369
TMR_HALL_SWTRIG
@ TMR_HALL_SWTRIG
Definition: at32f415_tmr.h:288
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • external_clock
  • src
project/at_start_f415/examples/tmr/external_clock/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39 crm_clocks_freq_type crm_clocks_freq_struct = {0};
40 tmr_output_config_type tmr_output_struct;
41 tmr_input_config_type tmr_input_config_struct;
42
48int main(void)
49{
50 system_clock_config();
51
52 at32_board_init();
53
54 /* get system clock */
55 crm_clocks_freq_get(&crm_clocks_freq_struct);
56
57 /* turn led2/led3/led4 on */
58 at32_led_on(LED2);
59 at32_led_on(LED3);
60 at32_led_on(LED4);
61
62 /* enable tmr2/tmr3/gpioa/gpiob clock */
63 crm_periph_clock_enable(CRM_TMR2_PERIPH_CLOCK, TRUE);
64 crm_periph_clock_enable(CRM_TMR3_PERIPH_CLOCK, TRUE);
65 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
66 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
67
68 /* timer2 and timer3 output pin Configuration */
69 gpio_init_struct.gpio_pins = GPIO_PINS_0;
70 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
71 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
72 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
73 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
74 gpio_init(GPIOA, &gpio_init_struct);
75 gpio_init(GPIOB, &gpio_init_struct);
76
77 gpio_init_struct.gpio_pins = GPIO_PINS_7;
78 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
79 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
80 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
81 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
82 gpio_init(GPIOA, &gpio_init_struct);
83
84 /* use tmr2 generate clock to drive tmr3
85 tmr2 pwm frequency = 144000000(systemclock)/144(period+1)/1000(div+1) = 1 khz
86 tmr3 pwm frequency = 1000(tmr2 pwm frequency)/10(period+1)/1(div+1) = 100 hz */
87
88 /* tmr2 and tmr3 counter mode configuration */
89 tmr_base_init(TMR2, 143, 999);
90 tmr_cnt_dir_set(TMR2, TMR_COUNT_UP);
91
92 tmr_base_init(TMR3, 9, 0);
93 tmr_cnt_dir_set(TMR3, TMR_COUNT_UP);
94
95 /* tmr2 and tmr3 output mode configuration */
96 tmr_output_default_para_init(&tmr_output_struct);
97 tmr_output_struct.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_A;
98 tmr_output_struct.oc_output_state = TRUE;
99 tmr_output_struct.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
100 tmr_output_struct.oc_idle_state = TRUE;
101 tmr_output_struct.occ_output_state = FALSE;
102 tmr_output_struct.occ_polarity = TMR_OUTPUT_ACTIVE_HIGH;
103 tmr_output_struct.occ_idle_state = FALSE;
104 /* tmr2 channel 1 */
105 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_1, &tmr_output_struct);
106 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_1, 72);
107 /* tmr3 channel 3 */
108 tmr_output_channel_config(TMR3, TMR_SELECT_CHANNEL_3, &tmr_output_struct);
109 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_3, 5);
110
111 /* configure tmr3 channel2 to get clock signal */
112 tmr_input_config_struct.input_channel_select = TMR_SELECT_CHANNEL_2;
113 tmr_input_config_struct.input_mapped_select = TMR_CC_CHANNEL_MAPPED_DIRECT;
114 tmr_input_config_struct.input_polarity_select = TMR_INPUT_RISING_EDGE;
115 tmr_input_channel_init(TMR3, &tmr_input_config_struct, TMR_CHANNEL_INPUT_DIV_1);
116
117 /* select the tmr3 input trigger: C2IF2 */
118 tmr_trigger_input_select(TMR3, TMR_SUB_INPUT_SEL_C2DF2);
119
120 /* select the slave mode: external mode a */
121 tmr_sub_mode_select(TMR3, TMR_SUB_EXTERNAL_CLOCK_MODE_A);
122
123 /* enable tmr2 */
124 tmr_counter_enable(TMR2, TRUE);
125
126 /* enable tmr3 */
127 tmr_counter_enable(TMR3, TRUE);
128
129 while(1)
130 {
131 }
132}
133
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/tmr/external_clock/src/main.c:38
tmr_output_struct
tmr_output_config_type tmr_output_struct
Definition: project/at_start_f415/examples/tmr/external_clock/src/main.c:40
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/external_clock/src/main.c:48
tmr_input_config_struct
tmr_input_config_type tmr_input_config_struct
Definition: project/at_start_f415/examples/tmr/external_clock/src/main.c:41
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/tmr/external_clock/src/main.c:39
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR2_PERIPH_CLOCK
@ CRM_TMR2_PERIPH_CLOCK
Definition: at32f415_crm.h:123
CRM_TMR3_PERIPH_CLOCK
@ CRM_TMR3_PERIPH_CLOCK
Definition: at32f415_crm.h:124
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_input_channel_init
void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
init tmr input channel
Definition: at32f415_tmr.c:780
tmr_sub_mode_select
void tmr_sub_mode_select(tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode
Definition: at32f415_tmr.c:1148
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_trigger_input_select
void tmr_trigger_input_select(tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger
Definition: at32f415_tmr.c:1212
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_INPUT_RISING_EDGE
@ TMR_INPUT_RISING_EDGE
Definition: at32f415_tmr.h:206
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_CC_CHANNEL_MAPPED_DIRECT
@ TMR_CC_CHANNEL_MAPPED_DIRECT
Definition: at32f415_tmr.h:239
TMR_OUTPUT_CONTROL_PWM_MODE_A
@ TMR_OUTPUT_CONTROL_PWM_MODE_A
Definition: at32f415_tmr.h:179
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR_SUB_INPUT_SEL_C2DF2
@ TMR_SUB_INPUT_SEL_C2DF2
Definition: at32f415_tmr.h:139
TMR_SUB_EXTERNAL_CLOCK_MODE_A
@ TMR_SUB_EXTERNAL_CLOCK_MODE_A
Definition: at32f415_tmr.h:155
TMR_CHANNEL_INPUT_DIV_1
@ TMR_CHANNEL_INPUT_DIV_1
Definition: at32f415_tmr.h:249
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_input_config_type
tmr input capture config type
Definition: at32f415_tmr.h:412
tmr_input_config_type::input_mapped_select
tmr_input_direction_mapped_type input_mapped_select
Definition: at32f415_tmr.h:415
tmr_input_config_type::input_polarity_select
tmr_input_polarity_type input_polarity_select
Definition: at32f415_tmr.h:414
tmr_input_config_type::input_channel_select
tmr_channel_select_type input_channel_select
Definition: at32f415_tmr.h:413
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::occ_output_state
confirm_state occ_output_state
Definition: at32f415_tmr.h:405
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::occ_polarity
tmr_output_polarity_type occ_polarity
Definition: at32f415_tmr.h:403
tmr_output_config_type::occ_idle_state
confirm_state occ_idle_state
Definition: at32f415_tmr.h:401
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • hall_xor_tmr2
  • inc
project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • hall_xor_tmr2
  • inc
project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • hall_xor_tmr2
  • inc
project/at_start_f415/examples/tmr/hall_xor_tmr2/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • hall_xor_tmr2
  • src
project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • hall_xor_tmr2
  • src
project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • hall_xor_tmr2
  • src
project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39 crm_clocks_freq_type crm_clocks_freq_struct = {0};
40 tmr_output_config_type tmr_output_struct;
41 tmr_input_config_type tmr_input_config_struct;
42
48int main(void)
49{
50 system_clock_config();
51
52 at32_board_init();
53
54 /* get system clock */
55 crm_clocks_freq_get(&crm_clocks_freq_struct);
56
57 /* turn led2/led3/led4 on */
58 at32_led_on(LED2);
59 at32_led_on(LED3);
60 at32_led_on(LED4);
61
62 /* enable tmr2/tmr3/gpioa/gpiob clock */
63 crm_periph_clock_enable(CRM_TMR2_PERIPH_CLOCK, TRUE);
64 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
65
66 /* tmr2 channel1 ,channel2 and channel3 configuration */
67 gpio_init_struct.gpio_pins = GPIO_PINS_0 | GPIO_PINS_1 | GPIO_PINS_2;
68 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
69 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
70 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
71 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
72 gpio_init(GPIOA, &gpio_init_struct);
73
74 /* hall signal (pa3 ,pa6 ,pa7) and trigger flag signal(pa8) configuration */
75 gpio_init_struct.gpio_pins = GPIO_PINS_3 | GPIO_PINS_6 | GPIO_PINS_7 | GPIO_PINS_8;
76 gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
77 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
78 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
79 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
80 gpio_init(GPIOA, &gpio_init_struct);
81
82 /* tmr2 xor mode configuration
83 tmr2 channel1 ,channel2 and channel3 as hall signal input channel, trigger
84 generated each signal edge. */
85
86 /* tmr2 and tmr3 counter mode configuration */
87 tmr_32_bit_function_enable(TMR2, TRUE);
88
89 tmr_base_init(TMR2, 0xFFFFFFFF, 0);
90 tmr_cnt_dir_set(TMR2, TMR_COUNT_UP);
91
92 /* config ti1 trc as input source */
93 tmr_input_config_struct.input_channel_select = TMR_SELECT_CHANNEL_1;
94 tmr_input_config_struct.input_mapped_select = TMR_CC_CHANNEL_MAPPED_STI;
95 tmr_input_config_struct.input_polarity_select = TMR_INPUT_RISING_EDGE;
96 tmr_input_channel_init(TMR2, &tmr_input_config_struct, TMR_CHANNEL_INPUT_DIV_1);
97
98 /* xor funtion enable */
99 tmr_channel1_input_select(TMR2, TMR_CHANEL1_2_3_CONNECTED_C1IRAW_XOR);
100
101 /* select the tmr2 input trigger: C1INC */
102 tmr_trigger_input_select(TMR2, TMR_SUB_INPUT_SEL_C1INC);
103
104 /* select the slave mode: reset mode */
105 tmr_sub_mode_select(TMR2, TMR_SUB_RESET_MODE);
106
107 tmr_interrupt_enable(TMR2, TMR_TRIGGER_INT, TRUE);
108
109 /* tmr2 trigger interrupt nvic init */
110 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
111 nvic_irq_enable(TMR2_GLOBAL_IRQn, 0, 0);
112
113 /* enable tmr2 */
114 tmr_counter_enable(TMR2, TRUE);
115
116 while(1)
117 {
118 /* generate hall signal */
119 gpio_bits_set(GPIOA, GPIO_PINS_3);
120 delay_us(10);
121 gpio_bits_set(GPIOA, GPIO_PINS_6);
122 delay_us(10);
123 gpio_bits_set(GPIOA, GPIO_PINS_7);
124 delay_us(10);
125 gpio_bits_reset(GPIOA, GPIO_PINS_3);
126 delay_us(10);
127 gpio_bits_reset(GPIOA, GPIO_PINS_6);
128 delay_us(10);
129 gpio_bits_reset(GPIOA, GPIO_PINS_7);
130 delay_us(10);
131 }
132}
133
139void TMR2_GLOBAL_IRQHandler(void)
140{
141 if(tmr_flag_get(TMR2, TMR_TRIGGER_FLAG) != RESET)
142 {
143 GPIOA->odt ^= GPIO_PINS_8;
144 tmr_flag_clear(TMR2, TMR_TRIGGER_FLAG);
145 }
146}
147
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c:38
tmr_output_struct
tmr_output_config_type tmr_output_struct
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c:40
TMR2_GLOBAL_IRQHandler
void TMR2_GLOBAL_IRQHandler(void)
this function handles TMR2 trigger exception.
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c:139
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c:48
tmr_input_config_struct
tmr_input_config_type tmr_input_config_struct
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c:41
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/tmr/hall_xor_tmr2/src/main.c:39
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR2_PERIPH_CLOCK
@ CRM_TMR2_PERIPH_CLOCK
Definition: at32f415_crm.h:123
TMR2_GLOBAL_IRQn
@ TMR2_GLOBAL_IRQn
Definition: at32f415.h:164
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_bits_reset
void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins)
clear the selected data port bits.
Definition: at32f415_gpio.c:341
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_bits_set
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins)
set the selected data port bits.
Definition: at32f415_gpio.c:310
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_MODE_OUTPUT
@ GPIO_MODE_OUTPUT
Definition: at32f415_gpio.h:229
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIO_PINS_1
#define GPIO_PINS_1
Definition: at32f415_gpio.h:52
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_input_channel_init
void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
init tmr input channel
Definition: at32f415_tmr.c:780
tmr_sub_mode_select
void tmr_sub_mode_select(tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode
Definition: at32f415_tmr.c:1148
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
tmr_channel1_input_select
void tmr_channel1_input_select(tmr_type *tmr_x, tmr_channel1_input_connected_type ti1_connect)
select tmr channel1 input
Definition: at32f415_tmr.c:1055
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_32_bit_function_enable
void tmr_32_bit_function_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr 32 bit function(plus mode)
Definition: at32f415_tmr.c:730
tmr_trigger_input_select
void tmr_trigger_input_select(tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger
Definition: at32f415_tmr.c:1212
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_INPUT_RISING_EDGE
@ TMR_INPUT_RISING_EDGE
Definition: at32f415_tmr.h:206
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_CHANEL1_2_3_CONNECTED_C1IRAW_XOR
@ TMR_CHANEL1_2_3_CONNECTED_C1IRAW_XOR
Definition: at32f415_tmr.h:231
TMR_CC_CHANNEL_MAPPED_STI
@ TMR_CC_CHANNEL_MAPPED_STI
Definition: at32f415_tmr.h:241
TMR_SUB_INPUT_SEL_C1INC
@ TMR_SUB_INPUT_SEL_C1INC
Definition: at32f415_tmr.h:137
TMR_SUB_RESET_MODE
@ TMR_SUB_RESET_MODE
Definition: at32f415_tmr.h:152
TMR_CHANNEL_INPUT_DIV_1
@ TMR_CHANNEL_INPUT_DIV_1
Definition: at32f415_tmr.h:249
TMR_TRIGGER_FLAG
#define TMR_TRIGGER_FLAG
Definition: at32f415_tmr.h:58
TMR_TRIGGER_INT
#define TMR_TRIGGER_INT
Definition: at32f415_tmr.h:80
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_input_config_type
tmr input capture config type
Definition: at32f415_tmr.h:412
tmr_input_config_type::input_mapped_select
tmr_input_direction_mapped_type input_mapped_select
Definition: at32f415_tmr.h:415
tmr_input_config_type::input_polarity_select
tmr_input_polarity_type input_polarity_select
Definition: at32f415_tmr.h:414
tmr_input_config_type::input_channel_select
tmr_channel_select_type input_channel_select
Definition: at32f415_tmr.h:413
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • hang_mode
  • inc
project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • hang_mode
  • inc
project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • hang_mode
  • inc
project/at_start_f415/examples/tmr/hang_mode/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • hang_mode
  • src
project/at_start_f415/examples/tmr/hang_mode/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/hang_mode/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • hang_mode
  • src
project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133 /* trigger TMR1 hall event */
134 tmr_event_sw_trigger(TMR1, TMR_HALL_SWTRIG);
135}
136
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/hang_mode/src/at32f415_int.c:113
tmr_event_sw_trigger
void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event
Definition: at32f415_tmr.c:1369
TMR_HALL_SWTRIG
@ TMR_HALL_SWTRIG
Definition: at32f415_tmr.h:288
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • hang_mode
  • src
project/at_start_f415/examples/tmr/hang_mode/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39 crm_clocks_freq_type crm_clocks_freq_struct = {0};
40 tmr_output_config_type tmr_output_struct;
41 tmr_input_config_type tmr_input_config_struct;
42
48int main(void)
49{
50 system_clock_config();
51
52 at32_board_init();
53
54 /* get system clock */
55 crm_clocks_freq_get(&crm_clocks_freq_struct);
56
57 /* turn led2/led3/led4 on */
58 at32_led_on(LED2);
59 at32_led_on(LED3);
60 at32_led_on(LED4);
61
62 /* enable tmr1/gpioa clock */
63 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
64 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
65
66 /* timer1 output pin configuration */
67 gpio_init_struct.gpio_pins = GPIO_PINS_8;
68 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
69 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
70 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
71 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
72 gpio_init(GPIOA, &gpio_init_struct);
73
74 gpio_init_struct.gpio_pins = GPIO_PINS_9;
75 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
76 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
77 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
78 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
79 gpio_init(GPIOA, &gpio_init_struct);
80
81 /* hang mode test
82 1/tmr1 is configured as master timer:
83 - toggle mode is used
84
85 2/tmr1 is configured as slave timer for an external trigger connected
86 to tmr1 ti2 pin (tmr1 ch2 configured as input pin):
87 - the tmr1 ti2fp2 is used as trigger input
88 - rising edge is used to start and stop the tmr1: hang mode.
89
90 the tmr1 are running at:
91 tmrx frequency = tmrx clock counter/ 2*(timx_period + 1) = 500 khz.
92 */
93
94 tmr_base_init(TMR1, 143, 0);
95 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
96
97 /* tmr1 output mode configuration */
98 tmr_output_default_para_init(&tmr_output_struct);
99 tmr_output_struct.oc_mode = TMR_OUTPUT_CONTROL_SWITCH;
100 tmr_output_struct.oc_output_state = TRUE;
101 tmr_output_struct.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
102 tmr_output_struct.oc_idle_state = TRUE;
103 tmr_output_struct.occ_output_state = FALSE;
104 tmr_output_struct.occ_polarity = TMR_OUTPUT_ACTIVE_HIGH;
105 tmr_output_struct.occ_idle_state = FALSE;
106 /* tmr1 channel 1 */
107 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_1, &tmr_output_struct);
108 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_1, 50);
109
110 /* configure tmr1 channel2 to get hang signal */
111 tmr_input_default_para_init(&tmr_input_config_struct);
112 tmr_input_config_struct.input_channel_select = TMR_SELECT_CHANNEL_2;
113 tmr_input_config_struct.input_mapped_select = TMR_CC_CHANNEL_MAPPED_DIRECT;
114 tmr_input_config_struct.input_polarity_select = TMR_INPUT_RISING_EDGE;
115 tmr_input_channel_init(TMR1, &tmr_input_config_struct, TMR_CHANNEL_INPUT_DIV_1);
116
117 /* select the tmr1 input trigger: c2df2 */
118 tmr_trigger_input_select(TMR1, TMR_SUB_INPUT_SEL_C2DF2);
119
120 /* select the slave mode: hang mode */
121 tmr_sub_mode_select(TMR1, TMR_SUB_HANG_MODE);
122
123 /* output enable */
124 tmr_output_enable(TMR1, TRUE);
125
126 /* enable tmr1 */
127 tmr_counter_enable(TMR1, TRUE);
128
129 while(1)
130 {
131 }
132}
133
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/tmr/hang_mode/src/main.c:38
tmr_output_struct
tmr_output_config_type tmr_output_struct
Definition: project/at_start_f415/examples/tmr/hang_mode/src/main.c:40
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/hang_mode/src/main.c:48
tmr_input_config_struct
tmr_input_config_type tmr_input_config_struct
Definition: project/at_start_f415/examples/tmr/hang_mode/src/main.c:41
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/tmr/hang_mode/src/main.c:39
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_input_channel_init
void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
init tmr input channel
Definition: at32f415_tmr.c:780
tmr_sub_mode_select
void tmr_sub_mode_select(tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode
Definition: at32f415_tmr.c:1148
tmr_input_default_para_init
void tmr_input_default_para_init(tmr_input_config_type *tmr_input_struct)
init tmr input default para
Definition: at32f415_tmr.c:132
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_output_enable
void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable
Definition: at32f415_tmr.c:1382
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_trigger_input_select
void tmr_trigger_input_select(tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger
Definition: at32f415_tmr.c:1212
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_INPUT_RISING_EDGE
@ TMR_INPUT_RISING_EDGE
Definition: at32f415_tmr.h:206
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_CC_CHANNEL_MAPPED_DIRECT
@ TMR_CC_CHANNEL_MAPPED_DIRECT
Definition: at32f415_tmr.h:239
TMR_OUTPUT_CONTROL_SWITCH
@ TMR_OUTPUT_CONTROL_SWITCH
Definition: at32f415_tmr.h:176
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR_SUB_INPUT_SEL_C2DF2
@ TMR_SUB_INPUT_SEL_C2DF2
Definition: at32f415_tmr.h:139
TMR_SUB_HANG_MODE
@ TMR_SUB_HANG_MODE
Definition: at32f415_tmr.h:153
TMR_CHANNEL_INPUT_DIV_1
@ TMR_CHANNEL_INPUT_DIV_1
Definition: at32f415_tmr.h:249
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_input_config_type
tmr input capture config type
Definition: at32f415_tmr.h:412
tmr_input_config_type::input_mapped_select
tmr_input_direction_mapped_type input_mapped_select
Definition: at32f415_tmr.h:415
tmr_input_config_type::input_polarity_select
tmr_input_polarity_type input_polarity_select
Definition: at32f415_tmr.h:414
tmr_input_config_type::input_channel_select
tmr_channel_select_type input_channel_select
Definition: at32f415_tmr.h:413
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::occ_output_state
confirm_state occ_output_state
Definition: at32f415_tmr.h:405
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::occ_polarity
tmr_output_polarity_type occ_polarity
Definition: at32f415_tmr.h:403
tmr_output_config_type::occ_idle_state
confirm_state occ_idle_state
Definition: at32f415_tmr.h:401
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • input_capture
  • inc
project/at_start_f415/examples/tmr/input_capture/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • input_capture
  • inc
project/at_start_f415/examples/tmr/input_capture/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • input_capture
  • inc
project/at_start_f415/examples/tmr/input_capture/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • input_capture
  • src
project/at_start_f415/examples/tmr/input_capture/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/input_capture/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • input_capture
  • src
project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/input_capture/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • input_capture
  • src
project/at_start_f415/examples/tmr/input_capture/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39 crm_clocks_freq_type crm_clocks_freq_struct = {0};
40 tmr_input_config_type tmr_input_config_struct;
41void uart_init(uint32_t baudrate);
42__IO uint32_t tmr3freq = 0;
43__IO uint32_t sys_counter = 0;
44__IO uint16_t capturenumber = 0;
45__IO uint16_t ch3readvalue1 = 0, ch3readvalue2 = 0;
46__IO uint32_t capture = 0;
47
53void TMR3_GLOBAL_IRQHandler(void)
54{
55 if(tmr_flag_get(TMR3, TMR_C2_FLAG) != RESET)
56 {
57 tmr_flag_clear(TMR3, TMR_C2_FLAG);
58 if(capturenumber == 0)
59 {
60 /* get the Input Capture value */
61 ch3readvalue1 = tmr_channel_value_get(TMR3, TMR_SELECT_CHANNEL_2);
62 capturenumber = 1;
63 }
64 else if(capturenumber == 1)
65 {
66 /* get the Input Capture value */
67 ch3readvalue2 = tmr_channel_value_get(TMR3, TMR_SELECT_CHANNEL_2);
68
69 /* capture computation */
70 if(ch3readvalue2 > ch3readvalue1)
71 {
72 capture = (ch3readvalue2 - ch3readvalue1);
73 }
74 else
75 {
76 capture = ((0xFFFF - ch3readvalue1) + ch3readvalue2);
77 }
78
79 /* frequency computation */
80 tmr3freq = (uint32_t) crm_clocks_freq_struct.sclk_freq / capture;
81 capturenumber = 0;
82 }
83 }
84}
85
91int main(void)
92{
93 system_clock_config();
94
95 at32_board_init();
96
97 uart_print_init(115200);
98
99 /* get system clock */
100 crm_clocks_freq_get(&crm_clocks_freq_struct);
101
102 /* turn led2/led3/led4 on */
103 at32_led_on(LED2);
104 at32_led_on(LED3);
105 at32_led_on(LED4);
106
107 /* enable tmr3/gpioa clock */
108 crm_periph_clock_enable(CRM_TMR3_PERIPH_CLOCK, TRUE);
109 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
110
111 /* timer3 input pin Configuration */
112 gpio_init_struct.gpio_pins = GPIO_PINS_7;
113 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
114 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
115 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
116 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
117 gpio_init(GPIOA, &gpio_init_struct);
118
119 /* tmr3 configuration: input capture mode
120 the external signal is connected to tmr3 ch2 pin (pa.07)
121 the rising edge is used as active edge,
122 the tmr3 c2dt is used to compute the frequency value */
123
124 /* tmr3 counter mode configuration */
125 tmr_base_init(TMR3, 0xFFFF, 0);
126 tmr_cnt_dir_set(TMR3, TMR_COUNT_UP);
127
128 /* configure tmr3 channel2 to get clock signal */
129 tmr_input_config_struct.input_channel_select = TMR_SELECT_CHANNEL_2;
130 tmr_input_config_struct.input_mapped_select = TMR_CC_CHANNEL_MAPPED_DIRECT;
131 tmr_input_config_struct.input_polarity_select = TMR_INPUT_RISING_EDGE;
132 tmr_input_channel_init(TMR3, &tmr_input_config_struct, TMR_CHANNEL_INPUT_DIV_1);
133
134 tmr_interrupt_enable(TMR3, TMR_C2_INT, TRUE);
135
136 /* tmr2 trigger interrupt nvic init */
137 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
138 nvic_irq_enable(TMR3_GLOBAL_IRQn, 0, 0);
139
140 /* enable tmr3 */
141 tmr_counter_enable(TMR3, TRUE);
142
143 while(1)
144 {
145 delay_ms(100);
146 printf("The external signal frequece is : %d\r\n",tmr3freq);
147 tmr3freq = 0;
148 }
149}
150
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/tmr/input_capture/src/main.c:38
ch3readvalue2
__IO uint16_t ch3readvalue2
Definition: project/at_start_f415/examples/tmr/input_capture/src/main.c:45
ch3readvalue1
__IO uint16_t ch3readvalue1
Definition: project/at_start_f415/examples/tmr/input_capture/src/main.c:45
tmr3freq
__IO uint32_t tmr3freq
Definition: project/at_start_f415/examples/tmr/input_capture/src/main.c:42
capturenumber
__IO uint16_t capturenumber
Definition: project/at_start_f415/examples/tmr/input_capture/src/main.c:44
TMR3_GLOBAL_IRQHandler
void TMR3_GLOBAL_IRQHandler(void)
this function handles tmr3 trigger exception.
Definition: project/at_start_f415/examples/tmr/input_capture/src/main.c:53
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/input_capture/src/main.c:91
uart_init
void uart_init(uint32_t baudrate)
init usart.
Definition: app_led3_toggle/src/usart.c:45
tmr_input_config_struct
tmr_input_config_type tmr_input_config_struct
Definition: project/at_start_f415/examples/tmr/input_capture/src/main.c:40
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/tmr/input_capture/src/main.c:39
sys_counter
__IO uint32_t sys_counter
Definition: project/at_start_f415/examples/tmr/input_capture/src/main.c:43
capture
__IO uint32_t capture
Definition: project/at_start_f415/examples/tmr/input_capture/src/main.c:46
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR3_PERIPH_CLOCK
@ CRM_TMR3_PERIPH_CLOCK
Definition: at32f415_crm.h:124
TMR3_GLOBAL_IRQn
@ TMR3_GLOBAL_IRQn
Definition: at32f415.h:165
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_channel_value_get
uint32_t tmr_channel_value_get(tmr_type *tmr_x, tmr_channel_select_type tmr_channel)
get tmr channel value
Definition: at32f415_tmr.c:527
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_input_channel_init
void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
init tmr input channel
Definition: at32f415_tmr.c:780
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_INPUT_RISING_EDGE
@ TMR_INPUT_RISING_EDGE
Definition: at32f415_tmr.h:206
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_CC_CHANNEL_MAPPED_DIRECT
@ TMR_CC_CHANNEL_MAPPED_DIRECT
Definition: at32f415_tmr.h:239
TMR_CHANNEL_INPUT_DIV_1
@ TMR_CHANNEL_INPUT_DIV_1
Definition: at32f415_tmr.h:249
TMR_C2_FLAG
#define TMR_C2_FLAG
Definition: at32f415_tmr.h:54
TMR_C2_INT
#define TMR_C2_INT
Definition: at32f415_tmr.h:76
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::sclk_freq
uint32_t sclk_freq
Definition: at32f415_crm.h:472
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_input_config_type
tmr input capture config type
Definition: at32f415_tmr.h:412
tmr_input_config_type::input_mapped_select
tmr_input_direction_mapped_type input_mapped_select
Definition: at32f415_tmr.h:415
tmr_input_config_type::input_polarity_select
tmr_input_polarity_type input_polarity_select
Definition: at32f415_tmr.h:414
tmr_input_config_type::input_channel_select
tmr_channel_select_type input_channel_select
Definition: at32f415_tmr.h:413
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • oc_high
  • inc
project/at_start_f415/examples/tmr/oc_high/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • oc_high
  • inc
project/at_start_f415/examples/tmr/oc_high/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • oc_high
  • inc
project/at_start_f415/examples/tmr/oc_high/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • oc_high
  • src
project/at_start_f415/examples/tmr/oc_high/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/oc_high/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • oc_high
  • src
project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
140void TMR2_GLOBAL_IRQHandler(void)
141{
142 if(tmr_flag_get(TMR2, TMR_C1_FLAG) != RESET)
143 {
144 /* clear tmr2 channel1 interrupt pending bit */
145 tmr_flag_clear(TMR2, TMR_C1_FLAG);
146
147 /* pc.06 turnoff after 1000 ms */
148 gpio_bits_reset(GPIOC, GPIO_PINS_6);
149 }
150 else if(tmr_flag_get(TMR2, TMR_C2_FLAG) != RESET)
151 {
152 /* clear tmr2 channel2 interrupt pending bit */
153 tmr_flag_clear(TMR2, TMR_C2_FLAG);
154
155 /* pc.07 turnoff after 500 ms */
156 gpio_bits_reset(GPIOC, GPIO_PINS_7);
157 }
158 else if(tmr_flag_get(TMR2, TMR_C3_FLAG) != RESET)
159 {
160 /* clear tmr2 channel3 interrupt pending bit */
161 tmr_flag_clear(TMR2, TMR_C3_FLAG);
162
163 /* pc.08 turnoff after 250 ms */
164 gpio_bits_reset(GPIOC, GPIO_PINS_8);
165 }
166 else
167 {
168 /* clear tmr2 channel4 interrupt pending bit */
169 tmr_flag_clear(TMR2, TMR_C4_FLAG);
170
171 /* pc.09 turnoff after 125 ms */
172 gpio_bits_reset(GPIOC, GPIO_PINS_9);
173 }
174}
175
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c:104
TMR2_GLOBAL_IRQHandler
void TMR2_GLOBAL_IRQHandler(void)
this function handles tmr2 global interrupt request.
Definition: project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c:140
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/oc_high/src/at32f415_int.c:113
RESET
@ RESET
Definition: at32f415.h:248
gpio_bits_reset
void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins)
clear the selected data port bits.
Definition: at32f415_gpio.c:341
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOC
#define GPIOC
Definition: at32f415_gpio.h:772
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
TMR_C1_FLAG
#define TMR_C1_FLAG
Definition: at32f415_tmr.h:53
TMR_C2_FLAG
#define TMR_C2_FLAG
Definition: at32f415_tmr.h:54
TMR_C3_FLAG
#define TMR_C3_FLAG
Definition: at32f415_tmr.h:55
TMR_C4_FLAG
#define TMR_C4_FLAG
Definition: at32f415_tmr.h:56
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • oc_high
  • src
project/at_start_f415/examples/tmr/oc_high/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 tmr_output_config_type tmr_oc_init_structure;
39 crm_clocks_freq_type crm_clocks_freq_struct = {0};
40uint16_t ch1_val = 1000;
41uint16_t ch2_val = 500;
42uint16_t ch3_val = 250;
43uint16_t ch4_val = 125;
44uint16_t div_value = 0;
45
46void gpio_configuration(void);
47
53void gpio_configuration(void)
54{
55 gpio_init_type gpio_init_struct;
56
57 gpio_default_para_init(&gpio_init_struct);
58
59 /* gpioc configuration: pin6, 7, 8 and 9 as output push-pull */
60 gpio_init_struct.gpio_pins = GPIO_PINS_6 | GPIO_PINS_7 | GPIO_PINS_8 | GPIO_PINS_9;
61 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
62 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
63 gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
64 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
65
66 gpio_init(GPIOC, &gpio_init_struct);
67}
68
74int main(void)
75{
76 /* config nvic priority group */
77 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
78
79 system_clock_config();
80
81 at32_board_init();
82
83 /* get system clock */
84 crm_clocks_freq_get(&crm_clocks_freq_struct);
85
86 crm_apb1_div_set(CRM_APB1_DIV_8);
87 crm_periph_clock_enable(CRM_TMR2_PERIPH_CLOCK, TRUE);
88 crm_periph_clock_enable(CRM_GPIOC_PERIPH_CLOCK, TRUE);
89
90 nvic_irq_enable(TMR2_GLOBAL_IRQn, 0, 0);
91
92 gpio_configuration();
93
94 /* compute the div value */
95 div_value = (uint16_t)(crm_clocks_freq_struct.sclk_freq / 4000) - 1;
96
97 /* tmr2 time base configuration */
98 tmr_base_init(TMR2, 0xFFFF, div_value);
99 tmr_cnt_dir_set(TMR2, TMR_COUNT_UP);
100 tmr_clock_source_div_set(TMR2, TMR_CLOCK_DIV1);
101
102 tmr_output_default_para_init(&tmr_oc_init_structure);
103 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_HIGH;
104 tmr_oc_init_structure.oc_idle_state = FALSE;
105 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
106 tmr_oc_init_structure.oc_output_state = TRUE;
107 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
108 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_1, ch1_val);
109
110 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_2, &tmr_oc_init_structure);
111 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_2, ch2_val);
112
113 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_3, &tmr_oc_init_structure);
114 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_3, ch3_val);
115
116 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_4, &tmr_oc_init_structure);
117 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_4, ch4_val);
118
119 tmr_period_buffer_enable(TMR2, TRUE);
120
121 /* tmr2 int enable */
122 tmr_interrupt_enable(TMR2, TMR_C1_INT | TMR_C2_INT | TMR_C3_INT | TMR_C4_INT, TRUE);
123
124 /* set pc.06, pc.07, pc.08 and pc.09 pins */
125 gpio_bits_set(GPIOC, GPIO_PINS_6 | GPIO_PINS_7 | GPIO_PINS_8 | GPIO_PINS_9);
126
127 /* tmr2 enable counter */
128 tmr_counter_enable(TMR2, TRUE);
129
130 while(1)
131 {
132 }
133}
134
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
ch4_val
uint16_t ch4_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:43
ch3_val
uint16_t ch3_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:42
ch1_val
uint16_t ch1_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:40
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:74
ch2_val
uint16_t ch2_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:41
gpio_configuration
void gpio_configuration(void)
configure the gpioc pins.
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:53
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:38
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:39
div_value
uint16_t div_value
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:44
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_GPIOC_PERIPH_CLOCK
@ CRM_GPIOC_PERIPH_CLOCK
Definition: at32f415_crm.h:112
CRM_TMR2_PERIPH_CLOCK
@ CRM_TMR2_PERIPH_CLOCK
Definition: at32f415_crm.h:123
CRM_APB1_DIV_8
@ CRM_APB1_DIV_8
Definition: at32f415_crm.h:334
TMR2_GLOBAL_IRQn
@ TMR2_GLOBAL_IRQn
Definition: at32f415.h:164
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_bits_set
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins)
set the selected data port bits.
Definition: at32f415_gpio.c:310
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_OUTPUT
@ GPIO_MODE_OUTPUT
Definition: at32f415_gpio.h:229
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOC
#define GPIOC
Definition: at32f415_gpio.h:772
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_period_buffer_enable
void tmr_period_buffer_enable(tmr_type *tmr_x, confirm_state new_state)
enable tmr period buffer
Definition: at32f415_tmr.c:567
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_4
@ TMR_SELECT_CHANNEL_4
Definition: at32f415_tmr.h:222
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_HIGH
@ TMR_OUTPUT_CONTROL_HIGH
Definition: at32f415_tmr.h:174
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR_C3_INT
#define TMR_C3_INT
Definition: at32f415_tmr.h:77
TMR_C4_INT
#define TMR_C4_INT
Definition: at32f415_tmr.h:78
TMR_C1_INT
#define TMR_C1_INT
Definition: at32f415_tmr.h:75
TMR_C2_INT
#define TMR_C2_INT
Definition: at32f415_tmr.h:76
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::sclk_freq
uint32_t sclk_freq
Definition: at32f415_crm.h:472
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • oc_low
  • inc
project/at_start_f415/examples/tmr/oc_low/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • oc_low
  • inc
project/at_start_f415/examples/tmr/oc_low/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • oc_low
  • inc
project/at_start_f415/examples/tmr/oc_low/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • oc_low
  • src
project/at_start_f415/examples/tmr/oc_low/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/oc_low/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • oc_low
  • src
project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
140void TMR2_GLOBAL_IRQHandler(void)
141{
142 if(tmr_flag_get(TMR2, TMR_C1_FLAG) != RESET)
143 {
144 /* clear tmr2 channel1 interrupt pending bit */
145 tmr_flag_clear(TMR2, TMR_C1_FLAG);
146
147 /* pc.06 turnoff after 1000 ms */
148 gpio_bits_reset(GPIOC, GPIO_PINS_6);
149 }
150 else if(tmr_flag_get(TMR2, TMR_C2_FLAG) != RESET)
151 {
152 /* clear tmr2 channel2 interrupt pending bit */
153 tmr_flag_clear(TMR2, TMR_C2_FLAG);
154
155 /* pc.07 turnoff after 500 ms */
156 gpio_bits_reset(GPIOC, GPIO_PINS_7);
157 }
158 else if(tmr_flag_get(TMR2, TMR_C3_FLAG) != RESET)
159 {
160 /* clear tmr2 channel3 interrupt pending bit */
161 tmr_flag_clear(TMR2, TMR_C3_FLAG);
162
163 /* pc.08 turnoff after 250 ms */
164 gpio_bits_reset(GPIOC, GPIO_PINS_8);
165 }
166 else
167 {
168 /* clear tmr2 channel4 interrupt pending bit */
169 tmr_flag_clear(TMR2, TMR_C4_FLAG);
170
171 /* pc.09 turnoff after 125 ms */
172 gpio_bits_reset(GPIOC, GPIO_PINS_9);
173 }
174}
175
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c:104
TMR2_GLOBAL_IRQHandler
void TMR2_GLOBAL_IRQHandler(void)
this function handles tmr2 global interrupt request.
Definition: project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c:140
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/oc_low/src/at32f415_int.c:113
RESET
@ RESET
Definition: at32f415.h:248
gpio_bits_reset
void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins)
clear the selected data port bits.
Definition: at32f415_gpio.c:341
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOC
#define GPIOC
Definition: at32f415_gpio.h:772
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
TMR_C1_FLAG
#define TMR_C1_FLAG
Definition: at32f415_tmr.h:53
TMR_C2_FLAG
#define TMR_C2_FLAG
Definition: at32f415_tmr.h:54
TMR_C3_FLAG
#define TMR_C3_FLAG
Definition: at32f415_tmr.h:55
TMR_C4_FLAG
#define TMR_C4_FLAG
Definition: at32f415_tmr.h:56
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • oc_low
  • src
project/at_start_f415/examples/tmr/oc_low/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 tmr_output_config_type tmr_oc_init_structure;
39uint16_t ch1_val = 1000;
40uint16_t ch2_val = 500;
41uint16_t ch3_val = 250;
42uint16_t ch4_val = 125;
43uint16_t div_value = 0;
44
45void gpio_configuration(void);
46
52void gpio_configuration(void)
53{
54 gpio_init_type gpio_init_struct;
55
56 /* gpioc configuration: pin6, 7, 8 and 9 as output push-pull */
57 gpio_default_para_init(&gpio_init_struct);
58 gpio_init_struct.gpio_pins = GPIO_PINS_6 | GPIO_PINS_7 | GPIO_PINS_8 | GPIO_PINS_9;
59 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
60 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
61 gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
62 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
63
64 gpio_init(GPIOC, &gpio_init_struct);
65}
66
72int main(void)
73{
74 /* config nvic priority group */
75 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
76
77 system_clock_config();
78
79 at32_board_init();
80
81 crm_apb1_div_set(CRM_APB1_DIV_8);
82 crm_periph_clock_enable(CRM_TMR2_PERIPH_CLOCK, TRUE);
83 crm_periph_clock_enable(CRM_GPIOC_PERIPH_CLOCK, TRUE);
84
85 nvic_irq_enable(TMR2_GLOBAL_IRQn, 0, 0);
86
87 gpio_configuration();
88
89 /* compute the div value */
90 div_value = (uint16_t)(system_core_clock / 4000) - 1;
91
92 /* tmr2 time base configuration */
93 tmr_base_init(TMR2, 65535, div_value);
94 tmr_cnt_dir_set(TMR2, TMR_COUNT_UP);
95 tmr_clock_source_div_set(TMR2, TMR_CLOCK_DIV1);
96
97 tmr_output_default_para_init(&tmr_oc_init_structure);
98 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_LOW;
99 tmr_oc_init_structure.oc_idle_state = FALSE;
100 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
101 tmr_oc_init_structure.oc_output_state = TRUE;
102 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
103 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_1, ch1_val);
104
105 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_2, &tmr_oc_init_structure);
106 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_2, ch2_val);
107
108 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_3, &tmr_oc_init_structure);
109 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_3, ch3_val);
110
111 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_4, &tmr_oc_init_structure);
112 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_4, ch4_val);
113
114 tmr_period_buffer_enable(TMR2, TRUE);
115
116 /* tmr2 int enable */
117 tmr_interrupt_enable(TMR2, TMR_C1_INT | TMR_C2_INT | TMR_C3_INT | TMR_C4_INT, TRUE);
118
119 /* set pc.06, pc.07, pc.08 and pc.09 pins */
120 gpio_bits_set(GPIOC, GPIO_PINS_6 | GPIO_PINS_7 | GPIO_PINS_8 | GPIO_PINS_9);
121
122 /* tmr2 enable counter */
123 tmr_counter_enable(TMR2, TRUE);
124
125 while(1)
126 {
127 }
128}
129
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
ch4_val
uint16_t ch4_val
Definition: project/at_start_f415/examples/tmr/oc_low/src/main.c:42
ch3_val
uint16_t ch3_val
Definition: project/at_start_f415/examples/tmr/oc_low/src/main.c:41
ch1_val
uint16_t ch1_val
Definition: project/at_start_f415/examples/tmr/oc_low/src/main.c:39
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/oc_low/src/main.c:72
ch2_val
uint16_t ch2_val
Definition: project/at_start_f415/examples/tmr/oc_low/src/main.c:40
gpio_configuration
void gpio_configuration(void)
configure the gpioc pins.
Definition: project/at_start_f415/examples/tmr/oc_low/src/main.c:52
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/oc_low/src/main.c:38
div_value
uint16_t div_value
Definition: project/at_start_f415/examples/tmr/oc_low/src/main.c:43
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOC_PERIPH_CLOCK
@ CRM_GPIOC_PERIPH_CLOCK
Definition: at32f415_crm.h:112
CRM_TMR2_PERIPH_CLOCK
@ CRM_TMR2_PERIPH_CLOCK
Definition: at32f415_crm.h:123
CRM_APB1_DIV_8
@ CRM_APB1_DIV_8
Definition: at32f415_crm.h:334
TMR2_GLOBAL_IRQn
@ TMR2_GLOBAL_IRQn
Definition: at32f415.h:164
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_bits_set
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins)
set the selected data port bits.
Definition: at32f415_gpio.c:310
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_OUTPUT
@ GPIO_MODE_OUTPUT
Definition: at32f415_gpio.h:229
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOC
#define GPIOC
Definition: at32f415_gpio.h:772
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_period_buffer_enable
void tmr_period_buffer_enable(tmr_type *tmr_x, confirm_state new_state)
enable tmr period buffer
Definition: at32f415_tmr.c:567
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_4
@ TMR_SELECT_CHANNEL_4
Definition: at32f415_tmr.h:222
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_LOW
@ TMR_OUTPUT_CONTROL_LOW
Definition: at32f415_tmr.h:175
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR_C3_INT
#define TMR_C3_INT
Definition: at32f415_tmr.h:77
TMR_C4_INT
#define TMR_C4_INT
Definition: at32f415_tmr.h:78
TMR_C1_INT
#define TMR_C1_INT
Definition: at32f415_tmr.h:75
TMR_C2_INT
#define TMR_C2_INT
Definition: at32f415_tmr.h:76
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • oc_toggle_tmr3
  • inc
project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • oc_toggle_tmr3
  • inc
project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • oc_toggle_tmr3
  • inc
project/at_start_f415/examples/tmr/oc_toggle_tmr3/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • oc_toggle_tmr3
  • src
project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • oc_toggle_tmr3
  • src
project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
30extern __IO uint16_t ch1_val;
31extern __IO uint16_t ch2_val;
32extern __IO uint16_t ch3_val;
33extern __IO uint16_t ch4_val;
34
43uint32_t capture = 0;
44
50void NMI_Handler(void)
51{
52}
53
59void HardFault_Handler(void)
60{
61 /* go to infinite loop when hard fault exception occurs */
62 while(1)
63 {
64 }
65}
66
72void MemManage_Handler(void)
73{
74 /* go to infinite loop when memory manage exception occurs */
75 while(1)
76 {
77 }
78}
79
85void BusFault_Handler(void)
86{
87 /* go to infinite loop when bus fault exception occurs */
88 while(1)
89 {
90 }
91}
92
98void UsageFault_Handler(void)
99{
100 /* go to infinite loop when usage fault exception occurs */
101 while(1)
102 {
103 }
104}
105
111void SVC_Handler(void)
112{
113}
114
120void DebugMon_Handler(void)
121{
122}
123
129void PendSV_Handler(void)
130{
131}
132
138void SysTick_Handler(void)
139{
140}
141
147void TMR3_GLOBAL_IRQHandler(void)
148{
149 /* TMR3_CH1 toggling with frequency = 183.1 Hz */
150 if(tmr_flag_get(TMR3, TMR_C1_FLAG) != RESET)
151 {
152 tmr_flag_clear(TMR3, TMR_C1_FLAG );
153 capture = tmr_channel_value_get(TMR3, TMR_SELECT_CHANNEL_1);
154 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_1, capture + ch1_val);
155 }
156
157 /* TMR3_CH2 toggling with frequency = 366.2 Hz */
158 if(tmr_flag_get(TMR3, TMR_C2_FLAG) != RESET)
159 {
160 tmr_flag_clear(TMR3, TMR_C2_FLAG);
161 capture = tmr_channel_value_get(TMR3, TMR_SELECT_CHANNEL_2);
162 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_2, capture + ch2_val);
163 }
164
165 /* TMR3_CH3 toggling with frequency = 732.4 Hz */
166 if(tmr_flag_get(TMR3, TMR_C3_FLAG) != RESET)
167 {
168 tmr_flag_clear(TMR3, TMR_C3_FLAG);
169 capture = tmr_channel_value_get(TMR3, TMR_SELECT_CHANNEL_3);
170 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_3, capture + ch3_val);
171 }
172
173 /* TMR3_CH4 toggling with frequency = 1464.8 Hz */
174 if(tmr_flag_get(TMR3, TMR_C4_FLAG) != RESET)
175 {
176 tmr_flag_clear(TMR3, TMR_C4_FLAG);
177 capture = tmr_channel_value_get(TMR3, TMR_SELECT_CHANNEL_4);
178 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_4, capture + ch4_val);
179 }
180}
181
ch4_val
__IO uint16_t ch4_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:43
ch3_val
__IO uint16_t ch3_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:42
ch1_val
__IO uint16_t ch1_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:40
ch2_val
__IO uint16_t ch2_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:41
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c:98
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c:59
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c:72
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c:111
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c:129
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c:50
TMR3_GLOBAL_IRQHandler
void TMR3_GLOBAL_IRQHandler(void)
this function handles tmr3 global interrupt request.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c:147
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c:85
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c:138
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c:120
capture
uint32_t capture
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/at32f415_int.c:43
RESET
@ RESET
Definition: at32f415.h:248
tmr_channel_value_get
uint32_t tmr_channel_value_get(tmr_type *tmr_x, tmr_channel_select_type tmr_channel)
get tmr channel value
Definition: at32f415_tmr.c:527
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_4
@ TMR_SELECT_CHANNEL_4
Definition: at32f415_tmr.h:222
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_C1_FLAG
#define TMR_C1_FLAG
Definition: at32f415_tmr.h:53
TMR_C2_FLAG
#define TMR_C2_FLAG
Definition: at32f415_tmr.h:54
TMR_C3_FLAG
#define TMR_C3_FLAG
Definition: at32f415_tmr.h:55
TMR_C4_FLAG
#define TMR_C4_FLAG
Definition: at32f415_tmr.h:56
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • oc_toggle_tmr3
  • src
project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 tmr_output_config_type tmr_oc_init_structure;
39__IO uint16_t ch1_val = 32768;
40__IO uint16_t ch2_val = 16384;
41__IO uint16_t ch3_val = 8192;
42__IO uint16_t ch4_val = 4096;
43uint16_t div_value = 0;
44
45void crm_configuration(void);
46void gpio_configuration(void);
47void nvic_configuration(void);
48
54void gpio_configuration(void)
55{
56 gpio_init_type gpio_init_struct;
57
58 /* gpioa configuration:tmr3 channel1, 2, 3 and 4 as alternate function push-pull */
59 gpio_default_para_init(&gpio_init_struct);
60 gpio_init_struct.gpio_pins = GPIO_PINS_6 | GPIO_PINS_7;
61 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
62 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
63 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
64 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
65
66 gpio_init(GPIOA, &gpio_init_struct);
67
68 gpio_init_struct.gpio_pins = GPIO_PINS_0 | GPIO_PINS_1;
69 gpio_init(GPIOB, &gpio_init_struct);
70
71}
72
78void crm_configuration(void)
79{
80 /* tmr3 clock enable */
81 crm_periph_clock_enable(CRM_TMR3_PERIPH_CLOCK, TRUE);
82
83 /* gpioa clock enable */
84 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
85 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
86}
87
93int main(void)
94{
95 system_clock_config();
96
97 /* peripheral clocks configuration */
98 crm_configuration();
99
100 /* nvic configuration */
101 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
102 nvic_irq_enable(TMR3_GLOBAL_IRQn, 0, 0);
103
104 /* gpio configuration */
105 gpio_configuration();
106
107 /* tmr3 configuration: output compare toggle mode:
108 tmr3clk = system_core_clock,
109 the objective is to get tmr3 counter clock at 24 mhz:
110 - div = (tmr3clk / tmr3 counter clock) - 1
111 cc1 update rate = tmr3 counter clock / ch1_val / 2 = 366.2 hz
112 cc2 update rate = tmr3 counter clock / ch2_val / 2 = 732.4 hz
113 cc3 update rate = tmr3 counter clock / ch3_val / 2 = 1464.8 hz
114 cc4 update rate = tmr3 counter clock / ch4_val / 2 = 2929.6 hz */
115
116 /* compute the div value */
117 div_value = (uint16_t)(system_core_clock / 24000000) - 1;
118
119 /* tmre base configuration */
120 tmr_base_init(TMR3, 65535, div_value);
121 tmr_cnt_dir_set(TMR3, TMR_COUNT_UP);
122 tmr_clock_source_div_set(TMR3, TMR_CLOCK_DIV1);
123
124 /* output compare toggle mode configuration: channel1 */
125 tmr_output_default_para_init(&tmr_oc_init_structure);
126 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_SWITCH;
127 tmr_oc_init_structure.oc_idle_state = FALSE;
128 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_LOW;
129 tmr_oc_init_structure.oc_output_state = TRUE;
130 tmr_output_channel_config(TMR3, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
131 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_1, ch1_val);
132
133 /* output compare toggle mode configuration: channel2 */
134 tmr_output_channel_config(TMR3, TMR_SELECT_CHANNEL_2, &tmr_oc_init_structure);
135 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_2, ch2_val);
136
137 /* output compare toggle mode configuration: channel3 */
138 tmr_output_channel_config(TMR3, TMR_SELECT_CHANNEL_3, &tmr_oc_init_structure);
139 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_3, ch3_val);
140
141 /* output compare toggle mode configuration: channel4 */
142 tmr_output_channel_config(TMR3, TMR_SELECT_CHANNEL_4, &tmr_oc_init_structure);
143 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_4, ch4_val);
144
145 /* tmr enable counter */
146 tmr_counter_enable(TMR3, TRUE);
147
148 /* tmr it enable */
149 tmr_interrupt_enable(TMR3, TMR_C1_INT | TMR_C2_INT | TMR_C3_INT | TMR_C4_INT, TRUE);
150
151 while(1)
152 {
153 }
154}
155
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
ch1_val
__IO uint16_t ch1_val
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c:39
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c:93
gpio_configuration
void gpio_configuration(void)
configure the tmr3 pins.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c:54
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c:38
ch3_val
__IO uint16_t ch3_val
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c:41
crm_configuration
void crm_configuration(void)
configures the different peripheral clocks.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c:78
ch4_val
__IO uint16_t ch4_val
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c:42
div_value
uint16_t div_value
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c:43
ch2_val
__IO uint16_t ch2_val
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr3/src/main.c:40
nvic_configuration
void nvic_configuration(void)
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR3_PERIPH_CLOCK
@ CRM_TMR3_PERIPH_CLOCK
Definition: at32f415_crm.h:124
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
TMR3_GLOBAL_IRQn
@ TMR3_GLOBAL_IRQn
Definition: at32f415.h:165
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_1
#define GPIO_PINS_1
Definition: at32f415_gpio.h:52
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_4
@ TMR_SELECT_CHANNEL_4
Definition: at32f415_tmr.h:222
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_SWITCH
@ TMR_OUTPUT_CONTROL_SWITCH
Definition: at32f415_tmr.h:176
TMR_OUTPUT_ACTIVE_LOW
@ TMR_OUTPUT_ACTIVE_LOW
Definition: at32f415_tmr.h:198
TMR_C3_INT
#define TMR_C3_INT
Definition: at32f415_tmr.h:77
TMR_C4_INT
#define TMR_C4_INT
Definition: at32f415_tmr.h:78
TMR_C1_INT
#define TMR_C1_INT
Definition: at32f415_tmr.h:75
TMR_C2_INT
#define TMR_C2_INT
Definition: at32f415_tmr.h:76
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • oc_toggle_tmr9
  • inc
project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • oc_toggle_tmr9
  • inc
project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • oc_toggle_tmr9
  • inc
project/at_start_f415/examples/tmr/oc_toggle_tmr9/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • oc_toggle_tmr9
  • src
project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • oc_toggle_tmr9
  • src
project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
30extern __IO uint16_t ch1_val;
31extern __IO uint16_t ch2_val;
32
41uint16_t capture = 0;
42
48void NMI_Handler(void)
49{
50}
51
57void HardFault_Handler(void)
58{
59 /* go to infinite loop when hard fault exception occurs */
60 while(1)
61 {
62 }
63}
64
70void MemManage_Handler(void)
71{
72 /* go to infinite loop when memory manage exception occurs */
73 while(1)
74 {
75 }
76}
77
83void BusFault_Handler(void)
84{
85 /* go to infinite loop when bus fault exception occurs */
86 while(1)
87 {
88 }
89}
90
96void UsageFault_Handler(void)
97{
98 /* go to infinite loop when usage fault exception occurs */
99 while(1)
100 {
101 }
102}
103
109void SVC_Handler(void)
110{
111}
112
118void DebugMon_Handler(void)
119{
120}
121
127void PendSV_Handler(void)
128{
129}
130
136void SysTick_Handler(void)
137{
138}
139
145void TMR1_BRK_TMR9_IRQHandler(void)
146{
147 /* TMR9_CH1 toggling with frequency = 366.2 Hz */
148 if(tmr_flag_get(TMR9, TMR_C1_FLAG) != RESET)
149 {
150 tmr_flag_clear(TMR9, TMR_C1_FLAG );
151 capture = tmr_channel_value_get(TMR9, TMR_SELECT_CHANNEL_1);
152 tmr_channel_value_set(TMR9, TMR_SELECT_CHANNEL_1, capture + ch1_val);
153 }
154
155 /* TMR9_CH2 toggling with frequency = 732.4 Hz */
156 if(tmr_flag_get(TMR9, TMR_C2_FLAG) != RESET)
157 {
158 tmr_flag_clear(TMR9, TMR_C2_FLAG);
159 capture = tmr_channel_value_get(TMR9, TMR_SELECT_CHANNEL_2);
160 tmr_channel_value_set(TMR9, TMR_SELECT_CHANNEL_2, capture + ch2_val);
161 }
162}
163
ch1_val
__IO uint16_t ch1_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:40
ch2_val
__IO uint16_t ch2_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:41
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c:96
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c:57
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c:70
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c:109
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c:127
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c:48
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c:83
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c:136
TMR1_BRK_TMR9_IRQHandler
void TMR1_BRK_TMR9_IRQHandler(void)
this function handles TMR9 global interrupt request.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c:145
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c:118
capture
uint16_t capture
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/at32f415_int.c:41
RESET
@ RESET
Definition: at32f415.h:248
tmr_channel_value_get
uint32_t tmr_channel_value_get(tmr_type *tmr_x, tmr_channel_select_type tmr_channel)
get tmr channel value
Definition: at32f415_tmr.c:527
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_C1_FLAG
#define TMR_C1_FLAG
Definition: at32f415_tmr.h:53
TMR_C2_FLAG
#define TMR_C2_FLAG
Definition: at32f415_tmr.h:54
TMR9
#define TMR9
Definition: at32f415_tmr.h:840
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • oc_toggle_tmr9
  • src
project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 tmr_output_config_type tmr_oc_init_structure;
39__IO uint16_t ch1_val = 32768;
40__IO uint16_t ch2_val = 16384;
41uint16_t div_value = 0;
42
43void crm_configuration(void);
44void gpio_configuration(void);
45void nvic_configuration(void);
46
52void gpio_configuration(void)
53{
54 gpio_init_type gpio_init_struct;
55
56 /* gpioa configuration:tmr9 channel1 and 2 as alternate function push-pull */
57 gpio_default_para_init(&gpio_init_struct);
58 gpio_init_struct.gpio_pins = GPIO_PINS_2 | GPIO_PINS_3;
59 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
60 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
61 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
62 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
63
64 gpio_init(GPIOA, &gpio_init_struct);
65}
66
72void crm_configuration(void)
73{
74 /* tmr9 clock enable */
75 crm_periph_clock_enable(CRM_TMR9_PERIPH_CLOCK, TRUE);
76
77 /* gpioa clock enable */
78 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
79}
80
86int main(void)
87{
88 system_clock_config();
89
90 /* peripheral clocks configuration */
91 crm_configuration();
92
93 /* nvic configuration */
94 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
95 nvic_irq_enable(TMR1_BRK_TMR9_IRQn, 0, 0);
96
97 /* gpio configuration */
98 gpio_configuration();
99
100 /* tmr9 configuration: output compare toggle mode:
101 tmr9clk = system_core_clock,
102 the objective is to get tmr9 counter clock at 24 mhz:
103 - div_value = (tmr9clk / tmr9 counter clock) - 1
104 cc1 update rate = tmr9 counter clock / ch1val / 2 = 366.2 hz
105 cc2 update rate = tmr9 counter clock / ch2val / 2 = 732.4 hz */
106
107 /* compute the div value */
108 div_value = (uint16_t) (system_core_clock / 24000000) - 1;
109
110 /* tmr base configuration */
111 tmr_base_init(TMR9, 65535, div_value);
112 tmr_cnt_dir_set(TMR9, TMR_COUNT_UP);
113 tmr_clock_source_div_set(TMR9, TMR_CLOCK_DIV1);
114
115 /* output compare toggle mode configuration: channel1 */
116 tmr_output_default_para_init(&tmr_oc_init_structure);
117 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_SWITCH;
118 tmr_oc_init_structure.oc_idle_state = FALSE;
119 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_LOW;
120 tmr_oc_init_structure.oc_output_state = TRUE;
121 tmr_output_channel_config(TMR9, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
122 tmr_channel_value_set(TMR9, TMR_SELECT_CHANNEL_1, ch1_val);
123
124 /* output toggle mode configuration: channel2 */
125 tmr_output_channel_config(TMR9, TMR_SELECT_CHANNEL_2, &tmr_oc_init_structure);
126 tmr_channel_value_set(TMR9, TMR_SELECT_CHANNEL_2, ch2_val);
127
128 /* tmr enable counter */
129 tmr_counter_enable(TMR9, TRUE);
130
131 /* tmr interrupt enable */
132 tmr_interrupt_enable(TMR9, TMR_C1_INT | TMR_C2_INT, TRUE);
133
134 while(1)
135 {
136 }
137}
138
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
ch1_val
__IO uint16_t ch1_val
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c:39
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c:86
gpio_configuration
void gpio_configuration(void)
configure the tmr9 pins.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c:52
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c:38
crm_configuration
void crm_configuration(void)
configures the different peripheral clocks.
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c:72
div_value
uint16_t div_value
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c:41
ch2_val
__IO uint16_t ch2_val
Definition: project/at_start_f415/examples/tmr/oc_toggle_tmr9/src/main.c:40
nvic_configuration
void nvic_configuration(void)
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR9_PERIPH_CLOCK
@ CRM_TMR9_PERIPH_CLOCK
Definition: at32f415_crm.h:119
TMR1_BRK_TMR9_IRQn
@ TMR1_BRK_TMR9_IRQn
Definition: at32f415.h:160
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_SWITCH
@ TMR_OUTPUT_CONTROL_SWITCH
Definition: at32f415_tmr.h:176
TMR_OUTPUT_ACTIVE_LOW
@ TMR_OUTPUT_ACTIVE_LOW
Definition: at32f415_tmr.h:198
TMR_C1_INT
#define TMR_C1_INT
Definition: at32f415_tmr.h:75
TMR_C2_INT
#define TMR_C2_INT
Definition: at32f415_tmr.h:76
TMR9
#define TMR9
Definition: at32f415_tmr.h:840
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • one_cycle
  • inc
project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • one_cycle
  • inc
project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • one_cycle
  • inc
project/at_start_f415/examples/tmr/one_cycle/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • one_cycle
  • src
project/at_start_f415/examples/tmr/one_cycle/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/one_cycle/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • one_cycle
  • src
project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/one_cycle/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • one_cycle
  • src
project/at_start_f415/examples/tmr/one_cycle/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 tmr_output_config_type tmr_oc_init_structure;
39 tmr_input_config_type tmr_ic_init_structure;
40uint16_t div_value = 0;
41
42void crm_configuration(void);
43void gpio_configuration(void);
44
50void gpio_configuration(void)
51{
52 gpio_init_type gpio_init_struct;
53
54 gpio_default_para_init(&gpio_init_struct);
55
56 /* tmr4_ch2 pin (pb.07) configuration */
57 gpio_init_struct.gpio_pins = GPIO_PINS_7;
58 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
59 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
60 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
61 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
62 gpio_init(GPIOB, &gpio_init_struct);
63
64 /* tmr4_ch1 pin (pb.06) configuration */
65 gpio_init_struct.gpio_pins = GPIO_PINS_6;
66 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
67 gpio_init(GPIOB, &gpio_init_struct);
68}
69
75void crm_configuration(void)
76{
77 /* tmr3 clock enable */
78 crm_periph_clock_enable(CRM_TMR4_PERIPH_CLOCK, TRUE);
79
80 /* gpioa clock enable */
81 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
82}
83
89int main(void)
90{
91 system_clock_config();
92
93 /* peripheral clocks configuration */
94 crm_configuration();
95
96 /* gpio configuration */
97 gpio_configuration();
98
99 /* compute the div value */
100 div_value = (uint16_t)(system_core_clock / 24000000) - 1;
101
102 /* tmr base configuration */
103 tmr_base_init(TMR4, 65535, div_value);
104 tmr_cnt_dir_set(TMR4, TMR_COUNT_UP);
105 tmr_clock_source_div_set(TMR4, TMR_CLOCK_DIV1);
106
107 /* output compare toggle mode configuration: channel1 */
108 tmr_output_default_para_init(&tmr_oc_init_structure);
109 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_B;
110 tmr_oc_init_structure.oc_idle_state = FALSE;
111 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
112 tmr_oc_init_structure.oc_output_state = TRUE;
113 tmr_output_channel_config(TMR4, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
114 tmr_channel_value_set(TMR4, TMR_SELECT_CHANNEL_1, 16383);
115
116 tmr_input_default_para_init(&tmr_ic_init_structure);
117 tmr_ic_init_structure.input_filter_value = 0;
118 tmr_ic_init_structure.input_channel_select = TMR_SELECT_CHANNEL_2;
119 tmr_ic_init_structure.input_mapped_select = TMR_CC_CHANNEL_MAPPED_DIRECT;
120 tmr_ic_init_structure.input_polarity_select = TMR_INPUT_RISING_EDGE;
121 tmr_input_channel_init(TMR4, &tmr_ic_init_structure, TMR_CHANNEL_INPUT_DIV_1);
122
123 /* one cycle mode selection */
124 tmr_one_cycle_mode_enable(TMR4, TRUE);
125
126 /* input trigger selection */
127 tmr_trigger_input_select(TMR4, TMR_SUB_INPUT_SEL_C2DF2);
128
129 /* slave mode selection: trigger mode */
130 tmr_sub_mode_select(TMR4, TMR_SUB_TRIGGER_MODE);
131
132 while(1)
133 {
134 }
135}
136
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/one_cycle/src/main.c:89
gpio_configuration
void gpio_configuration(void)
configure the tmr3 pins.
Definition: project/at_start_f415/examples/tmr/one_cycle/src/main.c:50
tmr_ic_init_structure
tmr_input_config_type tmr_ic_init_structure
Definition: project/at_start_f415/examples/tmr/one_cycle/src/main.c:39
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/one_cycle/src/main.c:38
crm_configuration
void crm_configuration(void)
configures the different peripheral clocks.
Definition: project/at_start_f415/examples/tmr/one_cycle/src/main.c:75
div_value
uint16_t div_value
Definition: project/at_start_f415/examples/tmr/one_cycle/src/main.c:40
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_TMR4_PERIPH_CLOCK
@ CRM_TMR4_PERIPH_CLOCK
Definition: at32f415_crm.h:125
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_input_channel_init
void tmr_input_channel_init(tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
init tmr input channel
Definition: at32f415_tmr.c:780
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_sub_mode_select
void tmr_sub_mode_select(tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode
Definition: at32f415_tmr.c:1148
tmr_input_default_para_init
void tmr_input_default_para_init(tmr_input_config_type *tmr_input_struct)
init tmr input default para
Definition: at32f415_tmr.c:132
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_trigger_input_select
void tmr_trigger_input_select(tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger
Definition: at32f415_tmr.c:1212
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_one_cycle_mode_enable
void tmr_one_cycle_mode_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr one cycle mode
Definition: at32f415_tmr.c:716
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_INPUT_RISING_EDGE
@ TMR_INPUT_RISING_EDGE
Definition: at32f415_tmr.h:206
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_CC_CHANNEL_MAPPED_DIRECT
@ TMR_CC_CHANNEL_MAPPED_DIRECT
Definition: at32f415_tmr.h:239
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_PWM_MODE_B
@ TMR_OUTPUT_CONTROL_PWM_MODE_B
Definition: at32f415_tmr.h:180
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR_SUB_INPUT_SEL_C2DF2
@ TMR_SUB_INPUT_SEL_C2DF2
Definition: at32f415_tmr.h:139
TMR_SUB_TRIGGER_MODE
@ TMR_SUB_TRIGGER_MODE
Definition: at32f415_tmr.h:154
TMR_CHANNEL_INPUT_DIV_1
@ TMR_CHANNEL_INPUT_DIV_1
Definition: at32f415_tmr.h:249
TMR4
#define TMR4
Definition: at32f415_tmr.h:835
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_input_config_type
tmr input capture config type
Definition: at32f415_tmr.h:412
tmr_input_config_type::input_mapped_select
tmr_input_direction_mapped_type input_mapped_select
Definition: at32f415_tmr.h:415
tmr_input_config_type::input_filter_value
uint8_t input_filter_value
Definition: at32f415_tmr.h:416
tmr_input_config_type::input_polarity_select
tmr_input_polarity_type input_polarity_select
Definition: at32f415_tmr.h:414
tmr_input_config_type::input_channel_select
tmr_channel_select_type input_channel_select
Definition: at32f415_tmr.h:413
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • parallel_synchro
  • inc
project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • parallel_synchro
  • inc
project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • parallel_synchro
  • inc
project/at_start_f415/examples/tmr/parallel_synchro/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • parallel_synchro
  • src
project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • parallel_synchro
  • src
project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • parallel_synchro
  • src
project/at_start_f415/examples/tmr/parallel_synchro/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 tmr_output_config_type tmr_oc_init_structure;
39
40void crm_configuration(void);
41void gpio_configuration(void);
42
48void gpio_configuration(void)
49{
50 gpio_init_type gpio_init_struct;
51
52 gpio_default_para_init(&gpio_init_struct);
53
54 gpio_init_struct.gpio_pins = GPIO_PINS_6 | GPIO_PINS_0;
55 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
56 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
57 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
58 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
59 gpio_init(GPIOA, &gpio_init_struct);
60
61 gpio_init_struct.gpio_pins = GPIO_PINS_6;
62 gpio_init(GPIOB, &gpio_init_struct);
63
64}
65
71void crm_configuration(void)
72{
73 /* tmr3 clock enable */
74 crm_periph_clock_enable(CRM_TMR2_PERIPH_CLOCK, TRUE);
75 crm_periph_clock_enable(CRM_TMR3_PERIPH_CLOCK, TRUE);
76 crm_periph_clock_enable(CRM_TMR4_PERIPH_CLOCK, TRUE);
77
78 /* gpios clock enable */
79 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
80 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
81 crm_periph_clock_enable(CRM_GPIOC_PERIPH_CLOCK, TRUE);
82 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
83}
84
90int main(void)
91{
92 system_clock_config();
93
94 /* peripheral clocks configuration */
95 crm_configuration();
96
97 /* gpio configuration */
98 gpio_configuration();
99
100 /* tmr base configuration */
101 tmr_base_init(TMR2, 143, 0);
102 tmr_cnt_dir_set(TMR2, TMR_COUNT_UP);
103 tmr_clock_source_div_set(TMR2, TMR_CLOCK_DIV1);
104 tmr_base_init(TMR3, 9, 0);
105 tmr_cnt_dir_set(TMR3, TMR_COUNT_UP);
106 tmr_clock_source_div_set(TMR3, TMR_CLOCK_DIV1);
107 tmr_base_init(TMR4, 4, 0);
108 tmr_cnt_dir_set(TMR4, TMR_COUNT_UP);
109 tmr_clock_source_div_set(TMR4, TMR_CLOCK_DIV1);
110
111 /* output compare toggle mode configuration: channel1 */
112 tmr_output_default_para_init(&tmr_oc_init_structure);
113 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_A;
114 tmr_oc_init_structure.oc_idle_state = FALSE;
115 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
116 tmr_oc_init_structure.oc_output_state = TRUE;
117 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
118 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_1, 72);
119
120 tmr_output_channel_config(TMR3, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
121 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_1, 3);
122
123 tmr_output_channel_config(TMR4, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
124 tmr_channel_value_set(TMR4, TMR_SELECT_CHANNEL_1, 3);
125
126 /* primary mode selection: TMR2 */
127 tmr_sub_sync_mode_set(TMR2, TRUE);
128 tmr_primary_mode_select(TMR2, TMR_PRIMARY_SEL_OVERFLOW);
129
130 /* subordinate mode selection: TMR3 */
131 tmr_sub_mode_select(TMR3, TMR_SUB_HANG_MODE);
132 tmr_trigger_input_select(TMR3, TMR_SUB_INPUT_SEL_IS1);
133
134 /* subordinate mode selection: TMR4 */
135 tmr_sub_mode_select(TMR4, TMR_SUB_HANG_MODE);
136 tmr_trigger_input_select(TMR4, TMR_SUB_INPUT_SEL_IS1);
137
138 /* tmr enable counter */
139 tmr_counter_enable(TMR2, TRUE);
140 tmr_counter_enable(TMR3, TRUE);
141 tmr_counter_enable(TMR4, TRUE);
142
143 while(1)
144 {
145 }
146}
147
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/main.c:90
gpio_configuration
void gpio_configuration(void)
configure the tmr3 pins.
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/main.c:48
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/main.c:38
crm_configuration
void crm_configuration(void)
configures the different peripheral clocks.
Definition: project/at_start_f415/examples/tmr/parallel_synchro/src/main.c:71
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOC_PERIPH_CLOCK
@ CRM_GPIOC_PERIPH_CLOCK
Definition: at32f415_crm.h:112
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR2_PERIPH_CLOCK
@ CRM_TMR2_PERIPH_CLOCK
Definition: at32f415_crm.h:123
CRM_TMR4_PERIPH_CLOCK
@ CRM_TMR4_PERIPH_CLOCK
Definition: at32f415_crm.h:125
CRM_TMR3_PERIPH_CLOCK
@ CRM_TMR3_PERIPH_CLOCK
Definition: at32f415_crm.h:124
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_sub_mode_select
void tmr_sub_mode_select(tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode
Definition: at32f415_tmr.c:1148
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_sub_sync_mode_set
void tmr_sub_sync_mode_set(tmr_type *tmr_x, confirm_state new_state)
set tmr subordinate synchronization mode
Definition: at32f415_tmr.c:1225
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_trigger_input_select
void tmr_trigger_input_select(tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger
Definition: at32f415_tmr.c:1212
tmr_primary_mode_select
void tmr_primary_mode_select(tmr_type *tmr_x, tmr_primary_select_type primary_mode)
select tmr primary mode
Definition: at32f415_tmr.c:1126
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_PWM_MODE_A
@ TMR_OUTPUT_CONTROL_PWM_MODE_A
Definition: at32f415_tmr.h:179
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR_SUB_INPUT_SEL_IS1
@ TMR_SUB_INPUT_SEL_IS1
Definition: at32f415_tmr.h:134
TMR_SUB_HANG_MODE
@ TMR_SUB_HANG_MODE
Definition: at32f415_tmr.h:153
TMR_PRIMARY_SEL_OVERFLOW
@ TMR_PRIMARY_SEL_OVERFLOW
Definition: at32f415_tmr.h:120
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
TMR4
#define TMR4
Definition: at32f415_tmr.h:835
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • pwm_input
  • inc
project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • pwm_input
  • inc
project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • pwm_input
  • inc
project/at_start_f415/examples/tmr/pwm_input/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • pwm_input
  • src
project/at_start_f415/examples/tmr/pwm_input/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/pwm_input/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • pwm_input
  • src
project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
30extern uint16_t duty_cycle;
31extern uint32_t frequency;
32
41__IO uint16_t ic2value = 0;
42
48void NMI_Handler(void)
49{
50}
51
57void HardFault_Handler(void)
58{
59 /* go to infinite loop when hard fault exception occurs */
60 while(1)
61 {
62 }
63}
64
70void MemManage_Handler(void)
71{
72 /* go to infinite loop when memory manage exception occurs */
73 while(1)
74 {
75 }
76}
77
83void BusFault_Handler(void)
84{
85 /* go to infinite loop when bus fault exception occurs */
86 while(1)
87 {
88 }
89}
90
96void UsageFault_Handler(void)
97{
98 /* go to infinite loop when usage fault exception occurs */
99 while(1)
100 {
101 }
102}
103
109void SVC_Handler(void)
110{
111}
112
118void DebugMon_Handler(void)
119{
120}
121
127void PendSV_Handler(void)
128{
129}
130
136void SysTick_Handler(void)
137{
138}
139
145void TMR3_GLOBAL_IRQHandler(void)
146{
147 /* clear tmr3 channel interrupt pending bit */
148 tmr_flag_clear(TMR3, TMR_C2_FLAG);
149
150 /* get the input channel data value */
151 ic2value = tmr_channel_value_get(TMR3, TMR_SELECT_CHANNEL_2);
152
153 if(ic2value != 0)
154 {
155 /* duty cycle computation */
156 duty_cycle = (tmr_channel_value_get(TMR3, TMR_SELECT_CHANNEL_1) * 100) / ic2value;
157
158 /* frequency computation */
159 frequency = system_core_clock / ic2value;
160 }
161 else
162 {
163 duty_cycle = 0;
164 frequency = 0;
165 }
166}
167
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c:96
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c:57
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c:70
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c:109
ic2value
__IO uint16_t ic2value
Definition: project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c:41
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c:127
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c:48
TMR3_GLOBAL_IRQHandler
void TMR3_GLOBAL_IRQHandler(void)
this function handles tmr3 global interrupt request.
Definition: project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c:145
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c:83
frequency
uint32_t frequency
Definition: project/at_start_f415/examples/tmr/pwm_input/src/main.c:41
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c:136
duty_cycle
uint16_t duty_cycle
Definition: project/at_start_f415/examples/tmr/pwm_input/src/main.c:40
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/pwm_input/src/at32f415_int.c:118
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
tmr_channel_value_get
uint32_t tmr_channel_value_get(tmr_type *tmr_x, tmr_channel_select_type tmr_channel)
get tmr channel value
Definition: at32f415_tmr.c:527
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_C2_FLAG
#define TMR_C2_FLAG
Definition: at32f415_tmr.h:54
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • pwm_input
  • src
project/at_start_f415/examples/tmr/pwm_input/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 tmr_input_config_type tmr_ic_init_structure;
39
40__IO uint16_t duty_cycle = 0;
41__IO uint32_t frequency = 0;
42
43void crm_configuration(void);
44void gpio_configuration(void);
45
51void gpio_configuration(void)
52{
53 gpio_init_type gpio_init_struct;
54
55 gpio_default_para_init(&gpio_init_struct);
56
57 gpio_init_struct.gpio_pins = GPIO_PINS_7;
58 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
59 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
60 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
61 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
62 gpio_init(GPIOA, &gpio_init_struct);
63}
64
70void crm_configuration(void)
71{
72 /* tmr3 clock enable */
73 crm_periph_clock_enable(CRM_TMR3_PERIPH_CLOCK, TRUE);
74
75 /* gpioa clock enable */
76 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
77}
78
84int main(void)
85{
86 system_clock_config();
87
88 /* peripheral clocks configuration */
89 crm_configuration();
90
91 /* nvic configuration */
92 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
93 nvic_irq_enable(TMR3_GLOBAL_IRQn, 0, 0);
94
95 /* gpio configuration */
96 gpio_configuration();
97
98 uart_print_init(115200);
99
100 tmr_input_default_para_init(&tmr_ic_init_structure);
101 tmr_ic_init_structure.input_filter_value = 0;
102 tmr_ic_init_structure.input_channel_select = TMR_SELECT_CHANNEL_2;
103 tmr_ic_init_structure.input_mapped_select = TMR_CC_CHANNEL_MAPPED_DIRECT;
104 tmr_ic_init_structure.input_polarity_select = TMR_INPUT_RISING_EDGE;
105
106 tmr_pwm_input_config(TMR3, &tmr_ic_init_structure, TMR_CHANNEL_INPUT_DIV_1);
107
108 /* select the tmr3 input trigger: c2df2 */
109 tmr_trigger_input_select(TMR3, TMR_SUB_INPUT_SEL_C2DF2);
110
111 /* select the sub mode: reset mode */
112 tmr_sub_mode_select(TMR3, TMR_SUB_RESET_MODE);
113
114 /* enable the sub sync mode */
115 tmr_sub_sync_mode_set(TMR3, TRUE);
116
117 /* tmr enable counter */
118 tmr_counter_enable(TMR3, TRUE);
119
120 /* enable the c2 interrupt request */
121 tmr_interrupt_enable(TMR3, TMR_C2_INT, TRUE);
122
123 while(1)
124 {
125 printf("Frequency = %dHZ,Dutycycle = %d%%\r\n", frequency, duty_cycle);
126 }
127}
128
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/pwm_input/src/main.c:84
gpio_configuration
void gpio_configuration(void)
configure the tmr3 pins.
Definition: project/at_start_f415/examples/tmr/pwm_input/src/main.c:51
tmr_ic_init_structure
tmr_input_config_type tmr_ic_init_structure
Definition: project/at_start_f415/examples/tmr/pwm_input/src/main.c:38
crm_configuration
void crm_configuration(void)
configures the different peripheral clocks.
Definition: project/at_start_f415/examples/tmr/pwm_input/src/main.c:70
frequency
__IO uint32_t frequency
Definition: project/at_start_f415/examples/tmr/pwm_input/src/main.c:41
duty_cycle
__IO uint16_t duty_cycle
Definition: project/at_start_f415/examples/tmr/pwm_input/src/main.c:40
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR3_PERIPH_CLOCK
@ CRM_TMR3_PERIPH_CLOCK
Definition: at32f415_crm.h:124
TMR3_GLOBAL_IRQn
@ TMR3_GLOBAL_IRQn
Definition: at32f415.h:165
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_sub_mode_select
void tmr_sub_mode_select(tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode
Definition: at32f415_tmr.c:1148
tmr_input_default_para_init
void tmr_input_default_para_init(tmr_input_config_type *tmr_input_struct)
init tmr input default para
Definition: at32f415_tmr.c:132
tmr_sub_sync_mode_set
void tmr_sub_sync_mode_set(tmr_type *tmr_x, confirm_state new_state)
set tmr subordinate synchronization mode
Definition: at32f415_tmr.c:1225
tmr_pwm_input_config
void tmr_pwm_input_config(tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
config tmr pwm input
Definition: at32f415_tmr.c:947
tmr_trigger_input_select
void tmr_trigger_input_select(tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger
Definition: at32f415_tmr.c:1212
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
TMR_INPUT_RISING_EDGE
@ TMR_INPUT_RISING_EDGE
Definition: at32f415_tmr.h:206
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_CC_CHANNEL_MAPPED_DIRECT
@ TMR_CC_CHANNEL_MAPPED_DIRECT
Definition: at32f415_tmr.h:239
TMR_SUB_INPUT_SEL_C2DF2
@ TMR_SUB_INPUT_SEL_C2DF2
Definition: at32f415_tmr.h:139
TMR_SUB_RESET_MODE
@ TMR_SUB_RESET_MODE
Definition: at32f415_tmr.h:152
TMR_CHANNEL_INPUT_DIV_1
@ TMR_CHANNEL_INPUT_DIV_1
Definition: at32f415_tmr.h:249
TMR_C2_INT
#define TMR_C2_INT
Definition: at32f415_tmr.h:76
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_input_config_type
tmr input capture config type
Definition: at32f415_tmr.h:412
tmr_input_config_type::input_mapped_select
tmr_input_direction_mapped_type input_mapped_select
Definition: at32f415_tmr.h:415
tmr_input_config_type::input_filter_value
uint8_t input_filter_value
Definition: at32f415_tmr.h:416
tmr_input_config_type::input_polarity_select
tmr_input_polarity_type input_polarity_select
Definition: at32f415_tmr.h:414
tmr_input_config_type::input_channel_select
tmr_channel_select_type input_channel_select
Definition: at32f415_tmr.h:413
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • pwm_input_dma
  • inc
project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • pwm_input_dma
  • inc
project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • pwm_input_dma
  • inc
project/at_start_f415/examples/tmr/pwm_input_dma/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • pwm_input_dma
  • src
project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • pwm_input_dma
  • src
project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • pwm_input_dma
  • src
project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define TMR1_C1DT_ADDRESS 0x40012C34
39#define TMR1_C2DT_ADDRESS 0x40012C38
40
41#define SAMPLING_NUM 1000
42
43 tmr_input_config_type tmr_ic_init_structure;
44 dma_init_type dma_init_structure;
45
46__IO uint16_t buffer_ch1[1000];
47__IO uint16_t buffer_ch2[1000];
48
49__IO uint32_t frequency = 0;
50__IO float duty_cycle = 0;
51
52uint32_t freq_result;
53float duty_result;
54
55void crm_configuration(void);
56void gpio_configuration(void);
57
58void DMA1_Channel2_IRQHandler(void)
59{
60 uint16_t i;
61
62 dma_flag_clear(DMA1_FDT2_FLAG);
63
64 duty_result = 0;
65 freq_result = 0.0;
66
67 for(i = 0; i < SAMPLING_NUM; i++)
68 {
69 duty_result += ((buffer_ch2[i] * 100.0) / buffer_ch1[i]);
70 freq_result += (system_core_clock / buffer_ch1[i]);
71 }
72
73 duty_cycle = duty_result / SAMPLING_NUM;
74 frequency = freq_result / SAMPLING_NUM;
75 printf("\r\nFreq=%dHZ, Duty=%.2f%%\r\n", frequency, duty_cycle);
76}
77
83void gpio_configuration(void)
84{
85 gpio_init_type gpio_init_struct;
86
87 gpio_default_para_init(&gpio_init_struct);
88
89 gpio_init_struct.gpio_pins = GPIO_PINS_8;
90 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
91 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
92 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
93 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
94 gpio_init(GPIOA, &gpio_init_struct);
95}
96
102void crm_configuration(void)
103{
104 /* tmr1 clock enable */
105 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
106
107 /* gpioa clock enable */
108 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
109
110 /* dma clock enable */
111 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
112}
113
119int main(void)
120{
121 system_clock_config();
122
123 /* peripheral clocks configuration */
124 crm_configuration();
125
126 /* nvic configuration */
127 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
128 nvic_irq_enable(DMA1_Channel2_IRQn, 0, 0);
129
130 /* gpio configuration */
131 gpio_configuration();
132
133 uart_print_init(115200);
134
135 dma_reset(DMA1_CHANNEL2);
136 dma_default_para_init(&dma_init_structure);
137 dma_init_structure.peripheral_base_addr = (uint32_t)TMR1_C1DT_ADDRESS;
138 dma_init_structure.memory_base_addr = (uint32_t)buffer_ch1;
139 dma_init_structure.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
140 dma_init_structure.buffer_size = SAMPLING_NUM;
141 dma_init_structure.peripheral_inc_enable = FALSE;
142 dma_init_structure.memory_inc_enable = TRUE;
143 dma_init_structure.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_HALFWORD;
144 dma_init_structure.memory_data_width = DMA_MEMORY_DATA_WIDTH_HALFWORD;
145 dma_init_structure.loop_mode_enable = TRUE;
146 dma_init_structure.priority = DMA_PRIORITY_HIGH;
147 dma_init(DMA1_CHANNEL2, &dma_init_structure);
148
149 dma_reset(DMA1_CHANNEL3);
150 dma_init_structure.peripheral_base_addr = (uint32_t)TMR1_C2DT_ADDRESS;
151 dma_init_structure.memory_base_addr = (uint32_t)buffer_ch2;
152 dma_init(DMA1_CHANNEL3, &dma_init_structure);
153
154 dma_interrupt_enable(DMA1_CHANNEL2, DMA_FDT_INT, TRUE);
155
156 dma_channel_enable(DMA1_CHANNEL2, TRUE);
157 dma_channel_enable(DMA1_CHANNEL3, TRUE);
158
159 tmr_input_default_para_init(&tmr_ic_init_structure);
160 tmr_ic_init_structure.input_filter_value = 0;
161 tmr_ic_init_structure.input_channel_select = TMR_SELECT_CHANNEL_1;
162 tmr_ic_init_structure.input_mapped_select = TMR_CC_CHANNEL_MAPPED_DIRECT;
163 tmr_ic_init_structure.input_polarity_select = TMR_INPUT_RISING_EDGE;
164
165 tmr_pwm_input_config(TMR1, &tmr_ic_init_structure, TMR_CHANNEL_INPUT_DIV_1);
166
167 /* select the TMR1 input trigger: C2IF2 */
168 tmr_trigger_input_select(TMR1, TMR_SUB_INPUT_SEL_C1DF1);
169
170 /* select the sub mode: reset mode */
171 tmr_sub_mode_select(TMR1, TMR_SUB_RESET_MODE);
172
173 /* enable the sub sync mode */
174 tmr_sub_sync_mode_set(TMR1, TRUE);
175
176 /* enable the c1/c2 dma */
177 tmr_dma_request_enable(TMR1, TMR_C1_DMA_REQUEST, TRUE);
178 tmr_dma_request_enable(TMR1, TMR_C2_DMA_REQUEST, TRUE);
179
180 /* tmr enable counter */
181 tmr_counter_enable(TMR1, TRUE);
182
183 while(1)
184 {
185 }
186}
187
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
duty_cycle
__IO float duty_cycle
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:50
DMA1_Channel2_IRQHandler
void DMA1_Channel2_IRQHandler(void)
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:58
dma_init_structure
dma_init_type dma_init_structure
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:44
freq_result
uint32_t freq_result
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:52
duty_result
float duty_result
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:53
TMR1_C1DT_ADDRESS
#define TMR1_C1DT_ADDRESS
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:38
buffer_ch2
__IO uint16_t buffer_ch2[1000]
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:47
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:119
gpio_configuration
void gpio_configuration(void)
configure the tmr1 pins.
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:83
SAMPLING_NUM
#define SAMPLING_NUM
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:41
tmr_ic_init_structure
tmr_input_config_type tmr_ic_init_structure
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:43
crm_configuration
void crm_configuration(void)
configures the different peripheral clocks.
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:102
frequency
__IO uint32_t frequency
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:49
buffer_ch1
__IO uint16_t buffer_ch1[1000]
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:46
TMR1_C2DT_ADDRESS
#define TMR1_C2DT_ADDRESS
Definition: project/at_start_f415/examples/tmr/pwm_input_dma/src/main.c:39
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
DMA1_Channel2_IRQn
@ DMA1_Channel2_IRQn
Definition: at32f415.h:147
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_interrupt_enable
void dma_interrupt_enable(dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt
Definition: at32f415_dma.c:165
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
@ DMA_PERIPHERAL_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:239
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_HALFWORD
@ DMA_MEMORY_DATA_WIDTH_HALFWORD
Definition: at32f415_dma.h:249
DMA_PRIORITY_HIGH
@ DMA_PRIORITY_HIGH
Definition: at32f415_dma.h:260
DMA1_FDT2_FLAG
#define DMA1_FDT2_FLAG
Definition: at32f415_dma.h:86
DMA_FDT_INT
#define DMA_FDT_INT
Definition: at32f415_dma.h:52
DMA1_CHANNEL3
#define DMA1_CHANNEL3
Definition: at32f415_dma.h:475
DMA1_CHANNEL2
#define DMA1_CHANNEL2
Definition: at32f415_dma.h:474
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_dma_request_enable
void tmr_dma_request_enable(tmr_type *tmr_x, tmr_dma_request_type dma_request, confirm_state new_state)
enable or disable tmr dma request
Definition: at32f415_tmr.c:1247
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_sub_mode_select
void tmr_sub_mode_select(tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode
Definition: at32f415_tmr.c:1148
tmr_input_default_para_init
void tmr_input_default_para_init(tmr_input_config_type *tmr_input_struct)
init tmr input default para
Definition: at32f415_tmr.c:132
tmr_sub_sync_mode_set
void tmr_sub_sync_mode_set(tmr_type *tmr_x, confirm_state new_state)
set tmr subordinate synchronization mode
Definition: at32f415_tmr.c:1225
tmr_pwm_input_config
void tmr_pwm_input_config(tmr_type *tmr_x, tmr_input_config_type *input_struct, tmr_channel_input_divider_type divider_factor)
config tmr pwm input
Definition: at32f415_tmr.c:947
tmr_trigger_input_select
void tmr_trigger_input_select(tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger
Definition: at32f415_tmr.c:1212
TMR_C1_DMA_REQUEST
@ TMR_C1_DMA_REQUEST
Definition: at32f415_tmr.h:270
TMR_C2_DMA_REQUEST
@ TMR_C2_DMA_REQUEST
Definition: at32f415_tmr.h:271
TMR_INPUT_RISING_EDGE
@ TMR_INPUT_RISING_EDGE
Definition: at32f415_tmr.h:206
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_CC_CHANNEL_MAPPED_DIRECT
@ TMR_CC_CHANNEL_MAPPED_DIRECT
Definition: at32f415_tmr.h:239
TMR_SUB_INPUT_SEL_C1DF1
@ TMR_SUB_INPUT_SEL_C1DF1
Definition: at32f415_tmr.h:138
TMR_SUB_RESET_MODE
@ TMR_SUB_RESET_MODE
Definition: at32f415_tmr.h:152
TMR_CHANNEL_INPUT_DIV_1
@ TMR_CHANNEL_INPUT_DIV_1
Definition: at32f415_tmr.h:249
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_input_config_type
tmr input capture config type
Definition: at32f415_tmr.h:412
tmr_input_config_type::input_mapped_select
tmr_input_direction_mapped_type input_mapped_select
Definition: at32f415_tmr.h:415
tmr_input_config_type::input_filter_value
uint8_t input_filter_value
Definition: at32f415_tmr.h:416
tmr_input_config_type::input_polarity_select
tmr_input_polarity_type input_polarity_select
Definition: at32f415_tmr.h:414
tmr_input_config_type::input_channel_select
tmr_channel_select_type input_channel_select
Definition: at32f415_tmr.h:413
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • pwm_output_simulate
  • inc
project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • pwm_output_simulate
  • inc
project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • pwm_output_simulate
  • inc
project/at_start_f415/examples/tmr/pwm_output_simulate/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • pwm_output_simulate
  • src
project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • pwm_output_simulate
  • src
project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
30extern __IO uint16_t ch1_val;
31extern __IO uint16_t ch2_val;
32extern __IO uint16_t ch3_val;
33extern __IO uint16_t ch4_val;
34
43uint16_t capture = 0;
44
50void NMI_Handler(void)
51{
52}
53
59void HardFault_Handler(void)
60{
61 /* go to infinite loop when hard fault exception occurs */
62 while(1)
63 {
64 }
65}
66
72void MemManage_Handler(void)
73{
74 /* go to infinite loop when memory manage exception occurs */
75 while(1)
76 {
77 }
78}
79
85void BusFault_Handler(void)
86{
87 /* go to infinite loop when bus fault exception occurs */
88 while(1)
89 {
90 }
91}
92
98void UsageFault_Handler(void)
99{
100 /* go to infinite loop when usage fault exception occurs */
101 while(1)
102 {
103 }
104}
105
111void SVC_Handler(void)
112{
113}
114
120void DebugMon_Handler(void)
121{
122}
123
129void PendSV_Handler(void)
130{
131}
132
138void SysTick_Handler(void)
139{
140}
141
142void TMR2_GLOBAL_IRQHandler(void)
143{
144 if(tmr_flag_get(TMR2, TMR_C1_FLAG) != RESET)
145 {
146 tmr_flag_clear(TMR2, TMR_C1_FLAG );
147
148 /* Pin PC.06 toggling with frequency = 73.24 Hz */
149 gpio_bits_write(GPIOC, GPIO_PINS_6, (confirm_state)(1 - gpio_output_data_bit_read(GPIOC, GPIO_PINS_6)));
150 capture = tmr_channel_value_get(TMR2, TMR_SELECT_CHANNEL_1);
151 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_1, capture + ch1_val);
152 }
153 else if(tmr_flag_get(TMR2, TMR_C2_FLAG) != RESET)
154 {
155 tmr_flag_clear(TMR2, TMR_C2_FLAG);
156
157 /* Pin PC.06 toggling with frequency = 73.24 Hz */
158 gpio_bits_write(GPIOC, GPIO_PINS_7, (confirm_state)(1 - gpio_output_data_bit_read(GPIOC, GPIO_PINS_7)));
159 capture = tmr_channel_value_get(TMR2, TMR_SELECT_CHANNEL_2);
160 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_2, capture + ch2_val);
161 }
162 else if(tmr_flag_get(TMR2, TMR_C3_FLAG) != RESET)
163 {
164 tmr_flag_clear(TMR2, TMR_C3_FLAG);
165
166 /* Pin PC.06 toggling with frequency = 73.24 Hz */
167 gpio_bits_write(GPIOC, GPIO_PINS_8, (confirm_state)(1 - gpio_output_data_bit_read(GPIOC, GPIO_PINS_8)));
168 capture = tmr_channel_value_get(TMR2, TMR_SELECT_CHANNEL_3);
169 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_3, capture + ch3_val);
170 }
171 else
172 {
173 tmr_flag_clear(TMR2, TMR_C4_FLAG);
174
175 /* Pin PC.06 toggling with frequency = 73.24 Hz */
176 gpio_bits_write(GPIOC, GPIO_PINS_9, (confirm_state)(1 - gpio_output_data_bit_read(GPIOC, GPIO_PINS_9)));
177 capture = tmr_channel_value_get(TMR2, TMR_SELECT_CHANNEL_4);
178 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_4, capture + ch4_val);
179 }
180}
181
ch4_val
__IO uint16_t ch4_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:43
ch3_val
__IO uint16_t ch3_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:42
ch1_val
__IO uint16_t ch1_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:40
ch2_val
__IO uint16_t ch2_val
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:41
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c:98
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c:59
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c:72
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c:111
TMR2_GLOBAL_IRQHandler
void TMR2_GLOBAL_IRQHandler(void)
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c:142
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c:129
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c:50
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c:85
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c:138
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c:120
capture
uint16_t capture
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/at32f415_int.c:43
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_output_data_bit_read
flag_status gpio_output_data_bit_read(gpio_type *gpio_x, uint16_t pins)
read the specified output port pin.
Definition: at32f415_gpio.c:256
gpio_bits_write
void gpio_bits_write(gpio_type *gpio_x, uint16_t pins, confirm_state bit_state)
set or clear the selected data port bit.
Definition: at32f415_gpio.c:373
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOC
#define GPIOC
Definition: at32f415_gpio.h:772
tmr_channel_value_get
uint32_t tmr_channel_value_get(tmr_type *tmr_x, tmr_channel_select_type tmr_channel)
get tmr channel value
Definition: at32f415_tmr.c:527
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_4
@ TMR_SELECT_CHANNEL_4
Definition: at32f415_tmr.h:222
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_C1_FLAG
#define TMR_C1_FLAG
Definition: at32f415_tmr.h:53
TMR_C2_FLAG
#define TMR_C2_FLAG
Definition: at32f415_tmr.h:54
TMR_C3_FLAG
#define TMR_C3_FLAG
Definition: at32f415_tmr.h:55
TMR_C4_FLAG
#define TMR_C4_FLAG
Definition: at32f415_tmr.h:56
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • pwm_output_simulate
  • src
project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 tmr_output_config_type tmr_oc_init_structure;
39
40uint16_t ch1_val = 40961;
41uint16_t ch2_val = 27309;
42uint16_t ch3_val = 13654;
43uint16_t ch4_val = 6826;
44uint16_t div_value = 0;
45
46void crm_configuration(void);
47void gpio_configuration(void);
48
54void gpio_configuration(void)
55{
56 gpio_init_type gpio_init_struct;
57
58 gpio_default_para_init(&gpio_init_struct);
59
60 gpio_init_struct.gpio_pins = GPIO_PINS_6 | GPIO_PINS_7 | GPIO_PINS_8 | GPIO_PINS_9;
61 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
62 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
63 gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
64 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
65 gpio_init(GPIOC, &gpio_init_struct);
66}
67
73void crm_configuration(void)
74{
75 /* tmr2 clock enable */
76 crm_periph_clock_enable(CRM_TMR2_PERIPH_CLOCK, TRUE);
77
78 /* gpioa gpiob clock enable */
79 crm_periph_clock_enable(CRM_GPIOC_PERIPH_CLOCK, TRUE);
80}
81
87int main(void)
88{
89 /* config nvic priority group */
90 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
91
92 system_clock_config();
93
94 /* peripheral clocks configuration */
95 crm_configuration();
96
97 /* nvic Configuration */
98 nvic_irq_enable(TMR2_GLOBAL_IRQn, 0, 0);
99
100 /* gpio configuration */
101 gpio_configuration();
102
103 /* compute the div value */
104 div_value = (uint16_t)(system_core_clock / 12000000) - 1;
105
106 /* tmr2 time base configuration */
107 tmr_base_init(TMR2, 65535, div_value);
108 tmr_cnt_dir_set(TMR2, TMR_COUNT_UP);
109 tmr_clock_source_div_set(TMR2, TMR_CLOCK_DIV1);
110
111 tmr_output_default_para_init(&tmr_oc_init_structure);
112 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_OFF;
113 tmr_oc_init_structure.oc_idle_state = FALSE;
114 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
115 tmr_oc_init_structure.oc_output_state = TRUE;
116 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
117 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_1, ch1_val);
118
119 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_2, &tmr_oc_init_structure);
120 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_2, ch2_val);
121
122 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_3, &tmr_oc_init_structure);
123 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_3, ch3_val);
124
125 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_4, &tmr_oc_init_structure);
126 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_4, ch4_val);
127
128 /* tmr2 int enable */
129 tmr_interrupt_enable(TMR2, TMR_C1_INT | TMR_C2_INT | TMR_C3_INT | TMR_C4_INT, TRUE);
130
131 /* tmr enable counter */
132 tmr_counter_enable(TMR2, TRUE);
133
134 while(1)
135 {
136 }
137}
138
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
ch4_val
uint16_t ch4_val
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c:43
ch3_val
uint16_t ch3_val
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c:42
ch1_val
uint16_t ch1_val
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c:40
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c:87
ch2_val
uint16_t ch2_val
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c:41
gpio_configuration
void gpio_configuration(void)
configure the tmr1 pins.
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c:54
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c:38
crm_configuration
void crm_configuration(void)
configures the different peripheral clocks.
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c:73
div_value
uint16_t div_value
Definition: project/at_start_f415/examples/tmr/pwm_output_simulate/src/main.c:44
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOC_PERIPH_CLOCK
@ CRM_GPIOC_PERIPH_CLOCK
Definition: at32f415_crm.h:112
CRM_TMR2_PERIPH_CLOCK
@ CRM_TMR2_PERIPH_CLOCK
Definition: at32f415_crm.h:123
TMR2_GLOBAL_IRQn
@ TMR2_GLOBAL_IRQn
Definition: at32f415.h:164
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_OUTPUT
@ GPIO_MODE_OUTPUT
Definition: at32f415_gpio.h:229
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOC
#define GPIOC
Definition: at32f415_gpio.h:772
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_4
@ TMR_SELECT_CHANNEL_4
Definition: at32f415_tmr.h:222
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_OFF
@ TMR_OUTPUT_CONTROL_OFF
Definition: at32f415_tmr.h:173
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR_C3_INT
#define TMR_C3_INT
Definition: at32f415_tmr.h:77
TMR_C4_INT
#define TMR_C4_INT
Definition: at32f415_tmr.h:78
TMR_C1_INT
#define TMR_C1_INT
Definition: at32f415_tmr.h:75
TMR_C2_INT
#define TMR_C2_INT
Definition: at32f415_tmr.h:76
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • pwm_output_tmr3
  • inc
project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • pwm_output_tmr3
  • inc
project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • pwm_output_tmr3
  • inc
project/at_start_f415/examples/tmr/pwm_output_tmr3/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • pwm_output_tmr3
  • src
project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • pwm_output_tmr3
  • src
project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • pwm_output_tmr3
  • src
project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 tmr_output_config_type tmr_oc_init_structure;
39
40uint16_t ch1_val = 333;
41uint16_t ch2_val = 249;
42uint16_t ch3_val = 166;
43uint16_t ch4_val = 83;
44uint16_t div_value = 0;
45
46void crm_configuration(void);
47void gpio_configuration(void);
48
54void gpio_configuration(void)
55{
56 gpio_init_type gpio_init_struct;
57
58 gpio_default_para_init(&gpio_init_struct);
59
60 gpio_init_struct.gpio_pins = GPIO_PINS_6 | GPIO_PINS_7;
61 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
62 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
63 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
64 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
65 gpio_init(GPIOA, &gpio_init_struct);
66
67 gpio_init_struct.gpio_pins = GPIO_PINS_0 | GPIO_PINS_1;
68 gpio_init(GPIOB, &gpio_init_struct);
69}
70
76void crm_configuration(void)
77{
78 /* tmr3 clock enable */
79 crm_periph_clock_enable(CRM_TMR3_PERIPH_CLOCK, TRUE);
80
81 /* gpioa gpiob clock enable */
82 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
83 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
84}
85
91int main(void)
92{
93 system_clock_config();
94
95 /* peripheral clocks configuration */
96 crm_configuration();
97
98 /* gpio configuration */
99 gpio_configuration();
100
101 /* compute the div value */
102 div_value = (uint16_t)(system_core_clock / 24000000) - 1;
103
104 /* tmr3 time base configuration */
105 tmr_base_init(TMR3, 665, div_value);
106 tmr_cnt_dir_set(TMR3, TMR_COUNT_UP);
107 tmr_clock_source_div_set(TMR3, TMR_CLOCK_DIV1);
108
109 tmr_output_default_para_init(&tmr_oc_init_structure);
110 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_A;
111 tmr_oc_init_structure.oc_idle_state = FALSE;
112 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
113 tmr_oc_init_structure.oc_output_state = TRUE;
114 tmr_output_channel_config(TMR3, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
115 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_1, ch1_val);
116 tmr_output_channel_buffer_enable(TMR3, TMR_SELECT_CHANNEL_1, TRUE);
117
118 tmr_output_channel_config(TMR3, TMR_SELECT_CHANNEL_2, &tmr_oc_init_structure);
119 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_2, ch2_val);
120 tmr_output_channel_buffer_enable(TMR3, TMR_SELECT_CHANNEL_2, TRUE);
121
122 tmr_output_channel_config(TMR3, TMR_SELECT_CHANNEL_3, &tmr_oc_init_structure);
123 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_3, ch3_val);
124 tmr_output_channel_buffer_enable(TMR3, TMR_SELECT_CHANNEL_3, TRUE);
125
126 tmr_output_channel_config(TMR3, TMR_SELECT_CHANNEL_4, &tmr_oc_init_structure);
127 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_4, ch4_val);
128 tmr_output_channel_buffer_enable(TMR3, TMR_SELECT_CHANNEL_4, TRUE);
129
130 tmr_period_buffer_enable(TMR3, TRUE);
131
132 /* tmr enable counter */
133 tmr_counter_enable(TMR3, TRUE);
134
135 while(1)
136 {
137 }
138}
139
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
ch4_val
uint16_t ch4_val
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c:43
ch3_val
uint16_t ch3_val
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c:42
ch1_val
uint16_t ch1_val
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c:40
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c:91
ch2_val
uint16_t ch2_val
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c:41
gpio_configuration
void gpio_configuration(void)
configure the tmr3 pins.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c:54
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c:38
crm_configuration
void crm_configuration(void)
configures the different peripheral clocks.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c:76
div_value
uint16_t div_value
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr3/src/main.c:44
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR3_PERIPH_CLOCK
@ CRM_TMR3_PERIPH_CLOCK
Definition: at32f415_crm.h:124
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_1
#define GPIO_PINS_1
Definition: at32f415_gpio.h:52
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
tmr_period_buffer_enable
void tmr_period_buffer_enable(tmr_type *tmr_x, confirm_state new_state)
enable tmr period buffer
Definition: at32f415_tmr.c:567
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_output_channel_buffer_enable
void tmr_output_channel_buffer_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
enable tmr output channel buffer
Definition: at32f415_tmr.c:587
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_4
@ TMR_SELECT_CHANNEL_4
Definition: at32f415_tmr.h:222
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_PWM_MODE_A
@ TMR_OUTPUT_CONTROL_PWM_MODE_A
Definition: at32f415_tmr.h:179
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • pwm_output_tmr10
  • inc
project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • pwm_output_tmr10
  • inc
project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • pwm_output_tmr10
  • inc
project/at_start_f415/examples/tmr/pwm_output_tmr10/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • pwm_output_tmr10
  • src
project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • pwm_output_tmr10
  • src
project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • pwm_output_tmr10
  • src
project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 tmr_output_config_type tmr_oc_init_structure;
39
40uint16_t ch1_val = 250;
41uint16_t div_value = 0;
42
43void crm_configuration(void);
44void gpio_configuration(void);
45
51void gpio_configuration(void)
52{
53 gpio_init_type gpio_init_struct;
54
55 gpio_default_para_init(&gpio_init_struct);
56
57 gpio_init_struct.gpio_pins = GPIO_PINS_8;
58 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
59 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
60 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
61 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
62 gpio_init(GPIOB, &gpio_init_struct);
63}
64
70void crm_configuration(void)
71{
72 /* tmr10 clock enable */
73 crm_periph_clock_enable(CRM_TMR10_PERIPH_CLOCK, TRUE);
74
75 /* gpioa gpiob clock enable */
76 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
77}
78
84int main(void)
85{
86 system_clock_config();
87
88 /* peripheral clocks configuration */
89 crm_configuration();
90
91 /* gpio configuration */
92 gpio_configuration();
93
94 /* compute the div value */
95 div_value = (uint16_t)(system_core_clock / 24000000) - 1;
96
97 /* tmr10 time base configuration */
98 tmr_base_init(TMR10, 499, div_value);
99 tmr_cnt_dir_set(TMR10, TMR_COUNT_UP);
100 tmr_clock_source_div_set(TMR10, TMR_CLOCK_DIV1);
101
102 tmr_output_default_para_init(&tmr_oc_init_structure);
103 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_A;
104 tmr_oc_init_structure.oc_idle_state = FALSE;
105 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
106 tmr_oc_init_structure.oc_output_state = TRUE;
107 tmr_output_channel_config(TMR10, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
108 tmr_channel_value_set(TMR10, TMR_SELECT_CHANNEL_1, ch1_val);
109 tmr_output_channel_buffer_enable(TMR10, TMR_SELECT_CHANNEL_1, TRUE);
110
111 tmr_period_buffer_enable(TMR10, TRUE);
112
113 /* tmr enable counter */
114 tmr_counter_enable(TMR10, TRUE);
115
116 while(1)
117 {
118 }
119}
120
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
ch1_val
uint16_t ch1_val
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c:40
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c:84
gpio_configuration
void gpio_configuration(void)
configure the tmr1 pins.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c:51
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c:38
crm_configuration
void crm_configuration(void)
configures the different peripheral clocks.
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c:70
div_value
uint16_t div_value
Definition: project/at_start_f415/examples/tmr/pwm_output_tmr10/src/main.c:41
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_TMR10_PERIPH_CLOCK
@ CRM_TMR10_PERIPH_CLOCK
Definition: at32f415_crm.h:120
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
tmr_period_buffer_enable
void tmr_period_buffer_enable(tmr_type *tmr_x, confirm_state new_state)
enable tmr period buffer
Definition: at32f415_tmr.c:567
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_output_channel_buffer_enable
void tmr_output_channel_buffer_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
enable tmr output channel buffer
Definition: at32f415_tmr.c:587
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_PWM_MODE_A
@ TMR_OUTPUT_CONTROL_PWM_MODE_A
Definition: at32f415_tmr.h:179
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR10
#define TMR10
Definition: at32f415_tmr.h:841
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • timer_base
  • inc
project/at_start_f415/examples/tmr/timer_base/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • timer_base
  • inc
project/at_start_f415/examples/tmr/timer_base/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • timer_base
  • inc
project/at_start_f415/examples/tmr/timer_base/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • timer_base
  • src
project/at_start_f415/examples/tmr/timer_base/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/timer_base/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • timer_base
  • src
project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/timer_base/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • timer_base
  • src
project/at_start_f415/examples/tmr/timer_base/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 crm_clocks_freq_type crm_clocks_freq_struct = {0};
39
40void clkout_config(void)
41{
42 gpio_init_type gpio_init_struct;
43
44 /* enable gpio port clock */
45 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
46
47 /* set default parameter */
48 gpio_default_para_init(&gpio_init_struct);
49
50 /* clkout gpio init */
51 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
52 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
53 gpio_init_struct.gpio_pins = GPIO_PINS_8;
54 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
55 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
56 gpio_init(GPIOA, &gpio_init_struct);
57
58 /* config clkout division */
59 crm_clkout_div_set(CRM_CLKOUT_DIV_1);
60
61 /* config clkout clock */
62 crm_clock_out_set(CRM_CLKOUT_PLL_DIV_4);
63}
64
70void TMR1_OVF_TMR10_IRQHandler(void)
71{
72 if(tmr_flag_get(TMR1, TMR_OVF_FLAG) != RESET)
73 {
74 /* add user code... */
75 at32_led_toggle(LED3);
76 tmr_flag_clear(TMR1, TMR_OVF_FLAG);
77 }
78}
79
85int main(void)
86{
87 system_clock_config();
88
89 at32_board_init();
90
91 /* get system clock */
92 crm_clocks_freq_get(&crm_clocks_freq_struct);
93
94 /* turn led2/led3/led4 on */
95 at32_led_on(LED2);
96 at32_led_on(LED3);
97 at32_led_on(LED4);
98
99 /* enable tmr1 clock */
100 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
101
102 /* tmr1 configuration */
103 /* time base configuration */
104 /* systemclock/14400/10000 = 1hz */
105 tmr_base_init(TMR1, 9999, (crm_clocks_freq_struct.ahb_freq / 10000) - 1);
106 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
107
108 /* overflow interrupt enable */
109 tmr_interrupt_enable(TMR1, TMR_OVF_INT, TRUE);
110
111 /* tmr1 overflow interrupt nvic init */
112 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
113 nvic_irq_enable(TMR1_OVF_TMR10_IRQn, 0, 0);
114
115 /* enable tmr1 */
116 tmr_counter_enable(TMR1, TRUE);
117 clkout_config();
118
119 while(1)
120 {
121 }
122}
123
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
clkout_config
void clkout_config(void)
clkout configuration.
Definition: project/at_start_f415/examples/tmr/timer_base/src/main.c:40
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/timer_base/src/main.c:85
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/tmr/timer_base/src/main.c:38
TMR1_OVF_TMR10_IRQHandler
void TMR1_OVF_TMR10_IRQHandler(void)
this function handles timer1 overflow handler.
Definition: project/at_start_f415/examples/tmr/timer_base/src/main.c:70
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_clkout_div_set
void crm_clkout_div_set(crm_clkout_div_type clkout_div)
set crm clkout division
Definition: at32f415_crm.c:901
crm_clock_out_set
void crm_clock_out_set(crm_clkout_select_type clkout)
set crm clkout
Definition: at32f415_crm.c:803
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
CRM_CLKOUT_DIV_1
@ CRM_CLKOUT_DIV_1
Definition: at32f415_crm.h:429
CRM_CLKOUT_PLL_DIV_4
@ CRM_CLKOUT_PLL_DIV_4
Definition: at32f415_crm.h:419
TMR1_OVF_TMR10_IRQn
@ TMR1_OVF_TMR10_IRQn
Definition: at32f415.h:161
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_flag_get
flag_status tmr_flag_get(tmr_type *tmr_x, uint32_t tmr_flag)
get tmr flag
Definition: at32f415_tmr.c:1310
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_OVF_FLAG
#define TMR_OVF_FLAG
Definition: at32f415_tmr.h:52
TMR_OVF_INT
#define TMR_OVF_INT
Definition: at32f415_tmr.h:74
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::ahb_freq
uint32_t ahb_freq
Definition: at32f415_crm.h:473
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • tmr1_synchro
  • inc
project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • tmr1_synchro
  • inc
project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • tmr1_synchro
  • inc
project/at_start_f415/examples/tmr/tmr1_synchro/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • tmr1_synchro
  • src
project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • tmr1_synchro
  • src
project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • tmr1_synchro
  • src
project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 tmr_output_config_type tmr_oc_init_structure;
39
40void crm_configuration(void);
41void gpio_configuration(void);
42
48void gpio_configuration(void)
49{
50 gpio_init_type gpio_init_struct;
51
52 gpio_default_para_init(&gpio_init_struct);
53
54 gpio_init_struct.gpio_pins = GPIO_PINS_6 | GPIO_PINS_8;
55 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
56 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
57 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
58 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
59 gpio_init(GPIOA, &gpio_init_struct);
60
61 gpio_init_struct.gpio_pins = GPIO_PINS_6;
62 gpio_init(GPIOB, &gpio_init_struct);
63}
64
70void crm_configuration(void)
71{
72 /* tmr clock enable */
73 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
74 crm_periph_clock_enable(CRM_TMR3_PERIPH_CLOCK, TRUE);
75 crm_periph_clock_enable(CRM_TMR4_PERIPH_CLOCK, TRUE);
76
77 /* gpio clock enable */
78 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
79 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
80}
81
87int main(void)
88{
89 system_clock_config();
90
91 /* peripheral clocks configuration */
92 crm_configuration();
93
94 /* gpio configuration */
95 gpio_configuration();
96
97 /* tmr3 time base configuration */
98 tmr_base_init(TMR3, 2, 0);
99 tmr_cnt_dir_set(TMR3, TMR_COUNT_UP);
100 tmr_clock_source_div_set(TMR3, TMR_CLOCK_DIV1);
101
102 tmr_output_default_para_init(&tmr_oc_init_structure);
103 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_A;
104 tmr_oc_init_structure.oc_idle_state = FALSE;
105 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
106 tmr_oc_init_structure.oc_output_state = TRUE;
107 tmr_output_channel_config(TMR3, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
108 tmr_channel_value_set(TMR3, TMR_SELECT_CHANNEL_1, 1);
109
110 /* input trigger selection */
111 tmr_trigger_input_select(TMR3, TMR_SUB_INPUT_SEL_IS0);
112
113 /* slave mode selection: hang mode */
114 tmr_sub_mode_select(TMR3, TMR_SUB_HANG_MODE);
115
116 /* tmr4 time base configuration */
117 tmr_base_init(TMR4, 1, 0);
118 tmr_cnt_dir_set(TMR4, TMR_COUNT_UP);
119 tmr_clock_source_div_set(TMR4, TMR_CLOCK_DIV1);
120
121 tmr_output_default_para_init(&tmr_oc_init_structure);
122 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_A;
123 tmr_oc_init_structure.oc_idle_state = FALSE;
124 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
125 tmr_oc_init_structure.oc_output_state = TRUE;
126 tmr_output_channel_config(TMR4, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
127 tmr_channel_value_set(TMR4, TMR_SELECT_CHANNEL_1, 1);
128
129 /* input trigger selection */
130 tmr_trigger_input_select(TMR4, TMR_SUB_INPUT_SEL_IS0);
131
132 /* slave mode selection: hang mode */
133 tmr_sub_mode_select(TMR4, TMR_SUB_HANG_MODE);
134
135 /* tmr1 time base configuration */
136 tmr_base_init(TMR1, 143, 0);
137 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
138 tmr_clock_source_div_set(TMR1, TMR_CLOCK_DIV1);
139 tmr_repetition_counter_set(TMR1, 4);
140
141 tmr_output_default_para_init(&tmr_oc_init_structure);
142 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_B;
143 tmr_oc_init_structure.oc_idle_state = TRUE;
144 tmr_oc_init_structure.occ_idle_state = FALSE;
145 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_LOW;
146 tmr_oc_init_structure.occ_polarity = TMR_OUTPUT_ACTIVE_LOW;
147 tmr_oc_init_structure.oc_output_state = TRUE;
148 tmr_oc_init_structure.occ_output_state = TRUE;
149 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
150 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_1, 72);
151
152 tmr_primary_mode_select(TMR1, TMR_PRIMARY_SEL_OVERFLOW);
153 tmr_sub_sync_mode_set(TMR1, TRUE);
154
155 tmr_output_enable(TMR1, TRUE);
156
157 /* tmr enable counter */
158 tmr_counter_enable(TMR1, TRUE);
159 tmr_counter_enable(TMR3, TRUE);
160 tmr_counter_enable(TMR4, TRUE);
161
162 while(1)
163 {
164 }
165}
166
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c:87
gpio_configuration
void gpio_configuration(void)
configure the tmr1 pins.
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c:48
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c:38
crm_configuration
void crm_configuration(void)
configures the different peripheral clocks.
Definition: project/at_start_f415/examples/tmr/tmr1_synchro/src/main.c:70
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR4_PERIPH_CLOCK
@ CRM_TMR4_PERIPH_CLOCK
Definition: at32f415_crm.h:125
CRM_TMR3_PERIPH_CLOCK
@ CRM_TMR3_PERIPH_CLOCK
Definition: at32f415_crm.h:124
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
tmr_repetition_counter_set
void tmr_repetition_counter_set(tmr_type *tmr_x, uint8_t tmr_rpr_value)
set the repetition counter register(rpr) value
Definition: at32f415_tmr.c:225
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_sub_mode_select
void tmr_sub_mode_select(tmr_type *tmr_x, tmr_sub_mode_select_type sub_mode)
select tmr subordinate mode
Definition: at32f415_tmr.c:1148
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_output_enable
void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable
Definition: at32f415_tmr.c:1382
tmr_sub_sync_mode_set
void tmr_sub_sync_mode_set(tmr_type *tmr_x, confirm_state new_state)
set tmr subordinate synchronization mode
Definition: at32f415_tmr.c:1225
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_trigger_input_select
void tmr_trigger_input_select(tmr_type *tmr_x, sub_tmr_input_sel_type trigger_select)
select tmr sub-trigger
Definition: at32f415_tmr.c:1212
tmr_primary_mode_select
void tmr_primary_mode_select(tmr_type *tmr_x, tmr_primary_select_type primary_mode)
select tmr primary mode
Definition: at32f415_tmr.c:1126
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_PWM_MODE_B
@ TMR_OUTPUT_CONTROL_PWM_MODE_B
Definition: at32f415_tmr.h:180
TMR_OUTPUT_CONTROL_PWM_MODE_A
@ TMR_OUTPUT_CONTROL_PWM_MODE_A
Definition: at32f415_tmr.h:179
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR_OUTPUT_ACTIVE_LOW
@ TMR_OUTPUT_ACTIVE_LOW
Definition: at32f415_tmr.h:198
TMR_SUB_INPUT_SEL_IS0
@ TMR_SUB_INPUT_SEL_IS0
Definition: at32f415_tmr.h:133
TMR_SUB_HANG_MODE
@ TMR_SUB_HANG_MODE
Definition: at32f415_tmr.h:153
TMR_PRIMARY_SEL_OVERFLOW
@ TMR_PRIMARY_SEL_OVERFLOW
Definition: at32f415_tmr.h:120
TMR3
#define TMR3
Definition: at32f415_tmr.h:834
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
TMR4
#define TMR4
Definition: at32f415_tmr.h:835
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::occ_output_state
confirm_state occ_output_state
Definition: at32f415_tmr.h:405
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::occ_polarity
tmr_output_polarity_type occ_polarity
Definition: at32f415_tmr.h:403
tmr_output_config_type::occ_idle_state
confirm_state occ_idle_state
Definition: at32f415_tmr.h:401
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • tmr2_32bit
  • inc
project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • tmr2_32bit
  • inc
project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • tmr2_32bit
  • inc
project/at_start_f415/examples/tmr/tmr2_32bit/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • tmr2_32bit
  • src
project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • tmr2_32bit
  • src
project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • tmr2_32bit
  • src
project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 tmr_output_config_type tmr_oc_init_structure;
39
40uint32_t ch1_val = 0x7FFFF;
41uint32_t ch2_val = 0x3FFFF;
42uint32_t ch3_val = 0x1FFFF;
43uint32_t ch4_val = 0xFFFF;
44
45void crm_configuration(void);
46void gpio_configuration(void);
47
53void gpio_configuration(void)
54{
55 gpio_init_type gpio_init_struct;
56
57 gpio_default_para_init(&gpio_init_struct);
58
59 gpio_init_struct.gpio_pins = GPIO_PINS_0 | GPIO_PINS_1 | GPIO_PINS_2 | GPIO_PINS_3;
60 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
61 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
62 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
63 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
64 gpio_init(GPIOA, &gpio_init_struct);
65}
66
72void crm_configuration(void)
73{
74 /* tmr clock enable */
75 crm_periph_clock_enable(CRM_TMR2_PERIPH_CLOCK, TRUE);
76
77 /* gpio clock enable */
78 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
79}
80
86int main(void)
87{
88 system_clock_config();
89
90 /* peripheral clocks configuration */
91 crm_configuration();
92
93 /* gpio configuration */
94 gpio_configuration();
95
96 tmr_32_bit_function_enable(TMR2, TRUE);
97
98 /* tmr2 time base configuration */
99 tmr_base_init(TMR2, 0xFFFFF, 0);
100 tmr_cnt_dir_set(TMR2, TMR_COUNT_UP);
101 tmr_clock_source_div_set(TMR2, TMR_CLOCK_DIV1);
102
103 tmr_output_default_para_init(&tmr_oc_init_structure);
104 tmr_oc_init_structure.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_A;
105 tmr_oc_init_structure.oc_idle_state = FALSE;
106 tmr_oc_init_structure.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
107 tmr_oc_init_structure.oc_output_state = TRUE;
108 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_1, &tmr_oc_init_structure);
109 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_1, ch1_val);
110 tmr_output_channel_buffer_enable(TMR2, TMR_SELECT_CHANNEL_1, TRUE);
111
112 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_2, &tmr_oc_init_structure);
113 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_2, ch2_val);
114 tmr_output_channel_buffer_enable(TMR2, TMR_SELECT_CHANNEL_2, TRUE);
115
116 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_3, &tmr_oc_init_structure);
117 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_3, ch3_val);
118 tmr_output_channel_buffer_enable(TMR2, TMR_SELECT_CHANNEL_3, TRUE);
119
120 tmr_output_channel_config(TMR2, TMR_SELECT_CHANNEL_4, &tmr_oc_init_structure);
121 tmr_channel_value_set(TMR2, TMR_SELECT_CHANNEL_4, ch4_val);
122 tmr_output_channel_buffer_enable(TMR2, TMR_SELECT_CHANNEL_4, TRUE);
123
124 tmr_period_buffer_enable(TMR2, TRUE);
125
126 /* tmr2 enable counter */
127 tmr_counter_enable(TMR2, TRUE);
128
129 while(1)
130 {
131 }
132}
133
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
ch1_val
uint32_t ch1_val
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c:40
ch2_val
uint32_t ch2_val
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c:41
ch4_val
uint32_t ch4_val
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c:43
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c:86
gpio_configuration
void gpio_configuration(void)
configure the tmr1 pins.
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c:53
tmr_oc_init_structure
tmr_output_config_type tmr_oc_init_structure
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c:38
crm_configuration
void crm_configuration(void)
configures the different peripheral clocks.
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c:72
ch3_val
uint32_t ch3_val
Definition: project/at_start_f415/examples/tmr/tmr2_32bit/src/main.c:42
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_TMR2_PERIPH_CLOCK
@ CRM_TMR2_PERIPH_CLOCK
Definition: at32f415_crm.h:123
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIO_PINS_1
#define GPIO_PINS_1
Definition: at32f415_gpio.h:52
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
tmr_period_buffer_enable
void tmr_period_buffer_enable(tmr_type *tmr_x, confirm_state new_state)
enable tmr period buffer
Definition: at32f415_tmr.c:567
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_clock_source_div_set
void tmr_clock_source_div_set(tmr_type *tmr_x, tmr_clock_division_type tmr_clock_div)
set tmr clock source division
Definition: at32f415_tmr.c:191
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_32_bit_function_enable
void tmr_32_bit_function_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr 32 bit function(plus mode)
Definition: at32f415_tmr.c:730
tmr_output_channel_buffer_enable
void tmr_output_channel_buffer_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
enable tmr output channel buffer
Definition: at32f415_tmr.c:587
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_4
@ TMR_SELECT_CHANNEL_4
Definition: at32f415_tmr.h:222
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_CLOCK_DIV1
@ TMR_CLOCK_DIV1
Definition: at32f415_tmr.h:96
TMR_OUTPUT_CONTROL_PWM_MODE_A
@ TMR_OUTPUT_CONTROL_PWM_MODE_A
Definition: at32f415_tmr.h:179
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR2
#define TMR2
Definition: at32f415_tmr.h:833
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • 6_steps
  • inc
project/at_start_f415/examples/tmr/6_steps/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • 6_steps
  • inc
project/at_start_f415/examples/tmr/6_steps/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • 6_steps
  • inc
project/at_start_f415/examples/tmr/6_steps/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • 6_steps
  • src
project/at_start_f415/examples/tmr/6_steps/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/6_steps/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • 6_steps
  • src
project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133 /* trigger TMR1 hall event */
134 tmr_event_sw_trigger(TMR1, TMR_HALL_SWTRIG);
135}
136
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/6_steps/src/at32f415_int.c:113
tmr_event_sw_trigger
void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event
Definition: at32f415_tmr.c:1369
TMR_HALL_SWTRIG
@ TMR_HALL_SWTRIG
Definition: at32f415_tmr.h:288
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • 6_steps
  • src
project/at_start_f415/examples/tmr/6_steps/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39 tmr_output_config_type tmr_output_struct;
40 tmr_brkdt_config_type tmr_brkdt_config_struct = {0};
41 crm_clocks_freq_type crm_clocks_freq_struct = {0};
42
43__IO uint32_t step = 1;
44
45/* systick configuration */
46void systick_configuration(void);
47
53int main(void)
54{
55 system_clock_config();
56
57 at32_board_init();
58
59 /* get system clock */
60 crm_clocks_freq_get(&crm_clocks_freq_struct);
61
62 systick_configuration();
63
64 /* turn led2/led3/led4 on */
65 at32_led_on(LED2);
66 at32_led_on(LED3);
67 at32_led_on(LED4);
68
69 /* enable tmr1/gpioa/gpiob clock */
70 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
71 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
72 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
73
74 /* timer2 output pin Configuration */
75 gpio_init_struct.gpio_pins = GPIO_PINS_8 | GPIO_PINS_9 | GPIO_PINS_10;
76 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
77 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
78 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
79 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
80 gpio_init(GPIOA, &gpio_init_struct);
81
82 gpio_init_struct.gpio_pins = GPIO_PINS_13 | GPIO_PINS_14 | GPIO_PINS_15;
83 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
84 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
85 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
86 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
87 gpio_init(GPIOB, &gpio_init_struct);
88
89 gpio_init_struct.gpio_pins = GPIO_PINS_12;
90 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
91 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
92 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
93 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
94 gpio_init(GPIOB, &gpio_init_struct);
95
96 /*
97 the tmr1 peripheral offers the possibility to program in advance the
98 configuration for the next tmr1 outputs behaviour (step) and change the configuration
99 of all the channels at the same time. this operation is possible when the hall
100 event is used.
101 the hall event can be generated by software by setting the hall bit in the tmr1_swevt
102 register or by hardware (on trc rising edge).
103 in this example, a software hall event is generated each 100 ms: using the systick
104 interrupt.
105 the tmr1 is configured in timing mode, each time a hall event occurs,
106 a new tmr1 configuration will be set in advance.
107 the following table describes the tmr1 channels states:
108 -----------------------------------------------
109 | step1 | step2 | step3 | step4 | step5 | step6 |
110 ----------------------------------------------------------
111 |channel1 | 1 | 0 | 0 | 0 | 0 | 1 |
112 ----------------------------------------------------------
113 |channel1n | 0 | 0 | 1 | 1 | 0 | 0 |
114 ----------------------------------------------------------
115 |channel2 | 0 | 0 | 0 | 1 | 1 | 0 |
116 ----------------------------------------------------------
117 |channel2n | 1 | 1 | 0 | 0 | 0 | 0 |
118 ----------------------------------------------------------
119 |channel3 | 0 | 1 | 1 | 0 | 0 | 0 |
120 ----------------------------------------------------------
121 |channel3n | 0 | 0 | 0 | 0 | 1 | 1 |
122 ----------------------------------------------------------
123 */
124 /* tmr1 configuration */
125 /* time base configuration */
126 tmr_base_init(TMR1, 4095, 0);
127 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
128
129 /* channel 1, 2 and 3 configuration in output mode */
130 tmr_output_default_para_init(&tmr_output_struct);
131 tmr_output_struct.oc_mode = TMR_OUTPUT_CONTROL_OFF;
132 tmr_output_struct.oc_output_state = TRUE;
133 tmr_output_struct.oc_polarity = TMR_OUTPUT_ACTIVE_HIGH;
134 tmr_output_struct.oc_idle_state = TRUE;
135 tmr_output_struct.occ_output_state = TRUE;
136 tmr_output_struct.occ_polarity = TMR_OUTPUT_ACTIVE_HIGH;
137 tmr_output_struct.occ_idle_state = TRUE;
138
139 /* channel 1 */
140 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_1, &tmr_output_struct);
141 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_1, 2047);
142
143 /* channel 2 */
144 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_2, &tmr_output_struct);
145 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_2, 1023);
146
147 /* channel 3 */
148 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_3, &tmr_output_struct);
149 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_3, 511);
150
151 /* automatic output enable, break, dead time and lock configuration */
152 tmr_brkdt_default_para_init(&tmr_brkdt_config_struct);
153 tmr_brkdt_config_struct.brk_enable = TRUE;
154 tmr_brkdt_config_struct.auto_output_enable = TRUE;
155 tmr_brkdt_config_struct.deadtime = 0;
156 tmr_brkdt_config_struct.fcsodis_state = TRUE;
157 tmr_brkdt_config_struct.fcsoen_state = TRUE;
158 tmr_brkdt_config_struct.brk_polarity = TMR_BRK_INPUT_ACTIVE_HIGH;
159 tmr_brkdt_config_struct.wp_level = TMR_WP_OFF;
160 tmr_brkdt_config(TMR1, &tmr_brkdt_config_struct);
161 tmr_channel_buffer_enable(TMR1, TRUE);
162
163 /* hall interrupt enable */
164 tmr_interrupt_enable(TMR1, TMR_HALL_INT, TRUE);
165
166 /* tmr1 hall interrupt nvic init */
167 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
168 nvic_irq_enable(TMR1_TRG_HALL_TMR11_IRQn, 0, 0);
169
170 /* tmr1 output enable */
171 tmr_output_enable(TMR1, TRUE);
172
173 /* enable tmr1 */
174 tmr_counter_enable(TMR1, TRUE);
175
176 while(1)
177 {
178 }
179}
185void systick_configuration(void)
186{
187 /* setup systick timer for 20 msec interrupts */
188 if(SysTick_Config((crm_clocks_freq_struct.sclk_freq) / 50))
189 {
190 /* capture error */
191 while(1);
192 }
193 NVIC_SetPriority(SysTick_IRQn, 0x0);
194}
195
202void TMR1_TRG_HALL_TMR11_IRQHandler(void)
203{
204 /* clear tmr1 com pending bit */
205 tmr_flag_clear(TMR1, TMR_HALL_FLAG);
206 if(step == 1)
207 {
208 /* next step: step 2 configuration ---------------------------- */
209 /* channel3 configuration */
210 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_3, FALSE);
211 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_3C, FALSE);
212
213 /* channel1 configuration */
214 tmr_output_channel_mode_select(TMR1, TMR_SELECT_CHANNEL_1, TMR_OUTPUT_CONTROL_PWM_MODE_A);
215 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_1, TRUE);
216 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_1C, FALSE);
217
218 /* channel2 configuration */
219 tmr_output_channel_mode_select(TMR1, TMR_SELECT_CHANNEL_2, TMR_OUTPUT_CONTROL_PWM_MODE_A);
220 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_2, FALSE);
221 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_2C, TRUE);
222 step++;
223 }
224 else if(step == 2)
225 {
226 /* next step: step 3 configuration ---------------------------- */
227 /* channel2 configuration */
228 tmr_output_channel_mode_select(TMR1, TMR_SELECT_CHANNEL_2, TMR_OUTPUT_CONTROL_PWM_MODE_A);
229 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_2, FALSE);
230 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_2C, TRUE);
231
232 /* channel3 configuration */
233 tmr_output_channel_mode_select(TMR1, TMR_SELECT_CHANNEL_3, TMR_OUTPUT_CONTROL_PWM_MODE_A);
234 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_3, TRUE);
235 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_3C, FALSE);
236
237 /* channel1 configuration */
238 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_1, FALSE);
239 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_1C, FALSE);
240 step++;
241 }
242 else if(step == 3)
243 {
244 /* next step: step 4 configuration ---------------------------- */
245 /* channel3 configuration */
246 tmr_output_channel_mode_select(TMR1, TMR_SELECT_CHANNEL_3, TMR_OUTPUT_CONTROL_PWM_MODE_A);
247 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_3, TRUE);
248 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_3C, FALSE);
249
250 /* channel2 configuration */
251 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_2, FALSE);
252 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_2C, FALSE);
253
254 /* channel1 configuration */
255 tmr_output_channel_mode_select(TMR1, TMR_SELECT_CHANNEL_1, TMR_OUTPUT_CONTROL_PWM_MODE_A);
256 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_1, FALSE);
257 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_1C, TRUE);
258 step++;
259 }
260 else if(step == 4)
261 {
262 /* next step: step 5 configuration ---------------------------- */
263 /* channel3 configuration */
264 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_3, FALSE);
265 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_3C, FALSE);
266
267 /* channel1 configuration */
268 tmr_output_channel_mode_select(TMR1, TMR_SELECT_CHANNEL_1, TMR_OUTPUT_CONTROL_PWM_MODE_A);
269 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_1, FALSE);
270 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_1C, TRUE);
271
272 /* channel2 configuration */
273 tmr_output_channel_mode_select(TMR1, TMR_SELECT_CHANNEL_2, TMR_OUTPUT_CONTROL_PWM_MODE_A);
274 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_2, TRUE);
275 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_2C, FALSE);
276 step++;
277 }
278 else if(step == 5)
279 {
280 /* next step: step 6 configuration ---------------------------- */
281 /* channel3 configuration */
282 tmr_output_channel_mode_select(TMR1, TMR_SELECT_CHANNEL_3, TMR_OUTPUT_CONTROL_PWM_MODE_A);
283 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_3, FALSE);
284 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_3C, TRUE);
285
286 /* channel1 configuration */
287 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_1, FALSE);
288 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_1C, FALSE);
289
290 /* channel2 configuration */
291 tmr_output_channel_mode_select(TMR1, TMR_SELECT_CHANNEL_2, TMR_OUTPUT_CONTROL_PWM_MODE_A);
292 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_2, TRUE);
293 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_2C, FALSE);
294 step++;
295 }
296 else
297 {
298 /* next step: step 1 configuration ---------------------------- */
299 /* channel1 configuration */
300 tmr_output_channel_mode_select(TMR1, TMR_SELECT_CHANNEL_1, TMR_OUTPUT_CONTROL_PWM_MODE_A);
301 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_1, TRUE);
302 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_1C, FALSE);
303
304 /* channel3 configuration */
305 tmr_output_channel_mode_select(TMR1, TMR_SELECT_CHANNEL_3, TMR_OUTPUT_CONTROL_PWM_MODE_A);
306 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_3, FALSE);
307 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_3C, TRUE);
308
309 /* channel2 configuration */
310 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_2, FALSE);
311 tmr_channel_enable(TMR1, TMR_SELECT_CHANNEL_2C, FALSE);
312 step = 1;
313 }
314}
315
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/tmr/6_steps/src/main.c:38
tmr_output_struct
tmr_output_config_type tmr_output_struct
Definition: project/at_start_f415/examples/tmr/6_steps/src/main.c:39
systick_configuration
void systick_configuration(void)
configures the systick.
Definition: project/at_start_f415/examples/tmr/6_steps/src/main.c:185
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/6_steps/src/main.c:53
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/tmr/6_steps/src/main.c:41
step
__IO uint32_t step
Definition: project/at_start_f415/examples/tmr/6_steps/src/main.c:43
TMR1_TRG_HALL_TMR11_IRQHandler
void TMR1_TRG_HALL_TMR11_IRQHandler(void)
this function handles tmr1 trigger and hall interrupts requests.
Definition: project/at_start_f415/examples/tmr/6_steps/src/main.c:202
tmr_brkdt_config_struct
tmr_brkdt_config_type tmr_brkdt_config_struct
Definition: project/at_start_f415/examples/tmr/6_steps/src/main.c:40
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
SysTick_IRQn
@ SysTick_IRQn
Definition: at32f415.h:132
TMR1_TRG_HALL_TMR11_IRQn
@ TMR1_TRG_HALL_TMR11_IRQn
Definition: at32f415.h:162
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_12
#define GPIO_PINS_12
Definition: at32f415_gpio.h:63
GPIO_PINS_14
#define GPIO_PINS_14
Definition: at32f415_gpio.h:65
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
tmr_flag_clear
void tmr_flag_clear(tmr_type *tmr_x, uint32_t tmr_flag)
clear tmr flag
Definition: at32f415_tmr.c:1347
tmr_channel_buffer_enable
void tmr_channel_buffer_enable(tmr_type *tmr_x, confirm_state new_state)
enable tmr channel buffer
Definition: at32f415_tmr.c:1190
tmr_output_channel_mode_select
void tmr_output_channel_mode_select(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_control_mode_type oc_mode)
select tmr output channel mode
Definition: at32f415_tmr.c:409
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_brkdt_default_para_init
void tmr_brkdt_default_para_init(tmr_brkdt_config_type *tmr_brkdt_struct)
init tmr brkdt default para
Definition: at32f415_tmr.c:146
tmr_brkdt_config
void tmr_brkdt_config(tmr_type *tmr_x, tmr_brkdt_config_type *brkdt_struct)
config tmr break mode and dead-time
Definition: at32f415_tmr.c:1677
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_output_enable
void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable
Definition: at32f415_tmr.c:1382
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_interrupt_enable
void tmr_interrupt_enable(tmr_type *tmr_x, uint32_t tmr_interrupt, confirm_state new_state)
enable or disable tmr interrupt
Definition: at32f415_tmr.c:1277
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_enable
void tmr_channel_enable(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, confirm_state new_state)
tmr channel enable
Definition: at32f415_tmr.c:847
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_1C
@ TMR_SELECT_CHANNEL_1C
Definition: at32f415_tmr.h:217
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_2C
@ TMR_SELECT_CHANNEL_2C
Definition: at32f415_tmr.h:219
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_SELECT_CHANNEL_3C
@ TMR_SELECT_CHANNEL_3C
Definition: at32f415_tmr.h:221
TMR_WP_OFF
@ TMR_WP_OFF
Definition: at32f415_tmr.h:388
TMR_BRK_INPUT_ACTIVE_HIGH
@ TMR_BRK_INPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:380
TMR_OUTPUT_CONTROL_OFF
@ TMR_OUTPUT_CONTROL_OFF
Definition: at32f415_tmr.h:173
TMR_OUTPUT_CONTROL_PWM_MODE_A
@ TMR_OUTPUT_CONTROL_PWM_MODE_A
Definition: at32f415_tmr.h:179
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR_HALL_FLAG
#define TMR_HALL_FLAG
Definition: at32f415_tmr.h:57
TMR_HALL_INT
#define TMR_HALL_INT
Definition: at32f415_tmr.h:79
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::sclk_freq
uint32_t sclk_freq
Definition: at32f415_crm.h:472
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_brkdt_config_type
tmr brkdt config type
Definition: at32f415_tmr.h:423
tmr_brkdt_config_type::brk_enable
confirm_state brk_enable
Definition: at32f415_tmr.h:430
tmr_brkdt_config_type::deadtime
uint8_t deadtime
Definition: at32f415_tmr.h:424
tmr_brkdt_config_type::auto_output_enable
confirm_state auto_output_enable
Definition: at32f415_tmr.h:427
tmr_brkdt_config_type::wp_level
tmr_wp_level_type wp_level
Definition: at32f415_tmr.h:426
tmr_brkdt_config_type::fcsoen_state
confirm_state fcsoen_state
Definition: at32f415_tmr.h:428
tmr_brkdt_config_type::fcsodis_state
confirm_state fcsodis_state
Definition: at32f415_tmr.h:429
tmr_brkdt_config_type::brk_polarity
tmr_brk_polarity_type brk_polarity
Definition: at32f415_tmr.h:425
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::occ_output_state
confirm_state occ_output_state
Definition: at32f415_tmr.h:405
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::occ_polarity
tmr_output_polarity_type occ_polarity
Definition: at32f415_tmr.h:403
tmr_output_config_type::occ_idle_state
confirm_state occ_idle_state
Definition: at32f415_tmr.h:401
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • tmr
  • 7_pwm_output
  • inc
project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • tmr
  • 7_pwm_output
  • inc
project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • tmr
  • 7_pwm_output
  • inc
project/at_start_f415/examples/tmr/7_pwm_output/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • tmr
  • 7_pwm_output
  • src
project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • tmr
  • 7_pwm_output
  • src
project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133 /* trigger TMR1 hall event */
134 tmr_event_sw_trigger(TMR1, TMR_HALL_SWTRIG);
135}
136
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/at32f415_int.c:113
tmr_event_sw_trigger
void tmr_event_sw_trigger(tmr_type *tmr_x, tmr_event_trigger_type tmr_event)
generate tmr event
Definition: at32f415_tmr.c:1369
TMR_HALL_SWTRIG
@ TMR_HALL_SWTRIG
Definition: at32f415_tmr.h:288
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • tmr
  • 7_pwm_output
  • src
project/at_start_f415/examples/tmr/7_pwm_output/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38 gpio_init_type gpio_init_struct = {0};
39 tmr_output_config_type tmr_output_struct;
40 crm_clocks_freq_type crm_clocks_freq_struct = {0};
41
42uint16_t timer_period = 0;
43uint16_t channel1_pulse = 0, channel2_pulse = 0, channel3_pulse = 0, channel4_pulse = 0;
44
50int main(void)
51{
52 system_clock_config();
53
54 at32_board_init();
55
56 /* get system clock */
57 crm_clocks_freq_get(&crm_clocks_freq_struct);
58
59 /* turn led2/led3/led4 on */
60 at32_led_on(LED2);
61 at32_led_on(LED3);
62 at32_led_on(LED4);
63
64 /* enable tmr1/gpioa/gpiob clock */
65 crm_periph_clock_enable(CRM_TMR1_PERIPH_CLOCK, TRUE);
66 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
67 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
68
69 /* timer1 output pin Configuration */
70 gpio_init_struct.gpio_pins = GPIO_PINS_8 | GPIO_PINS_9 | GPIO_PINS_10 | GPIO_PINS_11;
71 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
72 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
73 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
74 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
75 gpio_init(GPIOA, &gpio_init_struct);
76
77 gpio_init_struct.gpio_pins = GPIO_PINS_13 | GPIO_PINS_14 | GPIO_PINS_15;
78 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
79 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
80 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
81 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
82 gpio_init(GPIOB, &gpio_init_struct);
83
84 gpio_init_struct.gpio_pins = GPIO_PINS_12;
85 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
86 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
87 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
88 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
89 gpio_init(GPIOB, &gpio_init_struct);
90
91
92 /* tmr1 configuration generate 7 pwm signals with 4 different duty cycles:
93 prescaler = 0, tmr1 counter clock = system_core_clock
94
95 the objective is to generate 7 pwm signal at 17.57 khz:
96 - tim1_period = (system_core_clock / 17570) - 1
97 the channel 1 and channel 1n duty cycle is set to 50%
98 the channel 2 and channel 2n duty cycle is set to 37.5%
99 the channel 3 and channel 3n duty cycle is set to 25%
100 the channel 4 duty cycle is set to 12.5%
101 the timer pulse is calculated as follows:
102 - channelxpulse = duty_cycle * (tim1_period - 1) / 100 */
103
104 /* compute the value to be set in arr regiter to generate signal frequency at 17.57 khz */
105 timer_period = (crm_clocks_freq_struct.sclk_freq / 17570 ) - 1;
106
107 /* compute ccr1 value to generate a duty cycle at 50% for channel 1 and 1n */
108 channel1_pulse = (uint16_t)(((uint32_t) 5 * (timer_period - 1)) / 10);
109
110 /* compute ccr2 value to generate a duty cycle at 37.5% for channel 2 and 2n */
111 channel2_pulse = (uint16_t)(((uint32_t) 375 * (timer_period - 1)) / 1000);
112
113 /* compute ccr3 value to generate a duty cycle at 25% for channel 3 and 3n */
114 channel3_pulse = (uint16_t)(((uint32_t) 25 * (timer_period - 1)) / 100);
115
116 /* compute ccr4 value to generate a duty cycle at 12.5% for channel 4 */
117 channel4_pulse = (uint16_t)(((uint32_t) 125 * (timer_period- 1)) / 1000);
118
119 tmr_base_init(TMR1, timer_period, 0);
120 tmr_cnt_dir_set(TMR1, TMR_COUNT_UP);
121
122 /* channel 1, 2, 3 and 4 configuration in output mode */
123 tmr_output_default_para_init(&tmr_output_struct);
124 tmr_output_struct.oc_mode = TMR_OUTPUT_CONTROL_PWM_MODE_B;
125 tmr_output_struct.oc_output_state = TRUE;
126 tmr_output_struct.oc_polarity = TMR_OUTPUT_ACTIVE_LOW;
127 tmr_output_struct.oc_idle_state = TRUE;
128 tmr_output_struct.occ_output_state = TRUE;
129 tmr_output_struct.occ_polarity = TMR_OUTPUT_ACTIVE_HIGH;
130 tmr_output_struct.occ_idle_state = FALSE;
131
132 /* channel 1 */
133 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_1, &tmr_output_struct);
134 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_1, channel1_pulse);
135
136 /* channel 2 */
137 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_2, &tmr_output_struct);
138 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_2, channel2_pulse);
139
140 /* channel 3 */
141 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_3, &tmr_output_struct);
142 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_3, channel3_pulse);
143
144 /* channel 4 */
145 tmr_output_channel_config(TMR1, TMR_SELECT_CHANNEL_4, &tmr_output_struct);
146 tmr_channel_value_set(TMR1, TMR_SELECT_CHANNEL_4, channel4_pulse);
147
148 /* output enable */
149 tmr_output_enable(TMR1, TRUE);
150
151 /* enable tmr1 */
152 tmr_counter_enable(TMR1, TRUE);
153
154 while(1)
155 {
156 }
157}
158
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/main.c:38
channel1_pulse
uint16_t channel1_pulse
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/main.c:43
tmr_output_struct
tmr_output_config_type tmr_output_struct
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/main.c:39
timer_period
uint16_t timer_period
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/main.c:42
channel2_pulse
uint16_t channel2_pulse
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/main.c:43
channel3_pulse
uint16_t channel3_pulse
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/main.c:43
main
int main(void)
main function.
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/main.c:50
crm_clocks_freq_struct
crm_clocks_freq_type crm_clocks_freq_struct
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/main.c:40
channel4_pulse
uint16_t channel4_pulse
Definition: project/at_start_f415/examples/tmr/7_pwm_output/src/main.c:43
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_clocks_freq_get
void crm_clocks_freq_get(crm_clocks_freq_type *clocks_struct)
get crm clocks freqency
Definition: at32f415_crm.c:666
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_TMR1_PERIPH_CLOCK
@ CRM_TMR1_PERIPH_CLOCK
Definition: at32f415_crm.h:116
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_11
#define GPIO_PINS_11
Definition: at32f415_gpio.h:62
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_12
#define GPIO_PINS_12
Definition: at32f415_gpio.h:63
GPIO_PINS_14
#define GPIO_PINS_14
Definition: at32f415_gpio.h:65
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
tmr_counter_enable
void tmr_counter_enable(tmr_type *tmr_x, confirm_state new_state)
enable or disable tmr counter
Definition: at32f415_tmr.c:103
tmr_output_channel_config
void tmr_output_channel_config(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, tmr_output_config_type *tmr_output_struct)
config tmr output channel
Definition: at32f415_tmr.c:304
tmr_output_default_para_init
void tmr_output_default_para_init(tmr_output_config_type *tmr_output_struct)
init tmr output default para
Definition: at32f415_tmr.c:115
tmr_output_enable
void tmr_output_enable(tmr_type *tmr_x, confirm_state new_state)
tmr output enable(oen),this function is important for advtm output enable
Definition: at32f415_tmr.c:1382
tmr_base_init
void tmr_base_init(tmr_type *tmr_x, uint32_t tmr_pr, uint32_t tmr_div)
init tmr base
Definition: at32f415_tmr.c:167
tmr_cnt_dir_set
void tmr_cnt_dir_set(tmr_type *tmr_x, tmr_count_mode_type tmr_cnt_dir)
set tmr counter count direction
Definition: at32f415_tmr.c:211
tmr_channel_value_set
void tmr_channel_value_set(tmr_type *tmr_x, tmr_channel_select_type tmr_channel, uint32_t tmr_channel_value)
set tmr channel value
Definition: at32f415_tmr.c:483
TMR_COUNT_UP
@ TMR_COUNT_UP
Definition: at32f415_tmr.h:106
TMR_SELECT_CHANNEL_3
@ TMR_SELECT_CHANNEL_3
Definition: at32f415_tmr.h:220
TMR_SELECT_CHANNEL_1
@ TMR_SELECT_CHANNEL_1
Definition: at32f415_tmr.h:216
TMR_SELECT_CHANNEL_4
@ TMR_SELECT_CHANNEL_4
Definition: at32f415_tmr.h:222
TMR_SELECT_CHANNEL_2
@ TMR_SELECT_CHANNEL_2
Definition: at32f415_tmr.h:218
TMR_OUTPUT_CONTROL_PWM_MODE_B
@ TMR_OUTPUT_CONTROL_PWM_MODE_B
Definition: at32f415_tmr.h:180
TMR_OUTPUT_ACTIVE_HIGH
@ TMR_OUTPUT_ACTIVE_HIGH
Definition: at32f415_tmr.h:197
TMR_OUTPUT_ACTIVE_LOW
@ TMR_OUTPUT_ACTIVE_LOW
Definition: at32f415_tmr.h:198
TMR1
#define TMR1
Definition: at32f415_tmr.h:832
crm_clocks_freq_type
crm clocks freqency structure
Definition: at32f415_crm.h:471
crm_clocks_freq_type::sclk_freq
uint32_t sclk_freq
Definition: at32f415_crm.h:472
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
tmr_output_config_type
tmr output config type
Definition: at32f415_tmr.h:398
tmr_output_config_type::occ_output_state
confirm_state occ_output_state
Definition: at32f415_tmr.h:405
tmr_output_config_type::oc_idle_state
confirm_state oc_idle_state
Definition: at32f415_tmr.h:400
tmr_output_config_type::oc_output_state
confirm_state oc_output_state
Definition: at32f415_tmr.h:404
tmr_output_config_type::oc_mode
tmr_output_control_mode_type oc_mode
Definition: at32f415_tmr.h:399
tmr_output_config_type::occ_polarity
tmr_output_polarity_type occ_polarity
Definition: at32f415_tmr.h:403
tmr_output_config_type::occ_idle_state
confirm_state occ_idle_state
Definition: at32f415_tmr.h:401
tmr_output_config_type::oc_polarity
tmr_output_polarity_type oc_polarity
Definition: at32f415_tmr.h:402
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usart
  • half_duplex
  • inc
project/at_start_f415/examples/usart/half_duplex/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usart
  • half_duplex
  • inc
project/at_start_f415/examples/usart/half_duplex/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usart
  • half_duplex
  • inc
project/at_start_f415/examples/usart/half_duplex/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usart
  • half_duplex
  • src
project/at_start_f415/examples/usart/half_duplex/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usart/half_duplex/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usart
  • half_duplex
  • src
project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usart/half_duplex/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usart
  • half_duplex
  • src
project/at_start_f415/examples/usart/half_duplex/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define COUNTOF(a) (sizeof(a) / sizeof(*(a)))
39#define USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
40#define USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)
41
42uint8_t usart2_tx_buffer[] = "usart half-duplex transfer: usart2 -> usart3";
43uint8_t usart3_tx_buffer[] = "usart half-duplex transfer: usart3 -> usart2";
44uint8_t usart2_rx_buffer[USART3_TX_BUFFER_SIZE];
45uint8_t usart3_rx_buffer[USART2_TX_BUFFER_SIZE];
46uint8_t data_count;
47
53void usart_configuration(void)
54{
55 gpio_init_type gpio_init_struct;
56
57 /* enable the usart2 and gpio clock */
58 crm_periph_clock_enable(CRM_USART2_PERIPH_CLOCK, TRUE);
59 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
60
61 /* enable the usart3 and gpio clock */
62 crm_periph_clock_enable(CRM_USART3_PERIPH_CLOCK, TRUE);
63 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
64
65 gpio_default_para_init(&gpio_init_struct);
66
67 /* configure the usart2 tx pin */
68 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
69 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_OPEN_DRAIN;
70 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
71 gpio_init_struct.gpio_pins = GPIO_PINS_2;
72 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
73 gpio_init(GPIOA, &gpio_init_struct);
74
75 /* configure the usart3 tx pin */
76 gpio_init_struct.gpio_pins = GPIO_PINS_10;
77 gpio_init(GPIOB, &gpio_init_struct);
78
79 /* configure usart2 param */
80 usart_init(USART2, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
81 usart_transmitter_enable(USART2, TRUE);
82 usart_receiver_enable(USART2, TRUE);
83 usart_single_line_halfduplex_select(USART2, TRUE);
84 usart_enable(USART2, TRUE);
85
86 /* configure usart3 param */
87 usart_init(USART3, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
88 usart_transmitter_enable(USART3, TRUE);
89 usart_receiver_enable(USART3, TRUE);
90 usart_single_line_halfduplex_select(USART3, TRUE);
91 usart_enable(USART3, TRUE);
92}
93
101uint8_t buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length)
102{
103 while(buffer_length--)
104 {
105 if(*pbuffer1 != *pbuffer2)
106 {
107 return 0;
108 }
109 pbuffer1++;
110 pbuffer2++;
111 }
112 return 1;
113}
114
120int main(void)
121{
122 system_clock_config();
123 at32_board_init();
124 usart_configuration();
125
126 /* usart2 transmit and usart3 receive */
127 data_count = USART2_TX_BUFFER_SIZE;
128 while(data_count)
129 {
130 while(usart_flag_get(USART2, USART_TDBE_FLAG) == RESET);
131 usart_data_transmit(USART2, usart2_tx_buffer[USART2_TX_BUFFER_SIZE-data_count]);
132 while(usart_flag_get(USART3, USART_RDBF_FLAG) == RESET);
133 usart3_rx_buffer[USART2_TX_BUFFER_SIZE-data_count] = usart_data_receive(USART3);
134 data_count--;
135 }
136
137 /* usart3 transmit and usart2 receive */
138 data_count = USART3_TX_BUFFER_SIZE;
139 while(data_count)
140 {
141 while(usart_flag_get(USART3, USART_TDBE_FLAG) == RESET);
142 usart_data_transmit(USART3, usart3_tx_buffer[USART3_TX_BUFFER_SIZE-data_count]);
143 while(usart_flag_get(USART2, USART_RDBF_FLAG) == RESET);
144 usart2_rx_buffer[USART3_TX_BUFFER_SIZE-data_count] = usart_data_receive(USART2);
145 data_count--;
146 }
147
148 while(1)
149 {
150 /* compare data buffer */
151 if(buffer_compare(usart2_tx_buffer, usart3_rx_buffer, USART2_TX_BUFFER_SIZE) && \
152 buffer_compare(usart3_tx_buffer, usart2_rx_buffer, USART3_TX_BUFFER_SIZE))
153 {
154 at32_led_toggle(LED2);
155 at32_led_toggle(LED3);
156 at32_led_toggle(LED4);
157 delay_sec(1);
158 }
159 }
160}
161
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
usart_configuration
void usart_configuration(void)
config usart
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:53
buffer_compare
uint8_t buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers.
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:101
usart3_rx_buffer
uint8_t usart3_rx_buffer[((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:45
USART2_TX_BUFFER_SIZE
#define USART2_TX_BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:39
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:120
usart2_tx_buffer
uint8_t usart2_tx_buffer[]
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:42
USART3_TX_BUFFER_SIZE
#define USART3_TX_BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:40
data_count
uint8_t data_count
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:46
usart3_tx_buffer
uint8_t usart3_tx_buffer[]
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:43
usart2_rx_buffer
uint8_t usart2_rx_buffer[((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:44
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_USART3_PERIPH_CLOCK
@ CRM_USART3_PERIPH_CLOCK
Definition: at32f415_crm.h:131
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_USART2_PERIPH_CLOCK
@ CRM_USART2_PERIPH_CLOCK
Definition: at32f415_crm.h:130
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_OPEN_DRAIN
@ GPIO_OUTPUT_OPEN_DRAIN
Definition: at32f415_gpio.h:250
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
usart_single_line_halfduplex_select
void usart_single_line_halfduplex_select(usart_type *usart_x, confirm_state new_state)
enable or disable the usart single line bidirectional half-duplex communication.
Definition: at32f415_usart.c:470
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_TDBE_FLAG
#define USART_TDBE_FLAG
Definition: at32f415_usart.h:59
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART3
#define USART3
Definition: at32f415_usart.h:321
USART2
#define USART2
Definition: at32f415_usart.h:320
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usart
  • hw_flow_control
  • inc
project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usart
  • hw_flow_control
  • inc
project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usart
  • hw_flow_control
  • inc
project/at_start_f415/examples/usart/hw_flow_control/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usart
  • hw_flow_control
  • src
project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usart
  • hw_flow_control
  • src
project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usart
  • hw_flow_control
  • src
project/at_start_f415/examples/usart/hw_flow_control/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define BUFFER_SIZE 16
39
40uint8_t rx_buffer[BUFFER_SIZE];
41uint8_t data_count;
42
48void usart_configuration(void)
49{
50 gpio_init_type gpio_init_struct;
51
52 /* enable the usart2 and gpio clock */
53 crm_periph_clock_enable(CRM_USART2_PERIPH_CLOCK, TRUE);
54 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
55
56 gpio_default_para_init(&gpio_init_struct);
57
58 /* configure the usart2 tx and rts pin */
59 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
60 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
61 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
62 gpio_init_struct.gpio_pins = GPIO_PINS_1 | GPIO_PINS_2;
63 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
64 gpio_init(GPIOA, &gpio_init_struct);
65
66 /* configure the usart2 rx and cts pin */
67 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
68 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
69 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
70 gpio_init_struct.gpio_pins = GPIO_PINS_0 | GPIO_PINS_3;
71 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
72 gpio_init(GPIOA, &gpio_init_struct);
73
74 /* configure usart2 param */
75 usart_init(USART2, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
76 usart_hardware_flow_control_set(USART2, USART_HARDWARE_FLOW_RTS_CTS);
77 usart_transmitter_enable(USART2, TRUE);
78 usart_receiver_enable(USART2, TRUE);
79 usart_enable(USART2, TRUE);
80}
81
87int main(void)
88{
89 system_clock_config();
90 at32_board_init();
91 usart_configuration();
92
93 /* receive a string (BUFFER_SIZE bytes) from the hyperterminal */
94 data_count = BUFFER_SIZE;
95 while(data_count)
96 {
97 while(usart_flag_get(USART2, USART_RDBF_FLAG) == RESET);
98 rx_buffer[BUFFER_SIZE-data_count] = usart_data_receive(USART2);
99 data_count--;
100 }
101
102 /* send a buffer from usart to hyperterminal */
103 data_count = BUFFER_SIZE;
104 while(data_count)
105 {
106 while(usart_flag_get(USART2, USART_TDBE_FLAG) == RESET);
107 usart_data_transmit(USART2, rx_buffer[BUFFER_SIZE-data_count]);
108 data_count--;
109 }
110
111 while(1)
112 {
113 at32_led_toggle(LED2);
114 at32_led_toggle(LED3);
115 at32_led_toggle(LED4);
116 delay_sec(1);
117 }
118}
119
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
rx_buffer
uint8_t rx_buffer[16]
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/main.c:40
usart_configuration
void usart_configuration(void)
config usart
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/main.c:48
BUFFER_SIZE
#define BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/main.c:38
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/main.c:87
data_count
uint8_t data_count
Definition: project/at_start_f415/examples/usart/hw_flow_control/src/main.c:41
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_USART2_PERIPH_CLOCK
@ CRM_USART2_PERIPH_CLOCK
Definition: at32f415_crm.h:130
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_0
#define GPIO_PINS_0
Definition: at32f415_gpio.h:51
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIO_PINS_1
#define GPIO_PINS_1
Definition: at32f415_gpio.h:52
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_hardware_flow_control_set
void usart_hardware_flow_control_set(usart_type *usart_x, usart_hardware_flow_control_type flow_state)
configure the usart's hardware flow control.
Definition: at32f415_usart.c:516
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
USART_HARDWARE_FLOW_RTS_CTS
@ USART_HARDWARE_FLOW_RTS_CTS
Definition: at32f415_usart.h:172
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_TDBE_FLAG
#define USART_TDBE_FLAG
Definition: at32f415_usart.h:59
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART2
#define USART2
Definition: at32f415_usart.h:320
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usart
  • idle_detection
  • inc
project/at_start_f415/examples/usart/idle_detection/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usart
  • idle_detection
  • inc
project/at_start_f415/examples/usart/idle_detection/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usart
  • idle_detection
  • inc
project/at_start_f415/examples/usart/idle_detection/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usart
  • idle_detection
  • src
project/at_start_f415/examples/usart/idle_detection/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usart/idle_detection/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usart
  • idle_detection
  • src
project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
141void USART2_IRQHandler(void)
142{
143 if(usart_flag_get(USART2, USART_IDLEF_FLAG))
144 {
145 usart_data_receive(USART2);
146 at32_led_on(LED2);
147 at32_led_on(LED3);
148 at32_led_on(LED4);
149 }
150}
151
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
USART2_IRQHandler
void USART2_IRQHandler(void)
this function handles usart2 handler.
Definition: project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c:141
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usart/idle_detection/src/at32f415_int.c:114
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
USART_IDLEF_FLAG
#define USART_IDLEF_FLAG
Definition: at32f415_usart.h:56
USART2
#define USART2
Definition: at32f415_usart.h:320
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usart
  • idle_detection
  • src
project/at_start_f415/examples/usart/idle_detection/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
43void usart_configuration(void)
44{
45 gpio_init_type gpio_init_struct;
46
47 /* enable the usart2 and gpio clock */
48 crm_periph_clock_enable(CRM_USART2_PERIPH_CLOCK, TRUE);
49 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
50
51 gpio_default_para_init(&gpio_init_struct);
52
53 /* configure the usart2 tx pin */
54 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
55 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
56 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
57 gpio_init_struct.gpio_pins = GPIO_PINS_2;
58 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
59 gpio_init(GPIOA, &gpio_init_struct);
60
61 /* configure the usart2 rx pin */
62 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
63 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
64 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
65 gpio_init_struct.gpio_pins = GPIO_PINS_3;
66 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
67 gpio_init(GPIOA, &gpio_init_struct);
68
69 /* config usart nvic interrupt */
70 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
71 nvic_irq_enable(USART2_IRQn, 0, 0);
72
73 /* configure usart2 param */
74 usart_init(USART2, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
75 usart_transmitter_enable(USART2, TRUE);
76 usart_receiver_enable(USART2, TRUE);
77 usart_interrupt_enable(USART2, USART_IDLE_INT, TRUE);
78 usart_enable(USART2, TRUE);
79}
80
86int main(void)
87{
88 system_clock_config();
89 at32_board_init();
90 at32_led_off(LED2);
91 at32_led_off(LED3);
92 at32_led_off(LED4);
93 usart_configuration();
94
95 /* transmit a data */
96 while(usart_flag_get(USART2, USART_TDBE_FLAG) == RESET);
97 usart_data_transmit(USART2, 0x55);
98
99 /* receive a data from the tx pin */
100 while(usart_flag_get(USART2, USART_RDBF_FLAG) == RESET);
101 usart_data_receive(USART2);
102
103 while(1)
104 {
105 }
106}
107
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
usart_configuration
void usart_configuration(void)
config usart
Definition: project/at_start_f415/examples/usart/idle_detection/src/main.c:43
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usart/idle_detection/src/main.c:86
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_USART2_PERIPH_CLOCK
@ CRM_USART2_PERIPH_CLOCK
Definition: at32f415_crm.h:130
USART2_IRQn
@ USART2_IRQn
Definition: at32f415.h:174
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_interrupt_enable
void usart_interrupt_enable(usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts.
Definition: at32f415_usart.c:257
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_TDBE_FLAG
#define USART_TDBE_FLAG
Definition: at32f415_usart.h:59
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART_IDLE_INT
#define USART_IDLE_INT
Definition: at32f415_usart.h:72
USART2
#define USART2
Definition: at32f415_usart.h:320
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usart
  • interrupt
  • inc
project/at_start_f415/examples/usart/interrupt/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usart
  • interrupt
  • inc
project/at_start_f415/examples/usart/interrupt/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usart
  • interrupt
  • inc
project/at_start_f415/examples/usart/interrupt/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usart
  • interrupt
  • src
project/at_start_f415/examples/usart/interrupt/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usart/interrupt/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usart
  • interrupt
  • src
project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
30extern uint8_t usart2_tx_buffer[];
31extern uint8_t usart3_tx_buffer[];
32extern uint8_t usart2_rx_buffer[];
33extern uint8_t usart3_rx_buffer[];
34extern uint8_t usart2_tx_counter;
35extern uint8_t usart3_tx_counter;
36extern uint8_t usart2_rx_counter;
37extern uint8_t usart3_rx_counter;
38extern uint8_t usart2_tx_buffer_size;
39extern uint8_t usart3_tx_buffer_size;
40
54void NMI_Handler(void)
55{
56}
57
63void HardFault_Handler(void)
64{
65 /* go to infinite loop when hard fault exception occurs */
66 while(1)
67 {
68 }
69}
70
76void MemManage_Handler(void)
77{
78 /* go to infinite loop when memory manage exception occurs */
79 while(1)
80 {
81 }
82}
83
89void BusFault_Handler(void)
90{
91 /* go to infinite loop when bus fault exception occurs */
92 while(1)
93 {
94 }
95}
96
102void UsageFault_Handler(void)
103{
104 /* go to infinite loop when usage fault exception occurs */
105 while(1)
106 {
107 }
108}
109
115void SVC_Handler(void)
116{
117}
118
124void DebugMon_Handler(void)
125{
126}
127
133void PendSV_Handler(void)
134{
135}
136
142void SysTick_Handler(void)
143{
144}
145
151void USART2_IRQHandler(void)
152{
153 if(usart_flag_get(USART2, USART_RDBF_FLAG) != RESET)
154 {
155 /* read one byte from the receive data register */
156 usart2_rx_buffer[usart2_rx_counter++] = usart_data_receive(USART2);
157
158 if(usart2_rx_counter == usart3_tx_buffer_size)
159 {
160 /* disable the usart2 receive interrupt */
161 usart_interrupt_enable(USART2, USART_RDBF_INT, FALSE);
162 }
163 }
164
165 if(usart_flag_get(USART2, USART_TDBE_FLAG) != RESET)
166 {
167 /* write one byte to the transmit data register */
168 usart_data_transmit(USART2, usart2_tx_buffer[usart2_tx_counter++]);
169
170 if(usart2_tx_counter == usart2_tx_buffer_size)
171 {
172 /* disable the usart2 transmit interrupt */
173 usart_interrupt_enable(USART2, USART_TDBE_INT, FALSE);
174 }
175 }
176}
177
183void USART3_IRQHandler(void)
184{
185 if(usart_flag_get(USART3, USART_RDBF_FLAG) != RESET)
186 {
187 /* read one byte from the receive data register */
188 usart3_rx_buffer[usart3_rx_counter++] = usart_data_receive(USART3);
189
190 if(usart3_rx_counter == usart2_tx_buffer_size)
191 {
192 /* disable the usart3 receive interrupt */
193 usart_interrupt_enable(USART3, USART_RDBF_INT, FALSE);
194 }
195 }
196
197 if(usart_flag_get(USART3, USART_TDBE_FLAG) != RESET)
198 {
199 /* write one byte to the transmit data register */
200 usart_data_transmit(USART3, usart3_tx_buffer[usart3_tx_counter++]);
201
202 if(usart3_tx_counter == usart3_tx_buffer_size)
203 {
204 /* disable the usart3 transmit interrupt */
205 usart_interrupt_enable(USART3, USART_TDBE_INT, FALSE);
206 }
207 }
208}
209
usart3_rx_buffer
uint8_t usart3_rx_buffer[]
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:45
usart2_tx_buffer
uint8_t usart2_tx_buffer[]
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:42
usart3_tx_buffer
uint8_t usart3_tx_buffer[]
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:43
usart2_rx_buffer
uint8_t usart2_rx_buffer[]
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:44
USART2_IRQHandler
void USART2_IRQHandler(void)
this function handles usart2 handler.
Definition: project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c:151
USART3_IRQHandler
void USART3_IRQHandler(void)
this function handles usart3 handler.
Definition: project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c:183
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c:102
usart3_rx_counter
uint8_t usart3_rx_counter
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:49
usart2_rx_counter
uint8_t usart2_rx_counter
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:48
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c:63
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c:76
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c:115
usart2_tx_counter
uint8_t usart2_tx_counter
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:46
usart3_tx_counter
uint8_t usart3_tx_counter
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:47
usart2_tx_buffer_size
uint8_t usart2_tx_buffer_size
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:50
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c:133
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c:54
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c:89
usart3_tx_buffer_size
uint8_t usart3_tx_buffer_size
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:51
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c:142
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usart/interrupt/src/at32f415_int.c:124
FALSE
@ FALSE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_interrupt_enable
void usart_interrupt_enable(usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts.
Definition: at32f415_usart.c:257
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
USART_TDBE_FLAG
#define USART_TDBE_FLAG
Definition: at32f415_usart.h:59
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART_RDBF_INT
#define USART_RDBF_INT
Definition: at32f415_usart.h:73
USART_TDBE_INT
#define USART_TDBE_INT
Definition: at32f415_usart.h:75
USART3
#define USART3
Definition: at32f415_usart.h:321
USART2
#define USART2
Definition: at32f415_usart.h:320
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usart
  • interrupt
  • src
project/at_start_f415/examples/usart/interrupt/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define COUNTOF(a) (sizeof(a) / sizeof(*(a)))
39#define USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
40#define USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)
41
42uint8_t usart2_tx_buffer[] = "usart transfer by interrupt: usart2 -> usart3 using interrupt";
43uint8_t usart3_tx_buffer[] = "usart transfer by interrupt: usart3 -> usart2 using interrupt";
44uint8_t usart2_rx_buffer[USART3_TX_BUFFER_SIZE];
45uint8_t usart3_rx_buffer[USART2_TX_BUFFER_SIZE];
46volatile uint8_t usart2_tx_counter = 0x00;
47volatile uint8_t usart3_tx_counter = 0x00;
48volatile uint8_t usart2_rx_counter = 0x00;
49volatile uint8_t usart3_rx_counter = 0x00;
50uint8_t usart2_tx_buffer_size = USART2_TX_BUFFER_SIZE;
51uint8_t usart3_tx_buffer_size = USART3_TX_BUFFER_SIZE;
52
58void usart_configuration(void)
59{
60 gpio_init_type gpio_init_struct;
61
62 /* enable the usart2 and gpio clock */
63 crm_periph_clock_enable(CRM_USART2_PERIPH_CLOCK, TRUE);
64 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
65
66 /* enable the usart3 and gpio clock */
67 crm_periph_clock_enable(CRM_USART3_PERIPH_CLOCK, TRUE);
68 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
69
70 gpio_default_para_init(&gpio_init_struct);
71
72 /* configure the usart2 tx pin */
73 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
74 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
75 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
76 gpio_init_struct.gpio_pins = GPIO_PINS_2;
77 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
78 gpio_init(GPIOA, &gpio_init_struct);
79
80 /* configure the usart3 tx pin */
81 gpio_init_struct.gpio_pins = GPIO_PINS_10;
82 gpio_init(GPIOB, &gpio_init_struct);
83
84 /* configure the usart2 rx pin */
85 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
86 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
87 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
88 gpio_init_struct.gpio_pins = GPIO_PINS_3;
89 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
90 gpio_init(GPIOA, &gpio_init_struct);
91
92 /* configure the usart3 rx pin */
93 gpio_init_struct.gpio_pins = GPIO_PINS_11;
94 gpio_init(GPIOB, &gpio_init_struct);
95
96 /* config usart nvic interrupt */
97 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
98 nvic_irq_enable(USART2_IRQn, 0, 0);
99 nvic_irq_enable(USART3_IRQn, 0, 0);
100
101 /* configure usart2 param */
102 usart_init(USART2, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
103 usart_transmitter_enable(USART2, TRUE);
104 usart_receiver_enable(USART2, TRUE);
105
106 /* configure usart3 param */
107 usart_init(USART3, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
108 usart_transmitter_enable(USART3, TRUE);
109 usart_receiver_enable(USART3, TRUE);
110
111 /* enable usart2 and usart3 interrupt */
112 usart_interrupt_enable(USART2, USART_RDBF_INT, TRUE);
113 usart_enable(USART2, TRUE);
114
115 usart_interrupt_enable(USART3, USART_RDBF_INT, TRUE);
116 usart_enable(USART3, TRUE);
117
118 usart_interrupt_enable(USART2, USART_TDBE_INT, TRUE);
119 usart_interrupt_enable(USART3, USART_TDBE_INT, TRUE);
120}
121
129uint8_t buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length)
130{
131 while(buffer_length--)
132 {
133 if(*pbuffer1 != *pbuffer2)
134 {
135 return 0;
136 }
137 pbuffer1++;
138 pbuffer2++;
139 }
140 return 1;
141}
142
148int main(void)
149{
150 system_clock_config();
151 at32_board_init();
152 usart_configuration();
153
154 /* wait until end of transmission from usart2 to usart3 */
155 while(usart3_rx_counter < usart2_tx_buffer_size);
156
157 /* wait until end of transmission from usart3 to usart2 */
158 while(usart2_rx_counter < usart3_tx_buffer_size);
159
160 while(1)
161 {
162 /* compare data buffer */
163 if(buffer_compare(usart2_tx_buffer, usart3_rx_buffer, USART2_TX_BUFFER_SIZE) && \
164 buffer_compare(usart3_tx_buffer, usart2_rx_buffer, USART3_TX_BUFFER_SIZE))
165 {
166 at32_led_toggle(LED2);
167 at32_led_toggle(LED3);
168 at32_led_toggle(LED4);
169 delay_sec(1);
170 }
171 }
172}
173
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
usart_configuration
void usart_configuration(void)
config usart
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:58
buffer_compare
uint8_t buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers.
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:129
usart3_rx_counter
volatile uint8_t usart3_rx_counter
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:49
usart2_rx_counter
volatile uint8_t usart2_rx_counter
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:48
usart2_tx_counter
volatile uint8_t usart2_tx_counter
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:46
usart3_tx_counter
volatile uint8_t usart3_tx_counter
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:47
usart2_tx_buffer_size
uint8_t usart2_tx_buffer_size
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:50
usart3_rx_buffer
uint8_t usart3_rx_buffer[((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:45
USART2_TX_BUFFER_SIZE
#define USART2_TX_BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:39
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:148
usart3_tx_buffer_size
uint8_t usart3_tx_buffer_size
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:51
usart2_tx_buffer
uint8_t usart2_tx_buffer[]
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:42
USART3_TX_BUFFER_SIZE
#define USART3_TX_BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:40
usart3_tx_buffer
uint8_t usart3_tx_buffer[]
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:43
usart2_rx_buffer
uint8_t usart2_rx_buffer[((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
Definition: project/at_start_f415/examples/usart/interrupt/src/main.c:44
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_USART3_PERIPH_CLOCK
@ CRM_USART3_PERIPH_CLOCK
Definition: at32f415_crm.h:131
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_USART2_PERIPH_CLOCK
@ CRM_USART2_PERIPH_CLOCK
Definition: at32f415_crm.h:130
USART2_IRQn
@ USART2_IRQn
Definition: at32f415.h:174
USART3_IRQn
@ USART3_IRQn
Definition: at32f415.h:175
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_11
#define GPIO_PINS_11
Definition: at32f415_gpio.h:62
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_interrupt_enable
void usart_interrupt_enable(usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts.
Definition: at32f415_usart.c:257
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_RDBF_INT
#define USART_RDBF_INT
Definition: at32f415_usart.h:73
USART_TDBE_INT
#define USART_TDBE_INT
Definition: at32f415_usart.h:75
USART3
#define USART3
Definition: at32f415_usart.h:321
USART2
#define USART2
Definition: at32f415_usart.h:320
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usart
  • irda
  • inc
project/at_start_f415/examples/usart/irda/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usart
  • irda
  • inc
project/at_start_f415/examples/usart/irda/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usart
  • irda
  • inc
project/at_start_f415/examples/usart/irda/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usart
  • irda
  • src
project/at_start_f415/examples/usart/irda/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usart/irda/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usart
  • irda
  • src
project/at_start_f415/examples/usart/irda/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usart/irda/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usart/irda/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usart/irda/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usart/irda/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usart/irda/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usart/irda/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usart/irda/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usart/irda/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usart/irda/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usart
  • irda
  • src
project/at_start_f415/examples/usart/irda/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
43void usart_configuration(void)
44{
45 gpio_init_type gpio_init_struct;
46
47 /* enable the usart2 and gpio clock */
48 crm_periph_clock_enable(CRM_USART2_PERIPH_CLOCK, TRUE);
49 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
50
51 gpio_default_para_init(&gpio_init_struct);
52
53 /* configure the usart2 tx pin */
54 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
55 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
56 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
57 gpio_init_struct.gpio_pins = GPIO_PINS_2;
58 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
59 gpio_init(GPIOA, &gpio_init_struct);
60
61 /* configure the usart2 rx pin */
62 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
63 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
64 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
65 gpio_init_struct.gpio_pins = GPIO_PINS_3;
66 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
67 gpio_init(GPIOA, &gpio_init_struct);
68
69 /* configure usart2 param */
70 usart_init(USART2, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
71 usart_transmitter_enable(USART2, TRUE);
72 usart_receiver_enable(USART2, TRUE);
73 usart_irda_smartcard_division_set(USART2, 0x01);
74 usart_irda_mode_enable(USART2, TRUE);
75 usart_enable(USART2, TRUE);
76}
77
83int main(void)
84{
85 system_clock_config();
86 at32_board_init();
87 at32_led_off(LED2);
88 at32_led_off(LED3);
89 at32_led_off(LED4);
90 usart_configuration();
91
92#if defined(TRANSMIT)
93 while(usart_flag_get(USART2, USART_TDBE_FLAG) == RESET);
94 usart_data_transmit(USART2, 0x55);
95 at32_led_on(LED4);
96#endif
97
98#if defined(RECEIVE)
99 while(usart_flag_get(USART2, USART_RDBF_FLAG) == RESET);
100 if(usart_data_receive(USART2) == 0x55)
101 {
102 at32_led_on(LED4);
103 }
104#endif
105
106 while(1)
107 {
108 }
109}
110
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
usart_configuration
void usart_configuration(void)
config usart
Definition: project/at_start_f415/examples/usart/irda/src/main.c:43
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usart/irda/src/main.c:83
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_USART2_PERIPH_CLOCK
@ CRM_USART2_PERIPH_CLOCK
Definition: at32f415_crm.h:130
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_irda_smartcard_division_set
void usart_irda_smartcard_division_set(usart_type *usart_x, uint8_t div_val)
config the irda/smartcard division.
Definition: at32f415_usart.c:426
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_irda_mode_enable
void usart_irda_mode_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart's irda interface.
Definition: at32f415_usart.c:484
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_TDBE_FLAG
#define USART_TDBE_FLAG
Definition: at32f415_usart.h:59
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART2
#define USART2
Definition: at32f415_usart.h:320
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usart
  • polling
  • inc
project/at_start_f415/examples/usart/polling/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usart
  • polling
  • inc
project/at_start_f415/examples/usart/polling/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usart
  • polling
  • inc
project/at_start_f415/examples/usart/polling/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usart
  • polling
  • src
project/at_start_f415/examples/usart/polling/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usart/polling/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usart
  • polling
  • src
project/at_start_f415/examples/usart/polling/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usart/polling/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usart/polling/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usart/polling/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usart/polling/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usart/polling/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usart/polling/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usart/polling/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usart/polling/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usart/polling/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usart
  • polling
  • src
project/at_start_f415/examples/usart/polling/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define COUNTOF(a) (sizeof(a) / sizeof(*(a)))
39#define USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
40#define USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)
41
42uint8_t usart2_tx_buffer[] = "usart transfer by interrupt: usart2 -> usart3 using interrupt";
43uint8_t usart3_tx_buffer[] = "usart transfer by interrupt: usart3 -> usart2 using interrupt";
44uint8_t usart2_rx_buffer[USART3_TX_BUFFER_SIZE];
45uint8_t usart3_rx_buffer[USART2_TX_BUFFER_SIZE];
46uint8_t usart2_tx_counter = 0x00;
47uint8_t usart3_tx_counter = 0x00;
48uint8_t usart2_rx_counter = 0x00;
49uint8_t usart3_rx_counter = 0x00;
50uint8_t usart2_tx_buffer_size = USART2_TX_BUFFER_SIZE;
51uint8_t usart3_tx_buffer_size = USART3_TX_BUFFER_SIZE;
52
58void usart_configuration(void)
59{
60 gpio_init_type gpio_init_struct;
61
62 /* enable the usart2 and gpio clock */
63 crm_periph_clock_enable(CRM_USART2_PERIPH_CLOCK, TRUE);
64 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
65
66 /* enable the usart3 and gpio clock */
67 crm_periph_clock_enable(CRM_USART3_PERIPH_CLOCK, TRUE);
68 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
69
70 gpio_default_para_init(&gpio_init_struct);
71
72 /* configure the usart2 tx pin */
73 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
74 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
75 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
76 gpio_init_struct.gpio_pins = GPIO_PINS_2;
77 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
78 gpio_init(GPIOA, &gpio_init_struct);
79
80 /* configure the usart3 tx pin */
81 gpio_init_struct.gpio_pins = GPIO_PINS_10;
82 gpio_init(GPIOB, &gpio_init_struct);
83
84 /* configure the usart2 rx pin */
85 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
86 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
87 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
88 gpio_init_struct.gpio_pins = GPIO_PINS_3;
89 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
90 gpio_init(GPIOA, &gpio_init_struct);
91
92 /* configure the usart3 rx pin */
93 gpio_init_struct.gpio_pins = GPIO_PINS_11;
94 gpio_init(GPIOB, &gpio_init_struct);
95
96 /* configure usart2 param */
97 usart_init(USART2, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
98 usart_parity_selection_config(USART2, USART_PARITY_NONE);
99 usart_transmitter_enable(USART2, TRUE);
100 usart_receiver_enable(USART2, TRUE);
101 usart_enable(USART2, TRUE);
102
103 /* configure usart3 param */
104 usart_init(USART3, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
105 usart_parity_selection_config(USART3, USART_PARITY_NONE);
106 usart_transmitter_enable(USART3, TRUE);
107 usart_receiver_enable(USART3, TRUE);
108 usart_enable(USART3, TRUE);
109}
110
118uint8_t buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length)
119{
120 while(buffer_length--)
121 {
122 if(*pbuffer1 != *pbuffer2)
123 {
124 return 0;
125 }
126 pbuffer1++;
127 pbuffer2++;
128 }
129 return 1;
130}
131
137int main(void)
138{
139 system_clock_config();
140 at32_board_init();
141 usart_configuration();
142
143 /* wait until end of transmission from usart2 to usart3 */
144 while(usart3_rx_counter < usart2_tx_buffer_size)
145 {
146 while(usart_flag_get(USART2, USART_TDBE_FLAG) == RESET);
147 usart_data_transmit(USART2, usart2_tx_buffer[usart2_tx_counter++]);
148
149 while(usart_flag_get(USART3, USART_RDBF_FLAG) == RESET);
150 usart3_rx_buffer[usart3_rx_counter++] = usart_data_receive(USART3);
151 }
152
153 /* wait until end of transmission from usart3 to usart2 */
154 while(usart2_rx_counter < usart3_tx_buffer_size)
155 {
156 while(usart_flag_get(USART3, USART_TDBE_FLAG) == RESET);
157 usart_data_transmit(USART3, usart3_tx_buffer[usart3_tx_counter++]);
158
159 while(usart_flag_get(USART2, USART_RDBF_FLAG) == RESET);
160 usart2_rx_buffer[usart2_rx_counter++] = usart_data_receive(USART2);
161 }
162
163 while(1)
164 {
165 /* compare data buffer */
166 if(buffer_compare(usart2_tx_buffer, usart3_rx_buffer, USART2_TX_BUFFER_SIZE) && \
167 buffer_compare(usart3_tx_buffer, usart2_rx_buffer, USART3_TX_BUFFER_SIZE))
168 {
169 at32_led_toggle(LED2);
170 at32_led_toggle(LED3);
171 at32_led_toggle(LED4);
172 delay_sec(1);
173 }
174 }
175}
176
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
usart_configuration
void usart_configuration(void)
config usart
Definition: project/at_start_f415/examples/usart/polling/src/main.c:58
buffer_compare
uint8_t buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers.
Definition: project/at_start_f415/examples/usart/polling/src/main.c:118
usart3_tx_counter
uint8_t usart3_tx_counter
Definition: project/at_start_f415/examples/usart/polling/src/main.c:47
usart2_tx_counter
uint8_t usart2_tx_counter
Definition: project/at_start_f415/examples/usart/polling/src/main.c:46
usart2_tx_buffer_size
uint8_t usart2_tx_buffer_size
Definition: project/at_start_f415/examples/usart/polling/src/main.c:50
usart3_rx_buffer
uint8_t usart3_rx_buffer[((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
Definition: project/at_start_f415/examples/usart/polling/src/main.c:45
usart2_rx_counter
uint8_t usart2_rx_counter
Definition: project/at_start_f415/examples/usart/polling/src/main.c:48
USART2_TX_BUFFER_SIZE
#define USART2_TX_BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/polling/src/main.c:39
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usart/polling/src/main.c:137
usart3_tx_buffer_size
uint8_t usart3_tx_buffer_size
Definition: project/at_start_f415/examples/usart/polling/src/main.c:51
usart2_tx_buffer
uint8_t usart2_tx_buffer[]
Definition: project/at_start_f415/examples/usart/polling/src/main.c:42
USART3_TX_BUFFER_SIZE
#define USART3_TX_BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/polling/src/main.c:40
usart3_tx_buffer
uint8_t usart3_tx_buffer[]
Definition: project/at_start_f415/examples/usart/polling/src/main.c:43
usart3_rx_counter
uint8_t usart3_rx_counter
Definition: project/at_start_f415/examples/usart/polling/src/main.c:49
usart2_rx_buffer
uint8_t usart2_rx_buffer[((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
Definition: project/at_start_f415/examples/usart/polling/src/main.c:44
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_USART3_PERIPH_CLOCK
@ CRM_USART3_PERIPH_CLOCK
Definition: at32f415_crm.h:131
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_USART2_PERIPH_CLOCK
@ CRM_USART2_PERIPH_CLOCK
Definition: at32f415_crm.h:130
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_11
#define GPIO_PINS_11
Definition: at32f415_gpio.h:62
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_parity_selection_config
void usart_parity_selection_config(usart_type *usart_x, usart_parity_selection_type parity)
usart parity selection config.
Definition: at32f415_usart.c:138
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_PARITY_NONE
@ USART_PARITY_NONE
Definition: at32f415_usart.h:94
USART_TDBE_FLAG
#define USART_TDBE_FLAG
Definition: at32f415_usart.h:59
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART3
#define USART3
Definition: at32f415_usart.h:321
USART2
#define USART2
Definition: at32f415_usart.h:320
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usart
  • printf
  • inc
project/at_start_f415/examples/usart/printf/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usart
  • printf
  • inc
project/at_start_f415/examples/usart/printf/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usart
  • printf
  • inc
project/at_start_f415/examples/usart/printf/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usart
  • printf
  • src
project/at_start_f415/examples/usart/printf/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usart/printf/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usart
  • printf
  • src
project/at_start_f415/examples/usart/printf/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usart/printf/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usart/printf/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usart/printf/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usart/printf/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usart/printf/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usart/printf/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usart/printf/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usart/printf/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usart/printf/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usart
  • printf
  • src
project/at_start_f415/examples/usart/printf/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38__IO uint32_t time_cnt = 0;
39
45int main(void)
46{
47 system_clock_config();
48 at32_board_init();
49 uart_print_init(115200);
50
51 /* output a message on hyperterminal using printf function */
52 printf("usart printf example: retarget the c library printf function to the usart\r\n");
53
54 while(1)
55 {
56 printf("usart printf counter: %u\r\n",time_cnt++);
57 delay_sec(1);
58 }
59}
60
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usart/printf/src/main.c:45
time_cnt
__IO uint32_t time_cnt
Definition: project/at_start_f415/examples/usart/printf/src/main.c:38
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usart
  • receiver_mute
  • inc
project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usart
  • receiver_mute
  • inc
project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usart
  • receiver_mute
  • inc
project/at_start_f415/examples/usart/receiver_mute/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usart
  • receiver_mute
  • src
project/at_start_f415/examples/usart/receiver_mute/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usart/receiver_mute/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usart
  • receiver_mute
  • src
project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
30extern uint8_t usart3_rx_buffer[];
31extern uint8_t rx_counter;
32
46void NMI_Handler(void)
47{
48}
49
55void HardFault_Handler(void)
56{
57 /* go to infinite loop when hard fault exception occurs */
58 while(1)
59 {
60 }
61}
62
68void MemManage_Handler(void)
69{
70 /* go to infinite loop when memory manage exception occurs */
71 while(1)
72 {
73 }
74}
75
81void BusFault_Handler(void)
82{
83 /* go to infinite loop when bus fault exception occurs */
84 while(1)
85 {
86 }
87}
88
94void UsageFault_Handler(void)
95{
96 /* go to infinite loop when usage fault exception occurs */
97 while(1)
98 {
99 }
100}
101
107void SVC_Handler(void)
108{
109}
110
116void DebugMon_Handler(void)
117{
118}
119
125void PendSV_Handler(void)
126{
127}
128
134void SysTick_Handler(void)
135{
136}
137
143void USART3_IRQHandler(void)
144{
145 if(usart_flag_get(USART3, USART_RDBF_FLAG) != RESET)
146 {
147 usart3_rx_buffer[rx_counter++] = usart_data_receive(USART3);
148 }
149}
150
usart3_rx_buffer
uint8_t usart3_rx_buffer[]
Definition: project/at_start_f415/examples/usart/half_duplex/src/main.c:45
USART3_IRQHandler
void USART3_IRQHandler(void)
this function handles usart3 handler.
Definition: project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c:143
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c:94
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c:55
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c:68
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c:107
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c:125
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c:46
rx_counter
uint8_t rx_counter
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:49
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c:81
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c:134
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usart/receiver_mute/src/at32f415_int.c:116
RESET
@ RESET
Definition: at32f415.h:248
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART3
#define USART3
Definition: at32f415_usart.h:321
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usart
  • receiver_mute
  • src
project/at_start_f415/examples/usart/receiver_mute/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define BUFFER_SIZE 7
39#define MATCH_ID_VAL 0x81
40#define ERROR_ID_VAL 0x82
41#define DATA1_VAL 0x7F
42#define DATA2_VAL 0x7A
43#define DATA3_VAL 0x7B
44#define DATA4_VAL 0x7C
45
46uint8_t usart2_tx_buffer[BUFFER_SIZE] = {DATA1_VAL, MATCH_ID_VAL, DATA2_VAL, ERROR_ID_VAL, DATA3_VAL, MATCH_ID_VAL, DATA4_VAL};
47uint8_t usart3_rx_buffer[BUFFER_SIZE];
48uint8_t tx_counter = 0;
49uint8_t rx_counter = 0;
50
56void usart_configuration(void)
57{
58 gpio_init_type gpio_init_struct;
59
60 /* enable the usart2 and gpio clock */
61 crm_periph_clock_enable(CRM_USART2_PERIPH_CLOCK, TRUE);
62 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
63
64 /* enable the usart3 and gpio clock */
65 crm_periph_clock_enable(CRM_USART3_PERIPH_CLOCK, TRUE);
66 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
67
68 gpio_default_para_init(&gpio_init_struct);
69
70 /* configure the usart2 tx pin */
71 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
72 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
73 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
74 gpio_init_struct.gpio_pins = GPIO_PINS_2;
75 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
76 gpio_init(GPIOA, &gpio_init_struct);
77
78 /* configure the usart3 rx pin */
79 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
80 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
81 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
82 gpio_init_struct.gpio_pins = GPIO_PINS_11;
83 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
84 gpio_init(GPIOB, &gpio_init_struct);
85
86 /* configure usart2 param */
87 usart_init(USART2, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
88 usart_transmitter_enable(USART2, TRUE);
89 usart_enable(USART2, TRUE);
90
91 /* config usart3 nvic interrupt */
92 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
93 nvic_irq_enable(USART3_IRQn, 0 ,0);
94
95 /* configure usart3 param */
96 usart_init(USART3, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
97 usart_receiver_enable(USART3, TRUE);
98 usart_interrupt_enable(USART3, USART_RDBF_INT, TRUE);
99 usart_wakeup_id_set(USART3, 0x01);
100 usart_wakeup_mode_set(USART3, USART_WAKEUP_BY_MATCHING_ID);
101 usart_receiver_mute_enable(USART3, TRUE);
102 usart_enable(USART3, TRUE);
103}
104
110int main(void)
111{
112 system_clock_config();
113 at32_board_init();
114 usart_configuration();
115
116 /* usart2 transmit data */
117 while(tx_counter < BUFFER_SIZE)
118 {
119 while(usart_flag_get(USART2, USART_TDBE_FLAG) == RESET);
120 usart_data_transmit(USART2, usart2_tx_buffer[tx_counter++]);
121 }
122
123 /* wait usart2 data transmission complete */
124 while(usart_flag_get(USART2, USART_TDC_FLAG) == RESET);
125
126 while(1)
127 {
128 if((usart3_rx_buffer[0] == MATCH_ID_VAL) && (usart3_rx_buffer[1] == DATA2_VAL) && \
129 (usart3_rx_buffer[2] == MATCH_ID_VAL) && (usart3_rx_buffer[3] == DATA4_VAL))
130 {
131 at32_led_toggle(LED2);
132 at32_led_toggle(LED3);
133 at32_led_toggle(LED4);
134 delay_sec(1);
135 }
136 }
137}
138
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
DATA4_VAL
#define DATA4_VAL
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:44
usart_configuration
void usart_configuration(void)
config usart
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:56
usart2_tx_buffer
uint8_t usart2_tx_buffer[7]
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:46
ERROR_ID_VAL
#define ERROR_ID_VAL
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:40
tx_counter
uint8_t tx_counter
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:48
BUFFER_SIZE
#define BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:38
rx_counter
uint8_t rx_counter
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:49
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:110
DATA2_VAL
#define DATA2_VAL
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:42
DATA3_VAL
#define DATA3_VAL
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:43
MATCH_ID_VAL
#define MATCH_ID_VAL
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:39
usart3_rx_buffer
uint8_t usart3_rx_buffer[7]
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:47
DATA1_VAL
#define DATA1_VAL
Definition: project/at_start_f415/examples/usart/receiver_mute/src/main.c:41
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_USART3_PERIPH_CLOCK
@ CRM_USART3_PERIPH_CLOCK
Definition: at32f415_crm.h:131
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_USART2_PERIPH_CLOCK
@ CRM_USART2_PERIPH_CLOCK
Definition: at32f415_crm.h:130
USART3_IRQn
@ USART3_IRQn
Definition: at32f415.h:175
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_11
#define GPIO_PINS_11
Definition: at32f415_gpio.h:62
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_wakeup_id_set
void usart_wakeup_id_set(usart_type *usart_x, uint8_t usart_id)
set the wakeup id of the usart.
Definition: at32f415_usart.c:301
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_wakeup_mode_set
void usart_wakeup_mode_set(usart_type *usart_x, usart_wakeup_mode_type wakeup_mode)
select the usart wakeup method in multi-processor communication.
Definition: at32f415_usart.c:317
usart_interrupt_enable
void usart_interrupt_enable(usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts.
Definition: at32f415_usart.c:257
usart_receiver_mute_enable
void usart_receiver_mute_enable(usart_type *usart_x, confirm_state new_state)
config the usart in mute mode in multi-processor communication.
Definition: at32f415_usart.c:331
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_WAKEUP_BY_MATCHING_ID
@ USART_WAKEUP_BY_MATCHING_ID
Definition: at32f415_usart.h:105
USART_TDBE_FLAG
#define USART_TDBE_FLAG
Definition: at32f415_usart.h:59
USART_TDC_FLAG
#define USART_TDC_FLAG
Definition: at32f415_usart.h:58
USART_RDBF_INT
#define USART_RDBF_INT
Definition: at32f415_usart.h:73
USART3
#define USART3
Definition: at32f415_usart.h:321
USART2
#define USART2
Definition: at32f415_usart.h:320
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usart
  • smartcard
  • inc
project/at_start_f415/examples/usart/smartcard/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usart
  • smartcard
  • inc
project/at_start_f415/examples/usart/smartcard/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usart
  • smartcard
  • inc
project/at_start_f415/examples/usart/smartcard/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usart
  • smartcard
  • src
project/at_start_f415/examples/usart/smartcard/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usart/smartcard/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usart
  • smartcard
  • src
project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "smartcard_config.h"
30
31extern uint32_t card_inserted;
32
46void NMI_Handler(void)
47{
48}
49
55void HardFault_Handler(void)
56{
57 /* go to infinite loop when hard fault exception occurs */
58 while(1)
59 {
60 }
61}
62
68void MemManage_Handler(void)
69{
70 /* go to infinite loop when memory manage exception occurs */
71 while(1)
72 {
73 }
74}
75
81void BusFault_Handler(void)
82{
83 /* go to infinite loop when bus fault exception occurs */
84 while(1)
85 {
86 }
87}
88
94void UsageFault_Handler(void)
95{
96 /* go to infinite loop when usage fault exception occurs */
97 while(1)
98 {
99 }
100}
101
107void SVC_Handler(void)
108{
109}
110
116void DebugMon_Handler(void)
117{
118}
119
125void PendSV_Handler(void)
126{
127}
128
134void SysTick_Handler(void)
135{
136}
137
143void EXINT9_5_IRQHandler(void)
144{
145 /* reset smart card cmdvcc */
146 gpio_bits_reset(SC_CMDVCC_PORT, SC_CMDVCC_PIN);
147
148 /* rst low */
149 gpio_bits_reset(SC_RESET_PORT, SC_RESET_PIN);
150
151 /* rst high */
152 gpio_bits_set(SC_RESET_PORT, SC_RESET_PIN);
153
154 /* clear sc exint line pending bit */
155 exint_flag_clear(SC_OFF_EXINT);
156
157 /* smart card detected */
158 card_inserted = 1;
159}
160
166void SC_USART_IRQHandler(void)
167{
168 /* if the sc_usart detects a parity error */
169 if(usart_flag_get(SC_USART, USART_PERR_FLAG) != RESET)
170 {
171 /* enable sc_usart rdbf interrupt (until receiving the corrupted byte) */
172 usart_interrupt_enable(SC_USART, USART_RDBF_INT, TRUE);
173 /* flush the sc_usart dr register */
174 usart_data_receive(SC_USART);
175 }
176
177 if(usart_flag_get(SC_USART, USART_RDBF_FLAG) != RESET)
178 {
179 /* disable sc_usart rdbf interrupt */
180 usart_interrupt_enable(SC_USART, USART_RDBF_INT, FALSE);
181 usart_data_receive(SC_USART);
182 }
183}
184
EXINT9_5_IRQHandler
void EXINT9_5_IRQHandler(void)
this function handles external lines 9 to 5 interrupt request.
Definition: project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c:143
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c:94
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c:55
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c:68
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c:107
SC_USART_IRQHandler
void SC_USART_IRQHandler(void)
this function handles sc_usart global interrupt request.
Definition: project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c:166
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c:125
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c:46
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c:81
card_inserted
uint32_t card_inserted
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:58
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c:134
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usart/smartcard/src/at32f415_int.c:116
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_bits_reset
void gpio_bits_reset(gpio_type *gpio_x, uint16_t pins)
clear the selected data port bits.
Definition: at32f415_gpio.c:341
gpio_bits_set
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins)
set the selected data port bits.
Definition: at32f415_gpio.c:310
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_interrupt_enable
void usart_interrupt_enable(usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts.
Definition: at32f415_usart.c:257
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
USART_PERR_FLAG
#define USART_PERR_FLAG
Definition: at32f415_usart.h:52
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART_RDBF_INT
#define USART_RDBF_INT
Definition: at32f415_usart.h:73
smartcard_config.h
header file of clock program
SC_RESET_PIN
#define SC_RESET_PIN
Definition: smartcard_config.h:48
SC_RESET_PORT
#define SC_RESET_PORT
Definition: smartcard_config.h:52
SC_OFF_EXINT
#define SC_OFF_EXINT
Definition: smartcard_config.h:59
SC_USART
#define SC_USART
Definition: smartcard_config.h:36
SC_CMDVCC_PORT
#define SC_CMDVCC_PORT
Definition: smartcard_config.h:53
SC_CMDVCC_PIN
#define SC_CMDVCC_PIN
Definition: smartcard_config.h:49
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usart
  • smartcard
  • src
project/at_start_f415/examples/usart/smartcard/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "smartcard_config.h"
30
39#define T0_PROTOCOL 0x00 /* t0 protocol */
40#define SETUP_LENGTH 20
41#define HIST_LENGTH 20
42#define SC_RECEIVE_TIMEOUT 0x4000 /* direction to reader */
43
44/* atr structure - answer to reset */
45typedef struct
46{
47 uint8_t ts; /* bit convention */
48 uint8_t t0; /* high nibble = n. of setup byte; low nibble = n. of historical byte */
49 uint8_t t[SETUP_LENGTH]; /* setup array */
50 uint8_t h[HIST_LENGTH]; /* historical array */
51 uint8_t tlength; /* setup array dimension */
52 uint8_t hlength; /* historical array dimension */
53} sc_atr_type;
54
55 sc_atr_type sc_a2r_struct;
56uint32_t counter = 0;
57 error_status atr_decode_status = ERROR;
58uint32_t card_inserted = 0, card_protocol = 1;
59uint8_t dst_buffer[50]= {
60 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
61 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
62 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
63 };
64
70void usart_configuration(void)
71{
72 gpio_init_type gpio_init_struct;
73 exint_init_type exint_init_struct;
74
75 /* enable gpio_3_5v, sc_usart_gpio_clk, gpio_reset, gpio_cmdvcc, gpio_off and iomux clocks */
76 crm_periph_clock_enable(SC_3_5V_CLK, TRUE);
77 crm_periph_clock_enable(SC_USART_GPIO_CLK, TRUE);
78 crm_periph_clock_enable(SC_RESET_CLK, TRUE);
79 crm_periph_clock_enable(SC_CMDVCC_CLK, TRUE);
80 crm_periph_clock_enable(SC_OFF_CLK, TRUE);
81 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
82
83 /* enable sc_usart clocks */
84 crm_periph_clock_enable(SC_USART_CLK, TRUE);
85
86 gpio_default_para_init(&gpio_init_struct);
87 /* configure sc_usart ck pin */
88 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
89 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
90 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
91 gpio_init_struct.gpio_pins = SC_USART_CLK_PIN;
92 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
93 gpio_init(SC_USART_CLK_PORT, &gpio_init_struct);
94
95 /* configure sc_usart tx pin */
96 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
97 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_OPEN_DRAIN;
98 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
99 gpio_init_struct.gpio_pins = SC_USART_TX_PIN;
100 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
101 gpio_init(SC_USART_TX_PORT, &gpio_init_struct);
102
103 /* configure smartcard reset pin */
104 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
105 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
106 gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
107 gpio_init_struct.gpio_pins = SC_RESET_PIN;
108 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
109 gpio_init(SC_RESET_PORT, &gpio_init_struct);
110
111 /* set reset pin high */
112 gpio_bits_set(SC_RESET_PORT, SC_RESET_PIN);
113
114 /* configure smartcard 3/5v pin */
115 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
116 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
117 gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
118 gpio_init_struct.gpio_pins = SC_3_5V_PIN;
119 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
120 gpio_init(SC_3_5V_PORT, &gpio_init_struct);
121
122 /* select 5 v */
123 gpio_bits_set(SC_3_5V_PORT, SC_3_5V_PIN);
124
125 /* configure smartcard cmdvcc pin */
126 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
127 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
128 gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
129 gpio_init_struct.gpio_pins = SC_CMDVCC_PIN;
130 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
131 gpio_init(SC_CMDVCC_PORT, &gpio_init_struct);
132
133 /* set smartcard cmdvcc */
134 gpio_bits_set(SC_CMDVCC_PORT, SC_CMDVCC_PIN);
135
136 /* configure smartcard off pin */
137 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
138 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
139 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
140 gpio_init_struct.gpio_pins = SC_OFF_PIN;
141 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
142 gpio_init(SC_OFF_PORT, &gpio_init_struct);
143
144 /* nvic interrupt init */
145 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
146 NVIC_ClearPendingIRQ(SC_OFF_EXINT_IRQ);
147 nvic_irq_enable(SC_OFF_EXINT_IRQ, 0, 0);
148 nvic_irq_enable(SC_USART_IRQn, 1, 0);
149
150 /* configure smartcard off exint */
151 gpio_exint_line_config(SC_OFF_PORTSOURCE, SC_OFF_PINSOURCE);
152
153 exint_default_para_init(&exint_init_struct);
154 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
155 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
156 exint_init_struct.line_select = SC_OFF_EXINT;
157 exint_init_struct.line_enable = TRUE;
158 exint_init(&exint_init_struct);
159
160 /* clear sc exint line pending bit */
161 exint_flag_clear(SC_OFF_EXINT);
162
163 /* sc_usart clock set to 4mhz (apbclk = 72 mhz / 18) */
164 usart_irda_smartcard_division_set(SC_USART, 9);
165 /* sc_usart guard time set to 2 bit */
166 usart_smartcard_guard_time_set(SC_USART, 0x2);
167
168 /* configure sc usart clk */
169 usart_clock_config(SC_USART, USART_CLOCK_POLARITY_LOW, USART_CLOCK_PHASE_1EDGE, USART_CLOCK_LAST_BIT_OUTPUT);
170 usart_clock_enable(SC_USART, TRUE);
171
172 /* configure sc usart param */
173 usart_init(SC_USART, 12096, USART_DATA_9BITS, USART_STOP_1_5_BIT);
174 usart_parity_selection_config(SC_USART, USART_PARITY_EVEN);
175 usart_transmitter_enable(SC_USART, TRUE);
176 usart_receiver_enable(SC_USART, TRUE);
177
178 /* enable the sc_usart parity error interrupt */
179 usart_interrupt_enable(SC_USART, USART_PERR_INT, TRUE);
180 usart_enable(SC_USART, TRUE);
181
182 /* enable the nack transmission */
183 usart_smartcard_nack_set(SC_USART, TRUE);
184
185 /* enable the smartcard mode */
186 usart_smartcard_mode_enable(SC_USART, TRUE);
187}
188
194uint8_t sc_response_decode(__IO uint8_t *card)
195{
196 uint32_t i = 0, flag = 0, buf = 0, protocol = 0;
197
198 sc_a2r_struct.ts = 0;
199 sc_a2r_struct.t0 = 0;
200 for(i = 0; i < SETUP_LENGTH; i++)
201 {
202 sc_a2r_struct.t[i] = 0;
203 }
204 for(i = 0;i < HIST_LENGTH; i++)
205 {
206 sc_a2r_struct.h[i] = 0;
207 }
208 sc_a2r_struct.tlength = 0;
209 sc_a2r_struct.hlength = 0;
210
211 /* initial character */
212 sc_a2r_struct.ts = card[0];
213
214 /* format character */
215 sc_a2r_struct.t0 = card[1];
216
217 sc_a2r_struct.hlength = sc_a2r_struct.t0 & 0x0F;
218
219 if((sc_a2r_struct.t0 & 0x80) == 0x80) flag = 1;
220
221 for(i = 0; i < 4; i++)
222 {
223 sc_a2r_struct.tlength = sc_a2r_struct.tlength + (((sc_a2r_struct.t0 & 0xF0) >> (4 + i)) & 0x1);
224 }
225
226 for(i = 0; i < sc_a2r_struct.tlength; i++)
227 {
228 sc_a2r_struct.t[i] = card[i + 2];
229 }
230
231 protocol = sc_a2r_struct.t[sc_a2r_struct.tlength - 1] & 0x0F;
232
233 while(flag)
234 {
235 if((sc_a2r_struct.t[sc_a2r_struct.tlength - 1] & 0x80)== 0x80)
236 {
237 flag = 1;
238 }
239 else
240 {
241 flag = 0;
242 }
243 buf = sc_a2r_struct.tlength;
244 sc_a2r_struct.tlength = 0;
245
246 for(i = 0; i < 4; i++)
247 {
248 sc_a2r_struct.tlength = sc_a2r_struct.tlength + (((sc_a2r_struct.t[buf - 1] & 0xF0) >> (4 + i)) & 0x1);
249 }
250 for(i = 0; i < sc_a2r_struct.tlength; i++)
251 {
252 sc_a2r_struct.t[buf + i] = card[i + 2 + buf];
253 }
254 sc_a2r_struct.tlength += buf;
255 }
256
257 for(i = 0;i < sc_a2r_struct.hlength; i++)
258 {
259 sc_a2r_struct.h[i] = card[i + 2 + sc_a2r_struct.tlength];
260 }
261
262 return ((uint8_t)protocol);
263}
264
270int main(void)
271{
272 uint32_t index = 0;
273 system_clock_config();
274 at32_board_init();
275 usart_configuration();
276
277 /* loop while no smartcard is detected */
278 while(card_inserted == 0)
279 {
280 }
281
282 /* read smartcard atr response */
283 for(index = 0; index < 40; index++, counter = 0)
284 {
285 while((usart_flag_get(SC_USART, USART_RDBF_FLAG) == RESET) && (counter != SC_RECEIVE_TIMEOUT))
286 {
287 counter++;
288 }
289
290 if(counter != SC_RECEIVE_TIMEOUT)
291 {
292 dst_buffer[index] = usart_data_receive(SC_USART);
293 }
294 }
295
296 /* decode atr */
297 card_protocol = sc_response_decode(dst_buffer);
298
299 /* test if the inserted card is iso7816-3 t=0 compatible */
300 if(card_protocol == 0)
301 {
302 /* inserted card is iso7816-3 t=0 compatible */
303 atr_decode_status = SUCCESS;
304 }
305 else
306 {
307 /* inserted smartcard is not iso7816-3 t=0 compatible */
308 atr_decode_status = ERROR;
309 }
310
311 /* judge whether the result is correct */
312 if(atr_decode_status == SUCCESS)
313 {
314 /* trun on the led */
315 at32_led_on(LED2);
316 at32_led_on(LED3);
317 at32_led_on(LED4);
318 }
319
320 while(1)
321 {
322 }
323}
324
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
usart_configuration
void usart_configuration(void)
config usart
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:70
sc_response_decode
uint8_t sc_response_decode(__IO uint8_t *card)
decode the card atr response.
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:194
card_protocol
uint32_t card_protocol
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:58
counter
uint32_t counter
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:56
SETUP_LENGTH
#define SETUP_LENGTH
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:40
sc_a2r_struct
sc_atr_type sc_a2r_struct
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:55
atr_decode_status
error_status atr_decode_status
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:57
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:270
card_inserted
uint32_t card_inserted
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:58
dst_buffer
uint8_t dst_buffer[50]
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:59
SC_RECEIVE_TIMEOUT
#define SC_RECEIVE_TIMEOUT
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:42
HIST_LENGTH
#define HIST_LENGTH
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:41
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_bits_set
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins)
set the selected data port bits.
Definition: at32f415_gpio.c:310
gpio_exint_line_config
void gpio_exint_line_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line.
Definition: at32f415_gpio.c:577
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_MODE_OUTPUT
@ GPIO_MODE_OUTPUT
Definition: at32f415_gpio.h:229
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_OPEN_DRAIN
@ GPIO_OUTPUT_OPEN_DRAIN
Definition: at32f415_gpio.h:250
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
usart_clock_enable
void usart_clock_enable(usart_type *usart_x, confirm_state new_state)
usart enable the ck pin.
Definition: at32f415_usart.c:233
usart_smartcard_nack_set
void usart_smartcard_nack_set(usart_type *usart_x, confirm_state new_state)
enable or disable nack transmission in smartcard mode.
Definition: at32f415_usart.c:456
usart_clock_config
void usart_clock_config(usart_type *usart_x, usart_clock_polarity_type clk_pol, usart_clock_phase_type clk_pha, usart_lbcp_type clk_lb)
usart clock config.
Definition: at32f415_usart.c:217
usart_parity_selection_config
void usart_parity_selection_config(usart_type *usart_x, usart_parity_selection_type parity)
usart parity selection config.
Definition: at32f415_usart.c:138
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_irda_smartcard_division_set
void usart_irda_smartcard_division_set(usart_type *usart_x, uint8_t div_val)
config the irda/smartcard division.
Definition: at32f415_usart.c:426
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_smartcard_guard_time_set
void usart_smartcard_guard_time_set(usart_type *usart_x, uint8_t guard_time_val)
config the specified usart smartcard guard time.
Definition: at32f415_usart.c:412
usart_interrupt_enable
void usart_interrupt_enable(usart_type *usart_x, uint32_t usart_int, confirm_state new_state)
enable or disable the specified usart interrupts.
Definition: at32f415_usart.c:257
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
usart_smartcard_mode_enable
void usart_smartcard_mode_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart smart card mode.
Definition: at32f415_usart.c:441
USART_CLOCK_POLARITY_LOW
@ USART_CLOCK_POLARITY_LOW
Definition: at32f415_usart.h:140
USART_STOP_1_5_BIT
@ USART_STOP_1_5_BIT
Definition: at32f415_usart.h:161
USART_DATA_9BITS
@ USART_DATA_9BITS
Definition: at32f415_usart.h:114
USART_PARITY_EVEN
@ USART_PARITY_EVEN
Definition: at32f415_usart.h:95
USART_CLOCK_LAST_BIT_OUTPUT
@ USART_CLOCK_LAST_BIT_OUTPUT
Definition: at32f415_usart.h:150
USART_CLOCK_PHASE_1EDGE
@ USART_CLOCK_PHASE_1EDGE
Definition: at32f415_usart.h:131
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART_PERR_INT
#define USART_PERR_INT
Definition: at32f415_usart.h:76
smartcard_config.h
header file of clock program
SC_RESET_PIN
#define SC_RESET_PIN
Definition: smartcard_config.h:48
SC_USART_TX_PIN
#define SC_USART_TX_PIN
Definition: smartcard_config.h:39
SC_RESET_PORT
#define SC_RESET_PORT
Definition: smartcard_config.h:52
SC_3_5V_PORT
#define SC_3_5V_PORT
Definition: smartcard_config.h:51
SC_RESET_CLK
#define SC_RESET_CLK
Definition: smartcard_config.h:56
SC_USART_CLK_PIN
#define SC_USART_CLK_PIN
Definition: smartcard_config.h:41
SC_OFF_EXINT
#define SC_OFF_EXINT
Definition: smartcard_config.h:59
SC_USART
#define SC_USART
Definition: smartcard_config.h:36
SC_OFF_CLK
#define SC_OFF_CLK
Definition: smartcard_config.h:58
SC_CMDVCC_CLK
#define SC_CMDVCC_CLK
Definition: smartcard_config.h:57
SC_USART_GPIO_CLK
#define SC_USART_GPIO_CLK
Definition: smartcard_config.h:38
SC_3_5V_PIN
#define SC_3_5V_PIN
Definition: smartcard_config.h:47
SC_OFF_PIN
#define SC_OFF_PIN
Definition: smartcard_config.h:50
SC_CMDVCC_PORT
#define SC_CMDVCC_PORT
Definition: smartcard_config.h:53
SC_USART_IRQn
#define SC_USART_IRQn
Definition: smartcard_config.h:43
SC_USART_CLK_PORT
#define SC_USART_CLK_PORT
Definition: smartcard_config.h:42
SC_3_5V_CLK
#define SC_3_5V_CLK
Definition: smartcard_config.h:55
SC_USART_TX_PORT
#define SC_USART_TX_PORT
Definition: smartcard_config.h:40
SC_OFF_PORTSOURCE
#define SC_OFF_PORTSOURCE
Definition: smartcard_config.h:60
SC_OFF_EXINT_IRQ
#define SC_OFF_EXINT_IRQ
Definition: smartcard_config.h:62
SC_USART_CLK
#define SC_USART_CLK
Definition: smartcard_config.h:37
SC_CMDVCC_PIN
#define SC_CMDVCC_PIN
Definition: smartcard_config.h:49
SC_OFF_PORT
#define SC_OFF_PORT
Definition: smartcard_config.h:54
SC_OFF_PINSOURCE
#define SC_OFF_PINSOURCE
Definition: smartcard_config.h:61
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
sc_atr_type
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:46
sc_atr_type::t
uint8_t t[20]
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:49
sc_atr_type::h
uint8_t h[20]
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:50
sc_atr_type::ts
uint8_t ts
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:47
sc_atr_type::tlength
uint8_t tlength
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:51
sc_atr_type::hlength
uint8_t hlength
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:52
sc_atr_type::t0
uint8_t t0
Definition: project/at_start_f415/examples/usart/smartcard/src/main.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usart
  • synchronous
  • inc
project/at_start_f415/examples/usart/synchronous/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usart
  • synchronous
  • inc
project/at_start_f415/examples/usart/synchronous/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usart
  • synchronous
  • inc
project/at_start_f415/examples/usart/synchronous/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usart
  • synchronous
  • src
project/at_start_f415/examples/usart/synchronous/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usart/synchronous/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usart
  • synchronous
  • src
project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usart/synchronous/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usart
  • synchronous
  • src
project/at_start_f415/examples/usart/synchronous/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define COUNTOF(a) (sizeof(a) / sizeof(*(a)))
39#define USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
40#define SPI2_TX_BUFFER_SIZE (COUNTOF(spi2_tx_buffer) - 1)
41#define DYMMY_BYTE 0x00
42
43uint8_t usart2_tx_buffer[] = "usart synchronous example: usart2 -> spi2";
44uint8_t spi2_tx_buffer[] = "usart synchronous example: spi2 -> usart2";
45uint8_t usart2_rx_buffer[SPI2_TX_BUFFER_SIZE];
46uint8_t spi2_rx_buffer[USART2_TX_BUFFER_SIZE];
47uint8_t usart2_tx_counter = 0x00;
48uint8_t spi2_tx_counter = 0x00;
49uint8_t usart2_rx_counter = 0x00;
50uint8_t spi2_rx_counter = 0x00;
51uint8_t usart2_tx_buffer_size = USART2_TX_BUFFER_SIZE;
52uint8_t spi2_tx_buffer_size = SPI2_TX_BUFFER_SIZE;
53
59void usart_spi_configuration(void)
60{
61 gpio_init_type gpio_init_struct;
62 spi_init_type spi_init_struct;
63
64 /* enable the usart2 and gpio clock */
65 crm_periph_clock_enable(CRM_USART2_PERIPH_CLOCK, TRUE);
66 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
67
68 /* enable the spi2 and gpio clock */
69 crm_periph_clock_enable(CRM_SPI2_PERIPH_CLOCK, TRUE);
70 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
71
72 gpio_default_para_init(&gpio_init_struct);
73
74 /* configure the usart2 tx and ck pin */
75 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
76 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
77 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
78 gpio_init_struct.gpio_pins = GPIO_PINS_2 | GPIO_PINS_4;
79 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
80 gpio_init(GPIOA, &gpio_init_struct);
81
82 /* configure the usart2 rx pin */
83 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
84 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
85 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
86 gpio_init_struct.gpio_pins = GPIO_PINS_3;
87 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
88 gpio_init(GPIOA, &gpio_init_struct);
89
90 /* configure the spi2 mosi and ck pin */
91 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
92 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
93 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
94 gpio_init_struct.gpio_pins = GPIO_PINS_15 | GPIO_PINS_13;
95 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
96 gpio_init(GPIOB, &gpio_init_struct);
97
98 /* configure the spi2 miso pin */
99 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
100 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
101 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
102 gpio_init_struct.gpio_pins = GPIO_PINS_14;
103 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
104 gpio_init(GPIOB, &gpio_init_struct);
105
106 /* configure usart2 param */
107 usart_init(USART2, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
108 usart_clock_config(USART2, USART_CLOCK_POLARITY_HIGH, USART_CLOCK_PHASE_2EDGE, USART_CLOCK_LAST_BIT_OUTPUT);
109 usart_clock_enable(USART2, TRUE);
110 usart_transmitter_enable(USART2, TRUE);
111 usart_receiver_enable(USART2, TRUE);
112 usart_enable(USART2, TRUE);
113
114 /* configure spi2 param */
115 spi_default_para_init(&spi_init_struct);
116 spi_init_struct.transmission_mode = SPI_TRANSMIT_FULL_DUPLEX;
117 spi_init_struct.master_slave_mode =SPI_MODE_SLAVE;
118 spi_init_struct.first_bit_transmission = SPI_FIRST_BIT_LSB;
119 spi_init_struct.frame_bit_num = SPI_FRAME_8BIT;
120 spi_init_struct.clock_polarity = SPI_CLOCK_POLARITY_HIGH;
121 spi_init_struct.clock_phase = SPI_CLOCK_PHASE_2EDGE;
122 spi_init_struct.cs_mode_selection = SPI_CS_SOFTWARE_MODE;
123 spi_init(SPI2, &spi_init_struct);
124 spi_enable(SPI2, TRUE);
125}
126
134uint8_t buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length)
135{
136 while(buffer_length--)
137 {
138 if(*pbuffer1 != *pbuffer2)
139 {
140 return 0;
141 }
142 pbuffer1++;
143 pbuffer2++;
144 }
145 return 1;
146}
147
153int main(void)
154{
155 system_clock_config();
156 at32_board_init();
157 usart_spi_configuration();
158
159 /* wait until end of transmission from usart2 to spi2 */
160 while(spi2_rx_counter < usart2_tx_buffer_size)
161 {
162 /* usart transmit data */
163 while(usart_flag_get(USART2, USART_TDBE_FLAG) == RESET);
164 usart_data_transmit(USART2, usart2_tx_buffer[usart2_tx_counter++]);
165
166 /* wait until spi receive data */
167 while(spi_i2s_flag_get(SPI2, SPI_I2S_RDBF_FLAG) == RESET);
168 spi2_rx_buffer[spi2_rx_counter++] = spi_i2s_data_receive(SPI2);
169
170 /* wait until usart receive data, and clear dummy byte in data register */
171 while(usart_flag_get(USART2, USART_RDBF_FLAG) == RESET);
172 usart_data_receive(USART2);
173 }
174
175 /* wait until end of transmission from spi2 to usart2 */
176 while(usart2_rx_counter < spi2_tx_buffer_size)
177 {
178 /* spi put transmit data in data register */
179 while(spi_i2s_flag_get(SPI2, SPI_I2S_TDBE_FLAG) == RESET);
180 spi_i2s_data_transmit(SPI2, spi2_tx_buffer[spi2_tx_counter++]);
181
182 /* usart transmit a dummy byte to generate clock to slave */
183 while(usart_flag_get(USART2, USART_TDBE_FLAG) == RESET);
184 usart_data_transmit(USART2, DYMMY_BYTE);
185
186 /* wait until usart receive data */
187 while(usart_flag_get(USART2, USART_RDBF_FLAG) == RESET);
188 usart2_rx_buffer[usart2_rx_counter++] = usart_data_receive(USART2);
189 }
190
191 while(1)
192 {
193 /* compare data buffer */
194 if(buffer_compare(usart2_tx_buffer, spi2_rx_buffer, USART2_TX_BUFFER_SIZE) && \
195 buffer_compare(spi2_tx_buffer, usart2_rx_buffer, SPI2_TX_BUFFER_SIZE))
196 {
197 at32_led_toggle(LED2);
198 at32_led_toggle(LED3);
199 at32_led_toggle(LED4);
200 delay_sec(1);
201 }
202 }
203}
204
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
spi_init_struct
spi_init_type spi_init_struct
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:40
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
spi2_tx_buffer
uint8_t spi2_tx_buffer[]
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:44
buffer_compare
uint8_t buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers.
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:134
usart2_tx_counter
uint8_t usart2_tx_counter
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:47
usart_spi_configuration
void usart_spi_configuration(void)
config usart and spi
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:59
usart2_rx_buffer
uint8_t usart2_rx_buffer[((sizeof(spi2_tx_buffer)/sizeof(*(spi2_tx_buffer))) - 1)]
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:45
spi2_rx_counter
uint8_t spi2_rx_counter
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:50
SPI2_TX_BUFFER_SIZE
#define SPI2_TX_BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:40
DYMMY_BYTE
#define DYMMY_BYTE
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:41
usart2_tx_buffer_size
uint8_t usart2_tx_buffer_size
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:51
usart2_rx_counter
uint8_t usart2_rx_counter
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:49
USART2_TX_BUFFER_SIZE
#define USART2_TX_BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:39
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:153
spi2_tx_buffer_size
uint8_t spi2_tx_buffer_size
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:52
spi2_rx_buffer
uint8_t spi2_rx_buffer[((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:46
spi2_tx_counter
uint8_t spi2_tx_counter
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:48
usart2_tx_buffer
uint8_t usart2_tx_buffer[]
Definition: project/at_start_f415/examples/usart/synchronous/src/main.c:43
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_SPI2_PERIPH_CLOCK
@ CRM_SPI2_PERIPH_CLOCK
Definition: at32f415_crm.h:129
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_USART2_PERIPH_CLOCK
@ CRM_USART2_PERIPH_CLOCK
Definition: at32f415_crm.h:130
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_13
#define GPIO_PINS_13
Definition: at32f415_gpio.h:64
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIO_PINS_14
#define GPIO_PINS_14
Definition: at32f415_gpio.h:65
GPIO_PINS_4
#define GPIO_PINS_4
Definition: at32f415_gpio.h:55
GPIO_PINS_15
#define GPIO_PINS_15
Definition: at32f415_gpio.h:66
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
SPI_I2S_TDBE_FLAG
#define SPI_I2S_TDBE_FLAG
Definition: at32f415_spi.h:54
SPI_I2S_RDBF_FLAG
#define SPI_I2S_RDBF_FLAG
Definition: at32f415_spi.h:53
spi_i2s_data_transmit
void spi_i2s_data_transmit(spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit
Definition: at32f415_spi.c:514
spi_i2s_flag_get
flag_status spi_i2s_flag_get(spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:548
spi_init
void spi_init(spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value.
Definition: at32f415_spi.c:91
spi_default_para_init
void spi_default_para_init(spi_init_type *spi_init_struct)
spi init config with its default value.
Definition: at32f415_spi.c:71
spi_i2s_data_receive
uint16_t spi_i2s_data_receive(spi_type *spi_x)
spi/i2s data receive
Definition: at32f415_spi.c:526
spi_enable
void spi_enable(spi_type *spi_x, confirm_state new_state)
enable or disable spi.
Definition: at32f415_spi.c:287
SPI_MODE_SLAVE
@ SPI_MODE_SLAVE
Definition: at32f415_spi.h:98
SPI_CLOCK_PHASE_2EDGE
@ SPI_CLOCK_PHASE_2EDGE
Definition: at32f415_spi.h:117
SPI_CS_SOFTWARE_MODE
@ SPI_CS_SOFTWARE_MODE
Definition: at32f415_spi.h:126
SPI_FIRST_BIT_LSB
@ SPI_FIRST_BIT_LSB
Definition: at32f415_spi.h:152
SPI_CLOCK_POLARITY_HIGH
@ SPI_CLOCK_POLARITY_HIGH
Definition: at32f415_spi.h:108
SPI_TRANSMIT_FULL_DUPLEX
@ SPI_TRANSMIT_FULL_DUPLEX
Definition: at32f415_spi.h:160
SPI_FRAME_8BIT
@ SPI_FRAME_8BIT
Definition: at32f415_spi.h:89
SPI2
#define SPI2
Definition: at32f415_spi.h:449
usart_clock_enable
void usart_clock_enable(usart_type *usart_x, confirm_state new_state)
usart enable the ck pin.
Definition: at32f415_usart.c:233
usart_clock_config
void usart_clock_config(usart_type *usart_x, usart_clock_polarity_type clk_pol, usart_clock_phase_type clk_pha, usart_lbcp_type clk_lb)
usart clock config.
Definition: at32f415_usart.c:217
usart_data_transmit
void usart_data_transmit(usart_type *usart_x, uint16_t data)
transmit single data through the usart peripheral.
Definition: at32f415_usart.c:374
usart_flag_get
flag_status usart_flag_get(usart_type *usart_x, uint32_t flag)
check whether the specified usart flag is set or not.
Definition: at32f415_usart.c:559
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_data_receive
uint16_t usart_data_receive(usart_type *usart_x)
return the most recent received data by the usart peripheral.
Definition: at32f415_usart.c:386
USART_CLOCK_POLARITY_HIGH
@ USART_CLOCK_POLARITY_HIGH
Definition: at32f415_usart.h:141
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART_CLOCK_LAST_BIT_OUTPUT
@ USART_CLOCK_LAST_BIT_OUTPUT
Definition: at32f415_usart.h:150
USART_CLOCK_PHASE_2EDGE
@ USART_CLOCK_PHASE_2EDGE
Definition: at32f415_usart.h:132
USART_TDBE_FLAG
#define USART_TDBE_FLAG
Definition: at32f415_usart.h:59
USART_RDBF_FLAG
#define USART_RDBF_FLAG
Definition: at32f415_usart.h:57
USART2
#define USART2
Definition: at32f415_usart.h:320
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
spi_init_type
spi init type
Definition: at32f415_spi.h:257
spi_init_type::master_slave_mode
spi_master_slave_mode_type master_slave_mode
Definition: at32f415_spi.h:259
spi_init_type::first_bit_transmission
spi_first_bit_type first_bit_transmission
Definition: at32f415_spi.h:261
spi_init_type::frame_bit_num
spi_frame_bit_num_type frame_bit_num
Definition: at32f415_spi.h:262
spi_init_type::clock_polarity
spi_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:263
spi_init_type::cs_mode_selection
spi_cs_mode_type cs_mode_selection
Definition: at32f415_spi.h:265
spi_init_type::transmission_mode
spi_transmission_mode_type transmission_mode
Definition: at32f415_spi.h:258
spi_init_type::clock_phase
spi_clock_phase_type clock_phase
Definition: at32f415_spi.h:264
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usart
  • transfer_by_dma_interrupt
  • inc
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usart
  • transfer_by_dma_interrupt
  • inc
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usart
  • transfer_by_dma_interrupt
  • inc
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usart
  • transfer_by_dma_interrupt
  • src
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usart
  • transfer_by_dma_interrupt
  • src
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
30extern uint8_t usart2_tx_dma_status;
31extern uint8_t usart2_rx_dma_status;
32extern uint8_t usart3_tx_dma_status;
33extern uint8_t usart3_rx_dma_status;
34
48void NMI_Handler(void)
49{
50}
51
57void HardFault_Handler(void)
58{
59 /* go to infinite loop when hard fault exception occurs */
60 while(1)
61 {
62 }
63}
64
70void MemManage_Handler(void)
71{
72 /* go to infinite loop when memory manage exception occurs */
73 while(1)
74 {
75 }
76}
77
83void BusFault_Handler(void)
84{
85 /* go to infinite loop when bus fault exception occurs */
86 while(1)
87 {
88 }
89}
90
96void UsageFault_Handler(void)
97{
98 /* go to infinite loop when usage fault exception occurs */
99 while(1)
100 {
101 }
102}
103
109void SVC_Handler(void)
110{
111}
112
118void DebugMon_Handler(void)
119{
120}
121
127void PendSV_Handler(void)
128{
129}
130
136void SysTick_Handler(void)
137{
138}
139
145void DMA1_Channel1_IRQHandler(void)
146{
147 if(dma_flag_get(DMA1_FDT1_FLAG))
148 {
149 usart2_tx_dma_status = 1;
150 dma_flag_clear(DMA1_FDT1_FLAG);
151 dma_channel_enable(DMA1_CHANNEL1, FALSE);
152 }
153}
154
160void DMA1_Channel2_IRQHandler(void)
161{
162 if(dma_flag_get(DMA1_FDT2_FLAG))
163 {
164 usart2_rx_dma_status = 1;
165 dma_flag_clear(DMA1_FDT2_FLAG);
166 dma_channel_enable(DMA1_CHANNEL2, FALSE);
167 }
168}
169
175void DMA1_Channel3_IRQHandler(void)
176{
177 if(dma_flag_get(DMA1_FDT3_FLAG))
178 {
179 usart3_tx_dma_status = 1;
180 dma_flag_clear(DMA1_FDT3_FLAG);
181 dma_channel_enable(DMA1_CHANNEL3, FALSE);
182 }
183}
184
190void DMA1_Channel4_IRQHandler(void)
191{
192 if(dma_flag_get(DMA1_FDT4_FLAG))
193 {
194 usart3_rx_dma_status = 1;
195 dma_flag_clear(DMA1_FDT4_FLAG);
196 dma_channel_enable(DMA1_CHANNEL4, FALSE);
197 }
198}
199
DMA1_Channel2_IRQHandler
void DMA1_Channel2_IRQHandler(void)
this function handles dma1 channel2 handler.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c:160
usart3_tx_dma_status
uint8_t usart3_tx_dma_status
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:48
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c:96
usart2_tx_dma_status
uint8_t usart2_tx_dma_status
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:46
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c:57
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c:70
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c:109
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c:127
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c:48
DMA1_Channel1_IRQHandler
void DMA1_Channel1_IRQHandler(void)
this function handles dma1 channel1 handler.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c:145
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c:83
usart2_rx_dma_status
uint8_t usart2_rx_dma_status
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:47
DMA1_Channel4_IRQHandler
void DMA1_Channel4_IRQHandler(void)
this function handles dma1 channel4 handler.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c:190
usart3_rx_dma_status
uint8_t usart3_rx_dma_status
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:49
DMA1_Channel3_IRQHandler
void DMA1_Channel3_IRQHandler(void)
this function handles dma1 channel3 handler.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c:175
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c:136
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/at32f415_int.c:118
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
DMA1_FDT4_FLAG
#define DMA1_FDT4_FLAG
Definition: at32f415_dma.h:94
DMA1_FDT1_FLAG
#define DMA1_FDT1_FLAG
Definition: at32f415_dma.h:82
DMA1_FDT2_FLAG
#define DMA1_FDT2_FLAG
Definition: at32f415_dma.h:86
DMA1_FDT3_FLAG
#define DMA1_FDT3_FLAG
Definition: at32f415_dma.h:90
DMA1_CHANNEL3
#define DMA1_CHANNEL3
Definition: at32f415_dma.h:475
DMA1_CHANNEL4
#define DMA1_CHANNEL4
Definition: at32f415_dma.h:476
DMA1_CHANNEL1
#define DMA1_CHANNEL1
Definition: at32f415_dma.h:473
DMA1_CHANNEL2
#define DMA1_CHANNEL2
Definition: at32f415_dma.h:474
FALSE
@ FALSE
Definition: at32f415.h:253
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usart
  • transfer_by_dma_interrupt
  • src
project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define COUNTOF(a) (sizeof(a) / sizeof(*(a)))
39#define USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
40#define USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)
41
42uint8_t usart2_tx_buffer[] = "usart transfer by dma interrupt: usart2 -> usart3 using dma";
43uint8_t usart3_tx_buffer[] = "usart transfer by dma interrupt: usart3 -> usart2 using dma";
44uint8_t usart2_rx_buffer[USART3_TX_BUFFER_SIZE];
45uint8_t usart3_rx_buffer[USART2_TX_BUFFER_SIZE];
46volatile uint8_t usart2_tx_dma_status = 0;
47volatile uint8_t usart2_rx_dma_status = 0;
48volatile uint8_t usart3_tx_dma_status = 0;
49volatile uint8_t usart3_rx_dma_status = 0;
50
56void usart_configuration(void)
57{
58 gpio_init_type gpio_init_struct;
59
60 /* enable the usart2 and gpio clock */
61 crm_periph_clock_enable(CRM_USART2_PERIPH_CLOCK, TRUE);
62 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
63
64 /* enable the usart3 and gpio clock */
65 crm_periph_clock_enable(CRM_USART3_PERIPH_CLOCK, TRUE);
66 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
67
68 gpio_default_para_init(&gpio_init_struct);
69 /* configure the usart2 tx pin */
70 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
71 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
72 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
73 gpio_init_struct.gpio_pins = GPIO_PINS_2;
74 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
75 gpio_init(GPIOA, &gpio_init_struct);
76
77 /* configure the usart3 tx pin */
78 gpio_init_struct.gpio_pins = GPIO_PINS_10;
79 gpio_init(GPIOB, &gpio_init_struct);
80
81 /* configure the usart2 rx pin */
82 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
83 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
84 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
85 gpio_init_struct.gpio_pins = GPIO_PINS_3;
86 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
87 gpio_init(GPIOA, &gpio_init_struct);
88
89 /* configure the usart3 rx pin */
90 gpio_init_struct.gpio_pins = GPIO_PINS_11;
91 gpio_init(GPIOB, &gpio_init_struct);
92
93 /* configure usart2 param */
94 usart_init(USART2, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
95 usart_transmitter_enable(USART2, TRUE);
96 usart_receiver_enable(USART2, TRUE);
97 usart_dma_transmitter_enable(USART2, TRUE);
98 usart_dma_receiver_enable(USART2, TRUE);
99 usart_enable(USART2, TRUE);
100
101 /* configure usart3 param */
102 usart_init(USART3, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
103 usart_transmitter_enable(USART3, TRUE);
104 usart_receiver_enable(USART3, TRUE);
105 usart_dma_transmitter_enable(USART3, TRUE);
106 usart_dma_receiver_enable(USART3, TRUE);
107 usart_enable(USART3, TRUE);
108}
109
115void dma_configuration(void)
116{
117 dma_init_type dma_init_struct;
118
119 /* enable dma1 clock */
120 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
121
122 /* dma1 channel1 for usart2 tx configuration */
123 dma_reset(DMA1_CHANNEL1);
124 dma_default_para_init(&dma_init_struct);
125 dma_init_struct.buffer_size = USART2_TX_BUFFER_SIZE;
126 dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
127 dma_init_struct.memory_base_addr = (uint32_t)usart2_tx_buffer;
128 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
129 dma_init_struct.memory_inc_enable = TRUE;
130 dma_init_struct.peripheral_base_addr = (uint32_t)&USART2->dt;
131 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
132 dma_init_struct.peripheral_inc_enable = FALSE;
133 dma_init_struct.priority = DMA_PRIORITY_MEDIUM;
134 dma_init_struct.loop_mode_enable = FALSE;
135 dma_init(DMA1_CHANNEL1, &dma_init_struct);
136
137 /* enable transfer full data intterrupt */
138 dma_interrupt_enable(DMA1_CHANNEL1, DMA_FDT_INT, TRUE);
139
140 /* dma1 channel1 interrupt nvic init */
141 nvic_irq_enable(DMA1_Channel1_IRQn, 0, 0);
142
143 /* config flexible dma for usart2 tx */
144 dma_flexible_config(DMA1, FLEX_CHANNEL1, DMA_FLEXIBLE_UART2_TX);
145
146 /* dma1 channel2 for usart2 rx configuration */
147 dma_reset(DMA1_CHANNEL2);
148 dma_default_para_init(&dma_init_struct);
149 dma_init_struct.buffer_size = USART3_TX_BUFFER_SIZE;
150 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
151 dma_init_struct.memory_base_addr = (uint32_t)usart2_rx_buffer;
152 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
153 dma_init_struct.memory_inc_enable = TRUE;
154 dma_init_struct.peripheral_base_addr = (uint32_t)&USART2->dt;
155 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
156 dma_init_struct.peripheral_inc_enable = FALSE;
157 dma_init_struct.priority = DMA_PRIORITY_MEDIUM;
158 dma_init_struct.loop_mode_enable = FALSE;
159 dma_init(DMA1_CHANNEL2, &dma_init_struct);
160
161 /* enable transfer full data intterrupt */
162 dma_interrupt_enable(DMA1_CHANNEL2, DMA_FDT_INT, TRUE);
163
164 /* dma1 channel2 interrupt nvic init */
165 nvic_irq_enable(DMA1_Channel2_IRQn, 0, 0);
166
167 /* config flexible dma for usart2 rx */
168 dma_flexible_config(DMA1, FLEX_CHANNEL2, DMA_FLEXIBLE_UART2_RX);
169
170 /* dma1 channel3 for usart3 tx configuration */
171 dma_reset(DMA1_CHANNEL3);
172 dma_default_para_init(&dma_init_struct);
173 dma_init_struct.buffer_size = USART3_TX_BUFFER_SIZE;
174 dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
175 dma_init_struct.memory_base_addr = (uint32_t)usart3_tx_buffer;
176 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
177 dma_init_struct.memory_inc_enable = TRUE;
178 dma_init_struct.peripheral_base_addr = (uint32_t)&USART3->dt;
179 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
180 dma_init_struct.peripheral_inc_enable = FALSE;
181 dma_init_struct.priority = DMA_PRIORITY_MEDIUM;
182 dma_init_struct.loop_mode_enable = FALSE;
183 dma_init(DMA1_CHANNEL3, &dma_init_struct);
184
185 /* enable transfer full data intterrupt */
186 dma_interrupt_enable(DMA1_CHANNEL3, DMA_FDT_INT, TRUE);
187
188 /* dma1 channel3 interrupt nvic init */
189 nvic_irq_enable(DMA1_Channel3_IRQn, 0, 0);
190
191 /* config flexible dma for usart3 tx */
192 dma_flexible_config(DMA1, FLEX_CHANNEL3, DMA_FLEXIBLE_UART3_TX);
193
194 /* dma1 channel4 for usart3 rx configuration */
195 dma_reset(DMA1_CHANNEL4);
196 dma_default_para_init(&dma_init_struct);
197 dma_init_struct.buffer_size = USART2_TX_BUFFER_SIZE;
198 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
199 dma_init_struct.memory_base_addr = (uint32_t)usart3_rx_buffer;
200 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
201 dma_init_struct.memory_inc_enable = TRUE;
202 dma_init_struct.peripheral_base_addr = (uint32_t)&USART3->dt;
203 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
204 dma_init_struct.peripheral_inc_enable = FALSE;
205 dma_init_struct.priority = DMA_PRIORITY_MEDIUM;
206 dma_init_struct.loop_mode_enable = FALSE;
207 dma_init(DMA1_CHANNEL4, &dma_init_struct);
208
209 /* enable transfer full data intterrupt */
210 dma_interrupt_enable(DMA1_CHANNEL4, DMA_FDT_INT, TRUE);
211
212 /* dma1 channel4 interrupt nvic init */
213 nvic_irq_enable(DMA1_Channel4_IRQn, 0, 0);
214
215 /* config flexible dma for usart3 rx */
216 dma_flexible_config(DMA1, FLEX_CHANNEL4, DMA_FLEXIBLE_UART3_RX);
217
218 dma_channel_enable(DMA1_CHANNEL2, TRUE); /* usart2 rx begin dma receiving */
219 dma_channel_enable(DMA1_CHANNEL4, TRUE); /* usart3 rx begin dma receiving */
220 dma_channel_enable(DMA1_CHANNEL1, TRUE); /* usart2 tx begin dma transmitting */
221 dma_channel_enable(DMA1_CHANNEL3, TRUE); /* usart3 tx begin dma transmitting */
222}
223
231uint8_t buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length)
232{
233 while(buffer_length--)
234 {
235 if(*pbuffer1 != *pbuffer2)
236 {
237 return 0;
238 }
239 pbuffer1++;
240 pbuffer2++;
241 }
242 return 1;
243}
244
250int main(void)
251{
252 system_clock_config();
253 at32_board_init();
254 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
255 usart_configuration();
256 dma_configuration();
257
258 /* wait dma transmission complete */
259 while((usart2_tx_dma_status == 0) || (usart2_rx_dma_status == 0) || (usart3_tx_dma_status == 0) || (usart3_rx_dma_status == 0));
260
261 while(1)
262 {
263 /* compare data buffer */
264 if(buffer_compare(usart2_tx_buffer, usart3_rx_buffer, USART2_TX_BUFFER_SIZE) && \
265 buffer_compare(usart3_tx_buffer, usart2_rx_buffer, USART3_TX_BUFFER_SIZE))
266 {
267 at32_led_toggle(LED2);
268 at32_led_toggle(LED3);
269 at32_led_toggle(LED4);
270 delay_sec(1);
271 }
272 }
273}
274
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
usart_configuration
void usart_configuration(void)
config usart
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:56
usart3_tx_dma_status
volatile uint8_t usart3_tx_dma_status
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:48
usart2_tx_dma_status
volatile uint8_t usart2_tx_dma_status
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:46
buffer_compare
uint8_t buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:231
usart3_rx_buffer
uint8_t usart3_rx_buffer[((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:45
dma_configuration
void dma_configuration(void)
config dma for usart2 and usart3
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:115
USART2_TX_BUFFER_SIZE
#define USART2_TX_BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:39
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:250
usart2_rx_dma_status
volatile uint8_t usart2_rx_dma_status
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:47
usart3_rx_dma_status
volatile uint8_t usart3_rx_dma_status
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:49
usart2_tx_buffer
uint8_t usart2_tx_buffer[]
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:42
USART3_TX_BUFFER_SIZE
#define USART3_TX_BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:40
usart3_tx_buffer
uint8_t usart3_tx_buffer[]
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:43
usart2_rx_buffer
uint8_t usart2_rx_buffer[((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
Definition: project/at_start_f415/examples/usart/transfer_by_dma_interrupt/src/main.c:44
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_USART3_PERIPH_CLOCK
@ CRM_USART3_PERIPH_CLOCK
Definition: at32f415_crm.h:131
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_USART2_PERIPH_CLOCK
@ CRM_USART2_PERIPH_CLOCK
Definition: at32f415_crm.h:130
DMA1_Channel2_IRQn
@ DMA1_Channel2_IRQn
Definition: at32f415.h:147
DMA1_Channel1_IRQn
@ DMA1_Channel1_IRQn
Definition: at32f415.h:146
DMA1_Channel3_IRQn
@ DMA1_Channel3_IRQn
Definition: at32f415.h:148
DMA1_Channel4_IRQn
@ DMA1_Channel4_IRQn
Definition: at32f415.h:149
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_flexible_config
void dma_flexible_config(dma_type *dma_x, uint8_t flex_channelx, dma_flexible_request_type flexible_request)
initialize the dma_x flexible function according to the specified parameters.
Definition: at32f415_dma.c:236
dma_interrupt_enable
void dma_interrupt_enable(dma_channel_type *dmax_channely, uint32_t dma_int, confirm_state new_state)
enable or disable dma interrupt
Definition: at32f415_dma.c:165
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_BYTE
@ DMA_PERIPHERAL_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:238
DMA_FLEXIBLE_UART3_TX
@ DMA_FLEXIBLE_UART3_TX
Definition: at32f415_dma.h:162
DMA_FLEXIBLE_UART2_RX
@ DMA_FLEXIBLE_UART2_RX
Definition: at32f415_dma.h:159
DMA_FLEXIBLE_UART2_TX
@ DMA_FLEXIBLE_UART2_TX
Definition: at32f415_dma.h:160
DMA_FLEXIBLE_UART3_RX
@ DMA_FLEXIBLE_UART3_RX
Definition: at32f415_dma.h:161
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_BYTE
@ DMA_MEMORY_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:248
DMA_PRIORITY_MEDIUM
@ DMA_PRIORITY_MEDIUM
Definition: at32f415_dma.h:259
FLEX_CHANNEL3
#define FLEX_CHANNEL3
Definition: at32f415_dma.h:66
FLEX_CHANNEL1
#define FLEX_CHANNEL1
Definition: at32f415_dma.h:64
FLEX_CHANNEL4
#define FLEX_CHANNEL4
Definition: at32f415_dma.h:67
FLEX_CHANNEL2
#define FLEX_CHANNEL2
Definition: at32f415_dma.h:65
DMA_FDT_INT
#define DMA_FDT_INT
Definition: at32f415_dma.h:52
DMA1_CHANNEL3
#define DMA1_CHANNEL3
Definition: at32f415_dma.h:475
DMA1_CHANNEL4
#define DMA1_CHANNEL4
Definition: at32f415_dma.h:476
DMA1_CHANNEL1
#define DMA1_CHANNEL1
Definition: at32f415_dma.h:473
DMA1_CHANNEL2
#define DMA1_CHANNEL2
Definition: at32f415_dma.h:474
DMA1
#define DMA1
Definition: at32f415_dma.h:472
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_11
#define GPIO_PINS_11
Definition: at32f415_gpio.h:62
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_dma_receiver_enable
void usart_dma_receiver_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma receiver interface.
Definition: at32f415_usart.c:288
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_dma_transmitter_enable
void usart_dma_transmitter_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma transmitter interface.
Definition: at32f415_usart.c:274
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART3
#define USART3
Definition: at32f415_usart.h:321
USART2
#define USART2
Definition: at32f415_usart.h:320
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usart
  • transfer_by_dma_polling
  • inc
project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usart
  • transfer_by_dma_polling
  • inc
project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usart
  • transfer_by_dma_polling
  • inc
project/at_start_f415/examples/usart/transfer_by_dma_polling/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usart
  • transfer_by_dma_polling
  • src
project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usart
  • transfer_by_dma_polling
  • src
project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usart
  • transfer_by_dma_polling
  • src
project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define COUNTOF(a) (sizeof(a) / sizeof(*(a)))
39#define USART2_TX_BUFFER_SIZE (COUNTOF(usart2_tx_buffer) - 1)
40#define USART3_TX_BUFFER_SIZE (COUNTOF(usart3_tx_buffer) - 1)
41
42uint8_t usart2_tx_buffer[] = "usart transfer by dma interrupt: usart2 -> usart3 using dma";
43uint8_t usart3_tx_buffer[] = "usart transfer by dma interrupt: usart3 -> usart2 using dma";
44uint8_t usart2_rx_buffer[USART3_TX_BUFFER_SIZE];
45uint8_t usart3_rx_buffer[USART2_TX_BUFFER_SIZE];
46
52void usart_configuration(void)
53{
54 gpio_init_type gpio_init_struct;
55
56 /* enable the usart2 and gpio clock */
57 crm_periph_clock_enable(CRM_USART2_PERIPH_CLOCK, TRUE);
58 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
59
60 /* enable the usart3 and gpio clock */
61 crm_periph_clock_enable(CRM_USART3_PERIPH_CLOCK, TRUE);
62 crm_periph_clock_enable(CRM_GPIOB_PERIPH_CLOCK, TRUE);
63
64 gpio_default_para_init(&gpio_init_struct);
65 /* configure the usart2 tx pin */
66 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
67 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
68 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
69 gpio_init_struct.gpio_pins = GPIO_PINS_2;
70 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
71 gpio_init(GPIOA, &gpio_init_struct);
72
73 /* configure the usart3 tx pin */
74 gpio_init_struct.gpio_pins = GPIO_PINS_10;
75 gpio_init(GPIOB, &gpio_init_struct);
76
77 /* configure the usart2 rx pin */
78 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
79 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
80 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
81 gpio_init_struct.gpio_pins = GPIO_PINS_3;
82 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
83 gpio_init(GPIOA, &gpio_init_struct);
84
85 /* configure the usart3 rx pin */
86 gpio_init_struct.gpio_pins = GPIO_PINS_11;
87 gpio_init(GPIOB, &gpio_init_struct);
88
89 /* configure usart2 param */
90 usart_init(USART2, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
91 usart_transmitter_enable(USART2, TRUE);
92 usart_receiver_enable(USART2, TRUE);
93 usart_dma_transmitter_enable(USART2, TRUE);
94 usart_dma_receiver_enable(USART2, TRUE);
95 usart_enable(USART2, TRUE);
96
97 /* configure usart3 param */
98 usart_init(USART3, 115200, USART_DATA_8BITS, USART_STOP_1_BIT);
99 usart_transmitter_enable(USART3, TRUE);
100 usart_receiver_enable(USART3, TRUE);
101 usart_dma_transmitter_enable(USART3, TRUE);
102 usart_dma_receiver_enable(USART3, TRUE);
103 usart_enable(USART3, TRUE);
104}
105
111void dma_configuration(void)
112{
113 dma_init_type dma_init_struct;
114
115 /* enable dma1 clock */
116 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
117
118 /* dma1 channel1 for usart2 tx configuration */
119 dma_reset(DMA1_CHANNEL1);
120 dma_default_para_init(&dma_init_struct);
121 dma_init_struct.buffer_size = USART2_TX_BUFFER_SIZE;
122 dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
123 dma_init_struct.memory_base_addr = (uint32_t)usart2_tx_buffer;
124 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
125 dma_init_struct.memory_inc_enable = TRUE;
126 dma_init_struct.peripheral_base_addr = (uint32_t)&USART2->dt;
127 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
128 dma_init_struct.peripheral_inc_enable = FALSE;
129 dma_init_struct.priority = DMA_PRIORITY_MEDIUM;
130 dma_init_struct.loop_mode_enable = FALSE;
131 dma_init(DMA1_CHANNEL1, &dma_init_struct);
132
133 /* config flexible dma for usart2 tx */
134 dma_flexible_config(DMA1, FLEX_CHANNEL1, DMA_FLEXIBLE_UART2_TX);
135
136 /* dma1 channel2 for usart2 rx configuration */
137 dma_reset(DMA1_CHANNEL2);
138 dma_default_para_init(&dma_init_struct);
139 dma_init_struct.buffer_size = USART3_TX_BUFFER_SIZE;
140 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
141 dma_init_struct.memory_base_addr = (uint32_t)usart2_rx_buffer;
142 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
143 dma_init_struct.memory_inc_enable = TRUE;
144 dma_init_struct.peripheral_base_addr = (uint32_t)&USART2->dt;
145 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
146 dma_init_struct.peripheral_inc_enable = FALSE;
147 dma_init_struct.priority = DMA_PRIORITY_MEDIUM;
148 dma_init_struct.loop_mode_enable = FALSE;
149 dma_init(DMA1_CHANNEL2, &dma_init_struct);
150
151 /* config flexible dma for usart2 rx */
152 dma_flexible_config(DMA1, FLEX_CHANNEL2, DMA_FLEXIBLE_UART2_RX);
153
154 /* dma1 channel3 for usart3 tx configuration */
155 dma_reset(DMA1_CHANNEL3);
156 dma_default_para_init(&dma_init_struct);
157 dma_init_struct.buffer_size = USART3_TX_BUFFER_SIZE;
158 dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
159 dma_init_struct.memory_base_addr = (uint32_t)usart3_tx_buffer;
160 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
161 dma_init_struct.memory_inc_enable = TRUE;
162 dma_init_struct.peripheral_base_addr = (uint32_t)&USART3->dt;
163 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
164 dma_init_struct.peripheral_inc_enable = FALSE;
165 dma_init_struct.priority = DMA_PRIORITY_MEDIUM;
166 dma_init_struct.loop_mode_enable = FALSE;
167 dma_init(DMA1_CHANNEL3, &dma_init_struct);
168
169 /* config flexible dma for usart3 tx */
170 dma_flexible_config(DMA1, FLEX_CHANNEL3, DMA_FLEXIBLE_UART3_TX);
171
172 /* dma1 channel4 for usart3 rx configuration */
173 dma_reset(DMA1_CHANNEL4);
174 dma_default_para_init(&dma_init_struct);
175 dma_init_struct.buffer_size = USART2_TX_BUFFER_SIZE;
176 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
177 dma_init_struct.memory_base_addr = (uint32_t)usart3_rx_buffer;
178 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
179 dma_init_struct.memory_inc_enable = TRUE;
180 dma_init_struct.peripheral_base_addr = (uint32_t)&USART3->dt;
181 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
182 dma_init_struct.peripheral_inc_enable = FALSE;
183 dma_init_struct.priority = DMA_PRIORITY_MEDIUM;
184 dma_init_struct.loop_mode_enable = FALSE;
185 dma_init(DMA1_CHANNEL4, &dma_init_struct);
186
187 /* config flexible dma for usart3 rx */
188 dma_flexible_config(DMA1, FLEX_CHANNEL4, DMA_FLEXIBLE_UART3_RX);
189
190 dma_channel_enable(DMA1_CHANNEL2, TRUE); /* usart2 rx begin dma receiving */
191 dma_channel_enable(DMA1_CHANNEL4, TRUE); /* usart3 rx begin dma receiving */
192 dma_channel_enable(DMA1_CHANNEL1, TRUE); /* usart2 tx begin dma transmitting */
193 dma_channel_enable(DMA1_CHANNEL3, TRUE); /* usart3 tx begin dma transmitting */
194}
195
203uint8_t buffer_compare(uint8_t* pbuffer1, uint8_t* pbuffer2, uint16_t buffer_length)
204{
205 while(buffer_length--)
206 {
207 if(*pbuffer1 != *pbuffer2)
208 {
209 return 0;
210 }
211 pbuffer1++;
212 pbuffer2++;
213 }
214 return 1;
215}
216
222int main(void)
223{
224 system_clock_config();
225 at32_board_init();
226 usart_configuration();
227 dma_configuration();
228
229 /* wait dma transmission complete */
230 while((dma_flag_get(DMA1_FDT1_FLAG) == RESET) || (dma_flag_get(DMA1_FDT2_FLAG) == RESET) || \
231 (dma_flag_get(DMA1_FDT3_FLAG) == RESET) || (dma_flag_get(DMA1_FDT4_FLAG) == RESET));
232
233 while(1)
234 {
235 /* compare data buffer */
236 if(buffer_compare(usart2_tx_buffer, usart3_rx_buffer, USART2_TX_BUFFER_SIZE) && \
237 buffer_compare(usart3_tx_buffer, usart2_rx_buffer, USART3_TX_BUFFER_SIZE))
238 {
239 at32_led_toggle(LED2);
240 at32_led_toggle(LED3);
241 at32_led_toggle(LED4);
242 delay_sec(1);
243 }
244 }
245}
246
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
usart_configuration
void usart_configuration(void)
config usart
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c:52
buffer_compare
uint8_t buffer_compare(uint8_t *pbuffer1, uint8_t *pbuffer2, uint16_t buffer_length)
compares two buffers.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c:203
usart3_rx_buffer
uint8_t usart3_rx_buffer[((sizeof(usart2_tx_buffer)/sizeof(*(usart2_tx_buffer))) - 1)]
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c:45
dma_configuration
void dma_configuration(void)
config dma for usart2 and usart3
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c:111
USART2_TX_BUFFER_SIZE
#define USART2_TX_BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c:39
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c:222
usart2_tx_buffer
uint8_t usart2_tx_buffer[]
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c:42
USART3_TX_BUFFER_SIZE
#define USART3_TX_BUFFER_SIZE
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c:40
usart3_tx_buffer
uint8_t usart3_tx_buffer[]
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c:43
usart2_rx_buffer
uint8_t usart2_rx_buffer[((sizeof(usart3_tx_buffer)/sizeof(*(usart3_tx_buffer))) - 1)]
Definition: project/at_start_f415/examples/usart/transfer_by_dma_polling/src/main.c:44
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_USART3_PERIPH_CLOCK
@ CRM_USART3_PERIPH_CLOCK
Definition: at32f415_crm.h:131
CRM_GPIOB_PERIPH_CLOCK
@ CRM_GPIOB_PERIPH_CLOCK
Definition: at32f415_crm.h:111
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
CRM_USART2_PERIPH_CLOCK
@ CRM_USART2_PERIPH_CLOCK
Definition: at32f415_crm.h:130
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_flexible_config
void dma_flexible_config(dma_type *dma_x, uint8_t flex_channelx, dma_flexible_request_type flexible_request)
initialize the dma_x flexible function according to the specified parameters.
Definition: at32f415_dma.c:236
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_BYTE
@ DMA_PERIPHERAL_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:238
DMA_FLEXIBLE_UART3_TX
@ DMA_FLEXIBLE_UART3_TX
Definition: at32f415_dma.h:162
DMA_FLEXIBLE_UART2_RX
@ DMA_FLEXIBLE_UART2_RX
Definition: at32f415_dma.h:159
DMA_FLEXIBLE_UART2_TX
@ DMA_FLEXIBLE_UART2_TX
Definition: at32f415_dma.h:160
DMA_FLEXIBLE_UART3_RX
@ DMA_FLEXIBLE_UART3_RX
Definition: at32f415_dma.h:161
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_BYTE
@ DMA_MEMORY_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:248
DMA_PRIORITY_MEDIUM
@ DMA_PRIORITY_MEDIUM
Definition: at32f415_dma.h:259
DMA1_FDT4_FLAG
#define DMA1_FDT4_FLAG
Definition: at32f415_dma.h:94
DMA1_FDT1_FLAG
#define DMA1_FDT1_FLAG
Definition: at32f415_dma.h:82
DMA1_FDT2_FLAG
#define DMA1_FDT2_FLAG
Definition: at32f415_dma.h:86
DMA1_FDT3_FLAG
#define DMA1_FDT3_FLAG
Definition: at32f415_dma.h:90
FLEX_CHANNEL3
#define FLEX_CHANNEL3
Definition: at32f415_dma.h:66
FLEX_CHANNEL1
#define FLEX_CHANNEL1
Definition: at32f415_dma.h:64
FLEX_CHANNEL4
#define FLEX_CHANNEL4
Definition: at32f415_dma.h:67
FLEX_CHANNEL2
#define FLEX_CHANNEL2
Definition: at32f415_dma.h:65
DMA1_CHANNEL3
#define DMA1_CHANNEL3
Definition: at32f415_dma.h:475
DMA1_CHANNEL4
#define DMA1_CHANNEL4
Definition: at32f415_dma.h:476
DMA1_CHANNEL1
#define DMA1_CHANNEL1
Definition: at32f415_dma.h:473
DMA1_CHANNEL2
#define DMA1_CHANNEL2
Definition: at32f415_dma.h:474
DMA1
#define DMA1
Definition: at32f415_dma.h:472
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_11
#define GPIO_PINS_11
Definition: at32f415_gpio.h:62
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_3
#define GPIO_PINS_3
Definition: at32f415_gpio.h:54
GPIOB
#define GPIOB
Definition: at32f415_gpio.h:771
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
usart_transmitter_enable
void usart_transmitter_enable(usart_type *usart_x, confirm_state new_state)
usart transmitter enable.
Definition: at32f415_usart.c:179
usart_dma_receiver_enable
void usart_dma_receiver_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma receiver interface.
Definition: at32f415_usart.c:288
usart_init
void usart_init(usart_type *usart_x, uint32_t baud_rate, usart_data_bit_num_type data_bit, usart_stop_bit_num_type stop_bit)
initialize the usart peripheral according to the specified parameters.
Definition: at32f415_usart.c:99
usart_enable
void usart_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the specified usart peripheral.
Definition: at32f415_usart.c:166
usart_receiver_enable
void usart_receiver_enable(usart_type *usart_x, confirm_state new_state)
usart receiver enable.
Definition: at32f415_usart.c:192
usart_dma_transmitter_enable
void usart_dma_transmitter_enable(usart_type *usart_x, confirm_state new_state)
enable or disable the usart's dma transmitter interface.
Definition: at32f415_usart.c:274
USART_STOP_1_BIT
@ USART_STOP_1_BIT
Definition: at32f415_usart.h:158
USART_DATA_8BITS
@ USART_DATA_8BITS
Definition: at32f415_usart.h:113
USART3
#define USART3
Definition: at32f415_usart.h:321
USART2
#define USART2
Definition: at32f415_usart.h:320
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usb_device
  • audio
  • inc
project/at_start_f415/examples/usb_device/audio/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usb_device
  • audio
  • inc
project/at_start_f415/examples/usb_device/audio/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usb_device
  • audio
  • inc
project/at_start_f415/examples/usb_device/audio/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • usb_device
  • audio
  • inc
project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "at32f415_board.h"
38#include "stdio.h"
39
51#define USE_OTG_DEVICE_MODE
52
56/* #define USE_OTG_HOST_MODE */
57
58#define USB_ID 0
59#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
60#define OTG_IRQ OTGFS1_IRQn
61#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
62#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
63#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
64#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
65
66#define OTG_PIN_GPIO GPIOA
67#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
68#define OTG_PIN_VBUS GPIO_PINS_9
69#define OTG_PIN_ID GPIO_PINS_10
70
71#define OTG_PIN_SOF_GPIO GPIOA
72#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
73#define OTG_PIN_SOF GPIO_PINS_8
74
78#ifdef USE_OTG_DEVICE_MODE
82 /* otg1 device fifo */
83#define USBD_RX_SIZE 128
84#define USBD_EP0_TX_SIZE 24
85#define USBD_EP1_TX_SIZE 64
86#define USBD_EP2_TX_SIZE 16
87#define USBD_EP3_TX_SIZE 16
88
92#ifndef USB_EPT_MAX_NUM
93#define USB_EPT_MAX_NUM 4
94#endif
95#endif
96
100#ifdef USE_OTG_HOST_MODE
101#ifndef USB_HOST_CHANNEL_NUM
102#define USB_HOST_CHANNEL_NUM 8
103#endif
104
108/* otg1 host fifo */
109#define USBH_RX_FIFO_SIZE 128
110#define USBH_NP_TX_FIFO_SIZE 96
111#define USBH_P_TX_FIFO_SIZE 96
112#endif
113
117/* #define USB_SOF_OUTPUT_ENABLE */
118
129/* #define USB_VBUS_IGNORE */
130
134/* #define USB_LOW_POWER_WAKUP */
135
136void usb_delay_ms(uint32_t ms);
137void usb_delay_us(uint32_t us);
138
146#ifdef __cplusplus
147}
148#endif
149
150#endif
151
at32f415.h
at32f415 header file
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usb_device
  • audio
  • src
project/at_start_f415/examples/usb_device/audio/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usb_device/audio/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usb_device
  • audio
  • src
project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
41void NMI_Handler(void)
42{
43}
44
50void HardFault_Handler(void)
51{
52 /* go to infinite loop when hard fault exception occurs */
53 while(1)
54 {
55 }
56}
57
63void MemManage_Handler(void)
64{
65 /* go to infinite loop when memory manage exception occurs */
66 while(1)
67 {
68 }
69}
70
76void BusFault_Handler(void)
77{
78 /* go to infinite loop when bus fault exception occurs */
79 while(1)
80 {
81 }
82}
83
89void UsageFault_Handler(void)
90{
91 /* go to infinite loop when usage fault exception occurs */
92 while(1)
93 {
94 }
95}
96
102void SVC_Handler(void)
103{
104}
105
111void DebugMon_Handler(void)
112{
113}
114
120void PendSV_Handler(void)
121{
122}
123
129void SysTick_Handler(void)
130{
131}
132
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c:89
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c:50
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c:63
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c:102
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c:120
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c:41
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c:76
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c:129
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usb_device/audio/src/at32f415_int.c:111
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usb_device
  • audio
  • src
project/at_start_f415/examples/usb_device/audio/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbd_int.h"
32#include "audio_class.h"
33#include "audio_desc.h"
34#include "audio_codec.h"
35
44/* usb global struct define */
45 otg_core_type otg_core_struct;
46void usb_clock48m_select(usb_clk48_s clk_s);
47void usb_gpio_config(void);
48void usb_low_power_wakeup_config(void);
49
55int main(void)
56{
57 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
58
59 system_clock_config();
60
61 /* audio codec init */
62 audio_codec_init();
63
64 at32_board_init();
65
66 /* usb gpio config */
67 usb_gpio_config();
68
69#ifdef USB_LOW_POWER_WAKUP
70 usb_low_power_wakeup_config();
71#endif
72
73 /* enable otgfs clock */
74 crm_periph_clock_enable(OTG_CLOCK, TRUE);
75
76 /* select usb 48m clcok source */
77 usb_clock48m_select(USB_CLK_HEXT);
78
79 /* enable otgfs irq */
80 nvic_irq_enable(OTG_IRQ, 0, 0);
81
82 /* init usb */
83 usbd_init(&otg_core_struct,
84 USB_FULL_SPEED_CORE_ID,
85 USB_ID,
86 &audio_class_handler,
87 &audio_desc_handler);
88
89 while(1)
90 {
91 audio_codec_loop();
92 delay_ms(100);
93 }
94}
95
101void usb_clock48m_select(usb_clk48_s clk_s)
102{
103 switch(system_core_clock)
104 {
105 /* 48MHz */
106 case 48000000:
107 crm_usb_clock_div_set(CRM_USB_DIV_1);
108 break;
109
110 /* 72MHz */
111 case 72000000:
112 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
113 break;
114
115 /* 96MHz */
116 case 96000000:
117 crm_usb_clock_div_set(CRM_USB_DIV_2);
118 break;
119
120 /* 120MHz */
121 case 120000000:
122 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
123 break;
124
125 /* 144MHz */
126 case 144000000:
127 crm_usb_clock_div_set(CRM_USB_DIV_3);
128 break;
129
130 default:
131 break;
132
133 }
134}
135
141void usb_gpio_config(void)
142{
143 gpio_init_type gpio_init_struct;
144
145 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
146 gpio_default_para_init(&gpio_init_struct);
147
148 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
149 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
150 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
151 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
152
153
154#ifdef USB_SOF_OUTPUT_ENABLE
155 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
156 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
157 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
158#endif
159
160 /* otgfs use vbus pin */
161#ifndef USB_VBUS_IGNORE
162 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
163 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
164 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
165 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
166#endif
167
168
169}
170#ifdef USB_LOW_POWER_WAKUP
176void usb_low_power_wakeup_config(void)
177{
178 exint_init_type exint_init_struct;
179
180 exint_default_para_init(&exint_init_struct);
181
182 exint_init_struct.line_enable = TRUE;
183 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
184 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
185 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
186 exint_init(&exint_init_struct);
187
188 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
189}
190
196void OTG_WKUP_HANDLER(void)
197{
198 exint_flag_clear(OTG_WKUP_EXINT_LINE);
199}
200
201#endif
202
203
209void OTG_IRQ_HANDLER(void)
210{
211 usbd_irq_handler(&otg_core_struct);
212}
213
219void usb_delay_ms(uint32_t ms)
220{
221 /* user can define self delay function */
222 delay_ms(ms);
223}
224
230void usb_delay_us(uint32_t us)
231{
232 delay_us(us);
233}
234
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
audio_class.h
usb audio class file
audio_desc.h
usb audio descriptor header file
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:101
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:55
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:141
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:209
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230
otg_core_struct
otg_core_type otg_core_struct
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:45
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
audio_class_handler
usbd_class_handler audio_class_handler
Definition: audio_class.c:68
audio_desc_handler
usbd_desc_handler audio_desc_handler
device descriptor handler structure
Definition: audio_desc.c:64
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
audio_codec_loop
error_status audio_codec_loop(void)
audio codec loop
Definition: audio/src/audio_codec.c:855
audio_codec_init
error_status audio_codec_init(void)
audio codec init
Definition: audio/src/audio_codec.c:796
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_int.h
usb interrupt header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usb_device
  • composite_audio_hid
  • inc
project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usb_device
  • composite_audio_hid
  • inc
project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usb_device
  • composite_audio_hid
  • inc
project/at_start_f415/examples/usb_device/composite_audio_hid/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • usb_device
  • composite_audio_hid
  • inc
project/at_start_f415/examples/usb_device/composite_audio_hid/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "at32f415_board.h"
38#include "stdio.h"
39
51#define USE_OTG_DEVICE_MODE
52
56/* #define USE_OTG_HOST_MODE */
57
58#define USB_ID 0
59#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
60#define OTG_IRQ OTGFS1_IRQn
61#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
62#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
63#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
64#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
65
66#define OTG_PIN_GPIO GPIOA
67#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
68#define OTG_PIN_VBUS GPIO_PINS_9
69#define OTG_PIN_ID GPIO_PINS_10
70
71#define OTG_PIN_SOF_GPIO GPIOA
72#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
73#define OTG_PIN_SOF GPIO_PINS_8
74
78#ifdef USE_OTG_DEVICE_MODE
82 /* otg1 device fifo */
83#define USBD_RX_SIZE 128
84#define USBD_EP0_TX_SIZE 24
85#define USBD_EP1_TX_SIZE 64
86#define USBD_EP2_TX_SIZE 20
87#define USBD_EP3_TX_SIZE 16
88
92#ifndef USB_EPT_MAX_NUM
93#define USB_EPT_MAX_NUM 4
94#endif
95#endif
96
100#ifdef USE_OTG_HOST_MODE
101#ifndef USB_HOST_CHANNEL_NUM
102#define USB_HOST_CHANNEL_NUM 8
103#endif
104
108/* otg1 host fifo */
109#define USBH_RX_FIFO_SIZE 128
110#define USBH_NP_TX_FIFO_SIZE 96
111#define USBH_P_TX_FIFO_SIZE 96
112#endif
113
117/* #define USB_SOF_OUTPUT_ENABLE */
118
129/* #define USB_VBUS_IGNORE */
130
134/* #define USB_LOW_POWER_WAKUP */
135
136void usb_delay_ms(uint32_t ms);
137void usb_delay_us(uint32_t us);
138
146#ifdef __cplusplus
147}
148#endif
149
150#endif
151
at32f415.h
at32f415 header file
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c:226
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c:237


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usb_device
  • composite_audio_hid
  • src
project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usb_device
  • composite_audio_hid
  • src
project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
41void NMI_Handler(void)
42{
43}
44
50void HardFault_Handler(void)
51{
52 /* go to infinite loop when hard fault exception occurs */
53 while(1)
54 {
55 }
56}
57
63void MemManage_Handler(void)
64{
65 /* go to infinite loop when memory manage exception occurs */
66 while(1)
67 {
68 }
69}
70
76void BusFault_Handler(void)
77{
78 /* go to infinite loop when bus fault exception occurs */
79 while(1)
80 {
81 }
82}
83
89void UsageFault_Handler(void)
90{
91 /* go to infinite loop when usage fault exception occurs */
92 while(1)
93 {
94 }
95}
96
102void SVC_Handler(void)
103{
104}
105
111void DebugMon_Handler(void)
112{
113}
114
120void PendSV_Handler(void)
121{
122}
123
129void SysTick_Handler(void)
130{
131}
132
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c:89
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c:50
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c:63
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c:102
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c:120
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c:41
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c:76
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c:129
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/at32f415_int.c:111
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usb_device
  • composite_audio_hid
  • src
project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbd_int.h"
32#include "audio_hid_class.h"
33#include "audio_hid_desc.h"
34#include "audio_codec.h"
35
44/* usb global struct define */
45 otg_core_type otg_core_struct;
46void usb_clock48m_select(usb_clk48_s clk_s);
47void usb_gpio_config(void);
48void usb_low_power_wakeup_config(void);
49uint8_t report_buf[USBD_IN_MAXPACKET_SIZE];
50
56int main(void)
57{
58 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
59
60 system_clock_config();
61
62 /* audio codec init */
63 audio_codec_init();
64
65 at32_board_init();
66
67 /* usb gpio config */
68 usb_gpio_config();
69
70#ifdef USB_LOW_POWER_WAKUP
71 usb_low_power_wakeup_config();
72#endif
73
74 /* enable otgfs clock */
75 crm_periph_clock_enable(OTG_CLOCK, TRUE);
76
77 /* select usb 48m clcok source */
78 usb_clock48m_select(USB_CLK_HEXT);
79
80 /* enable otgfs irq */
81 nvic_irq_enable(OTG_IRQ, 0, 0);
82
83 /* init usb */
84 usbd_init(&otg_core_struct,
85 USB_FULL_SPEED_CORE_ID,
86 USB_ID,
87 &audio_hid_class_handler,
88 &audio_hid_desc_handler);
89
90 while(1)
91 {
92 audio_codec_loop();
93 if(at32_button_press() == USER_BUTTON)
94 {
95 report_buf[0] = HID_REPORT_ID_5;
96 report_buf[1] = (~report_buf[1]) & 0x1;
97 class_send_report(&otg_core_struct.dev, report_buf, USBD_IN_MAXPACKET_SIZE);
98 }
99 delay_ms(100);
100 }
101}
102
108void usb_clock48m_select(usb_clk48_s clk_s)
109{
110 switch(system_core_clock)
111 {
112 /* 48MHz */
113 case 48000000:
114 crm_usb_clock_div_set(CRM_USB_DIV_1);
115 break;
116
117 /* 72MHz */
118 case 72000000:
119 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
120 break;
121
122 /* 96MHz */
123 case 96000000:
124 crm_usb_clock_div_set(CRM_USB_DIV_2);
125 break;
126
127 /* 120MHz */
128 case 120000000:
129 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
130 break;
131
132 /* 144MHz */
133 case 144000000:
134 crm_usb_clock_div_set(CRM_USB_DIV_3);
135 break;
136
137 default:
138 break;
139
140 }
141}
142
148void usb_gpio_config(void)
149{
150 gpio_init_type gpio_init_struct;
151
152 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
153 gpio_default_para_init(&gpio_init_struct);
154
155 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
156 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
157 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
158 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
159
160
161#ifdef USB_SOF_OUTPUT_ENABLE
162 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
163 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
164 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
165#endif
166
167 /* otgfs use vbus pin */
168#ifndef USB_VBUS_IGNORE
169 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
170 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
171 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
172 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
173#endif
174
175
176}
177#ifdef USB_LOW_POWER_WAKUP
183void usb_low_power_wakeup_config(void)
184{
185 exint_init_type exint_init_struct;
186
187 exint_default_para_init(&exint_init_struct);
188
189 exint_init_struct.line_enable = TRUE;
190 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
191 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
192 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
193 exint_init(&exint_init_struct);
194
195 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
196}
197
203void OTG_WKUP_HANDLER(void)
204{
205 exint_flag_clear(OTG_WKUP_EXINT_LINE);
206}
207
208#endif
209
210
216void OTG_IRQ_HANDLER(void)
217{
218 usbd_irq_handler(&otg_core_struct);
219}
220
226void usb_delay_ms(uint32_t ms)
227{
228 /* user can define self delay function */
229 delay_ms(ms);
230}
231
237void usb_delay_us(uint32_t us)
238{
239 delay_us(us);
240}
241
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
audio_hid_class.h
audio_hid_desc.h
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c:108
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c:56
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c:148
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c:216
report_buf
uint8_t report_buf[USBD_IN_MAXPACKET_SIZE]
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c:49
otg_core_struct
otg_core_type otg_core_struct
Definition: project/at_start_f415/examples/usb_device/composite_audio_hid/src/main.c:45
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
audio_hid_class_handler
usbd_class_handler audio_hid_class_handler
Definition: audio_hid_class.c:77
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: audio_hid_class.c:818
HID_REPORT_ID_5
#define HID_REPORT_ID_5
Definition: audio_hid_desc.h:227
audio_hid_desc_handler
usbd_desc_handler audio_hid_desc_handler
device descriptor handler structure
Definition: audio_hid_desc.c:64
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
audio_codec_loop
error_status audio_codec_loop(void)
audio codec loop
Definition: audio/src/audio_codec.c:855
audio_codec_init
error_status audio_codec_init(void)
audio codec init
Definition: audio/src/audio_codec.c:796
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_int.h
usb interrupt header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usb_device
  • composite_vcp_keyboard
  • inc
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usb_device
  • composite_vcp_keyboard
  • inc
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usb_device
  • composite_vcp_keyboard
  • inc
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • usb_device
  • composite_vcp_keyboard
  • inc
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "stdio.h"
38
39
52#define USE_OTG_DEVICE_MODE
53
57/* #define USE_OTG_HOST_MODE */
58
59#define USB_ID 0
60#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
61#define OTG_IRQ OTGFS1_IRQn
62#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
63#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
64#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
65#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
66
67#define OTG_PIN_GPIO GPIOA
68#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
69#define OTG_PIN_VBUS GPIO_PINS_9
70#define OTG_PIN_ID GPIO_PINS_10
71
72#define OTG_PIN_SOF_GPIO GPIOA
73#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
74#define OTG_PIN_SOF GPIO_PINS_8
75
76
77
81#ifdef USE_OTG_DEVICE_MODE
85/* otg1 device fifo */
86#define USBD_RX_SIZE 128
87#define USBD_EP0_TX_SIZE 24
88#define USBD_EP1_TX_SIZE 20
89#define USBD_EP2_TX_SIZE 20
90#define USBD_EP3_TX_SIZE 20
91
95#ifndef USB_EPT_MAX_NUM
96#define USB_EPT_MAX_NUM 4
97#endif
98#endif
99
103#ifdef USE_OTG_HOST_MODE
104#ifndef USB_HOST_CHANNEL_NUM
105#define USB_HOST_CHANNEL_NUM 8
106#endif
107
111/* otg1 host fifo */
112#define USBH_RX_FIFO_SIZE 128
113#define USBH_NP_TX_FIFO_SIZE 96
114#define USBH_P_TX_FIFO_SIZE 96
115#endif
116
120/* #define USB_SOF_OUTPUT_ENABLE */
121
132/* #define USB_VBUS_IGNORE */
133
137#define USB_LOW_POWER_WAKUP
138
139void usb_delay_ms(uint32_t ms);
140void usb_delay_us(uint32_t us);
141
149#ifdef __cplusplus
150}
151#endif
152
153#endif
154
at32f415.h
at32f415 header file
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb delay millisecond function.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:344
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:355


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usb_device
  • composite_vcp_keyboard
  • src
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usb_device
  • composite_vcp_keyboard
  • src
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usb_device
  • composite_vcp_keyboard
  • src
project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbd_int.h"
32#include "cdc_keyboard_class.h"
33#include "cdc_keyboard_desc.h"
34
35
44/* usb global struct define */
45 otg_core_type otg_core_struct;
46__IO uint8_t keyboard_send_flag;
47uint8_t usb_buffer[256];
48
49void usb_clock48m_select(usb_clk48_s clk_s);
50void keyboard_send_string(uint8_t *string, uint8_t len);
51void usb_gpio_config(void);
52void usb_low_power_wakeup_config(void);
53
54void button_exint_init(void);
55void button_isr(void);
56
62void button_exint_init(void)
63{
64 exint_init_type exint_init_struct;
65
66 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
67 gpio_exint_line_config(GPIO_PORT_SOURCE_GPIOA, GPIO_PINS_SOURCE0);
68
69 exint_default_para_init(&exint_init_struct);
70 exint_init_struct.line_enable = TRUE;
71 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
72 exint_init_struct.line_select = EXINT_LINE_0;
73 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
74 exint_init(&exint_init_struct);
75
76 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
77 nvic_irq_enable(EXINT0_IRQn, 0, 0);
78}
79
85void button_isr(void)
86{
87 /* delay 5ms */
88 delay_ms(5);
89
90 /* clear interrupt pending bit */
91 exint_flag_clear(EXINT_LINE_0);
92
93 keyboard_send_flag = 1;
94}
95
101void EXINT0_IRQHandler(void)
102{
103 button_isr();
104}
105
112void keyboard_send_string(uint8_t *string, uint8_t len)
113{
114 __IO uint8_t index = 0;
115 for(index = 0; index < len; index ++)
116 {
117 while(1)
118 {
119 if(g_keyboard_tx_completed == 1)
120 {
121 g_keyboard_tx_completed = 0;
122 usb_hid_keyboard_send_char(&otg_core_struct.dev, string[index]);
123 break;
124 }
125 }
126 /* send 0x00 */
127 while(1)
128 {
129 if(g_keyboard_tx_completed == 1)
130 {
131 g_keyboard_tx_completed = 0;
132 usb_hid_keyboard_send_char(&otg_core_struct.dev, 0x00);
133 break;
134 }
135 }
136 }
137
138}
139
140
146int main(void)
147{
148 uint16_t data_len;
149
150 uint32_t timeout;
151
152 uint8_t send_zero_packet = 0;
153
154 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
155
156 system_clock_config();
157
158 at32_board_init();
159
160 button_exint_init();
161
162 /* usb gpio config */
163 usb_gpio_config();
164
165#ifdef USB_LOW_POWER_WAKUP
166 usb_low_power_wakeup_config();
167#endif
168
169 /* enable otgfs clock */
170 crm_periph_clock_enable(OTG_CLOCK, TRUE);
171
172 /* select usb 48m clcok source */
173 usb_clock48m_select(USB_CLK_HEXT);
174
175 /* enable otgfs irq */
176 nvic_irq_enable(OTG_IRQ, 0, 0);
177
178 /* init usb */
179 usbd_init(&otg_core_struct,
180 USB_FULL_SPEED_CORE_ID,
181 USB_ID,
182 &cdc_keyboard_class_handler,
183 &cdc_keyboard_desc_handler);
184
185 while(1)
186 {
187 /* get usb vcp receive data */
188 data_len = usb_vcp_get_rxdata(&otg_core_struct.dev, usb_buffer);
189
190 if(data_len > 0 || send_zero_packet == 1)
191 {
192 /* bulk transfer is complete when the endpoint does one of the following
193 1 has transferred exactly the amount of data expected
194 2 transfers a packet with a payload size less than wMaxPacketSize or transfers a zero-length packet
195 */
196 if(data_len > 0)
197 send_zero_packet = 1;
198
199 if(data_len == 0)
200 send_zero_packet = 0;
201
202 timeout = 50000;
203 do
204 {
205 /* send data to host */
206 if(usb_vcp_send_data(&otg_core_struct.dev, usb_buffer, data_len) == SUCCESS)
207 {
208 break;
209 }
210 }while(timeout --);
211 }
212 if(keyboard_send_flag)
213 {
214 keyboard_send_flag = 0;
215 keyboard_send_string((uint8_t *)" Keyboard Demo\r\n", 16);
216 }
217
218 }
219}
220
226void usb_clock48m_select(usb_clk48_s clk_s)
227{
228 switch(system_core_clock)
229 {
230 /* 48MHz */
231 case 48000000:
232 crm_usb_clock_div_set(CRM_USB_DIV_1);
233 break;
234
235 /* 72MHz */
236 case 72000000:
237 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
238 break;
239
240 /* 96MHz */
241 case 96000000:
242 crm_usb_clock_div_set(CRM_USB_DIV_2);
243 break;
244
245 /* 120MHz */
246 case 120000000:
247 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
248 break;
249
250 /* 144MHz */
251 case 144000000:
252 crm_usb_clock_div_set(CRM_USB_DIV_3);
253 break;
254
255 default:
256 break;
257
258 }
259
260}
261
262
268void usb_gpio_config(void)
269{
270 gpio_init_type gpio_init_struct;
271
272 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
273 gpio_default_para_init(&gpio_init_struct);
274
275 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
276 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
277 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
278 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
279
280#ifdef USB_SOF_OUTPUT_ENABLE
281 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
282 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
283 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
284#endif
285
286 /* otgfs use vbus pin */
287#ifndef USB_VBUS_IGNORE
288 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
289 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
290 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
291 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
292#endif
293
294
295}
296#ifdef USB_LOW_POWER_WAKUP
302void usb_low_power_wakeup_config(void)
303{
304 exint_init_type exint_init_struct;
305
306 exint_default_para_init(&exint_init_struct);
307
308 exint_init_struct.line_enable = TRUE;
309 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
310 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
311 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
312 exint_init(&exint_init_struct);
313
314 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
315}
316
322void OTG_WKUP_HANDLER(void)
323{
324 exint_flag_clear(OTG_WKUP_EXINT_LINE);
325}
326
327#endif
328
334void OTG_IRQ_HANDLER(void)
335{
336 usbd_irq_handler(&otg_core_struct);
337}
338
344void usb_delay_ms(uint32_t ms)
345{
346 /* user can define self delay function */
347 delay_ms(ms);
348}
349
355void usb_delay_us(uint32_t us)
356{
357 delay_us(us);
358}
359
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
cdc_keyboard_class.h
usb cdc and keyboard class file
cdc_keyboard_desc.h
usb cdc and keyboard descriptor header file
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
button_exint_init
void button_exint_init(void)
configure button exint
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:62
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:226
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:146
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:268
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:334
EXINT0_IRQHandler
void EXINT0_IRQHandler(void)
exint0 interrupt handler
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:101
usb_buffer
uint8_t usb_buffer[256]
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:47
button_isr
void button_isr(void)
button handler function
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:85
keyboard_send_flag
__IO uint8_t keyboard_send_flag
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:46
keyboard_send_string
void keyboard_send_string(uint8_t *string, uint8_t len)
keyboard send string
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:112
otg_core_struct
otg_core_type otg_core_struct
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:45
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
EXINT0_IRQn
@ EXINT0_IRQn
Definition: at32f415.h:141
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_0
#define EXINT_LINE_0
Definition: at32f415_exint.h:52
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_exint_line_config
void gpio_exint_line_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line.
Definition: at32f415_gpio.c:577
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PINS_SOURCE0
@ GPIO_PINS_SOURCE0
Definition: at32f415_gpio.h:268
GPIO_PORT_SOURCE_GPIOA
@ GPIO_PORT_SOURCE_GPIOA
Definition: at32f415_gpio.h:291
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
usb_vcp_get_rxdata
uint16_t usb_vcp_get_rxdata(void *udev, uint8_t *recv_data)
usb device class rx data process
Definition: cdc_class.c:322
usb_vcp_send_data
error_status usb_vcp_send_data(void *udev, uint8_t *send_data, uint16_t len)
usb device class send data
Definition: cdc_class.c:351
usb_hid_keyboard_send_char
void usb_hid_keyboard_send_char(void *udev, uint8_t ascii_code)
usb keyoard send char
Definition: cdc_keyboard_class.c:686
cdc_keyboard_class_handler
usbd_class_handler cdc_keyboard_class_handler
Definition: cdc_keyboard_class.c:217
g_keyboard_tx_completed
__IO uint8_t g_keyboard_tx_completed
Definition: cdc_keyboard_class.c:69
cdc_keyboard_desc_handler
usbd_desc_handler cdc_keyboard_desc_handler
device descriptor handler structure
Definition: cdc_keyboard_desc.c:62
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_int.h
usb interrupt header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usb_device
  • custom_hid
  • inc
project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usb_device
  • custom_hid
  • inc
project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usb_device
  • custom_hid
  • inc
project/at_start_f415/examples/usb_device/custom_hid/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • usb_device
  • custom_hid
  • inc
project/at_start_f415/examples/usb_device/custom_hid/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "at32f415_board.h"
38#include "stdio.h"
39
51#define USE_OTG_DEVICE_MODE
52
56/* #define USE_OTG_HOST_MODE */
57
58#define USB_ID 0
59#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
60#define OTG_IRQ OTGFS1_IRQn
61#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
62#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
63#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
64#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
65
66#define OTG_PIN_GPIO GPIOA
67#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
68#define OTG_PIN_VBUS GPIO_PINS_9
69#define OTG_PIN_ID GPIO_PINS_10
70
71#define OTG_PIN_SOF_GPIO GPIOA
72#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
73#define OTG_PIN_SOF GPIO_PINS_8
74
78#ifdef USE_OTG_DEVICE_MODE
82/* otg1 device fifo */
83#define USBD_RX_SIZE 128
84#define USBD_EP0_TX_SIZE 24
85#define USBD_EP1_TX_SIZE 20
86#define USBD_EP2_TX_SIZE 20
87#define USBD_EP3_TX_SIZE 20
88
92#ifndef USB_EPT_MAX_NUM
93#define USB_EPT_MAX_NUM 4
94#endif
95#endif
96
100#ifdef USE_OTG_HOST_MODE
101#ifndef USB_HOST_CHANNEL_NUM
102#define USB_HOST_CHANNEL_NUM 8
103#endif
104
108/* otg1 host fifo */
109#define USBH_RX_FIFO_SIZE 128
110#define USBH_NP_TX_FIFO_SIZE 96
111#define USBH_P_TX_FIFO_SIZE 96
112#endif
113
117/* #define USB_SOF_OUTPUT_ENABLE */
118
129/* #define USB_VBUS_IGNORE */
130
134/* #define USB_LOW_POWER_WAKUP */
135
136void usb_delay_ms(uint32_t ms);
137void usb_delay_us(uint32_t us);
138
146#ifdef __cplusplus
147}
148#endif
149
150#endif
at32f415.h
at32f415 header file
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/main.c:218
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/main.c:229


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usb_device
  • custom_hid
  • src
project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usb_device
  • custom_hid
  • src
project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usb_device
  • custom_hid
  • src
project/at_start_f415/examples/usb_device/custom_hid/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbd_int.h"
32#include "custom_hid_class.h"
33#include "custom_hid_desc.h"
34
43/* usb global struct define */
44 otg_core_type otg_core_struct;
45uint8_t report_buf[USBD_IN_MAXPACKET_SIZE];
46void usb_clock48m_select(usb_clk48_s clk_s);
47void usb_gpio_config(void);
48void usb_low_power_wakeup_config(void);
49
55int main(void)
56{
57 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
58
59 system_clock_config();
60
61 at32_board_init();
62
63 /* usb gpio config */
64 usb_gpio_config();
65
66#ifdef USB_LOW_POWER_WAKUP
67 usb_low_power_wakeup_config();
68#endif
69
70 /* enable otgfs clock */
71 crm_periph_clock_enable(OTG_CLOCK, TRUE);
72
73 /* select usb 48m clcok source */
74 usb_clock48m_select(USB_CLK_HEXT);
75
76 /* enable otgfs irq */
77 nvic_irq_enable(OTG_IRQ, 0, 0);
78
79 /* init usb */
80 usbd_init(&otg_core_struct,
81 USB_FULL_SPEED_CORE_ID,
82 USB_ID,
83 &custom_hid_class_handler,
84 &hid_desc_handler);
85
86 while(1)
87 {
88 if(at32_button_press() == USER_BUTTON)
89 {
90 report_buf[0] = HID_REPORT_ID_5;
91 report_buf[1] = (~report_buf[1]) & 0x1;
92 class_send_report(&otg_core_struct.dev, report_buf, USBD_IN_MAXPACKET_SIZE);
93 }
94 }
95}
96
102void usb_clock48m_select(usb_clk48_s clk_s)
103{
104 switch(system_core_clock)
105 {
106 /* 48MHz */
107 case 48000000:
108 crm_usb_clock_div_set(CRM_USB_DIV_1);
109 break;
110
111 /* 72MHz */
112 case 72000000:
113 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
114 break;
115
116 /* 96MHz */
117 case 96000000:
118 crm_usb_clock_div_set(CRM_USB_DIV_2);
119 break;
120
121 /* 120MHz */
122 case 120000000:
123 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
124 break;
125
126 /* 144MHz */
127 case 144000000:
128 crm_usb_clock_div_set(CRM_USB_DIV_3);
129 break;
130
131 default:
132 break;
133
134 }
135}
136
142void usb_gpio_config(void)
143{
144 gpio_init_type gpio_init_struct;
145
146 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
147 gpio_default_para_init(&gpio_init_struct);
148
149 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
150 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
151 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
152 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
153
154#ifdef USB_SOF_OUTPUT_ENABLE
155 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
156 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
157 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
158#endif
159
160 /* otgfs use vbus pin */
161#ifndef USB_VBUS_IGNORE
162 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
163 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
164 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
165 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
166#endif
167
168
169}
170#ifdef USB_LOW_POWER_WAKUP
176void usb_low_power_wakeup_config(void)
177{
178 exint_init_type exint_init_struct;
179
180 exint_default_para_init(&exint_init_struct);
181
182 exint_init_struct.line_enable = TRUE;
183 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
184 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
185 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
186 exint_init(&exint_init_struct);
187
188 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
189}
190
196void OTG_WKUP_HANDLER(void)
197{
198 exint_flag_clear(OTG_WKUP_EXINT_LINE);
199}
200
201#endif
202
208void OTG_IRQ_HANDLER(void)
209{
210 usbd_irq_handler(&otg_core_struct);
211}
212
218void usb_delay_ms(uint32_t ms)
219{
220 /* user can define self delay function */
221 delay_ms(ms);
222}
223
229void usb_delay_us(uint32_t us)
230{
231 delay_us(us);
232}
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
custom_hid_class.h
usb hid header file
custom_hid_desc.h
usb custom hid descriptor header file
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/main.c:102
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/main.c:55
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/main.c:142
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/main.c:208
report_buf
uint8_t report_buf[USBD_IN_MAXPACKET_SIZE]
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/main.c:45
otg_core_struct
otg_core_type otg_core_struct
Definition: project/at_start_f415/examples/usb_device/custom_hid/src/main.c:44
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
USBD_IN_MAXPACKET_SIZE
#define USBD_IN_MAXPACKET_SIZE
usb custom hid in and out max packet size define
Definition: audio_hid_class.h:67
class_send_report
usb_sts_type class_send_report(void *udev, uint8_t *report, uint16_t len)
usb device class send report
Definition: audio_hid_class.c:818
HID_REPORT_ID_5
#define HID_REPORT_ID_5
Definition: audio_hid_desc.h:227
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
custom_hid_class_handler
usbd_class_handler custom_hid_class_handler
Definition: custom_hid_class.c:66
hid_desc_handler
usbd_desc_handler hid_desc_handler
custom hid device descriptor handler structure
Definition: custom_hid_desc.c:63
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_int.h
usb interrupt header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usb_device
  • keyboard
  • inc
project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usb_device
  • keyboard
  • inc
project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usb_device
  • keyboard
  • inc
project/at_start_f415/examples/usb_device/keyboard/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • usb_device
  • keyboard
  • inc
project/at_start_f415/examples/usb_device/keyboard/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "stdio.h"
38
39
52#define USE_OTG_DEVICE_MODE
53
57/* #define USE_OTG_HOST_MODE */
58
59#define USB_ID 0
60#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
61#define OTG_IRQ OTGFS1_IRQn
62#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
63#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
64#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
65#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
66
67#define OTG_PIN_GPIO GPIOA
68#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
69#define OTG_PIN_VBUS GPIO_PINS_9
70#define OTG_PIN_ID GPIO_PINS_10
71
72#define OTG_PIN_SOF_GPIO GPIOA
73#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
74#define OTG_PIN_SOF GPIO_PINS_8
75
79#ifdef USE_OTG_DEVICE_MODE
83/* otg1 device fifo */
84#define USBD_RX_SIZE 128
85#define USBD_EP0_TX_SIZE 24
86#define USBD_EP1_TX_SIZE 20
87#define USBD_EP2_TX_SIZE 20
88#define USBD_EP3_TX_SIZE 20
89
93#ifndef USB_EPT_MAX_NUM
94#define USB_EPT_MAX_NUM 4
95#endif
96#endif
97
101#ifdef USE_OTG_HOST_MODE
102#ifndef USB_HOST_CHANNEL_NUM
103#define USB_HOST_CHANNEL_NUM 8
104#endif
105
109/* otg1 host fifo */
110#define USBH_RX_FIFO_SIZE 128
111#define USBH_NP_TX_FIFO_SIZE 96
112#define USBH_P_TX_FIFO_SIZE 96
113#endif
114
118/* #define USB_SOF_OUTPUT_ENABLE */
119
130/* #define USB_VBUS_IGNORE */
131
135#define USB_LOW_POWER_WAKUP
136
137void usb_delay_ms(uint32_t ms);
138void usb_delay_us(uint32_t us);
139
147#ifdef __cplusplus
148}
149#endif
150
151#endif
152
at32f415.h
at32f415 header file
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb delay millisecond function.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/main.c:358
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/main.c:369


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usb_device
  • keyboard
  • src
project/at_start_f415/examples/usb_device/keyboard/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usb_device/keyboard/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usb_device
  • keyboard
  • src
project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usb_device
  • keyboard
  • src
project/at_start_f415/examples/usb_device/keyboard/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbd_int.h"
32#include "keyboard_class.h"
33#include "keyboard_desc.h"
34
35
44/* usb global struct define */
45 otg_core_type otg_core_struct;
46extern __IO uint8_t hid_suspend_flag;
47void usb_clock48m_select(usb_clk48_s clk_s);
48void keyboard_send_string(uint8_t *string, uint8_t len);
49void usb_gpio_config(void);
50void usb_low_power_wakeup_config(void);
51void system_clock_recover(void);
52void button_exint_init(void);
53
60void keyboard_send_string(uint8_t *string, uint8_t len)
61{
62 __IO uint8_t index = 0;
63 for(index = 0; index < len; index ++)
64 {
65 while(1)
66 {
67 if(g_u8tx_completed == 1)
68 {
69 g_u8tx_completed = 0;
70 usb_hid_keyboard_send_char(&otg_core_struct.dev, string[index]);
71 break;
72 }
73 }
74 /* send 0x00 */
75 while(1)
76 {
77 if(g_u8tx_completed == 1)
78 {
79 g_u8tx_completed = 0;
80 usb_hid_keyboard_send_char(&otg_core_struct.dev, 0x00);
81 break;
82 }
83 }
84 }
85
86}
87
88
94int main(void)
95{
96 __IO uint32_t delay_index = 0;
97 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
98
99 system_clock_config();
100
101 at32_board_init();
102
103 /* usb gpio config */
104 usb_gpio_config();
105
106#ifdef USB_LOW_POWER_WAKUP
107 /* enable pwc and bpr clock */
108 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
109 button_exint_init();
110 usb_low_power_wakeup_config();
111#endif
112
113 /* enable otgfs clock */
114 crm_periph_clock_enable(OTG_CLOCK, TRUE);
115
116 /* select usb 48m clcok source */
117 usb_clock48m_select(USB_CLK_HEXT);
118
119 /* enable otgfs irq */
120 nvic_irq_enable(OTG_IRQ, 0, 0);
121
122 /* init usb */
123 usbd_init(&otg_core_struct,
124 USB_FULL_SPEED_CORE_ID,
125 USB_ID,
126 &keyboard_class_handler,
127 &keyboard_desc_handler);
128 at32_led_on(LED2);
129 at32_led_on(LED3);
130 at32_led_on(LED4);
131 while(1)
132 {
133 if(at32_button_press() == USER_BUTTON)
134 {
135 if(usbd_connect_state_get(&otg_core_struct.dev) == USB_CONN_STATE_CONFIGURED)
136 {
137 keyboard_send_string((uint8_t *)" Keyboard Demo\r\n", 16);
138 }
139 /* remote wakeup */
140 if(usbd_connect_state_get(&otg_core_struct.dev) == USB_CONN_STATE_SUSPENDED
141 && (otg_core_struct.dev.remote_wakup == 1))
142 {
143 usbd_remote_wakeup(&otg_core_struct.dev);
144 }
145 }
146
147#ifdef USB_LOW_POWER_WAKUP
148 /* enter deep sleep */
149 if(hid_suspend_flag == 1)
150 {
151 at32_led_off(LED2);
152 at32_led_off(LED3);
153 at32_led_off(LED4);
154 /* congfig the voltage regulator mode */
155 pwc_voltage_regulate_set(PWC_REGULATOR_LOW_POWER);
156
157 /* enter deep sleep mode */
158 pwc_deep_sleep_mode_enter(PWC_DEEP_SLEEP_ENTER_WFI);
159 /* wait clock stable */
160 for(delay_index = 0; delay_index < 600; delay_index++)
161 {
162 __NOP();
163 }
164 system_clock_recover();
165 hid_suspend_flag = 0;
166 at32_led_on(LED2);
167 at32_led_on(LED3);
168 at32_led_on(LED4);
169 }
170 #endif
171
172 }
173}
174
180void usb_clock48m_select(usb_clk48_s clk_s)
181{
182 switch(system_core_clock)
183 {
184 /* 48MHz */
185 case 48000000:
186 crm_usb_clock_div_set(CRM_USB_DIV_1);
187 break;
188
189 /* 72MHz */
190 case 72000000:
191 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
192 break;
193
194 /* 96MHz */
195 case 96000000:
196 crm_usb_clock_div_set(CRM_USB_DIV_2);
197 break;
198
199 /* 120MHz */
200 case 120000000:
201 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
202 break;
203
204 /* 144MHz */
205 case 144000000:
206 crm_usb_clock_div_set(CRM_USB_DIV_3);
207 break;
208
209 default:
210 break;
211
212 }
213}
214
220void usb_gpio_config(void)
221{
222 gpio_init_type gpio_init_struct;
223
224 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
225 gpio_default_para_init(&gpio_init_struct);
226
227 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
228 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
229 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
230 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
231
232#ifdef USB_SOF_OUTPUT_ENABLE
233 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
234 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
235 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
236#endif
237
238 /* otgfs use vbus pin */
239#ifndef USB_VBUS_IGNORE
240 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
241 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
242 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
243 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
244#endif
245
246
247}
248#ifdef USB_LOW_POWER_WAKUP
254void usb_low_power_wakeup_config(void)
255{
256 exint_init_type exint_init_struct;
257
258 exint_default_para_init(&exint_init_struct);
259
260 exint_init_struct.line_enable = TRUE;
261 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
262 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
263 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
264 exint_init(&exint_init_struct);
265
266 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
267}
268
274void system_clock_recover(void)
275{
276 /* enable external high-speed crystal oscillator - hext */
277 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
278
279 /* wait till hext is ready */
280 while(crm_hext_stable_wait() == ERROR);
281
282 /* enable pll */
283 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
284
285 /* wait till pll is ready */
286 while(crm_flag_get(CRM_PLL_STABLE_FLAG) == RESET);
287
288 /* enable auto step mode */
289 crm_auto_step_mode_enable(TRUE);
290
291 /* select pll as system clock source */
292 crm_sysclk_switch(CRM_SCLK_PLL);
293
294 /* wait till pll is used as system clock source */
295 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL);
296}
297
303void button_exint_init(void)
304{
305 exint_init_type exint_init_struct;
306
307 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
308 gpio_exint_line_config(GPIO_PORT_SOURCE_GPIOA, GPIO_PINS_SOURCE0);
309
310 exint_default_para_init(&exint_init_struct);
311 exint_init_struct.line_enable = TRUE;
312 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
313 exint_init_struct.line_select = EXINT_LINE_0;
314 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
315 exint_init(&exint_init_struct);
316
317 nvic_irq_enable(EXINT0_IRQn, 0, 0);
318}
319
325void OTG_WKUP_HANDLER(void)
326{
327 exint_flag_clear(OTG_WKUP_EXINT_LINE);
328}
329
335void EXINT0_IRQHandler(void)
336{
337 exint_flag_clear(EXINT_LINE_0);
338}
339
340
341#endif
342
348void OTG_IRQ_HANDLER(void)
349{
350 usbd_irq_handler(&otg_core_struct);
351}
352
358void usb_delay_ms(uint32_t ms)
359{
360 /* user can define self delay function */
361 delay_ms(ms);
362}
363
369void usb_delay_us(uint32_t us)
370{
371 delay_us(us);
372}
373
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
EXINT0_IRQHandler
void EXINT0_IRQHandler(void)
exint0 interrupt handler
Definition: project/at_start_f415/examples/exint/exint_config/src/main.c:96
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
hid_suspend_flag
__IO uint8_t hid_suspend_flag
Definition: keyboard_class.c:59
button_exint_init
void button_exint_init(void)
configure button exint
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:62
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: project/at_start_f415/examples/usb_device/keyboard/src/main.c:180
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/main.c:94
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/main.c:220
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: project/at_start_f415/examples/usb_device/keyboard/src/main.c:348
keyboard_send_string
void keyboard_send_string(uint8_t *string, uint8_t len)
keyboard send string
Definition: project/at_start_f415/examples/usb_device/keyboard/src/main.c:60
otg_core_struct
otg_core_type otg_core_struct
Definition: project/at_start_f415/examples/usb_device/keyboard/src/main.c:45
system_clock_recover
void system_clock_recover(void)
systemclock recover.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c:140
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
EXINT0_IRQn
@ EXINT0_IRQn
Definition: at32f415.h:141
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_0
#define EXINT_LINE_0
Definition: at32f415_exint.h:52
ERROR
@ ERROR
Definition: at32f415.h:258
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_exint_line_config
void gpio_exint_line_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line.
Definition: at32f415_gpio.c:577
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PINS_SOURCE0
@ GPIO_PINS_SOURCE0
Definition: at32f415_gpio.h:268
GPIO_PORT_SOURCE_GPIOA
@ GPIO_PORT_SOURCE_GPIOA
Definition: at32f415_gpio.h:291
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_voltage_regulate_set
void pwc_voltage_regulate_set(pwc_regulator_type pwc_regulator)
regulate low power consumption in the deep sleep mode
Definition: at32f415_pwc.c:213
pwc_deep_sleep_mode_enter
void pwc_deep_sleep_mode_enter(pwc_deep_sleep_enter_type pwc_deep_sleep_enter)
enter pwc deep-sleep mode
Definition: at32f415_pwc.c:189
PWC_REGULATOR_LOW_POWER
@ PWC_REGULATOR_LOW_POWER
Definition: at32f415_pwc.h:107
PWC_DEEP_SLEEP_ENTER_WFI
@ PWC_DEEP_SLEEP_ENTER_WFI
Definition: at32f415_pwc.h:97
usb_hid_keyboard_send_char
void usb_hid_keyboard_send_char(void *udev, uint8_t ascii_code)
usb keyoard send char
Definition: cdc_keyboard_class.c:686
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
g_u8tx_completed
__IO uint8_t g_u8tx_completed
Definition: keyboard_class.c:60
keyboard_class_handler
usbd_class_handler keyboard_class_handler
Definition: keyboard_class.c:197
keyboard_desc_handler
usbd_desc_handler keyboard_desc_handler
keyboard device descriptor handler structure
Definition: keyboard_desc.c:63
USB_CONN_STATE_SUSPENDED
@ USB_CONN_STATE_SUSPENDED
Definition: usb_std.h:132
USB_CONN_STATE_CONFIGURED
@ USB_CONN_STATE_CONFIGURED
Definition: usb_std.h:131
usbd_connect_state_get
usbd_conn_state usbd_connect_state_get(usbd_core_type *udev)
get usb connect state
Definition: usbd_core.c:592
usbd_remote_wakeup
void usbd_remote_wakeup(usbd_core_type *udev)
usb device remote wakeup
Definition: usbd_core.c:602
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
keyboard_class.h
usb hid keyboard header file
keyboard_desc.h
usb keyboard descriptor header file
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_int.h
usb interrupt header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usb_device
  • mouse
  • inc
project/at_start_f415/examples/usb_device/mouse/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usb_device
  • mouse
  • inc
project/at_start_f415/examples/usb_device/mouse/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usb_device
  • mouse
  • inc
project/at_start_f415/examples/usb_device/mouse/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • usb_device
  • mouse
  • inc
project/at_start_f415/examples/usb_device/mouse/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "stdio.h"
38
39
52#define USE_OTG_DEVICE_MODE
53
57/* #define USE_OTG_HOST_MODE */
58
62#define USB_ID 0
63#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
64#define OTG_IRQ OTGFS1_IRQn
65#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
66#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
67#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
68#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
69
70#define OTG_PIN_GPIO GPIOA
71#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
72
73#define OTG_PIN_DP GPIO_PINS_12
74#define OTG_PIN_DM GPIO_PINS_11
75#define OTG_PIN_VBUS GPIO_PINS_9
76#define OTG_PIN_ID GPIO_PINS_10
77
78#define OTG_PIN_SOF_GPIO GPIOA
79#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
80#define OTG_PIN_SOF GPIO_PINS_8
81
82
86#ifdef USE_OTG_DEVICE_MODE
90/* otg1 device fifo */
91#define USBD_RX_SIZE 128
92#define USBD_EP0_TX_SIZE 24
93#define USBD_EP1_TX_SIZE 20
94#define USBD_EP2_TX_SIZE 20
95#define USBD_EP3_TX_SIZE 20
96
100#ifndef USB_EPT_MAX_NUM
101#define USB_EPT_MAX_NUM 4
102#endif
103#endif
104
108#ifdef USE_OTG_HOST_MODE
109#ifndef USB_HOST_CHANNEL_NUM
110#define USB_HOST_CHANNEL_NUM 8
111#endif
112
116/* otg1 host fifo */
117#define USBH_RX_FIFO_SIZE 128
118#define USBH_NP_TX_FIFO_SIZE 96
119#define USBH_P_TX_FIFO_SIZE 96
120#endif
121
125/* #define USB_SOF_OUTPUT_ENABLE */
126
137/* #define USB_VBUS_IGNORE */
138
142#define USB_LOW_POWER_WAKUP
143
144void usb_delay_ms(uint32_t ms);
145void usb_delay_us(uint32_t us);
146
147
155#ifdef __cplusplus
156}
157#endif
158
159#endif
160
at32f415.h
at32f415 header file
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb delay millisecond function.
Definition: project/at_start_f415/examples/usb_device/mouse/src/main.c:329
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/mouse/src/main.c:340


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usb_device
  • mouse
  • src
project/at_start_f415/examples/usb_device/mouse/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usb_device/mouse/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usb_device
  • mouse
  • src
project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usb_device/mouse/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usb_device
  • mouse
  • src
project/at_start_f415/examples/usb_device/mouse/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbd_int.h"
32#include "mouse_class.h"
33#include "mouse_desc.h"
34
43/* usb global struct define */
44 otg_core_type otg_core_struct;
45__IO uint8_t press_mouse = 0;
46extern __IO uint8_t hid_suspend_flag;
47void usb_clock48m_select(usb_clk48_s clk_s);
48void keyboard_send_string(uint8_t *string, uint8_t len);
49void usb_gpio_config(void);
50void usb_low_power_wakeup_config(void);
51void system_clock_recover(void);
52void button_exint_init(void);
53
59int main(void)
60{
61 __IO uint32_t delay_index = 0;
62 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
63
64 system_clock_config();
65
66 at32_board_init();
67
68 /* usb gpio config */
69 usb_gpio_config();
70
71#ifdef USB_LOW_POWER_WAKUP
72 /* enable pwc and bpr clock */
73 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
74 button_exint_init();
75 usb_low_power_wakeup_config();
76#endif
77
78 /* enable otgfs clock */
79 crm_periph_clock_enable(OTG_CLOCK, TRUE);
80
81 /* select usb 48m clcok source */
82 usb_clock48m_select(USB_CLK_HEXT);
83
84 /* enable otgfs irq */
85 nvic_irq_enable(OTG_IRQ, 0, 0);
86
87 /* init usb */
88 usbd_init(&otg_core_struct,
89 USB_FULL_SPEED_CORE_ID,
90 USB_ID,
91 &mouse_class_handler,
92 &mouse_desc_handler);
93
94 at32_led_on(LED2);
95 at32_led_on(LED3);
96 at32_led_on(LED4);
97 while(1)
98 {
99 if(at32_button_press() == USER_BUTTON)
100 {
101 if(usbd_connect_state_get(&otg_core_struct.dev) == USB_CONN_STATE_CONFIGURED)
102 {
103 usb_hid_mouse_send(&otg_core_struct.dev, RIGHT_BUTTON);
104 press_mouse = 1;
105 }
106 /* remote wakeup */
107 if(usbd_connect_state_get(&otg_core_struct.dev) == USB_CONN_STATE_SUSPENDED
108 && (otg_core_struct.dev.remote_wakup == 1))
109 {
110 usbd_remote_wakeup(&otg_core_struct.dev);
111 }
112 }
113 else if(press_mouse == 1)
114 {
115 delay_ms(10);
116 usb_hid_mouse_send(&otg_core_struct.dev, BUTTON_RELEASE);
117 press_mouse = 0;
118
119 }
120 #ifdef USB_LOW_POWER_WAKUP
121 /* enter deep sleep */
122 if(hid_suspend_flag == 1)
123 {
124 at32_led_off(LED2);
125 at32_led_off(LED3);
126 at32_led_off(LED4);
127 /* congfig the voltage regulator mode */
128 pwc_voltage_regulate_set(PWC_REGULATOR_LOW_POWER);
129
130 /* enter deep sleep mode */
131 pwc_deep_sleep_mode_enter(PWC_DEEP_SLEEP_ENTER_WFI);
132 /* wait clock stable */
133 for(delay_index = 0; delay_index < 600; delay_index++)
134 {
135 __NOP();
136 }
137 system_clock_recover();
138 hid_suspend_flag = 0;
139 at32_led_on(LED2);
140 at32_led_on(LED3);
141 at32_led_on(LED4);
142 }
143 #endif
144 }
145}
146
152void usb_clock48m_select(usb_clk48_s clk_s)
153{
154 switch(system_core_clock)
155 {
156 /* 48MHz */
157 case 48000000:
158 crm_usb_clock_div_set(CRM_USB_DIV_1);
159 break;
160
161 /* 72MHz */
162 case 72000000:
163 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
164 break;
165
166 /* 96MHz */
167 case 96000000:
168 crm_usb_clock_div_set(CRM_USB_DIV_2);
169 break;
170
171 /* 120MHz */
172 case 120000000:
173 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
174 break;
175
176 /* 144MHz */
177 case 144000000:
178 crm_usb_clock_div_set(CRM_USB_DIV_3);
179 break;
180
181 default:
182 break;
183
184 }
185}
186
192void usb_gpio_config(void)
193{
194 gpio_init_type gpio_init_struct;
195
196 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
197 gpio_default_para_init(&gpio_init_struct);
198
199 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
200 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
201 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
202 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
203
204#ifdef USB_SOF_OUTPUT_ENABLE
205 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
206 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
207 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
208#endif
209
210 /* otgfs use vbus pin */
211#ifndef USB_VBUS_IGNORE
212 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
213 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
214 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
215 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
216#endif
217
218
219}
220#ifdef USB_LOW_POWER_WAKUP
226void usb_low_power_wakeup_config(void)
227{
228 exint_init_type exint_init_struct;
229
230 exint_default_para_init(&exint_init_struct);
231
232 exint_init_struct.line_enable = TRUE;
233 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
234 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
235 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
236 exint_init(&exint_init_struct);
237
238 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
239}
240
246void system_clock_recover(void)
247{
248 /* enable external high-speed crystal oscillator - hext */
249 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
250
251 /* wait till hext is ready */
252 while(crm_hext_stable_wait() == ERROR);
253
254 /* enable pll */
255 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
256
257 /* wait till pll is ready */
258 while(crm_flag_get(CRM_PLL_STABLE_FLAG) == RESET);
259
260 /* enable auto step mode */
261 crm_auto_step_mode_enable(TRUE);
262
263 /* select pll as system clock source */
264 crm_sysclk_switch(CRM_SCLK_PLL);
265
266 /* wait till pll is used as system clock source */
267 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL);
268}
269
275void button_exint_init(void)
276{
277 exint_init_type exint_init_struct;
278
279 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
280 gpio_exint_line_config(GPIO_PORT_SOURCE_GPIOA, GPIO_PINS_SOURCE0);
281
282 exint_default_para_init(&exint_init_struct);
283 exint_init_struct.line_enable = TRUE;
284 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
285 exint_init_struct.line_select = EXINT_LINE_0;
286 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
287 exint_init(&exint_init_struct);
288
289 nvic_irq_enable(EXINT0_IRQn, 0, 0);
290}
291
297void OTG_WKUP_HANDLER(void)
298{
299 exint_flag_clear(OTG_WKUP_EXINT_LINE);
300}
301
307void EXINT0_IRQHandler(void)
308{
309 exint_flag_clear(EXINT_LINE_0);
310}
311
312#endif
313
319void OTG_IRQ_HANDLER(void)
320{
321 usbd_irq_handler(&otg_core_struct);
322}
323
329void usb_delay_ms(uint32_t ms)
330{
331 /* user can define self delay function */
332 delay_ms(ms);
333}
334
340void usb_delay_us(uint32_t us)
341{
342 delay_us(us);
343}
344
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
EXINT0_IRQHandler
void EXINT0_IRQHandler(void)
exint0 interrupt handler
Definition: project/at_start_f415/examples/exint/exint_config/src/main.c:96
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
hid_suspend_flag
__IO uint8_t hid_suspend_flag
Definition: keyboard_class.c:59
button_exint_init
void button_exint_init(void)
configure button exint
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:62
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: project/at_start_f415/examples/usb_device/mouse/src/main.c:152
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usb_device/mouse/src/main.c:59
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: project/at_start_f415/examples/usb_device/mouse/src/main.c:192
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: project/at_start_f415/examples/usb_device/mouse/src/main.c:319
press_mouse
__IO uint8_t press_mouse
Definition: project/at_start_f415/examples/usb_device/mouse/src/main.c:45
keyboard_send_string
void keyboard_send_string(uint8_t *string, uint8_t len)
keyboard send string
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:112
otg_core_struct
otg_core_type otg_core_struct
Definition: project/at_start_f415/examples/usb_device/mouse/src/main.c:44
system_clock_recover
void system_clock_recover(void)
systemclock recover.
Definition: project/at_start_f415/examples/pwc/deepsleep_ertc_alarm/src/main.c:140
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
EXINT0_IRQn
@ EXINT0_IRQn
Definition: at32f415.h:141
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_0
#define EXINT_LINE_0
Definition: at32f415_exint.h:52
ERROR
@ ERROR
Definition: at32f415.h:258
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_exint_line_config
void gpio_exint_line_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line.
Definition: at32f415_gpio.c:577
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PINS_SOURCE0
@ GPIO_PINS_SOURCE0
Definition: at32f415_gpio.h:268
GPIO_PORT_SOURCE_GPIOA
@ GPIO_PORT_SOURCE_GPIOA
Definition: at32f415_gpio.h:291
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
pwc_voltage_regulate_set
void pwc_voltage_regulate_set(pwc_regulator_type pwc_regulator)
regulate low power consumption in the deep sleep mode
Definition: at32f415_pwc.c:213
pwc_deep_sleep_mode_enter
void pwc_deep_sleep_mode_enter(pwc_deep_sleep_enter_type pwc_deep_sleep_enter)
enter pwc deep-sleep mode
Definition: at32f415_pwc.c:189
PWC_REGULATOR_LOW_POWER
@ PWC_REGULATOR_LOW_POWER
Definition: at32f415_pwc.h:107
PWC_DEEP_SLEEP_ENTER_WFI
@ PWC_DEEP_SLEEP_ENTER_WFI
Definition: at32f415_pwc.h:97
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
mouse_class_handler
usbd_class_handler mouse_class_handler
Definition: mouse_class.c:62
usb_hid_mouse_send
void usb_hid_mouse_send(void *udev, uint8_t op)
usb device class report function
Definition: mouse_class.c:315
BUTTON_RELEASE
#define BUTTON_RELEASE
Definition: mouse_class.h:85
RIGHT_BUTTON
#define RIGHT_BUTTON
Definition: mouse_class.h:87
mouse_desc_handler
usbd_desc_handler mouse_desc_handler
mouse device descriptor handler structure
Definition: mouse_desc.c:63
USB_CONN_STATE_SUSPENDED
@ USB_CONN_STATE_SUSPENDED
Definition: usb_std.h:132
USB_CONN_STATE_CONFIGURED
@ USB_CONN_STATE_CONFIGURED
Definition: usb_std.h:131
usbd_connect_state_get
usbd_conn_state usbd_connect_state_get(usbd_core_type *udev)
get usb connect state
Definition: usbd_core.c:592
usbd_remote_wakeup
void usbd_remote_wakeup(usbd_core_type *udev)
usb device remote wakeup
Definition: usbd_core.c:602
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
mouse_class.h
usb hid mouse header file
mouse_desc.h
usb mouse descriptor header file
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_int.h
usb interrupt header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usb_device
  • msc
  • inc
project/at_start_f415/examples/usb_device/msc/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usb_device
  • msc
  • inc
project/at_start_f415/examples/usb_device/msc/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usb_device
  • msc
  • inc
project/at_start_f415/examples/usb_device/msc/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • usb_device
  • msc
  • inc
project/at_start_f415/examples/usb_device/msc/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "stdio.h"
38
39
52#define USE_OTG_DEVICE_MODE
53
57/* #define USE_OTG_HOST_MODE */
58
59#define USB_ID 0
60#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
61#define OTG_IRQ OTGFS1_IRQn
62#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
63#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
64#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
65#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
66
67#define OTG_PIN_GPIO GPIOA
68#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
69#define OTG_PIN_VBUS GPIO_PINS_9
70#define OTG_PIN_ID GPIO_PINS_10
71
72#define OTG_PIN_SOF_GPIO GPIOA
73#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
74#define OTG_PIN_SOF GPIO_PINS_8
75
79#ifdef USE_OTG_DEVICE_MODE
83/* otg1 device fifo */
84#define USBD_RX_SIZE 128
85#define USBD_EP0_TX_SIZE 24
86#define USBD_EP1_TX_SIZE 20
87#define USBD_EP2_TX_SIZE 20
88#define USBD_EP3_TX_SIZE 20
89
93#ifndef USB_EPT_MAX_NUM
94#define USB_EPT_MAX_NUM 4
95#endif
96#endif
97
101#ifdef USE_OTG_HOST_MODE
102#ifndef USB_HOST_CHANNEL_NUM
103#define USB_HOST_CHANNEL_NUM 8
104#endif
105
109/* otg1 host fifo */
110#define USBH_RX_FIFO_SIZE 128
111#define USBH_NP_TX_FIFO_SIZE 96
112#define USBH_P_TX_FIFO_SIZE 96
113#endif
114
118/* #define USB_SOF_OUTPUT_ENABLE */
119
130/* #define USB_VBUS_IGNORE */
131
135/* #define USB_LOW_POWER_WAKUP */
136
137void usb_delay_ms(uint32_t ms);
138void usb_delay_us(uint32_t us);
139
147#ifdef __cplusplus
148}
149#endif
150
151#endif
152
at32f415.h
at32f415 header file
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/msc/src/main.c:214
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/msc/src/main.c:225


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usb_device
  • msc
  • src
project/at_start_f415/examples/usb_device/msc/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usb_device/msc/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usb_device
  • msc
  • src
project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usb_device/msc/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usb_device
  • msc
  • src
project/at_start_f415/examples/usb_device/msc/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbd_int.h"
32#include "msc_class.h"
33#include "msc_desc.h"
34
35
36
45/* usb global struct define */
46 otg_core_type otg_core_struct;
47void usb_clock48m_select(usb_clk48_s clk_s);
48void usb_gpio_config(void);
49void usb_low_power_wakeup_config(void);
50
56int main(void)
57{
58 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
59
60 system_clock_config();
61
62 at32_board_init();
63
64 /* usb gpio config */
65 usb_gpio_config();
66
67#ifdef USB_LOW_POWER_WAKUP
68 usb_low_power_wakeup_config();
69#endif
70
71 /* enable otgfs clock */
72 crm_periph_clock_enable(OTG_CLOCK, TRUE);
73
74 /* select usb 48m clcok source */
75 usb_clock48m_select(USB_CLK_HEXT);
76
77 /* enable otgfs irq */
78 nvic_irq_enable(OTG_IRQ, 0, 0);
79
80 /* init usb */
81 usbd_init(&otg_core_struct,
82 USB_FULL_SPEED_CORE_ID,
83 USB_ID,
84 &msc_class_handler,
85 &msc_desc_handler);
86
87 while(1)
88 {
89
90 }
91}
92
98void usb_clock48m_select(usb_clk48_s clk_s)
99{
100 switch(system_core_clock)
101 {
102 /* 48MHz */
103 case 48000000:
104 crm_usb_clock_div_set(CRM_USB_DIV_1);
105 break;
106
107 /* 72MHz */
108 case 72000000:
109 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
110 break;
111
112 /* 96MHz */
113 case 96000000:
114 crm_usb_clock_div_set(CRM_USB_DIV_2);
115 break;
116
117 /* 120MHz */
118 case 120000000:
119 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
120 break;
121
122 /* 144MHz */
123 case 144000000:
124 crm_usb_clock_div_set(CRM_USB_DIV_3);
125 break;
126
127 default:
128 break;
129
130 }
131}
132
138void usb_gpio_config(void)
139{
140 gpio_init_type gpio_init_struct;
141
142 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
143 gpio_default_para_init(&gpio_init_struct);
144
145 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
146 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
147 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
148 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
149
150#ifdef USB_SOF_OUTPUT_ENABLE
151 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
152 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
153 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
154#endif
155
156 /* otgfs use vbus pin */
157#ifndef USB_VBUS_IGNORE
158 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
159 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
160 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
161 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
162#endif
163
164
165}
166#ifdef USB_LOW_POWER_WAKUP
172void usb_low_power_wakeup_config(void)
173{
174 exint_init_type exint_init_struct;
175
176 exint_default_para_init(&exint_init_struct);
177
178 exint_init_struct.line_enable = TRUE;
179 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
180 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
181 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
182 exint_init(&exint_init_struct);
183
184 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
185}
186
192void OTG_WKUP_HANDLER(void)
193{
194 exint_flag_clear(OTG_WKUP_EXINT_LINE);
195}
196
197#endif
198
204void OTG_IRQ_HANDLER(void)
205{
206 usbd_irq_handler(&otg_core_struct);
207}
208
214void usb_delay_ms(uint32_t ms)
215{
216 /* user can define self delay function */
217 delay_ms(ms);
218}
219
225void usb_delay_us(uint32_t us)
226{
227 delay_us(us);
228}
229
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: project/at_start_f415/examples/usb_device/msc/src/main.c:98
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usb_device/msc/src/main.c:56
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: project/at_start_f415/examples/usb_device/msc/src/main.c:138
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: project/at_start_f415/examples/usb_device/msc/src/main.c:204
otg_core_struct
otg_core_type otg_core_struct
Definition: project/at_start_f415/examples/usb_device/msc/src/main.c:46
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
msc_class_handler
usbd_class_handler msc_class_handler
Definition: msc_class.c:62
msc_desc_handler
usbd_desc_handler msc_desc_handler
device descriptor handler structure
Definition: msc_desc.c:64
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
msc_class.h
usb msc class file
msc_desc.h
usb msc descriptor header file
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_int.h
usb interrupt header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usb_device
  • printer
  • inc
project/at_start_f415/examples/usb_device/printer/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usb_device
  • printer
  • inc
project/at_start_f415/examples/usb_device/printer/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usb_device
  • printer
  • inc
project/at_start_f415/examples/usb_device/printer/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • usb_device
  • printer
  • inc
project/at_start_f415/examples/usb_device/printer/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "stdio.h"
38
51#define USE_OTG_DEVICE_MODE
52
56/* #define USE_OTG_HOST_MODE */
57
58#define USB_ID 0
59#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
60#define OTG_IRQ OTGFS1_IRQn
61#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
62#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
63#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
64#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
65
66#define OTG_PIN_GPIO GPIOA
67#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
68#define OTG_PIN_VBUS GPIO_PINS_9
69#define OTG_PIN_ID GPIO_PINS_10
70
71
72#define OTG_PIN_SOF_GPIO GPIOA
73#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
74#define OTG_PIN_SOF GPIO_PINS_8
75
76
80#ifdef USE_OTG_DEVICE_MODE
84/* otg1 device fifo */
85#define USBD_RX_SIZE 128
86#define USBD_EP0_TX_SIZE 24
87#define USBD_EP1_TX_SIZE 20
88#define USBD_EP2_TX_SIZE 20
89#define USBD_EP3_TX_SIZE 20
90
94#ifndef USB_EPT_MAX_NUM
95#define USB_EPT_MAX_NUM 4
96#endif
97#endif
98
102#ifdef USE_OTG_HOST_MODE
103#ifndef USB_HOST_CHANNEL_NUM
104#define USB_HOST_CHANNEL_NUM 8
105#endif
106
110/* otg1 host fifo */
111#define USBH_RX_FIFO_SIZE 128
112#define USBH_NP_TX_FIFO_SIZE 96
113#define USBH_P_TX_FIFO_SIZE 96
114#endif
115
119/* #define USB_SOF_OUTPUT_ENABLE */
120
131/* #define USB_VBUS_IGNORE */
132
136/* #define USB_LOW_POWER_WAKUP */
137
138void usb_delay_ms(uint32_t ms);
139void usb_delay_us(uint32_t us);
140
148#ifdef __cplusplus
149}
150#endif
151
152#endif
at32f415.h
at32f415 header file
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/printer/src/main.c:217
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/printer/src/main.c:228


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usb_device
  • printer
  • src
project/at_start_f415/examples/usb_device/printer/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usb_device/printer/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usb_device
  • printer
  • src
project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usb_device/printer/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usb_device
  • printer
  • src
project/at_start_f415/examples/usb_device/printer/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbd_int.h"
32#include "printer_class.h"
33#include "printer_desc.h"
34
44/* usb global struct define */
45 otg_core_type otg_core_struct;
46void usb_clock48m_select(usb_clk48_s clk_s);
47void usb_gpio_config(void);
48void usb_low_power_wakeup_config(void);
49
55int main(void)
56{
57 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
58
59 system_clock_config();
60
61 at32_board_init();
62
63 /* usb gpio config */
64 usb_gpio_config();
65
66#ifdef USB_LOW_POWER_WAKUP
67 usb_low_power_wakeup_config();
68#endif
69
70 /* enable otgfs clock */
71 crm_periph_clock_enable(OTG_CLOCK, TRUE);
72
73 /* select usb 48m clcok source */
74 usb_clock48m_select(USB_CLK_HEXT);
75
76 /* enable otgfs irq */
77 nvic_irq_enable(OTG_IRQ, 0, 0);
78
79 /* init usb */
80 usbd_init(&otg_core_struct,
81 USB_FULL_SPEED_CORE_ID,
82 USB_ID,
83 &class_handler,
84 &desc_handler);
85
86 while(1)
87 {
88 /* get usb vcp receive data */
89 /* usb_printer_get_rxdata(&otg_core_struct.dev, usb_buffer); */
90
91 /* user code ...*/
92 }
93}
94
100void usb_clock48m_select(usb_clk48_s clk_s)
101{
102 switch(system_core_clock)
103 {
104 /* 48MHz */
105 case 48000000:
106 crm_usb_clock_div_set(CRM_USB_DIV_1);
107 break;
108
109 /* 72MHz */
110 case 72000000:
111 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
112 break;
113
114 /* 96MHz */
115 case 96000000:
116 crm_usb_clock_div_set(CRM_USB_DIV_2);
117 break;
118
119 /* 120MHz */
120 case 120000000:
121 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
122 break;
123
124 /* 144MHz */
125 case 144000000:
126 crm_usb_clock_div_set(CRM_USB_DIV_3);
127 break;
128
129 default:
130 break;
131
132 }
133}
134
140void usb_gpio_config(void)
141{
142 gpio_init_type gpio_init_struct;
143
144 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
145 gpio_default_para_init(&gpio_init_struct);
146
147 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
148 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
149 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
150 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
151
152
153#ifdef USB_SOF_OUTPUT_ENABLE
154 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
155 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
156 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
157#endif
158
159 /* otgfs use vbus pin */
160#ifndef USB_VBUS_IGNORE
161 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
162 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
163 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
164 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
165#endif
166
167
168}
169#ifdef USB_LOW_POWER_WAKUP
175void usb_low_power_wakeup_config(void)
176{
177 exint_init_type exint_init_struct;
178
179 exint_default_para_init(&exint_init_struct);
180
181 exint_init_struct.line_enable = TRUE;
182 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
183 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
184 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
185 exint_init(&exint_init_struct);
186
187 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
188}
189
195void OTG_WKUP_HANDLER(void)
196{
197 exint_flag_clear(OTG_WKUP_EXINT_LINE);
198}
199
200#endif
201
207void OTG_IRQ_HANDLER(void)
208{
209 usbd_irq_handler(&otg_core_struct);
210}
211
217void usb_delay_ms(uint32_t ms)
218{
219 /* user can define self delay function */
220 delay_ms(ms);
221}
222
228void usb_delay_us(uint32_t us)
229{
230 delay_us(us);
231}
232
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: project/at_start_f415/examples/usb_device/printer/src/main.c:100
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usb_device/printer/src/main.c:55
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: project/at_start_f415/examples/usb_device/printer/src/main.c:140
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: project/at_start_f415/examples/usb_device/printer/src/main.c:207
otg_core_struct
otg_core_type otg_core_struct
Definition: project/at_start_f415/examples/usb_device/printer/src/main.c:45
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
class_handler
usbd_class_handler class_handler
Definition: cdc_class.c:75
desc_handler
usbd_desc_handler desc_handler
device descriptor handler structure
Definition: cdc_desc.c:64
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
printer_class.h
usb cdc class file
printer_desc.h
usb printer descriptor header file
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_int.h
usb interrupt header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usb_device
  • vcp_loopback
  • inc
project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usb_device
  • vcp_loopback
  • inc
project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usb_device
  • vcp_loopback
  • inc
project/at_start_f415/examples/usb_device/vcp_loopback/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • usb_device
  • vcp_loopback
  • inc
project/at_start_f415/examples/usb_device/vcp_loopback/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "stdio.h"
38
50#define USE_OTG_DEVICE_MODE
51
55/* #define USE_OTG_HOST_MODE */
56
57#define USB_ID 0
58#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
59#define OTG_IRQ OTGFS1_IRQn
60#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
61#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
62
63#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
64#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
65
66#define OTG_PIN_GPIO GPIOA
67#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
68#define OTG_PIN_VBUS GPIO_PINS_9
69#define OTG_PIN_ID GPIO_PINS_10
70
71#define OTG_PIN_SOF_GPIO GPIOA
72#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
73#define OTG_PIN_SOF GPIO_PINS_8
74
78#ifdef USE_OTG_DEVICE_MODE
82/* otg1 device fifo */
83#define USBD_RX_SIZE 128
84#define USBD_EP0_TX_SIZE 24
85#define USBD_EP1_TX_SIZE 20
86#define USBD_EP2_TX_SIZE 20
87#define USBD_EP3_TX_SIZE 20
88
92#ifndef USB_EPT_MAX_NUM
93#define USB_EPT_MAX_NUM 4
94#endif
95#endif
96
100#ifdef USE_OTG_HOST_MODE
101#ifndef USB_HOST_CHANNEL_NUM
102#define USB_HOST_CHANNEL_NUM 8
103#endif
104
108/* otg1 host fifo */
109#define USBH_RX_FIFO_SIZE 128
110#define USBH_NP_TX_FIFO_SIZE 96
111#define USBH_P_TX_FIFO_SIZE 96
112#endif
113
117/* #define USB_SOF_OUTPUT_ENABLE */
118
129/* #define USB_VBUS_IGNORE */
130
134/* #define USB_LOW_POWER_WAKUP */
135
136void usb_delay_ms(uint32_t ms);
137void usb_delay_us(uint32_t us);
145#ifdef __cplusplus
146}
147#endif
148
149#endif
at32f415.h
at32f415 header file
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c:242
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c:253


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usb_device
  • vcp_loopback
  • src
project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usb_device
  • vcp_loopback
  • src
project/at_start_f415/examples/usb_device/vcp_loopback/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usb_device
  • vcp_loopback
  • src
project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbd_int.h"
32#include "cdc_class.h"
33#include "cdc_desc.h"
34
43/* usb global struct define */
44 otg_core_type otg_core_struct;
45uint8_t usb_buffer[256];
46void usb_clock48m_select(usb_clk48_s clk_s);
47void usb_gpio_config(void);
48void usb_low_power_wakeup_config(void);
49
55int main(void)
56{
57 uint16_t data_len;
58
59 uint32_t timeout;
60
61 uint8_t send_zero_packet = 0;
62
63 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
64
65 system_clock_config();
66
67 at32_board_init();
68
69 /* usb gpio config */
70 usb_gpio_config();
71
72#ifdef USB_LOW_POWER_WAKUP
73 usb_low_power_wakeup_config();
74#endif
75
76 /* enable otgfs clock */
77 crm_periph_clock_enable(OTG_CLOCK, TRUE);
78
79 /* select usb 48m clcok source */
80 usb_clock48m_select(USB_CLK_HEXT);
81
82 /* enable otgfs irq */
83 nvic_irq_enable(OTG_IRQ, 0, 0);
84
85 /* init usb */
86 usbd_init(&otg_core_struct,
87 USB_FULL_SPEED_CORE_ID,
88 USB_ID,
89 &class_handler,
90 &desc_handler);
91 while(1)
92 {
93 /* get usb vcp receive data */
94 data_len = usb_vcp_get_rxdata(&otg_core_struct.dev, usb_buffer);
95
96 if(data_len > 0 || send_zero_packet == 1)
97 {
98
99 /* bulk transfer is complete when the endpoint does one of the following
100 1 has transferred exactly the amount of data expected
101 2 transfers a packet with a payload size less than wMaxPacketSize or transfers a zero-length packet
102 */
103 if(data_len > 0)
104 send_zero_packet = 1;
105
106 if(data_len == 0)
107 send_zero_packet = 0;
108
109 timeout = 50000;
110 do
111 {
112 /* send data to host */
113 if(usb_vcp_send_data(&otg_core_struct.dev, usb_buffer, data_len) == SUCCESS)
114 {
115 break;
116 }
117 }while(timeout --);
118 }
119 }
120}
121
127void usb_clock48m_select(usb_clk48_s clk_s)
128{
129 switch(system_core_clock)
130 {
131 /* 48MHz */
132 case 48000000:
133 crm_usb_clock_div_set(CRM_USB_DIV_1);
134 break;
135
136 /* 72MHz */
137 case 72000000:
138 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
139 break;
140
141 /* 96MHz */
142 case 96000000:
143 crm_usb_clock_div_set(CRM_USB_DIV_2);
144 break;
145
146 /* 120MHz */
147 case 120000000:
148 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
149 break;
150
151 /* 144MHz */
152 case 144000000:
153 crm_usb_clock_div_set(CRM_USB_DIV_3);
154 break;
155
156 default:
157 break;
158 }
159}
160
166void usb_gpio_config(void)
167{
168 gpio_init_type gpio_init_struct;
169
170 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
171 gpio_default_para_init(&gpio_init_struct);
172
173 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
174 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
175 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
176 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
177
178#ifdef USB_SOF_OUTPUT_ENABLE
179 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
180 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
181 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
182#endif
183
184 /* otgfs use vbus pin */
185#ifndef USB_VBUS_IGNORE
186 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
187 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
188 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
189 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
190#endif
191
192
193}
194#ifdef USB_LOW_POWER_WAKUP
200void usb_low_power_wakeup_config(void)
201{
202 exint_init_type exint_init_struct;
203
204 exint_default_para_init(&exint_init_struct);
205
206 exint_init_struct.line_enable = TRUE;
207 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
208 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
209 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
210 exint_init(&exint_init_struct);
211
212 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
213}
214
220void OTG_WKUP_HANDLER(void)
221{
222 exint_flag_clear(OTG_WKUP_EXINT_LINE);
223}
224
225#endif
226
232void OTG_IRQ_HANDLER(void)
233{
234 usbd_irq_handler(&otg_core_struct);
235}
236
242void usb_delay_ms(uint32_t ms)
243{
244 /* user can define self delay function */
245 delay_ms(ms);
246}
247
253void usb_delay_us(uint32_t us)
254{
255 delay_us(us);
256}
257
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
cdc_class.h
usb cdc class file
cdc_desc.h
usb cdc descriptor header file
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c:127
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c:55
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c:166
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c:232
usb_buffer
uint8_t usb_buffer[256]
Definition: project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c:45
otg_core_struct
otg_core_type otg_core_struct
Definition: project/at_start_f415/examples/usb_device/vcp_loopback/src/main.c:44
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
class_handler
usbd_class_handler class_handler
Definition: cdc_class.c:75
usb_vcp_get_rxdata
uint16_t usb_vcp_get_rxdata(void *udev, uint8_t *recv_data)
usb device class rx data process
Definition: cdc_class.c:322
usb_vcp_send_data
error_status usb_vcp_send_data(void *udev, uint8_t *send_data, uint16_t len)
usb device class send data
Definition: cdc_class.c:351
desc_handler
usbd_desc_handler desc_handler
device descriptor handler structure
Definition: cdc_desc.c:64
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_int.h
usb interrupt header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usb_device
  • virtual_msc_iap
  • inc
project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usb_device
  • virtual_msc_iap
  • inc
project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usb_device
  • virtual_msc_iap
  • inc
project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • usb_device
  • virtual_msc_iap
  • inc
project/at_start_f415/examples/usb_device/virtual_msc_iap/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "stdio.h"
38
39
52#define USE_OTG_DEVICE_MODE
53
57/* #define USE_OTG_HOST_MODE */
58
59#define USB_ID 0
60#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
61#define OTG_IRQ OTGFS1_IRQn
62#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
63#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
64#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
65#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
66
67#define OTG_PIN_GPIO GPIOA
68#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
69#define OTG_PIN_VBUS GPIO_PINS_9
70#define OTG_PIN_ID GPIO_PINS_10
71
72#define OTG_PIN_SOF_GPIO GPIOA
73#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
74#define OTG_PIN_SOF GPIO_PINS_8
75
79#ifdef USE_OTG_DEVICE_MODE
83/* otg1 device fifo */
84#define USBD_RX_SIZE 128
85#define USBD_EP0_TX_SIZE 24
86#define USBD_EP1_TX_SIZE 20
87#define USBD_EP2_TX_SIZE 20
88#define USBD_EP3_TX_SIZE 20
89
93#ifndef USB_EPT_MAX_NUM
94#define USB_EPT_MAX_NUM 4
95#endif
96#endif
97
101#ifdef USE_OTG_HOST_MODE
102#ifndef USB_HOST_CHANNEL_NUM
103#define USB_HOST_CHANNEL_NUM 8
104#endif
105
109/* otg1 host fifo */
110#define USBH_RX_FIFO_SIZE 128
111#define USBH_NP_TX_FIFO_SIZE 96
112#define USBH_P_TX_FIFO_SIZE 96
113#endif
114
118/* #define USB_SOF_OUTPUT_ENABLE */
119
130/* #define USB_VBUS_IGNORE */
131
135/* #define USB_LOW_POWER_WAKUP */
136
137void usb_delay_ms(uint32_t ms);
138void usb_delay_us(uint32_t us);
139
140
148#ifdef __cplusplus
149}
150#endif
151
152#endif
153
at32f415.h
at32f415 header file
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c:326
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c:337


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usb_device
  • virtual_msc_iap
  • src
project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usb_device
  • virtual_msc_iap
  • src
project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usb_device
  • virtual_msc_iap
  • src
project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbd_int.h"
32#include "msc_class.h"
33#include "msc_desc.h"
34#include "flash_fat16.h"
35
36
37
46/* usb global struct define */
47 otg_core_type otg_core_struct;
48void (*pftarget)(void);
49void usb_clock48m_select(usb_clk48_s clk_s);
50void usb_gpio_config(void);
51void usb_low_power_wakeup_config(void);
52void button_exint_init(button_type button);
53void button_isr(void);
54void jump_to_app(uint32_t address);
55void usb_re_connect(void);
56
57
63int main(void)
64{
65 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
66
67 system_clock_config();
68
69 flash_fat16_init();
70
71 at32_board_init();
72
73 if(flash_fat16_get_upgrade_flag() == IAP_SUCCESS &&
74 (at32_button_press() == NO_BUTTON))
75 {
76 jump_to_app(flash_iap.flash_app_addr);
77 }
78
79 /* usb gpio config */
80 usb_gpio_config();
81
82#ifdef USB_LOW_POWER_WAKUP
83 usb_low_power_wakeup_config();
84#endif
85
86 /* enable otgfs clock */
87 crm_periph_clock_enable(OTG_CLOCK, TRUE);
88
89 /* select usb 48m clcok source */
90 usb_clock48m_select(USB_CLK_HEXT);
91
92 /* enable otgfs irq */
93 nvic_irq_enable(OTG_IRQ, 0, 0);
94
95 /* init usb */
96 usbd_init(&otg_core_struct,
97 USB_FULL_SPEED_CORE_ID,
98 USB_ID,
99 &msc_class_handler,
100 &msc_desc_handler);
101
102 while(1)
103 {
104 flash_fat16_loop_status();
105 }
106}
107
113void usb_clock48m_select(usb_clk48_s clk_s)
114{
115 switch(system_core_clock)
116 {
117 /* 48MHz */
118 case 48000000:
119 crm_usb_clock_div_set(CRM_USB_DIV_1);
120 break;
121
122 /* 72MHz */
123 case 72000000:
124 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
125 break;
126
127 /* 96MHz */
128 case 96000000:
129 crm_usb_clock_div_set(CRM_USB_DIV_2);
130 break;
131
132 /* 120MHz */
133 case 120000000:
134 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
135 break;
136
137 /* 144MHz */
138 case 144000000:
139 crm_usb_clock_div_set(CRM_USB_DIV_3);
140 break;
141
142 default:
143 break;
144
145 }
146}
147
153void usb_gpio_config(void)
154{
155 gpio_init_type gpio_init_struct;
156
157 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
158 gpio_default_para_init(&gpio_init_struct);
159
160 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
161 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
162 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
163 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
164
165#ifdef USB_SOF_OUTPUT_ENABLE
166 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
167 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
168 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
169#endif
170
171 /* otgfs use vbus pin */
172#ifndef USB_VBUS_IGNORE
173 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
174 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
175 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
176 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
177#endif
178
179
180}
181#ifdef USB_LOW_POWER_WAKUP
187void usb_low_power_wakeup_config(void)
188{
189 exint_init_type exint_init_struct;
190
191 exint_default_para_init(&exint_init_struct);
192
193 exint_init_struct.line_enable = TRUE;
194 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
195 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
196 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
197 exint_init(&exint_init_struct);
198
199 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
200}
201
207void OTG_WKUP_HANDLER(void)
208{
209 exint_flag_clear(OTG_WKUP_EXINT_LINE);
210}
211
212#endif
213
214
220void usb_re_connect()
221{
222 delay_ms(1000);
223 usbd_disconnect(&otg_core_struct.dev);
224 delay_ms(1000);
225 usbd_connect(&otg_core_struct.dev);
226}
227
233void flash_fat16_loop_status(void)
234{
235 static uint8_t status = UPGRADE_READY;
236 if(status == flash_iap.msc_up_status)
237 {
238 return;
239 }
240 else
241 {
242 status = flash_iap.msc_up_status;
243 }
244
245 switch(flash_iap.msc_up_status)
246 {
247 case UPGRADE_READY:
248 flash_fat16_set_name((const uint8_t *)"Ready", 5);
249 break;
250 case UPGRAGE_ONGOING:
251 break;
252 case UPGRADE_SUCCESS:
253 flash_fat16_set_name((const uint8_t *)"Success", 7);
254 flash_iap.msc_up_status = UPGRADE_DONE;
255 usb_re_connect();
256 break;
257 case UPGRADE_ERROR:
258 flash_fat16_set_name((const uint8_t *)"error", 6);
259 flash_iap.msc_up_status = UPGRADE_DONE;
260 usb_re_connect();
261 break;
262 case UPGRADE_LARGE:
263 flash_fat16_set_name((const uint8_t *)"Large", 5);
264 flash_iap.msc_up_status = UPGRADE_DONE;
265 usb_re_connect();
266 break;
267 case UPGRADE_UNKNOWN:
268 flash_fat16_set_name((const uint8_t *)"Unkown", 6);
269 flash_iap.msc_up_status = UPGRADE_DONE;
270 break;
271 case UPGRADE_DONE:
272 break;
273 case UPGRADE_JUMP:
274 flash_fat16_set_name((const uint8_t *)"Jump", 6);
275 delay_ms(1000);
276 jump_to_app(flash_iap.write_addr);
277 break;
278 default:
279 break;
280 }
281
282}
283
284
290void jump_to_app(uint32_t address)
291{
292 uint32_t stkptr, jumpaddr;
293 stkptr = *(uint32_t *)address;
294 jumpaddr = *(uint32_t *)(address + sizeof(uint32_t));
295
296 /* disable nvic irq and periph clock, clear pending */
297 nvic_irq_disable(OTGFS1_IRQn);
298
299 __NVIC_ClearPendingIRQ(OTGFS1_IRQn);
300
301 crm_periph_clock_enable(CRM_OTGFS1_PERIPH_CLOCK, FALSE);
302
303 crm_periph_reset(CRM_OTGFS1_PERIPH_RESET, TRUE);
304 crm_periph_reset(CRM_OTGFS1_PERIPH_RESET, FALSE);
305
306 __set_MSP(stkptr);
307 pftarget = (void (*) (void))jumpaddr;
308 pftarget();
309}
310
316void OTG_IRQ_HANDLER(void)
317{
318 usbd_irq_handler(&otg_core_struct);
319}
320
326void usb_delay_ms(uint32_t ms)
327{
328 /* user can define self delay function */
329 delay_ms(ms);
330}
331
337void usb_delay_us(uint32_t us)
338{
339 delay_us(us);
340}
341
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
flash_fat16.h
fat16 file system header file
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
jump_to_app
void jump_to_app(uint32_t address)
jump to app
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c:290
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c:113
button_exint_init
void button_exint_init(button_type button)
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c:63
flash_fat16_loop_status
void flash_fat16_loop_status(void)
loop status
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c:233
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c:153
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c:316
usb_re_connect
void usb_re_connect(void)
usb re-connect
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c:220
button_isr
void button_isr(void)
button handler function
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:85
pftarget
void(* pftarget)(void)
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c:48
otg_core_struct
otg_core_type otg_core_struct
Definition: project/at_start_f415/examples/usb_device/virtual_msc_iap/src/main.c:47
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
button_type
button_type
Definition: at32f415_board.h:93
NO_BUTTON
@ NO_BUTTON
Definition: at32f415_board.h:95
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_periph_reset
void crm_periph_reset(crm_periph_reset_type value, confirm_state new_state)
enable or disable the peripheral reset
Definition: at32f415_crm.c:239
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_OTGFS1_PERIPH_CLOCK
@ CRM_OTGFS1_PERIPH_CLOCK
Definition: at32f415_crm.h:107
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
CRM_OTGFS1_PERIPH_RESET
@ CRM_OTGFS1_PERIPH_RESET
Definition: at32f415_crm.h:147
OTGFS1_IRQn
@ OTGFS1_IRQn
Definition: at32f415.h:187
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
nvic_irq_disable
void nvic_irq_disable(uint32_t irqn)
disable nvic irq number
Definition: at32f415_misc.c:81
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
flash_fat16_set_name
uint32_t flash_fat16_set_name(const uint8_t *file_name, uint8_t len)
set file name
Definition: flash_fat16.c:331
flash_fat16_get_upgrade_flag
uint8_t flash_fat16_get_upgrade_flag(void)
get iap upgrade complete flag
Definition: flash_fat16.c:248
flash_iap
flash_iap_type flash_iap
Definition: flash_fat16.c:145
flash_fat16_init
void flash_fat16_init(void)
flash fat16 iap init
Definition: flash_fat16.c:659
UPGRADE_ERROR
@ UPGRADE_ERROR
Definition: flash_fat16.h:85
UPGRADE_LARGE
@ UPGRADE_LARGE
Definition: flash_fat16.h:86
UPGRADE_UNKNOWN
@ UPGRADE_UNKNOWN
Definition: flash_fat16.h:87
UPGRADE_JUMP
@ UPGRADE_JUMP
Definition: flash_fat16.h:89
UPGRADE_SUCCESS
@ UPGRADE_SUCCESS
Definition: flash_fat16.h:84
UPGRADE_READY
@ UPGRADE_READY
Definition: flash_fat16.h:82
UPGRAGE_ONGOING
@ UPGRAGE_ONGOING
Definition: flash_fat16.h:83
UPGRADE_DONE
@ UPGRADE_DONE
Definition: flash_fat16.h:88
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
IAP_SUCCESS
@ IAP_SUCCESS
Definition: hid_iap_class.h:99
msc_class_handler
usbd_class_handler msc_class_handler
Definition: msc_class.c:62
msc_desc_handler
usbd_desc_handler msc_desc_handler
device descriptor handler structure
Definition: msc_desc.c:64
usbd_connect
void usbd_connect(usbd_core_type *udev)
usb device connect to host
Definition: usbd_core.c:364
usbd_disconnect
void usbd_disconnect(usbd_core_type *udev)
usb device disconnect to host
Definition: usbd_core.c:374
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
msc_class.h
usb msc class file
msc_desc.h
usb msc descriptor header file
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
flash_iap_type::msc_up_status
upgrade_status_type msc_up_status
Definition: flash_fat16.h:122
flash_iap_type::write_addr
uint32_t write_addr
Definition: flash_fat16.h:120
flash_iap_type::flash_app_addr
uint32_t flash_app_addr
Definition: flash_fat16.h:111
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_int.h
usb interrupt header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usb_host
  • hid_demo
  • inc
project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usb_host
  • hid_demo
  • inc
project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usb_host
  • hid_demo
  • inc
project/at_start_f415/examples/usb_host/hid_demo/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • usb_host
  • hid_demo
  • inc
project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "stdio.h"
38
50/* #define USE_OTG_DEVICE_MODE */
51
55#define USE_OTG_HOST_MODE
56
57
58
59#define USB_ID 0
60#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
61#define OTG_IRQ OTGFS1_IRQn
62#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
63#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
64#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
65#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
66
67#define OTG_PIN_GPIO GPIOA
68#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
69#define OTG_PIN_VBUS GPIO_PINS_9
70#define OTG_PIN_ID GPIO_PINS_10
71
72
73#define OTG_PIN_SOF_GPIO GPIOA
74#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
75#define OTG_PIN_SOF GPIO_PINS_8
76
77
78#define OTG_PIN_POWER_SWITCH_GPIO GPIOB
79#define OTG_PIN_POWER_SWITCH_CLOCK CRM_GPIOH_PERIPH_CLOCK
80#define OTG_PIN_POWER_SWITCH GPIO_PINS_3
81
82
86#ifdef USE_OTG_DEVICE_MODE
90/* otg1 device fifo */
91#define USBD_RX_SIZE 128
92#define USBD_EP0_TX_SIZE 24
93#define USBD_EP1_TX_SIZE 20
94#define USBD_EP2_TX_SIZE 20
95#define USBD_EP3_TX_SIZE 20
96
100#ifndef USB_EPT_MAX_NUM
101#define USB_EPT_MAX_NUM 4
102#endif
103#endif
104
108#ifdef USE_OTG_HOST_MODE
109
110#ifndef USB_HOST_CHANNEL_NUM
111#define USB_HOST_CHANNEL_NUM 8
112#endif
113
117/* otg1 host fifo */
118#define USBH_RX_FIFO_SIZE 128
119#define USBH_NP_TX_FIFO_SIZE 96
120#define USBH_P_TX_FIFO_SIZE 96
121
122/* usb host vbus power switch */
123//#define USBH_5V_POWER_SWITCH
124
125#endif
126
130/* #define USB_SOF_OUTPUT_ENABLE */
131
142/* #define USB_VBUS_IGNORE */
143
147/* #define USB_LOW_POWER_WAKUP */
148
149#define USBH_DEBUG_ENABLE
150
151#ifdef USBH_DEBUG_ENABLE
152#define USBH_DEBUG(...) printf(__VA_ARGS__);\
153 printf("\r\n");
154#else
155#define USBH_DEBUG(...)
156#endif
157
158void usb_delay_ms(uint32_t ms);
159void usb_delay_us(uint32_t us);
167#ifdef __cplusplus
168}
169#endif
170
171#endif
at32f415.h
at32f415 header file
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb delay millisecond function.
Definition: project/at_start_f415/examples/usb_host/hid_demo/src/main.c:274
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_host/hid_demo/src/main.c:285


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usb_host
  • hid_demo
  • src
project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usb_host
  • hid_demo
  • src
project/at_start_f415/examples/usb_host/hid_demo/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usb_host
  • hid_demo
  • src
project/at_start_f415/examples/usb_host/hid_demo/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbh_int.h"
32#include "usbh_hid_class.h"
33#include "usbh_user.h"
34
43/* usb global struct define */
44 otg_core_type otg_core_struct;
45void usb_clock48m_select(usb_clk48_s clk_s);
46void usb_gpio_config(void);
47void usb_low_power_wakeup_config(void);
48void button_exint_init(void);
49void button_isr(void);
50
56void button_exint_init(void)
57{
58 exint_init_type exint_init_struct;
59
60 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
61 gpio_exint_line_config(GPIO_PORT_SOURCE_GPIOA, GPIO_PINS_SOURCE0);
62
63 exint_default_para_init(&exint_init_struct);
64 exint_init_struct.line_enable = TRUE;
65 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
66 exint_init_struct.line_select = EXINT_LINE_0;
67 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
68 exint_init(&exint_init_struct);
69
70 nvic_irq_enable(EXINT0_IRQn, 0, 0);
71}
72
78void EXINT0_IRQHandler(void)
79{
80 delay_ms(50);
81 exint_flag_clear(EXINT_LINE_0);
82 if(USBH_CLASS == otg_core_struct.host.global_state)
83 {
84 otg_core_struct.host.global_state = USBH_SUSPEND;
85 USBH_DEBUG("Host Start Enter Suspend Mode");
86 }
87 else if(USBH_SUSPENDED == otg_core_struct.host.global_state)
88 {
89 otg_core_struct.host.global_state = USBH_WAKEUP;
90 USBH_DEBUG("Host Start Wakeup");
91 }
92}
93
94
100int main(void)
101{
102 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
103
104 system_clock_config();
105
106 at32_board_init();
107
108 uart_print_init(115200);
109
110 button_exint_init();
111
112 /* usb gpio config */
113 usb_gpio_config();
114
115#ifdef USB_LOW_POWER_WAKUP
116 usb_low_power_wakeup_config();
117#endif
118
119 /* enable otgfs clock */
120 crm_periph_clock_enable(OTG_CLOCK, TRUE);
121
122 /* select usb 48m clcok source */
123 usb_clock48m_select(USB_CLK_HEXT);
124
125 /* enable otgfs irq */
126 nvic_irq_enable(OTG_IRQ, 0, 0);
127
128 /* init usb */
129 usbh_init(&otg_core_struct,
130 USB_FULL_SPEED_CORE_ID,
131 USB_ID,
132 &uhost_class_handler,
133 &usbh_user_handle);
134 while(1)
135 {
136 usbh_loop_handler(&otg_core_struct.host);
137 }
138}
139
145void usb_clock48m_select(usb_clk48_s clk_s)
146{
147 switch(system_core_clock)
148 {
149 /* 48MHz */
150 case 48000000:
151 crm_usb_clock_div_set(CRM_USB_DIV_1);
152 break;
153
154 /* 72MHz */
155 case 72000000:
156 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
157 break;
158
159 /* 96MHz */
160 case 96000000:
161 crm_usb_clock_div_set(CRM_USB_DIV_2);
162 break;
163
164 /* 120MHz */
165 case 120000000:
166 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
167 break;
168
169 /* 144MHz */
170 case 144000000:
171 crm_usb_clock_div_set(CRM_USB_DIV_3);
172 break;
173
174 default:
175 break;
176
177 }
178}
179
185void usb_gpio_config(void)
186{
187 gpio_init_type gpio_init_struct;
188
189 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
190 gpio_default_para_init(&gpio_init_struct);
191
192 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
193 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
194 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
195 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
196
197#ifdef USB_SOF_OUTPUT_ENABLE
198 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
199 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
200 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
201#endif
202
203 /* otgfs use vbus pin */
204#ifndef USB_VBUS_IGNORE
205 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
206 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
207 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
208 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
209#endif
210
211#ifdef USBH_5V_POWER_SWITCH
212 crm_periph_clock_enable(OTG_PIN_POWER_SWITCH_CLOCK, TRUE);
213 gpio_bits_set(OTG_PIN_POWER_SWITCH_GPIO, OTG_PIN_POWER_SWITCH);
214
215 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
216 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_OPEN_DRAIN;
217 gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
218 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
219 gpio_init_struct.gpio_pins = OTG_PIN_POWER_SWITCH;
220 gpio_init(OTG_PIN_POWER_SWITCH_GPIO, &gpio_init_struct);
221#endif
222
223
224}
225#ifdef USB_LOW_POWER_WAKUP
231void usb_low_power_wakeup_config(void)
232{
233 exint_init_type exint_init_struct;
234
235 crm_periph_clock_enable(CRM_SCFG_PERIPH_CLOCK, TRUE);
236 exint_default_para_init(&exint_init_struct);
237
238 exint_init_struct.line_enable = TRUE;
239 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
240 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
241 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
242 exint_init(&exint_init_struct);
243
244 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
245}
246
252void OTG_WKUP_HANDLER(void)
253{
254 exint_flag_clear(OTG_WKUP_EXINT_LINE);
255}
256
257#endif
258
264void OTG_IRQ_HANDLER(void)
265{
266 usbh_irq_handler(&otg_core_struct);
267}
268
274void usb_delay_ms(uint32_t ms)
275{
276 /* user can define self delay function */
277 delay_ms(ms);
278}
279
285void usb_delay_us(uint32_t us)
286{
287 delay_us(us);
288}
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
OTG_PIN_POWER_SWITCH_GPIO
#define OTG_PIN_POWER_SWITCH_GPIO
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:78
OTG_PIN_POWER_SWITCH
#define OTG_PIN_POWER_SWITCH
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:80
button_exint_init
void button_exint_init(void)
configure button exint
Definition: project/at_start_f415/examples/usb_host/hid_demo/src/main.c:56
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: project/at_start_f415/examples/usb_host/hid_demo/src/main.c:145
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usb_host/hid_demo/src/main.c:100
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
OTG_PIN_POWER_SWITCH_CLOCK
#define OTG_PIN_POWER_SWITCH_CLOCK
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:79
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: project/at_start_f415/examples/usb_host/hid_demo/src/main.c:185
usbh_user_handle
usbh_user_handler_type usbh_user_handle
Definition: hid_demo/src/usbh_user.c:50
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: project/at_start_f415/examples/usb_host/hid_demo/src/main.c:264
EXINT0_IRQHandler
void EXINT0_IRQHandler(void)
exint0 interrupt handler
Definition: project/at_start_f415/examples/usb_host/hid_demo/src/main.c:78
button_isr
void button_isr(void)
button handler function
Definition: project/at_start_f415/examples/usb_device/composite_vcp_keyboard/src/main.c:85
otg_core_struct
otg_core_type otg_core_struct
Definition: project/at_start_f415/examples/usb_host/hid_demo/src/main.c:44
USBH_DEBUG
#define USBH_DEBUG(...)
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:152
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
EXINT0_IRQn
@ EXINT0_IRQn
Definition: at32f415.h:141
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_0
#define EXINT_LINE_0
Definition: at32f415_exint.h:52
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_bits_set
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins)
set the selected data port bits.
Definition: at32f415_gpio.c:310
gpio_exint_line_config
void gpio_exint_line_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line.
Definition: at32f415_gpio.c:577
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_MODE_OUTPUT
@ GPIO_MODE_OUTPUT
Definition: at32f415_gpio.h:229
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PINS_SOURCE0
@ GPIO_PINS_SOURCE0
Definition: at32f415_gpio.h:268
GPIO_PORT_SOURCE_GPIOA
@ GPIO_PORT_SOURCE_GPIOA
Definition: at32f415_gpio.h:291
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_OPEN_DRAIN
@ GPIO_OUTPUT_OPEN_DRAIN
Definition: at32f415_gpio.h:250
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
usbh_loop_handler
usb_sts_type usbh_loop_handler(usbh_core_type *uhost)
usb host enum loop handler
Definition: usbh_core.c:1134
uhost_class_handler
usbh_class_handler_type uhost_class_handler
Definition: usbh_hid_class.c:52
usbh_irq_handler
void usbh_irq_handler(otg_core_type *hdev)
usb host interrupt handler
Definition: usbh_int.c:47
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbh_hid_class.h
usb host hid class header file
usbh_int.h
usb header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • usb_host
  • msc_only_fat32
  • inc
project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • usb_host
  • msc_only_fat32
  • inc
project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • usb_host
  • msc_only_fat32
  • inc
project/at_start_f415/examples/usb_host/msc_only_fat32/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • usb_host
  • msc_only_fat32
  • inc
project/at_start_f415/examples/usb_host/msc_only_fat32/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "stdio.h"
38
50/* #define USE_OTG_DEVICE_MODE */
51
55#define USE_OTG_HOST_MODE
56
57
58
59#define USB_ID 0
60#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
61#define OTG_IRQ OTGFS1_IRQn
62#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
63#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
64#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
65#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
66
67#define OTG_PIN_GPIO GPIOA
68#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
69#define OTG_PIN_VBUS GPIO_PINS_9
70#define OTG_PIN_ID GPIO_PINS_10
71
72
73#define OTG_PIN_SOF_GPIO GPIOA
74#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
75#define OTG_PIN_SOF GPIO_PINS_8
76
77
78#define OTG_PIN_POWER_SWITCH_GPIO GPIOB
79#define OTG_PIN_POWER_SWITCH_CLOCK CRM_GPIOH_PERIPH_CLOCK
80#define OTG_PIN_POWER_SWITCH GPIO_PINS_3
81
82
86#ifdef USE_OTG_DEVICE_MODE
90/* otg1 device fifo */
91#define USBD_RX_SIZE 128
92#define USBD_EP0_TX_SIZE 24
93#define USBD_EP1_TX_SIZE 20
94#define USBD_EP2_TX_SIZE 20
95#define USBD_EP3_TX_SIZE 20
96
100#ifndef USB_EPT_MAX_NUM
101#define USB_EPT_MAX_NUM 4
102#endif
103#endif
104
108#ifdef USE_OTG_HOST_MODE
109
110#ifndef USB_HOST_CHANNEL_NUM
111#define USB_HOST_CHANNEL_NUM 8
112#endif
113
117/* otg1 host fifo */
118#define USBH_RX_FIFO_SIZE 128
119#define USBH_NP_TX_FIFO_SIZE 96
120#define USBH_P_TX_FIFO_SIZE 96
121
122/* usb host vbus power switch */
123//#define USBH_5V_POWER_SWITCH
124
125#endif
126
130/* #define USB_SOF_OUTPUT_ENABLE */
131
142/* #define USB_VBUS_IGNORE */
143
147/* #define USB_LOW_POWER_WAKUP */
148
149#define USBH_DEBUG_ENABLE
150
151#ifdef USBH_DEBUG_ENABLE
152#define USBH_DEBUG(...) printf(__VA_ARGS__);\
153 printf("\r\n");
154#else
155#define USBH_DEBUG(...)
156#endif
157
158void usb_delay_ms(uint32_t ms);
159void usb_delay_us(uint32_t us);
167#ifdef __cplusplus
168}
169#endif
170
171#endif
at32f415.h
at32f415 header file
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • usb_host
  • msc_only_fat32
  • src
project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • usb_host
  • msc_only_fat32
  • src
project/at_start_f415/examples/usb_host/msc_only_fat32/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/crm/sysclk_switch/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • usb_host
  • msc_only_fat32
  • src
project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbh_int.h"
32#include "usbh_user.h"
33#include "usbh_msc_class.h"
34#include "ff.h"
35
44/* usb global struct define */
45 otg_core_type otg_core_struct;
46void usb_clock48m_select(usb_clk48_s clk_s);
47void usb_gpio_config(void);
48void usb_low_power_wakeup_config(void);
49
55int main(void)
56{
57 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
58
59 system_clock_config();
60
61 at32_board_init();
62
63 /* usb gpio config */
64 usb_gpio_config();
65
66#ifdef USB_LOW_POWER_WAKUP
67 usb_low_power_wakeup_config();
68#endif
69
70 uart_print_init(115200);
71
72 /* enable otgfs clock */
73 crm_periph_clock_enable(OTG_CLOCK, TRUE);
74
75 /* select usb 48m clcok source */
76 usb_clock48m_select(USB_CLK_HEXT);
77
78 /* enable otgfs irq */
79 nvic_irq_enable(OTG_IRQ, 0, 0);
80
81 /* init usb */
82 usbh_init(&otg_core_struct,
83 USB_FULL_SPEED_CORE_ID,
84 USB_ID,
85 &uhost_class_handler,
86 &usbh_user_handle);
87 while(1)
88 {
89 usbh_loop_handler(&otg_core_struct.host);
90 }
91}
92
98void usb_clock48m_select(usb_clk48_s clk_s)
99{
100 switch(system_core_clock)
101 {
102 /* 48MHz */
103 case 48000000:
104 crm_usb_clock_div_set(CRM_USB_DIV_1);
105 break;
106
107 /* 72MHz */
108 case 72000000:
109 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
110 break;
111
112 /* 96MHz */
113 case 96000000:
114 crm_usb_clock_div_set(CRM_USB_DIV_2);
115 break;
116
117 /* 120MHz */
118 case 120000000:
119 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
120 break;
121
122 /* 144MHz */
123 case 144000000:
124 crm_usb_clock_div_set(CRM_USB_DIV_3);
125 break;
126
127 default:
128 break;
129
130 }
131}
132
138void usb_gpio_config(void)
139{
140 gpio_init_type gpio_init_struct;
141
142 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
143 gpio_default_para_init(&gpio_init_struct);
144
145 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
146 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
147 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
148 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
149
150
151#ifdef USB_SOF_OUTPUT_ENABLE
152 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
153 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
154 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
155#endif
156
157 /* otgfs use vbus pin */
158#ifndef USB_VBUS_IGNORE
159 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
160 gpio_init_struct.gpio_pull = GPIO_PULL_DOWN;
161 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
162 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
163#endif
164
165#ifdef USBH_5V_POWER_SWITCH
166 crm_periph_clock_enable(OTG_PIN_POWER_SWITCH_CLOCK, TRUE);
167 gpio_bits_set(OTG_PIN_POWER_SWITCH_GPIO, OTG_PIN_POWER_SWITCH);
168
169 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
170 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_OPEN_DRAIN;
171 gpio_init_struct.gpio_mode = GPIO_MODE_OUTPUT;
172 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
173 gpio_init_struct.gpio_pins = OTG_PIN_POWER_SWITCH;
174 gpio_init(OTG_PIN_POWER_SWITCH_GPIO, &gpio_init_struct);
175#endif
176
177
178}
179#ifdef USB_LOW_POWER_WAKUP
185void usb_low_power_wakeup_config(void)
186{
187 exint_init_type exint_init_struct;
188
189 exint_default_para_init(&exint_init_struct);
190
191 exint_init_struct.line_enable = TRUE;
192 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
193 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
194 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
195 exint_init(&exint_init_struct);
196
197 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
198}
199
205void OTG_WKUP_HANDLER(void)
206{
207 exint_flag_clear(OTG_WKUP_EXINT_LINE);
208}
209
210#endif
211
217void OTG_IRQ_HANDLER(void)
218{
219 usbh_irq_handler(&otg_core_struct);
220}
221
227void usb_delay_ms(uint32_t ms)
228{
229 /* user can define self delay function */
230 delay_ms(ms);
231}
232
238void usb_delay_us(uint32_t us)
239{
240 delay_us(us);
241}
242
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
OTG_PIN_POWER_SWITCH_GPIO
#define OTG_PIN_POWER_SWITCH_GPIO
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:78
OTG_PIN_POWER_SWITCH
#define OTG_PIN_POWER_SWITCH
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:80
OTG_PIN_POWER_SWITCH_CLOCK
#define OTG_PIN_POWER_SWITCH_CLOCK
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:79
usbh_user_handle
usbh_user_handler_type usbh_user_handle
Definition: hid_demo/src/usbh_user.c:50
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c:98
main
int main(void)
main function.
Definition: project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c:55
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c:138
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c:217
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb delay millisecond function.
Definition: project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c:227
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c:238
otg_core_struct
otg_core_type otg_core_struct
Definition: project/at_start_f415/examples/usb_host/msc_only_fat32/src/main.c:45
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_bits_set
void gpio_bits_set(gpio_type *gpio_x, uint16_t pins)
set the selected data port bits.
Definition: at32f415_gpio.c:310
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_MODE_OUTPUT
@ GPIO_MODE_OUTPUT
Definition: at32f415_gpio.h:229
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_DOWN
@ GPIO_PULL_DOWN
Definition: at32f415_gpio.h:260
GPIO_OUTPUT_OPEN_DRAIN
@ GPIO_OUTPUT_OPEN_DRAIN
Definition: at32f415_gpio.h:250
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
usbh_loop_handler
usb_sts_type usbh_loop_handler(usbh_core_type *uhost)
usb host enum loop handler
Definition: usbh_core.c:1134
uhost_class_handler
usbh_class_handler_type uhost_class_handler
Definition: usbh_hid_class.c:52
usbh_irq_handler
void usbh_irq_handler(otg_core_type *hdev)
usb host interrupt handler
Definition: usbh_int.c:47
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbh_int.h
usb header file
usbh_msc_class.h
usb host msc class header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • wdt
  • wdt_reset
  • inc
project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • wdt
  • wdt_reset
  • inc
project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • wdt
  • wdt_reset
  • inc
project/at_start_f415/examples/wdt/wdt_reset/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • wdt
  • wdt_reset
  • src
project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • wdt
  • wdt_reset
  • src
project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
135
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/wdt/wdt_reset/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • wdt
  • wdt_reset
  • src
project/at_start_f415/examples/wdt/wdt_reset/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
44int main(void)
45{
46 system_clock_config();
47
48 at32_board_init();
49
50 if(crm_flag_get(CRM_WDT_RESET_FLAG) != RESET)
51 {
52 /* reset from wdt */
53 crm_flag_clear(CRM_WDT_RESET_FLAG);
54
55 at32_led_on(LED4);
56 }
57 else
58 {
59 /* reset from other mode */
60 at32_led_off(LED4);
61 }
62
63 /* disable register write protection */
64 wdt_register_write_enable(TRUE);
65
66 /* set the wdt divider value */
67 wdt_divider_set(WDT_CLK_DIV_4);
68
69 /* set reload value
70
71 timeout = reload_value * (divider / lick_freq ) (s)
72
73 lick_freq = 40000 Hz
74 divider = 4
75 reload_value = 3000
76
77 timeout = 3000 * (4 / 40000 ) = 0.3s = 300ms
78 */
79 wdt_reload_value_set(3000 - 1);
80
81 /* enable wdt */
82 wdt_enable();
83
84 while(1)
85 {
86 /* reload wdt counter */
87 wdt_counter_reload();
88
89 at32_led_toggle(LED3);
90
91 delay_ms(200);
92
93 if(at32_button_press() == USER_BUTTON)
94 {
95 while(1);
96 }
97 }
98}
99
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
main
int main(void)
main function.
Definition: project/at_start_f415/examples/wdt/wdt_reset/src/main.c:44
LED3
@ LED3
Definition: at32f415_board.h:64
LED4
@ LED4
Definition: at32f415_board.h:65
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_flag_clear
void crm_flag_clear(uint32_t flag)
clear the crm reset flags
Definition: at32f415_crm.c:333
CRM_WDT_RESET_FLAG
#define CRM_WDT_RESET_FLAG
Definition: at32f415_crm.h:63
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
wdt_register_write_enable
void wdt_register_write_enable(confirm_state new_state)
enable or disable wdt cmd register write
Definition: at32f415_wdt.c:97
wdt_enable
void wdt_enable(void)
wdt enable ,the reload value will be sent to the counter
Definition: at32f415_wdt.c:49
wdt_counter_reload
void wdt_counter_reload(void)
reload wdt counter
Definition: at32f415_wdt.c:59
wdt_reload_value_set
void wdt_reload_value_set(uint16_t reload_value)
set wdt counter reload value
Definition: at32f415_wdt.c:69
wdt_divider_set
void wdt_divider_set(wdt_division_type division)
set wdt division divider
Definition: at32f415_wdt.c:87
WDT_CLK_DIV_4
@ WDT_CLK_DIV_4
Definition: at32f415_wdt.h:69
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • wwdt
  • wwdt_reset
  • inc
project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • wwdt
  • wwdt_reset
  • inc
project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • wwdt
  • wwdt_reset
  • inc
project/at_start_f415/examples/wwdt/wwdt_reset/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • wwdt
  • wwdt_reset
  • src
project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_clock.c:48
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • wwdt
  • wwdt_reset
  • src
project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
30
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while(1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while(1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while(1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while(1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/wwdt/wwdt_reset/src/at32f415_int.c:114
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • wwdt
  • wwdt_reset
  • src
project/at_start_f415/examples/wwdt/wwdt_reset/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
43int main(void)
44{
45 system_clock_config();
46
47 at32_board_init();
48
49 if(crm_flag_get(CRM_WWDT_RESET_FLAG) != RESET)
50 {
51 /* reset from wwdt */
52 crm_flag_clear(CRM_WWDT_RESET_FLAG);
53
54 at32_led_on(LED4);
55 }
56 else
57 {
58 /* reset from other mode */
59 at32_led_off(LED4);
60 }
61
62 /* enable the wwdt clock */
63 crm_periph_clock_enable(CRM_WWDT_PERIPH_CLOCK, TRUE);
64
65 /* set the wwdt divider value */
66 wwdt_divider_set(WWDT_PCLK1_DIV_32768);
67
68 /* set the wwdt window counter value */
69 wwdt_window_counter_set(0x6F);
70
71 /* enable wwdt
72
73 window_value: (0x7F - 0x6F)
74 timeout_value: (0x7F - 0x40) + 1
75
76 timeout = timeout_value * (divider / pclk1_freq ) (s)
77 window = window_value * (divider / pclk1_freq ) (s)
78
79 pclk1_freq = 72 MHz
80 divider = 32768
81 reload_value = 0x40 = 64
82 window_value = 0x10 = 16
83
84 timeout = 64 * (32768 / 72000000 ) = 0.0291s = 29.1ms
85 window = 16 * (32768 / 72000000 ) = 0.0073s = 7.3ms
86
87 */
88 wwdt_enable(0x7F);
89
90 while(1)
91 {
92 at32_led_toggle(LED3);
93
94 /* the reload time must within the window (10ms > 7.3ms) */
95 delay_ms(10);
96
97 /* update the wwdt window counter */
98 wwdt_counter_set(0x7F);
99
100 if(at32_button_press() == USER_BUTTON)
101 {
102 while(1);
103 }
104 }
105}
106
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
main
int main(void)
main function.
Definition: project/at_start_f415/examples/wwdt/wwdt_reset/src/main.c:43
LED3
@ LED3
Definition: at32f415_board.h:64
LED4
@ LED4
Definition: at32f415_board.h:65
USER_BUTTON
@ USER_BUTTON
Definition: at32f415_board.h:94
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_flag_clear
void crm_flag_clear(uint32_t flag)
clear the crm reset flags
Definition: at32f415_crm.c:333
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_WWDT_PERIPH_CLOCK
@ CRM_WWDT_PERIPH_CLOCK
Definition: at32f415_crm.h:128
CRM_WWDT_RESET_FLAG
#define CRM_WWDT_RESET_FLAG
Definition: at32f415_crm.h:64
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
wwdt_counter_set
void wwdt_counter_set(uint8_t wwdt_cnt)
wwdt counter value set
Definition: at32f415_wwdt.c:114
wwdt_divider_set
void wwdt_divider_set(wwdt_division_type division)
wwdt division set
Definition: at32f415_wwdt.c:64
wwdt_window_counter_set
void wwdt_window_counter_set(uint8_t window_cnt)
wwdt window counter value set
Definition: at32f415_wwdt.c:124
wwdt_enable
void wwdt_enable(uint8_t wwdt_cnt)
wwdt enable and the counter value load
Definition: at32f415_wwdt.c:84
WWDT_PCLK1_DIV_32768
@ WWDT_PCLK1_DIV_32768
Definition: at32f415_wwdt.h:70
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • templates
  • inc
project/at_start_f415/templates/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • templates
  • inc
project/at_start_f415/templates/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
49#if !defined HEXT_VALUE
50#define HEXT_VALUE ((uint32_t)8000000)
51#endif
52
57#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
58#define HICK_VALUE ((uint32_t)8000000)
60/* module define -------------------------------------------------------------*/
61#define CRM_MODULE_ENABLED
62#define CMP_MODULE_ENABLED
63#define TMR_MODULE_ENABLED
64#define ERTC_MODULE_ENABLED
65#define GPIO_MODULE_ENABLED
66#define I2C_MODULE_ENABLED
67#define USART_MODULE_ENABLED
68#define PWC_MODULE_ENABLED
69#define CAN_MODULE_ENABLED
70#define ADC_MODULE_ENABLED
71#define SPI_MODULE_ENABLED
72#define DMA_MODULE_ENABLED
73#define DEBUG_MODULE_ENABLED
74#define FLASH_MODULE_ENABLED
75#define CRC_MODULE_ENABLED
76#define WWDT_MODULE_ENABLED
77#define WDT_MODULE_ENABLED
78#define EXINT_MODULE_ENABLED
79#define SDIO_MODULE_ENABLED
80#define USB_MODULE_ENABLED
81#define MISC_MODULE_ENABLED
82
83/* includes ------------------------------------------------------------------*/
84#ifdef CRM_MODULE_ENABLED
85#include "at32f415_crm.h"
86#endif
87#ifdef CMP_MODULE_ENABLED
88#include "at32f415_cmp.h"
89#endif
90#ifdef TMR_MODULE_ENABLED
91#include "at32f415_tmr.h"
92#endif
93#ifdef ERTC_MODULE_ENABLED
94#include "at32f415_ertc.h"
95#endif
96#ifdef GPIO_MODULE_ENABLED
97#include "at32f415_gpio.h"
98#endif
99#ifdef I2C_MODULE_ENABLED
100#include "at32f415_i2c.h"
101#endif
102#ifdef USART_MODULE_ENABLED
103#include "at32f415_usart.h"
104#endif
105#ifdef PWC_MODULE_ENABLED
106#include "at32f415_pwc.h"
107#endif
108#ifdef CAN_MODULE_ENABLED
109#include "at32f415_can.h"
110#endif
111#ifdef ADC_MODULE_ENABLED
112#include "at32f415_adc.h"
113#endif
114#ifdef SPI_MODULE_ENABLED
115#include "at32f415_spi.h"
116#endif
117#ifdef DMA_MODULE_ENABLED
118#include "at32f415_dma.h"
119#endif
120#ifdef DEBUG_MODULE_ENABLED
121#include "at32f415_debug.h"
122#endif
123#ifdef FLASH_MODULE_ENABLED
124#include "at32f415_flash.h"
125#endif
126#ifdef CRC_MODULE_ENABLED
127#include "at32f415_crc.h"
128#endif
129#ifdef WWDT_MODULE_ENABLED
130#include "at32f415_wwdt.h"
131#endif
132#ifdef WDT_MODULE_ENABLED
133#include "at32f415_wdt.h"
134#endif
135#ifdef EXINT_MODULE_ENABLED
136#include "at32f415_exint.h"
137#endif
138#ifdef SDIO_MODULE_ENABLED
139#include "at32f415_sdio.h"
140#endif
141#ifdef MISC_MODULE_ENABLED
142#include "at32f415_misc.h"
143#endif
144#ifdef USB_MODULE_ENABLED
145#include "at32f415_usb.h"
146#endif
147
156#ifdef __cplusplus
157}
158#endif
159
160#endif /* __AT32F415_CONF_H */
161
162
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • templates
  • inc
project/at_start_f415/templates/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • templates
  • src
project/at_start_f415/templates/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
56void system_clock_config(void)
57{
58 /* config flash psr register */
59 flash_psr_set(FLASH_WAIT_CYCLE_4);
60
61 /* reset crm */
62 crm_reset();
63
64 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
65
66 /* wait till hext is ready */
67 while(crm_hext_stable_wait() == ERROR)
68 {
69 }
70
71 /* config pll clock resource */
72 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
73
74 /* enable pll */
75 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
76
77 /* wait till pll is ready */
78 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
79 {
80 }
81
82 /* config ahbclk */
83 crm_ahb_div_set(CRM_AHB_DIV_1);
84
85 /* config apb2clk */
86 crm_apb2_div_set(CRM_APB2_DIV_2);
87
88 /* config apb1clk */
89 crm_apb1_div_set(CRM_APB1_DIV_2);
90
91 /* enable auto step mode */
92 crm_auto_step_mode_enable(TRUE);
93
94 /* select pll as system clock source */
95 crm_sysclk_switch(CRM_SCLK_PLL);
96
97 /* wait till pll is used as system clock source */
98 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
99 {
100 }
101
102 /* disable auto step mode */
103 crm_auto_step_mode_enable(FALSE);
104
105 /* update system_core_clock global variable */
106 system_core_clock_update();
107}
108
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/templates/src/at32f415_clock.c:56
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • templates
  • src
project/at_start_f415/templates/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/templates/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/templates/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/templates/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/templates/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/templates/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/templates/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/templates/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/templates/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/templates/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • templates
  • src
project/at_start_f415/templates/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define DELAY 100
39#define FAST 1
40#define SLOW 4
41
42uint8_t g_speed = FAST;
43
44void button_exint_init(void);
45void button_isr(void);
46
52void button_exint_init(void)
53{
54 exint_init_type exint_init_struct;
55
56 crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);
57 gpio_exint_line_config(GPIO_PORT_SOURCE_GPIOA, GPIO_PINS_SOURCE0);
58
59 exint_default_para_init(&exint_init_struct);
60 exint_init_struct.line_enable = TRUE;
61 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
62 exint_init_struct.line_select = EXINT_LINE_0;
63 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
64 exint_init(&exint_init_struct);
65
66 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
67 nvic_irq_enable(EXINT0_IRQn, 0, 0);
68}
69
75void button_isr(void)
76{
77 /* delay 5ms */
78 delay_ms(5);
79
80 /* clear interrupt pending bit */
81 exint_flag_clear(EXINT_LINE_0);
82
83 /* check input pin state */
84 if(SET == gpio_input_data_bit_read(USER_BUTTON_PORT, USER_BUTTON_PIN))
85 {
86 if(g_speed == SLOW)
87 g_speed = FAST;
88 else
89 g_speed = SLOW;
90 }
91}
92
98void EXINT0_IRQHandler(void)
99{
100 button_isr();
101}
102
108int main(void)
109{
110 system_clock_config();
111
112 at32_board_init();
113
114 button_exint_init();
115
116 while(1)
117 {
118 at32_led_toggle(LED2);
119 delay_ms(g_speed * DELAY);
120 at32_led_toggle(LED3);
121 delay_ms(g_speed * DELAY);
122 at32_led_toggle(LED4);
123 delay_ms(g_speed * DELAY);
124 }
125}
126
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
SLOW
#define SLOW
Definition: project/at_start_f415/templates/src/main.c:40
button_exint_init
void button_exint_init(void)
configure button exint
Definition: project/at_start_f415/templates/src/main.c:52
DELAY
#define DELAY
Definition: project/at_start_f415/templates/src/main.c:38
FAST
#define FAST
Definition: project/at_start_f415/templates/src/main.c:39
main
int main(void)
main function.
Definition: project/at_start_f415/templates/src/main.c:108
EXINT0_IRQHandler
void EXINT0_IRQHandler(void)
exint0 interrupt handler
Definition: project/at_start_f415/templates/src/main.c:98
g_speed
uint8_t g_speed
Definition: project/at_start_f415/templates/src/main.c:42
button_isr
void button_isr(void)
button handler function
Definition: project/at_start_f415/templates/src/main.c:75
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
USER_BUTTON_PORT
#define USER_BUTTON_PORT
Definition: at32f415_board.h:99
USER_BUTTON_PIN
#define USER_BUTTON_PIN
Definition: at32f415_board.h:98
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_IOMUX_PERIPH_CLOCK
@ CRM_IOMUX_PERIPH_CLOCK
Definition: at32f415_crm.h:109
EXINT0_IRQn
@ EXINT0_IRQn
Definition: at32f415.h:141
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
EXINT_LINE_0
#define EXINT_LINE_0
Definition: at32f415_exint.h:52
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
gpio_input_data_bit_read
flag_status gpio_input_data_bit_read(gpio_type *gpio_x, uint16_t pins)
read the specified input port pin.
Definition: at32f415_gpio.c:203
gpio_exint_line_config
void gpio_exint_line_config(gpio_port_source_type gpio_port_source, gpio_pins_source_type gpio_pin_source)
select the gpio pin used as exint line.
Definition: at32f415_gpio.c:577
GPIO_PINS_SOURCE0
@ GPIO_PINS_SOURCE0
Definition: at32f415_gpio.h:268
GPIO_PORT_SOURCE_GPIOA
@ GPIO_PORT_SOURCE_GPIOA
Definition: at32f415_gpio.h:291
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: fir_filter.h Source File

  • utilities
  • at32f415_slib_demo
  • project_l0
  • inc
project_l0/inc/fir_filter.h
Go to the documentation of this file.
1
30/* Define to prevent recursive inclusion -------------------------------------*/
31#ifndef __FIR_FILTER_H
32#define __FIR_FILTER_H
33
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "arm_math.h"
38
39/* Exported types ------------------------------------------------------------*/
40/* Exported constants --------------------------------------------------------*/
41/* Exported macro ------------------------------------------------------------*/
42/* Exported functions ------------------------------------------------------- */
43void arm_fir_init_f32(
44 arm_fir_instance_f32 * S,
45 uint16_t numTaps,
46 const float32_t * pCoeffs,
47 float32_t * pState,
48 uint32_t blockSize);
49
50void arm_fir_f32(
51const arm_fir_instance_f32 * S,
52const float32_t * pSrc,
53float32_t * pDst,
54uint32_t blockSize);
55
56void FIR_lowpass_filter(float32_t * pSrc, float32_t * pDst, uint32_t testlengthsamples);
57
58#endif /* __FIR_FILTER_H */
59
arm_fir_f32
void arm_fir_f32(const arm_fir_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
arm_fir_init_f32
void arm_fir_init_f32(arm_fir_instance_f32 *S, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR filter.
Definition: arm_fir_init_f32.c:57
FIR_lowpass_filter
void FIR_lowpass_filter(float32_t *pSrc, float32_t *pDst, uint32_t testlengthsamples)
Definition: fir_filter.c:76


AT32F415 Firmwary Library: math_helper.h Source File

  • utilities
  • at32f415_slib_demo
  • project_l0
  • inc
project_l0/inc/math_helper.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------
2* Copyright (C) 2010-2013 ARM Limited. All rights reserved.
3*
4* $Date: 17. January 2013
5* $Revision: V1.4.0
6*
7* Project: CMSIS DSP Library
8*
9* Title: math_helper.h
10*
11* Description: Prototypes of all helper functions required.
12*
13* Target Processor: Cortex-M4/Cortex-M3
14*
15* Redistribution and use in source and binary forms, with or without
16* modification, are permitted provided that the following conditions
17* are met:
18* - Redistributions of source code must retain the above copyright
19* notice, this list of conditions and the following disclaimer.
20* - Redistributions in binary form must reproduce the above copyright
21* notice, this list of conditions and the following disclaimer in
22* the documentation and/or other materials provided with the
23* distribution.
24* - Neither the name of ARM LIMITED nor the names of its contributors
25* may be used to endorse or promote products derived from this
26* software without specific prior written permission.
27*
28* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39* POSSIBILITY OF SUCH DAMAGE.
40* -------------------------------------------------------------------- */
41
42
43#include "arm_math.h"
44
45#ifndef MATH_HELPER_H
46#define MATH_HELPER_H
47
48float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize);
49void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples);
50void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits);
51void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits);
52void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples);
53void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples);
54void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples);
55void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples);
56void arm_clip_f32(float *pIn, uint32_t numSamples);
57uint32_t arm_calc_guard_bits(uint32_t num_adds);
58void arm_apply_guard_bits (float32_t * pIn, uint32_t numSamples, uint32_t guard_bits);
59uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples);
60uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples);
61uint32_t arm_calc_2pow(uint32_t guard_bits);
62#endif
63
arm_float_to_q29
void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format.
Definition: project_l0/src/math_helper.c:391
arm_apply_guard_bits
void arm_apply_guard_bits(float32_t *pIn, uint32_t numSamples, uint32_t guard_bits)
Apply guard bits to buffer.
Definition: project_l0/src/math_helper.c:293
arm_float_to_q30
void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format.
Definition: project_l0/src/math_helper.c:364
arm_float_to_q14
void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples)
Converts float to fixed q14.
Definition: project_l0/src/math_helper.c:334
arm_float_to_q12_20
void arm_float_to_q12_20(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed in q12.20 format.
Definition: project_l0/src/math_helper.c:139
arm_compare_fixed_q31
uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output.
Definition: project_l0/src/math_helper.c:193
arm_calc_guard_bits
uint32_t arm_calc_guard_bits(uint32_t num_adds)
Caluclates number of guard bits.
Definition: project_l0/src/math_helper.c:267
arm_compare_fixed_q15
uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output.
Definition: project_l0/src/math_helper.c:165
arm_calc_2pow
uint32_t arm_calc_2pow(uint32_t guard_bits)
Calculates pow(2, numShifts)
Definition: project_l0/src/math_helper.c:310
arm_float_to_q28
void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q28 format.
Definition: project_l0/src/math_helper.c:419
arm_clip_f32
void arm_clip_f32(float *pIn, uint32_t numSamples)
Clip the float values to +/- 1.
Definition: project_l0/src/math_helper.c:445
arm_provide_guard_bits_q15
void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer.
Definition: project_l0/src/math_helper.c:119
arm_provide_guard_bits_q31
void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer.
Definition: project_l0/src/math_helper.c:223
arm_snr_f32
float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize)
Caluclation of SNR.
Definition: project_l0/src/math_helper.c:61


AT32F415 Firmwary Library: arm_fir_data.c Source File

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
project_l0/src/arm_fir_data.c
Go to the documentation of this file.
1/* ----------------------------------------------------------------------
2* Copyright (C) 2010-2012 ARM Limited. All rights reserved.
3*
4* $Date: 17. January 2013
5* $Revision: V1.4.0
6*
7* Project: CMSIS DSP Library
8* Title: arm_fir_data.c
9*
10* Description: Data file used for example code
11*
12* Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13*
14* Redistribution and use in source and binary forms, with or without
15* modification, are permitted provided that the following conditions
16* are met:
17* - Redistributions of source code must retain the above copyright
18* notice, this list of conditions and the following disclaimer.
19* - Redistributions in binary form must reproduce the above copyright
20* notice, this list of conditions and the following disclaimer in
21* the documentation and/or other materials provided with the
22* distribution.
23* - Neither the name of ARM LIMITED nor the names of its contributors
24* may be used to endorse or promote products derived from this
25* software without specific prior written permission.
26*
27* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
30* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
31* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
32* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
34* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38* POSSIBILITY OF SUCH DAMAGE.
39* -------------------------------------------------------------------- */
40
41#include "at32f415.h"
42#include "arm_math.h"
43
44/* ----------------------------------------------------------------------
45** Test input signal contains 1000Hz + 15000 Hz
46** ------------------------------------------------------------------- */
47
48float32_t testInput_f32_1kHz_15kHz[320] =
49{
50+0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
51+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
52+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
53-0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
54-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f,
55-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f,
56+0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
57+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
58+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
59+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
60-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f,
61-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f,
62+0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
63+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
64+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
65+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
66-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f,
67-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f,
68-0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
69+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
70+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
71-0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
72-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f,
73-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f,
74+0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
75+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
76+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
77+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
78-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f,
79-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f,
80-0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
81+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
82+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
83+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
84-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f,
85-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f,
86-0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
87+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
88+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
89+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
90};
91
92/* ----------------------------------------------------------------------
93** Reference output signal computed with MATLAB
94** ------------------------------------------------------------------- */
95
96float32_t refOutput[320] =
97{
98+0.0000000000f, -0.0010797829f, -0.0007681386f, -0.0001982932f, +0.0000644313f, +0.0020854271f, +0.0036891871f, +0.0015855941f,
99-0.0026280805f, -0.0075907658f, -0.0119390538f, -0.0086665968f, +0.0088981202f, +0.0430539279f, +0.0974468742f, +0.1740405600f,
100+0.2681416601f, +0.3747720089f, +0.4893362230f, +0.6024154672f, +0.7058740791f, +0.7968348987f, +0.8715901940f, +0.9277881093f,
101+0.9682182661f, +0.9934674267f, +1.0012052245f, +0.9925859371f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f,
102+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, -0.0000000000f, -0.1309866321f,
103-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f,
104-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f,
105-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f,
106+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f,
107+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f,
108+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, -0.0000000000f, -0.1309866321f,
109-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f,
110-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f,
111-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f,
112+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f,
113+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f,
114+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, -0.0000000000f, -0.1309866321f,
115-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f,
116-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f,
117-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f,
118+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f,
119+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f,
120+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, +0.0000000000f, -0.1309866321f,
121-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f,
122-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f,
123-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f,
124+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f,
125+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f,
126+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, +0.0000000000f, -0.1309866321f,
127-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f,
128-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f,
129-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, -0.0000000000f, +0.1309866321f,
130+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f,
131+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f,
132+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, +0.0000000000f, -0.1309866321f,
133-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f,
134-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f,
135-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f,
136+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f,
137+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f
138};
139
at32f415.h
at32f415 header file
testInput_f32_1kHz_15kHz
float32_t testInput_f32_1kHz_15kHz[320]
Definition: project_l0/src/arm_fir_data.c:48
refOutput
float32_t refOutput[320]
Definition: project_l0/src/arm_fir_data.c:96


AT32F415 Firmwary Library: math_helper.c Source File

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
project_l0/src/math_helper.c
Go to the documentation of this file.
1/* ----------------------------------------------------------------------
2* Copyright (C) 2010-2012 ARM Limited. All rights reserved.
3*
4* $Date: 17. January 2013
5* $Revision: V1.4.0 b
6*
7* Project: CMSIS DSP Library
8*
9* Title: math_helper.c
10*
11* Description: Definition of all helper functions required.
12*
13* Target Processor: Cortex-M4/Cortex-M3
14*
15* Redistribution and use in source and binary forms, with or without
16* modification, are permitted provided that the following conditions
17* are met:
18* - Redistributions of source code must retain the above copyright
19* notice, this list of conditions and the following disclaimer.
20* - Redistributions in binary form must reproduce the above copyright
21* notice, this list of conditions and the following disclaimer in
22* the documentation and/or other materials provided with the
23* distribution.
24* - Neither the name of ARM LIMITED nor the names of its contributors
25* may be used to endorse or promote products derived from this
26* software without specific prior written permission.
27*
28* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39* POSSIBILITY OF SUCH DAMAGE.
40* -------------------------------------------------------------------- */
41/* ----------------------------------------------------------------------
42* Include standard header files
43* -------------------------------------------------------------------- */
44#include<math.h>
45
46/* ----------------------------------------------------------------------
47* Include project header files
48* -------------------------------------------------------------------- */
49#include "math_helper.h"
50
61float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize)
62{
63 float EnergySignal = 0.0, EnergyError = 0.0;
64 uint32_t i;
65 float SNR;
66 int temp;
67 int *test;
68
69 for (i = 0; i < buffSize; i++)
70 {
71 /* Checking for a NAN value in pRef array */
72 test = (int *)(&pRef[i]);
73 temp = *test;
74
75 if (temp == 0x7FC00000)
76 {
77 return(0);
78 }
79
80 /* Checking for a NAN value in pTest array */
81 test = (int *)(&pTest[i]);
82 temp = *test;
83
84 if (temp == 0x7FC00000)
85 {
86 return(0);
87 }
88 EnergySignal += pRef[i] * pRef[i];
89 EnergyError += (pRef[i] - pTest[i]) * (pRef[i] - pTest[i]);
90 }
91
92 /* Checking for a NAN value in EnergyError */
93 test = (int *)(&EnergyError);
94 temp = *test;
95
96 if (temp == 0x7FC00000)
97 {
98 return(0);
99 }
100
101
102 SNR = 10 * log10 (EnergySignal / EnergyError);
103
104 return (SNR);
105
106}
107
108
119void arm_provide_guard_bits_q15 (q15_t * input_buf, uint32_t blockSize,
120 uint32_t guard_bits)
121{
122 uint32_t i;
123
124 for (i = 0; i < blockSize; i++)
125 {
126 input_buf[i] = input_buf[i] >> guard_bits;
127 }
128}
129
139void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples)
140{
141 uint32_t i;
142
143 for (i = 0; i < numSamples; i++)
144 {
145 /* 1048576.0f corresponds to pow(2, 20) */
146 pOut[i] = (q31_t) (pIn[i] * 1048576.0f);
147
148 pOut[i] += pIn[i] > 0 ? 0.5 : -0.5;
149
150 if (pIn[i] == (float) 1.0)
151 {
152 pOut[i] = 0x000FFFFF;
153 }
154 }
155}
156
165uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t *pOut, uint32_t numSamples)
166{
167 uint32_t i;
168 int32_t diff, diffCrnt = 0;
169 uint32_t maxDiff = 0;
170
171 for (i = 0; i < numSamples; i++)
172 {
173 diff = pIn[i] - pOut[i];
174 diffCrnt = (diff > 0) ? diff : -diff;
175
176 if (diffCrnt > maxDiff)
177 {
178 maxDiff = diffCrnt;
179 }
180 }
181
182 return(maxDiff);
183}
184
193uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t * pOut, uint32_t numSamples)
194{
195 uint32_t i;
196 int32_t diff, diffCrnt = 0;
197 uint32_t maxDiff = 0;
198
199 for (i = 0; i < numSamples; i++)
200 {
201 diff = pIn[i] - pOut[i];
202 diffCrnt = (diff > 0) ? diff : -diff;
203
204 if (diffCrnt > maxDiff)
205 {
206 maxDiff = diffCrnt;
207 }
208 }
209
210 return(maxDiff);
211}
212
223void arm_provide_guard_bits_q31 (q31_t * input_buf,
224 uint32_t blockSize,
225 uint32_t guard_bits)
226{
227 uint32_t i;
228
229 for (i = 0; i < blockSize; i++)
230 {
231 input_buf[i] = input_buf[i] >> guard_bits;
232 }
233}
234
245void arm_provide_guard_bits_q7 (q7_t * input_buf,
246 uint32_t blockSize,
247 uint32_t guard_bits)
248{
249 uint32_t i;
250
251 for (i = 0; i < blockSize; i++)
252 {
253 input_buf[i] = input_buf[i] >> guard_bits;
254 }
255}
256
257
258
267uint32_t arm_calc_guard_bits (uint32_t num_adds)
268{
269 uint32_t i = 1, j = 0;
270
271 if (num_adds == 1)
272 {
273 return (0);
274 }
275
276 while (i < num_adds)
277 {
278 i = i * 2;
279 j++;
280 }
281
282 return (j);
283}
284
293void arm_apply_guard_bits (float32_t *pIn,
294 uint32_t numSamples,
295 uint32_t guard_bits)
296{
297 uint32_t i;
298
299 for (i = 0; i < numSamples; i++)
300 {
301 pIn[i] = pIn[i] * arm_calc_2pow(guard_bits);
302 }
303}
304
310uint32_t arm_calc_2pow(uint32_t numShifts)
311{
312
313 uint32_t i, val = 1;
314
315 for (i = 0; i < numShifts; i++)
316 {
317 val = val * 2;
318 }
319
320 return(val);
321}
322
323
324
334void arm_float_to_q14 (float *pIn, q15_t *pOut, uint32_t numSamples)
335{
336 uint32_t i;
337
338 for (i = 0; i < numSamples; i++)
339 {
340 /* 16384.0f corresponds to pow(2, 14) */
341 pOut[i] = (q15_t) (pIn[i] * 16384.0f);
342
343 pOut[i] += pIn[i] > 0 ? 0.5 : -0.5;
344
345 if (pIn[i] == (float) 2.0)
346 {
347 pOut[i] = 0x7FFF;
348 }
349
350 }
351
352}
353
354
364void arm_float_to_q30 (float *pIn, q31_t * pOut, uint32_t numSamples)
365{
366 uint32_t i;
367
368 for (i = 0; i < numSamples; i++)
369 {
370 /* 1073741824.0f corresponds to pow(2, 30) */
371 pOut[i] = (q31_t) (pIn[i] * 1073741824.0f);
372
373 pOut[i] += pIn[i] > 0 ? 0.5 : -0.5;
374
375 if (pIn[i] == (float) 2.0)
376 {
377 pOut[i] = 0x7FFFFFFF;
378 }
379 }
380}
381
391void arm_float_to_q29 (float *pIn, q31_t *pOut, uint32_t numSamples)
392{
393 uint32_t i;
394
395 for (i = 0; i < numSamples; i++)
396 {
397 /* 1073741824.0f corresponds to pow(2, 30) */
398 pOut[i] = (q31_t) (pIn[i] * 536870912.0f);
399
400 pOut[i] += pIn[i] > 0 ? 0.5 : -0.5;
401
402 if (pIn[i] == (float) 4.0)
403 {
404 pOut[i] = 0x7FFFFFFF;
405 }
406 }
407}
408
409
419void arm_float_to_q28 (float *pIn, q31_t *pOut, uint32_t numSamples)
420{
421 uint32_t i;
422
423 for (i = 0; i < numSamples; i++)
424 {
425 /* 268435456.0f corresponds to pow(2, 28) */
426 pOut[i] = (q31_t) (pIn[i] * 268435456.0f);
427
428 pOut[i] += pIn[i] > 0 ? 0.5 : -0.5;
429
430 if (pIn[i] == (float) 8.0)
431 {
432 pOut[i] = 0x7FFFFFFF;
433 }
434 }
435}
436
445void arm_clip_f32 (float *pIn, uint32_t numSamples)
446{
447 uint32_t i;
448
449 for (i = 0; i < numSamples; i++)
450 {
451 if (pIn[i] > 1.0f)
452 {
453 pIn[i] = 1.0;
454 }
455 else if ( pIn[i] < -1.0f)
456 {
457 pIn[i] = -1.0;
458 }
459
460 }
461}
462
463
464
465
arm_float_to_q29
void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format.
Definition: project_l0/src/math_helper.c:391
arm_apply_guard_bits
void arm_apply_guard_bits(float32_t *pIn, uint32_t numSamples, uint32_t guard_bits)
Apply guard bits to buffer.
Definition: project_l0/src/math_helper.c:293
arm_float_to_q30
void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format.
Definition: project_l0/src/math_helper.c:364
arm_float_to_q14
void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples)
Converts float to fixed q14.
Definition: project_l0/src/math_helper.c:334
arm_float_to_q12_20
void arm_float_to_q12_20(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed in q12.20 format.
Definition: project_l0/src/math_helper.c:139
arm_compare_fixed_q31
uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output.
Definition: project_l0/src/math_helper.c:193
arm_provide_guard_bits_q7
void arm_provide_guard_bits_q7(q7_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer.
Definition: project_l0/src/math_helper.c:245
arm_calc_guard_bits
uint32_t arm_calc_guard_bits(uint32_t num_adds)
Caluclates number of guard bits.
Definition: project_l0/src/math_helper.c:267
arm_compare_fixed_q15
uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output.
Definition: project_l0/src/math_helper.c:165
arm_float_to_q28
void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q28 format.
Definition: project_l0/src/math_helper.c:419
arm_clip_f32
void arm_clip_f32(float *pIn, uint32_t numSamples)
Clip the float values to +/- 1.
Definition: project_l0/src/math_helper.c:445
arm_provide_guard_bits_q15
void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer.
Definition: project_l0/src/math_helper.c:119
arm_calc_2pow
uint32_t arm_calc_2pow(uint32_t numShifts)
Calculates pow(2, numShifts)
Definition: project_l0/src/math_helper.c:310
arm_provide_guard_bits_q31
void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer.
Definition: project_l0/src/math_helper.c:223
arm_snr_f32
float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize)
Caluclation of SNR.
Definition: project_l0/src/math_helper.c:61


AT32F415 Firmwary Library: fir_filter.h Source File

  • utilities
  • at32f415_slib_demo
  • project_l1
  • inc
project_l1/inc/fir_filter.h
Go to the documentation of this file.
1
30/* Define to prevent recursive inclusion -------------------------------------*/
31#ifndef __FIR_FILTER_H
32#define __FIR_FILTER_H
33
34
35
36/* Includes ------------------------------------------------------------------*/
37#include "arm_math.h"
38
39/* Exported types ------------------------------------------------------------*/
40/* Exported constants --------------------------------------------------------*/
41/* Exported macro ------------------------------------------------------------*/
42/* Exported functions ------------------------------------------------------- */
43void arm_fir_init_f32(
44 arm_fir_instance_f32 * S,
45 uint16_t numTaps,
46 const float32_t * pCoeffs,
47 float32_t * pState,
48 uint32_t blockSize);
49
50void arm_fir_f32(
51const arm_fir_instance_f32 * S,
52const float32_t * pSrc,
53float32_t * pDst,
54uint32_t blockSize);
55
56void FIR_lowpass_filter(float32_t * pSrc, float32_t * pDst, uint32_t testlengthsamples);
57
58#endif /* __FIR_FILTER_H */
59
arm_fir_f32
void arm_fir_f32(const arm_fir_instance_f32 *S, const float32_t *pSrc, float32_t *pDst, uint32_t blockSize)
arm_fir_init_f32
void arm_fir_init_f32(arm_fir_instance_f32 *S, uint16_t numTaps, const float32_t *pCoeffs, float32_t *pState, uint32_t blockSize)
Initialization function for the floating-point FIR filter.
Definition: arm_fir_init_f32.c:57
FIR_lowpass_filter
void FIR_lowpass_filter(float32_t *pSrc, float32_t *pDst, uint32_t testlengthsamples)
Definition: fir_filter.c:76


AT32F415 Firmwary Library: math_helper.h Source File

  • utilities
  • at32f415_slib_demo
  • project_l1
  • inc
project_l1/inc/math_helper.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------
2* Copyright (C) 2010-2013 ARM Limited. All rights reserved.
3*
4* $Date: 17. January 2013
5* $Revision: V1.4.0
6*
7* Project: CMSIS DSP Library
8*
9* Title: math_helper.h
10*
11* Description: Prototypes of all helper functions required.
12*
13* Target Processor: Cortex-M4/Cortex-M3
14*
15* Redistribution and use in source and binary forms, with or without
16* modification, are permitted provided that the following conditions
17* are met:
18* - Redistributions of source code must retain the above copyright
19* notice, this list of conditions and the following disclaimer.
20* - Redistributions in binary form must reproduce the above copyright
21* notice, this list of conditions and the following disclaimer in
22* the documentation and/or other materials provided with the
23* distribution.
24* - Neither the name of ARM LIMITED nor the names of its contributors
25* may be used to endorse or promote products derived from this
26* software without specific prior written permission.
27*
28* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39* POSSIBILITY OF SUCH DAMAGE.
40* -------------------------------------------------------------------- */
41
42
43#include "arm_math.h"
44
45#ifndef MATH_HELPER_H
46#define MATH_HELPER_H
47
48float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize);
49void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples);
50void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits);
51void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits);
52void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples);
53void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples);
54void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples);
55void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples);
56void arm_clip_f32(float *pIn, uint32_t numSamples);
57uint32_t arm_calc_guard_bits(uint32_t num_adds);
58void arm_apply_guard_bits (float32_t * pIn, uint32_t numSamples, uint32_t guard_bits);
59uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples);
60uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples);
61uint32_t arm_calc_2pow(uint32_t guard_bits);
62#endif
63
arm_float_to_q29
void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format.
Definition: project_l0/src/math_helper.c:391
arm_apply_guard_bits
void arm_apply_guard_bits(float32_t *pIn, uint32_t numSamples, uint32_t guard_bits)
Apply guard bits to buffer.
Definition: project_l0/src/math_helper.c:293
arm_float_to_q30
void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format.
Definition: project_l0/src/math_helper.c:364
arm_float_to_q14
void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples)
Converts float to fixed q14.
Definition: project_l0/src/math_helper.c:334
arm_float_to_q12_20
void arm_float_to_q12_20(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed in q12.20 format.
Definition: project_l0/src/math_helper.c:139
arm_compare_fixed_q31
uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output.
Definition: project_l0/src/math_helper.c:193
arm_calc_guard_bits
uint32_t arm_calc_guard_bits(uint32_t num_adds)
Caluclates number of guard bits.
Definition: project_l0/src/math_helper.c:267
arm_compare_fixed_q15
uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output.
Definition: project_l0/src/math_helper.c:165
arm_calc_2pow
uint32_t arm_calc_2pow(uint32_t guard_bits)
Calculates pow(2, numShifts)
Definition: project_l0/src/math_helper.c:310
arm_float_to_q28
void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q28 format.
Definition: project_l0/src/math_helper.c:419
arm_clip_f32
void arm_clip_f32(float *pIn, uint32_t numSamples)
Clip the float values to +/- 1.
Definition: project_l0/src/math_helper.c:445
arm_provide_guard_bits_q15
void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer.
Definition: project_l0/src/math_helper.c:119
arm_provide_guard_bits_q31
void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer.
Definition: project_l0/src/math_helper.c:223
arm_snr_f32
float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize)
Caluclation of SNR.
Definition: project_l0/src/math_helper.c:61


AT32F415 Firmwary Library: arm_fir_data.c Source File

  • utilities
  • at32f415_slib_demo
  • project_l1
  • src
project_l1/src/arm_fir_data.c
Go to the documentation of this file.
1/* ----------------------------------------------------------------------
2* Copyright (C) 2010-2012 ARM Limited. All rights reserved.
3*
4* $Date: 17. January 2013
5* $Revision: V1.4.0
6*
7* Project: CMSIS DSP Library
8* Title: arm_fir_data.c
9*
10* Description: Data file used for example code
11*
12* Target Processor: Cortex-M4/Cortex-M3/Cortex-M0
13*
14* Redistribution and use in source and binary forms, with or without
15* modification, are permitted provided that the following conditions
16* are met:
17* - Redistributions of source code must retain the above copyright
18* notice, this list of conditions and the following disclaimer.
19* - Redistributions in binary form must reproduce the above copyright
20* notice, this list of conditions and the following disclaimer in
21* the documentation and/or other materials provided with the
22* distribution.
23* - Neither the name of ARM LIMITED nor the names of its contributors
24* may be used to endorse or promote products derived from this
25* software without specific prior written permission.
26*
27* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
30* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
31* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
32* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
34* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38* POSSIBILITY OF SUCH DAMAGE.
39* -------------------------------------------------------------------- */
40
41#include "at32f415.h"
42#include "arm_math.h"
43
44/* ----------------------------------------------------------------------
45** Test input signal contains 1000Hz + 15000 Hz
46** ------------------------------------------------------------------- */
47
48float32_t testInput_f32_1kHz_15kHz[320] =
49{
50+0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
51+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
52+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
53-0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
54-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f,
55-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f,
56+0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
57+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
58+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
59+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
60-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f,
61-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f,
62+0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
63+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
64+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
65+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
66-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f,
67-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f,
68-0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
69+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
70+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
71-0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
72-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f,
73-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f,
74+0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
75+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
76+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
77+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
78-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f,
79-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f,
80-0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
81+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
82+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
83+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
84-0.8660254038f, -0.4619397663f, -1.3194792169f, -1.1827865776f, -0.5000000000f, -1.1827865776f, -1.3194792169f, -0.4619397663f,
85-0.8660254038f, -1.2552931065f, -0.3535533906f, -0.4174197128f, -1.0000000000f, -0.1913417162f, +0.0947343455f, -0.5924659585f,
86-0.0000000000f, +0.5924659585f, -0.0947343455f, +0.1913417162f, +1.0000000000f, +0.4174197128f, +0.3535533906f, +1.2552931065f,
87+0.8660254038f, +0.4619397663f, +1.3194792169f, +1.1827865776f, +0.5000000000f, +1.1827865776f, +1.3194792169f, +0.4619397663f,
88+0.8660254038f, +1.2552931065f, +0.3535533906f, +0.4174197128f, +1.0000000000f, +0.1913417162f, -0.0947343455f, +0.5924659585f,
89+0.0000000000f, -0.5924659585f, +0.0947343455f, -0.1913417162f, -1.0000000000f, -0.4174197128f, -0.3535533906f, -1.2552931065f,
90};
91
92/* ----------------------------------------------------------------------
93** Reference output signal computed with MATLAB
94** ------------------------------------------------------------------- */
95
96float32_t refOutput[320] =
97{
98+0.0000000000f, -0.0010797829f, -0.0007681386f, -0.0001982932f, +0.0000644313f, +0.0020854271f, +0.0036891871f, +0.0015855941f,
99-0.0026280805f, -0.0075907658f, -0.0119390538f, -0.0086665968f, +0.0088981202f, +0.0430539279f, +0.0974468742f, +0.1740405600f,
100+0.2681416601f, +0.3747720089f, +0.4893362230f, +0.6024154672f, +0.7058740791f, +0.7968348987f, +0.8715901940f, +0.9277881093f,
101+0.9682182661f, +0.9934674267f, +1.0012052245f, +0.9925859371f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f,
102+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, -0.0000000000f, -0.1309866321f,
103-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f,
104-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f,
105-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f,
106+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f,
107+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f,
108+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, -0.0000000000f, -0.1309866321f,
109-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f,
110-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f,
111-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f,
112+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f,
113+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f,
114+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, -0.0000000000f, -0.1309866321f,
115-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f,
116-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f,
117-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f,
118+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f,
119+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f,
120+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, +0.0000000000f, -0.1309866321f,
121-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f,
122-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f,
123-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f,
124+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f,
125+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f,
126+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, +0.0000000000f, -0.1309866321f,
127-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f,
128-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f,
129-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, -0.0000000000f, +0.1309866321f,
130+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f,
131+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f,
132+0.7085021596f, +0.6100062330f, +0.5012752767f, +0.3834386057f, +0.2592435399f, +0.1309866321f, +0.0000000000f, -0.1309866321f,
133-0.2592435399f, -0.3834386057f, -0.5012752767f, -0.6100062330f, -0.7085021596f, -0.7952493046f, -0.8679010068f, -0.9257026822f,
134-0.9681538347f, -0.9936657199f, -1.0019733630f, -0.9936657199f, -0.9681538347f, -0.9257026822f, -0.8679010068f, -0.7952493046f,
135-0.7085021596f, -0.6100062330f, -0.5012752767f, -0.3834386057f, -0.2592435399f, -0.1309866321f, +0.0000000000f, +0.1309866321f,
136+0.2592435399f, +0.3834386057f, +0.5012752767f, +0.6100062330f, +0.7085021596f, +0.7952493046f, +0.8679010068f, +0.9257026822f,
137+0.9681538347f, +0.9936657199f, +1.0019733630f, +0.9936657199f, +0.9681538347f, +0.9257026822f, +0.8679010068f, +0.7952493046f
138};
139
at32f415.h
at32f415 header file
testInput_f32_1kHz_15kHz
float32_t testInput_f32_1kHz_15kHz[320]
Definition: project_l1/src/arm_fir_data.c:48
refOutput
float32_t refOutput[320]
Definition: project_l1/src/arm_fir_data.c:96


AT32F415 Firmwary Library: math_helper.c Source File

  • utilities
  • at32f415_slib_demo
  • project_l1
  • src
project_l1/src/math_helper.c
Go to the documentation of this file.
1/* ----------------------------------------------------------------------
2* Copyright (C) 2010-2012 ARM Limited. All rights reserved.
3*
4* $Date: 17. January 2013
5* $Revision: V1.4.0 b
6*
7* Project: CMSIS DSP Library
8*
9* Title: math_helper.c
10*
11* Description: Definition of all helper functions required.
12*
13* Target Processor: Cortex-M4/Cortex-M3
14*
15* Redistribution and use in source and binary forms, with or without
16* modification, are permitted provided that the following conditions
17* are met:
18* - Redistributions of source code must retain the above copyright
19* notice, this list of conditions and the following disclaimer.
20* - Redistributions in binary form must reproduce the above copyright
21* notice, this list of conditions and the following disclaimer in
22* the documentation and/or other materials provided with the
23* distribution.
24* - Neither the name of ARM LIMITED nor the names of its contributors
25* may be used to endorse or promote products derived from this
26* software without specific prior written permission.
27*
28* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
36* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
38* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
39* POSSIBILITY OF SUCH DAMAGE.
40* -------------------------------------------------------------------- */
41/* ----------------------------------------------------------------------
42* Include standard header files
43* -------------------------------------------------------------------- */
44#include<math.h>
45
46/* ----------------------------------------------------------------------
47* Include project header files
48* -------------------------------------------------------------------- */
49#include "math_helper.h"
50
61float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize)
62{
63 float EnergySignal = 0.0, EnergyError = 0.0;
64 uint32_t i;
65 float SNR;
66 int temp;
67 int *test;
68
69 for (i = 0; i < buffSize; i++)
70 {
71 /* Checking for a NAN value in pRef array */
72 test = (int *)(&pRef[i]);
73 temp = *test;
74
75 if (temp == 0x7FC00000)
76 {
77 return(0);
78 }
79
80 /* Checking for a NAN value in pTest array */
81 test = (int *)(&pTest[i]);
82 temp = *test;
83
84 if (temp == 0x7FC00000)
85 {
86 return(0);
87 }
88 EnergySignal += pRef[i] * pRef[i];
89 EnergyError += (pRef[i] - pTest[i]) * (pRef[i] - pTest[i]);
90 }
91
92 /* Checking for a NAN value in EnergyError */
93 test = (int *)(&EnergyError);
94 temp = *test;
95
96 if (temp == 0x7FC00000)
97 {
98 return(0);
99 }
100
101
102 SNR = 10 * log10 (EnergySignal / EnergyError);
103
104 return (SNR);
105
106}
107
108
119void arm_provide_guard_bits_q15 (q15_t * input_buf, uint32_t blockSize,
120 uint32_t guard_bits)
121{
122 uint32_t i;
123
124 for (i = 0; i < blockSize; i++)
125 {
126 input_buf[i] = input_buf[i] >> guard_bits;
127 }
128}
129
139void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples)
140{
141 uint32_t i;
142
143 for (i = 0; i < numSamples; i++)
144 {
145 /* 1048576.0f corresponds to pow(2, 20) */
146 pOut[i] = (q31_t) (pIn[i] * 1048576.0f);
147
148 pOut[i] += pIn[i] > 0 ? 0.5 : -0.5;
149
150 if (pIn[i] == (float) 1.0)
151 {
152 pOut[i] = 0x000FFFFF;
153 }
154 }
155}
156
165uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t *pOut, uint32_t numSamples)
166{
167 uint32_t i;
168 int32_t diff, diffCrnt = 0;
169 uint32_t maxDiff = 0;
170
171 for (i = 0; i < numSamples; i++)
172 {
173 diff = pIn[i] - pOut[i];
174 diffCrnt = (diff > 0) ? diff : -diff;
175
176 if (diffCrnt > maxDiff)
177 {
178 maxDiff = diffCrnt;
179 }
180 }
181
182 return(maxDiff);
183}
184
193uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t * pOut, uint32_t numSamples)
194{
195 uint32_t i;
196 int32_t diff, diffCrnt = 0;
197 uint32_t maxDiff = 0;
198
199 for (i = 0; i < numSamples; i++)
200 {
201 diff = pIn[i] - pOut[i];
202 diffCrnt = (diff > 0) ? diff : -diff;
203
204 if (diffCrnt > maxDiff)
205 {
206 maxDiff = diffCrnt;
207 }
208 }
209
210 return(maxDiff);
211}
212
223void arm_provide_guard_bits_q31 (q31_t * input_buf,
224 uint32_t blockSize,
225 uint32_t guard_bits)
226{
227 uint32_t i;
228
229 for (i = 0; i < blockSize; i++)
230 {
231 input_buf[i] = input_buf[i] >> guard_bits;
232 }
233}
234
245void arm_provide_guard_bits_q7 (q7_t * input_buf,
246 uint32_t blockSize,
247 uint32_t guard_bits)
248{
249 uint32_t i;
250
251 for (i = 0; i < blockSize; i++)
252 {
253 input_buf[i] = input_buf[i] >> guard_bits;
254 }
255}
256
257
258
267uint32_t arm_calc_guard_bits (uint32_t num_adds)
268{
269 uint32_t i = 1, j = 0;
270
271 if (num_adds == 1)
272 {
273 return (0);
274 }
275
276 while (i < num_adds)
277 {
278 i = i * 2;
279 j++;
280 }
281
282 return (j);
283}
284
293void arm_apply_guard_bits (float32_t *pIn,
294 uint32_t numSamples,
295 uint32_t guard_bits)
296{
297 uint32_t i;
298
299 for (i = 0; i < numSamples; i++)
300 {
301 pIn[i] = pIn[i] * arm_calc_2pow(guard_bits);
302 }
303}
304
310uint32_t arm_calc_2pow(uint32_t numShifts)
311{
312
313 uint32_t i, val = 1;
314
315 for (i = 0; i < numShifts; i++)
316 {
317 val = val * 2;
318 }
319
320 return(val);
321}
322
323
324
334void arm_float_to_q14 (float *pIn, q15_t *pOut, uint32_t numSamples)
335{
336 uint32_t i;
337
338 for (i = 0; i < numSamples; i++)
339 {
340 /* 16384.0f corresponds to pow(2, 14) */
341 pOut[i] = (q15_t) (pIn[i] * 16384.0f);
342
343 pOut[i] += pIn[i] > 0 ? 0.5 : -0.5;
344
345 if (pIn[i] == (float) 2.0)
346 {
347 pOut[i] = 0x7FFF;
348 }
349
350 }
351
352}
353
354
364void arm_float_to_q30 (float *pIn, q31_t * pOut, uint32_t numSamples)
365{
366 uint32_t i;
367
368 for (i = 0; i < numSamples; i++)
369 {
370 /* 1073741824.0f corresponds to pow(2, 30) */
371 pOut[i] = (q31_t) (pIn[i] * 1073741824.0f);
372
373 pOut[i] += pIn[i] > 0 ? 0.5 : -0.5;
374
375 if (pIn[i] == (float) 2.0)
376 {
377 pOut[i] = 0x7FFFFFFF;
378 }
379 }
380}
381
391void arm_float_to_q29 (float *pIn, q31_t *pOut, uint32_t numSamples)
392{
393 uint32_t i;
394
395 for (i = 0; i < numSamples; i++)
396 {
397 /* 1073741824.0f corresponds to pow(2, 30) */
398 pOut[i] = (q31_t) (pIn[i] * 536870912.0f);
399
400 pOut[i] += pIn[i] > 0 ? 0.5 : -0.5;
401
402 if (pIn[i] == (float) 4.0)
403 {
404 pOut[i] = 0x7FFFFFFF;
405 }
406 }
407}
408
409
419void arm_float_to_q28 (float *pIn, q31_t *pOut, uint32_t numSamples)
420{
421 uint32_t i;
422
423 for (i = 0; i < numSamples; i++)
424 {
425 /* 268435456.0f corresponds to pow(2, 28) */
426 pOut[i] = (q31_t) (pIn[i] * 268435456.0f);
427
428 pOut[i] += pIn[i] > 0 ? 0.5 : -0.5;
429
430 if (pIn[i] == (float) 8.0)
431 {
432 pOut[i] = 0x7FFFFFFF;
433 }
434 }
435}
436
445void arm_clip_f32 (float *pIn, uint32_t numSamples)
446{
447 uint32_t i;
448
449 for (i = 0; i < numSamples; i++)
450 {
451 if (pIn[i] > 1.0f)
452 {
453 pIn[i] = 1.0;
454 }
455 else if ( pIn[i] < -1.0f)
456 {
457 pIn[i] = -1.0;
458 }
459
460 }
461}
462
463
464
465
arm_float_to_q29
void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format.
Definition: project_l1/src/math_helper.c:391
arm_apply_guard_bits
void arm_apply_guard_bits(float32_t *pIn, uint32_t numSamples, uint32_t guard_bits)
Apply guard bits to buffer.
Definition: project_l1/src/math_helper.c:293
arm_float_to_q30
void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q30 format.
Definition: project_l1/src/math_helper.c:364
arm_float_to_q14
void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples)
Converts float to fixed q14.
Definition: project_l1/src/math_helper.c:334
arm_float_to_q12_20
void arm_float_to_q12_20(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed in q12.20 format.
Definition: project_l1/src/math_helper.c:139
arm_compare_fixed_q31
uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output.
Definition: project_l1/src/math_helper.c:193
arm_provide_guard_bits_q7
void arm_provide_guard_bits_q7(q7_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer.
Definition: project_l1/src/math_helper.c:245
arm_calc_guard_bits
uint32_t arm_calc_guard_bits(uint32_t num_adds)
Caluclates number of guard bits.
Definition: project_l1/src/math_helper.c:267
arm_compare_fixed_q15
uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t *pOut, uint32_t numSamples)
Compare MATLAB Reference Output and ARM Test output.
Definition: project_l1/src/math_helper.c:165
arm_float_to_q28
void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples)
Converts float to fixed q28 format.
Definition: project_l1/src/math_helper.c:419
arm_clip_f32
void arm_clip_f32(float *pIn, uint32_t numSamples)
Clip the float values to +/- 1.
Definition: project_l1/src/math_helper.c:445
arm_provide_guard_bits_q15
void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer.
Definition: project_l1/src/math_helper.c:119
arm_calc_2pow
uint32_t arm_calc_2pow(uint32_t numShifts)
Calculates pow(2, numShifts)
Definition: project_l1/src/math_helper.c:310
arm_provide_guard_bits_q31
void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits)
Provide guard bits for Input buffer.
Definition: project_l1/src/math_helper.c:223
arm_snr_f32
float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize)
Caluclation of SNR.
Definition: project_l1/src/math_helper.c:61


AT32F415 Firmwary Library: random.c Source File

  • utilities
  • at32f415_gen_random_number_demo
  • src
random.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "random.h"
29#include "stdio.h"
30#include <stdlib.h>
31
40/* define at32 mcu uid address */
41#define DEVICE_ID_ADDR1 0x1FFFF7E8
42 ertc_time_type *time;
43
44uint16_t ertc_clk_div_a = 0;
45uint16_t ertc_clk_div_b = 0;
46
52int get_uid_for_seed (void)
53{
54 uint32_t id[3] = {0};
55 uint32_t uid_one_word;
56
57 /* get uid */
58 id[0] = *(int*)DEVICE_ID_ADDR1;
59 id[2] = *(int*)(DEVICE_ID_ADDR1+8);
60 uid_one_word=id[0]&0x7fffffff+((id[2]&(~0x7fffffff))<<16);
61 return uid_one_word;
62}
63
69#if ENABLE_ERTC_ASSEED
70void ertc_init_for_seed (void)
71{
72 /* enable the pwc clock interface */
73 crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
74
75 /* allow access to ertc */
76 pwc_battery_powered_domain_access(TRUE);
77
78 /* reset ertc domain */
79 crm_battery_powered_domain_reset(TRUE);
80 crm_battery_powered_domain_reset(FALSE);
81
82
83 /* the ertc clock may varies due to lick frequency dispersion. */
84 /* enable the lick osc */
85 crm_clock_source_enable(CRM_CLOCK_SOURCE_LICK, TRUE);
86
87 /* wait till lick is ready */
88 while(crm_flag_get(CRM_LICK_STABLE_FLAG) == RESET)
89 {
90 }
91
92 /* select the ertc clock source */
93 crm_ertc_clock_select(CRM_ERTC_CLOCK_LICK);
94
95 /* ck_spre(1hz) = ertcclk(lick) /(ertc_clk_div_a + 1)*(ertc_clk_div_b + 1)*/
96 ertc_clk_div_b = 0xFF;
97 ertc_clk_div_a = 0x7F;
98
99
100 /* enable the ertc clock */
101 crm_ertc_clock_enable(TRUE);
102
103 /* deinitializes the ertc registers */
104 ertc_reset();
105
106 /* wait for ertc apb registers synchronisation */
107 ertc_wait_update();
108
109 /* configure the ertc data register and ertc prescaler */
110 ertc_divider_set(ertc_clk_div_a, ertc_clk_div_b);
111 ertc_hour_mode_set(ERTC_HOUR_MODE_24);
112
113 /* set the alarm 05h:20min:30s */
114 ertc_alarm_mask_set(ERTC_ALA, ERTC_ALARM_MASK_DATE_WEEK);
115 ertc_alarm_week_date_select(ERTC_ALA, ERTC_SLECT_DATE);
116 ertc_alarm_set(ERTC_ALA, 31, 5, 20, 30, ERTC_AM);
117
118 /* enable ertc alarm a interrupt */
119 ertc_interrupt_enable(ERTC_ALA_INT, TRUE);
120
121 /* enable the alarm */
122 ertc_alarm_enable(ERTC_ALA, TRUE);
123
124 ertc_flag_clear(ERTC_ALAF_FLAG);
125
126 /* set the date: friday january 11th 2013 */
127 ertc_date_set(13, 1, 11, 5);
128
129 /* set the time to 05h 20mn 00s am */
130 ertc_time_set(5, 20, 0, ERTC_AM);
131
132 /* indicator for the ertc configuration */
133 ertc_bpr_data_write(ERTC_DT1, 0x32F1);
134}
135
136#endif
137
143void randnum_test( void)
144{
145#if ENABLE_ERTC_ASSEED
146
147 if(ertc_bpr_data_read(ERTC_DT1) != 0x32F1)
148 {
149 ertc_init_for_seed();
150 }
151 ertc_calendar_get(time);
152 /* set uid and ertc as seed for random */
153 srand(ERTC->time + get_uid_for_seed());
154#else
155 /* set only uid as seed for random */
156 srand(get_uid_for_seed());
157#endif
158 while(1)
159 {
160 delay_ms(500);
161 printf("%d\r\n",rand());
162 }
163}
164
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_ertc_clock_select
void crm_ertc_clock_select(crm_ertc_clock_type value)
select ertc clock
Definition: at32f415_crm.c:377
crm_ertc_clock_enable
void crm_ertc_clock_enable(confirm_state new_state)
enable or disable ertc
Definition: at32f415_crm.c:387
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
crm_battery_powered_domain_reset
void crm_battery_powered_domain_reset(confirm_state new_state)
battery powered domain software reset
Definition: at32f415_crm.c:496
CRM_PWC_PERIPH_CLOCK
@ CRM_PWC_PERIPH_CLOCK
Definition: at32f415_crm.h:137
CRM_CLOCK_SOURCE_LICK
@ CRM_CLOCK_SOURCE_LICK
Definition: at32f415_crm.h:307
CRM_ERTC_CLOCK_LICK
@ CRM_ERTC_CLOCK_LICK
Definition: at32f415_crm.h:384
CRM_LICK_STABLE_FLAG
#define CRM_LICK_STABLE_FLAG
Definition: at32f415_crm.h:59
ertc_hour_mode_set
error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode)
ertc hour mode set.
Definition: at32f415_ertc.c:283
ertc_wait_update
error_status ertc_wait_update(void)
ertc wait register update finish.
Definition: at32f415_ertc.c:97
ertc_time_set
error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set time.
Definition: at32f415_ertc.c:363
ertc_reset
error_status ertc_reset(void)
ertc reset all register.
Definition: at32f415_ertc.c:207
ertc_alarm_mask_set
void ertc_alarm_mask_set(ertc_alarm_type alarm_x, uint32_t mask)
set which bits are irrelevant to the alarm match.
Definition: at32f415_ertc.c:458
ertc_interrupt_enable
void ertc_interrupt_enable(uint32_t source, confirm_state new_state)
enable or disable interrupt.
Definition: at32f415_ertc.c:1340
ertc_alarm_week_date_select
void ertc_alarm_week_date_select(ertc_alarm_type alarm_x, ertc_week_date_select_type wk)
alarm week or date mode select.
Definition: at32f415_ertc.c:500
ertc_date_set
error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week)
set date.
Definition: at32f415_ertc.c:314
ertc_flag_clear
void ertc_flag_clear(uint32_t flag)
clear flag status
Definition: at32f415_ertc.c:1461
ertc_bpr_data_read
uint32_t ertc_bpr_data_read(ertc_dt_type dt)
read data from bpr register.
Definition: at32f415_ertc.c:1510
ertc_alarm_set
void ertc_alarm_set(ertc_alarm_type alarm_x, uint8_t week_date, uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm)
set alarm.
Definition: at32f415_ertc.c:538
ertc_calendar_get
void ertc_calendar_get(ertc_time_type *time)
get calendar
Definition: at32f415_ertc.c:404
ertc_divider_set
error_status ertc_divider_set(uint16_t div_a, uint16_t div_b)
ertc division set.
Definition: at32f415_ertc.c:251
ertc_bpr_data_write
void ertc_bpr_data_write(ertc_dt_type dt, uint32_t data)
write data to the bpr register.
Definition: at32f415_ertc.c:1484
ertc_alarm_enable
error_status ertc_alarm_enable(ertc_alarm_type alarm_x, confirm_state new_state)
enable or disable alarm clock.
Definition: at32f415_ertc.c:629
ERTC_SLECT_DATE
@ ERTC_SLECT_DATE
Definition: at32f415_ertc.h:124
ERTC_HOUR_MODE_24
@ ERTC_HOUR_MODE_24
Definition: at32f415_ertc.h:105
ERTC_DT1
@ ERTC_DT1
Definition: at32f415_ertc.h:345
ERTC_ALA
@ ERTC_ALA
Definition: at32f415_ertc.h:133
ERTC_AM
@ ERTC_AM
Definition: at32f415_ertc.h:115
ERTC_ALARM_MASK_DATE_WEEK
#define ERTC_ALARM_MASK_DATE_WEEK
Definition: at32f415_ertc.h:89
ERTC_ALAF_FLAG
#define ERTC_ALAF_FLAG
Definition: at32f415_ertc.h:74
ERTC_ALA_INT
#define ERTC_ALA_INT
Definition: at32f415_ertc.h:53
ERTC
#define ERTC
Definition: at32f415_ertc.h:1118
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
ertc_clk_div_b
uint16_t ertc_clk_div_b
Definition: random.c:45
get_uid_for_seed
int get_uid_for_seed(void)
get uid value as seed
Definition: random.c:52
DEVICE_ID_ADDR1
#define DEVICE_ID_ADDR1
Definition: random.c:41
ertc_clk_div_a
uint16_t ertc_clk_div_a
Definition: random.c:44
randnum_test
void randnum_test(void)
enable ertc as seed
Definition: random.c:143
time
ertc_time_type * time
Definition: random.c:42
pwc_battery_powered_domain_access
void pwc_battery_powered_domain_access(confirm_state new_state)
enable or disable access to the battery powered domain.
Definition: at32f415_pwc.c:61
random.h
at32f415 random header file
ertc_time_type
ertc time
Definition: at32f415_ertc.h:371


AT32F415 Firmwary Library: random.h Source File

  • utilities
  • at32f415_gen_random_number_demo
  • inc
random.h
Go to the documentation of this file.
1
27#ifndef __RANDOM_H
28#define __RANDOM_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "at32f415.h"
35
48/* this define ertc seed for random number gen,*/
49#define ENABLE_ERTC_ASSEED (1)
50
59void randnum_test( void);
60
73#ifdef __cplusplus
74}
75#endif
76
77#endif
at32f415.h
at32f415 header file
randnum_test
void randnum_test(void)
enable ertc as seed
Definition: random.c:143


AT32F415 Firmwary Library: run_in_boot_memory.c Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • src
run_in_boot_memory.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "run_in_boot_memory.h"
30#include "stdio.h"
31
32
41void run_in_boot_memory_test(void)
42{
43
44 /* initialize delay function */
45 delay_init();
46
47 /* configure led in at_start_board */
48 at32_led_init(LED2);
49
50 while(1)
51 {
52 /* toggle led2 */
53 at32_led_toggle(LED2);
54 delay_ms(500);
55 }
56}
57
58
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
run_in_boot_memory_test
void run_in_boot_memory_test(void)
Definition: run_in_boot_memory.c:41
LED2
@ LED2
Definition: at32f415_board.h:63
at32_led_init
void at32_led_init(led_type led)
configure led gpio
Definition: at32f415_board.c:216
delay_init
void delay_init()
initialize delay function
Definition: at32f415_board.c:291
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
run_in_boot_memory.h
run in boot memory file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: run_in_boot_memory.h Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • inc
run_in_boot_memory.h
Go to the documentation of this file.
1
27/* Define to prevent recursive inclusion -------------------------------------*/
28#ifndef __RUN_IN_BOOT_memory_H
29#define __RUN_IN_BOOT_memory_H
30
31
32#include "at32f415.h"
33
47void run_in_boot_memory_test(void);
48
61#endif
62
at32f415.h
at32f415 header file
run_in_boot_memory_test
void run_in_boot_memory_test(void)
Definition: run_in_boot_memory.c:41


AT32F415 Firmwary Library: at32_sdio.h Source File

  • sdio
  • sd_mmc_card
  • inc
sd_mmc_card/inc/at32_sdio.h
Go to the documentation of this file.
1
28/* define to prevent recursive inclusion -------------------------------------*/
29#ifndef __AT32_SDIO_H
30#define __AT32_SDIO_H
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36/* includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
51#define SDIOx SDIO1
52
64typedef enum
65{
66 SD_TRANSFER_POLLING_MODE = 0,
67 SD_TRANSFER_DMA_MODE = 1
68} sd_data_transfer_mode_type;
69
73typedef enum
74{
75 /* sdio specific error defines ------------------------------------------*/
76 SD_CMD_FAIL = 1,
77 SD_DATA_FAIL = 2,
78 SD_CMD_RSP_TIMEOUT = 3,
79 SD_DATA_TIMEOUT = 4,
80 SD_TX_UNDERRUN = 5,
81 SD_RX_OVERRUN = 6,
82 SD_START_BIT_ERR = 7,
83 SD_CMD_OUT_OF_RANGE = 8,
84 SD_ADDR_MISALIGNED = 9,
85 SD_BLK_LEN_ERR = 10,
86 SD_ERASE_SEQ_ERR = 11,
87 SD_INVALID_ERASE_PARAM = 12,
88 SD_WR_PROTECT_VIOLATION = 13,
89 SD_LOCK_UNLOCK_FAILED = 14,
90 SD_CMD_CRC_FAILED = 15,
91 SD_ILLEGAL_CMD = 16,
92 SD_CARD_ECC_FAILED = 17,
93 SD_CARD_CONTROLLER_ERR = 18,
94 SD_GENERAL_UNKNOWN_ERROR = 19,
95 SD_STREAM_RD_UNDERRUN = 20,
96 SD_STREAM_WR_OVERRUN = 21,
97 SD_CID_CSD_OVERWRITE = 22,
98 SD_WP_ERASE_SKIP = 23,
99 SD_CARD_ECC_DISABLED = 24,
100 SD_ERASE_RESET = 25,
101 SD_AKE_SEQ_ERROR = 26,
102 SD_INVALID_VOLTRANGE = 27,
103 SD_ADDR_OUT_OF_RANGE = 28,
104 SD_SWITCH_ERROR = 29,
105 SD_SDIO_DISABLED = 30,
106 SD_SDIO_FUNC_BUSY = 31,
107 SD_SDIO_FUNC_FAILED = 32,
108 SD_SDIO_UNKNOWN_FUNC = 33,
110 /* standard error defines --------------------------------------------*/
111 SD_INTERNAL_ERROR,
112 SD_NOT_CONFIGURED,
113 SD_REQ_PENDING,
114 SD_REQ_NOT_APPLICABLE,
115 SD_INVALID_PARAMETER,
116 SD_UNSUPPORTED_FEATURE,
117 SD_UNSUPPORTED_HW,
118 SD_ERROR,
119 SD_OK = 0
120} sd_error_status_type;
121
125typedef struct
126{
127 uint8_t csd_struct;
128 uint8_t spec_version;
129 uint8_t reserved1;
130 uint8_t taac;
131 uint8_t nsac;
132 uint8_t max_bus_clk_freq;
133 uint16_t card_cmd_classes;
134 uint8_t max_read_blk_length;
135 uint8_t part_blk_read;
136 uint8_t write_blk_misalign;
137 uint8_t read_blk_misalign;
138 uint8_t dsr_implemented;
139 uint8_t reserved2;
140 uint32_t device_size;
141 uint8_t max_read_current_vdd_min;
142 uint8_t max_read_current_vdd_max;
143 uint8_t max_write_current_vdd_min;
144 uint8_t max_write_current_vdd_max;
145 uint8_t device_size_mult;
146 uint8_t erase_group_size;
147 uint8_t erase_group_size_mult;
148 uint8_t write_protect_group_size;
149 uint8_t write_protect_group_enable;
150 uint8_t manufacturer_default_ecc;
151 uint8_t write_speed_factor;
152 uint8_t max_write_blk_length;
153 uint8_t part_blk_write;
154 uint8_t reserved3;
155 uint8_t content_protect_app;
156 uint8_t file_format_group;
157 uint8_t copy_flag;
158 uint8_t permanent_write_protect;
159 uint8_t temp_write_protect;
160 uint8_t file_formart;
161 uint8_t ecc_code;
162 uint8_t csd_crc;
163 uint8_t reserved4;
164} sd_csd_struct_type;
165
169typedef struct
170{
171 uint8_t manufacturer_id;
172 uint16_t oem_app_id;
173 uint32_t product_name1;
174 uint8_t product_name2;
175 uint8_t product_reversion;
176 uint32_t product_sn;
177 uint8_t reserved1;
178 uint16_t manufact_date;
179 uint8_t cid_crc;
180 uint8_t reserved2;
181} sd_cid_struct_type;
182
186typedef enum
187{
188 SD_CARD_READY = ((uint32_t)0x00000001),
189 SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002),
190 SD_CARD_STANDBY = ((uint32_t)0x00000003),
191 SD_CARD_TRANSFER = ((uint32_t)0x00000004),
192 SD_CARD_SENDING = ((uint32_t)0x00000005),
193 SD_CARD_RECEIVING = ((uint32_t)0x00000006),
194 SD_CARD_PROGRAMMING = ((uint32_t)0x00000007),
195 SD_CARD_DISCONNECTED = ((uint32_t)0x00000008),
196 SD_CARD_ERROR = ((uint32_t)0x000000FF)
197} sd_card_state_type;
198
202typedef enum
203{
204 SDIO_STD_CAPACITY_SD_CARD_V1_1 = 0,
205 SDIO_STD_CAPACITY_SD_CARD_V2_0 = 1,
206 SDIO_HIGH_CAPACITY_SD_CARD = 2,
207 SDIO_MULTIMEDIA_CARD = 3,
208 SDIO_SECURE_DIGITAL_IO_CARD = 4,
209 SDIO_HIGH_SPEED_MULTIMEDIA_CARD = 5,
210 SDIO_SECURE_DIGITAL_IO_COMBO_CARD = 6,
211 SDIO_HIGH_CAPACITY_MMC_CARD = 7,
212 SDIO_SDIO_CARD = 8
213} sd_memory_card_type;
214
218typedef struct
219{
220 uint32_t sd_spec :4; /* [59:56] */
221 uint32_t scr_structure :4; /* [60:63] */
222 uint32_t sd_bus_width :4; /* [51:48] */
223 uint32_t sd_security :3; /* [52:54] */
224 uint32_t data_stat_after_erase :1; /* [55:55] */
225 uint32_t reserved1 :7; /* [46:40] */
226 uint32_t sd_spec3 :1; /* [47:47] */
227 uint32_t cmd20_support :1; /* [32:32] */
228 uint32_t cmd23_support :1; /* [33:33] */
229 uint32_t reserverd2 :6; /* [34:39] */
230 uint32_t reserverd3; /* [31:0] */
231} sd_scr_struct_type;
232
236typedef struct
237{
238 sd_csd_struct_type sd_csd_reg;
239 sd_cid_struct_type sd_cid_reg;
240 sd_scr_struct_type sd_scr_reg;
241 long long card_capacity;
242 uint32_t card_blk_size;
243 uint16_t rca;
244 uint8_t card_type;
245} sd_card_info_struct_type;
246
258#define SD_CMD_GO_IDLE_STATE ((uint8_t)0)
259#define SD_CMD_SEND_OP_COND ((uint8_t)1)
260#define SD_CMD_ALL_SEND_CID ((uint8_t)2)
261#define SD_CMD_SET_REL_ADDR ((uint8_t)3)
262#define SD_CMD_SET_DSR ((uint8_t)4)
263#define SD_CMD_SDIO_SEN_OP_COND ((uint8_t)5)
264#define SD_CMD_HS_SWITCH ((uint8_t)6)
265#define SD_CMD_SEL_DESEL_CARD ((uint8_t)7)
266#define SD_CMD_HS_SEND_EXT_CSD ((uint8_t)8)
267#define SD_CMD_SEND_CSD ((uint8_t)9)
268#define SD_CMD_SEND_CID ((uint8_t)10)
269#define SD_CMD_READ_DAT_UNTIL_STOP ((uint8_t)11)
270#define SD_CMD_STOP_TRANSMISSION ((uint8_t)12)
271#define SD_CMD_SEND_STATUS ((uint8_t)13)
272#define SD_CMD_HS_BUSTEST_READ ((uint8_t)14)
273#define SD_CMD_GO_INACTIVE_STATE ((uint8_t)15)
274#define SD_CMD_SET_BLOCKLEN ((uint8_t)16)
275#define SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17)
276#define SD_CMD_READ_MULT_BLOCK ((uint8_t)18)
277#define SD_CMD_HS_BUSTEST_WRITE ((uint8_t)19)
278#define SD_CMD_WRITE_DAT_UNTIL_STOP ((uint8_t)20)
279#define SD_CMD_SET_BLOCK_COUNT ((uint8_t)23)
280#define SD_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24)
281#define SD_CMD_WRITE_MULT_BLOCK ((uint8_t)25)
282#define SD_CMD_PROG_CID ((uint8_t)26)
283#define SD_CMD_PROG_CSD ((uint8_t)27)
284#define SD_CMD_SET_WRITE_PROT ((uint8_t)28)
285#define SD_CMD_CLR_WRITE_PROT ((uint8_t)29)
286#define SD_CMD_SEND_WRITE_PROT ((uint8_t)30)
287#define SD_CMD_SD_ERASE_GRP_START ((uint8_t)32)
288#define SD_CMD_SD_ERASE_GRP_END ((uint8_t)33)
289#define SD_CMD_ERASE_GRP_START ((uint8_t)35)
290#define SD_CMD_ERASE_GRP_END ((uint8_t)36)
291#define SD_CMD_ERASE ((uint8_t)38)
292#define SD_CMD_FAST_IO ((uint8_t)39)
293#define SD_CMD_GO_IRQ_STATE ((uint8_t)40)
294#define SD_CMD_LOCK_UNLOCK ((uint8_t)42)
295#define SD_CMD_APP_CMD ((uint8_t)55)
296#define SD_CMD_GEN_CMD ((uint8_t)56)
297#define SD_CMD_NO_CMD ((uint8_t)64)
298
303#define SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6)
304#define SD_CMD_SD_APP_STAUS ((uint8_t)13)
305#define SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22)
306#define SD_CMD_SD_APP_OP_COND ((uint8_t)41)
307#define SD_CMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42)
308#define SD_CMD_SD_APP_SEND_SCR ((uint8_t)51)
309#define SD_CMD_SDIO_RW_DIRECT ((uint8_t)52)
310#define SD_CMD_SDIO_RW_EXTENDED ((uint8_t)53)
311
316#define SD_CMD_SD_APP_GET_MKB ((uint8_t)43)
317#define SD_CMD_SD_APP_GET_MID ((uint8_t)44)
318#define SD_CMD_SD_APP_SET_CER_RN1 ((uint8_t)45)
319#define SD_CMD_SD_APP_GET_CER_RN2 ((uint8_t)46)
320#define SD_CMD_SD_APP_SET_CER_RES2 ((uint8_t)47)
321#define SD_CMD_SD_APP_GET_CER_RES1 ((uint8_t)48)
322#define SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK ((uint8_t)18)
323#define SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK ((uint8_t)25)
324#define SD_CMD_SD_APP_SECURE_ERASE ((uint8_t)38)
325#define SD_CMD_SD_APP_CHANGE_SECURE_AREA ((uint8_t)49)
326#define SD_CMD_SD_APP_SECURE_WRITE_MKB ((uint8_t)48)
327
339#define NULL 0
340#define SDIO_STATIC_FLAGS ((uint32_t)0x000005FF)
341#define SDIO_CMD0TIMEOUT ((uint32_t)0x00010000)
342#define SDIO_DATATIMEOUT ((uint32_t)0xFFFFFFFF)
343#define SDIO_FIFO_Address ((uint32_t)0x40018080)
344
356#define SD_OCR_ADDR_OUT_OF_RANGE ((uint32_t)0x80000000)
357#define SD_OCR_ADDR_MISALIGNED ((uint32_t)0x40000000)
358#define SD_OCR_BLK_LEN_ERR ((uint32_t)0x20000000)
359#define SD_OCR_ERASE_SEQ_ERR ((uint32_t)0x10000000)
360#define SD_OCR_INVALID_ERASE_PARAM ((uint32_t)0x08000000)
361#define SD_OCR_WR_PROTECT_VIOLATION ((uint32_t)0x04000000)
362#define SD_OCR_LOCK_UNLOCK_FAILED ((uint32_t)0x01000000)
363#define SD_OCR_CMD_CRC_FAILED ((uint32_t)0x00800000)
364#define SD_OCR_ILLEGAL_CMD ((uint32_t)0x00400000)
365#define SD_OCR_CARD_ECC_FAILED ((uint32_t)0x00200000)
366#define SD_OCR_CARD_CONTROLLER_ERR ((uint32_t)0x00100000)
367#define SD_OCR_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00080000)
368#define SD_OCR_STREAM_RD_UNDERRUN ((uint32_t)0x00040000)
369#define SD_OCR_STREAM_WR_OVERRUN ((uint32_t)0x00020000)
370#define SD_OCR_CID_CSD_OVERWRIETE ((uint32_t)0x00010000)
371#define SD_OCR_WP_ERASE_SKIP ((uint32_t)0x00008000)
372#define SD_OCR_CARD_ECC_DISABLED ((uint32_t)0x00004000)
373#define SD_OCR_ERASE_RESET ((uint32_t)0x00002000)
374#define MMC_SWITCH_ERROR ((uint32_t)0x00000080)
375#define SD_OCR_AKE_SEQ_ERROR ((uint32_t)0x00000008)
376#define SD_OCR_ERRORBITS ((uint32_t)0xFDFFE008)
377
381#define SD_R5_OUT_OF_RANGE ((uint32_t)0x00000100)
382#define SD_R5_FUNCTION_NUMBER ((uint32_t)0x00000200)
383#define SD_R5_ERROR ((uint32_t)0x00000800)
384
388#define SD_R6_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00002000)
389#define SD_R6_ILLEGAL_CMD ((uint32_t)0x00004000)
390#define SD_R6_CMD_CRC_FAILED ((uint32_t)0x00008000)
391#define SD_VOLTAGE_WINDOW_SD ((uint32_t)0x80100000)
392#define SD_HIGH_CAPACITY ((uint32_t)0x40000000)
393#define SD_STD_CAPACITY ((uint32_t)0x00000000)
394#define SD_CHECK_PATTERN ((uint32_t)0x000001AA)
395#define SD_VOLTAGE_WINDOW_MMC ((uint32_t)0x80FF8000)
396#define SD_MAX_VOLT_TRIAL ((uint32_t)0x0000FFFF)
397#define SD_ALLZERO ((uint32_t)0x00000000)
398#define SD_WIDE_BUS_SUPPORT ((uint32_t)0x00040000)
399#define SD_SINGLE_BUS_SUPPORT ((uint32_t)0x00010000)
400#define SD_CARD_LOCKED ((uint32_t)0x02000000)
401#define SD_CARD_PROGRAMMING ((uint32_t)0x00000007)
402#define SD_CARD_RECEIVING ((uint32_t)0x00000006)
403#define SD_DATATIMEOUT ((uint32_t)0xFFFFFFFF)
404#define SD_0TO7BITS ((uint32_t)0x000000FF)
405#define SD_8TO15BITS ((uint32_t)0x0000FF00)
406#define SD_16TO23BITS ((uint32_t)0x00FF0000)
407#define SD_24TO31BITS ((uint32_t)0xFF000000)
408#define SD_MAX_DATA_LENGTH ((uint32_t)0x01FFFFFF)
409#define SD_HALFFIFO ((uint32_t)0x00000008)
410#define SD_HALFFIFOBYTES ((uint32_t)0x00000020)
411
423#define SD_CCCC_LOCK_UNLOCK ((uint32_t)0x00000080)
424#define SD_CCCC_WRITE_PROT ((uint32_t)0x00000040)
425#define SD_CCCC_ERASE ((uint32_t)0x00000020)
426
438#define SDIO_SEND_IF_COND ((uint32_t)0x00000008)
439
451#define EXT_CSD_Command_set 0x0
452#define EXT_CSD_Set_bit 0x1
453#define EXT_CSD_Clear_byte 0x2
454#define EXT_CSD_Write_byte 0x3
455
456#define EXT_CSD_CMD_SET_NORMAL (1<<0)
457#define EXT_CSD_CMD_SET_SECURE (1<<1)
458#define EXT_CSD_CMD_SET_CPSECURE (1<<2)
459
463#define EXT_CSD_BUS_WIDTH 183
464#define EXT_CSD_HS_TIMING 185
465
474#define SDIO_INTR_STS_WRITE_MASK (SDIO_DTFAIL_FLAG | SDIO_DTTIMEOUT_FLAG | SDIO_TXERRU_FLAG | \
475 SDIO_DTCMPL_FLAG | SDIO_SBITERR_FLAG)
476#define SDIO_INTR_STS_READ_MASK (SDIO_DTFAIL_FLAG | SDIO_DTTIMEOUT_FLAG | SDIO_RXERRO_FLAG | \
477 SDIO_DTCMPL_FLAG | SDIO_SBITERR_FLAG)
482extern sd_card_info_struct_type sd_card_info;
483
488/* sd exported functions ----------------------------------------*/
489 sd_error_status_type sd_init(void);
490void sdio_clock_set(uint32_t clkdiv);
491 sd_error_status_type sd_power_on(void);
492 sd_error_status_type sd_power_off(void);
493 sd_error_status_type sd_card_init(void);
494 sd_error_status_type sd_card_info_get(sd_card_info_struct_type *card_info);
495 sd_error_status_type sd_wide_bus_operation_config(sdio_bus_width_type mode);
496 sd_error_status_type sd_device_mode_set(uint32_t mode);
497 sd_error_status_type sd_deselect_select(uint32_t addr);
498 sd_error_status_type sd_status_send(uint32_t *p_card_status);
499 sd_card_state_type sd_state_get(void);
500 sd_error_status_type sd_blocks_erase(long long addr, uint32_t nblks);
501 sd_error_status_type sd_block_read(uint8_t *buf, long long addr, uint16_t blk_size);
502 sd_error_status_type sd_mult_blocks_read(uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks);
503 sd_error_status_type sd_block_write(const uint8_t *buf, long long addr, uint16_t blk_size);
504 sd_error_status_type sd_mult_blocks_write(const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks);
505 sd_error_status_type mmc_stream_read(uint8_t *buf, long long addr, uint32_t len);
506 sd_error_status_type mmc_stream_write(uint8_t *buf, long long addr, uint32_t len);
507 sd_error_status_type sd_irq_service(void);
508void sd_dma_config(uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir);
509
522#ifdef __cplusplus
523}
524#endif
525
526#endif /* __AT32_SDIO_H */
at32f415.h
at32f415 header file
sd_card_info
sd_card_info_struct_type sd_card_info
Definition: sd_mmc_card/src/at32_sdio.c:47
dma_dir_type
dma_dir_type
dma direction type
Definition: at32f415_dma.h:209
sdio_bus_width_type
sdio_bus_width_type
sdio bus width
Definition: at32f415_sdio.h:139
sd_power_off
sd_error_status_type sd_power_off(void)
turns the sdio output signals off.
Definition: sd_mmc_card/src/at32_sdio.c:395
sd_irq_service
sd_error_status_type sd_irq_service(void)
allows to process all the interrupts that are high.
Definition: sd_mmc_card/src/at32_sdio.c:1782
sd_device_mode_set
sd_error_status_type sd_device_mode_set(uint32_t mode)
set sdio work mode.
Definition: sd_mmc_card/src/at32_sdio.c:778
sd_card_info_get
sd_error_status_type sd_card_info_get(sd_card_info_struct_type *card_info)
returns information about specific card.
Definition: sd_mmc_card/src/at32_sdio.c:524
mmc_stream_write
sd_error_status_type mmc_stream_write(uint8_t *buf, long long addr, uint32_t len)
write mmc card data stream.
Definition: sd_mmc_card/src/at32_sdio.c:1693
sd_card_init
sd_error_status_type sd_card_init(void)
intialises all cards or single card as the case may be card(s) come into standby state.
Definition: sd_mmc_card/src/at32_sdio.c:409
sd_block_read
sd_error_status_type sd_block_read(uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma ...
Definition: sd_mmc_card/src/at32_sdio.c:1180
sd_deselect_select
sd_error_status_type sd_deselect_select(uint32_t addr)
selects od deselects the corresponding card.
Definition: sd_mmc_card/src/at32_sdio.c:799
sdio_clock_set
void sdio_clock_set(uint32_t clkdiv)
set sdio clock devision factor.
Definition: sd_mmc_card/src/at32_sdio.c:174
sd_blocks_erase
sd_error_status_type sd_blocks_erase(long long addr, uint32_t nblks)
erase continuous data block
Definition: sd_mmc_card/src/at32_sdio.c:1022
sd_mult_blocks_write
sd_error_status_type sd_mult_blocks_write(const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed ...
Definition: sd_mmc_card/src/at32_sdio.c:1482
sd_state_get
sd_card_state_type sd_state_get(void)
returns information about sd card.
Definition: sd_mmc_card/src/at32_sdio.c:2482
sd_dma_config
void sd_dma_config(uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
set dma configuation for sdio
Definition: sd_mmc_card/src/at32_sdio.c:2699
sd_block_write
sd_error_status_type sd_block_write(const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be manag...
Definition: sd_mmc_card/src/at32_sdio.c:1360
sd_status_send
sd_error_status_type sd_status_send(uint32_t *p_card_status)
read current card status.
Definition: sd_mmc_card/src/at32_sdio.c:2445
sd_init
sd_error_status_type sd_init(void)
initializes the sd card and put it into standby state (ready for data transfer).
Definition: sd_mmc_card/src/at32_sdio.c:71
mmc_stream_read
sd_error_status_type mmc_stream_read(uint8_t *buf, long long addr, uint32_t len)
read mmc card data stream.
Definition: sd_mmc_card/src/at32_sdio.c:1646
sd_power_on
sd_error_status_type sd_power_on(void)
enquires cards about their operating voltage and configures clock controls.
Definition: sd_mmc_card/src/at32_sdio.c:189
sd_mult_blocks_read
sd_error_status_type sd_mult_blocks_read(uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mod...
Definition: sdio_fatfs/src/at32_sdio.c:1276
sd_wide_bus_operation_config
sd_error_status_type sd_wide_bus_operation_config(sdio_bus_width_type mode)
enable wide bus opeartion for the requeseted card if supported by card.
Definition: sd_mmc_card/src/at32_sdio.c:735
sd_data_transfer_mode_type
sd_data_transfer_mode_type
Definition: sd_mmc_card/inc/at32_sdio.h:65
sd_error_status_type
sd_error_status_type
Definition: sd_mmc_card/inc/at32_sdio.h:74
sd_card_state_type
sd_card_state_type
Definition: sd_mmc_card/inc/at32_sdio.h:187
sd_memory_card_type
sd_memory_card_type
Definition: sd_mmc_card/inc/at32_sdio.h:203
SD_CARD_RECEIVING
#define SD_CARD_RECEIVING
Definition: sd_mmc_card/inc/at32_sdio.h:402
SD_CARD_PROGRAMMING
#define SD_CARD_PROGRAMMING
Definition: sd_mmc_card/inc/at32_sdio.h:401
SD_TRANSFER_DMA_MODE
@ SD_TRANSFER_DMA_MODE
Definition: sd_mmc_card/inc/at32_sdio.h:67
SD_TRANSFER_POLLING_MODE
@ SD_TRANSFER_POLLING_MODE
Definition: sd_mmc_card/inc/at32_sdio.h:66
SD_ERROR
@ SD_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:118
SD_WP_ERASE_SKIP
@ SD_WP_ERASE_SKIP
Definition: sd_mmc_card/inc/at32_sdio.h:98
SD_LOCK_UNLOCK_FAILED
@ SD_LOCK_UNLOCK_FAILED
Definition: sd_mmc_card/inc/at32_sdio.h:89
SD_SDIO_UNKNOWN_FUNC
@ SD_SDIO_UNKNOWN_FUNC
Definition: sd_mmc_card/inc/at32_sdio.h:108
SD_DATA_FAIL
@ SD_DATA_FAIL
Definition: sd_mmc_card/inc/at32_sdio.h:77
SD_STREAM_WR_OVERRUN
@ SD_STREAM_WR_OVERRUN
Definition: sd_mmc_card/inc/at32_sdio.h:96
SD_INVALID_PARAMETER
@ SD_INVALID_PARAMETER
Definition: sd_mmc_card/inc/at32_sdio.h:115
SD_CMD_FAIL
@ SD_CMD_FAIL
Definition: sd_mmc_card/inc/at32_sdio.h:76
SD_CMD_OUT_OF_RANGE
@ SD_CMD_OUT_OF_RANGE
Definition: sd_mmc_card/inc/at32_sdio.h:83
SD_UNSUPPORTED_HW
@ SD_UNSUPPORTED_HW
Definition: sd_mmc_card/inc/at32_sdio.h:117
SD_CARD_ECC_FAILED
@ SD_CARD_ECC_FAILED
Definition: sd_mmc_card/inc/at32_sdio.h:92
SD_INTERNAL_ERROR
@ SD_INTERNAL_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:111
SD_INVALID_ERASE_PARAM
@ SD_INVALID_ERASE_PARAM
Definition: sd_mmc_card/inc/at32_sdio.h:87
SD_CMD_CRC_FAILED
@ SD_CMD_CRC_FAILED
Definition: sd_mmc_card/inc/at32_sdio.h:90
SD_GENERAL_UNKNOWN_ERROR
@ SD_GENERAL_UNKNOWN_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:94
SD_CARD_ECC_DISABLED
@ SD_CARD_ECC_DISABLED
Definition: sd_mmc_card/inc/at32_sdio.h:99
SD_CARD_CONTROLLER_ERR
@ SD_CARD_CONTROLLER_ERR
Definition: sd_mmc_card/inc/at32_sdio.h:93
SD_ERASE_RESET
@ SD_ERASE_RESET
Definition: sd_mmc_card/inc/at32_sdio.h:100
SD_STREAM_RD_UNDERRUN
@ SD_STREAM_RD_UNDERRUN
Definition: sd_mmc_card/inc/at32_sdio.h:95
SD_UNSUPPORTED_FEATURE
@ SD_UNSUPPORTED_FEATURE
Definition: sd_mmc_card/inc/at32_sdio.h:116
SD_TX_UNDERRUN
@ SD_TX_UNDERRUN
Definition: sd_mmc_card/inc/at32_sdio.h:80
SD_ILLEGAL_CMD
@ SD_ILLEGAL_CMD
Definition: sd_mmc_card/inc/at32_sdio.h:91
SD_SDIO_FUNC_BUSY
@ SD_SDIO_FUNC_BUSY
Definition: sd_mmc_card/inc/at32_sdio.h:106
SD_ADDR_OUT_OF_RANGE
@ SD_ADDR_OUT_OF_RANGE
Definition: sd_mmc_card/inc/at32_sdio.h:103
SD_RX_OVERRUN
@ SD_RX_OVERRUN
Definition: sd_mmc_card/inc/at32_sdio.h:81
SD_SDIO_FUNC_FAILED
@ SD_SDIO_FUNC_FAILED
Definition: sd_mmc_card/inc/at32_sdio.h:107
SD_REQ_PENDING
@ SD_REQ_PENDING
Definition: sd_mmc_card/inc/at32_sdio.h:113
SD_REQ_NOT_APPLICABLE
@ SD_REQ_NOT_APPLICABLE
Definition: sd_mmc_card/inc/at32_sdio.h:114
SD_SWITCH_ERROR
@ SD_SWITCH_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:104
SD_INVALID_VOLTRANGE
@ SD_INVALID_VOLTRANGE
Definition: sd_mmc_card/inc/at32_sdio.h:102
SD_SDIO_DISABLED
@ SD_SDIO_DISABLED
Definition: sd_mmc_card/inc/at32_sdio.h:105
SD_DATA_TIMEOUT
@ SD_DATA_TIMEOUT
Definition: sd_mmc_card/inc/at32_sdio.h:79
SD_ADDR_MISALIGNED
@ SD_ADDR_MISALIGNED
Definition: sd_mmc_card/inc/at32_sdio.h:84
SD_START_BIT_ERR
@ SD_START_BIT_ERR
Definition: sd_mmc_card/inc/at32_sdio.h:82
SD_NOT_CONFIGURED
@ SD_NOT_CONFIGURED
Definition: sd_mmc_card/inc/at32_sdio.h:112
SD_CID_CSD_OVERWRITE
@ SD_CID_CSD_OVERWRITE
Definition: sd_mmc_card/inc/at32_sdio.h:97
SD_WR_PROTECT_VIOLATION
@ SD_WR_PROTECT_VIOLATION
Definition: sd_mmc_card/inc/at32_sdio.h:88
SD_CMD_RSP_TIMEOUT
@ SD_CMD_RSP_TIMEOUT
Definition: sd_mmc_card/inc/at32_sdio.h:78
SD_BLK_LEN_ERR
@ SD_BLK_LEN_ERR
Definition: sd_mmc_card/inc/at32_sdio.h:85
SD_OK
@ SD_OK
Definition: sd_mmc_card/inc/at32_sdio.h:119
SD_ERASE_SEQ_ERR
@ SD_ERASE_SEQ_ERR
Definition: sd_mmc_card/inc/at32_sdio.h:86
SD_AKE_SEQ_ERROR
@ SD_AKE_SEQ_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:101
SD_CARD_TRANSFER
@ SD_CARD_TRANSFER
Definition: sd_mmc_card/inc/at32_sdio.h:191
SD_CARD_IDENTIFICATION
@ SD_CARD_IDENTIFICATION
Definition: sd_mmc_card/inc/at32_sdio.h:189
SD_CARD_SENDING
@ SD_CARD_SENDING
Definition: sd_mmc_card/inc/at32_sdio.h:192
SD_CARD_STANDBY
@ SD_CARD_STANDBY
Definition: sd_mmc_card/inc/at32_sdio.h:190
SD_CARD_READY
@ SD_CARD_READY
Definition: sd_mmc_card/inc/at32_sdio.h:188
SD_CARD_DISCONNECTED
@ SD_CARD_DISCONNECTED
Definition: sd_mmc_card/inc/at32_sdio.h:195
SD_CARD_ERROR
@ SD_CARD_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:196
SDIO_SDIO_CARD
@ SDIO_SDIO_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:212
SDIO_HIGH_CAPACITY_SD_CARD
@ SDIO_HIGH_CAPACITY_SD_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:206
SDIO_SECURE_DIGITAL_IO_COMBO_CARD
@ SDIO_SECURE_DIGITAL_IO_COMBO_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:210
SDIO_HIGH_SPEED_MULTIMEDIA_CARD
@ SDIO_HIGH_SPEED_MULTIMEDIA_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:209
SDIO_STD_CAPACITY_SD_CARD_V1_1
@ SDIO_STD_CAPACITY_SD_CARD_V1_1
Definition: sd_mmc_card/inc/at32_sdio.h:204
SDIO_SECURE_DIGITAL_IO_CARD
@ SDIO_SECURE_DIGITAL_IO_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:208
SDIO_STD_CAPACITY_SD_CARD_V2_0
@ SDIO_STD_CAPACITY_SD_CARD_V2_0
Definition: sd_mmc_card/inc/at32_sdio.h:205
SDIO_MULTIMEDIA_CARD
@ SDIO_MULTIMEDIA_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:207
SDIO_HIGH_CAPACITY_MMC_CARD
@ SDIO_HIGH_CAPACITY_MMC_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:211
sd_card_info_struct_type
Definition: sd_mmc_card/inc/at32_sdio.h:237
sd_card_info_struct_type::sd_scr_reg
sd_scr_struct_type sd_scr_reg
Definition: sd_mmc_card/inc/at32_sdio.h:240
sd_card_info_struct_type::card_capacity
long long card_capacity
Definition: sd_mmc_card/inc/at32_sdio.h:241
sd_card_info_struct_type::sd_cid_reg
sd_cid_struct_type sd_cid_reg
Definition: sd_mmc_card/inc/at32_sdio.h:239
sd_card_info_struct_type::sd_csd_reg
sd_csd_struct_type sd_csd_reg
Definition: sd_mmc_card/inc/at32_sdio.h:238
sd_card_info_struct_type::card_blk_size
uint32_t card_blk_size
Definition: sd_mmc_card/inc/at32_sdio.h:242
sd_card_info_struct_type::rca
uint16_t rca
Definition: sd_mmc_card/inc/at32_sdio.h:243
sd_card_info_struct_type::card_type
uint8_t card_type
Definition: sd_mmc_card/inc/at32_sdio.h:244
sd_cid_struct_type
Definition: sd_mmc_card/inc/at32_sdio.h:170
sd_cid_struct_type::reserved1
uint8_t reserved1
Definition: sd_mmc_card/inc/at32_sdio.h:177
sd_cid_struct_type::product_name2
uint8_t product_name2
Definition: sd_mmc_card/inc/at32_sdio.h:174
sd_cid_struct_type::manufact_date
uint16_t manufact_date
Definition: sd_mmc_card/inc/at32_sdio.h:178
sd_cid_struct_type::cid_crc
uint8_t cid_crc
Definition: sd_mmc_card/inc/at32_sdio.h:179
sd_cid_struct_type::product_reversion
uint8_t product_reversion
Definition: sd_mmc_card/inc/at32_sdio.h:175
sd_cid_struct_type::manufacturer_id
uint8_t manufacturer_id
Definition: sd_mmc_card/inc/at32_sdio.h:171
sd_cid_struct_type::product_sn
uint32_t product_sn
Definition: sd_mmc_card/inc/at32_sdio.h:176
sd_cid_struct_type::product_name1
uint32_t product_name1
Definition: sd_mmc_card/inc/at32_sdio.h:173
sd_cid_struct_type::reserved2
uint8_t reserved2
Definition: sd_mmc_card/inc/at32_sdio.h:180
sd_cid_struct_type::oem_app_id
uint16_t oem_app_id
Definition: sd_mmc_card/inc/at32_sdio.h:172
sd_csd_struct_type
Definition: sd_mmc_card/inc/at32_sdio.h:126
sd_csd_struct_type::spec_version
uint8_t spec_version
Definition: sd_mmc_card/inc/at32_sdio.h:128
sd_csd_struct_type::max_write_current_vdd_max
uint8_t max_write_current_vdd_max
Definition: sd_mmc_card/inc/at32_sdio.h:144
sd_csd_struct_type::nsac
uint8_t nsac
Definition: sd_mmc_card/inc/at32_sdio.h:131
sd_csd_struct_type::card_cmd_classes
uint16_t card_cmd_classes
Definition: sd_mmc_card/inc/at32_sdio.h:133
sd_csd_struct_type::part_blk_read
uint8_t part_blk_read
Definition: sd_mmc_card/inc/at32_sdio.h:135
sd_csd_struct_type::read_blk_misalign
uint8_t read_blk_misalign
Definition: sd_mmc_card/inc/at32_sdio.h:137
sd_csd_struct_type::content_protect_app
uint8_t content_protect_app
Definition: sd_mmc_card/inc/at32_sdio.h:155
sd_csd_struct_type::write_speed_factor
uint8_t write_speed_factor
Definition: sd_mmc_card/inc/at32_sdio.h:151
sd_csd_struct_type::max_read_blk_length
uint8_t max_read_blk_length
Definition: sd_mmc_card/inc/at32_sdio.h:134
sd_csd_struct_type::max_bus_clk_freq
uint8_t max_bus_clk_freq
Definition: sd_mmc_card/inc/at32_sdio.h:132
sd_csd_struct_type::ecc_code
uint8_t ecc_code
Definition: sd_mmc_card/inc/at32_sdio.h:161
sd_csd_struct_type::reserved4
uint8_t reserved4
Definition: sd_mmc_card/inc/at32_sdio.h:163
sd_csd_struct_type::dsr_implemented
uint8_t dsr_implemented
Definition: sd_mmc_card/inc/at32_sdio.h:138
sd_csd_struct_type::max_read_current_vdd_min
uint8_t max_read_current_vdd_min
Definition: sd_mmc_card/inc/at32_sdio.h:141
sd_csd_struct_type::reserved2
uint8_t reserved2
Definition: sd_mmc_card/inc/at32_sdio.h:139
sd_csd_struct_type::erase_group_size_mult
uint8_t erase_group_size_mult
Definition: sd_mmc_card/inc/at32_sdio.h:147
sd_csd_struct_type::file_formart
uint8_t file_formart
Definition: sd_mmc_card/inc/at32_sdio.h:160
sd_csd_struct_type::temp_write_protect
uint8_t temp_write_protect
Definition: sd_mmc_card/inc/at32_sdio.h:159
sd_csd_struct_type::permanent_write_protect
uint8_t permanent_write_protect
Definition: sd_mmc_card/inc/at32_sdio.h:158
sd_csd_struct_type::max_read_current_vdd_max
uint8_t max_read_current_vdd_max
Definition: sd_mmc_card/inc/at32_sdio.h:142
sd_csd_struct_type::file_format_group
uint8_t file_format_group
Definition: sd_mmc_card/inc/at32_sdio.h:156
sd_csd_struct_type::device_size
uint32_t device_size
Definition: sd_mmc_card/inc/at32_sdio.h:140
sd_csd_struct_type::write_blk_misalign
uint8_t write_blk_misalign
Definition: sd_mmc_card/inc/at32_sdio.h:136
sd_csd_struct_type::csd_struct
uint8_t csd_struct
Definition: sd_mmc_card/inc/at32_sdio.h:127
sd_csd_struct_type::write_protect_group_enable
uint8_t write_protect_group_enable
Definition: sd_mmc_card/inc/at32_sdio.h:149
sd_csd_struct_type::max_write_current_vdd_min
uint8_t max_write_current_vdd_min
Definition: sd_mmc_card/inc/at32_sdio.h:143
sd_csd_struct_type::reserved1
uint8_t reserved1
Definition: sd_mmc_card/inc/at32_sdio.h:129
sd_csd_struct_type::max_write_blk_length
uint8_t max_write_blk_length
Definition: sd_mmc_card/inc/at32_sdio.h:152
sd_csd_struct_type::csd_crc
uint8_t csd_crc
Definition: sd_mmc_card/inc/at32_sdio.h:162
sd_csd_struct_type::write_protect_group_size
uint8_t write_protect_group_size
Definition: sd_mmc_card/inc/at32_sdio.h:148
sd_csd_struct_type::reserved3
uint8_t reserved3
Definition: sd_mmc_card/inc/at32_sdio.h:154
sd_csd_struct_type::taac
uint8_t taac
Definition: sd_mmc_card/inc/at32_sdio.h:130
sd_csd_struct_type::manufacturer_default_ecc
uint8_t manufacturer_default_ecc
Definition: sd_mmc_card/inc/at32_sdio.h:150
sd_csd_struct_type::part_blk_write
uint8_t part_blk_write
Definition: sd_mmc_card/inc/at32_sdio.h:153
sd_csd_struct_type::copy_flag
uint8_t copy_flag
Definition: sd_mmc_card/inc/at32_sdio.h:157
sd_csd_struct_type::erase_group_size
uint8_t erase_group_size
Definition: sd_mmc_card/inc/at32_sdio.h:146
sd_csd_struct_type::device_size_mult
uint8_t device_size_mult
Definition: sd_mmc_card/inc/at32_sdio.h:145
sd_scr_struct_type
Definition: sd_mmc_card/inc/at32_sdio.h:219
sd_scr_struct_type::cmd20_support
uint32_t cmd20_support
Definition: sd_mmc_card/inc/at32_sdio.h:227
sd_scr_struct_type::sd_bus_width
uint32_t sd_bus_width
Definition: sd_mmc_card/inc/at32_sdio.h:222
sd_scr_struct_type::reserverd3
uint32_t reserverd3
Definition: sd_mmc_card/inc/at32_sdio.h:230
sd_scr_struct_type::cmd23_support
uint32_t cmd23_support
Definition: sd_mmc_card/inc/at32_sdio.h:228
sd_scr_struct_type::sd_spec3
uint32_t sd_spec3
Definition: sd_mmc_card/inc/at32_sdio.h:226
sd_scr_struct_type::data_stat_after_erase
uint32_t data_stat_after_erase
Definition: sd_mmc_card/inc/at32_sdio.h:224
sd_scr_struct_type::reserved1
uint32_t reserved1
Definition: sd_mmc_card/inc/at32_sdio.h:225
sd_scr_struct_type::scr_structure
uint32_t scr_structure
Definition: sd_mmc_card/inc/at32_sdio.h:221
sd_scr_struct_type::sd_security
uint32_t sd_security
Definition: sd_mmc_card/inc/at32_sdio.h:223
sd_scr_struct_type::sd_spec
uint32_t sd_spec
Definition: sd_mmc_card/inc/at32_sdio.h:220
sd_scr_struct_type::reserverd2
uint32_t reserverd2
Definition: sd_mmc_card/inc/at32_sdio.h:229


AT32F415 Firmwary Library: at32_sdio.c Source File

  • sdio
  • sd_mmc_card
  • src
sd_mmc_card/src/at32_sdio.c
Go to the documentation of this file.
1
28#include "at32_sdio.h"
29
38 sdio_command_struct_type sdio_command_init_struct;
39 sdio_data_struct_type sdio_data_init_struct;
40
41static sd_memory_card_type card_type = SDIO_STD_CAPACITY_SD_CARD_V1_1; /* sd card type */
42static uint32_t csd_table[4], cid_table[4], rca = 0; /* csd, sid, rca */
43static sd_data_transfer_mode_type device_mode = SD_TRANSFER_POLLING_MODE; /* working mode */
44static uint8_t stop_flag = 0; /* transmit stop flag */
45volatile sd_error_status_type transfer_error = SD_OK; /* transmit error flag */
46volatile uint8_t transfer_end = 0; /* transmit end flag */
47 sd_card_info_struct_type sd_card_info; /* sd card information */
48
49 sd_error_status_type command_error(void);
50 sd_error_status_type command_rsp1_error(uint8_t cmd);
51 sd_error_status_type command_rsp2_error(void);
52 sd_error_status_type command_rsp3_error(void);
53 sd_error_status_type command_rsp4_error(uint8_t cmd);
54 sd_error_status_type command_rsp5_error(uint8_t cmd);
55 sd_error_status_type command_rsp6_error(uint8_t cmd, uint16_t *p_rca);
56 sd_error_status_type command_rsp7_error(void);
57 sd_error_status_type sd_bus_wide_enable(confirm_state new_state);
58 sd_error_status_type mmc_switch(uint8_t set, uint8_t index, uint8_t value);
59 sd_error_status_type sd_switch(uint32_t mode, uint32_t group, uint8_t value, uint8_t *rsp);
60 sd_error_status_type check_card_programming(uint8_t *p_status);
61 sd_error_status_type speed_change(uint8_t speed);
62 sd_error_status_type scr_find(void);
63uint8_t convert_from_bytes_to_power_of_two(uint16_t number_of_bytes);
64
71 sd_error_status_type sd_init(void)
72{
73 uint16_t clkdiv = 0;
74 sd_error_status_type status = SD_OK;
75 gpio_init_type gpio_init_struct = {0};
76
77 /* gpioc and gpiod periph clock enable */
78 crm_periph_clock_enable(CRM_GPIOC_PERIPH_CLOCK, TRUE);
79 crm_periph_clock_enable(CRM_GPIOD_PERIPH_CLOCK, TRUE);
80
81 /* sdio periph clock enable */
82 crm_periph_clock_enable(CRM_SDIO1_PERIPH_CLOCK, TRUE);
83
84 /* configure pc.08, pc.09, pc.10, pc.11, pc.12 pin: d0, d1, d2, d3, clk pin */
85 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
86 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
87 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
88 gpio_init_struct.gpio_pins = GPIO_PINS_8 | GPIO_PINS_9 | GPIO_PINS_10 | GPIO_PINS_11 | GPIO_PINS_12;
89 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
90 gpio_init(GPIOC, &gpio_init_struct);
91
92 /* configure pd.02 cmd line */
93 gpio_init_struct.gpio_pins = GPIO_PINS_2;
94 gpio_init(GPIOD, &gpio_init_struct);
95
96/* reset sdio */
97 sdio_reset(SDIOx);
98
99 /* power on */
100 status = sd_power_on();
101
102 if(status == SD_OK)
103 {
104 /* sdio card initialize */
105 status = sd_card_init();
106 }
107
108 if(status == SD_OK)
109 {
110 /* get card information*/
111 status = sd_card_info_get(&sd_card_info);
112 }
113
114 if((SDIO_MULTIMEDIA_CARD == card_type) && (sd_card_info.sd_csd_reg.spec_version >= 4))
115 {
116 card_type = SDIO_HIGH_SPEED_MULTIMEDIA_CARD;
117 }
118
119 if(status == SD_OK)
120 {
121 /* select card */
122 status = sd_deselect_select((uint32_t)(sd_card_info.rca << 16));
123 }
124
125 if(status == SD_OK && ((SDIO_STD_CAPACITY_SD_CARD_V1_1 == card_type) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == card_type) || \
126 (SDIO_SECURE_DIGITAL_IO_COMBO_CARD == card_type) || (SDIO_HIGH_CAPACITY_SD_CARD == card_type)))
127 {
128 status = scr_find();
129 }
130
131 if(status == SD_OK)
132 {
133 /* set normal speed */
134 status = speed_change(0);
135 }
136
137 if((status == SD_OK) || (card_type == SDIO_MULTIMEDIA_CARD))
138 {
139 if(sd_card_info.card_type == SDIO_STD_CAPACITY_SD_CARD_V1_1 || sd_card_info.card_type == SDIO_STD_CAPACITY_SD_CARD_V2_0)
140 {
141 /* set sdio_ck to 4MHz */
142 clkdiv = system_core_clock / 4000000;
143
144 if(clkdiv >= 2)
145 {
146 clkdiv -= 2;
147 }
148 }
149 else
150 {
151 /* set sdio_ck to 4MHz */
152 clkdiv = system_core_clock / 4000000;
153
154 if(clkdiv >= 2)
155 {
156 clkdiv -= 2;
157 }
158 }
159 /* set sdio clock divider */
160 sdio_clock_set(clkdiv);
161
162 /* set transfer mode */
163 status = sd_device_mode_set(SD_TRANSFER_DMA_MODE);
164 }
165
166 return status;
167}
168
174void sdio_clock_set(uint32_t clk_div)
175{
176 /* config clock divide [7:0] */
177 SDIOx->clkctrl_bit.clkdiv_l = (clk_div & 0xFF);
178
179 /* config clock divide [9:8] */
180 SDIOx->clkctrl_bit.clkdiv_h = ((clk_div & 0x300) >> 8);
181}
182
189 sd_error_status_type sd_power_on(void)
190{
191 uint8_t retry = 0;
192 sd_error_status_type status = SD_OK;
193 uint32_t response = 0, count = 0, valid_voltage = 0, clk_psc;
194 uint32_t sd_type = SD_STD_CAPACITY;
195
196 /* sdio_ck is less than 400KHz in initialization stage, set to 200KHz */
197 clk_psc = (system_core_clock / 200000) - 2;
198
199 if(clk_psc > 0x3FF)
200 {
201 clk_psc = 0x3FF;
202 }
203
204 /* config sdio clock divide and edge phase */
205 sdio_clock_config(SDIOx, clk_psc, SDIO_CLOCK_EDGE_FALLING);
206 /* config sdio bus width */
207 sdio_bus_width_config(SDIOx, SDIO_BUS_WIDTH_D1);
208 /* disable flow control */
209 sdio_flow_control_enable(SDIOx, FALSE);
210 /* disable clock bypass */
211 sdio_clock_bypass(SDIOx, FALSE);
212 /* disable power saving mode */
213 sdio_power_saving_mode_enable(SDIOx, FALSE);
214
215 /* sdio power on */
216 sdio_power_set(SDIOx, SDIO_POWER_ON);
217 /* enable to output sdio_ck */
218 sdio_clock_enable(SDIOx, TRUE);
219
220 for(retry = 0; retry < 10; retry++)
221 {
222 /* send cmd0, get in idle stage */
223 sdio_command_init_struct.argument = 0x0;
224 sdio_command_init_struct.cmd_index = SD_CMD_GO_IDLE_STATE;
225 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_NO;
226 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
227
228 /* sdio command config */
229 sdio_command_config(SDIOx, &sdio_command_init_struct);
230 /* enable CCSM */
231 sdio_command_state_machine_enable(SDIOx, TRUE);
232
233 /* get command status */
234 status = command_error();
235
236 if(status == SD_OK)
237 {
238 break;
239 }
240 }
241 /* if any errors occured, return status */
242 if(status != SD_OK)
243 {
244 return status;
245 }
246
247 /* send cmd8, check card interface feature */
248 sdio_command_init_struct.argument = SD_CHECK_PATTERN;
249 sdio_command_init_struct.cmd_index = SDIO_SEND_IF_COND;
250 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
251 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
252
253 /* sdio command config */
254 sdio_command_config(SDIOx, &sdio_command_init_struct);
255 /* enable CCSM */
256 sdio_command_state_machine_enable(SDIOx, TRUE);
257
258 /* waiting R7 */
259 status = command_rsp7_error();
260
261 if(status == SD_OK)
262 {
263 /* set card type and sd type */
264 card_type = SDIO_STD_CAPACITY_SD_CARD_V2_0;
265 sd_type = SD_HIGH_CAPACITY;
266 }
267
268 /* send cmd55, check sd version */
269 sdio_command_init_struct.argument = 0x00;
270 sdio_command_init_struct.cmd_index = SD_CMD_APP_CMD;
271 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
272 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
273
274 /* sdio command config */
275 sdio_command_config(SDIOx, &sdio_command_init_struct);
276 /* enable CCSM */
277 sdio_command_state_machine_enable(SDIOx, TRUE);
278
279 /* waiting R1 */
280 status = command_rsp1_error(SD_CMD_APP_CMD);
281
282 /* check sd card or mmc card */
283 if(SD_OK == status)
284 {
285 /* send acmd41, check voltage operation range */
286 while((!valid_voltage) && (count < SD_MAX_VOLT_TRIAL))
287 {
288 /* send cmd55 before acmd41 */
289 sdio_command_init_struct.argument = 0x00;
290 sdio_command_init_struct.cmd_index = SD_CMD_APP_CMD;
291 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
292 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
293
294 /* sdio command config */
295 sdio_command_config(SDIOx, &sdio_command_init_struct);
296 /* enable CCSM */
297 sdio_command_state_machine_enable(SDIOx, TRUE);
298
299 /* waiting R1 */
300 status = command_rsp1_error(SD_CMD_APP_CMD);
301
302 /* if any errors occured, return status */
303 if(status != SD_OK)
304 {
305 return status;
306 }
307
308 /* send acmd41 */
309 sdio_command_init_struct.argument = SD_VOLTAGE_WINDOW_SD | sd_type;
310 sdio_command_init_struct.cmd_index = SD_CMD_SD_APP_OP_COND;
311 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
312 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
313
314 /* sdio command config */
315 sdio_command_config(SDIOx, &sdio_command_init_struct);
316 /* enable CCSM */
317 sdio_command_state_machine_enable(SDIOx, TRUE);
318
319 /* waiting R3 */
320 status = command_rsp3_error();
321
322 /* if any errors occured, return status */
323 if(status != SD_OK)
324 {
325 return status;
326 }
327
328 /* get response1 */
329 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
330
331 /* check sd card power on stage is success or not */
332 valid_voltage = (((response >> 31) == 1) ? 1 : 0);
333 count++;
334 }
335
336 if(count >= SD_MAX_VOLT_TRIAL)
337 {
338 status = SD_INVALID_VOLTRANGE;
339 return status;
340 }
341
342 if(response &= SD_HIGH_CAPACITY)
343 {
344 card_type = SDIO_HIGH_CAPACITY_SD_CARD;
345 }
346 }
347 /* mmc card */
348 else
349 {
350 /* send cmd1 */
351 while((!valid_voltage) && (count < SD_MAX_VOLT_TRIAL))
352 {
353 sdio_command_init_struct.argument = SD_VOLTAGE_WINDOW_MMC;
354 sdio_command_init_struct.cmd_index = SD_CMD_SEND_OP_COND;
355 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
356 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
357
358 /* sdio command config */
359 sdio_command_config(SDIOx, &sdio_command_init_struct);
360 /* enable CCSM */
361 sdio_command_state_machine_enable(SDIOx, TRUE);
362
363 /* waiting R3 */
364 status = command_rsp3_error();
365
366 if(status != SD_OK)
367 {
368 return status;
369 }
370
371 /* get response1 */
372 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
373
374 valid_voltage = (((response >> 31) == 1) ? 1 : 0);
375 count++;
376 }
377
378 if(count >= SD_MAX_VOLT_TRIAL)
379 {
380 status = SD_INVALID_VOLTRANGE;
381 return status;
382 }
383
384 card_type = SDIO_MULTIMEDIA_CARD;
385 }
386
387 return(status);
388}
389
395 sd_error_status_type sd_power_off(void)
396{
397 /* sdio power off */
398 sdio_power_set(SDIOx, SDIO_POWER_OFF);
399
400 return SD_OK;
401}
402
409 sd_error_status_type sd_card_init(void)
410{
411 sd_error_status_type status = SD_OK;
412 uint16_t rca_temp = 0x01;
413
414 /* check power status */
415 if(SDIO_POWER_OFF == sdio_power_status_get(SDIOx))
416 {
417 return SD_REQ_NOT_APPLICABLE;
418 }
419
420 /* check is secure_digital_io_card or not */
421 if(SDIO_SECURE_DIGITAL_IO_CARD != card_type)
422 {
423 /* send cmd2, get cid register */
424 sdio_command_init_struct.argument = 0x0;
425 sdio_command_init_struct.cmd_index = SD_CMD_ALL_SEND_CID;
426 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_LONG;
427 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
428
429 /* sdio command config */
430 sdio_command_config(SDIOx, &sdio_command_init_struct);
431 /* enable CCSM */
432 sdio_command_state_machine_enable(SDIOx, TRUE);
433
434 status = command_rsp2_error();
435 if(status != SD_OK)
436 {
437 return status;
438 }
439
440 cid_table[0] = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
441 cid_table[1] = sdio_response_get(SDIOx, SDIO_RSP2_INDEX);
442 cid_table[2] = sdio_response_get(SDIOx, SDIO_RSP3_INDEX);
443 cid_table[3] = sdio_response_get(SDIOx, SDIO_RSP4_INDEX);
444 }
445
446 /* check card type */
447 if((card_type == SDIO_STD_CAPACITY_SD_CARD_V1_1) || (card_type == SDIO_STD_CAPACITY_SD_CARD_V2_0) || \
448 (card_type == SDIO_SECURE_DIGITAL_IO_COMBO_CARD) || (card_type == SDIO_HIGH_CAPACITY_SD_CARD))
449 {
450 /* send cmd3, get rca */
451 sdio_command_init_struct.argument = 0x00;
452 sdio_command_init_struct.cmd_index = SD_CMD_SET_REL_ADDR;
453 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
454 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
455
456 /* sdio command config */
457 sdio_command_config(SDIOx, &sdio_command_init_struct);
458 /* enable CCSM */
459 sdio_command_state_machine_enable(SDIOx, TRUE);
460
461 status = command_rsp6_error(SD_CMD_SET_REL_ADDR, &rca_temp);
462 if(status != SD_OK)
463 {
464 return status;
465 }
466 }
467
468 /* mmc card */
469 if(card_type == SDIO_MULTIMEDIA_CARD)
470 {
471 /* send cmd3 */
472 sdio_command_init_struct.argument = (uint32_t)(rca_temp << 16);
473 sdio_command_init_struct.cmd_index = SD_CMD_SET_REL_ADDR;
474 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
475 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
476
477 /* sdio command config */
478 sdio_command_config(SDIOx, &sdio_command_init_struct);
479 /* enable CCSM */
480 sdio_command_state_machine_enable(SDIOx, TRUE);
481
482 status = command_rsp2_error();
483 if(status != SD_OK)
484 {
485 return status;
486 }
487 }
488
489 /* check is secure_digital_io_card or not */
490 if(card_type != SDIO_SECURE_DIGITAL_IO_CARD)
491 {
492 rca = rca_temp;
493 sdio_command_init_struct.argument = (uint32_t)(rca << 16);
494 sdio_command_init_struct.cmd_index = SD_CMD_SEND_CSD;
495 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_LONG;
496 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
497
498 /* sdio command config */
499 sdio_command_config(SDIOx, &sdio_command_init_struct);
500 /* enable CCSM */
501 sdio_command_state_machine_enable(SDIOx, TRUE);
502
503 status = command_rsp2_error();
504 if(status != SD_OK)
505 {
506 return status;
507 }
508
509 csd_table[0] = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
510 csd_table[1] = sdio_response_get(SDIOx, SDIO_RSP2_INDEX);
511 csd_table[2] = sdio_response_get(SDIOx, SDIO_RSP3_INDEX);
512 csd_table[3] = sdio_response_get(SDIOx, SDIO_RSP4_INDEX);
513 }
514
515 return SD_OK;
516}
517
524 sd_error_status_type sd_card_info_get(sd_card_info_struct_type *card_info)
525{
526 sd_error_status_type status = SD_OK;
527 uint8_t tmp = 0;
528
529 card_info->card_type = (uint8_t)card_type;
530 card_info->rca = (uint16_t)rca;
531
532 /* byte 0 */
533 tmp = (uint8_t)((csd_table[0] & 0xFF000000) >> 24);
534 card_info->sd_csd_reg.csd_struct = (tmp & 0xC0) >> 6;
535 card_info->sd_csd_reg.spec_version = (tmp & 0x3C) >> 2;
536 card_info->sd_csd_reg.reserved1 = tmp & 0x03;
537
538 /* byte 1 */
539 tmp = (uint8_t)((csd_table[0] & 0x00FF0000) >> 16);
540 card_info->sd_csd_reg.taac = tmp;
541
542 /* byte 2 */
543 tmp = (uint8_t)((csd_table[0] & 0x0000FF00) >> 8);
544 card_info->sd_csd_reg.nsac = tmp;
545
546 /* byte 3 */
547 tmp = (uint8_t)(csd_table[0] & 0x000000FF);
548 card_info->sd_csd_reg.max_bus_clk_freq = tmp;
549
550 /* byte 4 */
551 tmp = (uint8_t)((csd_table[1] & 0xFF000000) >> 24);
552 card_info->sd_csd_reg.card_cmd_classes = tmp << 4;
553
554 /* byte 5 */
555 tmp = (uint8_t)((csd_table[1] & 0x00FF0000) >> 16);
556 card_info->sd_csd_reg.card_cmd_classes |= (tmp & 0xF0) >> 4;
557 card_info->sd_csd_reg.max_read_blk_length = tmp & 0x0F;
558
559 /* byte 6 */
560 tmp = (uint8_t)((csd_table[1] & 0x0000FF00) >> 8);
561 card_info->sd_csd_reg.part_blk_read = (tmp & 0x80) >> 7;
562 card_info->sd_csd_reg.write_blk_misalign = (tmp & 0x40) >> 6;
563 card_info->sd_csd_reg.read_blk_misalign = (tmp & 0x20) >> 5;
564 card_info->sd_csd_reg.dsr_implemented = (tmp & 0x10) >> 4;
565 card_info->sd_csd_reg.reserved2 = 0; /* reserved */
566
567 if((card_type == SDIO_STD_CAPACITY_SD_CARD_V1_1) || (card_type == SDIO_STD_CAPACITY_SD_CARD_V2_0) || (card_type == SDIO_MULTIMEDIA_CARD))
568 {
569 card_info->sd_csd_reg.device_size = (tmp & 0x03) << 10;
570
571 /* byte 7 */
572 tmp = (uint8_t)(csd_table[1] & 0x000000FF);
573 card_info->sd_csd_reg.device_size |= (tmp) << 2;
574
575 /* byte 8 */
576 tmp = (uint8_t)((csd_table[2] & 0xFF000000) >> 24);
577 card_info->sd_csd_reg.device_size |= (tmp & 0xC0) >> 6;
578
579 card_info->sd_csd_reg.max_read_current_vdd_min = (tmp & 0x38) >> 3;
580 card_info->sd_csd_reg.max_read_current_vdd_max = (tmp & 0x07);
581
582 /* byte 9 */
583 tmp = (uint8_t)((csd_table[2] & 0x00FF0000) >> 16);
584 card_info->sd_csd_reg.max_write_current_vdd_min = (tmp & 0xE0) >> 5;
585 card_info->sd_csd_reg.max_write_current_vdd_max = (tmp & 0x1C) >> 2;
586 card_info->sd_csd_reg.device_size_mult = (tmp & 0x03) << 1;
587 /* byte 10 */
588 tmp = (uint8_t)((csd_table[2] & 0x0000FF00) >> 8);
589 card_info->sd_csd_reg.device_size_mult |= (tmp & 0x80) >> 7;
590
591 card_info->card_capacity = (card_info->sd_csd_reg.device_size + 1) ;
592 card_info->card_capacity *= (1 << (card_info->sd_csd_reg.device_size_mult + 2));
593 card_info->card_blk_size = 1 << (card_info->sd_csd_reg.max_read_blk_length);
594 card_info->card_capacity *= card_info->card_blk_size;
595 }
596 else if(card_type == SDIO_HIGH_CAPACITY_SD_CARD)
597 {
598 /* byte 7 */
599 tmp = (uint8_t)(csd_table[1] & 0x000000FF);
600 card_info->sd_csd_reg.device_size = (tmp & 0x3F) << 16;
601
602 /* byte 8 */
603 tmp = (uint8_t)((csd_table[2] & 0xFF000000) >> 24);
604
605 card_info->sd_csd_reg.device_size |= (tmp << 8);
606
607 /* byte 9 */
608 tmp = (uint8_t)((csd_table[2] & 0x00FF0000) >> 16);
609
610 card_info->sd_csd_reg.device_size |= (tmp);
611
612 /* byte 10 */
613 tmp = (uint8_t)((csd_table[2] & 0x0000FF00) >> 8);
614
615 card_info->card_capacity = (uint64_t)(card_info->sd_csd_reg.device_size + 1) * 512 * 1024;
616 card_info->card_blk_size = 512;
617 }
618
619
620 card_info->sd_csd_reg.erase_group_size = (tmp & 0x40) >> 6;
621 card_info->sd_csd_reg.erase_group_size_mult = (tmp & 0x3F) << 1;
622
623 /* byte 11 */
624 tmp = (uint8_t)(csd_table[2] & 0x000000FF);
625 card_info->sd_csd_reg.erase_group_size_mult |= (tmp & 0x80) >> 7;
626 card_info->sd_csd_reg.write_protect_group_size = (tmp & 0x7F);
627
628 /* byte 12 */
629 tmp = (uint8_t)((csd_table[3] & 0xFF000000) >> 24);
630 card_info->sd_csd_reg.write_protect_group_enable = (tmp & 0x80) >> 7;
631 card_info->sd_csd_reg.manufacturer_default_ecc = (tmp & 0x60) >> 5;
632 card_info->sd_csd_reg.write_speed_factor = (tmp & 0x1C) >> 2;
633 card_info->sd_csd_reg.max_write_blk_length = (tmp & 0x03) << 2;
634
635 /* byte 13 */
636 tmp = (uint8_t)((csd_table[3] & 0x00FF0000) >> 16);
637 card_info->sd_csd_reg.max_write_blk_length |= (tmp & 0xC0) >> 6;
638 card_info->sd_csd_reg.part_blk_write = (tmp & 0x20) >> 5;
639 card_info->sd_csd_reg.reserved3 = 0;
640 card_info->sd_csd_reg.content_protect_app = (tmp & 0x01);
641
642 /* byte 14 */
643 tmp = (uint8_t)((csd_table[3] & 0x0000FF00) >> 8);
644 card_info->sd_csd_reg.file_format_group = (tmp & 0x80) >> 7;
645 card_info->sd_csd_reg.copy_flag = (tmp & 0x40) >> 6;
646 card_info->sd_csd_reg.permanent_write_protect = (tmp & 0x20) >> 5;
647 card_info->sd_csd_reg.temp_write_protect = (tmp & 0x10) >> 4;
648 card_info->sd_csd_reg.file_formart = (tmp & 0x0C) >> 2;
649 card_info->sd_csd_reg.ecc_code = (tmp & 0x03);
650
651 /* byte 15 */
652 tmp = (uint8_t)(csd_table[3] & 0x000000FF);
653 card_info->sd_csd_reg.csd_crc = (tmp & 0xFE) >> 1;
654 card_info->sd_csd_reg.reserved4 = 1;
655
656 /* byte 0 */
657 tmp = (uint8_t)((cid_table[0] & 0xFF000000) >> 24);
658 card_info->sd_cid_reg.manufacturer_id = tmp;
659
660 /* byte 1 */
661 tmp = (uint8_t)((cid_table[0] & 0x00FF0000) >> 16);
662 card_info->sd_cid_reg.oem_app_id = tmp << 8;
663
664 /* byte 2 */
665 tmp = (uint8_t)((cid_table[0] & 0x000000FF00) >> 8);
666 card_info->sd_cid_reg.oem_app_id |= tmp;
667
668 /* byte 3 */
669 tmp = (uint8_t)(cid_table[0] & 0x000000FF);
670 card_info->sd_cid_reg.product_name1 = tmp << 24;
671
672 /* byte 4 */
673 tmp = (uint8_t)((cid_table[1] & 0xFF000000) >> 24);
674 card_info->sd_cid_reg.product_name1 |= tmp << 16;
675
676 /* byte 5 */
677 tmp = (uint8_t)((cid_table[1] & 0x00FF0000) >> 16);
678 card_info->sd_cid_reg.product_name1 |= tmp << 8;
679
680 /* byte 6 */
681 tmp = (uint8_t)((cid_table[1] & 0x0000FF00) >> 8);
682 card_info->sd_cid_reg.product_name1 |= tmp;
683
684 /* byte 7 */
685 tmp = (uint8_t)(cid_table[1] & 0x000000FF);
686 card_info->sd_cid_reg.product_name2 = tmp;
687
688 /* byte 8 */
689 tmp = (uint8_t)((cid_table[2] & 0xFF000000) >> 24);
690 card_info->sd_cid_reg.product_reversion = tmp;
691
692 /* byte 9 */
693 tmp = (uint8_t)((cid_table[2] & 0x00FF0000) >> 16);
694 card_info->sd_cid_reg.product_sn = tmp << 24;
695
696 /* byte 10 */
697 tmp = (uint8_t)((cid_table[2] & 0x0000FF00) >> 8);
698 card_info->sd_cid_reg.product_sn |= tmp << 16;
699
700 /* byte 11 */
701 tmp = (uint8_t)(cid_table[2] & 0x000000FF);
702 card_info->sd_cid_reg.product_sn |= tmp << 8;
703
704 /* byte 12 */
705 tmp = (uint8_t)((cid_table[3] & 0xFF000000) >> 24);
706 card_info->sd_cid_reg.product_sn |= tmp;
707
708 /* byte 13 */
709 tmp = (uint8_t)((cid_table[3] & 0x00FF0000) >> 16);
710 card_info->sd_cid_reg.reserved1 |= (tmp & 0xF0) >> 4;
711 card_info->sd_cid_reg.manufact_date = (tmp & 0x0F) << 8;
712
713 /* byte 14 */
714 tmp = (uint8_t)((cid_table[3] & 0x0000FF00) >> 8);
715 card_info->sd_cid_reg.manufact_date |= tmp;
716
717 /* byte 15 */
718 tmp = (uint8_t)(cid_table[3] & 0x000000FF);
719 card_info->sd_cid_reg.cid_crc = (tmp & 0xFE) >> 1;
720 card_info->sd_cid_reg.reserved2 = 1;
721
722 return(status);
723}
724
735 sd_error_status_type sd_wide_bus_operation_config(sdio_bus_width_type mode)
736{
737 sd_error_status_type status = SD_OK;
738
739 if((card_type == SDIO_MULTIMEDIA_CARD) || (card_type == SDIO_HIGH_SPEED_MULTIMEDIA_CARD))
740 {
741 status = mmc_switch(EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, (uint8_t)mode);
742 }
743 else if((card_type == SDIO_STD_CAPACITY_SD_CARD_V1_1) || (card_type == SDIO_STD_CAPACITY_SD_CARD_V2_0) || \
744 (card_type == SDIO_HIGH_CAPACITY_SD_CARD))
745 {
746 if(mode >= 2)
747 {
748 /* not support D8 mode */
749 return SD_UNSUPPORTED_FEATURE;
750 }
751
752 if(SDIO_BUS_WIDTH_D4 == mode)
753 {
754 status = sd_bus_wide_enable(TRUE);
755 }
756 else
757 {
758 status = sd_bus_wide_enable(FALSE);
759 }
760 }
761
762 if(status == SD_OK)
763 {
764 sdio_bus_width_config(SDIOx, mode);
765 }
766
767 return status;
768}
769
778 sd_error_status_type sd_device_mode_set(uint32_t mode)
779{
780 sd_error_status_type status = SD_OK;
781
782 if((mode == SD_TRANSFER_DMA_MODE) || (mode == SD_TRANSFER_POLLING_MODE))
783 {
784 device_mode = (sd_data_transfer_mode_type)mode;
785 }
786 else
787 {
788 status = SD_INVALID_PARAMETER;
789 }
790
791 return status;
792}
793
799 sd_error_status_type sd_deselect_select(uint32_t addr)
800{
801 /* send cmd7, select card */
802 sdio_command_init_struct.argument = addr;
803 sdio_command_init_struct.cmd_index = SD_CMD_SEL_DESEL_CARD;
804 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
805 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_INT;
806
807 /* sdio command config */
808 sdio_command_config(SDIOx, &sdio_command_init_struct);
809 /* enable CCSM */
810 sdio_command_state_machine_enable(SDIOx, TRUE);
811
812 return command_rsp1_error(SD_CMD_SEL_DESEL_CARD);
813}
814
822 sd_error_status_type sdio_command_data_send(sdio_command_struct_type *sdio_cmd_init_t, \
823 sdio_data_struct_type* sdio_data_init_t, uint32_t *buf)
824{
825 sd_error_status_type status = SD_OK;
826 uint32_t count = 0;
827 uint32_t timeout = SDIO_DATATIMEOUT;
828 uint32_t length = 0;
829
830 if(buf == NULL)
831 {
832 return SD_INVALID_PARAMETER;
833 }
834 /* clear dtctrl register */
835 SDIOx->dtcnt = 0x0;
836
837 /* sdio command config */
838 sdio_data_config(SDIOx, sdio_data_init_t);
839 /* enable DCSM */
840 sdio_data_state_machine_enable(SDIOx, TRUE);
841
842 length = sdio_data_init_t->data_length;
843
844 if(device_mode == SD_TRANSFER_DMA_MODE)
845 {
846 if(sdio_data_init_t->transfer_direction == SDIO_DATA_TRANSFER_TO_CONTROLLER)
847 {
848 sd_dma_config(buf, length, DMA_DIR_PERIPHERAL_TO_MEMORY);
849 SDIOx->inten |= SDIO_INTR_STS_READ_MASK;
850 transfer_error = SD_OK;
851 transfer_end = 0;
852 sdio_dma_enable(SDIOx, TRUE);
853 }
854 }
855
856 /* sdio command config */
857 sdio_command_config(SDIOx, sdio_cmd_init_t);
858 /* enable CCSM */
859 sdio_command_state_machine_enable(SDIOx, TRUE);
860
861 status = command_rsp1_error(sdio_cmd_init_t->cmd_index);
862 if(status != SD_OK)
863 {
864 return status;
865 }
866
867 /* polling mode */
868 if(device_mode == SD_TRANSFER_POLLING_MODE)
869 {
870 if(SDIO_DATA_TRANSFER_TO_CONTROLLER == sdio_data_init_t->transfer_direction)
871 {
872 while(!(SDIOx->sts & (SDIO_INTR_STS_READ_MASK)))
873 {
874 if(sdio_flag_get(SDIOx, SDIO_RXBUFH_FLAG) != RESET)
875 {
876 for(count = 0; count < 8; count++, buf++)
877 {
878 *buf = sdio_data_read(SDIOx);
879 }
880
881 timeout = 0x7FFFFF;
882 }
883 else
884 {
885 if(0 == timeout)
886 {
887 sd_init();
888 return SD_DATA_TIMEOUT;
889 }
890
891 timeout--;
892 }
893 }
894
895 while(sdio_flag_get(SDIOx, SDIO_RXBUF_FLAG) != RESET)
896 {
897 *buf = sdio_data_read(SDIOx);
898 buf++;
899 }
900 }
901 else
902 {
903 while(!(SDIOx->sts & SDIO_INTR_STS_WRITE_MASK))
904 {
905 if(sdio_flag_get(SDIOx, SDIO_TXBUFH_FLAG) != RESET)
906 {
907 for(count = 0; count < 8 && length > 0; count++, buf++, length -= 4)
908 {
909 sdio_data_write(SDIOx, *buf);
910 }
911
912 timeout = 0x3FFFFFFF;
913 }
914 else
915 {
916 if(timeout == 0)
917 {
918 sd_init();
919 return SD_DATA_TIMEOUT;
920 }
921
922 timeout--;
923 }
924 }
925 }
926 /* data timeout */
927 if(sdio_flag_get(SDIOx, SDIO_DTTIMEOUT_FLAG) != RESET)
928 {
929 sdio_flag_clear(SDIOx, SDIO_DTTIMEOUT_FLAG);
930 return SD_DATA_TIMEOUT;
931 }
932 /* crc error */
933 else if(sdio_flag_get(SDIOx, SDIO_DTFAIL_FLAG) != RESET)
934 {
935 sdio_flag_clear(SDIOx, SDIO_DTFAIL_FLAG);
936 return SD_DATA_FAIL;
937 }
938 /* over run error */
939 else if(sdio_flag_get(SDIOx, SDIO_RXERRO_FLAG) != RESET)
940 {
941 sdio_flag_clear(SDIOx, SDIO_RXERRO_FLAG);
942 return SD_RX_OVERRUN;
943 }
944 /* under run error */
945 else if(sdio_flag_get(SDIOx, SDIO_TXERRU_FLAG) != RESET)
946 {
947 sdio_flag_clear(SDIOx, SDIO_TXERRU_FLAG);
948 return SD_TX_UNDERRUN;
949 }
950 /* start bit error */
951 else if(sdio_flag_get(SDIOx, SDIO_SBITERR_FLAG) != RESET)
952 {
953 sdio_flag_clear(SDIOx, SDIO_SBITERR_FLAG);
954 return SD_START_BIT_ERR;
955 }
956 /* data transfer complete */
957 if((stop_flag == 1) && (sdio_flag_get(SDIOx, SDIO_DTCMPL_FLAG) != RESET))
958 {
959 /* send cmd12, stop transmission */
960 sdio_cmd_init_t->argument = 0;
961 sdio_cmd_init_t->cmd_index = SD_CMD_STOP_TRANSMISSION;
962 sdio_cmd_init_t->rsp_type = SDIO_RESPONSE_SHORT;
963 sdio_cmd_init_t->wait_type = SDIO_WAIT_FOR_NO;
964
965 /* sdio command config */
966 sdio_command_config(SDIOx, sdio_cmd_init_t);
967 /* enable CCSM */
968 sdio_command_state_machine_enable(SDIOx, TRUE);
969
970 status = command_rsp1_error(SD_CMD_STOP_TRANSMISSION);
971
972 if(status != SD_OK)
973 {
974 return status;
975 }
976 }
977
978 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
979 }
980 else if(device_mode == SD_TRANSFER_DMA_MODE)
981 {
982 if(sdio_data_init_t->transfer_direction == SDIO_DATA_TRANSFER_TO_CARD)
983 {
984 sd_dma_config(buf, length, DMA_DIR_MEMORY_TO_PERIPHERAL);
985 SDIOx->inten |= SDIO_INTR_STS_WRITE_MASK;
986 transfer_error = SD_OK;
987 transfer_end = 0;
988 sdio_dma_enable(SDIOx, TRUE);
989 }
990
991 while(!(SDIOx->sts & SDIOx->inten) && timeout)
992 {
993 timeout--;
994
995 if(transfer_end)
996 {
997 break;
998 }
999 }
1000
1001 if(timeout == 0)
1002 {
1003 sd_init();
1004 return SD_DATA_TIMEOUT;
1005 }
1006
1007 if(transfer_error != SD_OK)
1008 {
1009 status = transfer_error;
1010 }
1011 }
1012
1013 return status;
1014}
1015
1022 sd_error_status_type sd_blocks_erase(long long addr, uint32_t nblks)
1023{
1024 sd_error_status_type status = SD_OK;
1025 uint32_t start_addr = 0, end_addr = 0, response = 0;
1026 uint8_t card_state;
1027
1028 /* high capacity sd card */
1029 if(card_type == SDIO_HIGH_CAPACITY_SD_CARD)
1030 {
1031 start_addr = addr >> 9;
1032 end_addr = start_addr + nblks - 1;
1033 }
1034 else
1035 {
1036 start_addr = addr;
1037 end_addr = start_addr + (nblks - 1) * 512;
1038 }
1039
1040 /* clear DCSM configuration */
1041 sdio_data_init_struct.block_size = SDIO_DATA_BLOCK_SIZE_1B;
1042 sdio_data_init_struct.data_length = 0 ;
1043 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1044 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1045 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1046
1047 sdio_data_config(SDIOx, &sdio_data_init_struct);
1048 sdio_data_state_machine_enable(SDIOx, FALSE);
1049
1050 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1051
1052 /* check card locked */
1053 if(response & SD_CARD_LOCKED)
1054 {
1055 return SD_LOCK_UNLOCK_FAILED;
1056 }
1057
1058 if(card_type == SDIO_MULTIMEDIA_CARD || card_type == SDIO_HIGH_SPEED_MULTIMEDIA_CARD)
1059 {
1060 /* send cmd35, set erase group start */
1061 sdio_command_init_struct.argument = start_addr;
1062 sdio_command_init_struct.cmd_index = SD_CMD_ERASE_GRP_START;
1063 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1064 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1065
1066 /* sdio command config */
1067 sdio_command_config(SDIOx, &sdio_command_init_struct);
1068 /* enable CCSM */
1069 sdio_command_state_machine_enable(SDIOx, TRUE);
1070
1071 status = command_rsp1_error(SD_CMD_ERASE_GRP_START);
1072
1073 if(status != SD_OK)
1074 {
1075 return status;
1076 }
1077
1078 /* send cmd36, set erase group end */
1079 sdio_command_init_struct.argument = end_addr;
1080 sdio_command_init_struct.cmd_index = SD_CMD_ERASE_GRP_END;
1081
1082 /* sdio command config */
1083 sdio_command_config(SDIOx, &sdio_command_init_struct);
1084 /* enable CCSM */
1085 sdio_command_state_machine_enable(SDIOx, TRUE);
1086
1087 status = command_rsp1_error(SD_CMD_ERASE_GRP_END);
1088
1089 if(status != SD_OK)
1090 {
1091 return status;
1092 }
1093
1094 /* send cmd38, start erase gourp */
1095 sdio_command_init_struct.argument = 0;
1096 sdio_command_init_struct.cmd_index = SD_CMD_ERASE;
1097
1098 /* sdio command config */
1099 sdio_command_config(SDIOx, &sdio_command_init_struct);
1100 /* enable CCSM */
1101 sdio_command_state_machine_enable(SDIOx, TRUE);
1102
1103 status = command_rsp1_error(SD_CMD_ERASE);
1104
1105 if(status != SD_OK)
1106 {
1107 return status;
1108 }
1109 }
1110 else
1111 {
1112 /* send cmd32, set erase block start */
1113 sdio_command_init_struct.argument = start_addr;
1114 sdio_command_init_struct.cmd_index = SD_CMD_SD_ERASE_GRP_START;
1115 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1116 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1117
1118 /* sdio command config */
1119 sdio_command_config(SDIOx, &sdio_command_init_struct);
1120 /* enable CCSM */
1121 sdio_command_state_machine_enable(SDIOx, TRUE);
1122
1123 status = command_rsp1_error(SD_CMD_SD_ERASE_GRP_START);
1124
1125 if(status != SD_OK)
1126 {
1127 return status;
1128 }
1129
1130 /* send cmd33, set erase block end */
1131 sdio_command_init_struct.argument = end_addr;
1132 sdio_command_init_struct.cmd_index = SD_CMD_SD_ERASE_GRP_END;
1133
1134 /* sdio command config */
1135 sdio_command_config(SDIOx, &sdio_command_init_struct);
1136 /* enable CCSM */
1137 sdio_command_state_machine_enable(SDIOx, TRUE);
1138
1139 if(status != SD_OK)
1140 {
1141 return status;
1142 }
1143
1144 /* send cmd38, start erase block */
1145 sdio_command_init_struct.argument = 0;
1146 sdio_command_init_struct.cmd_index = SD_CMD_ERASE;
1147
1148 /* sdio command config */
1149 sdio_command_config(SDIOx, &sdio_command_init_struct);
1150 /* enable CCSM */
1151 sdio_command_state_machine_enable(SDIOx, TRUE);
1152
1153 status = command_rsp1_error(SD_CMD_ERASE);
1154
1155 if(status != SD_OK)
1156 {
1157 return status;
1158 }
1159 }
1160
1161 status = check_card_programming(&card_state);
1162
1163 while((status == SD_OK) && ((card_state == SD_CARD_PROGRAMMING) || \
1164 (card_state == SD_CARD_RECEIVING)))
1165 {
1166 status = check_card_programming(&card_state);
1167 }
1168
1169 return status;
1170}
1171
1180 sd_error_status_type sd_block_read(uint8_t *buf, long long addr, uint16_t blk_size)
1181{
1182 sd_error_status_type status = SD_OK;
1183 uint32_t response = 0;
1184 uint8_t power;
1185
1186 if(NULL == buf)
1187 {
1188 return SD_INVALID_PARAMETER;
1189 }
1190
1191 SDIOx->dtctrl = 0x0;
1192
1193 if(card_type == SDIO_HIGH_CAPACITY_SD_CARD)
1194 {
1195 blk_size = 512;
1196 addr >>= 9;
1197 }
1198
1199 /* clear DCSM configuration */
1200 sdio_data_init_struct.block_size = SDIO_DATA_BLOCK_SIZE_1B;
1201 sdio_data_init_struct.data_length = 0;
1202 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
1203 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1204 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1205
1206 sdio_data_config(SDIOx, &sdio_data_init_struct);
1207 sdio_data_state_machine_enable(SDIOx, FALSE);
1208
1209 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1210
1211 /* check card locked */
1212 if(response & SD_CARD_LOCKED)
1213 {
1214 return SD_LOCK_UNLOCK_FAILED;
1215 }
1216
1217 if((blk_size > 0) && (blk_size <= 2048) && ((blk_size & (blk_size - 1)) == 0))
1218 {
1219 power = convert_from_bytes_to_power_of_two(blk_size);
1220
1221 /* send cmd16, set block size */
1222 sdio_command_init_struct.argument = blk_size;
1223 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCKLEN;
1224 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1225 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1226
1227 /* sdio command config */
1228 sdio_command_config(SDIOx, &sdio_command_init_struct);
1229 /* enable CCSM */
1230 sdio_command_state_machine_enable(SDIOx, TRUE);
1231
1232 status = command_rsp1_error(SD_CMD_SET_BLOCKLEN);
1233
1234 if(status != SD_OK)
1235 {
1236 return status;
1237 }
1238 }
1239 else
1240 {
1241 return SD_INVALID_PARAMETER;
1242 }
1243
1244 sdio_data_init_struct.block_size = (sdio_block_size_type)(power);
1245 sdio_data_init_struct.data_length = blk_size ;
1246 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1247 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CONTROLLER;
1248 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1249
1250 sdio_command_init_struct.argument = addr;
1251 sdio_command_init_struct.cmd_index = SD_CMD_READ_SINGLE_BLOCK;
1252 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1253 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1254
1255 stop_flag = 0;
1256
1257 return sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)buf);
1258}
1259
1269 __align(4) uint32_t *tempbuff;
1270 sd_error_status_type sd_mult_blocks_read(uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
1271{
1272 sd_error_status_type status = SD_OK;
1273 uint32_t response = 0;
1274 uint8_t power;
1275
1276 SDIOx->dtctrl = 0x0;
1277
1278 if(card_type == SDIO_HIGH_CAPACITY_SD_CARD)
1279 {
1280 blk_size = 512;
1281 addr >>= 9;
1282 }
1283
1284 /* clear DCSM configuration */
1285 sdio_data_init_struct.block_size = (sdio_block_size_type)0;
1286 sdio_data_init_struct.data_length = 0;
1287 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
1288 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1289 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1290
1291 sdio_data_config(SDIOx, &sdio_data_init_struct);
1292 sdio_data_state_machine_enable(SDIOx, FALSE);
1293
1294 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1295
1296 /* check card locked */
1297 if(response & SD_CARD_LOCKED)
1298 {
1299 return SD_LOCK_UNLOCK_FAILED;
1300 }
1301
1302 if((blk_size > 0) && (blk_size <= 2048) && ((blk_size & (blk_size - 1)) == 0))
1303 {
1304 power = convert_from_bytes_to_power_of_two(blk_size);
1305
1306 /* send cmd16, set block size */
1307 sdio_command_init_struct.argument = blk_size;
1308 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCKLEN;
1309 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1310 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1311
1312 /* sdio command config */
1313 sdio_command_config(SDIOx, &sdio_command_init_struct);
1314 /* enable CCSM */
1315 sdio_command_state_machine_enable(SDIOx, TRUE);
1316
1317 status = command_rsp1_error(SD_CMD_SET_BLOCKLEN);
1318
1319 if(status != SD_OK)
1320 {
1321 return status;
1322 }
1323 }
1324 else
1325 {
1326 return SD_INVALID_PARAMETER;
1327 }
1328
1329 /* check max receive length */
1330 if(nblks * blk_size > SD_MAX_DATA_LENGTH)
1331 {
1332 return SD_INVALID_PARAMETER;
1333 }
1334
1335 sdio_data_init_struct.block_size = (sdio_block_size_type)(power);
1336 sdio_data_init_struct.data_length = nblks * blk_size ;
1337 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1338 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CONTROLLER;
1339 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1340
1341 /* send cmd18, read block data */
1342 sdio_command_init_struct.argument = addr;
1343 sdio_command_init_struct.cmd_index = SD_CMD_READ_MULT_BLOCK;
1344 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1345 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1346
1347 stop_flag = 1;
1348
1349 return sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)buf);
1350}
1351
1360 sd_error_status_type sd_block_write(const uint8_t *buf, long long addr, uint16_t blk_size)
1361{
1362 sd_error_status_type status = SD_OK;
1363 uint8_t power = 0, card_state = 0;
1364 uint32_t timeout = 0, card_status = 0, response = 0;
1365
1366 if(buf == NULL)
1367 {
1368 return SD_INVALID_PARAMETER;
1369 }
1370
1371 SDIOx->dtctrl = 0x0;
1372
1373 /* clear DCSM configuration */
1374 sdio_data_init_struct.block_size = (sdio_block_size_type)0;
1375 sdio_data_init_struct.data_length = 0;
1376 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
1377 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1378 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1379
1380 sdio_data_config(SDIOx, &sdio_data_init_struct);
1381 sdio_data_state_machine_enable(SDIOx, FALSE);
1382
1383 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1384
1385 /* check card locked */
1386 if(response & SD_CARD_LOCKED)
1387 {
1388 return SD_LOCK_UNLOCK_FAILED;
1389 }
1390
1391 if(card_type == SDIO_HIGH_CAPACITY_SD_CARD)
1392 {
1393 blk_size = 512;
1394 addr >>= 9;
1395 }
1396
1397 if((blk_size > 0) && (blk_size <= 2048) && ((blk_size & (blk_size - 1)) == 0))
1398 {
1399 power = convert_from_bytes_to_power_of_two(blk_size);
1400
1401 /* send cmd16, set block size */
1402 sdio_command_init_struct.argument = blk_size;
1403 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCKLEN;
1404 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1405 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1406
1407 /* sdio command config */
1408 sdio_command_config(SDIOx, &sdio_command_init_struct);
1409 /* enable CCSM */
1410 sdio_command_state_machine_enable(SDIOx, TRUE);
1411
1412 status = command_rsp1_error(SD_CMD_SET_BLOCKLEN);
1413
1414 if(status != SD_OK)
1415 {
1416 return status;
1417 }
1418 }
1419 else
1420 {
1421 return SD_INVALID_PARAMETER;
1422 }
1423
1424 timeout = SD_DATATIMEOUT;
1425
1426 do
1427 {
1428 timeout--;
1429 status = sd_status_send(&card_status);
1430 }
1431 /* check ready_for_data flag */
1432 while(((card_status & 0x00000100) == 0) && (timeout > 0));
1433
1434 if(timeout == 0)
1435 {
1436 return SD_ERROR;
1437 }
1438
1439 /* send cmd24, write single block */
1440 sdio_command_init_struct.argument = addr;
1441 sdio_command_init_struct.cmd_index = SD_CMD_WRITE_SINGLE_BLOCK;
1442 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1443 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1444
1445 sdio_data_init_struct.block_size = (sdio_block_size_type)(power);
1446 sdio_data_init_struct.data_length = blk_size;
1447 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
1448 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1449 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1450
1451 stop_flag = 0;
1452
1453 /* single block, stop command is unnecessary */
1454 status = sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)buf);
1455
1456 if(status != SD_OK)
1457 {
1458 return status;
1459 }
1460
1461 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
1462
1463 status = check_card_programming(&card_state);
1464
1465 while((status == SD_OK) && ((card_state == SD_CARD_PROGRAMMING) || (card_state == SD_CARD_RECEIVING)))
1466 {
1467 status = check_card_programming(&card_state);
1468 }
1469
1470 return status;
1471}
1472
1482 sd_error_status_type sd_mult_blocks_write(const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
1483{
1484 sd_error_status_type status = SD_OK;
1485 uint8_t power = 0, card_state = 0;
1486 uint32_t timeout = 0, card_status = 0, response = 0;;
1487
1488 if(buf == NULL)
1489 {
1490 return SD_INVALID_PARAMETER;
1491 }
1492
1493 SDIOx->dtctrl = 0x0;
1494
1495 /* clear DCSM configuration */
1496 sdio_data_init_struct.block_size = (sdio_block_size_type)0;
1497 sdio_data_init_struct.data_length = 0;
1498 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
1499 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1500 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1501
1502 sdio_data_config(SDIOx, &sdio_data_init_struct);
1503 sdio_data_state_machine_enable(SDIOx, FALSE);
1504
1505 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1506
1507 /* check card locked */
1508 if(response & SD_CARD_LOCKED)
1509 {
1510 return SD_LOCK_UNLOCK_FAILED;
1511 }
1512
1513 if(card_type == SDIO_HIGH_CAPACITY_SD_CARD)
1514 {
1515 blk_size = 512;
1516 addr >>= 9;
1517 }
1518
1519 if((blk_size > 0) && (blk_size <= 2048) && ((blk_size & (blk_size - 1)) == 0))
1520 {
1521 power = convert_from_bytes_to_power_of_two(blk_size);
1522
1523 /* send cmd16, set block size */
1524 sdio_command_init_struct.argument = blk_size;
1525 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCKLEN;
1526 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1527 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1528
1529 /* sdio command config */
1530 sdio_command_config(SDIOx, &sdio_command_init_struct);
1531 /* enable CCSM */
1532 sdio_command_state_machine_enable(SDIOx, TRUE);
1533
1534 status = command_rsp1_error(SD_CMD_SET_BLOCKLEN);
1535
1536 if(status != SD_OK)
1537 {
1538 return status;
1539 }
1540 }
1541 else
1542 {
1543 return SD_INVALID_PARAMETER;
1544 }
1545
1546 if((nblks * blk_size) > SD_MAX_DATA_LENGTH)
1547 {
1548 return SD_INVALID_PARAMETER;
1549 }
1550
1551 timeout = SD_DATATIMEOUT;
1552
1553 do
1554 {
1555 timeout--;
1556 status = sd_status_send(&card_status);
1557 }
1558 /* check ready_for_data flag */
1559 while(((card_status & 0x00000100) == 0) && (timeout > 0));
1560
1561 if(timeout == 0)
1562 {
1563 return SD_ERROR;
1564 }
1565
1566 if((card_type == SDIO_STD_CAPACITY_SD_CARD_V1_1) || (card_type == SDIO_STD_CAPACITY_SD_CARD_V2_0) || \
1567 (card_type == SDIO_HIGH_CAPACITY_SD_CARD))
1568 {
1569 /* send cmd55 */
1570 sdio_command_init_struct.argument = (uint32_t)rca << 16;
1571 sdio_command_init_struct.cmd_index = SD_CMD_APP_CMD;
1572 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1573 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1574
1575 /* sdio command config */
1576 sdio_command_config(SDIOx, &sdio_command_init_struct);
1577 /* enable CCSM */
1578 sdio_command_state_machine_enable(SDIOx, TRUE);
1579
1580 status = command_rsp1_error(SD_CMD_APP_CMD);
1581
1582 if(status != SD_OK)
1583 {
1584 return status;
1585 }
1586
1587 /* send cmd23, set block count */
1588 sdio_command_init_struct.argument = blk_size;
1589 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCK_COUNT;
1590 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1591 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1592
1593 /* sdio command config */
1594 sdio_command_config(SDIOx, &sdio_command_init_struct);
1595 /* enable CCSM */
1596 sdio_command_state_machine_enable(SDIOx, TRUE);
1597
1598 status = command_rsp1_error(SD_CMD_SET_BLOCK_COUNT);
1599
1600 if(status != SD_OK)
1601 {
1602 return status;
1603 }
1604 }
1605
1606 /* send cmd25, write mult blocks */
1607 sdio_command_init_struct.argument = addr;
1608 sdio_command_init_struct.cmd_index = SD_CMD_WRITE_MULT_BLOCK;
1609 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1610 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1611
1612 sdio_data_init_struct.block_size = (sdio_block_size_type)(power);
1613 sdio_data_init_struct.data_length = nblks * blk_size ;
1614 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1615 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1616 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1617
1618 stop_flag = 1;
1619 /* cmd12 is needed */
1620 status = sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)buf);
1621
1622 if(status != SD_OK)
1623 {
1624 return status;
1625 }
1626
1627 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
1628
1629 status = check_card_programming(&card_state);
1630
1631 while((status == SD_OK) && ((card_state == SD_CARD_PROGRAMMING) || (card_state == SD_CARD_RECEIVING)))
1632 {
1633 status = check_card_programming(&card_state);
1634 }
1635
1636 return status;
1637}
1638
1646 sd_error_status_type mmc_stream_read(uint8_t *buf, long long addr, uint32_t len)
1647{
1648 uint32_t response = 0;
1649
1650 SDIOx->dtctrl = 0x0;
1651
1652 /* clear DCSM configuration */
1653 sdio_data_init_struct.block_size = SDIO_DATA_BLOCK_SIZE_1B;
1654 sdio_data_init_struct.data_length = 0 ;
1655 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1656 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1657 sdio_data_init_struct.transfer_mode = SDIO_DATA_STREAM_TRANSFER;
1658
1659 sdio_data_config(SDIOx, &sdio_data_init_struct);
1660 sdio_data_state_machine_enable(SDIOx, FALSE);
1661
1662 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1663
1664 /* check card locked */
1665 if(response & SD_CARD_LOCKED)
1666 {
1667 return SD_LOCK_UNLOCK_FAILED;
1668 }
1669 /* send cmd11, read data */
1670 sdio_command_init_struct.argument = addr;
1671 sdio_command_init_struct.cmd_index = SD_CMD_READ_DAT_UNTIL_STOP;
1672 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1673 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1674
1675 sdio_data_init_struct.block_size = (sdio_block_size_type)(5 << 4);
1676 sdio_data_init_struct.data_length = len;
1677 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1678 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CONTROLLER;
1679 sdio_data_init_struct.transfer_mode = SDIO_DATA_STREAM_TRANSFER;
1680
1681 stop_flag = 1;
1682 /* cmd12 is needed */
1683 return sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)buf);
1684}
1685
1693 sd_error_status_type mmc_stream_write(uint8_t *buf, long long addr, uint32_t len)
1694{
1695 sd_error_status_type status = SD_OK;
1696 uint32_t response = 0;
1697 uint8_t card_state = 0;
1698
1699 if(buf == NULL)
1700 {
1701 return SD_INVALID_PARAMETER;
1702 }
1703
1704 SDIOx->dtctrl = 0x0;
1705
1706 /* clear DCSM configuration */
1707 sdio_data_init_struct.block_size = SDIO_DATA_BLOCK_SIZE_1B;
1708 sdio_data_init_struct.data_length = 0;
1709 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
1710 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1711 sdio_data_init_struct.transfer_mode = SDIO_DATA_STREAM_TRANSFER;
1712
1713 sdio_data_config(SDIOx, &sdio_data_init_struct);
1714 sdio_data_state_machine_enable(SDIOx, FALSE);
1715
1716 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1717
1718 /* check card locked */
1719 if(response & SD_CARD_LOCKED)
1720 {
1721 return SD_LOCK_UNLOCK_FAILED;
1722 }
1723 /* send cmd20, write data */
1724 sdio_command_init_struct.argument = addr;
1725 sdio_command_init_struct.cmd_index = SD_CMD_WRITE_DAT_UNTIL_STOP;
1726 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1727 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1728
1729
1730 sdio_data_init_struct.block_size = (sdio_block_size_type)(15 << 4);
1731 sdio_data_init_struct.data_length = len;
1732 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1733 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1734 sdio_data_init_struct.transfer_mode = SDIO_DATA_STREAM_TRANSFER;
1735
1736 stop_flag = 1;
1737 /* cmd12 is needed */
1738 status = sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)buf);
1739
1740 if(status != SD_OK)
1741 {
1742 return status;
1743 }
1744
1745 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
1746
1747 status = check_card_programming(&card_state);
1748
1749 while((status == SD_OK) && ((card_state == SD_CARD_PROGRAMMING) || (card_state == SD_CARD_RECEIVING)))
1750 {
1751 status = check_card_programming(&card_state);
1752 }
1753
1754 return status;
1755}
1756
1762void SDIO1_IRQHandler(void)
1763{
1764 sd_irq_service();
1765}
1766
1772void SDIO2_IRQHandler(void)
1773{
1774 sd_irq_service();
1775}
1776
1782 sd_error_status_type sd_irq_service(void)
1783{
1784 if(sdio_flag_get(SDIOx, SDIO_DTCMPL_FLAG) != RESET)
1785 {
1786 if(stop_flag == 1)
1787 {
1788 /* send cmd12, stop transmission */
1789 sdio_command_init_struct.argument = 0;
1790 sdio_command_init_struct.cmd_index = SD_CMD_STOP_TRANSMISSION;
1791 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1792 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1793 /* sdio command config */
1794 sdio_command_config(SDIOx, &sdio_command_init_struct);
1795 /* enable CCSM */
1796 sdio_command_state_machine_enable(SDIOx, TRUE);
1797 transfer_error = command_rsp1_error(SD_CMD_STOP_TRANSMISSION);
1798 }
1799 else
1800 {
1801 transfer_error = SD_OK;
1802 }
1803 /* clear flag */
1804 sdio_flag_clear(SDIOx, SDIO_DTCMPL_FLAG);
1805 transfer_end = 1;
1806 return transfer_error;
1807 }
1808
1809 if(sdio_flag_get(SDIOx, SDIO_DTFAIL_FLAG) != RESET)
1810 {
1811 /* clear flag */
1812 sdio_flag_clear(SDIOx, SDIO_DTFAIL_FLAG);
1813 transfer_error = SD_DATA_FAIL;
1814 transfer_end = 1;
1815 return transfer_error;
1816 }
1817
1818 if(sdio_flag_get(SDIOx, SDIO_DTTIMEOUT_FLAG) != RESET)
1819 {
1820 /* clear flag */
1821 sdio_flag_clear(SDIOx, SDIO_DTTIMEOUT_FLAG);
1822 transfer_error = SD_DATA_TIMEOUT;
1823 transfer_end = 1;
1824 return transfer_error;
1825 }
1826
1827 if(sdio_flag_get(SDIOx, SDIO_RXERRO_FLAG) != RESET)
1828 {
1829 /* clear flag */
1830 sdio_flag_clear(SDIOx, SDIO_RXERRO_FLAG);
1831 transfer_error = SD_RX_OVERRUN;
1832 transfer_end = 1;
1833 return(SD_RX_OVERRUN);
1834 }
1835
1836 if(sdio_flag_get(SDIOx, SDIO_TXERRU_FLAG) != RESET)
1837 {
1838 /* clear flag */
1839 sdio_flag_clear(SDIOx, SDIO_TXERRU_FLAG);
1840 transfer_error = SD_TX_UNDERRUN;
1841 transfer_end = 1;
1842 return(SD_TX_UNDERRUN);
1843 }
1844
1845 if(sdio_flag_get(SDIOx, SDIO_SBITERR_FLAG) != RESET)
1846 {
1847 /* clear flag */
1848 sdio_flag_clear(SDIOx, SDIO_SBITERR_FLAG);
1849 transfer_error = SD_START_BIT_ERR;
1850 transfer_end = 1;
1851 return(SD_START_BIT_ERR);
1852 }
1853
1854 /* disable interrupt */
1855 sdio_interrupt_enable(SDIOx, (SDIO_DTFAIL_INT | SDIO_DTTIMEOUT_INT | \
1856 SDIO_DTCMP_INT | SDIO_TXBUFH_INT | SDIO_RXBUFH_INT | \
1857 SDIO_TXERRU_INT| SDIO_RXERRO_INT | SDIO_SBITERR_INT), FALSE);
1858 return(SD_OK);
1859}
1860
1866 sd_error_status_type command_error(void)
1867{
1868 sd_error_status_type status = SD_OK;
1869 uint32_t timeout = SDIO_CMD0TIMEOUT;
1870
1871 while(timeout--)
1872 {
1873 if(sdio_flag_get(SDIOx, SDIO_CMDCMPL_FLAG) != RESET)
1874 {
1875 break;
1876 }
1877 }
1878
1879 if(timeout == 0)
1880 {
1881 return SD_CMD_RSP_TIMEOUT;
1882 }
1883
1884 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
1885 return status;
1886}
1887
1893 sd_error_status_type command_rsp7_error(void)
1894{
1895 sd_error_status_type status = SD_OK;
1896 uint32_t sts_reg = 0;
1897 uint32_t timeout = SDIO_CMD0TIMEOUT;
1898
1899 while(timeout--)
1900 {
1901 sts_reg = SDIOx->sts;
1902
1903 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
1904 {
1905 break;
1906 }
1907 }
1908
1909 if((timeout == 0) || (sts_reg & SDIO_CMDTIMEOUT_FLAG))
1910 {
1911 status = SD_CMD_RSP_TIMEOUT;
1912 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
1913 return status;
1914 }
1915
1916 if(sts_reg & SDIO_CMDRSPCMPL_FLAG)
1917 {
1918 status = SD_OK;
1919 sdio_flag_clear(SDIOx, SDIO_CMDRSPCMPL_FLAG);
1920 }
1921
1922 return status;
1923}
1924
1930 sd_error_status_type command_rsp1_error(uint8_t cmd)
1931{
1932 uint32_t sts_reg = 0;
1933 uint32_t rsp_cmd = 0;
1934
1935 while(1)
1936 {
1937 sts_reg = SDIOx->sts;
1938
1939 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
1940 {
1941 break;
1942 }
1943 }
1944
1945 if(sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
1946 {
1947 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
1948 return SD_CMD_RSP_TIMEOUT;
1949 }
1950
1951 if(sdio_flag_get(SDIOx, SDIO_CMDFAIL_FLAG) != RESET)
1952 {
1953 sdio_flag_clear(SDIOx, SDIO_CMDFAIL_FLAG);
1954 return SD_CMD_FAIL;
1955 }
1956
1957 rsp_cmd = sdio_command_response_get(SDIOx);
1958 if(rsp_cmd != cmd)
1959 {
1960 return SD_ILLEGAL_CMD;
1961 }
1962
1963 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
1964
1965 return (sd_error_status_type)(sdio_response_get(SDIOx, SDIO_RSP1_INDEX) & SD_OCR_ERRORBITS);
1966}
1967
1973 sd_error_status_type command_rsp3_error(void)
1974{
1975 uint32_t sts_reg = 0;;
1976
1977 while(1)
1978 {
1979 sts_reg = SDIOx->sts;
1980
1981 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
1982 {
1983 break;
1984 }
1985 }
1986
1987 if(sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
1988 {
1989 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
1990 return SD_CMD_RSP_TIMEOUT;
1991 }
1992
1993 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
1994
1995 return SD_OK;
1996}
1997
2003 sd_error_status_type command_rsp2_error(void)
2004{
2005 sd_error_status_type status = SD_OK;
2006 uint32_t sts_reg;
2007 uint32_t timeout = SDIO_CMD0TIMEOUT;
2008
2009 while(timeout--)
2010 {
2011 sts_reg = SDIOx->sts;
2012
2013 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
2014 {
2015 break;
2016 }
2017 }
2018
2019 if((timeout == 0) || sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
2020 {
2021 status = SD_CMD_RSP_TIMEOUT;
2022 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
2023
2024 return status;
2025 }
2026
2027 if(sdio_flag_get(SDIOx, SDIO_CMDFAIL_FLAG) != RESET)
2028 {
2029 status = SD_CMD_FAIL;
2030 sdio_flag_clear(SDIOx, SDIO_CMDFAIL_FLAG);
2031 }
2032
2033 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
2034
2035 return status;
2036}
2037
2043 sd_error_status_type command_rsp4_error(uint8_t cmd)
2044{
2045 uint32_t sts_reg = 0, rsp_cmd = 0;
2046
2047 while(1)
2048 {
2049 sts_reg = SDIOx->sts;
2050
2051 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
2052 {
2053 break;
2054 }
2055 }
2056
2057 if(sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
2058 {
2059 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
2060 return SD_CMD_RSP_TIMEOUT;
2061 }
2062
2063 if(sdio_flag_get(SDIOx, SDIO_CMDFAIL_FLAG) != RESET)
2064 {
2065 sdio_flag_clear(SDIOx, SDIO_CMDFAIL_FLAG);
2066
2067 return SD_CMD_FAIL;
2068 }
2069
2070 rsp_cmd = sdio_command_response_get(SDIOx);
2071 if(rsp_cmd != cmd)
2072 {
2073 return SD_ILLEGAL_CMD;
2074 }
2075
2076 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
2077
2078 return SD_OK;
2079}
2080
2086 sd_error_status_type command_rsp5_error(uint8_t cmd)
2087{
2088 uint32_t sts_reg = 0, rsp_cmd = 0, response = 0;
2089
2090 while(1)
2091 {
2092 sts_reg = SDIOx->sts;
2093
2094 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
2095 {
2096 break;
2097 }
2098 }
2099
2100 if(sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
2101 {
2102 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
2103
2104 return SD_CMD_RSP_TIMEOUT;
2105 }
2106
2107 if(sdio_flag_get(SDIOx, SDIO_CMDFAIL_FLAG) != RESET)
2108 {
2109 sdio_flag_clear(SDIOx, SDIO_CMDFAIL_FLAG);
2110
2111 return SD_CMD_FAIL;
2112 }
2113
2114 rsp_cmd = sdio_command_response_get(SDIOx);
2115 if(rsp_cmd != cmd)
2116 {
2117 return SD_ILLEGAL_CMD;
2118 }
2119
2120 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
2121
2122 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
2123
2124 if(response & SD_R5_OUT_OF_RANGE)
2125 {
2126 return SD_CMD_OUT_OF_RANGE;
2127 }
2128
2129 if(response & SD_R5_FUNCTION_NUMBER)
2130 {
2131 return SD_SDIO_UNKNOWN_FUNC;
2132 }
2133
2134 if(response & SD_R5_ERROR)
2135 {
2136 return SD_GENERAL_UNKNOWN_ERROR;
2137 }
2138
2139 return SD_OK;
2140}
2141
2149 sd_error_status_type command_rsp6_error(uint8_t cmd, uint16_t *prca)
2150{
2151 sd_error_status_type status = SD_OK;
2152 uint32_t sts_reg, rsp_cmd = 0, response = 0;
2153
2154 while(1)
2155 {
2156 sts_reg = SDIOx->sts;
2157
2158 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
2159 {
2160 break;
2161 }
2162 }
2163
2164 if(sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
2165 {
2166 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
2167 return SD_CMD_RSP_TIMEOUT;
2168 }
2169
2170 if(sdio_flag_get(SDIOx, SDIO_CMDFAIL_FLAG) != RESET)
2171 {
2172 sdio_flag_clear(SDIOx, SDIO_CMDFAIL_FLAG);
2173 return SD_CMD_FAIL;
2174 }
2175
2176 rsp_cmd = sdio_command_response_get(SDIOx);
2177 if(rsp_cmd != cmd)
2178 {
2179 return SD_ILLEGAL_CMD;
2180 }
2181
2182 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
2183
2184 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
2185
2186 if(SD_ALLZERO == (response & (SD_R6_GENERAL_UNKNOWN_ERROR | SD_R6_ILLEGAL_CMD | SD_R6_CMD_CRC_FAILED)))
2187 {
2188 *prca = (uint16_t)(response >> 16);
2189 return status;
2190 }
2191
2192 if(response & SD_R6_GENERAL_UNKNOWN_ERROR)
2193 {
2194 return SD_GENERAL_UNKNOWN_ERROR;
2195 }
2196
2197 if(response & SD_R6_ILLEGAL_CMD)
2198 {
2199 return SD_ILLEGAL_CMD;
2200 }
2201
2202 if(response & SD_R6_CMD_CRC_FAILED)
2203 {
2204 return SD_CMD_CRC_FAILED;
2205 }
2206
2207 return status;
2208}
2209
2215 sd_error_status_type sd_bus_wide_enable(confirm_state new_state)
2216{
2217 sd_error_status_type status = SD_OK;
2218 uint32_t response = 0;
2219 uint8_t arg = 0x00;
2220
2221 if(new_state == TRUE)
2222 {
2223 arg = 0x02;
2224 }
2225 else
2226 {
2227 arg = 0x00;
2228 }
2229
2230 /* get response1 */
2231 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
2232
2233 /* check card locked or not */
2234 if(response & SD_CARD_LOCKED)
2235 {
2236 return SD_LOCK_UNLOCK_FAILED;
2237 }
2238
2239 if(sd_card_info.sd_scr_reg.sd_bus_width)
2240 {
2241 sdio_command_init_struct.argument = (uint32_t)(sd_card_info.rca << 16);
2242 sdio_command_init_struct.cmd_index = SD_CMD_APP_CMD;
2243 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2244 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2245
2246 /* sdio command config */
2247 sdio_command_config(SDIOx, &sdio_command_init_struct);
2248 /* enable CCSM */
2249 sdio_command_state_machine_enable(SDIOx, TRUE);
2250
2251 status = command_rsp1_error(SD_CMD_APP_CMD);
2252
2253 if(status != SD_OK)
2254 {
2255 return status;
2256 }
2257
2258 sdio_command_init_struct.argument = arg;
2259 sdio_command_init_struct.cmd_index = SD_CMD_APP_SD_SET_BUSWIDTH;
2260 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2261 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2262
2263 /* sdio command config */
2264 sdio_command_config(SDIOx, &sdio_command_init_struct);
2265 /* enable CCSM */
2266 sdio_command_state_machine_enable(SDIOx, TRUE);
2267
2268 status = command_rsp1_error(SD_CMD_APP_SD_SET_BUSWIDTH);
2269 return status;
2270 }
2271 else
2272 {
2273 return SD_REQ_NOT_APPLICABLE;
2274 }
2275}
2276
2284 sd_error_status_type mmc_switch(uint8_t set, uint8_t index, uint8_t value)
2285{
2286 sd_error_status_type status = SD_OK;
2287 uint32_t card_status = 0, timeout = 0;
2288
2289 sdio_command_init_struct.argument = (EXT_CSD_Write_byte << 24) | (index << 16) | (value << 8) | set;
2290 sdio_command_init_struct.cmd_index = SD_CMD_HS_SWITCH;
2291 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2292 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2293
2294 /* sdio command config */
2295 sdio_command_config(SDIOx, &sdio_command_init_struct);
2296 /* enable CCSM */
2297 sdio_command_state_machine_enable(SDIOx, TRUE);
2298
2299 status = command_rsp1_error(SD_CMD_HS_SWITCH);
2300 if(status != SD_OK)
2301 {
2302 return status;
2303 }
2304
2305 card_status = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
2306 if(card_status & MMC_SWITCH_ERROR)
2307 {
2308 return SD_SWITCH_ERROR;
2309 }
2310
2311 timeout = SD_DATATIMEOUT;
2312 do
2313 {
2314 timeout--;
2315 status = sd_status_send(&card_status);
2316 } /* check ready_for_data flag */
2317 while(((card_status & 0x00000100) == 0) && (timeout > 0));
2318
2319 if(timeout == 0)
2320 {
2321 return SD_ERROR;
2322 }
2323
2324 return status;
2325}
2326
2335 sd_error_status_type sd_switch(uint32_t mode, uint32_t group, uint8_t value, uint8_t *rsp)
2336{
2337 sd_error_status_type status = SD_OK;
2338 uint8_t power;
2339 uint16_t blk_size;
2340
2341 if(rsp == NULL)
2342 {
2343 return SD_INVALID_PARAMETER;
2344 }
2345
2346 SDIOx->dtctrl = 0x0;
2347
2348 blk_size = 64;
2349 power = convert_from_bytes_to_power_of_two(blk_size);
2350
2351 sdio_command_init_struct.argument = blk_size;
2352 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCKLEN;
2353 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2354 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2355
2356 /* sdio command config */
2357 sdio_command_config(SDIOx, &sdio_command_init_struct);
2358 /* enable CCSM */
2359 sdio_command_state_machine_enable(SDIOx, TRUE);
2360
2361 status = command_rsp1_error(SD_CMD_SET_BLOCKLEN);
2362
2363 if(status != SD_OK)
2364 {
2365 return status;
2366 }
2367
2368 sdio_data_init_struct.block_size = (sdio_block_size_type)(power);
2369 sdio_data_init_struct.data_length = blk_size ;
2370 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
2371 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CONTROLLER;
2372 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
2373
2374 sdio_command_init_struct.argument = (mode << 31) | 0x00FFFFFF;
2375 sdio_command_init_struct.argument &= ~(0xF << (group * 4));
2376 sdio_command_init_struct.argument |= value << (group * 4);
2377 sdio_command_init_struct.cmd_index = SD_CMD_HS_SWITCH;
2378 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2379 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2380
2381 stop_flag = 0;
2382
2383 return sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)rsp);
2384}
2385
2391 sd_error_status_type check_card_programming(uint8_t *p_status)
2392{
2393 volatile uint32_t response = 0, sts_reg = 0, rsp_cmd = 0;
2394
2395 /* send cmd13 */
2396 sdio_command_init_struct.argument = (uint32_t)(rca << 16);
2397 sdio_command_init_struct.cmd_index = SD_CMD_SEND_STATUS;
2398 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2399 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2400
2401 /* sdio command config */
2402 sdio_command_config(SDIOx, &sdio_command_init_struct);
2403 /* enable CCSM */
2404 sdio_command_state_machine_enable(SDIOx, TRUE);
2405
2406 sts_reg = SDIOx->sts;
2407
2408 while(!(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG)))
2409 {
2410 sts_reg = SDIOx->sts;
2411 }
2412
2413 if(sdio_flag_get(SDIOx, SDIO_CMDFAIL_FLAG) != RESET)
2414 {
2415 sdio_flag_clear(SDIOx, SDIO_CMDFAIL_FLAG);
2416 return SD_CMD_FAIL;
2417 }
2418
2419 if(sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
2420 {
2421 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
2422 return SD_CMD_RSP_TIMEOUT;
2423 }
2424
2425 rsp_cmd = sdio_command_response_get(SDIOx);
2426 if(rsp_cmd!= SD_CMD_SEND_STATUS)
2427 {
2428 return SD_ILLEGAL_CMD;
2429 }
2430
2431 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
2432
2433 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
2434
2435 *p_status = (uint8_t)((response >> 9) & 0x0000000F);
2436
2437 return SD_OK;
2438}
2439
2445 sd_error_status_type sd_status_send(uint32_t *p_card_status)
2446{
2447 sd_error_status_type status = SD_OK;
2448
2449 if(p_card_status == NULL)
2450 {
2451 status = SD_INVALID_PARAMETER;
2452 return status;
2453 }
2454
2455 sdio_command_init_struct.argument = (uint32_t)(rca << 16);
2456 sdio_command_init_struct.cmd_index = SD_CMD_SEND_STATUS;
2457 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2458 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2459
2460 /* sdio command config */
2461 sdio_command_config(SDIOx, &sdio_command_init_struct);
2462 /* enable CCSM */
2463 sdio_command_state_machine_enable(SDIOx, TRUE);
2464
2465 status = command_rsp1_error(SD_CMD_SEND_STATUS);
2466
2467 if(status != SD_OK)
2468 {
2469 return status;
2470 }
2471
2472 *p_card_status = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
2473
2474 return status;
2475}
2476
2482 sd_card_state_type sd_state_get(void)
2483{
2484 uint32_t response = 0;
2485
2486 if(sd_status_send(&response) != SD_OK)
2487 {
2488 return SD_CARD_ERROR;
2489 }
2490 else
2491 {
2492 return (sd_card_state_type)((response >> 9) & 0x0F);
2493 }
2494}
2495
2500 sd_error_status_type scr_find(void)
2501{
2502 uint32_t index = 0, sts_reg = 0;
2503 sd_error_status_type status = SD_OK;
2504 uint32_t *tempscr;
2505
2506 tempscr = (uint32_t *) &(sd_card_info.sd_scr_reg);
2507
2508 /* send cmd16, set block length */
2509 sdio_command_init_struct.argument = (uint32_t)8;
2510 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCKLEN;
2511 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2512 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2513
2514 /* sdio command config */
2515 sdio_command_config(SDIOx, &sdio_command_init_struct);
2516 /* enable CCSM */
2517 sdio_command_state_machine_enable(SDIOx, TRUE);
2518
2519 status = command_rsp1_error(SD_CMD_SET_BLOCKLEN);
2520
2521 if(status != SD_OK)
2522 {
2523 return status;
2524 }
2525
2526 /* send cmd55 */
2527 sdio_command_init_struct.argument = (uint32_t)(sd_card_info.rca << 16);
2528 sdio_command_init_struct.cmd_index = SD_CMD_APP_CMD;
2529 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2530 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2531
2532 /* sdio command config */
2533 sdio_command_config(SDIOx, &sdio_command_init_struct);
2534 /* enable CCSM */
2535 sdio_command_state_machine_enable(SDIOx, TRUE);
2536
2537 status = command_rsp1_error(SD_CMD_APP_CMD);
2538
2539 if(status != SD_OK)
2540 {
2541 return status;
2542 }
2543
2544 sdio_data_init_struct.block_size = SDIO_DATA_BLOCK_SIZE_8B;
2545 sdio_data_init_struct.data_length = 8;
2546 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
2547 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CONTROLLER;
2548 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
2549
2550 sdio_data_config(SDIOx, &sdio_data_init_struct);
2551 sdio_data_state_machine_enable(SDIOx, TRUE);
2552
2553 /* send cmd51 */
2554 sdio_command_init_struct.argument = 0x0;
2555 sdio_command_init_struct.cmd_index = SD_CMD_SD_APP_SEND_SCR;
2556 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2557 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2558
2559 /* sdio command config */
2560 sdio_command_config(SDIOx, &sdio_command_init_struct);
2561 /* enable CCSM */
2562 sdio_command_state_machine_enable(SDIOx, TRUE);
2563
2564 status = command_rsp1_error(SD_CMD_SD_APP_SEND_SCR);
2565
2566 if(status != SD_OK)
2567 {
2568 return status;
2569 }
2570
2571 sts_reg = SDIOx->sts;
2572
2573 while(!(sts_reg & (SDIO_RXERRO_FLAG | SDIO_DTFAIL_FLAG | SDIO_DTTIMEOUT_FLAG | SDIO_DTBLKCMPL_FLAG | SDIO_SBITERR_FLAG)))
2574 {
2575 if(sdio_flag_get(SDIOx, SDIO_RXBUF_FLAG) != RESET)
2576 {
2577 *(tempscr + index) = sdio_data_read(SDIOx);
2578 index++;
2579 }
2580 sts_reg = SDIOx->sts;
2581 }
2582
2583 if(sdio_flag_get(SDIOx, SDIO_DTTIMEOUT_FLAG) != RESET)
2584 {
2585 sdio_flag_clear(SDIOx, SDIO_DTTIMEOUT_FLAG);
2586 return SD_DATA_TIMEOUT;
2587 }
2588 else if(sdio_flag_get(SDIOx, SDIO_DTFAIL_FLAG) != RESET)
2589 {
2590 sdio_flag_clear(SDIOx, SDIO_DTFAIL_FLAG);
2591 return SD_DATA_FAIL;
2592 }
2593 else if(sdio_flag_get(SDIOx, SDIO_RXERRO_FLAG) != RESET)
2594 {
2595 sdio_flag_clear(SDIOx, SDIO_RXERRO_FLAG);
2596 return SD_RX_OVERRUN;
2597 }
2598 else if(sdio_flag_get(SDIOx, SDIO_SBITERR_FLAG) != RESET)
2599 {
2600 sdio_flag_clear(SDIOx, SDIO_SBITERR_FLAG);
2601 return SD_START_BIT_ERR;
2602 }
2603
2604 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
2605
2606 return status;
2607}
2608
2614 sd_error_status_type speed_change(uint8_t speed)
2615{
2616 sd_error_status_type status = SD_OK;
2617 uint8_t switch_sts[64];
2618
2619 if(speed > 1)
2620 {
2621 return SD_ERROR;
2622 }
2623
2624 /* check card type */
2625 if((SDIO_STD_CAPACITY_SD_CARD_V1_1 == card_type) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == card_type) || \
2626 (SDIO_HIGH_CAPACITY_SD_CARD == card_type))
2627 {
2628 /* version 1.01 card does not support cmd6 */
2629 if(sd_card_info.sd_scr_reg.sd_spec == 0)
2630 {
2631 return SD_ERROR;
2632 }
2633
2634 /* check group 1 function support speed */
2635 status = sd_switch(0, 0, speed, switch_sts);
2636
2637 if(status != 0)
2638 {
2639 return status;
2640 }
2641
2642 if((switch_sts[13] & (1 << speed)) == 0)
2643 {
2644 return SD_ERROR;
2645 }
2646
2647 status = sd_switch(1, 0, speed, switch_sts);
2648
2649 if(status != 0)
2650 {
2651 return status;
2652 }
2653
2654 /* read it back for confirmation */
2655 if((switch_sts[16] & 0xF) != speed)
2656 {
2657 return SD_ERROR;
2658 }
2659 }
2660 else if(card_type == SDIO_HIGH_SPEED_MULTIMEDIA_CARD)
2661 {
2662 status = mmc_switch(EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, (uint8_t)speed);
2663
2664 if(status != 0)
2665 {
2666 return status;
2667 }
2668 }
2669
2670 return status;
2671}
2672
2678uint8_t convert_from_bytes_to_power_of_two(uint16_t number_of_bytes)
2679{
2680 uint8_t count = 0;
2681
2682 while(number_of_bytes != 1)
2683 {
2684 number_of_bytes >>= 1;
2685 count++;
2686 }
2687
2688 return count;
2689}
2690
2699void sd_dma_config(uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
2700{
2701 dma_init_type dma_init_struct;
2702 dma_default_para_init(&dma_init_struct);
2703
2704 crm_periph_clock_enable(CRM_DMA2_PERIPH_CLOCK, TRUE);
2705
2706 dma_reset(DMA2_CHANNEL4);
2707 dma_channel_enable(DMA2_CHANNEL4, FALSE);
2708
2709 dma_init_struct.peripheral_base_addr = (uint32_t)&SDIOx->buf;
2710 dma_init_struct.memory_base_addr = (uint32_t)mbuf;
2711 dma_init_struct.direction = dir;
2712 dma_init_struct.buffer_size = buf_size / 4;
2713 dma_init_struct.peripheral_inc_enable = FALSE;
2714 dma_init_struct.memory_inc_enable = TRUE;
2715 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_WORD;
2716 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_WORD;
2717 dma_init_struct.loop_mode_enable = FALSE;
2718 dma_init_struct.priority = DMA_PRIORITY_HIGH;
2719 dma_init(DMA2_CHANNEL4, &dma_init_struct);
2720
2721 dma_channel_enable(DMA2_CHANNEL4, TRUE);
2722}
2723
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
sd_card_info
sd_card_info_struct_type sd_card_info
Definition: sd_mmc_card/src/at32_sdio.c:47
sd_switch
sd_error_status_type sd_switch(uint32_t mode, uint32_t group, uint8_t value, uint8_t *rsp)
switch sd card speed to high speed
Definition: sd_mmc_card/src/at32_sdio.c:2335
command_rsp5_error
sd_error_status_type command_rsp5_error(uint8_t cmd)
checks for error conditions for r5 response.
Definition: sd_mmc_card/src/at32_sdio.c:2086
speed_change
sd_error_status_type speed_change(uint8_t speed)
set bus speed
Definition: sd_mmc_card/src/at32_sdio.c:2614
__align
__align(4)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mod...
Definition: sd_mmc_card/src/at32_sdio.c:1269
sd_power_off
sd_error_status_type sd_power_off(void)
turns the sdio output signals off.
Definition: sd_mmc_card/src/at32_sdio.c:395
sdio_data_init_struct
sdio_data_struct_type sdio_data_init_struct
Definition: sd_mmc_card/src/at32_sdio.c:39
sd_irq_service
sd_error_status_type sd_irq_service(void)
allows to process all the interrupts that are high.
Definition: sd_mmc_card/src/at32_sdio.c:1782
transfer_end
volatile uint8_t transfer_end
Definition: sd_mmc_card/src/at32_sdio.c:46
command_rsp7_error
sd_error_status_type command_rsp7_error(void)
checks for error conditions for R7 response.
Definition: sd_mmc_card/src/at32_sdio.c:1893
sd_device_mode_set
sd_error_status_type sd_device_mode_set(uint32_t mode)
set sdio work mode.
Definition: sd_mmc_card/src/at32_sdio.c:778
card_type
static sd_memory_card_type card_type
Definition: sd_mmc_card/src/at32_sdio.c:41
convert_from_bytes_to_power_of_two
uint8_t convert_from_bytes_to_power_of_two(uint16_t number_of_bytes)
converts the number of bytes in power of two and returns the power.
Definition: sd_mmc_card/src/at32_sdio.c:2678
sd_card_info_get
sd_error_status_type sd_card_info_get(sd_card_info_struct_type *card_info)
returns information about specific card.
Definition: sd_mmc_card/src/at32_sdio.c:524
sdio_command_init_struct
sdio_command_struct_type sdio_command_init_struct
Definition: sd_mmc_card/src/at32_sdio.c:38
mmc_stream_write
sd_error_status_type mmc_stream_write(uint8_t *buf, long long addr, uint32_t len)
write mmc card data stream.
Definition: sd_mmc_card/src/at32_sdio.c:1693
sd_card_init
sd_error_status_type sd_card_init(void)
intialises all cards or single card as the case may be card(s) come into standby state.
Definition: sd_mmc_card/src/at32_sdio.c:409
sd_block_read
sd_error_status_type sd_block_read(uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma ...
Definition: sd_mmc_card/src/at32_sdio.c:1180
sd_deselect_select
sd_error_status_type sd_deselect_select(uint32_t addr)
selects od deselects the corresponding card.
Definition: sd_mmc_card/src/at32_sdio.c:799
command_rsp6_error
sd_error_status_type command_rsp6_error(uint8_t cmd, uint16_t *p_rca)
checks for error conditions for r6 (rca) response.
Definition: sd_mmc_card/src/at32_sdio.c:2149
SDIO1_IRQHandler
void SDIO1_IRQHandler(void)
sdio1 isr.
Definition: sd_mmc_card/src/at32_sdio.c:1762
stop_flag
static uint8_t stop_flag
Definition: sd_mmc_card/src/at32_sdio.c:44
mmc_switch
sd_error_status_type mmc_switch(uint8_t set, uint8_t index, uint8_t value)
switch mmc card speed to high speed
Definition: sd_mmc_card/src/at32_sdio.c:2284
sd_blocks_erase
sd_error_status_type sd_blocks_erase(long long addr, uint32_t nblks)
erase continuous data block
Definition: sd_mmc_card/src/at32_sdio.c:1022
check_card_programming
sd_error_status_type check_card_programming(uint8_t *p_status)
checks if the sd card is in programming state.
Definition: sd_mmc_card/src/at32_sdio.c:2391
transfer_error
volatile sd_error_status_type transfer_error
Definition: sd_mmc_card/src/at32_sdio.c:45
sd_bus_wide_enable
sd_error_status_type sd_bus_wide_enable(confirm_state new_state)
enable or disable the sdio wide bus mode.
Definition: sd_mmc_card/src/at32_sdio.c:2215
command_rsp1_error
sd_error_status_type command_rsp1_error(uint8_t cmd)
checks for error conditions for R1 response.
Definition: sd_mmc_card/src/at32_sdio.c:1930
SDIO2_IRQHandler
void SDIO2_IRQHandler(void)
sdio2 isr.
Definition: sd_mmc_card/src/at32_sdio.c:1772
sd_mult_blocks_write
sd_error_status_type sd_mult_blocks_write(const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed ...
Definition: sd_mmc_card/src/at32_sdio.c:1482
csd_table
static uint32_t csd_table[4]
Definition: sd_mmc_card/src/at32_sdio.c:42
sdio_clock_set
void sdio_clock_set(uint32_t clk_div)
set sdio clock devision factor.
Definition: sd_mmc_card/src/at32_sdio.c:174
sd_state_get
sd_card_state_type sd_state_get(void)
returns information about sd card.
Definition: sd_mmc_card/src/at32_sdio.c:2482
cid_table
static uint32_t cid_table[4]
Definition: sd_mmc_card/src/at32_sdio.c:42
sd_dma_config
void sd_dma_config(uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
set dma configuation for sdio
Definition: sd_mmc_card/src/at32_sdio.c:2699
sd_block_write
sd_error_status_type sd_block_write(const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be manag...
Definition: sd_mmc_card/src/at32_sdio.c:1360
device_mode
static sd_data_transfer_mode_type device_mode
Definition: sd_mmc_card/src/at32_sdio.c:43
sd_status_send
sd_error_status_type sd_status_send(uint32_t *p_card_status)
read current card status.
Definition: sd_mmc_card/src/at32_sdio.c:2445
sdio_command_data_send
sd_error_status_type sdio_command_data_send(sdio_command_struct_type *sdio_cmd_init_t, sdio_data_struct_type *sdio_data_init_t, uint32_t *buf)
read data from or write data to sd card.
Definition: sd_mmc_card/src/at32_sdio.c:822
command_rsp2_error
sd_error_status_type command_rsp2_error(void)
checks for error conditions for R2 (cid or csd) response.
Definition: sd_mmc_card/src/at32_sdio.c:2003
sd_init
sd_error_status_type sd_init(void)
initializes the sd card and put it into standby state (ready for data transfer).
Definition: sd_mmc_card/src/at32_sdio.c:71
mmc_stream_read
sd_error_status_type mmc_stream_read(uint8_t *buf, long long addr, uint32_t len)
read mmc card data stream.
Definition: sd_mmc_card/src/at32_sdio.c:1646
scr_find
sd_error_status_type scr_find(void)
find the sd card scr register value.
Definition: sd_mmc_card/src/at32_sdio.c:2500
sd_power_on
sd_error_status_type sd_power_on(void)
enquires cards about their operating voltage and configures clock controls.
Definition: sd_mmc_card/src/at32_sdio.c:189
command_rsp4_error
sd_error_status_type command_rsp4_error(uint8_t cmd)
checks for error conditions for r4 response.
Definition: sd_mmc_card/src/at32_sdio.c:2043
sd_wide_bus_operation_config
sd_error_status_type sd_wide_bus_operation_config(sdio_bus_width_type mode)
enable wide bus opeartion for the requeseted card if supported by card.
Definition: sd_mmc_card/src/at32_sdio.c:735
rca
static uint32_t rca
Definition: sd_mmc_card/src/at32_sdio.c:42
command_rsp3_error
sd_error_status_type command_rsp3_error(void)
checks for error conditions for R3 (ocr) response.
Definition: sd_mmc_card/src/at32_sdio.c:1973
command_error
sd_error_status_type command_error(void)
checks for error conditions for cmd0.
Definition: sd_mmc_card/src/at32_sdio.c:1866
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_SDIO1_PERIPH_CLOCK
@ CRM_SDIO1_PERIPH_CLOCK
Definition: at32f415_crm.h:106
CRM_GPIOC_PERIPH_CLOCK
@ CRM_GPIOC_PERIPH_CLOCK
Definition: at32f415_crm.h:112
CRM_GPIOD_PERIPH_CLOCK
@ CRM_GPIOD_PERIPH_CLOCK
Definition: at32f415_crm.h:113
CRM_DMA2_PERIPH_CLOCK
@ CRM_DMA2_PERIPH_CLOCK
Definition: at32f415_crm.h:104
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
dma_dir_type
dma_dir_type
dma direction type
Definition: at32f415_dma.h:209
DMA_PERIPHERAL_DATA_WIDTH_WORD
@ DMA_PERIPHERAL_DATA_WIDTH_WORD
Definition: at32f415_dma.h:240
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_WORD
@ DMA_MEMORY_DATA_WIDTH_WORD
Definition: at32f415_dma.h:250
DMA_PRIORITY_HIGH
@ DMA_PRIORITY_HIGH
Definition: at32f415_dma.h:260
DMA2_CHANNEL4
#define DMA2_CHANNEL4
Definition: at32f415_dma.h:485
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_11
#define GPIO_PINS_11
Definition: at32f415_gpio.h:62
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_12
#define GPIO_PINS_12
Definition: at32f415_gpio.h:63
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOC
#define GPIOC
Definition: at32f415_gpio.h:772
GPIOD
#define GPIOD
Definition: at32f415_gpio.h:773
sdio_command_config
void sdio_command_config(sdio_type *sdio_x, sdio_command_struct_type *command_struct)
config sdio command.
Definition: at32f415_sdio.c:340
sdio_data_write
void sdio_data_write(sdio_type *sdio_x, uint32_t data)
write one word data to fifo.
Definition: at32f415_sdio.c:501
sdio_data_config
void sdio_data_config(sdio_type *sdio_x, sdio_data_struct_type *data_struct)
config sdio data.
Definition: at32f415_sdio.c:427
sdio_data_read
uint32_t sdio_data_read(sdio_type *sdio_x)
read a word data from sdio fifo.
Definition: at32f415_sdio.c:476
sdio_power_status_get
flag_status sdio_power_status_get(sdio_type *sdio_x)
get power status.
Definition: at32f415_sdio.c:87
sdio_command_state_machine_enable
void sdio_command_state_machine_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable command path state machine(CPSM).
Definition: at32f415_sdio.c:363
sdio_clock_bypass
void sdio_clock_bypass(sdio_type *sdio_x, confirm_state new_state)
enable or disable clock divider bypss
Definition: at32f415_sdio.c:152
sdio_flow_control_enable
void sdio_flow_control_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable hardware flow control.
Definition: at32f415_sdio.c:179
sdio_power_set
void sdio_power_set(sdio_type *sdio_x, sdio_power_state_type power_state)
set the power status of the controller
Definition: at32f415_sdio.c:75
sdio_clock_config
void sdio_clock_config(sdio_type *sdio_x, uint16_t clk_div, sdio_edge_phase_type clk_edg)
config sdio clock
Definition: at32f415_sdio.c:115
sdio_bus_width_config
void sdio_bus_width_config(sdio_type *sdio_x, sdio_bus_width_type width)
config sdio bus width
Definition: at32f415_sdio.c:139
sdio_interrupt_enable
void sdio_interrupt_enable(sdio_type *sdio_x, uint32_t int_opt, confirm_state new_state)
config corresponding interrupt.
Definition: at32f415_sdio.c:243
sdio_flag_clear
void sdio_flag_clear(sdio_type *sdio_x, uint32_t flag)
clear sdio flag.
Definition: at32f415_sdio.c:326
sdio_response_get
uint32_t sdio_response_get(sdio_type *sdio_x, sdio_rsp_index_type reg_index)
get response received from the card for the last command.
Definition: at32f415_sdio.c:394
sdio_data_state_machine_enable
void sdio_data_state_machine_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable data path state machine(DPSM).
Definition: at32f415_sdio.c:452
sdio_power_saving_mode_enable
void sdio_power_saving_mode_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable power saving mode, config sdio_ck clock output when the bus is idle.
Definition: at32f415_sdio.c:166
sdio_flag_get
flag_status sdio_flag_get(sdio_type *sdio_x, uint32_t flag)
get sdio flag.
Definition: at32f415_sdio.c:289
sdio_dma_enable
void sdio_dma_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable dma.
Definition: at32f415_sdio.c:205
sdio_reset
void sdio_reset(sdio_type *sdio_x)
reset the sdio register
Definition: at32f415_sdio.c:51
sdio_clock_enable
void sdio_clock_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable sdio_ck output.
Definition: at32f415_sdio.c:192
sdio_command_response_get
uint8_t sdio_command_response_get(sdio_type *sdio_x)
get command index of last command for which response received.
Definition: at32f415_sdio.c:376
sdio_bus_width_type
sdio_bus_width_type
sdio bus width
Definition: at32f415_sdio.h:139
sdio_block_size_type
sdio_block_size_type
sdio data block size
Definition: at32f415_sdio.h:180
SDIO_WAIT_FOR_NO
@ SDIO_WAIT_FOR_NO
Definition: at32f415_sdio.h:160
SDIO_WAIT_FOR_INT
@ SDIO_WAIT_FOR_INT
Definition: at32f415_sdio.h:161
SDIO_RESPONSE_LONG
@ SDIO_RESPONSE_LONG
Definition: at32f415_sdio.h:152
SDIO_RESPONSE_SHORT
@ SDIO_RESPONSE_SHORT
Definition: at32f415_sdio.h:151
SDIO_RESPONSE_NO
@ SDIO_RESPONSE_NO
Definition: at32f415_sdio.h:150
SDIO_CLOCK_EDGE_FALLING
@ SDIO_CLOCK_EDGE_FALLING
Definition: at32f415_sdio.h:132
SDIO_DATA_TRANSFER_TO_CARD
@ SDIO_DATA_TRANSFER_TO_CARD
Definition: at32f415_sdio.h:212
SDIO_DATA_TRANSFER_TO_CONTROLLER
@ SDIO_DATA_TRANSFER_TO_CONTROLLER
Definition: at32f415_sdio.h:213
SDIO_POWER_OFF
@ SDIO_POWER_OFF
Definition: at32f415_sdio.h:122
SDIO_POWER_ON
@ SDIO_POWER_ON
Definition: at32f415_sdio.h:123
SDIO_DATA_BLOCK_TRANSFER
@ SDIO_DATA_BLOCK_TRANSFER
Definition: at32f415_sdio.h:203
SDIO_DATA_STREAM_TRANSFER
@ SDIO_DATA_STREAM_TRANSFER
Definition: at32f415_sdio.h:204
SDIO_BUS_WIDTH_D1
@ SDIO_BUS_WIDTH_D1
Definition: at32f415_sdio.h:140
SDIO_BUS_WIDTH_D4
@ SDIO_BUS_WIDTH_D4
Definition: at32f415_sdio.h:141
SDIO_RSP3_INDEX
@ SDIO_RSP3_INDEX
Definition: at32f415_sdio.h:172
SDIO_RSP2_INDEX
@ SDIO_RSP2_INDEX
Definition: at32f415_sdio.h:171
SDIO_RSP4_INDEX
@ SDIO_RSP4_INDEX
Definition: at32f415_sdio.h:173
SDIO_RSP1_INDEX
@ SDIO_RSP1_INDEX
Definition: at32f415_sdio.h:170
SDIO_DATA_BLOCK_SIZE_8B
@ SDIO_DATA_BLOCK_SIZE_8B
Definition: at32f415_sdio.h:184
SDIO_DATA_BLOCK_SIZE_1B
@ SDIO_DATA_BLOCK_SIZE_1B
Definition: at32f415_sdio.h:181
SDIO_CMDTIMEOUT_FLAG
#define SDIO_CMDTIMEOUT_FLAG
Definition: at32f415_sdio.h:87
SDIO_TXBUFH_FLAG
#define SDIO_TXBUFH_FLAG
Definition: at32f415_sdio.h:99
SDIO_CMDCMPL_FLAG
#define SDIO_CMDCMPL_FLAG
Definition: at32f415_sdio.h:92
SDIO_DTFAIL_FLAG
#define SDIO_DTFAIL_FLAG
Definition: at32f415_sdio.h:86
SDIO_RXERRO_FLAG
#define SDIO_RXERRO_FLAG
Definition: at32f415_sdio.h:90
SDIO_RXBUFH_FLAG
#define SDIO_RXBUFH_FLAG
Definition: at32f415_sdio.h:100
SDIO_RXBUF_FLAG
#define SDIO_RXBUF_FLAG
Definition: at32f415_sdio.h:106
SDIO_CMDFAIL_FLAG
#define SDIO_CMDFAIL_FLAG
Definition: at32f415_sdio.h:85
SDIO_CMDRSPCMPL_FLAG
#define SDIO_CMDRSPCMPL_FLAG
Definition: at32f415_sdio.h:91
SDIO_DTBLKCMPL_FLAG
#define SDIO_DTBLKCMPL_FLAG
Definition: at32f415_sdio.h:95
SDIO_DTTIMEOUT_FLAG
#define SDIO_DTTIMEOUT_FLAG
Definition: at32f415_sdio.h:88
SDIO_SBITERR_FLAG
#define SDIO_SBITERR_FLAG
Definition: at32f415_sdio.h:94
SDIO_DTCMPL_FLAG
#define SDIO_DTCMPL_FLAG
Definition: at32f415_sdio.h:93
SDIO_TXERRU_FLAG
#define SDIO_TXERRU_FLAG
Definition: at32f415_sdio.h:89
SDIO_SBITERR_INT
#define SDIO_SBITERR_INT
Definition: at32f415_sdio.h:61
SDIO_RXBUFH_INT
#define SDIO_RXBUFH_INT
Definition: at32f415_sdio.h:67
SDIO_DTTIMEOUT_INT
#define SDIO_DTTIMEOUT_INT
Definition: at32f415_sdio.h:55
SDIO_TXERRU_INT
#define SDIO_TXERRU_INT
Definition: at32f415_sdio.h:56
SDIO_RXERRO_INT
#define SDIO_RXERRO_INT
Definition: at32f415_sdio.h:57
SDIO_DTFAIL_INT
#define SDIO_DTFAIL_INT
Definition: at32f415_sdio.h:53
SDIO_TXBUFH_INT
#define SDIO_TXBUFH_INT
Definition: at32f415_sdio.h:66
SDIO_DTCMP_INT
#define SDIO_DTCMP_INT
Definition: at32f415_sdio.h:60
SDIO_SEND_IF_COND
#define SDIO_SEND_IF_COND
Definition: sd_mmc_card/inc/at32_sdio.h:438
SD_CMD_SD_APP_SEND_SCR
#define SD_CMD_SD_APP_SEND_SCR
Definition: sd_mmc_card/inc/at32_sdio.h:308
SD_CMD_ERASE
#define SD_CMD_ERASE
Definition: sd_mmc_card/inc/at32_sdio.h:291
SD_CMD_APP_SD_SET_BUSWIDTH
#define SD_CMD_APP_SD_SET_BUSWIDTH
Definition: sd_mmc_card/inc/at32_sdio.h:303
SD_CMD_WRITE_SINGLE_BLOCK
#define SD_CMD_WRITE_SINGLE_BLOCK
Definition: sd_mmc_card/inc/at32_sdio.h:280
SD_CMD_SD_ERASE_GRP_START
#define SD_CMD_SD_ERASE_GRP_START
Definition: sd_mmc_card/inc/at32_sdio.h:287
SD_CMD_APP_CMD
#define SD_CMD_APP_CMD
Definition: sd_mmc_card/inc/at32_sdio.h:295
SD_CMD_ALL_SEND_CID
#define SD_CMD_ALL_SEND_CID
Definition: sd_mmc_card/inc/at32_sdio.h:260
SD_CMD_STOP_TRANSMISSION
#define SD_CMD_STOP_TRANSMISSION
Definition: sd_mmc_card/inc/at32_sdio.h:270
SD_CMD_SEND_STATUS
#define SD_CMD_SEND_STATUS
Definition: sd_mmc_card/inc/at32_sdio.h:271
SD_CMD_SET_BLOCK_COUNT
#define SD_CMD_SET_BLOCK_COUNT
Definition: sd_mmc_card/inc/at32_sdio.h:279
SD_CMD_WRITE_DAT_UNTIL_STOP
#define SD_CMD_WRITE_DAT_UNTIL_STOP
Definition: sd_mmc_card/inc/at32_sdio.h:278
SD_CMD_SEND_OP_COND
#define SD_CMD_SEND_OP_COND
Definition: sd_mmc_card/inc/at32_sdio.h:259
SD_CMD_SET_BLOCKLEN
#define SD_CMD_SET_BLOCKLEN
Definition: sd_mmc_card/inc/at32_sdio.h:274
SD_CMD_HS_SWITCH
#define SD_CMD_HS_SWITCH
Definition: sd_mmc_card/inc/at32_sdio.h:264
SD_CMD_READ_SINGLE_BLOCK
#define SD_CMD_READ_SINGLE_BLOCK
Definition: sd_mmc_card/inc/at32_sdio.h:275
SD_CMD_SD_APP_OP_COND
#define SD_CMD_SD_APP_OP_COND
Definition: sd_mmc_card/inc/at32_sdio.h:306
SD_CMD_GO_IDLE_STATE
#define SD_CMD_GO_IDLE_STATE
Definition: sd_mmc_card/inc/at32_sdio.h:258
SD_CMD_SET_REL_ADDR
#define SD_CMD_SET_REL_ADDR
Definition: sd_mmc_card/inc/at32_sdio.h:261
SD_CMD_ERASE_GRP_END
#define SD_CMD_ERASE_GRP_END
Definition: sd_mmc_card/inc/at32_sdio.h:290
SD_CMD_READ_DAT_UNTIL_STOP
#define SD_CMD_READ_DAT_UNTIL_STOP
Definition: sd_mmc_card/inc/at32_sdio.h:269
SD_CMD_SD_ERASE_GRP_END
#define SD_CMD_SD_ERASE_GRP_END
Definition: sd_mmc_card/inc/at32_sdio.h:288
SD_CMD_ERASE_GRP_START
#define SD_CMD_ERASE_GRP_START
Definition: sd_mmc_card/inc/at32_sdio.h:289
SD_CMD_SEL_DESEL_CARD
#define SD_CMD_SEL_DESEL_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:265
SD_CMD_WRITE_MULT_BLOCK
#define SD_CMD_WRITE_MULT_BLOCK
Definition: sd_mmc_card/inc/at32_sdio.h:281
SD_CMD_READ_MULT_BLOCK
#define SD_CMD_READ_MULT_BLOCK
Definition: sd_mmc_card/inc/at32_sdio.h:276
SD_CMD_SEND_CSD
#define SD_CMD_SEND_CSD
Definition: sd_mmc_card/inc/at32_sdio.h:267
sd_mult_blocks_read
sd_error_status_type sd_mult_blocks_read(uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mod...
Definition: sdio_fatfs/src/at32_sdio.c:1276
sd_data_transfer_mode_type
sd_data_transfer_mode_type
Definition: sd_mmc_card/inc/at32_sdio.h:65
sd_error_status_type
sd_error_status_type
Definition: sd_mmc_card/inc/at32_sdio.h:74
sd_card_state_type
sd_card_state_type
Definition: sd_mmc_card/inc/at32_sdio.h:187
sd_memory_card_type
sd_memory_card_type
Definition: sd_mmc_card/inc/at32_sdio.h:203
SDIOx
#define SDIOx
Definition: sd_mmc_card/inc/at32_sdio.h:51
SDIO_INTR_STS_WRITE_MASK
#define SDIO_INTR_STS_WRITE_MASK
Definition: sd_mmc_card/inc/at32_sdio.h:474
SDIO_INTR_STS_READ_MASK
#define SDIO_INTR_STS_READ_MASK
Definition: sd_mmc_card/inc/at32_sdio.h:476
EXT_CSD_BUS_WIDTH
#define EXT_CSD_BUS_WIDTH
Definition: sd_mmc_card/inc/at32_sdio.h:463
EXT_CSD_CMD_SET_NORMAL
#define EXT_CSD_CMD_SET_NORMAL
Definition: sd_mmc_card/inc/at32_sdio.h:456
EXT_CSD_Write_byte
#define EXT_CSD_Write_byte
Definition: sd_mmc_card/inc/at32_sdio.h:454
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
SDIO_DATATIMEOUT
#define SDIO_DATATIMEOUT
Definition: sd_mmc_card/inc/at32_sdio.h:342
SDIO_CMD0TIMEOUT
#define SDIO_CMD0TIMEOUT
Definition: sd_mmc_card/inc/at32_sdio.h:341
SDIO_STATIC_FLAGS
#define SDIO_STATIC_FLAGS
Definition: sd_mmc_card/inc/at32_sdio.h:340
SD_CARD_LOCKED
#define SD_CARD_LOCKED
Definition: sd_mmc_card/inc/at32_sdio.h:400
SD_VOLTAGE_WINDOW_SD
#define SD_VOLTAGE_WINDOW_SD
Definition: sd_mmc_card/inc/at32_sdio.h:391
SD_R5_ERROR
#define SD_R5_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:383
SD_CARD_RECEIVING
#define SD_CARD_RECEIVING
Definition: sd_mmc_card/inc/at32_sdio.h:402
SD_R5_OUT_OF_RANGE
#define SD_R5_OUT_OF_RANGE
Definition: sd_mmc_card/inc/at32_sdio.h:381
SD_MAX_DATA_LENGTH
#define SD_MAX_DATA_LENGTH
Definition: sd_mmc_card/inc/at32_sdio.h:408
SD_STD_CAPACITY
#define SD_STD_CAPACITY
Definition: sd_mmc_card/inc/at32_sdio.h:393
SD_R5_FUNCTION_NUMBER
#define SD_R5_FUNCTION_NUMBER
Definition: sd_mmc_card/inc/at32_sdio.h:382
SD_R6_ILLEGAL_CMD
#define SD_R6_ILLEGAL_CMD
Definition: sd_mmc_card/inc/at32_sdio.h:389
SD_R6_GENERAL_UNKNOWN_ERROR
#define SD_R6_GENERAL_UNKNOWN_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:388
SD_MAX_VOLT_TRIAL
#define SD_MAX_VOLT_TRIAL
Definition: sd_mmc_card/inc/at32_sdio.h:396
SD_DATATIMEOUT
#define SD_DATATIMEOUT
Definition: sd_mmc_card/inc/at32_sdio.h:403
SD_R6_CMD_CRC_FAILED
#define SD_R6_CMD_CRC_FAILED
Definition: sd_mmc_card/inc/at32_sdio.h:390
SD_ALLZERO
#define SD_ALLZERO
Definition: sd_mmc_card/inc/at32_sdio.h:397
MMC_SWITCH_ERROR
#define MMC_SWITCH_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:374
SD_VOLTAGE_WINDOW_MMC
#define SD_VOLTAGE_WINDOW_MMC
Definition: sd_mmc_card/inc/at32_sdio.h:395
SD_CHECK_PATTERN
#define SD_CHECK_PATTERN
Definition: sd_mmc_card/inc/at32_sdio.h:394
SD_OCR_ERRORBITS
#define SD_OCR_ERRORBITS
Definition: sd_mmc_card/inc/at32_sdio.h:376
SD_CARD_PROGRAMMING
#define SD_CARD_PROGRAMMING
Definition: sd_mmc_card/inc/at32_sdio.h:401
SD_HIGH_CAPACITY
#define SD_HIGH_CAPACITY
Definition: sd_mmc_card/inc/at32_sdio.h:392
SD_TRANSFER_DMA_MODE
@ SD_TRANSFER_DMA_MODE
Definition: sd_mmc_card/inc/at32_sdio.h:67
SD_TRANSFER_POLLING_MODE
@ SD_TRANSFER_POLLING_MODE
Definition: sd_mmc_card/inc/at32_sdio.h:66
SD_ERROR
@ SD_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:118
SD_LOCK_UNLOCK_FAILED
@ SD_LOCK_UNLOCK_FAILED
Definition: sd_mmc_card/inc/at32_sdio.h:89
SD_SDIO_UNKNOWN_FUNC
@ SD_SDIO_UNKNOWN_FUNC
Definition: sd_mmc_card/inc/at32_sdio.h:108
SD_DATA_FAIL
@ SD_DATA_FAIL
Definition: sd_mmc_card/inc/at32_sdio.h:77
SD_INVALID_PARAMETER
@ SD_INVALID_PARAMETER
Definition: sd_mmc_card/inc/at32_sdio.h:115
SD_CMD_FAIL
@ SD_CMD_FAIL
Definition: sd_mmc_card/inc/at32_sdio.h:76
SD_CMD_OUT_OF_RANGE
@ SD_CMD_OUT_OF_RANGE
Definition: sd_mmc_card/inc/at32_sdio.h:83
SD_CMD_CRC_FAILED
@ SD_CMD_CRC_FAILED
Definition: sd_mmc_card/inc/at32_sdio.h:90
SD_GENERAL_UNKNOWN_ERROR
@ SD_GENERAL_UNKNOWN_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:94
SD_UNSUPPORTED_FEATURE
@ SD_UNSUPPORTED_FEATURE
Definition: sd_mmc_card/inc/at32_sdio.h:116
SD_TX_UNDERRUN
@ SD_TX_UNDERRUN
Definition: sd_mmc_card/inc/at32_sdio.h:80
SD_ILLEGAL_CMD
@ SD_ILLEGAL_CMD
Definition: sd_mmc_card/inc/at32_sdio.h:91
SD_RX_OVERRUN
@ SD_RX_OVERRUN
Definition: sd_mmc_card/inc/at32_sdio.h:81
SD_REQ_NOT_APPLICABLE
@ SD_REQ_NOT_APPLICABLE
Definition: sd_mmc_card/inc/at32_sdio.h:114
SD_SWITCH_ERROR
@ SD_SWITCH_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:104
SD_INVALID_VOLTRANGE
@ SD_INVALID_VOLTRANGE
Definition: sd_mmc_card/inc/at32_sdio.h:102
SD_DATA_TIMEOUT
@ SD_DATA_TIMEOUT
Definition: sd_mmc_card/inc/at32_sdio.h:79
SD_START_BIT_ERR
@ SD_START_BIT_ERR
Definition: sd_mmc_card/inc/at32_sdio.h:82
SD_CMD_RSP_TIMEOUT
@ SD_CMD_RSP_TIMEOUT
Definition: sd_mmc_card/inc/at32_sdio.h:78
SD_OK
@ SD_OK
Definition: sd_mmc_card/inc/at32_sdio.h:119
SD_CARD_ERROR
@ SD_CARD_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:196
SDIO_HIGH_CAPACITY_SD_CARD
@ SDIO_HIGH_CAPACITY_SD_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:206
SDIO_SECURE_DIGITAL_IO_COMBO_CARD
@ SDIO_SECURE_DIGITAL_IO_COMBO_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:210
SDIO_HIGH_SPEED_MULTIMEDIA_CARD
@ SDIO_HIGH_SPEED_MULTIMEDIA_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:209
SDIO_STD_CAPACITY_SD_CARD_V1_1
@ SDIO_STD_CAPACITY_SD_CARD_V1_1
Definition: sd_mmc_card/inc/at32_sdio.h:204
SDIO_SECURE_DIGITAL_IO_CARD
@ SDIO_SECURE_DIGITAL_IO_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:208
SDIO_STD_CAPACITY_SD_CARD_V2_0
@ SDIO_STD_CAPACITY_SD_CARD_V2_0
Definition: sd_mmc_card/inc/at32_sdio.h:205
SDIO_MULTIMEDIA_CARD
@ SDIO_MULTIMEDIA_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:207
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
sd_card_info_struct_type
Definition: sd_mmc_card/inc/at32_sdio.h:237
sd_card_info_struct_type::sd_scr_reg
sd_scr_struct_type sd_scr_reg
Definition: sd_mmc_card/inc/at32_sdio.h:240
sd_card_info_struct_type::card_capacity
long long card_capacity
Definition: sd_mmc_card/inc/at32_sdio.h:241
sd_card_info_struct_type::sd_cid_reg
sd_cid_struct_type sd_cid_reg
Definition: sd_mmc_card/inc/at32_sdio.h:239
sd_card_info_struct_type::sd_csd_reg
sd_csd_struct_type sd_csd_reg
Definition: sd_mmc_card/inc/at32_sdio.h:238
sd_card_info_struct_type::card_blk_size
uint32_t card_blk_size
Definition: sd_mmc_card/inc/at32_sdio.h:242
sd_card_info_struct_type::rca
uint16_t rca
Definition: sd_mmc_card/inc/at32_sdio.h:243
sd_card_info_struct_type::card_type
uint8_t card_type
Definition: sd_mmc_card/inc/at32_sdio.h:244
sd_cid_struct_type::reserved1
uint8_t reserved1
Definition: sd_mmc_card/inc/at32_sdio.h:177
sd_cid_struct_type::product_name2
uint8_t product_name2
Definition: sd_mmc_card/inc/at32_sdio.h:174
sd_cid_struct_type::manufact_date
uint16_t manufact_date
Definition: sd_mmc_card/inc/at32_sdio.h:178
sd_cid_struct_type::cid_crc
uint8_t cid_crc
Definition: sd_mmc_card/inc/at32_sdio.h:179
sd_cid_struct_type::product_reversion
uint8_t product_reversion
Definition: sd_mmc_card/inc/at32_sdio.h:175
sd_cid_struct_type::manufacturer_id
uint8_t manufacturer_id
Definition: sd_mmc_card/inc/at32_sdio.h:171
sd_cid_struct_type::product_sn
uint32_t product_sn
Definition: sd_mmc_card/inc/at32_sdio.h:176
sd_cid_struct_type::product_name1
uint32_t product_name1
Definition: sd_mmc_card/inc/at32_sdio.h:173
sd_cid_struct_type::reserved2
uint8_t reserved2
Definition: sd_mmc_card/inc/at32_sdio.h:180
sd_cid_struct_type::oem_app_id
uint16_t oem_app_id
Definition: sd_mmc_card/inc/at32_sdio.h:172
sd_csd_struct_type::spec_version
uint8_t spec_version
Definition: sd_mmc_card/inc/at32_sdio.h:128
sd_csd_struct_type::max_write_current_vdd_max
uint8_t max_write_current_vdd_max
Definition: sd_mmc_card/inc/at32_sdio.h:144
sd_csd_struct_type::nsac
uint8_t nsac
Definition: sd_mmc_card/inc/at32_sdio.h:131
sd_csd_struct_type::card_cmd_classes
uint16_t card_cmd_classes
Definition: sd_mmc_card/inc/at32_sdio.h:133
sd_csd_struct_type::part_blk_read
uint8_t part_blk_read
Definition: sd_mmc_card/inc/at32_sdio.h:135
sd_csd_struct_type::read_blk_misalign
uint8_t read_blk_misalign
Definition: sd_mmc_card/inc/at32_sdio.h:137
sd_csd_struct_type::content_protect_app
uint8_t content_protect_app
Definition: sd_mmc_card/inc/at32_sdio.h:155
sd_csd_struct_type::write_speed_factor
uint8_t write_speed_factor
Definition: sd_mmc_card/inc/at32_sdio.h:151
sd_csd_struct_type::max_read_blk_length
uint8_t max_read_blk_length
Definition: sd_mmc_card/inc/at32_sdio.h:134
sd_csd_struct_type::max_bus_clk_freq
uint8_t max_bus_clk_freq
Definition: sd_mmc_card/inc/at32_sdio.h:132
sd_csd_struct_type::ecc_code
uint8_t ecc_code
Definition: sd_mmc_card/inc/at32_sdio.h:161
sd_csd_struct_type::reserved4
uint8_t reserved4
Definition: sd_mmc_card/inc/at32_sdio.h:163
sd_csd_struct_type::dsr_implemented
uint8_t dsr_implemented
Definition: sd_mmc_card/inc/at32_sdio.h:138
sd_csd_struct_type::max_read_current_vdd_min
uint8_t max_read_current_vdd_min
Definition: sd_mmc_card/inc/at32_sdio.h:141
sd_csd_struct_type::reserved2
uint8_t reserved2
Definition: sd_mmc_card/inc/at32_sdio.h:139
sd_csd_struct_type::erase_group_size_mult
uint8_t erase_group_size_mult
Definition: sd_mmc_card/inc/at32_sdio.h:147
sd_csd_struct_type::file_formart
uint8_t file_formart
Definition: sd_mmc_card/inc/at32_sdio.h:160
sd_csd_struct_type::temp_write_protect
uint8_t temp_write_protect
Definition: sd_mmc_card/inc/at32_sdio.h:159
sd_csd_struct_type::permanent_write_protect
uint8_t permanent_write_protect
Definition: sd_mmc_card/inc/at32_sdio.h:158
sd_csd_struct_type::max_read_current_vdd_max
uint8_t max_read_current_vdd_max
Definition: sd_mmc_card/inc/at32_sdio.h:142
sd_csd_struct_type::file_format_group
uint8_t file_format_group
Definition: sd_mmc_card/inc/at32_sdio.h:156
sd_csd_struct_type::device_size
uint32_t device_size
Definition: sd_mmc_card/inc/at32_sdio.h:140
sd_csd_struct_type::write_blk_misalign
uint8_t write_blk_misalign
Definition: sd_mmc_card/inc/at32_sdio.h:136
sd_csd_struct_type::csd_struct
uint8_t csd_struct
Definition: sd_mmc_card/inc/at32_sdio.h:127
sd_csd_struct_type::write_protect_group_enable
uint8_t write_protect_group_enable
Definition: sd_mmc_card/inc/at32_sdio.h:149
sd_csd_struct_type::max_write_current_vdd_min
uint8_t max_write_current_vdd_min
Definition: sd_mmc_card/inc/at32_sdio.h:143
sd_csd_struct_type::reserved1
uint8_t reserved1
Definition: sd_mmc_card/inc/at32_sdio.h:129
sd_csd_struct_type::max_write_blk_length
uint8_t max_write_blk_length
Definition: sd_mmc_card/inc/at32_sdio.h:152
sd_csd_struct_type::csd_crc
uint8_t csd_crc
Definition: sd_mmc_card/inc/at32_sdio.h:162
sd_csd_struct_type::write_protect_group_size
uint8_t write_protect_group_size
Definition: sd_mmc_card/inc/at32_sdio.h:148
sd_csd_struct_type::reserved3
uint8_t reserved3
Definition: sd_mmc_card/inc/at32_sdio.h:154
sd_csd_struct_type::taac
uint8_t taac
Definition: sd_mmc_card/inc/at32_sdio.h:130
sd_csd_struct_type::manufacturer_default_ecc
uint8_t manufacturer_default_ecc
Definition: sd_mmc_card/inc/at32_sdio.h:150
sd_csd_struct_type::part_blk_write
uint8_t part_blk_write
Definition: sd_mmc_card/inc/at32_sdio.h:153
sd_csd_struct_type::copy_flag
uint8_t copy_flag
Definition: sd_mmc_card/inc/at32_sdio.h:157
sd_csd_struct_type::erase_group_size
uint8_t erase_group_size
Definition: sd_mmc_card/inc/at32_sdio.h:146
sd_csd_struct_type::device_size_mult
uint8_t device_size_mult
Definition: sd_mmc_card/inc/at32_sdio.h:145
sd_scr_struct_type::sd_bus_width
uint32_t sd_bus_width
Definition: sd_mmc_card/inc/at32_sdio.h:222
sd_scr_struct_type::sd_spec
uint32_t sd_spec
Definition: sd_mmc_card/inc/at32_sdio.h:220
sdio_command_struct_type
sdio command structure
Definition: at32f415_sdio.h:229
sdio_command_struct_type::cmd_index
uint8_t cmd_index
Definition: at32f415_sdio.h:231
sdio_command_struct_type::argument
uint32_t argument
Definition: at32f415_sdio.h:230
sdio_command_struct_type::wait_type
sdio_wait_type wait_type
Definition: at32f415_sdio.h:233
sdio_command_struct_type::rsp_type
sdio_reponse_type rsp_type
Definition: at32f415_sdio.h:232
sdio_data_struct_type
sdio data structure
Definition: at32f415_sdio.h:240
sdio_data_struct_type::block_size
sdio_block_size_type block_size
Definition: at32f415_sdio.h:243
sdio_data_struct_type::transfer_direction
sdio_transfer_direction_type transfer_direction
Definition: at32f415_sdio.h:245
sdio_data_struct_type::timeout
uint32_t timeout
Definition: at32f415_sdio.h:241
sdio_data_struct_type::transfer_mode
sdio_transfer_mode_type transfer_mode
Definition: at32f415_sdio.h:244
sdio_data_struct_type::data_length
uint32_t data_length
Definition: at32f415_sdio.h:242


AT32F415 Firmwary Library: ffconf.h Source File

  • sdio
  • sdio_fatfs
  • inc
sdio/sdio_fatfs/inc/ffconf.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------------/
2/ FatFs Functional Configurations
3/---------------------------------------------------------------------------*/
4
5#define FFCONF_DEF 86631 /* Revision ID */
6
7/*---------------------------------------------------------------------------/
8/ Function Configurations
9/---------------------------------------------------------------------------*/
10
11#define FF_FS_READONLY 0
12/* This option switches read-only configuration. (0:Read/Write or 1:Read-only)
13/ Read-only configuration removes writing API functions, f_write(), f_sync(),
14/ f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree()
15/ and optional writing functions as well. */
16
17
18#define FF_FS_MINIMIZE 0
19/* This option defines minimization level to remove some basic API functions.
20/
21/ 0: Basic functions are fully enabled.
22/ 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename()
23/ are removed.
24/ 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1.
25/ 3: f_lseek() function is removed in addition to 2. */
26
27
28#define FF_USE_FIND 0
29/* This option switches filtered directory read functions, f_findfirst() and
30/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */
31
32
33#define FF_USE_MKFS 1//0
34/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */
35
36
37#define FF_USE_FASTSEEK 1//0
38/* This option switches fast seek function. (0:Disable or 1:Enable) */
39
40
41#define FF_USE_EXPAND 0
42/* This option switches f_expand function. (0:Disable or 1:Enable) */
43
44
45#define FF_USE_CHMOD 0
46/* This option switches attribute manipulation functions, f_chmod() and f_utime().
47/ (0:Disable or 1:Enable) Also FF_FS_READONLY needs to be 0 to enable this option. */
48
49
50#define FF_USE_LABEL 0
51/* This option switches volume label functions, f_getlabel() and f_setlabel().
52/ (0:Disable or 1:Enable) */
53
54
55#define FF_USE_FORWARD 0
56/* This option switches f_forward() function. (0:Disable or 1:Enable) */
57
58
59#define FF_USE_STRFUNC 0
60#define FF_PRINT_LLI 0
61#define FF_PRINT_FLOAT 0
62#define FF_STRF_ENCODE 0
63/* FF_USE_STRFUNC switches string functions, f_gets(), f_putc(), f_puts() and
64/ f_printf().
65/
66/ 0: Disable. FF_PRINT_LLI, FF_PRINT_FLOAT and FF_STRF_ENCODE have no effect.
67/ 1: Enable without LF-CRLF conversion.
68/ 2: Enable with LF-CRLF conversion.
69/
70/ FF_PRINT_LLI = 1 makes f_printf() support long long argument and FF_PRINT_FLOAT = 1/2
71 makes f_printf() support floating point argument. These features want C99 or later.
72/ When FF_LFN_UNICODE >= 1 with LFN enabled, string functions convert the character
73/ encoding in it. FF_STRF_ENCODE selects assumption of character encoding ON THE FILE
74/ to be read/written via those functions.
75/
76/ 0: ANSI/OEM in current CP
77/ 1: Unicode in UTF-16LE
78/ 2: Unicode in UTF-16BE
79/ 3: Unicode in UTF-8
80*/
81
82
83/*---------------------------------------------------------------------------/
84/ Locale and Namespace Configurations
85/---------------------------------------------------------------------------*/
86
87#define FF_CODE_PAGE 932
88/* This option specifies the OEM code page to be used on the target system.
89/ Incorrect code page setting can cause a file open failure.
90/
91/ 437 - U.S.
92/ 720 - Arabic
93/ 737 - Greek
94/ 771 - KBL
95/ 775 - Baltic
96/ 850 - Latin 1
97/ 852 - Latin 2
98/ 855 - Cyrillic
99/ 857 - Turkish
100/ 860 - Portuguese
101/ 861 - Icelandic
102/ 862 - Hebrew
103/ 863 - Canadian French
104/ 864 - Arabic
105/ 865 - Nordic
106/ 866 - Russian
107/ 869 - Greek 2
108/ 932 - Japanese (DBCS)
109/ 936 - Simplified Chinese (DBCS)
110/ 949 - Korean (DBCS)
111/ 950 - Traditional Chinese (DBCS)
112/ 0 - Include all code pages above and configured by f_setcp()
113*/
114
115
116#define FF_USE_LFN 0
117#define FF_MAX_LFN 255
118/* The FF_USE_LFN switches the support for LFN (long file name).
119/
120/ 0: Disable LFN. FF_MAX_LFN has no effect.
121/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
122/ 2: Enable LFN with dynamic working buffer on the STACK.
123/ 3: Enable LFN with dynamic working buffer on the HEAP.
124/
125/ To enable the LFN, ffunicode.c needs to be added to the project. The LFN function
126/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and
127/ additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled.
128/ The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can
129/ be in range of 12 to 255. It is recommended to be set it 255 to fully support LFN
130/ specification.
131/ When use stack for the working buffer, take care on stack overflow. When use heap
132/ memory for the working buffer, memory management functions, ff_memalloc() and
133/ ff_memfree() exemplified in ffsystem.c, need to be added to the project. */
134
135
136#define FF_LFN_UNICODE 0
137/* This option switches the character encoding on the API when LFN is enabled.
138/
139/ 0: ANSI/OEM in current CP (TCHAR = char)
140/ 1: Unicode in UTF-16 (TCHAR = WCHAR)
141/ 2: Unicode in UTF-8 (TCHAR = char)
142/ 3: Unicode in UTF-32 (TCHAR = DWORD)
143/
144/ Also behavior of string I/O functions will be affected by this option.
145/ When LFN is not enabled, this option has no effect. */
146
147
148#define FF_LFN_BUF 255
149#define FF_SFN_BUF 12
150/* This set of options defines size of file name members in the FILINFO structure
151/ which is used to read out directory items. These values should be suffcient for
152/ the file names to read. The maximum possible length of the read file name depends
153/ on character encoding. When LFN is not enabled, these options have no effect. */
154
155
156#define FF_FS_RPATH 0
157/* This option configures support for relative path.
158/
159/ 0: Disable relative path and remove related functions.
160/ 1: Enable relative path. f_chdir() and f_chdrive() are available.
161/ 2: f_getcwd() function is available in addition to 1.
162*/
163
164
165/*---------------------------------------------------------------------------/
166/ Drive/Volume Configurations
167/---------------------------------------------------------------------------*/
168
169#define FF_VOLUMES 3//1
170/* Number of volumes (logical drives) to be used. (1-10) */
171
172
173#define FF_STR_VOLUME_ID 0
174#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"
175/* FF_STR_VOLUME_ID switches support for volume ID in arbitrary strings.
176/ When FF_STR_VOLUME_ID is set to 1 or 2, arbitrary strings can be used as drive
177/ number in the path name. FF_VOLUME_STRS defines the volume ID strings for each
178/ logical drives. Number of items must not be less than FF_VOLUMES. Valid
179/ characters for the volume ID strings are A-Z, a-z and 0-9, however, they are
180/ compared in case-insensitive. If FF_STR_VOLUME_ID >= 1 and FF_VOLUME_STRS is
181/ not defined, a user defined volume string table needs to be defined as:
182/
183/ const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb",...
184*/
185
186
187#define FF_MULTI_PARTITION 0
188/* This option switches support for multiple volumes on the physical drive.
189/ By default (0), each logical drive number is bound to the same physical drive
190/ number and only an FAT volume found on the physical drive will be mounted.
191/ When this function is enabled (1), each logical drive number can be bound to
192/ arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk()
193/ funciton will be available. */
194
195
196#define FF_MIN_SS 512
197#define FF_MAX_SS 512
198/* This set of options configures the range of sector size to be supported. (512,
199/ 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and
200/ harddisk, but a larger value may be required for on-board flash memory and some
201/ type of optical media. When FF_MAX_SS is larger than FF_MIN_SS, FatFs is configured
202/ for variable sector size mode and disk_ioctl() function needs to implement
203/ GET_SECTOR_SIZE command. */
204
205
206#define FF_LBA64 0
207/* This option switches support for 64-bit LBA. (0:Disable or 1:Enable)
208/ To enable the 64-bit LBA, also exFAT needs to be enabled. (FF_FS_EXFAT == 1) */
209
210
211#define FF_MIN_GPT 0x10000000
212/* Minimum number of sectors to switch GPT as partitioning format in f_mkfs and
213/ f_fdisk function. 0x100000000 max. This option has no effect when FF_LBA64 == 0. */
214
215
216#define FF_USE_TRIM 0
217/* This option switches support for ATA-TRIM. (0:Disable or 1:Enable)
218/ To enable Trim function, also CTRL_TRIM command should be implemented to the
219/ disk_ioctl() function. */
220
221
222
223/*---------------------------------------------------------------------------/
224/ System Configurations
225/---------------------------------------------------------------------------*/
226
227#define FF_FS_TINY 0
228/* This option switches tiny buffer configuration. (0:Normal or 1:Tiny)
229/ At the tiny configuration, size of file object (FIL) is shrinked FF_MAX_SS bytes.
230/ Instead of private sector buffer eliminated from the file object, common sector
231/ buffer in the filesystem object (FATFS) is used for the file data transfer. */
232
233
234#define FF_FS_EXFAT 0
235/* This option switches support for exFAT filesystem. (0:Disable or 1:Enable)
236/ To enable exFAT, also LFN needs to be enabled. (FF_USE_LFN >= 1)
237/ Note that enabling exFAT discards ANSI C (C89) compatibility. */
238
239
240#define FF_FS_NORTC 1//0
241#define FF_NORTC_MON 1
242#define FF_NORTC_MDAY 1
243#define FF_NORTC_YEAR 2020
244/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have
245/ any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable
246/ the timestamp function. Every object modified by FatFs will have a fixed timestamp
247/ defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time.
248/ To enable timestamp function (FF_FS_NORTC = 0), get_fattime() function need to be
249/ added to the project to read current time form real-time clock. FF_NORTC_MON,
250/ FF_NORTC_MDAY and FF_NORTC_YEAR have no effect.
251/ These options have no effect in read-only configuration (FF_FS_READONLY = 1). */
252
253
254#define FF_FS_NOFSINFO 0
255/* If you need to know correct free space on the FAT32 volume, set bit 0 of this
256/ option, and f_getfree() function at first time after volume mount will force
257/ a full FAT scan. Bit 1 controls the use of last allocated cluster number.
258/
259/ bit0=0: Use free cluster count in the FSINFO if available.
260/ bit0=1: Do not trust free cluster count in the FSINFO.
261/ bit1=0: Use last allocated cluster number in the FSINFO if available.
262/ bit1=1: Do not trust last allocated cluster number in the FSINFO.
263*/
264
265
266#define FF_FS_LOCK 0
267/* The option FF_FS_LOCK switches file lock function to control duplicated file open
268/ and illegal operation to open objects. This option must be 0 when FF_FS_READONLY
269/ is 1.
270/
271/ 0: Disable file lock function. To avoid volume corruption, application program
272/ should avoid illegal open, remove and rename to the open objects.
273/ >0: Enable file lock function. The value defines how many files/sub-directories
274/ can be opened simultaneously under file lock control. Note that the file
275/ lock control is independent of re-entrancy. */
276
277
278/* #include <somertos.h> // O/S definitions */
279#define FF_FS_REENTRANT 0
280#define FF_FS_TIMEOUT 1000
281#define FF_SYNC_t HANDLE
282/* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs
283/ module itself. Note that regardless of this option, file access to different
284/ volume is always re-entrant and volume control functions, f_mount(), f_mkfs()
285/ and f_fdisk() function, are always not re-entrant. Only file/directory access
286/ to the same volume is under control of this function.
287/
288/ 0: Disable re-entrancy. FF_FS_TIMEOUT and FF_SYNC_t have no effect.
289/ 1: Enable re-entrancy. Also user provided synchronization handlers,
290/ ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj()
291/ function, must be added to the project. Samples are available in
292/ option/syscall.c.
293/
294/ The FF_FS_TIMEOUT defines timeout period in unit of time tick.
295/ The FF_SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*,
296/ SemaphoreHandle_t and etc. A header file for O/S definitions needs to be
297/ included somewhere in the scope of ff.h. */
298
299
300
301/*--- End of configuration options ---*/


AT32F415 Firmwary Library: at32_sdio.h Source File

  • sdio
  • sdio_fatfs
  • inc
sdio_fatfs/inc/at32_sdio.h
Go to the documentation of this file.
1
28/* define to prevent recursive inclusion -------------------------------------*/
29#ifndef __AT32_SDIO_H
30#define __AT32_SDIO_H
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36/* includes ------------------------------------------------------------------*/
37#include "at32f415.h"
38
51#define SDIOx SDIO1
52
64typedef enum
65{
66 SD_TRANSFER_POLLING_MODE = 0,
67 SD_TRANSFER_DMA_MODE = 1
68} sd_data_transfer_mode_type;
69
73typedef enum
74{
75 /* sdio specific error defines ------------------------------------------*/
76 SD_CMD_FAIL = 1,
77 SD_DATA_FAIL = 2,
78 SD_CMD_RSP_TIMEOUT = 3,
79 SD_DATA_TIMEOUT = 4,
80 SD_TX_UNDERRUN = 5,
81 SD_RX_OVERRUN = 6,
82 SD_START_BIT_ERR = 7,
83 SD_CMD_OUT_OF_RANGE = 8,
84 SD_ADDR_MISALIGNED = 9,
85 SD_BLK_LEN_ERR = 10,
86 SD_ERASE_SEQ_ERR = 11,
87 SD_INVALID_ERASE_PARAM = 12,
88 SD_WR_PROTECT_VIOLATION = 13,
89 SD_LOCK_UNLOCK_FAILED = 14,
90 SD_CMD_CRC_FAILED = 15,
91 SD_ILLEGAL_CMD = 16,
92 SD_CARD_ECC_FAILED = 17,
93 SD_CARD_CONTROLLER_ERR = 18,
94 SD_GENERAL_UNKNOWN_ERROR = 19,
95 SD_STREAM_RD_UNDERRUN = 20,
96 SD_STREAM_WR_OVERRUN = 21,
97 SD_CID_CSD_OVERWRITE = 22,
98 SD_WP_ERASE_SKIP = 23,
99 SD_CARD_ECC_DISABLED = 24,
100 SD_ERASE_RESET = 25,
101 SD_AKE_SEQ_ERROR = 26,
102 SD_INVALID_VOLTRANGE = 27,
103 SD_ADDR_OUT_OF_RANGE = 28,
104 SD_SWITCH_ERROR = 29,
105 SD_SDIO_DISABLED = 30,
106 SD_SDIO_FUNC_BUSY = 31,
107 SD_SDIO_FUNC_FAILED = 32,
108 SD_SDIO_UNKNOWN_FUNC = 33,
110 /* standard error defines --------------------------------------------*/
111 SD_INTERNAL_ERROR,
112 SD_NOT_CONFIGURED,
113 SD_REQ_PENDING,
114 SD_REQ_NOT_APPLICABLE,
115 SD_INVALID_PARAMETER,
116 SD_UNSUPPORTED_FEATURE,
117 SD_UNSUPPORTED_HW,
118 SD_ERROR,
119 SD_OK = 0
120} sd_error_status_type;
121
125typedef struct
126{
127 uint8_t csd_struct;
128 uint8_t spec_version;
129 uint8_t reserved1;
130 uint8_t taac;
131 uint8_t nsac;
132 uint8_t max_bus_clk_freq;
133 uint16_t card_cmd_classes;
134 uint8_t max_read_blk_length;
135 uint8_t part_blk_read;
136 uint8_t write_blk_misalign;
137 uint8_t read_blk_misalign;
138 uint8_t dsr_implemented;
139 uint8_t reserved2;
140 uint32_t device_size;
141 uint8_t max_read_current_vdd_min;
142 uint8_t max_read_current_vdd_max;
143 uint8_t max_write_current_vdd_min;
144 uint8_t max_write_current_vdd_max;
145 uint8_t device_size_mult;
146 uint8_t erase_group_size;
147 uint8_t erase_group_size_mult;
148 uint8_t write_protect_group_size;
149 uint8_t write_protect_group_enable;
150 uint8_t manufacturer_default_ecc;
151 uint8_t write_speed_factor;
152 uint8_t max_write_blk_length;
153 uint8_t part_blk_write;
154 uint8_t reserved3;
155 uint8_t content_protect_app;
156 uint8_t file_format_group;
157 uint8_t copy_flag;
158 uint8_t permanent_write_protect;
159 uint8_t temp_write_protect;
160 uint8_t file_formart;
161 uint8_t ecc_code;
162 uint8_t csd_crc;
163 uint8_t reserved4;
164} sd_csd_struct_type;
165
169typedef struct
170{
171 uint8_t manufacturer_id;
172 uint16_t oem_app_id;
173 uint32_t product_name1;
174 uint8_t product_name2;
175 uint8_t product_reversion;
176 uint32_t product_sn;
177 uint8_t reserved1;
178 uint16_t manufact_date;
179 uint8_t cid_crc;
180 uint8_t reserved2;
181} sd_cid_struct_type;
182
186typedef enum
187{
188 SD_CARD_READY = ((uint32_t)0x00000001),
189 SD_CARD_IDENTIFICATION = ((uint32_t)0x00000002),
190 SD_CARD_STANDBY = ((uint32_t)0x00000003),
191 SD_CARD_TRANSFER = ((uint32_t)0x00000004),
192 SD_CARD_SENDING = ((uint32_t)0x00000005),
193 SD_CARD_RECEIVING = ((uint32_t)0x00000006),
194 SD_CARD_PROGRAMMING = ((uint32_t)0x00000007),
195 SD_CARD_DISCONNECTED = ((uint32_t)0x00000008),
196 SD_CARD_ERROR = ((uint32_t)0x000000FF)
197} sd_card_state_type;
198
202typedef enum
203{
204 SDIO_STD_CAPACITY_SD_CARD_V1_1 = 0,
205 SDIO_STD_CAPACITY_SD_CARD_V2_0 = 1,
206 SDIO_HIGH_CAPACITY_SD_CARD = 2,
207 SDIO_MULTIMEDIA_CARD = 3,
208 SDIO_SECURE_DIGITAL_IO_CARD = 4,
209 SDIO_HIGH_SPEED_MULTIMEDIA_CARD = 5,
210 SDIO_SECURE_DIGITAL_IO_COMBO_CARD = 6,
211 SDIO_HIGH_CAPACITY_MMC_CARD = 7,
212 SDIO_SDIO_CARD = 8
213} sd_memory_card_type;
214
218typedef struct
219{
220 uint32_t sd_spec :4; /* [59:56] */
221 uint32_t scr_structure :4; /* [60:63] */
222 uint32_t sd_bus_width :4; /* [51:48] */
223 uint32_t sd_security :3; /* [52:54] */
224 uint32_t data_stat_after_erase :1; /* [55:55] */
225 uint32_t reserved1 :7; /* [46:40] */
226 uint32_t sd_spec3 :1; /* [47:47] */
227 uint32_t cmd20_support :1; /* [32:32] */
228 uint32_t cmd23_support :1; /* [33:33] */
229 uint32_t reserverd2 :6; /* [34:39] */
230 uint32_t reserverd3; /* [31:0] */
231} sd_scr_struct_type;
232
236typedef struct
237{
238 sd_csd_struct_type sd_csd_reg;
239 sd_cid_struct_type sd_cid_reg;
240 sd_scr_struct_type sd_scr_reg;
241 long long card_capacity;
242 uint32_t card_blk_size;
243 uint16_t rca;
244 uint8_t card_type;
245} sd_card_info_struct_type;
246
258#define SD_CMD_GO_IDLE_STATE ((uint8_t)0)
259#define SD_CMD_SEND_OP_COND ((uint8_t)1)
260#define SD_CMD_ALL_SEND_CID ((uint8_t)2)
261#define SD_CMD_SET_REL_ADDR ((uint8_t)3)
262#define SD_CMD_SET_DSR ((uint8_t)4)
263#define SD_CMD_SDIO_SEN_OP_COND ((uint8_t)5)
264#define SD_CMD_HS_SWITCH ((uint8_t)6)
265#define SD_CMD_SEL_DESEL_CARD ((uint8_t)7)
266#define SD_CMD_HS_SEND_EXT_CSD ((uint8_t)8)
267#define SD_CMD_SEND_CSD ((uint8_t)9)
268#define SD_CMD_SEND_CID ((uint8_t)10)
269#define SD_CMD_READ_DAT_UNTIL_STOP ((uint8_t)11)
270#define SD_CMD_STOP_TRANSMISSION ((uint8_t)12)
271#define SD_CMD_SEND_STATUS ((uint8_t)13)
272#define SD_CMD_HS_BUSTEST_READ ((uint8_t)14)
273#define SD_CMD_GO_INACTIVE_STATE ((uint8_t)15)
274#define SD_CMD_SET_BLOCKLEN ((uint8_t)16)
275#define SD_CMD_READ_SINGLE_BLOCK ((uint8_t)17)
276#define SD_CMD_READ_MULT_BLOCK ((uint8_t)18)
277#define SD_CMD_HS_BUSTEST_WRITE ((uint8_t)19)
278#define SD_CMD_WRITE_DAT_UNTIL_STOP ((uint8_t)20)
279#define SD_CMD_SET_BLOCK_COUNT ((uint8_t)23)
280#define SD_CMD_WRITE_SINGLE_BLOCK ((uint8_t)24)
281#define SD_CMD_WRITE_MULT_BLOCK ((uint8_t)25)
282#define SD_CMD_PROG_CID ((uint8_t)26)
283#define SD_CMD_PROG_CSD ((uint8_t)27)
284#define SD_CMD_SET_WRITE_PROT ((uint8_t)28)
285#define SD_CMD_CLR_WRITE_PROT ((uint8_t)29)
286#define SD_CMD_SEND_WRITE_PROT ((uint8_t)30)
287#define SD_CMD_SD_ERASE_GRP_START ((uint8_t)32)
288#define SD_CMD_SD_ERASE_GRP_END ((uint8_t)33)
289#define SD_CMD_ERASE_GRP_START ((uint8_t)35)
290#define SD_CMD_ERASE_GRP_END ((uint8_t)36)
291#define SD_CMD_ERASE ((uint8_t)38)
292#define SD_CMD_FAST_IO ((uint8_t)39)
293#define SD_CMD_GO_IRQ_STATE ((uint8_t)40)
294#define SD_CMD_LOCK_UNLOCK ((uint8_t)42)
295#define SD_CMD_APP_CMD ((uint8_t)55)
296#define SD_CMD_GEN_CMD ((uint8_t)56)
297#define SD_CMD_NO_CMD ((uint8_t)64)
298
303#define SD_CMD_APP_SD_SET_BUSWIDTH ((uint8_t)6)
304#define SD_CMD_SD_APP_STAUS ((uint8_t)13)
305#define SD_CMD_SD_APP_SEND_NUM_WRITE_BLOCKS ((uint8_t)22)
306#define SD_CMD_SD_APP_OP_COND ((uint8_t)41)
307#define SD_CMD_SD_APP_SET_CLR_CARD_DETECT ((uint8_t)42)
308#define SD_CMD_SD_APP_SEND_SCR ((uint8_t)51)
309#define SD_CMD_SDIO_RW_DIRECT ((uint8_t)52)
310#define SD_CMD_SDIO_RW_EXTENDED ((uint8_t)53)
311
316#define SD_CMD_SD_APP_GET_MKB ((uint8_t)43)
317#define SD_CMD_SD_APP_GET_MID ((uint8_t)44)
318#define SD_CMD_SD_APP_SET_CER_RN1 ((uint8_t)45)
319#define SD_CMD_SD_APP_GET_CER_RN2 ((uint8_t)46)
320#define SD_CMD_SD_APP_SET_CER_RES2 ((uint8_t)47)
321#define SD_CMD_SD_APP_GET_CER_RES1 ((uint8_t)48)
322#define SD_CMD_SD_APP_SECURE_READ_MULTIPLE_BLOCK ((uint8_t)18)
323#define SD_CMD_SD_APP_SECURE_WRITE_MULTIPLE_BLOCK ((uint8_t)25)
324#define SD_CMD_SD_APP_SECURE_ERASE ((uint8_t)38)
325#define SD_CMD_SD_APP_CHANGE_SECURE_AREA ((uint8_t)49)
326#define SD_CMD_SD_APP_SECURE_WRITE_MKB ((uint8_t)48)
327
339#define NULL 0
340#define SDIO_STATIC_FLAGS ((uint32_t)0x000005FF)
341#define SDIO_CMD0TIMEOUT ((uint32_t)0x00010000)
342#define SDIO_DATATIMEOUT ((uint32_t)0xFFFFFFFF)
343#define SDIO_FIFO_Address ((uint32_t)0x40018080)
344
356#define SD_OCR_ADDR_OUT_OF_RANGE ((uint32_t)0x80000000)
357#define SD_OCR_ADDR_MISALIGNED ((uint32_t)0x40000000)
358#define SD_OCR_BLK_LEN_ERR ((uint32_t)0x20000000)
359#define SD_OCR_ERASE_SEQ_ERR ((uint32_t)0x10000000)
360#define SD_OCR_INVALID_ERASE_PARAM ((uint32_t)0x08000000)
361#define SD_OCR_WR_PROTECT_VIOLATION ((uint32_t)0x04000000)
362#define SD_OCR_LOCK_UNLOCK_FAILED ((uint32_t)0x01000000)
363#define SD_OCR_CMD_CRC_FAILED ((uint32_t)0x00800000)
364#define SD_OCR_ILLEGAL_CMD ((uint32_t)0x00400000)
365#define SD_OCR_CARD_ECC_FAILED ((uint32_t)0x00200000)
366#define SD_OCR_CARD_CONTROLLER_ERR ((uint32_t)0x00100000)
367#define SD_OCR_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00080000)
368#define SD_OCR_STREAM_RD_UNDERRUN ((uint32_t)0x00040000)
369#define SD_OCR_STREAM_WR_OVERRUN ((uint32_t)0x00020000)
370#define SD_OCR_CID_CSD_OVERWRIETE ((uint32_t)0x00010000)
371#define SD_OCR_WP_ERASE_SKIP ((uint32_t)0x00008000)
372#define SD_OCR_CARD_ECC_DISABLED ((uint32_t)0x00004000)
373#define SD_OCR_ERASE_RESET ((uint32_t)0x00002000)
374#define MMC_SWITCH_ERROR ((uint32_t)0x00000080)
375#define SD_OCR_AKE_SEQ_ERROR ((uint32_t)0x00000008)
376#define SD_OCR_ERRORBITS ((uint32_t)0xFDFFE008)
377
381#define SD_R5_OUT_OF_RANGE ((uint32_t)0x00000100)
382#define SD_R5_FUNCTION_NUMBER ((uint32_t)0x00000200)
383#define SD_R5_ERROR ((uint32_t)0x00000800)
384
388#define SD_R6_GENERAL_UNKNOWN_ERROR ((uint32_t)0x00002000)
389#define SD_R6_ILLEGAL_CMD ((uint32_t)0x00004000)
390#define SD_R6_CMD_CRC_FAILED ((uint32_t)0x00008000)
391#define SD_VOLTAGE_WINDOW_SD ((uint32_t)0x80100000)
392#define SD_HIGH_CAPACITY ((uint32_t)0x40000000)
393#define SD_STD_CAPACITY ((uint32_t)0x00000000)
394#define SD_CHECK_PATTERN ((uint32_t)0x000001AA)
395#define SD_VOLTAGE_WINDOW_MMC ((uint32_t)0x80FF8000)
396#define SD_MAX_VOLT_TRIAL ((uint32_t)0x0000FFFF)
397#define SD_ALLZERO ((uint32_t)0x00000000)
398#define SD_WIDE_BUS_SUPPORT ((uint32_t)0x00040000)
399#define SD_SINGLE_BUS_SUPPORT ((uint32_t)0x00010000)
400#define SD_CARD_LOCKED ((uint32_t)0x02000000)
401#define SD_CARD_PROGRAMMING ((uint32_t)0x00000007)
402#define SD_CARD_RECEIVING ((uint32_t)0x00000006)
403#define SD_DATATIMEOUT ((uint32_t)0xFFFFFFFF)
404#define SD_0TO7BITS ((uint32_t)0x000000FF)
405#define SD_8TO15BITS ((uint32_t)0x0000FF00)
406#define SD_16TO23BITS ((uint32_t)0x00FF0000)
407#define SD_24TO31BITS ((uint32_t)0xFF000000)
408#define SD_MAX_DATA_LENGTH ((uint32_t)0x01FFFFFF)
409#define SD_HALFFIFO ((uint32_t)0x00000008)
410#define SD_HALFFIFOBYTES ((uint32_t)0x00000020)
411
423#define SD_CCCC_LOCK_UNLOCK ((uint32_t)0x00000080)
424#define SD_CCCC_WRITE_PROT ((uint32_t)0x00000040)
425#define SD_CCCC_ERASE ((uint32_t)0x00000020)
426
438#define SDIO_SEND_IF_COND ((uint32_t)0x00000008)
439
451#define EXT_CSD_Command_set 0x0
452#define EXT_CSD_Set_bit 0x1
453#define EXT_CSD_Clear_byte 0x2
454#define EXT_CSD_Write_byte 0x3
455
456#define EXT_CSD_CMD_SET_NORMAL (1<<0)
457#define EXT_CSD_CMD_SET_SECURE (1<<1)
458#define EXT_CSD_CMD_SET_CPSECURE (1<<2)
459
463#define EXT_CSD_BUS_WIDTH 183
464#define EXT_CSD_HS_TIMING 185
465
474#define SDIO_INTR_STS_WRITE_MASK (SDIO_DTFAIL_FLAG | SDIO_DTTIMEOUT_FLAG | SDIO_TXERRU_FLAG | \
475 SDIO_DTCMPL_FLAG | SDIO_SBITERR_FLAG)
476#define SDIO_INTR_STS_READ_MASK (SDIO_DTFAIL_FLAG | SDIO_DTTIMEOUT_FLAG | SDIO_RXERRO_FLAG | \
477 SDIO_DTCMPL_FLAG | SDIO_SBITERR_FLAG)
482extern sd_card_info_struct_type sd_card_info;
483
488/* sd exported functions ----------------------------------------*/
489 sd_error_status_type sd_init(void);
490void sdio_clock_set(uint32_t clkdiv);
491 sd_error_status_type sd_power_on(void);
492 sd_error_status_type sd_power_off(void);
493 sd_error_status_type sd_card_init(void);
494 sd_error_status_type sd_card_info_get(sd_card_info_struct_type *card_info);
495 sd_error_status_type sd_wide_bus_operation_config(sdio_bus_width_type mode);
496 sd_error_status_type sd_device_mode_set(uint32_t mode);
497 sd_error_status_type sd_deselect_select(uint32_t addr);
498 sd_error_status_type sd_status_send(uint32_t *p_card_status);
499 sd_card_state_type sd_state_get(void);
500 sd_error_status_type sd_blocks_erase(long long addr, uint32_t nblks);
501 sd_error_status_type sd_block_read(uint8_t *buf, long long addr, uint16_t blk_size);
502 sd_error_status_type sd_mult_blocks_read(uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks);
503 sd_error_status_type sd_block_write(const uint8_t *buf, long long addr, uint16_t blk_size);
504 sd_error_status_type sd_mult_blocks_write(const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks);
505 sd_error_status_type mmc_stream_read(uint8_t *buf, long long addr, uint32_t len);
506 sd_error_status_type mmc_stream_write(uint8_t *buf, long long addr, uint32_t len);
507 sd_error_status_type sd_irq_service(void);
508void sd_dma_config(uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir);
509
522#ifdef __cplusplus
523}
524#endif
525
526#endif /* __AT32_SDIO_H */
at32f415.h
at32f415 header file
card_type
static sd_memory_card_type card_type
Definition: sd_mmc_card/src/at32_sdio.c:41
rca
static uint32_t rca
Definition: sd_mmc_card/src/at32_sdio.c:42
sd_card_info
sd_card_info_struct_type sd_card_info
Definition: sd_mmc_card/src/at32_sdio.c:47
dma_dir_type
dma_dir_type
dma direction type
Definition: at32f415_dma.h:209
sdio_bus_width_type
sdio_bus_width_type
sdio bus width
Definition: at32f415_sdio.h:139
sd_error_status_type
sd_error_status_type
Definition: sd_mmc_card/inc/at32_sdio.h:74
sd_card_state_type
sd_card_state_type
Definition: sd_mmc_card/inc/at32_sdio.h:187
sd_power_off
sd_error_status_type sd_power_off(void)
turns the sdio output signals off.
Definition: sd_mmc_card/src/at32_sdio.c:395
sd_irq_service
sd_error_status_type sd_irq_service(void)
allows to process all the interrupts that are high.
Definition: sd_mmc_card/src/at32_sdio.c:1782
sd_device_mode_set
sd_error_status_type sd_device_mode_set(uint32_t mode)
set sdio work mode.
Definition: sd_mmc_card/src/at32_sdio.c:778
sd_card_info_get
sd_error_status_type sd_card_info_get(sd_card_info_struct_type *card_info)
returns information about specific card.
Definition: sd_mmc_card/src/at32_sdio.c:524
mmc_stream_write
sd_error_status_type mmc_stream_write(uint8_t *buf, long long addr, uint32_t len)
write mmc card data stream.
Definition: sd_mmc_card/src/at32_sdio.c:1693
sd_card_init
sd_error_status_type sd_card_init(void)
intialises all cards or single card as the case may be card(s) come into standby state.
Definition: sd_mmc_card/src/at32_sdio.c:409
sd_block_read
sd_error_status_type sd_block_read(uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma ...
Definition: sd_mmc_card/src/at32_sdio.c:1180
sd_deselect_select
sd_error_status_type sd_deselect_select(uint32_t addr)
selects od deselects the corresponding card.
Definition: sd_mmc_card/src/at32_sdio.c:799
sdio_clock_set
void sdio_clock_set(uint32_t clkdiv)
set sdio clock devision factor.
Definition: sd_mmc_card/src/at32_sdio.c:174
sd_blocks_erase
sd_error_status_type sd_blocks_erase(long long addr, uint32_t nblks)
erase continuous data block
Definition: sd_mmc_card/src/at32_sdio.c:1022
sd_mult_blocks_write
sd_error_status_type sd_mult_blocks_write(const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed ...
Definition: sd_mmc_card/src/at32_sdio.c:1482
sd_state_get
sd_card_state_type sd_state_get(void)
returns information about sd card.
Definition: sd_mmc_card/src/at32_sdio.c:2482
sd_dma_config
void sd_dma_config(uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
set dma configuation for sdio
Definition: sd_mmc_card/src/at32_sdio.c:2699
sd_block_write
sd_error_status_type sd_block_write(const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be manag...
Definition: sd_mmc_card/src/at32_sdio.c:1360
sd_status_send
sd_error_status_type sd_status_send(uint32_t *p_card_status)
read current card status.
Definition: sd_mmc_card/src/at32_sdio.c:2445
sd_init
sd_error_status_type sd_init(void)
initializes the sd card and put it into standby state (ready for data transfer).
Definition: sd_mmc_card/src/at32_sdio.c:71
mmc_stream_read
sd_error_status_type mmc_stream_read(uint8_t *buf, long long addr, uint32_t len)
read mmc card data stream.
Definition: sd_mmc_card/src/at32_sdio.c:1646
sd_power_on
sd_error_status_type sd_power_on(void)
enquires cards about their operating voltage and configures clock controls.
Definition: sd_mmc_card/src/at32_sdio.c:189
sd_mult_blocks_read
sd_error_status_type sd_mult_blocks_read(uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mod...
Definition: sdio_fatfs/src/at32_sdio.c:1276
sd_wide_bus_operation_config
sd_error_status_type sd_wide_bus_operation_config(sdio_bus_width_type mode)
enable wide bus opeartion for the requeseted card if supported by card.
Definition: sd_mmc_card/src/at32_sdio.c:735
sd_data_transfer_mode_type
sd_data_transfer_mode_type
Definition: sdio_fatfs/inc/at32_sdio.h:65
sd_error_status_type
sd_error_status_type
Definition: sdio_fatfs/inc/at32_sdio.h:74
sd_card_state_type
sd_card_state_type
Definition: sdio_fatfs/inc/at32_sdio.h:187
sd_memory_card_type
sd_memory_card_type
Definition: sdio_fatfs/inc/at32_sdio.h:203
SD_TRANSFER_DMA_MODE
@ SD_TRANSFER_DMA_MODE
Definition: sdio_fatfs/inc/at32_sdio.h:67
SD_TRANSFER_POLLING_MODE
@ SD_TRANSFER_POLLING_MODE
Definition: sdio_fatfs/inc/at32_sdio.h:66
SD_ERROR
@ SD_ERROR
Definition: sdio_fatfs/inc/at32_sdio.h:118
SD_WP_ERASE_SKIP
@ SD_WP_ERASE_SKIP
Definition: sdio_fatfs/inc/at32_sdio.h:98
SD_LOCK_UNLOCK_FAILED
@ SD_LOCK_UNLOCK_FAILED
Definition: sdio_fatfs/inc/at32_sdio.h:89
SD_SDIO_UNKNOWN_FUNC
@ SD_SDIO_UNKNOWN_FUNC
Definition: sdio_fatfs/inc/at32_sdio.h:108
SD_DATA_FAIL
@ SD_DATA_FAIL
Definition: sdio_fatfs/inc/at32_sdio.h:77
SD_STREAM_WR_OVERRUN
@ SD_STREAM_WR_OVERRUN
Definition: sdio_fatfs/inc/at32_sdio.h:96
SD_INVALID_PARAMETER
@ SD_INVALID_PARAMETER
Definition: sdio_fatfs/inc/at32_sdio.h:115
SD_CMD_FAIL
@ SD_CMD_FAIL
Definition: sdio_fatfs/inc/at32_sdio.h:76
SD_CMD_OUT_OF_RANGE
@ SD_CMD_OUT_OF_RANGE
Definition: sdio_fatfs/inc/at32_sdio.h:83
SD_UNSUPPORTED_HW
@ SD_UNSUPPORTED_HW
Definition: sdio_fatfs/inc/at32_sdio.h:117
SD_CARD_ECC_FAILED
@ SD_CARD_ECC_FAILED
Definition: sdio_fatfs/inc/at32_sdio.h:92
SD_INTERNAL_ERROR
@ SD_INTERNAL_ERROR
Definition: sdio_fatfs/inc/at32_sdio.h:111
SD_INVALID_ERASE_PARAM
@ SD_INVALID_ERASE_PARAM
Definition: sdio_fatfs/inc/at32_sdio.h:87
SD_CMD_CRC_FAILED
@ SD_CMD_CRC_FAILED
Definition: sdio_fatfs/inc/at32_sdio.h:90
SD_GENERAL_UNKNOWN_ERROR
@ SD_GENERAL_UNKNOWN_ERROR
Definition: sdio_fatfs/inc/at32_sdio.h:94
SD_CARD_ECC_DISABLED
@ SD_CARD_ECC_DISABLED
Definition: sdio_fatfs/inc/at32_sdio.h:99
SD_CARD_CONTROLLER_ERR
@ SD_CARD_CONTROLLER_ERR
Definition: sdio_fatfs/inc/at32_sdio.h:93
SD_ERASE_RESET
@ SD_ERASE_RESET
Definition: sdio_fatfs/inc/at32_sdio.h:100
SD_STREAM_RD_UNDERRUN
@ SD_STREAM_RD_UNDERRUN
Definition: sdio_fatfs/inc/at32_sdio.h:95
SD_UNSUPPORTED_FEATURE
@ SD_UNSUPPORTED_FEATURE
Definition: sdio_fatfs/inc/at32_sdio.h:116
SD_TX_UNDERRUN
@ SD_TX_UNDERRUN
Definition: sdio_fatfs/inc/at32_sdio.h:80
SD_ILLEGAL_CMD
@ SD_ILLEGAL_CMD
Definition: sdio_fatfs/inc/at32_sdio.h:91
SD_SDIO_FUNC_BUSY
@ SD_SDIO_FUNC_BUSY
Definition: sdio_fatfs/inc/at32_sdio.h:106
SD_ADDR_OUT_OF_RANGE
@ SD_ADDR_OUT_OF_RANGE
Definition: sdio_fatfs/inc/at32_sdio.h:103
SD_RX_OVERRUN
@ SD_RX_OVERRUN
Definition: sdio_fatfs/inc/at32_sdio.h:81
SD_SDIO_FUNC_FAILED
@ SD_SDIO_FUNC_FAILED
Definition: sdio_fatfs/inc/at32_sdio.h:107
SD_REQ_PENDING
@ SD_REQ_PENDING
Definition: sdio_fatfs/inc/at32_sdio.h:113
SD_REQ_NOT_APPLICABLE
@ SD_REQ_NOT_APPLICABLE
Definition: sdio_fatfs/inc/at32_sdio.h:114
SD_SWITCH_ERROR
@ SD_SWITCH_ERROR
Definition: sdio_fatfs/inc/at32_sdio.h:104
SD_INVALID_VOLTRANGE
@ SD_INVALID_VOLTRANGE
Definition: sdio_fatfs/inc/at32_sdio.h:102
SD_SDIO_DISABLED
@ SD_SDIO_DISABLED
Definition: sdio_fatfs/inc/at32_sdio.h:105
SD_DATA_TIMEOUT
@ SD_DATA_TIMEOUT
Definition: sdio_fatfs/inc/at32_sdio.h:79
SD_ADDR_MISALIGNED
@ SD_ADDR_MISALIGNED
Definition: sdio_fatfs/inc/at32_sdio.h:84
SD_START_BIT_ERR
@ SD_START_BIT_ERR
Definition: sdio_fatfs/inc/at32_sdio.h:82
SD_NOT_CONFIGURED
@ SD_NOT_CONFIGURED
Definition: sdio_fatfs/inc/at32_sdio.h:112
SD_CID_CSD_OVERWRITE
@ SD_CID_CSD_OVERWRITE
Definition: sdio_fatfs/inc/at32_sdio.h:97
SD_WR_PROTECT_VIOLATION
@ SD_WR_PROTECT_VIOLATION
Definition: sdio_fatfs/inc/at32_sdio.h:88
SD_CMD_RSP_TIMEOUT
@ SD_CMD_RSP_TIMEOUT
Definition: sdio_fatfs/inc/at32_sdio.h:78
SD_BLK_LEN_ERR
@ SD_BLK_LEN_ERR
Definition: sdio_fatfs/inc/at32_sdio.h:85
SD_OK
@ SD_OK
Definition: sdio_fatfs/inc/at32_sdio.h:119
SD_ERASE_SEQ_ERR
@ SD_ERASE_SEQ_ERR
Definition: sdio_fatfs/inc/at32_sdio.h:86
SD_AKE_SEQ_ERROR
@ SD_AKE_SEQ_ERROR
Definition: sdio_fatfs/inc/at32_sdio.h:101
SD_CARD_TRANSFER
@ SD_CARD_TRANSFER
Definition: sdio_fatfs/inc/at32_sdio.h:191
SD_CARD_IDENTIFICATION
@ SD_CARD_IDENTIFICATION
Definition: sdio_fatfs/inc/at32_sdio.h:189
SD_CARD_SENDING
@ SD_CARD_SENDING
Definition: sdio_fatfs/inc/at32_sdio.h:192
SD_CARD_STANDBY
@ SD_CARD_STANDBY
Definition: sdio_fatfs/inc/at32_sdio.h:190
SD_CARD_READY
@ SD_CARD_READY
Definition: sdio_fatfs/inc/at32_sdio.h:188
SD_CARD_DISCONNECTED
@ SD_CARD_DISCONNECTED
Definition: sdio_fatfs/inc/at32_sdio.h:195
SD_CARD_ERROR
@ SD_CARD_ERROR
Definition: sdio_fatfs/inc/at32_sdio.h:196
SDIO_SDIO_CARD
@ SDIO_SDIO_CARD
Definition: sdio_fatfs/inc/at32_sdio.h:212
SDIO_HIGH_CAPACITY_SD_CARD
@ SDIO_HIGH_CAPACITY_SD_CARD
Definition: sdio_fatfs/inc/at32_sdio.h:206
SDIO_SECURE_DIGITAL_IO_COMBO_CARD
@ SDIO_SECURE_DIGITAL_IO_COMBO_CARD
Definition: sdio_fatfs/inc/at32_sdio.h:210
SDIO_HIGH_SPEED_MULTIMEDIA_CARD
@ SDIO_HIGH_SPEED_MULTIMEDIA_CARD
Definition: sdio_fatfs/inc/at32_sdio.h:209
SDIO_STD_CAPACITY_SD_CARD_V1_1
@ SDIO_STD_CAPACITY_SD_CARD_V1_1
Definition: sdio_fatfs/inc/at32_sdio.h:204
SDIO_SECURE_DIGITAL_IO_CARD
@ SDIO_SECURE_DIGITAL_IO_CARD
Definition: sdio_fatfs/inc/at32_sdio.h:208
SDIO_STD_CAPACITY_SD_CARD_V2_0
@ SDIO_STD_CAPACITY_SD_CARD_V2_0
Definition: sdio_fatfs/inc/at32_sdio.h:205
SDIO_MULTIMEDIA_CARD
@ SDIO_MULTIMEDIA_CARD
Definition: sdio_fatfs/inc/at32_sdio.h:207
SDIO_HIGH_CAPACITY_MMC_CARD
@ SDIO_HIGH_CAPACITY_MMC_CARD
Definition: sdio_fatfs/inc/at32_sdio.h:211
SD_CARD_RECEIVING
#define SD_CARD_RECEIVING
Definition: sdio_fatfs/inc/at32_sdio.h:402
SD_CARD_PROGRAMMING
#define SD_CARD_PROGRAMMING
Definition: sdio_fatfs/inc/at32_sdio.h:401
sd_card_info_struct_type
Definition: sd_mmc_card/inc/at32_sdio.h:237
sd_cid_struct_type
Definition: sd_mmc_card/inc/at32_sdio.h:170
sd_csd_struct_type
Definition: sd_mmc_card/inc/at32_sdio.h:126
sd_scr_struct_type
Definition: sd_mmc_card/inc/at32_sdio.h:219


AT32F415 Firmwary Library: at32_sdio.c Source File

  • sdio
  • sdio_fatfs
  • src
sdio_fatfs/src/at32_sdio.c
Go to the documentation of this file.
1
28#include <string.h>
29#include "at32_sdio.h"
30
39 sdio_command_struct_type sdio_command_init_struct;
40 sdio_data_struct_type sdio_data_init_struct;
41
42static sd_memory_card_type card_type = SDIO_STD_CAPACITY_SD_CARD_V1_1; /* sd card type */
43static uint32_t csd_table[4], cid_table[4], rca = 0; /* csd, sid, rca */
44static sd_data_transfer_mode_type device_mode = SD_TRANSFER_POLLING_MODE; /* working mode */
45static uint8_t stop_flag = 0; /* transmit stop flag */
46volatile sd_error_status_type transfer_error = SD_OK; /* transmit error flag */
47volatile uint8_t transfer_end = 0; /* transmit end flag */
48 sd_card_info_struct_type sd_card_info; /* sd card information */
49
50 sd_error_status_type command_error(void);
51 sd_error_status_type command_rsp1_error(uint8_t cmd);
52 sd_error_status_type command_rsp2_error(void);
53 sd_error_status_type command_rsp3_error(void);
54 sd_error_status_type command_rsp4_error(uint8_t cmd);
55 sd_error_status_type command_rsp5_error(uint8_t cmd);
56 sd_error_status_type command_rsp6_error(uint8_t cmd, uint16_t *p_rca);
57 sd_error_status_type command_rsp7_error(void);
58 sd_error_status_type sd_bus_wide_enable(confirm_state new_state);
59 sd_error_status_type mmc_switch(uint8_t set, uint8_t index, uint8_t value);
60 sd_error_status_type sd_switch(uint32_t mode, uint32_t group, uint8_t value, uint8_t *rsp);
61 sd_error_status_type check_card_programming(uint8_t *p_status);
62 sd_error_status_type speed_change(uint8_t speed);
63 sd_error_status_type scr_find(void);
64uint8_t convert_from_bytes_to_power_of_two(uint16_t number_of_bytes);
65
72 sd_error_status_type sd_init(void)
73{
74 uint16_t clkdiv = 0;
75 sd_error_status_type status = SD_OK;
76 gpio_init_type gpio_init_struct = {0};
77
78 /* gpioc and gpiod periph clock enable */
79 crm_periph_clock_enable(CRM_GPIOC_PERIPH_CLOCK, TRUE);
80 crm_periph_clock_enable(CRM_GPIOD_PERIPH_CLOCK, TRUE);
81
82 /* sdio periph clock enable */
83 crm_periph_clock_enable(CRM_SDIO1_PERIPH_CLOCK, TRUE);
84
85 /* configure pc.08, pc.09, pc.10, pc.11, pc.12 pin: d0, d1, d2, d3, clk pin */
86 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
87 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
88 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
89 gpio_init_struct.gpio_pins = GPIO_PINS_8 | GPIO_PINS_9 | GPIO_PINS_10 | GPIO_PINS_11 | GPIO_PINS_12;
90 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
91 gpio_init(GPIOC, &gpio_init_struct);
92
93 /* configure pd.02 cmd line */
94 gpio_init_struct.gpio_pins = GPIO_PINS_2;
95 gpio_init(GPIOD, &gpio_init_struct);
96
97 /* reset sdio */
98 sdio_reset(SDIOx);
99
100 /* power on */
101 status = sd_power_on();
102
103 if(status == SD_OK)
104 {
105 /* sdio card initialize */
106 status = sd_card_init();
107 }
108
109 if(status == SD_OK)
110 {
111 /* get card information*/
112 status = sd_card_info_get(&sd_card_info);
113 }
114
115 if((SDIO_MULTIMEDIA_CARD == card_type) && (sd_card_info.sd_csd_reg.spec_version >= 4))
116 {
117 card_type = SDIO_HIGH_SPEED_MULTIMEDIA_CARD;
118 }
119
120 if(status == SD_OK)
121 {
122 /* select card */
123 status = sd_deselect_select((uint32_t)(sd_card_info.rca << 16));
124 }
125
126 if(status == SD_OK && ((SDIO_STD_CAPACITY_SD_CARD_V1_1 == card_type) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == card_type) || \
127 (SDIO_SECURE_DIGITAL_IO_COMBO_CARD == card_type) || (SDIO_HIGH_CAPACITY_SD_CARD == card_type)))
128 {
129 status = scr_find();
130 }
131
132 if(status == SD_OK)
133 {
134 /* set normal speed */
135 status = speed_change(0);
136 }
137
138 if((status == SD_OK) || (card_type == SDIO_MULTIMEDIA_CARD))
139 {
140 if(sd_card_info.card_type == SDIO_STD_CAPACITY_SD_CARD_V1_1 || sd_card_info.card_type == SDIO_STD_CAPACITY_SD_CARD_V2_0)
141 {
142 /* set sdio_ck to 4mhz */
143 clkdiv = system_core_clock / 4000000;
144
145 if(clkdiv >= 2)
146 {
147 clkdiv -= 2;
148 }
149 }
150 else
151 {
152 /* set sdio_ck to 4mhz */
153 clkdiv = system_core_clock / 4000000;
154
155 if(clkdiv >= 2)
156 {
157 clkdiv -= 2;
158 }
159 }
160 /* set sdio clock divider */
161 sdio_clock_set(clkdiv);
162
163 /* set transfer mode */
164 status = sd_device_mode_set(SD_TRANSFER_DMA_MODE);
165 }
166
167 if(status == SD_OK)
168 {
169 /* Set data width */
170 status = sd_wide_bus_operation_config(SDIO_BUS_WIDTH_D4);
171 }
172
173 return status;
174}
175
181void sdio_clock_set(uint32_t clk_div)
182{
183 /* config clock divide [7:0] */
184 SDIOx->clkctrl_bit.clkdiv_l = (clk_div & 0xFF);
185
186 /* config clock divide [9:8] */
187 SDIOx->clkctrl_bit.clkdiv_h = ((clk_div & 0x300) >> 8);
188}
189
196 sd_error_status_type sd_power_on(void)
197{
198 uint8_t retry = 0;
199 sd_error_status_type status = SD_OK;
200 uint32_t response = 0, count = 0, valid_voltage = 0, clk_psc;
201 uint32_t sd_type = SD_STD_CAPACITY;
202
203 /* sdio_ck is less than 400KHz in initialization stage, set to 200KHz */
204 clk_psc = (system_core_clock / 200000) - 2;
205
206 if(clk_psc > 0x3FF)
207 {
208 clk_psc = 0x3FF;
209 }
210
211 /* config sdio clock divide and edge phase */
212 sdio_clock_config(SDIOx, clk_psc, SDIO_CLOCK_EDGE_FALLING);
213 /* config sdio bus width */
214 sdio_bus_width_config(SDIOx, SDIO_BUS_WIDTH_D1);
215 /* disable flow control */
216 sdio_flow_control_enable(SDIOx, FALSE);
217 /* disable clock bypass */
218 sdio_clock_bypass(SDIOx, FALSE);
219 /* disable power saving mode */
220 sdio_power_saving_mode_enable(SDIOx, FALSE);
221
222 /* sdio power on */
223 sdio_power_set(SDIOx, SDIO_POWER_ON);
224 /* enable to output sdio_ck */
225 sdio_clock_enable(SDIOx, TRUE);
226
227 for(retry = 0; retry < 10; retry++)
228 {
229 /* send cmd0, get in idle stage */
230 sdio_command_init_struct.argument = 0x0;
231 sdio_command_init_struct.cmd_index = SD_CMD_GO_IDLE_STATE;
232 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_NO;
233 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
234
235 /* sdio command config */
236 sdio_command_config(SDIOx, &sdio_command_init_struct);
237 /* enable ccsm */
238 sdio_command_state_machine_enable(SDIOx, TRUE);
239
240 /* get command status */
241 status = command_error();
242
243 if(status == SD_OK)
244 {
245 break;
246 }
247 }
248 /* if any errors occured, return status */
249 if(status != SD_OK)
250 {
251 return status;
252 }
253
254 /* send cmd8, check card interface feature */
255 sdio_command_init_struct.argument = SD_CHECK_PATTERN;
256 sdio_command_init_struct.cmd_index = SDIO_SEND_IF_COND;
257 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
258 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
259
260 /* sdio command config */
261 sdio_command_config(SDIOx, &sdio_command_init_struct);
262 /* enable ccsm */
263 sdio_command_state_machine_enable(SDIOx, TRUE);
264
265 /* waiting R7 */
266 status = command_rsp7_error();
267
268 if(status == SD_OK)
269 {
270 /* set card type and sd type */
271 card_type = SDIO_STD_CAPACITY_SD_CARD_V2_0;
272 sd_type = SD_HIGH_CAPACITY;
273 }
274
275 /* send cmd55, check sd version */
276 sdio_command_init_struct.argument = 0x00;
277 sdio_command_init_struct.cmd_index = SD_CMD_APP_CMD;
278 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
279 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
280
281 /* sdio command config */
282 sdio_command_config(SDIOx, &sdio_command_init_struct);
283 /* enable ccsm */
284 sdio_command_state_machine_enable(SDIOx, TRUE);
285
286 /* waiting R1 */
287 status = command_rsp1_error(SD_CMD_APP_CMD);
288
289 /* check sd card or mmc card */
290 if(SD_OK == status)
291 {
292 /* send acmd41, check voltage operation range */
293 while((!valid_voltage) && (count < SD_MAX_VOLT_TRIAL))
294 {
295 /* send cmd55 before acmd41 */
296 sdio_command_init_struct.argument = 0x00;
297 sdio_command_init_struct.cmd_index = SD_CMD_APP_CMD;
298 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
299 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
300
301 /* sdio command config */
302 sdio_command_config(SDIOx, &sdio_command_init_struct);
303 /* enable ccsm */
304 sdio_command_state_machine_enable(SDIOx, TRUE);
305
306 /* waiting R1 */
307 status = command_rsp1_error(SD_CMD_APP_CMD);
308
309 /* if any errors occured, return status */
310 if(status != SD_OK)
311 {
312 return status;
313 }
314
315 /* send acmd41 */
316 sdio_command_init_struct.argument = SD_VOLTAGE_WINDOW_SD | sd_type;
317 sdio_command_init_struct.cmd_index = SD_CMD_SD_APP_OP_COND;
318 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
319 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
320
321 /* sdio command config */
322 sdio_command_config(SDIOx, &sdio_command_init_struct);
323 /* enable ccsm */
324 sdio_command_state_machine_enable(SDIOx, TRUE);
325
326 /* waiting R3 */
327 status = command_rsp3_error();
328
329 /* if any errors occured, return status */
330 if(status != SD_OK)
331 {
332 return status;
333 }
334
335 /* get response1 */
336 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
337
338 /* check sd card power on stage is success or not */
339 valid_voltage = (((response >> 31) == 1) ? 1 : 0);
340 count++;
341 }
342
343 if(count >= SD_MAX_VOLT_TRIAL)
344 {
345 status = SD_INVALID_VOLTRANGE;
346 return status;
347 }
348
349 if(response &= SD_HIGH_CAPACITY)
350 {
351 card_type = SDIO_HIGH_CAPACITY_SD_CARD;
352 }
353 }
354 /* mmc card */
355 else
356 {
357 /* send cmd1 */
358 while((!valid_voltage) && (count < SD_MAX_VOLT_TRIAL))
359 {
360 sdio_command_init_struct.argument = SD_VOLTAGE_WINDOW_MMC;
361 sdio_command_init_struct.cmd_index = SD_CMD_SEND_OP_COND;
362 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
363 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
364
365 /* sdio command config */
366 sdio_command_config(SDIOx, &sdio_command_init_struct);
367 /* enable ccsm */
368 sdio_command_state_machine_enable(SDIOx, TRUE);
369
370 /* waiting R3 */
371 status = command_rsp3_error();
372
373 if(status != SD_OK)
374 {
375 return status;
376 }
377
378 /* get response1 */
379 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
380
381 valid_voltage = (((response >> 31) == 1) ? 1 : 0);
382 count++;
383 }
384
385 if(count >= SD_MAX_VOLT_TRIAL)
386 {
387 status = SD_INVALID_VOLTRANGE;
388 return status;
389 }
390
391 card_type = SDIO_MULTIMEDIA_CARD;
392 }
393
394 return(status);
395}
396
402 sd_error_status_type sd_power_off(void)
403{
404 /* sdio power off */
405 sdio_power_set(SDIOx, SDIO_POWER_OFF);
406
407 return SD_OK;
408}
409
416 sd_error_status_type sd_card_init(void)
417{
418 sd_error_status_type status = SD_OK;
419 uint16_t rca_temp = 0x01;
420
421 /* check power status */
422 if(SDIO_POWER_OFF == sdio_power_status_get(SDIOx))
423 {
424 return SD_REQ_NOT_APPLICABLE;
425 }
426
427 /* check is secure_digital_io_card or not */
428 if(SDIO_SECURE_DIGITAL_IO_CARD != card_type)
429 {
430 /* send cmd2, get cid register */
431 sdio_command_init_struct.argument = 0x0;
432 sdio_command_init_struct.cmd_index = SD_CMD_ALL_SEND_CID;
433 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_LONG;
434 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
435
436 /* sdio command config */
437 sdio_command_config(SDIOx, &sdio_command_init_struct);
438 /* enable ccsm */
439 sdio_command_state_machine_enable(SDIOx, TRUE);
440
441 status = command_rsp2_error();
442 if(status != SD_OK)
443 {
444 return status;
445 }
446
447 cid_table[0] = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
448 cid_table[1] = sdio_response_get(SDIOx, SDIO_RSP2_INDEX);
449 cid_table[2] = sdio_response_get(SDIOx, SDIO_RSP3_INDEX);
450 cid_table[3] = sdio_response_get(SDIOx, SDIO_RSP4_INDEX);
451 }
452
453 /* check card type */
454 if((card_type == SDIO_STD_CAPACITY_SD_CARD_V1_1) || (card_type == SDIO_STD_CAPACITY_SD_CARD_V2_0) || \
455 (card_type == SDIO_SECURE_DIGITAL_IO_COMBO_CARD) || (card_type == SDIO_HIGH_CAPACITY_SD_CARD))
456 {
457 /* send cmd3, get rca */
458 sdio_command_init_struct.argument = 0x00;
459 sdio_command_init_struct.cmd_index = SD_CMD_SET_REL_ADDR;
460 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
461 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
462
463 /* sdio command config */
464 sdio_command_config(SDIOx, &sdio_command_init_struct);
465 /* enable ccsm */
466 sdio_command_state_machine_enable(SDIOx, TRUE);
467
468 status = command_rsp6_error(SD_CMD_SET_REL_ADDR, &rca_temp);
469 if(status != SD_OK)
470 {
471 return status;
472 }
473 }
474
475 /* mmc card */
476 if(card_type == SDIO_MULTIMEDIA_CARD)
477 {
478 /* send cmd3 */
479 sdio_command_init_struct.argument = (uint32_t)(rca_temp << 16);
480 sdio_command_init_struct.cmd_index = SD_CMD_SET_REL_ADDR;
481 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
482 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
483
484 /* sdio command config */
485 sdio_command_config(SDIOx, &sdio_command_init_struct);
486 /* enable ccsm */
487 sdio_command_state_machine_enable(SDIOx, TRUE);
488
489 status = command_rsp2_error();
490 if(status != SD_OK)
491 {
492 return status;
493 }
494 }
495
496 /* check is secure_digital_io_card or not */
497 if(card_type != SDIO_SECURE_DIGITAL_IO_CARD)
498 {
499 rca = rca_temp;
500 sdio_command_init_struct.argument = (uint32_t)(rca << 16);
501 sdio_command_init_struct.cmd_index = SD_CMD_SEND_CSD;
502 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_LONG;
503 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
504
505 /* sdio command config */
506 sdio_command_config(SDIOx, &sdio_command_init_struct);
507 /* enable ccsm */
508 sdio_command_state_machine_enable(SDIOx, TRUE);
509
510 status = command_rsp2_error();
511 if(status != SD_OK)
512 {
513 return status;
514 }
515
516 csd_table[0] = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
517 csd_table[1] = sdio_response_get(SDIOx, SDIO_RSP2_INDEX);
518 csd_table[2] = sdio_response_get(SDIOx, SDIO_RSP3_INDEX);
519 csd_table[3] = sdio_response_get(SDIOx, SDIO_RSP4_INDEX);
520 }
521
522 return SD_OK;
523}
524
531 sd_error_status_type sd_card_info_get(sd_card_info_struct_type *card_info)
532{
533 sd_error_status_type status = SD_OK;
534 uint8_t tmp = 0;
535
536 card_info->card_type = (uint8_t)card_type;
537 card_info->rca = (uint16_t)rca;
538
539 /* byte 0 */
540 tmp = (uint8_t)((csd_table[0] & 0xFF000000) >> 24);
541 card_info->sd_csd_reg.csd_struct = (tmp & 0xC0) >> 6;
542 card_info->sd_csd_reg.spec_version = (tmp & 0x3C) >> 2;
543 card_info->sd_csd_reg.reserved1 = tmp & 0x03;
544
545 /* byte 1 */
546 tmp = (uint8_t)((csd_table[0] & 0x00FF0000) >> 16);
547 card_info->sd_csd_reg.taac = tmp;
548
549 /* byte 2 */
550 tmp = (uint8_t)((csd_table[0] & 0x0000FF00) >> 8);
551 card_info->sd_csd_reg.nsac = tmp;
552
553 /* byte 3 */
554 tmp = (uint8_t)(csd_table[0] & 0x000000FF);
555 card_info->sd_csd_reg.max_bus_clk_freq = tmp;
556
557 /* byte 4 */
558 tmp = (uint8_t)((csd_table[1] & 0xFF000000) >> 24);
559 card_info->sd_csd_reg.card_cmd_classes = tmp << 4;
560
561 /* byte 5 */
562 tmp = (uint8_t)((csd_table[1] & 0x00FF0000) >> 16);
563 card_info->sd_csd_reg.card_cmd_classes |= (tmp & 0xF0) >> 4;
564 card_info->sd_csd_reg.max_read_blk_length = tmp & 0x0F;
565
566 /* byte 6 */
567 tmp = (uint8_t)((csd_table[1] & 0x0000FF00) >> 8);
568 card_info->sd_csd_reg.part_blk_read = (tmp & 0x80) >> 7;
569 card_info->sd_csd_reg.write_blk_misalign = (tmp & 0x40) >> 6;
570 card_info->sd_csd_reg.read_blk_misalign = (tmp & 0x20) >> 5;
571 card_info->sd_csd_reg.dsr_implemented = (tmp & 0x10) >> 4;
572 card_info->sd_csd_reg.reserved2 = 0; /* reserved */
573
574 if((card_type == SDIO_STD_CAPACITY_SD_CARD_V1_1) || (card_type == SDIO_STD_CAPACITY_SD_CARD_V2_0) || (card_type == SDIO_MULTIMEDIA_CARD))
575 {
576 card_info->sd_csd_reg.device_size = (tmp & 0x03) << 10;
577
578 /* byte 7 */
579 tmp = (uint8_t)(csd_table[1] & 0x000000FF);
580 card_info->sd_csd_reg.device_size |= (tmp) << 2;
581
582 /* byte 8 */
583 tmp = (uint8_t)((csd_table[2] & 0xFF000000) >> 24);
584 card_info->sd_csd_reg.device_size |= (tmp & 0xC0) >> 6;
585
586 card_info->sd_csd_reg.max_read_current_vdd_min = (tmp & 0x38) >> 3;
587 card_info->sd_csd_reg.max_read_current_vdd_max = (tmp & 0x07);
588
589 /* byte 9 */
590 tmp = (uint8_t)((csd_table[2] & 0x00FF0000) >> 16);
591 card_info->sd_csd_reg.max_write_current_vdd_min = (tmp & 0xE0) >> 5;
592 card_info->sd_csd_reg.max_write_current_vdd_max = (tmp & 0x1C) >> 2;
593 card_info->sd_csd_reg.device_size_mult = (tmp & 0x03) << 1;
594 /* byte 10 */
595 tmp = (uint8_t)((csd_table[2] & 0x0000FF00) >> 8);
596 card_info->sd_csd_reg.device_size_mult |= (tmp & 0x80) >> 7;
597
598 card_info->card_capacity = (card_info->sd_csd_reg.device_size + 1) ;
599 card_info->card_capacity *= (1 << (card_info->sd_csd_reg.device_size_mult + 2));
600 card_info->card_blk_size = 1 << (card_info->sd_csd_reg.max_read_blk_length);
601 card_info->card_capacity *= card_info->card_blk_size;
602 }
603 else if(card_type == SDIO_HIGH_CAPACITY_SD_CARD)
604 {
605 /* byte 7 */
606 tmp = (uint8_t)(csd_table[1] & 0x000000FF);
607 card_info->sd_csd_reg.device_size = (tmp & 0x3F) << 16;
608
609 /* byte 8 */
610 tmp = (uint8_t)((csd_table[2] & 0xFF000000) >> 24);
611
612 card_info->sd_csd_reg.device_size |= (tmp << 8);
613
614 /* byte 9 */
615 tmp = (uint8_t)((csd_table[2] & 0x00FF0000) >> 16);
616
617 card_info->sd_csd_reg.device_size |= (tmp);
618
619 /* byte 10 */
620 tmp = (uint8_t)((csd_table[2] & 0x0000FF00) >> 8);
621
622 card_info->card_capacity = (uint64_t)(card_info->sd_csd_reg.device_size + 1) * 512 * 1024;
623 card_info->card_blk_size = 512;
624 }
625
626
627 card_info->sd_csd_reg.erase_group_size = (tmp & 0x40) >> 6;
628 card_info->sd_csd_reg.erase_group_size_mult = (tmp & 0x3F) << 1;
629
630 /* byte 11 */
631 tmp = (uint8_t)(csd_table[2] & 0x000000FF);
632 card_info->sd_csd_reg.erase_group_size_mult |= (tmp & 0x80) >> 7;
633 card_info->sd_csd_reg.write_protect_group_size = (tmp & 0x7F);
634
635 /* byte 12 */
636 tmp = (uint8_t)((csd_table[3] & 0xFF000000) >> 24);
637 card_info->sd_csd_reg.write_protect_group_enable = (tmp & 0x80) >> 7;
638 card_info->sd_csd_reg.manufacturer_default_ecc = (tmp & 0x60) >> 5;
639 card_info->sd_csd_reg.write_speed_factor = (tmp & 0x1C) >> 2;
640 card_info->sd_csd_reg.max_write_blk_length = (tmp & 0x03) << 2;
641
642 /* byte 13 */
643 tmp = (uint8_t)((csd_table[3] & 0x00FF0000) >> 16);
644 card_info->sd_csd_reg.max_write_blk_length |= (tmp & 0xC0) >> 6;
645 card_info->sd_csd_reg.part_blk_write = (tmp & 0x20) >> 5;
646 card_info->sd_csd_reg.reserved3 = 0;
647 card_info->sd_csd_reg.content_protect_app = (tmp & 0x01);
648
649 /* byte 14 */
650 tmp = (uint8_t)((csd_table[3] & 0x0000FF00) >> 8);
651 card_info->sd_csd_reg.file_format_group = (tmp & 0x80) >> 7;
652 card_info->sd_csd_reg.copy_flag = (tmp & 0x40) >> 6;
653 card_info->sd_csd_reg.permanent_write_protect = (tmp & 0x20) >> 5;
654 card_info->sd_csd_reg.temp_write_protect = (tmp & 0x10) >> 4;
655 card_info->sd_csd_reg.file_formart = (tmp & 0x0C) >> 2;
656 card_info->sd_csd_reg.ecc_code = (tmp & 0x03);
657
658 /* byte 15 */
659 tmp = (uint8_t)(csd_table[3] & 0x000000FF);
660 card_info->sd_csd_reg.csd_crc = (tmp & 0xFE) >> 1;
661 card_info->sd_csd_reg.reserved4 = 1;
662
663 /* byte 0 */
664 tmp = (uint8_t)((cid_table[0] & 0xFF000000) >> 24);
665 card_info->sd_cid_reg.manufacturer_id = tmp;
666
667 /* byte 1 */
668 tmp = (uint8_t)((cid_table[0] & 0x00FF0000) >> 16);
669 card_info->sd_cid_reg.oem_app_id = tmp << 8;
670
671 /* byte 2 */
672 tmp = (uint8_t)((cid_table[0] & 0x000000FF00) >> 8);
673 card_info->sd_cid_reg.oem_app_id |= tmp;
674
675 /* byte 3 */
676 tmp = (uint8_t)(cid_table[0] & 0x000000FF);
677 card_info->sd_cid_reg.product_name1 = tmp << 24;
678
679 /* byte 4 */
680 tmp = (uint8_t)((cid_table[1] & 0xFF000000) >> 24);
681 card_info->sd_cid_reg.product_name1 |= tmp << 16;
682
683 /* byte 5 */
684 tmp = (uint8_t)((cid_table[1] & 0x00FF0000) >> 16);
685 card_info->sd_cid_reg.product_name1 |= tmp << 8;
686
687 /* byte 6 */
688 tmp = (uint8_t)((cid_table[1] & 0x0000FF00) >> 8);
689 card_info->sd_cid_reg.product_name1 |= tmp;
690
691 /* byte 7 */
692 tmp = (uint8_t)(cid_table[1] & 0x000000FF);
693 card_info->sd_cid_reg.product_name2 = tmp;
694
695 /* byte 8 */
696 tmp = (uint8_t)((cid_table[2] & 0xFF000000) >> 24);
697 card_info->sd_cid_reg.product_reversion = tmp;
698
699 /* byte 9 */
700 tmp = (uint8_t)((cid_table[2] & 0x00FF0000) >> 16);
701 card_info->sd_cid_reg.product_sn = tmp << 24;
702
703 /* byte 10 */
704 tmp = (uint8_t)((cid_table[2] & 0x0000FF00) >> 8);
705 card_info->sd_cid_reg.product_sn |= tmp << 16;
706
707 /* byte 11 */
708 tmp = (uint8_t)(cid_table[2] & 0x000000FF);
709 card_info->sd_cid_reg.product_sn |= tmp << 8;
710
711 /* byte 12 */
712 tmp = (uint8_t)((cid_table[3] & 0xFF000000) >> 24);
713 card_info->sd_cid_reg.product_sn |= tmp;
714
715 /* byte 13 */
716 tmp = (uint8_t)((cid_table[3] & 0x00FF0000) >> 16);
717 card_info->sd_cid_reg.reserved1 |= (tmp & 0xF0) >> 4;
718 card_info->sd_cid_reg.manufact_date = (tmp & 0x0F) << 8;
719
720 /* byte 14 */
721 tmp = (uint8_t)((cid_table[3] & 0x0000FF00) >> 8);
722 card_info->sd_cid_reg.manufact_date |= tmp;
723
724 /* byte 15 */
725 tmp = (uint8_t)(cid_table[3] & 0x000000FF);
726 card_info->sd_cid_reg.cid_crc = (tmp & 0xFE) >> 1;
727 card_info->sd_cid_reg.reserved2 = 1;
728
729 return(status);
730}
731
742 sd_error_status_type sd_wide_bus_operation_config(sdio_bus_width_type mode)
743{
744 sd_error_status_type status = SD_OK;
745
746 if((card_type == SDIO_MULTIMEDIA_CARD) || (card_type == SDIO_HIGH_SPEED_MULTIMEDIA_CARD))
747 {
748 status = mmc_switch(EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, (uint8_t)mode);
749 }
750 else if((card_type == SDIO_STD_CAPACITY_SD_CARD_V1_1) || (card_type == SDIO_STD_CAPACITY_SD_CARD_V2_0) || \
751 (card_type == SDIO_HIGH_CAPACITY_SD_CARD))
752 {
753 if(mode >= 2)
754 {
755 /* not support D8 mode */
756 return SD_UNSUPPORTED_FEATURE;
757 }
758
759 if(SDIO_BUS_WIDTH_D4 == mode)
760 {
761 status = sd_bus_wide_enable(TRUE);
762 }
763 else
764 {
765 status = sd_bus_wide_enable(FALSE);
766 }
767 }
768
769 if(status == SD_OK)
770 {
771 sdio_bus_width_config(SDIOx, mode);
772 }
773
774 return status;
775}
776
785 sd_error_status_type sd_device_mode_set(uint32_t mode)
786{
787 sd_error_status_type status = SD_OK;
788
789 if((mode == SD_TRANSFER_DMA_MODE) || (mode == SD_TRANSFER_POLLING_MODE))
790 {
791 device_mode = (sd_data_transfer_mode_type)mode;
792 }
793 else
794 {
795 status = SD_INVALID_PARAMETER;
796 }
797
798 return status;
799}
800
806 sd_error_status_type sd_deselect_select(uint32_t addr)
807{
808 /* send cmd7, select card */
809 sdio_command_init_struct.argument = addr;
810 sdio_command_init_struct.cmd_index = SD_CMD_SEL_DESEL_CARD;
811 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
812 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_INT;
813
814 /* sdio command config */
815 sdio_command_config(SDIOx, &sdio_command_init_struct);
816 /* enable ccsm */
817 sdio_command_state_machine_enable(SDIOx, TRUE);
818
819 return command_rsp1_error(SD_CMD_SEL_DESEL_CARD);
820}
821
829 sd_error_status_type sdio_command_data_send(sdio_command_struct_type *sdio_cmd_init_t, \
830 sdio_data_struct_type* sdio_data_init_t, uint32_t *buf)
831{
832 sd_error_status_type status = SD_OK;
833 uint32_t count = 0;
834 uint32_t timeout = SDIO_DATATIMEOUT;
835 uint32_t length = 0;
836
837 if(buf == NULL)
838 {
839 return SD_INVALID_PARAMETER;
840 }
841 /* clear dtctrl register */
842 SDIOx->dtcnt = 0x0;
843
844 /* sdio command config */
845 sdio_data_config(SDIOx, sdio_data_init_t);
846 /* enable dcsm */
847 sdio_data_state_machine_enable(SDIOx, TRUE);
848
849 length = sdio_data_init_t->data_length;
850
851 if(device_mode == SD_TRANSFER_DMA_MODE)
852 {
853 if(sdio_data_init_t->transfer_direction == SDIO_DATA_TRANSFER_TO_CONTROLLER)
854 {
855 sd_dma_config(buf, length, DMA_DIR_PERIPHERAL_TO_MEMORY);
856 SDIOx->inten |= SDIO_INTR_STS_READ_MASK;
857 transfer_error = SD_OK;
858 transfer_end = 0;
859 sdio_dma_enable(SDIOx, TRUE);
860 }
861 }
862
863 /* sdio command config */
864 sdio_command_config(SDIOx, sdio_cmd_init_t);
865 /* enable ccsm */
866 sdio_command_state_machine_enable(SDIOx, TRUE);
867
868 status = command_rsp1_error(sdio_cmd_init_t->cmd_index);
869 if(status != SD_OK)
870 {
871 return status;
872 }
873
874 /* polling mode */
875 if(device_mode == SD_TRANSFER_POLLING_MODE)
876 {
877 if(SDIO_DATA_TRANSFER_TO_CONTROLLER == sdio_data_init_t->transfer_direction)
878 {
879 while(!(SDIOx->sts & (SDIO_INTR_STS_READ_MASK)))
880 {
881 if(sdio_flag_get(SDIOx, SDIO_RXBUFH_FLAG) != RESET)
882 {
883 for(count = 0; count < 8; count++, buf++)
884 {
885 *buf = sdio_data_read(SDIOx);
886 }
887
888 timeout = 0x7FFFFF;
889 }
890 else
891 {
892 if(0 == timeout)
893 {
894 sd_init();
895 return SD_DATA_TIMEOUT;
896 }
897
898 timeout--;
899 }
900 }
901
902 while(sdio_flag_get(SDIOx, SDIO_RXBUF_FLAG) != RESET)
903 {
904 *buf = sdio_data_read(SDIOx);
905 buf++;
906 }
907 }
908 else
909 {
910 while(!(SDIOx->sts & SDIO_INTR_STS_WRITE_MASK))
911 {
912 if(sdio_flag_get(SDIOx, SDIO_TXBUFH_FLAG) != RESET)
913 {
914 for(count = 0; count < 8 && length > 0; count++, buf++, length -= 4)
915 {
916 sdio_data_write(SDIOx, *buf);
917 }
918
919 timeout = 0x3FFFFFFF;
920 }
921 else
922 {
923 if(timeout == 0)
924 {
925 sd_init();
926 return SD_DATA_TIMEOUT;
927 }
928
929 timeout--;
930 }
931 }
932 }
933 /* data timeout */
934 if(sdio_flag_get(SDIOx, SDIO_DTTIMEOUT_FLAG) != RESET)
935 {
936 sdio_flag_clear(SDIOx, SDIO_DTTIMEOUT_FLAG);
937 return SD_DATA_TIMEOUT;
938 }
939 /* crc error */
940 else if(sdio_flag_get(SDIOx, SDIO_DTFAIL_FLAG) != RESET)
941 {
942 sdio_flag_clear(SDIOx, SDIO_DTFAIL_FLAG);
943 return SD_DATA_FAIL;
944 }
945 /* over run error */
946 else if(sdio_flag_get(SDIOx, SDIO_RXERRO_FLAG) != RESET)
947 {
948 sdio_flag_clear(SDIOx, SDIO_RXERRO_FLAG);
949 return SD_RX_OVERRUN;
950 }
951 /* under run error */
952 else if(sdio_flag_get(SDIOx, SDIO_TXERRU_FLAG) != RESET)
953 {
954 sdio_flag_clear(SDIOx, SDIO_TXERRU_FLAG);
955 return SD_TX_UNDERRUN;
956 }
957 /* start bit error */
958 else if(sdio_flag_get(SDIOx, SDIO_SBITERR_FLAG) != RESET)
959 {
960 sdio_flag_clear(SDIOx, SDIO_SBITERR_FLAG);
961 return SD_START_BIT_ERR;
962 }
963 /* data transfer complete */
964 if((stop_flag == 1) && (sdio_flag_get(SDIOx, SDIO_DTCMPL_FLAG) != RESET))
965 {
966 /* send cmd12, stop transmission */
967 sdio_cmd_init_t->argument = 0;
968 sdio_cmd_init_t->cmd_index = SD_CMD_STOP_TRANSMISSION;
969 sdio_cmd_init_t->rsp_type = SDIO_RESPONSE_SHORT;
970 sdio_cmd_init_t->wait_type = SDIO_WAIT_FOR_NO;
971
972 /* sdio command config */
973 sdio_command_config(SDIOx, sdio_cmd_init_t);
974 /* enable ccsm */
975 sdio_command_state_machine_enable(SDIOx, TRUE);
976
977 status = command_rsp1_error(SD_CMD_STOP_TRANSMISSION);
978
979 if(status != SD_OK)
980 {
981 return status;
982 }
983 }
984
985 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
986 }
987 else if(device_mode == SD_TRANSFER_DMA_MODE)
988 {
989 if(sdio_data_init_t->transfer_direction == SDIO_DATA_TRANSFER_TO_CARD)
990 {
991 sd_dma_config(buf, length, DMA_DIR_MEMORY_TO_PERIPHERAL);
992 SDIOx->inten |= SDIO_INTR_STS_WRITE_MASK;
993 transfer_error = SD_OK;
994 transfer_end = 0;
995 sdio_dma_enable(SDIOx, TRUE);
996 }
997
998 while(!(SDIOx->sts & SDIOx->inten) && timeout)
999 {
1000 timeout--;
1001
1002 if(transfer_end)
1003 {
1004 break;
1005 }
1006 }
1007
1008 if(timeout == 0)
1009 {
1010 sd_init();
1011 return SD_DATA_TIMEOUT;
1012 }
1013
1014 if(transfer_error != SD_OK)
1015 {
1016 status = transfer_error;
1017 }
1018 }
1019
1020 return status;
1021}
1022
1029 sd_error_status_type sd_blocks_erase(long long addr, uint32_t nblks)
1030{
1031 sd_error_status_type status = SD_OK;
1032 uint32_t start_addr = 0, end_addr = 0, response = 0;
1033 uint8_t card_state;
1034
1035 /* high capacity sd card */
1036 if(card_type == SDIO_HIGH_CAPACITY_SD_CARD)
1037 {
1038 start_addr = addr >> 9;
1039 end_addr = start_addr + nblks - 1;
1040 }
1041 else
1042 {
1043 start_addr = addr;
1044 end_addr = start_addr + (nblks - 1) * 512;
1045 }
1046
1047 /* clear DCSM configuration */
1048 sdio_data_init_struct.block_size = SDIO_DATA_BLOCK_SIZE_1B;
1049 sdio_data_init_struct.data_length = 0 ;
1050 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1051 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1052 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1053
1054 sdio_data_config(SDIOx, &sdio_data_init_struct);
1055 sdio_data_state_machine_enable(SDIOx, FALSE);
1056
1057 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1058
1059 /* check card locked */
1060 if(response & SD_CARD_LOCKED)
1061 {
1062 return SD_LOCK_UNLOCK_FAILED;
1063 }
1064
1065 if(card_type == SDIO_MULTIMEDIA_CARD || card_type == SDIO_HIGH_SPEED_MULTIMEDIA_CARD)
1066 {
1067 /* send cmd35, set erase group start */
1068 sdio_command_init_struct.argument = start_addr;
1069 sdio_command_init_struct.cmd_index = SD_CMD_ERASE_GRP_START;
1070 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1071 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1072
1073 /* sdio command config */
1074 sdio_command_config(SDIOx, &sdio_command_init_struct);
1075 /* enable ccsm */
1076 sdio_command_state_machine_enable(SDIOx, TRUE);
1077
1078 status = command_rsp1_error(SD_CMD_ERASE_GRP_START);
1079
1080 if(status != SD_OK)
1081 {
1082 return status;
1083 }
1084
1085 /* send cmd36, set erase group end */
1086 sdio_command_init_struct.argument = end_addr;
1087 sdio_command_init_struct.cmd_index = SD_CMD_ERASE_GRP_END;
1088
1089 /* sdio command config */
1090 sdio_command_config(SDIOx, &sdio_command_init_struct);
1091 /* enable ccsm */
1092 sdio_command_state_machine_enable(SDIOx, TRUE);
1093
1094 status = command_rsp1_error(SD_CMD_ERASE_GRP_END);
1095
1096 if(status != SD_OK)
1097 {
1098 return status;
1099 }
1100
1101 /* send cmd38, start erase gourp */
1102 sdio_command_init_struct.argument = 0;
1103 sdio_command_init_struct.cmd_index = SD_CMD_ERASE;
1104
1105 /* sdio command config */
1106 sdio_command_config(SDIOx, &sdio_command_init_struct);
1107 /* enable ccsm */
1108 sdio_command_state_machine_enable(SDIOx, TRUE);
1109
1110 status = command_rsp1_error(SD_CMD_ERASE);
1111
1112 if(status != SD_OK)
1113 {
1114 return status;
1115 }
1116 }
1117 else
1118 {
1119 /* send cmd32, set erase block start */
1120 sdio_command_init_struct.argument = start_addr;
1121 sdio_command_init_struct.cmd_index = SD_CMD_SD_ERASE_GRP_START;
1122 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1123 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1124
1125 /* sdio command config */
1126 sdio_command_config(SDIOx, &sdio_command_init_struct);
1127 /* enable ccsm */
1128 sdio_command_state_machine_enable(SDIOx, TRUE);
1129
1130 status = command_rsp1_error(SD_CMD_SD_ERASE_GRP_START);
1131
1132 if(status != SD_OK)
1133 {
1134 return status;
1135 }
1136
1137 /* send cmd33, set erase block end */
1138 sdio_command_init_struct.argument = end_addr;
1139 sdio_command_init_struct.cmd_index = SD_CMD_SD_ERASE_GRP_END;
1140
1141 /* sdio command config */
1142 sdio_command_config(SDIOx, &sdio_command_init_struct);
1143 /* enable ccsm */
1144 sdio_command_state_machine_enable(SDIOx, TRUE);
1145
1146 if(status != SD_OK)
1147 {
1148 return status;
1149 }
1150
1151 /* send cmd38, start erase block */
1152 sdio_command_init_struct.argument = 0;
1153 sdio_command_init_struct.cmd_index = SD_CMD_ERASE;
1154
1155 /* sdio command config */
1156 sdio_command_config(SDIOx, &sdio_command_init_struct);
1157 /* enable ccsm */
1158 sdio_command_state_machine_enable(SDIOx, TRUE);
1159
1160 status = command_rsp1_error(SD_CMD_ERASE);
1161
1162 if(status != SD_OK)
1163 {
1164 return status;
1165 }
1166 }
1167
1168 status = check_card_programming(&card_state);
1169
1170 while((status == SD_OK) && ((card_state == SD_CARD_PROGRAMMING) || \
1171 (card_state == SD_CARD_RECEIVING)))
1172 {
1173 status = check_card_programming(&card_state);
1174 }
1175
1176 return status;
1177}
1178
1187 sd_error_status_type sd_block_read(uint8_t *buf, long long addr, uint16_t blk_size)
1188{
1189 sd_error_status_type status = SD_OK;
1190 uint32_t response = 0;
1191 uint8_t power;
1192
1193 if(NULL == buf)
1194 {
1195 return SD_INVALID_PARAMETER;
1196 }
1197
1198 SDIOx->dtctrl = 0x0;
1199
1200 if(card_type == SDIO_HIGH_CAPACITY_SD_CARD)
1201 {
1202 blk_size = 512;
1203 addr >>= 9;
1204 }
1205
1206 /* clear dcsm configuration */
1207 sdio_data_init_struct.block_size = SDIO_DATA_BLOCK_SIZE_1B;
1208 sdio_data_init_struct.data_length = 0;
1209 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
1210 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1211 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1212
1213 sdio_data_config(SDIOx, &sdio_data_init_struct);
1214 sdio_data_state_machine_enable(SDIOx, FALSE);
1215
1216 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1217
1218 /* check card locked */
1219 if(response & SD_CARD_LOCKED)
1220 {
1221 return SD_LOCK_UNLOCK_FAILED;
1222 }
1223
1224 if((blk_size > 0) && (blk_size <= 2048) && ((blk_size & (blk_size - 1)) == 0))
1225 {
1226 power = convert_from_bytes_to_power_of_two(blk_size);
1227
1228 /* send cmd16, set block size */
1229 sdio_command_init_struct.argument = blk_size;
1230 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCKLEN;
1231 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1232 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1233
1234 /* sdio command config */
1235 sdio_command_config(SDIOx, &sdio_command_init_struct);
1236 /* enable ccsm */
1237 sdio_command_state_machine_enable(SDIOx, TRUE);
1238
1239 status = command_rsp1_error(SD_CMD_SET_BLOCKLEN);
1240
1241 if(status != SD_OK)
1242 {
1243 return status;
1244 }
1245 }
1246 else
1247 {
1248 return SD_INVALID_PARAMETER;
1249 }
1250
1251 sdio_data_init_struct.block_size = (sdio_block_size_type)(power);
1252 sdio_data_init_struct.data_length = blk_size ;
1253 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1254 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CONTROLLER;
1255 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1256
1257 sdio_command_init_struct.argument = addr;
1258 sdio_command_init_struct.cmd_index = SD_CMD_READ_SINGLE_BLOCK;
1259 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1260 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1261
1262 stop_flag = 0;
1263
1264 return sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)buf);
1265}
1266
1276 sd_error_status_type sd_mult_blocks_read(uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
1277{
1278 sd_error_status_type status = SD_OK;
1279 uint32_t response = 0;
1280 uint8_t power;
1281
1282 SDIOx->dtctrl = 0x0;
1283
1284 if(card_type == SDIO_HIGH_CAPACITY_SD_CARD)
1285 {
1286 blk_size = 512;
1287 addr >>= 9;
1288 }
1289
1290 /* clear dcsm configuration */
1291 sdio_data_init_struct.block_size = (sdio_block_size_type)0;
1292 sdio_data_init_struct.data_length = 0;
1293 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
1294 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1295 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1296
1297 sdio_data_config(SDIOx, &sdio_data_init_struct);
1298 sdio_data_state_machine_enable(SDIOx, FALSE);
1299
1300 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1301
1302 /* check card locked */
1303 if(response & SD_CARD_LOCKED)
1304 {
1305 return SD_LOCK_UNLOCK_FAILED;
1306 }
1307
1308 if((blk_size > 0) && (blk_size <= 2048) && ((blk_size & (blk_size - 1)) == 0))
1309 {
1310 power = convert_from_bytes_to_power_of_two(blk_size);
1311
1312 /* send cmd16, set block size */
1313 sdio_command_init_struct.argument = blk_size;
1314 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCKLEN;
1315 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1316 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1317
1318 /* sdio command config */
1319 sdio_command_config(SDIOx, &sdio_command_init_struct);
1320 /* enable ccsm */
1321 sdio_command_state_machine_enable(SDIOx, TRUE);
1322
1323 status = command_rsp1_error(SD_CMD_SET_BLOCKLEN);
1324
1325 if(status != SD_OK)
1326 {
1327 return status;
1328 }
1329 }
1330 else
1331 {
1332 return SD_INVALID_PARAMETER;
1333 }
1334
1335 /* check max receive length */
1336 if(nblks * blk_size > SD_MAX_DATA_LENGTH)
1337 {
1338 return SD_INVALID_PARAMETER;
1339 }
1340
1341 sdio_data_init_struct.block_size = (sdio_block_size_type)(power);
1342 sdio_data_init_struct.data_length = nblks * blk_size ;
1343 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1344 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CONTROLLER;
1345 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1346
1347 /* send cmd18, read block data */
1348 sdio_command_init_struct.argument = addr;
1349 sdio_command_init_struct.cmd_index = SD_CMD_READ_MULT_BLOCK;
1350 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1351 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1352
1353 stop_flag = 1;
1354
1355 return sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)buf);
1356}
1357
1366 sd_error_status_type sd_block_write(const uint8_t *buf, long long addr, uint16_t blk_size)
1367{
1368 sd_error_status_type status = SD_OK;
1369 uint8_t power = 0, card_state = 0;
1370 uint32_t timeout = 0, card_status = 0, response = 0;
1371
1372 if(buf == NULL)
1373 {
1374 return SD_INVALID_PARAMETER;
1375 }
1376
1377 SDIOx->dtctrl = 0x0;
1378
1379 /* clear dcsm configuration */
1380 sdio_data_init_struct.block_size = (sdio_block_size_type)0;
1381 sdio_data_init_struct.data_length = 0;
1382 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
1383 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1384 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1385
1386 sdio_data_config(SDIOx, &sdio_data_init_struct);
1387 sdio_data_state_machine_enable(SDIOx, FALSE);
1388
1389 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1390
1391 /* check card locked */
1392 if(response & SD_CARD_LOCKED)
1393 {
1394 return SD_LOCK_UNLOCK_FAILED;
1395 }
1396
1397 if(card_type == SDIO_HIGH_CAPACITY_SD_CARD)
1398 {
1399 blk_size = 512;
1400 addr >>= 9;
1401 }
1402
1403 if((blk_size > 0) && (blk_size <= 2048) && ((blk_size & (blk_size - 1)) == 0))
1404 {
1405 power = convert_from_bytes_to_power_of_two(blk_size);
1406
1407 /* send cmd16, set block size */
1408 sdio_command_init_struct.argument = blk_size;
1409 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCKLEN;
1410 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1411 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1412
1413 /* sdio command config */
1414 sdio_command_config(SDIOx, &sdio_command_init_struct);
1415 /* enable ccsm */
1416 sdio_command_state_machine_enable(SDIOx, TRUE);
1417
1418 status = command_rsp1_error(SD_CMD_SET_BLOCKLEN);
1419
1420 if(status != SD_OK)
1421 {
1422 return status;
1423 }
1424 }
1425 else
1426 {
1427 return SD_INVALID_PARAMETER;
1428 }
1429
1430 timeout = SD_DATATIMEOUT;
1431
1432 do
1433 {
1434 timeout--;
1435 status = sd_status_send(&card_status);
1436 }
1437 /* check ready_for_data flag */
1438 while(((card_status & 0x00000100) == 0) && (timeout > 0));
1439
1440 if(timeout == 0)
1441 {
1442 return SD_ERROR;
1443 }
1444
1445 /* send cmd24, write single block */
1446 sdio_command_init_struct.argument = addr;
1447 sdio_command_init_struct.cmd_index = SD_CMD_WRITE_SINGLE_BLOCK;
1448 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1449 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1450
1451 sdio_data_init_struct.block_size = (sdio_block_size_type)(power);
1452 sdio_data_init_struct.data_length = blk_size;
1453 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
1454 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1455 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1456
1457 stop_flag = 0;
1458
1459 /* single block, stop command is unnecessary */
1460 status = sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)buf);
1461
1462 if(status != SD_OK)
1463 {
1464 return status;
1465 }
1466
1467 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
1468
1469 status = check_card_programming(&card_state);
1470
1471 while((status == SD_OK) && ((card_state == SD_CARD_PROGRAMMING) || (card_state == SD_CARD_RECEIVING)))
1472 {
1473 status = check_card_programming(&card_state);
1474 }
1475
1476 return status;
1477}
1478
1488 sd_error_status_type sd_mult_blocks_write(const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
1489{
1490 sd_error_status_type status = SD_OK;
1491 uint8_t power = 0, card_state = 0;
1492 uint32_t timeout = 0, card_status = 0, response = 0;;
1493
1494 if(buf == NULL)
1495 {
1496 return SD_INVALID_PARAMETER;
1497 }
1498
1499 SDIOx->dtctrl = 0x0;
1500
1501 /* clear dcsm configuration */
1502 sdio_data_init_struct.block_size = (sdio_block_size_type)0;
1503 sdio_data_init_struct.data_length = 0;
1504 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
1505 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1506 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1507
1508 sdio_data_config(SDIOx, &sdio_data_init_struct);
1509 sdio_data_state_machine_enable(SDIOx, FALSE);
1510
1511 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1512
1513 /* check card locked */
1514 if(response & SD_CARD_LOCKED)
1515 {
1516 return SD_LOCK_UNLOCK_FAILED;
1517 }
1518
1519 if(card_type == SDIO_HIGH_CAPACITY_SD_CARD)
1520 {
1521 blk_size = 512;
1522 addr >>= 9;
1523 }
1524
1525 if((blk_size > 0) && (blk_size <= 2048) && ((blk_size & (blk_size - 1)) == 0))
1526 {
1527 power = convert_from_bytes_to_power_of_two(blk_size);
1528
1529 /* send cmd16, set block size */
1530 sdio_command_init_struct.argument = blk_size;
1531 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCKLEN;
1532 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1533 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1534
1535 /* sdio command config */
1536 sdio_command_config(SDIOx, &sdio_command_init_struct);
1537 /* enable ccsm */
1538 sdio_command_state_machine_enable(SDIOx, TRUE);
1539
1540 status = command_rsp1_error(SD_CMD_SET_BLOCKLEN);
1541
1542 if(status != SD_OK)
1543 {
1544 return status;
1545 }
1546 }
1547 else
1548 {
1549 return SD_INVALID_PARAMETER;
1550 }
1551
1552 if((nblks * blk_size) > SD_MAX_DATA_LENGTH)
1553 {
1554 return SD_INVALID_PARAMETER;
1555 }
1556
1557 timeout = SD_DATATIMEOUT;
1558
1559 do
1560 {
1561 timeout--;
1562 status = sd_status_send(&card_status);
1563 }
1564 /* check ready_for_data flag */
1565 while(((card_status & 0x00000100) == 0) && (timeout > 0));
1566
1567 if(timeout == 0)
1568 {
1569 return SD_ERROR;
1570 }
1571
1572 if((card_type == SDIO_STD_CAPACITY_SD_CARD_V1_1) || (card_type == SDIO_STD_CAPACITY_SD_CARD_V2_0) || \
1573 (card_type == SDIO_HIGH_CAPACITY_SD_CARD))
1574 {
1575 /* send cmd55 */
1576 sdio_command_init_struct.argument = (uint32_t)rca << 16;
1577 sdio_command_init_struct.cmd_index = SD_CMD_APP_CMD;
1578 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1579 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1580
1581 /* sdio command config */
1582 sdio_command_config(SDIOx, &sdio_command_init_struct);
1583 /* enable ccsm */
1584 sdio_command_state_machine_enable(SDIOx, TRUE);
1585
1586 status = command_rsp1_error(SD_CMD_APP_CMD);
1587
1588 if(status != SD_OK)
1589 {
1590 return status;
1591 }
1592
1593 /* send cmd23, set block count */
1594 sdio_command_init_struct.argument = blk_size;
1595 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCK_COUNT;
1596 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1597 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1598
1599 /* sdio command config */
1600 sdio_command_config(SDIOx, &sdio_command_init_struct);
1601 /* enable ccsm */
1602 sdio_command_state_machine_enable(SDIOx, TRUE);
1603
1604 status = command_rsp1_error(SD_CMD_SET_BLOCK_COUNT);
1605
1606 if(status != SD_OK)
1607 {
1608 return status;
1609 }
1610 }
1611
1612 /* send cmd25, write mult blocks */
1613 sdio_command_init_struct.argument = addr;
1614 sdio_command_init_struct.cmd_index = SD_CMD_WRITE_MULT_BLOCK;
1615 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1616 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1617
1618 sdio_data_init_struct.block_size = (sdio_block_size_type)(power);
1619 sdio_data_init_struct.data_length = nblks * blk_size ;
1620 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1621 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1622 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
1623
1624 stop_flag = 1;
1625 /* cmd12 is needed */
1626 status = sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)buf);
1627
1628 if(status != SD_OK)
1629 {
1630 return status;
1631 }
1632
1633 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
1634
1635 status = check_card_programming(&card_state);
1636
1637 while((status == SD_OK) && ((card_state == SD_CARD_PROGRAMMING) || (card_state == SD_CARD_RECEIVING)))
1638 {
1639 status = check_card_programming(&card_state);
1640 }
1641
1642 return status;
1643}
1644
1652 sd_error_status_type mmc_stream_read(uint8_t *buf, long long addr, uint32_t len)
1653{
1654 uint32_t response = 0;
1655
1656 SDIOx->dtctrl = 0x0;
1657
1658 /* clear DCSM configuration */
1659 sdio_data_init_struct.block_size = SDIO_DATA_BLOCK_SIZE_1B;
1660 sdio_data_init_struct.data_length = 0 ;
1661 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1662 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1663 sdio_data_init_struct.transfer_mode = SDIO_DATA_STREAM_TRANSFER;
1664
1665 sdio_data_config(SDIOx, &sdio_data_init_struct);
1666 sdio_data_state_machine_enable(SDIOx, FALSE);
1667
1668 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1669
1670 /* check card locked */
1671 if(response & SD_CARD_LOCKED)
1672 {
1673 return SD_LOCK_UNLOCK_FAILED;
1674 }
1675 /* send cmd11, read data */
1676 sdio_command_init_struct.argument = addr;
1677 sdio_command_init_struct.cmd_index = SD_CMD_READ_DAT_UNTIL_STOP;
1678 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1679 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1680
1681 sdio_data_init_struct.block_size = (sdio_block_size_type)(5 << 4);
1682 sdio_data_init_struct.data_length = len;
1683 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1684 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CONTROLLER;
1685 sdio_data_init_struct.transfer_mode = SDIO_DATA_STREAM_TRANSFER;
1686
1687 stop_flag = 1;
1688 /* cmd12 is needed */
1689 return sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)buf);
1690}
1691
1699 sd_error_status_type mmc_stream_write(uint8_t *buf, long long addr, uint32_t len)
1700{
1701 sd_error_status_type status = SD_OK;
1702 uint32_t response = 0;
1703 uint8_t card_state = 0;
1704
1705 if(buf == NULL)
1706 {
1707 return SD_INVALID_PARAMETER;
1708 }
1709
1710 SDIOx->dtctrl = 0x0;
1711
1712 /* clear dcsm configuration */
1713 sdio_data_init_struct.block_size = SDIO_DATA_BLOCK_SIZE_1B;
1714 sdio_data_init_struct.data_length = 0;
1715 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
1716 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1717 sdio_data_init_struct.transfer_mode = SDIO_DATA_STREAM_TRANSFER;
1718
1719 sdio_data_config(SDIOx, &sdio_data_init_struct);
1720 sdio_data_state_machine_enable(SDIOx, FALSE);
1721
1722 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
1723
1724 /* check card locked */
1725 if(response & SD_CARD_LOCKED)
1726 {
1727 return SD_LOCK_UNLOCK_FAILED;
1728 }
1729 /* send cmd20, write data */
1730 sdio_command_init_struct.argument = addr;
1731 sdio_command_init_struct.cmd_index = SD_CMD_WRITE_DAT_UNTIL_STOP;
1732 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1733 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1734
1735
1736 sdio_data_init_struct.block_size = (sdio_block_size_type)(15 << 4);
1737 sdio_data_init_struct.data_length = len;
1738 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
1739 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CARD;
1740 sdio_data_init_struct.transfer_mode = SDIO_DATA_STREAM_TRANSFER;
1741
1742 stop_flag = 1;
1743 /* cmd12 is needed */
1744 status = sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)buf);
1745
1746 if(status != SD_OK)
1747 {
1748 return status;
1749 }
1750
1751 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
1752
1753 status = check_card_programming(&card_state);
1754
1755 while((status == SD_OK) && ((card_state == SD_CARD_PROGRAMMING) || (card_state == SD_CARD_RECEIVING)))
1756 {
1757 status = check_card_programming(&card_state);
1758 }
1759
1760 return status;
1761}
1762
1768void SDIO1_IRQHandler(void)
1769{
1770 sd_irq_service();
1771}
1772
1778void SDIO2_IRQHandler(void)
1779{
1780 sd_irq_service();
1781}
1782
1788 sd_error_status_type sd_irq_service(void)
1789{
1790 if(sdio_flag_get(SDIOx, SDIO_DTCMPL_FLAG) != RESET)
1791 {
1792 if(stop_flag == 1)
1793 {
1794 /* send cmd12, stop transmission */
1795 sdio_command_init_struct.argument = 0;
1796 sdio_command_init_struct.cmd_index = SD_CMD_STOP_TRANSMISSION;
1797 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
1798 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
1799 /* sdio command config */
1800 sdio_command_config(SDIOx, &sdio_command_init_struct);
1801 /* enable ccsm */
1802 sdio_command_state_machine_enable(SDIOx, TRUE);
1803 transfer_error = command_rsp1_error(SD_CMD_STOP_TRANSMISSION);
1804 }
1805 else
1806 {
1807 transfer_error = SD_OK;
1808 }
1809 /* clear flag */
1810 sdio_flag_clear(SDIOx, SDIO_DTCMPL_FLAG);
1811 transfer_end = 1;
1812 return transfer_error;
1813 }
1814
1815 if(sdio_flag_get(SDIOx, SDIO_DTFAIL_FLAG) != RESET)
1816 {
1817 /* clear flag */
1818 sdio_flag_clear(SDIOx, SDIO_DTFAIL_FLAG);
1819 transfer_error = SD_DATA_FAIL;
1820 transfer_end = 1;
1821 return transfer_error;
1822 }
1823
1824 if(sdio_flag_get(SDIOx, SDIO_DTTIMEOUT_FLAG) != RESET)
1825 {
1826 /* clear flag */
1827 sdio_flag_clear(SDIOx, SDIO_DTTIMEOUT_FLAG);
1828 transfer_error = SD_DATA_TIMEOUT;
1829 transfer_end = 1;
1830 return transfer_error;
1831 }
1832
1833 if(sdio_flag_get(SDIOx, SDIO_RXERRO_FLAG) != RESET)
1834 {
1835 /* clear flag */
1836 sdio_flag_clear(SDIOx, SDIO_RXERRO_FLAG);
1837 transfer_error = SD_RX_OVERRUN;
1838 transfer_end = 1;
1839 return(SD_RX_OVERRUN);
1840 }
1841
1842 if(sdio_flag_get(SDIOx, SDIO_TXERRU_FLAG) != RESET)
1843 {
1844 /* clear flag */
1845 sdio_flag_clear(SDIOx, SDIO_TXERRU_FLAG);
1846 transfer_error = SD_TX_UNDERRUN;
1847 transfer_end = 1;
1848 return(SD_TX_UNDERRUN);
1849 }
1850
1851 if(sdio_flag_get(SDIOx, SDIO_SBITERR_FLAG) != RESET)
1852 {
1853 /* clear flag */
1854 sdio_flag_clear(SDIOx, SDIO_SBITERR_FLAG);
1855 transfer_error = SD_START_BIT_ERR;
1856 transfer_end = 1;
1857 return(SD_START_BIT_ERR);
1858 }
1859
1860 /* disable interrupt */
1861 sdio_interrupt_enable(SDIOx, (SDIO_DTFAIL_INT | SDIO_DTTIMEOUT_INT | \
1862 SDIO_DTCMP_INT | SDIO_TXBUFH_INT | SDIO_RXBUFH_INT | \
1863 SDIO_TXERRU_INT| SDIO_RXERRO_INT | SDIO_SBITERR_INT), FALSE);
1864 return(SD_OK);
1865}
1866
1872 sd_error_status_type command_error(void)
1873{
1874 sd_error_status_type status = SD_OK;
1875 uint32_t timeout = SDIO_CMD0TIMEOUT;
1876
1877 while(timeout--)
1878 {
1879 if(sdio_flag_get(SDIOx, SDIO_CMDCMPL_FLAG) != RESET)
1880 {
1881 break;
1882 }
1883 }
1884
1885 if(timeout == 0)
1886 {
1887 return SD_CMD_RSP_TIMEOUT;
1888 }
1889
1890 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
1891 return status;
1892}
1893
1899 sd_error_status_type command_rsp7_error(void)
1900{
1901 sd_error_status_type status = SD_OK;
1902 uint32_t sts_reg = 0;
1903 uint32_t timeout = SDIO_CMD0TIMEOUT;
1904
1905 while(timeout--)
1906 {
1907 sts_reg = SDIOx->sts;
1908
1909 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
1910 {
1911 break;
1912 }
1913 }
1914
1915 if((timeout == 0) || (sts_reg & SDIO_CMDTIMEOUT_FLAG))
1916 {
1917 status = SD_CMD_RSP_TIMEOUT;
1918 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
1919 return status;
1920 }
1921
1922 if(sts_reg & SDIO_CMDRSPCMPL_FLAG)
1923 {
1924 status = SD_OK;
1925 sdio_flag_clear(SDIOx, SDIO_CMDRSPCMPL_FLAG);
1926 }
1927
1928 return status;
1929}
1930
1936 sd_error_status_type command_rsp1_error(uint8_t cmd)
1937{
1938 uint32_t sts_reg = 0;
1939 uint32_t rsp_cmd = 0;
1940
1941 while(1)
1942 {
1943 sts_reg = SDIOx->sts;
1944
1945 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
1946 {
1947 break;
1948 }
1949 }
1950
1951 if(sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
1952 {
1953 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
1954 return SD_CMD_RSP_TIMEOUT;
1955 }
1956
1957 if(sdio_flag_get(SDIOx, SDIO_CMDFAIL_FLAG) != RESET)
1958 {
1959 sdio_flag_clear(SDIOx, SDIO_CMDFAIL_FLAG);
1960 return SD_CMD_FAIL;
1961 }
1962
1963 rsp_cmd = sdio_command_response_get(SDIOx);
1964 if(rsp_cmd != cmd)
1965 {
1966 return SD_ILLEGAL_CMD;
1967 }
1968
1969 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
1970
1971 return (sd_error_status_type)(sdio_response_get(SDIOx, SDIO_RSP1_INDEX) & SD_OCR_ERRORBITS);
1972}
1973
1979 sd_error_status_type command_rsp3_error(void)
1980{
1981 uint32_t sts_reg = 0;;
1982
1983 while(1)
1984 {
1985 sts_reg = SDIOx->sts;
1986
1987 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
1988 {
1989 break;
1990 }
1991 }
1992
1993 if(sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
1994 {
1995 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
1996 return SD_CMD_RSP_TIMEOUT;
1997 }
1998
1999 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
2000
2001 return SD_OK;
2002}
2003
2009 sd_error_status_type command_rsp2_error(void)
2010{
2011 sd_error_status_type status = SD_OK;
2012 uint32_t sts_reg;
2013 uint32_t timeout = SDIO_CMD0TIMEOUT;
2014
2015 while(timeout--)
2016 {
2017 sts_reg = SDIOx->sts;
2018
2019 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
2020 {
2021 break;
2022 }
2023 }
2024
2025 if((timeout == 0) || sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
2026 {
2027 status = SD_CMD_RSP_TIMEOUT;
2028 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
2029
2030 return status;
2031 }
2032
2033 if(sdio_flag_get(SDIOx, SDIO_CMDFAIL_FLAG) != RESET)
2034 {
2035 status = SD_CMD_FAIL;
2036 sdio_flag_clear(SDIOx, SDIO_CMDFAIL_FLAG);
2037 }
2038
2039 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
2040
2041 return status;
2042}
2043
2049 sd_error_status_type command_rsp4_error(uint8_t cmd)
2050{
2051 uint32_t sts_reg = 0, rsp_cmd = 0;
2052
2053 while(1)
2054 {
2055 sts_reg = SDIOx->sts;
2056
2057 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
2058 {
2059 break;
2060 }
2061 }
2062
2063 if(sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
2064 {
2065 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
2066 return SD_CMD_RSP_TIMEOUT;
2067 }
2068
2069 if(sdio_flag_get(SDIOx, SDIO_CMDFAIL_FLAG) != RESET)
2070 {
2071 sdio_flag_clear(SDIOx, SDIO_CMDFAIL_FLAG);
2072
2073 return SD_CMD_FAIL;
2074 }
2075
2076 rsp_cmd = sdio_command_response_get(SDIOx);
2077 if(rsp_cmd != cmd)
2078 {
2079 return SD_ILLEGAL_CMD;
2080 }
2081
2082 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
2083
2084 return SD_OK;
2085}
2086
2092 sd_error_status_type command_rsp5_error(uint8_t cmd)
2093{
2094 uint32_t sts_reg = 0, rsp_cmd = 0, response = 0;
2095
2096 while(1)
2097 {
2098 sts_reg = SDIOx->sts;
2099
2100 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
2101 {
2102 break;
2103 }
2104 }
2105
2106 if(sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
2107 {
2108 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
2109
2110 return SD_CMD_RSP_TIMEOUT;
2111 }
2112
2113 if(sdio_flag_get(SDIOx, SDIO_CMDFAIL_FLAG) != RESET)
2114 {
2115 sdio_flag_clear(SDIOx, SDIO_CMDFAIL_FLAG);
2116
2117 return SD_CMD_FAIL;
2118 }
2119
2120 rsp_cmd = sdio_command_response_get(SDIOx);
2121 if(rsp_cmd != cmd)
2122 {
2123 return SD_ILLEGAL_CMD;
2124 }
2125
2126 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
2127
2128 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
2129
2130 if(response & SD_R5_OUT_OF_RANGE)
2131 {
2132 return SD_CMD_OUT_OF_RANGE;
2133 }
2134
2135 if(response & SD_R5_FUNCTION_NUMBER)
2136 {
2137 return SD_SDIO_UNKNOWN_FUNC;
2138 }
2139
2140 if(response & SD_R5_ERROR)
2141 {
2142 return SD_GENERAL_UNKNOWN_ERROR;
2143 }
2144
2145 return SD_OK;
2146}
2147
2155 sd_error_status_type command_rsp6_error(uint8_t cmd, uint16_t *prca)
2156{
2157 sd_error_status_type status = SD_OK;
2158 uint32_t sts_reg, rsp_cmd = 0, response = 0;
2159
2160 while(1)
2161 {
2162 sts_reg = SDIOx->sts;
2163
2164 if(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG))
2165 {
2166 break;
2167 }
2168 }
2169
2170 if(sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
2171 {
2172 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
2173 return SD_CMD_RSP_TIMEOUT;
2174 }
2175
2176 if(sdio_flag_get(SDIOx, SDIO_CMDFAIL_FLAG) != RESET)
2177 {
2178 sdio_flag_clear(SDIOx, SDIO_CMDFAIL_FLAG);
2179 return SD_CMD_FAIL;
2180 }
2181
2182 rsp_cmd = sdio_command_response_get(SDIOx);
2183 if(rsp_cmd != cmd)
2184 {
2185 return SD_ILLEGAL_CMD;
2186 }
2187
2188 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
2189
2190 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
2191
2192 if(SD_ALLZERO == (response & (SD_R6_GENERAL_UNKNOWN_ERROR | SD_R6_ILLEGAL_CMD | SD_R6_CMD_CRC_FAILED)))
2193 {
2194 *prca = (uint16_t)(response >> 16);
2195 return status;
2196 }
2197
2198 if(response & SD_R6_GENERAL_UNKNOWN_ERROR)
2199 {
2200 return SD_GENERAL_UNKNOWN_ERROR;
2201 }
2202
2203 if(response & SD_R6_ILLEGAL_CMD)
2204 {
2205 return SD_ILLEGAL_CMD;
2206 }
2207
2208 if(response & SD_R6_CMD_CRC_FAILED)
2209 {
2210 return SD_CMD_CRC_FAILED;
2211 }
2212
2213 return status;
2214}
2215
2221 sd_error_status_type sd_bus_wide_enable(confirm_state new_state)
2222{
2223 sd_error_status_type status = SD_OK;
2224 uint32_t response = 0;
2225 uint8_t arg = 0x00;
2226
2227 if(new_state == TRUE)
2228 {
2229 arg = 0x02;
2230 }
2231 else
2232 {
2233 arg = 0x00;
2234 }
2235
2236 /* get response1 */
2237 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
2238
2239 /* check card locked or not */
2240 if(response & SD_CARD_LOCKED)
2241 {
2242 return SD_LOCK_UNLOCK_FAILED;
2243 }
2244
2245 if(sd_card_info.sd_scr_reg.sd_bus_width)
2246 {
2247 sdio_command_init_struct.argument = (uint32_t)(sd_card_info.rca << 16);
2248 sdio_command_init_struct.cmd_index = SD_CMD_APP_CMD;
2249 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2250 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2251
2252 /* sdio command config */
2253 sdio_command_config(SDIOx, &sdio_command_init_struct);
2254 /* enable ccsm */
2255 sdio_command_state_machine_enable(SDIOx, TRUE);
2256
2257 status = command_rsp1_error(SD_CMD_APP_CMD);
2258
2259 if(status != SD_OK)
2260 {
2261 return status;
2262 }
2263
2264 sdio_command_init_struct.argument = arg;
2265 sdio_command_init_struct.cmd_index = SD_CMD_APP_SD_SET_BUSWIDTH;
2266 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2267 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2268
2269 /* sdio command config */
2270 sdio_command_config(SDIOx, &sdio_command_init_struct);
2271 /* enable ccsm */
2272 sdio_command_state_machine_enable(SDIOx, TRUE);
2273
2274 status = command_rsp1_error(SD_CMD_APP_SD_SET_BUSWIDTH);
2275 return status;
2276 }
2277 else
2278 {
2279 return SD_REQ_NOT_APPLICABLE;
2280 }
2281}
2282
2290 sd_error_status_type mmc_switch(uint8_t set, uint8_t index, uint8_t value)
2291{
2292 sd_error_status_type status = SD_OK;
2293 uint32_t card_status = 0, timeout = 0;
2294
2295 sdio_command_init_struct.argument = (EXT_CSD_Write_byte << 24) | (index << 16) | (value << 8) | set;
2296 sdio_command_init_struct.cmd_index = SD_CMD_HS_SWITCH;
2297 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2298 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2299
2300 /* sdio command config */
2301 sdio_command_config(SDIOx, &sdio_command_init_struct);
2302 /* enable ccsm */
2303 sdio_command_state_machine_enable(SDIOx, TRUE);
2304
2305 status = command_rsp1_error(SD_CMD_HS_SWITCH);
2306 if(status != SD_OK)
2307 {
2308 return status;
2309 }
2310
2311 card_status = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
2312 if(card_status & MMC_SWITCH_ERROR)
2313 {
2314 return SD_SWITCH_ERROR;
2315 }
2316
2317 timeout = SD_DATATIMEOUT;
2318 do
2319 {
2320 timeout--;
2321 status = sd_status_send(&card_status);
2322 } /* check ready_for_data flag */
2323 while(((card_status & 0x00000100) == 0) && (timeout > 0));
2324
2325 if(timeout == 0)
2326 {
2327 return SD_ERROR;
2328 }
2329
2330 return status;
2331}
2332
2341 sd_error_status_type sd_switch(uint32_t mode, uint32_t group, uint8_t value, uint8_t *rsp)
2342{
2343 sd_error_status_type status = SD_OK;
2344 uint8_t power;
2345 uint16_t blk_size;
2346
2347 if(rsp == NULL)
2348 {
2349 return SD_INVALID_PARAMETER;
2350 }
2351
2352 SDIOx->dtctrl = 0x0;
2353
2354 blk_size = 64;
2355 power = convert_from_bytes_to_power_of_two(blk_size);
2356
2357 sdio_command_init_struct.argument = blk_size;
2358 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCKLEN;
2359 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2360 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2361
2362 /* sdio command config */
2363 sdio_command_config(SDIOx, &sdio_command_init_struct);
2364 /* enable ccsm */
2365 sdio_command_state_machine_enable(SDIOx, TRUE);
2366
2367 status = command_rsp1_error(SD_CMD_SET_BLOCKLEN);
2368
2369 if(status != SD_OK)
2370 {
2371 return status;
2372 }
2373
2374 sdio_data_init_struct.block_size = (sdio_block_size_type)(power);
2375 sdio_data_init_struct.data_length = blk_size ;
2376 sdio_data_init_struct.timeout = SD_DATATIMEOUT ;
2377 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CONTROLLER;
2378 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
2379
2380 sdio_command_init_struct.argument = (mode << 31) | 0x00FFFFFF;
2381 sdio_command_init_struct.argument &= ~(0xF << (group * 4));
2382 sdio_command_init_struct.argument |= value << (group * 4);
2383 sdio_command_init_struct.cmd_index = SD_CMD_HS_SWITCH;
2384 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2385 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2386
2387 stop_flag = 0;
2388
2389 return sdio_command_data_send(&sdio_command_init_struct, &sdio_data_init_struct, (uint32_t *)rsp);
2390}
2391
2397 sd_error_status_type check_card_programming(uint8_t *p_status)
2398{
2399 volatile uint32_t response = 0, sts_reg = 0, rsp_cmd = 0;
2400
2401 /* send cmd13 */
2402 sdio_command_init_struct.argument = (uint32_t)(rca << 16);
2403 sdio_command_init_struct.cmd_index = SD_CMD_SEND_STATUS;
2404 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2405 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2406
2407 /* sdio command config */
2408 sdio_command_config(SDIOx, &sdio_command_init_struct);
2409 /* enable ccsm */
2410 sdio_command_state_machine_enable(SDIOx, TRUE);
2411
2412 sts_reg = SDIOx->sts;
2413
2414 while(!(sts_reg & (SDIO_CMDFAIL_FLAG | SDIO_CMDTIMEOUT_FLAG | SDIO_CMDRSPCMPL_FLAG)))
2415 {
2416 sts_reg = SDIOx->sts;
2417 }
2418
2419 if(sdio_flag_get(SDIOx, SDIO_CMDFAIL_FLAG) != RESET)
2420 {
2421 sdio_flag_clear(SDIOx, SDIO_CMDFAIL_FLAG);
2422 return SD_CMD_FAIL;
2423 }
2424
2425 if(sdio_flag_get(SDIOx, SDIO_CMDTIMEOUT_FLAG) != RESET)
2426 {
2427 sdio_flag_clear(SDIOx, SDIO_CMDTIMEOUT_FLAG);
2428 return SD_CMD_RSP_TIMEOUT;
2429 }
2430
2431 rsp_cmd = sdio_command_response_get(SDIOx);
2432 if(rsp_cmd!= SD_CMD_SEND_STATUS)
2433 {
2434 return SD_ILLEGAL_CMD;
2435 }
2436
2437 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
2438
2439 response = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
2440
2441 *p_status = (uint8_t)((response >> 9) & 0x0000000F);
2442
2443 return SD_OK;
2444}
2445
2451 sd_error_status_type sd_status_send(uint32_t *p_card_status)
2452{
2453 sd_error_status_type status = SD_OK;
2454
2455 if(p_card_status == NULL)
2456 {
2457 status = SD_INVALID_PARAMETER;
2458 return status;
2459 }
2460
2461 sdio_command_init_struct.argument = (uint32_t)(rca << 16);
2462 sdio_command_init_struct.cmd_index = SD_CMD_SEND_STATUS;
2463 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2464 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2465
2466 /* sdio command config */
2467 sdio_command_config(SDIOx, &sdio_command_init_struct);
2468 /* enable ccsm */
2469 sdio_command_state_machine_enable(SDIOx, TRUE);
2470
2471 status = command_rsp1_error(SD_CMD_SEND_STATUS);
2472
2473 if(status != SD_OK)
2474 {
2475 return status;
2476 }
2477
2478 *p_card_status = sdio_response_get(SDIOx, SDIO_RSP1_INDEX);
2479
2480 return status;
2481}
2482
2488 sd_card_state_type sd_state_get(void)
2489{
2490 uint32_t response = 0;
2491
2492 if(sd_status_send(&response) != SD_OK)
2493 {
2494 return SD_CARD_ERROR;
2495 }
2496 else
2497 {
2498 return (sd_card_state_type)((response >> 9) & 0x0F);
2499 }
2500}
2501
2506 sd_error_status_type scr_find(void)
2507{
2508 uint32_t index = 0, sts_reg = 0;
2509 sd_error_status_type status = SD_OK;
2510 uint32_t *tempscr;
2511
2512 tempscr = (uint32_t *) &(sd_card_info.sd_scr_reg);
2513
2514 /* send cmd16, set block length */
2515 sdio_command_init_struct.argument = (uint32_t)8;
2516 sdio_command_init_struct.cmd_index = SD_CMD_SET_BLOCKLEN;
2517 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2518 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2519
2520 /* sdio command config */
2521 sdio_command_config(SDIOx, &sdio_command_init_struct);
2522 /* enable ccsm */
2523 sdio_command_state_machine_enable(SDIOx, TRUE);
2524
2525 status = command_rsp1_error(SD_CMD_SET_BLOCKLEN);
2526
2527 if(status != SD_OK)
2528 {
2529 return status;
2530 }
2531
2532 /* send cmd55 */
2533 sdio_command_init_struct.argument = (uint32_t)(sd_card_info.rca << 16);
2534 sdio_command_init_struct.cmd_index = SD_CMD_APP_CMD;
2535 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2536 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2537
2538 /* sdio command config */
2539 sdio_command_config(SDIOx, &sdio_command_init_struct);
2540 /* enable ccsm */
2541 sdio_command_state_machine_enable(SDIOx, TRUE);
2542
2543 status = command_rsp1_error(SD_CMD_APP_CMD);
2544
2545 if(status != SD_OK)
2546 {
2547 return status;
2548 }
2549
2550 sdio_data_init_struct.block_size = SDIO_DATA_BLOCK_SIZE_8B;
2551 sdio_data_init_struct.data_length = 8;
2552 sdio_data_init_struct.timeout = SD_DATATIMEOUT;
2553 sdio_data_init_struct.transfer_direction = SDIO_DATA_TRANSFER_TO_CONTROLLER;
2554 sdio_data_init_struct.transfer_mode = SDIO_DATA_BLOCK_TRANSFER;
2555
2556 sdio_data_config(SDIOx, &sdio_data_init_struct);
2557 sdio_data_state_machine_enable(SDIOx, TRUE);
2558
2559 /* send cmd51 */
2560 sdio_command_init_struct.argument = 0x0;
2561 sdio_command_init_struct.cmd_index = SD_CMD_SD_APP_SEND_SCR;
2562 sdio_command_init_struct.rsp_type = SDIO_RESPONSE_SHORT;
2563 sdio_command_init_struct.wait_type = SDIO_WAIT_FOR_NO;
2564
2565 /* sdio command config */
2566 sdio_command_config(SDIOx, &sdio_command_init_struct);
2567 /* enable ccsm */
2568 sdio_command_state_machine_enable(SDIOx, TRUE);
2569
2570 status = command_rsp1_error(SD_CMD_SD_APP_SEND_SCR);
2571
2572 if(status != SD_OK)
2573 {
2574 return status;
2575 }
2576
2577 sts_reg = SDIOx->sts;
2578
2579 while(!(sts_reg & (SDIO_RXERRO_FLAG | SDIO_DTFAIL_FLAG | SDIO_DTTIMEOUT_FLAG | SDIO_DTBLKCMPL_FLAG | SDIO_SBITERR_FLAG)))
2580 {
2581 if(sdio_flag_get(SDIOx, SDIO_RXBUF_FLAG) != RESET)
2582 {
2583 *(tempscr + index) = sdio_data_read(SDIOx);
2584 index++;
2585 }
2586 sts_reg = SDIOx->sts;
2587 }
2588
2589 if(sdio_flag_get(SDIOx, SDIO_DTTIMEOUT_FLAG) != RESET)
2590 {
2591 sdio_flag_clear(SDIOx, SDIO_DTTIMEOUT_FLAG);
2592 return SD_DATA_TIMEOUT;
2593 }
2594 else if(sdio_flag_get(SDIOx, SDIO_DTFAIL_FLAG) != RESET)
2595 {
2596 sdio_flag_clear(SDIOx, SDIO_DTFAIL_FLAG);
2597 return SD_DATA_FAIL;
2598 }
2599 else if(sdio_flag_get(SDIOx, SDIO_RXERRO_FLAG) != RESET)
2600 {
2601 sdio_flag_clear(SDIOx, SDIO_RXERRO_FLAG);
2602 return SD_RX_OVERRUN;
2603 }
2604 else if(sdio_flag_get(SDIOx, SDIO_SBITERR_FLAG) != RESET)
2605 {
2606 sdio_flag_clear(SDIOx, SDIO_SBITERR_FLAG);
2607 return SD_START_BIT_ERR;
2608 }
2609
2610 sdio_flag_clear(SDIOx, SDIO_STATIC_FLAGS);
2611
2612 return status;
2613}
2614
2620 sd_error_status_type speed_change(uint8_t speed)
2621{
2622 sd_error_status_type status = SD_OK;
2623 uint8_t switch_sts[64];
2624
2625 if(speed > 1)
2626 {
2627 return SD_ERROR;
2628 }
2629
2630 /* check card type */
2631 if((SDIO_STD_CAPACITY_SD_CARD_V1_1 == card_type) || (SDIO_STD_CAPACITY_SD_CARD_V2_0 == card_type) || \
2632 (SDIO_HIGH_CAPACITY_SD_CARD == card_type))
2633 {
2634 /* version 1.01 card does not support cmd6 */
2635 if(sd_card_info.sd_scr_reg.sd_spec == 0)
2636 {
2637 return SD_ERROR;
2638 }
2639
2640 /* check group 1 function support speed */
2641 status = sd_switch(0, 0, speed, switch_sts);
2642
2643 if(status != 0)
2644 {
2645 return status;
2646 }
2647
2648 if((switch_sts[13] & (1 << speed)) == 0)
2649 {
2650 return SD_ERROR;
2651 }
2652
2653 status = sd_switch(1, 0, speed, switch_sts);
2654
2655 if(status != 0)
2656 {
2657 return status;
2658 }
2659
2660 /* read it back for confirmation */
2661 if((switch_sts[16] & 0xF) != speed)
2662 {
2663 return SD_ERROR;
2664 }
2665 }
2666 else if(card_type == SDIO_HIGH_SPEED_MULTIMEDIA_CARD)
2667 {
2668 status = mmc_switch(EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, (uint8_t)speed);
2669
2670 if(status != 0)
2671 {
2672 return status;
2673 }
2674 }
2675
2676 return status;
2677}
2678
2684uint8_t convert_from_bytes_to_power_of_two(uint16_t number_of_bytes)
2685{
2686 uint8_t count = 0;
2687
2688 while(number_of_bytes != 1)
2689 {
2690 number_of_bytes >>= 1;
2691 count++;
2692 }
2693
2694 return count;
2695}
2696
2705void sd_dma_config(uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
2706{
2707 dma_init_type dma_init_struct;
2708 dma_default_para_init(&dma_init_struct);
2709
2710 crm_periph_clock_enable(CRM_DMA2_PERIPH_CLOCK, TRUE);
2711
2712 dma_reset(DMA2_CHANNEL4);
2713 dma_channel_enable(DMA2_CHANNEL4, FALSE);
2714
2715 dma_init_struct.peripheral_base_addr = (uint32_t)&SDIOx->buf;
2716 dma_init_struct.memory_base_addr = (uint32_t)mbuf;
2717 dma_init_struct.direction = dir;
2718 dma_init_struct.buffer_size = buf_size / 4;
2719 dma_init_struct.peripheral_inc_enable = FALSE;
2720 dma_init_struct.memory_inc_enable = TRUE;
2721 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_WORD;
2722 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_WORD;
2723 dma_init_struct.loop_mode_enable = FALSE;
2724 dma_init_struct.priority = DMA_PRIORITY_HIGH;
2725 dma_init(DMA2_CHANNEL4, &dma_init_struct);
2726
2727 dma_channel_enable(DMA2_CHANNEL4, TRUE);
2728}
2729
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
sd_card_info
sd_card_info_struct_type sd_card_info
Definition: sdio_fatfs/src/at32_sdio.c:48
sd_switch
sd_error_status_type sd_switch(uint32_t mode, uint32_t group, uint8_t value, uint8_t *rsp)
switch sd card speed to high speed
Definition: sdio_fatfs/src/at32_sdio.c:2341
command_rsp5_error
sd_error_status_type command_rsp5_error(uint8_t cmd)
checks for error conditions for r5 response.
Definition: sdio_fatfs/src/at32_sdio.c:2092
speed_change
sd_error_status_type speed_change(uint8_t speed)
set bus speed
Definition: sdio_fatfs/src/at32_sdio.c:2620
sd_power_off
sd_error_status_type sd_power_off(void)
turns the sdio output signals off.
Definition: sdio_fatfs/src/at32_sdio.c:402
sdio_data_init_struct
sdio_data_struct_type sdio_data_init_struct
Definition: sdio_fatfs/src/at32_sdio.c:40
sd_irq_service
sd_error_status_type sd_irq_service(void)
allows to process all the interrupts that are high.
Definition: sdio_fatfs/src/at32_sdio.c:1788
transfer_end
volatile uint8_t transfer_end
Definition: sdio_fatfs/src/at32_sdio.c:47
command_rsp7_error
sd_error_status_type command_rsp7_error(void)
checks for error conditions for R7 response.
Definition: sdio_fatfs/src/at32_sdio.c:1899
sd_device_mode_set
sd_error_status_type sd_device_mode_set(uint32_t mode)
set sdio work mode.
Definition: sdio_fatfs/src/at32_sdio.c:785
card_type
static sd_memory_card_type card_type
Definition: sdio_fatfs/src/at32_sdio.c:42
convert_from_bytes_to_power_of_two
uint8_t convert_from_bytes_to_power_of_two(uint16_t number_of_bytes)
converts the number of bytes in power of two and returns the power.
Definition: sdio_fatfs/src/at32_sdio.c:2684
sd_card_info_get
sd_error_status_type sd_card_info_get(sd_card_info_struct_type *card_info)
returns information about specific card.
Definition: sdio_fatfs/src/at32_sdio.c:531
sdio_command_init_struct
sdio_command_struct_type sdio_command_init_struct
Definition: sdio_fatfs/src/at32_sdio.c:39
mmc_stream_write
sd_error_status_type mmc_stream_write(uint8_t *buf, long long addr, uint32_t len)
write mmc card data stream.
Definition: sdio_fatfs/src/at32_sdio.c:1699
sd_card_init
sd_error_status_type sd_card_init(void)
intialises all cards or single card as the case may be card(s) come into standby state.
Definition: sdio_fatfs/src/at32_sdio.c:416
sd_block_read
sd_error_status_type sd_block_read(uint8_t *buf, long long addr, uint16_t blk_size)
allows to read one block from a specified address in a card. the data transfer can be managed by dma ...
Definition: sdio_fatfs/src/at32_sdio.c:1187
sd_deselect_select
sd_error_status_type sd_deselect_select(uint32_t addr)
selects od deselects the corresponding card.
Definition: sdio_fatfs/src/at32_sdio.c:806
command_rsp6_error
sd_error_status_type command_rsp6_error(uint8_t cmd, uint16_t *p_rca)
checks for error conditions for r6 (rca) response.
Definition: sdio_fatfs/src/at32_sdio.c:2155
SDIO1_IRQHandler
void SDIO1_IRQHandler(void)
sdio1 isr.
Definition: sdio_fatfs/src/at32_sdio.c:1768
stop_flag
static uint8_t stop_flag
Definition: sdio_fatfs/src/at32_sdio.c:45
mmc_switch
sd_error_status_type mmc_switch(uint8_t set, uint8_t index, uint8_t value)
switch mmc card speed to high speed
Definition: sdio_fatfs/src/at32_sdio.c:2290
sd_blocks_erase
sd_error_status_type sd_blocks_erase(long long addr, uint32_t nblks)
erase continuous data block
Definition: sdio_fatfs/src/at32_sdio.c:1029
check_card_programming
sd_error_status_type check_card_programming(uint8_t *p_status)
checks if the sd card is in programming state.
Definition: sdio_fatfs/src/at32_sdio.c:2397
transfer_error
volatile sd_error_status_type transfer_error
Definition: sdio_fatfs/src/at32_sdio.c:46
sd_bus_wide_enable
sd_error_status_type sd_bus_wide_enable(confirm_state new_state)
enable or disable the sdio wide bus mode.
Definition: sdio_fatfs/src/at32_sdio.c:2221
command_rsp1_error
sd_error_status_type command_rsp1_error(uint8_t cmd)
checks for error conditions for R1 response.
Definition: sdio_fatfs/src/at32_sdio.c:1936
SDIO2_IRQHandler
void SDIO2_IRQHandler(void)
sdio2 isr.
Definition: sdio_fatfs/src/at32_sdio.c:1778
sd_mult_blocks_write
sd_error_status_type sd_mult_blocks_write(const uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to write blocks starting from a specified address in a card. the data transfer can be managed ...
Definition: sdio_fatfs/src/at32_sdio.c:1488
csd_table
static uint32_t csd_table[4]
Definition: sdio_fatfs/src/at32_sdio.c:43
sdio_clock_set
void sdio_clock_set(uint32_t clk_div)
set sdio clock devision factor.
Definition: sdio_fatfs/src/at32_sdio.c:181
sd_state_get
sd_card_state_type sd_state_get(void)
returns information about sd card.
Definition: sdio_fatfs/src/at32_sdio.c:2488
cid_table
static uint32_t cid_table[4]
Definition: sdio_fatfs/src/at32_sdio.c:43
sd_dma_config
void sd_dma_config(uint32_t *mbuf, uint32_t buf_size, dma_dir_type dir)
set dma configuation for sdio
Definition: sdio_fatfs/src/at32_sdio.c:2705
sd_block_write
sd_error_status_type sd_block_write(const uint8_t *buf, long long addr, uint16_t blk_size)
allows to write one block starting from a specified address in a card. the data transfer can be manag...
Definition: sdio_fatfs/src/at32_sdio.c:1366
device_mode
static sd_data_transfer_mode_type device_mode
Definition: sdio_fatfs/src/at32_sdio.c:44
sd_status_send
sd_error_status_type sd_status_send(uint32_t *p_card_status)
read current card status.
Definition: sdio_fatfs/src/at32_sdio.c:2451
sdio_command_data_send
sd_error_status_type sdio_command_data_send(sdio_command_struct_type *sdio_cmd_init_t, sdio_data_struct_type *sdio_data_init_t, uint32_t *buf)
read data from or write data to sd card.
Definition: sdio_fatfs/src/at32_sdio.c:829
command_rsp2_error
sd_error_status_type command_rsp2_error(void)
checks for error conditions for R2 (cid or csd) response.
Definition: sdio_fatfs/src/at32_sdio.c:2009
sd_init
sd_error_status_type sd_init(void)
initializes the sd card and put it into standby state (ready for data transfer).
Definition: sdio_fatfs/src/at32_sdio.c:72
mmc_stream_read
sd_error_status_type mmc_stream_read(uint8_t *buf, long long addr, uint32_t len)
read mmc card data stream.
Definition: sdio_fatfs/src/at32_sdio.c:1652
scr_find
sd_error_status_type scr_find(void)
find the sd card scr register value.
Definition: sdio_fatfs/src/at32_sdio.c:2506
sd_power_on
sd_error_status_type sd_power_on(void)
enquires cards about their operating voltage and configures clock controls.
Definition: sdio_fatfs/src/at32_sdio.c:196
command_rsp4_error
sd_error_status_type command_rsp4_error(uint8_t cmd)
checks for error conditions for r4 response.
Definition: sdio_fatfs/src/at32_sdio.c:2049
sd_mult_blocks_read
sd_error_status_type sd_mult_blocks_read(uint8_t *buf, long long addr, uint16_t blk_size, uint32_t nblks)
allows to read blocks from a specified address in a card. the data transfer can be managed by dma mod...
Definition: sdio_fatfs/src/at32_sdio.c:1276
sd_wide_bus_operation_config
sd_error_status_type sd_wide_bus_operation_config(sdio_bus_width_type mode)
enable wide bus opeartion for the requeseted card if supported by card.
Definition: sdio_fatfs/src/at32_sdio.c:742
rca
static uint32_t rca
Definition: sdio_fatfs/src/at32_sdio.c:43
command_rsp3_error
sd_error_status_type command_rsp3_error(void)
checks for error conditions for R3 (ocr) response.
Definition: sdio_fatfs/src/at32_sdio.c:1979
command_error
sd_error_status_type command_error(void)
checks for error conditions for cmd0.
Definition: sdio_fatfs/src/at32_sdio.c:1872
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_SDIO1_PERIPH_CLOCK
@ CRM_SDIO1_PERIPH_CLOCK
Definition: at32f415_crm.h:106
CRM_GPIOC_PERIPH_CLOCK
@ CRM_GPIOC_PERIPH_CLOCK
Definition: at32f415_crm.h:112
CRM_GPIOD_PERIPH_CLOCK
@ CRM_GPIOD_PERIPH_CLOCK
Definition: at32f415_crm.h:113
CRM_DMA2_PERIPH_CLOCK
@ CRM_DMA2_PERIPH_CLOCK
Definition: at32f415_crm.h:104
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
dma_dir_type
dma_dir_type
dma direction type
Definition: at32f415_dma.h:209
DMA_PERIPHERAL_DATA_WIDTH_WORD
@ DMA_PERIPHERAL_DATA_WIDTH_WORD
Definition: at32f415_dma.h:240
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_WORD
@ DMA_MEMORY_DATA_WIDTH_WORD
Definition: at32f415_dma.h:250
DMA_PRIORITY_HIGH
@ DMA_PRIORITY_HIGH
Definition: at32f415_dma.h:260
DMA2_CHANNEL4
#define DMA2_CHANNEL4
Definition: at32f415_dma.h:485
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_10
#define GPIO_PINS_10
Definition: at32f415_gpio.h:61
GPIO_PINS_11
#define GPIO_PINS_11
Definition: at32f415_gpio.h:62
GPIO_PINS_2
#define GPIO_PINS_2
Definition: at32f415_gpio.h:53
GPIO_PINS_12
#define GPIO_PINS_12
Definition: at32f415_gpio.h:63
GPIO_PINS_9
#define GPIO_PINS_9
Definition: at32f415_gpio.h:60
GPIO_PINS_8
#define GPIO_PINS_8
Definition: at32f415_gpio.h:59
GPIOC
#define GPIOC
Definition: at32f415_gpio.h:772
GPIOD
#define GPIOD
Definition: at32f415_gpio.h:773
sdio_command_config
void sdio_command_config(sdio_type *sdio_x, sdio_command_struct_type *command_struct)
config sdio command.
Definition: at32f415_sdio.c:340
sdio_data_write
void sdio_data_write(sdio_type *sdio_x, uint32_t data)
write one word data to fifo.
Definition: at32f415_sdio.c:501
sdio_data_config
void sdio_data_config(sdio_type *sdio_x, sdio_data_struct_type *data_struct)
config sdio data.
Definition: at32f415_sdio.c:427
sdio_data_read
uint32_t sdio_data_read(sdio_type *sdio_x)
read a word data from sdio fifo.
Definition: at32f415_sdio.c:476
sdio_power_status_get
flag_status sdio_power_status_get(sdio_type *sdio_x)
get power status.
Definition: at32f415_sdio.c:87
sdio_command_state_machine_enable
void sdio_command_state_machine_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable command path state machine(CPSM).
Definition: at32f415_sdio.c:363
sdio_clock_bypass
void sdio_clock_bypass(sdio_type *sdio_x, confirm_state new_state)
enable or disable clock divider bypss
Definition: at32f415_sdio.c:152
sdio_flow_control_enable
void sdio_flow_control_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable hardware flow control.
Definition: at32f415_sdio.c:179
sdio_power_set
void sdio_power_set(sdio_type *sdio_x, sdio_power_state_type power_state)
set the power status of the controller
Definition: at32f415_sdio.c:75
sdio_clock_config
void sdio_clock_config(sdio_type *sdio_x, uint16_t clk_div, sdio_edge_phase_type clk_edg)
config sdio clock
Definition: at32f415_sdio.c:115
sdio_bus_width_config
void sdio_bus_width_config(sdio_type *sdio_x, sdio_bus_width_type width)
config sdio bus width
Definition: at32f415_sdio.c:139
sdio_interrupt_enable
void sdio_interrupt_enable(sdio_type *sdio_x, uint32_t int_opt, confirm_state new_state)
config corresponding interrupt.
Definition: at32f415_sdio.c:243
sdio_flag_clear
void sdio_flag_clear(sdio_type *sdio_x, uint32_t flag)
clear sdio flag.
Definition: at32f415_sdio.c:326
sdio_response_get
uint32_t sdio_response_get(sdio_type *sdio_x, sdio_rsp_index_type reg_index)
get response received from the card for the last command.
Definition: at32f415_sdio.c:394
sdio_data_state_machine_enable
void sdio_data_state_machine_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable data path state machine(DPSM).
Definition: at32f415_sdio.c:452
sdio_power_saving_mode_enable
void sdio_power_saving_mode_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable power saving mode, config sdio_ck clock output when the bus is idle.
Definition: at32f415_sdio.c:166
sdio_flag_get
flag_status sdio_flag_get(sdio_type *sdio_x, uint32_t flag)
get sdio flag.
Definition: at32f415_sdio.c:289
sdio_dma_enable
void sdio_dma_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable dma.
Definition: at32f415_sdio.c:205
sdio_reset
void sdio_reset(sdio_type *sdio_x)
reset the sdio register
Definition: at32f415_sdio.c:51
sdio_clock_enable
void sdio_clock_enable(sdio_type *sdio_x, confirm_state new_state)
enable or disable sdio_ck output.
Definition: at32f415_sdio.c:192
sdio_command_response_get
uint8_t sdio_command_response_get(sdio_type *sdio_x)
get command index of last command for which response received.
Definition: at32f415_sdio.c:376
sdio_bus_width_type
sdio_bus_width_type
sdio bus width
Definition: at32f415_sdio.h:139
sdio_block_size_type
sdio_block_size_type
sdio data block size
Definition: at32f415_sdio.h:180
SDIO_WAIT_FOR_NO
@ SDIO_WAIT_FOR_NO
Definition: at32f415_sdio.h:160
SDIO_WAIT_FOR_INT
@ SDIO_WAIT_FOR_INT
Definition: at32f415_sdio.h:161
SDIO_RESPONSE_LONG
@ SDIO_RESPONSE_LONG
Definition: at32f415_sdio.h:152
SDIO_RESPONSE_SHORT
@ SDIO_RESPONSE_SHORT
Definition: at32f415_sdio.h:151
SDIO_RESPONSE_NO
@ SDIO_RESPONSE_NO
Definition: at32f415_sdio.h:150
SDIO_CLOCK_EDGE_FALLING
@ SDIO_CLOCK_EDGE_FALLING
Definition: at32f415_sdio.h:132
SDIO_DATA_TRANSFER_TO_CARD
@ SDIO_DATA_TRANSFER_TO_CARD
Definition: at32f415_sdio.h:212
SDIO_DATA_TRANSFER_TO_CONTROLLER
@ SDIO_DATA_TRANSFER_TO_CONTROLLER
Definition: at32f415_sdio.h:213
SDIO_POWER_OFF
@ SDIO_POWER_OFF
Definition: at32f415_sdio.h:122
SDIO_POWER_ON
@ SDIO_POWER_ON
Definition: at32f415_sdio.h:123
SDIO_DATA_BLOCK_TRANSFER
@ SDIO_DATA_BLOCK_TRANSFER
Definition: at32f415_sdio.h:203
SDIO_DATA_STREAM_TRANSFER
@ SDIO_DATA_STREAM_TRANSFER
Definition: at32f415_sdio.h:204
SDIO_BUS_WIDTH_D1
@ SDIO_BUS_WIDTH_D1
Definition: at32f415_sdio.h:140
SDIO_BUS_WIDTH_D4
@ SDIO_BUS_WIDTH_D4
Definition: at32f415_sdio.h:141
SDIO_RSP3_INDEX
@ SDIO_RSP3_INDEX
Definition: at32f415_sdio.h:172
SDIO_RSP2_INDEX
@ SDIO_RSP2_INDEX
Definition: at32f415_sdio.h:171
SDIO_RSP4_INDEX
@ SDIO_RSP4_INDEX
Definition: at32f415_sdio.h:173
SDIO_RSP1_INDEX
@ SDIO_RSP1_INDEX
Definition: at32f415_sdio.h:170
SDIO_DATA_BLOCK_SIZE_8B
@ SDIO_DATA_BLOCK_SIZE_8B
Definition: at32f415_sdio.h:184
SDIO_DATA_BLOCK_SIZE_1B
@ SDIO_DATA_BLOCK_SIZE_1B
Definition: at32f415_sdio.h:181
SDIO_CMDTIMEOUT_FLAG
#define SDIO_CMDTIMEOUT_FLAG
Definition: at32f415_sdio.h:87
SDIO_TXBUFH_FLAG
#define SDIO_TXBUFH_FLAG
Definition: at32f415_sdio.h:99
SDIO_CMDCMPL_FLAG
#define SDIO_CMDCMPL_FLAG
Definition: at32f415_sdio.h:92
SDIO_DTFAIL_FLAG
#define SDIO_DTFAIL_FLAG
Definition: at32f415_sdio.h:86
SDIO_RXERRO_FLAG
#define SDIO_RXERRO_FLAG
Definition: at32f415_sdio.h:90
SDIO_RXBUFH_FLAG
#define SDIO_RXBUFH_FLAG
Definition: at32f415_sdio.h:100
SDIO_RXBUF_FLAG
#define SDIO_RXBUF_FLAG
Definition: at32f415_sdio.h:106
SDIO_CMDFAIL_FLAG
#define SDIO_CMDFAIL_FLAG
Definition: at32f415_sdio.h:85
SDIO_CMDRSPCMPL_FLAG
#define SDIO_CMDRSPCMPL_FLAG
Definition: at32f415_sdio.h:91
SDIO_DTBLKCMPL_FLAG
#define SDIO_DTBLKCMPL_FLAG
Definition: at32f415_sdio.h:95
SDIO_DTTIMEOUT_FLAG
#define SDIO_DTTIMEOUT_FLAG
Definition: at32f415_sdio.h:88
SDIO_SBITERR_FLAG
#define SDIO_SBITERR_FLAG
Definition: at32f415_sdio.h:94
SDIO_DTCMPL_FLAG
#define SDIO_DTCMPL_FLAG
Definition: at32f415_sdio.h:93
SDIO_TXERRU_FLAG
#define SDIO_TXERRU_FLAG
Definition: at32f415_sdio.h:89
SDIO_SBITERR_INT
#define SDIO_SBITERR_INT
Definition: at32f415_sdio.h:61
SDIO_RXBUFH_INT
#define SDIO_RXBUFH_INT
Definition: at32f415_sdio.h:67
SDIO_DTTIMEOUT_INT
#define SDIO_DTTIMEOUT_INT
Definition: at32f415_sdio.h:55
SDIO_TXERRU_INT
#define SDIO_TXERRU_INT
Definition: at32f415_sdio.h:56
SDIO_RXERRO_INT
#define SDIO_RXERRO_INT
Definition: at32f415_sdio.h:57
SDIO_DTFAIL_INT
#define SDIO_DTFAIL_INT
Definition: at32f415_sdio.h:53
SDIO_TXBUFH_INT
#define SDIO_TXBUFH_INT
Definition: at32f415_sdio.h:66
SDIO_DTCMP_INT
#define SDIO_DTCMP_INT
Definition: at32f415_sdio.h:60
SDIO_SEND_IF_COND
#define SDIO_SEND_IF_COND
Definition: sd_mmc_card/inc/at32_sdio.h:438
SD_CMD_SD_APP_SEND_SCR
#define SD_CMD_SD_APP_SEND_SCR
Definition: sd_mmc_card/inc/at32_sdio.h:308
SD_CMD_ERASE
#define SD_CMD_ERASE
Definition: sd_mmc_card/inc/at32_sdio.h:291
SD_CMD_APP_SD_SET_BUSWIDTH
#define SD_CMD_APP_SD_SET_BUSWIDTH
Definition: sd_mmc_card/inc/at32_sdio.h:303
SD_CMD_WRITE_SINGLE_BLOCK
#define SD_CMD_WRITE_SINGLE_BLOCK
Definition: sd_mmc_card/inc/at32_sdio.h:280
SD_CMD_SD_ERASE_GRP_START
#define SD_CMD_SD_ERASE_GRP_START
Definition: sd_mmc_card/inc/at32_sdio.h:287
SD_CMD_APP_CMD
#define SD_CMD_APP_CMD
Definition: sd_mmc_card/inc/at32_sdio.h:295
SD_CMD_ALL_SEND_CID
#define SD_CMD_ALL_SEND_CID
Definition: sd_mmc_card/inc/at32_sdio.h:260
SD_CMD_STOP_TRANSMISSION
#define SD_CMD_STOP_TRANSMISSION
Definition: sd_mmc_card/inc/at32_sdio.h:270
SD_CMD_SEND_STATUS
#define SD_CMD_SEND_STATUS
Definition: sd_mmc_card/inc/at32_sdio.h:271
SD_CMD_SET_BLOCK_COUNT
#define SD_CMD_SET_BLOCK_COUNT
Definition: sd_mmc_card/inc/at32_sdio.h:279
SD_CMD_WRITE_DAT_UNTIL_STOP
#define SD_CMD_WRITE_DAT_UNTIL_STOP
Definition: sd_mmc_card/inc/at32_sdio.h:278
SD_CMD_SEND_OP_COND
#define SD_CMD_SEND_OP_COND
Definition: sd_mmc_card/inc/at32_sdio.h:259
SD_CMD_SET_BLOCKLEN
#define SD_CMD_SET_BLOCKLEN
Definition: sd_mmc_card/inc/at32_sdio.h:274
SD_CMD_HS_SWITCH
#define SD_CMD_HS_SWITCH
Definition: sd_mmc_card/inc/at32_sdio.h:264
SD_CMD_READ_SINGLE_BLOCK
#define SD_CMD_READ_SINGLE_BLOCK
Definition: sd_mmc_card/inc/at32_sdio.h:275
SD_CMD_SD_APP_OP_COND
#define SD_CMD_SD_APP_OP_COND
Definition: sd_mmc_card/inc/at32_sdio.h:306
SD_CMD_GO_IDLE_STATE
#define SD_CMD_GO_IDLE_STATE
Definition: sd_mmc_card/inc/at32_sdio.h:258
SD_CMD_SET_REL_ADDR
#define SD_CMD_SET_REL_ADDR
Definition: sd_mmc_card/inc/at32_sdio.h:261
SD_CMD_ERASE_GRP_END
#define SD_CMD_ERASE_GRP_END
Definition: sd_mmc_card/inc/at32_sdio.h:290
SD_CMD_READ_DAT_UNTIL_STOP
#define SD_CMD_READ_DAT_UNTIL_STOP
Definition: sd_mmc_card/inc/at32_sdio.h:269
SD_CMD_SD_ERASE_GRP_END
#define SD_CMD_SD_ERASE_GRP_END
Definition: sd_mmc_card/inc/at32_sdio.h:288
SD_CMD_ERASE_GRP_START
#define SD_CMD_ERASE_GRP_START
Definition: sd_mmc_card/inc/at32_sdio.h:289
SD_CMD_SEL_DESEL_CARD
#define SD_CMD_SEL_DESEL_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:265
SD_CMD_WRITE_MULT_BLOCK
#define SD_CMD_WRITE_MULT_BLOCK
Definition: sd_mmc_card/inc/at32_sdio.h:281
SD_CMD_READ_MULT_BLOCK
#define SD_CMD_READ_MULT_BLOCK
Definition: sd_mmc_card/inc/at32_sdio.h:276
SD_CMD_SEND_CSD
#define SD_CMD_SEND_CSD
Definition: sd_mmc_card/inc/at32_sdio.h:267
sd_data_transfer_mode_type
sd_data_transfer_mode_type
Definition: sd_mmc_card/inc/at32_sdio.h:65
sd_error_status_type
sd_error_status_type
Definition: sd_mmc_card/inc/at32_sdio.h:74
sd_card_state_type
sd_card_state_type
Definition: sd_mmc_card/inc/at32_sdio.h:187
sd_memory_card_type
sd_memory_card_type
Definition: sd_mmc_card/inc/at32_sdio.h:203
SDIOx
#define SDIOx
Definition: sd_mmc_card/inc/at32_sdio.h:51
SDIO_INTR_STS_WRITE_MASK
#define SDIO_INTR_STS_WRITE_MASK
Definition: sd_mmc_card/inc/at32_sdio.h:474
SDIO_INTR_STS_READ_MASK
#define SDIO_INTR_STS_READ_MASK
Definition: sd_mmc_card/inc/at32_sdio.h:476
EXT_CSD_BUS_WIDTH
#define EXT_CSD_BUS_WIDTH
Definition: sd_mmc_card/inc/at32_sdio.h:463
EXT_CSD_CMD_SET_NORMAL
#define EXT_CSD_CMD_SET_NORMAL
Definition: sd_mmc_card/inc/at32_sdio.h:456
EXT_CSD_Write_byte
#define EXT_CSD_Write_byte
Definition: sd_mmc_card/inc/at32_sdio.h:454
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
SDIO_DATATIMEOUT
#define SDIO_DATATIMEOUT
Definition: sd_mmc_card/inc/at32_sdio.h:342
SDIO_CMD0TIMEOUT
#define SDIO_CMD0TIMEOUT
Definition: sd_mmc_card/inc/at32_sdio.h:341
SDIO_STATIC_FLAGS
#define SDIO_STATIC_FLAGS
Definition: sd_mmc_card/inc/at32_sdio.h:340
SD_CARD_LOCKED
#define SD_CARD_LOCKED
Definition: sd_mmc_card/inc/at32_sdio.h:400
SD_VOLTAGE_WINDOW_SD
#define SD_VOLTAGE_WINDOW_SD
Definition: sd_mmc_card/inc/at32_sdio.h:391
SD_R5_ERROR
#define SD_R5_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:383
SD_CARD_RECEIVING
#define SD_CARD_RECEIVING
Definition: sd_mmc_card/inc/at32_sdio.h:402
SD_R5_OUT_OF_RANGE
#define SD_R5_OUT_OF_RANGE
Definition: sd_mmc_card/inc/at32_sdio.h:381
SD_MAX_DATA_LENGTH
#define SD_MAX_DATA_LENGTH
Definition: sd_mmc_card/inc/at32_sdio.h:408
SD_STD_CAPACITY
#define SD_STD_CAPACITY
Definition: sd_mmc_card/inc/at32_sdio.h:393
SD_R5_FUNCTION_NUMBER
#define SD_R5_FUNCTION_NUMBER
Definition: sd_mmc_card/inc/at32_sdio.h:382
SD_R6_ILLEGAL_CMD
#define SD_R6_ILLEGAL_CMD
Definition: sd_mmc_card/inc/at32_sdio.h:389
SD_R6_GENERAL_UNKNOWN_ERROR
#define SD_R6_GENERAL_UNKNOWN_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:388
SD_MAX_VOLT_TRIAL
#define SD_MAX_VOLT_TRIAL
Definition: sd_mmc_card/inc/at32_sdio.h:396
SD_DATATIMEOUT
#define SD_DATATIMEOUT
Definition: sd_mmc_card/inc/at32_sdio.h:403
SD_R6_CMD_CRC_FAILED
#define SD_R6_CMD_CRC_FAILED
Definition: sd_mmc_card/inc/at32_sdio.h:390
SD_ALLZERO
#define SD_ALLZERO
Definition: sd_mmc_card/inc/at32_sdio.h:397
MMC_SWITCH_ERROR
#define MMC_SWITCH_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:374
SD_VOLTAGE_WINDOW_MMC
#define SD_VOLTAGE_WINDOW_MMC
Definition: sd_mmc_card/inc/at32_sdio.h:395
SD_CHECK_PATTERN
#define SD_CHECK_PATTERN
Definition: sd_mmc_card/inc/at32_sdio.h:394
SD_OCR_ERRORBITS
#define SD_OCR_ERRORBITS
Definition: sd_mmc_card/inc/at32_sdio.h:376
SD_CARD_PROGRAMMING
#define SD_CARD_PROGRAMMING
Definition: sd_mmc_card/inc/at32_sdio.h:401
SD_HIGH_CAPACITY
#define SD_HIGH_CAPACITY
Definition: sd_mmc_card/inc/at32_sdio.h:392
SD_TRANSFER_DMA_MODE
@ SD_TRANSFER_DMA_MODE
Definition: sd_mmc_card/inc/at32_sdio.h:67
SD_TRANSFER_POLLING_MODE
@ SD_TRANSFER_POLLING_MODE
Definition: sd_mmc_card/inc/at32_sdio.h:66
SD_ERROR
@ SD_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:118
SD_LOCK_UNLOCK_FAILED
@ SD_LOCK_UNLOCK_FAILED
Definition: sd_mmc_card/inc/at32_sdio.h:89
SD_SDIO_UNKNOWN_FUNC
@ SD_SDIO_UNKNOWN_FUNC
Definition: sd_mmc_card/inc/at32_sdio.h:108
SD_DATA_FAIL
@ SD_DATA_FAIL
Definition: sd_mmc_card/inc/at32_sdio.h:77
SD_INVALID_PARAMETER
@ SD_INVALID_PARAMETER
Definition: sd_mmc_card/inc/at32_sdio.h:115
SD_CMD_FAIL
@ SD_CMD_FAIL
Definition: sd_mmc_card/inc/at32_sdio.h:76
SD_CMD_OUT_OF_RANGE
@ SD_CMD_OUT_OF_RANGE
Definition: sd_mmc_card/inc/at32_sdio.h:83
SD_CMD_CRC_FAILED
@ SD_CMD_CRC_FAILED
Definition: sd_mmc_card/inc/at32_sdio.h:90
SD_GENERAL_UNKNOWN_ERROR
@ SD_GENERAL_UNKNOWN_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:94
SD_UNSUPPORTED_FEATURE
@ SD_UNSUPPORTED_FEATURE
Definition: sd_mmc_card/inc/at32_sdio.h:116
SD_TX_UNDERRUN
@ SD_TX_UNDERRUN
Definition: sd_mmc_card/inc/at32_sdio.h:80
SD_ILLEGAL_CMD
@ SD_ILLEGAL_CMD
Definition: sd_mmc_card/inc/at32_sdio.h:91
SD_RX_OVERRUN
@ SD_RX_OVERRUN
Definition: sd_mmc_card/inc/at32_sdio.h:81
SD_REQ_NOT_APPLICABLE
@ SD_REQ_NOT_APPLICABLE
Definition: sd_mmc_card/inc/at32_sdio.h:114
SD_SWITCH_ERROR
@ SD_SWITCH_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:104
SD_INVALID_VOLTRANGE
@ SD_INVALID_VOLTRANGE
Definition: sd_mmc_card/inc/at32_sdio.h:102
SD_DATA_TIMEOUT
@ SD_DATA_TIMEOUT
Definition: sd_mmc_card/inc/at32_sdio.h:79
SD_START_BIT_ERR
@ SD_START_BIT_ERR
Definition: sd_mmc_card/inc/at32_sdio.h:82
SD_CMD_RSP_TIMEOUT
@ SD_CMD_RSP_TIMEOUT
Definition: sd_mmc_card/inc/at32_sdio.h:78
SD_OK
@ SD_OK
Definition: sd_mmc_card/inc/at32_sdio.h:119
SD_CARD_ERROR
@ SD_CARD_ERROR
Definition: sd_mmc_card/inc/at32_sdio.h:196
SDIO_HIGH_CAPACITY_SD_CARD
@ SDIO_HIGH_CAPACITY_SD_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:206
SDIO_SECURE_DIGITAL_IO_COMBO_CARD
@ SDIO_SECURE_DIGITAL_IO_COMBO_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:210
SDIO_HIGH_SPEED_MULTIMEDIA_CARD
@ SDIO_HIGH_SPEED_MULTIMEDIA_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:209
SDIO_STD_CAPACITY_SD_CARD_V1_1
@ SDIO_STD_CAPACITY_SD_CARD_V1_1
Definition: sd_mmc_card/inc/at32_sdio.h:204
SDIO_SECURE_DIGITAL_IO_CARD
@ SDIO_SECURE_DIGITAL_IO_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:208
SDIO_STD_CAPACITY_SD_CARD_V2_0
@ SDIO_STD_CAPACITY_SD_CARD_V2_0
Definition: sd_mmc_card/inc/at32_sdio.h:205
SDIO_MULTIMEDIA_CARD
@ SDIO_MULTIMEDIA_CARD
Definition: sd_mmc_card/inc/at32_sdio.h:207
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
sd_card_info_struct_type
Definition: sd_mmc_card/inc/at32_sdio.h:237
sd_card_info_struct_type::sd_scr_reg
sd_scr_struct_type sd_scr_reg
Definition: sd_mmc_card/inc/at32_sdio.h:240
sd_card_info_struct_type::card_capacity
long long card_capacity
Definition: sd_mmc_card/inc/at32_sdio.h:241
sd_card_info_struct_type::sd_cid_reg
sd_cid_struct_type sd_cid_reg
Definition: sd_mmc_card/inc/at32_sdio.h:239
sd_card_info_struct_type::sd_csd_reg
sd_csd_struct_type sd_csd_reg
Definition: sd_mmc_card/inc/at32_sdio.h:238
sd_card_info_struct_type::card_blk_size
uint32_t card_blk_size
Definition: sd_mmc_card/inc/at32_sdio.h:242
sd_card_info_struct_type::rca
uint16_t rca
Definition: sd_mmc_card/inc/at32_sdio.h:243
sd_card_info_struct_type::card_type
uint8_t card_type
Definition: sd_mmc_card/inc/at32_sdio.h:244
sd_cid_struct_type::reserved1
uint8_t reserved1
Definition: sd_mmc_card/inc/at32_sdio.h:177
sd_cid_struct_type::product_name2
uint8_t product_name2
Definition: sd_mmc_card/inc/at32_sdio.h:174
sd_cid_struct_type::manufact_date
uint16_t manufact_date
Definition: sd_mmc_card/inc/at32_sdio.h:178
sd_cid_struct_type::cid_crc
uint8_t cid_crc
Definition: sd_mmc_card/inc/at32_sdio.h:179
sd_cid_struct_type::product_reversion
uint8_t product_reversion
Definition: sd_mmc_card/inc/at32_sdio.h:175
sd_cid_struct_type::manufacturer_id
uint8_t manufacturer_id
Definition: sd_mmc_card/inc/at32_sdio.h:171
sd_cid_struct_type::product_sn
uint32_t product_sn
Definition: sd_mmc_card/inc/at32_sdio.h:176
sd_cid_struct_type::product_name1
uint32_t product_name1
Definition: sd_mmc_card/inc/at32_sdio.h:173
sd_cid_struct_type::reserved2
uint8_t reserved2
Definition: sd_mmc_card/inc/at32_sdio.h:180
sd_cid_struct_type::oem_app_id
uint16_t oem_app_id
Definition: sd_mmc_card/inc/at32_sdio.h:172
sd_csd_struct_type::spec_version
uint8_t spec_version
Definition: sd_mmc_card/inc/at32_sdio.h:128
sd_csd_struct_type::max_write_current_vdd_max
uint8_t max_write_current_vdd_max
Definition: sd_mmc_card/inc/at32_sdio.h:144
sd_csd_struct_type::nsac
uint8_t nsac
Definition: sd_mmc_card/inc/at32_sdio.h:131
sd_csd_struct_type::card_cmd_classes
uint16_t card_cmd_classes
Definition: sd_mmc_card/inc/at32_sdio.h:133
sd_csd_struct_type::part_blk_read
uint8_t part_blk_read
Definition: sd_mmc_card/inc/at32_sdio.h:135
sd_csd_struct_type::read_blk_misalign
uint8_t read_blk_misalign
Definition: sd_mmc_card/inc/at32_sdio.h:137
sd_csd_struct_type::content_protect_app
uint8_t content_protect_app
Definition: sd_mmc_card/inc/at32_sdio.h:155
sd_csd_struct_type::write_speed_factor
uint8_t write_speed_factor
Definition: sd_mmc_card/inc/at32_sdio.h:151
sd_csd_struct_type::max_read_blk_length
uint8_t max_read_blk_length
Definition: sd_mmc_card/inc/at32_sdio.h:134
sd_csd_struct_type::max_bus_clk_freq
uint8_t max_bus_clk_freq
Definition: sd_mmc_card/inc/at32_sdio.h:132
sd_csd_struct_type::ecc_code
uint8_t ecc_code
Definition: sd_mmc_card/inc/at32_sdio.h:161
sd_csd_struct_type::reserved4
uint8_t reserved4
Definition: sd_mmc_card/inc/at32_sdio.h:163
sd_csd_struct_type::dsr_implemented
uint8_t dsr_implemented
Definition: sd_mmc_card/inc/at32_sdio.h:138
sd_csd_struct_type::max_read_current_vdd_min
uint8_t max_read_current_vdd_min
Definition: sd_mmc_card/inc/at32_sdio.h:141
sd_csd_struct_type::reserved2
uint8_t reserved2
Definition: sd_mmc_card/inc/at32_sdio.h:139
sd_csd_struct_type::erase_group_size_mult
uint8_t erase_group_size_mult
Definition: sd_mmc_card/inc/at32_sdio.h:147
sd_csd_struct_type::file_formart
uint8_t file_formart
Definition: sd_mmc_card/inc/at32_sdio.h:160
sd_csd_struct_type::temp_write_protect
uint8_t temp_write_protect
Definition: sd_mmc_card/inc/at32_sdio.h:159
sd_csd_struct_type::permanent_write_protect
uint8_t permanent_write_protect
Definition: sd_mmc_card/inc/at32_sdio.h:158
sd_csd_struct_type::max_read_current_vdd_max
uint8_t max_read_current_vdd_max
Definition: sd_mmc_card/inc/at32_sdio.h:142
sd_csd_struct_type::file_format_group
uint8_t file_format_group
Definition: sd_mmc_card/inc/at32_sdio.h:156
sd_csd_struct_type::device_size
uint32_t device_size
Definition: sd_mmc_card/inc/at32_sdio.h:140
sd_csd_struct_type::write_blk_misalign
uint8_t write_blk_misalign
Definition: sd_mmc_card/inc/at32_sdio.h:136
sd_csd_struct_type::csd_struct
uint8_t csd_struct
Definition: sd_mmc_card/inc/at32_sdio.h:127
sd_csd_struct_type::write_protect_group_enable
uint8_t write_protect_group_enable
Definition: sd_mmc_card/inc/at32_sdio.h:149
sd_csd_struct_type::max_write_current_vdd_min
uint8_t max_write_current_vdd_min
Definition: sd_mmc_card/inc/at32_sdio.h:143
sd_csd_struct_type::reserved1
uint8_t reserved1
Definition: sd_mmc_card/inc/at32_sdio.h:129
sd_csd_struct_type::max_write_blk_length
uint8_t max_write_blk_length
Definition: sd_mmc_card/inc/at32_sdio.h:152
sd_csd_struct_type::csd_crc
uint8_t csd_crc
Definition: sd_mmc_card/inc/at32_sdio.h:162
sd_csd_struct_type::write_protect_group_size
uint8_t write_protect_group_size
Definition: sd_mmc_card/inc/at32_sdio.h:148
sd_csd_struct_type::reserved3
uint8_t reserved3
Definition: sd_mmc_card/inc/at32_sdio.h:154
sd_csd_struct_type::taac
uint8_t taac
Definition: sd_mmc_card/inc/at32_sdio.h:130
sd_csd_struct_type::manufacturer_default_ecc
uint8_t manufacturer_default_ecc
Definition: sd_mmc_card/inc/at32_sdio.h:150
sd_csd_struct_type::part_blk_write
uint8_t part_blk_write
Definition: sd_mmc_card/inc/at32_sdio.h:153
sd_csd_struct_type::copy_flag
uint8_t copy_flag
Definition: sd_mmc_card/inc/at32_sdio.h:157
sd_csd_struct_type::erase_group_size
uint8_t erase_group_size
Definition: sd_mmc_card/inc/at32_sdio.h:146
sd_csd_struct_type::device_size_mult
uint8_t device_size_mult
Definition: sd_mmc_card/inc/at32_sdio.h:145
sd_scr_struct_type::sd_bus_width
uint32_t sd_bus_width
Definition: sd_mmc_card/inc/at32_sdio.h:222
sd_scr_struct_type::sd_spec
uint32_t sd_spec
Definition: sd_mmc_card/inc/at32_sdio.h:220
sdio_command_struct_type
sdio command structure
Definition: at32f415_sdio.h:229
sdio_command_struct_type::cmd_index
uint8_t cmd_index
Definition: at32f415_sdio.h:231
sdio_command_struct_type::argument
uint32_t argument
Definition: at32f415_sdio.h:230
sdio_command_struct_type::wait_type
sdio_wait_type wait_type
Definition: at32f415_sdio.h:233
sdio_command_struct_type::rsp_type
sdio_reponse_type rsp_type
Definition: at32f415_sdio.h:232
sdio_data_struct_type
sdio data structure
Definition: at32f415_sdio.h:240
sdio_data_struct_type::block_size
sdio_block_size_type block_size
Definition: at32f415_sdio.h:243
sdio_data_struct_type::transfer_direction
sdio_transfer_direction_type transfer_direction
Definition: at32f415_sdio.h:245
sdio_data_struct_type::timeout
uint32_t timeout
Definition: at32f415_sdio.h:241
sdio_data_struct_type::transfer_mode
sdio_transfer_mode_type transfer_mode
Definition: at32f415_sdio.h:244
sdio_data_struct_type::data_length
uint32_t data_length
Definition: at32f415_sdio.h:242


AT32F415 Firmwary Library: smartcard_config.h Source File

  • usart
  • smartcard
  • inc
smartcard_config.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __SMARTCARD_CONFIG_H
29#define __SMARTCARD_CONFIG_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* smartcard inteface usart pins */
36#define SC_USART USART2
37#define SC_USART_CLK CRM_USART2_PERIPH_CLOCK
38#define SC_USART_GPIO_CLK CRM_GPIOA_PERIPH_CLOCK
39#define SC_USART_TX_PIN GPIO_PINS_2
40#define SC_USART_TX_PORT GPIOA
41#define SC_USART_CLK_PIN GPIO_PINS_4
42#define SC_USART_CLK_PORT GPIOA
43#define SC_USART_IRQn USART2_IRQn
44#define SC_USART_IRQHandler USART2_IRQHandler
45
46/* smartcard inteface gpio pins */
47#define SC_3_5V_PIN GPIO_PINS_5
48#define SC_RESET_PIN GPIO_PINS_6
49#define SC_CMDVCC_PIN GPIO_PINS_7
50#define SC_OFF_PIN GPIO_PINS_8
51#define SC_3_5V_PORT GPIOA
52#define SC_RESET_PORT GPIOA
53#define SC_CMDVCC_PORT GPIOA
54#define SC_OFF_PORT GPIOA
55#define SC_3_5V_CLK CRM_GPIOA_PERIPH_CLOCK
56#define SC_RESET_CLK CRM_GPIOA_PERIPH_CLOCK
57#define SC_CMDVCC_CLK CRM_GPIOA_PERIPH_CLOCK
58#define SC_OFF_CLK CRM_GPIOA_PERIPH_CLOCK
59#define SC_OFF_EXINT EXINT_LINE_8
60#define SC_OFF_PORTSOURCE GPIO_PORT_SOURCE_GPIOA
61#define SC_OFF_PINSOURCE GPIO_PINS_SOURCE8
62#define SC_OFF_EXINT_IRQ EXINT9_5_IRQn
63
64#ifdef __cplusplus
65}
66#endif
67
68#endif /* __SMARTCARD_CONFIG_H */
69


AT32F415 Firmwary Library: spi_flash.c Source File

  • spi
  • w25q_flash
  • src
spi_flash.c
Go to the documentation of this file.
1
27#include "spi_flash.h"
28
37uint8_t spiflash_sector_buf[SPIF_SECTOR_SIZE];
38
44void spiflash_init(void)
45{
46 gpio_init_type gpio_initstructure;
47 spi_init_type spi_init_struct;
48
49 crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);
50 crm_periph_clock_enable(CRM_DMA1_PERIPH_CLOCK, TRUE);
51 /* software cs, pa4 as a general io to control flash cs */
52 gpio_initstructure.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
53 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
54 gpio_initstructure.gpio_mode = GPIO_MODE_OUTPUT;
55 gpio_initstructure.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
56 gpio_initstructure.gpio_pins = GPIO_PINS_4;
57 gpio_init(GPIOA, &gpio_initstructure);
58
59 /* sck */
60 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
61 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
62 gpio_initstructure.gpio_pins = GPIO_PINS_5;
63 gpio_init(GPIOA, &gpio_initstructure);
64
65 /* mosi */
66 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
67 gpio_initstructure.gpio_mode = GPIO_MODE_INPUT;
68 gpio_initstructure.gpio_pins = GPIO_PINS_6;
69 gpio_init(GPIOA, &gpio_initstructure);
70
71 /* miso */
72 gpio_initstructure.gpio_pull = GPIO_PULL_UP;
73 gpio_initstructure.gpio_mode = GPIO_MODE_MUX;
74 gpio_initstructure.gpio_pins = GPIO_PINS_7;
75 gpio_init(GPIOA, &gpio_initstructure);
76
77 FLASH_CS_HIGH();
78 crm_periph_clock_enable(CRM_SPI1_PERIPH_CLOCK, TRUE);
79 spi_default_para_init(&spi_init_struct);
80 spi_init_struct.transmission_mode = SPI_TRANSMIT_FULL_DUPLEX;
81 spi_init_struct.master_slave_mode = SPI_MODE_MASTER;
82 spi_init_struct.mclk_freq_division = SPI_MCLK_DIV_8;
83 spi_init_struct.first_bit_transmission = SPI_FIRST_BIT_MSB;
84 spi_init_struct.frame_bit_num = SPI_FRAME_8BIT;
85 spi_init_struct.clock_polarity = SPI_CLOCK_POLARITY_HIGH;
86 spi_init_struct.clock_phase = SPI_CLOCK_PHASE_2EDGE;
87 spi_init_struct.cs_mode_selection = SPI_CS_SOFTWARE_MODE;
88 spi_init(SPI1, &spi_init_struct);
89 spi_enable(SPI1, TRUE);
90}
91
99void spiflash_write(uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
100{
101 uint32_t sector_pos;
102 uint16_t sector_offset;
103 uint16_t sector_remain;
104 uint16_t index;
105 uint8_t *spiflash_buf;
106 spiflash_buf = spiflash_sector_buf;
107
108 /* sector address */
109 sector_pos = write_addr / SPIF_SECTOR_SIZE;
110
111 /* address offset in a sector */
112 sector_offset = write_addr % SPIF_SECTOR_SIZE;
113
114 /* the remain in a sector */
115 sector_remain = SPIF_SECTOR_SIZE - sector_offset;
116 if(length <= sector_remain)
117 {
118 /* smaller than a sector size */
119 sector_remain = length;
120 }
121 while(1)
122 {
123 /* read a sector */
124 spiflash_read(spiflash_buf, sector_pos * SPIF_SECTOR_SIZE, SPIF_SECTOR_SIZE);
125
126 /* validate the read erea */
127 for(index = 0; index < sector_remain; index++)
128 {
129 if(spiflash_buf[sector_offset + index] != 0xFF)
130 {
131 /* there are some data not equal 0xff, so this secotr needs erased */
132 break;
133 }
134 }
135 if(index < sector_remain)
136 {
137 /* erase the sector */
138 spiflash_sector_erase(sector_pos);
139
140 /* copy the write data */
141 for(index = 0; index < sector_remain; index++)
142 {
143 spiflash_buf[index + sector_offset] = pbuffer[index];
144 }
145 spiflash_write_nocheck(spiflash_buf, sector_pos * SPIF_SECTOR_SIZE, SPIF_SECTOR_SIZE); /* program the sector */
146 }
147 else
148 {
149 /* write directly in the erased area */
150 spiflash_write_nocheck(pbuffer, write_addr, sector_remain);
151 }
152 if(length == sector_remain)
153 {
154 /* write end */
155 break;
156 }
157 else
158 {
159 /* go on writing */
160 sector_pos++;
161 sector_offset = 0;
162
163 pbuffer += sector_remain;
164 write_addr += sector_remain;
165 length -= sector_remain;
166 if(length > SPIF_SECTOR_SIZE)
167 {
168 /* could not write the remain data in the next sector */
169 sector_remain = SPIF_SECTOR_SIZE;
170 }
171 else
172 {
173 /* could write the remain data in the next sector */
174 sector_remain = length;
175 }
176 }
177 }
178}
179
187void spiflash_read(uint8_t *pbuffer, uint32_t read_addr, uint32_t length)
188{
189 FLASH_CS_LOW();
190 spi_byte_write(SPIF_READDATA); /* send instruction */
191 spi_byte_write((uint8_t)((read_addr) >> 16)); /* send 24-bit address */
192 spi_byte_write((uint8_t)((read_addr) >> 8));
193 spi_byte_write((uint8_t)read_addr);
194 spi_bytes_read(pbuffer, length);
195 FLASH_CS_HIGH();
196}
197
203void spiflash_sector_erase(uint32_t erase_addr)
204{
205 erase_addr *= SPIF_SECTOR_SIZE; /* translate sector address to byte address */
206 spiflash_write_enable();
207 spiflash_wait_busy();
208 FLASH_CS_LOW();
209 spi_byte_write(SPIF_SECTORERASE);
210 spi_byte_write((uint8_t)((erase_addr) >> 16));
211 spi_byte_write((uint8_t)((erase_addr) >> 8));
212 spi_byte_write((uint8_t)erase_addr);
213 FLASH_CS_HIGH();
214 spiflash_wait_busy();
215}
216
224void spiflash_write_nocheck(uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
225{
226 uint16_t page_remain;
227
228 /* remain bytes in a page */
229 page_remain = SPIF_PAGE_SIZE - write_addr % SPIF_PAGE_SIZE;
230 if(length <= page_remain)
231 {
232 /* smaller than a page size */
233 page_remain = length;
234 }
235 while(1)
236 {
237 spiflash_page_write(pbuffer, write_addr, page_remain);
238 if(length == page_remain)
239 {
240 /* all data are programmed */
241 break;
242 }
243 else
244 {
245 /* length > page_remain */
246 pbuffer += page_remain;
247 write_addr += page_remain;
248
249 /* the remain bytes to be prorammed */
250 length -= page_remain;
251 if(length > SPIF_PAGE_SIZE)
252 {
253 /* can be progrmmed a page at a time */
254 page_remain = SPIF_PAGE_SIZE;
255 }
256 else
257 {
258 /* smaller than a page size */
259 page_remain = length;
260 }
261 }
262 }
263}
264
272void spiflash_page_write(uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
273{
274 if((0 < length) && (length <= SPIF_PAGE_SIZE))
275 {
276 /* set write enable */
277 spiflash_write_enable();
278
279 FLASH_CS_LOW();
280
281 /* send instruction */
282 spi_byte_write(SPIF_PAGEPROGRAM);
283
284 /* send 24-bit address */
285 spi_byte_write((uint8_t)((write_addr) >> 16));
286 spi_byte_write((uint8_t)((write_addr) >> 8));
287 spi_byte_write((uint8_t)write_addr);
288 spi_bytes_write(pbuffer,length);
289
290 FLASH_CS_HIGH();
291
292 /* wait for program end */
293 spiflash_wait_busy();
294 }
295}
296
303void spi_bytes_write(uint8_t *pbuffer, uint32_t length)
304{
305 volatile uint8_t dummy_data;
306
307#if defined(SPI_TRANS_DMA)
308 dma_init_type dma_init_struct;
309 dma_reset(DMA1_CHANNEL2);
310 dma_reset(DMA1_CHANNEL3);
311 dma_default_para_init(&dma_init_struct);
312 dma_init_struct.buffer_size = length;
313 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
314 dma_init_struct.memory_base_addr = (uint32_t)&dummy_data;
315 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
316 dma_init_struct.memory_inc_enable = FALSE;
317 dma_init_struct.peripheral_base_addr = (uint32_t)(&SPI1->dt);
318 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
319 dma_init_struct.peripheral_inc_enable = FALSE;
320 dma_init_struct.priority = DMA_PRIORITY_VERY_HIGH;
321 dma_init_struct.loop_mode_enable = FALSE;
322 dma_init(DMA1_CHANNEL2, &dma_init_struct);
323
324 dma_init_struct.buffer_size = length;
325 dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
326 dma_init_struct.memory_base_addr = (uint32_t)&pbuffer;
327 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
328 dma_init_struct.memory_inc_enable = TRUE;
329 dma_init_struct.peripheral_base_addr = (uint32_t)(&SPI1->dt);
330 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
331 dma_init_struct.peripheral_inc_enable = FALSE;
332 dma_init_struct.priority = DMA_PRIORITY_VERY_HIGH;
333 dma_init_struct.loop_mode_enable = FALSE;
334 dma_init(DMA1_CHANNEL3, &dma_init_struct);
335
336 spi_i2s_dma_transmitter_enable(SPI1, TRUE);
337 spi_i2s_dma_receiver_enable(SPI1, TRUE);
338
339 dma_channel_enable(DMA1_CHANNEL2, TRUE);
340 dma_channel_enable(DMA1_CHANNEL3, TRUE);
341
342 while(dma_flag_get(DMA1_FDT2_FLAG) == RESET);
343 dma_flag_clear(DMA1_FDT2_FLAG);
344
345 dma_channel_enable(DMA1_CHANNEL2, FALSE);
346 dma_channel_enable(DMA1_CHANNEL3, FALSE);
347
348 spi_i2s_dma_transmitter_enable(SPI1, FALSE);
349 spi_i2s_dma_receiver_enable(SPI1, FALSE);
350#else
351 while(length--)
352 {
353 while(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) == RESET);
354 spi_i2s_data_transmit(SPI1, *pbuffer);
355 while(spi_i2s_flag_get(SPI1, SPI_I2S_RDBF_FLAG) == RESET);
356 dummy_data = spi_i2s_data_receive(SPI1);
357 pbuffer++;
358 }
359#endif
360}
361
368void spi_bytes_read(uint8_t *pbuffer, uint32_t length)
369{
370 uint8_t write_value = FLASH_SPI_DUMMY_BYTE;
371
372#if defined(SPI_TRANS_DMA)
373 dma_init_type dma_init_struct;
374 dma_reset(DMA1_CHANNEL2);
375 dma_reset(DMA1_CHANNEL3);
376 dma_default_para_init(&dma_init_struct);
377 dma_init_struct.buffer_size = length;
378 dma_init_struct.direction = DMA_DIR_MEMORY_TO_PERIPHERAL;
379 dma_init_struct.memory_base_addr = (uint32_t)&write_value;
380 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
381 dma_init_struct.memory_inc_enable = FALSE;
382 dma_init_struct.peripheral_base_addr = (uint32_t)(&SPI1->dt);
383 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
384 dma_init_struct.peripheral_inc_enable = FALSE;
385 dma_init_struct.priority = DMA_PRIORITY_VERY_HIGH;
386 dma_init_struct.loop_mode_enable = FALSE;
387 dma_init(DMA1_CHANNEL3, &dma_init_struct);
388
389 dma_init_struct.buffer_size = length;
390 dma_init_struct.direction = DMA_DIR_PERIPHERAL_TO_MEMORY;
391 dma_init_struct.memory_base_addr = (uint32_t)pbuffer;
392 dma_init_struct.memory_data_width = DMA_MEMORY_DATA_WIDTH_BYTE;
393 dma_init_struct.memory_inc_enable = TRUE;
394 dma_init_struct.peripheral_base_addr = (uint32_t)(&SPI1->dt);
395 dma_init_struct.peripheral_data_width = DMA_PERIPHERAL_DATA_WIDTH_BYTE;
396 dma_init_struct.peripheral_inc_enable = FALSE;
397 dma_init_struct.priority = DMA_PRIORITY_VERY_HIGH;
398 dma_init_struct.loop_mode_enable = FALSE;
399 dma_init(DMA1_CHANNEL2, &dma_init_struct);
400
401 spi_i2s_dma_transmitter_enable(SPI1, TRUE);
402 spi_i2s_dma_receiver_enable(SPI1, TRUE);
403 dma_channel_enable(DMA1_CHANNEL2, TRUE);
404 dma_channel_enable(DMA1_CHANNEL3, TRUE);
405
406 while(dma_flag_get(DMA1_FDT2_FLAG) == RESET);
407 dma_flag_clear(DMA1_FDT2_FLAG);
408
409 dma_channel_enable(DMA1_CHANNEL2, FALSE);
410 dma_channel_enable(DMA1_CHANNEL3, FALSE);
411
412 spi_i2s_dma_transmitter_enable(SPI1, FALSE);
413 spi_i2s_dma_receiver_enable(SPI1, FALSE);
414#else
415 while(length--)
416 {
417 while(spi_i2s_flag_get(SPI1, SPI_I2S_TDBE_FLAG) == RESET);
418 spi_i2s_data_transmit(SPI1, write_value);
419 while(spi_i2s_flag_get(SPI1, SPI_I2S_RDBF_FLAG) == RESET);
420 *pbuffer = spi_i2s_data_receive(SPI1);
421 pbuffer++;
422 }
423#endif
424}
425
431void spiflash_wait_busy(void)
432{
433 while((spiflash_read_sr1() & 0x01) == 0x01);
434}
435
441uint8_t spiflash_read_sr1(void)
442{
443 uint8_t breadbyte = 0;
444 FLASH_CS_LOW();
445 spi_byte_write(SPIF_READSTATUSREG1);
446 breadbyte = (uint8_t)spi_byte_read();
447 FLASH_CS_HIGH();
448 return (breadbyte);
449}
450
456void spiflash_write_enable(void)
457{
458 FLASH_CS_LOW();
459 spi_byte_write(SPIF_WRITEENABLE);
460 FLASH_CS_HIGH();
461}
462
468uint16_t spiflash_read_id(void)
469{
470 uint16_t wreceivedata = 0;
471 FLASH_CS_LOW();
472 spi_byte_write(SPIF_MANUFACTDEVICEID);
473 spi_byte_write(0x00);
474 spi_byte_write(0x00);
475 spi_byte_write(0x00);
476 wreceivedata |= spi_byte_read() << 8;
477 wreceivedata |= spi_byte_read();
478 FLASH_CS_HIGH();
479 return wreceivedata;
480}
481
487uint8_t spi_byte_write(uint8_t data)
488{
489 uint8_t brxbuff;
490 spi_i2s_dma_transmitter_enable(SPI1, FALSE);
491 spi_i2s_dma_receiver_enable(SPI1, FALSE);
492 spi_i2s_data_transmit(SPI1, data);
493 while(spi_i2s_flag_get(SPI1, SPI_I2S_RDBF_FLAG) == RESET);
494 brxbuff = spi_i2s_data_receive(SPI1);
495 while(spi_i2s_flag_get(SPI1, SPI_I2S_BF_FLAG) != RESET);
496 return brxbuff;
497}
498
504uint8_t spi_byte_read(void)
505{
506 return (spi_byte_write(FLASH_SPI_DUMMY_BYTE));
507}
508
dma_init_struct
dma_init_type dma_init_struct
Definition: project/at_start_f415/examples/dma/data_to_gpio_flexible/src/main.c:39
spi_init_struct
spi_init_type spi_init_struct
Definition: project/at_start_f415/examples/spi/fullduplex_polling/src/main.c:40
spiflash_init
void spiflash_init(void)
spi configuration.
Definition: spi_flash.c:44
spiflash_write
void spiflash_write(uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write data to flash
Definition: spi_flash.c:99
spiflash_wait_busy
void spiflash_wait_busy(void)
wait program done
Definition: spi_flash.c:431
spiflash_write_enable
void spiflash_write_enable(void)
enable write operation
Definition: spi_flash.c:456
spiflash_read_sr1
uint8_t spiflash_read_sr1(void)
read sr1 register
Definition: spi_flash.c:441
spiflash_write_nocheck
void spiflash_write_nocheck(uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write data without check
Definition: spi_flash.c:224
spiflash_sector_erase
void spiflash_sector_erase(uint32_t erase_addr)
erase a sector data
Definition: spi_flash.c:203
spi_byte_write
uint8_t spi_byte_write(uint8_t data)
write a byte to flash
Definition: spi_flash.c:487
spiflash_read
void spiflash_read(uint8_t *pbuffer, uint32_t read_addr, uint32_t length)
read data from flash
Definition: spi_flash.c:187
spiflash_read_id
uint16_t spiflash_read_id(void)
read device id
Definition: spi_flash.c:468
spi_bytes_read
void spi_bytes_read(uint8_t *pbuffer, uint32_t length)
read data continuously
Definition: spi_flash.c:368
spi_bytes_write
void spi_bytes_write(uint8_t *pbuffer, uint32_t length)
write data continuously
Definition: spi_flash.c:303
spiflash_sector_buf
uint8_t spiflash_sector_buf[SPIF_SECTOR_SIZE]
Definition: spi_flash.c:37
spiflash_page_write
void spiflash_page_write(uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write a page data
Definition: spi_flash.c:272
spi_byte_read
uint8_t spi_byte_read(void)
read a byte to flash
Definition: spi_flash.c:504
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_GPIOA_PERIPH_CLOCK
@ CRM_GPIOA_PERIPH_CLOCK
Definition: at32f415_crm.h:110
CRM_SPI1_PERIPH_CLOCK
@ CRM_SPI1_PERIPH_CLOCK
Definition: at32f415_crm.h:117
CRM_DMA1_PERIPH_CLOCK
@ CRM_DMA1_PERIPH_CLOCK
Definition: at32f415_crm.h:103
dma_channel_enable
void dma_channel_enable(dma_channel_type *dmax_channely, confirm_state new_state)
enable or disable dma channely
Definition: at32f415_dma.c:198
dma_default_para_init
void dma_default_para_init(dma_init_type *dma_init_struct)
dma init config with its default value.
Definition: at32f415_dma.c:360
dma_flag_get
flag_status dma_flag_get(uint32_t dmax_flag)
get dma flag
Definition: at32f415_dma.c:296
dma_flag_clear
void dma_flag_clear(uint32_t dmax_flag)
clear dma flag
Definition: at32f415_dma.c:342
dma_reset
void dma_reset(dma_channel_type *dmax_channely)
reset the dmax channely registers.
Definition: at32f415_dma.c:64
dma_init
void dma_init(dma_channel_type *dmax_channely, dma_init_type *dma_init_struct)
dma init
Definition: at32f415_dma.c:395
DMA_PERIPHERAL_DATA_WIDTH_BYTE
@ DMA_PERIPHERAL_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:238
DMA_DIR_MEMORY_TO_PERIPHERAL
@ DMA_DIR_MEMORY_TO_PERIPHERAL
Definition: at32f415_dma.h:211
DMA_DIR_PERIPHERAL_TO_MEMORY
@ DMA_DIR_PERIPHERAL_TO_MEMORY
Definition: at32f415_dma.h:210
DMA_MEMORY_DATA_WIDTH_BYTE
@ DMA_MEMORY_DATA_WIDTH_BYTE
Definition: at32f415_dma.h:248
DMA_PRIORITY_VERY_HIGH
@ DMA_PRIORITY_VERY_HIGH
Definition: at32f415_dma.h:261
DMA1_FDT2_FLAG
#define DMA1_FDT2_FLAG
Definition: at32f415_dma.h:86
DMA1_CHANNEL3
#define DMA1_CHANNEL3
Definition: at32f415_dma.h:475
DMA1_CHANNEL2
#define DMA1_CHANNEL2
Definition: at32f415_dma.h:474
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_MODE_OUTPUT
@ GPIO_MODE_OUTPUT
Definition: at32f415_gpio.h:229
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
GPIO_PINS_6
#define GPIO_PINS_6
Definition: at32f415_gpio.h:57
GPIO_PINS_7
#define GPIO_PINS_7
Definition: at32f415_gpio.h:58
GPIO_PINS_4
#define GPIO_PINS_4
Definition: at32f415_gpio.h:55
GPIO_PINS_5
#define GPIO_PINS_5
Definition: at32f415_gpio.h:56
GPIOA
#define GPIOA
Definition: at32f415_gpio.h:770
SPI_I2S_TDBE_FLAG
#define SPI_I2S_TDBE_FLAG
Definition: at32f415_spi.h:54
SPI_I2S_RDBF_FLAG
#define SPI_I2S_RDBF_FLAG
Definition: at32f415_spi.h:53
SPI_I2S_BF_FLAG
#define SPI_I2S_BF_FLAG
Definition: at32f415_spi.h:60
spi_i2s_data_transmit
void spi_i2s_data_transmit(spi_type *spi_x, uint16_t tx_data)
spi/i2s data transmit
Definition: at32f415_spi.c:514
spi_i2s_dma_receiver_enable
void spi_i2s_dma_receiver_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma receiver mode.
Definition: at32f415_spi.c:499
spi_i2s_flag_get
flag_status spi_i2s_flag_get(spi_type *spi_x, uint32_t spi_i2s_flag)
get flag of the specified spi/i2s peripheral.
Definition: at32f415_spi.c:548
spi_init
void spi_init(spi_type *spi_x, spi_init_type *spi_init_struct)
spi init config with its setting value.
Definition: at32f415_spi.c:91
spi_default_para_init
void spi_default_para_init(spi_init_type *spi_init_struct)
spi init config with its default value.
Definition: at32f415_spi.c:71
spi_i2s_data_receive
uint16_t spi_i2s_data_receive(spi_type *spi_x)
spi/i2s data receive
Definition: at32f415_spi.c:526
spi_enable
void spi_enable(spi_type *spi_x, confirm_state new_state)
enable or disable spi.
Definition: at32f415_spi.c:287
spi_i2s_dma_transmitter_enable
void spi_i2s_dma_transmitter_enable(spi_type *spi_x, confirm_state new_state)
enable or disable the spi/i2s dma transmitter mode.
Definition: at32f415_spi.c:485
SPI_MODE_MASTER
@ SPI_MODE_MASTER
Definition: at32f415_spi.h:99
SPI_CLOCK_PHASE_2EDGE
@ SPI_CLOCK_PHASE_2EDGE
Definition: at32f415_spi.h:117
SPI_CS_SOFTWARE_MODE
@ SPI_CS_SOFTWARE_MODE
Definition: at32f415_spi.h:126
SPI_FIRST_BIT_MSB
@ SPI_FIRST_BIT_MSB
Definition: at32f415_spi.h:151
SPI_CLOCK_POLARITY_HIGH
@ SPI_CLOCK_POLARITY_HIGH
Definition: at32f415_spi.h:108
SPI_TRANSMIT_FULL_DUPLEX
@ SPI_TRANSMIT_FULL_DUPLEX
Definition: at32f415_spi.h:160
SPI_MCLK_DIV_8
@ SPI_MCLK_DIV_8
Definition: at32f415_spi.h:136
SPI_FRAME_8BIT
@ SPI_FRAME_8BIT
Definition: at32f415_spi.h:89
FLASH_CS_LOW
#define FLASH_CS_LOW()
Definition: spi_flash.h:53
FLASH_CS_HIGH
#define FLASH_CS_HIGH()
Definition: spi_flash.h:52
SPIF_READDATA
#define SPIF_READDATA
Definition: spi_flash.h:96
SPIF_PAGE_SIZE
#define SPIF_PAGE_SIZE
Definition: spi_flash.h:83
SPIF_SECTORERASE
#define SPIF_SECTORERASE
Definition: spi_flash.h:102
SPIF_MANUFACTDEVICEID
#define SPIF_MANUFACTDEVICEID
Definition: spi_flash.h:107
FLASH_SPI_DUMMY_BYTE
#define FLASH_SPI_DUMMY_BYTE
Definition: spi_flash.h:109
SPIF_SECTOR_SIZE
#define SPIF_SECTOR_SIZE
Definition: spi_flash.h:82
SPIF_READSTATUSREG1
#define SPIF_READSTATUSREG1
Definition: spi_flash.h:88
SPIF_PAGEPROGRAM
#define SPIF_PAGEPROGRAM
Definition: spi_flash.h:99
SPIF_WRITEENABLE
#define SPIF_WRITEENABLE
Definition: spi_flash.h:85
SPI1
#define SPI1
Definition: at32f415_spi.h:448
spi_flash.h
header file of spi_flash
dma_init_type
dma init type
Definition: at32f415_dma.h:268
dma_init_type::loop_mode_enable
confirm_state loop_mode_enable
Definition: at32f415_dma.h:277
dma_init_type::buffer_size
uint16_t buffer_size
Definition: at32f415_dma.h:272
dma_init_type::memory_data_width
dma_memory_data_size_type memory_data_width
Definition: at32f415_dma.h:276
dma_init_type::priority
dma_priority_level_type priority
Definition: at32f415_dma.h:278
dma_init_type::peripheral_inc_enable
confirm_state peripheral_inc_enable
Definition: at32f415_dma.h:273
dma_init_type::memory_inc_enable
confirm_state memory_inc_enable
Definition: at32f415_dma.h:274
dma_init_type::direction
dma_dir_type direction
Definition: at32f415_dma.h:271
dma_init_type::peripheral_base_addr
uint32_t peripheral_base_addr
Definition: at32f415_dma.h:269
dma_init_type::memory_base_addr
uint32_t memory_base_addr
Definition: at32f415_dma.h:270
dma_init_type::peripheral_data_width
dma_peripheral_data_size_type peripheral_data_width
Definition: at32f415_dma.h:275
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
spi_init_type
spi init type
Definition: at32f415_spi.h:257
spi_init_type::master_slave_mode
spi_master_slave_mode_type master_slave_mode
Definition: at32f415_spi.h:259
spi_init_type::first_bit_transmission
spi_first_bit_type first_bit_transmission
Definition: at32f415_spi.h:261
spi_init_type::frame_bit_num
spi_frame_bit_num_type frame_bit_num
Definition: at32f415_spi.h:262
spi_init_type::clock_polarity
spi_clock_polarity_type clock_polarity
Definition: at32f415_spi.h:263
spi_init_type::cs_mode_selection
spi_cs_mode_type cs_mode_selection
Definition: at32f415_spi.h:265
spi_init_type::mclk_freq_division
spi_mclk_freq_div_type mclk_freq_division
Definition: at32f415_spi.h:260
spi_init_type::transmission_mode
spi_transmission_mode_type transmission_mode
Definition: at32f415_spi.h:258
spi_init_type::clock_phase
spi_clock_phase_type clock_phase
Definition: at32f415_spi.h:264


AT32F415 Firmwary Library: spi_flash.h Source File

  • spi
  • w25q_flash
  • inc
spi_flash.h
Go to the documentation of this file.
1
27#ifndef __SPI_FLASH_H
28#define __SPI_FLASH_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "at32f415.h"
35
45 /* use dma transfer spi data */
46//#define SPI_TRANS_DMA
47
52#define FLASH_CS_HIGH() gpio_bits_set(GPIOA, GPIO_PINS_4)
53#define FLASH_CS_LOW() gpio_bits_reset(GPIOA, GPIO_PINS_4)
54
63/*
64 * flash define
65 */
66#define W25Q80 0xEF13
67#define W25Q16 0xEF14
68#define W25Q32 0xEF15
69#define W25Q64 0xEF16
70/* 16mb, the range of address:0~0xFFFFFF */
71#define W25Q128 0xEF17
72
81#define SPIF_CHIP_SIZE 0x1000000
82#define SPIF_SECTOR_SIZE 4096
83#define SPIF_PAGE_SIZE 256
84
85#define SPIF_WRITEENABLE 0x06
86#define SPIF_WRITEDISABLE 0x04
87/* s7-s0 */
88#define SPIF_READSTATUSREG1 0x05
89#define SPIF_WRITESTATUSREG1 0x01
90/* s15-s8 */
91#define SPIF_READSTATUSREG2 0x35
92#define SPIF_WRITESTATUSREG2 0x31
93/* s23-s16 */
94#define SPIF_READSTATUSREG3 0x15
95#define SPIF_WRITESTATUSREG3 0x11
96#define SPIF_READDATA 0x03
97#define SPIF_FASTREADDATA 0x0B
98#define SPIF_FASTREADDUAL 0x3B
99#define SPIF_PAGEPROGRAM 0x02
100/* block size:64kb */
101#define SPIF_BLOCKERASE 0xD8
102#define SPIF_SECTORERASE 0x20
103#define SPIF_CHIPERASE 0xC7
104#define SPIF_POWERDOWN 0xB9
105#define SPIF_RELEASEPOWERDOWN 0xAB
106#define SPIF_DEVICEID 0xAB
107#define SPIF_MANUFACTDEVICEID 0x90
108#define SPIF_JEDECDEVICEID 0x9F
109#define FLASH_SPI_DUMMY_BYTE 0xA5
110
119void spiflash_init(void);
120void spiflash_write(uint8_t *pbuffer, uint32_t write_addr, uint32_t length);
121void spiflash_read(uint8_t *pbuffer, uint32_t read_addr, uint32_t length);
122void spiflash_sector_erase(uint32_t erase_addr);
123void spiflash_write_nocheck(uint8_t *pbuffer, uint32_t write_addr, uint32_t length);
124void spiflash_page_write(uint8_t *pbuffer, uint32_t write_addr, uint32_t length);
125void spi_bytes_write(uint8_t *pbuffer, uint32_t length);
126void spi_bytes_read(uint8_t *pbuffer, uint32_t length);
127void spiflash_wait_busy(void);
128uint8_t spiflash_read_sr1(void);
129void spiflash_write_enable(void);
130uint16_t spiflash_read_id(void);
131uint8_t spi_byte_write(uint8_t data);
132uint8_t spi_byte_read(void);
133
146#ifdef __cplusplus
147}
148#endif
149
150#endif
151
at32f415.h
at32f415 header file
spiflash_init
void spiflash_init(void)
spi configuration.
Definition: spi_flash.c:44
spiflash_write
void spiflash_write(uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write data to flash
Definition: spi_flash.c:99
spiflash_wait_busy
void spiflash_wait_busy(void)
wait program done
Definition: spi_flash.c:431
spiflash_write_enable
void spiflash_write_enable(void)
enable write operation
Definition: spi_flash.c:456
spiflash_read_sr1
uint8_t spiflash_read_sr1(void)
read sr1 register
Definition: spi_flash.c:441
spiflash_write_nocheck
void spiflash_write_nocheck(uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write data without check
Definition: spi_flash.c:224
spiflash_sector_erase
void spiflash_sector_erase(uint32_t erase_addr)
erase a sector data
Definition: spi_flash.c:203
spi_byte_write
uint8_t spi_byte_write(uint8_t data)
write a byte to flash
Definition: spi_flash.c:487
spiflash_read
void spiflash_read(uint8_t *pbuffer, uint32_t read_addr, uint32_t length)
read data from flash
Definition: spi_flash.c:187
spiflash_read_id
uint16_t spiflash_read_id(void)
read device id
Definition: spi_flash.c:468
spi_bytes_read
void spi_bytes_read(uint8_t *pbuffer, uint32_t length)
read data continuously
Definition: spi_flash.c:368
spi_bytes_write
void spi_bytes_write(uint8_t *pbuffer, uint32_t length)
write data continuously
Definition: spi_flash.c:303
spiflash_page_write
void spiflash_page_write(uint8_t *pbuffer, uint32_t write_addr, uint32_t length)
write a page data
Definition: spi_flash.c:272
spi_byte_read
uint8_t spi_byte_read(void)
read a byte to flash
Definition: spi_flash.c:504


AT32F415 Firmwary Library: system_at32f415.c Source File

  • libraries
  • cmsis
  • cm4
  • device_support
system_at32f415.c
Go to the documentation of this file.
1
35#include "at32f415.h"
36
40#define VECT_TAB_OFFSET 0x0
48unsigned int system_core_clock = HICK_VALUE;
64void SystemInit (void)
65{
66 /* reset the crm clock configuration to the default reset state(for debug purpose) */
67 /* set hicken bit */
68 CRM->ctrl_bit.hicken = TRUE;
69
70 /* wait hick stable */
71 while(CRM->ctrl_bit.hickstbl != SET);
72
73 /* hick used as system clock */
74 CRM->cfg_bit.sclksel = CRM_SCLK_HICK;
75
76 /* wait sclk switch status */
77 while(CRM->cfg_bit.sclksts != CRM_SCLK_HICK);
78
79 /* reset cfg register, include sclk switch, ahbdiv, apb1div, apb2div, adcdiv,
80 clkout pllrcs, pllhextdiv, pllmult, usbdiv and pllrange bits */
81 CRM->cfg = 0;
82
83 /* reset pllfr, pllms, pllns and pllfref bits */
84 CRM->pll = (0x00001F10U);
85
86 /* reset hexten, hextbyps, cfden and pllen bits */
87 CRM->ctrl &= ~(0x010D0000U);
88
89 /* reset clkout[3], usbbufs, hickdiv, clkoutdiv */
90 CRM->misc1 = 0x00100000;
91
92 /* disable all interrupts enable and clear pending bits */
93 CRM->clkint = 0x009F0000;
94
95#ifdef VECT_TAB_SRAM
96 SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* vector table relocation in internal sram. */
97#else
98 SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* vector table relocation in internal flash. */
99#endif
100}
101
110void system_core_clock_update(void)
111{
112 uint32_t pll_mult = 0, pll_mult_h = 0, pll_clock_source = 0, temp = 0, div_value = 0;
113 uint32_t pllrcsfreq = 0, pll_ms = 0, pll_ns = 0, pll_fr = 0;
114 crm_sclk_type sclk_source;
115
116 static const uint8_t sys_ahb_div_table[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
117
118 /* get sclk source */
119 sclk_source = crm_sysclk_switch_status_get();
120
121 switch(sclk_source)
122 {
123 case CRM_SCLK_HICK:
124 if(((CRM->misc2_bit.hick_to_sclk) != RESET) && ((CRM->misc1_bit.hickdiv) != RESET))
125 system_core_clock = HICK_VALUE * 6;
126 else
127 system_core_clock = HICK_VALUE;
128 break;
129 case CRM_SCLK_HEXT:
130 system_core_clock = HEXT_VALUE;
131 break;
132 case CRM_SCLK_PLL:
133 pll_clock_source = CRM->cfg_bit.pllrcs;
134 if(CRM->pll_bit.pllcfgen == FALSE)
135 {
136 /* get multiplication factor */
137 pll_mult = CRM->cfg_bit.pllmult_l;
138 pll_mult_h = CRM->cfg_bit.pllmult_h;
139 /* process high bits */
140 if((pll_mult_h != 0U) || (pll_mult == 15U)){
141 pll_mult += ((16U * pll_mult_h) + 1U);
142 }
143 else
144 {
145 pll_mult += 2U;
146 }
147
148 if (pll_clock_source == 0x00)
149 {
150 /* hick divided by 2 selected as pll clock entry */
151 system_core_clock = (HICK_VALUE >> 1) * pll_mult;
152 }
153 else
154 {
155 /* hext selected as pll clock entry */
156 if (CRM->cfg_bit.pllhextdiv != RESET)
157 {
158 /* hext clock divided by 2 */
159 system_core_clock = (HEXT_VALUE / 2) * pll_mult;
160 }
161 else
162 {
163 system_core_clock = HEXT_VALUE * pll_mult;
164 }
165 }
166 }
167 else
168 {
169 pll_ms = CRM->pll_bit.pllms;
170 pll_ns = CRM->pll_bit.pllns;
171 pll_fr = CRM->pll_bit.pllfr;
172
173 if (pll_clock_source == 0x00)
174 {
175 /* hick divided by 2 selected as pll clock entry */
176 pllrcsfreq = (HICK_VALUE >> 1);
177 }
178 else
179 {
180 /* hext selected as pll clock entry */
181 if (CRM->cfg_bit.pllhextdiv != RESET)
182 {
183 /* hext clock divided by 2 */
184 pllrcsfreq = (HEXT_VALUE / 2);
185 }
186 else
187 {
188 pllrcsfreq = HEXT_VALUE;
189 }
190 }
191 system_core_clock = (pllrcsfreq * pll_ns) / (pll_ms * (0x1 << pll_fr));
192 }
193 break;
194 default:
195 system_core_clock = HICK_VALUE;
196 break;
197 }
198
199 /* compute sclk, ahbclk frequency */
200 /* get ahb division */
201 temp = CRM->cfg_bit.ahbdiv;
202 div_value = sys_ahb_div_table[temp];
203 /* ahbclk frequency */
204 system_core_clock = system_core_clock >> div_value;
205}
at32f415.h
at32f415 header file
div_value
uint16_t div_value
Definition: project/at_start_f415/examples/tmr/oc_high/src/main.c:44
VECT_TAB_OFFSET
#define VECT_TAB_OFFSET
Definition: system_at32f415.c:40
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
SystemInit
void SystemInit(void)
setup the microcontroller system initialize the flash interface.
Definition: system_at32f415.c:64
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_sclk_type
crm_sclk_type
crm sclk select
Definition: at32f415_crm.h:401
CRM_SCLK_HICK
@ CRM_SCLK_HICK
Definition: at32f415_crm.h:402
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_SCLK_HEXT
@ CRM_SCLK_HEXT
Definition: at32f415_crm.h:403
CRM
#define CRM
Definition: at32f415_crm.h:858
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
SRAM_BASE
#define SRAM_BASE
Definition: at32f415.h:288
FLASH_BASE
#define FLASH_BASE
Definition: at32f415.h:285
HEXT_VALUE
#define HEXT_VALUE
in the following line adjust the value of high speed exernal crystal (hext) used in your application ...
Definition: project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h:42
HICK_VALUE
#define HICK_VALUE
Definition: project/at_start_f415/examples/adc/current_vref_value_check/inc/at32f415_conf.h:50


AT32F415 Firmwary Library: system_at32f415.h Source File

  • libraries
  • cmsis
  • cm4
  • device_support
system_at32f415.h
Go to the documentation of this file.
1
27#ifndef __SYSTEM_AT32F415_H
28#define __SYSTEM_AT32F415_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
46#define HEXT_STABLE_DELAY (5000u)
47#define PLL_STABLE_DELAY (500u)
48
57extern unsigned int system_core_clock;
67extern void SystemInit(void);
68extern void system_core_clock_update(void);
69
82#ifdef __cplusplus
83}
84#endif
85
86#endif
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
SystemInit
void SystemInit(void)
setup the microcontroller system initialize the flash interface.
Definition: system_at32f415.c:64
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48


AT32F415 Firmwary Library: usb_core.c Source File

  • middlewares
  • usb_drivers
  • src
usb_core.c
Go to the documentation of this file.
1
26#include "usb_core.h"
27
41 usb_sts_type usb_core_config(otg_core_type *udev, uint8_t core_id);
42
49 usb_sts_type usb_core_config(otg_core_type *otgdev, uint8_t core_id)
50{
51 /* set usb speed and core id */
52 otgdev->cfg.speed = core_id;
53 otgdev->cfg.core_id = core_id;
54
55 /* default sof out and vbus ignore */
56 otgdev->cfg.sof_out = FALSE;
57 otgdev->cfg.vbusig = FALSE;
58
59 /* set max size */
60 otgdev->cfg.max_size = 64;
61
62 /* set support number of channel and endpoint */
63#ifdef USE_OTG_HOST_MODE
64 otgdev->cfg.hc_num = USB_HOST_CHANNEL_NUM;
65#endif
66#ifdef USE_OTG_DEVICE_MODE
67 otgdev->cfg.ept_num = USB_EPT_MAX_NUM;
68#endif
69 otgdev->cfg.fifo_size = OTG_FIFO_SIZE;
70 if(core_id == USB_FULL_SPEED_CORE_ID)
71 {
72 otgdev->cfg.phy_itface = 2;
73 }
74#ifdef USB_SOF_OUTPUT_ENABLE
75 otgdev->cfg.sof_out = TRUE;
76#endif
77
78#ifdef USB_VBUS_IGNORE
89 otgdev->cfg.vbusig = TRUE;
90#endif
91
92 return USB_OK;
93}
94
95#ifdef USE_OTG_DEVICE_MODE
108 usb_sts_type usbd_init(otg_core_type *otgdev,
109 uint8_t core_id, uint8_t usb_id,
110 usbd_class_handler *class_handler,
111 usbd_desc_handler *desc_handler)
112{
113 usb_sts_type usb_sts = USB_OK;
114
115 /* select use OTG1 or OTG2 */
116 otgdev->usb_reg = usb_global_select_core(usb_id);
117
118 /* usb device core config */
119 usb_core_config(otgdev, core_id);
120
121 if(otgdev->cfg.sof_out)
122 {
123 otgdev->usb_reg->gccfg_bit.sofouten = TRUE;
124 }
125
126 if(otgdev->cfg.vbusig)
127 {
138 otgdev->usb_reg->gccfg_bit.vbusig = TRUE;
139 }
140
141 /* usb device core init */
142 usbd_core_init(&(otgdev->dev), otgdev->usb_reg,
143 class_handler,
144 desc_handler,
145 core_id);
146
147 return usb_sts;
148}
149#endif
150
151#ifdef USE_OTG_HOST_MODE
152
165 usb_sts_type usbh_init(otg_core_type *otgdev,
166 uint8_t core_id, uint8_t usb_id,
167 usbh_class_handler_type *class_handler,
168 usbh_user_handler_type *user_handler)
169{
170 usb_sts_type status = USB_OK;
171
172 /* select use otg1 or otg2 */
173 otgdev->usb_reg = usb_global_select_core(usb_id);
174
175 /* usb core config */
176 usb_core_config(otgdev, core_id);
177
178 if(otgdev->cfg.sof_out)
179 {
180 otgdev->usb_reg->gccfg_bit.sofouten = TRUE;
181 }
182
183 if(otgdev->cfg.vbusig)
184 {
195 otgdev->usb_reg->gccfg_bit.vbusig = TRUE;
196 }
197
198 /* usb host core init */
199 usbh_core_init(&otgdev->host, otgdev->usb_reg,
200 class_handler,
201 user_handler,
202 core_id);
203
204 return status;
205}
206#endif
207
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
class_handler
usbd_class_handler class_handler
Definition: cdc_class.c:75
desc_handler
usbd_desc_handler desc_handler
device descriptor handler structure
Definition: cdc_desc.c:64
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
usb_core_config
usb_sts_type usb_core_config(otg_core_type *udev, uint8_t core_id)
usb core config
Definition: usb_core.c:49
usb_global_select_core
otg_global_type * usb_global_select_core(uint8_t usb_id)
usb global select usb core (otg1 or otg2).
Definition: at32f415_usb.c:103
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_OK
@ USB_OK
Definition: usb_std.h:218
usbd_core_init
usb_sts_type usbd_core_init(usbd_core_type *udev, usb_reg_type *usb_reg, usbd_class_handler *class_handler, usbd_desc_handler *desc_handler, uint8_t core_id)
usb device core initialization
Definition: usbd_core.c:740
usbh_core_init
usb_sts_type usbh_core_init(usbh_core_type *uhost, usb_reg_type *usb_reg, usbh_class_handler_type *class_handler, usbh_user_handler_type *user_handler, uint8_t core_id)
usb host core initialize
Definition: usbh_core.c:496
OTG_FIFO_SIZE
#define OTG_FIFO_SIZE
otg fifo size (word)
Definition: at32f415_usb.h:316
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
otg_core_type::cfg
usb_core_cfg cfg
Definition: usb_core.h:111
otg_core_type::usb_reg
usb_reg_type * usb_reg
Definition: usb_core.h:102
otg_global_type::vbusig
__IO uint32_t vbusig
ignore vbus detection, only available in at32f415xx revision C. at32f415xx revision B: (not support) ...
Definition: at32f415_usb.h:739
otg_global_type::sofouten
__IO uint32_t sofouten
Definition: at32f415_usb.h:727
otg_global_type::gccfg_bit
struct otg_global_type::@699::@719 gccfg_bit
usb_core_cfg::sof_out
uint8_t sof_out
Definition: usb_core.h:83
usb_core_cfg::fifo_size
uint16_t fifo_size
Definition: usb_core.h:79
usb_core_cfg::hc_num
uint8_t hc_num
Definition: usb_core.h:75
usb_core_cfg::vbusig
uint8_t vbusig
Definition: usb_core.h:86
usb_core_cfg::phy_itface
uint8_t phy_itface
Definition: usb_core.h:80
usb_core_cfg::core_id
uint8_t core_id
Definition: usb_core.h:81
usb_core_cfg::speed
uint8_t speed
Definition: usb_core.h:73
usb_core_cfg::max_size
uint16_t max_size
Definition: usb_core.h:78
usb_core_cfg::ept_num
uint8_t ept_num
Definition: usb_core.h:76
usb_core.h
usb core header file


AT32F415 Firmwary Library: usb_core.h Source File

  • middlewares
  • usb_drivers
  • inc
usb_core.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CORE_H
29#define __USB_CORE_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36#include "usb_std.h"
37#include "usb_conf.h"
38
39#ifdef USE_OTG_DEVICE_MODE
40#include "usbd_core.h"
41#endif
42#ifdef USE_OTG_HOST_MODE
43#include "usbh_core.h"
44#endif
45
61typedef enum
62{
63 USB_LOW_SPEED_CORE_ID,
64 USB_FULL_SPEED_CORE_ID,
65 USB_HIGH_SPEED_CORE_ID,
66} usb_speed_type;
67
71typedef struct
72{
73 uint8_t speed;
74 uint8_t dma_en;
75 uint8_t hc_num;
76 uint8_t ept_num;
78 uint16_t max_size;
79 uint16_t fifo_size;
80 uint8_t phy_itface;
81 uint8_t core_id;
82 uint8_t low_power;
83 uint8_t sof_out;
84 uint8_t usb_id;
86 uint8_t vbusig;
95} usb_core_cfg;
96
100typedef struct
101{
102 usb_reg_type *usb_reg;
103#ifdef USE_OTG_DEVICE_MODE
104 usbd_core_type dev;
105#endif
106
107#ifdef USE_OTG_HOST_MODE
108 usbh_core_type host;
109#endif
110
111 usb_core_cfg cfg;
113} otg_core_type;
114
115 usb_sts_type usb_core_config(otg_core_type *otgdev, uint8_t core_id);
116#ifdef USE_OTG_DEVICE_MODE
117 usb_sts_type usbd_init(otg_core_type *udev,
118 uint8_t core_id, uint8_t usb_id,
119 usbd_class_handler *class_handler,
120 usbd_desc_handler *desc_handler);
121#endif
122
123#ifdef USE_OTG_HOST_MODE
124 usb_sts_type usbh_init(otg_core_type *hdev,
125 uint8_t core_id, uint8_t usb_id,
126 usbh_class_handler_type *class_handler,
127 usbh_user_handler_type *user_handler);
128#endif
140#ifdef __cplusplus
141}
142#endif
143
144#endif
145
class_handler
usbd_class_handler class_handler
Definition: cdc_class.c:75
desc_handler
usbd_desc_handler desc_handler
device descriptor handler structure
Definition: cdc_desc.c:64
usb_speed_type
usb_speed_type
usb core speed select
Definition: usb_core.h:62
usb_core_config
usb_sts_type usb_core_config(otg_core_type *otgdev, uint8_t core_id)
usb core config
Definition: usb_core.c:49
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
USB_HIGH_SPEED_CORE_ID
@ USB_HIGH_SPEED_CORE_ID
Definition: usb_core.h:65
USB_LOW_SPEED_CORE_ID
@ USB_LOW_SPEED_CORE_ID
Definition: usb_core.h:63
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
otg_core_type::cfg
usb_core_cfg cfg
Definition: usb_core.h:111
otg_core_type::usb_reg
usb_reg_type * usb_reg
Definition: usb_core.h:102
otg_global_type
Definition: at32f415_usb.h:473
usb_core_cfg
usb core cofig struct
Definition: usb_core.h:72
usb_core_cfg::sof_out
uint8_t sof_out
Definition: usb_core.h:83
usb_core_cfg::fifo_size
uint16_t fifo_size
Definition: usb_core.h:79
usb_core_cfg::hc_num
uint8_t hc_num
Definition: usb_core.h:75
usb_core_cfg::usb_id
uint8_t usb_id
Definition: usb_core.h:84
usb_core_cfg::vbusig
uint8_t vbusig
Definition: usb_core.h:86
usb_core_cfg::phy_itface
uint8_t phy_itface
Definition: usb_core.h:80
usb_core_cfg::core_id
uint8_t core_id
Definition: usb_core.h:81
usb_core_cfg::speed
uint8_t speed
Definition: usb_core.h:73
usb_core_cfg::max_size
uint16_t max_size
Definition: usb_core.h:78
usb_core_cfg::ept_num
uint8_t ept_num
Definition: usb_core.h:76
usb_core_cfg::low_power
uint8_t low_power
Definition: usb_core.h:82
usb_core_cfg::dma_en
uint8_t dma_en
Definition: usb_core.h:74
usb_std.h
usb standard header file
usbd_core.h
usb device core header file
usbh_core.h
usb host core header file


AT32F415 Firmwary Library: ffconf.h Source File

  • usb_host
  • msc_only_fat32
  • inc
usb_host/msc_only_fat32/inc/ffconf.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------------/
2/ FatFs Functional Configurations
3/---------------------------------------------------------------------------*/
4
5#define FFCONF_DEF 86631 /* Revision ID */
6
7/*---------------------------------------------------------------------------/
8/ Function Configurations
9/---------------------------------------------------------------------------*/
10
11#define FF_FS_READONLY 0
12/* This option switches read-only configuration. (0:Read/Write or 1:Read-only)
13/ Read-only configuration removes writing API functions, f_write(), f_sync(),
14/ f_unlink(), f_mkdir(), f_chmod(), f_rename(), f_truncate(), f_getfree()
15/ and optional writing functions as well. */
16
17
18#define FF_FS_MINIMIZE 0
19/* This option defines minimization level to remove some basic API functions.
20/
21/ 0: Basic functions are fully enabled.
22/ 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename()
23/ are removed.
24/ 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1.
25/ 3: f_lseek() function is removed in addition to 2. */
26
27
28#define FF_USE_FIND 0
29/* This option switches filtered directory read functions, f_findfirst() and
30/ f_findnext(). (0:Disable, 1:Enable 2:Enable with matching altname[] too) */
31
32
33#define FF_USE_MKFS 0
34/* This option switches f_mkfs() function. (0:Disable or 1:Enable) */
35
36
37#define FF_USE_FASTSEEK 0
38/* This option switches fast seek function. (0:Disable or 1:Enable) */
39
40
41#define FF_USE_EXPAND 0
42/* This option switches f_expand function. (0:Disable or 1:Enable) */
43
44
45#define FF_USE_CHMOD 0
46/* This option switches attribute manipulation functions, f_chmod() and f_utime().
47/ (0:Disable or 1:Enable) Also FF_FS_READONLY needs to be 0 to enable this option. */
48
49
50#define FF_USE_LABEL 0
51/* This option switches volume label functions, f_getlabel() and f_setlabel().
52/ (0:Disable or 1:Enable) */
53
54
55#define FF_USE_FORWARD 0
56/* This option switches f_forward() function. (0:Disable or 1:Enable) */
57
58
59#define FF_USE_STRFUNC 0
60#define FF_PRINT_LLI 0
61#define FF_PRINT_FLOAT 0
62#define FF_STRF_ENCODE 0
63/* FF_USE_STRFUNC switches string functions, f_gets(), f_putc(), f_puts() and
64/ f_printf().
65/
66/ 0: Disable. FF_PRINT_LLI, FF_PRINT_FLOAT and FF_STRF_ENCODE have no effect.
67/ 1: Enable without LF-CRLF conversion.
68/ 2: Enable with LF-CRLF conversion.
69/
70/ FF_PRINT_LLI = 1 makes f_printf() support long long argument and FF_PRINT_FLOAT = 1/2
71 makes f_printf() support floating point argument. These features want C99 or later.
72/ When FF_LFN_UNICODE >= 1 with LFN enabled, string functions convert the character
73/ encoding in it. FF_STRF_ENCODE selects assumption of character encoding ON THE FILE
74/ to be read/written via those functions.
75/
76/ 0: ANSI/OEM in current CP
77/ 1: Unicode in UTF-16LE
78/ 2: Unicode in UTF-16BE
79/ 3: Unicode in UTF-8
80*/
81
82
83/*---------------------------------------------------------------------------/
84/ Locale and Namespace Configurations
85/---------------------------------------------------------------------------*/
86
87#define FF_CODE_PAGE 932
88/* This option specifies the OEM code page to be used on the target system.
89/ Incorrect code page setting can cause a file open failure.
90/
91/ 437 - U.S.
92/ 720 - Arabic
93/ 737 - Greek
94/ 771 - KBL
95/ 775 - Baltic
96/ 850 - Latin 1
97/ 852 - Latin 2
98/ 855 - Cyrillic
99/ 857 - Turkish
100/ 860 - Portuguese
101/ 861 - Icelandic
102/ 862 - Hebrew
103/ 863 - Canadian French
104/ 864 - Arabic
105/ 865 - Nordic
106/ 866 - Russian
107/ 869 - Greek 2
108/ 932 - Japanese (DBCS)
109/ 936 - Simplified Chinese (DBCS)
110/ 949 - Korean (DBCS)
111/ 950 - Traditional Chinese (DBCS)
112/ 0 - Include all code pages above and configured by f_setcp()
113*/
114
115
116#define FF_USE_LFN 0
117#define FF_MAX_LFN 255
118/* The FF_USE_LFN switches the support for LFN (long file name).
119/
120/ 0: Disable LFN. FF_MAX_LFN has no effect.
121/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
122/ 2: Enable LFN with dynamic working buffer on the STACK.
123/ 3: Enable LFN with dynamic working buffer on the HEAP.
124/
125/ To enable the LFN, ffunicode.c needs to be added to the project. The LFN function
126/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and
127/ additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled.
128/ The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can
129/ be in range of 12 to 255. It is recommended to be set it 255 to fully support LFN
130/ specification.
131/ When use stack for the working buffer, take care on stack overflow. When use heap
132/ memory for the working buffer, memory management functions, ff_memalloc() and
133/ ff_memfree() exemplified in ffsystem.c, need to be added to the project. */
134
135
136#define FF_LFN_UNICODE 0
137/* This option switches the character encoding on the API when LFN is enabled.
138/
139/ 0: ANSI/OEM in current CP (TCHAR = char)
140/ 1: Unicode in UTF-16 (TCHAR = WCHAR)
141/ 2: Unicode in UTF-8 (TCHAR = char)
142/ 3: Unicode in UTF-32 (TCHAR = DWORD)
143/
144/ Also behavior of string I/O functions will be affected by this option.
145/ When LFN is not enabled, this option has no effect. */
146
147
148#define FF_LFN_BUF 255
149#define FF_SFN_BUF 12
150/* This set of options defines size of file name members in the FILINFO structure
151/ which is used to read out directory items. These values should be suffcient for
152/ the file names to read. The maximum possible length of the read file name depends
153/ on character encoding. When LFN is not enabled, these options have no effect. */
154
155
156#define FF_FS_RPATH 0
157/* This option configures support for relative path.
158/
159/ 0: Disable relative path and remove related functions.
160/ 1: Enable relative path. f_chdir() and f_chdrive() are available.
161/ 2: f_getcwd() function is available in addition to 1.
162*/
163
164
165/*---------------------------------------------------------------------------/
166/ Drive/Volume Configurations
167/---------------------------------------------------------------------------*/
168
169#define FF_VOLUMES 1
170/* Number of volumes (logical drives) to be used. (1-10) */
171
172
173#define FF_STR_VOLUME_ID 0
174#define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3"
175/* FF_STR_VOLUME_ID switches support for volume ID in arbitrary strings.
176/ When FF_STR_VOLUME_ID is set to 1 or 2, arbitrary strings can be used as drive
177/ number in the path name. FF_VOLUME_STRS defines the volume ID strings for each
178/ logical drives. Number of items must not be less than FF_VOLUMES. Valid
179/ characters for the volume ID strings are A-Z, a-z and 0-9, however, they are
180/ compared in case-insensitive. If FF_STR_VOLUME_ID >= 1 and FF_VOLUME_STRS is
181/ not defined, a user defined volume string table needs to be defined as:
182/
183/ const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb",...
184*/
185
186
187#define FF_MULTI_PARTITION 0
188/* This option switches support for multiple volumes on the physical drive.
189/ By default (0), each logical drive number is bound to the same physical drive
190/ number and only an FAT volume found on the physical drive will be mounted.
191/ When this function is enabled (1), each logical drive number can be bound to
192/ arbitrary physical drive and partition listed in the VolToPart[]. Also f_fdisk()
193/ funciton will be available. */
194
195
196#define FF_MIN_SS 512
197#define FF_MAX_SS 512
198/* This set of options configures the range of sector size to be supported. (512,
199/ 1024, 2048 or 4096) Always set both 512 for most systems, generic memory card and
200/ harddisk, but a larger value may be required for on-board flash memory and some
201/ type of optical media. When FF_MAX_SS is larger than FF_MIN_SS, FatFs is configured
202/ for variable sector size mode and disk_ioctl() function needs to implement
203/ GET_SECTOR_SIZE command. */
204
205
206#define FF_LBA64 0
207/* This option switches support for 64-bit LBA. (0:Disable or 1:Enable)
208/ To enable the 64-bit LBA, also exFAT needs to be enabled. (FF_FS_EXFAT == 1) */
209
210
211#define FF_MIN_GPT 0x10000000
212/* Minimum number of sectors to switch GPT as partitioning format in f_mkfs and
213/ f_fdisk function. 0x100000000 max. This option has no effect when FF_LBA64 == 0. */
214
215
216#define FF_USE_TRIM 0
217/* This option switches support for ATA-TRIM. (0:Disable or 1:Enable)
218/ To enable Trim function, also CTRL_TRIM command should be implemented to the
219/ disk_ioctl() function. */
220
221
222
223/*---------------------------------------------------------------------------/
224/ System Configurations
225/---------------------------------------------------------------------------*/
226
227#define FF_FS_TINY 0
228/* This option switches tiny buffer configuration. (0:Normal or 1:Tiny)
229/ At the tiny configuration, size of file object (FIL) is shrinked FF_MAX_SS bytes.
230/ Instead of private sector buffer eliminated from the file object, common sector
231/ buffer in the filesystem object (FATFS) is used for the file data transfer. */
232
233
234#define FF_FS_EXFAT 0
235/* This option switches support for exFAT filesystem. (0:Disable or 1:Enable)
236/ To enable exFAT, also LFN needs to be enabled. (FF_USE_LFN >= 1)
237/ Note that enabling exFAT discards ANSI C (C89) compatibility. */
238
239
240#define FF_FS_NORTC 0
241#define FF_NORTC_MON 1
242#define FF_NORTC_MDAY 1
243#define FF_NORTC_YEAR 2020
244/* The option FF_FS_NORTC switches timestamp functiton. If the system does not have
245/ any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable
246/ the timestamp function. Every object modified by FatFs will have a fixed timestamp
247/ defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time.
248/ To enable timestamp function (FF_FS_NORTC = 0), get_fattime() function need to be
249/ added to the project to read current time form real-time clock. FF_NORTC_MON,
250/ FF_NORTC_MDAY and FF_NORTC_YEAR have no effect.
251/ These options have no effect in read-only configuration (FF_FS_READONLY = 1). */
252
253
254#define FF_FS_NOFSINFO 0
255/* If you need to know correct free space on the FAT32 volume, set bit 0 of this
256/ option, and f_getfree() function at first time after volume mount will force
257/ a full FAT scan. Bit 1 controls the use of last allocated cluster number.
258/
259/ bit0=0: Use free cluster count in the FSINFO if available.
260/ bit0=1: Do not trust free cluster count in the FSINFO.
261/ bit1=0: Use last allocated cluster number in the FSINFO if available.
262/ bit1=1: Do not trust last allocated cluster number in the FSINFO.
263*/
264
265
266#define FF_FS_LOCK 0
267/* The option FF_FS_LOCK switches file lock function to control duplicated file open
268/ and illegal operation to open objects. This option must be 0 when FF_FS_READONLY
269/ is 1.
270/
271/ 0: Disable file lock function. To avoid volume corruption, application program
272/ should avoid illegal open, remove and rename to the open objects.
273/ >0: Enable file lock function. The value defines how many files/sub-directories
274/ can be opened simultaneously under file lock control. Note that the file
275/ lock control is independent of re-entrancy. */
276
277
278/* #include <somertos.h> // O/S definitions */
279#define FF_FS_REENTRANT 0
280#define FF_FS_TIMEOUT 1000
281#define FF_SYNC_t HANDLE
282/* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs
283/ module itself. Note that regardless of this option, file access to different
284/ volume is always re-entrant and volume control functions, f_mount(), f_mkfs()
285/ and f_fdisk() function, are always not re-entrant. Only file/directory access
286/ to the same volume is under control of this function.
287/
288/ 0: Disable re-entrancy. FF_FS_TIMEOUT and FF_SYNC_t have no effect.
289/ 1: Enable re-entrancy. Also user provided synchronization handlers,
290/ ff_req_grant(), ff_rel_grant(), ff_del_syncobj() and ff_cre_syncobj()
291/ function, must be added to the project. Samples are available in
292/ option/syscall.c.
293/
294/ The FF_FS_TIMEOUT defines timeout period in unit of time tick.
295/ The FF_SYNC_t defines O/S dependent sync object type. e.g. HANDLE, ID, OS_EVENT*,
296/ SemaphoreHandle_t and etc. A header file for O/S definitions needs to be
297/ included somewhere in the scope of ff.h. */
298
299
300
301/*--- End of configuration options ---*/


AT32F415 Firmwary Library: usb_std.h Source File

  • middlewares
  • usb_drivers
  • inc
usb_std.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_STD_H
29#define __USB_STD_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* includes ------------------------------------------------------------------*/
37#include "usb_conf.h"
38
54#define USB_REQ_RECIPIENT_DEVICE 0x00
55#define USB_REQ_RECIPIENT_INTERFACE 0x01
56#define USB_REQ_RECIPIENT_ENDPOINT 0x02
57#define USB_REQ_RECIPIENT_OTHER 0x03
58#define USB_REQ_RECIPIENT_MASK 0x1F
63#define USB_REQ_TYPE_STANDARD 0x00
64#define USB_REQ_TYPE_CLASS 0x20
65#define USB_REQ_TYPE_VENDOR 0x40
66#define USB_REQ_TYPE_RESERVED 0x60
71#define USB_REQ_DIR_HTD 0x00
72#define USB_REQ_DIR_DTH 0x80
77#define USB_STD_REQ_GET_STATUS 0
78#define USB_STD_REQ_CLEAR_FEATURE 1
79#define USB_STD_REQ_SET_FEATURE 3
80#define USB_STD_REQ_SET_ADDRESS 5
81#define USB_STD_REQ_GET_DESCRIPTOR 6
82#define USB_STD_REQ_SET_DESCRIPTOR 7
83#define USB_STD_REQ_GET_CONFIGURATION 8
84#define USB_STD_REQ_SET_CONFIGURATION 9
85#define USB_STD_REQ_GET_INTERFACE 10
86#define USB_STD_REQ_SET_INTERFACE 11
87#define USB_STD_REQ_SYNCH_FRAME 12
92#define USB_DESCIPTOR_TYPE_DEVICE 1
93#define USB_DESCIPTOR_TYPE_CONFIGURATION 2
94#define USB_DESCIPTOR_TYPE_STRING 3
95#define USB_DESCIPTOR_TYPE_INTERFACE 4
96#define USB_DESCIPTOR_TYPE_ENDPOINT 5
97#define USB_DESCIPTOR_TYPE_DEVICE_QUALIFIER 6
98#define USB_DESCIPTOR_TYPE_OTHER_SPEED 7
99#define USB_DESCIPTOR_TYPE_INTERFACE_POWER 8
104#define USB_LANGID_STRING 0
105#define USB_MFC_STRING 1
106#define USB_PRODUCT_STRING 2
107#define USB_SERIAL_STRING 3
108#define USB_CONFIG_STRING 4
109#define USB_INTERFACE_STRING 5
114#define USB_CONF_REMOTE_WAKEUP 2
115#define USB_CONF_SELF_POWERED 1
120#define USB_FEATURE_EPT_HALT 0
121#define USB_FEATURE_REMOTE_WAKEUP 1
122#define USB_FEATURE_TEST_MODE 2
127typedef enum
128{
129 USB_CONN_STATE_DEFAULT =1,
130 USB_CONN_STATE_ADDRESSED,
131 USB_CONN_STATE_CONFIGURED,
132 USB_CONN_STATE_SUSPENDED
133}usbd_conn_state;
134
138#define USB_EPT0_IDLE 0
139#define USB_EPT0_SETUP 1
140#define USB_EPT0_DATA_IN 2
141#define USB_EPT0_DATA_OUT 3
142#define USB_EPT0_STATUS_IN 4
143#define USB_EPT0_STATUS_OUT 5
144#define USB_EPT0_STALL 6
149#define USB_DEVICE_QUALIFIER_DESC_LEN 0x0A
150#define USB_DEVICE_DESC_LEN 0x12
151#define USB_DEVICE_CFG_DESC_LEN 0x09
152#define USB_DEVICE_IF_DESC_LEN 0x09
153#define USB_DEVICE_EPT_LEN 0x07
154#define USB_DEVICE_OTG_DESC_LEN 0x03
155#define USB_DEVICE_LANGID_STR_DESC_LEN 0x04
156#define USB_DEVICE_OTHER_SPEED_DESC_SIZ_LEN 0x09
161#define USB_CLASS_CODE_AUDIO 0x01
162#define USB_CLASS_CODE_CDC 0x02
163#define USB_CLASS_CODE_HID 0x03
164#define USB_CLASS_CODE_PRINTER 0x07
165#define USB_CLASS_CODE_MSC 0x08
166#define USB_CLASS_CODE_HUB 0x09
167#define USB_CLASS_CODE_CDCDATA 0x0A
168#define USB_CLASS_CODE_CCID 0x0B
169#define USB_CLASS_CODE_VIDEO 0x0E
170#define USB_CLASS_CODE_VENDOR 0xFF
175#define USB_EPT_DESC_CONTROL 0x00
176#define USB_EPT_DESC_ISO 0x01
177#define USB_EPT_DESC_BULK 0x02
178#define USB_EPT_DESC_INTERRUPT 0x03
180#define USB_EPT_DESC_NSYNC 0x00
181#define USB_ETP_DESC_ASYNC 0x04
182#define USB_ETP_DESC_ADAPTIVE 0x08
183#define USB_ETP_DESC_SYNC 0x0C
185#define USB_EPT_DESC_DATA_EPT 0x00
186#define USB_EPT_DESC_FD_EPT 0x10
187#define USB_EPT_DESC_FDDATA_EPT 0x20
192#define USB_MAX_EP0_SIZE 64
197#define SWAPBYTE(addr) (uint16_t)(((uint16_t)(*((uint8_t *)(addr)))) + \
198 (((uint16_t)(*(((uint8_t *)(addr)) + 1))) << 8))
203#define MIN(a, b) (uint16_t)(((a) < (b)) ? (a) : (b))
204#define MAX(a, b) (uint16_t)(((a) > (b)) ? (a) : (b))
209#define LBYTE(x) ((uint8_t)(x & 0x00FF))
210#define HBYTE(x) ((uint8_t)((x & 0xFF00) >>8))
215typedef enum
216{
217 USB_OK,
218 USB_FAIL,
219 USB_WAIT,
220 USB_NOT_SUPPORT,
221 USB_ERROR,
222}usb_sts_type;
223
224
228typedef struct
229{
230 uint8_t bmRequestType;
231 uint8_t bRequest;
232 uint16_t wValue;
233 uint16_t wIndex;
235 uint16_t wLength;
236} usb_setup_type;
237
241typedef struct
242{
243 uint8_t bLength;
244 uint8_t bDescriptorType;
245 uint16_t bcdUSB;
246 uint8_t bDeviceClass;
247 uint8_t bDeviceSubClass;
248 uint8_t bDeviceProtocol;
249 uint8_t bMaxPacketSize0;
250 uint16_t idVendor;
251 uint16_t idProduct;
252 uint16_t bcdDevice;
253 uint8_t iManufacturer;
254 uint8_t iProduct;
255 uint8_t iSerialNumber;
256 uint8_t bNumConfigurations;
257} usb_device_desc_type;
258
262typedef struct
263{
264 uint8_t bLength;
265 uint8_t bDescriptorType;
266 uint16_t wTotalLength;
267 uint8_t bNumInterfaces;
268 uint8_t bConfigurationValue;
269 uint8_t iConfiguration;
270 uint8_t bmAttributes;
275 uint8_t bMaxPower;
278}usb_configuration_desc_type;
279
283typedef struct
284{
285 uint8_t bLength;
286 uint8_t bDescriptorType;
287 uint8_t bInterfaceNumber;
288 uint8_t bAlternateSetting;
289 uint8_t bNumEndpoints;
290 uint8_t bInterfaceClass;
291 uint8_t bInterfaceSubClass;
292 uint8_t bInterfaceProtocol;
293 uint8_t iInterface;
294} usb_interface_desc_type;
295
299typedef struct
300{
301 uint8_t bLength;
302 uint8_t bDescriptorType;
303 uint8_t bEndpointAddress;
304 uint8_t bmAttributes;
305 uint16_t wMaxPacketSize;
306 uint8_t bInterval;
307} usb_endpoint_desc_type;
308
312typedef struct
313{
314 uint8_t bLength;
315 uint8_t bDescriptorType;
316} usb_header_desc_type;
317
318
330#ifdef __cplusplus
331}
332#endif
333
334#endif
335
usbd_conn_state
usbd_conn_state
usb device connect state
Definition: usb_std.h:128
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_CONN_STATE_SUSPENDED
@ USB_CONN_STATE_SUSPENDED
Definition: usb_std.h:132
USB_CONN_STATE_DEFAULT
@ USB_CONN_STATE_DEFAULT
Definition: usb_std.h:129
USB_CONN_STATE_CONFIGURED
@ USB_CONN_STATE_CONFIGURED
Definition: usb_std.h:131
USB_CONN_STATE_ADDRESSED
@ USB_CONN_STATE_ADDRESSED
Definition: usb_std.h:130
USB_OK
@ USB_OK
Definition: usb_std.h:218
USB_WAIT
@ USB_WAIT
Definition: usb_std.h:220
USB_ERROR
@ USB_ERROR
Definition: usb_std.h:222
USB_NOT_SUPPORT
@ USB_NOT_SUPPORT
Definition: usb_std.h:221
USB_FAIL
@ USB_FAIL
Definition: usb_std.h:219
usb_configuration_desc_type
format of standard configuration descriptor
Definition: usb_std.h:264
usb_device_desc_type
format of standard device descriptor
Definition: usb_std.h:243
usb_endpoint_desc_type
format of standard endpoint descriptor
Definition: usb_std.h:301
usb_header_desc_type
format of header
Definition: usb_std.h:314
usb_interface_desc_type
format of standard interface descriptor
Definition: usb_std.h:285
usb_setup_type
format of usb setup data
Definition: usb_std.h:230


AT32F415 Firmwary Library: usbd_core.c Source File

  • middlewares
  • usb_drivers
  • src
usbd_core.c
Go to the documentation of this file.
1
27#include "usb_core.h"
28#include "usbd_core.h"
29#include "usbd_sdr.h"
30
50void usbd_core_in_handler(usbd_core_type *udev, uint8_t ept_addr)
51{
52 /* get endpoint info*/
53 usb_ept_info *ept_info = &udev->ept_in[ept_addr & 0x7F];
54
55 if(ept_addr == 0)
56 {
57 if(udev->ept0_sts == USB_EPT0_DATA_IN)
58 {
59 if(ept_info->ept0_slen > ept_info->maxpacket)
60 {
61 ept_info->ept0_slen -= ept_info->maxpacket;
62 usbd_ept_send(udev, 0, ept_info->trans_buf,
63 MIN(ept_info->ept0_slen, ept_info->maxpacket));
64 }
65 /* endpoint 0 */
66 else if(ept_info->last_len == ept_info->maxpacket
67 && ept_info->ept0_slen <= udev->ept0_wlength)
68 {
69 ept_info->last_len = 0;
70 usbd_ept_send(udev, 0, 0, 0);
71 usbd_ept_recv(udev, ept_addr, 0, 0);
72 }
73 else
74 {
75 if(udev->class_handler->ept0_tx_handler != 0 &&
76 udev->conn_state == USB_CONN_STATE_CONFIGURED)
77 {
78 udev->class_handler->ept0_tx_handler(udev);
79 }
80 usbd_ctrl_recv_status(udev);
81 }
82 }
83 }
84 else if(udev->class_handler->in_handler != 0 &&
85 udev->conn_state == USB_CONN_STATE_CONFIGURED)
86 {
87 /* other user define endpoint */
88 udev->class_handler->in_handler(udev, ept_addr);
89 }
90}
91
98void usbd_core_out_handler(usbd_core_type *udev, uint8_t ept_addr)
99{
100 /* get endpoint info*/
101 usb_ept_info *ept_info = &udev->ept_out[ept_addr & 0x7F];
102
103 if(ept_addr == 0)
104 {
105 /* endpoint 0 */
106 if(udev->ept0_sts == USB_EPT0_DATA_OUT)
107 {
108 if(ept_info->ept0_slen > ept_info->maxpacket)
109 {
110 ept_info->ept0_slen -= ept_info->maxpacket;
111 usbd_ept_recv(udev, ept_addr, ept_info->trans_buf,
112 MIN(ept_info->ept0_slen, ept_info->maxpacket));
113 }
114 else
115 {
116 if(udev->class_handler->ept0_rx_handler != 0)
117 {
118 udev->class_handler->ept0_rx_handler(udev);
119 }
120 usbd_ctrl_send_status(udev);
121 }
122 }
123 }
124 else if(udev->class_handler->out_handler != 0 &&
125 udev->conn_state == USB_CONN_STATE_CONFIGURED)
126 {
127 /* other user define endpoint */
128 udev->class_handler->out_handler(udev, ept_addr);
129 }
130}
131
138void usbd_core_setup_handler(usbd_core_type *udev, uint8_t ept_num)
139{
140 /* setup parse */
141 usbd_setup_request_parse(&udev->setup, udev->setup_buffer);
142
143 /* set ept0 status */
144 udev->ept0_sts = USB_EPT0_SETUP;
145 udev->ept0_wlength = udev->setup.wLength;
146
147 switch(udev->setup.bmRequestType & USB_REQ_RECIPIENT_MASK)
148 {
149 case USB_REQ_RECIPIENT_DEVICE:
150 /* recipient device request */
151 usbd_device_request(udev);
152 break;
153 case USB_REQ_RECIPIENT_INTERFACE:
154 /* recipient interface request */
155 usbd_interface_request(udev);
156 break;
157 case USB_REQ_RECIPIENT_ENDPOINT:
158 /* recipient endpoint request */
159 usbd_endpoint_request(udev);
160 break;
161 default:
162 break;
163 }
164}
165
174void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
175{
176 usb_ept_info *ept_info = &udev->ept_in[0];
177
178 ept_info->ept0_slen = len;
179 udev->ept0_sts = USB_EPT0_DATA_IN;
180
181 usbd_ept_send(udev, 0, buffer, len);
182}
183
192void usbd_ctrl_recv(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
193{
194 usb_ept_info *ept_info = &udev->ept_out[0];
195
196 ept_info->ept0_slen = len;
197 udev->ept0_sts = USB_EPT0_DATA_OUT;
198
199 usbd_ept_recv(udev, 0, buffer, len);
200}
201
207void usbd_ctrl_send_status(usbd_core_type *udev)
208{
209 udev->ept0_sts = USB_EPT0_STATUS_IN;
210
211 usbd_ept_send(udev, 0, 0, 0);
212}
213
219void usbd_ctrl_recv_status(usbd_core_type *udev)
220{
221 udev->ept0_sts = USB_EPT0_STATUS_OUT;
222
223 usbd_ept_recv(udev, 0, 0, 0);
224}
225
232void usbd_clear_stall(usbd_core_type *udev, uint8_t ept_addr)
233{
234 usb_ept_info *ept_info;
235 usb_reg_type *usbx = udev->usb_reg;
236
237 if(ept_addr & 0x80)
238 {
239 /* in endpoint */
240 ept_info = &udev->ept_in[ept_addr & 0x7F];
241 }
242 else
243 {
244 /* out endpoint */
245 ept_info = &udev->ept_out[ept_addr & 0x7F];
246 }
247 usb_ept_clear_stall(usbx, ept_info);
248 ept_info->stall = 0;
249}
250
257void usbd_set_stall(usbd_core_type *udev, uint8_t ept_addr)
258{
259 usb_ept_info *ept_info;
260 usb_reg_type *usbx = udev->usb_reg;
261
262 if(ept_addr & 0x80)
263 {
264 /* in endpoint */
265 ept_info = &udev->ept_in[ept_addr & 0x7F];
266 }
267 else
268 {
269 /* out endpoint */
270 ept_info = &udev->ept_out[ept_addr & 0x7F];
271 }
272 usb_ept_stall(usbx, ept_info);
273
274 ept_info->stall = 1;
275}
276
282void usbd_ctrl_unsupport(usbd_core_type *udev)
283{
284 /* return stall status */
285 usbd_set_stall(udev, 0x00);
286 usbd_set_stall(udev, 0x80);
287}
288
295uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr)
296{
297 usb_ept_info *ept = &udev->ept_out[ept_addr & 0x7F];
298 return ept->trans_len;
299}
300
309void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
310{
311 usb_reg_type *usbx = udev->usb_reg;
312 usb_ept_info *ept_info;
313
314 if((ept_addr & 0x80) == 0)
315 {
316 /* out endpoint info */
317 ept_info = &udev->ept_out[ept_addr & 0x7F];
318 ept_info->inout = EPT_DIR_OUT;
319 }
320 else
321 {
322 /* in endpoint info */
323 ept_info = &udev->ept_in[ept_addr & 0x7F];
324 ept_info->inout = EPT_DIR_IN;
325 }
326
327 /* set endpoint maxpacket and type */
328 ept_info->maxpacket = maxpacket;
329 ept_info->trans_type = ept_type;
330
331 /* open endpoint */
332 usb_ept_open(usbx, ept_info);
333}
334
341void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr)
342{
343 usb_ept_info *ept_info;
344 if(ept_addr & 0x80)
345 {
346 /* in endpoint */
347 ept_info = &udev->ept_in[ept_addr & 0x7F];
348 }
349 else
350 {
351 /* out endpoint */
352 ept_info = &udev->ept_out[ept_addr & 0x7F];
353 }
354
355 /* close endpoint */
356 usb_ept_close(udev->usb_reg, ept_info);
357}
358
364void usbd_connect(usbd_core_type *udev)
365{
366 usb_connect(udev->usb_reg);
367}
368
374void usbd_disconnect(usbd_core_type *udev)
375{
376 usb_disconnect(udev->usb_reg);
377}
378
385void usbd_set_device_addr(usbd_core_type *udev, uint8_t address)
386{
387 usb_set_address(udev->usb_reg, address);
388}
389
395void usb_ept_default_init(usbd_core_type *udev)
396{
397 uint8_t i_index = 0;
398 /* init in endpoint info structure */
399 for(i_index = 0; i_index < USB_EPT_MAX_NUM; i_index ++)
400 {
401 udev->ept_in[i_index].eptn = i_index;
402 udev->ept_in[i_index].ept_address = i_index;
403 udev->ept_in[i_index].inout = EPT_DIR_IN;
404 udev->ept_in[i_index].maxpacket = 0;
405 udev->ept_in[i_index].trans_buf = 0;
406 udev->ept_in[i_index].total_len = 0;
407 }
408
409 /* init out endpoint info structure */
410 for(i_index = 0; i_index < USB_EPT_MAX_NUM; i_index ++)
411 {
412 udev->ept_out[i_index].eptn = i_index;
413 udev->ept_out[i_index].ept_address = i_index;
414 udev->ept_out[i_index].inout = EPT_DIR_OUT;
415 udev->ept_out[i_index].maxpacket = 0;
416 udev->ept_out[i_index].trans_buf = 0;
417 udev->ept_out[i_index].total_len = 0;
418 }
419}
420
429void usbd_ept_send(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
430{
431 /* get endpoint info struct and register */
432 usb_reg_type *usbx = udev->usb_reg;
433 usb_ept_info *ept_info = &udev->ept_in[ept_addr & 0x7F];
434 otg_eptin_type *ept_in = USB_INEPT(usbx, ept_info->eptn);
435 otg_device_type *dev = OTG_DEVICE(usbx);
436 uint32_t pktcnt;
437
438 /* set send data buffer and length */
439 ept_info->trans_buf = buffer;
440 ept_info->total_len = len;
441 ept_info->trans_len = 0;
442
443 /* transfer data len is zero */
444 if(ept_info->total_len == 0)
445 {
446 ept_in->dieptsiz_bit.pktcnt = 1;
447 ept_in->dieptsiz_bit.xfersize = 0;
448 }
449 else
450 {
451 if((ept_addr & 0x7F) == 0) // endpoint 0
452 {
453 /* endpoint 0 */
454 if(ept_info->total_len > ept_info->maxpacket)
455 {
456 ept_info->total_len = ept_info->maxpacket;
457 }
458
459 /* set transfer size */
460 ept_in->dieptsiz_bit.xfersize = ept_info->total_len;
461
462 /* set packet count */
463 ept_in->dieptsiz_bit.pktcnt = 1;
464
465 ept_info->last_len = ept_info->total_len;
466 }
467 else
468 {
469 /* other endpoint */
470
471 /* packet count */
472 pktcnt = (ept_info->total_len + ept_info->maxpacket - 1) / ept_info->maxpacket;
473
474 /* set transfer size */
475 ept_in->dieptsiz_bit.xfersize = ept_info->total_len;
476
477 /* set packet count */
478 ept_in->dieptsiz_bit.pktcnt = pktcnt;
479
480 if(ept_info->trans_type == EPT_ISO_TYPE)
481 {
482 ept_in->dieptsiz_bit.mc = 1;
483 }
484 }
485 }
486
487 if(ept_info->trans_type != EPT_ISO_TYPE)
488 {
489 if(ept_info->total_len > 0)
490 {
491 /* set in endpoint tx fifo empty interrupt mask */
492 dev->diepempmsk |= 1 << ept_info->eptn;
493 }
494 }
495
496 if(ept_info->trans_type == EPT_ISO_TYPE)
497 {
498 if((dev->dsts_bit.soffn & 0x1) == 0)
499 {
500 ept_in->diepctl_bit.setd1pid = TRUE;
501 }
502 else
503 {
504 ept_in->diepctl_bit.setd0pid = TRUE;
505 }
506 }
507
508 /* clear endpoint nak */
509 ept_in->diepctl_bit.cnak = TRUE;
510
511 /* endpoint enable */
512 ept_in->diepctl_bit.eptena = TRUE;
513
514 if(ept_info->trans_type == EPT_ISO_TYPE)
515 {
516 /* write data to fifo */
517 usb_write_packet(usbx, ept_info->trans_buf, ept_info->eptn, ept_info->total_len);
518 }
519}
520
529void usbd_ept_recv(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
530{
531 /* get endpoint info struct and register */
532 usb_reg_type *usbx = udev->usb_reg;
533 usb_ept_info *ept_info = &udev->ept_out[ept_addr & 0x7F];
534 otg_eptout_type *ept_out = USB_OUTEPT(usbx, ept_info->eptn);
535 otg_device_type *dev = OTG_DEVICE(usbx);
536 uint32_t pktcnt;
537
538 /* set receive data buffer and length */
539 ept_info->trans_buf = buffer;
540 ept_info->total_len = len;
541 ept_info->trans_len = 0;
542
543 if((ept_addr & 0x7F) == 0)
544 {
545 /* endpoint 0 */
546 ept_info->total_len = ept_info->maxpacket;
547 }
548
549 if(ept_info->total_len == 0 || ((ept_addr & 0x7F) == 0))
550 {
551 /* set transfer size */
552 ept_out->doeptsiz_bit.xfersize = ept_info->maxpacket;
553
554 /* set packet count */
555 ept_out->doeptsiz_bit.pktcnt = 1;
556 }
557 else
558 {
559 pktcnt = (ept_info->total_len + ept_info->maxpacket - 1) / ept_info->maxpacket;
560
561 /* set transfer size */
562 ept_out->doeptsiz_bit.xfersize = ept_info->maxpacket * pktcnt;
563
564 /* set packet count */
565 ept_out->doeptsiz_bit.pktcnt = pktcnt;
566 }
567
568 if(ept_info->trans_type == EPT_ISO_TYPE)
569 {
570 if((dev->dsts_bit.soffn & 0x01) == 0)
571 {
572 ept_out->doepctl_bit.setd1pid = TRUE;
573 }
574 else
575 {
576 ept_out->doepctl_bit.setd0pid = TRUE;
577 }
578 }
579
580 /* clear endpoint nak */
581 ept_out->doepctl_bit.cnak = TRUE;
582
583 /* endpoint enable */
584 ept_out->doepctl_bit.eptena = TRUE;
585}
586
592 usbd_conn_state usbd_connect_state_get(usbd_core_type *udev)
593{
594 return udev->conn_state;
595}
596
602void usbd_remote_wakeup(usbd_core_type *udev)
603{
604 /* check device is in suspend mode */
605 if(usb_suspend_status_get(udev->usb_reg) == 1)
606 {
607 /* set connect state */
608 udev->conn_state = udev->old_conn_state;
609
610 /* open phy clock */
611 usb_open_phy_clk(udev->usb_reg);
612
613 /* set remote wakeup */
614 usb_remote_wkup_set(udev->usb_reg);
615
616 /* delay 10 ms */
617 usb_delay_ms(10);
618
619 /* clear remote wakup */
620 usb_remote_wkup_clear(udev->usb_reg);
621 }
622}
623
629void usbd_enter_suspend(usbd_core_type *udev)
630{
631 /* check device is in suspend mode */
632 if(usb_suspend_status_get(udev->usb_reg) == 1)
633 {
634 /* stop phy clk */
635 usb_stop_phy_clk(udev->usb_reg);
636 }
637}
638
645void usbd_flush_tx_fifo(usbd_core_type *udev, uint8_t ept_num)
646{
647 /* flush endpoint tx fifo */
648 usb_flush_tx_fifo(udev->usb_reg, ept_num & 0x1F);
649}
650
656void usbd_fifo_alloc(usbd_core_type *udev)
657{
658 usb_reg_type *usbx = udev->usb_reg;
659
660 if(usbx == OTG1_GLOBAL)
661 {
662 /* set receive fifo size */
663 usb_set_rx_fifo(usbx, USBD_RX_SIZE);
664
665 /* set endpoint0 tx fifo size */
666 usb_set_tx_fifo(usbx, USB_EPT0, USBD_EP0_TX_SIZE);
667
668 /* set endpoint1 tx fifo size */
669 usb_set_tx_fifo(usbx, USB_EPT1, USBD_EP1_TX_SIZE);
670
671 /* set endpoint2 tx fifo size */
672 usb_set_tx_fifo(usbx, USB_EPT2, USBD_EP2_TX_SIZE);
673
674 /* set endpoint3 tx fifo size */
675 usb_set_tx_fifo(usbx, USB_EPT3, USBD_EP3_TX_SIZE);
676#if (USB_EPT_MAX_NUM == 8)
677 if(USB_EPT_MAX_NUM == 8)
678 {
679 /* set endpoint4 tx fifo size */
680 usb_set_tx_fifo(usbx, USB_EPT4, USBD_EP4_TX_SIZE);
681
682 /* set endpoint5 tx fifo size */
683 usb_set_tx_fifo(usbx, USB_EPT5, USBD_EP5_TX_SIZE);
684
685 /* set endpoint6 tx fifo size */
686 usb_set_tx_fifo(usbx, USB_EPT6, USBD_EP6_TX_SIZE);
687
688 /* set endpoint7 tx fifo size */
689 usb_set_tx_fifo(usbx, USB_EPT7, USBD_EP7_TX_SIZE);
690 }
691#endif
692 }
693#ifdef OTG2_GLOBAL
694 if(usbx == OTG2_GLOBAL)
695 {
696 /* set receive fifo size */
697 usb_set_rx_fifo(usbx, USBD2_RX_SIZE);
698
699 /* set endpoint0 tx fifo size */
700 usb_set_tx_fifo(usbx, USB_EPT0, USBD2_EP0_TX_SIZE);
701
702 /* set endpoint1 tx fifo size */
703 usb_set_tx_fifo(usbx, USB_EPT1, USBD2_EP1_TX_SIZE);
704
705 /* set endpoint2 tx fifo size */
706 usb_set_tx_fifo(usbx, USB_EPT2, USBD2_EP2_TX_SIZE);
707
708 /* set endpoint3 tx fifo size */
709 usb_set_tx_fifo(usbx, USB_EPT3, USBD2_EP3_TX_SIZE);
710
711 if(USB_EPT_MAX_NUM == 8)
712 {
713 /* set endpoint4 tx fifo size */
714 usb_set_tx_fifo(usbx, USB_EPT4, USBD2_EP4_TX_SIZE);
715
716 /* set endpoint5 tx fifo size */
717 usb_set_tx_fifo(usbx, USB_EPT5, USBD2_EP5_TX_SIZE);
718
719 /* set endpoint6 tx fifo size */
720 usb_set_tx_fifo(usbx, USB_EPT6, USBD2_EP6_TX_SIZE);
721
722 /* set endpoint7 tx fifo size */
723 usb_set_tx_fifo(usbx, USB_EPT7, USBD2_EP7_TX_SIZE);
724 }
725 }
726#endif
727}
728
740 usb_sts_type usbd_core_init(usbd_core_type *udev,
741 usb_reg_type *usb_reg,
742 usbd_class_handler *class_handler,
743 usbd_desc_handler *desc_handler,
744 uint8_t core_id)
745{
746 usb_reg_type *usbx;
747 otg_device_type *dev;
748 otg_eptin_type *ept_in;
749 otg_eptout_type *ept_out;
750 uint32_t i_index;
751
752 udev->usb_reg = usb_reg;
753 usbx = usb_reg;
754 dev = OTG_DEVICE(usbx);
755
756 /* set connect state */
757 udev->conn_state = USB_CONN_STATE_DEFAULT;
758
759 /* device class config */
760 udev->device_addr = 0;
761 udev->class_handler = class_handler;
762 udev->desc_handler = desc_handler;
763
764 /* set device disconnect */
765 usbd_disconnect(udev);
766
767 /* set endpoint to default status */
768 usb_ept_default_init(udev);
769
770 /* disable usb global interrupt */
771 usb_interrupt_disable(usbx);
772
773 /* init global register */
774 usb_global_init(usbx);
775
776 /* set device mode */
777 usb_global_set_mode(usbx, OTG_DEVICE_MODE);
778
779 /* open phy clock */
780 usb_open_phy_clk(udev->usb_reg);
781
782 /* set periodic frame interval */
783 dev->dcfg_bit.perfrint = DCFG_PERFRINT_80;
784
785 /* set device speed to full-speed */
786 dev->dcfg_bit.devspd = USB_DCFG_FULL_SPEED;
787
788 /* flush all tx fifo */
789 usb_flush_tx_fifo(usbx, 16);
790
791 /* flush share rx fifo */
792 usb_flush_rx_fifo(usbx);
793
794 /* clear all endpoint interrupt flag and mask */
795 dev->daint = 0xFFFFFFFF;
796 dev->daintmsk = 0;
797 dev->diepmsk = 0;
798 dev->doepmsk = 0;
799
800 for(i_index = 0; i_index < USB_EPT_MAX_NUM; i_index ++)
801 {
802 usbx->dieptxfn[i_index] = 0;
803 }
804
805 /* endpoint fifo alloc */
806 usbd_fifo_alloc(udev);
807
808 /* disable all in endpoint */
809 for(i_index = 0; i_index < USB_EPT_MAX_NUM; i_index ++)
810 {
811 ept_in = USB_INEPT(usbx, i_index);
812 if(ept_in->diepctl_bit.eptena)
813 {
814 ept_in->diepctl = 0;
815 ept_in->diepctl_bit.eptdis = TRUE;
816 ept_in->diepctl_bit.snak = TRUE;
817 }
818 else
819 {
820 ept_in->diepctl = 0;
821 }
822 ept_in->dieptsiz = 0;
823 ept_in->diepint = 0xFF;
824 }
825
826 /* disable all out endpoint */
827 for(i_index = 0; i_index < USB_EPT_MAX_NUM; i_index ++)
828 {
829 ept_out = USB_OUTEPT(usbx, i_index);
830 if(ept_out->doepctl_bit.eptena)
831 {
832 ept_out->doepctl = 0;
833 ept_out->doepctl_bit.eptdis = TRUE;
834 ept_out->doepctl_bit.snak = TRUE;
835 }
836 else
837 {
838 ept_out->doepctl = 0;
839 }
840 ept_out->doeptsiz = 0;
841 ept_out->doepint = 0xFF;
842 }
843 dev->diepmsk_bit.txfifoudrmsk = TRUE;
844
845 /* clear global interrupt and mask */
846 usbx->gintmsk = 0;
847 usbx->gintsts = 0xBFFFFFFF;
848
849 /* enable global interrupt mask */
850 usbx->gintmsk = USB_OTG_SOF_INT | USB_OTG_RXFLVL_INT |
851 USB_OTG_USBSUSP_INT | USB_OTG_USBRST_INT |
852 USB_OTG_ENUMDONE_INT | USB_OTG_IEPT_INT |
853 USB_OTG_OEPT_INT | USB_OTG_INCOMISOIN_INT |
854 USB_OTG_INCOMPIP_INCOMPISOOUT_INT | USB_OTG_WKUP_INT |
855 USB_OTG_OTGINT_INT;
856
857 /* usb connect */
858 usbd_connect(udev);
859
860 /* enable global interrupt */
861 usb_interrupt_enable(usbx);
862
863 return USB_OK;
864
865}
866
USBD_EP2_TX_SIZE
#define USBD_EP2_TX_SIZE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:86
USBD_EP3_TX_SIZE
#define USBD_EP3_TX_SIZE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:87
USBD_EP1_TX_SIZE
#define USBD_EP1_TX_SIZE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:85
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
USBD_EP0_TX_SIZE
#define USBD_EP0_TX_SIZE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:84
USBD_RX_SIZE
#define USBD_RX_SIZE
usb device mode config
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:83
TRUE
@ TRUE
Definition: at32f415.h:253
class_handler
usbd_class_handler class_handler
Definition: cdc_class.c:75
desc_handler
usbd_desc_handler desc_handler
device descriptor handler structure
Definition: cdc_desc.c:64
USB_DCFG_FULL_SPEED
#define USB_DCFG_FULL_SPEED
usb device full speed
Definition: at32f415_usb.h:262
DCFG_PERFRINT_80
@ DCFG_PERFRINT_80
Definition: at32f415_usb.h:252
EPT_ISO_TYPE
@ EPT_ISO_TYPE
Definition: at32f415_usb.h:347
USB_EPT4
@ USB_EPT4
Definition: at32f415_usb.h:361
USB_EPT6
@ USB_EPT6
Definition: at32f415_usb.h:363
USB_EPT5
@ USB_EPT5
Definition: at32f415_usb.h:362
USB_EPT7
@ USB_EPT7
Definition: at32f415_usb.h:364
USB_EPT0
@ USB_EPT0
Definition: at32f415_usb.h:357
USB_EPT2
@ USB_EPT2
Definition: at32f415_usb.h:359
USB_EPT1
@ USB_EPT1
Definition: at32f415_usb.h:358
USB_EPT3
@ USB_EPT3
Definition: at32f415_usb.h:360
OTG_DEVICE_MODE
@ OTG_DEVICE_MODE
Definition: at32f415_usb.h:336
EPT_DIR_IN
@ EPT_DIR_IN
Definition: at32f415_usb.h:385
EPT_DIR_OUT
@ EPT_DIR_OUT
Definition: at32f415_usb.h:386
usb_ept_open
void usb_ept_open(otg_global_type *usbx, usb_ept_info *ept_info)
open usb endpoint
Definition: at32f415_usb.c:468
usb_connect
void usb_connect(otg_global_type *usbx)
connect usb device by enable pull-up
Definition: at32f415_usb.c:766
usb_remote_wkup_clear
void usb_remote_wkup_clear(otg_global_type *usbx)
usb remote wakeup clear
Definition: at32f415_usb.c:808
usb_set_rx_fifo
void usb_set_rx_fifo(otg_global_type *usbx, uint16_t size)
usb set rx fifo size
Definition: at32f415_usb.c:289
usb_write_packet
void usb_write_packet(otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
write data from user memory to usb buffer
Definition: at32f415_usb.c:417
usb_disconnect
void usb_disconnect(otg_global_type *usbx)
disconnect usb device by disable pull-up
Definition: at32f415_usb.c:780
usb_remote_wkup_set
void usb_remote_wkup_set(otg_global_type *usbx)
usb remote wakeup set
Definition: at32f415_usb.c:795
usb_global_set_mode
void usb_global_set_mode(otg_global_type *usbx, uint32_t mode)
set otg mode(device or host mode)
Definition: at32f415_usb.c:339
usb_set_tx_fifo
void usb_set_tx_fifo(otg_global_type *usbx, uint8_t txfifo, uint16_t size)
usb set tx fifo size
Definition: at32f415_usb.c:304
usb_flush_rx_fifo
void usb_flush_rx_fifo(otg_global_type *usbx)
flush rx fifo
Definition: at32f415_usb.c:145
usb_suspend_status_get
uint8_t usb_suspend_status_get(otg_global_type *usbx)
usb suspend status get
Definition: at32f415_usb.c:821
usb_ept_clear_stall
void usb_ept_clear_stall(otg_global_type *usbx, usb_ept_info *ept_info)
clear endpoint tx or rx status to stall
Definition: at32f415_usb.c:587
usb_set_address
void usb_set_address(otg_global_type *usbx, uint8_t address)
set the host assignment address
Definition: at32f415_usb.c:721
usb_flush_tx_fifo
void usb_flush_tx_fifo(otg_global_type *usbx, uint32_t fifo_num)
flush tx fifo
Definition: at32f415_usb.c:119
OTG_DEVICE
#define OTG_DEVICE(usbx)
Definition: at32f415_usb.h:1342
usb_interrupt_disable
void usb_interrupt_disable(otg_global_type *usbx)
usb global interrupt disable
Definition: at32f415_usb.c:275
usb_ept_close
void usb_ept_close(otg_global_type *usbx, usb_ept_info *ept_info)
close usb endpoint
Definition: at32f415_usb.c:534
usb_stop_phy_clk
void usb_stop_phy_clk(otg_global_type *usbx)
usb stop phy clock
Definition: at32f415_usb.c:391
usb_interrupt_enable
void usb_interrupt_enable(otg_global_type *usbx)
usb global interrupt enable
Definition: at32f415_usb.c:262
USB_OUTEPT
#define USB_OUTEPT(usbx, eptn)
Definition: at32f415_usb.h:1346
OTG1_GLOBAL
#define OTG1_GLOBAL
usb host and device register define
Definition: at32f415_usb.h:1339
USB_INEPT
#define USB_INEPT(usbx, eptn)
Definition: at32f415_usb.h:1345
usb_open_phy_clk
void usb_open_phy_clk(otg_global_type *usbx)
usb open phy clock
Definition: at32f415_usb.c:404
usb_ept_stall
void usb_ept_stall(otg_global_type *usbx, usb_ept_info *ept_info)
set endpoint tx or rx status to stall
Definition: at32f415_usb.c:558
usb_global_init
void usb_global_init(otg_global_type *usbx)
usb global initialization
Definition: at32f415_usb.c:83
USB_OTG_INCOMISOIN_INT
#define USB_OTG_INCOMISOIN_INT
Definition: at32f415_usb.h:67
USB_OTG_ENUMDONE_INT
#define USB_OTG_ENUMDONE_INT
Definition: at32f415_usb.h:62
USB_OTG_WKUP_INT
#define USB_OTG_WKUP_INT
Definition: at32f415_usb.h:74
USB_OTG_USBRST_INT
#define USB_OTG_USBRST_INT
Definition: at32f415_usb.h:61
USB_OTG_RXFLVL_INT
#define USB_OTG_RXFLVL_INT
Definition: at32f415_usb.h:55
USB_OTG_OEPT_INT
#define USB_OTG_OEPT_INT
Definition: at32f415_usb.h:66
USB_OTG_IEPT_INT
#define USB_OTG_IEPT_INT
Definition: at32f415_usb.h:65
USB_OTG_USBSUSP_INT
#define USB_OTG_USBSUSP_INT
Definition: at32f415_usb.h:60
USB_OTG_INCOMPIP_INCOMPISOOUT_INT
#define USB_OTG_INCOMPIP_INCOMPISOOUT_INT
Definition: at32f415_usb.h:68
USB_OTG_OTGINT_INT
#define USB_OTG_OTGINT_INT
Definition: at32f415_usb.h:53
USB_OTG_SOF_INT
#define USB_OTG_SOF_INT
Definition: at32f415_usb.h:54
USB_EPT0_STATUS_OUT
#define USB_EPT0_STATUS_OUT
Definition: usb_std.h:143
usbd_conn_state
usbd_conn_state
usb device connect state
Definition: usb_std.h:128
MIN
#define MIN(a, b)
min and max define
Definition: usb_std.h:204
USB_EPT0_DATA_IN
#define USB_EPT0_DATA_IN
Definition: usb_std.h:140
USB_REQ_RECIPIENT_DEVICE
#define USB_REQ_RECIPIENT_DEVICE
usb request recipient
Definition: usb_std.h:54
USB_REQ_RECIPIENT_MASK
#define USB_REQ_RECIPIENT_MASK
Definition: usb_std.h:58
USB_EPT0_DATA_OUT
#define USB_EPT0_DATA_OUT
Definition: usb_std.h:141
USB_EPT0_SETUP
#define USB_EPT0_SETUP
Definition: usb_std.h:139
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_REQ_RECIPIENT_ENDPOINT
#define USB_REQ_RECIPIENT_ENDPOINT
Definition: usb_std.h:56
USB_EPT0_STATUS_IN
#define USB_EPT0_STATUS_IN
Definition: usb_std.h:142
USB_REQ_RECIPIENT_INTERFACE
#define USB_REQ_RECIPIENT_INTERFACE
Definition: usb_std.h:55
USB_CONN_STATE_DEFAULT
@ USB_CONN_STATE_DEFAULT
Definition: usb_std.h:129
USB_CONN_STATE_CONFIGURED
@ USB_CONN_STATE_CONFIGURED
Definition: usb_std.h:131
USB_OK
@ USB_OK
Definition: usb_std.h:218
usbd_connect_state_get
usbd_conn_state usbd_connect_state_get(usbd_core_type *udev)
get usb connect state
Definition: usbd_core.c:592
usbd_set_stall
void usbd_set_stall(usbd_core_type *udev, uint8_t ept_addr)
usb set endpoint to stall status
Definition: usbd_core.c:257
usbd_ept_close
void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint
Definition: usbd_core.c:341
usbd_ctrl_send_status
void usbd_ctrl_send_status(usbd_core_type *udev)
usb control endpoint send in status
Definition: usbd_core.c:207
usbd_set_device_addr
void usbd_set_device_addr(usbd_core_type *udev, uint8_t address)
usb device set device address.
Definition: usbd_core.c:385
usbd_ept_recv
void usbd_ept_recv(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint receive data
Definition: usbd_core.c:529
usbd_flush_tx_fifo
void usbd_flush_tx_fifo(usbd_core_type *udev, uint8_t ept_num)
usb device flush in endpoint fifo
Definition: usbd_core.c:645
usbd_fifo_alloc
void usbd_fifo_alloc(usbd_core_type *udev)
usb device endpoint fifo alloc
Definition: usbd_core.c:656
usbd_core_out_handler
void usbd_core_out_handler(usbd_core_type *udev, uint8_t ept_addr)
usb core out transfer complete handler
Definition: usbd_core.c:98
usbd_ept_open
void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint
Definition: usbd_core.c:309
usbd_core_init
usb_sts_type usbd_core_init(usbd_core_type *udev, usb_reg_type *usb_reg, usbd_class_handler *class_handler, usbd_desc_handler *desc_handler, uint8_t core_id)
usb device core initialization
Definition: usbd_core.c:740
usbd_ctrl_recv_status
void usbd_ctrl_recv_status(usbd_core_type *udev)
usb control endpoint send out status
Definition: usbd_core.c:219
usbd_ctrl_send
void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data
Definition: usbd_core.c:174
usb_ept_default_init
void usb_ept_default_init(usbd_core_type *udev)
usb endpoint structure initialization
Definition: usbd_core.c:395
usbd_core_in_handler
void usbd_core_in_handler(usbd_core_type *udev, uint8_t ept_addr)
usb core in transfer complete handler
Definition: usbd_core.c:50
usbd_ept_send
void usbd_ept_send(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data
Definition: usbd_core.c:429
usbd_clear_stall
void usbd_clear_stall(usbd_core_type *udev, uint8_t ept_addr)
clear endpoint stall
Definition: usbd_core.c:232
usbd_get_recv_len
uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length
Definition: usbd_core.c:295
usbd_remote_wakeup
void usbd_remote_wakeup(usbd_core_type *udev)
usb device remote wakeup
Definition: usbd_core.c:602
usbd_connect
void usbd_connect(usbd_core_type *udev)
usb device connect to host
Definition: usbd_core.c:364
usbd_ctrl_recv
void usbd_ctrl_recv(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint recv data
Definition: usbd_core.c:192
usbd_ctrl_unsupport
void usbd_ctrl_unsupport(usbd_core_type *udev)
un-support device request
Definition: usbd_core.c:282
usbd_enter_suspend
void usbd_enter_suspend(usbd_core_type *udev)
usb device enter suspend mode
Definition: usbd_core.c:629
usbd_disconnect
void usbd_disconnect(usbd_core_type *udev)
usb device disconnect to host
Definition: usbd_core.c:374
usbd_core_setup_handler
void usbd_core_setup_handler(usbd_core_type *udev, uint8_t ept_num)
usb core setup transfer complete handler
Definition: usbd_core.c:138
usbd_endpoint_request
usb_sts_type usbd_endpoint_request(usbd_core_type *udev)
standard usb endpoint requests
Definition: usbd_sdr.c:419
usbd_setup_request_parse
void usbd_setup_request_parse(usb_setup_type *setup, uint8_t *buf)
usb parse standard setup request
Definition: usbd_sdr.c:55
usbd_device_request
usb_sts_type usbd_device_request(usbd_core_type *udev)
standard usb device requests
Definition: usbd_sdr.c:350
usbd_interface_request
usb_sts_type usbd_interface_request(usbd_core_type *udev)
standard usb interface requests
Definition: usbd_sdr.c:394
otg_device_type
Definition: at32f415_usb.h:1007
otg_device_type::diepempmsk
__IO uint32_t diepempmsk
Definition: at32f415_usb.h:1142
otg_device_type::txfifoudrmsk
__IO uint32_t txfifoudrmsk
Definition: at32f415_usb.h:1081
otg_device_type::devspd
__IO uint32_t devspd
Definition: at32f415_usb.h:1016
otg_device_type::perfrint
__IO uint32_t perfrint
Definition: at32f415_usb.h:1020
otg_device_type::diepmsk_bit
struct otg_device_type::@765::@778 diepmsk_bit
otg_device_type::dsts_bit
struct otg_device_type::@763::@777 dsts_bit
otg_device_type::dcfg_bit
struct otg_device_type::@759::@775 dcfg_bit
otg_device_type::soffn
__IO uint32_t soffn
Definition: at32f415_usb.h:1059
otg_device_type::doepmsk
__IO uint32_t doepmsk
Definition: at32f415_usb.h:1092
otg_device_type::daintmsk
__IO uint32_t daintmsk
Definition: at32f415_usb.h:1127
otg_device_type::diepmsk
__IO uint32_t diepmsk
Definition: at32f415_usb.h:1070
otg_device_type::daint
__IO uint32_t daint
Definition: at32f415_usb.h:1114
otg_eptin_type
Definition: at32f415_usb.h:1153
otg_eptin_type::xfersize
__IO uint32_t xfersize
Definition: at32f415_usb.h:1210
otg_eptin_type::snak
__IO uint32_t snak
Definition: at32f415_usb.h:1172
otg_eptin_type::eptena
__IO uint32_t eptena
Definition: at32f415_usb.h:1176
otg_eptin_type::diepctl_bit
struct otg_eptin_type::@783::@791 diepctl_bit
otg_eptin_type::setd1pid
__IO uint32_t setd1pid
Definition: at32f415_usb.h:1174
otg_eptin_type::dieptsiz_bit
struct otg_eptin_type::@787::@793 dieptsiz_bit
otg_eptin_type::dieptsiz
__IO uint32_t dieptsiz
Definition: at32f415_usb.h:1207
otg_eptin_type::diepint
__IO uint32_t diepint
Definition: at32f415_usb.h:1186
otg_eptin_type::setd0pid
__IO uint32_t setd0pid
Definition: at32f415_usb.h:1173
otg_eptin_type::diepctl
__IO uint32_t diepctl
Definition: at32f415_usb.h:1159
otg_eptin_type::cnak
__IO uint32_t cnak
Definition: at32f415_usb.h:1171
otg_eptin_type::pktcnt
__IO uint32_t pktcnt
Definition: at32f415_usb.h:1211
otg_eptin_type::eptdis
__IO uint32_t eptdis
Definition: at32f415_usb.h:1175
otg_eptin_type::mc
__IO uint32_t mc
Definition: at32f415_usb.h:1212
otg_eptout_type
Definition: at32f415_usb.h:1235
otg_eptout_type::eptdis
__IO uint32_t eptdis
Definition: at32f415_usb.h:1257
otg_eptout_type::pktcnt
__IO uint32_t pktcnt
Definition: at32f415_usb.h:1292
otg_eptout_type::setd1pid
__IO uint32_t setd1pid
Definition: at32f415_usb.h:1256
otg_eptout_type::eptena
__IO uint32_t eptena
Definition: at32f415_usb.h:1258
otg_eptout_type::setd0pid
__IO uint32_t setd0pid
Definition: at32f415_usb.h:1255
otg_eptout_type::cnak
__IO uint32_t cnak
Definition: at32f415_usb.h:1253
otg_eptout_type::doepctl_bit
struct otg_eptout_type::@795::@801 doepctl_bit
otg_eptout_type::doeptsiz
__IO uint32_t doeptsiz
Definition: at32f415_usb.h:1288
otg_eptout_type::snak
__IO uint32_t snak
Definition: at32f415_usb.h:1254
otg_eptout_type::doepint
__IO uint32_t doepint
Definition: at32f415_usb.h:1268
otg_eptout_type::doepctl
__IO uint32_t doepctl
Definition: at32f415_usb.h:1241
otg_eptout_type::doeptsiz_bit
struct otg_eptout_type::@799::@803 doeptsiz_bit
otg_eptout_type::xfersize
__IO uint32_t xfersize
Definition: at32f415_usb.h:1291
otg_global_type
Definition: at32f415_usb.h:473
otg_global_type::dieptxfn
__IO uint32_t dieptxfn[7]
Definition: at32f415_usb.h:776
otg_global_type::gintsts
__IO uint32_t gintsts
Definition: at32f415_usb.h:564
otg_global_type::gintmsk
__IO uint32_t gintmsk
Definition: at32f415_usb.h:604
usb_ept_info
usb endpoint infomation structure definition
Definition: at32f415_usb.h:421
usb_ept_info::ept0_slen
uint32_t ept0_slen
Definition: at32f415_usb.h:440
usb_ept_info::inout
uint8_t inout
Definition: at32f415_usb.h:424
usb_ept_info::maxpacket
uint32_t maxpacket
Definition: at32f415_usb.h:429
usb_ept_info::total_len
uint32_t total_len
Definition: at32f415_usb.h:436
usb_ept_info::trans_buf
uint8_t * trans_buf
Definition: at32f415_usb.h:435
usb_ept_info::stall
uint8_t stall
Definition: at32f415_usb.h:431
usb_ept_info::trans_len
uint32_t trans_len
Definition: at32f415_usb.h:437
usb_ept_info::last_len
uint32_t last_len
Definition: at32f415_usb.h:439
usb_ept_info::eptn
uint8_t eptn
Definition: at32f415_usb.h:422
usb_ept_info::trans_type
uint8_t trans_type
Definition: at32f415_usb.h:425
usb_core.h
usb core header file
usbd_core.h
usb device core header file
usbd_sdr.h


AT32F415 Firmwary Library: usbd_core.h Source File

  • middlewares
  • usb_drivers
  • inc
usbd_core.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USBD_CORE_H
29#define __USBD_CORE_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36#include "usb_conf.h"
37#include "usb_std.h"
38
51#ifdef USE_OTG_DEVICE_MODE
52
56typedef enum
57{
58 USBD_NOP_EVENT,
59 USBD_RESET_EVENT,
60 USBD_SUSPEND_EVENT,
61 USBD_WAKEUP_EVENT,
62 USBD_DISCONNECT_EVNET,
63 USBD_INISOINCOM_EVENT,
64 USBD_OUTISOINCOM_EVENT,
65 USBD_ERR_EVENT
66}usbd_event_type;
67
71typedef struct
72{
73 uint16_t length;
74 uint8_t *descriptor;
75}usbd_desc_t;
76
80typedef struct
81{
82 usbd_desc_t *(*get_device_descriptor)(void);
83 usbd_desc_t *(*get_device_qualifier)(void);
84 usbd_desc_t *(*get_device_configuration)(void);
85 usbd_desc_t *(*get_device_other_speed)(void);
86 usbd_desc_t *(*get_device_lang_id)(void);
87 usbd_desc_t *(*get_device_manufacturer_string)(void);
88 usbd_desc_t *(*get_device_product_string)(void);
89 usbd_desc_t *(*get_device_serial_string)(void);
90 usbd_desc_t *(*get_device_interface_string)(void);
91 usbd_desc_t *(*get_device_config_string)(void);
92}usbd_desc_handler;
93
97typedef struct
98{
99 usb_sts_type (*init_handler)(void *udev);
100 usb_sts_type (*clear_handler)(void *udev);
101 usb_sts_type (*setup_handler)(void *udev, usb_setup_type *setup);
102 usb_sts_type (*ept0_tx_handler)(void *udev);
103 usb_sts_type (*ept0_rx_handler)(void *udev);
104 usb_sts_type (*in_handler)(void *udev, uint8_t ept_num);
105 usb_sts_type (*out_handler)(void *udev, uint8_t ept_num);
106 usb_sts_type (*sof_handler)(void *udev);
107 usb_sts_type (*event_handler)(void *udev, usbd_event_type event);
108}usbd_class_handler;
109
113typedef struct
114{
115 usb_reg_type *usb_reg;
117 usbd_class_handler *class_handler;
118 usbd_desc_handler *desc_handler;
120 usb_ept_info ept_in[USB_EPT_MAX_NUM];
121 usb_ept_info ept_out[USB_EPT_MAX_NUM];
123 usb_setup_type setup;
124 uint8_t setup_buffer[12];
126 uint8_t ept0_sts;
127 uint8_t speed;
128 uint16_t ept0_wlength;
130 usbd_conn_state conn_state;
131 usbd_conn_state old_conn_state;
133 uint8_t device_addr;
134 uint8_t remote_wakup;
135 uint8_t default_config;
136 uint8_t dev_config;
137 uint32_t config_status;
138}usbd_core_type;
139
140void usbd_core_in_handler(usbd_core_type *udev, uint8_t ept_num);
141void usbd_core_out_handler(usbd_core_type *udev, uint8_t ept_num);
142void usbd_core_setup_handler(usbd_core_type *udev, uint8_t ept_num);
143void usbd_ctrl_unsupport(usbd_core_type *udev);
144void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len);
145void usbd_ctrl_recv(usbd_core_type *udev, uint8_t *buffer, uint16_t len);
146void usbd_ctrl_send_status(usbd_core_type *udev);
147void usbd_ctrl_recv_status(usbd_core_type *udev);
148void usbd_set_stall(usbd_core_type *udev, uint8_t ept_addr);
149void usbd_clear_stall(usbd_core_type *udev, uint8_t ept_addr);
150void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket);
151void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr);
152void usbd_ept_send(usbd_core_type *udev, uint8_t ept_num, uint8_t *buffer, uint16_t len);
153void usbd_ept_recv(usbd_core_type *udev, uint8_t ept_num, uint8_t *buffer, uint16_t len);
154void usbd_connect(usbd_core_type *udev);
155void usbd_disconnect(usbd_core_type *udev);
156void usbd_set_device_addr(usbd_core_type *udev, uint8_t address);
157uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr);
158void usb_ept_defaut_init(usbd_core_type *udev);
159 usbd_conn_state usbd_connect_state_get(usbd_core_type *udev);
160void usbd_remote_wakeup(usbd_core_type *udev);
161void usbd_enter_suspend(usbd_core_type *udev);
162void usbd_flush_tx_fifo(usbd_core_type *udev, uint8_t ept_num);
163void usbd_fifo_alloc(usbd_core_type *udev);
164 usb_sts_type usbd_core_init(usbd_core_type *udev,
165 usb_reg_type *usb_reg,
166 usbd_class_handler *class_handler,
167 usbd_desc_handler *desc_handler,
168 uint8_t core_id);
169#endif
170
182#ifdef __cplusplus
183}
184#endif
185
186#endif
class_handler
usbd_class_handler class_handler
Definition: cdc_class.c:75
desc_handler
usbd_desc_handler desc_handler
device descriptor handler structure
Definition: cdc_desc.c:64
usbd_conn_state
usbd_conn_state
usb device connect state
Definition: usb_std.h:128
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
usbd_connect_state_get
usbd_conn_state usbd_connect_state_get(usbd_core_type *udev)
get usb connect state
Definition: usbd_core.c:592
usbd_set_stall
void usbd_set_stall(usbd_core_type *udev, uint8_t ept_addr)
usb set endpoint to stall status
Definition: usbd_core.c:257
usbd_ept_close
void usbd_ept_close(usbd_core_type *udev, uint8_t ept_addr)
usb close endpoint
Definition: usbd_core.c:341
usbd_ctrl_send_status
void usbd_ctrl_send_status(usbd_core_type *udev)
usb control endpoint send in status
Definition: usbd_core.c:207
usbd_set_device_addr
void usbd_set_device_addr(usbd_core_type *udev, uint8_t address)
usb device set device address.
Definition: usbd_core.c:385
usbd_ept_recv
void usbd_ept_recv(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint receive data
Definition: usbd_core.c:529
usbd_flush_tx_fifo
void usbd_flush_tx_fifo(usbd_core_type *udev, uint8_t ept_num)
usb device flush in endpoint fifo
Definition: usbd_core.c:645
usbd_fifo_alloc
void usbd_fifo_alloc(usbd_core_type *udev)
usb device endpoint fifo alloc
Definition: usbd_core.c:656
usbd_core_out_handler
void usbd_core_out_handler(usbd_core_type *udev, uint8_t ept_addr)
usb core out transfer complete handler
Definition: usbd_core.c:98
usbd_ept_open
void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint
Definition: usbd_core.c:309
usbd_core_init
usb_sts_type usbd_core_init(usbd_core_type *udev, usb_reg_type *usb_reg, usbd_class_handler *class_handler, usbd_desc_handler *desc_handler, uint8_t core_id)
usb device core initialization
Definition: usbd_core.c:740
usbd_ctrl_recv_status
void usbd_ctrl_recv_status(usbd_core_type *udev)
usb control endpoint send out status
Definition: usbd_core.c:219
usbd_ctrl_send
void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data
Definition: usbd_core.c:174
usbd_core_in_handler
void usbd_core_in_handler(usbd_core_type *udev, uint8_t ept_addr)
usb core in transfer complete handler
Definition: usbd_core.c:50
usbd_ept_send
void usbd_ept_send(usbd_core_type *udev, uint8_t ept_addr, uint8_t *buffer, uint16_t len)
endpoint send data
Definition: usbd_core.c:429
usbd_clear_stall
void usbd_clear_stall(usbd_core_type *udev, uint8_t ept_addr)
clear endpoint stall
Definition: usbd_core.c:232
usbd_get_recv_len
uint32_t usbd_get_recv_len(usbd_core_type *udev, uint8_t ept_addr)
get endpoint receive data length
Definition: usbd_core.c:295
usbd_remote_wakeup
void usbd_remote_wakeup(usbd_core_type *udev)
usb device remote wakeup
Definition: usbd_core.c:602
usbd_connect
void usbd_connect(usbd_core_type *udev)
usb device connect to host
Definition: usbd_core.c:364
usbd_ctrl_recv
void usbd_ctrl_recv(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint recv data
Definition: usbd_core.c:192
usbd_ctrl_unsupport
void usbd_ctrl_unsupport(usbd_core_type *udev)
un-support device request
Definition: usbd_core.c:282
usbd_enter_suspend
void usbd_enter_suspend(usbd_core_type *udev)
usb device enter suspend mode
Definition: usbd_core.c:629
usbd_disconnect
void usbd_disconnect(usbd_core_type *udev)
usb device disconnect to host
Definition: usbd_core.c:374
usbd_core_setup_handler
void usbd_core_setup_handler(usbd_core_type *udev, uint8_t ept_num)
usb core setup transfer complete handler
Definition: usbd_core.c:138
otg_global_type
Definition: at32f415_usb.h:473
usb_ept_info
usb endpoint infomation structure definition
Definition: at32f415_usb.h:421
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_std.h
usb standard header file


AT32F415 Firmwary Library: usbd_int.c Source File

  • middlewares
  • usb_drivers
  • src
usbd_int.c
Go to the documentation of this file.
1
26#include "usbd_int.h"
27
46void usbd_irq_handler(otg_core_type *otgdev)
47{
48 otg_global_type *usbx = otgdev->usb_reg;
49 usbd_core_type *udev = &otgdev->dev;
50 uint32_t intsts = usb_global_get_all_interrupt(usbx);
51
52 /* check current device mode */
53 if(usbx->gintsts_bit.curmode == 0)
54 {
55 /* mode mismatch interrupt */
56 if(intsts & USB_OTG_MODEMIS_FLAG)
57 {
58 usb_global_clear_interrupt(usbx, USB_OTG_MODEMIS_FLAG);
59 }
60
61 /* in endpoint interrupt */
62 if(intsts & USB_OTG_IEPT_FLAG)
63 {
64 usbd_inept_handler(udev);
65 }
66
67 /* out endpoint interrupt */
68 if(intsts & USB_OTG_OEPT_FLAG)
69 {
70 usbd_outept_handler(udev);
71 }
72
73 /* usb reset interrupt */
74 if(intsts & USB_OTG_USBRST_FLAG)
75 {
76 usbd_reset_handler(udev);
77 usb_global_clear_interrupt(usbx, USB_OTG_USBRST_FLAG);
78 }
79
80 /* sof interrupt */
81 if(intsts & USB_OTG_SOF_FLAG)
82 {
83 usbd_sof_handler(udev);
84 usb_global_clear_interrupt(usbx, USB_OTG_SOF_FLAG);
85 }
86
87 /* enumeration done interrupt */
88 if(intsts & USB_OTG_ENUMDONE_FLAG)
89 {
90 usbd_enumdone_handler(udev);
91 usb_global_clear_interrupt(usbx, USB_OTG_ENUMDONE_FLAG);
92 }
93
94 /* rx non-empty interrupt, indicates that there is at least one
95 data packet pending to be read in rx fifo */
96 if(intsts & USB_OTG_RXFLVL_FLAG)
97 {
98 usbd_rxflvl_handler(udev);
99 }
100
101 /* incomplete isochronous in transfer interrupt */
102 if(intsts & USB_OTG_INCOMISOIN_FLAG)
103 {
104 usbd_incomisioin_handler(udev);
105 usb_global_clear_interrupt(usbx, USB_OTG_INCOMISOIN_FLAG);
106 }
107 #ifndef USB_VBUS_IGNORE
108 /* disconnect detected interrupt */
109 if(intsts & USB_OTG_OTGINT_FLAG)
110 {
111 uint32_t tmp = udev->usb_reg->gotgint;
112 if(udev->usb_reg->gotgint_bit.sesenddet)
113 usbd_discon_handler(udev);
114 udev->usb_reg->gotgint = tmp;
115 usb_global_clear_interrupt(usbx, USB_OTG_OTGINT_FLAG);
116 }
117#endif
118 /* incomplete isochronous out transfer interrupt */
119 if(intsts & USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG)
120 {
121 usbd_incomisoout_handler(udev);
122 usb_global_clear_interrupt(usbx, USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG);
123 }
124
125 /* resume/remote wakeup interrupt */
126 if(intsts & USB_OTG_WKUP_FLAG)
127 {
128 usbd_wakeup_handler(udev);
129 usb_global_clear_interrupt(usbx, USB_OTG_WKUP_FLAG);
130 }
131
132 /* usb suspend interrupt */
133 if(intsts & USB_OTG_USBSUSP_FLAG)
134 {
135 usbd_suspend_handler(udev);
136 usb_global_clear_interrupt(usbx, USB_OTG_USBSUSP_FLAG);
137 }
138 }
139}
140
147void usb_write_empty_txfifo(usbd_core_type *udev, uint32_t ept_num)
148{
149 otg_global_type *usbx = udev->usb_reg;
150 usb_ept_info *ept_info = &udev->ept_in[ept_num];
151 uint32_t length = ept_info->total_len - ept_info->trans_len;
152 uint32_t wlen = 0;
153
154 if(length > ept_info->maxpacket)
155 {
156 length = ept_info->maxpacket;
157 }
158 wlen = (length + 3) / 4;
159
160 while((USB_INEPT(usbx, ept_num)->dtxfsts & USB_OTG_DTXFSTS_INEPTFSAV) > wlen &&
161 (ept_info->trans_len < ept_info->total_len) && (ept_info->total_len != 0))
162 {
163 length = ept_info->total_len - ept_info->trans_len;
164 if(length > ept_info->maxpacket)
165 {
166 length = ept_info->maxpacket;
167 }
168 wlen = (length + 3) / 4;
169 usb_write_packet(usbx, ept_info->trans_buf, ept_num, length);
170
171 ept_info->trans_buf += length;
172 ept_info->trans_len += length;
173
174 }
175 if(length <= 0)
176 {
177 OTG_DEVICE(usbx)->diepempmsk &= ~(0x1 << ept_num);
178 }
179}
180
181
187void usbd_inept_handler(usbd_core_type *udev)
188{
189 otg_global_type *usbx = udev->usb_reg;
190 uint32_t ept_num = 0, ept_int;
191 uint32_t intsts;
192
193 /*get all endpoint interrut */
194 intsts = usb_get_all_in_interrupt(usbx);
195 while(intsts)
196 {
197 if(intsts & 0x1)
198 {
199 /* get endpoint interrupt flag */
200 ept_int = usb_ept_in_interrupt(usbx, ept_num);
201
202 /* transfer completed interrupt */
203 if(ept_int & USB_OTG_DIEPINT_XFERC_FLAG)
204 {
205 OTG_DEVICE(usbx)->diepempmsk &= ~(1 << ept_num);
206 usb_ept_in_clear(usbx, ept_num , USB_OTG_DIEPINT_XFERC_FLAG);
207 usbd_core_in_handler(udev, ept_num);
208 }
209
210 /* timeout condition interrupt */
211 if(ept_int & USB_OTG_DIEPINT_TIMEOUT_FLAG)
212 {
213 usb_ept_in_clear(usbx, ept_num , USB_OTG_DIEPINT_TIMEOUT_FLAG);
214 }
215
216 /* in token received when tx fifo is empty */
217 if(ept_int & USB_OTG_DIEPINT_INTKNTXFEMP_FLAG)
218 {
219 usb_ept_in_clear(usbx, ept_num , USB_OTG_DIEPINT_INTKNTXFEMP_FLAG);
220 }
221
222 /* in endpoint nak effective */
223 if(ept_int & USB_OTG_DIEPINT_INEPTNAK_FLAG)
224 {
225 usb_ept_in_clear(usbx, ept_num , USB_OTG_DIEPINT_INEPTNAK_FLAG);
226 }
227
228 /* endpoint disable interrupt */
229 if(ept_int & USB_OTG_DIEPINT_EPTDISD_FLAG)
230 {
231 usb_ept_in_clear(usbx, ept_num , USB_OTG_DIEPINT_EPTDISD_FLAG);
232 }
233
234 /* transmit fifo empty interrupt */
235 if(ept_int & USB_OTG_DIEPINT_TXFEMP_FLAG)
236 {
237 usb_write_empty_txfifo(udev, ept_num);
238 }
239 }
240 ept_num ++;
241 intsts >>= 1;
242 }
243}
244
250void usbd_outept_handler(usbd_core_type *udev)
251{
252 otg_global_type *usbx = udev->usb_reg;
253 uint32_t ept_num = 0, ept_int;
254 uint32_t intsts;
255
256 /* get all out endpoint interrupt */
257 intsts = usb_get_all_out_interrupt(usbx);
258
259 while(intsts)
260 {
261 if(intsts & 0x1)
262 {
263 /* get out endpoint interrupt */
264 ept_int = usb_ept_out_interrupt(usbx, ept_num);
265
266 /* transfer completed interrupt */
267 if(ept_int & USB_OTG_DOEPINT_XFERC_FLAG)
268 {
269 usb_ept_out_clear(usbx, ept_num , USB_OTG_DOEPINT_XFERC_FLAG);
270 usbd_core_out_handler(udev, ept_num);
271 }
272
273 /* setup phase done interrupt */
274 if(ept_int & USB_OTG_DOEPINT_SETUP_FLAG)
275 {
276 usb_ept_out_clear(usbx, ept_num , USB_OTG_DOEPINT_SETUP_FLAG);
277 usbd_core_setup_handler(udev, ept_num);
278 if(udev->device_addr != 0)
279 {
280 OTG_DEVICE(udev->usb_reg)->dcfg_bit.devaddr = udev->device_addr;
281 udev->device_addr = 0;
282 }
283 }
284
285 /* endpoint disable interrupt */
286 if(ept_int & USB_OTG_DOEPINT_OUTTEPD_FLAG)
287 {
288 usb_ept_out_clear(usbx, ept_num , USB_OTG_DOEPINT_OUTTEPD_FLAG);
289 }
290 }
291 ept_num ++;
292 intsts >>= 1;
293 }
294}
295
301void usbd_enumdone_handler(usbd_core_type *udev)
302{
303 otg_global_type *usbx = udev->usb_reg;
304
305 usb_ept0_setup(usbx);
306
307 usbx->gusbcfg_bit.usbtrdtim = USB_TRDTIM_16;
308
309 /* open endpoint 0 out */
310 usbd_ept_open(udev, 0x00, EPT_CONTROL_TYPE, 0x40);
311
312 /* open endpoint 0 in */
313 usbd_ept_open(udev, 0x80, EPT_CONTROL_TYPE, 0x40);
314
315 /* usb connect state set to default */
316 udev->conn_state = USB_CONN_STATE_DEFAULT;
317
318 /* clear callback */
319 if(udev->class_handler->clear_handler != 0)
320 udev->class_handler->clear_handler(udev);
321}
322
328void usbd_rxflvl_handler(usbd_core_type *udev)
329{
330 otg_global_type *usbx = udev->usb_reg;
331 uint32_t stsp;
332 uint32_t count;
333 uint32_t pktsts;
334 usb_ept_info *ept_info;
335
336 /* disable rxflvl interrupt */
337 usb_global_interrupt_enable(usbx, USB_OTG_RXFLVL_INT, FALSE);
338
339 /* get rx status */
340 stsp = usbx->grxstsp;
341
342 /*get the byte count of receive */
343 count = (stsp & USB_OTG_GRXSTSP_BCNT) >> 4;
344
345 /* get packet status */
346 pktsts = (stsp &USB_OTG_GRXSTSP_PKTSTS) >> 17;
347
348 /* get endpoint infomation struct */
349 ept_info = &udev->ept_out[stsp & USB_OTG_GRXSTSP_EPTNUM];
350
351 /* received out data packet */
352 if(pktsts == USB_OUT_STS_DATA)
353 {
354 if(count != 0)
355 {
356 /* read packet to buffer */
357 usb_read_packet(usbx, ept_info->trans_buf, (stsp & USB_OTG_GRXSTSP_EPTNUM), count);
358 ept_info->trans_buf += count;
359 ept_info->trans_len += count;
360
361 }
362 }
363 /* setup data received */
364 else if ( pktsts == USB_SETUP_STS_DATA)
365 {
366 /* read packet to buffer */
367 usb_read_packet(usbx, udev->setup_buffer, (stsp & USB_OTG_GRXSTSP_EPTNUM), count);
368 ept_info->trans_len += count;
369 }
370
371 /* enable rxflvl interrupt */
372 usb_global_interrupt_enable(usbx, USB_OTG_RXFLVL_INT, TRUE);
373
374}
375
381void usbd_discon_handler(usbd_core_type *udev)
382{
383 /* disconnect callback handler */
384 if(udev->class_handler->event_handler != 0)
385 udev->class_handler->event_handler(udev, USBD_DISCONNECT_EVNET);
386}
387
388
394void usbd_incomisoout_handler(usbd_core_type *udev)
395{
396 if(udev->class_handler->event_handler != 0)
397 udev->class_handler->event_handler(udev, USBD_OUTISOINCOM_EVENT);
398}
399
405void usbd_incomisioin_handler(usbd_core_type *udev)
406{
407 if(udev->class_handler->event_handler != 0)
408 udev->class_handler->event_handler(udev, USBD_INISOINCOM_EVENT);
409}
410
416void usbd_reset_handler(usbd_core_type *udev)
417{
418 otg_global_type *usbx = udev->usb_reg;
419 otg_device_type *dev = OTG_DEVICE(usbx);
420 uint32_t i_index = 0;
421
422 /* disable remote wakeup singal */
423 dev->dctl_bit.rwkupsig = FALSE;
424
425 /* endpoint fifo alloc */
426 usbd_fifo_alloc(udev);
427
428 /* flush all tx fifo */
429 usb_flush_tx_fifo(usbx, 0x10);
430
431 /* clear in and out endpoint interrupt flag */
432 for(i_index = 0; i_index < USB_EPT_MAX_NUM; i_index ++)
433 {
434 USB_INEPT(usbx, i_index)->diepint = 0xFF;
435 USB_OUTEPT(usbx, i_index)->doepint = 0xFF;
436 }
437
438 /* clear endpoint flag */
439 dev->daint = 0xFFFFFFFF;
440
441 /*clear endpoint interrupt mask */
442 dev->daintmsk = 0x10001;
443
444 /* enable out endpoint xfer, eptdis, setup interrupt mask */
445 dev->doepmsk_bit.xfercmsk = TRUE;
446 dev->doepmsk_bit.eptdismsk = TRUE;
447 dev->doepmsk_bit.setupmsk = TRUE;
448
449 /* enable in endpoint xfer, eptdis, timeout interrupt mask */
450 dev->diepmsk_bit.xfercmsk = TRUE;
451 dev->diepmsk_bit.eptdismsk = TRUE;
452 dev->diepmsk_bit.timeoutmsk = TRUE;
453
454 /* set device address to 0 */
455 usb_set_address(usbx, 0);
456
457 /* enable endpoint 0 */
458 usb_ept0_start(usbx);
459
460 /* usb connect state set to default */
461 udev->conn_state = USB_CONN_STATE_DEFAULT;
462
463 /* user define reset event */
464 if(udev->class_handler->event_handler)
465 udev->class_handler->event_handler(udev, USBD_RESET_EVENT);
466}
467
473void usbd_sof_handler(usbd_core_type *udev)
474{
475 /* user sof handler in class define */
476 if(udev->class_handler->sof_handler)
477 udev->class_handler->sof_handler(udev);
478}
479
485void usbd_suspend_handler(usbd_core_type *udev)
486{
487 otg_global_type *usbx = udev->usb_reg;
488
489 if(OTG_DEVICE(usbx)->dsts_bit.suspsts)
490 {
491 /* save connect state */
492 udev->old_conn_state = udev->conn_state;
493
494 /* set current state to suspend */
495 udev->conn_state = USB_CONN_STATE_SUSPENDED;
496
497 /* enter suspend mode */
498 usbd_enter_suspend(udev);
499
500 /* user suspend handler */
501 if(udev->class_handler->event_handler != 0)
502 udev->class_handler->event_handler(udev, USBD_SUSPEND_EVENT);
503 }
504}
505
511void usbd_wakeup_handler(usbd_core_type *udev)
512{
513 otg_global_type *usbx = udev->usb_reg;
514
515 /* clear remote wakeup bit */
516 OTG_DEVICE(usbx)->dctl_bit.rwkupsig = FALSE;
517
518 /* exit suspend mode */
519 usb_open_phy_clk(udev->usb_reg);
520
521 /* restore connect state */
522 udev->conn_state = udev->old_conn_state;
523
524 /* user suspend handler */
525 if(udev->class_handler->event_handler != 0)
526 udev->class_handler->event_handler(udev, USBD_WAKEUP_EVENT);
527}
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
USB_OTG_DIEPINT_TIMEOUT_FLAG
#define USB_OTG_DIEPINT_TIMEOUT_FLAG
Definition: at32f415_usb.h:282
USB_OTG_DIEPINT_XFERC_FLAG
#define USB_OTG_DIEPINT_XFERC_FLAG
usb device in endpoint flag
Definition: at32f415_usb.h:280
USB_OTG_DIEPINT_EPTDISD_FLAG
#define USB_OTG_DIEPINT_EPTDISD_FLAG
Definition: at32f415_usb.h:281
USB_OTG_DOEPINT_SETUP_FLAG
#define USB_OTG_DOEPINT_SETUP_FLAG
Definition: at32f415_usb.h:292
USB_OTG_DOEPINT_XFERC_FLAG
#define USB_OTG_DOEPINT_XFERC_FLAG
usb device out endpoint flag
Definition: at32f415_usb.h:290
USB_OTG_DIEPINT_INTKNTXFEMP_FLAG
#define USB_OTG_DIEPINT_INTKNTXFEMP_FLAG
Definition: at32f415_usb.h:283
USB_OTG_DIEPINT_TXFEMP_FLAG
#define USB_OTG_DIEPINT_TXFEMP_FLAG
Definition: at32f415_usb.h:285
USB_OTG_DIEPINT_INEPTNAK_FLAG
#define USB_OTG_DIEPINT_INEPTNAK_FLAG
Definition: at32f415_usb.h:284
USB_OTG_DTXFSTS_INEPTFSAV
#define USB_OTG_DTXFSTS_INEPTFSAV
usb device in endpoint fifo space mask
Definition: at32f415_usb.h:299
USB_OTG_DOEPINT_OUTTEPD_FLAG
#define USB_OTG_DOEPINT_OUTTEPD_FLAG
Definition: at32f415_usb.h:293
EPT_CONTROL_TYPE
@ EPT_CONTROL_TYPE
Definition: at32f415_usb.h:346
usb_ept_out_clear
void usb_ept_out_clear(otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear out endpoint interrupt flag
Definition: at32f415_usb.c:685
usb_ept0_setup
void usb_ept0_setup(otg_global_type *usbx)
endpoint 0 start setup
Definition: at32f415_usb.c:752
usb_ept_in_clear
void usb_ept_in_clear(otg_global_type *usbx, uint32_t eptn, uint32_t flag)
clear in endpoint interrupt flag
Definition: at32f415_usb.c:706
usb_write_packet
void usb_write_packet(otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
write data from user memory to usb buffer
Definition: at32f415_usb.c:417
usb_global_interrupt_enable
void usb_global_interrupt_enable(otg_global_type *usbx, uint16_t interrupt, confirm_state new_state)
usb interrupt mask enable
Definition: at32f415_usb.c:191
usb_global_clear_interrupt
void usb_global_clear_interrupt(otg_global_type *usbx, uint32_t flag)
clear the global interrupt flag
Definition: at32f415_usb.c:250
usb_ept0_start
void usb_ept0_start(otg_global_type *usbx)
enable endpoint 0 out
Definition: at32f415_usb.c:734
usb_set_address
void usb_set_address(otg_global_type *usbx, uint8_t address)
set the host assignment address
Definition: at32f415_usb.c:721
usb_flush_tx_fifo
void usb_flush_tx_fifo(otg_global_type *usbx, uint32_t fifo_num)
flush tx fifo
Definition: at32f415_usb.c:119
OTG_DEVICE
#define OTG_DEVICE(usbx)
Definition: at32f415_usb.h:1342
usb_ept_out_interrupt
uint32_t usb_ept_out_interrupt(otg_global_type *usbx, uint32_t eptn)
get out endpoint interrupt flag
Definition: at32f415_usb.c:645
usb_global_get_all_interrupt
uint32_t usb_global_get_all_interrupt(otg_global_type *usbx)
get all global core interrupt flag
Definition: at32f415_usb.c:211
USB_OUTEPT
#define USB_OUTEPT(usbx, eptn)
Definition: at32f415_usb.h:1346
usb_get_all_out_interrupt
uint32_t usb_get_all_out_interrupt(otg_global_type *usbx)
get all out endpoint interrupt bits
Definition: at32f415_usb.c:615
usb_ept_in_interrupt
uint32_t usb_ept_in_interrupt(otg_global_type *usbx, uint32_t eptn)
get in endpoint interrupt flag
Definition: at32f415_usb.c:660
usb_get_all_in_interrupt
uint32_t usb_get_all_in_interrupt(otg_global_type *usbx)
get all in endpoint interrupt bits
Definition: at32f415_usb.c:629
USB_INEPT
#define USB_INEPT(usbx, eptn)
Definition: at32f415_usb.h:1345
usb_open_phy_clk
void usb_open_phy_clk(otg_global_type *usbx)
usb open phy clock
Definition: at32f415_usb.c:404
usb_read_packet
void usb_read_packet(otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
read data from usb buffer to user buffer
Definition: at32f415_usb.c:440
USB_OTG_OEPT_FLAG
#define USB_OTG_OEPT_FLAG
Definition: at32f415_usb.h:100
USB_OTG_OTGINT_FLAG
#define USB_OTG_OTGINT_FLAG
Definition: at32f415_usb.h:87
USB_OTG_MODEMIS_FLAG
#define USB_OTG_MODEMIS_FLAG
Definition: at32f415_usb.h:86
USB_OTG_WKUP_FLAG
#define USB_OTG_WKUP_FLAG
Definition: at32f415_usb.h:108
USB_OTG_USBSUSP_FLAG
#define USB_OTG_USBSUSP_FLAG
Definition: at32f415_usb.h:94
USB_OTG_INCOMISOIN_FLAG
#define USB_OTG_INCOMISOIN_FLAG
Definition: at32f415_usb.h:101
USB_OTG_ENUMDONE_FLAG
#define USB_OTG_ENUMDONE_FLAG
Definition: at32f415_usb.h:96
USB_OTG_RXFLVL_FLAG
#define USB_OTG_RXFLVL_FLAG
Definition: at32f415_usb.h:89
USB_OTG_USBRST_FLAG
#define USB_OTG_USBRST_FLAG
Definition: at32f415_usb.h:95
USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG
#define USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG
Definition: at32f415_usb.h:102
USB_OTG_IEPT_FLAG
#define USB_OTG_IEPT_FLAG
Definition: at32f415_usb.h:99
USB_OTG_SOF_FLAG
#define USB_OTG_SOF_FLAG
Definition: at32f415_usb.h:88
USB_OTG_RXFLVL_INT
#define USB_OTG_RXFLVL_INT
Definition: at32f415_usb.h:55
USB_TRDTIM_16
#define USB_TRDTIM_16
Definition: at32f415_usb.h:124
USB_OUT_STS_DATA
#define USB_OUT_STS_DATA
Definition: at32f415_usb.h:147
USB_SETUP_STS_DATA
#define USB_SETUP_STS_DATA
Definition: at32f415_usb.h:150
USB_OTG_GRXSTSP_PKTSTS
#define USB_OTG_GRXSTSP_PKTSTS
Definition: at32f415_usb.h:133
USB_OTG_GRXSTSP_BCNT
#define USB_OTG_GRXSTSP_BCNT
Definition: at32f415_usb.h:131
USB_OTG_GRXSTSP_EPTNUM
#define USB_OTG_GRXSTSP_EPTNUM
usb receive status
Definition: at32f415_usb.h:129
USB_CONN_STATE_SUSPENDED
@ USB_CONN_STATE_SUSPENDED
Definition: usb_std.h:132
USB_CONN_STATE_DEFAULT
@ USB_CONN_STATE_DEFAULT
Definition: usb_std.h:129
usbd_fifo_alloc
void usbd_fifo_alloc(usbd_core_type *udev)
usb device endpoint fifo alloc
Definition: usbd_core.c:656
usbd_core_out_handler
void usbd_core_out_handler(usbd_core_type *udev, uint8_t ept_addr)
usb core out transfer complete handler
Definition: usbd_core.c:98
usbd_ept_open
void usbd_ept_open(usbd_core_type *udev, uint8_t ept_addr, uint8_t ept_type, uint16_t maxpacket)
usb open endpoint
Definition: usbd_core.c:309
usbd_core_in_handler
void usbd_core_in_handler(usbd_core_type *udev, uint8_t ept_addr)
usb core in transfer complete handler
Definition: usbd_core.c:50
usbd_enter_suspend
void usbd_enter_suspend(usbd_core_type *udev)
usb device enter suspend mode
Definition: usbd_core.c:629
usbd_core_setup_handler
void usbd_core_setup_handler(usbd_core_type *udev, uint8_t ept_num)
usb core setup transfer complete handler
Definition: usbd_core.c:138
usbd_inept_handler
void usbd_inept_handler(usbd_core_type *udev)
usb in endpoint handler
Definition: usbd_int.c:187
usbd_outept_handler
void usbd_outept_handler(usbd_core_type *udev)
usb out endpoint handler
Definition: usbd_int.c:250
usbd_sof_handler
void usbd_sof_handler(usbd_core_type *udev)
usb device sof interrupt request handler.
Definition: usbd_int.c:473
usb_write_empty_txfifo
void usb_write_empty_txfifo(usbd_core_type *udev, uint32_t ept_num)
usb write tx fifo.
Definition: usbd_int.c:147
usbd_incomisioin_handler
void usbd_incomisioin_handler(usbd_core_type *udev)
usb incomplete in handler
Definition: usbd_int.c:405
usbd_enumdone_handler
void usbd_enumdone_handler(usbd_core_type *udev)
usb enumeration done handler
Definition: usbd_int.c:301
usbd_reset_handler
void usbd_reset_handler(usbd_core_type *udev)
usb device reset interrupt request handler.
Definition: usbd_int.c:416
usbd_irq_handler
void usbd_irq_handler(otg_core_type *otgdev)
usb device interrput request handler.
Definition: usbd_int.c:46
usbd_incomisoout_handler
void usbd_incomisoout_handler(usbd_core_type *udev)
usb incomplete out handler
Definition: usbd_int.c:394
usbd_rxflvl_handler
void usbd_rxflvl_handler(usbd_core_type *udev)
usb rx non-empty handler
Definition: usbd_int.c:328
usbd_wakeup_handler
void usbd_wakeup_handler(usbd_core_type *udev)
usb device wakup interrupt request handler.
Definition: usbd_int.c:511
usbd_discon_handler
void usbd_discon_handler(usbd_core_type *udev)
usb disconnect handler
Definition: usbd_int.c:381
usbd_suspend_handler
void usbd_suspend_handler(usbd_core_type *udev)
usb device suspend interrupt request handler.
Definition: usbd_int.c:485
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
otg_core_type::usb_reg
usb_reg_type * usb_reg
Definition: usb_core.h:102
otg_device_type
Definition: at32f415_usb.h:1007
otg_device_type::timeoutmsk
__IO uint32_t timeoutmsk
Definition: at32f415_usb.h:1076
otg_device_type::eptdismsk
__IO uint32_t eptdismsk
Definition: at32f415_usb.h:1074
otg_device_type::xfercmsk
__IO uint32_t xfercmsk
Definition: at32f415_usb.h:1073
otg_device_type::diepmsk_bit
struct otg_device_type::@765::@778 diepmsk_bit
otg_device_type::rwkupsig
__IO uint32_t rwkupsig
Definition: at32f415_usb.h:1033
otg_device_type::dctl_bit
struct otg_device_type::@761::@776 dctl_bit
otg_device_type::doepmsk_bit
struct otg_device_type::@767::@779 doepmsk_bit
otg_device_type::setupmsk
__IO uint32_t setupmsk
Definition: at32f415_usb.h:1098
otg_device_type::daintmsk
__IO uint32_t daintmsk
Definition: at32f415_usb.h:1127
otg_device_type::daint
__IO uint32_t daint
Definition: at32f415_usb.h:1114
otg_global_type
Definition: at32f415_usb.h:473
otg_global_type::gusbcfg_bit
struct otg_global_type::@681::@710 gusbcfg_bit
otg_global_type::curmode
__IO uint32_t curmode
Definition: at32f415_usb.h:567
otg_global_type::gintsts_bit
struct otg_global_type::@685::@712 gintsts_bit
otg_global_type::usbtrdtim
__IO uint32_t usbtrdtim
Definition: at32f415_usb.h:531
otg_global_type::grxstsp
__IO uint32_t grxstsp
Definition: at32f415_usb.h:661
usb_ept_info
usb endpoint infomation structure definition
Definition: at32f415_usb.h:421
usb_ept_info::maxpacket
uint32_t maxpacket
Definition: at32f415_usb.h:429
usb_ept_info::total_len
uint32_t total_len
Definition: at32f415_usb.h:436
usb_ept_info::trans_buf
uint8_t * trans_buf
Definition: at32f415_usb.h:435
usb_ept_info::trans_len
uint32_t trans_len
Definition: at32f415_usb.h:437
usbd_int.h
usb interrupt header file


AT32F415 Firmwary Library: usbd_int.h Source File

  • middlewares
  • usb_drivers
  • inc
usbd_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USBD_INT_H
29#define __USBD_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
46/* includes ------------------------------------------------------------------*/
47#include "usbd_core.h"
48#include "usb_core.h"
49
50void usbd_irq_handler(otg_core_type *udev);
51void usbd_ept_handler(usbd_core_type *udev);
52void usbd_reset_handler(usbd_core_type *udev);
53void usbd_sof_handler(usbd_core_type *udev);
54void usbd_suspend_handler(usbd_core_type *udev);
55void usbd_wakeup_handler(usbd_core_type *udev);
56void usbd_inept_handler(usbd_core_type *udev);
57void usbd_outept_handler(usbd_core_type *udev);
58void usbd_enumdone_handler(usbd_core_type *udev);
59void usbd_rxflvl_handler(usbd_core_type *udev);
60void usbd_incomisioin_handler(usbd_core_type *udev);
61void usbd_discon_handler(usbd_core_type *udev);
62void usbd_incomisoout_handler(usbd_core_type *udev);
63void usb_write_empty_txfifo(usbd_core_type *udev, uint32_t ept_num);
64
77#ifdef __cplusplus
78}
79#endif
80
81#endif
82
usbd_inept_handler
void usbd_inept_handler(usbd_core_type *udev)
usb in endpoint handler
Definition: usbd_int.c:187
usbd_outept_handler
void usbd_outept_handler(usbd_core_type *udev)
usb out endpoint handler
Definition: usbd_int.c:250
usbd_sof_handler
void usbd_sof_handler(usbd_core_type *udev)
usb device sof interrupt request handler.
Definition: usbd_int.c:473
usb_write_empty_txfifo
void usb_write_empty_txfifo(usbd_core_type *udev, uint32_t ept_num)
usb write tx fifo.
Definition: usbd_int.c:147
usbd_incomisioin_handler
void usbd_incomisioin_handler(usbd_core_type *udev)
usb incomplete in handler
Definition: usbd_int.c:405
usbd_ept_handler
void usbd_ept_handler(usbd_core_type *udev)
usbd_enumdone_handler
void usbd_enumdone_handler(usbd_core_type *udev)
usb enumeration done handler
Definition: usbd_int.c:301
usbd_reset_handler
void usbd_reset_handler(usbd_core_type *udev)
usb device reset interrupt request handler.
Definition: usbd_int.c:416
usbd_incomisoout_handler
void usbd_incomisoout_handler(usbd_core_type *udev)
usb incomplete out handler
Definition: usbd_int.c:394
usbd_rxflvl_handler
void usbd_rxflvl_handler(usbd_core_type *udev)
usb rx non-empty handler
Definition: usbd_int.c:328
usbd_wakeup_handler
void usbd_wakeup_handler(usbd_core_type *udev)
usb device wakup interrupt request handler.
Definition: usbd_int.c:511
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
usbd_discon_handler
void usbd_discon_handler(usbd_core_type *udev)
usb disconnect handler
Definition: usbd_int.c:381
usbd_suspend_handler
void usbd_suspend_handler(usbd_core_type *udev)
usb device suspend interrupt request handler.
Definition: usbd_int.c:485
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_core.h
usb device core header file


AT32F415 Firmwary Library: usbd_sdr.c Source File

  • middlewares
  • usb_drivers
  • src
usbd_sdr.c
Go to the documentation of this file.
1
26#include "usbd_sdr.h"
27
41static usb_sts_type usbd_get_descriptor(usbd_core_type *udev);
42static usb_sts_type usbd_set_address(usbd_core_type *udev);
43static usb_sts_type usbd_get_status(usbd_core_type *udev);
44static usb_sts_type usbd_clear_feature(usbd_core_type *udev);
45static usb_sts_type usbd_set_feature(usbd_core_type *udev);
46static usb_sts_type usbd_get_configuration(usbd_core_type *udev);
47static usb_sts_type usbd_set_configuration(usbd_core_type *udev);
48
55void usbd_setup_request_parse(usb_setup_type *setup, uint8_t *buf)
56{
57 setup->bmRequestType = *(uint8_t *) buf;
58 setup->bRequest = *(uint8_t *) (buf + 1);
59 setup->wValue = SWAPBYTE(buf + 2);
60 setup->wIndex = SWAPBYTE(buf + 4);
61 setup->wLength = SWAPBYTE(buf + 6);
62}
63
69static usb_sts_type usbd_get_descriptor(usbd_core_type *udev)
70{
71 usb_sts_type ret = USB_OK;
72 uint16_t len = 0;
73 usbd_desc_t *desc = NULL;
74 uint8_t desc_type = udev->setup.wValue >> 8;
75 switch(desc_type)
76 {
77 case USB_DESCIPTOR_TYPE_DEVICE:
78 desc = udev->desc_handler->get_device_descriptor();
79 break;
80 case USB_DESCIPTOR_TYPE_CONFIGURATION:
81 desc = udev->desc_handler->get_device_configuration();
82 break;
83 case USB_DESCIPTOR_TYPE_STRING:
84 {
85 uint8_t str_desc = (uint8_t)udev->setup.wValue;
86 switch(str_desc)
87 {
88 case USB_LANGID_STRING:
89 desc = udev->desc_handler->get_device_lang_id();
90 break;
91 case USB_MFC_STRING:
92 desc = udev->desc_handler->get_device_manufacturer_string();
93 break;
94 case USB_PRODUCT_STRING:
95 desc = udev->desc_handler->get_device_product_string();
96 break;
97 case USB_SERIAL_STRING:
98 desc = udev->desc_handler->get_device_serial_string();
99 break;
100 case USB_CONFIG_STRING:
101 desc = udev->desc_handler->get_device_config_string();
102 break;
103 case USB_INTERFACE_STRING:
104 desc = udev->desc_handler->get_device_interface_string();
105 break;
106 default:
107 usbd_ctrl_unsupport(udev);
108 return ret;
109 }
110 break;
111 }
112 case USB_DESCIPTOR_TYPE_DEVICE_QUALIFIER:
113 usbd_ctrl_unsupport(udev);
114 break;
115 case USB_DESCIPTOR_TYPE_OTHER_SPEED:
116 usbd_ctrl_unsupport(udev);
117 return ret;
118 default:
119 usbd_ctrl_unsupport(udev);
120 return ret;
121 }
122
123 if(desc != NULL)
124 {
125 if((desc->length != 0) && (udev->setup.wLength != 0))
126 {
127 len = MIN(desc->length , udev->setup.wLength);
128 usbd_ctrl_send(udev, desc->descriptor, len);
129 }
130 }
131 return ret;
132}
133
139static usb_sts_type usbd_set_address(usbd_core_type *udev)
140{
141 usb_sts_type ret = USB_OK;
142 usb_setup_type *setup = &udev->setup;
143 uint8_t dev_addr;
144
145 /* if wIndex or wLength are non-zero, then the behavior of
146 the device is not specified
147 */
148 if(setup->wIndex == 0 && setup->wLength == 0)
149 {
150 dev_addr = (uint8_t)(setup->wValue) & 0x7f;
151
152 /* device behavior when this request is received
153 while the device is in the configured state is not specified.*/
154 if(udev->conn_state == USB_CONN_STATE_CONFIGURED )
155 {
156 usbd_ctrl_unsupport(udev);
157 }
158 else
159 {
160 udev->device_addr = dev_addr;
161
162 if(dev_addr != 0)
163 {
164 udev->conn_state = USB_CONN_STATE_ADDRESSED;
165 }
166 else
167 {
168 udev->conn_state = USB_CONN_STATE_DEFAULT;
169 }
170 usbd_ctrl_send_status(udev);
171 }
172 }
173 else
174 {
175 usbd_ctrl_unsupport(udev);
176 }
177 return ret;
178}
179
185static usb_sts_type usbd_get_status(usbd_core_type *udev)
186{
187 usb_sts_type ret = USB_OK;
188 switch(udev->conn_state)
189 {
190 case USB_CONN_STATE_ADDRESSED:
191 case USB_CONN_STATE_CONFIGURED:
192 if(udev->remote_wakup)
193 {
194 udev->config_status |= USB_CONF_REMOTE_WAKEUP;
195 }
196 usbd_ctrl_send(udev, (uint8_t *)(&udev->config_status), 2);
197 break;
198 default:
199 usbd_ctrl_unsupport(udev);
200 break;
201 }
202 return ret;
203}
204
210static usb_sts_type usbd_clear_feature(usbd_core_type *udev)
211{
212 usb_sts_type ret = USB_OK;
213 usb_setup_type *setup = &udev->setup;
214 switch(udev->conn_state)
215 {
216 case USB_CONN_STATE_ADDRESSED:
217 case USB_CONN_STATE_CONFIGURED:
218 if(setup->wValue == USB_FEATURE_REMOTE_WAKEUP)
219 {
220 udev->remote_wakup = 0;
221 udev->config_status &= ~USB_CONF_REMOTE_WAKEUP;
222 udev->class_handler->setup_handler(udev, &udev->setup);
223 usbd_ctrl_send_status(udev);
224 }
225 break;
226 default:
227 usbd_ctrl_unsupport(udev);
228 break;
229 }
230 return ret;
231}
232
238static usb_sts_type usbd_set_feature(usbd_core_type *udev)
239{
240 usb_sts_type ret = USB_OK;
241 usb_setup_type *setup = &udev->setup;
242 if(setup->wValue == USB_FEATURE_REMOTE_WAKEUP)
243 {
244 udev->remote_wakup = 1;
245 udev->class_handler->setup_handler(udev, &udev->setup);
246 usbd_ctrl_send_status(udev);
247 }
248 return ret;
249}
250
256static usb_sts_type usbd_get_configuration(usbd_core_type *udev)
257{
258 usb_sts_type ret = USB_OK;
259 usb_setup_type *setup = &udev->setup;
260 if(setup->wLength != 1)
261 {
262 usbd_ctrl_unsupport(udev);
263 }
264 else
265 {
266 switch(udev->conn_state)
267 {
268 case USB_CONN_STATE_ADDRESSED:
269 udev->default_config = 0;
270 usbd_ctrl_send(udev, (uint8_t *)(&udev->default_config), 1);
271 break;
272 case USB_CONN_STATE_CONFIGURED:
273 usbd_ctrl_send(udev, (uint8_t *)(&udev->dev_config), 1);
274 break;
275 default:
276 usbd_ctrl_unsupport(udev);
277 break;
278 }
279 }
280 return ret;
281}
282
288static usb_sts_type usbd_set_configuration(usbd_core_type *udev)
289{
290 usb_sts_type ret = USB_OK;
291 static uint8_t config_value;
292 usb_setup_type *setup = &udev->setup;
293 config_value = (uint8_t)setup->wValue;
294
295 if(setup->wIndex == 0 && setup->wLength == 0)
296 {
297 switch(udev->conn_state)
298 {
299 case USB_CONN_STATE_ADDRESSED:
300 if(config_value)
301 {
302 udev->dev_config = config_value;
303 udev->conn_state = USB_CONN_STATE_CONFIGURED;
304 udev->class_handler->init_handler(udev);
305 usbd_ctrl_send_status(udev);
306 }
307 else
308 {
309 usbd_ctrl_send_status(udev);
310 }
311
312 break;
313 case USB_CONN_STATE_CONFIGURED:
314 if(config_value == 0)
315 {
316 udev->conn_state = USB_CONN_STATE_ADDRESSED;
317 udev->dev_config = config_value;
318 udev->class_handler->clear_handler(udev);
319 usbd_ctrl_send_status(udev);
320 }
321 else if(config_value == udev->dev_config)
322 {
323 udev->class_handler->clear_handler(udev);
324 udev->dev_config = config_value;
325 udev->class_handler->init_handler(udev);
326 usbd_ctrl_send_status(udev);
327 }
328 else
329 {
330 usbd_ctrl_send_status(udev);
331 }
332 break;
333 default:
334 usbd_ctrl_unsupport(udev);
335 break;
336 }
337 }
338 else
339 {
340 usbd_ctrl_unsupport(udev);
341 }
342 return ret;
343}
344
350 usb_sts_type usbd_device_request(usbd_core_type *udev)
351{
352 usb_sts_type ret = USB_OK;
353 usb_setup_type *setup = &udev->setup;
354 if((setup->bmRequestType & USB_REQ_TYPE_RESERVED) != USB_REQ_TYPE_STANDARD)
355 {
356 udev->class_handler->setup_handler(udev, &udev->setup);
357 return ret;
358 }
359 switch(udev->setup.bRequest)
360 {
361 case USB_STD_REQ_GET_STATUS:
362 usbd_get_status(udev);
363 break;
364 case USB_STD_REQ_CLEAR_FEATURE:
365 usbd_clear_feature(udev);
366 break;
367 case USB_STD_REQ_SET_FEATURE:
368 usbd_set_feature(udev);
369 break;
370 case USB_STD_REQ_SET_ADDRESS:
371 usbd_set_address(udev);
372 break;
373 case USB_STD_REQ_GET_DESCRIPTOR:
374 usbd_get_descriptor(udev);
375 break;
376 case USB_STD_REQ_GET_CONFIGURATION:
377 usbd_get_configuration(udev);
378 break;
379 case USB_STD_REQ_SET_CONFIGURATION:
380 usbd_set_configuration(udev);
381 break;
382 default:
383 usbd_ctrl_unsupport(udev);
384 break;
385 }
386 return ret;
387}
388
394 usb_sts_type usbd_interface_request(usbd_core_type *udev)
395{
396 usb_sts_type ret = USB_OK;
397 usb_setup_type *setup = &udev->setup;
398 switch(udev->conn_state)
399 {
400 case USB_CONN_STATE_CONFIGURED:
401 udev->class_handler->setup_handler(udev, &udev->setup);
402 if(setup->wLength == 0)
403 {
404 usbd_ctrl_send_status(udev);
405 }
406 break;
407 default:
408 usbd_ctrl_unsupport(udev);
409 break;
410 }
411 return ret;
412}
413
419 usb_sts_type usbd_endpoint_request(usbd_core_type *udev)
420{
421 usb_sts_type ret = USB_OK;
422 usb_setup_type *setup = &udev->setup;
423 uint8_t ept_addr = LBYTE(setup->wIndex);
424 usb_ept_info *ept_info;
425
426 if((setup->bmRequestType & USB_REQ_TYPE_RESERVED) == USB_REQ_TYPE_CLASS)
427 {
428 udev->class_handler->setup_handler(udev, &udev->setup);
429 }
430 switch(setup->bRequest)
431 {
432 case USB_STD_REQ_GET_STATUS:
433 switch(udev->conn_state)
434 {
435 case USB_CONN_STATE_ADDRESSED:
436 if((ept_addr & 0x7F) != 0)
437 {
438 usbd_set_stall(udev, ept_addr);
439 }
440 break;
441 case USB_CONN_STATE_CONFIGURED:
442 {
443 if((ept_addr & 0x80) != 0)
444 {
445 ept_info = &udev->ept_in[ept_addr & 0x7F];
446 }
447 else
448 {
449 ept_info = &udev->ept_out[ept_addr & 0x7F];
450 }
451 if(ept_info->stall == 1)
452 {
453 ept_info->status = 0x0001;
454 }
455 else
456 {
457 ept_info->status = 0x0000;
458 }
459 usbd_ctrl_send(udev, (uint8_t *)(&ept_info->status), 2);
460 }
461 break;
462 default:
463 usbd_ctrl_unsupport(udev);
464 break;
465 }
466 break;
467 case USB_STD_REQ_CLEAR_FEATURE:
468 switch(udev->conn_state)
469 {
470 case USB_CONN_STATE_ADDRESSED:
471 if((ept_addr != 0x00) && (ept_addr != 0x80))
472 {
473 usbd_set_stall(udev, ept_addr);
474 }
475 break;
476 case USB_CONN_STATE_CONFIGURED:
477 if(setup->wValue == USB_FEATURE_EPT_HALT)
478 {
479 if((ept_addr & 0x7F) != 0x00 )
480 {
481 usbd_clear_stall(udev, ept_addr);
482 udev->class_handler->setup_handler(udev, &udev->setup);
483 }
484 usbd_ctrl_send_status(udev);
485 }
486 break;
487 default:
488 usbd_ctrl_unsupport(udev);
489 break;
490 }
491 break;
492 case USB_STD_REQ_SET_FEATURE:
493 switch(udev->conn_state)
494 {
495 case USB_CONN_STATE_ADDRESSED:
496 if((ept_addr != 0x00) && (ept_addr != 0x80))
497 {
498 usbd_set_stall(udev, ept_addr);
499 }
500 break;
501 case USB_CONN_STATE_CONFIGURED:
502 if(setup->wValue == USB_FEATURE_EPT_HALT)
503 {
504 if((ept_addr != 0x00) && (ept_addr != 0x80))
505 {
506 usbd_set_stall(udev, ept_addr);
507 }
508 }
509 udev->class_handler->setup_handler(udev, &udev->setup);
510 usbd_ctrl_send_status(udev);
511 break;
512 default:
513 usbd_ctrl_unsupport(udev);
514 break;
515 }
516 break;
517 default:
518 usbd_ctrl_unsupport(udev);
519 break;
520 }
521 return ret;
522}
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
USB_STD_REQ_CLEAR_FEATURE
#define USB_STD_REQ_CLEAR_FEATURE
Definition: usb_std.h:78
USB_DESCIPTOR_TYPE_OTHER_SPEED
#define USB_DESCIPTOR_TYPE_OTHER_SPEED
Definition: usb_std.h:98
USB_INTERFACE_STRING
#define USB_INTERFACE_STRING
Definition: usb_std.h:109
USB_STD_REQ_SET_CONFIGURATION
#define USB_STD_REQ_SET_CONFIGURATION
Definition: usb_std.h:84
USB_FEATURE_REMOTE_WAKEUP
#define USB_FEATURE_REMOTE_WAKEUP
Definition: usb_std.h:121
USB_PRODUCT_STRING
#define USB_PRODUCT_STRING
Definition: usb_std.h:106
MIN
#define MIN(a, b)
min and max define
Definition: usb_std.h:204
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
USB_DESCIPTOR_TYPE_CONFIGURATION
#define USB_DESCIPTOR_TYPE_CONFIGURATION
Definition: usb_std.h:93
USB_STD_REQ_GET_DESCRIPTOR
#define USB_STD_REQ_GET_DESCRIPTOR
Definition: usb_std.h:81
USB_STD_REQ_SET_ADDRESS
#define USB_STD_REQ_SET_ADDRESS
Definition: usb_std.h:80
LBYTE
#define LBYTE(x)
low byte and high byte define
Definition: usb_std.h:210
USB_STD_REQ_SET_FEATURE
#define USB_STD_REQ_SET_FEATURE
Definition: usb_std.h:79
USB_CONF_REMOTE_WAKEUP
#define USB_CONF_REMOTE_WAKEUP
usb configuration attributes
Definition: usb_std.h:114
SWAPBYTE
#define SWAPBYTE(addr)
usb swap address
Definition: usb_std.h:197
USB_MFC_STRING
#define USB_MFC_STRING
Definition: usb_std.h:105
USB_STD_REQ_GET_STATUS
#define USB_STD_REQ_GET_STATUS
usb standard device requests codes
Definition: usb_std.h:77
USB_SERIAL_STRING
#define USB_SERIAL_STRING
Definition: usb_std.h:107
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92
USB_FEATURE_EPT_HALT
#define USB_FEATURE_EPT_HALT
usb standard feature selectors
Definition: usb_std.h:120
USB_STD_REQ_GET_CONFIGURATION
#define USB_STD_REQ_GET_CONFIGURATION
Definition: usb_std.h:83
USB_DESCIPTOR_TYPE_STRING
#define USB_DESCIPTOR_TYPE_STRING
Definition: usb_std.h:94
USB_REQ_TYPE_RESERVED
#define USB_REQ_TYPE_RESERVED
Definition: usb_std.h:66
USB_LANGID_STRING
#define USB_LANGID_STRING
usb standard string type
Definition: usb_std.h:104
USB_DESCIPTOR_TYPE_DEVICE_QUALIFIER
#define USB_DESCIPTOR_TYPE_DEVICE_QUALIFIER
Definition: usb_std.h:97
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_CONFIG_STRING
#define USB_CONFIG_STRING
Definition: usb_std.h:108
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usb_std.h:64
USB_CONN_STATE_DEFAULT
@ USB_CONN_STATE_DEFAULT
Definition: usb_std.h:129
USB_CONN_STATE_CONFIGURED
@ USB_CONN_STATE_CONFIGURED
Definition: usb_std.h:131
USB_CONN_STATE_ADDRESSED
@ USB_CONN_STATE_ADDRESSED
Definition: usb_std.h:130
USB_OK
@ USB_OK
Definition: usb_std.h:218
usbd_set_stall
void usbd_set_stall(usbd_core_type *udev, uint8_t ept_addr)
usb set endpoint to stall status
Definition: usbd_core.c:257
usbd_ctrl_send_status
void usbd_ctrl_send_status(usbd_core_type *udev)
usb control endpoint send in status
Definition: usbd_core.c:207
usbd_ctrl_send
void usbd_ctrl_send(usbd_core_type *udev, uint8_t *buffer, uint16_t len)
usb control endpoint send data
Definition: usbd_core.c:174
usbd_clear_stall
void usbd_clear_stall(usbd_core_type *udev, uint8_t ept_addr)
clear endpoint stall
Definition: usbd_core.c:232
usbd_ctrl_unsupport
void usbd_ctrl_unsupport(usbd_core_type *udev)
un-support device request
Definition: usbd_core.c:282
usbd_set_feature
static usb_sts_type usbd_set_feature(usbd_core_type *udev)
set usb feature request
Definition: usbd_sdr.c:238
usbd_endpoint_request
usb_sts_type usbd_endpoint_request(usbd_core_type *udev)
standard usb endpoint requests
Definition: usbd_sdr.c:419
usbd_get_status
static usb_sts_type usbd_get_status(usbd_core_type *udev)
get usb status request
Definition: usbd_sdr.c:185
usbd_get_configuration
static usb_sts_type usbd_get_configuration(usbd_core_type *udev)
get usb configuration request
Definition: usbd_sdr.c:256
usbd_get_descriptor
static usb_sts_type usbd_get_descriptor(usbd_core_type *udev)
get usb standard device description request
Definition: usbd_sdr.c:69
usbd_setup_request_parse
void usbd_setup_request_parse(usb_setup_type *setup, uint8_t *buf)
usb parse standard setup request
Definition: usbd_sdr.c:55
usbd_device_request
usb_sts_type usbd_device_request(usbd_core_type *udev)
standard usb device requests
Definition: usbd_sdr.c:350
usbd_set_address
static usb_sts_type usbd_set_address(usbd_core_type *udev)
this request sets the device address
Definition: usbd_sdr.c:139
usbd_interface_request
usb_sts_type usbd_interface_request(usbd_core_type *udev)
standard usb interface requests
Definition: usbd_sdr.c:394
usbd_set_configuration
static usb_sts_type usbd_set_configuration(usbd_core_type *udev)
sets the usb device configuration request
Definition: usbd_sdr.c:288
usbd_clear_feature
static usb_sts_type usbd_clear_feature(usbd_core_type *udev)
clear usb feature request
Definition: usbd_sdr.c:210
usb_ept_info
usb endpoint infomation structure definition
Definition: at32f415_usb.h:421
usb_ept_info::stall
uint8_t stall
Definition: at32f415_usb.h:431
usb_ept_info::status
uint32_t status
Definition: at32f415_usb.h:432
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_setup_type::wValue
uint16_t wValue
Definition: usb_std.h:233
usb_setup_type::wLength
uint16_t wLength
Definition: usb_std.h:236
usb_setup_type::bmRequestType
uint8_t bmRequestType
Definition: usb_std.h:231
usb_setup_type::wIndex
uint16_t wIndex
Definition: usb_std.h:234
usb_setup_type::bRequest
uint8_t bRequest
Definition: usb_std.h:232
usbd_sdr.h


AT32F415 Firmwary Library: usbd_sdr.h Source File

  • middlewares
  • usb_drivers
  • inc
usbd_sdr.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_SDR_H
29#define __USB_SDR_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* includes ------------------------------------------------------------------*/
37#include "usb_conf.h"
38#include "usb_core.h"
52void usbd_setup_request_parse(usb_setup_type *setup, uint8_t *buf);
53 usb_sts_type usbd_device_request(usbd_core_type *udev);
54 usb_sts_type usbd_interface_request(usbd_core_type *udev);
55 usb_sts_type usbd_endpoint_request(usbd_core_type *udev);
56
57
69#ifdef __cplusplus
70}
71#endif
72
73#endif
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
usbd_endpoint_request
usb_sts_type usbd_endpoint_request(usbd_core_type *udev)
standard usb endpoint requests
Definition: usbd_sdr.c:419
usbd_setup_request_parse
void usbd_setup_request_parse(usb_setup_type *setup, uint8_t *buf)
usb parse standard setup request
Definition: usbd_sdr.c:55
usbd_device_request
usb_sts_type usbd_device_request(usbd_core_type *udev)
standard usb device requests
Definition: usbd_sdr.c:350
usbd_interface_request
usb_sts_type usbd_interface_request(usbd_core_type *udev)
standard usb interface requests
Definition: usbd_sdr.c:394
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_core.h
usb core header file


AT32F415 Firmwary Library: usbh_core.c Source File

  • middlewares
  • usb_drivers
  • src
usbh_core.c
Go to the documentation of this file.
1
26#include "usbh_core.h"
27#include "usb_core.h"
28#include "usbh_ctrl.h"
29#include "usb_conf.h"
30
44static void usbh_attached(usbh_core_type *uhost);
45static void usbh_enumeration(usbh_core_type *uhost);
46static void usbh_class_request(usbh_core_type *uhost);
47static void usbh_class(usbh_core_type *uhost);
48static void usbh_suspend(usbh_core_type *uhost);
49static void usbh_wakeup(usbh_core_type *uhost);
50static void usbh_disconnect(usbh_core_type *uhost);
57void usbh_free_channel(usbh_core_type *uhost, uint8_t index)
58{
59 if(index < USB_HOST_CHANNEL_NUM)
60 {
61 /* free host channel */
62 uhost->channel[index] = 0x0;
63 }
64}
65
71uint16_t usbh_get_free_channel(usbh_core_type *uhost)
72{
73 uint16_t i_index = 0;
74 for(i_index = 0; i_index < USB_HOST_CHANNEL_NUM; i_index ++)
75 {
76 /* find unuse channel */
77 if((uhost->channel[i_index] & HCH_USED) == 0)
78 {
79 /* return channel index */
80 return i_index;
81 }
82 }
83 return HCH_ERROR;
84}
85
86
94 usb_sts_type usbh_set_toggle(usbh_core_type *uhost, uint8_t hc_num, uint8_t toggle)
95{
96 if(uhost->hch[hc_num].dir)
97 {
98 /* direction in */
99 uhost->hch[hc_num].toggle_in = toggle;
100 }
101 else
102 {
103 /* direction out */
104 uhost->hch[hc_num].toggle_out = toggle;
105 }
106 return USB_OK;
107}
108
115 usb_sts_type usbh_in_out_request(usbh_core_type *uhost, uint8_t hc_num)
116{
117 usb_sts_type status = USB_OK;
118 uint32_t n_packet = 0;
119 uint32_t num_words = 0;
120 uint32_t tmp;
121 otg_global_type *usbx = uhost->usb_reg;
122 otg_hchannel_type *ch = USB_CHL(uhost->usb_reg, hc_num);
123
124 /* set usb request block to idle */
125 uhost->urb_state[hc_num] = URB_IDLE;
126
127 /* set usb channel transmit count to zero */
128 uhost->hch[hc_num].trans_count = 0;
129
130 /* check transmit data len */
131 if(uhost->hch[hc_num].trans_len > 0)
132 {
133 /* count how many packet need to send */
134 n_packet = (uhost->hch[hc_num].trans_len + \
135 uhost->hch[hc_num].maxpacket - 1) / \
136 uhost->hch[hc_num].maxpacket;
137
138 /* packet count max 256 */
139 if(n_packet > 256)
140 {
141 n_packet = 256;
142 uhost->hch[hc_num].trans_len = n_packet * uhost->hch[hc_num].maxpacket;
143 }
144 }
145 else
146 {
147 /* zero data len */
148 n_packet = 1;
149 }
150
151 /* direction is in */
152 if(uhost->hch[hc_num].dir)
153 {
154 uhost->hch[hc_num].trans_len = n_packet * uhost->hch[hc_num].maxpacket;
155 }
156
157 /* set transfer information to channel register */
158 ch->hctsiz = (uhost->hch[hc_num].trans_len & USB_OTG_HCTSIZ_XFERSIZE) |
159 ((n_packet << 19) & USB_OTG_HCTSIZ_PKTCNT) |
160 ((uhost->hch[hc_num].data_pid << 29) & USB_OTG_HCTSIZ_PID);
161
162 /* set odd frame */
163 ch->hcchar_bit.oddfrm = !(OTG_HOST(uhost->usb_reg)->hfnum & 0x1);
164
165 /* clear channel disable bit and enable channel */
166 tmp = ch->hcchar;
167 tmp &= ~(USB_OTG_HCCHAR_CHDIS);
168 tmp |= USB_OTG_HCCHAR_CHENA;
169 ch->hcchar = tmp;
170
171 /* channel direction is out and transfer len > 0 */
172 if((uhost->hch[hc_num].dir == 0) &&
173 (uhost->hch[hc_num].trans_len > 0 ))
174 {
175 switch(uhost->hch[hc_num].ept_type)
176 {
177 case EPT_CONTROL_TYPE:
178 case EPT_BULK_TYPE:
179 num_words = (uhost->hch[hc_num].trans_len + 3) / 4;
180
181 /* non-periodic transfer */
182 if(num_words > usbx->gnptxsts_bit.nptxfspcavail)
183 {
184 usbx->gintmsk_bit.nptxfempmsk = 1;
185 }
186 break;
187 case EPT_ISO_TYPE:
188 case EPT_INT_TYPE:
189 num_words = (uhost->hch[hc_num].trans_len + 3) / 4;
190
191 /* periodic transfer */
192 if(num_words > OTG_HOST(usbx)->hptxsts_bit.ptxfspcavil)
193 {
194 usbx->gintmsk_bit.nptxfempmsk = 1;
195 }
196 break;
197 default:
198 break;
199 }
200 /* write data to fifo */
201 usb_write_packet(usbx, uhost->hch[hc_num].trans_buf,
202 hc_num, uhost->hch[hc_num].trans_len);
203 }
204
205 return status;
206}
207
216 usb_sts_type usbh_interrupt_recv(usbh_core_type *uhost, uint8_t hc_num,
217 uint8_t *buffer, uint16_t length)
218{
219 /* set direction is in */
220 uhost->hch[hc_num].dir = 1;
221
222 /* set transfer buffer */
223 uhost->hch[hc_num].trans_buf = buffer;
224
225 /* set transfer len*/
226 uhost->hch[hc_num].trans_len = length;
227
228 if(uhost->hch[hc_num].toggle_in == 0)
229 {
230 /* pid: data0 */
231 uhost->hch[hc_num].data_pid = HCH_PID_DATA0;
232 }
233 else
234 {
235 /* pid: data1 */
236 uhost->hch[hc_num].data_pid = HCH_PID_DATA1;
237 }
238
239 return usbh_in_out_request(uhost, hc_num);
240}
241
250 usb_sts_type usbh_interrupt_send(usbh_core_type *uhost, uint8_t hc_num,
251 uint8_t *buffer, uint16_t length)
252{
253 /* set direction is out */
254 uhost->hch[hc_num].dir = 0;
255
256 /* set transfer buffer */
257 uhost->hch[hc_num].trans_buf = buffer;
258
259 /* set transfer len*/
260 uhost->hch[hc_num].trans_len = length;
261
262 if(uhost->hch[hc_num].toggle_out == 0)
263 {
264 /* pid: data0 */
265 uhost->hch[hc_num].data_pid = HCH_PID_DATA0;
266 }
267 else
268 {
269 /* pid: data1 */
270 uhost->hch[hc_num].data_pid = HCH_PID_DATA1;
271 }
272
273 return usbh_in_out_request(uhost, hc_num);
274}
275
276
285 usb_sts_type usbh_bulk_recv(usbh_core_type *uhost, uint8_t hc_num,
286 uint8_t *buffer, uint16_t length)
287{
288 /* set direction is in */
289 uhost->hch[hc_num].dir = 1;
290
291 /* set transfer buffer */
292 uhost->hch[hc_num].trans_buf = buffer;
293
294 /* set transfer len*/
295 uhost->hch[hc_num].trans_len = length;
296
297 if(uhost->hch[hc_num].toggle_in == 0)
298 {
299 /* pid: data0 */
300 uhost->hch[hc_num].data_pid = HCH_PID_DATA0;
301 }
302 else
303 {
304 /* pid: data1 */
305 uhost->hch[hc_num].data_pid = HCH_PID_DATA1;
306 }
307
308 return usbh_in_out_request(uhost, hc_num);
309}
310
311
320 usb_sts_type usbh_bulk_send(usbh_core_type *uhost, uint8_t hc_num,
321 uint8_t *buffer, uint16_t length)
322{
323 /* set direction is out */
324 uhost->hch[hc_num].dir = 0;
325
326 /* set transfer buffer */
327 uhost->hch[hc_num].trans_buf = buffer;
328
329 /* set transfer len*/
330 uhost->hch[hc_num].trans_len = length;
331
332 if(uhost->hch[hc_num].toggle_out == 0)
333 {
334 /* pid: data0 */
335 uhost->hch[hc_num].data_pid = HCH_PID_DATA0;
336 }
337 else
338 {
339 /* pid: data1 */
340 uhost->hch[hc_num].data_pid = HCH_PID_DATA1;
341 }
342
343 return usbh_in_out_request(uhost, hc_num);
344}
345
346
355 usb_sts_type usbh_isoc_send(usbh_core_type *uhost, uint8_t hc_num,
356 uint8_t *buffer, uint16_t length)
357{
358 /* set direction is out */
359 uhost->hch[hc_num].dir = 0;
360
361 /* set transfer buffer */
362 uhost->hch[hc_num].trans_buf = buffer;
363
364 /* set transfer len*/
365 uhost->hch[hc_num].trans_len = length;
366
367 /* pid: data0 */
368 uhost->hch[hc_num].data_pid = HCH_PID_DATA0;
369
370 return usbh_in_out_request(uhost, hc_num);
371}
372
381 usb_sts_type usbh_isoc_recv(usbh_core_type *uhost, uint8_t hc_num,
382 uint8_t *buffer, uint16_t length)
383{
384 /* set direction is in */
385 uhost->hch[hc_num].dir = 1;
386
387 /* set transfer buffer */
388 uhost->hch[hc_num].trans_buf = buffer;
389
390 /* set transfer len*/
391 uhost->hch[hc_num].trans_len = length;
392
393 /* pid: data0 */
394 uhost->hch[hc_num].data_pid = HCH_PID_DATA0;
395
396 return usbh_in_out_request(uhost, hc_num);
397}
398
404 usb_sts_type usbh_cfg_default_init(usbh_core_type *uhost)
405{
406 /* set global state to idle */
407 uhost->global_state = USBH_IDLE;
408
409 /* enumeration state to get description */
410 uhost->enum_state = ENUM_GET_MIN_DESC;
411
412 /* request state send */
413 uhost->req_state = CMD_SEND;
414
415 /* control transfer state is idle*/
416 uhost->ctrl.state = CONTROL_IDLE;
417
418 /* defaut endpoint 0 max size is 8byte */
419 uhost->ctrl.ept0_size = 8;
420
421 /* default device address is 0 */
422 uhost->dev.address = 0;
423
424 /* default speed is full speed */
425 uhost->dev.speed = USB_FULL_SPEED_CORE_ID;
426
427 /* free all channel */
428 usbh_free_channel(uhost, uhost->ctrl.hch_in);
429 usbh_free_channel(uhost, uhost->ctrl.hch_out);
430 return USB_OK;
431}
432
438void usbh_enter_suspend(usbh_core_type *uhost)
439{
440 otg_host_type *host = OTG_HOST(uhost->usb_reg);
441 uint32_t hprt_val = host->hprt;
442
443 hprt_val &= ~(USB_OTG_HPRT_PRTENA | USB_OTG_HPRT_PRTENCHNG |
444 USB_OTG_HPRT_PRTOVRCACT | USB_OTG_HPRT_PRTCONDET);
445
446 /* set port suspend */
447 host->hprt = hprt_val | USB_OTG_HPRT_PRTSUSP;
448
449 /* stop phy clock */
450 usb_stop_phy_clk(uhost->usb_reg);
451
452}
453
459void usbh_resume(usbh_core_type *uhost)
460{
461 otg_host_type *host = OTG_HOST(uhost->usb_reg);
462 uint32_t temp = host->hprt;
463
464 /* open phy clock */
465 usb_open_phy_clk(uhost->usb_reg);
466
467 /* clear port suspend and set port resume*/
468 temp &= ~(USB_OTG_HPRT_PRTENA | USB_OTG_HPRT_PRTENCHNG |
469 USB_OTG_HPRT_PRTOVRCACT | USB_OTG_HPRT_PRTCONDET
470 | USB_OTG_HPRT_PRTSUSP);
471 host->hprt = temp | USB_OTG_HPRT_PRTRES;
472
473 /* delay 20 ms */
474 usb_delay_ms(20);
475
476 /*clear port resume */
477 temp = host->hprt;
478 temp &= ~(USB_OTG_HPRT_PRTENA | USB_OTG_HPRT_PRTENCHNG |
479 USB_OTG_HPRT_PRTOVRCACT | USB_OTG_HPRT_PRTCONDET
480 | USB_OTG_HPRT_PRTRES);
481 host->hprt = temp;
482 usb_delay_ms(5);
483}
484
496 usb_sts_type usbh_core_init(usbh_core_type *uhost,
497 usb_reg_type *usb_reg,
498 usbh_class_handler_type *class_handler,
499 usbh_user_handler_type *user_handler,
500 uint8_t core_id)
501{
502 usb_sts_type status = USB_OK;
503 uint32_t i_index;
504 otg_global_type *usbx = usb_reg;
505 otg_host_type *host = OTG_HOST(usbx);
506 uhost->usb_reg = usb_reg;
507
508 /* host class handler */
509 uhost->class_handler = class_handler;
510 uhost->user_handler = user_handler;
511
512 /* host user handler */
513 uhost->user_handler->user_init();
514
515 uhost->timer = 0;
516
517 /* usb host cfg default init */
518 usbh_cfg_default_init(uhost);
519
520 /* clear host config to default value */
521 for(i_index = 0; i_index < USB_HOST_CHANNEL_NUM; i_index ++)
522 {
523 uhost->err_cnt[i_index] = 0;
524 uhost->xfer_cnt[i_index] = 0;
525 uhost->hch_state[i_index] = HCH_IDLE;
526 uhost->hch[0].maxpacket = 8;
527 }
528
529 /* no device connect */
530 uhost->conn_sts = 0;
531
532 /* disable usb interrupt */
533 usb_interrupt_disable(usbx);
534
535 /* usb global init */
536 usb_global_init(usbx);
537
538 /* set usb host mode */
539 usb_global_set_mode(usbx, OTG_HOST_MODE);
540
541 /* open usb phy clock*/
542 usb_open_phy_clk(usbx);
543
544 /* clock select */
545 usbh_fsls_clksel(usbx, USB_HCFG_CLK_48M);
546
547 /* set support ls and fs device */
548 host->hcfg_bit.fslssupp = 0;
549
550 /* set receive fifo size */
551 usbx->grxfsiz = USBH_RX_FIFO_SIZE;
552
553 if(usbx == OTG1_GLOBAL)
554 {
555 /* set non-periodic transmit fifo start address and depth */
556 usbx->gnptxfsiz_ept0tx_bit.nptxfstaddr = USBH_RX_FIFO_SIZE;
557 usbx->gnptxfsiz_ept0tx_bit.nptxfdep = USBH_NP_TX_FIFO_SIZE;
558
559 /* set periodic transmit fifo start address and depth */
560 usbx->hptxfsiz_bit.ptxfstaddr = USBH_RX_FIFO_SIZE + USBH_NP_TX_FIFO_SIZE;
561 usbx->hptxfsiz_bit.ptxfsize = USBH_P_TX_FIFO_SIZE;
562 }
563#ifdef OTG2_GLOBAL
564 if(usbx == OTG2_GLOBAL)
565 {
566 /* set non-periodic transmit fifo start address and depth */
567 usbx->gnptxfsiz_ept0tx_bit.nptxfstaddr = USBH2_RX_FIFO_SIZE;
568 usbx->gnptxfsiz_ept0tx_bit.nptxfdep = USBH2_NP_TX_FIFO_SIZE;
569
570 /* set periodic transmit fifo start address and depth */
571 usbx->hptxfsiz_bit.ptxfstaddr = USBH2_RX_FIFO_SIZE + USBH2_NP_TX_FIFO_SIZE;
572 usbx->hptxfsiz_bit.ptxfsize = USBH2_P_TX_FIFO_SIZE;
573 }
574#endif
575 /* flush tx fifo */
576 usb_flush_tx_fifo(usbx, 16);
577
578 /* flush rx fifo */
579 usb_flush_rx_fifo(usbx);
580
581 /* clear host channel interrut mask and status */
582 for(i_index = 0; i_index < USB_HOST_CHANNEL_NUM; i_index ++)
583 {
584 USB_CHL(usbx, i_index)->hcintmsk = 0;
585 USB_CHL(usbx, i_index)->hcint = 0xFFFFFFFF;
586 }
587
588 /* power on to this port */
589 usb_port_power_on(usbx, TRUE);
590
591 /* clear global interrupt mask and status */
592 usbx->gintmsk = 0;
593 usbx->gintsts = 0xBFFFFFFF;
594
595 /* set global interrut mask */
596 usbx->gintmsk = USB_OTG_SOF_INT | USB_OTG_RXFLVL_INT |
597 USB_OTG_USBSUSP_INT | USB_OTG_PRT_INT |
598 USB_OTG_HCH_INT | USB_OTG_INCOMISOIN_INT |
599 USB_OTG_INCOMPIP_INCOMPISOOUT_INT | USB_OTG_WKUP_INT |
600 USB_OTG_DISCON_INT;
601
602 /* enable usb global interrupt */
603 usb_interrupt_enable(usbx);
604
605 /* active vbus */
606 usbh_active_vbus(uhost, TRUE);
607 return status;
608}
609
630void usbh_hc_open(usbh_core_type *uhost,
631 uint8_t chn,
632 uint8_t ept_num,
633 uint8_t dev_address,
634 uint8_t type,
635 uint8_t maxpacket,
636 uint8_t speed)
637{
638 /* device address */
639 uhost->hch[chn].address = dev_address;
640
641 /* device speed */
642 uhost->hch[chn].speed = speed;
643
644 /* endpoint transfer type */
645 uhost->hch[chn].ept_type = type;
646
647 /* endpoint support maxpacket */
648 uhost->hch[chn].maxpacket = maxpacket;
649
650 /* endpoint direction in or out */
651 uhost->hch[chn].dir = (ept_num & 0x80)?1:0;;
652
653 /* host channel number */
654 uhost->hch[chn].ch_num = chn;
655
656 /* device endpoint number */
657 uhost->hch[chn].ept_num = ept_num;
658
659 /* enable channel */
660 usb_hc_enable(uhost->usb_reg, chn,
661 ept_num, dev_address,
662 type, maxpacket, speed
663 );
664}
665
675void usbh_ch_disable(usbh_core_type *uhost, uint8_t chn)
676{
677 usb_hch_halt(uhost->usb_reg, chn);
678}
679
686uint16_t usbh_alloc_channel(usbh_core_type *uhost, uint8_t ept_addr)
687{
688 /* get one free channel */
689 uint16_t ch_num = usbh_get_free_channel(uhost);
690
691 if(ch_num == HCH_ERROR)
692 return USB_FAIL;
693
694 /* set channel to used */
695 uhost->channel[ch_num] = HCH_USED | ept_addr;
696 return ch_num;
697}
698
705urb_sts_type usbh_get_urb_status(usbh_core_type *uhost, uint8_t ch_num)
706{
707 return uhost->urb_state[ch_num];
708}
716 usb_sts_type usbh_ctrl_result_check(usbh_core_type *uhost, ctrl_ept0_sts_type next_ctrl_state, uint8_t next_enum_state)
717{
718 usb_sts_type status;
719
720 /* control transfer loop */
721 status = usbh_ctrl_transfer_loop(uhost);
722
723 if(status == USB_OK)
724 {
725 uhost->ctrl.state = next_ctrl_state;
726 uhost->enum_state = next_enum_state;
727 uhost->req_state = CMD_SEND;
728 }
729 else if(status == USB_ERROR)
730 {
731 uhost->ctrl.state = CONTROL_IDLE;
732 uhost->req_state = CMD_SEND;
733 }
734 else if(status == USB_NOT_SUPPORT)
735 {
736 uhost->ctrl.state = next_ctrl_state;
737 uhost->enum_state = next_enum_state;
738 uhost->req_state = CMD_SEND;
739 }
740 return status;
741}
742
748uint8_t usbh_alloc_address(void)
749{
750 static uint8_t address = 0;
751 if(address == 127)
752 address = 0;
753 return address + 1;
754}
755
756
762 usb_sts_type usbh_enum_handler(usbh_core_type *uhost)
763{
764 usb_sts_type status = USB_WAIT;
765 switch(uhost->enum_state)
766 {
767 case ENUM_IDLE:
768 break;
769 case ENUM_GET_MIN_DESC:
770 /* get description */
771 if(uhost->ctrl.state == CONTROL_IDLE)
772 {
773 usbh_get_device_descriptor(uhost, 8);
774 }
775 if(usbh_ctrl_result_check(uhost, CONTROL_IDLE, ENUM_GET_FULL_DESC) == USB_OK)
776 {
777 usbh_parse_dev_desc(uhost, uhost->rx_buffer, 8);
778
779 /* set new control endpoint maxpacket size */
780 uhost->ctrl.ept0_size = (uhost->dev).dev_desc.bMaxPacketSize0;
781
782 /* enable channel */
783 usbh_hc_open(uhost, uhost->ctrl.hch_in,0x80,
784 uhost->dev.address, EPT_CONTROL_TYPE,
785 uhost->ctrl.ept0_size,
786 uhost->dev.speed);
787
788 /* enable channel */
789 usbh_hc_open(uhost, uhost->ctrl.hch_out,0x00,
790 uhost->dev.address, EPT_CONTROL_TYPE,
791 uhost->ctrl.ept0_size,
792 uhost->dev.speed);
793 }
794 break;
795
796 case ENUM_GET_FULL_DESC:
797 /* get description */
798 if(uhost->ctrl.state == CONTROL_IDLE)
799 {
800 usbh_get_device_descriptor(uhost, 18);
801 }
802 if(usbh_ctrl_result_check(uhost, CONTROL_IDLE, ENUM_SET_ADDR) == USB_OK)
803 {
804 usbh_parse_dev_desc(uhost, uhost->rx_buffer, 18);
805 USBH_DEBUG("VID: %xh", uhost->dev.dev_desc.idVendor);
806 USBH_DEBUG("PID: %xh", uhost->dev.dev_desc.idProduct);
807 }
808 break;
809
810 case ENUM_SET_ADDR:
811 /* set device address */
812 if(uhost->ctrl.state == CONTROL_IDLE)
813 {
814 uhost->dev.address = usbh_alloc_address();
815 USBH_DEBUG("Set Address: %d", uhost->dev.address);
816 usbh_set_address(uhost, uhost->dev.address);
817 }
818 if (usbh_ctrl_result_check(uhost, CONTROL_IDLE, ENUM_GET_CFG) == USB_OK)
819 {
820 /* enable channel */
821 usbh_hc_open(uhost, uhost->ctrl.hch_in,0x80,
822 uhost->dev.address, EPT_CONTROL_TYPE,
823 uhost->ctrl.ept0_size,
824 uhost->dev.speed);
825
826 /* enable channel */
827 usbh_hc_open(uhost, uhost->ctrl.hch_out,0x00,
828 uhost->dev.address, EPT_CONTROL_TYPE,
829 uhost->ctrl.ept0_size,
830 uhost->dev.speed);
831 }
832 break;
833
834 case ENUM_GET_CFG:
835 /* get device confiuration */
836 if(uhost->ctrl.state == CONTROL_IDLE)
837 {
838 usbh_get_configure_descriptor(uhost, 9);
839 }
840
841 if(usbh_ctrl_result_check(uhost, CONTROL_IDLE, ENUM_GET_FULL_CFG) == USB_OK)
842 {
843 usbh_parse_configure_desc(uhost, uhost->rx_buffer, 9);
844 }
845 break;
846
847 case ENUM_GET_FULL_CFG:
848 /* get device confiuration */
849 if(uhost->ctrl.state == CONTROL_IDLE)
850 {
851 usbh_get_configure_descriptor(uhost, uhost->dev.cfg_desc.cfg.wTotalLength);
852 }
853
854 if(usbh_ctrl_result_check(uhost, CONTROL_IDLE, ENUM_GET_MFC_STRING) == USB_OK)
855 {
856 usbh_parse_configure_desc(uhost, uhost->rx_buffer, uhost->dev.cfg_desc.cfg.wTotalLength);
857 }
858 break;
859
860 case ENUM_GET_MFC_STRING:
861 /* get device mfc string */
862 if(uhost->ctrl.state == CONTROL_IDLE)
863 {
864 usbh_get_sting_descriptor(uhost, uhost->dev.dev_desc.iManufacturer,
865 uhost->rx_buffer, 0xFF);
866 }
867
868 if(usbh_ctrl_result_check(uhost, CONTROL_IDLE, ENUM_GET_PRODUCT_STRING) == USB_OK)
869 {
870 usbh_parse_string_desc(uhost->rx_buffer, uhost->rx_buffer, 0xFF);
871 uhost->user_handler->user_mfc_string(uhost->rx_buffer);
872 }
873 break;
874
875 case ENUM_GET_PRODUCT_STRING:
876 /* get device product string */
877 if(uhost->ctrl.state == CONTROL_IDLE)
878 {
879 usbh_get_sting_descriptor(uhost, uhost->dev.dev_desc.iProduct,
880 uhost->rx_buffer, 0xFF);
881 }
882
883 if(usbh_ctrl_result_check(uhost, CONTROL_IDLE, ENUM_GET_SERIALNUM_STRING) == USB_OK)
884 {
885 usbh_parse_string_desc(uhost->rx_buffer, uhost->rx_buffer, 0xFF);
886 uhost->user_handler->user_product_string(uhost->rx_buffer);
887 }
888 break;
889
890 case ENUM_GET_SERIALNUM_STRING:
891 /* get device serial string */
892 if(uhost->ctrl.state == CONTROL_IDLE)
893 {
894 usbh_get_sting_descriptor(uhost, uhost->dev.dev_desc.iSerialNumber,
895 uhost->rx_buffer, 0xFF);
896 }
897
898 if(usbh_ctrl_result_check(uhost, CONTROL_IDLE, ENUM_SET_CONFIG) == USB_OK)
899 {
900 usbh_parse_string_desc(uhost->rx_buffer, uhost->rx_buffer, 0xFF);
901 uhost->user_handler->user_serial_string(uhost->rx_buffer);
902 }
903 break;
904
905 case ENUM_SET_CONFIG:
906 /* set device config */
907 if(uhost->ctrl.state == CONTROL_IDLE)
908 {
909 usbh_set_configuration(uhost, uhost->dev.cfg_desc.cfg.bConfigurationValue);
910 }
911 usbh_ctrl_result_check(uhost, CONTROL_IDLE, ENUM_COMPLETE);
912
913 break;
914
915 case ENUM_COMPLETE:
916 /* enum complete */
917 status = USB_OK;
918 break;
919 default:
920 break;
921 }
922 return status;
923}
924
931void usbh_active_vbus(usbh_core_type *uhost, confirm_state state)
932{
933 uhost->user_handler->user_active_vbus(uhost, state);
934}
935
941void usbh_reset_port(usbh_core_type *uhost)
942{
943 otg_host_type *usb_host = OTG_HOST(uhost->usb_reg);
944 uint32_t hprt_val = usb_host->hprt;
945
946 hprt_val &= ~(USB_OTG_HPRT_PRTENA | USB_OTG_HPRT_PRTENCHNG |
947 USB_OTG_HPRT_PRTOVRCACT | USB_OTG_HPRT_PRTCONDET);
948
949 /* set port reset */
950 usb_host->hprt = hprt_val | USB_OTG_HPRT_PRTRST;
951
952 usb_delay_ms(100);
953
954 /* clear port reset */
955 usb_host->hprt = hprt_val & (~USB_OTG_HPRT_PRTRST);
956
957 usb_delay_ms(20);
958
959}
960
966static void usbh_attached(usbh_core_type *uhost)
967{
968 /* get free channel */
969 uhost->ctrl.hch_in = usbh_alloc_channel(uhost, 0x80);
970 uhost->ctrl.hch_out = usbh_alloc_channel(uhost, 0x00);
971
972 /* user reset callback handler */
973 uhost->user_handler->user_reset();
974
975 /* get device speed */
976 uhost->dev.speed = OTG_HOST(uhost->usb_reg)->hprt_bit.prtspd;
977 uhost->global_state = USBH_ENUMERATION;
978 uhost->user_handler->user_speed(uhost->dev.speed);
979
980 /* enable channel */
981 usbh_hc_open(uhost, uhost->ctrl.hch_in,0x80,
982 uhost->dev.address, EPT_CONTROL_TYPE,
983 uhost->ctrl.ept0_size,
984 uhost->dev.speed);
985
986 /* enable channel */
987 usbh_hc_open(uhost, uhost->ctrl.hch_out,0x00,
988 uhost->dev.address, EPT_CONTROL_TYPE,
989 uhost->ctrl.ept0_size,
990 uhost->dev.speed);
991
992 usb_flush_tx_fifo(uhost->usb_reg, 0x10);
993 usb_flush_rx_fifo(uhost->usb_reg);
994
995 /* user attached callback */
996 uhost->user_handler->user_attached();
997}
998
999
1005static void usbh_enumeration(usbh_core_type *uhost)
1006{
1007 /* enumeration process */
1008 if(usbh_enum_handler(uhost) == USB_OK)
1009 {
1010 /* user enumeration done callback */
1011 uhost->user_handler->user_enumeration_done();
1012 uhost->global_state = USBH_USER_HANDLER;
1013 }
1014}
1015
1021static void usbh_class_request(usbh_core_type *uhost)
1022{
1023 usb_sts_type status;
1024
1025 /* class request callback */
1026 status = uhost->class_handler->request_handler((void *)uhost);
1027 if(status == USB_OK)
1028 {
1029 uhost->global_state = USBH_CLASS;
1030 }
1031 else if(status == USB_ERROR || status == USB_FAIL)
1032 {
1033 uhost->global_state = USBH_ERROR_STATE;
1034 }
1035 else if(status == USB_NOT_SUPPORT)
1036 {
1037 uhost->global_state = USBH_ERROR_STATE;
1038 }
1039}
1040
1046static void usbh_class(usbh_core_type *uhost)
1047{
1048 /* process handler */
1049 if(uhost->class_handler->process_handler((void *)uhost) == USB_OK)
1050 {
1051 }
1052}
1053
1059static void usbh_suspend(usbh_core_type *uhost)
1060{
1061 /* set device feature */
1062 if(uhost->ctrl.state == CONTROL_IDLE)
1063 {
1064 usbh_set_feature(uhost, 0x01, 0);
1065 }
1066 if(usbh_ctrl_result_check(uhost, CONTROL_IDLE, ENUM_IDLE) == USB_OK)
1067 {
1068 /* enter suspend mode */
1069 usb_delay_ms(3);
1070 usbh_enter_suspend(uhost);
1071 uhost->global_state = USBH_SUSPENDED;
1072
1073 }
1074}
1075
1081static void usbh_wakeup(usbh_core_type *uhost)
1082{
1083 /* clear device feature */
1084 if(uhost->ctrl.state == CONTROL_IDLE)
1085 {
1086 /* usb host resume */
1087 usbh_resume(uhost);
1088 usbh_clear_dev_feature(uhost, 0x01, 0);
1089 }
1090 if(usbh_ctrl_result_check(uhost, CONTROL_IDLE, ENUM_IDLE) == USB_OK)
1091 {
1092 uhost->global_state = USBH_CLASS_REQUEST;
1093 USBH_DEBUG("Remote Wakeup");
1094 }
1095}
1096
1102static void usbh_disconnect(usbh_core_type *uhost)
1103{
1104 uint8_t i_index = 0;
1105
1106 /* set host to default state */
1107 usbh_cfg_default_init(uhost);
1108
1109 /* free host channel */
1110 for(i_index = 0; i_index < USB_HOST_CHANNEL_NUM; i_index ++)
1111 {
1112 usbh_free_channel(uhost, i_index);
1113 }
1114
1115 /* call class reset handler */
1116 if(uhost->class_handler->reset_handler != NULL)
1117 {
1118 uhost->class_handler->reset_handler(uhost);
1119 }
1120
1121 /* set global state to idle */
1122 uhost->global_state = USBH_IDLE;
1123
1124 /*call user disconnect function */
1125 uhost->user_handler->user_disconnect();
1126}
1127
1128
1134 usb_sts_type usbh_loop_handler(usbh_core_type *uhost)
1135{
1136 usb_sts_type status = USB_FAIL;
1137
1138 if(uhost->conn_sts == 0 &&
1139 uhost->global_state != USBH_IDLE &&
1140 uhost->global_state != USBH_DISCONNECT)
1141 {
1142 uhost->global_state = USBH_IDLE;
1143 }
1144 switch(uhost->global_state)
1145 {
1146 case USBH_IDLE:
1147 if(uhost->conn_sts == 1)
1148 {
1149 uhost->global_state = USBH_PORT_EN;
1150
1151 /* wait stable */
1152 usb_delay_ms(200);
1153
1154 /* port reset */
1155 usbh_reset_port(uhost);
1156
1157 /* user reset */
1158 uhost->user_handler->user_reset();
1159 }
1160 break;
1161
1162 case USBH_PORT_EN:
1163 if(uhost->port_enable)
1164 {
1165 uhost->global_state = USBH_ATTACHED;
1166 }
1167 break;
1168
1169 case USBH_ATTACHED:
1170 usbh_attached(uhost);
1171 break;
1172
1173 case USBH_ENUMERATION:
1174 usbh_enumeration(uhost);
1175 break;
1176
1177 case USBH_USER_HANDLER:
1178 uhost->global_state = USBH_CLASS_REQUEST;
1179 if( uhost->class_handler->init_handler(uhost) == USB_NOT_SUPPORT)
1180 {
1181 uhost->global_state = USBH_UNSUPPORT;
1182 }
1183 break;
1184
1185 case USBH_CLASS_REQUEST:
1186 usbh_class_request(uhost);
1187 break;
1188
1189 case USBH_CLASS:
1190 usbh_class(uhost);
1191 break;
1192
1193 case USBH_SUSPEND:
1194 usbh_suspend(uhost);
1195 break;
1196
1197 case USBH_SUSPENDED:
1198 break;
1199
1200 case USBH_WAKEUP:
1201 usbh_wakeup(uhost);
1202 break;
1203
1204 case USBH_DISCONNECT:
1205 usbh_disconnect(uhost);
1206 break;
1207
1208 case USBH_ERROR_STATE:
1209 usbh_cfg_default_init(uhost);
1210 uhost->class_handler->reset_handler(uhost);
1211 uhost->user_handler->user_reset();
1212 break;
1213 case USBH_UNSUPPORT:
1214 break;
1215 default:
1216 break;
1217 }
1218
1219 return status;
1220}
1221
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
USBH_P_TX_FIFO_SIZE
#define USBH_P_TX_FIFO_SIZE
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:120
USBH_NP_TX_FIFO_SIZE
#define USBH_NP_TX_FIFO_SIZE
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:119
USBH_RX_FIFO_SIZE
#define USBH_RX_FIFO_SIZE
usb device mode config
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:118
USBH_DEBUG
#define USBH_DEBUG(...)
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:152
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
class_handler
usbd_class_handler class_handler
Definition: cdc_class.c:75
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
EPT_ISO_TYPE
@ EPT_ISO_TYPE
Definition: at32f415_usb.h:347
EPT_INT_TYPE
@ EPT_INT_TYPE
Definition: at32f415_usb.h:349
EPT_CONTROL_TYPE
@ EPT_CONTROL_TYPE
Definition: at32f415_usb.h:346
EPT_BULK_TYPE
@ EPT_BULK_TYPE
Definition: at32f415_usb.h:348
OTG_HOST_MODE
@ OTG_HOST_MODE
Definition: at32f415_usb.h:337
OTG_HOST
#define OTG_HOST(usbx)
Definition: at32f415_usb.h:1343
usb_port_power_on
void usb_port_power_on(otg_global_type *usbx, confirm_state state)
usb port power on
Definition: at32f415_usb.c:837
USB_CHL
#define USB_CHL(usbx, n)
Definition: at32f415_usb.h:1344
usb_write_packet
void usb_write_packet(otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
write data from user memory to usb buffer
Definition: at32f415_usb.c:417
usb_global_set_mode
void usb_global_set_mode(otg_global_type *usbx, uint32_t mode)
set otg mode(device or host mode)
Definition: at32f415_usb.c:339
usb_flush_rx_fifo
void usb_flush_rx_fifo(otg_global_type *usbx)
flush rx fifo
Definition: at32f415_usb.c:145
usb_flush_tx_fifo
void usb_flush_tx_fifo(otg_global_type *usbx, uint32_t fifo_num)
flush tx fifo
Definition: at32f415_usb.c:119
usbh_fsls_clksel
void usbh_fsls_clksel(otg_global_type *usbx, uint8_t clk)
select full or low speed clock
Definition: at32f415_usb.c:1063
usb_interrupt_disable
void usb_interrupt_disable(otg_global_type *usbx)
usb global interrupt disable
Definition: at32f415_usb.c:275
usb_stop_phy_clk
void usb_stop_phy_clk(otg_global_type *usbx)
usb stop phy clock
Definition: at32f415_usb.c:391
usb_interrupt_enable
void usb_interrupt_enable(otg_global_type *usbx)
usb global interrupt enable
Definition: at32f415_usb.c:262
OTG1_GLOBAL
#define OTG1_GLOBAL
usb host and device register define
Definition: at32f415_usb.h:1339
usb_open_phy_clk
void usb_open_phy_clk(otg_global_type *usbx)
usb open phy clock
Definition: at32f415_usb.c:404
usb_hc_enable
void usb_hc_enable(otg_global_type *usbx, uint8_t chn, uint8_t ept_num, uint8_t dev_address, uint8_t type, uint8_t maxpacket, uint8_t speed)
enable one host channel
Definition: at32f415_usb.c:891
usb_hch_halt
void usb_hch_halt(otg_global_type *usbx, uint8_t chn)
halt channel
Definition: at32f415_usb.c:1007
usb_global_init
void usb_global_init(otg_global_type *usbx)
usb global initialization
Definition: at32f415_usb.c:83
USB_OTG_INCOMISOIN_INT
#define USB_OTG_INCOMISOIN_INT
Definition: at32f415_usb.h:67
USB_OTG_WKUP_INT
#define USB_OTG_WKUP_INT
Definition: at32f415_usb.h:74
USB_OTG_RXFLVL_INT
#define USB_OTG_RXFLVL_INT
Definition: at32f415_usb.h:55
USB_OTG_USBSUSP_INT
#define USB_OTG_USBSUSP_INT
Definition: at32f415_usb.h:60
USB_OTG_PRT_INT
#define USB_OTG_PRT_INT
Definition: at32f415_usb.h:69
USB_OTG_INCOMPIP_INCOMPISOOUT_INT
#define USB_OTG_INCOMPIP_INCOMPISOOUT_INT
Definition: at32f415_usb.h:68
USB_OTG_DISCON_INT
#define USB_OTG_DISCON_INT
Definition: at32f415_usb.h:73
USB_OTG_SOF_INT
#define USB_OTG_SOF_INT
Definition: at32f415_usb.h:54
USB_OTG_HCH_INT
#define USB_OTG_HCH_INT
Definition: at32f415_usb.h:70
USB_OTG_HCTSIZ_PID
#define USB_OTG_HCTSIZ_PID
Definition: at32f415_usb.h:209
USB_OTG_HCCHAR_CHENA
#define USB_OTG_HCCHAR_CHENA
Definition: at32f415_usb.h:202
USB_OTG_HCTSIZ_XFERSIZE
#define USB_OTG_HCTSIZ_XFERSIZE
usb host register hctsiz bit define
Definition: at32f415_usb.h:207
USB_OTG_HCCHAR_CHDIS
#define USB_OTG_HCCHAR_CHDIS
Definition: at32f415_usb.h:201
USB_OTG_HPRT_PRTENA
#define USB_OTG_HPRT_PRTENA
Definition: at32f415_usb.h:172
USB_OTG_HPRT_PRTRES
#define USB_OTG_HPRT_PRTRES
Definition: at32f415_usb.h:176
USB_HCFG_CLK_48M
#define USB_HCFG_CLK_48M
Definition: at32f415_usb.h:164
USB_OTG_HCTSIZ_PKTCNT
#define USB_OTG_HCTSIZ_PKTCNT
Definition: at32f415_usb.h:208
USB_OTG_HPRT_PRTSUSP
#define USB_OTG_HPRT_PRTSUSP
Definition: at32f415_usb.h:177
USB_OTG_HPRT_PRTOVRCACT
#define USB_OTG_HPRT_PRTOVRCACT
Definition: at32f415_usb.h:174
USB_OTG_HPRT_PRTENCHNG
#define USB_OTG_HPRT_PRTENCHNG
Definition: at32f415_usb.h:173
USB_OTG_HPRT_PRTCONDET
#define USB_OTG_HPRT_PRTCONDET
Definition: at32f415_usb.h:171
USB_OTG_HPRT_PRTRST
#define USB_OTG_HPRT_PRTRST
Definition: at32f415_usb.h:178
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_OK
@ USB_OK
Definition: usb_std.h:218
USB_WAIT
@ USB_WAIT
Definition: usb_std.h:220
USB_ERROR
@ USB_ERROR
Definition: usb_std.h:222
USB_NOT_SUPPORT
@ USB_NOT_SUPPORT
Definition: usb_std.h:221
USB_FAIL
@ USB_FAIL
Definition: usb_std.h:219
usbh_class_request
static void usbh_class_request(usbh_core_type *uhost)
usb host class request
Definition: usbh_core.c:1021
usbh_loop_handler
usb_sts_type usbh_loop_handler(usbh_core_type *uhost)
usb host enum loop handler
Definition: usbh_core.c:1134
usbh_core_init
usb_sts_type usbh_core_init(usbh_core_type *uhost, usb_reg_type *usb_reg, usbh_class_handler_type *class_handler, usbh_user_handler_type *user_handler, uint8_t core_id)
usb host core initialize
Definition: usbh_core.c:496
usbh_enumeration
static void usbh_enumeration(usbh_core_type *uhost)
usb host enumeration
Definition: usbh_core.c:1005
usbh_interrupt_recv
usb_sts_type usbh_interrupt_recv(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host interrupt receive request
Definition: usbh_core.c:216
usbh_get_free_channel
uint16_t usbh_get_free_channel(usbh_core_type *uhost)
get usb host free channel
Definition: usbh_core.c:71
usbh_free_channel
void usbh_free_channel(usbh_core_type *uhost, uint8_t index)
usb host free channel
Definition: usbh_core.c:57
usbh_set_toggle
usb_sts_type usbh_set_toggle(usbh_core_type *uhost, uint8_t hc_num, uint8_t toggle)
usb host set toggle
Definition: usbh_core.c:94
usbh_alloc_address
uint8_t usbh_alloc_address(void)
auto alloc address (1...127)
Definition: usbh_core.c:748
usbh_attached
static void usbh_attached(usbh_core_type *uhost)
usb host attached
Definition: usbh_core.c:966
usbh_bulk_recv
usb_sts_type usbh_bulk_recv(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host bulk receive request
Definition: usbh_core.c:285
usbh_resume
void usbh_resume(usbh_core_type *uhost)
usb host resume
Definition: usbh_core.c:459
usbh_ctrl_result_check
usb_sts_type usbh_ctrl_result_check(usbh_core_type *uhost, ctrl_ept0_sts_type next_ctrl_state, uint8_t next_enum_state)
usb wait control setup complete
Definition: usbh_core.c:716
usbh_active_vbus
void usbh_active_vbus(usbh_core_type *uhost, confirm_state state)
active vbus.
Definition: usbh_core.c:931
usbh_cfg_default_init
usb_sts_type usbh_cfg_default_init(usbh_core_type *uhost)
usb host cfg default init
Definition: usbh_core.c:404
usbh_interrupt_send
usb_sts_type usbh_interrupt_send(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host interrupt send request
Definition: usbh_core.c:250
usbh_hc_open
void usbh_hc_open(usbh_core_type *uhost, uint8_t chn, uint8_t ept_num, uint8_t dev_address, uint8_t type, uint8_t maxpacket, uint8_t speed)
usb host open channel
Definition: usbh_core.c:630
usbh_isoc_recv
usb_sts_type usbh_isoc_recv(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host iso receive request
Definition: usbh_core.c:381
usbh_wakeup
static void usbh_wakeup(usbh_core_type *uhost)
usb host wakeup
Definition: usbh_core.c:1081
usbh_alloc_channel
uint16_t usbh_alloc_channel(usbh_core_type *uhost, uint8_t ept_addr)
usb host alloc channel
Definition: usbh_core.c:686
usbh_ch_disable
void usbh_ch_disable(usbh_core_type *uhost, uint8_t chn)
disable host channel
Definition: usbh_core.c:675
usbh_enter_suspend
void usbh_enter_suspend(usbh_core_type *uhost)
usb host enter suspend
Definition: usbh_core.c:438
usbh_suspend
static void usbh_suspend(usbh_core_type *uhost)
usb host suspend
Definition: usbh_core.c:1059
usbh_disconnect
static void usbh_disconnect(usbh_core_type *uhost)
usb host disconnect
Definition: usbh_core.c:1102
usbh_bulk_send
usb_sts_type usbh_bulk_send(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host bulk send request
Definition: usbh_core.c:320
usbh_in_out_request
usb_sts_type usbh_in_out_request(usbh_core_type *uhost, uint8_t hc_num)
usb host in out request
Definition: usbh_core.c:115
usbh_get_urb_status
urb_sts_type usbh_get_urb_status(usbh_core_type *uhost, uint8_t ch_num)
usb host get urb status
Definition: usbh_core.c:705
usbh_reset_port
void usbh_reset_port(usbh_core_type *uhost)
reset usb port
Definition: usbh_core.c:941
usbh_class
static void usbh_class(usbh_core_type *uhost)
usb host class handler
Definition: usbh_core.c:1046
usbh_enum_handler
usb_sts_type usbh_enum_handler(usbh_core_type *uhost)
usb host enumeration handler
Definition: usbh_core.c:762
usbh_isoc_send
usb_sts_type usbh_isoc_send(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host iso send request
Definition: usbh_core.c:355
usbh_set_configuration
usb_sts_type usbh_set_configuration(usbh_core_type *uhost, uint16_t config)
usb host set configurtion
Definition: usbh_ctrl.c:776
usbh_ctrl_transfer_loop
usb_sts_type usbh_ctrl_transfer_loop(usbh_core_type *uhost)
usb host control transfer loop function
Definition: usbh_ctrl.c:401
usbh_clear_dev_feature
usb_sts_type usbh_clear_dev_feature(usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host clear device feature
Definition: usbh_ctrl.c:864
usbh_get_device_descriptor
usb_sts_type usbh_get_device_descriptor(usbh_core_type *uhost, uint16_t length)
usb host get device descriptor
Definition: usbh_ctrl.c:711
usbh_parse_string_desc
void usbh_parse_string_desc(uint8_t *src, uint8_t *dest, uint16_t length)
usbh parse string descriptor
Definition: usbh_ctrl.c:687
usbh_parse_dev_desc
void usbh_parse_dev_desc(usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse device descriptor
Definition: usbh_ctrl.c:524
usbh_parse_configure_desc
usb_sts_type usbh_parse_configure_desc(usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse configure descriptor
Definition: usbh_ctrl.c:603
usbh_get_configure_descriptor
usb_sts_type usbh_get_configure_descriptor(usbh_core_type *uhost, uint16_t length)
usb host get configure descriptor
Definition: usbh_ctrl.c:731
usbh_set_address
usb_sts_type usbh_set_address(usbh_core_type *uhost, uint8_t address)
usb host set device address
Definition: usbh_ctrl.c:797
usbh_get_sting_descriptor
usb_sts_type usbh_get_sting_descriptor(usbh_core_type *uhost, uint8_t string_id, uint8_t *buffer, uint16_t length)
usb host get string descriptor
Definition: usbh_ctrl.c:754
usbh_set_feature
usb_sts_type usbh_set_feature(usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host set feature
Definition: usbh_ctrl.c:841
otg_global_type
Definition: at32f415_usb.h:473
otg_global_type::gnptxsts_bit
struct otg_global_type::@697::@718 gnptxsts_bit
otg_global_type::gnptxfsiz_ept0tx_bit
struct otg_global_type::@695::@717 gnptxfsiz_ept0tx_bit
otg_global_type::ptxfsize
__IO uint32_t ptxfsize
Definition: at32f415_usb.h:767
otg_global_type::nptxfempmsk
__IO uint32_t nptxfempmsk
Definition: at32f415_usb.h:612
otg_global_type::nptxfdep
__IO uint32_t nptxfdep
Definition: at32f415_usb.h:694
otg_global_type::nptxfspcavail
__IO uint32_t nptxfspcavail
Definition: at32f415_usb.h:706
otg_global_type::grxfsiz
__IO uint32_t grxfsiz
Definition: at32f415_usb.h:677
otg_global_type::nptxfstaddr
__IO uint32_t nptxfstaddr
Definition: at32f415_usb.h:693
otg_global_type::ptxfstaddr
__IO uint32_t ptxfstaddr
Definition: at32f415_usb.h:766
otg_global_type::gintsts
__IO uint32_t gintsts
Definition: at32f415_usb.h:564
otg_global_type::gintmsk
__IO uint32_t gintmsk
Definition: at32f415_usb.h:604
otg_global_type::gintmsk_bit
struct otg_global_type::@687::@713 gintmsk_bit
otg_global_type::hptxfsiz_bit
struct otg_global_type::@703::@721 hptxfsiz_bit
otg_hchannel_type
Definition: at32f415_usb.h:901
otg_hchannel_type::hcchar_bit
struct otg_hchannel_type::@744::@754 hcchar_bit
otg_hchannel_type::oddfrm
__IO uint32_t oddfrm
Definition: at32f415_usb.h:918
otg_hchannel_type::hctsiz
__IO uint32_t hctsiz
Definition: at32f415_usb.h:992
otg_hchannel_type::hcchar
__IO uint32_t hcchar
Definition: at32f415_usb.h:907
otg_host_type
Definition: at32f415_usb.h:787
otg_host_type::hprt
__IO uint32_t hprt
Definition: at32f415_usb.h:877
otg_host_type::fslssupp
__IO uint32_t fslssupp
Definition: at32f415_usb.h:797
otg_host_type::hcfg_bit
struct otg_host_type::@723::@737 hcfg_bit
usb_core.h
usb core header file
usbh_core.h
usb host core header file
usbh_ctrl.h
usb header file


AT32F415 Firmwary Library: usbh_core.h Source File

  • middlewares
  • usb_drivers
  • inc
usbh_core.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USBH_CORE_H
29#define __USBH_CORE_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "usb_conf.h"
36#include "usb_std.h"
37
51#ifdef USE_OTG_HOST_MODE
52
56typedef enum
57{
58 HCH_IDLE,
59 HCH_XFRC,
60 HCH_HALTED,
61 HCH_NAK,
62 HCH_NYET,
63 HCH_STALL,
64 HCH_XACTERR,
65 HCH_BBLERR,
66 HCH_DATATGLERR
67} hch_sts_type;
68
72typedef enum
73{
74 URB_IDLE = 0,
75 URB_DONE,
76 URB_NOTREADY,
77 URB_NYET,
78 URB_ERROR,
79 URB_STALL
80} urb_sts_type;
81
85typedef enum
86{
87 CTRL_START = 0,
88 CTRL_XFERC,
89 CTRL_HALTED,
90 CTRL_NAK,
91 CTRL_STALL,
92 CTRL_XACTERR,
93 CTRL_BBLERR,
94 CTRL_DATATGLERR,
95 CTRL_FAIL
96} ctrl_sts_type;
97
101typedef enum
102{
103 CONTROL_IDLE,
104 CONTROL_SETUP,
105 CONTROL_SETUP_WAIT,
106 CONTROL_DATA_IN,
107 CONTROL_DATA_IN_WAIT,
108 CONTROL_DATA_OUT,
109 CONTROL_DATA_OUT_WAIT,
110 CONTROL_STATUS_IN,
111 CONTROL_STATUS_IN_WAIT,
112 CONTROL_STATUS_OUT,
113 CONTROL_STATUS_OUT_WAIT,
114 CONTROL_ERROR,
115 CONTROL_STALL,
116 CONTROL_COMPLETE
117} ctrl_ept0_sts_type;
118
122typedef enum
123{
124 ENUM_IDLE,
125 ENUM_GET_MIN_DESC,
126 ENUM_GET_FULL_DESC,
127 ENUM_SET_ADDR,
128 ENUM_GET_CFG,
129 ENUM_GET_FULL_CFG,
130 ENUM_GET_MFC_STRING,
131 ENUM_GET_PRODUCT_STRING,
132 ENUM_GET_SERIALNUM_STRING,
133 ENUM_SET_CONFIG,
134 ENUM_COMPLETE,
135} usbh_enum_sts_type;
136
140typedef enum
141{
142 USBH_IDLE,
143 USBH_PORT_EN,
144 USBH_ATTACHED,
145 USBH_DISCONNECT,
146 USBH_DEV_SPEED,
147 USBH_ENUMERATION,
148 USBH_CLASS_REQUEST,
149 USBH_CLASS,
150 USBH_CTRL_XFER,
151 USBH_USER_HANDLER,
152 USBH_SUSPEND,
153 USBH_SUSPENDED,
154 USBH_WAKEUP,
155 USBH_UNSUPPORT,
156 USBH_ERROR_STATE,
157} usbh_gstate_type;
158
162typedef enum
163{
164 CMD_IDLE,
165 CMD_SEND,
166 CMD_WAIT
167} cmd_sts_type;
168
172#define HCH_OK 0x0000
173#define HCH_USED 0x8000
174#define HCH_ERROR 0xFFFF
175#define HCH_USED_MASK 0x7FFF
180#define HCH_PID_DATA0 0
181#define HCH_PID_DATA2 1
182#define HCH_PID_DATA1 2
183#define HCH_PID_SETUP 3
188#define USB_REQUEST_DIR_MASK 0x80
189#define USB_DIR_H2D USB_REQ_DIR_HTD
190#define USB_DIR_D2H USB_REQ_DIR_DTH
195#define DATA_STAGE_TIMEOUT 5000
196#define NODATA_STAGE_TIMEOUT 50
201#define USBH_MAX_ERROR_COUNT 2
202#define USBH_MAX_INTERFACE 5
203#define USBH_MAX_ENDPOINT 5
208typedef struct
209{
210 usb_interface_desc_type interface;
211 usb_endpoint_desc_type endpoint[USBH_MAX_ENDPOINT];
212} usb_itf_desc_type;
213
217typedef struct
218{
219 usb_configuration_desc_type cfg;
220 usb_itf_desc_type interface[USBH_MAX_INTERFACE];
221} usb_cfg_desc_type;
222
226typedef struct
227{
228 uint8_t address;
229 uint8_t speed;
230 usb_device_desc_type dev_desc;
231 usb_cfg_desc_type cfg_desc;
232} usbh_dev_desc_type;
233
237typedef struct
238{
239 uint8_t hch_in;
240 uint8_t hch_out;
241 uint8_t ept0_size;
242 uint8_t *buffer;
243 uint16_t len;
244 uint8_t err_cnt;
245 uint16_t timer;
246 ctrl_sts_type sts;
247 usb_setup_type setup;
248 ctrl_ept0_sts_type state;
249} usbh_ctrl_type;
250
254typedef struct
255{
256 usb_sts_type (*init_handler)(void *uhost);
257 usb_sts_type (*reset_handler)(void *uhost);
258 usb_sts_type (*request_handler)(void *uhost);
259 usb_sts_type (*process_handler)(void *uhost);
260 void *pdata;
261} usbh_class_handler_type;
262
266typedef struct
267{
268 usb_sts_type (*user_init)(void);
269 usb_sts_type (*user_reset)(void);
270 usb_sts_type (*user_attached)(void);
271 usb_sts_type (*user_disconnect)(void);
272 usb_sts_type (*user_speed)(uint8_t speed);
273 usb_sts_type (*user_mfc_string)(void *);
274 usb_sts_type (*user_product_string)(void *);
275 usb_sts_type (*user_serial_string)(void *);
276 usb_sts_type (*user_enumeration_done)(void);
277 usb_sts_type (*user_application)(void);
278 usb_sts_type (*user_active_vbus)(void *uhost, confirm_state state);
279 usb_sts_type (*user_not_support)(void);
280} usbh_user_handler_type;
281
285typedef struct
286{
287 usb_reg_type *usb_reg;
289 uint8_t global_state;
290 uint8_t enum_state;
291 uint8_t req_state;
293 usbh_dev_desc_type dev;
294 usbh_ctrl_type ctrl;
296 usbh_class_handler_type *class_handler;
297 usbh_user_handler_type *user_handler;
299 usb_hch_type hch[USB_HOST_CHANNEL_NUM];
300 uint8_t rx_buffer[USB_MAX_DATA_LENGTH];
302 uint32_t conn_sts;
303 uint32_t port_enable;
304 uint32_t timer;
306 uint32_t err_cnt[USB_HOST_CHANNEL_NUM];
307 uint32_t xfer_cnt[USB_HOST_CHANNEL_NUM];
308 hch_sts_type hch_state[USB_HOST_CHANNEL_NUM];
309 urb_sts_type urb_state[USB_HOST_CHANNEL_NUM];
310 uint16_t channel[USB_HOST_CHANNEL_NUM];
311} usbh_core_type;
312
313
314void usbh_free_channel(usbh_core_type *uhost, uint8_t index);
315uint16_t usbh_get_free_channel(usbh_core_type *uhost);
316 usb_sts_type usbh_set_toggle(usbh_core_type *uhost, uint8_t hc_num, uint8_t toggle);
317 usb_sts_type usbh_in_out_request(usbh_core_type *uhost, uint8_t hc_num);
318 usb_sts_type usbh_interrupt_recv(usbh_core_type *uhost, uint8_t hc_num,
319 uint8_t *buffer, uint16_t length);
320 usb_sts_type usbh_interrupt_send(usbh_core_type *uhost, uint8_t hc_num,
321 uint8_t *buffer, uint16_t length);
322 usb_sts_type usbh_bulk_recv(usbh_core_type *uhost, uint8_t hc_num,
323 uint8_t *buffer, uint16_t length);
324 usb_sts_type usbh_bulk_send(usbh_core_type *uhost, uint8_t hc_num,
325 uint8_t *buffer, uint16_t length);
326 usb_sts_type usbh_isoc_send(usbh_core_type *uhost, uint8_t hc_num,
327 uint8_t *buffer, uint16_t length);
328 usb_sts_type usbh_isoc_recv(usbh_core_type *uhost, uint8_t hc_num,
329 uint8_t *buffer, uint16_t length);
330 usb_sts_type usbh_cfg_default_init(usbh_core_type *uhost);
331void usbh_enter_suspend(usbh_core_type *uhost);
332void usbh_resume(usbh_core_type *uhost);
333
334uint16_t usbh_alloc_channel(usbh_core_type *uhost, uint8_t ept_addr);
335urb_sts_type usbh_get_urb_status(usbh_core_type *uhost, uint8_t ch_num);
336 usb_sts_type usbh_ctrl_result_check(usbh_core_type *uhost,
337 ctrl_ept0_sts_type next_ctrl_state,
338 uint8_t next_enum_state);
339uint8_t usbh_alloc_address(void);
340void usbh_reset_port(usbh_core_type *uhost);
341 usb_sts_type usbh_loop_handler(usbh_core_type *uhost);
342void usbh_ch_disable(usbh_core_type *uhost, uint8_t chn);
343void usbh_hc_open(usbh_core_type *uhost,
344 uint8_t chn,
345 uint8_t ept_num,
346 uint8_t dev_address,
347 uint8_t type,
348 uint8_t maxpacket,
349 uint8_t speed);
350void usbh_active_vbus(usbh_core_type *uhost, confirm_state state);
351
352 usb_sts_type usbh_core_init(usbh_core_type *uhost,
353 usb_reg_type *usb_reg,
354 usbh_class_handler_type *class_handler,
355 usbh_user_handler_type *user_handler,
356 uint8_t core_id);
357#endif
358
359
371#ifdef __cplusplus
372}
373#endif
374
375#endif
rx_buffer
uint8_t rx_buffer[0x256]
Definition: project/at_start_f415/examples/spi/w25q_flash/src/main.c:43
confirm_state
confirm_state
confirm state
Definition: at32f415.h:253
class_handler
usbd_class_handler class_handler
Definition: cdc_class.c:75
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
usbh_loop_handler
usb_sts_type usbh_loop_handler(usbh_core_type *uhost)
usb host enum loop handler
Definition: usbh_core.c:1134
usbh_core_init
usb_sts_type usbh_core_init(usbh_core_type *uhost, usb_reg_type *usb_reg, usbh_class_handler_type *class_handler, usbh_user_handler_type *user_handler, uint8_t core_id)
usb host core initialize
Definition: usbh_core.c:496
usbh_interrupt_recv
usb_sts_type usbh_interrupt_recv(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host interrupt receive request
Definition: usbh_core.c:216
usbh_get_free_channel
uint16_t usbh_get_free_channel(usbh_core_type *uhost)
get usb host free channel
Definition: usbh_core.c:71
usbh_free_channel
void usbh_free_channel(usbh_core_type *uhost, uint8_t index)
usb host free channel
Definition: usbh_core.c:57
usbh_set_toggle
usb_sts_type usbh_set_toggle(usbh_core_type *uhost, uint8_t hc_num, uint8_t toggle)
usb host set toggle
Definition: usbh_core.c:94
usbh_alloc_address
uint8_t usbh_alloc_address(void)
auto alloc address (1...127)
Definition: usbh_core.c:748
usbh_bulk_recv
usb_sts_type usbh_bulk_recv(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host bulk receive request
Definition: usbh_core.c:285
usbh_resume
void usbh_resume(usbh_core_type *uhost)
usb host resume
Definition: usbh_core.c:459
usbh_ctrl_result_check
usb_sts_type usbh_ctrl_result_check(usbh_core_type *uhost, ctrl_ept0_sts_type next_ctrl_state, uint8_t next_enum_state)
usb wait control setup complete
Definition: usbh_core.c:716
usbh_active_vbus
void usbh_active_vbus(usbh_core_type *uhost, confirm_state state)
active vbus.
Definition: usbh_core.c:931
usbh_cfg_default_init
usb_sts_type usbh_cfg_default_init(usbh_core_type *uhost)
usb host cfg default init
Definition: usbh_core.c:404
usbh_interrupt_send
usb_sts_type usbh_interrupt_send(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host interrupt send request
Definition: usbh_core.c:250
usbh_hc_open
void usbh_hc_open(usbh_core_type *uhost, uint8_t chn, uint8_t ept_num, uint8_t dev_address, uint8_t type, uint8_t maxpacket, uint8_t speed)
usb host open channel
Definition: usbh_core.c:630
usbh_isoc_recv
usb_sts_type usbh_isoc_recv(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host iso receive request
Definition: usbh_core.c:381
usbh_alloc_channel
uint16_t usbh_alloc_channel(usbh_core_type *uhost, uint8_t ept_addr)
usb host alloc channel
Definition: usbh_core.c:686
usbh_ch_disable
void usbh_ch_disable(usbh_core_type *uhost, uint8_t chn)
disable host channel
Definition: usbh_core.c:675
usbh_enter_suspend
void usbh_enter_suspend(usbh_core_type *uhost)
usb host enter suspend
Definition: usbh_core.c:438
usbh_bulk_send
usb_sts_type usbh_bulk_send(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host bulk send request
Definition: usbh_core.c:320
usbh_in_out_request
usb_sts_type usbh_in_out_request(usbh_core_type *uhost, uint8_t hc_num)
usb host in out request
Definition: usbh_core.c:115
usbh_get_urb_status
urb_sts_type usbh_get_urb_status(usbh_core_type *uhost, uint8_t ch_num)
usb host get urb status
Definition: usbh_core.c:705
usbh_reset_port
void usbh_reset_port(usbh_core_type *uhost)
reset usb port
Definition: usbh_core.c:941
usbh_isoc_send
usb_sts_type usbh_isoc_send(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host iso send request
Definition: usbh_core.c:355
USB_MAX_DATA_LENGTH
#define USB_MAX_DATA_LENGTH
otg host max buffer length (byte)
Definition: at32f415_usb.h:321
otg_global_type
Definition: at32f415_usb.h:473
usb_configuration_desc_type
format of standard configuration descriptor
Definition: usb_std.h:264
usb_device_desc_type
format of standard device descriptor
Definition: usb_std.h:243
usb_endpoint_desc_type
format of standard endpoint descriptor
Definition: usb_std.h:301
usb_hch_type
usb host channel infomation structure definition
Definition: at32f415_usb.h:448
usb_interface_desc_type
format of standard interface descriptor
Definition: usb_std.h:285
usb_setup_type
format of usb setup data
Definition: usb_std.h:230
usb_std.h
usb standard header file


AT32F415 Firmwary Library: usbh_ctrl.c Source File

  • middlewares
  • usb_drivers
  • src
usbh_ctrl.c
Go to the documentation of this file.
1
26#include "usbh_ctrl.h"
27#include "usbh_core.h"
28#include "usb_std.h"
29
50 usb_sts_type usbh_ctrl_send_setup(usbh_core_type *uhost, uint8_t *buffer, uint8_t hc_num)
51{
52 uhost->hch[hc_num].dir = 0;
53 uhost->hch[hc_num].data_pid = HCH_PID_SETUP;
54 uhost->hch[hc_num].trans_buf = buffer;
55 uhost->hch[hc_num].trans_len = 8; /*setup */
56
57 return usbh_in_out_request(uhost, hc_num);
58}
59
68 usb_sts_type usbh_ctrl_recv_data(usbh_core_type *uhost, uint8_t *buffer,
69 uint8_t length, uint16_t hc_num)
70{
71 uhost->hch[hc_num].dir = 1;
72 uhost->hch[hc_num].data_pid = HCH_PID_DATA1;
73 uhost->hch[hc_num].trans_buf = buffer;
74 uhost->hch[hc_num].trans_len = length;
75
76 return usbh_in_out_request(uhost, hc_num);
77}
78
87 usb_sts_type usbh_ctrl_send_data(usbh_core_type *uhost, uint8_t *buffer,
88 uint8_t length, uint16_t hc_num)
89{
90 uhost->hch[hc_num].dir = 0;
91 uhost->hch[hc_num].trans_buf = buffer;
92 uhost->hch[hc_num].trans_len = length;
93
94 if(length == 0)
95 {
96 uhost->hch[uhost->ctrl.hch_out].toggle_out = 1;
97 }
98 if(uhost->hch[uhost->ctrl.hch_out].toggle_out == 0)
99 {
100 uhost->hch[hc_num].data_pid = HCH_PID_DATA0;
101 }
102 else
103 {
104 uhost->hch[hc_num].data_pid = HCH_PID_DATA1;
105 }
106 return usbh_in_out_request(uhost, hc_num);
107}
108
114 usb_sts_type usbh_ctrl_setup_handler(usbh_core_type *uhost)
115{
116 usbh_ctrl_send_setup(uhost, (uint8_t *)(&uhost->ctrl.setup),
117 uhost->ctrl.hch_out);
118 uhost->ctrl.state = CONTROL_SETUP_WAIT;
119 return USB_OK;
120}
121
128 usb_sts_type usbh_ctrl_setup_wait_handler(usbh_core_type *uhost, uint32_t *timeout)
129{
130 urb_sts_type urb_state;
131 usb_sts_type status = USB_WAIT;
132 uint8_t dir;
133 urb_state = uhost->urb_state[uhost->ctrl.hch_out];
134 if(urb_state == URB_DONE)
135 {
136 dir = uhost->ctrl.setup.bmRequestType & USB_REQUEST_DIR_MASK;
137 if(uhost->ctrl.setup.wLength != 0)
138 {
139 *timeout = DATA_STAGE_TIMEOUT;
140 if(dir == USB_DIR_D2H) //in
141 {
142 uhost->ctrl.state = CONTROL_DATA_IN;
143 }
144 else //out
145 {
146 uhost->ctrl.state = CONTROL_DATA_OUT;
147 }
148 }
149 else
150 {
151 *timeout = NODATA_STAGE_TIMEOUT;
152 if(dir == USB_DIR_D2H) //no data, send status
153 {
154 uhost->ctrl.state = CONTROL_STATUS_OUT;
155 }
156 else //out
157 {
158 uhost->ctrl.state = CONTROL_STATUS_IN;
159 }
160 }
161 uhost->ctrl.timer = OTG_HOST(uhost->usb_reg)->hfnum_bit.frnum;
162 status = USB_OK;
163 }
164 else if(urb_state == URB_ERROR)
165 {
166 uhost->ctrl.state = CONTROL_ERROR;
167 uhost->ctrl.sts = CTRL_XACTERR;
168 status = USB_ERROR;
169 }
170 return status;
171}
172
178 usb_sts_type usbh_ctrl_data_in_handler(usbh_core_type *uhost)
179{
180 usb_sts_type status = USB_OK;
181 usbh_ctrl_recv_data(uhost, uhost->ctrl.buffer,
182 uhost->ctrl.len,
183 uhost->ctrl.hch_in);
184 uhost->ctrl.state = CONTROL_DATA_IN_WAIT;
185
186 return status;
187}
188
195 usb_sts_type usbh_ctrl_data_in_wait_handler(usbh_core_type *uhost, uint32_t timeout)
196{
197 usb_sts_type status = USB_OK;
198 urb_sts_type urb_state;
199 urb_state = uhost->urb_state[uhost->ctrl.hch_in];
200
201 if(urb_state == URB_DONE)
202 {
203 uhost->ctrl.state = CONTROL_STATUS_OUT;
204 }
205 else if(urb_state == URB_STALL)
206 {
207 uhost->ctrl.state = CONTROL_STALL;
208 }
209 else if(urb_state == URB_ERROR)
210 {
211 uhost->ctrl.state = CONTROL_ERROR;
212 }
213 return status;
214}
215
221 usb_sts_type usbh_ctrl_data_out_handler(usbh_core_type *uhost)
222{
223 usb_sts_type status = USB_OK;
224 uhost->hch[uhost->ctrl.hch_out].toggle_out = 1;
225
226 usbh_ctrl_send_data(uhost, uhost->ctrl.buffer,
227 uhost->ctrl.len,
228 uhost->ctrl.hch_out);
229 uhost->ctrl.state = CONTROL_DATA_OUT_WAIT;
230
231 return status;
232}
233
240 usb_sts_type usbh_ctrl_data_out_wait_handler(usbh_core_type *uhost, uint32_t timeout)
241{
242 usb_sts_type status = USB_OK;
243 urb_sts_type urb_state;
244 urb_state = uhost->urb_state[uhost->ctrl.hch_out];
245 if(urb_state == URB_DONE)
246 {
247 uhost->ctrl.state = CONTROL_STATUS_IN;
248 }
249 else if(urb_state == URB_STALL)
250 {
251 uhost->ctrl.state = CONTROL_STALL;
252 }
253 else if(urb_state == URB_ERROR)
254 {
255 uhost->ctrl.state = CONTROL_ERROR;
256 }
257 else if(urb_state == URB_NOTREADY)
258 {
259 uhost->ctrl.state = CONTROL_DATA_OUT;
260 }
261 return status;
262}
263
269 usb_sts_type usbh_ctrl_status_in_handler(usbh_core_type *uhost)
270{
271 usb_sts_type status = USB_OK;
272 usbh_ctrl_recv_data(uhost, 0, 0,
273 uhost->ctrl.hch_in);
274 uhost->ctrl.state = CONTROL_STATUS_IN_WAIT;
275
276
277 return status;
278}
279
286 usb_sts_type usbh_ctrl_status_in_wait_handler(usbh_core_type *uhost, uint32_t timeout)
287{
288 usb_sts_type status = USB_OK;
289 urb_sts_type urb_state;
290 urb_state = uhost->urb_state[uhost->ctrl.hch_in];
291 if(urb_state == URB_DONE)
292 {
293 uhost->ctrl.state = CONTROL_COMPLETE;
294 }
295 else if(urb_state == URB_STALL)
296 {
297 uhost->ctrl.state = CONTROL_STALL;
298 status = USB_NOT_SUPPORT;
299 }
300 else if(urb_state == URB_ERROR)
301 {
302 uhost->ctrl.state = CONTROL_ERROR;
303 }
304 return status;
305}
306
312 usb_sts_type usbh_ctrl_status_out_handler(usbh_core_type *uhost)
313{
314 usb_sts_type status = USB_OK;
315 uhost->hch[uhost->ctrl.hch_out].toggle_out ^= 1;
316
317 usbh_ctrl_send_data(uhost, 0, 0, uhost->ctrl.hch_out);
318 uhost->ctrl.state = CONTROL_STATUS_OUT_WAIT;
319
320 return status;
321}
322
329 usb_sts_type usbh_ctrl_status_out_wait_handler(usbh_core_type *uhost, uint32_t timeout)
330{
331 usb_sts_type status = USB_OK;
332 urb_sts_type urb_state;
333 urb_state = uhost->urb_state[uhost->ctrl.hch_out];
334 if(urb_state == URB_DONE)
335 {
336 uhost->ctrl.state = CONTROL_COMPLETE;
337 }
338 else if(urb_state == URB_STALL)
339 {
340 uhost->ctrl.state = CONTROL_STALL;
341 }
342 else if(urb_state == URB_ERROR)
343 {
344 uhost->ctrl.state = CONTROL_ERROR;
345 }
346 else if(urb_state == URB_NOTREADY)
347 {
348 uhost->ctrl.state = CONTROL_STATUS_OUT;
349 }
350 return status;
351}
352
358 usb_sts_type usbh_ctrl_error_handler(usbh_core_type *uhost)
359{
360 usb_sts_type status = USB_WAIT;
361 if(++ uhost->ctrl.err_cnt <= USBH_MAX_ERROR_COUNT)
362 {
363 uhost->ctrl.state = CONTROL_SETUP;
364 }
365 else
366 {
367 uhost->ctrl.sts = CTRL_FAIL;
368 uhost->global_state = USBH_DISCONNECT;
369 uhost->ctrl.err_cnt = 0;
370 USBH_DEBUG("control error: device not response");
371 status = USB_ERROR;
372 }
373 return status;
374}
375
381 usb_sts_type usbh_ctrl_stall_handler(usbh_core_type *uhost)
382{
383 return USB_NOT_SUPPORT;
384}
385
391 usb_sts_type usbh_ctrl_complete_handler(usbh_core_type *uhost)
392{
393 return USB_OK;
394}
395
401 usb_sts_type usbh_ctrl_transfer_loop(usbh_core_type *uhost)
402{
403 usb_sts_type status = USB_WAIT;
404 static uint32_t timeout = 0;
405 uhost->ctrl.sts = CTRL_START;
406
407 switch(uhost->ctrl.state)
408 {
409 case CONTROL_SETUP:
410 usbh_ctrl_setup_handler(uhost);
411 break;
412
413 case CONTROL_SETUP_WAIT:
414 usbh_ctrl_setup_wait_handler(uhost, &timeout);
415 break;
416
417 case CONTROL_DATA_IN:
418 usbh_ctrl_data_in_handler(uhost);
419 break;
420
421 case CONTROL_DATA_IN_WAIT:
422 usbh_ctrl_data_in_wait_handler(uhost, timeout);
423 break;
424
425 case CONTROL_DATA_OUT:
426 usbh_ctrl_data_out_handler(uhost);
427 break;
428
429 case CONTROL_DATA_OUT_WAIT:
430 usbh_ctrl_data_out_wait_handler(uhost, timeout);
431 break;
432
433 case CONTROL_STATUS_IN:
434 usbh_ctrl_status_in_handler(uhost);
435 break;
436
437 case CONTROL_STATUS_IN_WAIT:
438 usbh_ctrl_status_in_wait_handler(uhost, timeout);
439 break;
440
441 case CONTROL_STATUS_OUT:
442 usbh_ctrl_status_out_handler(uhost);
443 break;
444
445 case CONTROL_STATUS_OUT_WAIT:
446 usbh_ctrl_status_out_wait_handler(uhost, timeout);
447 break;
448 case CONTROL_STALL:
449 status = usbh_ctrl_stall_handler(uhost);
450 break;
451 case CONTROL_ERROR:
452 status = usbh_ctrl_error_handler(uhost);
453 break;
454 case CONTROL_COMPLETE:
455 status = usbh_ctrl_complete_handler(uhost);
456 break;
457
458 default:
459 break;
460 }
461
462 return status;
463}
464
472 usb_sts_type usbh_ctrl_request(usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
473{
474 usb_sts_type status = USB_OK;
475 if(uhost->req_state == CMD_SEND)
476 {
477 uhost->req_state = CMD_WAIT;
478 uhost->ctrl.buffer = buffer;
479 uhost->ctrl.len = length;
480 uhost->ctrl.state = CONTROL_SETUP;
481 }
482 return status;
483}
484
494 usb_sts_type usbh_get_descriptor(usbh_core_type *uhost, uint16_t length,
495 uint8_t req_type, uint16_t wvalue,
496 uint8_t *buffer)
497{
498 usb_sts_type status;
499 uhost->ctrl.setup.bmRequestType = USB_DIR_D2H | req_type;
500 uhost->ctrl.setup.bRequest = USB_STD_REQ_GET_DESCRIPTOR;
501 uhost->ctrl.setup.wValue = wvalue;
502 uhost->ctrl.setup.wLength = length;
503
504 if((wvalue & 0xFF00) == ((USB_DESCIPTOR_TYPE_STRING << 8) & 0xFF00))
505 {
506 uhost->ctrl.setup.wIndex = 0x0409;
507 }
508 else
509 {
510 uhost->ctrl.setup.wIndex = 0;
511 }
512
513 status = usbh_ctrl_request(uhost, buffer, length);
514 return status;
515}
516
524void usbh_parse_dev_desc(usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
525{
526 usbh_dev_desc_type *desc = &(uhost->dev);
527
528 desc->dev_desc.bLength = *(uint8_t *)(buffer + 0);
529 desc->dev_desc.bDescriptorType = *(uint8_t *)(buffer + 1);
530 desc->dev_desc.bcdUSB = SWAPBYTE(buffer + 2);
531 desc->dev_desc.bDeviceClass = *(uint8_t *)(buffer + 4);
532 desc->dev_desc.bDeviceSubClass = *(uint8_t *)(buffer + 5);
533 desc->dev_desc.bDeviceProtocol = *(uint8_t *)(buffer + 6);
534 desc->dev_desc.bMaxPacketSize0 = *(uint8_t *)(buffer + 7);
535
536 if(length > 8)
537 {
538 desc->dev_desc.idVendor = SWAPBYTE(buffer + 8);
539 desc->dev_desc.idProduct = SWAPBYTE(buffer + 10);
540 desc->dev_desc.bcdDevice = SWAPBYTE(buffer + 12);
541 desc->dev_desc.iManufacturer = *(uint8_t *)(buffer + 14);
542 desc->dev_desc.iProduct = *(uint8_t *)(buffer + 15);
543 desc->dev_desc.iSerialNumber = *(uint8_t *)(buffer + 16);
544 desc->dev_desc.bNumConfigurations = *(uint8_t *)(buffer + 17);
545 }
546}
547
554 usb_header_desc_type *usbh_get_next_header(uint8_t *buf, uint16_t *index_len)
555{
556 *index_len += ((usb_header_desc_type *)buf)->bLength;
557 return (usb_header_desc_type *)
558 ((uint8_t *)buf + ((usb_header_desc_type *)buf)->bLength);
559}
560
567void usbh_parse_interface_desc(usb_interface_desc_type *intf, uint8_t *buf)
568{
569 intf->bLength = *(uint8_t *)buf;
570 intf->bDescriptorType = *(uint8_t *)(buf + 1);
571 intf->bInterfaceNumber = *(uint8_t *)(buf + 2);
572 intf->bAlternateSetting = *(uint8_t *)(buf + 3);
573 intf->bNumEndpoints = *(uint8_t *)(buf + 4);
574 intf->bInterfaceClass = *(uint8_t *)(buf + 5);
575 intf->bInterfaceSubClass = *(uint8_t *)(buf + 6);
576 intf->bInterfaceProtocol = *(uint8_t *)(buf + 7);
577 intf->iInterface = *(uint8_t *)(buf + 8);
578}
579
586void usbh_parse_endpoint_desc(usb_endpoint_desc_type *ept_desc, uint8_t *buf)
587{
588 ept_desc->bLength = *(uint8_t *)(buf + 0);
589 ept_desc->bDescriptorType = *(uint8_t *)(buf + 1);
590 ept_desc->bEndpointAddress = *(uint8_t *)(buf + 2);
591 ept_desc->bmAttributes = *(uint8_t *)(buf + 3);
592 ept_desc->wMaxPacketSize = SWAPBYTE(buf + 4);
593 ept_desc->bInterval = *(uint8_t *)(buf + 6);
594}
595
603 usb_sts_type usbh_parse_configure_desc(usbh_core_type *uhost,
604 uint8_t *buffer, uint16_t length)
605{
606 usb_cfg_desc_type *cfg_desc = &(uhost->dev.cfg_desc);
607 usb_interface_desc_type *intf_desc;
608 usb_endpoint_desc_type *ept_desc;
609 usb_header_desc_type *desc;
610 uint16_t index_len;
611 uint8_t index_intf = 0;
612 uint8_t index_ept = 0;
613
614 desc = (usb_header_desc_type *)buffer;
615 cfg_desc->cfg.bLength = *(uint8_t *)buffer;
616 cfg_desc->cfg.bDescriptorType = *(uint8_t *)(buffer + 1);
617 cfg_desc->cfg.wTotalLength = SWAPBYTE(buffer + 2);
618 cfg_desc->cfg.bNumInterfaces = *(uint8_t *)(buffer + 4);
619 cfg_desc->cfg.bConfigurationValue = *(uint8_t *)(buffer + 5);
620 cfg_desc->cfg.iConfiguration = *(uint8_t *)(buffer + 6);
621 cfg_desc->cfg.bmAttributes = *(uint8_t *)(buffer + 7);
622 cfg_desc->cfg.bMaxPower = *(uint8_t *)(buffer + 8);
623
624 if(length > USB_DEVICE_CFG_DESC_LEN)
625 {
626 index_len = USB_DEVICE_CFG_DESC_LEN;
627
628 while((index_intf < USBH_MAX_INTERFACE) && index_len < cfg_desc->cfg.wTotalLength)
629 {
630 desc = usbh_get_next_header((uint8_t *)desc, &index_len);
631 if(desc->bDescriptorType == USB_DESCIPTOR_TYPE_INTERFACE)
632 {
633 index_ept = 0;
634 intf_desc = &cfg_desc->interface[index_intf].interface;
635 usbh_parse_interface_desc(intf_desc, (uint8_t *)desc);
636
637 while(index_ept < intf_desc->bNumEndpoints && index_len < cfg_desc->cfg.wTotalLength)
638 {
639 desc = usbh_get_next_header((uint8_t *)desc, &index_len);
640 if(desc->bDescriptorType == USB_DESCIPTOR_TYPE_ENDPOINT)
641 {
642 ept_desc = &(cfg_desc->interface[index_intf].endpoint[index_ept]);
643 usbh_parse_endpoint_desc(ept_desc, (uint8_t *)desc);
644 index_ept ++;
645 }
646 }
647 index_intf ++;
648 }
649 }
650 }
651 return USB_OK;
652}
653
662uint8_t usbh_find_interface(usbh_core_type *uhost, uint8_t class_code, uint8_t sub_class, uint8_t protocol)
663{
664 uint8_t idx = 0;
665 usb_itf_desc_type *usbitf;
666 for(idx = 0; idx < uhost->dev.cfg_desc.cfg.bNumInterfaces; idx ++)
667 {
668 usbitf = &uhost->dev.cfg_desc.interface[idx];
669 if(((usbitf->interface.bInterfaceClass == class_code) || (class_code == 0xFF)) &&
670 ((usbitf->interface.bInterfaceSubClass == sub_class) || (sub_class == 0xFF)) &&
671 ((usbitf->interface.bInterfaceProtocol == protocol) || (protocol == 0xFF))
672 )
673 {
674 return idx;
675 }
676 }
677 return 0xFF;
678}
679
687void usbh_parse_string_desc(uint8_t *src, uint8_t *dest, uint16_t length)
688{
689 uint16_t len;
690 uint16_t i_index;
691
692 if(src[1] == USB_DESCIPTOR_TYPE_STRING)
693 {
694 len = ((src[0] - 2) <= length ? (src[0] - 2) : length);
695 src += 2;
696 for(i_index = 0; i_index < len; i_index += 2)
697 {
698 *dest = src[i_index];
699 dest ++;
700 }
701 *dest = 0;
702 }
703}
704
711 usb_sts_type usbh_get_device_descriptor(usbh_core_type *uhost, uint16_t length)
712{
713 usb_sts_type status = USB_WAIT;
714 uint8_t bm_req;
715 uint16_t wvalue;
716
717 bm_req = USB_REQ_RECIPIENT_DEVICE | USB_REQ_TYPE_STANDARD;
718 wvalue = (USB_DESCIPTOR_TYPE_DEVICE << 8) & 0xFF00;
719
720 status = usbh_get_descriptor(uhost, length, bm_req,
721 wvalue, uhost->rx_buffer);
722 return status;
723}
724
731 usb_sts_type usbh_get_configure_descriptor(usbh_core_type *uhost, uint16_t length)
732{
733 usb_sts_type status = USB_WAIT;
734 uint8_t bm_req;
735 uint16_t wvalue;
736
737 bm_req = USB_REQ_RECIPIENT_DEVICE | USB_REQ_TYPE_STANDARD;
738 wvalue = (USB_DESCIPTOR_TYPE_CONFIGURATION << 8) & 0xFF00;
739
740 status = usbh_get_descriptor(uhost, length, bm_req,
741 wvalue, uhost->rx_buffer);
742
743 return status;
744}
745
754 usb_sts_type usbh_get_sting_descriptor(usbh_core_type *uhost, uint8_t string_id,
755 uint8_t *buffer, uint16_t length)
756{
757 usb_sts_type status = USB_WAIT;
758 uint8_t bm_req;
759 uint16_t wvalue;
760
761 bm_req = USB_REQ_RECIPIENT_DEVICE | USB_REQ_TYPE_STANDARD;
762 wvalue = (USB_DESCIPTOR_TYPE_STRING << 8) | string_id;
763
764 status = usbh_get_descriptor(uhost, length, bm_req,
765 wvalue, uhost->rx_buffer);
766
767 return status;
768}
769
776 usb_sts_type usbh_set_configuration(usbh_core_type *uhost, uint16_t config)
777{
778 usb_sts_type status = USB_WAIT;
779 uint8_t bm_req;
780 bm_req = USB_REQ_RECIPIENT_DEVICE | USB_REQ_TYPE_STANDARD;
781
782 uhost->ctrl.setup.bmRequestType = USB_DIR_H2D | bm_req;
783 uhost->ctrl.setup.bRequest = USB_STD_REQ_SET_CONFIGURATION;
784 uhost->ctrl.setup.wValue = config;
785 uhost->ctrl.setup.wLength = 0;
786 uhost->ctrl.setup.wIndex = 0;
787 status = usbh_ctrl_request(uhost, 0, 0);
788 return status;
789}
790
797 usb_sts_type usbh_set_address(usbh_core_type *uhost, uint8_t address)
798{
799 usb_sts_type status = USB_WAIT;
800 uint8_t bm_req;
801 bm_req = USB_REQ_RECIPIENT_DEVICE | USB_REQ_TYPE_STANDARD;
802
803 uhost->ctrl.setup.bmRequestType = USB_DIR_H2D | bm_req;
804 uhost->ctrl.setup.bRequest = USB_STD_REQ_SET_ADDRESS;
805 uhost->ctrl.setup.wValue = (uint16_t)address;
806 uhost->ctrl.setup.wLength = 0;
807 uhost->ctrl.setup.wIndex = 0;
808 status = usbh_ctrl_request(uhost, 0, 0);
809 return status;
810}
811
819 usb_sts_type usbh_set_interface(usbh_core_type *uhost, uint8_t ept_num, uint8_t altsetting)
820{
821 usb_sts_type status = USB_WAIT;
822 uint8_t bm_req;
823 bm_req = USB_REQ_RECIPIENT_INTERFACE | USB_REQ_TYPE_STANDARD;
824
825 uhost->ctrl.setup.bmRequestType = USB_DIR_H2D | bm_req;
826 uhost->ctrl.setup.bRequest = USB_STD_REQ_SET_INTERFACE;
827 uhost->ctrl.setup.wValue = (uint16_t)altsetting;
828 uhost->ctrl.setup.wLength = 0;
829 uhost->ctrl.setup.wIndex = ept_num;
830 status = usbh_ctrl_request(uhost, 0, 0);
831 return status;
832}
833
841 usb_sts_type usbh_set_feature(usbh_core_type *uhost, uint8_t feature, uint16_t index)
842{
843 usb_sts_type status = USB_WAIT;
844 uint8_t bm_req;
845 bm_req = USB_REQ_RECIPIENT_DEVICE | USB_REQ_TYPE_STANDARD;
846
847 uhost->ctrl.setup.bmRequestType = USB_DIR_H2D | bm_req;
848 uhost->ctrl.setup.bRequest = USB_STD_REQ_SET_FEATURE;
849 uhost->ctrl.setup.wValue = (uint16_t)feature;
850 uhost->ctrl.setup.wLength = 0;
851 uhost->ctrl.setup.wIndex = index;
852 status = usbh_ctrl_request(uhost, 0, 0);
853 return status;
854}
855
856
864 usb_sts_type usbh_clear_dev_feature(usbh_core_type *uhost, uint8_t feature, uint16_t index)
865{
866 usb_sts_type status = USB_WAIT;
867 uint8_t bm_req;
868 bm_req = USB_REQ_RECIPIENT_DEVICE | USB_REQ_TYPE_STANDARD;
869
870 uhost->ctrl.setup.bmRequestType = USB_DIR_H2D | bm_req;
871 uhost->ctrl.setup.bRequest = USB_STD_REQ_CLEAR_FEATURE;
872 uhost->ctrl.setup.wValue = (uint16_t)feature;
873 uhost->ctrl.setup.wLength = 0;
874 uhost->ctrl.setup.wIndex = index;
875 status = usbh_ctrl_request(uhost, 0, 0);
876 return status;
877}
878
886 usb_sts_type usbh_clear_ept_feature(usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num)
887{
888 usb_sts_type status = USB_WAIT;
889 uint8_t bm_req;
890 if(uhost->ctrl.state == CONTROL_IDLE )
891 {
892 bm_req = USB_REQ_RECIPIENT_ENDPOINT | USB_REQ_TYPE_STANDARD;
893
894 uhost->ctrl.setup.bmRequestType = USB_DIR_H2D | bm_req;
895 uhost->ctrl.setup.bRequest = USB_STD_REQ_CLEAR_FEATURE;
896 uhost->ctrl.setup.wValue = USB_FEATURE_EPT_HALT;
897 uhost->ctrl.setup.wLength = 0;
898 uhost->ctrl.setup.wIndex = ept_num;
899 usbh_ctrl_request(uhost, 0, 0);
900 }
901 if(usbh_ctrl_result_check(uhost, CONTROL_IDLE, ENUM_IDLE) == USB_OK)
902 {
903 status = USB_OK;
904 }
905 return status;
906}
907
USBH_DEBUG
#define USBH_DEBUG(...)
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:152
OTG_HOST
#define OTG_HOST(usbx)
Definition: at32f415_usb.h:1343
USB_STD_REQ_CLEAR_FEATURE
#define USB_STD_REQ_CLEAR_FEATURE
Definition: usb_std.h:78
USB_STD_REQ_SET_CONFIGURATION
#define USB_STD_REQ_SET_CONFIGURATION
Definition: usb_std.h:84
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
USB_DESCIPTOR_TYPE_CONFIGURATION
#define USB_DESCIPTOR_TYPE_CONFIGURATION
Definition: usb_std.h:93
USB_STD_REQ_GET_DESCRIPTOR
#define USB_STD_REQ_GET_DESCRIPTOR
Definition: usb_std.h:81
USB_STD_REQ_SET_ADDRESS
#define USB_STD_REQ_SET_ADDRESS
Definition: usb_std.h:80
USB_STD_REQ_SET_FEATURE
#define USB_STD_REQ_SET_FEATURE
Definition: usb_std.h:79
USB_DESCIPTOR_TYPE_ENDPOINT
#define USB_DESCIPTOR_TYPE_ENDPOINT
Definition: usb_std.h:96
SWAPBYTE
#define SWAPBYTE(addr)
usb swap address
Definition: usb_std.h:197
USB_DEVICE_CFG_DESC_LEN
#define USB_DEVICE_CFG_DESC_LEN
Definition: usb_std.h:151
USB_DESCIPTOR_TYPE_DEVICE
#define USB_DESCIPTOR_TYPE_DEVICE
usb standard device type
Definition: usb_std.h:92
USB_REQ_RECIPIENT_DEVICE
#define USB_REQ_RECIPIENT_DEVICE
usb request recipient
Definition: usb_std.h:54
USB_FEATURE_EPT_HALT
#define USB_FEATURE_EPT_HALT
usb standard feature selectors
Definition: usb_std.h:120
USB_DESCIPTOR_TYPE_STRING
#define USB_DESCIPTOR_TYPE_STRING
Definition: usb_std.h:94
USB_STD_REQ_SET_INTERFACE
#define USB_STD_REQ_SET_INTERFACE
Definition: usb_std.h:86
USB_DESCIPTOR_TYPE_INTERFACE
#define USB_DESCIPTOR_TYPE_INTERFACE
Definition: usb_std.h:95
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_REQ_RECIPIENT_ENDPOINT
#define USB_REQ_RECIPIENT_ENDPOINT
Definition: usb_std.h:56
USB_REQ_RECIPIENT_INTERFACE
#define USB_REQ_RECIPIENT_INTERFACE
Definition: usb_std.h:55
USB_OK
@ USB_OK
Definition: usb_std.h:218
USB_WAIT
@ USB_WAIT
Definition: usb_std.h:220
USB_ERROR
@ USB_ERROR
Definition: usb_std.h:222
USB_NOT_SUPPORT
@ USB_NOT_SUPPORT
Definition: usb_std.h:221
usbh_ctrl_result_check
usb_sts_type usbh_ctrl_result_check(usbh_core_type *uhost, ctrl_ept0_sts_type next_ctrl_state, uint8_t next_enum_state)
usb wait control setup complete
Definition: usbh_core.c:716
usbh_in_out_request
usb_sts_type usbh_in_out_request(usbh_core_type *uhost, uint8_t hc_num)
usb host in out request
Definition: usbh_core.c:115
usbh_set_configuration
usb_sts_type usbh_set_configuration(usbh_core_type *uhost, uint16_t config)
usb host set configurtion
Definition: usbh_ctrl.c:776
usbh_ctrl_stall_handler
usb_sts_type usbh_ctrl_stall_handler(usbh_core_type *uhost)
usb host control stall handler
Definition: usbh_ctrl.c:381
usbh_get_next_header
usb_header_desc_type * usbh_get_next_header(uint8_t *buf, uint16_t *index_len)
usb host get next header
Definition: usbh_ctrl.c:554
usbh_ctrl_data_out_wait_handler
usb_sts_type usbh_ctrl_data_out_wait_handler(usbh_core_type *uhost, uint32_t timeout)
usb host control data out wait handler
Definition: usbh_ctrl.c:240
usbh_ctrl_data_in_handler
usb_sts_type usbh_ctrl_data_in_handler(usbh_core_type *uhost)
usb host control data in request handler
Definition: usbh_ctrl.c:178
usbh_ctrl_setup_handler
usb_sts_type usbh_ctrl_setup_handler(usbh_core_type *uhost)
usb host control setup request handler
Definition: usbh_ctrl.c:114
usbh_ctrl_transfer_loop
usb_sts_type usbh_ctrl_transfer_loop(usbh_core_type *uhost)
usb host control transfer loop function
Definition: usbh_ctrl.c:401
usbh_clear_dev_feature
usb_sts_type usbh_clear_dev_feature(usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host clear device feature
Definition: usbh_ctrl.c:864
usbh_get_device_descriptor
usb_sts_type usbh_get_device_descriptor(usbh_core_type *uhost, uint16_t length)
usb host get device descriptor
Definition: usbh_ctrl.c:711
usbh_ctrl_request
usb_sts_type usbh_ctrl_request(usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host control request
Definition: usbh_ctrl.c:472
usbh_parse_string_desc
void usbh_parse_string_desc(uint8_t *src, uint8_t *dest, uint16_t length)
usbh parse string descriptor
Definition: usbh_ctrl.c:687
usbh_get_descriptor
usb_sts_type usbh_get_descriptor(usbh_core_type *uhost, uint16_t length, uint8_t req_type, uint16_t wvalue, uint8_t *buffer)
usb host get device descriptor
Definition: usbh_ctrl.c:494
usbh_ctrl_send_data
usb_sts_type usbh_ctrl_send_data(usbh_core_type *uhost, uint8_t *buffer, uint8_t length, uint16_t hc_num)
usb host control send data packet
Definition: usbh_ctrl.c:87
usbh_parse_interface_desc
void usbh_parse_interface_desc(usb_interface_desc_type *intf, uint8_t *buf)
usb host parse interface descriptor
Definition: usbh_ctrl.c:567
usbh_ctrl_send_setup
usb_sts_type usbh_ctrl_send_setup(usbh_core_type *uhost, uint8_t *buffer, uint8_t hc_num)
usb host control send setup packet
Definition: usbh_ctrl.c:50
usbh_ctrl_data_out_handler
usb_sts_type usbh_ctrl_data_out_handler(usbh_core_type *uhost)
usb host control data out request handler
Definition: usbh_ctrl.c:221
usbh_ctrl_recv_data
usb_sts_type usbh_ctrl_recv_data(usbh_core_type *uhost, uint8_t *buffer, uint8_t length, uint16_t hc_num)
usb host control receive data from device
Definition: usbh_ctrl.c:68
usbh_find_interface
uint8_t usbh_find_interface(usbh_core_type *uhost, uint8_t class_code, uint8_t sub_class, uint8_t protocol)
usb host find interface
Definition: usbh_ctrl.c:662
usbh_clear_ept_feature
usb_sts_type usbh_clear_ept_feature(usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num)
usb host clear endpoint feature
Definition: usbh_ctrl.c:886
usbh_ctrl_status_in_wait_handler
usb_sts_type usbh_ctrl_status_in_wait_handler(usbh_core_type *uhost, uint32_t timeout)
usb host control status data in wait handler
Definition: usbh_ctrl.c:286
usbh_set_interface
usb_sts_type usbh_set_interface(usbh_core_type *uhost, uint8_t ept_num, uint8_t altsetting)
usb host set interface
Definition: usbh_ctrl.c:819
usbh_ctrl_error_handler
usb_sts_type usbh_ctrl_error_handler(usbh_core_type *uhost)
usb host control error handler
Definition: usbh_ctrl.c:358
usbh_parse_dev_desc
void usbh_parse_dev_desc(usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse device descriptor
Definition: usbh_ctrl.c:524
usbh_ctrl_status_in_handler
usb_sts_type usbh_ctrl_status_in_handler(usbh_core_type *uhost)
usb host control status data in handler
Definition: usbh_ctrl.c:269
usbh_ctrl_status_out_wait_handler
usb_sts_type usbh_ctrl_status_out_wait_handler(usbh_core_type *uhost, uint32_t timeout)
usb host control status data out wait handler
Definition: usbh_ctrl.c:329
usbh_parse_configure_desc
usb_sts_type usbh_parse_configure_desc(usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse configure descriptor
Definition: usbh_ctrl.c:603
usbh_ctrl_complete_handler
usb_sts_type usbh_ctrl_complete_handler(usbh_core_type *uhost)
usb host control complete handler
Definition: usbh_ctrl.c:391
usbh_get_configure_descriptor
usb_sts_type usbh_get_configure_descriptor(usbh_core_type *uhost, uint16_t length)
usb host get configure descriptor
Definition: usbh_ctrl.c:731
usbh_set_address
usb_sts_type usbh_set_address(usbh_core_type *uhost, uint8_t address)
usb host set device address
Definition: usbh_ctrl.c:797
usbh_parse_endpoint_desc
void usbh_parse_endpoint_desc(usb_endpoint_desc_type *ept_desc, uint8_t *buf)
usb host parse endpoint descriptor
Definition: usbh_ctrl.c:586
usbh_ctrl_status_out_handler
usb_sts_type usbh_ctrl_status_out_handler(usbh_core_type *uhost)
usb host control status data out wait handler
Definition: usbh_ctrl.c:312
usbh_get_sting_descriptor
usb_sts_type usbh_get_sting_descriptor(usbh_core_type *uhost, uint8_t string_id, uint8_t *buffer, uint16_t length)
usb host get string descriptor
Definition: usbh_ctrl.c:754
usbh_ctrl_data_in_wait_handler
usb_sts_type usbh_ctrl_data_in_wait_handler(usbh_core_type *uhost, uint32_t timeout)
usb host control data in wait handler
Definition: usbh_ctrl.c:195
usbh_set_feature
usb_sts_type usbh_set_feature(usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host set feature
Definition: usbh_ctrl.c:841
usbh_ctrl_setup_wait_handler
usb_sts_type usbh_ctrl_setup_wait_handler(usbh_core_type *uhost, uint32_t *timeout)
usb host control setup request wait handler
Definition: usbh_ctrl.c:128
usb_endpoint_desc_type
format of standard endpoint descriptor
Definition: usb_std.h:301
usb_endpoint_desc_type::bDescriptorType
uint8_t bDescriptorType
Definition: usb_std.h:303
usb_endpoint_desc_type::bInterval
uint8_t bInterval
Definition: usb_std.h:307
usb_endpoint_desc_type::bEndpointAddress
uint8_t bEndpointAddress
Definition: usb_std.h:304
usb_endpoint_desc_type::bmAttributes
uint8_t bmAttributes
Definition: usb_std.h:305
usb_endpoint_desc_type::wMaxPacketSize
uint16_t wMaxPacketSize
Definition: usb_std.h:306
usb_endpoint_desc_type::bLength
uint8_t bLength
Definition: usb_std.h:302
usb_header_desc_type
format of header
Definition: usb_std.h:314
usb_header_desc_type::bLength
uint8_t bLength
Definition: usb_std.h:315
usb_interface_desc_type
format of standard interface descriptor
Definition: usb_std.h:285
usb_interface_desc_type::bInterfaceNumber
uint8_t bInterfaceNumber
Definition: usb_std.h:288
usb_interface_desc_type::bAlternateSetting
uint8_t bAlternateSetting
Definition: usb_std.h:289
usb_interface_desc_type::bNumEndpoints
uint8_t bNumEndpoints
Definition: usb_std.h:290
usb_interface_desc_type::bInterfaceProtocol
uint8_t bInterfaceProtocol
Definition: usb_std.h:293
usb_interface_desc_type::bInterfaceClass
uint8_t bInterfaceClass
Definition: usb_std.h:291
usb_interface_desc_type::bInterfaceSubClass
uint8_t bInterfaceSubClass
Definition: usb_std.h:292
usb_interface_desc_type::bLength
uint8_t bLength
Definition: usb_std.h:286
usb_interface_desc_type::iInterface
uint8_t iInterface
Definition: usb_std.h:294
usb_interface_desc_type::bDescriptorType
uint8_t bDescriptorType
Definition: usb_std.h:287
usb_std.h
usb standard header file
usbh_core.h
usb host core header file
usbh_ctrl.h
usb header file


AT32F415 Firmwary Library: usbh_ctrl.h Source File

  • middlewares
  • usb_drivers
  • inc
usbh_ctrl.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USBH_CTRL_H
29#define __USBH_CTRL_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35
36/* includes ------------------------------------------------------------------*/
37#include "usb_conf.h"
38#include "usbh_core.h"
39
52 usb_sts_type usbh_ctrl_send_setup(usbh_core_type *uhost, uint8_t *buffer, uint8_t hc_num);
53 usb_sts_type usbh_ctrl_recv_data(usbh_core_type *uhost, uint8_t *buffer,
54 uint8_t length, uint16_t hc_num);
55 usb_sts_type usbh_ctrl_send_data(usbh_core_type *uhost, uint8_t *buffer,
56 uint8_t length, uint16_t hc_num);
57 usb_sts_type usbh_ctrl_setup_handler(usbh_core_type *uhost);
58 usb_sts_type usbh_ctrl_setup_wait_handler(usbh_core_type *uhost, uint32_t *timeout);
59 usb_sts_type usbh_ctrl_data_in_handler(usbh_core_type *uhost);
60 usb_sts_type usbh_ctrl_data_in_wait_handler(usbh_core_type *uhost, uint32_t timeout);
61 usb_sts_type usbh_ctrl_data_out_handler(usbh_core_type *uhost);
62 usb_sts_type usbh_ctrl_data_out_wait_handler(usbh_core_type *uhost, uint32_t timeout);
63 usb_sts_type usbh_ctrl_status_in_handler(usbh_core_type *uhost);
64 usb_sts_type usbh_ctrl_status_in_wait_handler(usbh_core_type *uhost, uint32_t timeout);
65 usb_sts_type usbh_ctrl_status_out_handler(usbh_core_type *uhost);
66 usb_sts_type usbh_ctrl_status_out_wait_handler(usbh_core_type *uhost, uint32_t timeout);
67 usb_sts_type usbh_ctrl_error_handler(usbh_core_type *uhost);
68 usb_sts_type usbh_ctrl_stall_handler(usbh_core_type *uhost);
69 usb_sts_type usbh_ctrl_complete_handler(usbh_core_type *uhost);
70 usb_sts_type usbh_ctrl_transfer_loop(usbh_core_type *uhost);
71 usb_sts_type usbh_ctrl_request(usbh_core_type *uhost, uint8_t *buffer, uint16_t length);
72 usb_sts_type usbh_get_descriptor(usbh_core_type *uhost, uint16_t length,
73 uint8_t req_type, uint16_t wvalue,
74 uint8_t *buffer);
75void usbh_parse_dev_desc(usbh_core_type *uhost, uint8_t *buffer, uint16_t length);
76 usb_header_desc_type *usbh_get_next_header(uint8_t *buf, uint16_t *index_len);
77void usbh_parse_interface_desc(usb_interface_desc_type *intf, uint8_t *buf);
78void usbh_parse_endpoint_desc(usb_endpoint_desc_type *ept_desc, uint8_t *buf);
79 usb_sts_type usbh_parse_configure_desc(usbh_core_type *uhost,
80 uint8_t *buffer, uint16_t length);
81uint8_t usbh_find_interface(usbh_core_type *uhost, uint8_t class_code, uint8_t sub_class, uint8_t protocol);
82void usbh_parse_string_desc(uint8_t *src, uint8_t *dest, uint16_t length);
83 usb_sts_type usbh_get_device_descriptor(usbh_core_type *uhost, uint16_t length);
84 usb_sts_type usbh_get_configure_descriptor(usbh_core_type *uhost, uint16_t length);
85 usb_sts_type usbh_get_sting_descriptor(usbh_core_type *uhost, uint8_t string_id,
86 uint8_t *buffer, uint16_t length);
87 usb_sts_type usbh_set_configuration(usbh_core_type *uhost, uint16_t config);
88 usb_sts_type usbh_set_address(usbh_core_type *uhost, uint8_t address);
89 usb_sts_type usbh_set_interface(usbh_core_type *uhost, uint8_t ept_num, uint8_t altsetting);
90 usb_sts_type usbh_set_feature(usbh_core_type *uhost, uint8_t feature, uint16_t index);
91 usb_sts_type usbh_clear_dev_feature(usbh_core_type *uhost, uint8_t feature, uint16_t index);
92 usb_sts_type usbh_clear_ept_feature(usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num);
93
105#ifdef __cplusplus
106}
107#endif
108
109#endif
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
usbh_set_configuration
usb_sts_type usbh_set_configuration(usbh_core_type *uhost, uint16_t config)
usb host set configurtion
Definition: usbh_ctrl.c:776
usbh_ctrl_stall_handler
usb_sts_type usbh_ctrl_stall_handler(usbh_core_type *uhost)
usb host control stall handler
Definition: usbh_ctrl.c:381
usbh_get_next_header
usb_header_desc_type * usbh_get_next_header(uint8_t *buf, uint16_t *index_len)
usb host get next header
Definition: usbh_ctrl.c:554
usbh_ctrl_data_out_wait_handler
usb_sts_type usbh_ctrl_data_out_wait_handler(usbh_core_type *uhost, uint32_t timeout)
usb host control data out wait handler
Definition: usbh_ctrl.c:240
usbh_ctrl_data_in_handler
usb_sts_type usbh_ctrl_data_in_handler(usbh_core_type *uhost)
usb host control data in request handler
Definition: usbh_ctrl.c:178
usbh_ctrl_setup_handler
usb_sts_type usbh_ctrl_setup_handler(usbh_core_type *uhost)
usb host control setup request handler
Definition: usbh_ctrl.c:114
usbh_ctrl_transfer_loop
usb_sts_type usbh_ctrl_transfer_loop(usbh_core_type *uhost)
usb host control transfer loop function
Definition: usbh_ctrl.c:401
usbh_clear_dev_feature
usb_sts_type usbh_clear_dev_feature(usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host clear device feature
Definition: usbh_ctrl.c:864
usbh_get_device_descriptor
usb_sts_type usbh_get_device_descriptor(usbh_core_type *uhost, uint16_t length)
usb host get device descriptor
Definition: usbh_ctrl.c:711
usbh_ctrl_request
usb_sts_type usbh_ctrl_request(usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host control request
Definition: usbh_ctrl.c:472
usbh_parse_string_desc
void usbh_parse_string_desc(uint8_t *src, uint8_t *dest, uint16_t length)
usbh parse string descriptor
Definition: usbh_ctrl.c:687
usbh_get_descriptor
usb_sts_type usbh_get_descriptor(usbh_core_type *uhost, uint16_t length, uint8_t req_type, uint16_t wvalue, uint8_t *buffer)
usb host get device descriptor
Definition: usbh_ctrl.c:494
usbh_ctrl_send_data
usb_sts_type usbh_ctrl_send_data(usbh_core_type *uhost, uint8_t *buffer, uint8_t length, uint16_t hc_num)
usb host control send data packet
Definition: usbh_ctrl.c:87
usbh_parse_interface_desc
void usbh_parse_interface_desc(usb_interface_desc_type *intf, uint8_t *buf)
usb host parse interface descriptor
Definition: usbh_ctrl.c:567
usbh_ctrl_send_setup
usb_sts_type usbh_ctrl_send_setup(usbh_core_type *uhost, uint8_t *buffer, uint8_t hc_num)
usb host control send setup packet
Definition: usbh_ctrl.c:50
usbh_ctrl_data_out_handler
usb_sts_type usbh_ctrl_data_out_handler(usbh_core_type *uhost)
usb host control data out request handler
Definition: usbh_ctrl.c:221
usbh_ctrl_recv_data
usb_sts_type usbh_ctrl_recv_data(usbh_core_type *uhost, uint8_t *buffer, uint8_t length, uint16_t hc_num)
usb host control receive data from device
Definition: usbh_ctrl.c:68
usbh_find_interface
uint8_t usbh_find_interface(usbh_core_type *uhost, uint8_t class_code, uint8_t sub_class, uint8_t protocol)
usb host find interface
Definition: usbh_ctrl.c:662
usbh_clear_ept_feature
usb_sts_type usbh_clear_ept_feature(usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num)
usb host clear endpoint feature
Definition: usbh_ctrl.c:886
usbh_ctrl_status_in_wait_handler
usb_sts_type usbh_ctrl_status_in_wait_handler(usbh_core_type *uhost, uint32_t timeout)
usb host control status data in wait handler
Definition: usbh_ctrl.c:286
usbh_set_interface
usb_sts_type usbh_set_interface(usbh_core_type *uhost, uint8_t ept_num, uint8_t altsetting)
usb host set interface
Definition: usbh_ctrl.c:819
usbh_ctrl_error_handler
usb_sts_type usbh_ctrl_error_handler(usbh_core_type *uhost)
usb host control error handler
Definition: usbh_ctrl.c:358
usbh_parse_dev_desc
void usbh_parse_dev_desc(usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse device descriptor
Definition: usbh_ctrl.c:524
usbh_ctrl_status_in_handler
usb_sts_type usbh_ctrl_status_in_handler(usbh_core_type *uhost)
usb host control status data in handler
Definition: usbh_ctrl.c:269
usbh_ctrl_status_out_wait_handler
usb_sts_type usbh_ctrl_status_out_wait_handler(usbh_core_type *uhost, uint32_t timeout)
usb host control status data out wait handler
Definition: usbh_ctrl.c:329
usbh_parse_configure_desc
usb_sts_type usbh_parse_configure_desc(usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host parse configure descriptor
Definition: usbh_ctrl.c:603
usbh_ctrl_complete_handler
usb_sts_type usbh_ctrl_complete_handler(usbh_core_type *uhost)
usb host control complete handler
Definition: usbh_ctrl.c:391
usbh_get_configure_descriptor
usb_sts_type usbh_get_configure_descriptor(usbh_core_type *uhost, uint16_t length)
usb host get configure descriptor
Definition: usbh_ctrl.c:731
usbh_set_address
usb_sts_type usbh_set_address(usbh_core_type *uhost, uint8_t address)
usb host set device address
Definition: usbh_ctrl.c:797
usbh_parse_endpoint_desc
void usbh_parse_endpoint_desc(usb_endpoint_desc_type *ept_desc, uint8_t *buf)
usb host parse endpoint descriptor
Definition: usbh_ctrl.c:586
usbh_ctrl_status_out_handler
usb_sts_type usbh_ctrl_status_out_handler(usbh_core_type *uhost)
usb host control status data out wait handler
Definition: usbh_ctrl.c:312
usbh_get_sting_descriptor
usb_sts_type usbh_get_sting_descriptor(usbh_core_type *uhost, uint8_t string_id, uint8_t *buffer, uint16_t length)
usb host get string descriptor
Definition: usbh_ctrl.c:754
usbh_ctrl_data_in_wait_handler
usb_sts_type usbh_ctrl_data_in_wait_handler(usbh_core_type *uhost, uint32_t timeout)
usb host control data in wait handler
Definition: usbh_ctrl.c:195
usbh_set_feature
usb_sts_type usbh_set_feature(usbh_core_type *uhost, uint8_t feature, uint16_t index)
usb host set feature
Definition: usbh_ctrl.c:841
usbh_ctrl_setup_wait_handler
usb_sts_type usbh_ctrl_setup_wait_handler(usbh_core_type *uhost, uint32_t *timeout)
usb host control setup request wait handler
Definition: usbh_ctrl.c:128
usb_endpoint_desc_type
format of standard endpoint descriptor
Definition: usb_std.h:301
usb_header_desc_type
format of header
Definition: usb_std.h:314
usb_interface_desc_type
format of standard interface descriptor
Definition: usb_std.h:285
usbh_core.h
usb host core header file


AT32F415 Firmwary Library: usbh_hid_class.c Source File

  • middlewares
  • usbh_class
  • usbh_hid
usbh_hid_class.c
Go to the documentation of this file.
1
26 #include "usbh_hid_class.h"
27 #include "usb_conf.h"
28 #include "usbh_core.h"
29 #include "usbh_ctrl.h"
30 #include "usbh_hid_mouse.h"
31 #include "usbh_hid_keyboard.h"
32
46 usb_sts_type uhost_init_handler(void *uhost);
47 usb_sts_type uhost_reset_handler(void *uhost);
48 usb_sts_type uhost_request_handler(void *uhost);
49 usb_sts_type uhost_process_handler(void *uhost);
50
51 usbh_hid_type usbh_hid;
52 usbh_class_handler_type uhost_class_handler =
53 {
54 uhost_init_handler,
55 uhost_reset_handler,
56 uhost_request_handler,
57 uhost_process_handler,
58 &usbh_hid
59 };
60
66 usb_sts_type uhost_init_handler(void *uhost)
67{
68 usbh_core_type *puhost = (usbh_core_type *)uhost;
69 usb_sts_type status = USB_OK;
70 uint8_t hidx, eptidx = 0;
71 usbh_hid_type *phid = &usbh_hid;
72
73 puhost->class_handler->pdata = &usbh_hid;
74
75 /* get hid interface */
76 hidx = usbh_find_interface(puhost, USB_CLASS_CODE_HID, 0x01, 0xFF);
77 if(hidx == 0xFF)
78 {
79 USBH_DEBUG("Unsupport Device!");
80 return USB_NOT_SUPPORT;
81 }
82
83 /* get hid protocol */
84 phid->protocol = puhost->dev.cfg_desc.interface[hidx].interface.bInterfaceProtocol;
85
86 if(phid->protocol == USB_HID_MOUSE_PROTOCOL_CODE)
87 {
88 USBH_DEBUG("Mouse Device!");
89 }
90 else if(phid->protocol == USB_HID_KEYBOARD_PROTOCOL_CODE)
91 {
92 USBH_DEBUG("Keyboard Device!");
93 }
94
95 for(eptidx = 0; eptidx < puhost->dev.cfg_desc.interface[hidx].interface.bNumEndpoints; eptidx ++)
96 {
97 if(puhost->dev.cfg_desc.interface[hidx].endpoint[eptidx].bEndpointAddress & 0x80)
98 {
99 /* find interface out endpoint information */
100 phid->eptin = puhost->dev.cfg_desc.interface[hidx].endpoint[eptidx].bEndpointAddress;
101 phid->in_maxpacket = puhost->dev.cfg_desc.interface[hidx].endpoint[eptidx].wMaxPacketSize;
102 phid->in_poll = puhost->dev.cfg_desc.interface[hidx].endpoint[eptidx].bInterval;
103
104 phid->chin = usbh_alloc_channel(puhost, phid->eptin);
105 /* enable channel */
106 usbh_hc_open(puhost, phid->chin,phid->eptin,
107 puhost->dev.address, EPT_INT_TYPE,
108 phid->in_maxpacket,
109 puhost->dev.speed);
110 }
111 else
112 {
113 /* get interface out endpoint information */
114 phid->eptout = puhost->dev.cfg_desc.interface[hidx].endpoint[eptidx].bEndpointAddress;
115 phid->out_maxpacket = puhost->dev.cfg_desc.interface[hidx].endpoint[eptidx].wMaxPacketSize;
116 phid->out_poll = puhost->dev.cfg_desc.interface[hidx].endpoint[eptidx].bInterval;
117
118 phid->chout = usbh_alloc_channel(puhost, usbh_hid.eptout);
119 /* enable channel */
120 usbh_hc_open(puhost, phid->chout, phid->eptout,
121 puhost->dev.address, EPT_INT_TYPE,
122 phid->out_maxpacket,
123 puhost->dev.speed);
124 }
125 }
126 phid->ctrl_state = USB_HID_STATE_IDLE;
127 return status;
128}
129
135 usb_sts_type uhost_reset_handler(void *uhost)
136{
137 usbh_core_type *puhost = (usbh_core_type *)uhost;
138 usbh_hid_type *phid = (usbh_hid_type *)puhost->class_handler->pdata;
139 usb_sts_type status = USB_OK;
140 if(puhost->class_handler->pdata == NULL)
141 {
142 return status;
143 }
144
145 if(phid->chin != 0)
146 {
147 /* free in channel */
148 usbh_free_channel(puhost, phid->chin);
149 usbh_ch_disable(puhost, phid->chin);
150 phid->chin = 0;
151 }
152
153 if(phid->chout != 0)
154 {
155 /* free out channel */
156 usbh_free_channel(puhost, phid->chout);
157 usbh_ch_disable(puhost, phid->chout);
158 phid->chout = 0;
159 }
160
161 return status;
162}
163
170 usb_sts_type usbh_hid_get_desc(void *uhost, uint16_t length)
171{
172 usbh_core_type *puhost = (usbh_core_type *)uhost;
173 usbh_hid_type *phid = (usbh_hid_type *)puhost->class_handler->pdata;
174 usb_sts_type status = USB_WAIT;
175 uint8_t bm_req;
176 uint16_t wvalue;
177 if(puhost->ctrl.state == CONTROL_IDLE)
178 {
179 bm_req = USB_REQ_RECIPIENT_INTERFACE | USB_REQ_TYPE_STANDARD;
180 wvalue = (0x21 << 8) & 0xFF00;
181
182 usbh_get_descriptor(puhost, length, bm_req,
183 wvalue, puhost->rx_buffer);
184 }
185 else
186 {
187 if(usbh_ctrl_result_check(puhost, CONTROL_IDLE, ENUM_IDLE) == USB_OK)
188 {
189 phid->hid_desc.bLength = puhost->rx_buffer[0];
190 phid->hid_desc.bDescriptorType = puhost->rx_buffer[1];
191 phid->hid_desc.bcdHID = SWAPBYTE(puhost->rx_buffer+2);
192 phid->hid_desc.bCountryCode = puhost->rx_buffer[4];
193 phid->hid_desc.bNumDescriptors = puhost->rx_buffer[5];
194 phid->hid_desc.bReportDescriptorType = puhost->rx_buffer[6];
195 phid->hid_desc.wItemLength = SWAPBYTE(puhost->rx_buffer+7);
196 status = USB_OK;
197 }
198 }
199 return status;
200}
201
202
209 usb_sts_type usbh_hid_get_report(void *uhost, uint16_t length)
210{
211 usbh_core_type *puhost = (usbh_core_type *)uhost;
212 usb_sts_type status = USB_WAIT;
213 uint8_t bm_req;
214 uint16_t wvalue;
215 if(puhost->ctrl.state == CONTROL_IDLE)
216 {
217 bm_req = USB_REQ_RECIPIENT_INTERFACE | USB_REQ_TYPE_STANDARD;
218 wvalue = (0x22 << 8) & 0xFF00;
219
220 usbh_get_descriptor(puhost, length, bm_req,
221 wvalue, puhost->rx_buffer);
222 }
223 else
224 {
225 if(usbh_ctrl_result_check(puhost, CONTROL_IDLE, ENUM_IDLE) == USB_OK)
226 {
227 status = USB_OK;
228 }
229 }
230 return status;
231}
232
240 usb_sts_type usbh_hid_set_idle(void *uhost, uint8_t id, uint8_t dr)
241{
242 usbh_core_type *puhost = (usbh_core_type *)uhost;
243 usb_sts_type status = USB_WAIT;
244 if(puhost->ctrl.state == CONTROL_IDLE)
245 {
246 puhost->ctrl.setup.bmRequestType = USB_DIR_H2D | USB_REQ_RECIPIENT_INTERFACE | USB_REQ_TYPE_CLASS;
247 puhost->ctrl.setup.bRequest = USB_HID_SET_IDLE;
248 puhost->ctrl.setup.wValue = (dr << 8) | id;
249 puhost->ctrl.setup.wIndex = 0;
250 puhost->ctrl.setup.wLength = 0;
251 usbh_ctrl_request(puhost, 0, 0);
252 }
253 else
254 {
255 status = usbh_ctrl_result_check(puhost, CONTROL_IDLE, ENUM_IDLE);
256 if(status == USB_OK || status == USB_NOT_SUPPORT)
257 {
258 status = USB_OK;
259 }
260 }
261 return status;
262}
263
270 usb_sts_type usbh_hid_set_protocol(void *uhost, uint8_t protocol)
271{
272 usbh_core_type *puhost = (usbh_core_type *)uhost;
273 usb_sts_type status = USB_WAIT;
274 if(puhost->ctrl.state == CONTROL_IDLE)
275 {
276 puhost->ctrl.setup.bmRequestType = USB_DIR_H2D | USB_REQ_RECIPIENT_INTERFACE | USB_REQ_TYPE_CLASS;
277 puhost->ctrl.setup.bRequest = USB_HID_SET_PROTOCOL;
278 puhost->ctrl.setup.wValue = protocol;
279 puhost->ctrl.setup.wIndex = 0;
280 puhost->ctrl.setup.wLength = 0;
281 usbh_ctrl_request(puhost, 0, 0);
282 }
283 else
284 {
285 status = usbh_ctrl_result_check(puhost, CONTROL_IDLE, ENUM_IDLE);
286 if(status == USB_OK || status == USB_NOT_SUPPORT)
287 {
288 status = USB_OK;
289 }
290 }
291 return status;
292}
293
301 usb_sts_type usbh_clear_endpoint_feature(usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num)
302{
303 usb_sts_type status = USB_WAIT;
304 usbh_core_type *puhost = (usbh_core_type *)uhost;
305 uint8_t bm_req;
306 bm_req = USB_REQ_RECIPIENT_ENDPOINT | USB_REQ_TYPE_STANDARD;
307 if(puhost->ctrl.state == CONTROL_IDLE)
308 {
309 puhost->ctrl.setup.bmRequestType = USB_DIR_H2D | bm_req;
310 puhost->ctrl.setup.bRequest = USB_STD_REQ_CLEAR_FEATURE;
311 puhost->ctrl.setup.wValue = 0x00;
312 puhost->ctrl.setup.wLength = 0;
313 puhost->ctrl.setup.wIndex = ept_num;
314 if((ept_num & 0x80) == USB_DIR_D2H)
315 {
316 puhost->hch[hc_num].toggle_in = 0;
317 }
318 else
319 {
320 puhost->hch[hc_num].toggle_out = 0;
321 }
322 status = usbh_ctrl_request(puhost, 0, 0);
323 }
324 if(usbh_ctrl_result_check(puhost, CONTROL_IDLE, ENUM_IDLE) == USB_OK)
325 {
326 status = USB_OK;
327 }
328 return status;
329}
330
336 usb_sts_type uhost_request_handler(void *uhost)
337{
338 usb_sts_type status = USB_WAIT;
339 usbh_core_type *puhost = (usbh_core_type *)uhost;
340 usbh_hid_type *phid = (usbh_hid_type *)puhost->class_handler->pdata;
341
342 switch(phid->ctrl_state)
343 {
344 case USB_HID_STATE_IDLE:
345 phid->ctrl_state = USB_HID_STATE_GET_DESC;
346 break;
347 case USB_HID_STATE_GET_DESC:
348 if(usbh_hid_get_desc(puhost, 9) == USB_OK)
349 {
350 phid->ctrl_state = USB_HID_STATE_GET_REPORT;
351 }
352 break;
353 case USB_HID_STATE_GET_REPORT:
354 if(usbh_hid_get_report(puhost, phid->hid_desc.wItemLength) == USB_OK)
355 {
356 phid->ctrl_state = USB_HID_STATE_SET_IDLE;
357 }
358 break;
359 case USB_HID_STATE_SET_IDLE:
360 if(usbh_hid_set_idle(puhost, 0, 0) == USB_OK)
361 {
362 phid->ctrl_state = USB_HID_STATE_SET_PROTOCOL;
363 }
364 break;
365 case USB_HID_STATE_SET_PROTOCOL:
366 if(usbh_hid_set_protocol(puhost, 0) == USB_OK)
367 {
368 phid->ctrl_state = USB_HID_STATE_COMPLETE;
369 }
370 break;
371 case USB_HID_STATE_COMPLETE:
372 phid->state = USB_HID_INIT;
373 status = USB_OK;
374 break;
375 default:
376 break;
377 }
378
379 return status;
380}
381
387 usb_sts_type uhost_process_handler(void *uhost)
388{
389 usbh_core_type *puhost = (usbh_core_type *)uhost;
390 usbh_hid_type *phid = (usbh_hid_type *)puhost->class_handler->pdata;
391 urb_sts_type urb_status;
392 switch(phid->state)
393 {
394 case USB_HID_INIT:
395 phid->state = USB_HID_GET;
396 break;
397
398 case USB_HID_GET:
399 usbh_interrupt_recv(puhost, phid->chin, (uint8_t *)phid->buffer, phid->in_maxpacket);
400 phid->state = USB_HID_POLL;
401 phid->poll_timer = usbh_get_frame(puhost->usb_reg);
402 break;
403
404 case USB_HID_POLL:
405 if((usbh_get_frame(puhost->usb_reg) - phid->poll_timer) >= phid->in_poll )
406 {
407 phid->state = USB_HID_GET;
408 }
409 else
410 {
411 urb_status = usbh_get_urb_status(puhost, phid->chin);
412 if(urb_status == URB_DONE)
413 {
414 puhost->urb_state[phid->chin] = URB_IDLE;
415 if(phid->protocol == USB_HID_MOUSE_PROTOCOL_CODE)
416 {
417 usbh_hid_mouse_decode((uint8_t *)phid->buffer);
418 }
419 else if(phid->protocol == USB_HID_KEYBOARD_PROTOCOL_CODE)
420 {
421 usbh_hid_keyboard_decode((uint8_t *)phid->buffer);
422 }
423
424 }
425 else if(urb_status == URB_STALL)
426 {
427 if(usbh_clear_endpoint_feature(puhost, phid->eptin, phid->chin) == USB_OK)
428 {
429 phid->state = USB_HID_GET;
430 }
431 }
432 }
433 break;
434
435 default:
436 break;
437 }
438 return USB_OK;
439}
440
USBH_DEBUG
#define USBH_DEBUG(...)
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:152
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
EPT_INT_TYPE
@ EPT_INT_TYPE
Definition: at32f415_usb.h:349
usbh_get_frame
uint32_t usbh_get_frame(otg_global_type *usbx)
get current frame number
Definition: at32f415_usb.c:863
USB_STD_REQ_CLEAR_FEATURE
#define USB_STD_REQ_CLEAR_FEATURE
Definition: usb_std.h:78
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
SWAPBYTE
#define SWAPBYTE(addr)
usb swap address
Definition: usb_std.h:197
USB_CLASS_CODE_HID
#define USB_CLASS_CODE_HID
Definition: usb_std.h:163
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_REQ_RECIPIENT_ENDPOINT
#define USB_REQ_RECIPIENT_ENDPOINT
Definition: usb_std.h:56
USB_REQ_RECIPIENT_INTERFACE
#define USB_REQ_RECIPIENT_INTERFACE
Definition: usb_std.h:55
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usb_std.h:64
USB_OK
@ USB_OK
Definition: usb_std.h:218
USB_WAIT
@ USB_WAIT
Definition: usb_std.h:220
USB_NOT_SUPPORT
@ USB_NOT_SUPPORT
Definition: usb_std.h:221
usbh_interrupt_recv
usb_sts_type usbh_interrupt_recv(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host interrupt receive request
Definition: usbh_core.c:216
usbh_free_channel
void usbh_free_channel(usbh_core_type *uhost, uint8_t index)
usb host free channel
Definition: usbh_core.c:57
usbh_ctrl_result_check
usb_sts_type usbh_ctrl_result_check(usbh_core_type *uhost, ctrl_ept0_sts_type next_ctrl_state, uint8_t next_enum_state)
usb wait control setup complete
Definition: usbh_core.c:716
usbh_hc_open
void usbh_hc_open(usbh_core_type *uhost, uint8_t chn, uint8_t ept_num, uint8_t dev_address, uint8_t type, uint8_t maxpacket, uint8_t speed)
usb host open channel
Definition: usbh_core.c:630
usbh_alloc_channel
uint16_t usbh_alloc_channel(usbh_core_type *uhost, uint8_t ept_addr)
usb host alloc channel
Definition: usbh_core.c:686
usbh_ch_disable
void usbh_ch_disable(usbh_core_type *uhost, uint8_t chn)
disable host channel
Definition: usbh_core.c:675
usbh_get_urb_status
urb_sts_type usbh_get_urb_status(usbh_core_type *uhost, uint8_t ch_num)
usb host get urb status
Definition: usbh_core.c:705
usbh_ctrl_request
usb_sts_type usbh_ctrl_request(usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host control request
Definition: usbh_ctrl.c:472
usbh_get_descriptor
usb_sts_type usbh_get_descriptor(usbh_core_type *uhost, uint16_t length, uint8_t req_type, uint16_t wvalue, uint8_t *buffer)
usb host get device descriptor
Definition: usbh_ctrl.c:494
usbh_find_interface
uint8_t usbh_find_interface(usbh_core_type *uhost, uint8_t class_code, uint8_t sub_class, uint8_t protocol)
usb host find interface
Definition: usbh_ctrl.c:662
USB_HID_SET_IDLE
#define USB_HID_SET_IDLE
Definition: usbh_hid_class.h:63
USB_HID_SET_PROTOCOL
#define USB_HID_SET_PROTOCOL
Definition: usbh_hid_class.h:64
USB_HID_MOUSE_PROTOCOL_CODE
#define USB_HID_MOUSE_PROTOCOL_CODE
Definition: usbh_hid_class.h:54
USB_HID_KEYBOARD_PROTOCOL_CODE
#define USB_HID_KEYBOARD_PROTOCOL_CODE
Definition: usbh_hid_class.h:53
USB_HID_STATE_COMPLETE
@ USB_HID_STATE_COMPLETE
Definition: usbh_hid_class.h:76
USB_HID_STATE_GET_REPORT
@ USB_HID_STATE_GET_REPORT
Definition: usbh_hid_class.h:73
USB_HID_STATE_SET_IDLE
@ USB_HID_STATE_SET_IDLE
Definition: usbh_hid_class.h:74
USB_HID_STATE_SET_PROTOCOL
@ USB_HID_STATE_SET_PROTOCOL
Definition: usbh_hid_class.h:75
USB_HID_STATE_GET_DESC
@ USB_HID_STATE_GET_DESC
Definition: usbh_hid_class.h:72
USB_HID_STATE_IDLE
@ USB_HID_STATE_IDLE
Definition: usbh_hid_class.h:71
USB_HID_GET
@ USB_HID_GET
Definition: usbh_hid_class.h:85
USB_HID_INIT
@ USB_HID_INIT
Definition: usbh_hid_class.h:84
USB_HID_POLL
@ USB_HID_POLL
Definition: usbh_hid_class.h:87
usbh_hid_keyboard_decode
void usbh_hid_keyboard_decode(uint8_t *data)
usb host hid keyboard decode
Definition: usbh_hid_keyboard.c:145
usbh_hid_mouse_decode
void usbh_hid_mouse_decode(uint8_t *mouse_data)
usb host hid mouse decode
Definition: usbh_hid_mouse.c:167
uhost_process_handler
usb_sts_type uhost_process_handler(void *uhost)
usb host hid class process handler
Definition: usbh_hid_class.c:387
usbh_hid_set_protocol
usb_sts_type usbh_hid_set_protocol(void *uhost, uint8_t protocol)
usb host hid class set protocol
Definition: usbh_hid_class.c:270
usbh_hid
usbh_hid_type usbh_hid
Definition: usbh_hid_class.c:51
usbh_hid_set_idle
usb_sts_type usbh_hid_set_idle(void *uhost, uint8_t id, uint8_t dr)
usb host hid class set idle
Definition: usbh_hid_class.c:240
usbh_clear_endpoint_feature
usb_sts_type usbh_clear_endpoint_feature(usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num)
usb host clear feature
Definition: usbh_hid_class.c:301
uhost_init_handler
usb_sts_type uhost_init_handler(void *uhost)
usb host class init handler
Definition: usbh_hid_class.c:66
uhost_class_handler
usbh_class_handler_type uhost_class_handler
Definition: usbh_hid_class.c:52
usbh_hid_get_report
usb_sts_type usbh_hid_get_report(void *uhost, uint16_t length)
usb host hid class get report
Definition: usbh_hid_class.c:209
uhost_request_handler
usb_sts_type uhost_request_handler(void *uhost)
usb host hid class request handler
Definition: usbh_hid_class.c:336
usbh_hid_get_desc
usb_sts_type usbh_hid_get_desc(void *uhost, uint16_t length)
usb host hid class get descriptor
Definition: usbh_hid_class.c:170
uhost_reset_handler
usb_sts_type uhost_reset_handler(void *uhost)
usb host class reset handler
Definition: usbh_hid_class.c:135
usb_hid_desc_type::bCountryCode
uint8_t bCountryCode
Definition: usbh_hid_class.h:100
usb_hid_desc_type::bNumDescriptors
uint8_t bNumDescriptors
Definition: usbh_hid_class.h:101
usb_hid_desc_type::wItemLength
uint16_t wItemLength
Definition: usbh_hid_class.h:103
usb_hid_desc_type::bReportDescriptorType
uint8_t bReportDescriptorType
Definition: usbh_hid_class.h:102
usb_hid_desc_type::bLength
uint8_t bLength
Definition: usbh_hid_class.h:97
usb_hid_desc_type::bcdHID
uint16_t bcdHID
Definition: usbh_hid_class.h:99
usb_hid_desc_type::bDescriptorType
uint8_t bDescriptorType
Definition: usbh_hid_class.h:98
usbh_hid_type
usb hid struct
Definition: usbh_hid_class.h:110
usbh_hid_type::eptout
uint8_t eptout
Definition: usbh_hid_class.h:117
usbh_hid_type::out_maxpacket
uint16_t out_maxpacket
Definition: usbh_hid_class.h:118
usbh_hid_type::in_maxpacket
uint16_t in_maxpacket
Definition: usbh_hid_class.h:113
usbh_hid_type::state
usb_hid_state_type state
Definition: usbh_hid_class.h:125
usbh_hid_type::out_poll
uint8_t out_poll
Definition: usbh_hid_class.h:119
usbh_hid_type::protocol
uint8_t protocol
Definition: usbh_hid_class.h:120
usbh_hid_type::eptin
uint8_t eptin
Definition: usbh_hid_class.h:112
usbh_hid_type::ctrl_state
usb_hid_ctrl_state_type ctrl_state
Definition: usbh_hid_class.h:124
usbh_hid_type::in_poll
uint8_t in_poll
Definition: usbh_hid_class.h:114
usbh_hid_type::hid_desc
usb_hid_desc_type hid_desc
Definition: usbh_hid_class.h:123
usbh_hid_type::chin
uint8_t chin
Definition: usbh_hid_class.h:111
usbh_hid_type::buffer
uint32_t buffer[16]
Definition: usbh_hid_class.h:127
usbh_hid_type::poll_timer
uint16_t poll_timer
Definition: usbh_hid_class.h:126
usbh_hid_type::chout
uint8_t chout
Definition: usbh_hid_class.h:116
usbh_core.h
usb host core header file
usbh_ctrl.h
usb header file
usbh_hid_class.h
usb host hid class header file
usbh_hid_keyboard.h
usb host hid keyboard header file
usbh_hid_mouse.h
usb host hid mouse header file


AT32F415 Firmwary Library: usbh_hid_class.h Source File

  • middlewares
  • usbh_class
  • usbh_hid
usbh_hid_class.h
Go to the documentation of this file.
1
26/* Define to prevent recursive inclusion -------------------------------------*/
27#ifndef __USBH_HID_CLASS_H
28#define __USBH_HID_CLASS_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "usbh_core.h"
35#include "usb_conf.h"
36
52#define USB_HID_NONE_PROTOCOL_CODE 0x00
53#define USB_HID_KEYBOARD_PROTOCOL_CODE 0x01
54#define USB_HID_MOUSE_PROTOCOL_CODE 0x02
55
59#define USB_HID_GET_REPORT 0x01
60#define USB_HID_GET_IDLE 0x02
61#define USB_HID_GET_PROTOCOL 0x03
62#define USB_HID_SET_REPORT 0x09
63#define USB_HID_SET_IDLE 0x0A
64#define USB_HID_SET_PROTOCOL 0x0B
65
69typedef enum
70{
71 USB_HID_STATE_IDLE,
72 USB_HID_STATE_GET_DESC,
73 USB_HID_STATE_GET_REPORT,
74 USB_HID_STATE_SET_IDLE,
75 USB_HID_STATE_SET_PROTOCOL,
76 USB_HID_STATE_COMPLETE,
77}usb_hid_ctrl_state_type;
78
82typedef enum
83{
84 USB_HID_INIT,
85 USB_HID_GET,
86 USB_HID_SEND,
87 USB_HID_POLL,
88 USB_HID_BUSY,
89 USB_HID_ERROR,
90}usb_hid_state_type;
91
95typedef struct
96{
97 uint8_t bLength;
98 uint8_t bDescriptorType;
99 uint16_t bcdHID;
100 uint8_t bCountryCode;
101 uint8_t bNumDescriptors;
102 uint8_t bReportDescriptorType;
103 uint16_t wItemLength;
104}usb_hid_desc_type;
105
109typedef struct
110{
111 uint8_t chin;
112 uint8_t eptin;
113 uint16_t in_maxpacket;
114 uint8_t in_poll;
115
116 uint8_t chout;
117 uint8_t eptout;
118 uint16_t out_maxpacket;
119 uint8_t out_poll;
120 uint8_t protocol;
121
122
123 usb_hid_desc_type hid_desc;
124 usb_hid_ctrl_state_type ctrl_state;
125 usb_hid_state_type state;
126 uint16_t poll_timer;
127 uint32_t buffer[16];
128}usbh_hid_type;
129
130extern usbh_class_handler_type uhost_class_handler;
131
132
144#ifdef __cplusplus
145}
146#endif
147
148#endif
usb_hid_ctrl_state_type
usb_hid_ctrl_state_type
usb hid request state
Definition: usbh_hid_class.h:70
uhost_class_handler
usbh_class_handler_type uhost_class_handler
Definition: usbh_hid_class.c:52
usb_hid_state_type
usb_hid_state_type
usb hid process state
Definition: usbh_hid_class.h:83
USB_HID_STATE_COMPLETE
@ USB_HID_STATE_COMPLETE
Definition: usbh_hid_class.h:76
USB_HID_STATE_GET_REPORT
@ USB_HID_STATE_GET_REPORT
Definition: usbh_hid_class.h:73
USB_HID_STATE_SET_IDLE
@ USB_HID_STATE_SET_IDLE
Definition: usbh_hid_class.h:74
USB_HID_STATE_SET_PROTOCOL
@ USB_HID_STATE_SET_PROTOCOL
Definition: usbh_hid_class.h:75
USB_HID_STATE_GET_DESC
@ USB_HID_STATE_GET_DESC
Definition: usbh_hid_class.h:72
USB_HID_STATE_IDLE
@ USB_HID_STATE_IDLE
Definition: usbh_hid_class.h:71
USB_HID_GET
@ USB_HID_GET
Definition: usbh_hid_class.h:85
USB_HID_ERROR
@ USB_HID_ERROR
Definition: usbh_hid_class.h:89
USB_HID_SEND
@ USB_HID_SEND
Definition: usbh_hid_class.h:86
USB_HID_INIT
@ USB_HID_INIT
Definition: usbh_hid_class.h:84
USB_HID_POLL
@ USB_HID_POLL
Definition: usbh_hid_class.h:87
USB_HID_BUSY
@ USB_HID_BUSY
Definition: usbh_hid_class.h:88
usb_hid_desc_type
usb hid descriptor type
Definition: usbh_hid_class.h:96
usb_hid_desc_type::bCountryCode
uint8_t bCountryCode
Definition: usbh_hid_class.h:100
usb_hid_desc_type::bNumDescriptors
uint8_t bNumDescriptors
Definition: usbh_hid_class.h:101
usb_hid_desc_type::wItemLength
uint16_t wItemLength
Definition: usbh_hid_class.h:103
usb_hid_desc_type::bReportDescriptorType
uint8_t bReportDescriptorType
Definition: usbh_hid_class.h:102
usb_hid_desc_type::bLength
uint8_t bLength
Definition: usbh_hid_class.h:97
usb_hid_desc_type::bcdHID
uint16_t bcdHID
Definition: usbh_hid_class.h:99
usb_hid_desc_type::bDescriptorType
uint8_t bDescriptorType
Definition: usbh_hid_class.h:98
usbh_hid_type
usb hid struct
Definition: usbh_hid_class.h:110
usbh_hid_type::eptout
uint8_t eptout
Definition: usbh_hid_class.h:117
usbh_hid_type::out_maxpacket
uint16_t out_maxpacket
Definition: usbh_hid_class.h:118
usbh_hid_type::in_maxpacket
uint16_t in_maxpacket
Definition: usbh_hid_class.h:113
usbh_hid_type::state
usb_hid_state_type state
Definition: usbh_hid_class.h:125
usbh_hid_type::out_poll
uint8_t out_poll
Definition: usbh_hid_class.h:119
usbh_hid_type::protocol
uint8_t protocol
Definition: usbh_hid_class.h:120
usbh_hid_type::eptin
uint8_t eptin
Definition: usbh_hid_class.h:112
usbh_hid_type::ctrl_state
usb_hid_ctrl_state_type ctrl_state
Definition: usbh_hid_class.h:124
usbh_hid_type::in_poll
uint8_t in_poll
Definition: usbh_hid_class.h:114
usbh_hid_type::hid_desc
usb_hid_desc_type hid_desc
Definition: usbh_hid_class.h:123
usbh_hid_type::chin
uint8_t chin
Definition: usbh_hid_class.h:111
usbh_hid_type::poll_timer
uint16_t poll_timer
Definition: usbh_hid_class.h:126
usbh_hid_type::chout
uint8_t chout
Definition: usbh_hid_class.h:116
usbh_core.h
usb host core header file


AT32F415 Firmwary Library: usbh_hid_keyboard.c Source File

  • middlewares
  • usbh_class
  • usbh_hid
usbh_hid_keyboard.c
Go to the documentation of this file.
1
26 #include "usbh_hid_keyboard.h"
27
41static const uint8_t hid_keyboard_codes[] =
42{
43 0, 0, 0, 0, 31, 50, 48, 33,
44 19, 34, 35, 36, 24, 37, 38, 39,
45 52, 51, 25, 26, 17, 20, 32, 21,
46 23, 49, 18, 47, 22, 46, 2, 3,
47 4, 5, 6, 7, 8, 9, 10, 11,
48 43, 110, 15, 16, 61, 12, 13, 27,
49 28, 29, 42, 40, 41, 1, 53, 54,
50 55, 30, 112, 113, 114, 115, 116, 117,
51 118, 119, 120, 121, 122, 123, 124, 125,
52 126, 75, 80, 85, 76, 81, 86, 89,
53 79, 84, 83, 90, 95, 100, 105, 106,
54 108, 93, 98, 103, 92, 97, 102, 91,
55 96, 101, 99, 104, 45, 129, 0, 0,
56 0, 0, 0, 0, 0, 0, 0, 0,
57 0, 0, 0, 0, 0, 0, 0, 0,
58 0, 0, 0, 0, 0, 0, 0, 0,
59 0, 0, 0, 0, 0, 107, 0, 56,
60 0, 0, 0, 0, 0, 0, 0, 0,
61 0, 0, 0, 0, 0, 0, 0, 0,
62 0, 0, 0, 0, 0, 0, 0, 0,
63 0, 0, 0, 0, 0, 0, 0, 0,
64 0, 0, 0, 0, 0, 0, 0, 0,
65 0, 0, 0, 0, 0, 0, 0, 0,
66 0, 0, 0, 0, 0, 0, 0, 0,
67 0, 0, 0, 0, 0, 0, 0, 0,
68 0, 0, 0, 0, 0, 0, 0, 0,
69 0, 0, 0, 0, 0, 0, 0, 0,
70 0, 0, 0, 0, 0, 0, 0, 0,
71 58, 44, 60, 127, 64, 57, 62, 128,
72};
73
74#ifdef QWERTY_KEYBOARD
75
76static const int8_t hid_keyboard_key[] = {
77 '\0', '`', '1', '2', '3', '4', '5', '6',
78 '7', '8', '9', '0', '-', '=', '\0', '\r',
79 '\t', 'q', 'w', 'e', 'r', 't', 'y', 'u',
80 'i', 'o', 'p', '[', ']', '\\',
81 '\0', 'a', 's', 'd', 'f', 'g', 'h', 'j',
82 'k', 'l', ';', '\'', '\0', '\n',
83 '\0', '\0', 'z', 'x', 'c', 'v', 'b', 'n',
84 'm', ',', '.', '/', '\0', '\0',
85 '\0', '\0', '\0', ' ', '\0', '\0', '\0', '\0',
86 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
87 '\0', '\0', '\0', '\0', '\0', '\r', '\0', '\0',
88 '\0', '\0', '\0', '\0', '\0', '\0',
89 '\0', '\0', '7', '4', '1',
90 '\0', '/', '8', '5', '2',
91 '0', '*', '9', '6', '3',
92 '.', '-', '+', '\0', '\n', '\0', '\0', '\0', '\0', '\0', '\0',
93 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
94 '\0', '\0', '\0', '\0'
95};
96
97static const int8_t hid_keyboard_key_shift[] = {
98 '\0', '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')',
99 '_', '+', '\0', '\0', '\0', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U',
100 'I', 'O', 'P', '{', '}', '|', '\0', 'A', 'S', 'D', 'F', 'G',
101 'H', 'J', 'K', 'L', ':', '"', '\0', '\n', '\0', '\0', 'Z', 'X',
102 'C', 'V', 'B', 'N', 'M', '<', '>', '?', '\0', '\0', '\0', '\0',
103 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
104 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
105 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
106 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
107 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
108 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'
109};
110
111#else
112static const int8_t hid_keyboard_key[] = {
113 '\0', '`', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
114 '-', '=', '\0', '\r', '\t', 'a', 'z', 'e', 'r', 't', 'y', 'u',
115 'i', 'o', 'p', '[', ']', '\\', '\0', 'q', 's', 'd', 'f', 'g',
116 'h', 'j', 'k', 'l', 'm', '\0', '\0', '\n', '\0', '\0', 'w', 'x',
117 'c', 'v', 'b', 'n', ',', ';', ':', '!', '\0', '\0', '\0', '\0',
118 '\0', ' ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
119 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\r', '\0', '\0', '\0',
120 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '7', '4', '1','\0', '/',
121 '8', '5', '2', '0', '*', '9', '6', '3', '.', '-', '+', '\0',
122 '\n', '\0', '\0', '\0', '\0', '\0', '\0','\0', '\0', '\0', '\0', '\0', '\0',
123 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'
124};
125
126static const int8_t hid_keyboard_key_shift[] = {
127 '\0', '~', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_',
128 '+', '\0', '\0', '\0', 'A', 'Z', 'E', 'R', 'T', 'Y', 'U', 'I', 'O',
129 'P', '{', '}', '*', '\0', 'Q', 'S', 'D', 'F', 'G', 'H', 'J', 'K',
130 'L', 'M', '%', '\0', '\n', '\0', '\0', 'W', 'X', 'C', 'V', 'B', 'N',
131 '?', '.', '/', '\0', '\0', '\0','\0', '\0', '\0', '\0', '\0', '\0', '\0',
132 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
133 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
134 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
135 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
136 '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'
137};
138#endif
139
145void usbh_hid_keyboard_decode(uint8_t *data)
146{
147 static uint8_t shift;
148 static uint8_t keys[KEYBOARD_MAX_NB_PRESSED];
149 static uint8_t keys_n[KEYBOARD_MAX_NB_PRESSED];
150 static uint8_t keys_l[KEYBOARD_MAX_NB_PRESSED];
151 static uint8_t key_newest;
152 static uint8_t nb_keys;
153 static uint8_t nb_keys_n;
154 static uint8_t nb_keys_l;
155
156 uint8_t idx;
157 uint8_t idy;
158 uint8_t err;
159 uint8_t out;
160
161 nb_keys = 0;
162 nb_keys_n = 0;
163 nb_keys_l = 0;
164 key_newest = 0;
165
166 if(data[0] == KEYBOARD_LEFT_SHIFT || data[0] == KEYBOARD_RIGHT_SHIFT)
167 {
168 shift = TRUE;
169 }
170 else
171 {
172 shift = FALSE;
173 }
174 err = FALSE;
175
176 for(idx = 2; idx < 2 + KEYBOARD_MAX_NB_PRESSED; idx ++)
177 {
178 if((data[idx] == 0x01) ||
179 (data[idx] == 0x02) ||
180 (data[idx] == 0x03))
181 {
182 err = TRUE;
183 }
184 }
185
186 if(err == TRUE)
187 {
188 return;
189 }
190
191 nb_keys = 0;
192 nb_keys_n = 0;
193 for(idx = 2; idx < 2 + KEYBOARD_MAX_NB_PRESSED; idx ++)
194 {
195 if(data[idx] != 0)
196 {
197 keys[nb_keys] = data[idx];
198 nb_keys ++;
199 for(idy = 0; idy < nb_keys_l; idy ++)
200 {
201 if(data[idx] == keys_l[idy])
202 {
203 break;
204 }
205 }
206
207 if(idy == nb_keys_l)
208 {
209 keys_n[nb_keys_n] = data[idx];
210 nb_keys_n ++;
211 }
212
213 }
214 }
215
216 if(nb_keys_n == 1)
217 {
218 key_newest = keys_n[0];
219
220 if(shift == TRUE)
221 {
222 out = hid_keyboard_key_shift[hid_keyboard_codes[key_newest]];
223 }
224 else
225 {
226 out = hid_keyboard_key[hid_keyboard_codes[key_newest]];
227 }
228 /* callback user handler */
229 USBH_DEBUG("%c", out);
230 }
231 else
232 {
233 key_newest = 0;
234 }
235
236 nb_keys_l = nb_keys;
237 for(idx = 0; idx < KEYBOARD_MAX_NB_PRESSED; idx ++)
238 {
239 keys_l[idx] = keys[idx];
240 }
241 return;
242}
243
USBH_DEBUG
#define USBH_DEBUG(...)
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:152
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
KEYBOARD_RIGHT_SHIFT
#define KEYBOARD_RIGHT_SHIFT
Definition: usbh_hid_keyboard.h:56
KEYBOARD_LEFT_SHIFT
#define KEYBOARD_LEFT_SHIFT
Definition: usbh_hid_keyboard.h:52
KEYBOARD_MAX_NB_PRESSED
#define KEYBOARD_MAX_NB_PRESSED
Definition: usbh_hid_keyboard.h:60
hid_keyboard_codes
static const uint8_t hid_keyboard_codes[]
Definition: usbh_hid_keyboard.c:41
hid_keyboard_key
static const int8_t hid_keyboard_key[]
Definition: usbh_hid_keyboard.c:76
hid_keyboard_key_shift
static const int8_t hid_keyboard_key_shift[]
Definition: usbh_hid_keyboard.c:97
usbh_hid_keyboard_decode
void usbh_hid_keyboard_decode(uint8_t *data)
usb host hid keyboard decode
Definition: usbh_hid_keyboard.c:145
usbh_hid_keyboard.h
usb host hid keyboard header file


AT32F415 Firmwary Library: usbh_hid_keyboard.h Source File

  • middlewares
  • usbh_class
  • usbh_hid
usbh_hid_keyboard.h
Go to the documentation of this file.
1
26/* Define to prevent recursive inclusion -------------------------------------*/
27#ifndef __USBH_HID_KEYBOARD_H
28#define __USBH_HID_KEYBOARD_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "usb_conf.h"
35
51#define KEYBOARD_LEFT_CTRL 0x01
52#define KEYBOARD_LEFT_SHIFT 0x02
53#define KEYBOARD_LEFT_ALT 0x04
54#define KEYBOARD_LEFT_GUI 0x08
55#define KEYBOARD_RIGHT_CTRL 0x10
56#define KEYBOARD_RIGHT_SHIFT 0x20
57#define KEYBOARD_RIGHT_ALT 0x40
58#define KEYBOARD_RIGHT_GUI 0x80
59
60#define KEYBOARD_MAX_NB_PRESSED 6
61
62#ifndef AZERTY_KEYBOARD
63 #define QWERTY_KEYBOARD
64#endif
65
66void usbh_hid_keyboard_decode(uint8_t *data);
67
68
80#ifdef __cplusplus
81}
82#endif
83
84#endif
usbh_hid_keyboard_decode
void usbh_hid_keyboard_decode(uint8_t *data)
usb host hid keyboard decode
Definition: usbh_hid_keyboard.c:145


AT32F415 Firmwary Library: usbh_hid_mouse.c Source File

  • middlewares
  • usbh_class
  • usbh_hid
usbh_hid_mouse.c
Go to the documentation of this file.
1
26#include "usbh_hid_mouse.h"
27
41 usb_hid_mouse_type hid_mouse;
42uint16_t x_pos = 0, y_pos = 0;
43
50void usbh_hid_mouse_position(uint8_t x, uint8_t y)
51{
52 if((x != 0) || (y != 0))
53 {
54 x_pos += x / 2;
55 y_pos += y / 2;
56
57 if(x_pos > MOUSE_WINDOW_WIDTH - 12)
58 {
59 x_pos = MOUSE_WINDOW_WIDTH - 12;
60 }
61 if(y_pos > MOUSE_WINDOW_HEIGHT - 12)
62 {
63 y_pos = MOUSE_WINDOW_HEIGHT - 12;
64 }
65
66 if(x_pos < 2)
67 {
68 x_pos = 2;
69 }
70 if(y_pos < 2)
71 {
72 y_pos = 2;
73 }
74 USBH_DEBUG("Moving Mouse");
75 }
76
77}
78
84void usbh_hid_mouse_button_press(uint8_t button)
85{
86 switch(button)
87 {
88 case MOUSE_BUTTON_LEFT:
89 /* left button */
90 USBH_DEBUG("Left Button Pressed ");
91 break;
92 case MOUSE_BUTTON_RIGHT:
93 USBH_DEBUG("Right Button Pressed ");
94 /* left button */
95 break;
96 case MOUSE_BUTTON_MIDDLE:
97 USBH_DEBUG("Middle Button Pressed ");
98 /* middle button */
99 break;
100 }
101}
102
108void usbh_hid_mouse_button_release(uint8_t button)
109{
110 switch(button)
111 {
112 case MOUSE_BUTTON_LEFT:
113 /* left button */
114 USBH_DEBUG("Left Button Released ");
115 break;
116 case MOUSE_BUTTON_RIGHT:
117 /* left button */
118 USBH_DEBUG("Right Button Released ");
119 break;
120 case MOUSE_BUTTON_MIDDLE:
121 /* middle button */
122 USBH_DEBUG("Middle Button Released ");
123 break;
124 }
125}
126
132void usbh_hid_mouse_process(usb_hid_mouse_type *mouse)
133{
134 uint8_t idx = 1;
135 static uint8_t b_state[3] = {0};
136 if((mouse->x != 0) && (mouse->y != 0))
137 {
138 usbh_hid_mouse_position(mouse->x, mouse->y);
139 }
140
141 for(idx = 0; idx < 3; idx ++)
142 {
143 if(mouse->button & 1 << idx)
144 {
145 if(b_state[idx] == 0)
146 {
147 usbh_hid_mouse_button_press(idx);
148 b_state[idx] = 1;
149 }
150 }
151 else
152 {
153 if(b_state[idx] == 1)
154 {
155 usbh_hid_mouse_button_release(idx);
156 b_state[idx] = 0;
157 }
158 }
159 }
160}
161
167void usbh_hid_mouse_decode(uint8_t *mouse_data)
168{
169 hid_mouse.button = mouse_data[0];
170 hid_mouse.x = mouse_data[1];
171 hid_mouse.y = mouse_data[2];
172 hid_mouse.z = mouse_data[3];
173
174 usbh_hid_mouse_process(&hid_mouse);
175}
176
USBH_DEBUG
#define USBH_DEBUG(...)
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:152
MOUSE_WINDOW_HEIGHT
#define MOUSE_WINDOW_HEIGHT
Definition: usbh_hid_mouse.h:53
MOUSE_BUTTON_LEFT
#define MOUSE_BUTTON_LEFT
usb hid mouse button
Definition: usbh_hid_mouse.h:59
MOUSE_WINDOW_WIDTH
#define MOUSE_WINDOW_WIDTH
Definition: usbh_hid_mouse.h:54
MOUSE_BUTTON_MIDDLE
#define MOUSE_BUTTON_MIDDLE
Definition: usbh_hid_mouse.h:61
MOUSE_BUTTON_RIGHT
#define MOUSE_BUTTON_RIGHT
Definition: usbh_hid_mouse.h:60
hid_mouse
usb_hid_mouse_type hid_mouse
Definition: usbh_hid_mouse.c:41
usbh_hid_mouse_button_press
void usbh_hid_mouse_button_press(uint8_t button)
usb host hid button press
Definition: usbh_hid_mouse.c:84
y_pos
uint16_t y_pos
Definition: usbh_hid_mouse.c:42
usbh_hid_mouse_position
void usbh_hid_mouse_position(uint8_t x, uint8_t y)
usb host hid position
Definition: usbh_hid_mouse.c:50
usbh_hid_mouse_process
void usbh_hid_mouse_process(usb_hid_mouse_type *mouse)
usb host hid mouse process
Definition: usbh_hid_mouse.c:132
usbh_hid_mouse_button_release
void usbh_hid_mouse_button_release(uint8_t button)
usb host hid button release
Definition: usbh_hid_mouse.c:108
x_pos
uint16_t x_pos
Definition: usbh_hid_mouse.c:42
usbh_hid_mouse_decode
void usbh_hid_mouse_decode(uint8_t *mouse_data)
usb host hid mouse decode
Definition: usbh_hid_mouse.c:167
usb_hid_mouse_type
usb hid mouse type
Definition: usbh_hid_mouse.h:67
usb_hid_mouse_type::y
uint8_t y
Definition: usbh_hid_mouse.h:70
usb_hid_mouse_type::z
uint8_t z
Definition: usbh_hid_mouse.h:71
usb_hid_mouse_type::button
uint8_t button
Definition: usbh_hid_mouse.h:68
usb_hid_mouse_type::x
uint8_t x
Definition: usbh_hid_mouse.h:69
usbh_hid_mouse.h
usb host hid mouse header file


AT32F415 Firmwary Library: usbh_hid_mouse.h Source File

  • middlewares
  • usbh_class
  • usbh_hid
usbh_hid_mouse.h
Go to the documentation of this file.
1
26/* Define to prevent recursive inclusion -------------------------------------*/
27#ifndef __USBH_HID_MOUSE_H
28#define __USBH_HID_MOUSE_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "usb_conf.h"
35
51#define MOUSE_WINDOW_X 100
52#define MOUSE_WINDOW_Y 220
53#define MOUSE_WINDOW_HEIGHT 90
54#define MOUSE_WINDOW_WIDTH 128
55
59#define MOUSE_BUTTON_LEFT 0x00
60#define MOUSE_BUTTON_RIGHT 0x01
61#define MOUSE_BUTTON_MIDDLE 0x02
62
66typedef struct
67{
68 uint8_t button;
69 uint8_t x;
70 uint8_t y;
71 uint8_t z;
72}usb_hid_mouse_type;
73
74void usbh_hid_mouse_decode(uint8_t *mouse_data);
75
76
88#ifdef __cplusplus
89}
90#endif
91
92#endif
93
usbh_hid_mouse_decode
void usbh_hid_mouse_decode(uint8_t *mouse_data)
usb host hid mouse decode
Definition: usbh_hid_mouse.c:167
usb_hid_mouse_type
usb hid mouse type
Definition: usbh_hid_mouse.h:67
usb_hid_mouse_type::y
uint8_t y
Definition: usbh_hid_mouse.h:70
usb_hid_mouse_type::z
uint8_t z
Definition: usbh_hid_mouse.h:71
usb_hid_mouse_type::button
uint8_t button
Definition: usbh_hid_mouse.h:68
usb_hid_mouse_type::x
uint8_t x
Definition: usbh_hid_mouse.h:69


AT32F415 Firmwary Library: usbh_int.c Source File

  • middlewares
  • usb_drivers
  • src
usbh_int.c
Go to the documentation of this file.
1
26#include "usbh_int.h"
27
28
47void usbh_irq_handler(otg_core_type *otgdev)
48{
49 otg_global_type *usbx = otgdev->usb_reg;
50 usbh_core_type *uhost = &otgdev->host;
51 uint32_t intsts = usb_global_get_all_interrupt(usbx);
52
53 if(usbx->gintsts_bit.curmode == 1)
54 {
55 if(intsts & USB_OTG_HCH_FLAG)
56 {
57 usbh_hch_handler(uhost);
58 usb_global_clear_interrupt(usbx, USB_OTG_HCH_FLAG);
59 }
60 if(intsts & USB_OTG_SOF_FLAG)
61 {
62 usbh_sof_handler(uhost);
63 usb_global_clear_interrupt(usbx, USB_OTG_SOF_FLAG);
64 }
65 if(intsts & USB_OTG_MODEMIS_FLAG)
66 {
67 usb_global_clear_interrupt(usbx, USB_OTG_MODEMIS_FLAG);
68 }
69 if(intsts & USB_OTG_WKUP_FLAG)
70 {
71 usbh_wakeup_handler(uhost);
72 usb_global_clear_interrupt(usbx, USB_OTG_WKUP_FLAG);
73 }
74 if(intsts & USB_OTG_RXFLVL_FLAG)
75 {
76 usbh_rx_qlvl_handler(uhost);
77 usb_global_clear_interrupt(usbx, USB_OTG_RXFLVL_FLAG);
78 }
79 if(intsts & USB_OTG_DISCON_FLAG)
80 {
81 usbh_disconnect_handler(uhost);
82 usb_global_clear_interrupt(usbx, USB_OTG_DISCON_FLAG);
83 }
84 if(intsts & USB_OTG_PRT_FLAG)
85 {
86 usbh_port_handler(uhost);
87 }
88 if(intsts & USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG)
89 {
90 usb_global_clear_interrupt(usbx, USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG);
91 }
92 if(intsts & USB_OTG_INCOMISOIN_FLAG)
93 {
94 usb_global_clear_interrupt(usbx, USB_OTG_INCOMISOIN_FLAG);
95 }
96 if(intsts & USB_OTG_PTXFEMP_FLAG)
97 {
98 usb_global_clear_interrupt(usbx, USB_OTG_PTXFEMP_FLAG);
99 }
100 if(intsts & USB_OTG_ISOOUTDROP_FLAG)
101 {
102 usb_global_clear_interrupt(usbx, USB_OTG_ISOOUTDROP_FLAG);
103 }
104
105 }
106}
107
113void usbh_wakeup_handler(usbh_core_type *uhost)
114{
115 uhost->global_state = USBH_WAKEUP;
116}
117
123void usbh_sof_handler(usbh_core_type *uhost)
124{
125 uhost->timer ++;
126}
127
133void usbh_disconnect_handler(usbh_core_type *uhost)
134{
135 otg_global_type *usbx = uhost->usb_reg;
136 otg_host_type *usb_host = OTG_HOST(usbx);
137 uint8_t i_index;
138
139 usb_host->hprt &= ~(USB_OTG_HPRT_PRTENA | USB_OTG_HPRT_PRTENCHNG |
140 USB_OTG_HPRT_PRTOVRCACT | USB_OTG_HPRT_PRTCONDET);
141
142 usb_host_disable(usbx);
143
144 uhost->conn_sts = 0;
145
146 uhost->global_state = USBH_DISCONNECT;
147
148 for(i_index = 0; i_index < USB_HOST_CHANNEL_NUM; i_index ++)
149 {
150 usbh_free_channel(uhost, i_index);
151 }
152 usbh_fsls_clksel(usbx, USB_HCFG_CLK_48M);
153}
154
161void usbh_hch_in_handler(usbh_core_type *uhost, uint8_t chn)
162{
163 otg_global_type *usbx = uhost->usb_reg;
164 otg_hchannel_type *usb_chh = USB_CHL(usbx, chn);
165 uint32_t hcint_value = usb_chh->hcint & usb_chh->hcintmsk;
166
167 if( hcint_value & USB_OTG_HC_ACK_FLAG)
168 {
169 usb_chh->hcint = USB_OTG_HC_ACK_FLAG;
170 }
171 else if(hcint_value & USB_OTG_HC_STALL_FLAG)
172 {
173 usb_chh->hcintmsk_bit.chhltdmsk = TRUE;
174 usb_chh->hcint = USB_OTG_HC_NAK_FLAG | USB_OTG_HC_STALL_FLAG;
175 uhost->hch[chn].state = HCH_STALL;
176 usb_hch_halt(usbx, chn);
177 }
178 else if(hcint_value & USB_OTG_HC_DTGLERR_FLAG)
179 {
180 usb_chh->hcintmsk_bit.chhltdmsk = TRUE;
181 usb_hch_halt(usbx, chn);
182 usb_chh->hcint = USB_OTG_HC_DTGLERR_FLAG | USB_OTG_HC_NAK_FLAG;
183 uhost->hch[chn].state = HCH_DATATGLERR;
184 }
185
186 else if(hcint_value & USB_OTG_HC_FRMOVRRUN_FLAG)
187 {
188 usb_chh->hcintmsk_bit.chhltdmsk = TRUE;
189 usb_hch_halt(usbx, chn);
190 usb_chh->hcint = USB_OTG_HC_FRMOVRRUN_FLAG;
191 }
192 else if(hcint_value & USB_OTG_HC_XFERC_FLAG)
193 {
194 uhost->hch[chn].state = HCH_XFRC;
195 usb_chh->hcint = USB_OTG_HC_XFERC_FLAG;
196
197 if(usb_chh->hcchar_bit.eptype == EPT_BULK_TYPE || usb_chh->hcchar_bit.eptype == EPT_CONTROL_TYPE)
198 {
199 usb_chh->hcintmsk_bit.chhltdmsk = TRUE;
200 usb_hch_halt(usbx, chn);
201 usb_chh->hcint = USB_OTG_HC_NAK_FLAG;
202 }
203 else if(usb_chh->hcchar_bit.eptype == EPT_INT_TYPE)
204 {
205 usb_chh->hcchar_bit.oddfrm = TRUE;
206 uhost->urb_state[chn] = URB_DONE;
207 }
208 else if(usb_chh->hcchar_bit.eptype == EPT_ISO_TYPE)
209 {
210 uhost->urb_state[chn] = URB_DONE;
211 }
212 uhost->hch[chn].toggle_in ^= 1;
213 }
214 else if(hcint_value & USB_OTG_HC_CHHLTD_FLAG)
215 {
216 usb_chh->hcintmsk_bit.chhltdmsk = FALSE;
217 if(uhost->hch[chn].state == HCH_XFRC )
218 {
219 uhost->urb_state[chn] = URB_DONE;
220 }
221 else if(uhost->hch[chn].state == HCH_STALL)
222 {
223 uhost->urb_state[chn] = URB_STALL;
224 }
225 else if(uhost->hch[chn].state == HCH_XACTERR ||
226 uhost->hch[chn].state == HCH_DATATGLERR)
227 {
228 uhost->urb_state[chn] = URB_ERROR;
229
230 usb_chh->hcchar_bit.chdis = FALSE;
231 usb_chh->hcchar_bit.chena = TRUE;
232 }
233 usb_chh->hcint = USB_OTG_HC_CHHLTD_FLAG;
234 }
235 else if(hcint_value & USB_OTG_HC_XACTERR_FLAG)
236 {
237 usb_chh->hcintmsk_bit.chhltdmsk = TRUE;
238 uhost->hch[chn].state = HCH_XACTERR;
239 usb_hch_halt(usbx, chn);
240 usb_chh->hcint = USB_OTG_HC_XACTERR_FLAG;
241 }
242 else if(hcint_value & USB_OTG_HC_NAK_FLAG)
243 {
244 if(usb_chh->hcchar_bit.eptype == EPT_INT_TYPE)
245 {
246 usb_chh->hcintmsk_bit.chhltdmsk = TRUE;
247 usb_hch_halt(usbx, chn);
248 }
249 else if(usb_chh->hcchar_bit.eptype == EPT_BULK_TYPE ||
250 usb_chh->hcchar_bit.eptype == EPT_CONTROL_TYPE)
251 {
252 usb_chh->hcchar_bit.chdis = FALSE;
253 usb_chh->hcchar_bit.chena = TRUE;
254 }
255 uhost->hch[chn].state = HCH_NAK;
256 usb_chh->hcint = USB_OTG_HC_NAK_FLAG;
257 }
258 else if(hcint_value & USB_OTG_HC_BBLERR_FLAG)
259 {
260 usb_chh->hcint = USB_OTG_HC_BBLERR_FLAG;
261 }
262}
263
270void usbh_hch_out_handler(usbh_core_type *uhost, uint8_t chn)
271{
272 otg_global_type *usbx = uhost->usb_reg;
273 otg_hchannel_type *usb_chh = USB_CHL(usbx, chn);
274 uint32_t hcint_value = usb_chh->hcint & usb_chh->hcintmsk;
275
276 if( hcint_value & USB_OTG_HC_ACK_FLAG)
277 {
278 usb_chh->hcint = USB_OTG_HC_ACK_FLAG;
279 }
280 else if( hcint_value & USB_OTG_HC_FRMOVRRUN_FLAG)
281 {
282 usb_chh->hcintmsk_bit.chhltdmsk = TRUE;
283 usb_hch_halt(usbx, chn);
284 usb_chh->hcint = USB_OTG_HC_FRMOVRRUN_FLAG;
285 }
286 else if( hcint_value & USB_OTG_HC_XFERC_FLAG)
287 {
288 usb_chh->hcintmsk_bit.chhltdmsk = TRUE;
289 usb_hch_halt(usbx, chn);
290 uhost->hch[chn].state = HCH_XFRC;
291 usb_chh->hcint = USB_OTG_HC_XFERC_FLAG;
292 }
293 else if( hcint_value & USB_OTG_HC_STALL_FLAG)
294 {
295 usb_chh->hcintmsk_bit.chhltdmsk = TRUE;
296 usb_chh->hcint = USB_OTG_HC_STALL_FLAG;
297 uhost->hch[chn].state = HCH_STALL;
298 usb_hch_halt(usbx, chn);
299 }
300 else if( hcint_value & USB_OTG_HC_DTGLERR_FLAG)
301 {
302 usb_chh->hcintmsk_bit.chhltdmsk = TRUE;
303 usb_hch_halt(usbx, chn);
304 usb_chh->hcint = USB_OTG_HC_DTGLERR_FLAG | USB_OTG_HC_NAK_FLAG;
305 uhost->hch[chn].state = HCH_DATATGLERR;
306 }
307 else if( hcint_value & USB_OTG_HC_CHHLTD_FLAG)
308 {
309 usb_chh->hcintmsk_bit.chhltdmsk = FALSE;
310 if(uhost->hch[chn].state == HCH_XFRC)
311 {
312 uhost->urb_state[chn] = URB_DONE;
313 if(uhost->hch[chn].ept_type == EPT_BULK_TYPE)
314 {
315 uhost->hch[chn].toggle_out ^= 1;
316 }
317 }
318 else if(uhost->hch[chn].state == HCH_NAK)
319 {
320 uhost->urb_state[chn] = URB_NOTREADY;
321 }
322 else if(uhost->hch[chn].state == HCH_STALL)
323 {
324 uhost->hch[chn].urb_sts = URB_STALL;
325 }
326 else if(uhost->hch[chn].state == HCH_XACTERR ||
327 uhost->hch[chn].state == HCH_DATATGLERR)
328 {
329 uhost->urb_state[chn] = URB_ERROR;
330
331 usb_chh->hcchar_bit.chdis = FALSE;
332 usb_chh->hcchar_bit.chena = TRUE;
333 }
334 usb_chh->hcint = USB_OTG_HC_CHHLTD_FLAG;
335 }
336 else if( hcint_value & USB_OTG_HC_XACTERR_FLAG)
337 {
338 usb_chh->hcintmsk_bit.chhltdmsk = TRUE;
339 uhost->hch[chn].state = HCH_XACTERR;
340 usb_hch_halt(usbx, chn);
341 usb_chh->hcint = USB_OTG_HC_XACTERR_FLAG | USB_OTG_HC_NAK_FLAG;
342 }
343 else if( hcint_value & USB_OTG_HC_NAK_FLAG)
344 {
345 usb_chh->hcintmsk_bit.chhltdmsk = TRUE;
346 usb_hch_halt(usbx, chn);
347 uhost->hch[chn].state = HCH_NAK;
348 usb_chh->hcint = USB_OTG_HC_NAK_FLAG;
349 }
350}
351
357void usbh_hch_handler(usbh_core_type *uhost)
358{
359 otg_global_type *usbx = uhost->usb_reg;
360 otg_host_type *usb_host = OTG_HOST(usbx);
361 uint32_t intsts, i_index;
362
363 intsts = usb_host->haint & 0xFFFF;
364 for(i_index = 0; i_index < 16; i_index ++)
365 {
366 if(intsts & (1 << i_index))
367 {
368 if(USB_CHL(usbx, i_index)->hcchar_bit.eptdir)
369 {
370 //hc in
371 usbh_hch_in_handler(uhost, i_index);
372 }
373 else
374 {
375 //hc out
376 usbh_hch_out_handler(uhost, i_index);
377 }
378 }
379 }
380}
381
387void usbh_rx_qlvl_handler(usbh_core_type *uhost)
388{
389 uint8_t chn;
390 uint32_t pktsts;
391 uint32_t pktcnt;
392 uint32_t tmp;
393 otg_hchannel_type *ch;
394 otg_global_type *usbx = uhost->usb_reg;
395
396 usbx->gintmsk_bit.rxflvlmsk = 0;
397
398 tmp = usbx->grxstsp;
399 chn = tmp & 0xF;
400 pktsts = (tmp >> 17) & 0xF;
401 pktcnt = (tmp >> 4) & 0x7FF;
402 ch = USB_CHL(usbx, chn);
403 switch(pktsts)
404 {
405 case PKTSTS_IN_DATA_PACKET_RECV:
406 if(pktcnt > 0 && (uhost->hch[chn].trans_buf) != 0)
407 {
408 usb_read_packet(usbx, uhost->hch[chn].trans_buf, chn, pktcnt);
409 uhost->hch[chn].trans_buf += pktcnt;
410 uhost->hch[chn].trans_count += pktcnt;
411
412 if(ch->hctsiz_bit.pktcnt > 0)
413 {
414 ch->hcchar_bit.chdis = FALSE;
415 ch->hcchar_bit.chena = TRUE;
416 uhost->hch[chn].toggle_in ^= 1;
417 }
418 }
419 break;
420 case PKTSTS_IN_TRANSFER_COMPLETE:
421 break;
422 case PKTSTS_DATA_BIT_ERROR:
423 break;
424 case PKTSTS_CHANNEL_STOP:
425 break;
426 default:
427 break;
428
429 }
430 usbx->gintmsk_bit.rxflvlmsk = 1;
431}
432
438void usbh_port_handler(usbh_core_type *uhost)
439{
440 otg_global_type *usbx = uhost->usb_reg;
441 otg_host_type *usb_host = OTG_HOST(usbx);
442
443 uint32_t prt = 0, prt_0;
444
445 prt = usb_host->hprt;
446 prt_0 = prt;
447
448 prt_0 &= ~(USB_OTG_HPRT_PRTENA | USB_OTG_HPRT_PRTENCHNG |
449 USB_OTG_HPRT_PRTOVRCACT | USB_OTG_HPRT_PRTCONDET);
450 if(prt & USB_OTG_HPRT_PRTCONDET)
451 {
452 if(prt & USB_OTG_HPRT_PRTCONSTS)
453 {
454 /* connect callback */
455 uhost->conn_sts = 1;
456 }
457 prt_0 |= USB_OTG_HPRT_PRTCONDET;
458 }
459
460 if(prt & USB_OTG_HPRT_PRTENCHNG)
461 {
462 prt_0 |= USB_OTG_HPRT_PRTENCHNG;
463
464 if(prt & USB_OTG_HPRT_PRTENA)
465 {
466 if((prt & USB_OTG_HPRT_PRTSPD) == (USB_PRTSPD_LOW_SPEED << 17))
467 {
468 usbh_fsls_clksel(usbx, USB_HCFG_CLK_6M);
469 }
470 else
471 {
472 usbh_fsls_clksel(usbx, USB_HCFG_CLK_48M);
473 }
474 /* connect callback */
475 uhost->port_enable = 1;
476 }
477 else
478 {
479 /* clean up hprt */
480 usb_host->hprt &= ~(USB_OTG_HPRT_PRTENA | USB_OTG_HPRT_PRTENCHNG |
481 USB_OTG_HPRT_PRTOVRCACT | USB_OTG_HPRT_PRTCONDET);
482 }
483 }
484
485 if(prt & USB_OTG_HPRT_PRTOVRCACT)
486 {
487 prt_0 |= USB_OTG_HPRT_PRTOVRCACT;
488 }
489
490 usb_host->hprt = prt_0;
491}
492
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
EPT_ISO_TYPE
@ EPT_ISO_TYPE
Definition: at32f415_usb.h:347
EPT_INT_TYPE
@ EPT_INT_TYPE
Definition: at32f415_usb.h:349
EPT_CONTROL_TYPE
@ EPT_CONTROL_TYPE
Definition: at32f415_usb.h:346
EPT_BULK_TYPE
@ EPT_BULK_TYPE
Definition: at32f415_usb.h:348
OTG_HOST
#define OTG_HOST(usbx)
Definition: at32f415_usb.h:1343
USB_CHL
#define USB_CHL(usbx, n)
Definition: at32f415_usb.h:1344
usb_global_clear_interrupt
void usb_global_clear_interrupt(otg_global_type *usbx, uint32_t flag)
clear the global interrupt flag
Definition: at32f415_usb.c:250
usbh_fsls_clksel
void usbh_fsls_clksel(otg_global_type *usbx, uint8_t clk)
select full or low speed clock
Definition: at32f415_usb.c:1063
usb_global_get_all_interrupt
uint32_t usb_global_get_all_interrupt(otg_global_type *usbx)
get all global core interrupt flag
Definition: at32f415_usb.c:211
usb_hch_halt
void usb_hch_halt(otg_global_type *usbx, uint8_t chn)
halt channel
Definition: at32f415_usb.c:1007
usb_read_packet
void usb_read_packet(otg_global_type *usbx, uint8_t *pusr_buf, uint16_t num, uint16_t nbytes)
read data from usb buffer to user buffer
Definition: at32f415_usb.c:440
usb_host_disable
void usb_host_disable(otg_global_type *usbx)
disable host
Definition: at32f415_usb.c:963
USB_OTG_DISCON_FLAG
#define USB_OTG_DISCON_FLAG
Definition: at32f415_usb.h:107
USB_OTG_MODEMIS_FLAG
#define USB_OTG_MODEMIS_FLAG
Definition: at32f415_usb.h:86
USB_OTG_WKUP_FLAG
#define USB_OTG_WKUP_FLAG
Definition: at32f415_usb.h:108
USB_OTG_ISOOUTDROP_FLAG
#define USB_OTG_ISOOUTDROP_FLAG
Definition: at32f415_usb.h:97
USB_OTG_HCH_FLAG
#define USB_OTG_HCH_FLAG
Definition: at32f415_usb.h:104
USB_OTG_PTXFEMP_FLAG
#define USB_OTG_PTXFEMP_FLAG
Definition: at32f415_usb.h:105
USB_OTG_INCOMISOIN_FLAG
#define USB_OTG_INCOMISOIN_FLAG
Definition: at32f415_usb.h:101
USB_OTG_PRT_FLAG
#define USB_OTG_PRT_FLAG
Definition: at32f415_usb.h:103
USB_OTG_RXFLVL_FLAG
#define USB_OTG_RXFLVL_FLAG
Definition: at32f415_usb.h:89
USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG
#define USB_OTG_INCOMPIP_INCOMPISOOUT_FLAG
Definition: at32f415_usb.h:102
USB_OTG_SOF_FLAG
#define USB_OTG_SOF_FLAG
Definition: at32f415_usb.h:88
PKTSTS_DATA_BIT_ERROR
#define PKTSTS_DATA_BIT_ERROR
Definition: at32f415_usb.h:140
PKTSTS_IN_TRANSFER_COMPLETE
#define PKTSTS_IN_TRANSFER_COMPLETE
Definition: at32f415_usb.h:139
PKTSTS_CHANNEL_STOP
#define PKTSTS_CHANNEL_STOP
Definition: at32f415_usb.h:141
PKTSTS_IN_DATA_PACKET_RECV
#define PKTSTS_IN_DATA_PACKET_RECV
usb host packet status
Definition: at32f415_usb.h:138
USB_OTG_HC_CHHLTD_FLAG
#define USB_OTG_HC_CHHLTD_FLAG
Definition: at32f415_usb.h:229
USB_OTG_HC_STALL_FLAG
#define USB_OTG_HC_STALL_FLAG
Definition: at32f415_usb.h:230
USB_OTG_HPRT_PRTSPD
#define USB_OTG_HPRT_PRTSPD
Definition: at32f415_usb.h:181
USB_OTG_HPRT_PRTENA
#define USB_OTG_HPRT_PRTENA
Definition: at32f415_usb.h:172
USB_OTG_HC_XFERC_FLAG
#define USB_OTG_HC_XFERC_FLAG
usb host channel interrupt flag
Definition: at32f415_usb.h:228
USB_OTG_HC_FRMOVRRUN_FLAG
#define USB_OTG_HC_FRMOVRRUN_FLAG
Definition: at32f415_usb.h:236
USB_OTG_HPRT_PRTCONSTS
#define USB_OTG_HPRT_PRTCONSTS
usb host port status
Definition: at32f415_usb.h:170
USB_OTG_HC_XACTERR_FLAG
#define USB_OTG_HC_XACTERR_FLAG
Definition: at32f415_usb.h:234
USB_OTG_HC_NAK_FLAG
#define USB_OTG_HC_NAK_FLAG
Definition: at32f415_usb.h:231
USB_HCFG_CLK_6M
#define USB_HCFG_CLK_6M
Definition: at32f415_usb.h:165
USB_PRTSPD_LOW_SPEED
#define USB_PRTSPD_LOW_SPEED
Definition: at32f415_usb.h:188
USB_HCFG_CLK_48M
#define USB_HCFG_CLK_48M
Definition: at32f415_usb.h:164
USB_OTG_HC_BBLERR_FLAG
#define USB_OTG_HC_BBLERR_FLAG
Definition: at32f415_usb.h:235
USB_OTG_HC_ACK_FLAG
#define USB_OTG_HC_ACK_FLAG
Definition: at32f415_usb.h:232
USB_OTG_HPRT_PRTOVRCACT
#define USB_OTG_HPRT_PRTOVRCACT
Definition: at32f415_usb.h:174
USB_OTG_HPRT_PRTENCHNG
#define USB_OTG_HPRT_PRTENCHNG
Definition: at32f415_usb.h:173
USB_OTG_HC_DTGLERR_FLAG
#define USB_OTG_HC_DTGLERR_FLAG
Definition: at32f415_usb.h:237
USB_OTG_HPRT_PRTCONDET
#define USB_OTG_HPRT_PRTCONDET
Definition: at32f415_usb.h:171
usbh_free_channel
void usbh_free_channel(usbh_core_type *uhost, uint8_t index)
usb host free channel
Definition: usbh_core.c:57
usbh_port_handler
void usbh_port_handler(usbh_core_type *uhost)
usb host port request handler
Definition: usbh_int.c:438
usbh_sof_handler
void usbh_sof_handler(usbh_core_type *uhost)
usb host sof handler
Definition: usbh_int.c:123
usbh_hch_in_handler
void usbh_hch_in_handler(usbh_core_type *uhost, uint8_t chn)
usb host in transfer request handler
Definition: usbh_int.c:161
usbh_rx_qlvl_handler
void usbh_rx_qlvl_handler(usbh_core_type *uhost)
usb host rx buffer not empty request handler
Definition: usbh_int.c:387
usbh_irq_handler
void usbh_irq_handler(otg_core_type *otgdev)
usb host interrupt handler
Definition: usbh_int.c:47
usbh_wakeup_handler
void usbh_wakeup_handler(usbh_core_type *uhost)
usb host wakeup handler
Definition: usbh_int.c:113
usbh_hch_handler
void usbh_hch_handler(usbh_core_type *uhost)
usb host channel request handler
Definition: usbh_int.c:357
usbh_hch_out_handler
void usbh_hch_out_handler(usbh_core_type *uhost, uint8_t chn)
usb host out transfer request handler
Definition: usbh_int.c:270
usbh_disconnect_handler
void usbh_disconnect_handler(usbh_core_type *uhost)
usb host disconnect handler
Definition: usbh_int.c:133
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
otg_core_type::usb_reg
usb_reg_type * usb_reg
Definition: usb_core.h:102
otg_global_type
Definition: at32f415_usb.h:473
otg_global_type::curmode
__IO uint32_t curmode
Definition: at32f415_usb.h:567
otg_global_type::gintsts_bit
struct otg_global_type::@685::@712 gintsts_bit
otg_global_type::rxflvlmsk
__IO uint32_t rxflvlmsk
Definition: at32f415_usb.h:611
otg_global_type::grxstsp
__IO uint32_t grxstsp
Definition: at32f415_usb.h:661
otg_global_type::gintmsk_bit
struct otg_global_type::@687::@713 gintmsk_bit
otg_hchannel_type
Definition: at32f415_usb.h:901
otg_hchannel_type::hcint
__IO uint32_t hcint
Definition: at32f415_usb.h:946
otg_hchannel_type::hcchar_bit
struct otg_hchannel_type::@744::@754 hcchar_bit
otg_hchannel_type::chhltdmsk
__IO uint32_t chhltdmsk
Definition: at32f415_usb.h:973
otg_hchannel_type::oddfrm
__IO uint32_t oddfrm
Definition: at32f415_usb.h:918
otg_hchannel_type::chena
__IO uint32_t chena
Definition: at32f415_usb.h:920
otg_hchannel_type::hctsiz_bit
struct otg_hchannel_type::@752::@758 hctsiz_bit
otg_hchannel_type::chdis
__IO uint32_t chdis
Definition: at32f415_usb.h:919
otg_hchannel_type::hcintmsk
__IO uint32_t hcintmsk
Definition: at32f415_usb.h:969
otg_hchannel_type::eptype
__IO uint32_t eptype
Definition: at32f415_usb.h:915
otg_hchannel_type::pktcnt
__IO uint32_t pktcnt
Definition: at32f415_usb.h:996
otg_hchannel_type::hcintmsk_bit
struct otg_hchannel_type::@750::@757 hcintmsk_bit
otg_host_type
Definition: at32f415_usb.h:787
otg_host_type::hprt
__IO uint32_t hprt
Definition: at32f415_usb.h:877
otg_host_type::haint
__IO uint32_t haint
Definition: at32f415_usb.h:849
usbh_int.h
usb header file


AT32F415 Firmwary Library: usbh_int.h Source File

  • middlewares
  • usb_drivers
  • inc
usbh_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USBH_INT_H
29#define __USBH_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
47/* includes ------------------------------------------------------------------*/
48#include "usbh_core.h"
49#include "usb_core.h"
50void usbh_irq_handler(otg_core_type *hdev);
51void usbh_hch_handler(usbh_core_type *uhost);
52void usbh_port_handler(usbh_core_type *uhost);
53void usbh_disconnect_handler(usbh_core_type *uhost);
54void usbh_hch_in_handler(usbh_core_type *uhost, uint8_t chn);
55void usbh_hch_out_handler(usbh_core_type *uhost, uint8_t chn);
56void usbh_rx_qlvl_handler(usbh_core_type *uhost);
57void usbh_wakeup_handler(usbh_core_type *uhost);
58void usbh_sof_handler(usbh_core_type *uhost);
59
72#ifdef __cplusplus
73}
74#endif
75
76#endif
77
usbh_port_handler
void usbh_port_handler(usbh_core_type *uhost)
usb host port request handler
Definition: usbh_int.c:438
usbh_sof_handler
void usbh_sof_handler(usbh_core_type *uhost)
usb host sof handler
Definition: usbh_int.c:123
usbh_hch_in_handler
void usbh_hch_in_handler(usbh_core_type *uhost, uint8_t chn)
usb host in transfer request handler
Definition: usbh_int.c:161
usbh_rx_qlvl_handler
void usbh_rx_qlvl_handler(usbh_core_type *uhost)
usb host rx buffer not empty request handler
Definition: usbh_int.c:387
usbh_irq_handler
void usbh_irq_handler(otg_core_type *hdev)
usb host interrupt handler
Definition: usbh_int.c:47
usbh_wakeup_handler
void usbh_wakeup_handler(usbh_core_type *uhost)
usb host wakeup handler
Definition: usbh_int.c:113
usbh_hch_handler
void usbh_hch_handler(usbh_core_type *uhost)
usb host channel request handler
Definition: usbh_int.c:357
usbh_hch_out_handler
void usbh_hch_out_handler(usbh_core_type *uhost, uint8_t chn)
usb host out transfer request handler
Definition: usbh_int.c:270
usbh_disconnect_handler
void usbh_disconnect_handler(usbh_core_type *uhost)
usb host disconnect handler
Definition: usbh_int.c:133
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbh_core.h
usb host core header file


AT32F415 Firmwary Library: usbh_msc_bot_scsi.c Source File

  • middlewares
  • usbh_class
  • usbh_msc
usbh_msc_bot_scsi.c
Go to the documentation of this file.
1
26#include "usbh_msc_bot_scsi.h"
27#include "usbh_msc_class.h"
28#include "usb_conf.h"
29#include "usbh_core.h"
30#include "usbh_ctrl.h"
31
45static usb_sts_type usbh_bot_cbw(msc_bot_cbw_type *cbw, uint32_t data_length, uint8_t cmd_len, uint8_t flag);
46static usb_sts_type usbh_cmd_inquiry(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun);
47static usb_sts_type usbh_cmd_capacity10(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun);
48static usb_sts_type usbh_cmd_test_unit_ready(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun);
49static usb_sts_type usbh_cmd_requset_sense(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun);
50static usb_sts_type usbh_cmd_write(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun,
51 uint32_t data_len, uint32_t address, uint8_t *buffer);
52static usb_sts_type usbh_cmd_read(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun,
53 uint32_t data_len, uint32_t address, uint8_t *buffer);
54
63static usb_sts_type usbh_bot_cbw(msc_bot_cbw_type *cbw, uint32_t data_length, uint8_t cmd_len, uint8_t flag)
64{
65 uint8_t i_index;
66 cbw->dCBWSignature = MSC_CBW_SIGNATURE;
67 cbw->dCBWTag = MSC_CBW_TAG;
68 cbw->dCBWDataTransferLength = data_length;
69 cbw->bmCBWFlags = flag;
70 cbw->bCBWCBLength = cmd_len;
71 for(i_index = 0; i_index < MSC_CBW_CB_LEN; i_index ++)
72 {
73 cbw->CBWCB[i_index] = 0x00;
74 }
75 return USB_OK;
76}
77
85static usb_sts_type usbh_cmd_inquiry(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
86{
87 usbh_msc_type *msc_struct = (usbh_msc_type *)bot_trans->msc_struct;
88 cmd[0] = MSC_OPCODE_INQUIRY;
89 cmd[1] = lun << 5;
90 cmd[4] = MSC_INQUIRY_DATA_LEN;
91
92 bot_trans->data = (uint8_t *)&msc_struct->l_unit_n[lun].inquiry;
93 return USB_OK;
94}
95
103static usb_sts_type usbh_cmd_capacity10(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
104{
105 usbh_msc_type *msc_struct = (usbh_msc_type *)bot_trans->msc_struct;
106 cmd[0] = MSC_OPCODE_CAPACITY;
107 cmd[1] = lun << 5;
108
109 msc_struct->bot_trans.data = (uint8_t *)bot_trans->buffer;
110 return USB_OK;
111}
112
120static usb_sts_type usbh_cmd_test_unit_ready(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
121{
122 cmd[0] = MSC_OPCODE_TEST_UNIT_READY;
123 cmd[1] = lun << 5;
124
125 return USB_OK;
126}
127
135static usb_sts_type usbh_cmd_requset_sense(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
136{
137 cmd[0] = MSC_OPCODE_REQUEST_SENSE;
138 cmd[1] = lun << 5;
139 cmd[4] = MSC_REQUEST_SENSE_DATA_LEN;
140
141 bot_trans->data = bot_trans->buffer;
142 return USB_OK;
143}
144
155static usb_sts_type usbh_cmd_write(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun,
156 uint32_t data_len, uint32_t address, uint8_t *buffer)
157{
158 cmd[0] = MSC_OPCODE_WRITE10;
159 cmd[1] = lun << 5;
160 cmd[2] = (uint8_t)(address >> 24);
161 cmd[3] = (uint8_t)(address >> 16);
162 cmd[4] = (uint8_t)(address >> 8);
163 cmd[5] = (uint8_t)(address & 0xFF);
164
165 cmd[7] = data_len >> 8;
166 cmd[8] = data_len;
167
168 bot_trans->data = buffer;
169 return USB_OK;
170}
171
182static usb_sts_type usbh_cmd_read(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun,
183 uint32_t data_len, uint32_t address, uint8_t *buffer)
184{
185 cmd[0] = MSC_OPCODE_READ10;
186 cmd[1] = lun << 5;
187 cmd[2] = (uint8_t)(address >> 24);
188 cmd[3] = (uint8_t)(address >> 16);
189 cmd[4] = (uint8_t)(address >> 8);
190 cmd[5] = (uint8_t)(address & 0xFF);
191
192 cmd[7] = data_len >> 8;
193 cmd[8] = data_len;
194
195 bot_trans->data = buffer;
196 return USB_OK;
197}
198
205 usb_sts_type usbh_check_csw(msc_bot_cbw_type *cbw, msc_bot_csw_type *csw)
206{
207 usb_sts_type status = USB_OK;
208
209 return status;
210}
211
218 usb_sts_type usb_bot_request(void *uhost, msc_bot_trans_type *bot_trans)
219{
220 usb_sts_type status = USB_WAIT;
221 urb_sts_type urb_status;
222 usbh_core_type *puhost = (usbh_core_type *)uhost;
223 usbh_msc_type *msc_struct = (usbh_msc_type *)bot_trans->msc_struct;
224 switch(bot_trans->bot_state)
225 {
226 case BOT_STATE_SEND_CBW:
227 usbh_bulk_send(puhost, msc_struct->chout, (uint8_t *)(&bot_trans->cbw), MSC_CBW_LEN);
228 bot_trans->bot_state = BOT_STATE_SEND_CBW_WAIT;
229 break;
230
231 case BOT_STATE_SEND_CBW_WAIT:
232 urb_status = usbh_get_urb_status(puhost, msc_struct->chout);
233 if(urb_status == URB_DONE)
234 {
235 if(bot_trans->cbw.dCBWDataTransferLength != 0)
236 {
237 if(bot_trans->cbw.bmCBWFlags == MSC_CBW_FLAG_IN)
238 {
239 bot_trans->bot_state = BOT_STATE_DATA_IN;
240 }
241 else
242 {
243 bot_trans->bot_state = BOT_STATE_DATA_OUT;
244 }
245 }
246 else
247 {
248 bot_trans->bot_state = BOT_STATE_RECV_CSW;
249 }
250 }
251 else if(urb_status == URB_NOTREADY)
252 {
253 bot_trans->bot_state = BOT_STATE_SEND_CBW;
254 }
255 else if(urb_status == URB_STALL)
256 {
257 bot_trans->bot_state = BOT_STATE_ERROR;
258 }
259 break;
260
261 case BOT_STATE_DATA_IN:
262 usbh_bulk_recv(puhost, msc_struct->chin, bot_trans->data,
263 msc_struct->in_maxpacket);
264 bot_trans->bot_state = BOT_STATE_DATA_IN_WAIT;
265 break;
266
267 case BOT_STATE_DATA_IN_WAIT:
268 urb_status = usbh_get_urb_status(puhost, msc_struct->chin);
269 if(urb_status == URB_DONE)
270 {
271 if(bot_trans->cbw.dCBWDataTransferLength > msc_struct->in_maxpacket)
272 {
273 bot_trans->data += msc_struct->in_maxpacket;
274 bot_trans->cbw.dCBWDataTransferLength -= msc_struct->in_maxpacket;
275 }
276 else
277 {
278 bot_trans->cbw.dCBWDataTransferLength = 0;
279 }
280 if(bot_trans->cbw.dCBWDataTransferLength > 0)
281 {
282 usbh_bulk_recv(puhost, msc_struct->chin, bot_trans->data,
283 msc_struct->in_maxpacket);
284 }
285 else
286 {
287 bot_trans->bot_state = BOT_STATE_RECV_CSW;
288 }
289 }
290 else if(urb_status == URB_STALL)
291 {
292 bot_trans->bot_state = BOT_STATE_ERROR;
293 }
294
295 break;
296
297 case BOT_STATE_DATA_OUT:
298 usbh_bulk_send(puhost, msc_struct->chout, bot_trans->data, msc_struct->out_maxpacket);
299 bot_trans->bot_state = BOT_STATE_DATA_OUT_WAIT;
300 break;
301
302 case BOT_STATE_DATA_OUT_WAIT:
303 urb_status = usbh_get_urb_status(puhost, msc_struct->chout);
304 if(urb_status == URB_DONE)
305 {
306 if(bot_trans->cbw.dCBWDataTransferLength > msc_struct->out_maxpacket)
307 {
308 bot_trans->data += msc_struct->out_maxpacket;
309 bot_trans->cbw.dCBWDataTransferLength -= msc_struct->out_maxpacket;
310 }
311 else
312 {
313 bot_trans->cbw.dCBWDataTransferLength = 0;
314 }
315 if(bot_trans->cbw.dCBWDataTransferLength > 0)
316 {
317 usbh_bulk_send(puhost, msc_struct->chout, bot_trans->data, msc_struct->out_maxpacket);
318 }
319 else
320 {
321 bot_trans->bot_state = BOT_STATE_RECV_CSW;
322 }
323 }
324 else if(urb_status == URB_NOTREADY)
325 {
326 bot_trans->bot_state = BOT_STATE_DATA_OUT;
327 }
328 else if(urb_status == URB_STALL)
329 {
330 bot_trans->bot_state = BOT_STATE_ERROR;
331 }
332 break;
333
334 case BOT_STATE_RECV_CSW:
335 usbh_bulk_recv(puhost, msc_struct->chin, (uint8_t *)&bot_trans->csw,
336 MSC_CSW_LEN);
337 bot_trans->bot_state = BOT_STATE_RECV_CSW_WAIT;
338
339 break;
340 case BOT_STATE_RECV_CSW_WAIT:
341 urb_status = usbh_get_urb_status(puhost, msc_struct->chin);
342 if(urb_status == URB_DONE)
343 {
344 bot_trans->bot_state = BOT_STATE_SEND_CBW;
345 bot_trans->cmd_state = CMD_STATE_SEND;
346 status = usbh_check_csw(&bot_trans->cbw, &bot_trans->csw);
347 }
348 else if(urb_status == URB_STALL)
349 {
350 bot_trans->bot_state = BOT_STATE_ERROR;
351 }
352
353 break;
354 case BOT_STATE_ERROR:
355 if(usbh_clear_ept_feature(puhost, msc_struct->eptin, 0) == USB_OK)
356 {
357 bot_trans->bot_state = BOT_STATE_RECV_CSW;
358 }
359
360 break;
361
362 case BOT_STATE_COMPLETE:
363 break;
364
365 default:
366 break;
367 }
368
369 return status;
370}
371
380 usb_sts_type usbh_msc_bot_scsi_get_inquiry(void *uhost, msc_bot_trans_type *bot_trans,
381 uint8_t lun, msc_scsi_data_inquiry *inquiry)
382{
383 usb_sts_type status = USB_WAIT;
384 switch(bot_trans->cmd_state)
385 {
386 case CMD_STATE_SEND:
387 usbh_bot_cbw(&bot_trans->cbw, MSC_INQUIRY_DATA_LEN, MSC_INQUIRY_CMD_LEN, MSC_CBW_FLAG_IN);
388 usbh_cmd_inquiry(bot_trans, bot_trans->cbw.CBWCB, lun);
389 bot_trans->cmd_state = CMD_STATE_WAIT;
390 bot_trans->bot_state = BOT_STATE_SEND_CBW;
391 break;
392
393 case CMD_STATE_WAIT:
394 if(usb_bot_request(uhost, bot_trans) == USB_OK)
395 {
396 status = USB_OK;
397 bot_trans->cmd_state = CMD_STATE_SEND;
398 }
399 break;
400 default:
401 break;
402 }
403 return status;
404}
405
414 usb_sts_type usbh_msc_bot_scsi_capacity(void *uhost, msc_bot_trans_type *bot_trans,
415 uint8_t lun, msc_scsi_data_capacity *capacity)
416{
417 usb_sts_type status = USB_WAIT;
418 switch(bot_trans->cmd_state)
419 {
420 case CMD_STATE_SEND:
421 usbh_bot_cbw(&bot_trans->cbw, MSC_CAPACITY10_DATA_LEN, MSC_CAPACITY10_CMD_LEN, MSC_CBW_FLAG_IN);
422 usbh_cmd_capacity10(bot_trans, bot_trans->cbw.CBWCB, lun);
423 bot_trans->cmd_state = CMD_STATE_WAIT;
424 bot_trans->bot_state = BOT_STATE_SEND_CBW;
425 break;
426
427 case CMD_STATE_WAIT:
428 if(usb_bot_request(uhost, bot_trans) == USB_OK)
429 {
430 status = USB_OK;
431 capacity->blk_nbr = bot_trans->buffer[3] | bot_trans->buffer[2] << 8 |
432 bot_trans->buffer[1] << 16 | bot_trans->buffer[0] << 24;
433 capacity->blk_size = bot_trans->buffer[7] | bot_trans->buffer[6] << 8 ;
434 bot_trans->cmd_state = CMD_STATE_SEND;
435 }
436 break;
437 default:
438 break;
439 }
440 return status;
441}
442
450 usb_sts_type usbh_msc_bot_scsi_test_unit_ready(void *uhost, msc_bot_trans_type *bot_trans,
451 uint8_t lun)
452{
453 usb_sts_type status = USB_WAIT;
454 switch(bot_trans->cmd_state)
455 {
456 case CMD_STATE_SEND:
457 usbh_bot_cbw(&bot_trans->cbw, MSC_TEST_UNIT_READY_DATA_LEN,
458 MSC_TEST_UNIT_READY_CMD_LEN, MSC_CBW_FLAG_OUT);
459 usbh_cmd_test_unit_ready(bot_trans, bot_trans->cbw.CBWCB, lun);
460 bot_trans->cmd_state = CMD_STATE_WAIT;
461 bot_trans->bot_state = BOT_STATE_SEND_CBW;
462 break;
463
464 case CMD_STATE_WAIT:
465 if(usb_bot_request(uhost, bot_trans) == USB_OK)
466 {
467 status = USB_OK;
468 bot_trans->cmd_state = CMD_STATE_SEND;
469 }
470 break;
471 default:
472 break;
473 }
474 return status;
475}
476
484 usb_sts_type usbh_msc_bot_scsi_request_sense(void *uhost, msc_bot_trans_type *bot_trans,
485 uint8_t lun)
486{
487 usb_sts_type status = USB_WAIT;
488 switch(bot_trans->cmd_state)
489 {
490 case CMD_STATE_SEND:
491 usbh_bot_cbw(&bot_trans->cbw, MSC_REQUEST_SENSE_DATA_LEN,
492 MSC_REQUEST_SENSE_CMD_LEN, MSC_CBW_FLAG_IN);
493 usbh_cmd_requset_sense(bot_trans, bot_trans->cbw.CBWCB, lun);
494 bot_trans->cmd_state = CMD_STATE_WAIT;
495 bot_trans->bot_state = BOT_STATE_SEND_CBW;
496 break;
497
498 case CMD_STATE_WAIT:
499 if(usb_bot_request(uhost, bot_trans) == USB_OK)
500 {
501 status = USB_OK;
502 bot_trans->cmd_state = CMD_STATE_SEND;
503 }
504 break;
505 default:
506 break;
507 }
508 return status;
509}
510
521 usb_sts_type usbh_msc_bot_scsi_write(void *uhost, msc_bot_trans_type *bot_trans,
522 uint32_t address, uint8_t *write_data,
523 uint32_t write_len, uint8_t lun)
524{
525 usb_sts_type status = USB_WAIT;
526 switch(bot_trans->cmd_state)
527 {
528 case CMD_STATE_SEND:
529 usbh_bot_cbw(&bot_trans->cbw, write_len * 512,
530 MSC_WRITE_CMD_LEN, MSC_CBW_FLAG_OUT);
531 usbh_cmd_write(bot_trans, bot_trans->cbw.CBWCB, lun, write_len, address, write_data);
532 bot_trans->cmd_state = CMD_STATE_WAIT;
533 bot_trans->bot_state = BOT_STATE_SEND_CBW;
534 break;
535
536 case CMD_STATE_WAIT:
537 if(usb_bot_request(uhost, bot_trans) == USB_OK)
538 {
539 status = USB_OK;
540 bot_trans->cmd_state = CMD_STATE_SEND;
541 }
542 break;
543 default:
544 break;
545 }
546 return status;
547}
548
559 usb_sts_type usbh_msc_bot_scsi_read(void *uhost, msc_bot_trans_type *bot_trans,
560 uint32_t address, uint8_t *read_data,
561 uint32_t read_len, uint8_t lun)
562{
563 usb_sts_type status = USB_WAIT;
564 switch(bot_trans->cmd_state)
565 {
566 case CMD_STATE_SEND:
567 usbh_bot_cbw(&bot_trans->cbw, read_len * 512,
568 MSC_READ_CMD_LEN, MSC_CBW_FLAG_IN);
569 usbh_cmd_read(bot_trans, bot_trans->cbw.CBWCB, lun, read_len, address, read_data);
570 bot_trans->cmd_state = CMD_STATE_WAIT;
571 bot_trans->bot_state = BOT_STATE_SEND_CBW;
572 break;
573
574 case CMD_STATE_WAIT:
575 if(usb_bot_request(uhost, bot_trans) == USB_OK)
576 {
577 status = USB_OK;
578 bot_trans->cmd_state = CMD_STATE_SEND;
579 }
580 break;
581 default:
582 break;
583 }
584 return status;
585}
586
592 usb_sts_type msc_bot_scsi_init(usbh_msc_type *msc_struct)
593{
594 msc_struct->state = USBH_MSC_INIT;
595 msc_struct->ctrl_state = USBH_MSC_STATE_IDLE;
596 msc_struct->error = MSC_OK;
597 msc_struct->cur_lun = 0;
598 msc_struct->max_lun = 0;
599 msc_struct->use_lun = 0;
600 msc_struct->bot_trans.msc_struct = &usbh_msc;
601 msc_struct->bot_trans.cmd_state = CMD_STATE_SEND;
602 msc_struct->bot_trans.bot_state = BOT_STATE_SEND_CBW;
603 return USB_OK;
604}
605
606
msc_struct
msc_type msc_struct
Definition: msc_bot_scsi.c:42
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_OK
@ USB_OK
Definition: usb_std.h:218
USB_WAIT
@ USB_WAIT
Definition: usb_std.h:220
usbh_bulk_recv
usb_sts_type usbh_bulk_recv(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host bulk receive request
Definition: usbh_core.c:285
usbh_bulk_send
usb_sts_type usbh_bulk_send(usbh_core_type *uhost, uint8_t hc_num, uint8_t *buffer, uint16_t length)
usb host bulk send request
Definition: usbh_core.c:320
usbh_get_urb_status
urb_sts_type usbh_get_urb_status(usbh_core_type *uhost, uint8_t ch_num)
usb host get urb status
Definition: usbh_core.c:705
usbh_clear_ept_feature
usb_sts_type usbh_clear_ept_feature(usbh_core_type *uhost, uint8_t ept_num, uint8_t hc_num)
usb host clear endpoint feature
Definition: usbh_ctrl.c:886
MSC_CSW_LEN
#define MSC_CSW_LEN
Definition: usbh_msc_bot_scsi.h:56
MSC_CBW_TAG
#define MSC_CBW_TAG
Definition: usbh_msc_bot_scsi.h:51
MSC_READ_CMD_LEN
#define MSC_READ_CMD_LEN
Definition: usbh_msc_bot_scsi.h:67
MSC_CAPACITY10_CMD_LEN
#define MSC_CAPACITY10_CMD_LEN
Definition: usbh_msc_bot_scsi.h:62
MSC_REQUEST_SENSE_CMD_LEN
#define MSC_REQUEST_SENSE_CMD_LEN
Definition: usbh_msc_bot_scsi.h:64
MSC_CBW_FLAG_IN
#define MSC_CBW_FLAG_IN
Definition: usbh_msc_bot_scsi.h:52
MSC_TEST_UNIT_READY_DATA_LEN
#define MSC_TEST_UNIT_READY_DATA_LEN
Definition: usbh_msc_bot_scsi.h:59
MSC_INQUIRY_DATA_LEN
#define MSC_INQUIRY_DATA_LEN
Definition: usbh_msc_bot_scsi.h:61
MSC_CBW_SIGNATURE
#define MSC_CBW_SIGNATURE
Definition: usbh_msc_bot_scsi.h:49
MSC_OPCODE_INQUIRY
#define MSC_OPCODE_INQUIRY
Definition: usbh_msc_bot_scsi.h:69
MSC_OPCODE_REQUEST_SENSE
#define MSC_OPCODE_REQUEST_SENSE
Definition: usbh_msc_bot_scsi.h:72
MSC_TEST_UNIT_READY_CMD_LEN
#define MSC_TEST_UNIT_READY_CMD_LEN
Definition: usbh_msc_bot_scsi.h:58
MSC_OPCODE_WRITE10
#define MSC_OPCODE_WRITE10
Definition: usbh_msc_bot_scsi.h:73
MSC_OPCODE_READ10
#define MSC_OPCODE_READ10
Definition: usbh_msc_bot_scsi.h:74
MSC_REQUEST_SENSE_DATA_LEN
#define MSC_REQUEST_SENSE_DATA_LEN
Definition: usbh_msc_bot_scsi.h:65
MSC_INQUIRY_CMD_LEN
#define MSC_INQUIRY_CMD_LEN
Definition: usbh_msc_bot_scsi.h:60
MSC_OPCODE_TEST_UNIT_READY
#define MSC_OPCODE_TEST_UNIT_READY
Definition: usbh_msc_bot_scsi.h:71
MSC_CBW_CB_LEN
#define MSC_CBW_CB_LEN
Definition: usbh_msc_bot_scsi.h:57
MSC_CBW_FLAG_OUT
#define MSC_CBW_FLAG_OUT
Definition: usbh_msc_bot_scsi.h:53
MSC_CBW_LEN
#define MSC_CBW_LEN
Definition: usbh_msc_bot_scsi.h:55
MSC_WRITE_CMD_LEN
#define MSC_WRITE_CMD_LEN
Definition: usbh_msc_bot_scsi.h:66
MSC_OPCODE_CAPACITY
#define MSC_OPCODE_CAPACITY
Definition: usbh_msc_bot_scsi.h:70
MSC_CAPACITY10_DATA_LEN
#define MSC_CAPACITY10_DATA_LEN
Definition: usbh_msc_bot_scsi.h:63
USBH_MSC_INIT
@ USBH_MSC_INIT
Definition: usbh_msc_bot_scsi.h:102
BOT_STATE_DATA_IN
@ BOT_STATE_DATA_IN
Definition: usbh_msc_bot_scsi.h:81
BOT_STATE_DATA_IN_WAIT
@ BOT_STATE_DATA_IN_WAIT
Definition: usbh_msc_bot_scsi.h:82
BOT_STATE_ERROR
@ BOT_STATE_ERROR
Definition: usbh_msc_bot_scsi.h:87
BOT_STATE_DATA_OUT_WAIT
@ BOT_STATE_DATA_OUT_WAIT
Definition: usbh_msc_bot_scsi.h:84
BOT_STATE_SEND_CBW_WAIT
@ BOT_STATE_SEND_CBW_WAIT
Definition: usbh_msc_bot_scsi.h:80
BOT_STATE_SEND_CBW
@ BOT_STATE_SEND_CBW
Definition: usbh_msc_bot_scsi.h:79
BOT_STATE_COMPLETE
@ BOT_STATE_COMPLETE
Definition: usbh_msc_bot_scsi.h:88
BOT_STATE_RECV_CSW_WAIT
@ BOT_STATE_RECV_CSW_WAIT
Definition: usbh_msc_bot_scsi.h:86
BOT_STATE_RECV_CSW
@ BOT_STATE_RECV_CSW
Definition: usbh_msc_bot_scsi.h:85
BOT_STATE_DATA_OUT
@ BOT_STATE_DATA_OUT
Definition: usbh_msc_bot_scsi.h:83
MSC_OK
@ MSC_OK
Definition: usbh_msc_bot_scsi.h:116
CMD_STATE_SEND
@ CMD_STATE_SEND
Definition: usbh_msc_bot_scsi.h:93
CMD_STATE_WAIT
@ CMD_STATE_WAIT
Definition: usbh_msc_bot_scsi.h:94
usbh_cmd_test_unit_ready
static usb_sts_type usbh_cmd_test_unit_ready(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
usb host msc command test unit ready
Definition: usbh_msc_bot_scsi.c:120
usbh_cmd_requset_sense
static usb_sts_type usbh_cmd_requset_sense(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
usb host msc command request sense
Definition: usbh_msc_bot_scsi.c:135
usbh_check_csw
usb_sts_type usbh_check_csw(msc_bot_cbw_type *cbw, msc_bot_csw_type *csw)
usb host csw check
Definition: usbh_msc_bot_scsi.c:205
usbh_msc_bot_scsi_capacity
usb_sts_type usbh_msc_bot_scsi_capacity(void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_capacity *capacity)
usb host msc bulk-only capacity request
Definition: usbh_msc_bot_scsi.c:414
usbh_msc_bot_scsi_test_unit_ready
usb_sts_type usbh_msc_bot_scsi_test_unit_ready(void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only tet unit ready request
Definition: usbh_msc_bot_scsi.c:450
usbh_msc_bot_scsi_write
usb_sts_type usbh_msc_bot_scsi_write(void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *write_data, uint32_t write_len, uint8_t lun)
usb host msc bulk-only write request
Definition: usbh_msc_bot_scsi.c:521
usbh_cmd_write
static usb_sts_type usbh_cmd_write(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun, uint32_t data_len, uint32_t address, uint8_t *buffer)
usb host msc command write
Definition: usbh_msc_bot_scsi.c:155
usbh_msc_bot_scsi_request_sense
usb_sts_type usbh_msc_bot_scsi_request_sense(void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only request sense request
Definition: usbh_msc_bot_scsi.c:484
usbh_msc_bot_scsi_get_inquiry
usb_sts_type usbh_msc_bot_scsi_get_inquiry(void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_inquiry *inquiry)
usb host msc bulk-only get inquiry request
Definition: usbh_msc_bot_scsi.c:380
usbh_cmd_read
static usb_sts_type usbh_cmd_read(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun, uint32_t data_len, uint32_t address, uint8_t *buffer)
usb host msc command read
Definition: usbh_msc_bot_scsi.c:182
usbh_bot_cbw
static usb_sts_type usbh_bot_cbw(msc_bot_cbw_type *cbw, uint32_t data_length, uint8_t cmd_len, uint8_t flag)
usb host bulk-only cbw
Definition: usbh_msc_bot_scsi.c:63
usbh_msc_bot_scsi_read
usb_sts_type usbh_msc_bot_scsi_read(void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *read_data, uint32_t read_len, uint8_t lun)
usb host msc bulk-only read request
Definition: usbh_msc_bot_scsi.c:559
usbh_cmd_capacity10
static usb_sts_type usbh_cmd_capacity10(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
usb host msc command capacity10
Definition: usbh_msc_bot_scsi.c:103
usb_bot_request
usb_sts_type usb_bot_request(void *uhost, msc_bot_trans_type *bot_trans)
usb host msc bulk-only request
Definition: usbh_msc_bot_scsi.c:218
usbh_cmd_inquiry
static usb_sts_type usbh_cmd_inquiry(msc_bot_trans_type *bot_trans, uint8_t *cmd, uint8_t lun)
usb host msc command inquiry
Definition: usbh_msc_bot_scsi.c:85
msc_bot_scsi_init
usb_sts_type msc_bot_scsi_init(usbh_msc_type *msc_struct)
usb host msc init
Definition: usbh_msc_bot_scsi.c:592
USBH_MSC_STATE_IDLE
@ USBH_MSC_STATE_IDLE
Definition: usbh_msc_class.h:84
usbh_msc
usbh_msc_type usbh_msc
Definition: usbh_msc_class.c:53
msc_bot_cbw_type
usb msc bulk-only command block wrapper type
Definition: usbh_msc_bot_scsi.h:152
msc_bot_cbw_type::dCBWDataTransferLength
uint32_t dCBWDataTransferLength
Definition: usbh_msc_bot_scsi.h:155
msc_bot_cbw_type::bCBWCBLength
uint8_t bCBWCBLength
Definition: usbh_msc_bot_scsi.h:158
msc_bot_cbw_type::CBWCB
uint8_t CBWCB[16]
Definition: usbh_msc_bot_scsi.h:159
msc_bot_cbw_type::dCBWSignature
uint32_t dCBWSignature
Definition: usbh_msc_bot_scsi.h:153
msc_bot_cbw_type::dCBWTag
uint32_t dCBWTag
Definition: usbh_msc_bot_scsi.h:154
msc_bot_cbw_type::bmCBWFlags
uint8_t bmCBWFlags
Definition: usbh_msc_bot_scsi.h:156
msc_bot_csw_type
usb msc bulk-only command status wrapper type
Definition: usbh_msc_bot_scsi.h:166
msc_bot_trans_type
usb msc bulk-only transfer control type
Definition: usbh_msc_bot_scsi.h:177
msc_bot_trans_type::data
uint8_t * data
Definition: usbh_msc_bot_scsi.h:183
msc_bot_trans_type::buffer
uint8_t buffer[32]
Definition: usbh_msc_bot_scsi.h:178
msc_bot_trans_type::msc_struct
void * msc_struct
Definition: usbh_msc_bot_scsi.h:184
msc_bot_trans_type::csw
msc_bot_csw_type csw
Definition: usbh_msc_bot_scsi.h:180
msc_bot_trans_type::bot_state
msc_bot_state_type bot_state
Definition: usbh_msc_bot_scsi.h:182
msc_bot_trans_type::cbw
msc_bot_cbw_type cbw
Definition: usbh_msc_bot_scsi.h:179
msc_bot_trans_type::cmd_state
msc_cmd_state_type cmd_state
Definition: usbh_msc_bot_scsi.h:181
msc_scsi_data_capacity
usb msc capacity data type
Definition: usbh_msc_bot_scsi.h:143
msc_scsi_data_capacity::blk_nbr
uint32_t blk_nbr
Definition: usbh_msc_bot_scsi.h:144
msc_scsi_data_capacity::blk_size
uint32_t blk_size
Definition: usbh_msc_bot_scsi.h:145
msc_scsi_data_inquiry
usb msc inquiry data type
Definition: usbh_msc_bot_scsi.h:126
msc_type::data
uint8_t data[4096]
Definition: msc_bot_scsi.h:206
msc_type::max_lun
uint32_t max_lun
Definition: msc_bot_scsi.h:197
usbh_msc_type
usb msc struct
Definition: usbh_msc_class.h:122
usbh_core.h
usb host core header file
usbh_ctrl.h
usb header file
usbh_msc_bot_scsi.h
usb host msc bulk-only transfer and scsi header file
usbh_msc_class.h
usb host msc class header file


AT32F415 Firmwary Library: usbh_msc_bot_scsi.h Source File

  • middlewares
  • usbh_class
  • usbh_msc
usbh_msc_bot_scsi.h
Go to the documentation of this file.
1
26/* Define to prevent recursive inclusion -------------------------------------*/
27#ifndef __USBH_MSC_BOT_SCSI_H
28#define __USBH_MSC_BOT_SCSI_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "usbh_core.h"
35#include "usb_conf.h"
36
49#define MSC_CBW_SIGNATURE 0x43425355
50#define MSC_CSW_SIGNATURE 0x53425355
51#define MSC_CBW_TAG 0x50607080
52#define MSC_CBW_FLAG_IN 0x80
53#define MSC_CBW_FLAG_OUT 0x00
54
55#define MSC_CBW_LEN 31
56#define MSC_CSW_LEN 13
57#define MSC_CBW_CB_LEN 16
58#define MSC_TEST_UNIT_READY_CMD_LEN 12
59#define MSC_TEST_UNIT_READY_DATA_LEN 0
60#define MSC_INQUIRY_CMD_LEN 12
61#define MSC_INQUIRY_DATA_LEN 36
62#define MSC_CAPACITY10_CMD_LEN 12
63#define MSC_CAPACITY10_DATA_LEN 8
64#define MSC_REQUEST_SENSE_CMD_LEN 12
65#define MSC_REQUEST_SENSE_DATA_LEN 18
66#define MSC_WRITE_CMD_LEN 12
67#define MSC_READ_CMD_LEN 10
68
69#define MSC_OPCODE_INQUIRY 0x12
70#define MSC_OPCODE_CAPACITY 0x25
71#define MSC_OPCODE_TEST_UNIT_READY 0x00
72#define MSC_OPCODE_REQUEST_SENSE 0x03
73#define MSC_OPCODE_WRITE10 0x2A
74#define MSC_OPCODE_READ10 0x28
75
76typedef enum
77{
78 BOT_STATE_IDLE,
79 BOT_STATE_SEND_CBW,
80 BOT_STATE_SEND_CBW_WAIT,
81 BOT_STATE_DATA_IN,
82 BOT_STATE_DATA_IN_WAIT,
83 BOT_STATE_DATA_OUT,
84 BOT_STATE_DATA_OUT_WAIT,
85 BOT_STATE_RECV_CSW,
86 BOT_STATE_RECV_CSW_WAIT,
87 BOT_STATE_ERROR,
88 BOT_STATE_COMPLETE
89}msc_bot_state_type;
90
91typedef enum
92{
93 CMD_STATE_SEND,
94 CMD_STATE_WAIT,
95}msc_cmd_state_type;
96
100typedef enum
101{
102 USBH_MSC_INIT,
103 USBH_MSC_INQUIRY,
104 USBH_MSC_TEST_UNIT_READY,
105 USBH_MSC_READ_CAPACITY10,
106 USBH_MSC_REQUEST_SENSE,
107 USBH_MSC_READ10,
108 USBH_MSC_WRITE,
109 USBH_MSC_BUSY,
110 USBH_MSC_ERROR,
111 USBH_MSC_IDLE
112}msc_state_type;
113
114typedef enum
115{
116 MSC_OK,
117 MSC_NOT_READY,
118 MSC_ERROR
119}msc_error_type;
120
121
125typedef struct
126{
127 uint8_t pdev_type;
128 uint8_t rmb;
129 uint8_t version;
130 uint8_t data_format;
131 uint8_t length;
132 uint8_t reserved[3];
133 uint8_t vendor[8];
134 uint8_t product[16];
135 uint8_t revision[4];
136}msc_scsi_data_inquiry;
137
138
142typedef struct
143{
144 uint32_t blk_nbr;
145 uint32_t blk_size;
146}msc_scsi_data_capacity;
147
151typedef struct
152{
153 uint32_t dCBWSignature;
154 uint32_t dCBWTag;
155 uint32_t dCBWDataTransferLength;
156 uint8_t bmCBWFlags;
157 uint8_t bCBWLUN;
158 uint8_t bCBWCBLength;
159 uint8_t CBWCB[MSC_CBW_CB_LEN];
160}msc_bot_cbw_type;
161
165typedef struct
166{
167 uint32_t dCBWSignature;
168 uint32_t dCBWTag;
169 uint32_t dCSWDataResidue;
170 uint8_t bCSWStatus;
171}msc_bot_csw_type;
172
176typedef struct
177{
178 uint8_t buffer[32];
179 msc_bot_cbw_type cbw;
180 msc_bot_csw_type csw;
181 msc_cmd_state_type cmd_state;
182 msc_bot_state_type bot_state;
183 uint8_t *data;
184 void *msc_struct;
185}msc_bot_trans_type;
186
190typedef struct
191{
192 msc_scsi_data_inquiry inquiry;
193 msc_scsi_data_capacity capacity;
194 msc_state_type state;
195 msc_error_type ready;
196 usb_sts_type pre_state;
197 uint8_t change;
198}usbh_msc_unit_type;
199
200
201 usb_sts_type usb_bot_request(void *uhost, msc_bot_trans_type *bot_trans);
202
203 usb_sts_type usbh_msc_bot_scsi_get_inquiry(void *uhost, msc_bot_trans_type *bot_trans,
204 uint8_t lun, msc_scsi_data_inquiry *inquiry);
205
206 usb_sts_type usbh_msc_bot_scsi_capacity(void *uhost, msc_bot_trans_type *bot_trans,
207 uint8_t lun, msc_scsi_data_capacity *capacity);
208
209 usb_sts_type usbh_msc_bot_scsi_test_unit_ready(void *uhost, msc_bot_trans_type *bot_trans,
210 uint8_t lun);
211
212 usb_sts_type usbh_msc_bot_scsi_request_sense(void *uhost, msc_bot_trans_type *bot_trans,
213 uint8_t lun);
214
215 usb_sts_type usbh_msc_bot_scsi_write(void *uhost, msc_bot_trans_type *bot_trans,
216 uint32_t address, uint8_t *write_data,
217 uint32_t write_len, uint8_t lun);
218
219 usb_sts_type usbh_msc_bot_scsi_read(void *uhost, msc_bot_trans_type *bot_trans,
220 uint32_t address, uint8_t *read_data,
221 uint32_t read_len, uint8_t lun);
233#ifdef __cplusplus
234}
235#endif
236
237#endif
238
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
msc_state_type
msc_state_type
usb msc process state
Definition: usbh_msc_bot_scsi.h:101
usbh_msc_bot_scsi_capacity
usb_sts_type usbh_msc_bot_scsi_capacity(void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_capacity *capacity)
usb host msc bulk-only capacity request
Definition: usbh_msc_bot_scsi.c:414
usbh_msc_bot_scsi_test_unit_ready
usb_sts_type usbh_msc_bot_scsi_test_unit_ready(void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only tet unit ready request
Definition: usbh_msc_bot_scsi.c:450
usbh_msc_bot_scsi_write
usb_sts_type usbh_msc_bot_scsi_write(void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *write_data, uint32_t write_len, uint8_t lun)
usb host msc bulk-only write request
Definition: usbh_msc_bot_scsi.c:521
usbh_msc_bot_scsi_request_sense
usb_sts_type usbh_msc_bot_scsi_request_sense(void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only request sense request
Definition: usbh_msc_bot_scsi.c:484
usbh_msc_bot_scsi_get_inquiry
usb_sts_type usbh_msc_bot_scsi_get_inquiry(void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_inquiry *inquiry)
usb host msc bulk-only get inquiry request
Definition: usbh_msc_bot_scsi.c:380
usbh_msc_bot_scsi_read
usb_sts_type usbh_msc_bot_scsi_read(void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *read_data, uint32_t read_len, uint8_t lun)
usb host msc bulk-only read request
Definition: usbh_msc_bot_scsi.c:559
msc_bot_state_type
msc_bot_state_type
Definition: usbh_msc_bot_scsi.h:77
usb_bot_request
usb_sts_type usb_bot_request(void *uhost, msc_bot_trans_type *bot_trans)
usb host msc bulk-only request
Definition: usbh_msc_bot_scsi.c:218
msc_error_type
msc_error_type
Definition: usbh_msc_bot_scsi.h:115
MSC_CBW_CB_LEN
#define MSC_CBW_CB_LEN
Definition: usbh_msc_bot_scsi.h:57
msc_cmd_state_type
msc_cmd_state_type
Definition: usbh_msc_bot_scsi.h:92
USBH_MSC_WRITE
@ USBH_MSC_WRITE
Definition: usbh_msc_bot_scsi.h:108
USBH_MSC_READ10
@ USBH_MSC_READ10
Definition: usbh_msc_bot_scsi.h:107
USBH_MSC_TEST_UNIT_READY
@ USBH_MSC_TEST_UNIT_READY
Definition: usbh_msc_bot_scsi.h:104
USBH_MSC_ERROR
@ USBH_MSC_ERROR
Definition: usbh_msc_bot_scsi.h:110
USBH_MSC_REQUEST_SENSE
@ USBH_MSC_REQUEST_SENSE
Definition: usbh_msc_bot_scsi.h:106
USBH_MSC_READ_CAPACITY10
@ USBH_MSC_READ_CAPACITY10
Definition: usbh_msc_bot_scsi.h:105
USBH_MSC_INIT
@ USBH_MSC_INIT
Definition: usbh_msc_bot_scsi.h:102
USBH_MSC_INQUIRY
@ USBH_MSC_INQUIRY
Definition: usbh_msc_bot_scsi.h:103
USBH_MSC_BUSY
@ USBH_MSC_BUSY
Definition: usbh_msc_bot_scsi.h:109
USBH_MSC_IDLE
@ USBH_MSC_IDLE
Definition: usbh_msc_bot_scsi.h:111
BOT_STATE_DATA_IN
@ BOT_STATE_DATA_IN
Definition: usbh_msc_bot_scsi.h:81
BOT_STATE_IDLE
@ BOT_STATE_IDLE
Definition: usbh_msc_bot_scsi.h:78
BOT_STATE_DATA_IN_WAIT
@ BOT_STATE_DATA_IN_WAIT
Definition: usbh_msc_bot_scsi.h:82
BOT_STATE_ERROR
@ BOT_STATE_ERROR
Definition: usbh_msc_bot_scsi.h:87
BOT_STATE_DATA_OUT_WAIT
@ BOT_STATE_DATA_OUT_WAIT
Definition: usbh_msc_bot_scsi.h:84
BOT_STATE_SEND_CBW_WAIT
@ BOT_STATE_SEND_CBW_WAIT
Definition: usbh_msc_bot_scsi.h:80
BOT_STATE_SEND_CBW
@ BOT_STATE_SEND_CBW
Definition: usbh_msc_bot_scsi.h:79
BOT_STATE_COMPLETE
@ BOT_STATE_COMPLETE
Definition: usbh_msc_bot_scsi.h:88
BOT_STATE_RECV_CSW_WAIT
@ BOT_STATE_RECV_CSW_WAIT
Definition: usbh_msc_bot_scsi.h:86
BOT_STATE_RECV_CSW
@ BOT_STATE_RECV_CSW
Definition: usbh_msc_bot_scsi.h:85
BOT_STATE_DATA_OUT
@ BOT_STATE_DATA_OUT
Definition: usbh_msc_bot_scsi.h:83
MSC_OK
@ MSC_OK
Definition: usbh_msc_bot_scsi.h:116
MSC_NOT_READY
@ MSC_NOT_READY
Definition: usbh_msc_bot_scsi.h:117
MSC_ERROR
@ MSC_ERROR
Definition: usbh_msc_bot_scsi.h:118
CMD_STATE_SEND
@ CMD_STATE_SEND
Definition: usbh_msc_bot_scsi.h:93
CMD_STATE_WAIT
@ CMD_STATE_WAIT
Definition: usbh_msc_bot_scsi.h:94
msc_bot_cbw_type
usb msc bulk-only command block wrapper type
Definition: usbh_msc_bot_scsi.h:152
msc_bot_cbw_type::dCBWDataTransferLength
uint32_t dCBWDataTransferLength
Definition: usbh_msc_bot_scsi.h:155
msc_bot_cbw_type::bCBWCBLength
uint8_t bCBWCBLength
Definition: usbh_msc_bot_scsi.h:158
msc_bot_cbw_type::dCBWSignature
uint32_t dCBWSignature
Definition: usbh_msc_bot_scsi.h:153
msc_bot_cbw_type::dCBWTag
uint32_t dCBWTag
Definition: usbh_msc_bot_scsi.h:154
msc_bot_cbw_type::bCBWLUN
uint8_t bCBWLUN
Definition: usbh_msc_bot_scsi.h:157
msc_bot_cbw_type::bmCBWFlags
uint8_t bmCBWFlags
Definition: usbh_msc_bot_scsi.h:156
msc_bot_csw_type
usb msc bulk-only command status wrapper type
Definition: usbh_msc_bot_scsi.h:166
msc_bot_csw_type::dCBWSignature
uint32_t dCBWSignature
Definition: usbh_msc_bot_scsi.h:167
msc_bot_csw_type::dCBWTag
uint32_t dCBWTag
Definition: usbh_msc_bot_scsi.h:168
msc_bot_csw_type::dCSWDataResidue
uint32_t dCSWDataResidue
Definition: usbh_msc_bot_scsi.h:169
msc_bot_csw_type::bCSWStatus
uint8_t bCSWStatus
Definition: usbh_msc_bot_scsi.h:170
msc_bot_trans_type
usb msc bulk-only transfer control type
Definition: usbh_msc_bot_scsi.h:177
msc_bot_trans_type::data
uint8_t * data
Definition: usbh_msc_bot_scsi.h:183
msc_bot_trans_type::msc_struct
void * msc_struct
Definition: usbh_msc_bot_scsi.h:184
msc_bot_trans_type::csw
msc_bot_csw_type csw
Definition: usbh_msc_bot_scsi.h:180
msc_bot_trans_type::bot_state
msc_bot_state_type bot_state
Definition: usbh_msc_bot_scsi.h:182
msc_bot_trans_type::cbw
msc_bot_cbw_type cbw
Definition: usbh_msc_bot_scsi.h:179
msc_bot_trans_type::cmd_state
msc_cmd_state_type cmd_state
Definition: usbh_msc_bot_scsi.h:181
msc_scsi_data_capacity
usb msc capacity data type
Definition: usbh_msc_bot_scsi.h:143
msc_scsi_data_capacity::blk_nbr
uint32_t blk_nbr
Definition: usbh_msc_bot_scsi.h:144
msc_scsi_data_capacity::blk_size
uint32_t blk_size
Definition: usbh_msc_bot_scsi.h:145
msc_scsi_data_inquiry
usb msc inquiry data type
Definition: usbh_msc_bot_scsi.h:126
msc_scsi_data_inquiry::rmb
uint8_t rmb
Definition: usbh_msc_bot_scsi.h:128
msc_scsi_data_inquiry::pdev_type
uint8_t pdev_type
Definition: usbh_msc_bot_scsi.h:127
msc_scsi_data_inquiry::data_format
uint8_t data_format
Definition: usbh_msc_bot_scsi.h:130
msc_scsi_data_inquiry::version
uint8_t version
Definition: usbh_msc_bot_scsi.h:129
msc_scsi_data_inquiry::length
uint8_t length
Definition: usbh_msc_bot_scsi.h:131
usbh_msc_unit_type
usb msc bank type
Definition: usbh_msc_bot_scsi.h:191
usbh_msc_unit_type::pre_state
usb_sts_type pre_state
Definition: usbh_msc_bot_scsi.h:196
usbh_msc_unit_type::ready
msc_error_type ready
Definition: usbh_msc_bot_scsi.h:195
usbh_msc_unit_type::capacity
msc_scsi_data_capacity capacity
Definition: usbh_msc_bot_scsi.h:193
usbh_msc_unit_type::change
uint8_t change
Definition: usbh_msc_bot_scsi.h:197
usbh_msc_unit_type::state
msc_state_type state
Definition: usbh_msc_bot_scsi.h:194
usbh_msc_unit_type::inquiry
msc_scsi_data_inquiry inquiry
Definition: usbh_msc_bot_scsi.h:192
usbh_core.h
usb host core header file


AT32F415 Firmwary Library: usbh_msc_class.c Source File

  • middlewares
  • usbh_class
  • usbh_msc
usbh_msc_class.c
Go to the documentation of this file.
1
26#include "usbh_msc_class.h"
27#include "usb_conf.h"
28#include "usbh_core.h"
29#include "usbh_ctrl.h"
30
44 usb_sts_type uhost_init_handler(void *uhost);
45 usb_sts_type uhost_reset_handler(void *uhost);
46 usb_sts_type uhost_request_handler(void *uhost);
47 usb_sts_type uhost_process_handler(void *uhost);
48
49 usb_sts_type usbh_msc_get_max_lun(void *uhost, uint8_t *lun);
50 usb_sts_type usbh_msc_clear_feature(void *uhost, uint8_t ept_num);
51
52
53 usbh_msc_type usbh_msc;
54
55usbh_class_handler_type uhost_class_handler =
56{
57 uhost_init_handler,
58 uhost_reset_handler,
59 uhost_request_handler,
60 uhost_process_handler,
61 &usbh_msc
62};
63
64
65
71 usb_sts_type uhost_init_handler(void *uhost)
72{
73 usbh_core_type *puhost = (usbh_core_type *)uhost;
74 usb_sts_type status = USB_OK;
75 uint8_t if_x, eptidx = 0;
76 usbh_msc_type *pmsc = &usbh_msc;
77 puhost->class_handler->pdata = &usbh_msc;
78
79 if_x = usbh_find_interface(puhost, USB_CLASS_CODE_MSC, MSC_SUBCLASS_SCSI_TRANS, MSC_PROTOCOL_BBB);
80 if(if_x == 0xFF)
81 {
82 USBH_DEBUG("Unsupport Device!");
83 return USB_NOT_SUPPORT;
84 }
85 pmsc->protocol = puhost->dev.cfg_desc.interface[if_x].interface.bInterfaceProtocol;
86
87 for(eptidx = 0; eptidx < puhost->dev.cfg_desc.interface[if_x].interface.bNumEndpoints; eptidx ++)
88 {
89 if(puhost->dev.cfg_desc.interface[if_x].endpoint[eptidx].bEndpointAddress & 0x80)
90 {
91 pmsc->eptin = puhost->dev.cfg_desc.interface[if_x].endpoint[eptidx].bEndpointAddress;
92 pmsc->in_maxpacket = puhost->dev.cfg_desc.interface[if_x].endpoint[eptidx].wMaxPacketSize;
93 pmsc->in_poll = puhost->dev.cfg_desc.interface[if_x].endpoint[eptidx].bInterval;
94
95 pmsc->chin = usbh_alloc_channel(puhost, pmsc->eptin);
96 /* enable channel */
97 usbh_hc_open(puhost, pmsc->chin, pmsc->eptin,
98 puhost->dev.address, EPT_BULK_TYPE,
99 pmsc->in_maxpacket,
100 puhost->dev.speed);
101 }
102 else
103 {
104 pmsc->eptout = puhost->dev.cfg_desc.interface[if_x].endpoint[eptidx].bEndpointAddress;
105 pmsc->out_maxpacket = puhost->dev.cfg_desc.interface[if_x].endpoint[eptidx].wMaxPacketSize;
106 pmsc->out_poll = puhost->dev.cfg_desc.interface[if_x].endpoint[eptidx].bInterval;
107
108 pmsc->chout = usbh_alloc_channel(puhost, pmsc->eptout);
109 /* enable channel */
110 usbh_hc_open(puhost, pmsc->chout,pmsc->eptout,
111 puhost->dev.address, EPT_BULK_TYPE,
112 pmsc->out_maxpacket,
113 puhost->dev.speed);
114 }
115 }
116
117 msc_bot_scsi_init(pmsc);
118 usbh_set_toggle(puhost, pmsc->chout, 0);
119 usbh_set_toggle(puhost, pmsc->chin, 0);
120 return status;
121}
122
128 usb_sts_type uhost_reset_handler(void *uhost)
129{
130 usbh_core_type *puhost = (usbh_core_type *)uhost;
131 usbh_msc_type *pmsc = (usbh_msc_type *)puhost->class_handler->pdata;
132 usb_sts_type status = USB_OK;
133 uint8_t i_index = 0;
134
135 if(puhost->class_handler->pdata)
136 {
137 return status;
138 }
139
140 for(i_index = 0; i_index < pmsc->max_lun ; i_index ++)
141 {
142 pmsc->l_unit_n[i_index].pre_state = USB_FAIL;
143 pmsc->l_unit_n[i_index].change = 0;
144 pmsc->l_unit_n[i_index].state = USBH_MSC_INIT;
145 pmsc->l_unit_n[i_index].ready = MSC_NOT_READY;
146 }
147
148 if(pmsc->chin != 0 )
149 {
150 usbh_free_channel(puhost, pmsc->chin);
151 usbh_ch_disable(puhost, pmsc->chin);
152 pmsc->chin = 0;
153 }
154
155 if(pmsc->chout != 0 )
156 {
157 usbh_free_channel(puhost, pmsc->chout);
158 usbh_ch_disable(puhost, pmsc->chout);
159 pmsc->chout = 0;
160 }
161
162 return status;
163}
164
170 usb_sts_type uhost_request_handler(void *uhost)
171{
172 usbh_core_type *puhost = (usbh_core_type *)uhost;
173 usbh_msc_type *pmsc = (usbh_msc_type *)puhost->class_handler->pdata;
174 usb_sts_type status = USB_WAIT;
175 uint8_t i_index = 0;
176
177 switch(pmsc->ctrl_state)
178 {
179 case USBH_MSC_STATE_IDLE:
180 pmsc->ctrl_state = USBH_MSC_STATE_GET_LUN;
181 break;
182 case USBH_MSC_STATE_GET_LUN:
183 if((status = usbh_msc_get_max_lun(uhost, (uint8_t *)&pmsc->max_lun)) == USB_OK)
184 {
185 pmsc->max_lun = (pmsc->max_lun & 0xFF) > USBH_SUPPORT_MAX_LUN ? USBH_SUPPORT_MAX_LUN:((pmsc->max_lun & 0xFF) + 1);
186 USBH_DEBUG("Support max lun %d", pmsc->max_lun);
187 for(i_index = 0; i_index < pmsc->max_lun ; i_index ++)
188 {
189 pmsc->l_unit_n[i_index].pre_state = USB_FAIL;
190 pmsc->l_unit_n[i_index].change = 0;
191 pmsc->l_unit_n[i_index].state = USBH_MSC_INIT;
192 }
193 }
194 break;
195 case USBH_MSC_STATE_ERROR:
196 if((usbh_msc_clear_feature(uhost, 0)) == USB_OK)
197 {
198 pmsc->ctrl_state = USBH_MSC_STATE_GET_LUN;
199 }
200 break;
201 default:
202 break;
203 }
204
205 return status;
206}
207
213 usb_sts_type uhost_process_handler(void *uhost)
214{
215 usbh_core_type *puhost = (usbh_core_type *)uhost;
216 usbh_msc_type *pmsc = (usbh_msc_type *)puhost->class_handler->pdata;
217 uint64_t msize = 0;
218 usb_sts_type status;
219 switch(pmsc->state)
220 {
221 case USBH_MSC_INIT:
222 if(pmsc->cur_lun < pmsc->max_lun)
223 {
224 switch(pmsc->l_unit_n[pmsc->cur_lun].state)
225 {
226 case USBH_MSC_INIT:
227 pmsc->l_unit_n[pmsc->cur_lun].ready = MSC_NOT_READY;
228 pmsc->l_unit_n[pmsc->cur_lun].state = USBH_MSC_INQUIRY;
229 break;
230 case USBH_MSC_INQUIRY:
231 status = usbh_msc_bot_scsi_get_inquiry(uhost, &pmsc->bot_trans, pmsc->cur_lun, &pmsc->l_unit_n[pmsc->cur_lun].inquiry);
232 if(status == USB_OK)
233 {
234 pmsc->l_unit_n[pmsc->cur_lun].state = USBH_MSC_TEST_UNIT_READY;
235 }
236 else if(status == USB_FAIL)
237 {
238 pmsc->l_unit_n[pmsc->cur_lun].state = USBH_MSC_REQUEST_SENSE;
239 }
240 break;
241 case USBH_MSC_TEST_UNIT_READY:
242 status = usbh_msc_bot_scsi_test_unit_ready(uhost, &pmsc->bot_trans, pmsc->cur_lun);
243 if(status == USB_OK)
244 {
245 pmsc->l_unit_n[pmsc->cur_lun].state = USBH_MSC_READ_CAPACITY10;
246 pmsc->l_unit_n[pmsc->cur_lun].ready = MSC_OK;
247 }
248 else if(status == USB_FAIL)
249 {
250 pmsc->l_unit_n[pmsc->cur_lun].state = USBH_MSC_REQUEST_SENSE;
251 pmsc->l_unit_n[pmsc->cur_lun].ready = MSC_NOT_READY;
252 }
253 break;
254
255 case USBH_MSC_READ_CAPACITY10:
256 status = usbh_msc_bot_scsi_capacity(uhost, &pmsc->bot_trans, pmsc->cur_lun, &pmsc->l_unit_n[pmsc->cur_lun].capacity);
257 if(status == USB_OK)
258 {
259 msize = (uint64_t)pmsc->l_unit_n[pmsc->cur_lun].capacity.blk_nbr * (uint64_t)pmsc->l_unit_n[pmsc->cur_lun].capacity.blk_size;
260 USBH_DEBUG("Device capacity: %llu Byte", msize);
261 USBH_DEBUG("Block num: %d ", pmsc->l_unit_n[pmsc->cur_lun].capacity.blk_nbr);
262 USBH_DEBUG("Block size: %d Byte", pmsc->l_unit_n[pmsc->cur_lun].capacity.blk_size);
263 pmsc->l_unit_n[pmsc->cur_lun].state = USBH_MSC_IDLE;
264 pmsc->state = USBH_MSC_IDLE;
265 pmsc->cur_lun ++;
266 }
267 else if(status == USB_FAIL)
268 {
269 pmsc->l_unit_n[pmsc->cur_lun].state = USBH_MSC_REQUEST_SENSE;
270 }
271 break;
272 case USBH_MSC_REQUEST_SENSE:
273 status = usbh_msc_bot_scsi_request_sense(uhost, &pmsc->bot_trans, pmsc->cur_lun);
274 if(status == USB_OK)
275 {
276 pmsc->l_unit_n[pmsc->cur_lun].state = USBH_MSC_IDLE;
277 pmsc->cur_lun ++;
278 }
279 else if(status == USB_FAIL)
280 {
281 pmsc->l_unit_n[pmsc->cur_lun].ready = MSC_NOT_READY;
282 pmsc->cur_lun ++;
283 }
284 break;
285
286 case USBH_MSC_BUSY:
287 break;
288 case USBH_MSC_ERROR:
289 break;
290 default:
291 break;
292 }
293 }
294 break;
295 case USBH_MSC_IDLE:
296 if(puhost->user_handler->user_application != NULL)
297 {
298 puhost->user_handler->user_application();
299 }
300 default:
301 break;
302 }
303 return USB_OK;
304}
305
306
313 usb_sts_type usbh_msc_get_max_lun(void *uhost, uint8_t *lun)
314{
315 usbh_core_type *puhost = (usbh_core_type *)uhost;
316 usb_sts_type status = USB_WAIT;
317 if(puhost->ctrl.state == CONTROL_IDLE )
318 {
319 puhost->ctrl.setup.bmRequestType = USB_DIR_D2H | USB_REQ_RECIPIENT_INTERFACE | USB_REQ_TYPE_CLASS;
320 puhost->ctrl.setup.bRequest = MSC_REQ_GET_MAX_LUN;
321 puhost->ctrl.setup.wValue = 0;
322 puhost->ctrl.setup.wIndex = 0;
323 puhost->ctrl.setup.wLength = 1;
324 usbh_ctrl_request(puhost, lun, 1);
325 }
326 else
327 {
328 status = usbh_ctrl_result_check(puhost, CONTROL_IDLE, ENUM_IDLE);
329 if(status == USB_OK || status == USB_NOT_SUPPORT)
330 {
331 status = USB_OK;
332 }
333 }
334 return status;
335}
336
343 usb_sts_type usbh_msc_clear_feature(void *uhost, uint8_t ept_num)
344{
345 usbh_core_type *puhost = (usbh_core_type *)uhost;
346 usb_sts_type status = USB_WAIT;
347 if(puhost->ctrl.state == CONTROL_IDLE )
348 {
349 puhost->ctrl.setup.bmRequestType = USB_DIR_H2D | USB_REQ_RECIPIENT_ENDPOINT | USB_REQ_TYPE_STANDARD;
350 puhost->ctrl.setup.bRequest = USB_STD_REQ_CLEAR_FEATURE;
351 puhost->ctrl.setup.wValue = 0;
352 puhost->ctrl.setup.wIndex = ept_num;
353 puhost->ctrl.setup.wLength = 0;
354 usbh_ctrl_request(puhost, 0, 0);
355 }
356 else
357 {
358 status = usbh_ctrl_result_check(puhost, CONTROL_IDLE, ENUM_IDLE);
359 if(status == USB_OK || status == USB_NOT_SUPPORT)
360 {
361 status = USB_OK;
362 }
363 }
364 return status;
365}
366
372 msc_error_type usbh_msc_is_ready(void *uhost, uint8_t lun)
373{
374 usbh_core_type *puhost = (usbh_core_type *)uhost;
375 usbh_msc_type *pmsc = (usbh_msc_type *)puhost->class_handler->pdata;
376 return pmsc->l_unit_n[lun].ready;
377}
378
388 usb_sts_type usbh_msc_read(void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
389{
390 usbh_core_type *puhost = (usbh_core_type *)uhost;
391 usbh_msc_type *pmsc = (usbh_msc_type *)puhost->class_handler->pdata;
392 usb_sts_type status;
393 uint32_t timeout = 0;
394 if(puhost->conn_sts == 0 || puhost->global_state != USBH_CLASS
395 || pmsc->l_unit_n[lun].state != USBH_MSC_IDLE)
396 {
397 return USB_FAIL;
398 }
399 pmsc->bot_trans.msc_struct = &usbh_msc;
400 pmsc->state = USBH_MSC_READ10;
401 pmsc->l_unit_n[lun].state = USBH_MSC_READ10;
402 pmsc->use_lun = lun;
403
404 timeout = puhost->timer;
405 while(1)
406 {
407 if(puhost->conn_sts == 0 || (puhost->timer - timeout) > (len * 10000))
408 {
409 pmsc->l_unit_n[lun].state = USBH_MSC_IDLE;
410 return USB_FAIL;
411 }
412 status = usbh_msc_bot_scsi_read(uhost, &pmsc->bot_trans, address, buffer, len, lun);
413 if(status == USB_OK)
414 {
415 pmsc->l_unit_n[lun].state = USBH_MSC_IDLE;
416 break;
417 }
418 else if(status == USB_FAIL)
419 {
420 pmsc->l_unit_n[lun].state = USBH_MSC_IDLE;
421 break;
422 }
423 }
424 return status;
425}
426
436 usb_sts_type usbh_msc_write(void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
437{
438 usbh_core_type *puhost = (usbh_core_type *)uhost;
439 usbh_msc_type *pmsc = (usbh_msc_type *)puhost->class_handler->pdata;
440 usb_sts_type status;
441 uint32_t timeout = 0;
442 if(puhost->conn_sts == 0 || puhost->global_state != USBH_CLASS
443 || pmsc->l_unit_n[lun].state != USBH_MSC_IDLE)
444 {
445 return USB_FAIL;
446 }
447
448 pmsc->bot_trans.msc_struct = &usbh_msc;
449 pmsc->state = USBH_MSC_WRITE;
450 pmsc->l_unit_n[lun].state = USBH_MSC_WRITE;
451 pmsc->use_lun = lun;
452
453 timeout = puhost->timer;
454 while(1)
455 {
456 if(puhost->conn_sts == 0 || (puhost->timer - timeout) > (len * 10000))
457 {
458 pmsc->l_unit_n[lun].state = USBH_MSC_IDLE;
459 return USB_FAIL;
460 }
461 status = usbh_msc_bot_scsi_write(uhost, &pmsc->bot_trans, address, buffer, len, lun);
462 if(status == USB_OK)
463 {
464 pmsc->l_unit_n[lun].state = USBH_MSC_IDLE;
465 break;
466 }
467 else if(status == USB_FAIL)
468 {
469 pmsc->l_unit_n[lun].state = USBH_MSC_IDLE;
470 break;
471 }
472 }
473 return status;
474}
475
USBH_DEBUG
#define USBH_DEBUG(...)
Definition: project/at_start_f415/examples/usb_host/hid_demo/inc/usb_conf.h:152
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
EPT_BULK_TYPE
@ EPT_BULK_TYPE
Definition: at32f415_usb.h:348
MSC_REQ_GET_MAX_LUN
#define MSC_REQ_GET_MAX_LUN
Definition: msc_bot_scsi.h:69
USB_STD_REQ_CLEAR_FEATURE
#define USB_STD_REQ_CLEAR_FEATURE
Definition: usb_std.h:78
USB_REQ_TYPE_STANDARD
#define USB_REQ_TYPE_STANDARD
usb request type
Definition: usb_std.h:63
USB_CLASS_CODE_MSC
#define USB_CLASS_CODE_MSC
Definition: usb_std.h:165
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_REQ_RECIPIENT_ENDPOINT
#define USB_REQ_RECIPIENT_ENDPOINT
Definition: usb_std.h:56
USB_REQ_RECIPIENT_INTERFACE
#define USB_REQ_RECIPIENT_INTERFACE
Definition: usb_std.h:55
USB_REQ_TYPE_CLASS
#define USB_REQ_TYPE_CLASS
Definition: usb_std.h:64
USB_OK
@ USB_OK
Definition: usb_std.h:218
USB_WAIT
@ USB_WAIT
Definition: usb_std.h:220
USB_NOT_SUPPORT
@ USB_NOT_SUPPORT
Definition: usb_std.h:221
USB_FAIL
@ USB_FAIL
Definition: usb_std.h:219
usbh_free_channel
void usbh_free_channel(usbh_core_type *uhost, uint8_t index)
usb host free channel
Definition: usbh_core.c:57
usbh_set_toggle
usb_sts_type usbh_set_toggle(usbh_core_type *uhost, uint8_t hc_num, uint8_t toggle)
usb host set toggle
Definition: usbh_core.c:94
usbh_ctrl_result_check
usb_sts_type usbh_ctrl_result_check(usbh_core_type *uhost, ctrl_ept0_sts_type next_ctrl_state, uint8_t next_enum_state)
usb wait control setup complete
Definition: usbh_core.c:716
usbh_hc_open
void usbh_hc_open(usbh_core_type *uhost, uint8_t chn, uint8_t ept_num, uint8_t dev_address, uint8_t type, uint8_t maxpacket, uint8_t speed)
usb host open channel
Definition: usbh_core.c:630
usbh_alloc_channel
uint16_t usbh_alloc_channel(usbh_core_type *uhost, uint8_t ept_addr)
usb host alloc channel
Definition: usbh_core.c:686
usbh_ch_disable
void usbh_ch_disable(usbh_core_type *uhost, uint8_t chn)
disable host channel
Definition: usbh_core.c:675
usbh_ctrl_request
usb_sts_type usbh_ctrl_request(usbh_core_type *uhost, uint8_t *buffer, uint16_t length)
usb host control request
Definition: usbh_ctrl.c:472
usbh_find_interface
uint8_t usbh_find_interface(usbh_core_type *uhost, uint8_t class_code, uint8_t sub_class, uint8_t protocol)
usb host find interface
Definition: usbh_ctrl.c:662
msc_error_type
msc_error_type
Definition: usbh_msc_bot_scsi.h:115
USBH_MSC_WRITE
@ USBH_MSC_WRITE
Definition: usbh_msc_bot_scsi.h:108
USBH_MSC_READ10
@ USBH_MSC_READ10
Definition: usbh_msc_bot_scsi.h:107
USBH_MSC_TEST_UNIT_READY
@ USBH_MSC_TEST_UNIT_READY
Definition: usbh_msc_bot_scsi.h:104
USBH_MSC_ERROR
@ USBH_MSC_ERROR
Definition: usbh_msc_bot_scsi.h:110
USBH_MSC_REQUEST_SENSE
@ USBH_MSC_REQUEST_SENSE
Definition: usbh_msc_bot_scsi.h:106
USBH_MSC_READ_CAPACITY10
@ USBH_MSC_READ_CAPACITY10
Definition: usbh_msc_bot_scsi.h:105
USBH_MSC_INIT
@ USBH_MSC_INIT
Definition: usbh_msc_bot_scsi.h:102
USBH_MSC_INQUIRY
@ USBH_MSC_INQUIRY
Definition: usbh_msc_bot_scsi.h:103
USBH_MSC_BUSY
@ USBH_MSC_BUSY
Definition: usbh_msc_bot_scsi.h:109
USBH_MSC_IDLE
@ USBH_MSC_IDLE
Definition: usbh_msc_bot_scsi.h:111
MSC_OK
@ MSC_OK
Definition: usbh_msc_bot_scsi.h:116
MSC_NOT_READY
@ MSC_NOT_READY
Definition: usbh_msc_bot_scsi.h:117
usbh_msc_bot_scsi_capacity
usb_sts_type usbh_msc_bot_scsi_capacity(void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_capacity *capacity)
usb host msc bulk-only capacity request
Definition: usbh_msc_bot_scsi.c:414
usbh_msc_bot_scsi_test_unit_ready
usb_sts_type usbh_msc_bot_scsi_test_unit_ready(void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only tet unit ready request
Definition: usbh_msc_bot_scsi.c:450
usbh_msc_bot_scsi_write
usb_sts_type usbh_msc_bot_scsi_write(void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *write_data, uint32_t write_len, uint8_t lun)
usb host msc bulk-only write request
Definition: usbh_msc_bot_scsi.c:521
usbh_msc_bot_scsi_request_sense
usb_sts_type usbh_msc_bot_scsi_request_sense(void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun)
usb host msc bulk-only request sense request
Definition: usbh_msc_bot_scsi.c:484
usbh_msc_bot_scsi_get_inquiry
usb_sts_type usbh_msc_bot_scsi_get_inquiry(void *uhost, msc_bot_trans_type *bot_trans, uint8_t lun, msc_scsi_data_inquiry *inquiry)
usb host msc bulk-only get inquiry request
Definition: usbh_msc_bot_scsi.c:380
usbh_msc_bot_scsi_read
usb_sts_type usbh_msc_bot_scsi_read(void *uhost, msc_bot_trans_type *bot_trans, uint32_t address, uint8_t *read_data, uint32_t read_len, uint8_t lun)
usb host msc bulk-only read request
Definition: usbh_msc_bot_scsi.c:559
msc_bot_scsi_init
usb_sts_type msc_bot_scsi_init(usbh_msc_type *msc_struct)
usb host msc init
Definition: usbh_msc_bot_scsi.c:592
USBH_SUPPORT_MAX_LUN
#define USBH_SUPPORT_MAX_LUN
Definition: usbh_msc_class.h:77
MSC_SUBCLASS_SCSI_TRANS
#define MSC_SUBCLASS_SCSI_TRANS
usb msc subclass code
Definition: usbh_msc_class.h:53
MSC_PROTOCOL_BBB
#define MSC_PROTOCOL_BBB
usb msc protocol code
Definition: usbh_msc_class.h:58
USBH_MSC_STATE_GET_LUN
@ USBH_MSC_STATE_GET_LUN
Definition: usbh_msc_class.h:85
USBH_MSC_STATE_IDLE
@ USBH_MSC_STATE_IDLE
Definition: usbh_msc_class.h:84
USBH_MSC_STATE_ERROR
@ USBH_MSC_STATE_ERROR
Definition: usbh_msc_class.h:86
uhost_process_handler
usb_sts_type uhost_process_handler(void *uhost)
usb host class process handler
Definition: usbh_msc_class.c:213
usbh_msc_write
usb_sts_type usbh_msc_write(void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc write
Definition: usbh_msc_class.c:436
usbh_msc_get_max_lun
usb_sts_type usbh_msc_get_max_lun(void *uhost, uint8_t *lun)
usb host msc get max lun
Definition: usbh_msc_class.c:313
usbh_msc_clear_feature
usb_sts_type usbh_msc_clear_feature(void *uhost, uint8_t ept_num)
usb host msc clear feature
Definition: usbh_msc_class.c:343
uhost_init_handler
usb_sts_type uhost_init_handler(void *uhost)
usb host class init handler
Definition: usbh_msc_class.c:71
uhost_class_handler
usbh_class_handler_type uhost_class_handler
Definition: usbh_msc_class.c:55
usbh_msc_read
usb_sts_type usbh_msc_read(void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc read
Definition: usbh_msc_class.c:388
uhost_request_handler
usb_sts_type uhost_request_handler(void *uhost)
usb host hid class request handler
Definition: usbh_msc_class.c:170
usbh_msc_is_ready
msc_error_type usbh_msc_is_ready(void *uhost, uint8_t lun)
usb host msc clear feature
Definition: usbh_msc_class.c:372
usbh_msc
usbh_msc_type usbh_msc
Definition: usbh_msc_class.c:53
uhost_reset_handler
usb_sts_type uhost_reset_handler(void *uhost)
usb host class reset handler
Definition: usbh_msc_class.c:128
msc_bot_trans_type::msc_struct
void * msc_struct
Definition: usbh_msc_bot_scsi.h:184
msc_scsi_data_capacity::blk_nbr
uint32_t blk_nbr
Definition: usbh_msc_bot_scsi.h:144
msc_scsi_data_capacity::blk_size
uint32_t blk_size
Definition: usbh_msc_bot_scsi.h:145
usbh_msc_type
usb msc struct
Definition: usbh_msc_class.h:122
usbh_msc_type::eptout
uint8_t eptout
Definition: usbh_msc_class.h:129
usbh_msc_type::in_poll
uint8_t in_poll
Definition: usbh_msc_class.h:126
usbh_msc_type::chin
uint8_t chin
Definition: usbh_msc_class.h:123
usbh_msc_type::out_poll
uint8_t out_poll
Definition: usbh_msc_class.h:131
usbh_msc_type::out_maxpacket
uint16_t out_maxpacket
Definition: usbh_msc_class.h:130
usbh_msc_type::bot_trans
msc_bot_trans_type bot_trans
Definition: usbh_msc_class.h:142
usbh_msc_type::in_maxpacket
uint16_t in_maxpacket
Definition: usbh_msc_class.h:125
usbh_msc_type::chout
uint8_t chout
Definition: usbh_msc_class.h:128
usbh_msc_type::protocol
uint8_t protocol
Definition: usbh_msc_class.h:132
usbh_msc_type::use_lun
uint32_t use_lun
Definition: usbh_msc_class.h:136
usbh_msc_type::state
msc_state_type state
Definition: usbh_msc_class.h:140
usbh_msc_type::max_lun
uint32_t max_lun
Definition: usbh_msc_class.h:134
usbh_msc_type::ctrl_state
usbh_msc_ctrl_state_type ctrl_state
Definition: usbh_msc_class.h:139
usbh_msc_type::eptin
uint8_t eptin
Definition: usbh_msc_class.h:124
usbh_msc_type::l_unit_n
usbh_msc_unit_type l_unit_n[0x2]
Definition: usbh_msc_class.h:143
usbh_msc_type::cur_lun
uint32_t cur_lun
Definition: usbh_msc_class.h:135
usbh_msc_unit_type::pre_state
usb_sts_type pre_state
Definition: usbh_msc_bot_scsi.h:196
usbh_msc_unit_type::ready
msc_error_type ready
Definition: usbh_msc_bot_scsi.h:195
usbh_msc_unit_type::capacity
msc_scsi_data_capacity capacity
Definition: usbh_msc_bot_scsi.h:193
usbh_msc_unit_type::change
uint8_t change
Definition: usbh_msc_bot_scsi.h:197
usbh_msc_unit_type::state
msc_state_type state
Definition: usbh_msc_bot_scsi.h:194
usbh_msc_unit_type::inquiry
msc_scsi_data_inquiry inquiry
Definition: usbh_msc_bot_scsi.h:192
usbh_core.h
usb host core header file
usbh_ctrl.h
usb header file
usbh_msc_class.h
usb host msc class header file


AT32F415 Firmwary Library: usbh_msc_class.h Source File

  • middlewares
  • usbh_class
  • usbh_msc
usbh_msc_class.h
Go to the documentation of this file.
1
26/* Define to prevent recursive inclusion -------------------------------------*/
27#ifndef __USBH_MSC_CLASS_H
28#define __USBH_MSC_CLASS_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "usbh_core.h"
35#include "usb_conf.h"
36#include "usbh_msc_bot_scsi.h"
37
53#define MSC_SUBCLASS_SCSI_TRANS 0x06
54
58#define MSC_PROTOCOL_BBB 0x50
59
63#define MSC_REQ_GET_MAX_LUN 0xFE
64#define MSC_REQ_BOMSR 0xFF
65
69#define USB_HID_GET_REPORT 0x01
70#define USB_HID_GET_IDLE 0x02
71#define USB_HID_GET_PROTOCOL 0x03
72#define USB_HID_SET_REPORT 0x09
73#define USB_HID_SET_IDLE 0x0A
74#define USB_HID_SET_PROTOCOL 0x0B
75
76
77#define USBH_SUPPORT_MAX_LUN 0x2
78
82typedef enum
83{
84 USBH_MSC_STATE_IDLE,
85 USBH_MSC_STATE_GET_LUN,
86 USBH_MSC_STATE_ERROR,
87 USBH_MSC_STATE_COMPLETE,
88}usbh_msc_ctrl_state_type;
89
91// * @brief usb msc process state
92// */
93//typedef enum
94//{
95// USBH_MSC_INIT,
96// USBH_MSC_INQUIRY,
97// USBH_MSC_READ_CAPACITY10,
98// USBH_MSC_READ10,
99// USBH_MSC_BUSY,
100// USBH_MSC_ERROR,
101//}usbh_msc_state_type;
102
106typedef struct
107{
108 uint8_t bLength;
109 uint8_t bDescriptorType;
110 uint16_t bcdHID;
111 uint8_t bCountryCode;
112 uint8_t bNumDescriptors;
113 uint8_t bReportDescriptorType;
114 uint16_t wItemLength;
115}usb_hid_desc_type;
116
117
121typedef struct
122{
123 uint8_t chin;
124 uint8_t eptin;
125 uint16_t in_maxpacket;
126 uint8_t in_poll;
127
128 uint8_t chout;
129 uint8_t eptout;
130 uint16_t out_maxpacket;
131 uint8_t out_poll;
132 uint8_t protocol;
133
134 uint32_t max_lun;
135 uint32_t cur_lun;
136 uint32_t use_lun;
137
138
139 usbh_msc_ctrl_state_type ctrl_state;
140 msc_state_type state;
141 uint8_t error;
142 msc_bot_trans_type bot_trans;
143 usbh_msc_unit_type l_unit_n[USBH_SUPPORT_MAX_LUN];
144 uint16_t poll_timer;
145 uint8_t buffer[64];
146}usbh_msc_type;
147
148extern usbh_class_handler_type uhost_class_handler;
149extern usbh_msc_type usbh_msc;
150 msc_error_type usbh_msc_is_ready(void *uhost, uint8_t lun);
151 usb_sts_type usbh_msc_write(void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun);
152 usb_sts_type usbh_msc_read(void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun);
153 usb_sts_type msc_bot_scsi_init(usbh_msc_type *msc_struct);
154
166#ifdef __cplusplus
167}
168#endif
169
170#endif
msc_struct
msc_type msc_struct
Definition: msc_bot_scsi.c:42
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
msc_state_type
msc_state_type
usb msc process state
Definition: usbh_msc_bot_scsi.h:101
msc_error_type
msc_error_type
Definition: usbh_msc_bot_scsi.h:115
usbh_msc_write
usb_sts_type usbh_msc_write(void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc write
Definition: usbh_msc_class.c:436
usbh_msc_ctrl_state_type
usbh_msc_ctrl_state_type
usb msc request state
Definition: usbh_msc_class.h:83
USBH_SUPPORT_MAX_LUN
#define USBH_SUPPORT_MAX_LUN
Definition: usbh_msc_class.h:77
uhost_class_handler
usbh_class_handler_type uhost_class_handler
Definition: usbh_hid_class.c:52
usbh_msc_read
usb_sts_type usbh_msc_read(void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc read
Definition: usbh_msc_class.c:388
usbh_msc_is_ready
msc_error_type usbh_msc_is_ready(void *uhost, uint8_t lun)
usb host msc clear feature
Definition: usbh_msc_class.c:372
msc_bot_scsi_init
usb_sts_type msc_bot_scsi_init(usbh_msc_type *msc_struct)
usb host msc init
Definition: usbh_msc_bot_scsi.c:592
usbh_msc
usbh_msc_type usbh_msc
Definition: usbh_msc_class.c:53
USBH_MSC_STATE_GET_LUN
@ USBH_MSC_STATE_GET_LUN
Definition: usbh_msc_class.h:85
USBH_MSC_STATE_IDLE
@ USBH_MSC_STATE_IDLE
Definition: usbh_msc_class.h:84
USBH_MSC_STATE_ERROR
@ USBH_MSC_STATE_ERROR
Definition: usbh_msc_class.h:86
USBH_MSC_STATE_COMPLETE
@ USBH_MSC_STATE_COMPLETE
Definition: usbh_msc_class.h:87
msc_bot_trans_type
usb msc bulk-only transfer control type
Definition: usbh_msc_bot_scsi.h:177
usb_hid_desc_type
usb hid descriptor type
Definition: usbh_hid_class.h:96
usbh_msc_type
usb msc struct
Definition: usbh_msc_class.h:122
usbh_msc_type::eptout
uint8_t eptout
Definition: usbh_msc_class.h:129
usbh_msc_type::in_poll
uint8_t in_poll
Definition: usbh_msc_class.h:126
usbh_msc_type::chin
uint8_t chin
Definition: usbh_msc_class.h:123
usbh_msc_type::out_poll
uint8_t out_poll
Definition: usbh_msc_class.h:131
usbh_msc_type::out_maxpacket
uint16_t out_maxpacket
Definition: usbh_msc_class.h:130
usbh_msc_type::bot_trans
msc_bot_trans_type bot_trans
Definition: usbh_msc_class.h:142
usbh_msc_type::in_maxpacket
uint16_t in_maxpacket
Definition: usbh_msc_class.h:125
usbh_msc_type::chout
uint8_t chout
Definition: usbh_msc_class.h:128
usbh_msc_type::poll_timer
uint16_t poll_timer
Definition: usbh_msc_class.h:144
usbh_msc_type::protocol
uint8_t protocol
Definition: usbh_msc_class.h:132
usbh_msc_type::use_lun
uint32_t use_lun
Definition: usbh_msc_class.h:136
usbh_msc_type::error
uint8_t error
Definition: usbh_msc_class.h:141
usbh_msc_type::state
msc_state_type state
Definition: usbh_msc_class.h:140
usbh_msc_type::max_lun
uint32_t max_lun
Definition: usbh_msc_class.h:134
usbh_msc_type::ctrl_state
usbh_msc_ctrl_state_type ctrl_state
Definition: usbh_msc_class.h:139
usbh_msc_type::eptin
uint8_t eptin
Definition: usbh_msc_class.h:124
usbh_msc_type::cur_lun
uint32_t cur_lun
Definition: usbh_msc_class.h:135
usbh_msc_unit_type
usb msc bank type
Definition: usbh_msc_bot_scsi.h:191
usbh_core.h
usb host core header file
usbh_msc_bot_scsi.h
usb host msc bulk-only transfer and scsi header file


AT32F415 Firmwary Library: usbh_msc_diskio.c Source File

  • usb_host
  • msc_only_fat32
  • src
usbh_msc_diskio.c
Go to the documentation of this file.
1
26#include "ff.h" /* Obtains integer types */
27#include "diskio.h" /* Declarations of disk functions */
28#include "usb_core.h"
29#include "usbh_msc_class.h"
38extern otg_core_type otg_core_struct;
39
40/* Definitions of physical drive number for each drive */
41#define DEV_RAM 0 /* Example: Map Ramdisk to physical drive 0 */
42#define DEV_MMC 1 /* Example: Map MMC/SD card to physical drive 1 */
43#define DEV_USB 2 /* Example: Map USB MSD to physical drive 2 */
44
45
46/*-----------------------------------------------------------------------*/
47/* Get Drive Status */
48/*-----------------------------------------------------------------------*/
49
50DSTATUS disk_status (
51 BYTE pdrv /* Physical drive nmuber to identify the drive */
52)
53{
54 if(usbh_msc_is_ready(&otg_core_struct.host, pdrv) == MSC_OK)
55 {
56 return RES_OK;
57 }
58
59 return RES_ERROR;
60}
61
62
63
64/*-----------------------------------------------------------------------*/
65/* Inidialize a Drive */
66/*-----------------------------------------------------------------------*/
67
68DSTATUS disk_initialize (
69 BYTE pdrv /* Physical drive nmuber to identify the drive */
70)
71{
72 return RES_OK;
73}
74
75
76
77/*-----------------------------------------------------------------------*/
78/* Read Sector(s) */
79/*-----------------------------------------------------------------------*/
80DRESULT disk_read (
81 BYTE pdrv, /* Physical drive nmuber to identify the drive */
82 BYTE *buff, /* Data buffer to store read data */
83 LBA_t sector, /* Start sector in LBA */
84 UINT count /* Number of sectors to read */
85)
86{
87 usb_sts_type status;
88
89 status = usbh_msc_read(&otg_core_struct.host, sector, count, buff, pdrv);
90
91 if(status == USB_OK)
92 return RES_OK;
93
94 return RES_ERROR;
95}
96
97
98
99/*-----------------------------------------------------------------------*/
100/* Write Sector(s) */
101/*-----------------------------------------------------------------------*/
102
103#if FF_FS_READONLY == 0
104
105DRESULT disk_write (
106 BYTE pdrv, /* Physical drive nmuber to identify the drive */
107 const BYTE *buff, /* Data to be written */
108 LBA_t sector, /* Start sector in LBA */
109 UINT count /* Number of sectors to write */
110)
111{
112 usb_sts_type status;
113
114 status = usbh_msc_write(&otg_core_struct.host, sector, count, (uint8_t *)buff, pdrv);
115
116 if(status == USB_OK)
117 return RES_OK;
118
119 return RES_ERROR;
120
121
122}
123
124#endif
125
126
127/*-----------------------------------------------------------------------*/
128/* Miscellaneous Functions */
129/*-----------------------------------------------------------------------*/
130
131DRESULT disk_ioctl (
132 BYTE pdrv, /* Physical drive nmuber (0..) */
133 BYTE cmd, /* Control code */
134 void *buff /* Buffer to send/receive control data */
135)
136{
137 usbh_core_type *host = (usbh_core_type *)&otg_core_struct.host;
138 usbh_msc_type *pmsc = (usbh_msc_type *)host->class_handler->pdata;
139 DRESULT res = RES_OK;
140 switch(cmd)
141 {
142 case CTRL_SYNC:
143 res = RES_OK;
144 break;
145 case GET_SECTOR_COUNT:
146 *(DWORD*)buff = pmsc->l_unit_n[pdrv].capacity.blk_nbr;
147 break;
148 case GET_SECTOR_SIZE:
149 *(DWORD*)buff = pmsc->l_unit_n[pdrv].capacity.blk_size;
150 break;
151 case GET_BLOCK_SIZE:
152 *(DWORD*)buff = pmsc->l_unit_n[pdrv].capacity.blk_size;
153 break;
154 default:
155 res = RES_PARERR;
156 }
157 return res;
158}
159
160/*-----------------------------------------------------------------------*/
161/* get_fattime */
162/*-----------------------------------------------------------------------*/
163DWORD get_fattime (void)
164{
165 return 0;
166}
167
disk_read
DRESULT disk_read(BYTE pdrv, BYTE *buff, LBA_t sector, UINT count)
Definition: usbh_msc_diskio.c:80
disk_initialize
DSTATUS disk_initialize(BYTE pdrv)
Definition: usbh_msc_diskio.c:68
disk_status
DSTATUS disk_status(BYTE pdrv)
Definition: usbh_msc_diskio.c:50
disk_ioctl
DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void *buff)
Definition: usbh_msc_diskio.c:131
disk_write
DRESULT disk_write(BYTE pdrv, const BYTE *buff, LBA_t sector, UINT count)
Definition: usbh_msc_diskio.c:105
otg_core_struct
otg_core_type otg_core_struct
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:45
get_fattime
DWORD get_fattime(void)
Definition: usbh_msc_diskio.c:163
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_OK
@ USB_OK
Definition: usb_std.h:218
MSC_OK
@ MSC_OK
Definition: usbh_msc_bot_scsi.h:116
usbh_msc_write
usb_sts_type usbh_msc_write(void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc write
Definition: usbh_msc_class.c:436
usbh_msc_read
usb_sts_type usbh_msc_read(void *uhost, uint32_t address, uint32_t len, uint8_t *buffer, uint8_t lun)
usb host msc read
Definition: usbh_msc_class.c:388
usbh_msc_is_ready
msc_error_type usbh_msc_is_ready(void *uhost, uint8_t lun)
usb host msc clear feature
Definition: usbh_msc_class.c:372
msc_scsi_data_capacity::blk_nbr
uint32_t blk_nbr
Definition: usbh_msc_bot_scsi.h:144
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usbh_msc_type
usb msc struct
Definition: usbh_msc_class.h:122
usbh_msc_type::l_unit_n
usbh_msc_unit_type l_unit_n[0x2]
Definition: usbh_msc_class.h:143
usbh_msc_unit_type::capacity
msc_scsi_data_capacity capacity
Definition: usbh_msc_bot_scsi.h:193
usb_core.h
usb core header file
usbh_msc_class.h
usb host msc class header file


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • inc
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • inc
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • inc
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • src
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_clock_config
void system_clock_config(void)
system clock config program
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_clock.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • src
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while (1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while (1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while (1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while (1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • read_write_boot_memory
  • src
utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29
38#define TEST_BUFEER_SIZE 0x400
39#define TEST_FLASH_ADDRESS_START 0x1FFFAC00
40
41uint16_t buffer_write[TEST_BUFEER_SIZE];
42uint16_t buffer_read[TEST_BUFEER_SIZE];
43
44 error_status buffer_compare(uint16_t* p_buffer1, uint16_t* p_buffer2, uint16_t buffer_length);
45
53 error_status buffer_compare(uint16_t* p_buffer1, uint16_t* p_buffer2, uint16_t buffer_length)
54{
55 while(buffer_length--)
56 {
57 if(*p_buffer1 != *p_buffer2)
58 {
59 return ERROR;
60 }
61 p_buffer1++;
62 p_buffer2++;
63 }
64 return SUCCESS;
65}
71int main(void)
72{
73 uint32_t index=0;
74 system_clock_config();
75 at32_board_init();
76 /* fill buffer_write data to test */
77 for(index = 0; index < TEST_BUFEER_SIZE; index++)
78 {
79 buffer_write[index] = index;
80 }
81
82 flash_unlock();
83
84 /* erase one sector in boot memory */
85 flash_sector_erase(TEST_FLASH_ADDRESS_START);
86
87 /* write data to boot memory */
88 for(index = 0; index < TEST_BUFEER_SIZE; index++)
89 {
90 flash_halfword_program(TEST_FLASH_ADDRESS_START + index * sizeof(uint16_t), buffer_write[index]);
91 }
92
93 /* read data from boot memory */
94 for(index = 0; index < TEST_BUFEER_SIZE; index++)
95 {
96 buffer_read[index] = *(uint16_t*)(TEST_FLASH_ADDRESS_START + index * sizeof(uint16_t));
97 }
98
99 /* compare the buffer */
100 if(buffer_compare(buffer_write, buffer_read, TEST_BUFEER_SIZE) == SUCCESS)
101 {
102 at32_led_on(LED2);
103 at32_led_on(LED3);
104 at32_led_on(LED4);
105 }
106
107 while(1)
108 {
109 }
110}
111
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
TEST_BUFEER_SIZE
#define TEST_BUFEER_SIZE
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c:38
TEST_FLASH_ADDRESS_START
#define TEST_FLASH_ADDRESS_START
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c:39
buffer_compare
error_status buffer_compare(uint16_t *p_buffer1, uint16_t *p_buffer2, uint16_t buffer_length)
compares two buffers.
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c:53
buffer_write
uint16_t buffer_write[0x400]
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c:41
main
int main(void)
main function.
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c:71
buffer_read
uint16_t buffer_read[0x400]
Definition: utilities/at32f415_boot_memory_ap_demo/read_write_boot_memory/src/main.c:42
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
error_status
error_status
error status
Definition: at32f415.h:258
ERROR
@ ERROR
Definition: at32f415.h:258
SUCCESS
@ SUCCESS
Definition: at32f415.h:258
flash_sector_erase
flash_status_type flash_sector_erase(uint32_t sector_address)
erase a specified flash sector.
Definition: at32f415_flash.c:173
flash_halfword_program
flash_status_type flash_halfword_program(uint32_t address, uint16_t data)
program a halfword at a specified address.
Definition: at32f415_flash.c:315
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • inc
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • inc
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • inc
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • src
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_clock_config
void system_clock_config(void)
system clock config program
Definition: utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_clock.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • src
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while (1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while (1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while (1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while (1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • utilities
  • at32f415_boot_memory_ap_demo
  • run_in_boot_memory
  • src
utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "run_in_boot_memory.h"
30
44int main(void)
45{
46 /* confif system clock */
47 system_clock_config();
48
49 /* initialize usart1 printf */
50 uart_print_init(115200);
51
52 printf("check the led toggle in boot memory\r\n");
53 run_in_boot_memory_test();
54 while(1)
55 {
56 }
57
58}
59
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
main
int main(void)
main function.
Definition: utilities/at32f415_boot_memory_ap_demo/run_in_boot_memory/src/main.c:44
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
run_in_boot_memory_test
void run_in_boot_memory_test(void)
Definition: run_in_boot_memory.c:41
run_in_boot_memory.h
run in boot memory file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • utilities
  • at32f415_freertos_demo
  • inc
utilities/at32f415_freertos_demo/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • utilities
  • at32f415_freertos_demo
  • inc
utilities/at32f415_freertos_demo/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • utilities
  • at32f415_freertos_demo
  • inc
utilities/at32f415_freertos_demo/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • utilities
  • at32f415_freertos_demo
  • src
utilities/at32f415_freertos_demo/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_clock_config
void system_clock_config(void)
system clock config program
Definition: utilities/at32f415_freertos_demo/src/at32f415_clock.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • utilities
  • at32f415_freertos_demo
  • src
utilities/at32f415_freertos_demo/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104//void SVC_Handler(void)
105//{
106//}
107
113void DebugMon_Handler(void)
114{
115}
116
122//void PendSV_Handler(void)
123//{
124//}
125
131//void SysTick_Handler(void)
132//{
133//}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: utilities/at32f415_freertos_demo/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: utilities/at32f415_freertos_demo/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: utilities/at32f415_freertos_demo/src/at32f415_int.c:65
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: utilities/at32f415_freertos_demo/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: utilities/at32f415_freertos_demo/src/at32f415_int.c:78
DebugMon_Handler
void DebugMon_Handler(void)
this function handles svcall exception.
Definition: utilities/at32f415_freertos_demo/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • utilities
  • at32f415_freertos_demo
  • src
utilities/at32f415_freertos_demo/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "FreeRTOS.h"
30#include "task.h"
31
39TaskHandle_t led2_handler;
40TaskHandle_t led3_handler;
41
42/* led2 task */
43void led2_task_function(void *pvParameters);
44/* led3 task */
45void led3_task_function(void *pvParameters);
46
52int main(void)
53{
54 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
55
56 system_clock_config();
57
58 /* init led2 and led3 */
59 at32_led_init(LED2);
60 at32_led_init(LED3);
61
62 /* init usart1 */
63 uart_print_init(115200);
64
65 /* enter critical */
66 taskENTER_CRITICAL();
67
68 /* create led2 task */
69 if(xTaskCreate((TaskFunction_t )led2_task_function,
70 (const char* )"LED2_task",
71 (uint16_t )512,
72 (void* )NULL,
73 (UBaseType_t )2,
74 (TaskHandle_t* )&led2_handler) != pdPASS)
75 {
76 printf("LED2 task could not be created as there was insufficient heap memory remaining.\r\n");
77 }
78 else
79 {
80 printf("LED2 task was created successfully.\r\n");
81 }
82 /* create led3 task */
83 if(xTaskCreate((TaskFunction_t )led3_task_function,
84 (const char* )"LED3_task",
85 (uint16_t )512,
86 (void* )NULL,
87 (UBaseType_t )2,
88 (TaskHandle_t* )&led3_handler) != pdPASS)
89 {
90 printf("LED3 task could not be created as there was insufficient heap memory remaining.\r\n");
91 }
92 else
93 {
94 printf("LED3 task was created successfully.\r\n");
95 }
96
97 /* exit critical */
98 taskEXIT_CRITICAL();
99
100 /* start scheduler */
101 vTaskStartScheduler();
102}
103
104/* led2 task function */
105void led2_task_function(void *pvParameters)
106{
107 while(1)
108 {
109 at32_led_toggle(LED2);
110 vTaskDelay(1000);
111 }
112}
113
114/* led3 task function */
115void led3_task_function(void *pvParameters)
116{
117 while(1)
118 {
119 at32_led_toggle(LED3);
120 vTaskDelay(500);
121 }
122}
123
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
at32_led_init
void at32_led_init(led_type led)
configure led gpio
Definition: at32f415_board.c:216
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
led2_task_function
void led2_task_function(void *pvParameters)
Definition: utilities/at32f415_freertos_demo/src/main.c:105
main
int main(void)
main function.
Definition: utilities/at32f415_freertos_demo/src/main.c:52
led3_task_function
void led3_task_function(void *pvParameters)
Definition: utilities/at32f415_freertos_demo/src/main.c:115
led3_handler
TaskHandle_t led3_handler
Definition: utilities/at32f415_freertos_demo/src/main.c:40
led2_handler
TaskHandle_t led2_handler
Definition: utilities/at32f415_freertos_demo/src/main.c:39
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • utilities
  • at32f415_gen_random_number_demo
  • inc
utilities/at32f415_gen_random_number_demo/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • utilities
  • at32f415_gen_random_number_demo
  • inc
utilities/at32f415_gen_random_number_demo/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • utilities
  • at32f415_gen_random_number_demo
  • inc
utilities/at32f415_gen_random_number_demo/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • utilities
  • at32f415_gen_random_number_demo
  • src
utilities/at32f415_gen_random_number_demo/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_clock_config
void system_clock_config(void)
system clock config program
Definition: utilities/at32f415_gen_random_number_demo/src/at32f415_clock.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • utilities
  • at32f415_gen_random_number_demo
  • src
utilities/at32f415_gen_random_number_demo/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while (1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while (1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while (1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while (1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: utilities/at32f415_gen_random_number_demo/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: utilities/at32f415_gen_random_number_demo/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: utilities/at32f415_gen_random_number_demo/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: utilities/at32f415_gen_random_number_demo/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: utilities/at32f415_gen_random_number_demo/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: utilities/at32f415_gen_random_number_demo/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: utilities/at32f415_gen_random_number_demo/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: utilities/at32f415_gen_random_number_demo/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: utilities/at32f415_gen_random_number_demo/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • utilities
  • at32f415_gen_random_number_demo
  • src
utilities/at32f415_gen_random_number_demo/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "random.h"
30
44int main(void)
45{
46 system_clock_config();
47
48 at32_board_init();
49 uart_print_init(115200);
50 printf("gen random number test\r\n");
51 randnum_test();
52 while(1)
53 {
54 }
55}
56
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
uart_print_init
void uart_print_init(uint32_t baudrate)
initialize uart
Definition: at32f415_board.c:107
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
randnum_test
void randnum_test(void)
enable ertc as seed
Definition: random.c:143
main
int main(void)
main function.
Definition: utilities/at32f415_gen_random_number_demo/src/main.c:44
random.h
at32f415 random header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • utilities
  • at32f415_slib_demo
  • project_l0
  • inc
utilities/at32f415_slib_demo/project_l0/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • utilities
  • at32f415_slib_demo
  • project_l0
  • inc
utilities/at32f415_slib_demo/project_l0/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • utilities
  • at32f415_slib_demo
  • project_l0
  • inc
utilities/at32f415_slib_demo/project_l0/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
utilities/at32f415_slib_demo/project_l0/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT, CRM_PLL_MULT_18);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_clock_config
void system_clock_config(void)
system clock config program
Definition: utilities/at32f415_slib_demo/project_l0/src/at32f415_clock.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT
@ CRM_PLL_SOURCE_HEXT
Definition: at32f415_crm.h:281
CRM_PLL_MULT_18
@ CRM_PLL_MULT_18
Definition: at32f415_crm.h:213
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while (1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while (1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while (1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while (1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
141void FLASH_IRQHandler(void)
142{
143 if(flash_flag_get(FLASH_EPPERR_FLAG))
144 {
145 flash_flag_clear(FLASH_EPPERR_FLAG);
146 delay_ms(500);
147 }
148}
149
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
flash_flag_get
flag_status flash_flag_get(uint32_t flash_flag)
check whether the specified flash flag is set or not.
Definition: at32f415_flash.c:55
flash_flag_clear
void flash_flag_clear(uint32_t flash_flag)
clear the flash flag.
Definition: at32f415_flash.c:87
FLASH_EPPERR_FLAG
#define FLASH_EPPERR_FLAG
Definition: at32f415_flash.h:71
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c:114
FLASH_IRQHandler
void FLASH_IRQHandler(void)
flash handler.
Definition: utilities/at32f415_slib_demo/project_l0/src/at32f415_int.c:141
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • utilities
  • at32f415_slib_demo
  • project_l0
  • src
utilities/at32f415_slib_demo/project_l0/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include <stdio.h>
30#include "math_helper.h"
31#include "fir_filter.h"
32
33extern float32_t testInput_f32_1kHz_15kHz[];
34extern float32_t refOutput[];
35
44#define USE_SLIB_FUNCTION /* define it when user want to activate slib in this project */
45
46#if defined (USE_SLIB_FUNCTION)
47#define FLASH_START_ADDR 0x08000000
48#define TEST_SLIB_PSW 0x55665566
49#define SLIB_START_ADDR 0x08001000
50#define SLIB_DATA_ADDR 0x08002000
51#define SLIB_END_ADDR 0x08002800
52#define FLASH_SECTOR_SIZE 0x800
53#define SECTOR_NUM(dwAddr) ((dwAddr & (FLASH_START_ADDR - 1)) / FLASH_SECTOR_SIZE)
54#define SECTOR_WORD_CNT (FLASH_SECTOR_SIZE >> 2) /* words per sector */
55#endif
56#define SNR_THRESHOLD_F32 140.0f
57#define TEST_LENGTH_SAMPLES 320
58
59#if defined (USE_SLIB_FUNCTION)
60uint32_t dw_start_sector, dw_data_start_sector, dw_end_sector;
61uint32_t temp_buf[512]; /* 2kb buffer */
62#endif
63
64static float32_t testOutput[TEST_LENGTH_SAMPLES];
65
66#if defined (USE_SLIB_FUNCTION)
67 flash_status_type slib_enable(void);
68#endif
69void config_flash_interrupt(void);
70
76void config_flash_interrupt(void)
77{
78 flash_unlock();
79 flash_interrupt_enable(FLASH_ERR_INT, TRUE);
80 flash_lock();
81 /* config nvic priority group */
82 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
83
84 nvic_irq_enable(FLASH_IRQn, 0, 0);
85}
86
87#if defined (USE_SLIB_FUNCTION)
93 flash_status_type slib_enable(void)
94{
95 uint32_t *ptr;
96 uint32_t i, j;
97 flash_status_type status = FLASH_OPERATE_DONE;
98 ptr = (uint32_t *)SLIB_START_ADDR;
99 dw_start_sector = SECTOR_NUM(SLIB_START_ADDR); /* slib start sector */
100 dw_data_start_sector = SECTOR_NUM(SLIB_DATA_ADDR); /* slib data sector */
101 dw_end_sector = SECTOR_NUM(SLIB_END_ADDR); /* slib end sector */
102 flash_unlock();
103 status = flash_slib_enable(TEST_SLIB_PSW, dw_start_sector, dw_data_start_sector, dw_end_sector);
104 if(status != FLASH_OPERATE_DONE)
105 return status;
106 for(i = 0; i <= (dw_end_sector - dw_start_sector); i++)
107 {
108 memcpy(temp_buf, ptr, FLASH_SECTOR_SIZE);
109 status = flash_sector_erase(SLIB_START_ADDR + i * FLASH_SECTOR_SIZE);
110 if(status != FLASH_OPERATE_DONE)
111 return status;
112 for(j = 0; j < (FLASH_SECTOR_SIZE >> 2); j++)
113 {
114 status = flash_word_program(SLIB_START_ADDR + i * FLASH_SECTOR_SIZE + (j << 2), temp_buf[j]);
115 if(status != FLASH_OPERATE_DONE)
116 return status;
117 }
118 ptr += SECTOR_WORD_CNT;
119 }
120 return status;
121}
122#endif
123
129int main(void)
130{
131 arm_status status;
132 float32_t *inputf32, *outputf32, snr;
133
134 system_clock_config();
135 at32_board_init();
136
137 /* initialize input and output buffer pointers */
138 inputf32 = &testInput_f32_1kHz_15kHz[0];
139 outputf32 = &testOutput[0];
140
141 /* configure flash to generate an interrupt when a write protect error occur */
142 config_flash_interrupt();
143
144 /* wait for key button to be pushed, then turn off led3 */
145 while(at32_button_press() == NO_BUTTON)
146 {
147 at32_led_toggle(LED3);
148 delay_ms(100);
149 }
150 at32_led_off(LED3);
151
152 /* call the fir low pass filter function */
153 FIR_lowpass_filter(inputf32, outputf32, TEST_LENGTH_SAMPLES);
154
155 /* compare the generated output against the reference output computed in matlab. */
156 snr = arm_snr_f32(&refOutput[0], &testOutput[0], TEST_LENGTH_SAMPLES);
157 if(snr < SNR_THRESHOLD_F32)
158 {
159 status = ARM_MATH_TEST_FAILURE;
160 }
161 else
162 {
163 status = ARM_MATH_SUCCESS;
164#if defined (USE_SLIB_FUNCTION)
165 /* enable slib protection from sector 2 to sector 5 when fir filter ip-code is tested ok */
166 if(flash_slib_state_get() == RESET)
167 {
168 /* if slib has not been enabled, set slib configuration */
169 if(slib_enable() == FLASH_OPERATE_DONE)
170 {
171 /* if slib configuration is correctly set, tuen on green led4 */
172 at32_led_on(LED4);
173 delay_sec(3);
174
175 /* execute system reset to activate slib protection */
176 nvic_system_reset();
177 }
178 else
179 {
180 /* turn on red led2 if slib activation failed */
181 at32_led_on(LED2);
182 while(1);
183 }
184 }
185#endif
186 }
187
188 /* infinite loop */
189 while(1)
190 {
191 if(status == ARM_MATH_TEST_FAILURE)
192 {
193 /* toggle red led2 if fir function failed */
194 at32_led_toggle(LED2);
195 delay_ms(500);
196 }
197 else
198 {
199 /* toggle green led4 if fir function success */
200 at32_led_toggle(LED4);
201 delay_ms(500);
202 }
203 }
204}
205
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
NO_BUTTON
@ NO_BUTTON
Definition: at32f415_board.h:95
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
at32_led_on
void at32_led_on(led_type led)
turns selected led on.
Definition: at32f415_board.c:244
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_sec
void delay_sec(uint16_t sec)
inserts a delay time.
Definition: at32f415_board.c:356
FLASH_IRQn
@ FLASH_IRQn
Definition: at32f415.h:139
TRUE
@ TRUE
Definition: at32f415.h:253
RESET
@ RESET
Definition: at32f415.h:248
flash_slib_state_get
flag_status flash_slib_state_get(void)
get the main block slib state.
Definition: at32f415_flash.c:748
flash_slib_enable
flash_status_type flash_slib_enable(uint32_t pwd, uint16_t start_sector, uint16_t data_start_sector, uint16_t end_sector)
enable main block security library function.
Definition: at32f415_flash.c:691
flash_sector_erase
flash_status_type flash_sector_erase(uint32_t sector_address)
erase a specified flash sector.
Definition: at32f415_flash.c:173
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
flash_interrupt_enable
void flash_interrupt_enable(uint32_t flash_int, confirm_state new_state)
enable or disable the specified flash interrupts.
Definition: at32f415_flash.c:674
flash_word_program
flash_status_type flash_word_program(uint32_t address, uint32_t data)
program a word at a specified address.
Definition: at32f415_flash.c:288
flash_lock
void flash_lock(void)
lock the flash controller.
Definition: at32f415_flash.c:162
flash_status_type
flash_status_type
flash status type
Definition: at32f415_flash.h:154
FLASH_OPERATE_DONE
@ FLASH_OPERATE_DONE
Definition: at32f415_flash.h:158
FLASH_ERR_INT
#define FLASH_ERR_INT
Definition: at32f415_flash.h:83
nvic_system_reset
void nvic_system_reset(void)
system reset
Definition: at32f415_misc.c:52
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
SECTOR_NUM
#define SECTOR_NUM(dwAddr)
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:53
testOutput
static float32_t testOutput[320]
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:64
SECTOR_WORD_CNT
#define SECTOR_WORD_CNT
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:54
config_flash_interrupt
void config_flash_interrupt(void)
config flash error interrupt.
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:76
SLIB_DATA_ADDR
#define SLIB_DATA_ADDR
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:50
dw_end_sector
uint32_t dw_end_sector
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:60
SLIB_END_ADDR
#define SLIB_END_ADDR
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:51
dw_start_sector
uint32_t dw_start_sector
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:60
main
int main(void)
main function.
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:129
TEST_LENGTH_SAMPLES
#define TEST_LENGTH_SAMPLES
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:57
temp_buf
uint32_t temp_buf[512]
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:61
SLIB_START_ADDR
#define SLIB_START_ADDR
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:49
dw_data_start_sector
uint32_t dw_data_start_sector
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:60
slib_enable
flash_status_type slib_enable(void)
config slib enable and program slib area.
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:93
FLASH_SECTOR_SIZE
#define FLASH_SECTOR_SIZE
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:52
TEST_SLIB_PSW
#define TEST_SLIB_PSW
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:48
SNR_THRESHOLD_F32
#define SNR_THRESHOLD_F32
Definition: utilities/at32f415_slib_demo/project_l0/src/main.c:56
FIR_lowpass_filter
void FIR_lowpass_filter(float32_t *pSrc, float32_t *pDst, uint32_t testlengthsamples)
Definition: fir_filter.c:76
arm_snr_f32
float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize)
Caluclation of SNR.
Definition: project_l0/src/math_helper.c:61
testInput_f32_1kHz_15kHz
float32_t testInput_f32_1kHz_15kHz[]
Definition: project_l0/src/arm_fir_data.c:48
refOutput
float32_t refOutput[]
Definition: project_l0/src/arm_fir_data.c:96
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • utilities
  • at32f415_slib_demo
  • project_l1
  • inc
utilities/at32f415_slib_demo/project_l1/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • utilities
  • at32f415_slib_demo
  • project_l1
  • inc
utilities/at32f415_slib_demo/project_l1/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • utilities
  • at32f415_slib_demo
  • project_l1
  • inc
utilities/at32f415_slib_demo/project_l1/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • utilities
  • at32f415_slib_demo
  • project_l1
  • src
utilities/at32f415_slib_demo/project_l1/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_clock_config
void system_clock_config(void)
system clock config program
Definition: utilities/at32f415_slib_demo/project_l1/src/at32f415_clock.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • utilities
  • at32f415_slib_demo
  • project_l1
  • src
utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29#include "at32f415_board.h"
30
44void NMI_Handler(void)
45{
46}
47
53void HardFault_Handler(void)
54{
55 /* go to infinite loop when hard fault exception occurs */
56 while (1)
57 {
58 }
59}
60
66void MemManage_Handler(void)
67{
68 /* go to infinite loop when memory manage exception occurs */
69 while (1)
70 {
71 }
72}
73
79void BusFault_Handler(void)
80{
81 /* go to infinite loop when bus fault exception occurs */
82 while (1)
83 {
84 }
85}
86
92void UsageFault_Handler(void)
93{
94 /* go to infinite loop when usage fault exception occurs */
95 while (1)
96 {
97 }
98}
99
105void SVC_Handler(void)
106{
107}
108
114void DebugMon_Handler(void)
115{
116}
117
123void PendSV_Handler(void)
124{
125}
126
132void SysTick_Handler(void)
133{
134}
135
141void FLASH_IRQHandler(void)
142{
143 if(flash_flag_get(FLASH_EPPERR_FLAG))
144 {
145 flash_flag_clear(FLASH_EPPERR_FLAG);
146 delay_ms(500);
147 }
148}
149
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
flash_flag_get
flag_status flash_flag_get(uint32_t flash_flag)
check whether the specified flash flag is set or not.
Definition: at32f415_flash.c:55
flash_flag_clear
void flash_flag_clear(uint32_t flash_flag)
clear the flash flag.
Definition: at32f415_flash.c:87
FLASH_EPPERR_FLAG
#define FLASH_EPPERR_FLAG
Definition: at32f415_flash.h:71
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c:92
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c:53
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c:66
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c:105
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c:123
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c:44
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c:79
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c:132
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c:114
FLASH_IRQHandler
void FLASH_IRQHandler(void)
flash handler.
Definition: utilities/at32f415_slib_demo/project_l1/src/at32f415_int.c:141
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • utilities
  • at32f415_slib_demo
  • project_l1
  • src
utilities/at32f415_slib_demo/project_l1/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include <stdio.h>
30#include "math_helper.h"
31#include "fir_filter.h"
32
33extern float32_t testInput_f32_1kHz_15kHz[];
34extern float32_t refOutput[];
35
44#define SNR_THRESHOLD_F32 140.0f
45#define TEST_LENGTH_SAMPLES 320
46
47static float32_t testOutput[TEST_LENGTH_SAMPLES];
48
49void config_flash_interrupt(void);
50
56void config_flash_interrupt(void)
57{
58 flash_unlock();
59 flash_interrupt_enable(FLASH_ERR_INT, TRUE);
60 flash_lock();
61 /* config nvic priority group */
62 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
63
64 nvic_irq_enable(FLASH_IRQn, 0, 0);
65}
66
72int main(void)
73{
74 arm_status status;
75 float32_t *inputf32, *outputf32, snr;
76
77 system_clock_config();
78 at32_board_init();
79
80 /* initialize input and output buffer pointers */
81 inputf32 = &testInput_f32_1kHz_15kHz[0];
82 outputf32 = &testOutput[0];
83
84 /* configure flash to generate an interrupt when a write protect error occur */
85 config_flash_interrupt();
86
87 /* wait for key button to be pushed, then turn off led3 */
88 while(at32_button_press() == NO_BUTTON)
89 {
90 at32_led_toggle(LED3);
91 delay_ms(100);
92 }
93 at32_led_off(LED3);
94
95 /* call the fir low pass filter function */
96 FIR_lowpass_filter(inputf32, outputf32, TEST_LENGTH_SAMPLES);
97
98 /* compare the generated output against the reference output computed in matlab. */
99 snr = arm_snr_f32(&refOutput[0], &testOutput[0], TEST_LENGTH_SAMPLES);
100 if(snr < SNR_THRESHOLD_F32)
101 {
102 status = ARM_MATH_TEST_FAILURE;
103 }
104 else
105 {
106 status = ARM_MATH_SUCCESS;
107 }
108
109 /* infinite loop */
110 while(1)
111 {
112 if(status == ARM_MATH_TEST_FAILURE)
113 {
114 /* toggle red led2 if fir function failed */
115 at32_led_toggle(LED2);
116 delay_ms(500);
117 }
118 else
119 {
120 /* toggle green led4 if fir function success */
121 at32_led_toggle(LED4);
122 delay_ms(500);
123 }
124 }
125}
126
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
LED2
@ LED2
Definition: at32f415_board.h:63
LED4
@ LED4
Definition: at32f415_board.h:65
NO_BUTTON
@ NO_BUTTON
Definition: at32f415_board.h:95
at32_button_press
button_type at32_button_press()
returns which button have press down
Definition: at32f415_board.c:192
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_led_off
void at32_led_off(led_type led)
turns selected led off.
Definition: at32f415_board.c:261
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
FLASH_IRQn
@ FLASH_IRQn
Definition: at32f415.h:139
TRUE
@ TRUE
Definition: at32f415.h:253
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
flash_interrupt_enable
void flash_interrupt_enable(uint32_t flash_int, confirm_state new_state)
enable or disable the specified flash interrupts.
Definition: at32f415_flash.c:674
flash_lock
void flash_lock(void)
lock the flash controller.
Definition: at32f415_flash.c:162
FLASH_ERR_INT
#define FLASH_ERR_INT
Definition: at32f415_flash.h:83
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
testOutput
static float32_t testOutput[320]
Definition: utilities/at32f415_slib_demo/project_l1/src/main.c:47
config_flash_interrupt
void config_flash_interrupt(void)
config flash error interrupt.
Definition: utilities/at32f415_slib_demo/project_l1/src/main.c:56
main
int main(void)
main function.
Definition: utilities/at32f415_slib_demo/project_l1/src/main.c:72
TEST_LENGTH_SAMPLES
#define TEST_LENGTH_SAMPLES
Definition: utilities/at32f415_slib_demo/project_l1/src/main.c:45
SNR_THRESHOLD_F32
#define SNR_THRESHOLD_F32
Definition: utilities/at32f415_slib_demo/project_l1/src/main.c:44
FIR_lowpass_filter
void FIR_lowpass_filter(float32_t *pSrc, float32_t *pDst, uint32_t testlengthsamples)
Definition: fir_filter.c:76
arm_snr_f32
float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize)
Caluclation of SNR.
Definition: project_l0/src/math_helper.c:61
testInput_f32_1kHz_15kHz
float32_t testInput_f32_1kHz_15kHz[]
Definition: project_l0/src/arm_fir_data.c:48
refOutput
float32_t refOutput[]
Definition: project_l0/src/arm_fir_data.c:96
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • inc
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • inc
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • inc
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • src
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_clock_config
void system_clock_config(void)
system clock config program
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • src
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while (1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while (1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while (1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while (1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led3_toggle
  • src
utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "tmr.h"
30#include "usart.h"
31#include "iap.h"
32
46int main(void)
47{
48 /* config vector table offset */
49 nvic_vector_table_set(NVIC_VECTTAB_FLASH, 0x4000);
50
51 /* config nvic priority group */
52 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
53
54 system_clock_config();
55 at32_board_init();
56
57 /* check and clear iap_upgrade_flag flag */
58 iap_init();
59
60 /* init usart used for app update */
61 uart_init(115200);
62
63 /* init tmr used for show code running state(led cycle toggle) */
64 tmr_init();
65
66 while(1)
67 {
68 iap_command_handle();
69 }
70}
71
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
uart_init
void uart_init(uint32_t baudrate)
init usart.
Definition: app_led3_toggle/src/usart.c:45
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
nvic_vector_table_set
void nvic_vector_table_set(uint32_t base, uint32_t offset)
set the vector table location and offset.
Definition: at32f415_misc.c:112
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
NVIC_VECTTAB_FLASH
#define NVIC_VECTTAB_FLASH
Definition: at32f415_misc.h:52
main
int main(void)
main function.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led3_toggle/src/main.c:46
iap_init
void iap_init(void)
iap init.
Definition: app_led3_toggle/src/iap.c:61
iap_command_handle
void iap_command_handle(void)
iap command handle handle.
Definition: app_led3_toggle/src/iap.c:44
tmr_init
void tmr_init(void)
init tmr.
Definition: app_led3_toggle/src/tmr.c:44
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • inc
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • inc
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • inc
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • src
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_clock_config
void system_clock_config(void)
system clock config program
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • src
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while (1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while (1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while (1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while (1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • app_led4_toggle
  • src
utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "tmr.h"
30#include "usart.h"
31#include "iap.h"
32
46int main(void)
47{
48 /* config vector table offset */
49 nvic_vector_table_set(NVIC_VECTTAB_FLASH, 0x4000);
50
51 /* config nvic priority group */
52 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
53
54 system_clock_config();
55 at32_board_init();
56
57 /* check and clear iap_upgrade_flag flag */
58 iap_init();
59
60 /* init usart used for app update */
61 uart_init(115200);
62
63 /* init tmr used for show code running state(led cycle toggle) */
64 tmr_init();
65
66 while(1)
67 {
68 iap_command_handle();
69 }
70}
71
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
uart_init
void uart_init(uint32_t baudrate)
init usart.
Definition: app_led3_toggle/src/usart.c:45
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
nvic_vector_table_set
void nvic_vector_table_set(uint32_t base, uint32_t offset)
set the vector table location and offset.
Definition: at32f415_misc.c:112
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
NVIC_VECTTAB_FLASH
#define NVIC_VECTTAB_FLASH
Definition: at32f415_misc.h:52
main
int main(void)
main function.
Definition: utilities/at32f415_usart_iap_demo/source_code/app_led4_toggle/src/main.c:46
iap_init
void iap_init(void)
iap init.
Definition: app_led3_toggle/src/iap.c:61
iap_command_handle
void iap_command_handle(void)
iap command handle handle.
Definition: app_led3_toggle/src/iap.c:44
tmr_init
void tmr_init(void)
init tmr.
Definition: app_led3_toggle/src/tmr.c:44
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: flash.h Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • inc
utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h
Go to the documentation of this file.
1
27#ifndef __FLASH_H__
28#define __FLASH_H__
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34#include "at32f415_board.h"
35
48#define FLASH_SIZE (*((uint32_t*)0x1FFFF7E0)) /* read from at32 flash capacity register(unit:kbyte) */
49#define SRAM_SIZE 224 /* sram size, unit:kbyte */
50
59void flash_2kb_write(uint32_t write_addr, uint8_t *pbuffer);
60 flag_status flash_upgrade_flag_read(void);
61
74#ifdef __cplusplus
75}
76#endif
77
78#endif
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
flag_status
flag_status
flag status
Definition: at32f415.h:248
flash_2kb_write
void flash_2kb_write(uint32_t write_addr, uint8_t *pbuffer)
flash erase/program operation.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c:45
flash_upgrade_flag_read
flag_status flash_upgrade_flag_read(void)
check flash upgrade flag.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c:66


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_clock_config
void system_clock_config(void)
system clock config program
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_clock.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while (1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while (1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while (1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while (1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: flash.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c
Go to the documentation of this file.
1
27#include "flash.h"
28#include "usart.h"
29#include "iap.h"
30
45void flash_2kb_write(uint32_t write_addr, uint8_t *pbuffer)
46{
47 uint16_t index, write_data;
48 flash_unlock();
49 flash_sector_erase(write_addr);
50 if(FLASH_SIZE < 0x100) /* less than 256kb, 1kb/sector */
51 flash_sector_erase(write_addr + 0x400);
52 for(index = 0; index < 2048; index += 2)
53 {
54 write_data = (pbuffer[index+1] << 8) + pbuffer[index];
55 flash_halfword_program(write_addr, write_data);
56 write_addr += sizeof(uint16_t);
57 }
58 flash_lock();
59}
60
66 flag_status flash_upgrade_flag_read(void)
67{
68 if((*(uint32_t*)IAP_UPGRADE_FLAG_ADDR) == IAP_UPGRADE_FLAG)
69 return SET;
70 else
71 return RESET;
72}
73
flag_status
flag_status
flag status
Definition: at32f415.h:248
RESET
@ RESET
Definition: at32f415.h:248
SET
@ SET
Definition: at32f415.h:248
flash_sector_erase
flash_status_type flash_sector_erase(uint32_t sector_address)
erase a specified flash sector.
Definition: at32f415_flash.c:173
flash_halfword_program
flash_status_type flash_halfword_program(uint32_t address, uint16_t data)
program a halfword at a specified address.
Definition: at32f415_flash.c:315
flash_unlock
void flash_unlock(void)
unlock the flash controller.
Definition: at32f415_flash.c:151
flash_lock
void flash_lock(void)
lock the flash controller.
Definition: at32f415_flash.c:162
flash_2kb_write
void flash_2kb_write(uint32_t write_addr, uint8_t *pbuffer)
flash erase/program operation.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c:45
flash_upgrade_flag_read
flag_status flash_upgrade_flag_read(void)
check flash upgrade flag.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c:66
IAP_UPGRADE_FLAG_ADDR
#define IAP_UPGRADE_FLAG_ADDR
Definition: app_led3_toggle/inc/iap.h:52
IAP_UPGRADE_FLAG
#define IAP_UPGRADE_FLAG
Definition: app_led3_toggle/inc/iap.h:56
FLASH_SIZE
#define FLASH_SIZE
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/inc/flash.h:48


AT32F415 Firmwary Library: main.c Source File

  • utilities
  • at32f415_usart_iap_demo
  • source_code
  • bootloader
  • src
utilities/at32f415_usart_iap_demo/source_code/bootloader/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "tmr.h"
30#include "usart.h"
31#include "flash.h"
32#include "iap.h"
33
47int main(void)
48{
49 system_clock_config();
50 at32_board_init();
51
52 /* config nvic priority group */
53 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
54
55 /* check iap_upgrade_flag flag */
56 if(flash_upgrade_flag_read() == RESET)
57 {
58 /* check app starting address whether 0x08xxxxxx */
59 if(((*(uint32_t*)(APP_START_ADDR + 4)) & 0xFF000000) == 0x08000000)
60 app_load(APP_START_ADDR);
61 }
62
63 /* init usart used for app update */
64 uart_init(115200);
65
66 /* check whether need to upgrade, if yes, response ok to pc-tool */
67 if(flash_upgrade_flag_read() != RESET)
68 back_ok();
69
70 /* init tmr used for show code running state(led cycle toggle) */
71 tmr_init();
72
73 while(1)
74 {
75 /* upgrade handle */
76 iap_upgrade_app_handle();
77 }
78}
79
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
uart_init
void uart_init(uint32_t baudrate)
init usart.
Definition: app_led3_toggle/src/usart.c:45
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
RESET
@ RESET
Definition: at32f415.h:248
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
main
int main(void)
main function.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/main.c:47
APP_START_ADDR
#define APP_START_ADDR
Definition: app_led3_toggle/inc/iap.h:49
tmr_init
void tmr_init(void)
init tmr.
Definition: app_led3_toggle/src/tmr.c:44
back_ok
void back_ok(void)
command response ok.
Definition: app_led3_toggle/src/usart.c:107
iap_upgrade_app_handle
void iap_upgrade_app_handle(void)
iap upgrade app handle.
Definition: bootloader/src/iap.c:344
app_load
void app_load(uint32_t appxaddr)
app load.
Definition: bootloader/src/iap.c:60
flash_upgrade_flag_read
flag_status flash_upgrade_flag_read(void)
check flash upgrade flag.
Definition: utilities/at32f415_usart_iap_demo/source_code/bootloader/src/flash.c:66
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • inc
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • inc
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • inc
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • inc
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "at32f415_board.h"
38#include "stdio.h"
39
51#define USE_OTG_DEVICE_MODE
52
56/* #define USE_OTG_HOST_MODE */
57
58#define USB_ID 0
59#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
60#define OTG_IRQ OTGFS1_IRQn
61#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
62#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
63#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
64#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
65
66#define OTG_PIN_GPIO GPIOA
67#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
68#define OTG_PIN_VBUS GPIO_PINS_9
69#define OTG_PIN_ID GPIO_PINS_10
70
71#define OTG_PIN_SOF_GPIO GPIOA
72#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
73#define OTG_PIN_SOF GPIO_PINS_8
74
75
79#ifdef USE_OTG_DEVICE_MODE
83/* otg1 device fifo */
84#define USBD_RX_SIZE 128
85#define USBD_EP0_TX_SIZE 24
86#define USBD_EP1_TX_SIZE 20
87#define USBD_EP2_TX_SIZE 20
88#define USBD_EP3_TX_SIZE 20
92#ifndef USB_EPT_MAX_NUM
93#define USB_EPT_MAX_NUM 4
94#endif
95#endif
96
100#ifdef USE_OTG_HOST_MODE
101#ifndef USB_HOST_CHANNEL_NUM
102#define USB_HOST_CHANNEL_NUM 8
103#endif
104
108/* otg1 host fifo */
109#define USBH_RX_FIFO_SIZE 128
110#define USBH_NP_TX_FIFO_SIZE 96
111#define USBH_P_TX_FIFO_SIZE 96
112
113#endif
114
118/* #define USB_SOF_OUTPUT_ENABLE */
119
130/* #define USB_VBUS_IGNORE */
131
135/* #define USB_LOW_POWER_WAKUP */
136
137void usb_delay_ms(uint32_t ms);
138void usb_delay_us(uint32_t us);
139
147#ifdef __cplusplus
148}
149#endif
150
151#endif
at32f415.h
at32f415 header file
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • src
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_clock_config
void system_clock_config(void)
system clock config program
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_clock.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • src
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led3_toggle
  • src
utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbd_int.h"
32#include "hid_iap_class.h"
33#include "hid_iap_desc.h"
34#include "hid_iap_user.h"
35
44/* usb global struct define */
45 otg_core_type otg_core_struct;
46void usb_clock48m_select(usb_clk48_s clk_s);
47void usb_gpio_config(void);
48void usb_low_power_wakeup_config(void);
49
55int main(void)
56{
57 nvic_vector_table_set(NVIC_VECTTAB_FLASH, 0x5000);
58
59 system_clock_config();
60
61 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
62
63 /* iap init */
64 iap_init();
65
66 at32_board_init();
67
68 /* usb gpio config */
69 usb_gpio_config();
70
71#ifdef USB_LOW_POWER_WAKUP
72 usb_low_power_wakeup_config();
73#endif
74
75 /* enable otgfs clock */
76 crm_periph_clock_enable(OTG_CLOCK, TRUE);
77
78 /* select usb 48m clcok source */
79 usb_clock48m_select(USB_CLK_HEXT);
80
81 /* enable otgfs irq */
82 nvic_irq_enable(OTG_IRQ, 0, 0);
83
84 /* init usb */
85 usbd_init(&otg_core_struct,
86 USB_FULL_SPEED_CORE_ID,
87 USB_ID,
88 &hid_iap_class_handler,
89 &hid_iap_desc_handler);
90
91 while(1)
92 {
93 app_loop();
94 at32_led_toggle(LED3);
95 delay_ms(200);
96 }
97}
98
104void usb_clock48m_select(usb_clk48_s clk_s)
105{
106 switch(system_core_clock)
107 {
108 /* 48MHz */
109 case 48000000:
110 crm_usb_clock_div_set(CRM_USB_DIV_1);
111 break;
112
113 /* 72MHz */
114 case 72000000:
115 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
116 break;
117
118 /* 96MHz */
119 case 96000000:
120 crm_usb_clock_div_set(CRM_USB_DIV_2);
121 break;
122
123 /* 120MHz */
124 case 120000000:
125 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
126 break;
127
128 /* 144MHz */
129 case 144000000:
130 crm_usb_clock_div_set(CRM_USB_DIV_3);
131 break;
132
133 default:
134 break;
135
136 }
137}
138
144void usb_gpio_config(void)
145{
146 gpio_init_type gpio_init_struct;
147
148 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
149 gpio_default_para_init(&gpio_init_struct);
150
151 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
152 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
153 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
154 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
155
156#ifdef USB_SOF_OUTPUT_ENABLE
157 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
158 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
159 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
160#endif
161
162 /* otgfs use vbus pin */
163#ifndef USB_VBUS_IGNORE
164 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
165 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
166 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
167 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
168#endif
169
170
171}
172#ifdef USB_LOW_POWER_WAKUP
178void usb_low_power_wakeup_config(void)
179{
180 exint_init_type exint_init_struct;
181
182 crm_periph_clock_enable(CRM_SCFG_PERIPH_CLOCK, TRUE);
183 exint_default_para_init(&exint_init_struct);
184
185 exint_init_struct.line_enable = TRUE;
186 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
187 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
188 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
189 exint_init(&exint_init_struct);
190
191 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
192}
193
199void OTG_WKUP_HANDLER(void)
200{
201 exint_flag_clear(OTG_WKUP_EXINT_LINE);
202}
203
204#endif
205
211void OTG_IRQ_HANDLER(void)
212{
213 usbd_irq_handler(&otg_core_struct);
214}
215
221void usb_delay_ms(uint32_t ms)
222{
223 /* user can define self delay function */
224 delay_ms(ms);
225}
226
232void usb_delay_us(uint32_t us)
233{
234 delay_us(us);
235}
236
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
LED3
@ LED3
Definition: at32f415_board.h:64
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_vector_table_set
void nvic_vector_table_set(uint32_t base, uint32_t offset)
set the vector table location and offset.
Definition: at32f415_misc.c:112
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
NVIC_VECTTAB_FLASH
#define NVIC_VECTTAB_FLASH
Definition: at32f415_misc.h:52
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c:104
main
int main(void)
main function.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c:55
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c:144
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c:211
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb delay millisecond function.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c:221
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c:232
otg_core_struct
otg_core_type otg_core_struct
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led3_toggle/src/main.c:45
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
hid_iap_class_handler
usbd_class_handler hid_iap_class_handler
Definition: hid_iap_class.c:68
hid_iap_desc_handler
usbd_desc_handler hid_iap_desc_handler
hid device descriptor handler structure
Definition: hid_iap_desc.c:65
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
iap_init
void iap_init(void)
iap init.
Definition: app_led3_toggle/src/iap.c:61
app_loop
void app_loop(void)
iap loop
Definition: app_led3_toggle/src/hid_iap_user.c:253
hid_iap_class.h
usb hid iap header file
hid_iap_desc.h
usb hid iap descriptor header file
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_int.h
usb interrupt header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • inc
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • inc
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • inc
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • inc
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "at32f415_board.h"
38#include "stdio.h"
39
51#define USE_OTG_DEVICE_MODE
52
56/* #define USE_OTG_HOST_MODE */
57
58#define USB_ID 0
59#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
60#define OTG_IRQ OTGFS1_IRQn
61#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
62#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
63#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
64#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
65
66#define OTG_PIN_GPIO GPIOA
67#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
68#define OTG_PIN_VBUS GPIO_PINS_9
69#define OTG_PIN_ID GPIO_PINS_10
70
71#define OTG_PIN_SOF_GPIO GPIOA
72#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
73#define OTG_PIN_SOF GPIO_PINS_8
74
75
79#ifdef USE_OTG_DEVICE_MODE
83/* otg1 device fifo */
84#define USBD_RX_SIZE 128
85#define USBD_EP0_TX_SIZE 24
86#define USBD_EP1_TX_SIZE 20
87#define USBD_EP2_TX_SIZE 20
88#define USBD_EP3_TX_SIZE 20
92#ifndef USB_EPT_MAX_NUM
93#define USB_EPT_MAX_NUM 4
94#endif
95#endif
96
100#ifdef USE_OTG_HOST_MODE
101#ifndef USB_HOST_CHANNEL_NUM
102#define USB_HOST_CHANNEL_NUM 8
103#endif
104
108/* otg1 host fifo */
109#define USBH_RX_FIFO_SIZE 128
110#define USBH_NP_TX_FIFO_SIZE 96
111#define USBH_P_TX_FIFO_SIZE 96
112
113#endif
114
118/* #define USB_SOF_OUTPUT_ENABLE */
119
130/* #define USB_VBUS_IGNORE */
131
135/* #define USB_LOW_POWER_WAKUP */
136
137void usb_delay_ms(uint32_t ms);
138void usb_delay_us(uint32_t us);
139
147#ifdef __cplusplus
148}
149#endif
150
151#endif
at32f415.h
at32f415 header file
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • src
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_clock_config
void system_clock_config(void)
system clock config program
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_clock.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • src
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • app_led4_toggle
  • src
utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbd_int.h"
32#include "hid_iap_class.h"
33#include "hid_iap_desc.h"
34#include "hid_iap_user.h"
35
44/* usb global struct define */
45 otg_core_type otg_core_struct;
46void usb_clock48m_select(usb_clk48_s clk_s);
47void usb_gpio_config(void);
48void usb_low_power_wakeup_config(void);
49
55int main(void)
56{
57 nvic_vector_table_set(NVIC_VECTTAB_FLASH, 0x5000);
58
59 system_clock_config();
60
61 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
62
63 /* iap init */
64 iap_init();
65
66 at32_board_init();
67
68 /* usb gpio config */
69 usb_gpio_config();
70
71#ifdef USB_LOW_POWER_WAKUP
72 usb_low_power_wakeup_config();
73#endif
74
75 /* enable otgfs clock */
76 crm_periph_clock_enable(OTG_CLOCK, TRUE);
77
78 /* select usb 48m clcok source */
79 usb_clock48m_select(USB_CLK_HEXT);
80
81 /* enable otgfs irq */
82 nvic_irq_enable(OTG_IRQ, 0, 0);
83
84 /* init usb */
85 usbd_init(&otg_core_struct,
86 USB_FULL_SPEED_CORE_ID,
87 USB_ID,
88 &hid_iap_class_handler,
89 &hid_iap_desc_handler);
90
91 while(1)
92 {
93 app_loop();
94 at32_led_toggle(LED4);
95 delay_ms(200);
96 }
97}
98
104void usb_clock48m_select(usb_clk48_s clk_s)
105{
106 switch(system_core_clock)
107 {
108 /* 48MHz */
109 case 48000000:
110 crm_usb_clock_div_set(CRM_USB_DIV_1);
111 break;
112
113 /* 72MHz */
114 case 72000000:
115 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
116 break;
117
118 /* 96MHz */
119 case 96000000:
120 crm_usb_clock_div_set(CRM_USB_DIV_2);
121 break;
122
123 /* 120MHz */
124 case 120000000:
125 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
126 break;
127
128 /* 144MHz */
129 case 144000000:
130 crm_usb_clock_div_set(CRM_USB_DIV_3);
131 break;
132
133 default:
134 break;
135
136 }
137}
138
144void usb_gpio_config(void)
145{
146 gpio_init_type gpio_init_struct;
147
148 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
149 gpio_default_para_init(&gpio_init_struct);
150
151 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
152 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
153 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
154 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
155
156#ifdef USB_SOF_OUTPUT_ENABLE
157 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
158 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
159 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
160#endif
161
162 /* otgfs use vbus pin */
163#ifndef USB_VBUS_IGNORE
164 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
165 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
166 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
167 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
168#endif
169
170
171}
172#ifdef USB_LOW_POWER_WAKUP
178void usb_low_power_wakeup_config(void)
179{
180 exint_init_type exint_init_struct;
181
182 exint_default_para_init(&exint_init_struct);
183
184 exint_init_struct.line_enable = TRUE;
185 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
186 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
187 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
188 exint_init(&exint_init_struct);
189
190 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
191}
192
198void OTG_WKUP_HANDLER(void)
199{
200 exint_flag_clear(OTG_WKUP_EXINT_LINE);
201}
202
203#endif
204
210void OTG_IRQ_HANDLER(void)
211{
212 usbd_irq_handler(&otg_core_struct);
213}
214
220void usb_delay_ms(uint32_t ms)
221{
222 /* user can define self delay function */
223 delay_ms(ms);
224}
225
231void usb_delay_us(uint32_t us)
232{
233 delay_us(us);
234}
235
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
LED4
@ LED4
Definition: at32f415_board.h:65
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_vector_table_set
void nvic_vector_table_set(uint32_t base, uint32_t offset)
set the vector table location and offset.
Definition: at32f415_misc.c:112
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
NVIC_VECTTAB_FLASH
#define NVIC_VECTTAB_FLASH
Definition: at32f415_misc.h:52
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c:104
main
int main(void)
main function.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c:55
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c:144
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c:210
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb delay millisecond function.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c:220
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c:231
otg_core_struct
otg_core_type otg_core_struct
Definition: utilities/at32f415_usb_iap_demo/source_code/app_led4_toggle/src/main.c:45
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
hid_iap_class_handler
usbd_class_handler hid_iap_class_handler
Definition: hid_iap_class.c:68
hid_iap_desc_handler
usbd_desc_handler hid_iap_desc_handler
hid device descriptor handler structure
Definition: hid_iap_desc.c:65
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
iap_init
void iap_init(void)
iap init.
Definition: app_led3_toggle/src/iap.c:61
app_loop
void app_loop(void)
iap loop
Definition: app_led3_toggle/src/hid_iap_user.c:253
hid_iap_class.h
usb hid iap header file
hid_iap_desc.h
usb hid iap descriptor header file
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_int.h
usb interrupt header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_clock.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • inc
utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_clock.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CLOCK_H
29#define __AT32F415_CLOCK_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported functions ------------------------------------------------------- */
39void system_clock_config(void);
40
41#ifdef __cplusplus
42}
43#endif
44
45#endif /* __AT32F415_CLOCK_H */
46
at32f415.h
at32f415 header file
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48


AT32F415 Firmwary Library: at32f415_conf.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • inc
utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_CONF_H
29#define __AT32F415_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
41#if !defined HEXT_VALUE
42#define HEXT_VALUE ((uint32_t)8000000)
43#endif
44
49#define HEXT_STARTUP_TIMEOUT ((uint16_t)0x3000)
50#define HICK_VALUE ((uint32_t)8000000)
52/* module define -------------------------------------------------------------*/
53#define CRM_MODULE_ENABLED
54#define CMP_MODULE_ENABLED
55#define TMR_MODULE_ENABLED
56#define ERTC_MODULE_ENABLED
57#define GPIO_MODULE_ENABLED
58#define I2C_MODULE_ENABLED
59#define USART_MODULE_ENABLED
60#define PWC_MODULE_ENABLED
61#define CAN_MODULE_ENABLED
62#define ADC_MODULE_ENABLED
63#define SPI_MODULE_ENABLED
64#define DMA_MODULE_ENABLED
65#define DEBUG_MODULE_ENABLED
66#define FLASH_MODULE_ENABLED
67#define CRC_MODULE_ENABLED
68#define WWDT_MODULE_ENABLED
69#define WDT_MODULE_ENABLED
70#define EXINT_MODULE_ENABLED
71#define SDIO_MODULE_ENABLED
72#define USB_MODULE_ENABLED
73#define MISC_MODULE_ENABLED
74
75/* includes ------------------------------------------------------------------*/
76#ifdef CRM_MODULE_ENABLED
77#include "at32f415_crm.h"
78#endif
79#ifdef CMP_MODULE_ENABLED
80#include "at32f415_cmp.h"
81#endif
82#ifdef TMR_MODULE_ENABLED
83#include "at32f415_tmr.h"
84#endif
85#ifdef ERTC_MODULE_ENABLED
86#include "at32f415_ertc.h"
87#endif
88#ifdef GPIO_MODULE_ENABLED
89#include "at32f415_gpio.h"
90#endif
91#ifdef I2C_MODULE_ENABLED
92#include "at32f415_i2c.h"
93#endif
94#ifdef USART_MODULE_ENABLED
95#include "at32f415_usart.h"
96#endif
97#ifdef PWC_MODULE_ENABLED
98#include "at32f415_pwc.h"
99#endif
100#ifdef CAN_MODULE_ENABLED
101#include "at32f415_can.h"
102#endif
103#ifdef ADC_MODULE_ENABLED
104#include "at32f415_adc.h"
105#endif
106#ifdef SPI_MODULE_ENABLED
107#include "at32f415_spi.h"
108#endif
109#ifdef DMA_MODULE_ENABLED
110#include "at32f415_dma.h"
111#endif
112#ifdef DEBUG_MODULE_ENABLED
113#include "at32f415_debug.h"
114#endif
115#ifdef FLASH_MODULE_ENABLED
116#include "at32f415_flash.h"
117#endif
118#ifdef CRC_MODULE_ENABLED
119#include "at32f415_crc.h"
120#endif
121#ifdef WWDT_MODULE_ENABLED
122#include "at32f415_wwdt.h"
123#endif
124#ifdef WDT_MODULE_ENABLED
125#include "at32f415_wdt.h"
126#endif
127#ifdef EXINT_MODULE_ENABLED
128#include "at32f415_exint.h"
129#endif
130#ifdef SDIO_MODULE_ENABLED
131#include "at32f415_sdio.h"
132#endif
133#ifdef MISC_MODULE_ENABLED
134#include "at32f415_misc.h"
135#endif
136#ifdef USB_MODULE_ENABLED
137#include "at32f415_usb.h"
138#endif
139
140#ifdef __cplusplus
141}
142#endif
143
144#endif /* __AT32F415_CONF_H */
145
146
at32f415_adc.h
at32f415 adc header file
at32f415_can.h
at32f415 can header file
at32f415_cmp.h
at32f415 cmp header file
at32f415_crc.h
at32f415 crc header file
at32f415_crm.h
at32f415 crm header file
at32f415_debug.h
at32f415 debug header file
at32f415_dma.h
at32f415 dma header file
at32f415_ertc.h
at32f415 ertc header file
at32f415_exint.h
at32f415 exint header file
at32f415_flash.h
at32f415 flash header file
at32f415_gpio.h
at32f415 gpio header file
at32f415_i2c.h
at32f415 i2c header file
at32f415_misc.h
at32f415 misc header file
at32f415_pwc.h
at32f415 pwc header file
at32f415_sdio.h
at32f415 sdio header file
at32f415_spi.h
at32f415 spi header file
at32f415_tmr.h
at32f415 tmr header file
at32f415_usart.h
at32f415 usart header file
at32f415_usb.h
at32f415 usb header file
at32f415_wdt.h
at32f415 wdt header file
at32f415_wwdt.h
at32f415 wwdt header file


AT32F415 Firmwary Library: at32f415_int.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • inc
utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/at32f415_int.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __AT32F415_INT_H
29#define __AT32F415_INT_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* includes ------------------------------------------------------------------*/
36#include "at32f415.h"
37
38/* exported types ------------------------------------------------------------*/
39/* exported constants --------------------------------------------------------*/
40/* exported macro ------------------------------------------------------------*/
41/* exported functions ------------------------------------------------------- */
42
43void NMI_Handler(void);
44void HardFault_Handler(void);
45void MemManage_Handler(void);
46void BusFault_Handler(void);
47void UsageFault_Handler(void);
48void SVC_Handler(void);
49void DebugMon_Handler(void);
50void PendSV_Handler(void);
51void SysTick_Handler(void);
52
53#ifdef __cplusplus
54}
55#endif
56
57#endif
58
at32f415.h
at32f415 header file
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:93
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:54
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:67
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:106
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:124
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:45
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:80
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:133
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_int.c:115


AT32F415 Firmwary Library: usb_conf.h Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • inc
utilities/at32f415_usb_iap_demo/source_code/bootloader/inc/usb_conf.h
Go to the documentation of this file.
1
27/* define to prevent recursive inclusion -------------------------------------*/
28#ifndef __USB_CONF_H
29#define __USB_CONF_H
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35#include "at32f415_usb.h"
36#include "at32f415.h"
37#include "at32f415_board.h"
38#include "stdio.h"
39
51#define USE_OTG_DEVICE_MODE
52
56/* #define USE_OTG_HOST_MODE */
57
58#define USB_ID 0
59#define OTG_CLOCK CRM_OTGFS1_PERIPH_CLOCK
60#define OTG_IRQ OTGFS1_IRQn
61#define OTG_IRQ_HANDLER OTGFS1_IRQHandler
62#define OTG_WKUP_IRQ OTGFS1_WKUP_IRQn
63#define OTG_WKUP_HANDLER OTGFS1_WKUP_IRQHandler
64#define OTG_WKUP_EXINT_LINE EXINT_LINE_18
65
66#define OTG_PIN_GPIO GPIOA
67#define OTG_PIN_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
68#define OTG_PIN_VBUS GPIO_PINS_9
69#define OTG_PIN_ID GPIO_PINS_10
70
71#define OTG_PIN_SOF_GPIO GPIOA
72#define OTG_PIN_SOF_GPIO_CLOCK CRM_GPIOA_PERIPH_CLOCK
73#define OTG_PIN_SOF GPIO_PINS_8
74
75
76
80#ifdef USE_OTG_DEVICE_MODE
84/* otg1 device fifo */
85#define USBD_RX_SIZE 128
86#define USBD_EP0_TX_SIZE 24
87#define USBD_EP1_TX_SIZE 20
88#define USBD_EP2_TX_SIZE 20
89#define USBD_EP3_TX_SIZE 20
90
94#ifndef USB_EPT_MAX_NUM
95#define USB_EPT_MAX_NUM 4
96#endif
97#endif
98
102#ifdef USE_OTG_HOST_MODE
103#ifndef USB_HOST_CHANNEL_NUM
104#define USB_HOST_CHANNEL_NUM 8
105#endif
106
110/* otg1 host fifo */
111#define USBH_RX_FIFO_SIZE 128
112#define USBH_NP_TX_FIFO_SIZE 96
113#define USBH_P_TX_FIFO_SIZE 96
114#endif
115
119/* #define USB_SOF_OUTPUT_ENABLE */
120
131/* #define USB_VBUS_IGNORE */
132
136/* #define USB_LOW_POWER_WAKUP */
137
138void usb_delay_ms(uint32_t ms);
139void usb_delay_us(uint32_t us);
140
148#ifdef __cplusplus
149}
150#endif
151
152#endif
at32f415.h
at32f415 header file
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
at32f415_usb.h
at32f415 usb header file
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb endpoint max num define
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:219
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: project/at_start_f415/examples/usb_device/audio/src/main.c:230


AT32F415 Firmwary Library: at32f415_clock.c Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • src
utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_clock.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_clock.h"
29
48void system_clock_config(void)
49{
50 /* config flash psr register */
51 flash_psr_set(FLASH_WAIT_CYCLE_4);
52
53 /* reset crm */
54 crm_reset();
55
56 crm_clock_source_enable(CRM_CLOCK_SOURCE_HEXT, TRUE);
57
58 /* wait till hext is ready */
59 while(crm_hext_stable_wait() == ERROR)
60 {
61 }
62
63 /* config pll clock resource */
64 crm_pll_config(CRM_PLL_SOURCE_HEXT_DIV, CRM_PLL_MULT_36);
65
66 /* enable pll */
67 crm_clock_source_enable(CRM_CLOCK_SOURCE_PLL, TRUE);
68
69 /* wait till pll is ready */
70 while(crm_flag_get(CRM_PLL_STABLE_FLAG) != SET)
71 {
72 }
73
74 /* config ahbclk */
75 crm_ahb_div_set(CRM_AHB_DIV_1);
76
77 /* config apb2clk */
78 crm_apb2_div_set(CRM_APB2_DIV_2);
79
80 /* config apb1clk */
81 crm_apb1_div_set(CRM_APB1_DIV_2);
82
83 /* enable auto step mode */
84 crm_auto_step_mode_enable(TRUE);
85
86 /* select pll as system clock source */
87 crm_sysclk_switch(CRM_SCLK_PLL);
88
89 /* wait till pll is used as system clock source */
90 while(crm_sysclk_switch_status_get() != CRM_SCLK_PLL)
91 {
92 }
93
94 /* disable auto step mode */
95 crm_auto_step_mode_enable(FALSE);
96
97 /* update system_core_clock global variable */
98 system_core_clock_update();
99}
system_clock_config
void system_clock_config(void)
system clock config program
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_clock.c:48
system_core_clock_update
void system_core_clock_update(void)
update system_core_clock variable according to clock register values. the system_core_clock variable ...
Definition: system_at32f415.c:110
crm_flag_get
flag_status crm_flag_get(uint32_t flag)
get crm flag status
Definition: at32f415_crm.c:125
crm_hext_stable_wait
error_status crm_hext_stable_wait(void)
wait for hext stable
Definition: at32f415_crm.c:144
crm_ahb_div_set
void crm_ahb_div_set(crm_ahb_div_type value)
set crm ahb division
Definition: at32f415_crm.c:407
crm_sysclk_switch_status_get
crm_sclk_type crm_sysclk_switch_status_get(void)
indicate which clock source is used as system clock
Definition: at32f415_crm.c:655
crm_clock_source_enable
void crm_clock_source_enable(crm_clock_source_type source, confirm_state new_state)
enable or disable the crm clock source
Definition: at32f415_crm.c:289
crm_apb2_div_set
void crm_apb2_div_set(crm_apb2_div_type value)
set crm apb2 division
Definition: at32f415_crm.c:439
crm_apb1_div_set
void crm_apb1_div_set(crm_apb1_div_type value)
set crm apb1 division
Definition: at32f415_crm.c:423
crm_pll_config
void crm_pll_config(crm_pll_clock_source_type clock_source, crm_pll_mult_type mult_value)
config crm pll
Definition: at32f415_crm.c:511
crm_auto_step_mode_enable
void crm_auto_step_mode_enable(confirm_state new_state)
auto step clock switch enable
Definition: at32f415_crm.c:834
crm_reset
void crm_reset(void)
reset the crm register
Definition: at32f415_crm.c:49
crm_sysclk_switch
void crm_sysclk_switch(crm_sclk_type value)
select system clock source
Definition: at32f415_crm.c:641
CRM_APB1_DIV_2
@ CRM_APB1_DIV_2
Definition: at32f415_crm.h:332
CRM_CLOCK_SOURCE_PLL
@ CRM_CLOCK_SOURCE_PLL
Definition: at32f415_crm.h:305
CRM_CLOCK_SOURCE_HEXT
@ CRM_CLOCK_SOURCE_HEXT
Definition: at32f415_crm.h:304
CRM_PLL_SOURCE_HEXT_DIV
@ CRM_PLL_SOURCE_HEXT_DIV
Definition: at32f415_crm.h:282
CRM_PLL_MULT_36
@ CRM_PLL_MULT_36
Definition: at32f415_crm.h:231
CRM_AHB_DIV_1
@ CRM_AHB_DIV_1
Definition: at32f415_crm.h:315
CRM_SCLK_PLL
@ CRM_SCLK_PLL
Definition: at32f415_crm.h:404
CRM_APB2_DIV_2
@ CRM_APB2_DIV_2
Definition: at32f415_crm.h:344
CRM_PLL_STABLE_FLAG
#define CRM_PLL_STABLE_FLAG
Definition: at32f415_crm.h:57
ERROR
@ ERROR
Definition: at32f415.h:258
FALSE
@ FALSE
Definition: at32f415.h:253
TRUE
@ TRUE
Definition: at32f415.h:253
SET
@ SET
Definition: at32f415.h:248
FLASH_WAIT_CYCLE_4
@ FLASH_WAIT_CYCLE_4
Definition: at32f415_flash.h:171
flash_psr_set
#define flash_psr_set(wtcyc)
set the flash psr register
Definition: at32f415_flash.h:144
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: at32f415_int.c Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • src
utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c
Go to the documentation of this file.
1
27/* includes ------------------------------------------------------------------*/
28#include "at32f415_int.h"
29
43void NMI_Handler(void)
44{
45}
46
52void HardFault_Handler(void)
53{
54 /* go to infinite loop when hard fault exception occurs */
55 while(1)
56 {
57 }
58}
59
65void MemManage_Handler(void)
66{
67 /* go to infinite loop when memory manage exception occurs */
68 while(1)
69 {
70 }
71}
72
78void BusFault_Handler(void)
79{
80 /* go to infinite loop when bus fault exception occurs */
81 while(1)
82 {
83 }
84}
85
91void UsageFault_Handler(void)
92{
93 /* go to infinite loop when usage fault exception occurs */
94 while(1)
95 {
96 }
97}
98
104void SVC_Handler(void)
105{
106}
107
113void DebugMon_Handler(void)
114{
115}
116
122void PendSV_Handler(void)
123{
124}
125
131void SysTick_Handler(void)
132{
133}
134
UsageFault_Handler
void UsageFault_Handler(void)
this function handles usage fault exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c:91
HardFault_Handler
void HardFault_Handler(void)
this function handles hard fault exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c:52
MemManage_Handler
void MemManage_Handler(void)
this function handles memory manage exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c:65
SVC_Handler
void SVC_Handler(void)
this function handles svcall exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c:104
PendSV_Handler
void PendSV_Handler(void)
this function handles pendsv_handler exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c:122
NMI_Handler
void NMI_Handler(void)
this function handles nmi exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c:43
BusFault_Handler
void BusFault_Handler(void)
this function handles bus fault exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c:78
SysTick_Handler
void SysTick_Handler(void)
this function handles systick handler.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c:131
DebugMon_Handler
void DebugMon_Handler(void)
this function handles debug monitor exception.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/at32f415_int.c:113
at32f415_int.h
header file of main interrupt service routines.


AT32F415 Firmwary Library: main.c Source File

  • utilities
  • at32f415_usb_iap_demo
  • source_code
  • bootloader
  • src
utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c
Go to the documentation of this file.
1
27#include "at32f415_board.h"
28#include "at32f415_clock.h"
29#include "usb_conf.h"
30#include "usb_core.h"
31#include "usbd_int.h"
32#include "hid_iap_class.h"
33#include "hid_iap_desc.h"
34#include "hid_iap_user.h"
35
44/* usb global struct define */
45 otg_core_type otg_core_struct;
46void usb_clock48m_select(usb_clk48_s clk_s);
47void usb_gpio_config(void);
48void usb_low_power_wakeup_config(void);
49
55int main(void)
56{
57 system_clock_config();
58
59 nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);
60
61 iap_init();
62
63 if(iap_get_upgrade_flag() == IAP_SUCCESS)
64 {
65 jump_to_app(FLASH_APP_ADDRESS);
66 }
67
68 at32_board_init();
69
70 /* usb gpio config */
71 usb_gpio_config();
72
73#ifdef USB_LOW_POWER_WAKUP
74 usb_low_power_wakeup_config();
75#endif
76
77 /* enable otgfs clock */
78 crm_periph_clock_enable(OTG_CLOCK, TRUE);
79
80 /* select usb 48m clcok source */
81 usb_clock48m_select(USB_CLK_HEXT);
82
83 /* enable otgfs irq */
84 nvic_irq_enable(OTG_IRQ, 0, 0);
85
86 /* init usb */
87 usbd_init(&otg_core_struct,
88 USB_FULL_SPEED_CORE_ID,
89 USB_ID,
90 &hid_iap_class_handler,
91 &hid_iap_desc_handler);
92
93 while(1)
94 {
95 iap_loop();
96 at32_led_toggle(LED2);
97 delay_ms(200);
98 }
99}
100
106void usb_clock48m_select(usb_clk48_s clk_s)
107{
108 switch(system_core_clock)
109 {
110 /* 48MHz */
111 case 48000000:
112 crm_usb_clock_div_set(CRM_USB_DIV_1);
113 break;
114
115 /* 72MHz */
116 case 72000000:
117 crm_usb_clock_div_set(CRM_USB_DIV_1_5);
118 break;
119
120 /* 96MHz */
121 case 96000000:
122 crm_usb_clock_div_set(CRM_USB_DIV_2);
123 break;
124
125 /* 120MHz */
126 case 120000000:
127 crm_usb_clock_div_set(CRM_USB_DIV_2_5);
128 break;
129
130 /* 144MHz */
131 case 144000000:
132 crm_usb_clock_div_set(CRM_USB_DIV_3);
133 break;
134
135 default:
136 break;
137
138 }
139}
140
146void usb_gpio_config(void)
147{
148 gpio_init_type gpio_init_struct;
149
150 crm_periph_clock_enable(OTG_PIN_GPIO_CLOCK, TRUE);
151 gpio_default_para_init(&gpio_init_struct);
152
153 gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
154 gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
155 gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
156 gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
157
158
159#ifdef USB_SOF_OUTPUT_ENABLE
160 crm_periph_clock_enable(OTG_PIN_SOF_GPIO_CLOCK, TRUE);
161 gpio_init_struct.gpio_pins = OTG_PIN_SOF;
162 gpio_init(OTG_PIN_SOF_GPIO, &gpio_init_struct);
163 gpio_pin_mux_config(OTG_PIN_GPIO, OTG_PIN_SOF_SOURCE, OTG_PIN_MUX);
164#endif
165
166 /* otgfs use vbus pin */
167#ifndef USB_VBUS_IGNORE
168 gpio_init_struct.gpio_pins = OTG_PIN_VBUS;
169 gpio_init_struct.gpio_pull = GPIO_PULL_UP;
170 gpio_init_struct.gpio_mode = GPIO_MODE_INPUT;
171 gpio_init(OTG_PIN_GPIO, &gpio_init_struct);
172#endif
173
174
175}
176#ifdef USB_LOW_POWER_WAKUP
182void usb_low_power_wakeup_config(void)
183{
184 exint_init_type exint_init_struct;
185
186 exint_default_para_init(&exint_init_struct);
187
188 exint_init_struct.line_enable = TRUE;
189 exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;
190 exint_init_struct.line_select = OTG_WKUP_EXINT_LINE;
191 exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;
192 exint_init(&exint_init_struct);
193
194 nvic_irq_enable(OTG_WKUP_IRQ, 0, 0);
195}
196
202void OTG_WKUP_HANDLER(void)
203{
204 exint_flag_clear(OTG_WKUP_EXINT_LINE);
205}
206
207#endif
208
214void OTG_IRQ_HANDLER(void)
215{
216 usbd_irq_handler(&otg_core_struct);
217}
218
224void usb_delay_ms(uint32_t ms)
225{
226 /* user can define self delay function */
227 delay_ms(ms);
228}
229
235void usb_delay_us(uint32_t us)
236{
237 delay_us(us);
238}
239
at32f415_board.h
header file for at-start board. set of firmware functions to manage leds and push-button....
gpio_init_struct
gpio_init_type gpio_init_struct
Definition: project/at_start_f415/examples/cmp/deep_sleep_mode/src/main.c:38
system_clock_config
void system_clock_config(void)
system clock config program
Definition: project/at_start_f415/examples/adc/current_vref_value_check/src/at32f415_clock.c:48
OTG_PIN_VBUS
#define OTG_PIN_VBUS
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:68
OTG_PIN_SOF
#define OTG_PIN_SOF
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:73
OTG_WKUP_IRQ
#define OTG_WKUP_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:62
OTG_PIN_GPIO
#define OTG_PIN_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:66
OTG_IRQ
#define OTG_IRQ
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:60
OTG_PIN_SOF_GPIO
#define OTG_PIN_SOF_GPIO
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:71
OTG_WKUP_HANDLER
#define OTG_WKUP_HANDLER
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:63
OTG_CLOCK
#define OTG_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:59
OTG_PIN_GPIO_CLOCK
#define OTG_PIN_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:67
USB_ID
#define USB_ID
enable usb host mode
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:58
OTG_WKUP_EXINT_LINE
#define OTG_WKUP_EXINT_LINE
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:64
OTG_PIN_SOF_GPIO_CLOCK
#define OTG_PIN_SOF_GPIO_CLOCK
Definition: project/at_start_f415/examples/usb_device/audio/inc/usb_conf.h:72
jump_to_app
iapfun jump_to_app
jump to app
Definition: bootloader/src/iap.c:46
system_core_clock
unsigned int system_core_clock
Definition: system_at32f415.c:48
LED2
@ LED2
Definition: at32f415_board.h:63
delay_ms
void delay_ms(uint16_t nms)
inserts a delay time.
Definition: at32f415_board.c:324
at32_led_toggle
void at32_led_toggle(led_type led)
turns selected led tooggle.
Definition: at32f415_board.c:278
at32_board_init
void at32_board_init()
board initialize interface init led and button
Definition: at32f415_board.c:136
delay_us
void delay_us(uint32_t nus)
inserts a delay time.
Definition: at32f415_board.c:304
crm_usb_clock_div_set
void crm_usb_clock_div_set(crm_usb_div_type div_value)
set crm usb division
Definition: at32f415_crm.c:475
crm_periph_clock_enable
void crm_periph_clock_enable(crm_periph_clock_type value, confirm_state new_state)
enable or disable the peripheral clock
Definition: at32f415_crm.c:210
CRM_USB_DIV_3
@ CRM_USB_DIV_3
Definition: at32f415_crm.h:373
CRM_USB_DIV_1_5
@ CRM_USB_DIV_1_5
Definition: at32f415_crm.h:368
CRM_USB_DIV_2
@ CRM_USB_DIV_2
Definition: at32f415_crm.h:371
CRM_USB_DIV_1
@ CRM_USB_DIV_1
Definition: at32f415_crm.h:369
CRM_USB_DIV_2_5
@ CRM_USB_DIV_2_5
Definition: at32f415_crm.h:370
exint_flag_clear
void exint_flag_clear(uint32_t exint_line)
clear exint flag
Definition: at32f415_exint.c:126
exint_default_para_init
void exint_default_para_init(exint_init_type *exint_struct)
exint default para init
Definition: at32f415_exint.c:64
exint_init
void exint_init(exint_init_type *exint_struct)
exint init
Definition: at32f415_exint.c:78
EXINT_LINE_INTERRUPUT
@ EXINT_LINE_INTERRUPUT
Definition: at32f415_exint.h:89
EXINT_TRIGGER_RISING_EDGE
@ EXINT_TRIGGER_RISING_EDGE
Definition: at32f415_exint.h:98
TRUE
@ TRUE
Definition: at32f415.h:253
gpio_init
void gpio_init(gpio_type *gpio_x, gpio_init_type *gpio_init_struct)
initialize the gpio peripheral.
Definition: at32f415_gpio.c:100
gpio_default_para_init
void gpio_default_para_init(gpio_init_type *gpio_init_struct)
fill each gpio_init_type member with its default value.
Definition: at32f415_gpio.c:168
GPIO_MODE_MUX
@ GPIO_MODE_MUX
Definition: at32f415_gpio.h:230
GPIO_MODE_INPUT
@ GPIO_MODE_INPUT
Definition: at32f415_gpio.h:228
GPIO_DRIVE_STRENGTH_STRONGER
@ GPIO_DRIVE_STRENGTH_STRONGER
Definition: at32f415_gpio.h:239
GPIO_PULL_NONE
@ GPIO_PULL_NONE
Definition: at32f415_gpio.h:258
GPIO_PULL_UP
@ GPIO_PULL_UP
Definition: at32f415_gpio.h:259
GPIO_OUTPUT_PUSH_PULL
@ GPIO_OUTPUT_PUSH_PULL
Definition: at32f415_gpio.h:249
nvic_irq_enable
void nvic_irq_enable(uint32_t irqn, uint32_t preempt_priority, uint32_t sub_priority)
enable nvic irq
Definition: at32f415_misc.c:64
nvic_priority_group_config
void nvic_priority_group_config(nvic_priority_group_type priority_group)
config nvic priority group
Definition: at32f415_misc.c:97
NVIC_PRIORITY_GROUP_4
@ NVIC_PRIORITY_GROUP_4
Definition: at32f415_misc.h:71
usb_clock48m_select
void usb_clock48m_select(usb_clk48_s clk_s)
usb 48M clock select
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c:106
main
int main(void)
main function.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c:55
usb_low_power_wakeup_config
void usb_low_power_wakeup_config(void)
usb_gpio_config
void usb_gpio_config(void)
this function config gpio.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c:146
OTG_IRQ_HANDLER
void OTG_IRQ_HANDLER(void)
this function handles otgfs interrupt.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c:214
usb_delay_ms
void usb_delay_ms(uint32_t ms)
usb delay millisecond function.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c:224
usb_delay_us
void usb_delay_us(uint32_t us)
usb delay microsecond function.
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c:235
otg_core_struct
otg_core_type otg_core_struct
Definition: utilities/at32f415_usb_iap_demo/source_code/bootloader/src/main.c:45
USB_FULL_SPEED_CORE_ID
@ USB_FULL_SPEED_CORE_ID
Definition: usb_core.h:64
usb_clk48_s
usb_clk48_s
usb clock select
Definition: at32f415_usb.h:402
USB_CLK_HEXT
@ USB_CLK_HEXT
Definition: at32f415_usb.h:404
IAP_SUCCESS
@ IAP_SUCCESS
Definition: hid_iap_class.h:99
hid_iap_class_handler
usbd_class_handler hid_iap_class_handler
Definition: hid_iap_class.c:68
hid_iap_desc_handler
usbd_desc_handler hid_iap_desc_handler
hid device descriptor handler structure
Definition: hid_iap_desc.c:65
usbd_irq_handler
void usbd_irq_handler(otg_core_type *udev)
usb device interrput request handler.
Definition: usbd_int.c:46
iap_init
void iap_init(void)
iap init.
Definition: app_led3_toggle/src/iap.c:61
FLASH_APP_ADDRESS
#define FLASH_APP_ADDRESS
Definition: app_led3_toggle/inc/hid_iap_user.h:49
iap_get_upgrade_flag
iap_result_type iap_get_upgrade_flag(void)
get iap upgrade complete flag
Definition: app_led3_toggle/src/hid_iap_user.c:79
iap_loop
void iap_loop(void)
iap loop
Definition: bootloader/src/hid_iap_user.c:476
hid_iap_class.h
usb hid iap header file
hid_iap_desc.h
usb hid iap descriptor header file
exint_init_type
exint init type
Definition: at32f415_exint.h:107
exint_init_type::line_select
uint32_t line_select
Definition: at32f415_exint.h:109
exint_init_type::line_enable
confirm_state line_enable
Definition: at32f415_exint.h:111
exint_init_type::line_mode
exint_line_mode_type line_mode
Definition: at32f415_exint.h:108
exint_init_type::line_polarity
exint_polarity_config_type line_polarity
Definition: at32f415_exint.h:110
gpio_init_type
gpio init type
Definition: at32f415_gpio.h:302
gpio_init_type::gpio_out_type
gpio_output_type gpio_out_type
Definition: at32f415_gpio.h:304
gpio_init_type::gpio_pull
gpio_pull_type gpio_pull
Definition: at32f415_gpio.h:305
gpio_init_type::gpio_drive_strength
gpio_drive_type gpio_drive_strength
Definition: at32f415_gpio.h:307
gpio_init_type::gpio_mode
gpio_mode_type gpio_mode
Definition: at32f415_gpio.h:306
gpio_init_type::gpio_pins
uint32_t gpio_pins
Definition: at32f415_gpio.h:303
otg_core_type
usb otg core struct type
Definition: usb_core.h:101
usb_core.h
usb core header file
usbd_int.h
usb interrupt header file
at32f415_clock.h
header file of clock program


AT32F415 Firmwary Library: msc_diskio.h Source File

  • usb_device
  • virtual_msc_iap
  • inc
virtual_msc_iap/inc/msc_diskio.h
Go to the documentation of this file.
1
26/* Define to prevent recursive inclusion -------------------------------------*/
27#ifndef __MSC_DISKIO_H
28#define __MSC_DISKIO_H
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34
35#include "usb_conf.h"
36#include "usb_std.h"
37
45#define INTERNAL_FLASH_LUN 0
46#define SPI_FLASH_LUN 1
47#define SD_LUN 2
48
49#define USB_FLASH_ADDR_OFFSET 0x08004000
50
51uint8_t *get_inquiry(uint8_t lun);
52 usb_sts_type msc_disk_read(uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len);
53 usb_sts_type msc_disk_write(uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len);
54 usb_sts_type msc_disk_capacity(uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size);
55
64#ifdef __cplusplus
65}
66#endif
67
68#endif
69
70
msc_disk_write
usb_sts_type msc_disk_write(uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len)
disk write
Definition: virtual_msc_iap/src/msc_diskio.c:97
msc_disk_read
usb_sts_type msc_disk_read(uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len)
disk read
Definition: virtual_msc_iap/src/msc_diskio.c:75
msc_disk_capacity
usb_sts_type msc_disk_capacity(uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size)
disk capacity
Definition: virtual_msc_iap/src/msc_diskio.c:117
get_inquiry
uint8_t * get_inquiry(uint8_t lun)
get disk inquiry
Definition: virtual_msc_iap/src/msc_diskio.c:59
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
usb_std.h
usb standard header file
usb_conf.h
usb config header file


AT32F415 Firmwary Library: msc_diskio.c Source File

  • usb_device
  • virtual_msc_iap
  • src
virtual_msc_iap/src/msc_diskio.c
Go to the documentation of this file.
1
26#include "msc_diskio.h"
27#include "msc_bot_scsi.h"
28#include "flash_fat16.h"
29
38uint8_t scsi_inquiry[MSC_SUPPORT_MAX_LUN][SCSI_INQUIRY_DATA_LENGTH] =
39{
40 /* lun = 0 */
41 {
42 0x00, /* peripheral device type (direct-access device) */
43 0x80, /* removable media bit */
44 0x00, /* ansi version, ecma version, iso version */
45 0x01, /* respond data format */
46 SCSI_INQUIRY_DATA_LENGTH - 5, /* additional length */
47 0x00, 0x00, 0x00, /* reserved */
48 'A', 'T', '3', '2', ' ', ' ', ' ', ' ', /* vendor information "AT32" */
49 'M', 's', 'c', ' ', 'i', 'a', 'p', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', /* Product identification "Disk" */
50 '2', '.', '0', '0' /* product revision level */
51 },
52};
53
59uint8_t *get_inquiry(uint8_t lun)
60{
61 if(lun < MSC_SUPPORT_MAX_LUN)
62 return (uint8_t *)scsi_inquiry[lun];
63 else
64 return NULL;
65}
66
75 usb_sts_type msc_disk_read(uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len)
76{
77
78 switch(lun)
79 {
80 case 0:
81 flash_fat16_read(addr, read_buf, len);
82 break;
83 case 1:
84 break;
85 }
86 return USB_OK;
87}
88
97 usb_sts_type msc_disk_write(uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len)
98{
99 switch(lun)
100 {
101 case 0:
102 flash_fat16_write(addr, buf, len);
103 break;
104 case 1:
105 break;
106 }
107 return USB_OK;
108}
109
117 usb_sts_type msc_disk_capacity(uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size)
118{
119 switch(lun)
120 {
121 case INTERNAL_FLASH_LUN:
122 *blk_nbr = (100*1024*1024 / FLASH_SECTOR_2K_SIZE);
123 *blk_size = flash_iap.sector_size;
124 break;
125 case SPI_FLASH_LUN:
126 break;
127 case SD_LUN:
128 break;
129 default:
130 break;
131 }
132 return USB_OK;
133}
134
flash_fat16.h
fat16 file system header file
msc_disk_write
usb_sts_type msc_disk_write(uint8_t lun, uint32_t addr, uint8_t *buf, uint32_t len)
disk write
Definition: msc/src/msc_diskio.c:106
msc_disk_read
usb_sts_type msc_disk_read(uint8_t lun, uint32_t addr, uint8_t *read_buf, uint32_t len)
disk read
Definition: msc/src/msc_diskio.c:75
INTERNAL_FLASH_LUN
#define INTERNAL_FLASH_LUN
Definition: msc/inc/msc_diskio.h:45
msc_disk_capacity
usb_sts_type msc_disk_capacity(uint8_t lun, uint32_t *blk_nbr, uint32_t *blk_size)
disk capacity
Definition: msc/src/msc_diskio.c:144
SD_LUN
#define SD_LUN
Definition: msc/inc/msc_diskio.h:47
SPI_FLASH_LUN
#define SPI_FLASH_LUN
Definition: msc/inc/msc_diskio.h:46
get_inquiry
uint8_t * get_inquiry(uint8_t lun)
get disk inquiry
Definition: msc/src/msc_diskio.c:59
scsi_inquiry
uint8_t scsi_inquiry[MSC_SUPPORT_MAX_LUN][SCSI_INQUIRY_DATA_LENGTH]
Definition: virtual_msc_iap/src/msc_diskio.c:38
NULL
#define NULL
Definition: sd_mmc_card/inc/at32_sdio.h:339
FLASH_SECTOR_2K_SIZE
#define FLASH_SECTOR_2K_SIZE
Definition: flash_fat16.h:63
flash_iap
flash_iap_type flash_iap
Definition: flash_fat16.c:145
flash_fat16_write
uint32_t flash_fat16_write(uint32_t fat_lbk, uint8_t *data, uint32_t len)
write a logical block address
Definition: flash_fat16.c:308
flash_fat16_read
uint32_t flash_fat16_read(uint32_t fat_lbk, uint8_t *data, uint32_t len)
read a logical block address
Definition: flash_fat16.c:269
SCSI_INQUIRY_DATA_LENGTH
#define SCSI_INQUIRY_DATA_LENGTH
Definition: msc_bot_scsi.h:123
MSC_SUPPORT_MAX_LUN
#define MSC_SUPPORT_MAX_LUN
Definition: msc_bot_scsi.h:49
usb_sts_type
usb_sts_type
usb return status
Definition: usb_std.h:217
USB_OK
@ USB_OK
Definition: usb_std.h:218
msc_bot_scsi.h
usb mass storage bulk-only transport and scsi command header file
flash_iap_type::sector_size
uint32_t sector_size
Definition: flash_fat16.h:114